plass-ui 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +962 -0
- package/README.md +19 -17
- package/dist/components/accordion/PlAccordion.d.ts +1 -1
- package/dist/components/alert/PlAlert.js +1 -1
- package/dist/components/anchor/PlAnchor.d.ts +85 -0
- package/dist/components/anchor/PlAnchor.js +1 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.js +1 -0
- package/dist/components/animate-appear/PlAnimateAppear.d.ts +10 -0
- package/dist/components/animate-appear/PlAnimateAppear.js +1 -1
- package/dist/components/animate-blink/PlAnimateBlink.d.ts +2 -2
- package/dist/components/animate-blink/PlAnimateBlink.js +1 -1
- package/dist/components/animate-counter/PlAnimateCounter.d.ts +83 -0
- package/dist/components/animate-counter/PlAnimateCounter.js +1 -0
- package/dist/components/animate-counter/index.d.ts +2 -0
- package/dist/components/animate-counter/index.js +1 -0
- package/dist/components/animate-fade/PlAnimateFade.d.ts +2 -2
- package/dist/components/animate-fade/PlAnimateFade.js +1 -1
- package/dist/components/animate-float/PlAnimateFloat.d.ts +51 -0
- package/dist/components/animate-float/PlAnimateFloat.js +1 -0
- package/dist/components/animate-float/index.d.ts +2 -0
- package/dist/components/animate-float/index.js +1 -0
- package/dist/components/animate-grow/PlAnimateGrow.d.ts +2 -2
- package/dist/components/animate-grow/PlAnimateGrow.js +1 -1
- package/dist/components/animate-headline/PlAnimateHeadline.js +1 -1
- package/dist/components/animate-lighting/PlAnimateLighting.js +1 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +13 -4
- package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
- package/dist/components/animate-reveal/PlAnimateReveal.d.ts +51 -0
- package/dist/components/animate-reveal/PlAnimateReveal.js +1 -0
- package/dist/components/animate-reveal/index.d.ts +2 -0
- package/dist/components/animate-reveal/index.js +1 -0
- package/dist/components/animate-rotate/PlAnimateRotate.d.ts +2 -2
- package/dist/components/animate-rotate/PlAnimateRotate.js +1 -1
- package/dist/components/animate-scramble/PlAnimateScramble.d.ts +75 -0
- package/dist/components/animate-scramble/PlAnimateScramble.js +1 -0
- package/dist/components/animate-scramble/index.d.ts +2 -0
- package/dist/components/animate-scramble/index.js +1 -0
- package/dist/components/animate-shake/PlAnimateShake.d.ts +57 -0
- package/dist/components/animate-shake/PlAnimateShake.js +1 -0
- package/dist/components/animate-shake/index.d.ts +2 -0
- package/dist/components/animate-shake/index.js +1 -0
- package/dist/components/animate-slide/PlAnimateSlide.d.ts +2 -2
- package/dist/components/animate-slide/PlAnimateSlide.js +1 -1
- package/dist/components/animate-split/PlAnimateSplit.d.ts +57 -0
- package/dist/components/animate-split/PlAnimateSplit.js +1 -0
- package/dist/components/animate-split/index.d.ts +2 -0
- package/dist/components/animate-split/index.js +1 -0
- package/dist/components/animate-typing/PlAnimateTyping.d.ts +3 -2
- package/dist/components/animate-typing/PlAnimateTyping.js +1 -1
- package/dist/components/animate-zoom/PlAnimateZoom.d.ts +2 -2
- package/dist/components/animate-zoom/PlAnimateZoom.js +1 -1
- package/dist/components/app-logo/PlAppLogo.d.ts +78 -0
- package/dist/components/app-logo/PlAppLogo.js +1 -0
- package/dist/components/app-logo/index.d.ts +2 -0
- package/dist/components/app-logo/index.js +1 -0
- package/dist/components/area-chart/PlAreaChart.d.ts +54 -0
- package/dist/components/area-chart/PlAreaChart.js +1 -0
- package/dist/components/area-chart/index.d.ts +2 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/aspect-ratio/PlAspectRatio.d.ts +2 -1
- package/dist/components/aspect-ratio/PlAspectRatio.js +1 -1
- package/dist/components/avatar/PlAvatar.js +1 -1
- package/dist/components/back-top/PlBackTop.d.ts +2 -1
- package/dist/components/back-top/PlBackTop.js +1 -1
- package/dist/components/badge/PlBadge.js +1 -1
- package/dist/components/bar-chart/PlBarChart.d.ts +63 -0
- package/dist/components/bar-chart/PlBarChart.js +1 -0
- package/dist/components/bar-chart/index.d.ts +2 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/bottom-navigation/PlBottomNavigation.d.ts +3 -0
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button/PlButton.d.ts +8 -0
- package/dist/components/button/PlButton.js +1 -1
- package/dist/components/button-group/PlButtonGroup.js +1 -1
- package/dist/components/calendar/PlCalendar.js +1 -1
- package/dist/components/card/PlCard.js +1 -1
- package/dist/components/carousel/PlCarousel.d.ts +1 -1
- package/dist/components/carousel/PlCarousel.js +1 -1
- package/dist/components/chat-bubble/PlChatBubble.d.ts +4 -1
- package/dist/components/chat-bubble/PlChatBubble.js +1 -1
- package/dist/components/checkbox/PlCheckbox.js +1 -1
- package/dist/components/chip/PlChip.d.ts +6 -2
- package/dist/components/chip/PlChip.js +1 -1
- package/dist/components/code-block/PlCodeBlock.d.ts +192 -0
- package/dist/components/code-block/PlCodeBlock.js +1 -0
- package/dist/components/code-block/index.d.ts +2 -0
- package/dist/components/code-block/index.js +1 -0
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +6 -5
- package/dist/components/combobox/PlCombobox.js +1 -1
- package/dist/components/command-palette/PlCommandPalette.d.ts +6 -2
- package/dist/components/command-palette/PlCommandPalette.js +1 -1
- package/dist/components/confirm/PlConfirmProvider.js +1 -1
- package/dist/components/container/PlContainer.d.ts +22 -6
- package/dist/components/container/PlContainer.js +1 -1
- package/dist/components/data-list/PlDataList.d.ts +74 -0
- package/dist/components/data-list/PlDataList.js +1 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.js +1 -0
- package/dist/components/data-table/PlDataTable.d.ts +216 -0
- package/dist/components/data-table/PlDataTable.js +1 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.js +1 -0
- package/dist/components/date-picker/PlDatePicker.js +1 -1
- package/dist/components/date-range-picker/PlDateRangePicker.js +1 -1
- package/dist/components/date-time-picker/PlDateTimePicker.js +1 -1
- package/dist/components/drawer/PlDrawer.d.ts +1 -1
- package/dist/components/drawer/PlDrawer.js +1 -1
- package/dist/components/file-picker/PlFilePicker.d.ts +4 -1
- package/dist/components/file-picker/PlFilePicker.js +1 -1
- package/dist/components/flex/PlFlex.d.ts +83 -0
- package/dist/components/flex/PlFlex.js +1 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +1 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +81 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -0
- package/dist/components/floating-action-button/index.d.ts +2 -0
- package/dist/components/floating-action-button/index.js +1 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.d.ts +3 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +1 -1
- package/dist/components/footer/PlFooter.d.ts +4 -3
- package/dist/components/footer/PlFooter.js +1 -1
- package/dist/components/form/PlForm.js +1 -1
- package/dist/components/gallery/PlGallery.d.ts +192 -0
- package/dist/components/gallery/PlGallery.js +1 -0
- package/dist/components/gallery/PlGalleryViewer.d.ts +31 -0
- package/dist/components/gallery/PlGalleryViewer.js +1 -0
- package/dist/components/gallery/index.d.ts +2 -0
- package/dist/components/gallery/index.js +1 -0
- package/dist/components/gauge-chart/PlGaugeChart.d.ts +64 -0
- package/dist/components/gauge-chart/PlGaugeChart.js +1 -0
- package/dist/components/gauge-chart/index.d.ts +2 -0
- package/dist/components/gauge-chart/index.js +1 -0
- package/dist/components/grid/PlGrid.js +1 -1
- package/dist/components/grid/PlGridItem.js +1 -1
- package/dist/components/header/PlHeader.d.ts +4 -3
- package/dist/components/header/PlHeader.js +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.d.ts +69 -0
- package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -0
- package/dist/components/heatmap-chart/index.d.ts +2 -0
- package/dist/components/heatmap-chart/index.js +1 -0
- package/dist/components/highlight/PlHighlight.js +1 -1
- package/dist/components/hot-keys/PlHotKeys.js +1 -1
- package/dist/components/hover-card/PlHoverCard.d.ts +96 -0
- package/dist/components/hover-card/PlHoverCard.js +1 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/how-to-steps/PlHowToSteps.d.ts +87 -0
- package/dist/components/how-to-steps/PlHowToSteps.js +1 -0
- package/dist/components/how-to-steps/index.d.ts +2 -0
- package/dist/components/how-to-steps/index.js +1 -0
- package/dist/components/image/PlImage.d.ts +195 -8
- package/dist/components/image/PlImage.js +1 -1
- package/dist/components/image/PlImagePreview.d.ts +58 -0
- package/dist/components/image/PlImagePreview.js +1 -0
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/line-chart/PlLineChart.d.ts +74 -0
- package/dist/components/line-chart/PlLineChart.js +1 -0
- package/dist/components/line-chart/index.d.ts +2 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/menu/PlMenu.d.ts +14 -5
- package/dist/components/menu/PlMenu.js +1 -1
- package/dist/components/meter/PlMeter.d.ts +83 -0
- package/dist/components/meter/PlMeter.js +1 -0
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/index.js +1 -0
- package/dist/components/mockup/PlMockup.d.ts +146 -0
- package/dist/components/mockup/PlMockup.js +1 -0
- package/dist/components/mockup/index.d.ts +2 -0
- package/dist/components/mockup/index.js +1 -0
- package/dist/components/modal/PlModal.d.ts +1 -1
- package/dist/components/modal/PlModal.js +1 -1
- package/dist/components/navigation-menu/PlNavigationMenu.d.ts +7 -1
- package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +1 -1
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.d.ts +6 -0
- package/dist/components/otp-field/PlOtpField.js +1 -1
- package/dist/components/overlay/PlOverlay.d.ts +1 -1
- package/dist/components/overlay/PlOverlay.js +1 -1
- package/dist/components/page-layout/PlPageLayout.js +1 -1
- package/dist/components/pagination/PlPagination.d.ts +12 -9
- package/dist/components/pagination/PlPagination.js +1 -1
- package/dist/components/panes/PlPanes.d.ts +7 -2
- package/dist/components/panes/PlPanes.js +1 -1
- package/dist/components/pie-chart/PlPieChart.d.ts +58 -0
- package/dist/components/pie-chart/PlPieChart.js +1 -0
- package/dist/components/pie-chart/index.d.ts +2 -0
- package/dist/components/pie-chart/index.js +1 -0
- package/dist/components/pill/PlPill.js +1 -1
- package/dist/components/popconfirm/PlPopconfirm.d.ts +1 -1
- package/dist/components/popconfirm/PlPopconfirm.js +1 -1
- package/dist/components/popover/PlPopover.d.ts +6 -6
- package/dist/components/popover/PlPopover.js +1 -1
- package/dist/components/portal/PlPortal.d.ts +78 -0
- package/dist/components/portal/PlPortal.js +1 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/progress-box/PlProgressBox.js +1 -1
- package/dist/components/progress-circular/PlProgressCircular.js +1 -1
- package/dist/components/progress-linear/PlProgressLinear.js +1 -1
- package/dist/components/radio-group/PlRadioGroup.js +1 -1
- package/dist/components/rating/PlRating.d.ts +1 -1
- package/dist/components/rating/PlRating.js +1 -1
- package/dist/components/scatter-chart/PlScatterChart.d.ts +46 -0
- package/dist/components/scatter-chart/PlScatterChart.js +1 -0
- package/dist/components/scatter-chart/index.d.ts +2 -0
- package/dist/components/scatter-chart/index.js +1 -0
- package/dist/components/scroll-area/PlScrollArea.d.ts +98 -0
- package/dist/components/scroll-area/PlScrollArea.js +1 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.js +1 -0
- package/dist/components/scroll-zone/PlScrollZone.d.ts +27 -10
- package/dist/components/scroll-zone/PlScrollZone.js +1 -1
- package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
- package/dist/components/select/PlSelect.js +1 -1
- package/dist/components/show/PlShow.d.ts +76 -0
- package/dist/components/show/PlShow.js +1 -0
- package/dist/components/show/index.d.ts +2 -0
- package/dist/components/show/index.js +1 -0
- package/dist/components/sidebar/PlSidebar.js +1 -1
- package/dist/components/sidebar/PlSidebarTrigger.js +1 -1
- package/dist/components/skeleton/PlSkeleton.js +1 -1
- package/dist/components/slider/PlSlider.d.ts +13 -1
- package/dist/components/slider/PlSlider.js +1 -1
- package/dist/components/sparkline/PlSparkline.d.ts +68 -0
- package/dist/components/sparkline/PlSparkline.js +1 -0
- package/dist/components/sparkline/index.d.ts +2 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/spoiler/PlSpoiler.d.ts +16 -1
- package/dist/components/spoiler/PlSpoiler.js +1 -1
- package/dist/components/stack/PlStack.d.ts +114 -0
- package/dist/components/stack/PlStack.js +1 -0
- package/dist/components/stack/index.d.ts +2 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/stat/PlStat.d.ts +4 -0
- package/dist/components/stat/PlStat.js +1 -1
- package/dist/components/stepper/PlStepper.d.ts +3 -3
- package/dist/components/stepper/PlStepper.js +1 -1
- package/dist/components/switch/PlSwitch.js +1 -1
- package/dist/components/table/PlTable.d.ts +5 -5
- package/dist/components/table/PlTable.js +1 -1
- package/dist/components/tabs/PlTabs.d.ts +27 -2
- package/dist/components/tabs/PlTabs.js +1 -1
- package/dist/components/text-link/PlTextLink.js +1 -1
- package/dist/components/time-picker/PlTimePicker.js +1 -1
- package/dist/components/timeline/PlTimeline.d.ts +2 -2
- package/dist/components/timeline/PlTimeline.js +1 -1
- package/dist/components/timeline-chart/PlTimelineChart.d.ts +44 -0
- package/dist/components/timeline-chart/PlTimelineChart.js +1 -0
- package/dist/components/timeline-chart/index.d.ts +2 -0
- package/dist/components/timeline-chart/index.js +1 -0
- package/dist/components/toast/PlToast.d.ts +1 -1
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/toggle/PlToggleGroup.js +1 -1
- package/dist/components/tooltip/PlTooltip.js +1 -1
- package/dist/components/tour/PlTour.d.ts +134 -0
- package/dist/components/tour/PlTour.js +1 -0
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tour/index.js +1 -0
- package/dist/components/transfer/PlTransfer.d.ts +10 -1
- package/dist/components/transfer/PlTransfer.js +1 -1
- package/dist/components/tree/PlTree.js +1 -1
- package/dist/components/tree-select/PlTreeSelect.d.ts +99 -0
- package/dist/components/tree-select/PlTreeSelect.js +1 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/typography/PlTypography.js +1 -1
- package/dist/components/window-pane/PlWindowPane.d.ts +179 -0
- package/dist/components/window-pane/PlWindowPane.js +1 -0
- package/dist/components/window-pane/index.d.ts +2 -0
- package/dist/components/window-pane/index.js +1 -0
- package/dist/css/anchor.css +2 -0
- package/dist/css/animate-counter.css +2 -0
- package/dist/css/animate-float.css +2 -0
- package/dist/css/animate-reveal.css +2 -0
- package/dist/css/animate-scramble.css +2 -0
- package/dist/css/animate-shake.css +2 -0
- package/dist/css/animate-split.css +2 -0
- package/dist/css/app-logo.css +2 -0
- package/dist/css/area-chart.css +3 -0
- package/dist/css/back-top.css +2 -0
- package/dist/css/bar-chart.css +3 -0
- package/dist/css/calendar.css +1 -0
- package/dist/css/carousel.css +2 -0
- package/dist/css/code-block.css +2 -0
- package/dist/css/color-picker.css +1 -0
- package/dist/css/combobox.css +1 -0
- package/dist/css/command-palette.css +1 -0
- package/dist/css/confirm.css +2 -0
- package/dist/css/data-list.css +2 -0
- package/dist/css/data-table.css +7 -0
- package/dist/css/date-picker.css +1 -0
- package/dist/css/date-range-picker.css +1 -0
- package/dist/css/date-time-picker.css +1 -0
- package/dist/css/flex.css +2 -0
- package/dist/css/floating-action-button.css +4 -0
- package/dist/css/gallery.css +7 -0
- package/dist/css/gauge-chart.css +3 -0
- package/dist/css/heatmap-chart.css +3 -0
- package/dist/css/hover-card.css +2 -0
- package/dist/css/how-to-steps.css +2 -0
- package/dist/css/icon-button.css +1 -0
- package/dist/css/image.css +2 -0
- package/dist/css/line-chart.css +3 -0
- package/dist/css/menubar.css +1 -0
- package/dist/css/meter.css +2 -0
- package/dist/css/mockup.css +2 -0
- package/dist/css/pagination.css +1 -0
- package/dist/css/pie-chart.css +3 -0
- package/dist/css/popconfirm.css +2 -0
- package/dist/css/portal.css +2 -0
- package/dist/css/scatter-chart.css +3 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/scroll-zone.css +2 -0
- package/dist/css/show.css +2 -0
- package/dist/css/sidebar.css +3 -0
- package/dist/css/sparkline.css +3 -0
- package/dist/css/spoiler.css +1 -0
- package/dist/css/stack.css +2 -0
- package/dist/css/stat.css +1 -0
- package/dist/css/time-picker.css +1 -0
- package/dist/css/timeline-chart.css +3 -0
- package/dist/css/tour.css +3 -0
- package/dist/css/transfer.css +4 -0
- package/dist/css/tree-select.css +4 -0
- package/dist/css/window-pane.css +2 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/usePlBreakpoint.d.ts +3 -0
- package/dist/hooks/usePlBreakpoint.js +1 -1
- package/dist/hooks/usePlDisclosure.d.ts +44 -0
- package/dist/hooks/usePlDisclosure.js +1 -0
- package/dist/hooks/usePlElementSize.d.ts +34 -0
- package/dist/hooks/usePlElementSize.js +1 -0
- package/dist/hooks/usePlHotKeys.d.ts +5 -1
- package/dist/hooks/usePlHotKeys.js +1 -1
- package/dist/hooks/usePlOnScreen.d.ts +54 -0
- package/dist/hooks/usePlOnScreen.js +1 -0
- package/dist/index.d.ts +34 -1
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +121 -7
- package/dist/internal/animate.js +1 -1
- package/dist/internal/breakpoints.d.ts +31 -0
- package/dist/internal/breakpoints.js +1 -0
- package/dist/internal/button-group.d.ts +29 -2
- package/dist/internal/button-group.js +2 -2
- package/dist/internal/calendar.d.ts +11 -36
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +462 -0
- package/dist/internal/chart-frame.js +1 -0
- package/dist/internal/chart-line.d.ts +44 -0
- package/dist/internal/chart-line.js +1 -0
- package/dist/internal/chart.d.ts +551 -0
- package/dist/internal/chart.js +1 -0
- package/dist/internal/color-scheme.js +1 -1
- package/dist/internal/data-table.d.ts +70 -0
- package/dist/internal/data-table.js +1 -0
- package/dist/internal/date.d.ts +10 -0
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +8 -3
- package/dist/internal/drag.d.ts +65 -0
- package/dist/internal/drag.js +1 -0
- package/dist/internal/focusable.d.ts +8 -0
- package/dist/internal/focusable.js +1 -0
- package/dist/internal/form.d.ts +61 -0
- package/dist/internal/form.js +1 -0
- package/dist/internal/format.d.ts +2 -0
- package/dist/internal/format.js +1 -1
- package/dist/internal/gallery.d.ts +80 -0
- package/dist/internal/gallery.js +1 -0
- package/dist/internal/glow.d.ts +17 -0
- package/dist/internal/glow.js +1 -0
- package/dist/internal/grid.d.ts +6 -27
- package/dist/internal/grid.js +1 -1
- package/dist/internal/highlight.d.ts +98 -0
- package/dist/internal/highlight.js +1 -0
- package/dist/internal/icons.d.ts +10 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/image.d.ts +94 -0
- package/dist/internal/image.js +1 -0
- package/dist/internal/inert.d.ts +19 -0
- package/dist/internal/inert.js +1 -0
- package/dist/internal/keys.d.ts +19 -0
- package/dist/internal/keys.js +1 -1
- package/dist/internal/labels.d.ts +182 -0
- package/dist/internal/labels.js +1 -0
- package/dist/internal/link.d.ts +17 -0
- package/dist/internal/link.js +1 -1
- package/dist/internal/mockup.d.ts +193 -0
- package/dist/internal/mockup.js +1 -0
- package/dist/internal/page-layout.d.ts +14 -7
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +43 -6
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +22 -8
- package/dist/internal/progress.js +1 -1
- package/dist/internal/responsive.d.ts +108 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/scramble.d.ts +35 -0
- package/dist/internal/scramble.js +1 -0
- package/dist/internal/scroll-target.d.ts +5 -0
- package/dist/internal/scroll-target.js +1 -0
- package/dist/internal/steps.js +1 -1
- package/dist/internal/styles.d.ts +81 -0
- package/dist/internal/styles.js +1 -1
- package/dist/internal/table.d.ts +86 -0
- package/dist/internal/table.js +1 -0
- package/dist/internal/text.d.ts +39 -0
- package/dist/internal/text.js +1 -0
- package/dist/internal/threshold.d.ts +19 -0
- package/dist/internal/threshold.js +1 -0
- package/dist/internal/tour.d.ts +42 -0
- package/dist/internal/tour.js +1 -0
- package/dist/internal/watermark.d.ts +44 -0
- package/dist/internal/watermark.js +1 -0
- package/dist/internal/wheel.d.ts +52 -0
- package/dist/internal/wheel.js +1 -0
- package/dist/internal/window.d.ts +201 -0
- package/dist/internal/window.js +1 -0
- package/dist/locales/de.d.ts +3 -0
- package/dist/locales/de.js +1 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/es.d.ts +3 -0
- package/dist/locales/es.js +1 -0
- package/dist/locales/fr.d.ts +3 -0
- package/dist/locales/fr.js +1 -0
- package/dist/locales/index.d.ts +33 -0
- package/dist/locales/index.js +1 -0
- package/dist/locales/ja.d.ts +3 -0
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ko.d.ts +3 -0
- package/dist/locales/ko.js +1 -0
- package/dist/locales/zh-Hans.d.ts +3 -0
- package/dist/locales/zh-Hans.js +1 -0
- package/dist/provider/PlColorSchemeScript.js +1 -1
- package/dist/provider/PlassProvider.js +1 -1
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1357 -25
- package/dist/tokens.css +1357 -25
- package/dist/types.d.ts +368 -2
- package/package.json +26 -16
- package/dist/components/avatar-group/PlAvatarGroup.d.ts +0 -47
- package/dist/components/avatar-group/PlAvatarGroup.js +0 -1
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/avatar-group/index.js +0 -1
- package/dist/css/avatar-group.css +0 -2
- package/dist/internal/avatar-group.d.ts +0 -25
- package/dist/internal/avatar-group.js +0 -2
|
@@ -27,6 +27,9 @@ export interface PlFloatingBottomNavigationProps extends Omit<PlassStyleProps, '
|
|
|
27
27
|
/**
|
|
28
28
|
* Keeps the bar clear of the home indicator on a phone, by adding
|
|
29
29
|
* `env(safe-area-inset-bottom)` to the gap under it.
|
|
30
|
+
*
|
|
31
|
+
* A browser gives a page that inset only when its viewport meta tag has
|
|
32
|
+
* `viewport-fit=cover`. Without it, this adds nothing.
|
|
30
33
|
* @default true
|
|
31
34
|
*/
|
|
32
35
|
safeArea?: boolean;
|
|
@@ -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{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
|
|
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 b=/* @__PURE__ */s.createContext({value:null,change:()=>{},size:"md",disabled:!1}),v={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)]","forced-colors:border-2 forced-colors:[border-color:Highlight]","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(),H=l??E.size??"md",I=n??E.color??"primary",L=c??E.density??"default",[O,S]=s.useState(f),V=void 0!==u,W=V?u:O,D=s.useRef(null),M=s.useRef(null),T=s.useCallback(e=>{const t=D.current,a=M.current;if(!t||!a)return;const s=t.querySelector("[data-disc][data-current]");if(!s)return a.hidden=!0,void a.removeAttribute("data-ready");a.hidden=!1;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,W,a,H,L,P,q]),s.useEffect(()=>{const e=D.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=>{V||S(e),m?.(e)},[V,m]),J=s.useMemo(()=>({value:W??null,change:G,size:H,disabled:P}),[W,G,H,P]),K=d("flex w-full justify-center px-4","static"===j?"":"pointer-events-none",k?h[H]:v[H],w[j],R);return i({render:A??e("nav",{}),ref:$,props:{"aria-label":C,className:K,style:{...o(I,p,"solid"),...F},children:e(b.Provider,{value:J,children:t("div",{ref:D,className:d("pointer-events-auto relative inline-flex items-center rounded-full",N[a],x[L][H],y[L][H],g),children:[null!=W?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:v,children:h,onClick:x,...y},w){const N=s.useContext(b),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)",v),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{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{cx as a,sheetPaddingXClasses as
|
|
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}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r}from"react/jsx-runtime";import*as o from"react";import{Form as e}from"@base-ui/react/form";import{cx as
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import*as o from"react";import{Form as e}from"@base-ui/react/form";import{FormReportContext as t}from"../../internal/form.js";import{cx as i,sheetSectionGapClasses as m}from"../../internal/styles.js";export const PlForm=/* @__PURE__ */o.forwardRef(function PlForm({validationMode:n="onSubmit",errors:s,onSubmit:a,size:l="md",className:f,children:c,...u},d){const[p]=o.useState(()=>new Map);return r(t.Provider,{value:p,children:r(e,{ref:d,validationMode:n,errors:s,onFormSubmit:r=>{if(!a)return;const o={...r};for(const[r,e]of p)o[r]=e();a(o)},className:i("flex flex-col",m[l],f),...u,children:c})})});
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlImageFit, PlImageFlip, PlImageLetterbox, PlImagePlaceholder, PlImagePosition, PlImageRotation } from '../image/PlImage.js';
|
|
3
|
+
import type { PlassColor, PlassResponsive, PlassSize } from '../../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* How the tiles are arranged.
|
|
6
|
+
*
|
|
7
|
+
* Four, and they answer four different questions rather than being four looks.
|
|
8
|
+
* `grid` is a contact sheet: every tile the same shape, whatever shape the
|
|
9
|
+
* files are. `masonry` keeps each picture's own proportion and stacks the
|
|
10
|
+
* columns. `justified` keeps the proportions *and* fills every row to the edge,
|
|
11
|
+
* scaling each row to a common height — the arrangement a photograph library
|
|
12
|
+
* uses, and the only one where no tile is cropped and no space is left over.
|
|
13
|
+
* `quilted` is a grid whose tiles may take more than one cell, for a set where
|
|
14
|
+
* some pictures matter more than others.
|
|
15
|
+
*/
|
|
16
|
+
export type PlGalleryLayout = 'grid' | 'masonry' | 'justified' | 'quilted';
|
|
17
|
+
/** What a tile does when the pointer is on it. */
|
|
18
|
+
export type PlGalleryHover = 'none' | 'lift' | 'dim' | 'zoom';
|
|
19
|
+
/** Where a tile's words go. */
|
|
20
|
+
export type PlGalleryCaption = 'none' | 'below' | 'overlay' | 'hover';
|
|
21
|
+
/** One picture in the set. */
|
|
22
|
+
export interface PlGalleryItem {
|
|
23
|
+
/** Where the picture is. */
|
|
24
|
+
src: string;
|
|
25
|
+
/** What the picture says. Required, for the reason `PlImage` requires it. */
|
|
26
|
+
alt: string;
|
|
27
|
+
/** A stable identity. Defaults to `src`. */
|
|
28
|
+
id?: string;
|
|
29
|
+
/** The first line of the caption. */
|
|
30
|
+
title?: React.ReactNode;
|
|
31
|
+
/** The second, one step down the scale and muted. */
|
|
32
|
+
description?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* A larger file for the viewer, when the tile is a thumbnail. Falls back to
|
|
35
|
+
* `src`, so a set that has only one size of each picture needs nothing here.
|
|
36
|
+
*/
|
|
37
|
+
full?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The picture's own proportion, as a number or a CSS ratio.
|
|
40
|
+
*
|
|
41
|
+
* `masonry` and `justified` are laid out from this, and both are laid out
|
|
42
|
+
* *before* anything has loaded — which is the whole reason it is data rather
|
|
43
|
+
* than a measurement. A set without it falls back to the gallery's own
|
|
44
|
+
* `ratio`, and comes out as a grid of squares in a masonry's clothing.
|
|
45
|
+
*/
|
|
46
|
+
ratio?: number | string;
|
|
47
|
+
/**
|
|
48
|
+
* Turns the picture clockwise, a quarter at a time, as `PlImage`'s `rotate`
|
|
49
|
+
* does.
|
|
50
|
+
*
|
|
51
|
+
* `ratio` stays the file's own proportion. A picture on its side is laid out
|
|
52
|
+
* on its side in `masonry` and `justified`, and in the viewer; a `grid` tile
|
|
53
|
+
* keeps the gallery's shape, because that is the shape of the layout.
|
|
54
|
+
* @default 0
|
|
55
|
+
*/
|
|
56
|
+
rotate?: PlImageRotation;
|
|
57
|
+
/** Mirrors the picture, as `PlImage`'s `flip` does. @default 'none' */
|
|
58
|
+
flip?: PlImageFlip;
|
|
59
|
+
/** Where the picture sits in its tile, as `PlImage`'s `position`. @default 'center' */
|
|
60
|
+
position?: PlImagePosition | (string & {});
|
|
61
|
+
/**
|
|
62
|
+
* A small copy of the picture to stand in while the file arrives, as
|
|
63
|
+
* `PlImage`'s `placeholder` takes one.
|
|
64
|
+
*/
|
|
65
|
+
placeholder?: PlImagePlaceholder;
|
|
66
|
+
/** How many columns the tile takes in `quilted`. @default 1 */
|
|
67
|
+
cols?: number;
|
|
68
|
+
/** How many rows the tile takes in `quilted`. @default 1 */
|
|
69
|
+
rows?: number;
|
|
70
|
+
}
|
|
71
|
+
/** The parts of a gallery a `className` does not reach. */
|
|
72
|
+
export interface PlGalleryClassNames {
|
|
73
|
+
/** One tile's `<li>`. */
|
|
74
|
+
item?: string;
|
|
75
|
+
/** The picture inside it. */
|
|
76
|
+
image?: string;
|
|
77
|
+
/** The box the two lines of words sit in. */
|
|
78
|
+
caption?: string;
|
|
79
|
+
/** The first of them. */
|
|
80
|
+
title?: string;
|
|
81
|
+
/** The second. */
|
|
82
|
+
description?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface PlGalleryProps extends Omit<React.ComponentPropsWithoutRef<'ul'>, 'children' | 'onSelect'> {
|
|
85
|
+
/** The pictures, in the order they are drawn. */
|
|
86
|
+
items: readonly PlGalleryItem[];
|
|
87
|
+
/** How the tiles are arranged. @default 'grid' */
|
|
88
|
+
layout?: PlGalleryLayout;
|
|
89
|
+
/**
|
|
90
|
+
* How many tiles across, per breakpoint. Read by `grid`, `masonry` and
|
|
91
|
+
* `quilted`; `justified` decides for itself, row by row.
|
|
92
|
+
* @default { xs: 2, sm: 3, lg: 4 }
|
|
93
|
+
*/
|
|
94
|
+
columns?: PlassResponsive<number>;
|
|
95
|
+
/**
|
|
96
|
+
* The space between tiles — a step of the size ladder, a number in pixels, or
|
|
97
|
+
* a CSS length.
|
|
98
|
+
* @default 'md'
|
|
99
|
+
*/
|
|
100
|
+
gap?: PlassSize | number | string;
|
|
101
|
+
/**
|
|
102
|
+
* The shape of a tile in `grid`, and what an item with no `ratio` of its own
|
|
103
|
+
* falls back to everywhere else.
|
|
104
|
+
* @default 1
|
|
105
|
+
*/
|
|
106
|
+
ratio?: number | string;
|
|
107
|
+
/**
|
|
108
|
+
* How tall a row aims to be in `justified`, and how tall one cell is in
|
|
109
|
+
* `quilted`. Rows come out near it rather than on it, because the last thing
|
|
110
|
+
* a justified row does is scale to the width it actually has.
|
|
111
|
+
* @default 220
|
|
112
|
+
*/
|
|
113
|
+
rowHeight?: number;
|
|
114
|
+
/** Rounds the tiles. @default true */
|
|
115
|
+
rounded?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* How every picture fills its tile, as `PlImage`'s `fit`.
|
|
118
|
+
* @default 'cover'
|
|
119
|
+
*/
|
|
120
|
+
fit?: PlImageFit;
|
|
121
|
+
/**
|
|
122
|
+
* What fills a tile where `fit` leaves it empty, as `PlImage`'s `letterbox`:
|
|
123
|
+
* `blur`, or a CSS `background`.
|
|
124
|
+
* @default 'none'
|
|
125
|
+
*/
|
|
126
|
+
letterbox?: PlImageLetterbox | (string & {});
|
|
127
|
+
/**
|
|
128
|
+
* When the pictures are fetched. `eager` for a gallery at the top of the
|
|
129
|
+
* page, where lazy tiles would arrive late.
|
|
130
|
+
* @default 'lazy'
|
|
131
|
+
*/
|
|
132
|
+
loading?: 'lazy' | 'eager';
|
|
133
|
+
/**
|
|
134
|
+
* Where a tile's `title` and `description` go. `below` puts them under the
|
|
135
|
+
* picture, `overlay` writes them across the foot of it, and `hover` is
|
|
136
|
+
* `overlay` that arrives with the pointer. `none` draws no caption, and then
|
|
137
|
+
* neither is read out.
|
|
138
|
+
* @default 'none'
|
|
139
|
+
*/
|
|
140
|
+
caption?: PlGalleryCaption;
|
|
141
|
+
/**
|
|
142
|
+
* What a tile does under the pointer.
|
|
143
|
+
*
|
|
144
|
+
* `lift` and `dim` are depth and colour, which is how everything else in the
|
|
145
|
+
* library answers a pointer. `zoom` is the one that scales, and it is the
|
|
146
|
+
* exception the design language names: what moves is a photograph inside a
|
|
147
|
+
* frame that stays exactly where it was, with no text on it to resample.
|
|
148
|
+
* @default 'lift'
|
|
149
|
+
*/
|
|
150
|
+
hover?: PlGalleryHover;
|
|
151
|
+
/**
|
|
152
|
+
* Opens the picture full size when a tile is chosen, with the rest of the set
|
|
153
|
+
* an arrow key away.
|
|
154
|
+
*
|
|
155
|
+
* The viewer is fetched on demand, so a gallery that does not offer one does
|
|
156
|
+
* not carry it.
|
|
157
|
+
* @default false
|
|
158
|
+
*/
|
|
159
|
+
preview?: boolean;
|
|
160
|
+
/** Called when a tile is chosen, whether or not there is a viewer. */
|
|
161
|
+
onItemSelect?: (item: PlGalleryItem, index: number) => void;
|
|
162
|
+
/** The list's accessible name. @default 'Gallery' */
|
|
163
|
+
label?: string;
|
|
164
|
+
/**
|
|
165
|
+
* How a tile and the viewer's counter say where in the set they are.
|
|
166
|
+
* @default `{index} of {total}`, from the label pack
|
|
167
|
+
*/
|
|
168
|
+
itemLabel?: (index: number, total: number) => string;
|
|
169
|
+
/** What is drawn when `items` is empty. Nothing at all by default. */
|
|
170
|
+
empty?: React.ReactNode;
|
|
171
|
+
/** @default 'md' */
|
|
172
|
+
size?: PlassSize;
|
|
173
|
+
/** @default 'primary' */
|
|
174
|
+
color?: PlassColor;
|
|
175
|
+
/** Class names for the parts behind the root. */
|
|
176
|
+
classNames?: PlGalleryClassNames;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* A set of pictures, arranged.
|
|
180
|
+
*
|
|
181
|
+
* The four layouts are the component: everything else — the captions, the
|
|
182
|
+
* pointer treatment, the viewer — is the same in all of them, and choosing
|
|
183
|
+
* between a contact sheet, a masonry, a justified library and a quilt is one
|
|
184
|
+
* prop rather than four components.
|
|
185
|
+
*
|
|
186
|
+
* **None of them measures anything.** A tile's shape comes from the item's own
|
|
187
|
+
* `ratio`, which means the whole arrangement is right in the first frame the
|
|
188
|
+
* browser paints and does not move again as the files arrive — the same bargain
|
|
189
|
+
* `PlImage`'s `ratio` makes one level up, and the reason a gallery of forty
|
|
190
|
+
* photographs does not reflow forty times.
|
|
191
|
+
*/
|
|
192
|
+
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 i from"react";import{useDefaults as r}from"../../internal/defaults.js";import{useLabels as a}from"../../internal/labels.js";import{isTurned as o,masonryRows as s,ratioOf as n,shownRatio as d}from"../../internal/gallery.js";import{responsiveSlots as m,withBaseline as p}from"../../internal/responsive.js";import{usePlBreakpointValue as u}from"../../hooks/usePlBreakpoint.js";import{cx as c,focusRingClasses as g,hasContent as f,metaTextClasses as h,radiusClasses as v,surfaceSlots as x,toLength as y,transitionClasses as b}from"../../internal/styles.js";import{PlImage as w}from"../image/PlImage.js";const j=/* @__PURE__ */i.lazy(()=>import("./PlGalleryViewer.js").then(e=>({default:e.PlGalleryViewer}))),_={xs:2,sm:3,lg:4},$={xs:"0.25rem",sm:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem"},z={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]:[transform:scale(1.06)] group-focus-visible/tile:[&_img]:[transform:scale(1.06)]"};export const PlGallery=/* @__PURE__ */i.forwardRef(function PlGallery({items:R,layout:k="grid",columns:M,gap:q="md",ratio:P=1,rowHeight:S=220,rounded:C=!0,fit:G="cover",letterbox:I,loading:T="lazy",caption:B="none",hover:F="lift",preview:A=!1,onItemSelect:L,label:V,itemLabel:H,empty:W,size:D,color:E,className:J,classNames:K,style:O,...Q},U){const X=r(),Y=D??X.size??"md",Z=E??X.color??"primary",ee=a(),le=V??ee.gallery,te=H??ee.galleryItem,ie=i.useId(),[re,ae]=i.useState(null),oe=p(M??_,2),se=Math.max(1,u(oe)??2),ne="string"==typeof q&&q in $?$[q]:y(q)??$.md,de=C?v[Y]:"",me=n(P,1),tile=(i,r,a,s)=>{const m=f(i.title)||f(i.description),p="none"!==B&&m,u="overlay"===B||"hover"===B,v=`${ie}-${r}-title`,x=`${ie}-${r}-description`,y=p?[f(i.title)?v:null,f(i.description)?x:null].filter(Boolean).join(" "):void 0,j=e(w,{src:i.src,alt:i.alt,ratio:"grid"===k?P:"quilted"===k?"auto":o(i.rotate)?d(n(i.ratio,me),i.rotate):i.ratio??P,fit:G,letterbox:I,loading:T,rotate:i.rotate,flip:i.flip,position:i.position,placeholder:i.placeholder,rounded:!1,size:Y,color:Z,className:c("size-full",K?.image)}),_=p?l("div",{style:void 0===s||u?void 0:{gridRow:String(s)},className:c("min-w-0",u?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"===B?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",K?.caption),children:[f(i.title)?e("span",{id:v,className:c("truncate font-medium",h[Y],u?"":"text-(--plass-fg)",K?.title),children:i.title}):null,f(i.description)?e("span",{id:x,className:c("truncate",h[Y],u?"text-white/80":"text-(--plass-muted-fg)",K?.description),children:i.description}):null]}):null,$=l("span",{style:void 0===s?void 0:{gridRow:`1 / span ${"below"===B?s-1:s}`},className:c("relative block overflow-hidden",de,"quilted"===k||"justified"===k?"size-full":"","[transition:box-shadow_var(--plass-duration)_var(--plass-ease)]",z[F],N[F],"[&_img]:[transition:opacity_var(--plass-duration)_var(--plass-ease),filter_var(--plass-duration)_var(--plass-ease),transform_var(--plass-duration)_var(--plass-ease)]"),children:[j,u?_:null]}),M=u||!p?$:l(t,{children:[$,_]});return e("li",{className:c("group/tile relative m-0 min-w-0 list-none","justified"===k?"flex flex-col":void 0===s?"":"grid",K?.item),style:a,children:A||L?e("button",{type:"button","aria-label":`${i.alt} — ${te(r+1,R.length)}`,"aria-describedby":y,className:c(void 0===s?"block":"grid","w-full bg-transparent p-0 text-start",A?"cursor-zoom-in":"cursor-pointer",g,b,de,"justified"===k?"flex-1":""),style:void 0===s?void 0:{gridRow:`1 / span ${s}`,gridTemplateRows:"subgrid"},onClick:()=>(e=>{L?.(R[e],e),A&&ae(e)})(r),children:M}):M},i.id??i.src)};let pe,ue;if("masonry"===k){const e=R.map(e=>d(n(e.ratio,me),e.rotate)),{tracks:l,tiles:t}=s(e,se,"below"===B);ue=l.map(e=>"caption"===e?"auto":"gap"===e?ne:`${Number((100*e).toFixed(2))}fr`).join(" "),pe=R.map((e,l)=>{const{column:i,start:r,end:a}=t[l];return tile(e,l,{gridColumn:String(i),gridRow:`${r} / ${a}`,gridTemplateRows:"subgrid"},a-r)})}else pe="justified"===k?R.map((e,l)=>{const t=d(n(e.ratio,me),e.rotate);return tile(e,l,{flexGrow:t,flexBasis:t*S+"px",maxWidth:"100%"})}):R.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===R.length&&f(W)?e(t,{children:W}):l(t,{children:[e("ul",{ref:U,role:"list","aria-label":le,className:c("plass-gallery m-0 list-none p-0","justified"===k?"plass-gallery-justified flex flex-wrap":"","masonry"===k?"grid":"","grid"===k?"plass-gallery-grid grid":"","quilted"===k?"plass-gallery-quilted grid":"",J),style:{gap:"masonry"===k?`0 ${ne}`:ne,...x(Z,0),...m("cols",oe,e=>String(Math.max(1,Math.round(e)))),..."masonry"===k?{gridTemplateColumns:`repeat(${se}, minmax(0, 1fr))`,gridTemplateRows:ue}:null,..."quilted"===k?{gridAutoRows:`${S}px`,gridAutoFlow:"dense"}:null,...O},...Q,children:pe}),A?e(i.Suspense,{fallback:null,children:e(j,{items:R,index:re,onIndexChange:ae,size:Y,color:Z,label:le,itemLabel:te})}):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 t}from"react/jsx-runtime";import*as l from"react";import{useLabels as n}from"../../internal/labels.js";import{isTurned as r,ratioOf as i,shownRatio as a}from"../../internal/gallery.js";import{ChevronIcon as s}from"../../internal/icons.js";import{poseStyle as o,quartersOf as c}from"../../internal/image.js";import{cx as m,metaTextClasses as u}from"../../internal/styles.js";import{PlIconButton as d}from"../icon-button/PlIconButton.js";import{PlOverlay as f}from"../overlay/PlOverlay.js";function turnedFrame(e){if(void 0===e.ratio)return{aspectRatio:"1",width:"min(90vw, 80vh)",containerType:"size"};const t=a(i(e.ratio,1),e.rotate);return{aspectRatio:String(t),width:`min(90vw, calc(80vh * ${t}))`,containerType:"size"}}export function PlGalleryViewer({items:i,index:a,onIndexChange:p,size:v,color:h,label:x,itemLabel:g}){const y=n(),b=null!==a,w=null===a?void 0:i[a],j=null===a||a<=0,N=null===a||a>=i.length-1,k=l.useRef(null),z=l.useRef(null),R=l.useRef(null),go=e=>{if(e<0||e>=i.length)return;const t=document.activeElement;e===i.length-1&&t===z.current?R.current=k.current:0===e&&t===k.current&&(R.current=z.current),p(e)};return l.useLayoutEffect(()=>{R.current?.focus(),R.current=null},[a]),e(f,{open:b,onOpenChange:e=>{e||p(null)},tone:"glass",dismissible:!0,size:v,color:h,label:x,onKeyDown:e=>{null===a||e.metaKey||e.ctrlKey||e.altKey||("ArrowRight"===e.key?(e.preventDefault(),go(a+1)):"ArrowLeft"===e.key&&(e.preventDefault(),go(a-1)))},children:t("div",{className:"flex max-w-[90vw] flex-col gap-3",children:[t("div",{className:"relative flex items-center justify-center",children:[w?e("span",{className:"relative block",style:r(w.rotate)?turnedFrame(w):void 0,children:e("img",{src:w.full??w.src,alt:w.alt,className:m("block object-contain",r(w.rotate)?"":"max-h-[80vh] max-w-[90vw]"),style:o(c(w.rotate??0),w.flip??"none")??void 0})},w.id??w.src):null,i.length>1?t("div",{className:"pointer-events-none absolute inset-x-0 flex items-center justify-between px-1",children:[e(d,{variant:"solid",elevation:1,size:v,color:h,ref:k,label:y.previous,disabled:j,className:"pointer-events-auto",icon:e("span",{className:"flex items-center rotate-90 rtl:-rotate-90",children:e(s,{})}),onClick:()=>go((a??0)-1)}),e(d,{variant:"solid",elevation:1,size:v,color:h,ref:z,label:y.next,disabled:N,className:"pointer-events-auto",icon:e("span",{className:"flex items-center -rotate-90 rtl:rotate-90",children:e(s,{})}),onClick:()=>go((a??0)+1)})]}):null]}),w&&(w.title||w.description)?t("div",{className:"flex min-w-0 flex-col gap-0.5 text-center",children:[w.title?e("span",{className:"truncate font-medium text-(--plass-fg)",children:w.title}):null,w.description?e("span",{className:m("truncate text-(--plass-muted-fg)",u[v]),children:w.description}):null]}):null,i.length>1?e("p",{className:m("m-0 text-center text-(--plass-muted-fg)",u[v]),"aria-live":"polite",children:g((a??0)+1,i.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=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&&kt>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}})});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ChartScaleKind } from '../../internal/chart.js';
|
|
3
|
+
import type { PlassChartCategory, PlassChartLegend, PlassChartSeries } from '../../types.js';
|
|
4
|
+
import type { ChartBaseProps } from '../../internal/chart-frame.js';
|
|
5
|
+
export interface PlHeatmapChartProps extends Omit<ChartBaseProps, 'legend'> {
|
|
6
|
+
/**
|
|
7
|
+
* The rows. Each series is a row of the grid or a group of the treemap, and
|
|
8
|
+
* each datum a cell or a tile.
|
|
9
|
+
*
|
|
10
|
+
* `y` is the magnitude and `x` names the column. A `null` is a gap: the cell
|
|
11
|
+
* is left as surface rather than drawn as the bottom of the scale, because
|
|
12
|
+
* "nothing happened" and "the least of anything" are not the same reading.
|
|
13
|
+
*/
|
|
14
|
+
series: readonly PlassChartSeries[];
|
|
15
|
+
/** The column names. Points may carry their own `x` instead. */
|
|
16
|
+
categories?: readonly PlassChartCategory[];
|
|
17
|
+
/**
|
|
18
|
+
* - `grid` — a cell per row and column, which is the shape for two
|
|
19
|
+
* categorical axes and one magnitude: hours against weekdays, a cohort
|
|
20
|
+
* against a week.
|
|
21
|
+
* - `treemap` — a tile per datum, sized by its share and packed to fill the
|
|
22
|
+
* box. For parts of a whole where the parts are grouped and there are more
|
|
23
|
+
* of them than a [`PlPieChart`](./pie-chart) can hold.
|
|
24
|
+
* @default 'grid'
|
|
25
|
+
*/
|
|
26
|
+
shape?: 'grid' | 'treemap';
|
|
27
|
+
/**
|
|
28
|
+
* How the magnitude is coloured.
|
|
29
|
+
*
|
|
30
|
+
* - `sequential` — one hue, pale to deep. The default, and right whenever
|
|
31
|
+
* more is simply more.
|
|
32
|
+
* - `diverging` — two hues either side of a neutral, for a value with a
|
|
33
|
+
* *middle* that means something: over and under target, gained and lost.
|
|
34
|
+
* Reached for on a plain magnitude it invents a boundary the data has none
|
|
35
|
+
* of.
|
|
36
|
+
* @default 'sequential'
|
|
37
|
+
*/
|
|
38
|
+
scale?: ChartScaleKind;
|
|
39
|
+
/** Where a `diverging` scale turns over. @default 0 */
|
|
40
|
+
midpoint?: number;
|
|
41
|
+
/** Where the scale starts and ends. Taken from the data otherwise. */
|
|
42
|
+
min?: number;
|
|
43
|
+
max?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Writes each cell's value on it, where the cell is big enough for the text
|
|
46
|
+
* to fit with room either side. A label that does not fit is dropped rather
|
|
47
|
+
* than clipped — the tooltip and the table still have it.
|
|
48
|
+
* @default 'none'
|
|
49
|
+
*/
|
|
50
|
+
valueLabels?: 'none' | 'all';
|
|
51
|
+
/** Where the scale legend sits. `false` leaves it off. */
|
|
52
|
+
legend?: boolean | Pick<PlassChartLegend, 'side' | 'align'>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A magnitude per cell, coloured rather than measured.
|
|
56
|
+
*
|
|
57
|
+
* Two shapes of the same idea. A `grid` is the one to reach for when both axes
|
|
58
|
+
* are categorical and the question is *where* — which hour of which day, which
|
|
59
|
+
* cohort in which week; a bar chart of the same data would be forty bars nobody
|
|
60
|
+
* can scan. A `treemap` is for parts of a whole with more parts than a
|
|
61
|
+
* [`PlPieChart`](./pie-chart) can hold, and it is the same component because the
|
|
62
|
+
* data is the same shape: a row of a heatmap and a group of a treemap are both
|
|
63
|
+
* a named series of named magnitudes.
|
|
64
|
+
*
|
|
65
|
+
* Colour here encodes *size* and not identity, so it comes off a one-hue ramp
|
|
66
|
+
* rather than off the categorical palette — a heatmap in eight hues says its
|
|
67
|
+
* cells are eight unrelated things.
|
|
68
|
+
*/
|
|
69
|
+
export declare function PlHeatmapChart({ series, categories, shape, scale, midpoint, min, max, valueLabels, height, format, locale: localeProp, label, legend, tooltip, empty, size: sizeProp, variant, padded, className, ...box }: PlHeatmapChartProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{ChartScaleLegend as n,ChartStatus as i,ChartSurface as r,ChartTooltipPanel as a,markTransitionClasses as o,useMeasuredWidth as d}from"../../internal/chart-frame.js";import{categoryAt as h,chartFontSizes as s,compactNumber as c,formatCategory as m,markGap as u,plotHeights as x,rampFill as f,rampInk as p,rampStep as g,rampSteps as w,squarify as v,textWidth as y,tickStride as b,toValues as M,truncate as k}from"../../internal/chart.js";import{numberFormatter as A}from"../../internal/format.js";import{cx as $,metaTextClasses as j,srOnlyClasses as N}from"../../internal/styles.js";import{useLabels as z}from"../../internal/labels.js";import{useDefaults as E}from"../../internal/defaults.js";export function PlHeatmapChart({series:S,categories:C,shape:D="grid",scale:B="sequential",midpoint:I=0,min:L,max:P,valueLabels:R="none",height:U,format:_,locale:q,label:H,legend:K,tooltip:W,empty:F,size:G,variant:J="ghost",padded:O=!1,className:Q,...T}){const V=E(),X=G??V.size??"md",Y=q??V.locale,Z=t.useRef(null),ee=d(Z),le=z(),te=t.useId(),[ne,ie]=t.useState(null),re=t.useCallback(e=>_?A(Y,_).format(e):c(e,Y),[_,Y]),ae=t.useMemo(()=>M(S),[S]),oe=ae.reduce((e,l)=>Math.max(e,l.length),0),de=t.useMemo(()=>Array.from({length:oe},(e,l)=>h(l,C,ae)),[oe,C,ae]),he=t.useMemo(()=>S.map((e,l)=>e.name??`${l+1}`),[S]),se=t.useMemo(()=>{let e=1/0,l=-1/0,t=!1;for(const n of ae)for(const i of n)null!==i.value&&(t=!0,e=Math.min(e,i.value),l=Math.max(l,i.value));return t?{min:e,max:l}:null},[ae]),ce=L??se?.min??0,me=P??se?.max??1,ue=t.useCallback(e=>g(e,ce,me,B,I),[ce,me,B,I]),xe="number"==typeof U?U:x[X]??220,fe=s[X],pe=!0===K||void 0===K||!1===K?{}:K,ge=!1!==K,we=pe.side??"bottom",ve=!1===W?{mode:"none"}:!0===W||void 0===W?{}:W,ye="none"===ve.mode,be=null===se||0===oe||0===S.length,Me=t.useMemo(()=>{if("treemap"===D||ee<=0)return{texts:[],band:0};const e=Math.min(150,.25*ee),l=he.map(l=>k(l,e,fe));return{texts:l,band:l.reduce((e,l)=>Math.max(e,y(l,fe)),0)+10}},[D,he,ee,fe]),ke="treemap"===D?0:fe+8,Ae={left:Me.band,width:Math.max(0,ee-Me.band),height:Math.max(0,xe-ke)},$e=t.useMemo(()=>{if("treemap"===D)return{texts:[],widest:0};const e=de.map(e=>m(e,Y));return{texts:e,widest:e.reduce((e,l)=>Math.max(e,y(l,fe)),0)}},[D,de,Y,fe]),je=b(oe,Ae.width,$e.widest+8),Ne=t.useMemo(()=>{if(Ae.width<=0||Ae.height<=0)return[];if("treemap"===D){const e=[];return ae.forEach((l,t)=>l.forEach((l,n)=>{null!==l.value&&e.push({row:t,index:n,cell:l})})),v(e.map(e=>Math.max(0,e.cell.value??0)),Ae.width,Ae.height).map(l=>({row:e[l.index].row,index:e[l.index].index,cell:e[l.index].cell,x:Ae.left+l.x,y:l.y,width:l.width,height:l.height}))}const e=Ae.height/Math.max(1,S.length),l=Ae.width/Math.max(1,oe),t=[];return ae.forEach((n,i)=>n.forEach((n,r)=>{null!==n.value&&t.push({row:i,index:r,cell:n,x:Ae.left+r*l,y:i*e,width:l,height:e})})),t},[D,ae,S.length,oe,Ae.left,Ae.width,Ae.height]),ze=t.useCallback((e,l)=>m(e.x??C?.[l]??de[l]??l,Y),[C,de,Y]),Ee=t.useCallback(e=>ze(e.cell,e.index),[ze]),Se=null===ne?null:Ne.find(e=>e.row===ne.row&&e.index===ne.index)??null,Ce=null===Se?[]:[{seriesIndex:Se.row,color:Se.cell.color??f(ue(Se.cell.value??0),B),value:Se.cell.value,formatted:re(Se.cell.value??0),label:Se.cell.label}],De=Array.from({length:w},(e,l)=>f(l,B));return l(r,{...T,size:X,variant:J,padded:O,className:Q,legendSide:we,legend:ge&&!be?e(n,{steps:De,from:re("diverging"===B?-reach(ce,me,I)+I:ce),to:re("diverging"===B?reach(ce,me,I)+I:me),middle:"diverging"===B?re(I):void 0,align:pe.align??"center",vertical:"left"===we||"right"===we,size:X}):null,table:be?null:l("table","treemap"===D?{id:te,className:N,children:[H?e("caption",{children:H}):null,ae.map((t,n)=>l("tbody",{children:[e("tr",{children:e("th",{scope:"rowgroup",colSpan:2,children:he[n]})}),t.map((t,n)=>null===t.value?null:l("tr",{children:[e("th",{scope:"row",children:ze(t,n)}),e("td",{children:void 0!==t.label?t.label:re(t.value)})]},n))]},n))]}:{id:te,className:N,children:[H?e("caption",{children:H}):null,e("thead",{children:l("tr",{children:[e("th",{scope:"col"}),de.map((l,t)=>e("th",{scope:"col",children:m(l,Y)},t))]})}),e("tbody",{children:ae.map((t,n)=>l("tr",{children:[e("th",{scope:"row",children:he[n]}),de.map((l,n)=>{const i=t[n];return e("td",{children:void 0!==i?.label?i.label:null==i?.value?"":re(i.value)},n)})]},n))})]}),children:[l("div",{ref:Z,role:"img",tabIndex:be?void 0:0,"aria-label":H??le.chart,"aria-describedby":be?void 0:te,onPointerLeave:()=>ie(null),onBlur:()=>ie(null),onKeyDown:e=>{if(ye||0===Ne.length)return;const l=null===ne?-1:Ne.findIndex(e=>e.row===ne.row&&e.index===ne.index);if("grid"!==D||-1===l||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)if("ArrowRight"===e.key||"ArrowDown"===e.key){const e=Ne[Math.min(Ne.length-1,l+1)];ie({row:e.row,index:e.index})}else if("ArrowLeft"===e.key||"ArrowUp"===e.key){const e=Ne[Math.max(0,(-1===l?Ne.length:l)-1)];ie({row:e.row,index:e.index})}else{if("Escape"!==e.key)return;ie(null)}else{const t="ArrowDown"===e.key?1:-1;let n=l+t;for(;n>=0&&n<Ne.length&&Ne[n].index!==Ne[l].index;)n+=t;n>=0&&n<Ne.length&&ie({row:Ne[n].row,index:Ne[n].index})}e.preventDefault()},className:$("relative w-full rounded-(--plass-radius-xs)","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-2"),style:{height:xe},children:[be?e("div",{className:$("flex h-full items-center justify-center text-(--plass-muted-fg)",j[X]),children:F??le.empty}):ee>0?l("svg",{width:ee,height:xe,viewBox:`0 0 ${ee} ${xe}`,"aria-hidden":"true",className:"block",children:[Ne.map(t=>{const n=ue(t.cell.value??0),i=ne?.row===t.row&&ne?.index===t.index,r=Math.max(0,t.width-u),a=Math.max(0,t.height-u);if(r<=0||a<=0)return null;const d=re(t.cell.value??0),h="treemap"===D?"all"===R?[Ee(t),d]:[Ee(t)]:"all"===R?[d]:[],s=h.filter(e=>function fits(e,l,t,n){return t>=1.8*n&&l>=Math.min(y(e,n),2.5*n)+8}(e,r,a/h.length,fe)),c=t.cell.color?"var(--plass-surface)":p(n,B);return l("g",{children:[e("rect",{x:t.x+u/2,y:t.y+u/2,width:r,height:a,rx:Math.min(3,r/2,a/2),fill:t.cell.color??f(n,B),opacity:i?1:.94,onPointerEnter:ye?void 0:()=>ie({row:t.row,index:t.index}),className:o}),s.map((l,n)=>e("text",{x:t.x+t.width/2,y:t.y+t.height/2+(n-(s.length-1)/2)*(fe+2),textAnchor:"middle",dominantBaseline:"central",fontSize:fe,fontWeight:0===n?500:400,fill:c,opacity:0===n?1:.85,pointerEvents:"none",className:0===n&&"treemap"===D?void 0:"tabular-nums",children:k(l,t.width-8,fe)},n))]},`${t.row}-${t.index}`)}),"grid"===D?Me.texts.map((l,t)=>e("text",{x:Ae.left-8,y:(t+.5)*Ae.height/Math.max(1,S.length),textAnchor:"end",dominantBaseline:"central",fontSize:fe,fill:"var(--plass-muted-fg)",children:l},`row-${t}`)):null,"grid"===D?$e.texts.map((l,t)=>{const n=Ae.width/Math.max(1,oe);return t%je!==0?null:e("text",{x:Ae.left+(t+.5)*n,y:Ae.height+fe,textAnchor:"middle",fontSize:fe,fill:"var(--plass-muted-fg)",children:l},`col-${t}`)}):null]}):null,Se&&!ye?ve.render?e("div",{className:"pointer-events-none absolute z-10",style:{left:Se.x+Se.width/2,top:Se.y},children:ve.render({index:Se.index,category:Se.cell.x??de[Se.index]??Se.index,items:Ce})}):e(a,{heading:`${he[Se.row]} · ${Ee(Se)}`,items:Ce,x:Se.x+Se.width/2,y:Se.y,flip:Se.x+Se.width/2>.6*ee,size:X}):null]}),ye?null:e(i,{heading:Se?`${he[Se.row]} · ${Ee(Se)}`:void 0,items:Ce})]})}function reach(e,l,t){return Math.max(Math.abs(l-t),Math.abs(t-e))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlHeatmapChart}from"./PlHeatmapChart.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useDefaults as n}from"../../internal/defaults.js";import{transitionClasses as o}from"../../internal/styles.js";const t="forced-colors:[background-color:Mark] forced-colors:[color:MarkText]",l={solid:`[background-image:var(--p-fill)] text-(--p-on-solid) ${t}`,glass:`border bg-(--p-soft) text-(--p-accent) [border-color:var(--p-line)] ${t}`,ghost:`bg-transparent text-(--p-accent) ${t}`},i={regular:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},s=/[\p{L}\p{N}_]/u;function escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function isWholeWord(e,r,n){const o=r>0?e[r-1]:"",t=n<e.length?e[n]:"";return!s.test(o)&&!s.test(t)}function markString(e,r,n,o){r.lastIndex=0;const t=[];let l,i=0;for(;null!==(l=r.exec(e));){if(""===l[0]){r.lastIndex+=1;continue}const s=l.index,a=s+l[0].length;n&&!isWholeWord(e,s,a)||(s>i&&t.push(e.slice(i,s)),t.push(o(l[0],`${s}`)),i=a)}return 0===t.length?e:(i<e.length&&t.push(e.slice(i)),t)}function markNode(e,n,o,t){if("string"==typeof e)return markString(e,n,o,t);if("number"==typeof e)return markString(String(e),n,o,t);if(Array.isArray(e))return r.Children.map(e,e=>markNode(e,n,o,t));if(r.isValidElement(e)){const l=e.props.children;return void 0===l||"function"==typeof l?e:r.cloneElement(e,void 0,markNode(l,n,o,t))}return e}export const PlHighlight=/* @__PURE__ */r.forwardRef(function PlHighlight({query:t,variant:s="solid",color:a,caseSensitive:c=!1,wholeWord:d=!1,underline:p=!1,weight:f,className:u,style:g,children:m,...h},x){const b=n(),k=a??b.color??"warning",$=r.useMemo(()=>function buildPattern(e,r){if(e instanceof RegExp)return new RegExp(e.source,e.global?e.flags:`${e.flags}g`);const n=(Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(Boolean).sort((e,r)=>r.length-e.length);return 0===n.length?null:new RegExp(n.map(escapeRegExp).join("|"),r?"gu":"giu")}(t,c),[t,c]),v=["-mx-0.5 rounded-[0.25rem] px-0.5","box-decoration-clone",l[s],p?"underline decoration-2 underline-offset-2":"",f?i[f]:"",o].filter(Boolean).join(" "),y=$?markNode(m,$,d,(r,n)=>e("mark",{className:v,children:r},n)):m;return e("span",{ref:x,className:u,style:{"--p-fill":`var(--plass-${k}-fill)`,"--p-on-solid":`var(--plass-${k}-on-solid)`,"--p-accent":`var(--plass-${k}-accent)`,"--p-soft":`var(--plass-${k}-soft)`,"--p-line":`var(--plass-${k}-line)`,...g},...h,children:y})});
|