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,138 @@
|
|
|
1
|
+
export interface PlassLabels {
|
|
2
|
+
/** The × on a modal, a drawer, a popover, a toast. */
|
|
3
|
+
close: string;
|
|
4
|
+
/** The way out of a question that has two answers. */
|
|
5
|
+
cancel: string;
|
|
6
|
+
/** The other one. */
|
|
7
|
+
confirm: string;
|
|
8
|
+
/** Empties a field, a picker, a search. */
|
|
9
|
+
clear: string;
|
|
10
|
+
/** Finishes with a picker, or with a tour. */
|
|
11
|
+
done: string;
|
|
12
|
+
/** Leaves a sequence before the end of it. */
|
|
13
|
+
skip: string;
|
|
14
|
+
/** Names a search field the caller did not name. */
|
|
15
|
+
search: string;
|
|
16
|
+
/** Ticks everything in a list at once. */
|
|
17
|
+
selectAll: string;
|
|
18
|
+
/** Ticks one row of a table, whose own name is the row's contents. */
|
|
19
|
+
selectRow: string;
|
|
20
|
+
/** Takes one thing out of a set. */
|
|
21
|
+
remove: string;
|
|
22
|
+
/** Sends a message away without answering it. */
|
|
23
|
+
dismiss: string;
|
|
24
|
+
/** Opens a list a field is attached to. */
|
|
25
|
+
open: string;
|
|
26
|
+
/** A direction, on the two components that only move one step. */
|
|
27
|
+
previous: string;
|
|
28
|
+
next: string;
|
|
29
|
+
/** Uncovers and re-covers hidden content. */
|
|
30
|
+
reveal: string;
|
|
31
|
+
hide: string;
|
|
32
|
+
/** A number field's two steppers. */
|
|
33
|
+
increase: string;
|
|
34
|
+
decrease: string;
|
|
35
|
+
/** Opens a picture over the page. */
|
|
36
|
+
preview: string;
|
|
37
|
+
/** What a list says when it has nothing in it. */
|
|
38
|
+
empty: string;
|
|
39
|
+
/** The trail's landmark, and the button that opens the steps it folded away. */
|
|
40
|
+
breadcrumb: string;
|
|
41
|
+
breadcrumbExpand: string;
|
|
42
|
+
/** The reel's landmark and its two steppers, which move by a slide. */
|
|
43
|
+
carousel: string;
|
|
44
|
+
carouselPrevious: string;
|
|
45
|
+
carouselNext: string;
|
|
46
|
+
/** The wall of pictures' own landmark. */
|
|
47
|
+
gallery: string;
|
|
48
|
+
/** What a drawing of numbers is called when the caller has not named it. */
|
|
49
|
+
chart: string;
|
|
50
|
+
minimize: string;
|
|
51
|
+
maximize: string;
|
|
52
|
+
restore: string;
|
|
53
|
+
resizeWindow: string;
|
|
54
|
+
/** The palette's landmark and the placeholder in its field. */
|
|
55
|
+
commandPalette: string;
|
|
56
|
+
commandPalettePlaceholder: string;
|
|
57
|
+
/** What a sheet over the whole page is called when it has no name. */
|
|
58
|
+
overlay: string;
|
|
59
|
+
/** The pager's landmark and its four steppers, which move by a page. */
|
|
60
|
+
pagination: string;
|
|
61
|
+
paginationPrevious: string;
|
|
62
|
+
paginationNext: string;
|
|
63
|
+
paginationFirst: string;
|
|
64
|
+
paginationLast: string;
|
|
65
|
+
/** The stars' group. */
|
|
66
|
+
rating: string;
|
|
67
|
+
/** The panel's landmark, the button that shuts it, and the handle that sizes it. */
|
|
68
|
+
sidebar: string;
|
|
69
|
+
sidebarClose: string;
|
|
70
|
+
sidebarResize: string;
|
|
71
|
+
/** The first link on a page, which jumps past the furniture. */
|
|
72
|
+
skipToContent: string;
|
|
73
|
+
/** The button that goes back up a long page. */
|
|
74
|
+
backToTop: string;
|
|
75
|
+
/** The table of contents' own landmark. */
|
|
76
|
+
onThisPage: string;
|
|
77
|
+
/** What a chat bubble says while somebody is still writing. */
|
|
78
|
+
typing: string;
|
|
79
|
+
/** Read out after a link that leaves the page, and never drawn. */
|
|
80
|
+
newTab: string;
|
|
81
|
+
/** The two columns of a transfer, and the buttons between them. */
|
|
82
|
+
transferAvailable: string;
|
|
83
|
+
transferSelected: string;
|
|
84
|
+
transferToSelected: string;
|
|
85
|
+
transferToAvailable: string;
|
|
86
|
+
/** The code block's bar: the button, what it says once it has worked, and
|
|
87
|
+
* what it says when the clipboard refused. */
|
|
88
|
+
copy: string;
|
|
89
|
+
copied: string;
|
|
90
|
+
copyFailed: string;
|
|
91
|
+
/** The toggle that drops a block's colouring. */
|
|
92
|
+
raw: string;
|
|
93
|
+
/** What a block of code is called when it has neither a title nor a language. */
|
|
94
|
+
code: string;
|
|
95
|
+
/** The calendar's steppers, in day view. */
|
|
96
|
+
previousMonth: string;
|
|
97
|
+
nextMonth: string;
|
|
98
|
+
/** The same steppers in month view, where they move by a year. */
|
|
99
|
+
previousYear: string;
|
|
100
|
+
nextYear: string;
|
|
101
|
+
/** And in year view, where they move by a page of twelve. */
|
|
102
|
+
previousYears: string;
|
|
103
|
+
nextYears: string;
|
|
104
|
+
/** The two header buttons that open the month grid and the year grid. */
|
|
105
|
+
chooseMonth: string;
|
|
106
|
+
chooseYear: string;
|
|
107
|
+
/** The footer's actions. */
|
|
108
|
+
today: string;
|
|
109
|
+
/** The same shortcut on a picker that only asks for a month or a year. */
|
|
110
|
+
thisMonth: string;
|
|
111
|
+
thisYear: string;
|
|
112
|
+
now: string;
|
|
113
|
+
/** The clock's columns. */
|
|
114
|
+
hour: string;
|
|
115
|
+
minute: string;
|
|
116
|
+
second: string;
|
|
117
|
+
meridiem: string;
|
|
118
|
+
/** Which end of a range the calendar is currently asking for. */
|
|
119
|
+
start: string;
|
|
120
|
+
end: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* English, and the reason the library needs no setup to read.
|
|
124
|
+
*
|
|
125
|
+
* Every locale in `src/locales/` is this object with the values replaced, which
|
|
126
|
+
* is what makes a missing key a type error rather than a word that quietly
|
|
127
|
+
* stays English.
|
|
128
|
+
*/
|
|
129
|
+
export declare const defaultLabels: PlassLabels;
|
|
130
|
+
/**
|
|
131
|
+
* The words in scope, resolved once per render.
|
|
132
|
+
*
|
|
133
|
+
* Two layers: the English above, and whatever a `PlassProvider` set. A
|
|
134
|
+
* component's own `*Label` prop is the third and narrowest, and it is applied
|
|
135
|
+
* at the call site rather than here — which is what lets an application
|
|
136
|
+
* translate the vocabulary once and one button still say something else.
|
|
137
|
+
*/
|
|
138
|
+
export declare function useLabels(): PlassLabels;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{useDefaults as a}from"./defaults.js";export const defaultLabels={close:"Close",cancel:"Cancel",confirm:"Confirm",clear:"Clear",done:"Done",skip:"Skip",search:"Search",selectAll:"Select all",selectRow:"Select row",remove:"Remove",dismiss:"Dismiss",open:"Open",previous:"Previous",next:"Next",reveal:"Reveal",hide:"Hide",increase:"Increase",decrease:"Decrease",preview:"Preview",empty:"Nothing here",breadcrumb:"Breadcrumb",breadcrumbExpand:"Show the hidden steps",carousel:"Carousel",carouselPrevious:"Previous slide",carouselNext:"Next slide",commandPalette:"Command palette",commandPalettePlaceholder:"Search commands",gallery:"Gallery",chart:"Chart",minimize:"Minimize",maximize:"Maximize",restore:"Restore",resizeWindow:"Resize window",overlay:"Overlay",pagination:"Pagination",paginationPrevious:"Previous page",paginationNext:"Next page",paginationFirst:"First page",paginationLast:"Last page",rating:"Rating",sidebar:"Sidebar",sidebarClose:"Close sidebar",sidebarResize:"Resize sidebar",skipToContent:"Skip to content",backToTop:"Back to top",onThisPage:"On this page",typing:"Typing…",newTab:"(opens in a new tab)",transferAvailable:"Available",transferSelected:"Selected",transferToSelected:"Move to selected",transferToAvailable:"Move to available",copy:"Copy",copied:"Copied",copyFailed:"Could not copy",raw:"Raw",code:"Code",previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",today:"Today",thisMonth:"This month",thisYear:"This year",now:"Now",hour:"Hour",minute:"Minute",second:"Second",meridiem:"AM/PM",start:"Start",end:"End"};export function useLabels(){const{labels:o}=a();return e.useMemo(()=>o?{...defaultLabels,...o}:defaultLabels,[o])}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one query the library asks on its own behalf rather than the caller's.
|
|
3
|
+
*
|
|
4
|
+
* Named here rather than in `internal/animate.ts` because it is not only the
|
|
5
|
+
* animations' business: a loading indicator answers it the other way round —
|
|
6
|
+
* slowing rather than stopping, since a spinner that stopped would be lying
|
|
7
|
+
* about whether anything is happening.
|
|
8
|
+
*/
|
|
9
|
+
export declare const reducedMotionQuery = "(prefers-reduced-motion: reduce)";
|
|
10
|
+
/**
|
|
11
|
+
* Whether the window matches `query` right now, re-rendering when it stops.
|
|
12
|
+
*
|
|
13
|
+
* `null` is a query that cannot be asked — the `xs` rung of a ladder whose
|
|
14
|
+
* floor is zero — and is always `false` rather than being a second code path at
|
|
15
|
+
* every call site.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useMediaQuery(query: string | null): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the reader has asked their platform for less movement.
|
|
20
|
+
*
|
|
21
|
+
* A server has no reader and so no preference, which is the store's own answer
|
|
22
|
+
* and is the right one here: the markup that ships is the one with the motion
|
|
23
|
+
* in it, and a reader who asked for less gets it in the render after hydration
|
|
24
|
+
* — before any of these animations has had a frame to run in.
|
|
25
|
+
*/
|
|
26
|
+
export declare function usePrefersReducedMotion(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";const n=new Map;function listFor(e){if("undefined"==typeof window||!window.matchMedia)return null;let r=n.get(e);return r||(r=window.matchMedia(e),n.set(e,r)),r}function onServer(){return!1}export const reducedMotionQuery="(prefers-reduced-motion: reduce)";export function useMediaQuery(n){const r=e.useCallback(e=>{const r=null===n?null:listFor(n);return r?(r.addEventListener("change",e),()=>r.removeEventListener("change",e)):()=>{}},[n]),t=e.useCallback(()=>null!==n&&(listFor(n)?.matches??!1),[n]);return e.useSyncExternalStore(r,t,onServer)}export function usePrefersReducedMotion(){return useMediaQuery(reducedMotionQuery)}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The device a `PlMockup` is a picture of: the tables that say how big it is,
|
|
3
|
+
* and the drawings that go on its screen.
|
|
4
|
+
*
|
|
5
|
+
* It lives here for the reason `internal/color.ts` does. Only one component
|
|
6
|
+
* reads it, but what it holds is a body of reference data rather than a piece of
|
|
7
|
+
* that component — five resolutions per device, three shells, six systems' worth
|
|
8
|
+
* of chrome — and a component file with all of that in it would be a table with
|
|
9
|
+
* a `forwardRef` at the bottom.
|
|
10
|
+
*
|
|
11
|
+
* Two conventions run through the whole file:
|
|
12
|
+
*
|
|
13
|
+
* **Every length in here is a device pixel.** The screen is laid out at the
|
|
14
|
+
* resolution it claims to have and the whole frame is scaled once, at the top,
|
|
15
|
+
* so a 54px status bar is 54px on the phone rather than 54px on the page. That
|
|
16
|
+
* is also why the geometry is written as inline styles rather than as utilities:
|
|
17
|
+
* these are numbers off a table, computed per render, and Tailwind only ever
|
|
18
|
+
* sees class names that appear literally in the source. Utilities are still what
|
|
19
|
+
* does the layout — the inline styles are only ever the measurements.
|
|
20
|
+
*
|
|
21
|
+
* **The chrome draws no words except the clock.** A menu bar's titles, a dock's
|
|
22
|
+
* icons and a status bar's carrier are abstract shapes, which is what keeps this
|
|
23
|
+
* an impression of a system rather than a copy of one: nothing to translate,
|
|
24
|
+
* nothing to redraw when a version ships, and no other party's marks in the
|
|
25
|
+
* library. The clock is the exception because a blank rectangle where the time
|
|
26
|
+
* goes reads as a bug, and it is a prop.
|
|
27
|
+
*/
|
|
28
|
+
import * as React from 'react';
|
|
29
|
+
import type { PlassSize } from '../types.js';
|
|
30
|
+
/** Which machine the mockup is a picture of. */
|
|
31
|
+
export type PlMockupDevice = 'desktop' | 'tablet' | 'mobile';
|
|
32
|
+
/**
|
|
33
|
+
* The system whose chrome is drawn on the screen.
|
|
34
|
+
*
|
|
35
|
+
* One union across all three devices rather than one per device: a caller
|
|
36
|
+
* reading the type should see the whole set, and a device offered an OS that is
|
|
37
|
+
* not its own falls back to its default rather than failing to compile — which
|
|
38
|
+
* is the behaviour a single `Mockup` with a `device` prop has to have anyway.
|
|
39
|
+
*/
|
|
40
|
+
export type PlMockupOs = 'macos' | 'windows' | 'linux' | 'ios' | 'ipados' | 'android';
|
|
41
|
+
/** What the hardware around a desktop screen is. */
|
|
42
|
+
export type PlMockupHardware = 'monitor' | 'laptop';
|
|
43
|
+
/**
|
|
44
|
+
* The camera cut-out at the top of a screen.
|
|
45
|
+
*
|
|
46
|
+
* Hardware, not chrome — it is drawn whether or not `systemUi` is on, because a
|
|
47
|
+
* phone with the status bar hidden still has a hole in its screen.
|
|
48
|
+
*/
|
|
49
|
+
export type PlMockupNotch = 'none' | 'notch' | 'dynamic-island' | 'punch-hole';
|
|
50
|
+
/**
|
|
51
|
+
* How much hardware there is around the screen.
|
|
52
|
+
*
|
|
53
|
+
* `none` is not a thinner bezel — it is no hardware at all: no frame, no stand,
|
|
54
|
+
* no laptop base, just the screen with its corners cut. It is what a mockup that
|
|
55
|
+
* only wants to say "this is a phone-shaped viewport" asks for.
|
|
56
|
+
*
|
|
57
|
+
* `thick` is an older device rather than a wider version of `standard`: the
|
|
58
|
+
* sides stay narrow and the forehead and chin grow, which is where a bezel
|
|
59
|
+
* actually goes when there is a lot of it.
|
|
60
|
+
*/
|
|
61
|
+
export type PlMockupBezel = 'none' | 'thin' | 'standard' | 'thick';
|
|
62
|
+
/** What the hardware is made of. */
|
|
63
|
+
export type PlMockupFinish = 'graphite' | 'silver' | 'white';
|
|
64
|
+
/**
|
|
65
|
+
* Which way a handheld is held.
|
|
66
|
+
*
|
|
67
|
+
* `portrait`/`landscape` rather than `PlassOrientation`'s `vertical`/`horizontal`,
|
|
68
|
+
* and this is the one place the library spells the idea twice on purpose. A
|
|
69
|
+
* `PlDivider` running horizontally is not "landscape", and a device held upright is
|
|
70
|
+
* not "vertical" in any vocabulary a designer or a media query uses. CSS itself
|
|
71
|
+
* keeps both pairs for exactly this reason.
|
|
72
|
+
*/
|
|
73
|
+
export type PlMockupOrientation = 'portrait' | 'landscape';
|
|
74
|
+
/** A screen's logical resolution, in CSS pixels. */
|
|
75
|
+
export interface PlMockupResolution {
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The system a device will actually draw.
|
|
81
|
+
*
|
|
82
|
+
* An OS the device does not run falls back to its default, with one nicety: a
|
|
83
|
+
* caller who writes `ios` on a tablet or `ipados` on a phone meant the Apple one
|
|
84
|
+
* and gets it, rather than being sent back to the start of the list.
|
|
85
|
+
*/
|
|
86
|
+
export declare function resolveOs(device: PlMockupDevice, os?: PlMockupOs): PlMockupOs;
|
|
87
|
+
/** What a device puts in its screen when the caller says nothing. */
|
|
88
|
+
export declare function defaultNotch(device: PlMockupDevice, os: PlMockupOs): PlMockupNotch;
|
|
89
|
+
export declare const resolutions: Record<PlMockupDevice, Record<PlassSize, PlMockupResolution>>;
|
|
90
|
+
/** How much hardware sits on each side of the screen. */
|
|
91
|
+
export interface PlMockupInset {
|
|
92
|
+
x: number;
|
|
93
|
+
top: number;
|
|
94
|
+
bottom: number;
|
|
95
|
+
}
|
|
96
|
+
/** Every number the component needs to lay a device out, in device pixels. */
|
|
97
|
+
export interface PlMockupMetrics {
|
|
98
|
+
/** The screen, after `orientation` has had its say. */
|
|
99
|
+
screen: PlMockupResolution;
|
|
100
|
+
/** The hardware around it. Zero on all four sides when `bezel` is `none`. */
|
|
101
|
+
bezel: PlMockupInset;
|
|
102
|
+
/** Screen plus bezel: the part you would call the device's face. */
|
|
103
|
+
body: {
|
|
104
|
+
width: number;
|
|
105
|
+
height: number;
|
|
106
|
+
};
|
|
107
|
+
/** Face plus whatever holds it up. This is what gets scaled to fit. */
|
|
108
|
+
frame: {
|
|
109
|
+
width: number;
|
|
110
|
+
height: number;
|
|
111
|
+
};
|
|
112
|
+
frameRadius: number;
|
|
113
|
+
screenRadius: number;
|
|
114
|
+
/** A monitor's neck and foot, when there is one. */
|
|
115
|
+
stand: {
|
|
116
|
+
neckWidth: number;
|
|
117
|
+
neckHeight: number;
|
|
118
|
+
footWidth: number;
|
|
119
|
+
footHeight: number;
|
|
120
|
+
} | null;
|
|
121
|
+
/** A laptop's base, when there is one. */
|
|
122
|
+
base: {
|
|
123
|
+
width: number;
|
|
124
|
+
height: number;
|
|
125
|
+
lipWidth: number;
|
|
126
|
+
} | null;
|
|
127
|
+
}
|
|
128
|
+
export declare function mockupMetrics(options: {
|
|
129
|
+
device: PlMockupDevice;
|
|
130
|
+
size: PlassSize;
|
|
131
|
+
resolution?: PlMockupResolution;
|
|
132
|
+
orientation: PlMockupOrientation;
|
|
133
|
+
bezel: PlMockupBezel;
|
|
134
|
+
hardware: PlMockupHardware;
|
|
135
|
+
}): PlMockupMetrics;
|
|
136
|
+
export declare const finishSlots: Record<PlMockupFinish, React.CSSProperties>;
|
|
137
|
+
/**
|
|
138
|
+
* The hardware's surface: the finish, a light top edge and a hairline all the
|
|
139
|
+
* way round, which is the plate the design language puts on everything else. No
|
|
140
|
+
* dark bevel underneath — the shade is a ring, not a shadow.
|
|
141
|
+
*/
|
|
142
|
+
export declare const shellClasses = "bg-(--p-shell) [box-shadow:inset_0_1px_0_var(--p-shell-edge),inset_0_0_0_1px_var(--p-shell-shade)]";
|
|
143
|
+
/** How far off the page the whole device sits, as a silhouette rather than a box.
|
|
144
|
+
*
|
|
145
|
+
* `drop-shadow` rather than `box-shadow` for one reason: the shadow has to
|
|
146
|
+
* follow a rounded lid on a narrow neck on a wide foot, and a box-shadow would
|
|
147
|
+
* draw the rectangle that contains all three. It also sits outside the scale,
|
|
148
|
+
* so a device shrunk to a third of its size does not get a third of its shadow.
|
|
149
|
+
*/
|
|
150
|
+
export declare const elevationFilters: readonly ["none", "drop-shadow(0 1px 2px var(--plass-shadow-ambient))", "drop-shadow(0 2px 4px var(--plass-shadow-ambient)) drop-shadow(0 8px 12px var(--plass-shadow-ambient))", "drop-shadow(0 4px 6px var(--plass-shadow-ambient)) drop-shadow(0 18px 28px var(--plass-shadow-ambient))"];
|
|
151
|
+
/**
|
|
152
|
+
* The camera, drawn on the glass.
|
|
153
|
+
*
|
|
154
|
+
* Portrait puts it against the top edge and landscape against the leading one,
|
|
155
|
+
* which is where it goes on a real device turned the same way — and it is why
|
|
156
|
+
* the island does not collide with the status bar in landscape: it has moved out
|
|
157
|
+
* from under it.
|
|
158
|
+
*/
|
|
159
|
+
export declare function PlMockupCutout({ notch, screen, landscape }: {
|
|
160
|
+
notch: PlMockupNotch;
|
|
161
|
+
screen: PlMockupResolution;
|
|
162
|
+
landscape: boolean;
|
|
163
|
+
}): React.JSX.Element | null;
|
|
164
|
+
/** What a system puts on the screen, and how much room it takes. */
|
|
165
|
+
export interface PlMockupChrome {
|
|
166
|
+
top?: {
|
|
167
|
+
size: number;
|
|
168
|
+
node: React.ReactNode;
|
|
169
|
+
};
|
|
170
|
+
bottom?: {
|
|
171
|
+
size: number;
|
|
172
|
+
node: React.ReactNode;
|
|
173
|
+
};
|
|
174
|
+
/** A dock down the leading edge. Only Linux has one. */
|
|
175
|
+
start?: {
|
|
176
|
+
size: number;
|
|
177
|
+
node: React.ReactNode;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* The bars, per system.
|
|
182
|
+
*
|
|
183
|
+
* Each one takes its own space rather than floating over the content: a caller
|
|
184
|
+
* putting a screenshot in a mockup wants all of the screenshot, and a status bar
|
|
185
|
+
* that covered the top of it would be a crop nobody asked for. The cut-out is
|
|
186
|
+
* the exception, because that one really is a hole in the glass.
|
|
187
|
+
*/
|
|
188
|
+
export declare function mockupChrome(options: {
|
|
189
|
+
os: PlMockupOs;
|
|
190
|
+
notch: PlMockupNotch;
|
|
191
|
+
landscape: boolean;
|
|
192
|
+
time: string;
|
|
193
|
+
}): PlMockupChrome;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";const i={desktop:["macos","windows","linux"],tablet:["ipados","android"],mobile:["ios","android"]};export function resolveOs(e,t){const a=i[e];return t&&a.includes(t)?t:"ios"===t&&"tablet"===e?"ipados":"ipados"===t&&"mobile"===e?"ios":a[0]}export function defaultNotch(e,t){return"mobile"!==e?"none":"android"===t?"punch-hole":"dynamic-island"}export const resolutions={mobile:{xs:{width:320,height:568},sm:{width:360,height:780},md:{width:390,height:844},lg:{width:414,height:896},xl:{width:430,height:932}},tablet:{xs:{width:744,height:1133},sm:{width:768,height:1024},md:{width:820,height:1180},lg:{width:834,height:1194},xl:{width:1024,height:1366}},desktop:{xs:{width:1024,height:640},sm:{width:1280,height:800},md:{width:1440,height:900},lg:{width:1680,height:1050},xl:{width:1920,height:1200}}};const a={mobile:{thin:{bezel:{x:8,top:8,bottom:8},frameRadius:50,screenRadius:42},standard:{bezel:{x:13,top:13,bottom:13},frameRadius:56,screenRadius:43},thick:{bezel:{x:16,top:62,bottom:62},frameRadius:40,screenRadius:4}},tablet:{thin:{bezel:{x:12,top:12,bottom:12},frameRadius:34,screenRadius:22},standard:{bezel:{x:20,top:20,bottom:20},frameRadius:42,screenRadius:22},thick:{bezel:{x:28,top:74,bottom:74},frameRadius:36,screenRadius:4}},desktop:{thin:{bezel:{x:8,top:8,bottom:8},frameRadius:12,screenRadius:4},standard:{bezel:{x:13,top:13,bottom:30},frameRadius:16,screenRadius:4},thick:{bezel:{x:22,top:22,bottom:62},frameRadius:18,screenRadius:3}}},s={mobile:42,tablet:24,desktop:8};export function mockupMetrics(e){const{device:t,size:i,resolution:r,orientation:d,bezel:h,hardware:n}=e,o=r??resolutions[t][i],l="desktop"!==t&&"landscape"===d,c=l?{width:o.height,height:o.width}:o;if("none"===h)return{screen:c,bezel:{x:0,top:0,bottom:0},body:{...c},frame:{...c},frameRadius:s[t],screenRadius:s[t],stand:null,base:null};const u=a[t][h],p=l?{x:u.bezel.top,top:u.bezel.x,bottom:u.bezel.x}:u.bezel,g="desktop"===t&&"laptop"===n,m=g?{...p,bottom:p.top}:p,x={width:c.width+2*m.x,height:c.height+m.top+m.bottom};if("desktop"!==t)return{screen:c,bezel:m,body:x,frame:{...x},frameRadius:u.frameRadius,screenRadius:u.screenRadius,stand:null,base:null};if(g){const e={width:Math.round(1.075*x.width),height:Math.round(.035*x.height),lipWidth:Math.round(.12*x.width)};return{screen:c,bezel:m,body:x,frame:{width:e.width,height:x.height+e.height},frameRadius:u.frameRadius,screenRadius:u.screenRadius,stand:null,base:e}}const f={neckWidth:Math.round(.11*x.width),neckHeight:Math.round(.09*x.height),footWidth:Math.round(.28*x.width),footHeight:Math.round(.018*x.height)};return{screen:c,bezel:m,body:x,frame:{width:x.width,height:x.height+f.neckHeight+f.footHeight},frameRadius:u.frameRadius,screenRadius:u.screenRadius,stand:f,base:null}}export const finishSlots={graphite:{"--p-shell":"#2b2f38","--p-shell-edge":"rgb(255 255 255 / 0.16)","--p-shell-shade":"#181b22"},silver:{"--p-shell":"#cfd2d7","--p-shell-edge":"rgb(255 255 255 / 0.75)","--p-shell-shade":"#9ca1a9"},white:{"--p-shell":"#f3f4f6","--p-shell-edge":"rgb(255 255 255 / 0.9)","--p-shell-shade":"#c1c4ca"}};export const shellClasses="bg-(--p-shell) [box-shadow:inset_0_1px_0_var(--p-shell-edge),inset_0_0_0_1px_var(--p-shell-shade)]";export const elevationFilters=["none","drop-shadow(0 1px 2px var(--plass-shadow-ambient))","drop-shadow(0 2px 4px var(--plass-shadow-ambient)) drop-shadow(0 8px 12px var(--plass-shadow-ambient))","drop-shadow(0 4px 6px var(--plass-shadow-ambient)) drop-shadow(0 18px 28px var(--plass-shadow-ambient))"];export function PlMockupCutout({notch:t,screen:i,landscape:a}){if("none"===t)return null;const s=a?i.height:i.width,r={position:"absolute",background:"oklch(12% 0.006 262)",pointerEvents:"none",zIndex:20},d="plass-mockup-cutout";if("punch-hole"===t){const t=Math.max(16,Math.round(.07*s)),i=Math.round(.55*t);return e("div",{"aria-hidden":"true",className:d,style:{...r,width:t,height:t,borderRadius:"50%",...a?{left:i,top:"50%",marginTop:-t/2}:{top:i,left:"50%",marginLeft:-t/2}}})}if("dynamic-island"===t){const t=Math.max(96,Math.round(.32*s)),i=Math.round(.29*t),h=Math.round(.32*i);return e("div",{"aria-hidden":"true",className:d,style:{...r,borderRadius:i,...a?{left:h,top:"50%",width:i,height:t,marginTop:-t/2}:{top:h,left:"50%",width:t,height:i,marginLeft:-t/2}}})}const h=Math.max(120,Math.round(.42*s)),n=Math.round(.23*h),o=Math.round(.6*n);return e("div",{"aria-hidden":"true",className:d,style:{...r,...a?{left:0,top:"50%",width:n,height:h,marginTop:-h/2,borderRadius:`0 ${o}px ${o}px 0`}:{top:0,left:"50%",width:h,height:n,marginLeft:-h/2,borderRadius:`0 0 ${o}px ${o}px`}}})}const r="relative z-10 flex shrink-0 items-center [background:color-mix(in_oklab,var(--plass-surface)_88%,transparent)]",d="font-medium text-(--plass-fg) tabular-nums";function Tile({width:t,height:i,radius:a,tone:s="muted"}){return e("div",{style:{width:t,height:i??t,borderRadius:a,background:"accent"===s?"var(--p-accent)":"faint"===s?"color-mix(in oklab, var(--plass-fg) 12%, transparent)":"color-mix(in oklab, var(--plass-fg) 26%, transparent)"}})}function Tiles({count:t,size:i,radius:a,gap:s,accent:r=!1}){return e("div",{className:"flex items-center",style:{gap:s},children:Array.from({length:t},(t,s)=>e(Tile,{width:i,radius:a,tone:r&&0===s?"accent":"muted"},s))})}function SignalGlyph({height:i}){return t("svg",{viewBox:"0 0 17 11",height:i,width:17*i/11,fill:"currentColor","aria-hidden":"true",children:[e("rect",{y:"7.5",width:"3",height:"3.5",rx:"1"}),e("rect",{x:"4.7",y:"5",width:"3",height:"6",rx:"1"}),e("rect",{x:"9.4",y:"2.5",width:"3",height:"8.5",rx:"1"}),e("rect",{x:"14",width:"3",height:"11",rx:"1",opacity:"0.35"})]})}function WifiGlyph({height:i}){return t("svg",{viewBox:"0 0 16 12",height:i,width:16*i/12,fill:"none","aria-hidden":"true",children:[e("path",{d:"M1 4.2a10.5 10.5 0 0 1 14 0",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),e("path",{d:"M3.6 7a6.8 6.8 0 0 1 8.8 0",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),e("circle",{cx:"8",cy:"10.2",r:"1.6",fill:"currentColor"})]})}function BatteryGlyph({height:i}){return t("svg",{viewBox:"0 0 25 12",height:i,width:25*i/12,fill:"none","aria-hidden":"true",children:[e("rect",{x:"0.7",y:"0.7",width:"20.6",height:"10.6",rx:"3.2",stroke:"currentColor",strokeWidth:"1.3",opacity:"0.45"}),e("rect",{x:"2.6",y:"2.6",width:"12.8",height:"6.8",rx:"1.8",fill:"currentColor"}),e("rect",{x:"22.8",y:"4",width:"1.8",height:"4",rx:"0.9",fill:"currentColor",opacity:"0.45"})]})}function StatusGlyphs({height:i,gap:a}){return t("div",{className:"flex items-center text-(--plass-fg)",style:{gap:a},children:[e(SignalGlyph,{height:i}),e(WifiGlyph,{height:i}),e(BatteryGlyph,{height:i})]})}function NavGlyphs({size:i,gap:a}){return t("div",{className:"flex items-center justify-center text-(--plass-fg)",style:{gap:a,opacity:.72},children:[e("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none","aria-hidden":"true",children:e("path",{d:"M10 3 5 8l5 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),e("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none","aria-hidden":"true",children:e("circle",{cx:"8",cy:"8",r:"5",stroke:"currentColor",strokeWidth:"1.6"})}),e("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"none","aria-hidden":"true",children:e("rect",{x:"3.5",y:"3.5",width:"9",height:"9",rx:"1.6",stroke:"currentColor",strokeWidth:"1.6"})})]})}function StartGlyph({size:i}){return t("svg",{viewBox:"0 0 16 16",width:i,height:i,fill:"currentColor","aria-hidden":"true",children:[e("rect",{x:"1",y:"1",width:"6",height:"6",rx:"1.4"}),e("rect",{x:"9",y:"1",width:"6",height:"6",rx:"1.4"}),e("rect",{x:"1",y:"9",width:"6",height:"6",rx:"1.4"}),e("rect",{x:"9",y:"9",width:"6",height:"6",rx:"1.4"})]})}export function mockupChrome(i){const{os:a,notch:s,landscape:h,time:n}=i;if("ios"===a||"ipados"===a){const i="ipados"===a,o=i?30:i||h||"none"===s||"punch-hole"===s?44:54;return{top:{size:o,node:t("div",{"aria-hidden":"true",className:`${r} justify-between`,style:{height:o,paddingInline:i?22:26},children:[e("span",{className:`${d} text-[15px]`,children:n}),e(StatusGlyphs,{height:i?11:12,gap:6})]})},bottom:{size:i?22:34,node:e("div",{"aria-hidden":"true",className:`${r} justify-center`,style:{height:i?22:34,background:"transparent"},children:e("div",{style:{width:i?220:140,height:5,borderRadius:3,background:"color-mix(in oklab, var(--plass-fg) 55%, transparent)"}})})}}}return"android"===a?{top:{size:34,node:t("div",{"aria-hidden":"true",className:`${r} justify-between`,style:{height:34,paddingInline:18},children:[e("span",{className:`${d} text-[13px]`,children:n}),e(StatusGlyphs,{height:11,gap:5})]})},bottom:{size:48,node:e("div",{"aria-hidden":"true",className:`${r} justify-center`,style:{height:48},children:e(NavGlyphs,{size:20,gap:72})})}}:"macos"===a?{top:{size:28,node:t("div",{"aria-hidden":"true",className:`${r} justify-between`,style:{height:28,paddingInline:16},children:[t("div",{className:"flex items-center",style:{gap:16},children:[e(Tile,{width:13,radius:4}),e(Tile,{width:34,height:7,radius:4}),e(Tile,{width:26,height:7,radius:4,tone:"faint"}),e(Tile,{width:30,height:7,radius:4,tone:"faint"}),e(Tile,{width:22,height:7,radius:4,tone:"faint"})]}),t("div",{className:"flex items-center",style:{gap:14},children:[e(Tile,{width:11,radius:3,tone:"faint"}),e(Tile,{width:11,radius:3,tone:"faint"}),e("span",{className:`${d} text-[13px]`,children:n})]})]})},bottom:{size:78,node:e("div",{"aria-hidden":"true",className:"flex shrink-0 items-end justify-center",style:{height:78},children:t("div",{className:`${r} [box-shadow:var(--plass-shadow-2),var(--plass-gloss-glass)]`,style:{gap:10,padding:8,marginBottom:10,borderRadius:22},children:[e(Tiles,{count:5,size:52,radius:14,gap:10,accent:!0}),e("div",{style:{width:1,height:44,background:"color-mix(in oklab, var(--plass-fg) 16%, transparent)"}}),e(Tiles,{count:2,size:52,radius:14,gap:10})]})})}}:"windows"===a?{bottom:{size:52,node:t("div",{"aria-hidden":"true",className:`${r} justify-center [border-block-start:1px_solid_var(--plass-border)]`,style:{height:52,paddingInline:16},children:[t("div",{className:"flex items-center",style:{gap:10},children:[e("div",{className:"text-(--plass-fg)",style:{opacity:.7},children:e(StartGlyph,{size:22})}),e(Tiles,{count:6,size:30,radius:8,gap:10,accent:!0})]}),t("div",{className:"absolute flex items-center",style:{insetInlineEnd:16,gap:12},children:[e(Tile,{width:11,radius:3,tone:"faint"}),e(Tile,{width:11,radius:3,tone:"faint"}),e("span",{className:`${d} text-[12px]`,children:n})]})]})}}:{top:{size:34,node:t("div",{"aria-hidden":"true",className:`${r} justify-center`,style:{height:34,paddingInline:14},children:[e("div",{className:"absolute",style:{insetInlineStart:14},children:e(Tile,{width:52,height:9,radius:5})}),e("span",{className:`${d} text-[13px]`,children:n}),t("div",{className:"absolute flex items-center",style:{insetInlineEnd:14,gap:10},children:[e(Tile,{width:10,radius:3,tone:"faint"}),e(Tile,{width:10,radius:3,tone:"faint"}),e(Tile,{width:10,radius:3,tone:"faint"})]})]})},start:{size:66,node:t("div",{"aria-hidden":"true",className:`${r} flex-col justify-start [border-inline-end:1px_solid_var(--plass-border)]`,style:{width:66,height:"100%",gap:10,paddingBlock:12},children:[e(Tile,{width:44,radius:12,tone:"accent"}),e(Tile,{width:44,radius:12}),e(Tile,{width:44,radius:12}),e(Tile,{width:44,radius:12})]})}}}
|
|
@@ -114,12 +114,12 @@ export declare const expandedOnlyClasses: Record<PlPageLayoutCollapse, string>;
|
|
|
114
114
|
* Whether the window is currently narrower than the breakpoint a sidebar
|
|
115
115
|
* collapses at.
|
|
116
116
|
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
117
|
+
* The store behind it is `internal/media.ts`, and the one reason that matters
|
|
118
|
+
* here is its server snapshot: the server's answer has to be "not collapsed". A
|
|
119
|
+
* collapsed sidebar is a `PlDrawer`, a drawer is a portal, and a portal
|
|
120
|
+
* rendered into `document.body` on the server is not a thing — so the markup
|
|
121
|
+
* that ships is the column, and the classes above are what keep that column off
|
|
122
|
+
* a narrow screen until this hook can say otherwise.
|
|
123
123
|
*/
|
|
124
124
|
export declare function useCollapsed(breakpoint: PlPageLayoutCollapse): boolean;
|
|
125
125
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";export const PlPageLayoutContext=/* @__PURE__ */e.createContext({present:!1,register:()=>{},collapseBelow:"none",open:{start:!1,end:!1},setOpen:()=>{},scroll:"page"});export const PlassSidebarSideContext=/* @__PURE__ */e.createContext(null);
|
|
1
|
+
"use client";import*as e from"react";import{belowQuery as n}from"./breakpoints.js";import{useMediaQuery as t}from"./media.js";export const PlPageLayoutContext=/* @__PURE__ */e.createContext({present:!1,register:()=>{},collapseBelow:"none",open:{start:!1,end:!1},setOpen:()=>{},scroll:"page"});export const PlassSidebarSideContext=/* @__PURE__ */e.createContext(null);export const collapsedOnlyClasses={none:"hidden",xs:"hidden",sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"};export const expandedOnlyClasses={none:"",xs:"",sm:"max-sm:hidden",md:"max-md:hidden",lg:"max-lg:hidden",xl:"max-xl:hidden"};export function useCollapsed(e){return t("none"===e?null:function collapseQuery(e){return"xs"===e?null:n(e)}(e))}export function drawerSide(e){const n="undefined"!=typeof document&&"rtl"===getComputedStyle(document.documentElement).direction;return"start"===e?n?"right":"left":n?"left":"right"}
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
*
|
|
9
9
|
* What is left in each component is the shape, which is the point: it is the
|
|
10
10
|
* only thing that genuinely differs.
|
|
11
|
+
*
|
|
12
|
+
* `PlMeter` borrows the groove, the thickness ladder, the fill slots and the
|
|
13
|
+
* clamp from here without being one of the three. It is the same channel cut
|
|
14
|
+
* into the same surface; what it reports is a quantity that is already known
|
|
15
|
+
* rather than something advancing, which is why it keeps its own props and its
|
|
16
|
+
* own role.
|
|
11
17
|
*/
|
|
12
18
|
import type * as React from 'react';
|
|
13
19
|
import type { PlassColor, PlassSize } from '../types.js';
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one shape a value takes when it changes with the width of the window, and
|
|
3
|
+
* the one way it reaches CSS.
|
|
4
|
+
*
|
|
5
|
+
* It started as `PlGrid`'s private arithmetic and is here because a second
|
|
6
|
+
* component wanted it — and because the *rule* is the interesting part, not the
|
|
7
|
+
* code: a bare value applies everywhere, a map applies each entry from its own
|
|
8
|
+
* breakpoint up, and a rung that was not named inherits the one below it.
|
|
9
|
+
* `usePlBreakpointValue` resolves the same shape in JavaScript, so a caller who
|
|
10
|
+
* has learned it once has learned all of it.
|
|
11
|
+
*
|
|
12
|
+
* ## Where the resolving happens, and why it is two places
|
|
13
|
+
*
|
|
14
|
+
* A responsive value that only decides **style** is resolved in **CSS**:
|
|
15
|
+
* `responsiveSlots` writes one `--p-{name}-{rung}` per rung the caller named,
|
|
16
|
+
* and the `@variant` blocks in `styles.css` cascade each slot down from the
|
|
17
|
+
* rung above. That is what `PlGrid` and `PlContainer` use, and what makes them
|
|
18
|
+
* free: no resize listener, no re-render, and a server render that is already
|
|
19
|
+
* correct at every width because the browser resolves it.
|
|
20
|
+
*
|
|
21
|
+
* A responsive value that decides **structure** cannot be: an orientation
|
|
22
|
+
* changes which DOM a component builds, which ARIA it claims, and which way its
|
|
23
|
+
* arrow keys go, and no stylesheet can do that. Those resolve in JavaScript
|
|
24
|
+
* through `usePlBreakpointValue`, and pay what that costs — the server renders
|
|
25
|
+
* the `xs` entry and the browser corrects it on hydration.
|
|
26
|
+
*
|
|
27
|
+
* The split is not a compromise between the two; it is the honest line. A
|
|
28
|
+
* component should reach for the CSS half whenever it can.
|
|
29
|
+
*/
|
|
30
|
+
import type * as React from 'react';
|
|
31
|
+
import type { PlassBreakpoint, PlassResponsive, PlassSize } from '../types.js';
|
|
32
|
+
/** Smallest first, which is also the order the media queries have to be in. */
|
|
33
|
+
export declare const breakpoints: readonly PlassBreakpoint[];
|
|
34
|
+
/** A bare value means "from `xs` up"; a map is already per-breakpoint. */
|
|
35
|
+
export declare function breakpointMap<T>(value: PlassResponsive<T> | undefined): Partial<Record<PlassBreakpoint, T>>;
|
|
36
|
+
/** Whether a value is a per-breakpoint map rather than one answer for all of them. */
|
|
37
|
+
export declare function isResponsiveMap<T>(value: PlassResponsive<T> | undefined): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* A responsive value at one rung of the ladder.
|
|
40
|
+
*
|
|
41
|
+
* Walks **down** from that rung rather than up from `xs`: the nearest entry at
|
|
42
|
+
* or below the window is the one that applies, and walking down finds it
|
|
43
|
+
* without having to know which rungs were named.
|
|
44
|
+
*
|
|
45
|
+
* `undefined` when the map named no rung at or below — `{ lg: 3 }` on a phone
|
|
46
|
+
* is not `3`, and guessing a value the caller did not write would be worse than
|
|
47
|
+
* saying so.
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveAt<T>(value: PlassResponsive<T> | undefined, at: PlassBreakpoint): T | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* A responsive prop a component has to resolve **itself**, with its own default
|
|
52
|
+
* behind it.
|
|
53
|
+
*
|
|
54
|
+
* For the props CSS cannot decide: an orientation changes which DOM a component
|
|
55
|
+
* builds, which ARIA it claims and which way its arrow keys go, and no
|
|
56
|
+
* stylesheet can do any of that. The cost is the one every JavaScript answer
|
|
57
|
+
* about width pays — a server renders the `xs` entry and the browser corrects
|
|
58
|
+
* it on hydration — which is why a prop that only decides *style* should use
|
|
59
|
+
* `responsiveSlots` instead and never come here.
|
|
60
|
+
*
|
|
61
|
+
* **A bare value subscribes to nothing.** `useMediaQuery(null)` is a hook that
|
|
62
|
+
* adds no listener, so a component whose orientation is one word costs exactly
|
|
63
|
+
* what it cost before this existed: the four queries are only asked when there
|
|
64
|
+
* is a map to answer with. Twenty tab bars on a page that never change shape
|
|
65
|
+
* install no listeners between them.
|
|
66
|
+
*/
|
|
67
|
+
export declare function useResponsiveValue<T>(value: PlassResponsive<T> | undefined, fallback: T): T;
|
|
68
|
+
/**
|
|
69
|
+
* Turns a responsive value into the `--p-{name}-{breakpoint}` slots the CSS
|
|
70
|
+
* reads, emitting only the breakpoints the caller actually named.
|
|
71
|
+
*
|
|
72
|
+
* The gaps are filled in by CSS rather than here: each breakpoint's rule falls
|
|
73
|
+
* back through the ones below it, so `{ md: 6 }` needs one slot and not five.
|
|
74
|
+
* That keeps the inline style on a grid item down to what was asked for.
|
|
75
|
+
*/
|
|
76
|
+
export declare function responsiveSlots<T>(name: string, value: PlassResponsive<T> | undefined, toCss: (value: T) => string): React.CSSProperties;
|
|
77
|
+
/**
|
|
78
|
+
* Fills in the `xs` entry of a partial map with the prop's own default.
|
|
79
|
+
*
|
|
80
|
+
* Without this, `spacing={{ md: 4 }}` would be a grid with no gutter at all
|
|
81
|
+
* below 48rem — the CSS fallback rather than the documented default — and a
|
|
82
|
+
* caller who narrowed one breakpoint would silently lose every other one. A map
|
|
83
|
+
* says "from here up, use this instead"; it does not say "and nothing below".
|
|
84
|
+
*/
|
|
85
|
+
export declare function withBaseline<T>(value: PlassResponsive<T> | undefined, baseline: T): PlassResponsive<T>;
|
|
86
|
+
/**
|
|
87
|
+
* How wide content is allowed to get, and the three components that ask.
|
|
88
|
+
*
|
|
89
|
+
* A rung of the ladder, `none`, a number of pixels, or any CSS length. The
|
|
90
|
+
* `string & {}` half is what keeps the five rungs autocompleting: a bare
|
|
91
|
+
* `string` in the union would swallow them and the ladder would be five names a
|
|
92
|
+
* caller has to remember rather than five an editor offers.
|
|
93
|
+
*/
|
|
94
|
+
export type PlassMeasure = PlassSize | 'none' | number | (string & {});
|
|
95
|
+
/** A rung if it is one of the five, `none` as itself, anything else a length. */
|
|
96
|
+
export declare function measureValue(value: PlassMeasure): string;
|
|
97
|
+
/**
|
|
98
|
+
* The class and the slots a measure is carried by, or nothing at all.
|
|
99
|
+
*
|
|
100
|
+
* `PlContainer`, `PlHeader` and `PlFooter` each hold their content to a measure
|
|
101
|
+
* and each used to carry a copy of the ladder. One implementation, because they
|
|
102
|
+
* are one decision written three times — a header whose measure did not line up
|
|
103
|
+
* with the container under it is the defect this prevents.
|
|
104
|
+
*/
|
|
105
|
+
export declare function measureSlots(value: PlassResponsive<PlassMeasure> | undefined): {
|
|
106
|
+
className: string;
|
|
107
|
+
style: React.CSSProperties | undefined;
|
|
108
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fromQuery as e}from"./breakpoints.js";import{useMediaQuery as o}from"./media.js";import{toLength as t}from"./styles.js";export const breakpoints=["xs","sm","md","lg","xl"];export function breakpointMap(e){return null==e?{}:"object"==typeof e?e:{xs:e}}export function isResponsiveMap(e){return null!=e&&"object"==typeof e}export function resolveAt(e,o){const t=breakpointMap(e);for(let e=breakpoints.indexOf(o);e>=0;e-=1){const o=t[breakpoints[e]];if(void 0!==o)return o}}export function useResponsiveValue(t,n){const s=isResponsiveMap(t),r=o(s?e("sm"):null),i=o(s?e("md"):null),l=o(s?e("lg"):null),p=o(s?e("xl"):null);return s?resolveAt(t,p?"xl":l?"lg":i?"md":r?"sm":"xs")??n:t??n}export function responsiveSlots(e,o,t){const n=breakpointMap(o),s={};for(const o of breakpoints){const r=n[o];void 0!==r&&(s[`--p-${e}-${o}`]=t(r))}return s}export function withBaseline(e,o){return null==e?o:"object"==typeof e?{xs:o,...e}:e}const n={xs:"30rem",sm:"40rem",md:"48rem",lg:"64rem",xl:"80rem"};export function measureValue(e){return"none"===e?"none":"string"==typeof e&&e in n?n[e]:t(e)}export function measureSlots(e){return void 0===e?{className:"",style:void 0}:{className:"plass-container",style:responsiveSlots("maxw",e,measureValue)}}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arithmetic behind `PlAnimateScramble`, and the one decision in it worth
|
|
3
|
+
* writing down.
|
|
4
|
+
*
|
|
5
|
+
* **The pool a character is drawn from is the text's own characters**, not a
|
|
6
|
+
* table of Latin letters. Every scrambler that ships with a default alphabet
|
|
7
|
+
* ships an English one, and English noise over a Korean, Greek or Arabic
|
|
8
|
+
* headline is not a word resolving — it is a different script flickering where
|
|
9
|
+
* a word is about to be. Shuffling the string's own glyphs is script-agnostic
|
|
10
|
+
* for nothing, and it also keeps the line's colour and width steady, because
|
|
11
|
+
* every frame is drawn out of exactly the characters the finished line is made
|
|
12
|
+
* of.
|
|
13
|
+
*
|
|
14
|
+
* `characters` overrides it for the caller who genuinely wants a terminal look.
|
|
15
|
+
*/
|
|
16
|
+
/** Everything in the text that is worth scrambling: no spaces, no repeats. */
|
|
17
|
+
export declare function poolOf(text: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* The line as it looks part of the way through.
|
|
20
|
+
*
|
|
21
|
+
* `progress` is `0`…`1`, and what it decides is **how many characters have
|
|
22
|
+
* settled**, counted from the start. Resolving left to right rather than at
|
|
23
|
+
* random is what makes it read as a word arriving rather than as a slot
|
|
24
|
+
* machine: a reader can follow it, and a reader who looks away and back has not
|
|
25
|
+
* lost their place.
|
|
26
|
+
*
|
|
27
|
+
* Whitespace is never scrambled. The gaps between words are what makes a line
|
|
28
|
+
* of noise still look like a sentence, and a space that flickers into a letter
|
|
29
|
+
* changes the word count on every frame.
|
|
30
|
+
*/
|
|
31
|
+
export declare function scrambleAt(text: string, pool: string, progress: number, seed: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function poolOf(t){const o=new Set;for(const r of t)""!==r.trim()&&o.add(r);return Array.from(o).join("")}export function scrambleAt(t,o,r,n){const e=Array.from(t),a=Math.floor(e.length*Math.max(0,Math.min(1,r)));return 0===o.length?t:e.map((t,r)=>r<a||""===t.trim()?t:o[(31*r+17*n)%o.length]).join("")}
|