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,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ink a table is drawn with, and the reason two components share it.
|
|
3
|
+
*
|
|
4
|
+
* `PlTable` draws a grid it is given; `PlDataTable` sorts, filters and pages
|
|
5
|
+
* its own rows and then draws one. They are two components because the second
|
|
6
|
+
* has to call hooks and the first must not — a table whose every column is a
|
|
7
|
+
* `render` callback is the one component in this library that a React server
|
|
8
|
+
* component has to be able to render, and reading a context would take that
|
|
9
|
+
* away. Two components drawing the same grid out of two copies of these
|
|
10
|
+
* constants is how the rules under a sorted table end up a shade off the rules
|
|
11
|
+
* under a plain one.
|
|
12
|
+
*/
|
|
13
|
+
import type * as React from 'react';
|
|
14
|
+
import type { PlassDensity, PlassSize } from '../types.js';
|
|
15
|
+
/**
|
|
16
|
+
* Row height, as vertical padding — and, like the horizontal track, a raw
|
|
17
|
+
* length rather than a class. See the note on `paddingXValues`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const cellPaddingYValues: Record<PlassDensity, Record<PlassSize, string>>;
|
|
20
|
+
/**
|
|
21
|
+
* Everything a table is painted with is written inline, `<table>` included.
|
|
22
|
+
*
|
|
23
|
+
* This is the one component in the library that has to do that, and the reason
|
|
24
|
+
* is the elements it renders. A PlButton owns its `<button>`; nobody else
|
|
25
|
+
* styles it. `<table>`, `<th>` and `<td>` are different — VitePress's
|
|
26
|
+
* `.vp-doc table`, Tailwind Typography's `.prose td` and every CSS framework in
|
|
27
|
+
* existence style them by tag name, at two-class specificity that a one-class
|
|
28
|
+
* Tailwind utility cannot outrank.
|
|
29
|
+
*
|
|
30
|
+
* Padding and alignment were already written inline for that reason. **The
|
|
31
|
+
* borders, the display mode and the margins were not**, and that omission was
|
|
32
|
+
* most of what a Plass table looked like on a documentation page: the host's
|
|
33
|
+
* `td { border: 1px solid }` drew a full grid of cell rules the design never
|
|
34
|
+
* asked for, its `table { display: block }` stopped `width: 100%` filling the
|
|
35
|
+
* sheet, and its `table { margin: 20px 0 }` pushed the whole thing off the
|
|
36
|
+
* top-left corner of the pane it is supposed to be flush inside. A grid of
|
|
37
|
+
* boxed cells floating inside a rounded sheet is not a restrained table with a
|
|
38
|
+
* problem — it is somebody else's table wearing this one's frame.
|
|
39
|
+
*
|
|
40
|
+
* So every cell states `border: 0` and then draws the one rule it actually
|
|
41
|
+
* wants, and the `<table>` states the four properties a prose stylesheet is
|
|
42
|
+
* known to take off it. It is verbose, and it is the only way the component
|
|
43
|
+
* looks the same in a bare app and inside `.prose`.
|
|
44
|
+
*
|
|
45
|
+
* What is *not* inline is the row's own background, because it has a hover
|
|
46
|
+
* state and inline styles have no `:hover`. It reads a `--p-row` slot instead,
|
|
47
|
+
* which classes then set — a custom property is invisible to a host stylesheet,
|
|
48
|
+
* so a one-class variant wins there without a fight.
|
|
49
|
+
*/
|
|
50
|
+
export declare const tableStyle: React.CSSProperties;
|
|
51
|
+
export declare const rowClasses: string;
|
|
52
|
+
/**
|
|
53
|
+
* What a row that answers a press needs beyond the pointer treatment.
|
|
54
|
+
*
|
|
55
|
+
* `tabIndex` is the whole point: a row whose only way in is `onClick` is a
|
|
56
|
+
* control a keyboard cannot reach at all, and `cursor-pointer` advertises it as
|
|
57
|
+
* one anyway. The ring is inset rather than offset, because the sheet clips at
|
|
58
|
+
* its own rounded edge and an outline drawn outside the first or last row is an
|
|
59
|
+
* outline with its top or bottom sliced off.
|
|
60
|
+
*
|
|
61
|
+
* The `role` is deliberately left alone. `role="button"` on a `<tr>` reads well
|
|
62
|
+
* in isolation and takes the row semantics off it — which orphans every `<td>`
|
|
63
|
+
* inside from the table they belong to, and costs a screen reader the column
|
|
64
|
+
* headers, the row position and the count.
|
|
65
|
+
*/
|
|
66
|
+
export declare const clickableRowClasses: string;
|
|
67
|
+
/**
|
|
68
|
+
* Two weights of rule, and the whole of the table's structure.
|
|
69
|
+
*
|
|
70
|
+
* `--plass-divider` scores one row off the next, the same ink a PlCard and a
|
|
71
|
+
* PlList are scored with, so a table on a card and the card's own dividers are
|
|
72
|
+
* one family of lines. The header sits on `--plass-border`, one step firmer,
|
|
73
|
+
* because the break between the names of the columns and the data in them is
|
|
74
|
+
* the one division a reader has to find without looking for it.
|
|
75
|
+
*
|
|
76
|
+
* Both are neutral inks rather than the `--plass-glass-line` this used to use.
|
|
77
|
+
* That line is white, and a white rule between two rows of a white sheet is
|
|
78
|
+
* not a rule — which is why the table had no visible structure of its own in
|
|
79
|
+
* light mode, and why it looked like whatever grid the host page happened to
|
|
80
|
+
* be drawing over it.
|
|
81
|
+
*
|
|
82
|
+
* They are on the *cells* rather than on the `<tr>`, which is where a rule can
|
|
83
|
+
* be written inline and therefore where a host stylesheet cannot reach it.
|
|
84
|
+
*/
|
|
85
|
+
export declare const rowRule = "1px solid var(--plass-divider)";
|
|
86
|
+
export declare const headRule = "1px solid var(--plass-border)";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{focusRingInsetClasses as r}from"./styles.js";export const cellPaddingYValues={default:{xs:"0.375rem",sm:"0.5rem",md:"0.75rem",lg:"0.875rem",xl:"1rem"},compact:{xs:"0.125rem",sm:"0.25rem",md:"0.4375rem",lg:"0.5625rem",xl:"0.6875rem"}};export const tableStyle={display:"table",width:"100%",margin:0,borderCollapse:"collapse",borderSpacing:0};export const rowClasses=/* @__PURE__ */["[--p-row:transparent]","[transition:background-color_var(--plass-duration)_var(--plass-ease)]"].join(" ");export const clickableRowClasses=/* @__PURE__ */["cursor-pointer [outline:none]",r].join(" ");export const rowRule="1px solid var(--plass-divider)";export const headRule="1px solid var(--plass-border)";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading a node as the words it draws, and cutting those words the way a
|
|
3
|
+
* reader cuts them.
|
|
4
|
+
*
|
|
5
|
+
* Both halves exist because more than one component needs them and all of them
|
|
6
|
+
* have to arrive at the same answer as the Flutter build, which reads a widget
|
|
7
|
+
* with `plassTextOf` in `lib/src/internal/text.dart` and cuts with
|
|
8
|
+
* `String.characters`.
|
|
9
|
+
*/
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
/**
|
|
12
|
+
* Everything in a node, flattened to its text.
|
|
13
|
+
*
|
|
14
|
+
* Strings and numbers are their own text, a list is its parts joined, and an
|
|
15
|
+
* element contributes the text of its `children` and nothing else — a walk in,
|
|
16
|
+
* not a render. What a component draws for itself is only decided when it
|
|
17
|
+
* renders and cannot be read here, so a `<PlIcon />` among the children adds
|
|
18
|
+
* nothing, which is exactly right for every caller: a picture of a thing is not
|
|
19
|
+
* its name.
|
|
20
|
+
*
|
|
21
|
+
* Three components need it, and all three need it for the same reason — a
|
|
22
|
+
* string where React would otherwise hand them a tree. `PlBreadcrumb` puts a
|
|
23
|
+
* step's `name` into structured data, `PlChip` hands a chip's words to the label
|
|
24
|
+
* pack so that a language can put a name where its own grammar puts it, and
|
|
25
|
+
* `PlAnimateTyping` types a string one grapheme at a time, because there is no
|
|
26
|
+
* honest way to reveal half of a `<strong>`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function textOf(node: React.ReactNode): string;
|
|
29
|
+
/**
|
|
30
|
+
* The text cut the way a reader would cut it.
|
|
31
|
+
*
|
|
32
|
+
* Not `[...text]`, and not `text.split('')`. A code point is not a character:
|
|
33
|
+
* `👩👩👧` is seven of them, a flag is two, and `한` typed on a Korean keyboard
|
|
34
|
+
* can be three. Cut by code point, each of those comes back as pieces that
|
|
35
|
+
* mean nothing on their own and draw as broken glyphs. `Intl.Segmenter` knows
|
|
36
|
+
* where the boundaries actually are; the spread is the fallback for a runtime
|
|
37
|
+
* that does not have it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function graphemesOf(text: string): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";export function textOf(t){return"string"==typeof t||"number"==typeof t?String(t):Array.isArray(t)?t.map(textOf).join(""):e.isValidElement(t)?textOf(t.props.children):""}let t;export function graphemesOf(e){const n=function segmenter(){return void 0===t&&(t="undefined"!=typeof Intl&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null),t}();return null===n?[...e]:[...n.segment(e)].map(e=>e.segment)}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which band a reading has landed in.
|
|
3
|
+
*
|
|
4
|
+
* One rule, shared by the two components that draw a value against a scale a
|
|
5
|
+
* caller described: `PlMeter`'s bar and `PlGaugeChart`'s arc. Written twice
|
|
6
|
+
* they would drift, and a quota that turns `danger` on a bar but not on the
|
|
7
|
+
* dial beside it is a dashboard that contradicts itself.
|
|
8
|
+
*/
|
|
9
|
+
import type { PlassColor, PlassThreshold } from '../types.js';
|
|
10
|
+
/**
|
|
11
|
+
* The family a value lands in.
|
|
12
|
+
*
|
|
13
|
+
* The highest band at or below the value, or `color` when the value is under
|
|
14
|
+
* all of them. One pass rather than a sort, because the list is small and
|
|
15
|
+
* sorting a caller's array — or a copy of it on every render — buys nothing.
|
|
16
|
+
* Reading it rather than walking it in order is also what makes the prop
|
|
17
|
+
* order-independent, which is what a caller assumes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function bandColor(value: number, color: PlassColor, thresholds: readonly PlassThreshold[] | undefined): PlassColor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function bandColor(o,r,f){if(!f?.length)return r;let n;for(const r of f)o>=r.from&&(void 0===n||r.from>n.from)&&(n=r);return n?.color??r}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The geometry a spotlight is cut out of, as arithmetic rather than as a
|
|
3
|
+
* component.
|
|
4
|
+
*
|
|
5
|
+
* A tour dims the page and takes one thing out of the dimming. Everything hard
|
|
6
|
+
* about that is a rectangle and a rounded corner, so it is here: it can be read
|
|
7
|
+
* without a browser, tested without one, and it is the same shape the Flutter
|
|
8
|
+
* build punches with `Path.combine`.
|
|
9
|
+
*/
|
|
10
|
+
/** Where the thing being pointed at is, in viewport coordinates. */
|
|
11
|
+
export interface PlassSpot {
|
|
12
|
+
top: number;
|
|
13
|
+
left: number;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}
|
|
17
|
+
/** A rectangle grown by [padding] on every side, never to a negative size. */
|
|
18
|
+
export declare function inflate(rect: PlassSpot, padding: number): PlassSpot;
|
|
19
|
+
/**
|
|
20
|
+
* The whole scrim with a hole in it, as a `clip-path` value.
|
|
21
|
+
*
|
|
22
|
+
* A clip and not a shadow, and that is the decision the whole component rests
|
|
23
|
+
* on. The obvious way to draw a hole is one element the size of the target
|
|
24
|
+
* carrying a box shadow larger than any screen; it works, and it buys nothing
|
|
25
|
+
* else. A clip buys two things that matter:
|
|
26
|
+
*
|
|
27
|
+
* **The dimming can blur.** A `box-shadow` paints a colour. A clipped element
|
|
28
|
+
* can carry a `backdrop-filter`, so the page around the spotlight is blurred as
|
|
29
|
+
* well as dimmed — which is this library's own material rather than a grey wash
|
|
30
|
+
* over it.
|
|
31
|
+
*
|
|
32
|
+
* **The hole is a hole for the pointer too.** A clipped-away region is not
|
|
33
|
+
* hit-tested, so the scrim can take the pointer everywhere it is painted and
|
|
34
|
+
* nowhere it is not. The reader can use the control being pointed at and
|
|
35
|
+
* nothing else, which is what separates a tour from a dialog with a picture of
|
|
36
|
+
* a control in it — and it falls out of the geometry rather than being a second
|
|
37
|
+
* mechanism that has to agree with it.
|
|
38
|
+
*
|
|
39
|
+
* `null` is a step with no target: the whole page dims and nothing is cut out,
|
|
40
|
+
* which is what a welcome step and a closing step are.
|
|
41
|
+
*/
|
|
42
|
+
export declare function spotlightPath(spot: PlassSpot | null, radius: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function inflate(t,$){return{top:t.top-$,left:t.left-$,width:Math.max(0,t.width+2*$),height:Math.max(0,t.height+2*$)}}export function spotlightPath(t,$){const h="M0,0H100000V100000H0Z";return null===t||t.width<=0||t.height<=0?`path(evenodd,'${h}')`:`path(evenodd,'${h}${function roundedRect(t,$){const{top:h,left:e,width:n,height:i}=t,o=Math.max(0,Math.min($,n/2,i/2));return 0===o?`M${e},${h}H${e+n}V${h+i}H${e}Z`:`M${e+o},${h}H${e+n-o}A${o},${o} 0 0 1 ${e+n},${h+o}V${h+i-o}A${o},${o} 0 0 1 ${e+n-o},${h+i}H${e+o}A${o},${o} 0 0 1 ${e},${h+i-o}V${h+o}A${o},${o} 0 0 1 ${e+o},${h}Z`}(t,$)}')`}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** Where a watermark sits on the picture. */
|
|
3
|
+
export type PlassWatermarkPlacement = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'tile';
|
|
4
|
+
/** A mark laid over a picture. A bare string is the text, in the usual corner. */
|
|
5
|
+
export interface PlassWatermarkOptions {
|
|
6
|
+
/** What it says. */
|
|
7
|
+
text: string;
|
|
8
|
+
/** One in a corner, or `'tile'` for the whole picture. @default 'bottom-end' */
|
|
9
|
+
placement?: PlassWatermarkPlacement;
|
|
10
|
+
/** How far through it the picture shows. @default 0.55 in a corner, 0.14 tiled */
|
|
11
|
+
opacity?: number;
|
|
12
|
+
/** The turn a tiled mark is set at, in degrees. @default -24 */
|
|
13
|
+
angle?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The ink, as any CSS colour, a token or `currentColor` included. White is what
|
|
16
|
+
* reads on a photograph. @default 'white'
|
|
17
|
+
*/
|
|
18
|
+
color?: string;
|
|
19
|
+
/** The type size, in pixels. @default 13 in a corner, 15 tiled */
|
|
20
|
+
fontSize?: number;
|
|
21
|
+
}
|
|
22
|
+
/** Normalised, so a bare string and a full object are one thing downstream. */
|
|
23
|
+
export declare function watermarkOptions(watermark: string | PlassWatermarkOptions): Required<PlassWatermarkOptions>;
|
|
24
|
+
/**
|
|
25
|
+
* A mark over a picture, in a corner or across the whole of it.
|
|
26
|
+
*
|
|
27
|
+
* It is `aria-hidden` and takes no pointer: a watermark is a claim about the
|
|
28
|
+
* file rather than something the page is telling a reader, and a screen reader
|
|
29
|
+
* announcing "Ada & Co" between the picture and its caption is reading out a
|
|
30
|
+
* stamp. The `alt` text is where a picture says what it is.
|
|
31
|
+
*
|
|
32
|
+
* The tiled layer is **rotated as one layer** rather than each copy being turned
|
|
33
|
+
* on its own, which is what keeps the repeat seamless — turning the tiles inside
|
|
34
|
+
* a straight grid leaves the grid's own lines showing through. It is drawn
|
|
35
|
+
* oversized and centred so the corners the turn opens up are still covered.
|
|
36
|
+
*
|
|
37
|
+
* That rotation is a `transform`, and the house rule it sits beside is about
|
|
38
|
+
* *controls*: a surface under a finger must not resample the label being pressed.
|
|
39
|
+
* Nothing here is pressed and the angle never changes, so it is the same
|
|
40
|
+
* allowance the chevrons in `PlGalleryViewer` are drawn with.
|
|
41
|
+
*/
|
|
42
|
+
export declare function PlassWatermark({ watermark }: {
|
|
43
|
+
watermark: string | PlassWatermarkOptions;
|
|
44
|
+
}): React.JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";export function watermarkOptions(t){const e="string"==typeof t?{text:t}:t,o=e.placement??"bottom-end",a="tile"===o;return{text:e.text,placement:o,opacity:e.opacity??(a?.14:.55),angle:e.angle??-24,color:e.color??"white",fontSize:e.fontSize??(a?15:13)}}const e="calc(max(100cqw, 100cqh) * 1.415)",o={"top-start":"top-2 start-2","top-end":"top-2 end-2","bottom-start":"bottom-2 start-2","bottom-end":"bottom-2 end-2"};export function PlassWatermark({watermark:a}){const{text:n,placement:r,opacity:s,angle:i,color:l,fontSize:c}=watermarkOptions(a);if(""===n)return null;if("tile"===r){const o=function tileUri(t,e){const o=Math.max(120,Math.round(t.length*e*.68)+48),a=Math.round(4.6*e),n=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${a}"><text x="0" y="${Math.round(a/2)}" fill="white" font-family="system-ui, sans-serif" font-size="${e}" font-weight="600">${function escapeXml(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(t)}</text></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(n)}")`}(n,c);return t("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 overflow-hidden",style:{containerType:"size"},children:t("span",{className:"absolute block",style:{top:"50%",left:"50%",width:e,height:e,translate:"-50% -50%",opacity:s,transform:`rotate(${i}deg)`,backgroundColor:l,WebkitMaskImage:o,maskImage:o,WebkitMaskRepeat:"repeat",maskRepeat:"repeat"}})})}return t("span",{"aria-hidden":"true",className:`pointer-events-none absolute select-none font-semibold ${o[r]}`,style:{opacity:s,color:l,fontSize:c,textShadow:"0 1px 2px rgb(0 0 0 / 0.55)"},children:n})}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wheel over a strip that runs the other way, and what happens when the
|
|
3
|
+
* strip runs out of room.
|
|
4
|
+
*
|
|
5
|
+
* Two components have the same problem and it is not the one it looks like. A
|
|
6
|
+
* mouse has one wheel, it points down the page, and a strip that runs across
|
|
7
|
+
* the box has no use for that direction — so what the wheel does over a shelf
|
|
8
|
+
* of cards or a bar of tabs is left to the browser, which is to say it is one
|
|
9
|
+
* thing on one machine and another on the next. The pointer being on the strip
|
|
10
|
+
* is the reader saying which of the two things under it they meant to move, and
|
|
11
|
+
* this is what acts on that.
|
|
12
|
+
*
|
|
13
|
+
* The second half is what happens at the end of the strip. A nested scroller
|
|
14
|
+
* that runs out hands the rest of the gesture to the page, and the reader who
|
|
15
|
+
* was flicking a shelf along gets the whole page moving instead, without having
|
|
16
|
+
* asked for it and usually without having noticed which pixel it happened at.
|
|
17
|
+
* `overscroll` is the choice between the two answers, and neither of them is
|
|
18
|
+
* "sometimes": see `PlassOverscroll`.
|
|
19
|
+
*
|
|
20
|
+
* Only the axis the browser has no answer for. A trackpad's two fingers, a tilt
|
|
21
|
+
* wheel and Shift held down all produce a horizontal gesture, which scrolls a
|
|
22
|
+
* horizontal strip on its own — and chains on its own, which is what
|
|
23
|
+
* `overscroll-behavior-x` is for. Nothing here touches those.
|
|
24
|
+
*/
|
|
25
|
+
import * as React from 'react';
|
|
26
|
+
import type { PlassOverscroll } from '../types.js';
|
|
27
|
+
export interface WheelScrollOptions {
|
|
28
|
+
/** Whether the wheel is read at all. A strip that runs down the page is not. */
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
/** What happens once the strip has nowhere left to go. */
|
|
31
|
+
overscroll: PlassOverscroll;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Turns a vertical wheel over a horizontal scroller into travel along it.
|
|
35
|
+
*
|
|
36
|
+
* A native listener rather than `onWheel`, because React attaches its own wheel
|
|
37
|
+
* listener to the root passively, and `preventDefault` inside a passive
|
|
38
|
+
* listener does nothing but log.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useWheelScroll(ref: React.RefObject<HTMLElement | null>, { enabled, overscroll }: WheelScrollOptions): void;
|
|
41
|
+
/**
|
|
42
|
+
* The class that keeps a scroller's *own* axis to itself.
|
|
43
|
+
*
|
|
44
|
+
* The other half of `overscroll`, and it is CSS rather than JavaScript because
|
|
45
|
+
* this axis is one the browser already scrolls: a two-finger swipe along the
|
|
46
|
+
* shelf, and on a Mac the swipe past the end of it that goes back a page.
|
|
47
|
+
*
|
|
48
|
+
* One axis, never both. A horizontal strip that also contained the vertical
|
|
49
|
+
* axis would be a box a finger cannot scroll the page from, which is most of
|
|
50
|
+
* the screen on a phone.
|
|
51
|
+
*/
|
|
52
|
+
export declare function overscrollClasses(overscroll: PlassOverscroll, horizontal: boolean): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";export function useWheelScroll(t,{enabled:r,overscroll:l}){e.useEffect(()=>{const e=t.current;if(!e||!r)return;let n=Number.NEGATIVE_INFINITY;const onWheel=t=>{if(Math.abs(t.deltaY)<=Math.abs(t.deltaX))return;const r=e.scrollWidth-e.clientWidth;if(r<=1)return;const o=t.deltaMode===t.DOM_DELTA_LINE?16*t.deltaY:t.deltaMode===t.DOM_DELTA_PAGE?t.deltaY*e.clientWidth:t.deltaY,a=Math.abs(e.scrollLeft);if(!(o>0?r-a>1:a>1))return void(("contain"===l||t.timeStamp-n<250)&&t.preventDefault());const i="rtl"===getComputedStyle(e).direction?-1:1;n=t.timeStamp,t.preventDefault(),e.scrollBy({left:o*i,behavior:"instant"})};return e.addEventListener("wheel",onWheel,{passive:!1}),()=>e.removeEventListener("wheel",onWheel)},[r,l,t])}export function overscrollClasses(e,t){return"contain"!==e?"":t?"overscroll-x-contain":"overscroll-y-contain"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chrome a `PlWindowPane` draws, and the tables that say how big it is.
|
|
3
|
+
*
|
|
4
|
+
* It lives here for the reason `internal/mockup.tsx` does. One component reads
|
|
5
|
+
* it, but what it holds is reference data rather than a piece of that component
|
|
6
|
+
* — four systems' worth of title bars, three buttons each, drawn four different
|
|
7
|
+
* ways — and a component file with all of that in it would be a table with a
|
|
8
|
+
* `forwardRef` at the bottom.
|
|
9
|
+
*
|
|
10
|
+
* Three conventions run through it:
|
|
11
|
+
*
|
|
12
|
+
* **Every length is a CSS pixel at `md`, scaled once by `size`.** A title bar is
|
|
13
|
+
* 32px on Windows 11 and 38px on macOS because those are the heights they are,
|
|
14
|
+
* not because a ladder in `internal/styles.ts` says so — this is the one place
|
|
15
|
+
* in the library where the numbers come from somewhere else. `size` multiplies
|
|
16
|
+
* them, which is why they are written as numbers rather than as utilities.
|
|
17
|
+
*
|
|
18
|
+
* **The buttons are drawings of what they do and carry no other party's marks.**
|
|
19
|
+
* A traffic light is three circles; a Windows control is a line, a box and a
|
|
20
|
+
* cross. Their names come from `internal/labels.ts` and are read out; nothing here
|
|
21
|
+
* writes a word.
|
|
22
|
+
*
|
|
23
|
+
* **Nothing is mixed out of `currentColor`.** Every fill a control can take is a
|
|
24
|
+
* slot computed once in `windowSlots`, because a hover that changes the ink and
|
|
25
|
+
* a fill derived from the ink are the same declaration arguing with itself —
|
|
26
|
+
* which is exactly how a close button ends up white on white.
|
|
27
|
+
*/
|
|
28
|
+
import * as React from 'react';
|
|
29
|
+
import type { PlassColor, PlassSize } from '../types.js';
|
|
30
|
+
/**
|
|
31
|
+
* Whose window this is a picture of.
|
|
32
|
+
*
|
|
33
|
+
* Versions are separate entries wherever the *title bar* is what changed, which
|
|
34
|
+
* is why Windows has five and the others have one or two. XP painted its bar in
|
|
35
|
+
* Luna blue and framed the window in it; 7 made it glass; 8 threw both away for
|
|
36
|
+
* a flat square sheet; 10 ruled the bar off from the body; 11 rounded the
|
|
37
|
+
* corners and made the two one Mica sheet again. `macosx` is Aqua — the striped
|
|
38
|
+
* grey bar, the glossy lights and the square bottom corners — against the flat
|
|
39
|
+
* `macos` that replaced it.
|
|
40
|
+
*
|
|
41
|
+
* They are named the way the systems are, so `windows11` rather than `win11`
|
|
42
|
+
* and `macos` rather than `mac`. Nothing here is a copy of any of them: what is
|
|
43
|
+
* drawn is a bar, a border and three buttons at the proportions the system used,
|
|
44
|
+
* and no mark, wordmark or icon belonging to anyone else.
|
|
45
|
+
*/
|
|
46
|
+
export type PlWindowOs = 'macos' | 'macosx' | 'windows11' | 'windows10' | 'windows8' | 'windows7' | 'windowsxp' | 'linux';
|
|
47
|
+
/** The three buttons a title bar can carry. */
|
|
48
|
+
export type PlWindowControl = 'minimize' | 'maximize' | 'close';
|
|
49
|
+
/** How far the window has been dragged from where the layout put it. */
|
|
50
|
+
export interface PlWindowOffset {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
}
|
|
54
|
+
/** Everything the component needs to lay a title bar out, in CSS pixels. */
|
|
55
|
+
export interface PlWindowMetrics {
|
|
56
|
+
/** The title bar's height. */
|
|
57
|
+
bar: number;
|
|
58
|
+
/** The window's own corner, at the top. */
|
|
59
|
+
radius: number;
|
|
60
|
+
/** And at the bottom, which the older systems leave square. */
|
|
61
|
+
radiusBottom: number;
|
|
62
|
+
/** The hairline around the window. */
|
|
63
|
+
frame: number;
|
|
64
|
+
/**
|
|
65
|
+
* The *band* around it, which is a different thing: the stretch of the
|
|
66
|
+
* system's own colour that XP and Aero put down the sides of a window and
|
|
67
|
+
* along the bottom of it, with the content inset into it. Zero on the systems
|
|
68
|
+
* that have only a hairline.
|
|
69
|
+
*/
|
|
70
|
+
band: {
|
|
71
|
+
side: number;
|
|
72
|
+
bottom: number;
|
|
73
|
+
};
|
|
74
|
+
/** The air at the leading edge of the bar. */
|
|
75
|
+
padX: number;
|
|
76
|
+
/** And at the trailing edge, which is nothing where the buttons run to it. */
|
|
77
|
+
padEnd: number;
|
|
78
|
+
/** Between one control and the next. */
|
|
79
|
+
gap: number;
|
|
80
|
+
/** The title's type size. */
|
|
81
|
+
title: number;
|
|
82
|
+
/** One control's box. */
|
|
83
|
+
control: {
|
|
84
|
+
width: number;
|
|
85
|
+
height: number;
|
|
86
|
+
};
|
|
87
|
+
/** The mark inside it. */
|
|
88
|
+
glyph: number;
|
|
89
|
+
/** How heavy the title is written. */
|
|
90
|
+
weight: number;
|
|
91
|
+
/** How much room the whole set of them takes, given how many are drawn. */
|
|
92
|
+
controlsWidth: (count: number) => number;
|
|
93
|
+
/** Aero's close button, which is wider than the two beside it. */
|
|
94
|
+
closeWidth: number;
|
|
95
|
+
}
|
|
96
|
+
interface PlWindowChrome {
|
|
97
|
+
bar: number;
|
|
98
|
+
radius: number;
|
|
99
|
+
/** Square on every system before the corners were rounded all the way round. */
|
|
100
|
+
radiusBottom: number;
|
|
101
|
+
padX: number;
|
|
102
|
+
/** The air at the trailing end, which is nothing where the buttons run to it. */
|
|
103
|
+
padEnd: number;
|
|
104
|
+
gap: number;
|
|
105
|
+
title: number;
|
|
106
|
+
glyph: number;
|
|
107
|
+
weight: number;
|
|
108
|
+
frame: number;
|
|
109
|
+
band: {
|
|
110
|
+
side: number;
|
|
111
|
+
bottom: number;
|
|
112
|
+
};
|
|
113
|
+
control: {
|
|
114
|
+
width: number;
|
|
115
|
+
height: number;
|
|
116
|
+
};
|
|
117
|
+
/** Aero's close button is wider than the two beside it. */
|
|
118
|
+
closeWidth?: number;
|
|
119
|
+
/** Where the title sits along the bar. */
|
|
120
|
+
titleAlign: 'start' | 'center';
|
|
121
|
+
/** Which end the controls are on. */
|
|
122
|
+
controlsSide: 'start' | 'end';
|
|
123
|
+
/**
|
|
124
|
+
* How one control is drawn.
|
|
125
|
+
*
|
|
126
|
+
* - `dot` — a flat traffic light, and `gloss-dot` the same one with Aqua's
|
|
127
|
+
* highlight and ring on it.
|
|
128
|
+
* - `square` — a flat rectangle running to the corner of the window.
|
|
129
|
+
* - `plate` — XP's coloured, gradient-filled button.
|
|
130
|
+
* - `aero` — a pane of glass hung off the top edge, close first among equals.
|
|
131
|
+
* - `circle` — GNOME's small disc.
|
|
132
|
+
*/
|
|
133
|
+
shape: 'dot' | 'gloss-dot' | 'square' | 'plate' | 'aero' | 'circle';
|
|
134
|
+
/** Whether the bar is ruled off from the body. */
|
|
135
|
+
rule: boolean;
|
|
136
|
+
/** How thick the glyphs are drawn. */
|
|
137
|
+
stroke: number;
|
|
138
|
+
/** The corner on the maximize box: Windows 11 rounds it, Windows 10 does not. */
|
|
139
|
+
boxRadius: number;
|
|
140
|
+
/** How much of the page's ink is stirred into the bar, in front and behind. */
|
|
141
|
+
tint: [number, number];
|
|
142
|
+
/** Whether an accented window carries the colour into its border as well. */
|
|
143
|
+
accentBorder: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* The chrome's own colours, for the systems that painted their title bar
|
|
146
|
+
* rather than taking the page's.
|
|
147
|
+
*
|
|
148
|
+
* Fixed values rather than theme tokens, exactly as `PlMockup`'s finishes are:
|
|
149
|
+
* Luna blue is Luna blue on a page switched to dark, and a title bar that
|
|
150
|
+
* changed colour with the theme would be a drawing of the theme rather than
|
|
151
|
+
* of a window. `dark` says which way its own controls have to lighten.
|
|
152
|
+
*/
|
|
153
|
+
paint: {
|
|
154
|
+
fill: string;
|
|
155
|
+
ink: string;
|
|
156
|
+
dark: boolean;
|
|
157
|
+
} | null;
|
|
158
|
+
/** What is laid over that fill: the gradient, the gloss, the stripes. */
|
|
159
|
+
image: string | null;
|
|
160
|
+
/** The title's own shadow — XP's hard one, Aero's glow, Aqua's emboss. */
|
|
161
|
+
shadow: string | null;
|
|
162
|
+
/** Whether the bar blurs what is behind it, which is what made Aero glass. */
|
|
163
|
+
glass: boolean;
|
|
164
|
+
}
|
|
165
|
+
export declare function windowMetrics(os: PlWindowOs, size: PlassSize): PlWindowMetrics;
|
|
166
|
+
export declare function windowChrome(os: PlWindowOs): PlWindowChrome;
|
|
167
|
+
export declare function orderControls(os: PlWindowOs, controls: readonly PlWindowControl[]): PlWindowControl[];
|
|
168
|
+
export declare function windowSlots(options: {
|
|
169
|
+
os: PlWindowOs;
|
|
170
|
+
color: PlassColor;
|
|
171
|
+
accent: boolean;
|
|
172
|
+
transparency: number;
|
|
173
|
+
active: boolean;
|
|
174
|
+
elevation: number;
|
|
175
|
+
}): React.CSSProperties;
|
|
176
|
+
export interface PlPlWindowControlsProps {
|
|
177
|
+
os: PlWindowOs;
|
|
178
|
+
metrics: PlWindowMetrics;
|
|
179
|
+
controls: readonly PlWindowControl[];
|
|
180
|
+
maximized: boolean;
|
|
181
|
+
active: boolean;
|
|
182
|
+
/** What each button is called, plus the word the maximize one takes once the
|
|
183
|
+
* window is maximized. */
|
|
184
|
+
labels: Record<PlWindowControl | 'restore', string>;
|
|
185
|
+
onCommand: (control: PlWindowControl) => void;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The buttons on a title bar.
|
|
189
|
+
*
|
|
190
|
+
* Real `<button>`s with real names, in every system: the whole point of drawing
|
|
191
|
+
* a window rather than a picture of one is that its controls work, and a
|
|
192
|
+
* `<div>` with a click handler on it is invisible to a keyboard. They also stop
|
|
193
|
+
* the press from reaching the bar underneath, or every close would begin by
|
|
194
|
+
* dragging the window half a pixel.
|
|
195
|
+
*
|
|
196
|
+
* Every fill is written into a slot and every state is a class that reads one,
|
|
197
|
+
* so no two declarations are ever left arguing about which of them paints the
|
|
198
|
+
* button — which is the bug that made a hovered close button vanish.
|
|
199
|
+
*/
|
|
200
|
+
export declare function PlWindowControls({ os, metrics, controls, maximized, active, labels, onCommand }: PlPlWindowControlsProps): React.JSX.Element | null;
|
|
201
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{cx as t}from"./styles.js";const o={macos:{bar:38,radius:10,radiusBottom:10,padX:12,padEnd:12,gap:8,title:13,glyph:7,weight:500,frame:1,band:{side:0,bottom:0},control:{width:12,height:12},titleAlign:"center",controlsSide:"start",shape:"dot",rule:!1,stroke:1.4,boxRadius:0,tint:[6,3],accentBorder:!1,paint:null,image:null,shadow:null,glass:!1},macosx:{bar:26,radius:8,radiusBottom:0,padX:10,padEnd:10,gap:8,title:12,glyph:7,weight:700,frame:1,band:{side:0,bottom:0},control:{width:13,height:13},titleAlign:"center",controlsSide:"start",shape:"gloss-dot",rule:!0,stroke:1.5,boxRadius:0,tint:[0,0],accentBorder:!1,paint:{fill:"#e4e4e4",ink:"#333333",dark:!1},image:"repeating-linear-gradient(180deg, rgb(255 255 255 / 0.55) 0 1px, rgb(0 0 0 / 0.035) 1px 2px), linear-gradient(180deg, rgb(255 255 255 / 0.8), rgb(0 0 0 / 0.07))",shadow:"0 1px 0 rgb(255 255 255 / 0.85)",glass:!1},windows11:{bar:32,radius:8,radiusBottom:8,padX:12,padEnd:0,gap:0,title:12,glyph:10,weight:400,frame:1,band:{side:0,bottom:0},control:{width:46,height:32},titleAlign:"start",controlsSide:"end",shape:"square",rule:!1,tint:[3,1],stroke:1,boxRadius:1.6,accentBorder:!1,paint:null,image:null,shadow:null,glass:!1},windows10:{bar:30,radius:0,radiusBottom:0,padX:10,padEnd:0,gap:0,title:12,glyph:10,weight:400,frame:1,band:{side:0,bottom:0},control:{width:45,height:30},titleAlign:"start",controlsSide:"end",shape:"square",rule:!0,tint:[0,0],stroke:.9,boxRadius:0,accentBorder:!0,paint:null,image:null,shadow:null,glass:!1},windows8:{bar:32,radius:0,radiusBottom:0,padX:10,padEnd:0,gap:0,title:12,glyph:11,weight:400,frame:2,band:{side:0,bottom:0},control:{width:45,height:32},titleAlign:"start",controlsSide:"end",shape:"square",rule:!1,tint:[0,0],stroke:1,boxRadius:0,accentBorder:!0,paint:null,image:null,shadow:null,glass:!1},windows7:{bar:30,radius:7,radiusBottom:0,padX:10,padEnd:3,gap:2,title:12,glyph:10,weight:400,frame:1,band:{side:7,bottom:7},control:{width:29,height:20},closeWidth:45,titleAlign:"start",controlsSide:"end",shape:"aero",rule:!1,tint:[0,0],stroke:1.1,boxRadius:0,accentBorder:!1,paint:{fill:"rgb(198 218 242 / 0.45)",ink:"#12314f",dark:!1},image:"linear-gradient(180deg, rgb(255 255 255 / 0.62), rgb(255 255 255 / 0.1) 46%, rgb(255 255 255 / 0.34) 88%, rgb(255 255 255 / 0.5))",shadow:"0 0 6px rgb(255 255 255 / 0.95), 0 0 3px rgb(255 255 255 / 0.95)",glass:!0},windowsxp:{bar:30,radius:8,radiusBottom:0,padX:6,padEnd:4,gap:2,title:13,glyph:9,weight:700,frame:1,band:{side:4,bottom:4},control:{width:21,height:21},closeWidth:26,titleAlign:"start",controlsSide:"end",shape:"plate",rule:!1,tint:[0,0],stroke:1.8,boxRadius:3,accentBorder:!1,paint:{fill:"#1f66d6",ink:"#ffffff",dark:!0},image:"linear-gradient(180deg, rgb(255 255 255 / 0.55), rgb(255 255 255 / 0.26) 7%, rgb(0 0 0 / 0.11) 42%, rgb(0 0 0 / 0.05) 56%, rgb(255 255 255 / 0.22) 76%, rgb(255 255 255 / 0.34) 88%, rgb(0 0 0 / 0.16) 96%, rgb(0 0 0 / 0.34))",shadow:"0 1px 1px rgb(0 0 0 / 0.45)",glass:!1},linux:{bar:44,radius:12,radiusBottom:12,padX:10,padEnd:10,gap:6,title:14,glyph:10,weight:600,frame:1,band:{side:0,bottom:0},control:{width:24,height:24},titleAlign:"center",controlsSide:"end",shape:"circle",rule:!1,stroke:1.2,boxRadius:0,tint:[11,5],accentBorder:!1,paint:null,image:null,shadow:null,glass:!1}},r={xs:.8,sm:.9,md:1,lg:1.15,xl:1.3};export function windowMetrics(e,i){const t=o[e],a=r[i],round=e=>Math.round(e*a),n={width:round(t.control.width),height:round(t.control.height)},s=round(t.gap),l=void 0===t.closeWidth?n.width:round(t.closeWidth);return{bar:round(t.bar),radius:t.radius,radiusBottom:t.radiusBottom,frame:t.frame,band:{side:round(t.band.side),bottom:round(t.band.bottom)},padX:round(t.padX),padEnd:round(t.padEnd),gap:s,title:round(t.title),glyph:round(t.glyph),weight:t.weight,control:n,controlsWidth:e=>e<=0?0:l+(e-1)*n.width+(e-1)*s,closeWidth:l}}export function windowChrome(e){return o[e]}const a={macos:["close","minimize","maximize"],macosx:["close","minimize","maximize"],windows11:["minimize","maximize","close"],windows10:["minimize","maximize","close"],windows8:["minimize","maximize","close"],windows7:["minimize","maximize","close"],windowsxp:["minimize","maximize","close"],linux:["minimize","maximize","close"]};export function orderControls(e,i){return a[e].filter(e=>i.includes(e))}function veil(e,i){const t=Math.round(100*(1-i));return t>=100?e:`color-mix(in oklab, ${e} ${t}%, transparent)`}export function windowSlots(e){const{os:i,color:t,accent:r,transparency:a,active:n,elevation:s}=e,l=o[i],d=Math.min(Math.max(a,0),1),p="var(--plass-surface)",c=l.tint[n?0:1],g=0===c?p:`color-mix(in oklab, ${p} ${100-c}%, var(--plass-fg))`,h=r&&n,u=l.paint,m=u?n?u.fill:`color-mix(in oklab, ${u.fill} 45%, #c6c9ce)`:null,b=h?`var(--plass-${t}-solid)`:m??g,w=h?`var(--plass-${t}-on-solid)`:u?n?u.ink:`color-mix(in oklab, ${u.ink} 60%, transparent)`:n?"var(--plass-fg)":"var(--plass-muted-fg)",x=l.band.side>0,f=x?veil(h?`var(--plass-${t}-solid)`:m??g,d):"transparent",v=x?`color-mix(in oklab, ${h?`var(--plass-${t}-solid)`:m??"var(--plass-border)"} 72%, black)`:h&&l.accentBorder?`var(--plass-${t}-solid)`:n?"var(--plass-border)":"color-mix(in oklab, var(--plass-border) 55%, transparent)",k=h||(u?.dark??!1);return{"--p-window-bar":veil(b,d),"--p-window-bar-fg":w,"--p-window-bar-image":l.image??"none","--p-window-bar-shadow":l.shadow??"none","--p-window-body":veil(p,d),"--p-window-line":v,"--p-window-band":f,"--p-window-hover":k?"rgb(255 255 255 / 0.18)":"color-mix(in oklab, var(--plass-fg) 9%, transparent)","--p-window-press":k?"rgb(255 255 255 / 0.28)":"color-mix(in oklab, var(--plass-fg) 16%, transparent)","--p-window-shadow":`var(--plass-shadow-${n?s:Math.max(s-1,0)})`,"--p-accent":`var(--plass-${t}-accent)`,"--p-ring":`var(--plass-${t}-ring)`}}function Glyph({size:i,stroke:t,round:o,children:r}){return e("svg",{viewBox:"0 0 10 10",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:t,strokeLinecap:o?"round":"square",strokeLinejoin:o?"round":"miter","aria-hidden":"true",children:r})}function controlGlyph(t,o,r,a){const n=r.stroke,s=r.boxRadius>0||"square"!==r.shape,l=r.boxRadius;return"minimize"===t?e(Glyph,{size:a,stroke:n,round:s,children:e("path",{d:"plate"===r.shape?"M2 7.5h6":"M1.5 5h7"})}):"close"===t?e(Glyph,{size:a,stroke:n,round:s,children:e("path",{d:"m1.6 1.6 6.8 6.8M8.4 1.6 1.6 8.4"})}):o?i(Glyph,{size:a,stroke:n,round:s,children:[e("rect",{x:"1.4",y:"3.4",width:"5.2",height:"5.2",rx:l}),e("path",{d:"M3.6 3.4v-2h5v5h-2"})]}):e(Glyph,{size:a,stroke:n,round:s,children:e("rect",{x:"1.5",y:"1.5",width:"7",height:"7",rx:l})})}const n={close:"#ff5f57",minimize:"#febc2e",maximize:"#28c840"},s={close:"#cf4b36",minimize:"#4b85d4",maximize:"#4b85d4"},l={macos:null,macosx:null,windows11:"#c42b1c",windows10:"#e81123",windows8:"#e81123",windows7:"#e04a45",windowsxp:null,linux:null};export function PlWindowControls({os:i,metrics:r,controls:a,maximized:d,active:p,labels:c,onCommand:g}){const h=o[i],u=orderControls(i,a);if(0===u.length)return null;const m="dot"===h.shape||"gloss-dot"===h.shape,b="circle"===h.shape,w="plate"===h.shape,x="aero"===h.shape;return e("div",{className:t("group/controls flex shrink-0 items-center",x?"self-start":"self-stretch"),style:{gap:r.gap},onPointerDown:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:u.map(o=>{const a="maximize"===o&&d?c.restore:c[o],u="close"===o?l[i]:null,{face:f,ink:v,image:k,plate:y}=function controlFace(e,i,t){switch(e.shape){case"dot":case"gloss-dot":return{face:t?n[i]:"color-mix(in oklab, var(--plass-fg) 22%, transparent)",ink:"rgb(0 0 0 / 0.55)",image:"gloss-dot"===e.shape?"radial-gradient(circle at 50% 26%, rgb(255 255 255 / 0.8), rgb(255 255 255 / 0) 62%)":void 0,plate:"gloss-dot"===e.shape?"inset 0 0 0 1px rgb(0 0 0 / 0.22), inset 0 -1px 1px rgb(0 0 0 / 0.15)":void 0};case"plate":return{face:t?s[i]:`color-mix(in oklab, ${s[i]} 45%, #c6c9ce)`,ink:"#ffffff",image:"linear-gradient(180deg, rgb(255 255 255 / 0.5), rgb(255 255 255 / 0.05) 55%, rgb(0 0 0 / 0.14))",plate:"inset 0 0 0 1px rgb(255 255 255 / 0.4)"};case"aero":return{face:"rgb(255 255 255 / 0.3)",image:"linear-gradient(180deg, rgb(255 255 255 / 0.6), rgb(255 255 255 / 0.08) 52%, rgb(255 255 255 / 0.3))",plate:"inset 0 0 0 1px rgb(255 255 255 / 0.55)"};default:return{}}}(h,o,p);return e("button",{type:"button","aria-label":a,title:a,className:t("group/control relative flex shrink-0 cursor-pointer items-center justify-center","[transition:background-color_var(--plass-duration)_var(--plass-ease),color_var(--plass-duration)_var(--plass-ease),filter_var(--plass-duration)_var(--plass-ease)]","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]",m||b?"rounded-full":"",b?"bg-(--p-window-hover)":"",f?"bg-(--p-window-face)":"",u?"hover:bg-(--p-window-danger) hover:text-white active:bg-(--p-window-danger)":m?"":w?"hover:brightness-110 active:brightness-95":b?"hover:bg-(--p-window-press) active:bg-(--p-window-press)":x?"hover:brightness-110 active:brightness-95":"hover:bg-(--p-window-hover) active:bg-(--p-window-press)"),style:{width:m?r.control.height:"close"===o?r.closeWidth:r.control.width,height:r.control.height,borderRadius:w?h.boxRadius+1:x?"0 0 3px 3px":void 0,backgroundImage:k,boxShadow:y,color:v,...f?{"--p-window-face":f}:{},...u?{"--p-window-danger":u}:{}},onClick:()=>g(o),children:e("span",{className:t("flex items-center justify-center",m?"opacity-0 [transition:opacity_var(--plass-duration)_var(--plass-ease)] group-hover/controls:opacity-100 group-focus-visible/control:opacity-100":""),children:controlGlyph(o,d,h,r.glyph)})},o)})})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const de={close:"Schließen",cancel:"Abbrechen",confirm:"Bestätigen",acknowledge:"OK",clear:"Leeren",done:"Fertig",skip:"Überspringen",search:"Suchen",selectAll:"Alle auswählen",selectRow:"Zeile auswählen",remove:"Entfernen",dismiss:"Ausblenden",open:"Öffnen",previous:"Zurück",next:"Weiter",reveal:"Anzeigen",hide:"Verbergen",increase:"Erhöhen",decrease:"Verringern",preview:"Vorschau",empty:"Nichts vorhanden",optional:"Optional",breadcrumb:"Navigationspfad",breadcrumbExpand:"Ausgeblendete Schritte anzeigen",carousel:"Karussell",carouselPrevious:"Vorheriges Bild",carouselNext:"Nächstes Bild",slide:"Bild",commandPalette:"Befehlspalette",commandPalettePlaceholder:"Befehle durchsuchen",gallery:"Galerie",chart:"Diagramm",minimize:"Minimieren",maximize:"Maximieren",restore:"Wiederherstellen",resizeWindow:"Fenstergröße ändern",overlay:"Overlay",notifications:"Benachrichtigungen",pagination:"Seitennavigation",paginationPrevious:"Vorherige Seite",paginationNext:"Nächste Seite",paginationFirst:"Erste Seite",paginationLast:"Letzte Seite",rating:"Bewertung",sidebar:"Seitenleiste",sidebarOpen:"Seitenleiste öffnen",sidebarClose:"Seitenleiste schließen",sidebarResize:"Breite der Seitenleiste ändern",skipToContent:"Zum Inhalt springen",backToTop:"Nach oben",onThisPage:"Auf dieser Seite",typing:"Schreibt …",messageSending:"Wird gesendet",messageSent:"Gesendet",messageDelivered:"Zugestellt",messageRead:"Gelesen",messageFailed:"Nicht zugestellt",spoilerWarning:"Kann Spoiler enthalten",filePickerTitle:"Dateien hier ablegen oder zum Durchsuchen klicken",newTab:"(wird in einem neuen Tab geöffnet)",transferAvailable:"Verfügbar",transferSelected:"Ausgewählt",transferToSelected:"Zu den ausgewählten verschieben",transferToAvailable:"Zu den verfügbaren verschieben",copy:"Kopieren",copied:"Kopiert",copyFailed:"Kopieren nicht möglich",raw:"Unformatiert",code:"Code",previousMonth:"Vorheriger Monat",nextMonth:"Nächster Monat",previousYear:"Vorheriges Jahr",nextYear:"Nächstes Jahr",previousYears:"Vorherige Jahre",nextYears:"Nächste Jahre",chooseMonth:"Monat wählen",chooseYear:"Jahr wählen",today:"Heute",thisMonth:"Dieser Monat",thisYear:"Dieses Jahr",now:"Jetzt",hour:"Stunde",minute:"Minute",second:"Sekunde",meridiem:"AM/PM",start:"Beginn",end:"Ende",paginationPage:e=>`Seite ${e}`,paginationStatus:(e,n)=>`Seite ${e} von ${n}`,ratingValue:(e,n)=>`${e.toLocaleString("de")} von ${n}`,ratingNone:"Keine Bewertung",carouselSlide:(e,n)=>`Bild ${e} von ${n}`,galleryItem:(e,n)=>`${e} von ${n}`,removeItem:e=>`${e} entfernen`,addCustom:e=>`„${e}“ hinzufügen`,otpSlot:(e,n)=>`Zeichen ${e} von ${n}`,transferMoved:(e,n)=>`${e} ${1===e?"Eintrag":"Einträge"} nach „${n}“ verschoben`};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defaultLabels as e}from"../internal/labels.js";export const en=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const es={close:"Cerrar",cancel:"Cancelar",confirm:"Confirmar",acknowledge:"Aceptar",clear:"Borrar",done:"Hecho",skip:"Omitir",search:"Buscar",selectAll:"Seleccionar todo",selectRow:"Seleccionar fila",remove:"Quitar",dismiss:"Descartar",open:"Abrir",previous:"Anterior",next:"Siguiente",reveal:"Mostrar",hide:"Ocultar",increase:"Aumentar",decrease:"Disminuir",preview:"Vista previa",empty:"No hay nada aquí",optional:"Opcional",breadcrumb:"Ruta de navegación",breadcrumbExpand:"Mostrar los pasos ocultos",carousel:"Carrusel",carouselPrevious:"Diapositiva anterior",carouselNext:"Diapositiva siguiente",slide:"diapositiva",commandPalette:"Paleta de comandos",commandPalettePlaceholder:"Buscar comandos",gallery:"Galería",chart:"Gráfico",minimize:"Minimizar",maximize:"Maximizar",restore:"Restaurar",resizeWindow:"Redimensionar la ventana",overlay:"Capa",notifications:"Notificaciones",pagination:"Paginación",paginationPrevious:"Página anterior",paginationNext:"Página siguiente",paginationFirst:"Primera página",paginationLast:"Última página",rating:"Valoración",sidebar:"Barra lateral",sidebarOpen:"Abrir la barra lateral",sidebarClose:"Cerrar la barra lateral",sidebarResize:"Redimensionar la barra lateral",skipToContent:"Saltar al contenido",backToTop:"Volver arriba",onThisPage:"En esta página",typing:"Escribiendo…",messageSending:"Enviando",messageSent:"Enviado",messageDelivered:"Entregado",messageRead:"Leído",messageFailed:"No entregado",spoilerWarning:"Puede contener spoilers",filePickerTitle:"Suelta archivos aquí o haz clic para buscarlos",newTab:"(se abre en una pestaña nueva)",transferAvailable:"Disponibles",transferSelected:"Seleccionados",transferToSelected:"Mover a seleccionados",transferToAvailable:"Mover a disponibles",copy:"Copiar",copied:"Copiado",copyFailed:"No se pudo copiar",raw:"Sin formato",code:"Código",previousMonth:"Mes anterior",nextMonth:"Mes siguiente",previousYear:"Año anterior",nextYear:"Año siguiente",previousYears:"Años anteriores",nextYears:"Años siguientes",chooseMonth:"Elegir un mes",chooseYear:"Elegir un año",today:"Hoy",thisMonth:"Este mes",thisYear:"Este año",now:"Ahora",hour:"Hora",minute:"Minuto",second:"Segundo",meridiem:"a. m./p. m.",start:"Inicio",end:"Fin",paginationPage:e=>`Página ${e}`,paginationStatus:(e,a)=>`Página ${e} de ${a}`,ratingValue:(e,a)=>`${e.toLocaleString("es")} de ${a}`,ratingNone:"Sin valoración",carouselSlide:(e,a)=>`Diapositiva ${e} de ${a}`,galleryItem:(e,a)=>`${e} de ${a}`,removeItem:e=>`Quitar ${e}`,addCustom:e=>`Añadir «${e}»`,otpSlot:(e,a)=>`Carácter ${e} de ${a}`,transferMoved:(e,a)=>`${e} ${1===e?"elemento movido":"elementos movidos"} a «${a}»`};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const fr={close:"Fermer",cancel:"Annuler",confirm:"Confirmer",acknowledge:"OK",clear:"Effacer",done:"Terminé",skip:"Ignorer",search:"Rechercher",selectAll:"Tout sélectionner",selectRow:"Sélectionner la ligne",remove:"Retirer",dismiss:"Masquer",open:"Ouvrir",previous:"Précédent",next:"Suivant",reveal:"Afficher",hide:"Masquer",increase:"Augmenter",decrease:"Diminuer",preview:"Aperçu",empty:"Rien ici",optional:"Facultatif",breadcrumb:"Fil d’Ariane",breadcrumbExpand:"Afficher les étapes masquées",carousel:"Carrousel",carouselPrevious:"Diapositive précédente",carouselNext:"Diapositive suivante",slide:"diapositive",commandPalette:"Palette de commandes",commandPalettePlaceholder:"Rechercher une commande",gallery:"Galerie",chart:"Graphique",minimize:"Réduire",maximize:"Agrandir",restore:"Restaurer",resizeWindow:"Redimensionner la fenêtre",overlay:"Voile",notifications:"Notifications",pagination:"Pagination",paginationPrevious:"Page précédente",paginationNext:"Page suivante",paginationFirst:"Première page",paginationLast:"Dernière page",rating:"Note",sidebar:"Barre latérale",sidebarOpen:"Ouvrir la barre latérale",sidebarClose:"Fermer la barre latérale",sidebarResize:"Redimensionner la barre latérale",skipToContent:"Aller au contenu",backToTop:"Revenir en haut",onThisPage:"Sur cette page",typing:"Écrit…",messageSending:"Envoi en cours",messageSent:"Envoyé",messageDelivered:"Distribué",messageRead:"Lu",messageFailed:"Non distribué",spoilerWarning:"Peut contenir des spoilers",filePickerTitle:"Déposez des fichiers ici ou cliquez pour parcourir",newTab:"(s’ouvre dans un nouvel onglet)",transferAvailable:"Disponibles",transferSelected:"Sélectionnés",transferToSelected:"Déplacer vers les sélectionnés",transferToAvailable:"Déplacer vers les disponibles",copy:"Copier",copied:"Copié",copyFailed:"Copie impossible",raw:"Brut",code:"Code",previousMonth:"Mois précédent",nextMonth:"Mois suivant",previousYear:"Année précédente",nextYear:"Année suivante",previousYears:"Années précédentes",nextYears:"Années suivantes",chooseMonth:"Choisir un mois",chooseYear:"Choisir une année",today:"Aujourd’hui",thisMonth:"Ce mois-ci",thisYear:"Cette année",now:"Maintenant",hour:"Heure",minute:"Minute",second:"Seconde",meridiem:"AM/PM",start:"Début",end:"Fin",paginationPage:e=>`Page ${e}`,paginationStatus:(e,r)=>`Page ${e} sur ${r}`,ratingValue:(e,r)=>`${e.toLocaleString("fr")} sur ${r}`,ratingNone:"Aucune note",carouselSlide:(e,r)=>`Diapositive ${e} sur ${r}`,galleryItem:(e,r)=>`${e} sur ${r}`,removeItem:e=>`Retirer ${e}`,addCustom:e=>`Ajouter « ${e} »`,otpSlot:(e,r)=>`Caractère ${e} sur ${r}`,transferMoved:(e,r)=>`${e} ${1===e?"élément déplacé":"éléments déplacés"} vers « ${r} »`};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The library's own vocabulary, translated.
|
|
3
|
+
*
|
|
4
|
+
* Every pack is a whole `PlassLabels`, so a missing key is a type error rather
|
|
5
|
+
* than a word that quietly stays English, and every one of them is a **named
|
|
6
|
+
* export from its own module**. That is the shape rather than a
|
|
7
|
+
* `locales['ko']` lookup, and the reason is the bundle: a lookup table has to
|
|
8
|
+
* be in the build for the key to be found in it, so a French application would
|
|
9
|
+
* ship the Korean one. An import ships one.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { PlassProvider } from 'plass-ui';
|
|
13
|
+
* import { ko } from 'plass-ui/locales';
|
|
14
|
+
*
|
|
15
|
+
* <PlassProvider locale="ko-KR" labels={ko}>…</PlassProvider>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* `locale` and `labels` are two different jobs and both are needed. `locale` is
|
|
19
|
+
* the BCP 47 tag `Intl` formats dates and numbers against; `labels` is the
|
|
20
|
+
* words `Intl` has no opinion about.
|
|
21
|
+
*
|
|
22
|
+
* **The set is short on purpose.** A pack is only worth shipping when somebody
|
|
23
|
+
* who reads the language has read it, so this is the list that has been read
|
|
24
|
+
* rather than the list a machine could produce. Adding one is a file of the
|
|
25
|
+
* same shape and a pull request.
|
|
26
|
+
*/
|
|
27
|
+
export { de } from './de.js';
|
|
28
|
+
export { en } from './en.js';
|
|
29
|
+
export { es } from './es.js';
|
|
30
|
+
export { fr } from './fr.js';
|
|
31
|
+
export { ja } from './ja.js';
|
|
32
|
+
export { ko } from './ko.js';
|
|
33
|
+
export { zhHans } from './zh-Hans.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{de}from"./de.js";export{en}from"./en.js";export{es}from"./es.js";export{fr}from"./fr.js";export{ja}from"./ja.js";export{ko}from"./ko.js";export{zhHans}from"./zh-Hans.js";
|