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,114 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassResponsive, PlassSize } from '../../types.js';
|
|
3
|
+
/** Which way the pile grows. */
|
|
4
|
+
export type PlStackDirection = 'horizontal' | 'vertical' | 'diagonal';
|
|
5
|
+
/** Which end of the list is on top. */
|
|
6
|
+
export type PlStackFront = 'first' | 'last';
|
|
7
|
+
export interface PlStackProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
8
|
+
/**
|
|
9
|
+
* Which way the pile grows.
|
|
10
|
+
*
|
|
11
|
+
* `diagonal` is a **fan** rather than a true 45°, and it cannot be anything
|
|
12
|
+
* else: the horizontal advance is `item width − overlap`, and a component that
|
|
13
|
+
* takes arbitrary children does not know how wide they are. `drop` is the
|
|
14
|
+
* vertical step, stated separately, and the two are independent on purpose.
|
|
15
|
+
* @default 'horizontal'
|
|
16
|
+
*/
|
|
17
|
+
direction?: PlassResponsive<PlStackDirection>;
|
|
18
|
+
/**
|
|
19
|
+
* How far each item sits under the one before it, along the axis the pile
|
|
20
|
+
* flows on — a number of pixels or any CSS length.
|
|
21
|
+
*
|
|
22
|
+
* Left out it is a fraction of `size`, which keeps the overlap looking the
|
|
23
|
+
* same at every step.
|
|
24
|
+
*/
|
|
25
|
+
overlap?: number | string;
|
|
26
|
+
/**
|
|
27
|
+
* The step on the *other* axis, for `direction="diagonal"` only. Defaults to
|
|
28
|
+
* whatever `overlap` resolved to, which is a 45° fan for square items and a
|
|
29
|
+
* shallower one for anything wider than it is tall.
|
|
30
|
+
*/
|
|
31
|
+
drop?: number | string;
|
|
32
|
+
/**
|
|
33
|
+
* Which rung of the ladder the default `overlap` comes off.
|
|
34
|
+
*
|
|
35
|
+
* It decides **nothing else**. A stack draws no surface of its own and has no
|
|
36
|
+
* type in it, so there is no height to set and no ink to colour — the items
|
|
37
|
+
* are whatever they already were.
|
|
38
|
+
* @default 'md'
|
|
39
|
+
*/
|
|
40
|
+
size?: PlassSize;
|
|
41
|
+
/** How many items are drawn. Left out, every one of them is. */
|
|
42
|
+
max?: number;
|
|
43
|
+
/**
|
|
44
|
+
* How many there are altogether, when the stack was handed only the first few.
|
|
45
|
+
* Without it the count is worked out from the children, which is right only
|
|
46
|
+
* when all of them were passed.
|
|
47
|
+
*/
|
|
48
|
+
total?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Draws a last item standing for the ones that did not fit, given how many
|
|
51
|
+
* that is: `(n) => <PlAvatar initials={`+${n}`} />`.
|
|
52
|
+
*
|
|
53
|
+
* A function rather than a node, because the number **is** the item — a node
|
|
54
|
+
* would have to be given a count it has no way to work out, and would then be
|
|
55
|
+
* wrong every time the list changed.
|
|
56
|
+
*/
|
|
57
|
+
overflow?: (hidden: number) => React.ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Which end of the list is on top.
|
|
60
|
+
*
|
|
61
|
+
* `last` is what the DOM does on its own and what a row of faces wants — the
|
|
62
|
+
* newest arrival in front. `first` is what a deck of cards is: the top card is
|
|
63
|
+
* the one you read first.
|
|
64
|
+
* @default 'last'
|
|
65
|
+
*/
|
|
66
|
+
front?: PlStackFront;
|
|
67
|
+
/**
|
|
68
|
+
* What each item further back is multiplied by, compounding. `0.94` takes four
|
|
69
|
+
* steps down to about 78%.
|
|
70
|
+
*
|
|
71
|
+
* On the standalone `scale` property rather than inside a `transform`, so a
|
|
72
|
+
* caller's own transform on the same item survives.
|
|
73
|
+
* @default 1
|
|
74
|
+
*/
|
|
75
|
+
scaleStep?: number;
|
|
76
|
+
/** The same, for opacity. @default 1 */
|
|
77
|
+
opacityStep?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Draws a hairline of the page's own surface colour around each item, which
|
|
80
|
+
* is the *hole* the near item is cut out of rather than an edge on it.
|
|
81
|
+
*
|
|
82
|
+
* Two shapes of similar tone laid over each other have no boundary between
|
|
83
|
+
* them at all and the pile reads as one smeared shape. A translucent line
|
|
84
|
+
* would not help, because what is behind it is the other item.
|
|
85
|
+
*
|
|
86
|
+
* It lands on **the element you passed**, so it takes that element's shape.
|
|
87
|
+
* Wrap an avatar in something square and the ring is square; there is no way
|
|
88
|
+
* for a component that accepts arbitrary children to know better.
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
ring?: boolean;
|
|
92
|
+
/** The things in the pile. */
|
|
93
|
+
children?: React.ReactNode;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Things piled up, overlapping.
|
|
97
|
+
*
|
|
98
|
+
* A row of faces is one arrangement of this and not a component of its own: a
|
|
99
|
+
* deck of cards, a pile of documents, a fan of thumbnails and a stack of avatars
|
|
100
|
+
* differ in what is in them, not in how they are laid out. So this takes
|
|
101
|
+
* whatever it is given and never looks inside.
|
|
102
|
+
*
|
|
103
|
+
* Which is also what it gives up. It cannot set an axis on its items the way a
|
|
104
|
+
* `PlAvatarGroup` used to, because it does not know what they are — put a
|
|
105
|
+
* `PlassProvider` around it for `size` and `color`, and write anything narrower
|
|
106
|
+
* on the items themselves.
|
|
107
|
+
*
|
|
108
|
+
* Two boxes are drawn per item rather than one, and the second is not spare. The
|
|
109
|
+
* outer one carries the offset and the stacking order; the inner one carries the
|
|
110
|
+
* depth, on the standalone `scale` and `opacity` properties. Kept on one box,
|
|
111
|
+
* an entrance animation that writes `scale` — every keyframe in this library
|
|
112
|
+
* that grows or zooms does — would overwrite the depth on its first frame.
|
|
113
|
+
*/
|
|
114
|
+
export declare const PlStack: React.ForwardRefExoticComponent<PlStackProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import*as l from"react";import{useDefaults as t}from"../../internal/defaults.js";import{cx as e,toLength as a}from"../../internal/styles.js";import{useResponsiveValue as i}from"../../internal/responsive.js";const n={xs:"0.5rem",sm:"0.625rem",md:"0.875rem",lg:"1rem",xl:"1.25rem"},s={horizontal:/* @__PURE__ */["flex-row","[&>*:not(:first-child)]:[margin-inline-start:calc(var(--p-overlap)*-1)]"].join(" "),vertical:/* @__PURE__ */["flex-col","[&>*:not(:first-child)]:[margin-block-start:calc(var(--p-overlap)*-1)]"].join(" "),diagonal:/* @__PURE__ */["flex-row","[&>*:not(:first-child)]:[margin-inline-start:calc(var(--p-overlap)*-1)]"].join(" ")};export const PlStack=/* @__PURE__ */l.forwardRef(function PlStack({direction:o,overlap:c,drop:m,size:p,max:f,total:d,overflow:h,front:g="last",scaleStep:v=1,opacityStep:x=1,ring:u=!1,className:j,style:y,children:S,...k},z){const w=i(o,"horizontal"),N=t(),M=p??N.size??"md",P=void 0===c?n[M]:a(c),$=void 0===m?P:a(m),b=l.Children.toArray(S),A=void 0===f?b:b.slice(0,Math.max(0,f)),B=d??b.length,C=Math.max(0,B-A.length),I=h&&C>0?[...A,h(C)]:[...A];return r("div",{ref:z,className:e("isolate inline-flex items-start",s[w],u?"[&>*>*>*]:ring-2 [&>*>*>*]:ring-(--plass-surface)":"",j),style:{"--p-overlap":P,...y},...k,children:I.map((l,t)=>{const e="first"===g?t:I.length-1-t;return r("span",{className:"flex shrink-0",style:{zIndex:"first"===g?I.length-t:t+1,..."diagonal"===w&&t>0?{marginBlockStart:`calc(${$} * ${t})`}:null},children:r("span",{className:"flex",style:{...1===v?null:{scale:String(v**e)},...1===x?null:{opacity:x**e}},children:l})},t)})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlStack}from"./PlStack.js";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassColor, PlassDensity, PlassSize } from '../../types.js';
|
|
3
|
+
/** Which way a change has to go to be good news. */
|
|
4
|
+
export type PlStatDirection = 'up' | 'down';
|
|
5
|
+
export interface PlStatProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
6
|
+
/** What the figure is of. The line above it. */
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The figure itself, already formatted.
|
|
10
|
+
*
|
|
11
|
+
* A node rather than a number, and deliberately: how a figure is written —
|
|
12
|
+
* the currency, the grouping, the decimals, the locale — is the page's
|
|
13
|
+
* decision and `Intl.NumberFormat` already makes it. A component that took a
|
|
14
|
+
* number would have to guess at all four.
|
|
15
|
+
*/
|
|
16
|
+
value?: React.ReactNode;
|
|
17
|
+
/** A line under the figure. What it is compared with, usually. */
|
|
18
|
+
description?: React.ReactNode;
|
|
19
|
+
/** A glyph beside the label. */
|
|
20
|
+
icon?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* How much it moved, as a percentage. Drawn with an arrow, and coloured by
|
|
23
|
+
* whether that is good news rather than by its sign.
|
|
24
|
+
*/
|
|
25
|
+
change?: number;
|
|
26
|
+
/**
|
|
27
|
+
* What the change says, instead of the formatted percentage. For a figure
|
|
28
|
+
* that moved by a count rather than by a proportion — "+1,204 this week".
|
|
29
|
+
*/
|
|
30
|
+
changeLabel?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Which way is good news.
|
|
33
|
+
*
|
|
34
|
+
* `up` by default and worth setting on about a third of the figures a
|
|
35
|
+
* dashboard has: for churn, for a bounce rate, for a p95 latency, a rise is
|
|
36
|
+
* the bad one, and a component that painted it green would be reading the
|
|
37
|
+
* number and not the meaning.
|
|
38
|
+
* @default 'up'
|
|
39
|
+
*/
|
|
40
|
+
improvesWhen?: PlStatDirection;
|
|
41
|
+
/** Draws a skeleton where the figure will be. */
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
/** @default 'md' */
|
|
44
|
+
size?: PlassSize;
|
|
45
|
+
/** The family the icon takes. @default 'primary' */
|
|
46
|
+
color?: PlassColor;
|
|
47
|
+
/** @default 'default' */
|
|
48
|
+
density?: PlassDensity;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* One figure, and what has happened to it.
|
|
52
|
+
*
|
|
53
|
+
* A row of these is the top of every dashboard, and the whole of what makes
|
|
54
|
+
* them worth a component rather than three `<div>`s is the **change**: a number
|
|
55
|
+
* on its own says what things are, and a number with a movement beside it says
|
|
56
|
+
* whether that is going anywhere.
|
|
57
|
+
*
|
|
58
|
+
* The colour of that movement is decided by `improvesWhen` and not by the
|
|
59
|
+
* sign, which is the one thing a naive version of this gets wrong. Churn going
|
|
60
|
+
* up is not good news, and a green arrow on it is a dashboard lying to
|
|
61
|
+
* somebody.
|
|
62
|
+
*
|
|
63
|
+
* It draws **no surface**. A figure sits in a `PlCard` or in a row of them, and
|
|
64
|
+
* a sheet inside a sheet is two sheets.
|
|
65
|
+
*/
|
|
66
|
+
export declare const PlStat: React.ForwardRefExoticComponent<PlStatProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as s from"react";import{PlSkeleton as l}from"../skeleton/PlSkeleton.js";import{useDefaults as a}from"../../internal/defaults.js";import{controlSlots as n,cx as r,hasContent as i,metaTextClasses as c,stackGapClasses as o}from"../../internal/styles.js";const m={xs:"text-xl",sm:"text-2xl",md:"text-3xl",lg:"text-4xl",xl:"text-5xl"};function Arrow({up:t}){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"size-[1em]",children:e("path",{d:t?"M8 12V4m0 0L4.5 7.5M8 4l3.5 3.5":"M8 4v8m0 0 3.5-3.5M8 12l-3.5-3.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export const PlStat=/* @__PURE__ */s.forwardRef(function PlStat({label:s,value:d,description:u,icon:p,change:x,changeLabel:f,improvesWhen:h="up",loading:g=!1,size:v,color:N,density:j,className:b,style:k,children:y,...w},z){const L=a(),M=v??L.size??"md",P=N??L.color??"primary",S=j??L.density??"default",A=void 0!==x&&0!==x,W=(x??0)>0,$=A&&("up"===h?W:!W),B=void 0!==x||i(f);return t("div",{ref:z,className:r("flex flex-col","compact"===S?"gap-0.5":o[M],b),style:{...n(P,0,"ghost"),...k},...w,children:[i(s)||i(p)?t("div",{className:r("flex items-center gap-1.5 text-(--plass-muted-fg)",c[M]),children:[i(p)?e("span",{"aria-hidden":"true",className:"flex items-center text-(--p-accent) [&_svg]:size-[1.15em]",children:p}):null,s]}):null,t("div",{className:"flex items-baseline gap-2",children:[g?e(l,{shape:"line",size:M,color:P,width:"6ch"}):e("span",{className:r("font-semibold text-(--plass-fg) tabular-nums",m[M]),children:d}),B&&!g?t("span",{className:r("flex items-center gap-0.5 font-medium tabular-nums",c[M],A?$?"text-(--plass-success-accent)":"text-(--plass-danger-accent)":"text-(--plass-muted-fg)"),children:[A?e(Arrow,{up:W}):null,f??`${W?"+":""}${x}%`]}):null]}),i(u)?e("div",{className:r("text-(--plass-muted-fg)",c[M]),children:u}):null,y]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlStat}from"./PlStat.js";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type PlassStepConnector, type PlassStepStatus } from '../../internal/steps.js';
|
|
3
|
+
import type { PlassColor, PlassDensity, PlassOrientation, PlassResponsive, PlassSize } from '../../types.js';
|
|
4
|
+
/** The same three a `PlTimeline` draws, and the same marks. */
|
|
5
|
+
export type PlStepStatus = PlassStepStatus;
|
|
6
|
+
/** How the line between two steps is drawn. `none` leaves the gap open. */
|
|
7
|
+
export type PlStepConnector = PlassStepConnector;
|
|
8
|
+
export interface PlStepperProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
9
|
+
/** Which step the reader is on. Use with `onActiveChange` for a controlled stepper. */
|
|
10
|
+
active?: number;
|
|
11
|
+
/** Which step it starts on, for an uncontrolled one. @default 0 */
|
|
12
|
+
defaultActive?: number;
|
|
13
|
+
onActiveChange?: (active: number) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Whether a step ahead of the current one can be jumped to.
|
|
16
|
+
*
|
|
17
|
+
* On by default, because that is what makes it a process rather than a set of
|
|
18
|
+
* tabs: the third step of a sign-up cannot be filled in before the second.
|
|
19
|
+
* Turn it off for a review screen, where every step has already been answered
|
|
20
|
+
* and the reader is going back to check one.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
linear?: boolean;
|
|
24
|
+
/** @default 'horizontal' */
|
|
25
|
+
orientation?: PlassResponsive<PlassOrientation>;
|
|
26
|
+
/** How the line between two steps is drawn. @default 'solid' */
|
|
27
|
+
connector?: PlStepConnector;
|
|
28
|
+
/** @default 'md' */
|
|
29
|
+
size?: PlassSize;
|
|
30
|
+
/** @default 'primary' */
|
|
31
|
+
color?: PlassColor;
|
|
32
|
+
/** @default 'default' */
|
|
33
|
+
density?: PlassDensity;
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
export interface PlStepProps extends Omit<React.ComponentPropsWithoutRef<'li'>, 'color'> {
|
|
37
|
+
/** What the step is called. */
|
|
38
|
+
label?: React.ReactNode;
|
|
39
|
+
/** A second line under it — what the step asks for. */
|
|
40
|
+
description?: React.ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* What is drawn in the bullet. The step's own number by default, and a tick
|
|
43
|
+
* once it is complete.
|
|
44
|
+
*/
|
|
45
|
+
bullet?: React.ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Overrides where the sequence says this step is. For the one that failed
|
|
48
|
+
* validation while the reader was three steps further on.
|
|
49
|
+
*/
|
|
50
|
+
status?: PlStepStatus;
|
|
51
|
+
/**
|
|
52
|
+
* Marks the step as skippable. `true` draws the word "Optional"; a node draws
|
|
53
|
+
* that node instead, which is how the word is translated.
|
|
54
|
+
*/
|
|
55
|
+
optional?: boolean | React.ReactNode;
|
|
56
|
+
/** Cannot be reached, whatever `linear` says. */
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
/** Overrides the stepper's family for this one step. */
|
|
59
|
+
color?: PlassColor;
|
|
60
|
+
/** The panel this step shows while it is the current one. */
|
|
61
|
+
children?: React.ReactNode;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A process the reader is moving through, and where they are in it.
|
|
65
|
+
*
|
|
66
|
+
* It draws the same rail a [`PlTimeline`](../display/timeline) does — the same
|
|
67
|
+
* three bullet states, the same connector — and the difference is what the two
|
|
68
|
+
* are *for*, which is also the whole of when to reach for which. A timeline
|
|
69
|
+
* **reports**: it is an `<ol>` of text about a sequence that already happened,
|
|
70
|
+
* and nothing on it can be pressed. A stepper **is** the sequence: its steps are
|
|
71
|
+
* buttons, the current one owns a panel, and pressing one moves the reader.
|
|
72
|
+
*
|
|
73
|
+
* `active` is an index rather than a value, exactly as a timeline's is, because
|
|
74
|
+
* a stepper has no selection: everything before it is done, the step at it is
|
|
75
|
+
* where you are, everything after it is ahead.
|
|
76
|
+
*/
|
|
77
|
+
export declare const PlStepper: React.ForwardRefExoticComponent<PlStepperProps & React.RefAttributes<HTMLDivElement>>;
|
|
78
|
+
/**
|
|
79
|
+
* One step.
|
|
80
|
+
*
|
|
81
|
+
* Its index is not a prop and cannot be: a step that had to be told where it
|
|
82
|
+
* was would be one every caller could put in the wrong place, and `active={2}`
|
|
83
|
+
* would stop meaning anything. The stepper numbers its children as it walks
|
|
84
|
+
* them and hands each one its index through a context.
|
|
85
|
+
*/
|
|
86
|
+
export declare const PlStep: React.ForwardRefExoticComponent<PlStepProps & React.RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{useDefaults as r}from"../../internal/defaults.js";import{bulletGapClasses as n,bulletSizeValues as s,bulletStatusClasses as a,connectorColorClasses as i,connectorStyleClasses as o,statusAt as c,titleStatusClasses as d}from"../../internal/steps.js";import{cx as u,focusRingClasses as m,hasContent as p,iconClasses as f,metaTextClasses as x,radiusClasses as h,sheetBodyClasses as v,sheetTitleClasses as b,surfaceSlots as N,transitionClasses as w}from"../../internal/styles.js";import{useResponsiveValue as y}from"../../internal/responsive.js";const z=/* @__PURE__ */t.createContext(null),j=/* @__PURE__ */t.createContext({index:0,last:!1});function StepTick(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"size-[0.7em]",children:e("path",{d:"m3.5 8.5 3 3 6-7",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export const PlStepper=/* @__PURE__ */t.forwardRef(function PlStepper({active:n,defaultActive:s=0,onActiveChange:a,linear:i=!0,orientation:o,connector:c="solid",size:d,color:m,density:f,className:x,style:h,children:b,...w},k){const C=y(o,"horizontal"),S=r(),g=d??S.size??"md",P=m??S.color??"primary",$=f??S.density??"default",[A,I]=t.useState(s),L=n??A,R=t.useId(),T=t.useCallback(e=>{void 0===n&&I(e),a?.(e)},[n,a]),B=t.Children.toArray(b),M=B.length,O=t.useMemo(()=>({size:g,density:$,orientation:C,color:P,active:L,linear:i,connector:c,baseId:R,onSelect:T}),[g,$,C,P,L,i,c,R,T]),W="horizontal"===C,q=W?B[L]?.props?.children:null;return e(z.Provider,{value:O,children:l("div",{ref:k,className:u("flex w-full flex-col",x),style:{...N(P,0),...h},...w,children:[e("ol",{role:"list",className:u("flex w-full",W?"flex-row":"flex-col"),children:B.map((l,t)=>e(j.Provider,{value:{index:t,last:t===M-1},children:l},t))}),p(q)?e("div",{"aria-labelledby":`${R}-${L}`,className:u("mt-4",v[g]),children:q}):null]})})});export const PlStep=/* @__PURE__ */t.forwardRef(function PlStep({label:r,description:y,bullet:k,status:C,optional:S,disabled:g=!1,color:P,className:$,children:A,...I},L){const R=t.useContext(z),{index:T,last:B}=t.useContext(j),M=R?.size??"md",O=R?.orientation??"horizontal",W=P??R?.color??"primary",q=R?.active??null,D=R?.connector??"solid",E=C??c(T,q),F="horizontal"===O,G=!g&&null!==R&&(!R.linear||T<=R.active),H="none"!==D&&!B,J=e("span",{"aria-hidden":"true",className:u("relative z-10 flex shrink-0 items-center justify-center rounded-full","size-(--p-bullet) text-[calc(var(--p-bullet)*0.5)] leading-none font-semibold tabular-nums",a[E],w,f),children:k??("complete"===E?e(StepTick,{}):T+1)}),K=l("span",{className:u("flex min-w-0 flex-col",F?"items-center text-center":""),children:[e("span",{id:R?`${R.baseId}-${T}`:void 0,className:u("font-semibold",b[M],d[E]),children:r}),p(y)?e("span",{className:u("text-(--plass-muted-fg)",x[M]),children:y}):null,S?e("span",{className:u("text-(--plass-muted-fg) italic",x[M]),children:!0===S?"Optional":S}):null]}),Q=l("span",{className:u("flex items-center",F?"flex-col":"flex-row",n[M]),children:[J,F?K:null]}),U=G?l("button",{type:"button","aria-current":"current"===E?"step":void 0,onClick:()=>R?.onSelect(T),className:u("flex cursor-pointer items-center bg-transparent p-1",F?"flex-col":"flex-row",n[M],h[M],m,w,"hover:bg-(--p-soft)"),children:[F?Q:J,F?null:K]}):l("span",{"aria-current":"current"===E?"step":void 0,className:u("flex items-center p-1",F?"flex-col":"flex-row",n[M],g?"opacity-50":""),children:[F?Q:J,F?null:K]});return l("li",{ref:L,className:u("relative flex min-w-0",F?"flex-1 flex-col items-center":"flex-col",$),style:{"--p-bullet":s[M],...N(W,0),"--p-fill":`var(--plass-${W}-fill)`,"--p-on-solid":`var(--plass-${W}-on-solid)`},...I,children:[l("span",{className:u("flex w-full",F?"flex-row items-start":"flex-col"),children:[U,H?e("span",{"aria-hidden":"true",className:u(F?"mt-[calc(var(--p-bullet)/2+0.25rem)] h-0 flex-1 border-t":"ms-[calc(var(--p-bullet)/2+0.25rem)] w-0 flex-1 self-stretch border-s",o[D],i[E],w)}):null]}),!F&&"current"===E&&p(A)?e("div",{className:u("ms-[calc(var(--p-bullet)+0.75rem)] pt-2 pb-4",v[M]),children:A}):null]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlStep,PlStepper}from"./PlStepper.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as a,jsxs as e,Fragment as r}from"react/jsx-runtime";import*as t from"react";import{useDefaults as s}from"../../internal/defaults.js";import{Switch as l}from"@base-ui/react/switch";import{Field as i}from"@base-ui/react/field";import{controlSlots as c,cx as n,focusRingClasses as o,hasContent as d,metaTextClasses as h,tickRowTextClasses as m}from"../../internal/styles.js";const p={xs:"h-3.5 w-6",sm:"h-4 w-7",md:"h-5 w-9",lg:"h-6 w-11",xl:"h-7 w-13"},u={xs:"data-[checked]:start-[calc(100%-0.75rem)]",sm:"data-[checked]:start-[calc(100%-0.875rem)]",md:"data-[checked]:start-[calc(100%-1.125rem)]",lg:"data-[checked]:start-[calc(100%-1.375rem)]",xl:"data-[checked]:start-[calc(100%-1.625rem)]"},f=/* @__PURE__ */["relative inline-flex shrink-0 rounded-full","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","[transition-property:background-color,background-image,box-shadow,filter]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]",o].join(" "),g=/* @__PURE__ */["cursor-pointer bg-(--plass-track)","hover:brightness-[0.97] dark:hover:brightness-110","data-[checked]:[background-image:var(--p-fill)]","data-[checked]:[box-shadow:var(--p-lift)] data-[checked]:hover:brightness-105"].join(" "),b=/* @__PURE__ */["cursor-default bg-(--plass-track) saturate-[0.55]","data-[checked]:[background-image:var(--p-fill)]","data-[checked]:shadow-none"].join(" "),x=/* @__PURE__ */["cursor-not-allowed bg-(--plass-track)","opacity-50 saturate-[0.35] shadow-none","data-[checked]:[background-image:var(--p-fill)]"].join(" "),k=/* @__PURE__ */["absolute inset-y-0.5 start-0.5 aspect-square rounded-full bg-white","[box-shadow:0_1px_2px_rgb(20_40_90/0.25)]","[transition:inset-inline-start_var(--plass-duration)_var(--plass-ease)]"].join(" ");export const PlSwitch=/* @__PURE__ */t.forwardRef(function PlSwitch({size:t,color:o,label:w,description:v,error:j,invalid:N,labelPlacement:y="end",disabled:_=!1,readOnly:P=!1,className:R,classNames:S,style:$,...z},B){const O=s(),q=t??O.size??"md",D=o??O.color??"primary",E=d(j),F=N??E,L=F?"danger":D,T=a("span",{className:"flex h-[1lh] shrink-0 items-center",children:a(l.Root,{ref:B,className:n(f,p[q],_?x:P?b:g,S?.control),disabled:_,readOnly:P,...z,children:a(l.Thumb,{className:`${k} ${u[q]}`})})}),A=w||v?e("span",{className:["flex min-w-0 flex-col gap-0.5","start"===y?"flex-1":""].filter(Boolean).join(" "),children:[w?a(i.Label,{className:n(_?"text-(--plass-muted-fg)":"cursor-pointer text-(--plass-fg)",S?.label),children:w}):null,v?a(i.Description,{className:n(h[q],"text-(--plass-muted-fg)",S?.description),children:v}):null]}):null;return e(i.Root,{disabled:_,invalid:F,className:["inline-flex flex-col gap-1 align-top",R??""].filter(Boolean).join(" "),style:{...c(L,0,"solid"),...$},children:[a("div",{className:`flex items-start gap-2.5 ${m[q]}`,children:e(r,"start"===y?{children:[A,T]}:{children:[T,A]})}),a(i.Error,E?{match:!0,className:n(h[q],"text-(--p-accent)",S?.error),children:j}:{className:n(h[q],"text-(--p-accent)",S?.error)})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{controlTextLeadingClasses as r,metaTextClasses as a,paddingXValues as l,radiusClasses as o,sheetRestClasses as s,srOnlyClasses as n,surfaceSlots as i}from"../../internal/styles.js";import{cellPaddingYValues as d,clickableRowClasses as c,headRule as p,rowClasses as m,rowRule as h,tableStyle as g}from"../../internal/table.js";export function PlTable({variant:y="glass",size:v="md",color:f="primary",density:u="default",elevation:x=0,columns:b,rows:w,getRowKey:k,caption:N,empty:j="No data",striped:B=!1,hoverable:$=!1,stickyHeader:A=!1,maxHeight:C,onRowClick:H,className:T,style:z,...D}){const K=l[u][v],R=d[u][v],S=Boolean(H),E=$||S,I=void 0!==C,P={padding:`${R} ${K}`,border:0,background:"none"},q={...P,...A?{boxShadow:"inset 0 -1px 0 var(--plass-border)"}:{borderBottom:p},...A?{background:"linear-gradient(var(--plass-glass-press), var(--plass-glass-press)), linear-gradient(var(--plass-surface), var(--plass-surface))"}:null},bodyCellStyle=e=>0===e?P:{...P,borderTop:h};return t("div",{className:["overflow-hidden",o[v],s[y],T??""].filter(Boolean).join(" "),style:{...i(f,x),...z},...D,children:[N?e("div",{"aria-hidden":"true",className:`${a[v]} font-semibold text-(--plass-muted-fg)`,style:{...P,borderBottom:h,textAlign:"start"},children:N}):null,e("div",{className:["overflow-x-auto",I?"overflow-y-auto overscroll-contain":""].filter(Boolean).join(" "),style:I?{maxHeight:C}:void 0,children:t("table",{className:`text-start ${r[v]} text-(--plass-fg)`,style:g,children:[N?e("caption",{className:n,children:N}):null,e("colgroup",{children:b.map(t=>e("col",{style:void 0===t.width?void 0:{width:"number"==typeof t.width?`${t.width}px`:t.width}},t.key))}),e("thead",{children:e("tr",{children:b.map(t=>e("th",{scope:"col",className:["font-semibold whitespace-nowrap text-(--plass-muted-fg)",A?"sticky top-0 z-10":""].filter(Boolean).join(" "),style:{...q,textAlign:t.align??"start"},children:t.header??t.key},t.key))})}),e("tbody",{children:0===w.length?e("tr",{className:m,children:e("td",{colSpan:b.length,className:"text-(--plass-muted-fg)",style:{...P,padding:`2rem ${K}`,textAlign:"center"},children:j})}):w.map((t,r)=>e("tr",{className:[m,B&&r%2==1?"[--p-row:var(--plass-stripe)]":"",E?"hover:[--p-row:var(--p-soft)]":"",S?c:""].filter(Boolean).join(" "),style:{backgroundColor:"var(--p-row)"},tabIndex:S?0:void 0,onClick:H?()=>H(t,r):void 0,onKeyDown:H?e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),H(t,r)))}:void 0,children:b.map(a=>e("td",{style:{...bodyCellStyle(r),textAlign:a.align??"start"},children:a.render?a.render(t,r):t[a.key]},a.key))},k?k(t,r):r))})]})})]})}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { PlassOrientation, PlassStyleProps, PlassVariant } from '../../types.js';
|
|
2
|
+
import type { PlassOrientation, PlassResponsive, PlassStyleProps, PlassVariant } from '../../types.js';
|
|
3
3
|
/** A tab's value. The same restraint `PlSelect` puts on its own — an identifier. */
|
|
4
4
|
export type PlTabValue = string | number;
|
|
5
5
|
export interface PlTabsProps extends Omit<PlassStyleProps, 'variant'>, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
@@ -28,7 +28,7 @@ export interface PlTabsProps extends Omit<PlassStyleProps, 'variant'>, Omit<Reac
|
|
|
28
28
|
* UI's doing, and is what makes a vertical tab bar reachable.
|
|
29
29
|
* @default 'horizontal'
|
|
30
30
|
*/
|
|
31
|
-
orientation?: PlassOrientation
|
|
31
|
+
orientation?: PlassResponsive<PlassOrientation>;
|
|
32
32
|
/**
|
|
33
33
|
* Whether moving the arrow keys also chooses the tab it lands on.
|
|
34
34
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useDefaults as l}from"../../internal/defaults.js";import{Tabs as o}from"@base-ui/react/tabs";import{controlHeightClasses as s,controlTextClasses as r,focusRingClasses as i,focusRingInsetClasses as n,gapClasses as c,glassClasses as d,hasContent as f,iconClasses as h,paddingXClasses as u,radiusClasses as p,surfaceSlots as v,transitionClasses as b}from"../../internal/styles.js";import{useResponsiveValue as m}from"../../internal/responsive.js";const g=/* @__PURE__ */a.createContext({variant:"glass",size:"md",density:"default",orientation:"horizontal",fullWidth:!1}),x={solid:{horizontal:`${d} inline-flex bg-(--plass-glass) p-1 [box-shadow:var(--plass-well)]`,vertical:`${d} inline-flex flex-col bg-(--plass-glass) p-1 [box-shadow:var(--plass-well)]`},glass:{horizontal:"flex border-b [border-color:var(--plass-border)]",vertical:"flex flex-col border-e [border-color:var(--plass-border)]"},ghost:{horizontal:"flex",vertical:"flex flex-col"}},w={solid:{horizontal:"absolute top-(--active-tab-top) left-(--active-tab-left) h-(--active-tab-height) w-(--active-tab-width)",vertical:"absolute top-(--active-tab-top) left-(--active-tab-left) h-(--active-tab-height) w-(--active-tab-width)"},glass:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"},ghost:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"}},y={solid:`${d} bg-(--plass-glass-press) [box-shadow:var(--plass-shadow-1),var(--plass-gloss-glass)]`,glass:"bg-(--p-accent)",ghost:"bg-(--p-accent)"},z="text-(--plass-muted-fg) hover:text-(--plass-fg) data-[active]:text-(--p-accent)";export const PlTab=/* @__PURE__ */a.forwardRef(function PlTab({value:l,startIcon:i,endIcon:d,disabled:v=!1,className:m,children:x,...w},y){const{variant:j,size:P,density:N,fullWidth:T}=a.useContext(g);return t(o.Tab,{ref:y,value:l,disabled:v,className:["relative z-10 inline-flex shrink-0 cursor-pointer items-center justify-center select-none","font-semibold whitespace-nowrap","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",s[P],r[P],c[P],u[N][P],"solid"===j?p[P]:"",b,h,z,n,"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",T?"flex-1":"",m??""].filter(Boolean).join(" "),...w,children:[f(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:i}):null,x,f(d)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:d}):null]})});export const PlTabPanel=/* @__PURE__ */a.forwardRef(function PlTabPanel({value:t,keepMounted:l=!1,className:s,children:r,...n},c){const{size:d}=a.useContext(g);return e(o.Panel,{ref:c,value:t,keepMounted:l,className:["min-w-0 flex-1 text-(--plass-fg)",i,p[d],s??""].filter(Boolean).join(" "),...n,children:r})});export const PlTabs=/* @__PURE__ */a.forwardRef(function PlTabs({variant:s="glass",size:r,color:i,density:n,value:c,defaultValue:d,onValueChange:f,orientation:h,activateOnFocus:u=!1,loopFocus:b=!0,fullWidth:z=!1,className:j,style:P,children:N,...T},k){const C=m(h,"horizontal"),R=l(),S=r??R.size??"md",W=i??R.color??"primary",O=n??R.density??"default",V=a.useMemo(()=>({variant:s,size:S,density:O,orientation:C,fullWidth:z}),[s,S,O,C,z]),B=a.useRef(null),E=function useListOverflow(e,t){const[l,o]=a.useState({start:!1,end:!1,rtl:!1}),s=a.useCallback(()=>{const t=e.current;if(!t)return;const a=t.scrollWidth-t.clientWidth,l=Math.abs(t.scrollLeft),s={start:l>1,end:a-l>1,rtl:"rtl"===getComputedStyle(t).direction};o(e=>e.start===s.start&&e.end===s.end&&e.rtl===s.rtl?e:s)},[e]);return a.useLayoutEffect(()=>{t&&s()}),a.useEffect(()=>{const a=e.current;if(!a||!t||"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(s);return l.observe(a),()=>l.disconnect()},[t,s,e]),t?{style:{"--p-fade-left":(l.rtl?l.end:l.start)?"var(--p-fade)":void 0,"--p-fade-right":(l.rtl?l.start:l.end)?"var(--p-fade)":void 0},onScroll:s,state:l.start?l.end?"both":"start":l.end?"end":"none"}:{style:void 0,onScroll:void 0,state:void 0}}(B,"horizontal"===C),F=[],L=[];return a.Children.forEach(N,e=>{a.isValidElement(e)&&e.type===PlTabPanel?L.push(e):null!=e&&!1!==e&&F.push(e)}),e(g.Provider,{value:V,children:t(o.Root,{ref:k,value:c,defaultValue:d,onValueChange:e=>f?.(e),orientation:C,className:["flex min-w-0","vertical"===C?"flex-row gap-4":"flex-col gap-4",j??""].filter(Boolean).join(" "),style:{...v(W,0),...P},...T,children:[t(o.List,{ref:B,activateOnFocus:u,loopFocus:b,className:["relative shrink-0",x[s][C],"solid"===s?p[S]:"",z&&"horizontal"===C?"w-full":"","horizontal"===C?"plass-fade-x overflow-x-auto overflow-y-hidden":""].filter(Boolean).join(" "),style:E.style,onScroll:E.onScroll,"data-overflow":E.state,children:[F,e(o.Indicator,{className:["pointer-events-none",w[s][C],y[s],"solid"===s?p[S]:"rounded-full","[transition-property:left,top,width,height]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" ")})]}),L]})})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { PlassElevation, PlassFieldClassNames, PlassStyleProps } from '../../types.js';
|
|
2
|
+
import type { PlassElevation, PlassFieldClassNames, PlassHotKeys, PlassStyleProps } from '../../types.js';
|
|
3
3
|
/** How the multiline control may be resized by the user. Ignored when single line. */
|
|
4
4
|
export type PlTextFieldResize = 'none' | 'vertical' | 'horizontal' | 'both';
|
|
5
5
|
/**
|
|
@@ -11,6 +11,15 @@ type NativeControlProps = Omit<React.ComponentPropsWithoutRef<'input'>, 'color'
|
|
|
11
11
|
export interface PlTextFieldProps extends PlassStyleProps, NativeControlProps {
|
|
12
12
|
/** Classes on the parts a `className` does not reach. */
|
|
13
13
|
classNames?: PlassFieldClassNames;
|
|
14
|
+
/**
|
|
15
|
+
* Chords this field answers to, in the vocabulary `PlHotKeys` draws.
|
|
16
|
+
*
|
|
17
|
+
* `{ 'Mod+Enter': save, Escape: cancel }` — the same string a `PlHotKeys`
|
|
18
|
+
* beside the field would print, so the cap and the binding cannot drift. A
|
|
19
|
+
* chord that matches is **consumed**: the handler runs and the key reaches
|
|
20
|
+
* neither the control's own behaviour nor the form around it.
|
|
21
|
+
*/
|
|
22
|
+
hotKeys?: PlassHotKeys;
|
|
14
23
|
/**
|
|
15
24
|
* Drop shadow depth. `0` is the default — a field is a well cut into the
|
|
16
25
|
* sheet, not a key resting on it, and the one place in the library where a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{useDefaults as s}from"../../internal/defaults.js";import{Field as r}from"@base-ui/react/field";import{Input as n}from"@base-ui/react/input";import{Spinner as i}from"../../internal/icons.js";import{hotKeyHandler as a}from"../../internal/keys.js";import{controlHeightClasses as o,controlTextLeadingClasses as c,cx as m,disabledClasses as d,fieldReadOnlyClasses as p,fieldRestClasses as f,focusWithinRingClasses as u,gapClasses as x,hasContent as h,iconClasses as g,metaTextClasses as y,paddingXClasses as $,radiusClasses as b,stackGapClasses as w,surfaceSlots as N,transitionClasses as j}from"../../internal/styles.js";const v={xs:`${x.xs} ${b.xs} ${c.xs}`,sm:`${x.sm} ${b.sm} ${c.sm}`,md:`${x.md} ${b.md} ${c.md}`,lg:`${x.lg} ${b.lg} ${c.lg}`,xl:`${x.xl} ${b.xl} ${c.xl}`},z={xs:"min-h-6 py-[3px]",sm:"min-h-8 py-[6px]",md:"min-h-10 py-[9px]",lg:"min-h-12 py-[11px]",xl:"min-h-14 py-[13px]"},k={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},D=/* @__PURE__ */["group relative flex w-full cursor-text","[-webkit-tap-highlight-color:transparent]",j,u,g].join(" "),K=f,P=p;export const PlTextField=/* @__PURE__ */l.forwardRef(function PlTextField({variant:c="glass",size:p,color:f,density:u,elevation:x=0,multiline:g=!1,rows:b=3,resize:j="vertical",label:R,description:T,error:B,invalid:F,startIcon:I,endIcon:O,loading:C=!1,fullWidth:E=!1,readOnly:L=!1,disabled:W=!1,type:q="text",hotKeys:A,onKeyDown:G,className:H,classNames:J,style:M,...Q},S){const U=s(),V=p??U.size??"md",X=f??U.color??"primary",Y=u??U.density??"default",Z=h(B),_=F??Z,ee=_?"danger":X,te=l.useRef(null),le=l.useCallback(e=>{te.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),se=[D,v[V],g?`${z[V]} items-start`:`${o[V]} items-center`,$[Y][V],W?d[c]:L?P[c]:K[c]].filter(Boolean).join(" "),re=["min-w-0 flex-1 bg-transparent [font:inherit] text-inherit","[outline:none]","placeholder:text-(--plass-muted-fg)","caret-(--p-accent) selection:bg-(--p-soft-press)","disabled:cursor-not-allowed",g?`block ${k[j]}`:"self-stretch"].join(" "),ne="inline-flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg) transition-[color] duration-(--plass-duration) group-focus-within:text-(--p-accent)";return t(r.Root,{disabled:W,invalid:_,className:["flex-col align-top",w[V],E?"flex w-full":"inline-flex",H??""].filter(Boolean).join(" "),style:{...N(ee,x),...M},children:[R?e(r.Label,{className:m(y[V],"font-semibold",W?"text-(--plass-muted-fg)":"text-(--plass-fg)",J?.label),children:R}):null,t("span",{className:m(se,J?.control),onPointerDown:e=>{e.target!==e.currentTarget||W||(e.preventDefault(),te.current?.focus())},children:[I?e("span",{className:ne,children:I}):null,e(n,{ref:le,className:re,disabled:W,readOnly:L,"aria-busy":C||void 0,"data-loading":C||void 0,onKeyDown:a(A,G),...g?{render:e("textarea",{rows:b})}:{type:q},...Q}),C?e("span",{className:ne,children:e(i,{})}):O?e("span",{className:ne,children:O}):null]}),T?e(r.Description,{className:m(y[V],"text-(--plass-muted-fg)",J?.description),children:T}):null,e(r.Error,Z?{match:!0,className:m(y[V],"text-(--p-accent)",J?.error),children:B}:{className:m(y[V],"text-(--p-accent)",J?.error)})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,Fragment as e,jsxs as r}from"react/jsx-runtime";import*as s from"react";import{useRender as i}from"@base-ui/react/use-render";import{ExternalLinkIcon as
|
|
1
|
+
"use client";import{jsx as n,Fragment as e,jsxs as r}from"react/jsx-runtime";import*as s from"react";import{useLabels as l}from"../../internal/labels.js";import{useRender as i}from"@base-ui/react/use-render";import{ExternalLinkIcon as a,LinkIcon as o}from"../../internal/icons.js";import{controlTextLeadingClasses as t,focusRingClasses as c,srOnlyClasses as p}from"../../internal/styles.js";import{safeRel as m}from"../../internal/link.js";const d={always:"[&.plass-link]:underline",hover:"[&.plass-link]:no-underline [&.plass-link]:hover:underline",none:"[&.plass-link]:no-underline"},u=/* @__PURE__ */["plass-link","cursor-pointer","[&_svg]:pointer-events-none [&_svg]:inline [&_svg]:size-[0.95em] [&_svg]:shrink-0",/* @__PURE__ */["[transition-property:color,text-decoration-color]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" "),c,"focus-visible:rounded-[0.25rem]"].join(" ");export const PlTextLink=/* @__PURE__ */s.forwardRef(function PlTextLink({href:c,underline:f="always",color:v,size:h,newTab:k=!1,icon:b,startIcon:j,newTabLabel:x,render:g,className:y,style:w,children:_,...N},T){const L=l(),z=x??L.newTab,C=b??k,P=!0===C?n(k?a:o,{}):C,$=[u,h?t[h]:"",d[f],v?"[&.plass-link]:text-(--p-accent)":"[&.plass-link]:text-inherit",y??""].filter(Boolean).join(" "),B={"--p-underline":"color-mix(in oklab, currentColor 45%, transparent)","--p-underline-hover":"currentColor","--p-ring":`var(--plass-${v??"primary"}-ring)`,...v?{"--p-accent":`var(--plass-${v}-accent)`}:null},E=s.isValidElement(g)&&void 0!==g.props.href,{rel:F,...I}=N,R=m(k?"_blank":void 0,F);return i({render:g??n("a",{}),ref:T,props:{...E?null:{href:c},target:k?"_blank":void 0,className:$,style:{...B,...w},children:r(e,{children:[j?n("span",{className:"me-[0.25em]",children:j}):null,_,P?n("span",{className:"ms-[0.25em]",children:P}):null,k?r(e,{children:[" ",n("span",{className:p,children:z})]}):null]}),...I,rel:R}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as o from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as o from"react";import{useDefaults as l}from"../../internal/defaults.js";import{PlButton as t}from"../button/PlButton.js";import{TimeGrid as s,usePickerLabels as i}from"../../internal/calendar.js";import{ClockIcon as a}from"../../internal/icons.js";import{PickerFooter as r,PickerShell as c}from"../../internal/picker.js";import{displaySamples as d,formatDate as u,isHour12 as m,isValidDate as p,secondsOfDay as h,timeUnitSpan as f,toISOTime as g,withPlaceholder as y,withTime as S}from"../../internal/date.js";import{cx as b}from"../../internal/styles.js";export const PlTimePicker=/* @__PURE__ */o.forwardRef(function PlTimePicker({value:v,defaultValue:j,onValueChange:C,open:w,defaultOpen:z,onOpenChange:k,referenceDate:x,minTime:D,maxTime:O,shouldDisableTime:T,hour12:P,showSeconds:M=!1,hourStep:V=1,minuteStep:B=1,secondStep:I=1,locale:N,format:R,placeholder:F,clearable:H=!1,showNowButton:q=!0,closeOnSelect:A=!1,labels:E,name:G,size:J,color:K,density:L,readOnly:Q=!1,disabled:U=!1,startIcon:W,...X},Y){const Z=l(),$=N??Z.locale,_=J??Z.size??"md",ee=K??Z.color??"primary",ne=L??Z.density??"default",oe=i(E),le=P??m($),[te,se]=o.useState(j??null),ie=void 0!==v?v:te,[ae,re]=o.useState(z??!1),ce=w??ae,[de]=o.useState(()=>x??new Date),setOpen=e=>{e&&(Q||U)||(void 0===w&&re(e),k?.(e))},commit=e=>{void 0===v&&se(e),C?.(e)},ue=o.useCallback((e,n)=>{const[o,l]=f(n,e);return!!(p(D)&&l<h(D))||!!(p(O)&&o>h(O))||(T?.(e,n)??!1)},[D,O,T]),me=o.useMemo(()=>R??{hour:"numeric",minute:"2-digit",...M?{second:"2-digit"}:{}},[R,M]),pe=new Date,he=S(x??de,{hours:pe.getHours(),minutes:pe.getMinutes(),seconds:M?pe.getSeconds():0}),fe=q||H||!A,ge=o.useMemo(()=>y(d($,me),F),[$,me,F]);return e(c,{...X,size:_,color:ee,density:ne,readOnly:Q,disabled:U,triggerRef:Y,startIcon:W??e(a,{}),display:p(ie)?u(ie,$,me):F??"",samples:ge,empty:!p(ie),clearable:H,onClear:()=>commit(null),open:ce,onOpenChange:setOpen,labels:oe,hiddenValues:G?[{name:G,value:p(ie)?g(ie,M):""}]:void 0,children:n("div",{className:b("flex flex-col",fe&&"gap-1.5"),children:[e(s,{size:_,density:ne,locale:$,value:p(ie)?ie:null,referenceDate:x??de,onChange:e=>{commit(e),A&&setOpen(!1)},hour12:le,showSeconds:M,hourStep:V,minuteStep:B,secondStep:I,shouldDisableTime:ue,labels:oe,autoFocus:!0}),fe?n(r,{size:_,children:[H?e(t,{variant:"ghost",size:_,color:ee,density:"compact",onClick:()=>{commit(null),setOpen(!1)},children:oe.clear}):null,q?e(t,{variant:"ghost",size:_,color:ee,density:"compact",disabled:ue(he,"second"),onClick:()=>{commit(he),setOpen(!1)},children:oe.now}):null,A?null:e(t,{variant:"solid",size:_,color:ee,density:"compact",onClick:()=>setOpen(!1),children:oe.done})]}):null]})})});
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import
|
|
3
|
+
import { type PlassStepConnector, type PlassStepStatus } from '../../internal/steps.js';
|
|
4
|
+
import type { PlassColor, PlassDensity, PlassOrientation, PlassResponsive, PlassSize } from '../../types.js';
|
|
4
5
|
/**
|
|
5
|
-
* How far along one item is.
|
|
6
|
-
*
|
|
7
|
-
* Three states rather than two, because "the one you are on" is not the same
|
|
8
|
-
* claim as "done", and a sequence that cannot say which step is current is a
|
|
9
|
-
* list. Each gets its own axis — a filled bullet, a filled bullet with a halo
|
|
10
|
-
* around it, an empty one — rather than three shades of the same thing.
|
|
6
|
+
* How far along one item is. The same three a `PlStepper` draws, from
|
|
7
|
+
* `internal/steps.ts`, because a haloed bullet must not mean two things.
|
|
11
8
|
*/
|
|
12
|
-
export type PlTimelineStatus =
|
|
9
|
+
export type PlTimelineStatus = PlassStepStatus;
|
|
13
10
|
/** How the line between two items is drawn. `none` leaves the gap open. */
|
|
14
|
-
export type PlTimelineConnector =
|
|
11
|
+
export type PlTimelineConnector = PlassStepConnector;
|
|
15
12
|
export interface PlTimelineProps extends Omit<React.ComponentPropsWithoutRef<'ol'>, 'color'> {
|
|
16
13
|
/**
|
|
17
14
|
* How far the sequence has got: the index of the item being worked on now.
|
|
@@ -36,7 +33,7 @@ export interface PlTimelineProps extends Omit<React.ComponentPropsWithoutRef<'ol
|
|
|
36
33
|
* only honest while every label is short.
|
|
37
34
|
* @default 'vertical'
|
|
38
35
|
*/
|
|
39
|
-
orientation?: PlassOrientation
|
|
36
|
+
orientation?: PlassResponsive<PlassOrientation>;
|
|
40
37
|
/** Renders something other than an `<ol>` — Base UI's own escape hatch. */
|
|
41
38
|
render?: useRender.RenderProp;
|
|
42
39
|
children?: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{useDefaults as r}from"../../internal/defaults.js";import{useRender as s}from"@base-ui/react/use-render";import{cx as a,hasContent as n,iconClasses as i,metaTextClasses as o,sheetBodyClasses as c,sheetTitleClasses as p,surfaceSlots as d,transitionClasses as m}from"../../internal/styles.js";import{bulletGapClasses as u,bulletSizeValues as f,bulletStatusClasses as x,connectorColorClasses as b,connectorStyleClasses as v,statusAt as h,titleStatusClasses as y}from"../../internal/steps.js";import{useResponsiveValue as N}from"../../internal/responsive.js";const g=/* @__PURE__ */t.createContext(null),j=/* @__PURE__ */t.createContext({index:0,last:!1}),z={default:{xs:"pb-5",sm:"pb-6",md:"pb-7",lg:"pb-8",xl:"pb-10"},compact:{xs:"pb-3",sm:"pb-3.5",md:"pb-4",lg:"pb-5",xl:"pb-6"}},w={default:{xs:"pe-5",sm:"pe-6",md:"pe-7",lg:"pe-8",xl:"pe-10"},compact:{xs:"pe-3",sm:"pe-3.5",md:"pe-4",lg:"pe-5",xl:"pe-6"}};export const PlTimelineItem=/* @__PURE__ */t.forwardRef(function PlTimelineItem({title:r,meta:s,bullet:N,status:P,color:C,connector:T="solid",className:_,children:I,...R},$){const k=t.useContext(g),{index:A,last:M}=t.useContext(j),q=k?.size??"md",B=k?.density??"default",D=k?.orientation??"vertical",E=C??k?.color??"primary",F=P??h(A,k?.active??null),G="horizontal"===D,H="none"!==T&&!M,J=e("span",{"aria-hidden":"true",className:a("relative z-10 flex shrink-0 items-center justify-center rounded-full","size-(--p-bullet) text-[calc(var(--p-bullet)*0.5)] leading-none font-semibold tabular-nums",x[F],m,i),children:N}),K=H?e("span",{"aria-hidden":"true",className:a("pointer-events-none absolute",G?"top-[calc(var(--p-bullet)/2_-_1px)] end-0 start-(--p-bullet) border-t-2":"top-(--p-bullet) bottom-0 start-[calc(var(--p-bullet)/2_-_1px)] border-s-2",v[T],b[F],m)}):null,L=l("div",{className:a("flex min-w-0 flex-col gap-0.5",G?"mt-2":""),children:[n(r)||n(s)?l("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[n(r)?e("span",{className:a("font-semibold",p[q],y[F],m),children:r}):null,n(s)?e("span",{className:a("text-(--plass-muted-fg)",o[q]),children:s}):null]}):null,n(I)?e("div",{className:a("text-(--plass-muted-fg)",c[q]),children:I}):null]});return l("li",{ref:$,"aria-current":"current"===F?"step":void 0,"data-status":F,className:a("relative",G?a("flex min-w-0 flex-1 flex-col",M?"":w[B][q]):a("flex",u[q],M?"":z[B][q]),_),style:{"--p-bullet":f[q],...d(E,0),"--p-fill":`var(--plass-${E}-fill)`,"--p-on-solid":`var(--plass-${E}-on-solid)`},...R,children:[K,J,L]})});export const PlTimeline=/* @__PURE__ */t.forwardRef(function PlTimeline({active:l,size:n,color:i,density:o,orientation:c,render:p,className:m,style:u,children:f,...x},b){const v=N(c,"vertical"),h=r(),y=n??h.size??"md",z=i??h.color??"primary",w=o??h.density??"default",P=t.Children.toArray(f),C=P.length,T=t.useMemo(()=>({size:y,density:w,orientation:v,color:z,active:l??null}),[y,w,v,z,l]),_=s({render:p??e("ol",{}),ref:b,props:{role:"list",className:a("flex","horizontal"===v?"flex-row":"flex-col",m),style:{...d(z,0),...u},children:P.map((l,t)=>e(j.Provider,{value:{index:t,last:t===C-1},children:l},t)),...x}});return e(g.Provider,{value:T,children:_})});
|