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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** The box an element is laid out at, in pixels. */
|
|
3
|
+
export interface PlElementSize {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* How big an element is, kept up to date as it changes.
|
|
9
|
+
*
|
|
10
|
+
* A `ResizeObserver` and the two things a hook has to add. The first is
|
|
11
|
+
* **when**: the size is read in a layout effect as well as from the observer,
|
|
12
|
+
* because an observer's first callback arrives after a frame has been painted
|
|
13
|
+
* and a component that laid itself out from `0 × 0` for one frame flashes.
|
|
14
|
+
*
|
|
15
|
+
* The second is what it reports: the **content box**, the room actually left
|
|
16
|
+
* inside the element once its own padding has been taken off. A hand-written
|
|
17
|
+
* version nearly always reports `getBoundingClientRect` or `borderBoxSize`
|
|
18
|
+
* instead, which is a different number — and the wrong one for the question
|
|
19
|
+
* that made somebody measure the element.
|
|
20
|
+
*
|
|
21
|
+
* `null` until there is an element to measure, which is the honest answer on a
|
|
22
|
+
* server and on the first render: guessing `0` there would let a caller divide
|
|
23
|
+
* by it. The ref is read again after every render, so an element that is
|
|
24
|
+
* attached later — `loading ? <Spinner /> : <div ref={box}>` — or swapped for
|
|
25
|
+
* another is measured from the moment it is there, and the answer goes back to
|
|
26
|
+
* `null` while there is none.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const box = React.useRef<HTMLDivElement>(null);
|
|
30
|
+
* const size = usePlElementSize(box);
|
|
31
|
+
*
|
|
32
|
+
* <div ref={box}>{size ? `${Math.round(size.width)}px` : null}</div>
|
|
33
|
+
*/
|
|
34
|
+
export declare function usePlElementSize(target: React.RefObject<HTMLElement | null>): PlElementSize | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";export function usePlElementSize(t){const[n,r]=e.useState(null),[i,o]=e.useState(null);return e.useLayoutEffect(()=>{t.current!==i&&o(t.current)}),e.useLayoutEffect(()=>{if(!i)return void r(null);const read=()=>{const e=function contentBoxOf(e){const t=getComputedStyle(e),n=parseFloat(t.paddingInlineStart)+parseFloat(t.paddingInlineEnd),r=parseFloat(t.paddingBlockStart)+parseFloat(t.paddingBlockEnd);return{width:Math.max(0,e.clientWidth-n),height:Math.max(0,e.clientHeight-r)}}(i);r(t=>t?.width===e.width&&t.height===e.height?t:e)};if(read(),"undefined"==typeof ResizeObserver)return;const e=new ResizeObserver(read);return e.observe(i),()=>e.disconnect()},[i]),n}
|
|
@@ -55,7 +55,7 @@ export interface PlHotKeysOptions {
|
|
|
55
55
|
* this way since it existed, with a private copy of the matcher — and an
|
|
56
56
|
* application's own shortcuts are the reason it is public.
|
|
57
57
|
*
|
|
58
|
-
*
|
|
58
|
+
* Five rules it shares with the `hotKeys` prop:
|
|
59
59
|
*
|
|
60
60
|
* - **A modifier is checked in both directions.** `Enter` does not fire on
|
|
61
61
|
* `Shift+Enter`, and `Mod+K` does not fire on `Mod+Shift+K`.
|
|
@@ -66,6 +66,10 @@ export interface PlHotKeysOptions {
|
|
|
66
66
|
* - **These are chords rather than letters.** A single unmodified key is
|
|
67
67
|
* allowed and is sometimes right (`?` for help), but it is the case
|
|
68
68
|
* `whileTyping` is about.
|
|
69
|
+
* - **A chord names the key, not the character it types.** `Alt+K` answers
|
|
70
|
+
* the `˚` Option+K types on a Mac, and `?` needs no `Shift+`.
|
|
71
|
+
* - **A key an input method is composing is left alone**, so the Enter that
|
|
72
|
+
* commits a syllable fires nothing.
|
|
69
73
|
*
|
|
70
74
|
* The handlers are read fresh on every keystroke, so an inline object literal
|
|
71
75
|
* costs nothing and a handler closing over current state is never stale. What
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{editsText as n,hasHardModifier as t,
|
|
1
|
+
"use client";import*as e from"react";import{editsText as n,hasHardModifier as t,isComposingKey as r,isTypingTarget as o,matchesHotKey as i}from"../internal/keys.js";export function usePlHotKeys(u,s={}){const{enabled:f=!0,target:c,whileTyping:l=!1}=s,d=e.useRef(u);e.useEffect(()=>{d.current=u});const a=Object.keys(u??{}).join("\n");e.useEffect(()=>{const e=function resolve(e){return void 0===e?"undefined"==typeof window?null:window:null===e?null:"current"in e?e.current:e}(c);if(!f||!e||""===a)return;const u=a.split("\n"),onKeyDown=e=>{const s=e;if(!s.defaultPrevented&&!r(s))for(const e of u)if(i(s,e)){if(!l&&!t(e)&&n(s.key)&&o(s.target))return;return s.preventDefault(),void d.current?.[e]?.()}};return e.addEventListener("keydown",onKeyDown),()=>e.removeEventListener("keydown",onKeyDown)},[a,c,f,l])}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface PlOnScreenOptions {
|
|
3
|
+
/**
|
|
4
|
+
* How much of the element has to be showing before it counts, from `0` to
|
|
5
|
+
* `1`.
|
|
6
|
+
* @default 0
|
|
7
|
+
*/
|
|
8
|
+
threshold?: number;
|
|
9
|
+
/**
|
|
10
|
+
* How far outside the viewport still counts, as a CSS margin — `'200px'`
|
|
11
|
+
* starts a fetch a screen early.
|
|
12
|
+
*/
|
|
13
|
+
rootMargin?: string;
|
|
14
|
+
/**
|
|
15
|
+
* What it is measured against. The viewport when it is not given; a scrolling
|
|
16
|
+
* panel otherwise.
|
|
17
|
+
*/
|
|
18
|
+
root?: React.RefObject<Element | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Stops watching the first time it appears.
|
|
21
|
+
*
|
|
22
|
+
* On by default, because the question a caller almost always has is "has this
|
|
23
|
+
* been seen yet" rather than "is it on screen right now" — a lazily loaded
|
|
24
|
+
* picture, a section that animates once, a page that fetches the next batch.
|
|
25
|
+
* Turn it off for the answer that keeps changing.
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
once?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Whether an element is on screen.
|
|
32
|
+
*
|
|
33
|
+
* An `IntersectionObserver` with the three things a hook has to decide, and
|
|
34
|
+
* the interesting one is `once`. It is **on** by default: the question a caller
|
|
35
|
+
* almost always has is "has this been seen yet", not "is it on screen right
|
|
36
|
+
* now", and a hook that kept answering the second one would re-render a page of
|
|
37
|
+
* lazily loaded pictures every time the reader scrolled past any of them.
|
|
38
|
+
*
|
|
39
|
+
* `false` on a server and on the first render, which is the safe answer for
|
|
40
|
+
* both of the things this is used for: nothing is fetched that did not need to
|
|
41
|
+
* be, and nothing is played before a reader could see it.
|
|
42
|
+
*
|
|
43
|
+
* A browser with no observer is told **yes** rather than no. There is no way to
|
|
44
|
+
* find out, and a picture that never loads is worse than one that loads early.
|
|
45
|
+
*
|
|
46
|
+
* The refs are read again after every render, so an element or a `root` that is
|
|
47
|
+
* attached after the first one, or swapped for another, is watched from the
|
|
48
|
+
* moment it is there.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const section = React.useRef<HTMLDivElement>(null);
|
|
52
|
+
* const seen = usePlOnScreen(section, { rootMargin: '200px' });
|
|
53
|
+
*/
|
|
54
|
+
export declare function usePlOnScreen(target: React.RefObject<Element | null>, { threshold, rootMargin, root, once }?: PlOnScreenOptions): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";export function usePlOnScreen(t,{threshold:r=0,rootMargin:n,root:o,once:s=!0}={}){const[u,c]=e.useState(!1),[i,l]=e.useState(null),[f,a]=e.useState(null);return e.useEffect(()=>{t.current!==i&&l(t.current),(o?.current??null)!==f&&a(o?.current??null)}),e.useEffect(()=>{if(!i)return;if("undefined"==typeof IntersectionObserver)return void c(!0);const e=new IntersectionObserver(([t])=>{t.isIntersecting?(c(!0),s&&e.disconnect()):s||c(!1)},{threshold:r,rootMargin:n,root:f});return e.observe(i),()=>e.disconnect()},[i,f,r,n,s]),u}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,22 +3,31 @@ export * from './hooks/index.js';
|
|
|
3
3
|
export * from './provider/index.js';
|
|
4
4
|
export * from './components/accordion/index.js';
|
|
5
5
|
export * from './components/alert/index.js';
|
|
6
|
+
export * from './components/anchor/index.js';
|
|
6
7
|
export * from './components/animate-appear/index.js';
|
|
7
8
|
export * from './components/animate-blink/index.js';
|
|
9
|
+
export * from './components/animate-counter/index.js';
|
|
8
10
|
export * from './components/animate-fade/index.js';
|
|
11
|
+
export * from './components/animate-float/index.js';
|
|
9
12
|
export * from './components/animate-grow/index.js';
|
|
10
13
|
export * from './components/animate-headline/index.js';
|
|
11
14
|
export * from './components/animate-lighting/index.js';
|
|
12
15
|
export * from './components/animate-marquee/index.js';
|
|
16
|
+
export * from './components/animate-reveal/index.js';
|
|
13
17
|
export * from './components/animate-rotate/index.js';
|
|
18
|
+
export * from './components/animate-scramble/index.js';
|
|
19
|
+
export * from './components/animate-shake/index.js';
|
|
14
20
|
export * from './components/animate-slide/index.js';
|
|
21
|
+
export * from './components/animate-split/index.js';
|
|
15
22
|
export * from './components/animate-typing/index.js';
|
|
16
23
|
export * from './components/animate-zoom/index.js';
|
|
24
|
+
export * from './components/app-logo/index.js';
|
|
25
|
+
export * from './components/area-chart/index.js';
|
|
17
26
|
export * from './components/aspect-ratio/index.js';
|
|
18
27
|
export * from './components/avatar/index.js';
|
|
19
|
-
export * from './components/avatar-group/index.js';
|
|
20
28
|
export * from './components/back-top/index.js';
|
|
21
29
|
export * from './components/badge/index.js';
|
|
30
|
+
export * from './components/bar-chart/index.js';
|
|
22
31
|
export * from './components/blockquote/index.js';
|
|
23
32
|
export * from './components/bottom-navigation/index.js';
|
|
24
33
|
export * from './components/box/index.js';
|
|
@@ -31,12 +40,15 @@ export * from './components/carousel/index.js';
|
|
|
31
40
|
export * from './components/chat-bubble/index.js';
|
|
32
41
|
export * from './components/checkbox/index.js';
|
|
33
42
|
export * from './components/chip/index.js';
|
|
43
|
+
export * from './components/code-block/index.js';
|
|
34
44
|
export * from './components/collapsible/index.js';
|
|
35
45
|
export * from './components/color-picker/index.js';
|
|
36
46
|
export * from './components/combobox/index.js';
|
|
37
47
|
export * from './components/confirm/index.js';
|
|
38
48
|
export * from './components/command-palette/index.js';
|
|
39
49
|
export * from './components/container/index.js';
|
|
50
|
+
export * from './components/data-list/index.js';
|
|
51
|
+
export * from './components/data-table/index.js';
|
|
40
52
|
export * from './components/date-picker/index.js';
|
|
41
53
|
export * from './components/date-range-picker/index.js';
|
|
42
54
|
export * from './components/date-time-picker/index.js';
|
|
@@ -45,19 +57,29 @@ export * from './components/drawer/index.js';
|
|
|
45
57
|
export * from './components/empty/index.js';
|
|
46
58
|
export * from './components/fieldset/index.js';
|
|
47
59
|
export * from './components/file-picker/index.js';
|
|
60
|
+
export * from './components/flex/index.js';
|
|
61
|
+
export * from './components/floating-action-button/index.js';
|
|
48
62
|
export * from './components/floating-bottom-navigation/index.js';
|
|
49
63
|
export * from './components/footer/index.js';
|
|
50
64
|
export * from './components/form/index.js';
|
|
65
|
+
export * from './components/gallery/index.js';
|
|
66
|
+
export * from './components/gauge-chart/index.js';
|
|
51
67
|
export * from './components/grid/index.js';
|
|
52
68
|
export * from './components/header/index.js';
|
|
69
|
+
export * from './components/heatmap-chart/index.js';
|
|
53
70
|
export * from './components/highlight/index.js';
|
|
54
71
|
export * from './components/hot-keys/index.js';
|
|
72
|
+
export * from './components/hover-card/index.js';
|
|
73
|
+
export * from './components/how-to-steps/index.js';
|
|
55
74
|
export * from './components/icon/index.js';
|
|
56
75
|
export * from './components/icon-button/index.js';
|
|
57
76
|
export * from './components/image/index.js';
|
|
77
|
+
export * from './components/line-chart/index.js';
|
|
58
78
|
export * from './components/list/index.js';
|
|
59
79
|
export * from './components/menu/index.js';
|
|
60
80
|
export * from './components/menubar/index.js';
|
|
81
|
+
export * from './components/meter/index.js';
|
|
82
|
+
export * from './components/mockup/index.js';
|
|
61
83
|
export * from './components/modal/index.js';
|
|
62
84
|
export * from './components/navigation-menu/index.js';
|
|
63
85
|
export * from './components/number-field/index.js';
|
|
@@ -66,21 +88,28 @@ export * from './components/overlay/index.js';
|
|
|
66
88
|
export * from './components/page-layout/index.js';
|
|
67
89
|
export * from './components/pagination/index.js';
|
|
68
90
|
export * from './components/panes/index.js';
|
|
91
|
+
export * from './components/pie-chart/index.js';
|
|
69
92
|
export * from './components/pill/index.js';
|
|
70
93
|
export * from './components/popconfirm/index.js';
|
|
71
94
|
export * from './components/popover/index.js';
|
|
95
|
+
export * from './components/portal/index.js';
|
|
72
96
|
export * from './components/progress-box/index.js';
|
|
73
97
|
export * from './components/progress-circular/index.js';
|
|
74
98
|
export * from './components/progress-linear/index.js';
|
|
75
99
|
export * from './components/radio-group/index.js';
|
|
76
100
|
export * from './components/rating/index.js';
|
|
101
|
+
export * from './components/scatter-chart/index.js';
|
|
102
|
+
export * from './components/scroll-area/index.js';
|
|
77
103
|
export * from './components/scroll-zone/index.js';
|
|
78
104
|
export * from './components/segmented-button/index.js';
|
|
79
105
|
export * from './components/select/index.js';
|
|
106
|
+
export * from './components/show/index.js';
|
|
80
107
|
export * from './components/sidebar/index.js';
|
|
81
108
|
export * from './components/skeleton/index.js';
|
|
82
109
|
export * from './components/slider/index.js';
|
|
110
|
+
export * from './components/sparkline/index.js';
|
|
83
111
|
export * from './components/spoiler/index.js';
|
|
112
|
+
export * from './components/stack/index.js';
|
|
84
113
|
export * from './components/stat/index.js';
|
|
85
114
|
export * from './components/stepper/index.js';
|
|
86
115
|
export * from './components/switch/index.js';
|
|
@@ -90,11 +119,15 @@ export * from './components/text-field/index.js';
|
|
|
90
119
|
export * from './components/text-link/index.js';
|
|
91
120
|
export * from './components/time-picker/index.js';
|
|
92
121
|
export * from './components/timeline/index.js';
|
|
122
|
+
export * from './components/timeline-chart/index.js';
|
|
93
123
|
export * from './components/toast/index.js';
|
|
94
124
|
export * from './components/toggle/index.js';
|
|
95
125
|
export * from './components/toolbar/index.js';
|
|
96
126
|
export * from './components/tooltip/index.js';
|
|
127
|
+
export * from './components/tour/index.js';
|
|
97
128
|
export * from './components/tree/index.js';
|
|
129
|
+
export * from './components/tree-select/index.js';
|
|
98
130
|
export * from './components/transfer/index.js';
|
|
99
131
|
export * from './components/typography/index.js';
|
|
100
132
|
export * from './components/visually-hidden/index.js';
|
|
133
|
+
export * from './components/window-pane/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./types.js";export*from"./hooks/index.js";export*from"./provider/index.js";export*from"./components/accordion/index.js";export*from"./components/alert/index.js";export*from"./components/animate-appear/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/
|
|
1
|
+
export*from"./types.js";export*from"./hooks/index.js";export*from"./provider/index.js";export*from"./components/accordion/index.js";export*from"./components/alert/index.js";export*from"./components/anchor/index.js";export*from"./components/animate-appear/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-counter/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-float/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-reveal/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-scramble/index.js";export*from"./components/animate-shake/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-split/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/app-logo/index.js";export*from"./components/area-chart/index.js";export*from"./components/aspect-ratio/index.js";export*from"./components/avatar/index.js";export*from"./components/back-top/index.js";export*from"./components/badge/index.js";export*from"./components/bar-chart/index.js";export*from"./components/blockquote/index.js";export*from"./components/bottom-navigation/index.js";export*from"./components/box/index.js";export*from"./components/breadcrumb/index.js";export*from"./components/button/index.js";export*from"./components/button-group/index.js";export*from"./components/calendar/index.js";export*from"./components/card/index.js";export*from"./components/carousel/index.js";export*from"./components/chat-bubble/index.js";export*from"./components/checkbox/index.js";export*from"./components/chip/index.js";export*from"./components/code-block/index.js";export*from"./components/collapsible/index.js";export*from"./components/color-picker/index.js";export*from"./components/combobox/index.js";export*from"./components/confirm/index.js";export*from"./components/command-palette/index.js";export*from"./components/container/index.js";export*from"./components/data-list/index.js";export*from"./components/data-table/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-range-picker/index.js";export*from"./components/date-time-picker/index.js";export*from"./components/divider/index.js";export*from"./components/drawer/index.js";export*from"./components/empty/index.js";export*from"./components/fieldset/index.js";export*from"./components/file-picker/index.js";export*from"./components/flex/index.js";export*from"./components/floating-action-button/index.js";export*from"./components/floating-bottom-navigation/index.js";export*from"./components/footer/index.js";export*from"./components/form/index.js";export*from"./components/gallery/index.js";export*from"./components/gauge-chart/index.js";export*from"./components/grid/index.js";export*from"./components/header/index.js";export*from"./components/heatmap-chart/index.js";export*from"./components/highlight/index.js";export*from"./components/hot-keys/index.js";export*from"./components/hover-card/index.js";export*from"./components/how-to-steps/index.js";export*from"./components/icon/index.js";export*from"./components/icon-button/index.js";export*from"./components/image/index.js";export*from"./components/line-chart/index.js";export*from"./components/list/index.js";export*from"./components/menu/index.js";export*from"./components/menubar/index.js";export*from"./components/meter/index.js";export*from"./components/mockup/index.js";export*from"./components/modal/index.js";export*from"./components/navigation-menu/index.js";export*from"./components/number-field/index.js";export*from"./components/otp-field/index.js";export*from"./components/overlay/index.js";export*from"./components/page-layout/index.js";export*from"./components/pagination/index.js";export*from"./components/panes/index.js";export*from"./components/pie-chart/index.js";export*from"./components/pill/index.js";export*from"./components/popconfirm/index.js";export*from"./components/popover/index.js";export*from"./components/portal/index.js";export*from"./components/progress-box/index.js";export*from"./components/progress-circular/index.js";export*from"./components/progress-linear/index.js";export*from"./components/radio-group/index.js";export*from"./components/rating/index.js";export*from"./components/scatter-chart/index.js";export*from"./components/scroll-area/index.js";export*from"./components/scroll-zone/index.js";export*from"./components/segmented-button/index.js";export*from"./components/select/index.js";export*from"./components/show/index.js";export*from"./components/sidebar/index.js";export*from"./components/skeleton/index.js";export*from"./components/slider/index.js";export*from"./components/sparkline/index.js";export*from"./components/spoiler/index.js";export*from"./components/stack/index.js";export*from"./components/stat/index.js";export*from"./components/stepper/index.js";export*from"./components/switch/index.js";export*from"./components/table/index.js";export*from"./components/tabs/index.js";export*from"./components/text-field/index.js";export*from"./components/text-link/index.js";export*from"./components/time-picker/index.js";export*from"./components/timeline/index.js";export*from"./components/timeline-chart/index.js";export*from"./components/toast/index.js";export*from"./components/toggle/index.js";export*from"./components/toolbar/index.js";export*from"./components/tooltip/index.js";export*from"./components/tour/index.js";export*from"./components/tree/index.js";export*from"./components/tree-select/index.js";export*from"./components/transfer/index.js";export*from"./components/typography/index.js";export*from"./components/visually-hidden/index.js";export*from"./components/window-pane/index.js";
|
|
@@ -25,15 +25,27 @@
|
|
|
25
25
|
* `rotate` properties rather than on the `transform` shorthand, so a caller's
|
|
26
26
|
* own transform on the same element survives.
|
|
27
27
|
*
|
|
28
|
+
* ## Telling the children apart
|
|
29
|
+
*
|
|
30
|
+
* `stagger`, `durationStep` and `reverse` move an effect off the box and onto
|
|
31
|
+
* the things inside it, one after another. There is no `PlAnimateStagger`
|
|
32
|
+
* component and there should not be: a stagger is a *differential* rather than
|
|
33
|
+
* an effect, and a wrapper would be a second way to spell something all six
|
|
34
|
+
* effects can already say. `animateChildren` and `staggerSlots` are what
|
|
35
|
+
* `PlAnimateAppear` — which was staggering long before the six could — now runs
|
|
36
|
+
* on as well, because two implementations of "one after another" is two
|
|
37
|
+
* opinions about the arithmetic.
|
|
38
|
+
*
|
|
28
39
|
* ## What is deliberately not here
|
|
29
40
|
*
|
|
30
41
|
* An effect that has to know what its children *are* — a marquee that lays them
|
|
31
42
|
* down twice, a headline that swaps between them, a typewriter that counts
|
|
32
43
|
* graphemes — cannot be a class name and a few numbers. Those are components,
|
|
33
|
-
* and their logic stays in their own files.
|
|
44
|
+
* and their logic stays in their own files. They are also the four that cannot
|
|
45
|
+
* take a `stagger`, for the same reason: their children are already spoken for.
|
|
34
46
|
*/
|
|
35
47
|
import * as React from 'react';
|
|
36
|
-
import type { PlassAnimateRepeat, PlassAnimateTrigger, PlassAnimation, PlassSide } from '../types.js';
|
|
48
|
+
import type { PlassAnimateRepeat, PlassAnimateStaggerProps, PlassAnimateTimelineProps, PlassAnimateTrigger, PlassAnimation, PlassSide } from '../types.js';
|
|
37
49
|
/**
|
|
38
50
|
* Which keyframe an effect runs.
|
|
39
51
|
*
|
|
@@ -59,7 +71,15 @@ export declare function isInfinite(repeat: PlassAnimateRepeat | undefined): bool
|
|
|
59
71
|
* is `both`, so a faded-out element stays faded out instead of snapping back.
|
|
60
72
|
*/
|
|
61
73
|
export declare function directionValue(mode: 'in' | 'out', alternate: boolean | undefined): string;
|
|
62
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Where a scroll-linked effect starts and finishes, as an `animation-range`.
|
|
76
|
+
*
|
|
77
|
+
* Finished while the element is still arriving rather than when it reaches the
|
|
78
|
+
* middle of the screen: an entrance that is only half drawn by the time a
|
|
79
|
+
* reader has read past it is an entrance that never happened.
|
|
80
|
+
*/
|
|
81
|
+
export declare const defaultViewRange = "entry 0% cover 45%";
|
|
82
|
+
export interface AnimationSlotOptions extends PlassAnimateTimelineProps {
|
|
63
83
|
duration: number;
|
|
64
84
|
delay: number;
|
|
65
85
|
easing?: string;
|
|
@@ -73,6 +93,8 @@ export interface AnimationSlotOptions {
|
|
|
73
93
|
y?: string;
|
|
74
94
|
angle?: string;
|
|
75
95
|
angleTo?: string;
|
|
96
|
+
/** The `clip-path` a reveal is uncovered from. */
|
|
97
|
+
clip?: string;
|
|
76
98
|
}
|
|
77
99
|
/**
|
|
78
100
|
* The `--p-anim-*` slots, as an inline style object.
|
|
@@ -82,6 +104,14 @@ export interface AnimationSlotOptions {
|
|
|
82
104
|
* has never seen written down.
|
|
83
105
|
*/
|
|
84
106
|
export declare function animationSlots(options: AnimationSlotOptions): React.CSSProperties;
|
|
107
|
+
/**
|
|
108
|
+
* The `clip-path` a reveal starts from, given the edge it uncovers from.
|
|
109
|
+
*
|
|
110
|
+
* `inset()` takes its four sides in the physical order CSS writes them, and
|
|
111
|
+
* `PlassSide` is physical for the same reason it is on a slide: a title wiped
|
|
112
|
+
* in from the top is wiped in from the top in every writing direction.
|
|
113
|
+
*/
|
|
114
|
+
export declare function revealClip(from: PlassSide): string;
|
|
85
115
|
/**
|
|
86
116
|
* Which way a slide starts, given the edge it comes from.
|
|
87
117
|
*
|
|
@@ -101,6 +131,17 @@ export interface AnimationRunOptions {
|
|
|
101
131
|
paused?: boolean;
|
|
102
132
|
/** An infinite effect stops when the pointer leaves; a finite one finishes. */
|
|
103
133
|
infinite: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* A value that plays the effect again whenever it changes, and never on the
|
|
136
|
+
* first render.
|
|
137
|
+
*
|
|
138
|
+
* `play` is a boolean, so replaying with it means toggling off and on — two
|
|
139
|
+
* renders for one event, and a piece of state whose only job is to be
|
|
140
|
+
* flipped back. A response to something that can happen twice needs the
|
|
141
|
+
* *event*, and a value that has changed is the closest React has to one: a
|
|
142
|
+
* count of failed attempts already is this.
|
|
143
|
+
*/
|
|
144
|
+
nonce?: unknown;
|
|
104
145
|
}
|
|
105
146
|
export interface AnimationRun {
|
|
106
147
|
/** Goes on the animated element. */
|
|
@@ -109,7 +150,25 @@ export interface AnimationRun {
|
|
|
109
150
|
state: 'running' | 'paused';
|
|
110
151
|
/** Whether the animation has been let go at all. */
|
|
111
152
|
started: boolean;
|
|
112
|
-
/**
|
|
153
|
+
/**
|
|
154
|
+
* How many times it has been started, counting every hover, every `play` and
|
|
155
|
+
* every change of `nonce`.
|
|
156
|
+
*
|
|
157
|
+
* `started` stays `true` from the first start on, so a second hover changes
|
|
158
|
+
* nothing an effect could depend on. A keyframe does not need to know, because
|
|
159
|
+
* it is rewound in the DOM whenever this changes. Counter, Scramble and Typing
|
|
160
|
+
* run their own loops in JavaScript, and they replay by listing this among
|
|
161
|
+
* their effects' dependencies.
|
|
162
|
+
*/
|
|
163
|
+
runs: number;
|
|
164
|
+
/**
|
|
165
|
+
* The hover trigger's handlers when `trigger` is `hover`; empty otherwise.
|
|
166
|
+
*
|
|
167
|
+
* Merged with the caller's props through `mergeProps` rather than spread
|
|
168
|
+
* beside them. Both sides want `onPointerEnter` and `onFocus`, and a spread
|
|
169
|
+
* keeps only one: either a caller's prefetch never runs, or a caller's
|
|
170
|
+
* `onFocus` quietly takes the keyboard's way in away from the effect.
|
|
171
|
+
*/
|
|
113
172
|
handlers: React.HTMLAttributes<HTMLElement>;
|
|
114
173
|
}
|
|
115
174
|
/**
|
|
@@ -130,18 +189,73 @@ export interface AnimationRun {
|
|
|
130
189
|
* with it. Clearing `animation-name`, reading a layout property to force the
|
|
131
190
|
* style to settle, and putting it back is the one move that rewinds the element
|
|
132
191
|
* and leaves everything inside it alone.
|
|
192
|
+
*
|
|
193
|
+
* **`visible` is measured rather than observed.** Two observers report and
|
|
194
|
+
* neither decides: what they say is that the view has moved, and the answer is
|
|
195
|
+
* then read off the element's own resting box. An `IntersectionObserver` sees
|
|
196
|
+
* the element where its first frame is holding it, which for a slide is a
|
|
197
|
+
* screen from where it lives, so the box it reports on is the wrong box.
|
|
198
|
+
*/
|
|
199
|
+
export declare function useAnimationRun({ trigger, play, once, threshold, paused, infinite, nonce }: AnimationRunOptions): AnimationRun;
|
|
200
|
+
export interface StaggerPosition extends Required<PlassAnimateStaggerProps> {
|
|
201
|
+
index: number;
|
|
202
|
+
count: number;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Where one child sits in a staggered run.
|
|
206
|
+
*
|
|
207
|
+
* `reverse` turns the *order* round and nothing else: the last child goes
|
|
208
|
+
* first and every child still plays forwards. An effect that ran backwards is
|
|
209
|
+
* `mode="out"`, which is a different question and already has an answer.
|
|
210
|
+
*
|
|
211
|
+
* The duration is floored at zero rather than allowed to go negative, because a
|
|
212
|
+
* negative `animation-duration` is invalid and an invalid declaration is
|
|
213
|
+
* dropped — which would leave that one child playing at the CSS default while
|
|
214
|
+
* its neighbours honoured the prop.
|
|
215
|
+
*/
|
|
216
|
+
export declare function staggerSlots(slots: AnimationSlotOptions, { index, count, stagger, durationStep, reverse }: StaggerPosition): AnimationSlotOptions;
|
|
217
|
+
/**
|
|
218
|
+
* Writes one effect onto each child, with that child's own slots.
|
|
219
|
+
*
|
|
220
|
+
* Onto the children **themselves** rather than onto wrappers around them, which
|
|
221
|
+
* is the whole reason this is worth sharing: a row of `<li>`s stays a row of
|
|
222
|
+
* `<li>`s, a grid's cells stay its direct children, and nothing about the
|
|
223
|
+
* layout changes because the set is being animated. A wrapper per child would
|
|
224
|
+
* break every one of those.
|
|
225
|
+
*
|
|
226
|
+
* The trade is the one `React.cloneElement` always makes — a child has to
|
|
227
|
+
* accept a `className` and a `style` — and it is taken here and nowhere else in
|
|
228
|
+
* the library. It is bearable because what is being copied is *only* the
|
|
229
|
+
* animation, so a child that ignores both is a child that does not animate,
|
|
230
|
+
* rather than a child that lands in the wrong place. `PlStack` draws a wrapper
|
|
231
|
+
* per item instead, and takes the layout cost, precisely because *there* the
|
|
232
|
+
* failure would not be survivable: a child that dropped the class would land in
|
|
233
|
+
* the wrong place rather than merely arriving without an entrance.
|
|
234
|
+
*
|
|
235
|
+
* A bare string has no element to write onto, so that one is wrapped in a
|
|
236
|
+
* `<span>`. It is the only case that gets a wrapper.
|
|
133
237
|
*/
|
|
134
|
-
export declare function
|
|
135
|
-
export interface AnimateElementParams extends AnimationSlotOptions, AnimationRunOptions {
|
|
238
|
+
export declare function animateChildren(children: React.ReactNode, className: string, slotsFor: (index: number, count: number) => React.CSSProperties): React.ReactNode[];
|
|
239
|
+
export interface AnimateElementParams extends AnimationSlotOptions, AnimationRunOptions, PlassAnimateStaggerProps {
|
|
136
240
|
/** Which keyframe. `null` for the components that write their own. */
|
|
137
241
|
effect: PlassAnimation | null;
|
|
242
|
+
/** `transform-origin`, for the two effects that turn about a point. */
|
|
243
|
+
origin?: string;
|
|
244
|
+
/** Needed only to be handed back staggered. Passed straight through otherwise. */
|
|
245
|
+
children?: React.ReactNode;
|
|
138
246
|
}
|
|
139
247
|
export interface AnimateElement {
|
|
140
248
|
ref: React.RefCallback<HTMLElement>;
|
|
141
249
|
className: string;
|
|
142
250
|
style: React.CSSProperties;
|
|
143
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* The hover handlers and the two data attributes, to be merged with the
|
|
253
|
+
* caller's props through `mergeProps` for the reason `AnimationRun.handlers`
|
|
254
|
+
* gives.
|
|
255
|
+
*/
|
|
144
256
|
props: React.HTMLAttributes<HTMLElement> & Record<string, unknown>;
|
|
257
|
+
/** The children, with the effect written onto them if it was staggered. */
|
|
258
|
+
children: React.ReactNode;
|
|
145
259
|
}
|
|
146
260
|
/**
|
|
147
261
|
* Everything a one-keyframe `PlAnimate*` root needs, in one call.
|
package/dist/internal/animate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";export const animationClasses={fade:"plass-anim-fade",grow:"plass-anim-scale",slide:"plass-anim-slide",zoom:"plass-anim-scale",rotate:"plass-anim-rotate",blink:"plass-anim-blink"};export const animBaseClass="plass-anim";export function lengthValue(e){return"number"==typeof e?`${e}px`:e}export function repeatValue(e){return"infinite"===e?"infinite":String(e)}export function isInfinite(e){return"infinite"===e}export function directionValue(e,
|
|
1
|
+
import*as e from"react";import{cx as t}from"./styles.js";export const animationClasses={fade:"plass-anim-fade",grow:"plass-anim-scale",slide:"plass-anim-slide",zoom:"plass-anim-scale",rotate:"plass-anim-rotate",blink:"plass-anim-blink",reveal:"plass-anim-reveal"};export const animBaseClass="plass-anim";export function lengthValue(e){return"number"==typeof e?`${e}px`:e}export function repeatValue(e){return"infinite"===e?"infinite":String(e)}export function isInfinite(e){return"infinite"===e}export function directionValue(e,t){return"out"===e?t?"alternate-reverse":"reverse":t?"alternate":"normal"}export const defaultViewRange="entry 0% cover 45%";export function animationSlots(e){const t={"--p-anim-duration":`${e.duration}ms`,"--p-anim-delay":`${e.delay}ms`,"--p-anim-repeat":repeatValue(e.repeat),"--p-anim-direction":directionValue(e.mode??"in",e.alternate)};return e.easing&&(t["--p-anim-ease"]=e.easing),"view"===e.timeline&&(t["--p-anim-timeline"]="view()",t["--p-anim-range"]=e.range??defaultViewRange),void 0!==e.opacity&&(t["--p-anim-opacity"]=String(e.opacity)),void 0!==e.scale&&(t["--p-anim-scale"]=String(e.scale)),void 0!==e.x&&(t["--p-anim-x"]=e.x),void 0!==e.y&&(t["--p-anim-y"]=e.y),void 0!==e.angle&&(t["--p-anim-angle"]=e.angle),void 0!==e.angleTo&&(t["--p-anim-angle-to"]=e.angleTo),void 0!==e.clip&&(t["--p-anim-clip"]=e.clip),t}export function revealClip(e){switch(e){case"top":return"inset(0 0 100% 0)";case"bottom":return"inset(100% 0 0 0)";case"right":return"inset(0 0 0 100%)";default:return"inset(0 100% 0 0)"}}export function slideOffsets(e,t){const n=lengthValue(t),r="number"==typeof t?-t+"px":`calc(-1 * ${n})`;switch(e){case"top":return{x:"0px",y:r};case"bottom":return{x:"0px",y:n};case"left":return{x:r,y:"0px"};default:return{x:n,y:"0px"}}}function viewportRect(){const e=document.documentElement;return new DOMRect(0,0,e.clientWidth,e.clientHeight)}function holds(e,t){return null!==e&&t instanceof Node&&e.contains(t)}export function useAnimationRun({trigger:t,play:n,once:r,threshold:i,paused:a,infinite:o,nonce:s}){const l=e.useRef(null),[c,u]=e.useState("mount"===t),[m,p]=e.useState(0),f=e.useCallback(()=>{u(!0),p(e=>e+1)},[]);e.useLayoutEffect(()=>{const e=l.current;if(!e||0===m)return;const t=[e];for(const n of e.querySelectorAll(".plass-anim, .plass-marquee-track"))n.closest("[data-plass-animation]")===e&&t.push(n);for(const e of t)e.style.animationName="none";e.offsetWidth;for(const e of t)e.style.animationName=""},[m]);const d=e.useRef("mount"!==t);e.useEffect(()=>{d.current=!c},[c]),e.useEffect(()=>{if("visible"!==t)return;const e=l.current;if(!e||"undefined"==typeof IntersectionObserver)return void u(!0);const n=[],a=e.parentElement;let o=a?null:viewportRect();const check=()=>{if(!o)return;const t=function visibleShare(e,t){const n=e.width*e.height;if(n<=0)return 0;const r=Math.min(e.right,t.right)-Math.max(e.left,t.left),i=Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top);return Math.max(0,r)*Math.max(0,i)/n}(function restingRect(e,t){if(!t)return e.getBoundingClientRect();const n=e.style.animationName;e.style.animationName="none";const r=e.getBoundingClientRect();return e.style.animationName=n,r}(e,d.current),o);if(t>0&&t>=i){if(f(),r)for(const e of n)e.disconnect()}else r||u(!1)},s=function measureSteps(e){const t=Array.from({length:21},(e,t)=>t/20);return e>0&&e<1?[...t,e]:t}(i);if(a){const e=new IntersectionObserver(([e])=>{o=function clipRect(e){const t=e.boundingClientRect;return t.width*t.height>0?e.intersectionRect:e.rootBounds??viewportRect()}(e),check()},{threshold:s});n.push(e),e.observe(a)}const c=new IntersectionObserver(check,{threshold:s});return n.push(c),c.observe(e),()=>{for(const e of n)e.disconnect()}},[t,r,i,f]);const g=e.useRef(s);e.useEffect(()=>{Object.is(s,g.current)||(g.current=s,f())},[s,f]),e.useEffect(()=>{"manual"===t&&(n?f():u(!1))},[t,n,f]);const h="hover"===t?{onPointerEnter:f,onFocus:e=>{holds(l.current,e.relatedTarget)||f()},onPointerLeave:()=>{o&&u(!1)},onBlur:e=>{o&&!holds(l.current,e.relatedTarget)&&u(!1)}}:{};return{ref:e.useCallback(e=>{l.current=e},[]),state:c&&!a?"running":"paused",started:c,runs:m,handlers:h}}export function staggerSlots(e,{index:t,count:n,stagger:r,durationStep:i,reverse:a}){const o=a?n-1-t:t;return{...e,delay:e.delay+o*r,duration:Math.max(0,e.duration+o*i)}}export function animateChildren(n,r,i){const a=e.Children.toArray(n);return a.map((n,o)=>{const s=i(o,a.length);if(!e.isValidElement(n))return e.createElement("span",{key:o,className:r,style:s},n);const l=n.props;return e.cloneElement(n,{className:t(r,l.className),style:{...s,...l.style}})})}export function useAnimateElement(e){const{effect:t,trigger:n,play:r,once:i,threshold:a,paused:o,infinite:s,nonce:l,stagger:c=0,durationStep:u=0,reverse:m=!1,origin:p,children:f,...d}=e,g=useAnimationRun({trigger:"view"===d.timeline?"mount":n,play:r,once:i,threshold:a,paused:o,infinite:s,nonce:l}),h=t?`plass-anim ${animationClasses[t]}`:"",y=0!==c&&null!==t,v=void 0===p?null:{transformOrigin:p};return{ref:g.ref,className:y?"":h,style:{...v,...y?null:animationSlots(d),"--p-anim-state":g.state},props:{...g.handlers,"data-plass-animation":t??void 0,"data-state":g.state},children:y?animateChildren(f,h,(e,t)=>({...v,...animationSlots(staggerSlots(d,{index:e,count:t,stagger:c,durationStep:u,reverse:m}))})):f}}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The width of each rung, and the queries the library asks about them.
|
|
3
|
+
*
|
|
4
|
+
* The ladder itself is declared **in the stylesheet**, as
|
|
5
|
+
* `--plass-breakpoint-*`, because a page must not have two answers about how
|
|
6
|
+
* wide it is. That file explains the whole arrangement; the short version is
|
|
7
|
+
* that a media query's *condition* cannot read a custom property, so the CSS
|
|
8
|
+
* half resolves Tailwind's `--breakpoint-*` theme at build time through
|
|
9
|
+
* `@variant`, and this — where a breakpoint is a *value* rather than a
|
|
10
|
+
* condition — reads the same answer off the document at runtime.
|
|
11
|
+
*
|
|
12
|
+
* So a project that moves a breakpoint moves one thing:
|
|
13
|
+
*
|
|
14
|
+
* @theme { --breakpoint-md: 50rem; }
|
|
15
|
+
*
|
|
16
|
+
* and both halves follow.
|
|
17
|
+
*/
|
|
18
|
+
import type { PlassBreakpointFloor } from '../types.js';
|
|
19
|
+
/**
|
|
20
|
+
* Tailwind's own widths, and what is used when the stylesheet cannot be read.
|
|
21
|
+
*
|
|
22
|
+
* That is not an edge case: it is every server render, and the first client
|
|
23
|
+
* render of a page whose CSS has not arrived. Both want the same answer the
|
|
24
|
+
* shipped stylesheet has baked in, which is this.
|
|
25
|
+
*/
|
|
26
|
+
export declare const defaultFloors: Record<PlassBreakpointFloor, string>;
|
|
27
|
+
export declare function breakpointFloors(): Record<PlassBreakpointFloor, string>;
|
|
28
|
+
/** `(width >= …)` — at this rung and above. */
|
|
29
|
+
export declare function fromQuery(rung: PlassBreakpointFloor): string;
|
|
30
|
+
/** `(width < …)` — below this rung. The mirror of `fromQuery`, never both. */
|
|
31
|
+
export declare function belowQuery(rung: PlassBreakpointFloor): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";export const defaultFloors={sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem"};let e=null;export function breakpointFloors(){if(e)return e;if("undefined"==typeof document||"undefined"==typeof getComputedStyle)return defaultFloors;const t=getComputedStyle(document.documentElement),read=e=>{const o=t.getPropertyValue(`--plass-breakpoint-${e}`).trim();return""===o?defaultFloors[e]:o};return e={sm:read("sm"),md:read("md"),lg:read("lg"),xl:read("xl")},e}export function fromQuery(e){return`(width >= ${breakpointFloors()[e]})`}export function belowQuery(e){return`(width < ${breakpointFloors()[e]})`}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What a `PlButton` inherits from the `PlButtonGroup` around it
|
|
2
|
+
* What a `PlButton` inherits from the `PlButtonGroup` around it, and what a run
|
|
3
|
+
* of keys is made of.
|
|
3
4
|
*
|
|
4
5
|
* A context rather than `React.Children.map` with `cloneElement`, and a file of
|
|
5
6
|
* its own rather than something the group exports, for one reason each.
|
|
@@ -13,9 +14,13 @@
|
|
|
13
14
|
* Every field is optional, and every one of them means *not specified* rather
|
|
14
15
|
* than a value: a button falls back to its own default, so a `PlButtonGroup`
|
|
15
16
|
* with no props of its own changes nothing except the corners.
|
|
17
|
+
*
|
|
18
|
+
* The three class lists at the end are here for the same reason the context is:
|
|
19
|
+
* a `PlToggleGroup` is the same run of keys with a selection on it, and two
|
|
20
|
+
* copies of the join would be two places for the seam to stop lining up.
|
|
16
21
|
*/
|
|
17
22
|
import * as React from 'react';
|
|
18
|
-
import type { PlassColor, PlassDensity, PlassElevation, PlassSize, PlassVariant } from '../types.js';
|
|
23
|
+
import type { PlassColor, PlassDensity, PlassElevation, PlassOrientation, PlassSize, PlassVariant } from '../types.js';
|
|
19
24
|
export interface PlassButtonGroupContextValue {
|
|
20
25
|
variant?: PlassVariant;
|
|
21
26
|
size?: PlassSize;
|
|
@@ -25,3 +30,25 @@ export interface PlassButtonGroupContextValue {
|
|
|
25
30
|
disabled?: boolean;
|
|
26
31
|
}
|
|
27
32
|
export declare const ButtonGroupContext: React.Context<PlassButtonGroupContextValue | null>;
|
|
33
|
+
/**
|
|
34
|
+
* The corners that face a neighbour are squared off, so a run reads as one
|
|
35
|
+
* piece scored into segments rather than as three keys that happen to be
|
|
36
|
+
* touching.
|
|
37
|
+
*
|
|
38
|
+
* Logical properties (`s`/`e`) rather than left/right: under RTL the first key
|
|
39
|
+
* is on the right, and `rounded-l-none` would flatten the wrong side.
|
|
40
|
+
*/
|
|
41
|
+
export declare const groupJoinClasses: Record<PlassOrientation, string>;
|
|
42
|
+
/**
|
|
43
|
+
* Only `glass` needs the overlap, because it is the only variant that draws an
|
|
44
|
+
* edge. Two glass keys meeting would otherwise show both of their hairlines and
|
|
45
|
+
* the seam would be twice as heavy as every other edge on the page; pulling the
|
|
46
|
+
* second one back a pixel makes the two share one line.
|
|
47
|
+
*
|
|
48
|
+
* A `solid` run must **not** do this. Its keys have no border to double up, and
|
|
49
|
+
* overlapping would put one gradient over the start of the next — which is
|
|
50
|
+
* exactly the join the squared corners are drawing.
|
|
51
|
+
*/
|
|
52
|
+
export declare const groupOverlapClasses: Record<PlassOrientation, string>;
|
|
53
|
+
/** What a run of keys is, before either of the two above. */
|
|
54
|
+
export declare const groupBaseClasses: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as
|
|
2
|
-
/* @__PURE__ */
|
|
1
|
+
import*as o from"react";export const ButtonGroupContext=
|
|
2
|
+
/* @__PURE__ */o.createContext(null);export const groupJoinClasses={horizontal:"[&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none",vertical:"[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none"};export const groupOverlapClasses={horizontal:"[&>*:not(:first-child)]:-ms-px",vertical:"[&>*:not(:first-child)]:-mt-px"};export const groupBaseClasses=/* @__PURE__ */["inline-flex align-middle","[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10","[&>*]:shrink-0"].join(" ");
|