plass-ui 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +668 -0
- package/README.md +1 -1
- package/dist/components/accordion/PlAccordion.js +1 -1
- package/dist/components/alert/PlAlert.js +1 -1
- package/dist/components/anchor/PlAnchor.d.ts +72 -0
- package/dist/components/anchor/PlAnchor.js +1 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.js +1 -0
- package/dist/components/animate-appear/PlAnimateAppear.d.ts +10 -0
- package/dist/components/animate-appear/PlAnimateAppear.js +1 -1
- package/dist/components/animate-blink/PlAnimateBlink.d.ts +2 -2
- package/dist/components/animate-blink/PlAnimateBlink.js +1 -1
- package/dist/components/animate-counter/PlAnimateCounter.d.ts +83 -0
- package/dist/components/animate-counter/PlAnimateCounter.js +1 -0
- package/dist/components/animate-counter/index.d.ts +2 -0
- package/dist/components/animate-counter/index.js +1 -0
- package/dist/components/animate-fade/PlAnimateFade.d.ts +2 -2
- package/dist/components/animate-fade/PlAnimateFade.js +1 -1
- package/dist/components/animate-float/PlAnimateFloat.d.ts +51 -0
- package/dist/components/animate-float/PlAnimateFloat.js +1 -0
- package/dist/components/animate-float/index.d.ts +2 -0
- package/dist/components/animate-float/index.js +1 -0
- package/dist/components/animate-grow/PlAnimateGrow.d.ts +2 -2
- package/dist/components/animate-grow/PlAnimateGrow.js +1 -1
- package/dist/components/animate-headline/PlAnimateHeadline.js +1 -1
- package/dist/components/animate-lighting/PlAnimateLighting.js +1 -1
- package/dist/components/animate-reveal/PlAnimateReveal.d.ts +51 -0
- package/dist/components/animate-reveal/PlAnimateReveal.js +1 -0
- package/dist/components/animate-reveal/index.d.ts +2 -0
- package/dist/components/animate-reveal/index.js +1 -0
- package/dist/components/animate-rotate/PlAnimateRotate.d.ts +2 -2
- package/dist/components/animate-rotate/PlAnimateRotate.js +1 -1
- package/dist/components/animate-scramble/PlAnimateScramble.d.ts +75 -0
- package/dist/components/animate-scramble/PlAnimateScramble.js +1 -0
- package/dist/components/animate-scramble/index.d.ts +2 -0
- package/dist/components/animate-scramble/index.js +1 -0
- package/dist/components/animate-shake/PlAnimateShake.d.ts +57 -0
- package/dist/components/animate-shake/PlAnimateShake.js +1 -0
- package/dist/components/animate-shake/index.d.ts +2 -0
- package/dist/components/animate-shake/index.js +1 -0
- package/dist/components/animate-slide/PlAnimateSlide.d.ts +2 -2
- package/dist/components/animate-slide/PlAnimateSlide.js +1 -1
- package/dist/components/animate-split/PlAnimateSplit.d.ts +54 -0
- package/dist/components/animate-split/PlAnimateSplit.js +1 -0
- package/dist/components/animate-split/index.d.ts +2 -0
- package/dist/components/animate-split/index.js +1 -0
- package/dist/components/animate-typing/PlAnimateTyping.js +1 -1
- package/dist/components/animate-zoom/PlAnimateZoom.d.ts +2 -2
- package/dist/components/animate-zoom/PlAnimateZoom.js +1 -1
- package/dist/components/app-logo/PlAppLogo.d.ts +78 -0
- package/dist/components/app-logo/PlAppLogo.js +1 -0
- package/dist/components/app-logo/index.d.ts +2 -0
- package/dist/components/app-logo/index.js +1 -0
- package/dist/components/area-chart/PlAreaChart.d.ts +54 -0
- package/dist/components/area-chart/PlAreaChart.js +1 -0
- package/dist/components/area-chart/index.d.ts +2 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/aspect-ratio/PlAspectRatio.js +1 -1
- package/dist/components/avatar/PlAvatar.js +1 -1
- package/dist/components/back-top/PlBackTop.d.ts +55 -0
- package/dist/components/back-top/PlBackTop.js +1 -0
- package/dist/components/back-top/index.d.ts +2 -0
- package/dist/components/back-top/index.js +1 -0
- package/dist/components/badge/PlBadge.js +1 -1
- package/dist/components/bar-chart/PlBarChart.d.ts +63 -0
- package/dist/components/bar-chart/PlBarChart.js +1 -0
- package/dist/components/bar-chart/index.d.ts +2 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/blockquote/PlBlockquote.js +1 -1
- package/dist/components/bottom-navigation/PlBottomNavigation.js +1 -1
- package/dist/components/box/PlBox.js +1 -1
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button/PlButton.js +1 -1
- package/dist/components/button-group/PlButtonGroup.js +1 -1
- package/dist/components/calendar/PlCalendar.d.ts +104 -0
- package/dist/components/calendar/PlCalendar.js +1 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/card/PlCard.js +1 -1
- package/dist/components/carousel/PlCarousel.js +1 -1
- package/dist/components/chat-bubble/PlChatBubble.js +1 -1
- package/dist/components/checkbox/PlCheckbox.js +1 -1
- package/dist/components/chip/PlChip.js +1 -1
- package/dist/components/code-block/PlCodeBlock.d.ts +175 -0
- package/dist/components/code-block/PlCodeBlock.js +1 -0
- package/dist/components/code-block/index.d.ts +2 -0
- package/dist/components/code-block/index.js +1 -0
- package/dist/components/collapsible/PlCollapsible.js +1 -1
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +11 -2
- package/dist/components/combobox/PlCombobox.js +1 -1
- package/dist/components/command-palette/PlCommandPalette.d.ts +1 -1
- package/dist/components/command-palette/PlCommandPalette.js +1 -1
- package/dist/components/confirm/PlConfirmProvider.d.ts +100 -0
- package/dist/components/confirm/PlConfirmProvider.js +1 -0
- package/dist/components/confirm/index.d.ts +2 -0
- package/dist/components/confirm/index.js +1 -0
- package/dist/components/container/PlContainer.d.ts +22 -6
- package/dist/components/container/PlContainer.js +1 -1
- package/dist/components/data-list/PlDataList.d.ts +74 -0
- package/dist/components/data-list/PlDataList.js +1 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.js +1 -0
- package/dist/components/data-table/PlDataTable.d.ts +202 -0
- package/dist/components/data-table/PlDataTable.js +1 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.js +1 -0
- package/dist/components/date-picker/PlDatePicker.d.ts +41 -2
- package/dist/components/date-picker/PlDatePicker.js +1 -1
- package/dist/components/date-range-picker/PlDateRangePicker.js +1 -1
- package/dist/components/date-time-picker/PlDateTimePicker.js +1 -1
- package/dist/components/divider/PlDivider.js +1 -1
- package/dist/components/drawer/PlDrawer.d.ts +1 -1
- package/dist/components/drawer/PlDrawer.js +1 -1
- package/dist/components/empty/PlEmpty.d.ts +47 -0
- package/dist/components/empty/PlEmpty.js +1 -0
- package/dist/components/empty/index.d.ts +2 -0
- package/dist/components/empty/index.js +1 -0
- package/dist/components/file-picker/PlFilePicker.js +1 -1
- package/dist/components/flex/PlFlex.d.ts +83 -0
- package/dist/components/flex/PlFlex.js +1 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +1 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +81 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -0
- package/dist/components/floating-action-button/index.d.ts +2 -0
- package/dist/components/floating-action-button/index.js +1 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +1 -1
- package/dist/components/footer/PlFooter.d.ts +4 -3
- package/dist/components/footer/PlFooter.js +1 -1
- package/dist/components/gallery/PlGallery.d.ts +154 -0
- package/dist/components/gallery/PlGallery.js +1 -0
- package/dist/components/gallery/PlGalleryViewer.d.ts +31 -0
- package/dist/components/gallery/PlGalleryViewer.js +1 -0
- package/dist/components/gallery/index.d.ts +2 -0
- package/dist/components/gallery/index.js +1 -0
- package/dist/components/gauge-chart/PlGaugeChart.d.ts +64 -0
- package/dist/components/gauge-chart/PlGaugeChart.js +1 -0
- package/dist/components/gauge-chart/index.d.ts +2 -0
- package/dist/components/gauge-chart/index.js +1 -0
- package/dist/components/grid/PlGrid.js +1 -1
- package/dist/components/grid/PlGridItem.js +1 -1
- package/dist/components/header/PlHeader.d.ts +4 -3
- package/dist/components/header/PlHeader.js +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.d.ts +69 -0
- package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -0
- package/dist/components/heatmap-chart/index.d.ts +2 -0
- package/dist/components/heatmap-chart/index.js +1 -0
- package/dist/components/highlight/PlHighlight.js +1 -1
- package/dist/components/hot-keys/PlHotKeys.js +1 -1
- package/dist/components/hover-card/PlHoverCard.d.ts +94 -0
- package/dist/components/hover-card/PlHoverCard.js +1 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/how-to-steps/PlHowToSteps.d.ts +87 -0
- package/dist/components/how-to-steps/PlHowToSteps.js +1 -0
- package/dist/components/how-to-steps/index.d.ts +2 -0
- package/dist/components/how-to-steps/index.js +1 -0
- package/dist/components/image/PlImage.d.ts +72 -0
- package/dist/components/image/PlImage.js +1 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/line-chart/PlLineChart.d.ts +74 -0
- package/dist/components/line-chart/PlLineChart.js +1 -0
- package/dist/components/line-chart/index.d.ts +2 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/list/PlList.js +1 -1
- package/dist/components/menu/PlMenu.d.ts +2 -2
- package/dist/components/menu/PlMenu.js +1 -1
- package/dist/components/menubar/PlMenubar.js +1 -1
- package/dist/components/meter/PlMeter.d.ts +83 -0
- package/dist/components/meter/PlMeter.js +1 -0
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/index.js +1 -0
- package/dist/components/mockup/PlMockup.d.ts +146 -0
- package/dist/components/mockup/PlMockup.js +1 -0
- package/dist/components/mockup/index.d.ts +2 -0
- package/dist/components/mockup/index.js +1 -0
- package/dist/components/modal/PlModal.d.ts +1 -1
- package/dist/components/modal/PlModal.js +1 -1
- package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +11 -2
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.d.ts +10 -1
- package/dist/components/otp-field/PlOtpField.js +1 -1
- package/dist/components/overlay/PlOverlay.d.ts +1 -1
- package/dist/components/overlay/PlOverlay.js +1 -1
- package/dist/components/page-layout/PlPageLayout.js +1 -1
- package/dist/components/pagination/PlPagination.js +1 -1
- package/dist/components/panes/PlPanes.d.ts +2 -2
- package/dist/components/panes/PlPanes.js +1 -1
- package/dist/components/pie-chart/PlPieChart.d.ts +58 -0
- package/dist/components/pie-chart/PlPieChart.js +1 -0
- package/dist/components/pie-chart/index.d.ts +2 -0
- package/dist/components/pie-chart/index.js +1 -0
- package/dist/components/pill/PlPill.js +1 -1
- package/dist/components/popconfirm/PlPopconfirm.d.ts +61 -0
- package/dist/components/popconfirm/PlPopconfirm.js +1 -0
- package/dist/components/popconfirm/index.d.ts +2 -0
- package/dist/components/popconfirm/index.js +1 -0
- package/dist/components/popover/PlPopover.d.ts +1 -1
- package/dist/components/popover/PlPopover.js +1 -1
- package/dist/components/portal/PlPortal.d.ts +78 -0
- package/dist/components/portal/PlPortal.js +1 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/progress-box/PlProgressBox.js +1 -1
- package/dist/components/progress-circular/PlProgressCircular.js +1 -1
- package/dist/components/progress-linear/PlProgressLinear.js +1 -1
- package/dist/components/radio-group/PlRadioGroup.js +1 -1
- package/dist/components/rating/PlRating.js +1 -1
- package/dist/components/scatter-chart/PlScatterChart.d.ts +46 -0
- package/dist/components/scatter-chart/PlScatterChart.js +1 -0
- package/dist/components/scatter-chart/index.d.ts +2 -0
- package/dist/components/scatter-chart/index.js +1 -0
- package/dist/components/scroll-area/PlScrollArea.d.ts +98 -0
- package/dist/components/scroll-area/PlScrollArea.js +1 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.js +1 -0
- package/dist/components/scroll-zone/PlScrollZone.d.ts +9 -5
- package/dist/components/scroll-zone/PlScrollZone.js +1 -1
- package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
- package/dist/components/select/PlSelect.d.ts +10 -1
- package/dist/components/select/PlSelect.js +1 -1
- package/dist/components/show/PlShow.d.ts +60 -0
- package/dist/components/show/PlShow.js +1 -0
- package/dist/components/show/index.d.ts +2 -0
- package/dist/components/show/index.js +1 -0
- package/dist/components/sidebar/PlSidebar.js +1 -1
- package/dist/components/skeleton/PlSkeleton.js +1 -1
- package/dist/components/slider/PlSlider.js +1 -1
- package/dist/components/sparkline/PlSparkline.d.ts +68 -0
- package/dist/components/sparkline/PlSparkline.js +1 -0
- package/dist/components/sparkline/index.d.ts +2 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/spoiler/PlSpoiler.d.ts +8 -0
- package/dist/components/spoiler/PlSpoiler.js +1 -1
- package/dist/components/stack/PlStack.d.ts +114 -0
- package/dist/components/stack/PlStack.js +1 -0
- package/dist/components/stack/index.d.ts +2 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/stat/PlStat.d.ts +66 -0
- package/dist/components/stat/PlStat.js +1 -0
- package/dist/components/stat/index.d.ts +2 -0
- package/dist/components/stat/index.js +1 -0
- package/dist/components/stepper/PlStepper.d.ts +86 -0
- package/dist/components/stepper/PlStepper.js +1 -0
- package/dist/components/stepper/index.d.ts +2 -0
- package/dist/components/stepper/index.js +1 -0
- package/dist/components/switch/PlSwitch.js +1 -1
- package/dist/components/table/PlTable.js +1 -1
- package/dist/components/tabs/PlTabs.d.ts +2 -2
- package/dist/components/tabs/PlTabs.js +1 -1
- package/dist/components/text-field/PlTextField.d.ts +10 -1
- package/dist/components/text-field/PlTextField.js +1 -1
- package/dist/components/text-link/PlTextLink.js +1 -1
- package/dist/components/time-picker/PlTimePicker.js +1 -1
- package/dist/components/timeline/PlTimeline.d.ts +7 -10
- package/dist/components/timeline/PlTimeline.js +1 -1
- package/dist/components/timeline-chart/PlTimelineChart.d.ts +44 -0
- package/dist/components/timeline-chart/PlTimelineChart.js +1 -0
- package/dist/components/timeline-chart/index.d.ts +2 -0
- package/dist/components/timeline-chart/index.js +1 -0
- package/dist/components/toast/PlToast.d.ts +1 -1
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/toggle/PlToggleGroup.js +1 -1
- package/dist/components/toolbar/PlToolbar.js +1 -1
- package/dist/components/tooltip/PlTooltip.d.ts +1 -1
- package/dist/components/tooltip/PlTooltip.js +1 -1
- package/dist/components/tour/PlTour.d.ts +134 -0
- package/dist/components/tour/PlTour.js +1 -0
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tour/index.js +1 -0
- package/dist/components/transfer/PlTransfer.js +1 -1
- package/dist/components/tree/PlTree.d.ts +67 -0
- package/dist/components/tree/PlTree.js +1 -0
- package/dist/components/tree/index.d.ts +2 -0
- package/dist/components/tree/index.js +1 -0
- package/dist/components/tree-select/PlTreeSelect.d.ts +99 -0
- package/dist/components/tree-select/PlTreeSelect.js +1 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/visually-hidden/PlVisuallyHidden.d.ts +46 -0
- package/dist/components/visually-hidden/PlVisuallyHidden.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +1 -0
- package/dist/components/window-pane/PlWindowPane.d.ts +179 -0
- package/dist/components/window-pane/PlWindowPane.js +1 -0
- package/dist/components/window-pane/index.d.ts +2 -0
- package/dist/components/window-pane/index.js +1 -0
- package/dist/css/anchor.css +2 -0
- package/dist/css/animate-counter.css +2 -0
- package/dist/css/animate-float.css +2 -0
- package/dist/css/animate-reveal.css +2 -0
- package/dist/css/animate-scramble.css +2 -0
- package/dist/css/animate-shake.css +2 -0
- package/dist/css/animate-split.css +2 -0
- package/dist/css/app-logo.css +2 -0
- package/dist/css/area-chart.css +2 -0
- package/dist/css/back-top.css +2 -0
- package/dist/css/bar-chart.css +2 -0
- package/dist/css/calendar.css +2 -0
- package/dist/css/code-block.css +2 -0
- package/dist/css/confirm.css +2 -0
- package/dist/css/data-list.css +2 -0
- package/dist/css/data-table.css +2 -0
- package/dist/css/empty.css +2 -0
- package/dist/css/flex.css +2 -0
- package/dist/css/floating-action-button.css +2 -0
- package/dist/css/gallery.css +2 -0
- package/dist/css/gauge-chart.css +2 -0
- package/dist/css/heatmap-chart.css +2 -0
- package/dist/css/hover-card.css +2 -0
- package/dist/css/how-to-steps.css +2 -0
- package/dist/css/image.css +2 -0
- package/dist/css/line-chart.css +2 -0
- package/dist/css/meter.css +2 -0
- package/dist/css/mockup.css +2 -0
- package/dist/css/pie-chart.css +2 -0
- package/dist/css/popconfirm.css +2 -0
- package/dist/css/portal.css +2 -0
- package/dist/css/scatter-chart.css +2 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/show.css +2 -0
- package/dist/css/sparkline.css +2 -0
- package/dist/css/stack.css +2 -0
- package/dist/css/stat.css +2 -0
- package/dist/css/stepper.css +2 -0
- package/dist/css/timeline-chart.css +2 -0
- package/dist/css/tour.css +2 -0
- package/dist/css/tree-select.css +2 -0
- package/dist/css/tree.css +2 -0
- package/dist/css/visually-hidden.css +2 -0
- package/dist/css/window-pane.css +2 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/usePlBreakpoint.d.ts +41 -0
- package/dist/hooks/usePlBreakpoint.js +1 -0
- package/dist/hooks/usePlColorScheme.d.ts +66 -0
- package/dist/hooks/usePlColorScheme.js +1 -0
- package/dist/hooks/usePlDisclosure.d.ts +44 -0
- package/dist/hooks/usePlDisclosure.js +1 -0
- package/dist/hooks/usePlElementSize.d.ts +31 -0
- package/dist/hooks/usePlElementSize.js +1 -0
- package/dist/hooks/usePlHotKeys.d.ts +81 -0
- package/dist/hooks/usePlHotKeys.js +1 -0
- package/dist/hooks/usePlMediaQuery.d.ts +22 -0
- package/dist/hooks/usePlMediaQuery.js +1 -0
- package/dist/hooks/usePlOnScreen.d.ts +50 -0
- package/dist/hooks/usePlOnScreen.js +1 -0
- package/dist/hooks/usePlReducedMotion.d.ts +22 -0
- package/dist/hooks/usePlReducedMotion.js +1 -0
- package/dist/index.d.ts +46 -1
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +91 -6
- package/dist/internal/animate.js +1 -1
- package/dist/internal/breakpoints.d.ts +31 -0
- package/dist/internal/breakpoints.js +1 -0
- package/dist/internal/button-group.d.ts +29 -2
- package/dist/internal/button-group.js +2 -2
- package/dist/internal/calendar.d.ts +33 -36
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +458 -0
- package/dist/internal/chart-frame.js +1 -0
- package/dist/internal/chart-line.d.ts +44 -0
- package/dist/internal/chart-line.js +1 -0
- package/dist/internal/chart.d.ts +473 -0
- package/dist/internal/chart.js +1 -0
- package/dist/internal/color-scheme.d.ts +23 -0
- package/dist/internal/color-scheme.js +1 -0
- package/dist/internal/data-table.d.ts +69 -0
- package/dist/internal/data-table.js +1 -0
- package/dist/internal/date.d.ts +21 -0
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +74 -0
- package/dist/internal/defaults.js +1 -0
- package/dist/internal/direction.d.ts +4 -0
- package/dist/internal/direction.js +1 -0
- package/dist/internal/drag.d.ts +49 -0
- package/dist/internal/drag.js +1 -0
- package/dist/internal/format.d.ts +2 -0
- package/dist/internal/format.js +1 -1
- package/dist/internal/gallery.d.ts +34 -0
- package/dist/internal/gallery.js +1 -0
- package/dist/internal/grid.d.ts +6 -25
- package/dist/internal/grid.js +1 -1
- package/dist/internal/highlight.d.ts +98 -0
- package/dist/internal/highlight.js +1 -0
- package/dist/internal/icons.d.ts +10 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/keys.d.ts +93 -0
- package/dist/internal/keys.js +1 -0
- package/dist/internal/labels.d.ts +138 -0
- package/dist/internal/labels.js +1 -0
- package/dist/internal/media.d.ts +26 -0
- package/dist/internal/media.js +1 -0
- package/dist/internal/mockup.d.ts +193 -0
- package/dist/internal/mockup.js +1 -0
- package/dist/internal/page-layout.d.ts +6 -6
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/progress.d.ts +6 -0
- package/dist/internal/responsive.d.ts +108 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/scramble.d.ts +31 -0
- package/dist/internal/scramble.js +1 -0
- package/dist/internal/steps.d.ts +76 -0
- package/dist/internal/steps.js +1 -0
- package/dist/internal/styles.d.ts +15 -0
- package/dist/internal/styles.js +1 -1
- package/dist/internal/table.d.ts +86 -0
- package/dist/internal/table.js +1 -0
- package/dist/internal/threshold.d.ts +19 -0
- package/dist/internal/threshold.js +1 -0
- package/dist/internal/tour.d.ts +42 -0
- package/dist/internal/tour.js +1 -0
- package/dist/internal/window.d.ts +201 -0
- package/dist/internal/window.js +1 -0
- package/dist/locales/de.d.ts +3 -0
- package/dist/locales/de.js +1 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/es.d.ts +3 -0
- package/dist/locales/es.js +1 -0
- package/dist/locales/fr.d.ts +3 -0
- package/dist/locales/fr.js +1 -0
- package/dist/locales/index.d.ts +33 -0
- package/dist/locales/index.js +1 -0
- package/dist/locales/ja.d.ts +3 -0
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ko.d.ts +3 -0
- package/dist/locales/ko.js +1 -0
- package/dist/locales/zh-Hans.d.ts +3 -0
- package/dist/locales/zh-Hans.js +1 -0
- package/dist/provider/PlColorSchemeScript.d.ts +40 -0
- package/dist/provider/PlColorSchemeScript.js +1 -0
- package/dist/provider/PlassProvider.d.ts +39 -0
- package/dist/provider/PlassProvider.js +1 -0
- package/dist/provider/index.d.ts +6 -0
- package/dist/provider/index.js +1 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1133 -20
- package/dist/tokens.css +1133 -20
- package/dist/types.d.ts +398 -2
- package/package.json +30 -4
- package/dist/components/avatar-group/PlAvatarGroup.d.ts +0 -47
- package/dist/components/avatar-group/PlAvatarGroup.js +0 -1
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/avatar-group/index.js +0 -1
- package/dist/css/avatar-group.css +0 -2
- package/dist/internal/avatar-group.d.ts +0 -25
- package/dist/internal/avatar-group.js +0 -2
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
export interface PlVisuallyHiddenProps extends React.ComponentPropsWithoutRef<'span'> {
|
|
4
|
+
/**
|
|
5
|
+
* Brings the content back into the page while anything inside it has the
|
|
6
|
+
* focus, and clips it again as soon as the focus leaves.
|
|
7
|
+
*
|
|
8
|
+
* Off by default, because the ordinary use of this component is a name that
|
|
9
|
+
* is never meant to be seen. The exception is the one element that *must*
|
|
10
|
+
* appear when it is reached — a skip link — and there is no way for a caller
|
|
11
|
+
* to add it from the outside: the clip is `position: absolute`, so revealing
|
|
12
|
+
* it means putting the element back in the flow, which a `className` cannot
|
|
13
|
+
* do without also fighting the class it is trying to override.
|
|
14
|
+
*
|
|
15
|
+
* `:focus-within` rather than `:focus`, because the thing being tabbed to is
|
|
16
|
+
* almost always a link *inside* the box rather than the box itself — and
|
|
17
|
+
* `:focus-within` matches the element when it holds the focus too, so the
|
|
18
|
+
* narrower case is covered by the wider one.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
focusable?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Renders something other than a `<span>`: `render={<div />}`,
|
|
24
|
+
* `render={<h2 />}`. Base UI's own escape hatch.
|
|
25
|
+
*/
|
|
26
|
+
render?: useRender.RenderProp;
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Content for a screen reader and for nobody else.
|
|
31
|
+
*
|
|
32
|
+
* It is not a styling escape hatch and it is not `display: none`. The two
|
|
33
|
+
* obvious ways to hide something — `hidden` and `opacity: 0` — are both wrong
|
|
34
|
+
* in the same place: the first takes the text off the accessibility tree along
|
|
35
|
+
* with the screen, which is the one thing this component exists to avoid, and
|
|
36
|
+
* the second leaves a clickable ghost the size of the words. A one-pixel
|
|
37
|
+
* clipped box is the only form that is absent to a sighted reader and present
|
|
38
|
+
* to every other kind.
|
|
39
|
+
*
|
|
40
|
+
* What it is for is the sentence a control cannot say out loud — the word
|
|
41
|
+
* "Close" on a button that draws an ✕, the unit after a number, the change of
|
|
42
|
+
* context on a link that says "read more". The library already reaches for this
|
|
43
|
+
* inside a dozen components; this is the same rule, spelled once, for the
|
|
44
|
+
* caller's own markup.
|
|
45
|
+
*/
|
|
46
|
+
export declare const PlVisuallyHidden: React.ForwardRefExoticComponent<PlVisuallyHiddenProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as i from"react";import{useRender as r}from"@base-ui/react/use-render";import{cx as s,srOnlyClasses as n}from"../../internal/styles.js";const o=/* @__PURE__ */["focus-within:static focus-within:size-auto","focus-within:overflow-visible focus-within:whitespace-normal","focus-within:[clip-path:none]"].join(" ");export const PlVisuallyHidden=/* @__PURE__ */i.forwardRef(function PlVisuallyHidden({focusable:i=!1,render:t,className:a,children:c,...l},f){return r({render:t??e("span",{}),ref:f,props:{className:s(n,i?o:"",a),children:c,...l}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlVisuallyHidden}from"./PlVisuallyHidden.js";
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlWindowControl, PlWindowOffset, PlWindowOs } from '../../internal/window.js';
|
|
4
|
+
import type { PlassColor, PlassElevation, PlassSize } from '../../types.js';
|
|
5
|
+
export type { PlWindowControl, PlWindowOffset, PlWindowOs } from '../../internal/window.js';
|
|
6
|
+
/** The three CSS positions a window can be laid out with. */
|
|
7
|
+
export type PlWindowPanePosition = 'static' | 'absolute' | 'fixed';
|
|
8
|
+
/** What a resize reports: the window's size in pixels. */
|
|
9
|
+
export interface PlWindowPaneSize {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export interface PlWindowPaneProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title' | 'onResize'> {
|
|
14
|
+
/**
|
|
15
|
+
* Whose window this is a picture of. Decides where the controls sit, how they
|
|
16
|
+
* are drawn, how tall the title bar is and how its corners are cut.
|
|
17
|
+
* @default 'macos'
|
|
18
|
+
*/
|
|
19
|
+
os?: PlWindowOs;
|
|
20
|
+
/** The window's name, in the title bar. Also what names the window itself. */
|
|
21
|
+
title?: React.ReactNode;
|
|
22
|
+
/** A glyph beside the title — the app's mark. */
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
/** Anything else the title bar carries, set beside the controls. */
|
|
25
|
+
actions?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Which of the three buttons the title bar has. `true` is all of them,
|
|
28
|
+
* `false` is none, and an array is exactly the ones named — a window that can
|
|
29
|
+
* be closed but not minimized is `['close']`.
|
|
30
|
+
*
|
|
31
|
+
* The order is the system's rather than the array's: macOS puts close first
|
|
32
|
+
* and Windows puts it last, and that is not something a caller should have to
|
|
33
|
+
* remember.
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
controls?: boolean | readonly PlWindowControl[];
|
|
37
|
+
/**
|
|
38
|
+
* The scale of the chrome — the title bar's height, its buttons and its type.
|
|
39
|
+
* It does not touch the content, which is the caller's and is laid out at its
|
|
40
|
+
* own scale, exactly as it would be on a desktop where the title bar does not
|
|
41
|
+
* grow with the document.
|
|
42
|
+
* @default 'md'
|
|
43
|
+
*/
|
|
44
|
+
size?: PlassSize;
|
|
45
|
+
/** The colour family the focus rings and an `accent` title bar take. @default 'primary' */
|
|
46
|
+
color?: PlassColor;
|
|
47
|
+
/**
|
|
48
|
+
* Dyes the title bar with the colour family, the way Windows offers to. Off,
|
|
49
|
+
* the bar is the neutral shade the system draws by default.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
accent?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* How much of what is behind the window shows through its chrome, from `0` to
|
|
55
|
+
* `1`. It applies to the title bar, the body's own fill and the border —
|
|
56
|
+
* never to the content on it, which stays exactly as legible as it was.
|
|
57
|
+
*
|
|
58
|
+
* Anything above `0` also turns the acrylic on, so the page underneath is
|
|
59
|
+
* blurred rather than merely visible. `1` is a window that is nothing but its
|
|
60
|
+
* edge and its chrome.
|
|
61
|
+
* @default 0
|
|
62
|
+
*/
|
|
63
|
+
transparency?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Whether this is the window in front.
|
|
66
|
+
*
|
|
67
|
+
* Left out, the window works it out for itself: it is in front until another
|
|
68
|
+
* `PlWindowPane` on the page is pressed or takes the focus, exactly as windows on
|
|
69
|
+
* a desktop behave. A click on the page *around* the windows changes nothing
|
|
70
|
+
* — a paragraph is not a desktop.
|
|
71
|
+
*
|
|
72
|
+
* Pass it to drive that yourself, which is what a caller keeping its own
|
|
73
|
+
* z-order wants.
|
|
74
|
+
*
|
|
75
|
+
* What being in front looks like is the system's: coloured traffic lights on
|
|
76
|
+
* macOS against grey ones, an accent title bar and an accent border on
|
|
77
|
+
* Windows 10, a tinted header bar on GNOME — and, on all four, a window one
|
|
78
|
+
* step further off the page than the ones behind it.
|
|
79
|
+
*/
|
|
80
|
+
active?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The shadow around the window. `2` here, against the `0` everything else
|
|
83
|
+
* defaults to, for the reason `PlPill`'s is `2`: a window is by definition not
|
|
84
|
+
* part of the page it is on.
|
|
85
|
+
* @default 2
|
|
86
|
+
*/
|
|
87
|
+
elevation?: PlassElevation;
|
|
88
|
+
/**
|
|
89
|
+
* How the window is laid out. `static` leaves it in the flow (as a
|
|
90
|
+
* relatively positioned box, so `offset` can move it without disturbing
|
|
91
|
+
* anything around it); `absolute` pins it inside the nearest positioned
|
|
92
|
+
* ancestor, which is what a desktop full of windows wants; `fixed` pins it to
|
|
93
|
+
* the viewport.
|
|
94
|
+
* @default 'static'
|
|
95
|
+
*/
|
|
96
|
+
position?: PlWindowPanePosition;
|
|
97
|
+
/** Lets the title bar be dragged. @default false */
|
|
98
|
+
draggable?: boolean;
|
|
99
|
+
/** Lets the edges and corners be dragged. @default false */
|
|
100
|
+
resizable?: boolean;
|
|
101
|
+
/** The window's width — a number in pixels or any CSS length. */
|
|
102
|
+
width?: number | string;
|
|
103
|
+
/** And its height. Left out, the window is as tall as what is in it. */
|
|
104
|
+
height?: number | string;
|
|
105
|
+
/** How small it may be dragged, in pixels. @default 180 */
|
|
106
|
+
minWidth?: number;
|
|
107
|
+
/** The same downward. Defaults to the title bar's own height. */
|
|
108
|
+
minHeight?: number;
|
|
109
|
+
/** How far it has been dragged from where the layout put it. */
|
|
110
|
+
offset?: PlWindowOffset;
|
|
111
|
+
/** Where an uncontrolled window starts. @default { x: 0, y: 0 } */
|
|
112
|
+
defaultOffset?: PlWindowOffset;
|
|
113
|
+
onOffsetChange?: (offset: PlWindowOffset) => void;
|
|
114
|
+
/** Fires with the window's size, in pixels, while an edge is dragged. */
|
|
115
|
+
onResize?: (size: PlWindowPaneSize) => void;
|
|
116
|
+
/** Whether the window is on screen at all. Closing it renders nothing. */
|
|
117
|
+
open?: boolean;
|
|
118
|
+
/** @default true */
|
|
119
|
+
defaultOpen?: boolean;
|
|
120
|
+
onOpenChange?: (open: boolean) => void;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the window is rolled up to its title bar. This is what minimizing
|
|
123
|
+
* means for a window that is part of a page rather than of a desktop: there
|
|
124
|
+
* is no dock for it to go to, so it stays where it is with nothing under the
|
|
125
|
+
* bar.
|
|
126
|
+
*/
|
|
127
|
+
minimized?: boolean;
|
|
128
|
+
/** @default false */
|
|
129
|
+
defaultMinimized?: boolean;
|
|
130
|
+
onMinimizedChange?: (minimized: boolean) => void;
|
|
131
|
+
/**
|
|
132
|
+
* Whether the window fills whatever is holding it. Its corners go square
|
|
133
|
+
* while it does, as they do on every system.
|
|
134
|
+
*/
|
|
135
|
+
maximized?: boolean;
|
|
136
|
+
/** @default false */
|
|
137
|
+
defaultMaximized?: boolean;
|
|
138
|
+
onMaximizedChange?: (maximized: boolean) => void;
|
|
139
|
+
/** Whether content taller than the window scrolls. @default true */
|
|
140
|
+
scroll?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Overrides the buttons' own names.
|
|
143
|
+
*
|
|
144
|
+
* There is no `locale` here: the words come from `PlassProvider`'s `labels`,
|
|
145
|
+
* which is where every other component in the library gets its own, and these
|
|
146
|
+
* four are the narrower override for one window.
|
|
147
|
+
*/
|
|
148
|
+
minimizeLabel?: string;
|
|
149
|
+
maximizeLabel?: string;
|
|
150
|
+
restoreLabel?: string;
|
|
151
|
+
closeLabel?: string;
|
|
152
|
+
resizeLabel?: string;
|
|
153
|
+
/** Renders something other than a `<div>`: `render={<section />}`. */
|
|
154
|
+
render?: useRender.RenderProp;
|
|
155
|
+
/** What is in the window. */
|
|
156
|
+
children?: React.ReactNode;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* A window, drawn the way one of four systems draws it, with anything at all
|
|
160
|
+
* inside it.
|
|
161
|
+
*
|
|
162
|
+
* It is not a real window and does not pretend to be one: there is no desktop,
|
|
163
|
+
* no z-order and no dock. What it is is a *frame that behaves* — the title bar
|
|
164
|
+
* drags, the corners resize, the three buttons are real buttons with real names
|
|
165
|
+
* — so a screenshot of an app, a demo of a feature or a piece of a landing page
|
|
166
|
+
* can be shown as the thing it will be rather than as a picture of it.
|
|
167
|
+
*
|
|
168
|
+
* Nothing here is transformed. A dragged window moves on `left` and `top` and a
|
|
169
|
+
* resized one changes `width` and `height`, which is what keeps the text inside
|
|
170
|
+
* it at whole pixels through both gestures — a `translate()` would resample
|
|
171
|
+
* every glyph in the window for the length of the drag, which is exactly what
|
|
172
|
+
* the house rule against transforming a surface exists to prevent.
|
|
173
|
+
*
|
|
174
|
+
* `minimize` rolls the window up to its title bar rather than sending it
|
|
175
|
+
* anywhere, because a page has nowhere to send it to. `maximize` fills whatever
|
|
176
|
+
* is holding the window, which is the container for `position="absolute"` and
|
|
177
|
+
* the viewport for `fixed`.
|
|
178
|
+
*/
|
|
179
|
+
export declare const PlWindowPane: React.ForwardRefExoticComponent<PlWindowPaneProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from"react";import{useRender as o}from"@base-ui/react/use-render";import{beginPointerDrag as r}from"../../internal/drag.js";import{useLabels as s}from"../../internal/labels.js";import{cx as a,glassClasses as l,hasContent as d,iconClasses as c}from"../../internal/styles.js";import{PlWindowControls as u,orderControls as m,windowChrome as h,windowMetrics as g,windowSlots as f}from"../../internal/window.js";import{useDefaults as w}from"../../internal/defaults.js";function useLatched(e,t,n){const[o,r]=i.useState(t),s=void 0!==e;return[s?e:o,i.useCallback(e=>{s||r(e),n?.(e)},[s,n])]}const p=[{edge:"n",className:"inset-x-3 top-0 h-1.5 cursor-ns-resize"},{edge:"s",className:"inset-x-3 bottom-0 h-1.5 cursor-ns-resize"},{edge:"w",className:"inset-y-3 left-0 w-1.5 cursor-ew-resize"},{edge:"e",className:"inset-y-3 right-0 w-1.5 cursor-ew-resize"},{edge:"nw",className:"top-0 left-0 size-3 cursor-nwse-resize"},{edge:"ne",className:"top-0 right-0 size-3 cursor-nesw-resize"},{edge:"sw",className:"bottom-0 left-0 size-3 cursor-nesw-resize"},{edge:"se",className:"right-0 bottom-0 size-3 cursor-nwse-resize"}];export const PlWindowPane=/* @__PURE__ */i.forwardRef(function PlWindowPane(b,v){const{os:x="macos",title:z,icon:y,actions:N,controls:M=!0,size:C,color:E,accent:L=!1,transparency:S=0,active:k,elevation:R=2,position:j="static",draggable:I=!1,resizable:T=!1,width:D,height:P,minWidth:B=180,minHeight:W,offset:A,defaultOffset:H,onOffsetChange:O,onResize:X,open:$,defaultOpen:G=!0,onOpenChange:F,minimized:U,defaultMinimized:Y=!1,onMinimizedChange:_,maximized:q,defaultMaximized:K=!1,onMaximizedChange:J,scroll:Q=!0,minimizeLabel:V,maximizeLabel:Z,restoreLabel:ee,closeLabel:te,resizeLabel:ne,render:ie,className:oe,style:re,children:se,...ae}=b,le=w(),de=C??le.size??"md",ce=E??le.color??"primary",ue=s(),me=h(x),he=g(x,de),ge=i.useId(),[fe,we]=useLatched($,G,F),[pe,be]=useLatched(U,Y,_),[ve,xe]=useLatched(q,K,J),[ze,ye]=useLatched(A,H??{x:0,y:0},O),[Ne,Me]=i.useState(null),[Ce,Ee]=i.useState(!0),Le=k??Ce,[Se,ke]=i.useState(null),[Re,je]=i.useState(null),[Ie,Te]=i.useState(!1),[De,Pe]=i.useState(!1),[Be,We]=i.useState(fe);Be!==fe&&(We(fe),Pe(!fe)),i.useEffect(()=>{if(!De)return;const e=window.setTimeout(()=>Pe(!1),260);return()=>window.clearTimeout(e)},[De]);const Ae=i.useRef(null),He=i.useCallback(e=>{Ae.current=e,"function"==typeof v?v(e):v&&(v.current=e)},[v]);i.useEffect(()=>{if(void 0!==k)return;const e=Ae.current;if(!e)return;const notice=t=>{const n=t.target;if(!(n instanceof Node))return;if(e.contains(n))return void Ee(!0);const i=n instanceof Element?n:n.parentElement;i?.closest(".plass-window")&&Ee(!1)};return document.addEventListener("pointerdown",notice,!0),document.addEventListener("focusin",notice,!0),()=>{document.removeEventListener("pointerdown",notice,!0),document.removeEventListener("focusin",notice,!0)}},[k]);const Oe=i.useRef(null);function beginGesture(e,t){if(0!==e.button)return;Oe.current?.();const n=e.currentTarget,i=e.clientX,o=e.clientY;Te(!0);const finish=()=>{Oe.current=null,Te(!1)},s=r({target:n,pointerId:e.pointerId,onMove:e=>t(e.clientX-i,e.clientY-o),onEnd:finish});Oe.current=()=>{s(),finish()}}i.useEffect(()=>()=>Oe.current?.(),[]);const Xe={width:Math.max(0,B),height:Math.max(he.bar,W??he.bar)};function resizeTo(e){Me(e),X?.(e)}const $e=m(x,!0===M?["minimize","maximize","close"]:!1===M?[]:M),Ge=$e.includes("maximize");i.useEffect(()=>{if(pe||null===Re)return;const e=window.setTimeout(()=>je(null),400);return()=>window.clearTimeout(e)},[pe,Re]);const Fe={minimize:V??ue.minimize,maximize:Z??ue.maximize,restore:ee??ue.restore,close:te??ue.close},Ue=e(u,{os:x,metrics:he,controls:$e,maximized:ve,active:Le,labels:Fe,onCommand:function command(e){"close"===e?we(!1):"minimize"===e?function rollUp(e){const t=Ae.current,n=t?.firstElementChild;if(t&&n instanceof HTMLElement&&ke(n.offsetHeight+(t.offsetHeight-t.clientHeight)),e&&void 0===(Ne?.height??P)&&t)return je(t.getBoundingClientRect().height),void requestAnimationFrame(()=>be(!0));be(e)}(!pe):xe(!ve)}}),Ye=d(z)?e("span",{id:ge,className:"min-w-0 truncate",children:z}):null,_e=d(y)?e("span",{className:"flex shrink-0 items-center",children:y}):null,qe=t("div",{className:a("relative flex shrink-0 items-center select-none",c,I&&!ve?"cursor-grab active:cursor-grabbing":""),style:{height:he.bar,textShadow:"var(--p-window-bar-shadow)",fontWeight:he.weight,paddingInlineStart:he.padX,paddingInlineEnd:he.padEnd,gap:Math.round(.7*he.title),fontSize:he.title,backgroundColor:"var(--p-window-bar)",backgroundImage:"var(--p-window-bar-image)",color:"var(--p-window-bar-fg)",borderBlockEnd:me.rule?"1px solid var(--p-window-line)":void 0},onPointerDown:function beginDrag(e){if(!I||ve)return;const t={...ze};beginGesture(e,(e,n)=>ye({x:t.x+e,y:t.y+n}))},onDoubleClick:Ge?()=>xe(!ve):void 0,children:["start"===me.controlsSide?Ue:null,"center"===me.titleAlign?e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 flex items-center justify-center",style:{paddingInline:he.controlsWidth($e.length)+2*he.padX},children:t("span",{className:"flex min-w-0 items-center",style:{gap:Math.round(.5*he.title)},children:[_e,Ye]})}):t(n,{children:[_e,Ye]}),e("span",{className:"flex-1"}),d(N)?e("span",{className:"flex shrink-0 items-center",style:{gap:Math.round(.5*he.title)},onPointerDown:e=>e.stopPropagation(),children:N}):null,"end"===me.controlsSide?Ue:null]}),Ke=ve?{left:0,top:0,width:"100%",height:"100%"}:{left:ze.x,top:ze.y,width:Ne?.width??D,height:pe?Se??he.bar:Ne?.height??P??Re??void 0},Je=o({render:ie,ref:He,props:{role:"group","aria-labelledby":Ye?ge:void 0,className:a("plass-window relative flex min-w-0 flex-col overflow-hidden",S>0?l:"",me.glass&&0===S?"[backdrop-filter:var(--plass-blur)]":"","[transition-property:left,top,width,height,opacity,box-shadow,background-color,border-color,border-radius]","[transition-duration:var(--plass-duration-slow)]","[transition-timing-function:var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","data-[gesture]:[transition-property:none]",oe),"data-gesture":Ie?"":void 0,inert:!fe||void 0,style:{opacity:fe?void 0:0,...f({os:x,color:ce,accent:L,transparency:S,active:Le,elevation:R}),position:"static"===j?"relative":j,...Ke,borderRadius:ve?0:`${he.radius}px ${he.radius}px ${he.radiusBottom}px ${he.radiusBottom}px`,borderStyle:"solid",borderWidth:he.frame,borderColor:"var(--p-window-line)",backgroundColor:"var(--p-window-band)",boxShadow:"var(--p-window-shadow), var(--plass-gloss-glass)",...re},children:t(n,{children:[qe,e("div",{className:a("min-h-0 flex-1",Q?"overflow-auto":"overflow-hidden"),style:{backgroundColor:"var(--p-window-body)",marginInline:he.band.side,marginBottom:he.band.bottom,boxShadow:he.band.side>0?"inset 0 0 0 1px rgb(0 0 0 / 0.12)":void 0},inert:pe,children:se}),!T||ve||pe?null:p.map(t=>{const n="se"===t.edge;return e("div",{role:n?"button":void 0,tabIndex:n?0:void 0,"aria-label":n?ne??ue.resizeWindow:void 0,"aria-hidden":n?void 0:"true",className:a("absolute z-10 touch-none",t.className,n?"focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]":""),onPointerDown:e=>function beginResize(e,t){const n=Ae.current;if(!n||ve)return;const i=n.getBoundingClientRect(),o={width:i.width,height:i.height,x:ze.x,y:ze.y},r=e.includes("e"),s=e.includes("w"),a=e.includes("n"),l=e.includes("s");beginGesture(t,(e,t)=>{let{width:n,height:i}=o,{x:d,y:c}=o;r&&(n=Math.max(Xe.width,o.width+e)),l&&(i=Math.max(Xe.height,o.height+t)),s&&(n=Math.max(Xe.width,o.width-e),d=o.x+(o.width-n)),a&&(i=Math.max(Xe.height,o.height-t),c=o.y+(o.height-i)),resizeTo({width:n,height:i}),(s||a)&&ye({x:d,y:c})})}(t.edge,e),onKeyDown:n?e=>{const t={ArrowRight:[16,0],ArrowLeft:[-16,0],ArrowDown:[0,16],ArrowUp:[0,-16]}[e.key];t&&(e.preventDefault(),function nudge(e,t){const n=Ae.current;if(!n)return;const i=n.getBoundingClientRect();resizeTo({width:Math.max(Xe.width,i.width+e),height:Math.max(Xe.height,i.height+t)})}(t[0],t[1]))}:void 0},t.edge)})]}),...ae}});return fe||De?Je:null});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlWindowPane}from"./PlWindowPane.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { usePlBreakpoint, usePlBreakpointValue } from './usePlBreakpoint.js';
|
|
2
|
+
export { usePlColorScheme } from './usePlColorScheme.js';
|
|
3
|
+
export type { PlColorScheme, PlColorSchemeOptions, PlColorSchemeResult, PlResolvedColorScheme } from './usePlColorScheme.js';
|
|
4
|
+
export { usePlDisclosure } from './usePlDisclosure.js';
|
|
5
|
+
export type { PlDisclosureResult } from './usePlDisclosure.js';
|
|
6
|
+
export { usePlElementSize } from './usePlElementSize.js';
|
|
7
|
+
export type { PlElementSize } from './usePlElementSize.js';
|
|
8
|
+
export { usePlHotKeys } from './usePlHotKeys.js';
|
|
9
|
+
export type { PlHotKeysOptions, PlHotKeysTarget } from './usePlHotKeys.js';
|
|
10
|
+
export { usePlMediaQuery } from './usePlMediaQuery.js';
|
|
11
|
+
export { usePlOnScreen } from './usePlOnScreen.js';
|
|
12
|
+
export type { PlOnScreenOptions } from './usePlOnScreen.js';
|
|
13
|
+
export { usePlReducedMotion } from './usePlReducedMotion.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{usePlBreakpoint,usePlBreakpointValue}from"./usePlBreakpoint.js";export{usePlColorScheme}from"./usePlColorScheme.js";export{usePlDisclosure}from"./usePlDisclosure.js";export{usePlElementSize}from"./usePlElementSize.js";export{usePlHotKeys}from"./usePlHotKeys.js";export{usePlMediaQuery}from"./usePlMediaQuery.js";export{usePlOnScreen}from"./usePlOnScreen.js";export{usePlReducedMotion}from"./usePlReducedMotion.js";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { PlassBreakpoint, PlassResponsive } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Which rung of the breakpoint ladder the window is on.
|
|
4
|
+
*
|
|
5
|
+
* Four queries rather than one `innerWidth` read, and deliberately: a width
|
|
6
|
+
* measured in JavaScript is a number that has to be compared against a `rem`,
|
|
7
|
+
* and a `rem` is whatever the reader has set their font size to. `matchMedia`
|
|
8
|
+
* asks the same engine the stylesheet asks, so a component that switches at
|
|
9
|
+
* `md` here switches with the `md:` utilities beside it rather than a few
|
|
10
|
+
* pixels away from them.
|
|
11
|
+
*
|
|
12
|
+
* The widths come off the document — see `internal/breakpoints.ts` — so a
|
|
13
|
+
* project that moves a breakpoint in its Tailwind theme moves this too.
|
|
14
|
+
*
|
|
15
|
+
* **`xs` is the server's answer**, and the first one a browser renders. See
|
|
16
|
+
* `usePlMediaQuery` for what follows from that.
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePlBreakpoint(): PlassBreakpoint;
|
|
19
|
+
/**
|
|
20
|
+
* A `PlassResponsive` value, resolved for the width the window is at.
|
|
21
|
+
*
|
|
22
|
+
* The same shape and the same rule as `PlGrid`'s own props: a bare value
|
|
23
|
+
* applies everywhere, and a map applies each entry **from its own breakpoint
|
|
24
|
+
* up**, so `{ xs: 1, md: 3 }` is `1` on a phone and `3` from 48rem. An entry
|
|
25
|
+
* cascades to the rungs above it, which is what keeps a responsive value to the
|
|
26
|
+
* breakpoints it actually names.
|
|
27
|
+
*
|
|
28
|
+
* It exists because there is a class of decision CSS cannot make — how many
|
|
29
|
+
* items to fetch, which of two components to mount, how many characters to
|
|
30
|
+
* truncate at — and writing it out by hand means repeating the ladder in
|
|
31
|
+
* numbers a stylesheet will later disagree with.
|
|
32
|
+
*
|
|
33
|
+
* `undefined` when the map named no rung at or below the current one:
|
|
34
|
+
* `{ lg: 3 }` on a phone is not `3`, and guessing a value the caller did not
|
|
35
|
+
* write would be worse than saying so.
|
|
36
|
+
*
|
|
37
|
+
* An object is read as a **map**, exactly as it is in a responsive prop — so a
|
|
38
|
+
* value that is itself an object has to be wrapped in a map to be passed
|
|
39
|
+
* through: `{ xs: { … } }`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function usePlBreakpointValue<T>(value: PlassResponsive<T>): T | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{fromQuery as e}from"../internal/breakpoints.js";import{resolveAt as r}from"../internal/responsive.js";import{useMediaQuery as n}from"../internal/media.js";export function usePlBreakpoint(){const r=n(e("sm")),t=n(e("md")),o=n(e("lg"));return n(e("xl"))?"xl":o?"lg":t?"md":r?"sm":"xs"}export function usePlBreakpointValue(e){return r(e,usePlBreakpoint())}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type PlColorScheme, type PlResolvedColorScheme } from '../internal/color-scheme.js';
|
|
2
|
+
export type { PlColorScheme, PlResolvedColorScheme };
|
|
3
|
+
export interface PlColorSchemeOptions {
|
|
4
|
+
/**
|
|
5
|
+
* What to use when nothing has been stored.
|
|
6
|
+
*
|
|
7
|
+
* `system` — follow the platform — and it should stay `system`: a library
|
|
8
|
+
* that pinned a page to light on first visit would be overruling a preference
|
|
9
|
+
* the reader has already expressed to their operating system.
|
|
10
|
+
* @default 'system'
|
|
11
|
+
*/
|
|
12
|
+
defaultScheme?: PlColorScheme;
|
|
13
|
+
/**
|
|
14
|
+
* Where the choice is kept, in `localStorage`.
|
|
15
|
+
*
|
|
16
|
+
* Change it to scope the choice to one app on a shared origin. There is no
|
|
17
|
+
* way to turn storage off, because a toggle whose answer does not survive a
|
|
18
|
+
* reload is a toggle that looks broken.
|
|
19
|
+
* @default 'plass-color-scheme'
|
|
20
|
+
*/
|
|
21
|
+
storageKey?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface PlColorSchemeResult {
|
|
24
|
+
/** What the reader chose. `system` is the absence of a choice. */
|
|
25
|
+
scheme: PlColorScheme;
|
|
26
|
+
/** What the page is painted in, once `system` has been resolved. */
|
|
27
|
+
resolved: PlResolvedColorScheme;
|
|
28
|
+
/** Chooses one. Written to `<html>` and to storage, and every other caller of this hook hears about it. */
|
|
29
|
+
setScheme: (next: PlColorScheme) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Light ⇄ dark, from whatever is currently *painted*.
|
|
32
|
+
*
|
|
33
|
+
* So the first press on a system-dark page gives light, which is what a
|
|
34
|
+
* reader pressing a toggle means. It leaves `system` behind, deliberately:
|
|
35
|
+
* they have now expressed a preference of their own.
|
|
36
|
+
*/
|
|
37
|
+
toggle: () => void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The dark mode toggle, and what it takes to make one that does not flash.
|
|
41
|
+
*
|
|
42
|
+
* The library's tokens already answer to `.dark` / `[data-theme]` on any
|
|
43
|
+
* ancestor and to `prefers-color-scheme` when neither is there, so a page that
|
|
44
|
+
* only ever follows the platform needs nothing at all — this is for the app that
|
|
45
|
+
* offers a **choice**, which needs three things the CSS cannot do on its own:
|
|
46
|
+
* somewhere to keep it, something to write it onto `<html>`, and a way to paint
|
|
47
|
+
* it before the first frame.
|
|
48
|
+
*
|
|
49
|
+
* The third one is not this hook. React runs after the document has been
|
|
50
|
+
* parsed, so a scheme applied from an effect is applied one paint too late and
|
|
51
|
+
* the reader sees a white flash. [`PlColorSchemeScript`](./PlColorSchemeScript)
|
|
52
|
+
* is the answer to that and belongs in `<head>`.
|
|
53
|
+
*
|
|
54
|
+
* ```tsx
|
|
55
|
+
* const { resolved, toggle } = usePlColorScheme();
|
|
56
|
+
*
|
|
57
|
+
* <PlIconButton label="Switch theme" icon={resolved === 'dark' ? <Sun /> : <Moon />} onClick={toggle} />
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* **`storageKey` and `defaultScheme` are read once**, when the first component
|
|
61
|
+
* using that key mounts, and are ignored on every call after it. That is what
|
|
62
|
+
* makes two toggles on one page agree with each other — they share one store —
|
|
63
|
+
* and it means these two are decisions to make where the app is set up rather
|
|
64
|
+
* than props to compute. Changing them at runtime does nothing.
|
|
65
|
+
*/
|
|
66
|
+
export declare function usePlColorScheme(options?: PlColorSchemeOptions): PlColorSchemeResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{DEFAULT_STORAGE_KEY as t,applyColorScheme as r,darkQuery as s,useColorSchemeStore as o}from"../internal/color-scheme.js";import{useMediaQuery as m}from"../internal/media.js";export function usePlColorScheme(c={}){const{defaultScheme:l="system",storageKey:a=t}=c,[i,n]=o(a,l),f=m(s),h="system"===i?f?"dark":"light":i;e.useEffect(()=>{r(i)},[i]);const u=e.useCallback(()=>{n("dark"===h?"light":"dark")},[h,n]);return{scheme:i,resolved:h,setScheme:n,toggle:u}}
|