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
package/dist/internal/icons.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as e}from"react/jsx-runtime";export function Spinner(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"animate-spin",children:[r("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"2"}),r("path",{d:"M14.5 8A6.5 6.5 0 0 0 8 1.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}export function ChevronIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 6.5 3.5 3.5 3.5-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function ArrowRightIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3 8h10m-3.5-3.5L13 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function EllipsisIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"3.5",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"12.5",cy:"8",r:"1.15",fill:"currentColor"})]})}export function CheckIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m3.5 8.5 3 3 6-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export function MinusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function PlusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function CloseIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 4.5 7 7m0-7-7 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function ClockIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 4.5V8l2.4 1.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CalendarIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"2.25",y:"3.25",width:"11.5",height:"10.5",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M2.25 6.5h11.5",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M5.5 1.75v2.5M10.5 1.75v2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function LinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M6.5 9.5a2.75 2.75 0 0 0 4 .25l1.75-1.75a2.75 2.75 0 0 0-3.9-3.9L7.75 5.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 6.5a2.75 2.75 0 0 0-4-.25L3.75 8a2.75 2.75 0 0 0 3.9 3.9l.6-.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ExternalLinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M12.75 9.25v2.5a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5h2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 2.75h3.75V6.5M7.25 8.75l5.75-5.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function NoteIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 7.25v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"4.9",r:"0.85",fill:"currentColor"})]})}export function DotIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r("circle",{cx:"8",cy:"8",r:"3.25"})})}export function StarIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r("path",{d:"m8 1.6 1.86 3.9 4.14.56-3.02 2.9.76 4.24L8 11.16 4.26 13.2l.76-4.24L2 6.06l4.14-.56z"})})}export function StarOutlineIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m8 1.6 1.86 3.9 4.14.56-3.02 2.9.76 4.24L8 11.16 4.26 13.2l.76-4.24L2 6.06l4.14-.56z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}export function severityIcon(o){return"success"===o?e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.25 8.25 1.9 1.9 3.6-3.9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):"warning"===o?e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M7.13 2.6 1.9 11.7a1 1 0 0 0 .87 1.5h10.46a1 1 0 0 0 .87-1.5L8.87 2.6a1 1 0 0 0-1.74 0Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),r("path",{d:"M8 6.1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"11.2",r:"0.85",fill:"currentColor"})]}):"danger"===o?e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.9 5.9 4.2 4.2m0-4.2-4.2 4.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}):r(NoteIcon,{})}
|
|
1
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";export function Spinner(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"animate-spin",children:[r("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"2"}),r("path",{d:"M14.5 8A6.5 6.5 0 0 0 8 1.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}export function ChevronIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 6.5 3.5 3.5 3.5-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function ArrowRightIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3 8h10m-3.5-3.5L13 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function EllipsisIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"3.5",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"12.5",cy:"8",r:"1.15",fill:"currentColor"})]})}export function CheckIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m3.5 8.5 3 3 6-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export function CopyIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"5.75",y:"5.75",width:"7.5",height:"7.5",rx:"1.75",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M10.25 3.6a1.85 1.85 0 0 0-1.5-.85h-4a2 2 0 0 0-2 2v4c0 .62.28 1.17.72 1.54",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function CodeIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M5.75 4.5 2.5 8l3.25 3.5m4.5-7L13.5 8l-3.25 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function MinusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function PlusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function CloseIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 4.5 7 7m0-7-7 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function ClockIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 4.5V8l2.4 1.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CalendarIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"2.25",y:"3.25",width:"11.5",height:"10.5",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M2.25 6.5h11.5",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M5.5 1.75v2.5M10.5 1.75v2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function LinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M6.5 9.5a2.75 2.75 0 0 0 4 .25l1.75-1.75a2.75 2.75 0 0 0-3.9-3.9L7.75 5.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 6.5a2.75 2.75 0 0 0-4-.25L3.75 8a2.75 2.75 0 0 0 3.9 3.9l.6-.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ExternalLinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M12.75 9.25v2.5a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5h2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 2.75h3.75V6.5M7.25 8.75l5.75-5.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function NoteIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 7.25v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"4.9",r:"0.85",fill:"currentColor"})]})}export function DotIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r("circle",{cx:"8",cy:"8",r:"3.25"})})}export function StarIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r("path",{d:"m8 1.6 1.86 3.9 4.14.56-3.02 2.9.76 4.24L8 11.16 4.26 13.2l.76-4.24L2 6.06l4.14-.56z"})})}export function StarOutlineIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m8 1.6 1.86 3.9 4.14.56-3.02 2.9.76 4.24L8 11.16 4.26 13.2l.76-4.24L2 6.06l4.14-.56z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}export function severityIcon(o){return"success"===o?e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.25 8.25 1.9 1.9 3.6-3.9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}):"warning"===o?e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M7.13 2.6 1.9 11.7a1 1 0 0 0 .87 1.5h10.46a1 1 0 0 0 .87-1.5L8.87 2.6a1 1 0 0 0-1.74 0Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),r("path",{d:"M8 6.1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"11.2",r:"0.85",fill:"currentColor"})]}):"danger"===o?e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.9 5.9 4.2 4.2m0-4.2-4.2 4.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}):r(NoteIcon,{})}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arithmetic a `PlImage` turns, mirrors and places its picture with, and the
|
|
3
|
+
* declarations that draw the turn and the mirror.
|
|
4
|
+
*
|
|
5
|
+
* The arithmetic is here rather than in the component for the reason
|
|
6
|
+
* `internal/gallery.ts` is: **the Dart build needs the same answers.** A turn
|
|
7
|
+
* that rounded a stray `45` to a different quarter on the two sides would be one
|
|
8
|
+
* picture lying two different ways, and a crop that kept a different part of it
|
|
9
|
+
* would be two pictures. The declarations are here because the preview draws
|
|
10
|
+
* the same turn and mirror from a chunk of its own.
|
|
11
|
+
*/
|
|
12
|
+
import type * as React from 'react';
|
|
13
|
+
/** A turn, as a count of clockwise quarters. */
|
|
14
|
+
export type PlassQuarters = 0 | 1 | 2 | 3;
|
|
15
|
+
/**
|
|
16
|
+
* Which way a picture is mirrored, along the axes it is shown on.
|
|
17
|
+
*
|
|
18
|
+
* Declared here rather than beside the component because the declarations
|
|
19
|
+
* below are written from it; `PlImageFlip` is this under the component's name.
|
|
20
|
+
*/
|
|
21
|
+
export type PlassImageFlip = 'none' | 'horizontal' | 'vertical' | 'both';
|
|
22
|
+
/**
|
|
23
|
+
* A turn in degrees as a count of clockwise quarters, whatever number arrived.
|
|
24
|
+
*
|
|
25
|
+
* The type holds a TypeScript caller to `0`, `90`, `180` and `270`; this is for
|
|
26
|
+
* everyone else. `-90` is the `270` it means, `450` is `90`, anything between
|
|
27
|
+
* two quarters goes to the nearer one, and a number that is not finite is no
|
|
28
|
+
* turn at all.
|
|
29
|
+
*/
|
|
30
|
+
export declare function quartersOf(degrees: number): PlassQuarters;
|
|
31
|
+
/** Whether a turn puts the picture on its side, swapping its width and height. */
|
|
32
|
+
export declare function isSideways(quarters: PlassQuarters): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The turn and the mirror, as the declarations that draw them.
|
|
35
|
+
*
|
|
36
|
+
* The individual `rotate` and `scale` properties rather than `transform`, which
|
|
37
|
+
* leaves `transform` to whoever else wants the picture: an inline `transform`
|
|
38
|
+
* here would silently beat a hover effect or a class of the caller's own.
|
|
39
|
+
*
|
|
40
|
+
* The two compose in a fixed order, and scale comes first: it acts on the
|
|
41
|
+
* element before the element is turned. So on a quarter turn, a mirror along one
|
|
42
|
+
* axis of the screen is a mirror along the other axis of the element, and the
|
|
43
|
+
* two are swapped here rather than making a caller think about it.
|
|
44
|
+
*
|
|
45
|
+
* On its side the picture is laid out at the box's height by the box's width
|
|
46
|
+
* and turned into place, and that is what lets `fit` work at all. `object-fit`
|
|
47
|
+
* fits the element's own box, and a picture turned inside the box it was given
|
|
48
|
+
* would overhang it on one axis and fall short on the other. The container
|
|
49
|
+
* units read the box, which is a size container only while this is the case;
|
|
50
|
+
* `maxWidth` is cleared because a reset caps an `<img>` at the width of its
|
|
51
|
+
* parent, and on a tall box that is shorter than the length the turned picture
|
|
52
|
+
* needs.
|
|
53
|
+
*/
|
|
54
|
+
export declare function poseStyle(quarters: PlassQuarters, flip: PlassImageFlip): React.CSSProperties | null;
|
|
55
|
+
/**
|
|
56
|
+
* The geometry of a copy of the picture drawn underneath it: the same turn and
|
|
57
|
+
* mirror, over the same box grown by `bleed` on every side.
|
|
58
|
+
*
|
|
59
|
+
* A blur fades to transparent over about two of its radii at the element's
|
|
60
|
+
* edge, so a blurred copy drawn at the box's own size would show the page
|
|
61
|
+
* through a soft frame. Grown past the box, it has the fringe clipped off by the
|
|
62
|
+
* box's `overflow: hidden` instead.
|
|
63
|
+
*/
|
|
64
|
+
export declare function layerStyle(quarters: PlassQuarters, flip: PlassImageFlip, bleed: number): React.CSSProperties;
|
|
65
|
+
/**
|
|
66
|
+
* A position as the fractions of the free space across and down, or `null` for
|
|
67
|
+
* anything past the keywords and percentages `PlImagePosition` offers.
|
|
68
|
+
*
|
|
69
|
+
* The part of CSS's grammar a caller writes. A keyword says its own axis, a
|
|
70
|
+
* percentage is across when it comes first and down when it comes second, and
|
|
71
|
+
* `center` says nothing, which leaves the axis at the middle. A length has no
|
|
72
|
+
* fraction to turn, so it is `null`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function positionFractions(position: string): [number, number] | null;
|
|
75
|
+
/**
|
|
76
|
+
* A place on the picture as it is shown, as the same place on the element that
|
|
77
|
+
* is actually turned and mirrored.
|
|
78
|
+
*
|
|
79
|
+
* `object-position` works in the element's own frame, before it is transformed,
|
|
80
|
+
* so `top` on a picture turned upside down would keep what ends up at the
|
|
81
|
+
* bottom. The mirror is undone first, because it acts on the axes of the screen
|
|
82
|
+
* after the turn. Then the turn, a quarter at a time: one quarter clockwise lays
|
|
83
|
+
* the element's left edge along the top of the screen, so what is across on the
|
|
84
|
+
* screen was down the element.
|
|
85
|
+
*/
|
|
86
|
+
export declare function elementFractions([shownAcross, shownDown]: readonly [number, number], quarters: PlassQuarters, mirrorAcross: boolean, mirrorDown: boolean): [number, number];
|
|
87
|
+
/**
|
|
88
|
+
* The `object-position` that keeps `position` where the reader sees it.
|
|
89
|
+
*
|
|
90
|
+
* Always written as two percentages rounded to two decimals, which every engine
|
|
91
|
+
* serialises the same way. A string the parser cannot read is handed through as
|
|
92
|
+
* it was written.
|
|
93
|
+
*/
|
|
94
|
+
export declare function objectPosition(position: string, quarters: PlassQuarters, flip: PlassImageFlip): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function quartersOf(t){return Number.isFinite(t)?(Math.round(t/90)%4+4)%4:0}export function isSideways(t){return t%2==1}export function poseStyle(t,e){const o="horizontal"===e||"both"===e,n="vertical"===e||"both"===e;if(0===t&&!o&&!n)return null;const[i,r]=isSideways(t)?[n,o]:[o,n];return{scale:i||r?`${i?-1:1} ${r?-1:1}`:void 0,rotate:0===t?void 0:90*t+"deg",...isSideways(t)?{position:"absolute",top:"50%",left:"50%",width:"100cqh",height:"100cqw",maxWidth:"none",translate:"-50% -50%"}:null}}export function layerStyle(t,e,o){const grown=t=>0===o?t:`calc(${t} + ${2*o}px)`;return isSideways(t)?{...poseStyle(t,e),width:grown("100cqh"),height:grown("100cqw")}:{...poseStyle(t,e),position:"absolute",top:-o+"px",left:-o+"px",width:grown("100%"),height:grown("100%"),maxWidth:"none"}}export function positionFractions(t){const e=[.5,.5],o=t.trim().toLowerCase().split(/\s+/);for(let t=0;t<o.length;t+=1){const n=["left","top","right","bottom"].indexOf(o[t]);if(n>=0)e[n%2]=n>1?1:0;else if(/^-?\d*\.?\d+%$/.test(o[t]))e[0===t?0:1]=parseFloat(o[t])/100;else if("center"!==o[t])return null}return e}export function elementFractions([t,e],o,n,i){let r=n?1-t:t,s=i?1-e:e;for(let t=0;t<o;t+=1)[r,s]=[s,1-r];return[r,s]}export function objectPosition(t,e,o){const n=positionFractions(t);if(null===n)return t;const[i,r]=elementFractions(n,e,"horizontal"===o||"both"===o,"vertical"===o||"both"===o),percent=t=>Math.round(1e4*t)/100+"%";return`${percent(i)} ${percent(r)}`}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The value `inert` has to be written with for a given React to put it in the
|
|
3
|
+
* DOM.
|
|
4
|
+
*
|
|
5
|
+
* React 19 knows `inert` as a boolean attribute, writes `true` and drops an
|
|
6
|
+
* empty string. React 18 does not know it at all: it drops `true` with a warning
|
|
7
|
+
* and writes a string as it is. A dropped attribute leaves the subtree
|
|
8
|
+
* focusable and on the accessibility tree, which is exactly what the attribute
|
|
9
|
+
* was there to stop, and nothing on the page looks any different.
|
|
10
|
+
*/
|
|
11
|
+
export declare function inertValueFor(version: string): true | '';
|
|
12
|
+
/**
|
|
13
|
+
* `inert` as props to spread onto an element, written the way the running React
|
|
14
|
+
* keeps it. Nothing at all when the element is not inert, so the attribute is
|
|
15
|
+
* absent rather than present and false.
|
|
16
|
+
*/
|
|
17
|
+
export declare function inertProps(inert: boolean): {
|
|
18
|
+
inert?: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as r from"react";export function inertValueFor(r){return Number.parseInt(r,10)>=19||""}const e=inertValueFor(r.version);export function inertProps(r){return r?{inert:e}:{}}
|
package/dist/internal/keys.d.ts
CHANGED
|
@@ -43,11 +43,30 @@ export declare function canonicalKey(token: string): string;
|
|
|
43
43
|
*/
|
|
44
44
|
export interface PlassKeyState {
|
|
45
45
|
key: string;
|
|
46
|
+
/** The physical key, for when `key` is what a modifier turned it into. */
|
|
47
|
+
code?: string;
|
|
46
48
|
metaKey: boolean;
|
|
47
49
|
ctrlKey: boolean;
|
|
48
50
|
shiftKey: boolean;
|
|
49
51
|
altKey: boolean;
|
|
50
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Whether the key belongs to text an input method is still composing.
|
|
55
|
+
*
|
|
56
|
+
* The Enter that commits a Korean syllable and the Escape that cancels a
|
|
57
|
+
* Japanese conversion are the input method's keys, not the page's: answering
|
|
58
|
+
* one fires a binding the reader did not press, and consuming it breaks the
|
|
59
|
+
* word they were typing. `229` is what a browser reports for such a key where
|
|
60
|
+
* `isComposing` is not set.
|
|
61
|
+
*/
|
|
62
|
+
export declare function isComposingKey(event: {
|
|
63
|
+
keyCode?: number;
|
|
64
|
+
isComposing?: boolean;
|
|
65
|
+
} & {
|
|
66
|
+
nativeEvent?: {
|
|
67
|
+
isComposing?: boolean;
|
|
68
|
+
};
|
|
69
|
+
}): boolean;
|
|
51
70
|
/**
|
|
52
71
|
* Does the chord carry a modifier a reader cannot type?
|
|
53
72
|
*
|
package/dist/internal/keys.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function detectOS(){if("undefined"==typeof navigator)return"windows";const e=navigator.userAgentData,t=`${e?.platform??""} ${navigator.platform??""} ${navigator.userAgent??""}`;return/mac|iphone|ipad|ipod/i.test(t)?"mac":/win/i.test(t)?"windows":"linux"}export const keyAliases={cmdorctrl:"mod",commandorcontrol:"mod",cmd:"meta",command:"meta",super:"meta",win:"meta",windows:"meta",control:"ctrl",option:"alt",opt:"alt",return:"enter",numpadenter:"enter",esc:"escape",del:"delete",caps:"capslock"};export function canonicalKey(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return keyAliases[t]??t}const e={up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",space:" ",plus:"+"};export function hasHardModifier(e){return e.split("+").slice(0,-1).map(canonicalKey).some(e=>"mod"===e||"ctrl"===e||"meta"===e||"alt"===e)}const t=new Set(["enter","backspace","delete","arrowleft","arrowright","arrowup","arrowdown","home","end","pageup","pagedown"]);export function editsText(e){return 1===e.length||t.has(e.toLowerCase())}export function isTypingTarget(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;if("TEXTAREA"===e.tagName||"SELECT"===e.tagName)return!0;if("INPUT"===e.tagName){const t=e.type;return!["button","checkbox","color","file","image","radio","range","reset","submit"].includes(t)}return!1}export function matchesHotKey(t,
|
|
1
|
+
export function detectOS(){if("undefined"==typeof navigator)return"windows";const e=navigator.userAgentData,t=`${e?.platform??""} ${navigator.platform??""} ${navigator.userAgent??""}`;return/mac|iphone|ipad|ipod/i.test(t)?"mac":/win/i.test(t)?"windows":"linux"}export const keyAliases={cmdorctrl:"mod",commandorcontrol:"mod",cmd:"meta",command:"meta",super:"meta",win:"meta",windows:"meta",control:"ctrl",option:"alt",opt:"alt",return:"enter",numpadenter:"enter",esc:"escape",del:"delete",caps:"capslock"};export function canonicalKey(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return keyAliases[t]??t}const e={up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",space:" ",plus:"+"};export function isComposingKey(e){return Boolean(e.nativeEvent?.isComposing??e.isComposing)||229===e.keyCode}export function hasHardModifier(e){return e.split("+").slice(0,-1).map(canonicalKey).some(e=>"mod"===e||"ctrl"===e||"meta"===e||"alt"===e)}const t=new Set(["enter","backspace","delete","arrowleft","arrowright","arrowup","arrowdown","home","end","pageup","pagedown"]);export function editsText(e){return 1===e.length||t.has(e.toLowerCase())}export function isTypingTarget(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;if("TEXTAREA"===e.tagName||"SELECT"===e.tagName)return!0;if("INPUT"===e.tagName){const t=e.type;return!["button","checkbox","color","file","image","radio","range","reset","submit"].includes(t)}return!1}export function matchesHotKey(t,o){const n=o.split("+").map(canonicalKey),r=new Set(n.slice(0,-1)),a=n[n.length-1],i=e[a]??a,s="mac"===detectOS()?t.metaKey:t.ctrlKey,c=!(1===i.length&&!/[a-z0-9]/.test(i)&&!r.has("shift"))&&t.shiftKey;if(r.has("mod")!==s)return!1;if(r.has("shift")!==c||r.has("alt")!==t.altKey)return!1;if(!r.has("mod")&&(r.has("ctrl")!==t.ctrlKey||r.has("meta")!==t.metaKey))return!1;const p=t.key.toLowerCase();return p===i||!(!/^[a-z0-9]$/.test(i)||/^[a-z0-9]$/.test(p)||!t.code)&&t.code===(/[a-z]/.test(i)?`Key${i.toUpperCase()}`:`Digit${i}`)}export function hotKeyHandler(e,t){if(e||t)return o=>{if(t?.(o),e&&!o.defaultPrevented&&!isComposingKey(o))for(const t of Object.keys(e))if(matchesHotKey(o,t))return o.preventDefault(),o.stopPropagation(),void e[t]()}}
|
|
@@ -0,0 +1,182 @@
|
|
|
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
|
+
/** The one button on a message that only needs to have been read. */
|
|
9
|
+
acknowledge: string;
|
|
10
|
+
/** Empties a field, a picker, a search. */
|
|
11
|
+
clear: string;
|
|
12
|
+
/** Finishes with a picker, or with a tour. */
|
|
13
|
+
done: string;
|
|
14
|
+
/** Leaves a sequence before the end of it. */
|
|
15
|
+
skip: string;
|
|
16
|
+
/** Names a search field the caller did not name. */
|
|
17
|
+
search: string;
|
|
18
|
+
/** Ticks everything in a list at once. */
|
|
19
|
+
selectAll: string;
|
|
20
|
+
/** Ticks one row of a table, whose own name is the row's contents. */
|
|
21
|
+
selectRow: string;
|
|
22
|
+
/** Takes one thing out of a set. */
|
|
23
|
+
remove: string;
|
|
24
|
+
/** Sends a message away without answering it. */
|
|
25
|
+
dismiss: string;
|
|
26
|
+
/** Opens a list a field is attached to. */
|
|
27
|
+
open: string;
|
|
28
|
+
/** A direction, on the two components that only move one step. */
|
|
29
|
+
previous: string;
|
|
30
|
+
next: string;
|
|
31
|
+
/** Uncovers and re-covers hidden content. */
|
|
32
|
+
reveal: string;
|
|
33
|
+
hide: string;
|
|
34
|
+
/** A number field's two steppers. */
|
|
35
|
+
increase: string;
|
|
36
|
+
decrease: string;
|
|
37
|
+
/** Opens a picture over the page. */
|
|
38
|
+
preview: string;
|
|
39
|
+
/** What a list says when it has nothing in it. */
|
|
40
|
+
empty: string;
|
|
41
|
+
/** Marks a step, or anything else, that may be left out. */
|
|
42
|
+
optional: string;
|
|
43
|
+
/** The trail's landmark, and the button that opens the steps it folded away. */
|
|
44
|
+
breadcrumb: string;
|
|
45
|
+
breadcrumbExpand: string;
|
|
46
|
+
/** The reel's landmark and its two steppers, which move by a slide. */
|
|
47
|
+
carousel: string;
|
|
48
|
+
carouselPrevious: string;
|
|
49
|
+
carouselNext: string;
|
|
50
|
+
/** What a slide is, said after its name: one slide's `aria-roledescription`.
|
|
51
|
+
* The reel's own is `carousel`. */
|
|
52
|
+
slide: string;
|
|
53
|
+
/** The wall of pictures' own landmark. */
|
|
54
|
+
gallery: string;
|
|
55
|
+
/** What a drawing of numbers is called when the caller has not named it. */
|
|
56
|
+
chart: string;
|
|
57
|
+
minimize: string;
|
|
58
|
+
maximize: string;
|
|
59
|
+
restore: string;
|
|
60
|
+
resizeWindow: string;
|
|
61
|
+
/** The palette's landmark and the placeholder in its field. */
|
|
62
|
+
commandPalette: string;
|
|
63
|
+
commandPalettePlaceholder: string;
|
|
64
|
+
/** What a sheet over the whole page is called when it has no name. */
|
|
65
|
+
overlay: string;
|
|
66
|
+
/** The region the toasts are announced in. */
|
|
67
|
+
notifications: string;
|
|
68
|
+
/** The pager's landmark and its four steppers, which move by a page. */
|
|
69
|
+
pagination: string;
|
|
70
|
+
paginationPrevious: string;
|
|
71
|
+
paginationNext: string;
|
|
72
|
+
paginationFirst: string;
|
|
73
|
+
paginationLast: string;
|
|
74
|
+
/** The stars' group. */
|
|
75
|
+
rating: string;
|
|
76
|
+
/** The panel's landmark, the buttons that open and shut it, and the handle
|
|
77
|
+
* that sizes it. */
|
|
78
|
+
sidebar: string;
|
|
79
|
+
sidebarOpen: string;
|
|
80
|
+
sidebarClose: string;
|
|
81
|
+
sidebarResize: string;
|
|
82
|
+
/** The first link on a page, which jumps past the furniture. */
|
|
83
|
+
skipToContent: string;
|
|
84
|
+
/** The button that goes back up a long page. */
|
|
85
|
+
backToTop: string;
|
|
86
|
+
/** The table of contents' own landmark. */
|
|
87
|
+
onThisPage: string;
|
|
88
|
+
/** What a chat bubble says while somebody is still writing. */
|
|
89
|
+
typing: string;
|
|
90
|
+
/** What a chat bubble's mark says about the message it is on. */
|
|
91
|
+
messageSending: string;
|
|
92
|
+
messageSent: string;
|
|
93
|
+
messageDelivered: string;
|
|
94
|
+
messageRead: string;
|
|
95
|
+
messageFailed: string;
|
|
96
|
+
/** What covers a spoiler until it is revealed. */
|
|
97
|
+
spoilerWarning: string;
|
|
98
|
+
/** What a file picker's drop zone says when the caller has not said. */
|
|
99
|
+
filePickerTitle: string;
|
|
100
|
+
/** Read out after a link that leaves the page, and never drawn. */
|
|
101
|
+
newTab: string;
|
|
102
|
+
/** The two columns of a transfer, and the buttons between them. */
|
|
103
|
+
transferAvailable: string;
|
|
104
|
+
transferSelected: string;
|
|
105
|
+
transferToSelected: string;
|
|
106
|
+
transferToAvailable: string;
|
|
107
|
+
/** The code block's bar: the button, what it says once it has worked, and
|
|
108
|
+
* what it says when the clipboard refused. */
|
|
109
|
+
copy: string;
|
|
110
|
+
copied: string;
|
|
111
|
+
copyFailed: string;
|
|
112
|
+
/** The toggle that drops a block's colouring. */
|
|
113
|
+
raw: string;
|
|
114
|
+
/** What a block of code is called when it has neither a title nor a language. */
|
|
115
|
+
code: string;
|
|
116
|
+
/** The calendar's steppers, in day view. */
|
|
117
|
+
previousMonth: string;
|
|
118
|
+
nextMonth: string;
|
|
119
|
+
/** The same steppers in month view, where they move by a year. */
|
|
120
|
+
previousYear: string;
|
|
121
|
+
nextYear: string;
|
|
122
|
+
/** And in year view, where they move by a page of twelve. */
|
|
123
|
+
previousYears: string;
|
|
124
|
+
nextYears: string;
|
|
125
|
+
/** The two header buttons that open the month grid and the year grid. */
|
|
126
|
+
chooseMonth: string;
|
|
127
|
+
chooseYear: string;
|
|
128
|
+
/** The footer's actions. */
|
|
129
|
+
today: string;
|
|
130
|
+
/** The same shortcut on a picker that only asks for a month or a year. */
|
|
131
|
+
thisMonth: string;
|
|
132
|
+
thisYear: string;
|
|
133
|
+
now: string;
|
|
134
|
+
/** The clock's columns. */
|
|
135
|
+
hour: string;
|
|
136
|
+
minute: string;
|
|
137
|
+
second: string;
|
|
138
|
+
meridiem: string;
|
|
139
|
+
/** Which end of a range the calendar is currently asking for. */
|
|
140
|
+
start: string;
|
|
141
|
+
end: string;
|
|
142
|
+
/** A page button's name. */
|
|
143
|
+
paginationPage: (page: number) => string;
|
|
144
|
+
/** What the pager's live region says once the page has changed. */
|
|
145
|
+
paginationStatus: (page: number, count: number) => string;
|
|
146
|
+
/** What one star is called, and a read-only row with a score. The score can
|
|
147
|
+
* be a fraction, so a pack writes it the way its language writes a number:
|
|
148
|
+
* `2.5` in English, `2,5` in German. */
|
|
149
|
+
ratingValue: (value: number, count: number) => string;
|
|
150
|
+
/** And a read-only row with none. */
|
|
151
|
+
ratingNone: string;
|
|
152
|
+
/** One slide's name, which is also its dot's. */
|
|
153
|
+
carouselSlide: (index: number, count: number) => string;
|
|
154
|
+
/** Where a picture sits in a gallery: said after a tile's own words, and
|
|
155
|
+
* drawn as the viewer's counter. */
|
|
156
|
+
galleryItem: (index: number, total: number) => string;
|
|
157
|
+
/** A remove button named after what it takes away: a file, a chip. */
|
|
158
|
+
removeItem: (name: string) => string;
|
|
159
|
+
/** The row that offers what was typed as a value of its own. */
|
|
160
|
+
addCustom: (query: string) => string;
|
|
161
|
+
/** One slot of a code field, named by its place in the row. */
|
|
162
|
+
otpSlot: (index: number, count: number) => string;
|
|
163
|
+
/** What a transfer says once rows have moved, given how many and the list. */
|
|
164
|
+
transferMoved: (count: number, list: string) => string;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* English, and the reason the library needs no setup to read.
|
|
168
|
+
*
|
|
169
|
+
* Every locale in `src/locales/` is this object with the values replaced, which
|
|
170
|
+
* is what makes a missing key a type error rather than a word that quietly
|
|
171
|
+
* stays English.
|
|
172
|
+
*/
|
|
173
|
+
export declare const defaultLabels: PlassLabels;
|
|
174
|
+
/**
|
|
175
|
+
* The words in scope, resolved once per render.
|
|
176
|
+
*
|
|
177
|
+
* Two layers: the English above, and whatever a `PlassProvider` set. A
|
|
178
|
+
* component's own `*Label` prop is the third and narrowest, and it is applied
|
|
179
|
+
* at the call site rather than here — which is what lets an application
|
|
180
|
+
* translate the vocabulary once and one button still say something else.
|
|
181
|
+
*/
|
|
182
|
+
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",acknowledge:"OK",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",optional:"Optional",breadcrumb:"Breadcrumb",breadcrumbExpand:"Show the hidden steps",carousel:"Carousel",carouselPrevious:"Previous slide",carouselNext:"Next slide",slide:"slide",commandPalette:"Command palette",commandPalettePlaceholder:"Search commands",gallery:"Gallery",chart:"Chart",minimize:"Minimize",maximize:"Maximize",restore:"Restore",resizeWindow:"Resize window",overlay:"Overlay",notifications:"Notifications",pagination:"Pagination",paginationPrevious:"Previous page",paginationNext:"Next page",paginationFirst:"First page",paginationLast:"Last page",rating:"Rating",sidebar:"Sidebar",sidebarOpen:"Open sidebar",sidebarClose:"Close sidebar",sidebarResize:"Resize sidebar",skipToContent:"Skip to content",backToTop:"Back to top",onThisPage:"On this page",typing:"Typing…",messageSending:"Sending",messageSent:"Sent",messageDelivered:"Delivered",messageRead:"Read",messageFailed:"Not delivered",spoilerWarning:"This may contain spoilers",filePickerTitle:"Drop files here, or click to browse",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",paginationPage:e=>`Page ${e}`,paginationStatus:(e,a)=>`Page ${e} of ${a}`,ratingValue:(e,a)=>`${e.toLocaleString("en")} out of ${a}`,ratingNone:"No rating",carouselSlide:(e,a)=>`Slide ${e} of ${a}`,galleryItem:(e,a)=>`${e} of ${a}`,removeItem:e=>`Remove ${e}`,addCustom:e=>`Add “${e}”`,otpSlot:(e,a)=>`Character ${e} of ${a}`,transferMoved:(e,a)=>`${e} ${1===e?"item":"items"} moved to ${a}`};export function useLabels(){const{labels:o}=a();return e.useMemo(()=>o?{...defaultLabels,...o}:defaultLabels,[o])}
|
package/dist/internal/link.d.ts
CHANGED
|
@@ -16,3 +16,20 @@
|
|
|
16
16
|
* that can drift, and the one that drifts is the one nobody reads.
|
|
17
17
|
*/
|
|
18
18
|
export declare function safeRel(target: string | undefined, rel: string | undefined): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Whether an address is one this library will point an `href` at.
|
|
21
|
+
*
|
|
22
|
+
* Relative addresses pass, and so do `http`, `https` and `mailto`. Everything
|
|
23
|
+
* else is turned down, which in practice means `javascript:` — an address that
|
|
24
|
+
* runs code instead of going somewhere. React 19 refuses to write one, but the
|
|
25
|
+
* peer range starts at React 18, which only warns and then writes it.
|
|
26
|
+
*
|
|
27
|
+
* The test is done on the address with tabs and line breaks taken out and the
|
|
28
|
+
* leading control characters and spaces trimmed, because that is the address the
|
|
29
|
+
* browser navigates to: a tab written into the middle of a scheme is gone by the
|
|
30
|
+
* time it counts. Only the scheme is read, so the rest is handed back untouched.
|
|
31
|
+
*
|
|
32
|
+
* Here beside `safeRel` for the same reason that one is here: which addresses a
|
|
33
|
+
* component will follow is one decision, and it belongs in one place.
|
|
34
|
+
*/
|
|
35
|
+
export declare function safeHref(href: string | undefined): string | undefined;
|
package/dist/internal/link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function safeRel(e,
|
|
1
|
+
export function safeRel(e,t){return void 0===e||""===e||"_self"===e?t:[...new Set([...(t??"").split(/\s+/).filter(Boolean),"noopener","noreferrer"])].join(" ")}const e=new Set(["http:","https:","mailto:"]),t=/^[a-z][a-z0-9+.-]*:/i;export function safeHref(r){if(void 0===r)return;const n=r.replace(/[\t\n\r]/g,"").replace(/^[\0- ]+/,""),o=t.exec(n);return null===o||e.has(o[0].toLowerCase())?r:void 0}
|
|
@@ -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;
|