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
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useDefaults as s}from"../../internal/defaults.js";import{useRender as t}from"@base-ui/react/use-render";import{cx as o,radiusClasses as a,sheetPaddingXClasses as i,sheetPaddingYClasses as n,sheetRestClasses as l,surfaceSlots as d,transitionClasses as m}from"../../internal/styles.js";export const PlBox=/* @__PURE__ */r.forwardRef(function PlBox({variant:r="glass",size:c,color:f,density:p,elevation:u=0,padded:y=!0,render:x,className:j,style:v,children:b,...h},z){const B=s(),N=c??B.size??"md",P=f??B.color??"primary",$=p??B.density??"default",g=o("block",a[N],y?`${i[$][N]} ${n[$][N]}`:"",l[r],m,j);return t({render:x??e("div",{}),ref:z,props:{className:g,style:{...d(P,u),...v},children:b,...h}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as a from"react";import{ArrowRightIcon as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as a from"react";import{useDefaults as s}from"../../internal/defaults.js";import{useLabels as n}from"../../internal/labels.js";import{ArrowRightIcon as l,ChevronIcon as i,EllipsisIcon as c}from"../../internal/icons.js";import{controlTextClasses as o,cx as m,focusRingClasses as p,gapClasses as d,hasContent as u,iconClasses as f,radiusClasses as h,transitionClasses as x}from"../../internal/styles.js";const g=/* @__PURE__ */a.createContext({size:"md",last:!1}),b={default:{xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"},compact:{xs:"gap-0.5",sm:"gap-1",md:"gap-1",lg:"gap-1.5",xl:"gap-2"}},y={xs:h.xs,sm:h.xs,md:h.xs,lg:h.sm,xl:h.sm},N=["chevron","arrow","slash","dot"];function textOf(e){return"string"==typeof e||"number"==typeof e?String(e):Array.isArray(e)?e.map(textOf).join(""):a.isValidElement(e)?textOf(e.props.children):""}function absoluteHref(e,t){if(!t)return e;try{return new URL(e,t).href}catch{return e}}function breadcrumbListData(e,t){const r=e.map((e,r)=>{const{href:a,children:s}=e.props;return{"@type":"ListItem",position:r+1,name:textOf(s),...a?{item:absoluteHref(a,t)}:null}});return JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:r}).replace(/</g,"\\u003c")}export const PlBreadcrumb=/* @__PURE__ */a.forwardRef(function PlBreadcrumb({size:r,color:d,density:u,separator:h="chevron",maxItems:y,itemsBeforeCollapse:v=1,itemsAfterCollapse:k=1,expandable:w=!0,label:j,expandLabel:C,structuredData:L=!1,baseUrl:B,className:I,style:z,children:M,...O},P){const S=s(),A=n(),E=j??A.breadcrumb,D=C??A.breadcrumbExpand,H=r??S.size??"md",R=d??S.color??"primary",$=u??S.density??"default",[F,U]=a.useState(!1),V=a.Children.toArray(M).filter(a.isValidElement),_=V.length,J=V.some(e=>!0===e.props.current),T=!F&&void 0!==y&&_>Math.max(y,1)&&_-v-k>1?[...V.slice(0,Math.max(0,v)),null,...V.slice(_-Math.max(0,k))]:V,q=function isSeparatorName(e){return"string"==typeof e&&N.includes(e)}(h)?function separatorMark(t){switch(t){case"chevron":return e("span",{className:"flex -rotate-90 items-center rtl:rotate-90",children:e(i,{})});case"arrow":return e("span",{className:"flex items-center rtl:rotate-180",children:e(l,{})});case"slash":return e("span",{className:"opacity-70",children:"/"});case"dot":return e("span",{className:"opacity-70",children:"·"});default:return null}}(h):h,G=m("inline-flex items-center rounded-(--plass-radius-xs) px-0.5","text-(--plass-muted-fg)",x,f,w?m("cursor-pointer hover:bg-(--p-soft) hover:text-(--p-accent)",p):"");return t("nav",{ref:P,"aria-label":E,className:m("flex",o[H],f,I),style:{"--p-accent":`var(--plass-${R}-accent)`,"--p-soft":`var(--plass-${R}-soft)`,"--p-ring":`var(--plass-${R}-ring)`,...z},...O,children:[L&&_>0?e("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:breadcrumbListData(V,B)}}):null,e("ol",{role:"list",className:m("flex list-none flex-wrap items-center p-0",b[$][H]),children:T.map((r,s)=>t(a.Fragment,{children:[s>0?e("li",{"aria-hidden":"true",className:"flex shrink-0 items-center text-(--plass-muted-fg) select-none",children:q}):null,r?e(g.Provider,{value:{size:H,last:!J&&s===T.length-1},children:r}):e("li",{className:"flex shrink-0 items-center",children:w?e("button",{type:"button",className:G,"aria-label":D,onClick:()=>U(!0),children:e(c,{})}):e("span",{className:G,"aria-hidden":"true",children:e(c,{})})})]},r?r.key??s:"fold"))})]})});export const PlBreadcrumbItem=/* @__PURE__ */a.forwardRef(function PlBreadcrumbItem({href:s,onClick:n,startIcon:l,endIcon:i,current:c,disabled:o=!1,className:f,children:h,...b},N){const{size:v,last:k}=a.useContext(g),w=c??k,j=Boolean(s||n)&&!w&&!o,C=m("inline-flex min-w-0 items-center px-1",d[v],y[v],x,o?"cursor-not-allowed text-(--plass-muted-fg) opacity-50":w?"font-medium text-(--plass-fg)":j?m("cursor-pointer text-(--plass-muted-fg)","hover:bg-(--p-soft) hover:text-(--p-accent)",p):"text-(--plass-muted-fg)"),L=t(r,{children:[u(l)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:l}):null,e("span",{className:"truncate",children:h}),u(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:i}):null]});return e("li",{ref:N,className:m("flex min-w-0 items-center",f),...b,children:j&&s?e("a",{href:s,className:C,onClick:n,children:L}):j?e("button",{type:"button",className:C,onClick:n,children:L}):e("span",{className:C,"aria-current":w?"page":void 0,"aria-disabled":o||void 0,children:L})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as s,Fragment as e,jsxs as o}from"react/jsx-runtime";import*as r from"react";import{
|
|
1
|
+
"use client";import{jsx as s,Fragment as e,jsxs as o}from"react/jsx-runtime";import*as r from"react";import{useDefaults as a}from"../../internal/defaults.js";import{Button as t}from"@base-ui/react/button";import{useRender as l}from"@base-ui/react/use-render";import{ButtonGroupContext as n}from"../../internal/button-group.js";import{Spinner as i}from"../../internal/icons.js";import{controlHeightClasses as p,controlSlots as d,controlSquareClasses as v,controlTextClasses as c,disabledClasses as g,focusRingClasses as m,gapClasses as x,glassClasses as f,hasContent as b,iconClasses as u,paddingXClasses as h,radiusClasses as $,readOnlyFilterClasses as j,transitionClasses as y}from"../../internal/styles.js";const w={xs:`${p.xs} ${x.xs} ${$.xs} ${c.xs}`,sm:`${p.sm} ${x.sm} ${$.sm} ${c.sm}`,md:`${p.md} ${x.md} ${$.md} ${c.md}`,lg:`${p.lg} ${x.lg} ${$.lg} ${c.lg}`,xl:`${p.xl} ${x.xl} ${$.xl} ${c.xl}`},P={xs:`${v.xs} px-0`,sm:`${v.sm} px-0`,md:`${v.md} px-0`,lg:`${v.lg} px-0`,xl:`${v.xl} px-0`},k=/* @__PURE__ */["relative inline-flex shrink-0 select-none items-center justify-center","whitespace-nowrap align-middle font-semibold leading-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",y,m,u].join(" "),B={solid:/* @__PURE__ */["text-(--p-on-solid) [background-image:var(--p-fill)]","[box-shadow:var(--p-elev),var(--p-lift)]"].join(" "),glass:/* @__PURE__ */[f,"border text-(--p-accent) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--p-accent) bg-transparent"},z={solid:/* @__PURE__ */["hover:brightness-105","hover:[box-shadow:var(--p-elev-hover),var(--p-lift-hover)]","active:brightness-95","active:[box-shadow:var(--p-elev-press),var(--p-lift-press)]"].join(" "),glass:/* @__PURE__ */["hover:bg-(--plass-glass-hover) hover:[border-color:var(--p-line)]","hover:[box-shadow:var(--p-elev-hover),var(--plass-gloss-glass)]","active:bg-(--plass-glass-press)","active:[box-shadow:var(--p-elev-press),var(--plass-gloss-glass)]"].join(" "),ghost:"hover:bg-(--p-soft) active:bg-(--p-soft-hover)"},C={solid:/* @__PURE__ */["cursor-default text-(--p-on-solid) [background-image:var(--p-fill)]",`shadow-none ${j}`].join(" "),glass:/* @__PURE__ */[f,"cursor-default border text-(--p-accent) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]",`[box-shadow:var(--plass-gloss-glass)] ${j}`].join(" "),ghost:`cursor-default text-(--p-accent) bg-transparent ${j}`};export const PlButton=/* @__PURE__ */r.forwardRef(function PlButton({variant:p,size:v,color:c,density:m,elevation:x,startIcon:f,endIcon:u,loading:$=!1,readOnly:j=!1,fullWidth:y=!1,disabled:E,render:I,className:M,style:N,children:D,onClick:F,onPointerMove:O,...R},T){const W=a(),X=r.useContext(n),Y=p??X?.variant??"solid",q=v??X?.size??W.size??"md",A=c??X?.color??W.color??"primary",G=m??X?.density??W.density??"default",H=x??X?.elevation??1,J=E??X?.disabled??!1,K=!b(D),L=$||j,Q=!J&&!L,S=[k,w[q],K?P[q]:h[G][q],J?g[Y]:j?C[Y]:B[Y],Q?`${z[Y]} cursor-pointer`:"",Q?"plass-glow":"",$?"cursor-progress":"",y?"w-full":"",M??""].filter(Boolean).join(" ");return l({render:I??s(t,{disabled:J}),ref:T,props:{className:S,style:{...d(A,H,Y),...N},"aria-disabled":L||void 0,"aria-busy":$||void 0,"data-loading":$||void 0,"data-readonly":j||void 0,onClick:s=>{if(L)return s.preventDefault(),void s.stopPropagation();F?.(s)},onPointerMove:s=>{const e=s.currentTarget;e.style.setProperty("--p-mx",`${s.nativeEvent.offsetX}px`),e.style.setProperty("--p-my",`${s.nativeEvent.offsetY}px`),O?.(s)},...R,children:o(e,{children:[$?s(i,{}):f,D,u]})}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{ButtonGroupContext as o,groupBaseClasses as t,groupJoinClasses as l,groupOverlapClasses as i}from"../../internal/button-group.js";import{cx as n}from"../../internal/styles.js";export const PlButtonGroup=/* @__PURE__ */r.forwardRef(function PlButtonGroup({variant:s,size:a,color:c,density:u,elevation:d,orientation:f="horizontal",disabled:m,fullWidth:p=!1,className:v,children:x,...h},j){const b=r.useMemo(()=>({variant:s,size:a,color:c,density:u,elevation:d,disabled:m}),[s,a,c,u,d,m]);return e(o.Provider,{value:b,children:e("div",{ref:j,role:"group",className:n(t,"vertical"===f?"flex-col":"flex-row",l[f],"glass"===(s??"solid")?i[f]:"",p?"flex w-full [&>*]:flex-1":"",v),...h,children:x})})});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type PlassPickerLabels } from '../../internal/calendar.js';
|
|
3
|
+
import type { PlassColor, PlassElevation, PlassSize, PlassVariant, PlassWeekday } from '../../types.js';
|
|
4
|
+
/** The smallest unit the calendar hands back. The same three a picker takes. */
|
|
5
|
+
export type PlCalendarPrecision = 'day' | 'month' | 'year';
|
|
6
|
+
export interface PlCalendarProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onSelect'> {
|
|
7
|
+
/**
|
|
8
|
+
* What the surface is made of.
|
|
9
|
+
*
|
|
10
|
+
* `ghost` is the one to reach for when the calendar is already inside
|
|
11
|
+
* something that draws a sheet — a `PlCard`, a `PlPopover` — because a second
|
|
12
|
+
* bordered rectangle inside the first is a second rectangle.
|
|
13
|
+
* @default 'glass'
|
|
14
|
+
*/
|
|
15
|
+
variant?: PlassVariant;
|
|
16
|
+
/** @default 'md' */
|
|
17
|
+
size?: PlassSize;
|
|
18
|
+
/** @default 'primary' */
|
|
19
|
+
color?: PlassColor;
|
|
20
|
+
/** @default 1 */
|
|
21
|
+
elevation?: PlassElevation;
|
|
22
|
+
/** The chosen day. Use with `onValueChange` for a controlled calendar. */
|
|
23
|
+
value?: Date | null;
|
|
24
|
+
/** The day it starts on, for an uncontrolled one. */
|
|
25
|
+
defaultValue?: Date | null;
|
|
26
|
+
onValueChange?: (value: Date | null) => void;
|
|
27
|
+
/**
|
|
28
|
+
* The smallest unit this calendar hands back, and a **floor** rather than a
|
|
29
|
+
* starting view: at `month` the month grid is the last grid and pressing a
|
|
30
|
+
* cell in it answers, so there is no day grid under it at all. A card's
|
|
31
|
+
* expiry is a month, and a control that made somebody answer *which day of
|
|
32
|
+
* December 2027* is one that will be answered wrongly.
|
|
33
|
+
*
|
|
34
|
+
* The value is normalised to the start of what was chosen — the 1st of the
|
|
35
|
+
* month, the 1st of January — never whichever day the cursor was resting on.
|
|
36
|
+
* @default 'day'
|
|
37
|
+
*/
|
|
38
|
+
precision?: PlCalendarPrecision;
|
|
39
|
+
/** The month on screen. Use with `onMonthChange` to control it. */
|
|
40
|
+
month?: Date;
|
|
41
|
+
/** The month it opens on, for an uncontrolled one. Defaults to the value's. */
|
|
42
|
+
defaultMonth?: Date;
|
|
43
|
+
onMonthChange?: (month: Date) => void;
|
|
44
|
+
/** Nothing before this day can be chosen. Read at the calendar's `precision`. */
|
|
45
|
+
minDate?: Date | null;
|
|
46
|
+
/** Nothing after it can be chosen. Read at the calendar's `precision`. */
|
|
47
|
+
maxDate?: Date | null;
|
|
48
|
+
/**
|
|
49
|
+
* Blocks individual days — weekends, holidays, a booked date. Day-granular,
|
|
50
|
+
* so a `month` or `year` calendar never consults it.
|
|
51
|
+
*/
|
|
52
|
+
shouldDisableDate?: (date: Date) => boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The BCP 47 tag the month names, the weekday initials and the first day of
|
|
55
|
+
* the week come from. The page's own locale by default.
|
|
56
|
+
*/
|
|
57
|
+
locale?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Which day the week starts on, as `Date` counts them — Sunday is `0`.
|
|
60
|
+
* Worked out from `locale` when it is not given.
|
|
61
|
+
*/
|
|
62
|
+
weekStartsOn?: PlassWeekday;
|
|
63
|
+
/**
|
|
64
|
+
* Draws the leading and trailing days belonging to the neighbouring months.
|
|
65
|
+
* @default true
|
|
66
|
+
*/
|
|
67
|
+
showOutsideDays?: boolean;
|
|
68
|
+
/** Takes the focus on mount. Off, because a calendar in a page is not a popup. */
|
|
69
|
+
autoFocus?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Greys the whole calendar out and takes it out of the tab order.
|
|
72
|
+
*
|
|
73
|
+
* There is no `readOnly` beside it, and that is not an omission: a read-only
|
|
74
|
+
* field still shows a value a reader can select and copy, and a calendar has
|
|
75
|
+
* nothing to copy — a grid whose every cell is inert *is* the disabled one.
|
|
76
|
+
* To block some days rather than all of them, use `shouldDisableDate`.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Submits the value with a form, under this name. The spelling follows
|
|
82
|
+
* `precision`: `YYYY-MM-DD`, then `YYYY-MM` and `YYYY`, which is what the
|
|
83
|
+
* native inputs of the same shape submit.
|
|
84
|
+
*/
|
|
85
|
+
name?: string;
|
|
86
|
+
/** The strings `Intl` has no opinion about — the buttons and the headings. */
|
|
87
|
+
labels?: Partial<PlassPickerLabels>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* A month, on the page rather than in a popup.
|
|
91
|
+
*
|
|
92
|
+
* It is the same grid a `PlDatePicker` opens — the three views, the roving tab
|
|
93
|
+
* stop, the arrow keys that step the month when they run off an edge — with the
|
|
94
|
+
* trigger and the popup taken away. That is the whole difference and it is the
|
|
95
|
+
* reason to have both: a picker is a field that happens to open a calendar, and
|
|
96
|
+
* this is a calendar that is not standing in for a field. A booking page, a
|
|
97
|
+
* dashboard's date rail and an availability view all want the grid *visible*,
|
|
98
|
+
* and none of them wants a text box above it.
|
|
99
|
+
*
|
|
100
|
+
* Because it is not a field it has no label, no description and no error line —
|
|
101
|
+
* put it in a `PlFieldset` if it needs one. What it does keep is `name`, so a
|
|
102
|
+
* plain form can submit what it holds.
|
|
103
|
+
*/
|
|
104
|
+
export declare const PlCalendar: React.ForwardRefExoticComponent<PlCalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{useDefaults as o}from"../../internal/defaults.js";import{Calendar as l,usePickerLabels as n}from"../../internal/calendar.js";import{popupPaddingClasses as s}from"../../internal/picker.js";import{isValidDate as r,localeWeekStart as i,mergeDateAndTime as m,startOfDay as c,startOfMonth as d,today as u,toISODate as f,toISOMonth as h,toISOYear as p}from"../../internal/date.js";import{controlTextLeadingClasses as y,cx as D,disabledClasses as v,radiusClasses as j,sheetRestClasses as x,surfaceSlots as w}from"../../internal/styles.js";const S={day:f,month:h,year:p};export const PlCalendar=/* @__PURE__ */t.forwardRef(function PlCalendar({variant:f="glass",size:h,color:p,elevation:b=1,value:C,defaultValue:O,onValueChange:g,precision:k="day",month:z,defaultMonth:M,onMonthChange:F,minDate:N,maxDate:P,shouldDisableDate:V,locale:R,weekStartsOn:q,showOutsideDays:A=!0,autoFocus:B=!1,disabled:E=!1,name:G,labels:H,className:I,style:J,...K},L){const Q=o(),T=R??Q.locale,U=h??Q.size??"md",W=p??Q.color??"primary",X=n(H),Y=q??Q.weekStartsOn??i(T),[Z,$]=t.useState(O??null),_=void 0!==C?C:Z,[ee,ae]=t.useState(()=>d(r(_)?_:M??u())),te=z??ee,setMonth=e=>{void 0===z&&ae(e),F?.(e)};return a("div",{ref:L,inert:E||void 0,className:D("inline-flex flex-col",x[f],j[U],s[U],y[U],E?v[f]:"",I),style:{...w(W,b),...J},...K,children:[e(l,{size:U,color:W,locale:T,weekStartsOn:Y,month:te,onMonthChange:setMonth,precision:k,selected:[_],onSelect:e=>{const a=r(_)?m(e,_):c(e);void 0===C&&$(a),g?.(a),setMonth(d(a))},minDate:N,maxDate:P,shouldDisableDate:V,showOutsideDays:A,autoFocus:B,labels:X}),G?e("input",{type:"hidden",name:G,value:r(_)?S[k](_):""}):null]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlCalendar}from"./PlCalendar.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s,Fragment as r}from"react/jsx-runtime";import*as a from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as s,Fragment as r}from"react/jsx-runtime";import*as a from"react";import{useDefaults as l}from"../../internal/defaults.js";import{useRender as o}from"@base-ui/react/use-render";import{focusRingClasses as t,hasContent as n,metaTextClasses as i,radiusClasses as c,sheetBodyClasses as d,sheetHeaderGapClasses as v,sheetLineClasses as p,sheetPaddingXClasses as m,sheetPaddingYClasses as f,sheetRestClasses as h,sheetSectionGapClasses as u,sheetTitleClasses as g,surfaceSlots as x}from"../../internal/styles.js";const y=/* @__PURE__ */["[transition-property:background-color,border-color,box-shadow,color,transform]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]"].join(" "),b={solid:/* @__PURE__ */["cursor-pointer hover:-translate-y-0.5","hover:[box-shadow:var(--p-elev-hover),var(--plass-gloss-glass)]","active:translate-y-0 active:[box-shadow:var(--p-elev-press),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */["cursor-pointer hover:-translate-y-0.5 hover:bg-(--plass-glass-hover)","hover:[border-color:var(--p-line)]","hover:[box-shadow:var(--p-elev-hover),var(--plass-gloss-glass)]","active:translate-y-0 active:[box-shadow:var(--p-elev-press),var(--plass-gloss-glass)]"].join(" "),ghost:"cursor-pointer hover:bg-(--p-soft) active:bg-(--p-soft-hover)"};export const PlCard=/* @__PURE__ */a.forwardRef(function PlCard({variant:a="glass",size:N,color:j,density:$,elevation:w=1,title:k,subtitle:z,headerAction:B,footer:C,dividers:P=!1,padded:A=!0,interactive:F=!1,render:R,className:q,style:D,children:E,...G},H){const I=l(),J=N??I.size??"md",K=j??I.color??"primary",L=$??I.density??"default",M=A?m[L][J]:"",O=A?f[L][J]:"",Q=P?`${M} ${O}`:M,S=n(k)||n(z)||n(B),T=s(r,{children:[n(k)||n(z)?s("div",{className:`flex min-w-0 flex-1 flex-col ${v[J]}`,children:[n(k)?e("div",{className:`plass-title font-semibold ${g[J]}`,children:k}):null,n(z)?e("div",{className:`text-(--plass-muted-fg) ${i[J]}`,children:z}):null]}):null,n(B)?e("div",{className:"ms-auto shrink-0",children:B}):null]}),U=[S?{key:"header",className:"flex items-start gap-3",content:T}:null,n(E)?{key:"content",className:d[J],content:E}:null,n(C)?{key:"footer",className:`flex flex-wrap items-center gap-2 ${d[J]}`,content:C}:null].filter(e=>null!==e),V=["flex flex-col",c[J],h[a],y,F?`${b[a]} ${t}`:"",P?"overflow-hidden":`${O} ${u[J]}`,q??""].filter(Boolean).join(" ");return o({render:R??e("div",{}),ref:H,props:{className:V,style:{...x(K,w),...D},...G,children:U.map((s,r)=>e("div",{className:[Q,s.className,P&&r>0?p:""].filter(Boolean).join(" "),children:s.content},s.key))}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{useDefaults as a}from"../../internal/defaults.js";import{useLabels as n}from"../../internal/labels.js";import{PlIconButton as s}from"../icon-button/PlIconButton.js";import{ChevronIcon as l}from"../../internal/icons.js";import{cx as o,radiusClasses as i,sheetRestClasses as c,srOnlyClasses as u,surfaceSlots as d,transitionClasses as f}from"../../internal/styles.js";const m={xs:"start-1 end-1",sm:"start-1.5 end-1.5",md:"start-2 end-2",lg:"start-3 end-3",xl:"start-4 end-4"},p={xs:{rest:"h-1 w-1",current:"h-1 w-3",gap:"gap-1"},sm:{rest:"h-1 w-1",current:"h-1 w-3.5",gap:"gap-1"},md:{rest:"h-1.5 w-1.5",current:"h-1.5 w-4",gap:"gap-1.5"},lg:{rest:"h-1.5 w-1.5",current:"h-1.5 w-5",gap:"gap-2"},xl:{rest:"h-2 w-2",current:"h-2 w-6",gap:"gap-2"}};export const PlCarousel=/* @__PURE__ */t.forwardRef(function PlCarousel({variant:h="glass",size:v,color:b,density:w,elevation:g=0,value:x,defaultValue:y=0,onValueChange:N,loop:j=!0,autoPlay:k=!1,interval:C=5e3,arrows:M=!0,indicators:P=!0,label:R,previousLabel:I,nextLabel:L,slideLabel:z,className:S,style:$,children:_,...E},V){const B=a(),T=n(),W=R??T.carousel,A=I??T.carouselPrevious,F=L??T.carouselNext,q=v??B.size??"md",D=b??B.color??"primary",G=w??B.density??"default",H=z??((e,r)=>`Slide ${e} of ${r}`),J=t.Children.toArray(_),K=J.length,[O,Q]=t.useState(y),U=Math.min(Math.max(x??O,0),Math.max(K-1,0)),X=t.useRef(null),Y=t.useRef([]),Z=t.useRef(!1),ee=t.useRef(!1),re=t.useRef(!1),[te,ae]=t.useState(!1),ne=t.useCallback((e,r=!1)=>{if(0===K)return;const t=j?(e%K+K)%K:Math.min(Math.max(e,0),K-1);Z.current=r,void 0===x&&Q(t),t!==U&&N?.(t)},[K,j,x,U,N]);t.useEffect(()=>{if(Z.current)return void(Z.current=!1);if(!ee.current)return void(ee.current=!0);Y.current[U]?.scrollIntoView({block:"nearest",inline:"start"}),re.current=!0;const e=window.setTimeout(()=>{re.current=!1},700);return()=>window.clearTimeout(e)},[U]),t.useEffect(()=>{if(!k||te||K<2)return;if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;const e=window.setInterval(()=>{document.hidden||ne(U+1)},C);return()=>window.clearInterval(e)},[k,te,K,C,U,ne]);const se=U<=0,le=U>=K-1;return r("div",{ref:V,role:"region","aria-roledescription":"carousel","aria-label":W,className:o("flex flex-col",S),style:{...d(D,g),...$},onPointerEnter:()=>ae(!0),onPointerLeave:()=>ae(!1),onFocus:()=>ae(!0),onBlur:()=>ae(!1),...E,children:[r("div",{className:o("relative min-w-0 overflow-hidden",i[q],c[h],f),children:[e("div",{ref:X,tabIndex:0,role:"group","aria-label":W,className:o("flex min-w-0 snap-x snap-mandatory overflow-x-auto scroll-smooth","motion-reduce:scroll-auto","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]"),onScroll:()=>{const e=X.current;if(re.current||!e||0===e.clientWidth)return;const r=Math.round(Math.abs(e.scrollLeft)/e.clientWidth);r!==U&&r>=0&&r<K&&ne(r,!0)},children:J.map((r,t)=>e("div",{ref:e=>{Y.current[t]=e},role:"group","aria-roledescription":"slide","aria-label":H(t+1,K),className:"w-full shrink-0 grow-0 basis-full snap-start",children:r},t))}),M&&K>1?r("div",{className:o("pointer-events-none absolute inset-y-0 flex items-center",m[q]),children:[e(s,{variant:"glass",size:q,color:D,density:G,elevation:1,label:A,disabled:!j&&se,className:"pointer-events-auto",icon:e("span",{className:"flex rotate-90 items-center rtl:-rotate-90",children:e(l,{})}),onClick:()=>ne(U-1)}),e("span",{className:"flex-1"}),e(s,{variant:"glass",size:q,color:D,density:G,elevation:1,label:F,disabled:!j&&le,className:"pointer-events-auto",icon:e("span",{className:"flex -rotate-90 items-center rtl:rotate-90",children:e(l,{})}),onClick:()=>ne(U+1)})]}):null]}),P&&K>1?e("div",{className:o("flex shrink-0 items-center justify-center pt-2",p[q].gap),children:J.map((r,t)=>e("button",{type:"button","aria-label":H(t+1,K),"aria-current":t===U?"true":void 0,className:o("cursor-pointer rounded-full","[transition-property:width,background-color]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-2",t===U?`${p[q].current} bg-(--p-accent)`:`${p[q].rest} bg-(--plass-border) hover:bg-(--p-accent)`),onClick:()=>ne(t)},t))}):null,e("span",{className:u,"aria-live":k?"off":"polite",children:K>0?H(U+1,K):""})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as s from"react";import{CheckIcon as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as s from"react";import{useDefaults as r}from"../../internal/defaults.js";import{useLabels as a}from"../../internal/labels.js";import{CheckIcon as n,ClockIcon as i,LinkIcon as t,severityIcon as o}from"../../internal/icons.js";import{controlSlots as d,focusRingClasses as c,glassClasses as p,hasContent as m,metaTextClasses as u,radiusClasses as f,sheetBodyClasses as v,sheetHeaderGapClasses as g,srOnlyClasses as x,transitionClasses as h}from"../../internal/styles.js";const b={default:{xs:"px-2 py-1",sm:"px-2.5 py-1.5",md:"px-3 py-2",lg:"px-3.5 py-2.5",xl:"px-4 py-3"},compact:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-1.5",xl:"px-3.5 py-2"}},y={start:"[border-start-start-radius:0.25rem]",end:"[border-start-end-radius:0.25rem]"},k={solid:/* @__PURE__ */["text-(--p-on-solid) [background-image:var(--p-fill)]","[box-shadow:var(--p-elev),var(--p-lift)]"].join(" "),glass:/* @__PURE__ */[p,"border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--plass-fg) bg-(--p-soft) [box-shadow:var(--p-elev)]"};function DoubleCheckIcon(){return l("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e("path",{d:"m1.5 8.5 2.75 2.75L9.5 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M7 10.75 8.25 12l5.25-5.25",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}const w={sending:e(i,{}),sent:e(n,{}),delivered:e(DoubleCheckIcon,{}),read:e(DoubleCheckIcon,{}),failed:/* @__PURE__ */o("danger")},N={sending:"Sending",sent:"Sent",delivered:"Delivered",read:"Read",failed:"Not delivered"},j={sending:"text-(--plass-muted-fg)",sent:"text-(--plass-muted-fg)",delivered:"text-(--plass-muted-fg)",read:"text-(--p-accent)",failed:"text-(--plass-danger-accent)"},_=/* @__PURE__ */["block overflow-hidden rounded-(--plass-radius-sm) border no-underline","[border-color:color-mix(in_oklab,currentColor_18%,transparent)]","[background-color:color-mix(in_oklab,currentColor_7%,transparent)]","hover:[background-color:color-mix(in_oklab,currentColor_12%,transparent)]","[transition-property:background-color] [transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]",c].join(" "),C=/* @__PURE__ */["shrink-0 opacity-0","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","group-hover/bubble:opacity-100 group-focus-within/bubble:opacity-100","[@media(hover:none)]:opacity-100"].join(" ");export const PlChatBubble=/* @__PURE__ */s.forwardRef(function PlChatBubble({side:s="start",name:n,time:i,avatar:t,status:o,statusLabel:c,typing:p=!1,typingLabel:_,media:L,preview:D,actions:z,variant:B="glass",size:P,color:I,density:T,elevation:R=0,className:S,style:W,children:M,...$},q){const A=r(),E=a(),F=_??E.typing,G=P??A.size??"md",H=I??A.color??"primary",J=T??A.density??"default",K="end"===s,O=m(n)||m(i),Q=p||m(M)||Boolean(D),U=["flex min-w-0 flex-col overflow-hidden",f[G],y[s],k[B],h].join(" ");return l("div",{ref:q,className:["group/bubble flex w-full items-start gap-2",K?"flex-row-reverse":"",S??""].filter(Boolean).join(" "),style:{...d(H,R,B),...W},...$,children:[m(t)?e("div",{className:"shrink-0",children:t}):null,l("div",{className:["flex max-w-[min(100%,32rem)] min-w-0 flex-col",g[G],K?"items-end":"items-start"].join(" "),children:[O?l("div",{className:`flex items-baseline gap-2 ${u[G]}`,children:[m(n)?e("span",{className:"font-semibold",children:n}):null,m(i)?e("span",{className:"text-(--plass-muted-fg)",children:i}):null]}):null,l("div",{className:"flex min-w-0 items-center gap-1 "+(K?"flex-row-reverse":""),children:[l("div",{className:U,children:[m(L)?e("div",{className:"[&_img]:block [&_img]:w-full [&_video]:block [&_video]:w-full",children:L}):null,Q?l("div",{className:[b[J][G],"flex min-w-0 flex-col gap-2",v[G]].join(" "),children:[p?e(TypingDots,{label:F}):m(M)?e("div",{className:"min-w-0 break-words whitespace-pre-line",children:M}):null,D?e(LinkPreview,{preview:D}):null]}):null]}),m(z)?e("div",{className:C,children:z}):null]}),o?l("div",{className:["flex items-center gap-1",u[G],j[o],"[&_svg]:size-[1.15em] [&_svg]:shrink-0"].join(" "),children:[w[o],e("span",{className:x,children:c??N[o]})]}):null]})]})});function TypingDots({label:s}){return l("div",{className:"flex items-center gap-1 py-[0.35em]",role:"status",children:[[0,1,2].map(l=>e("span",{"aria-hidden":"true",className:"plass-typing-dot size-[0.45em] rounded-full",style:{"--p-i":l}},l)),e("span",{className:x,children:s})]})}function LinkPreview({preview:s}){const{url:r,title:a,description:n,image:i,site:o,newTab:d=!1}=s;return l("a",{href:r,target:d?"_blank":void 0,rel:d?"noopener noreferrer":void 0,className:_,children:[i?e("img",{src:i,alt:"",className:"block h-28 w-full object-cover"}):null,l("div",{className:"flex flex-col gap-0.5 p-2",children:[m(o)?l("span",{className:"flex items-center gap-1 text-[0.85em] opacity-70 [&_svg]:size-[1em] [&_svg]:shrink-0",children:[e(t,{}),e("span",{className:"truncate",children:o})]}):null,m(a)?e("span",{className:"font-semibold",children:a}):null,m(n)?e("span",{className:"line-clamp-2 text-[0.9em] opacity-80",children:n}):null]})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{useDefaults as t}from"../../internal/defaults.js";import{Checkbox as s}from"@base-ui/react/checkbox";import{Field as o}from"@base-ui/react/field";import{controlSlots as n,cx as i,focusRingClasses as l,glassClasses as c,hasContent as d,metaTextClasses as h,tickRadiusClasses as p,tickRowTextClasses as m,tickSizeClasses as u,transitionClasses as f}from"../../internal/styles.js";const k=/* @__PURE__ */["relative inline-flex shrink-0 items-center justify-center border","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",f,l].join(" "),b=/* @__PURE__ */[c,"cursor-pointer bg-(--plass-glass) [border-color:var(--plass-border)]","hover:bg-(--plass-glass-hover) hover:[border-color:var(--p-line)]","data-[checked]:[background-image:var(--p-fill)] data-[checked]:text-(--p-on-solid)","data-[checked]:[border-color:transparent] data-[checked]:hover:brightness-105","data-[indeterminate]:[background-image:var(--p-fill)] data-[indeterminate]:text-(--p-on-solid)","data-[indeterminate]:[border-color:transparent]"].join(" "),g=/* @__PURE__ */[c,"cursor-default bg-(--plass-glass) [border-color:var(--plass-border)]","saturate-[0.55]","data-[checked]:[background-image:var(--p-fill)] data-[checked]:text-(--p-on-solid)","data-[checked]:[border-color:transparent]"].join(" "),x=/* @__PURE__ */[c,"cursor-not-allowed bg-(--plass-glass) [border-color:var(--plass-border)]","opacity-50 saturate-[0.35]","data-[checked]:[background-image:var(--p-fill)] data-[checked]:text-(--p-on-solid)","data-[checked]:[border-color:transparent]","data-[indeterminate]:[background-image:var(--p-fill)] data-[indeterminate]:text-(--p-on-solid)"].join(" "),v=/* @__PURE__ */["flex size-[70%] items-center justify-center","[&_path]:[stroke-dasharray:1] [&_path]:[stroke-dashoffset:0]","[&_path]:[transition:stroke-dashoffset_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[&_path]:[transition-duration:0ms]","data-[unchecked]:[&_path]:[stroke-dashoffset:1]"].join(" ");function CheckMark(){return e("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"size-full",children:e("path",{d:"M2 6.2 4.6 8.8 10 3.4",pathLength:1,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function DashMark(){return e("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"size-full",children:e("path",{d:"M2.5 6h7",pathLength:1,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}export const PlCheckbox=/* @__PURE__ */r.forwardRef(function PlCheckbox({size:r,color:l,label:c,description:f,error:j,invalid:N,disabled:y=!1,readOnly:C=!1,className:M,classNames:_,style:w,...L},z){const B=t(),D=r??B.size??"md",R=l??B.color??"primary",O=d(j),P=N??O,W=P?"danger":R,E=i(k,u[D],p[D],y?x:C?g:b,_?.control);return a(o.Root,{disabled:y,invalid:P,className:["inline-flex flex-col gap-1 align-top",M??""].filter(Boolean).join(" "),style:{...n(W,0,"solid"),...w},children:[a("div",{className:`flex items-start gap-2 ${m[D]}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(s.Root,{ref:z,className:E,disabled:y,readOnly:C,...L,children:e(s.Indicator,{keepMounted:!0,className:v,children:L.indeterminate?e(DashMark,{}):e(CheckMark,{})})})}),c||f?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[c?e(o.Label,{className:i(y?"text-(--plass-muted-fg)":"cursor-pointer text-(--plass-fg)",_?.label),children:c}):null,f?e(o.Description,{className:i(h[D],"text-(--plass-muted-fg)",_?.description),children:f}):null]}):null]}),e(o.Error,O?{match:!0,className:i(h[D],"text-(--p-accent)",_?.error),children:j}:{className:i(h[D],"text-(--p-accent)",_?.error)})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as s,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{
|
|
1
|
+
"use client";import{jsx as e,Fragment as s,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{useDefaults as o}from"../../internal/defaults.js";import{useLabels as n}from"../../internal/labels.js";import{CloseIcon as a}from"../../internal/icons.js";import{chipRemoveClasses as r,controlHeightClasses as i,controlSlots as p,controlTextClasses as c,disabledClasses as d,focusRingClasses as m,gapClasses as g,glassClasses as b,hasContent as h,iconClasses as f,paddingXClasses as u,radiusClasses as v,transitionClasses as x}from"../../internal/styles.js";const j={xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"lg"},w={solid:"text-(--p-on-solid) [background-image:var(--p-fill)] [box-shadow:var(--p-elev)]",glass:/* @__PURE__ */[b,"border text-(--p-accent) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--p-accent) bg-(--p-soft)"},y={solid:"[box-shadow:var(--p-elev),var(--p-lift)]",glass:"bg-(--plass-glass-press) [border-color:var(--p-line-hover)]",ghost:"bg-(--p-soft-press)"},k={solid:"hover:brightness-105 active:brightness-95",glass:"hover:bg-(--plass-glass-hover) hover:[border-color:var(--p-line)] active:bg-(--plass-glass-press)",ghost:"hover:bg-(--p-soft-hover) active:bg-(--p-soft-press)"},N=/* @__PURE__ */["relative inline-flex max-w-full shrink-0 items-center select-none","align-middle leading-none font-medium whitespace-nowrap","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",x,f].join(" "),C=/* @__PURE__ */["flex min-w-0 flex-1 cursor-pointer items-center justify-center self-stretch rounded-[inherit]",m].join(" ");export const PlChip=/* @__PURE__ */t.forwardRef(function PlChip({variant:t="glass",size:m,color:b,density:f,elevation:x=0,startIcon:$,endIcon:z,count:B,onDelete:I,deleteLabel:P,selected:D=!1,disabled:F=!1,className:L,style:R,children:q,onClick:A,...E},G){const H=o(),J=n(),K=P??J.remove,M=m??H.size??"md",O=b??H.color??"primary",Q=f??H.density??"default",S=Boolean(A)&&!F,T=j[M],U=u[Q][T],V=[N,i[T],c[T],g[T],v[T],F?d[t]:w[t],!F&&D?y[t]:"",S?k[t]:"",S?"ps-0":U,I?"pe-1":S?"pe-0":"",L??""].filter(Boolean).join(" "),W=l(s,{children:[$,h(q)?e("span",{className:"min-w-0 truncate",children:q}):null,z,h(B)?e("span",{className:["ms-0.5 inline-flex shrink-0 items-center justify-center rounded-full px-1.5 py-px","text-[0.85em] leading-none font-semibold tabular-nums","solid"===t?"bg-(--plass-glow-on-fill) text-(--p-on-solid)":"bg-(--p-soft-press) text-(--p-accent)"].join(" "),children:B}):null]});return l("span",{ref:G,className:V,style:{...p(O,x,t),...R},"aria-disabled":!(!F||S)||void 0,...E,children:[S?e("button",{type:"button","aria-pressed":D,className:`${C} ${g[T]} ${U}`,onClick:A,children:W}):W,I?e("button",{type:"button","aria-label":K,disabled:F,className:r,onClick:I,children:e(a,{})}):null]})});
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PlassColor, PlassDensity, PlassElevation, PlassSize } from '../../types.js';
|
|
3
|
+
export { registerLanguage } from '../../internal/highlight.js';
|
|
4
|
+
export type { PlCodeLine, PlCodeToken } from '../../internal/highlight.js';
|
|
5
|
+
/**
|
|
6
|
+
* Which palette the block wears.
|
|
7
|
+
*
|
|
8
|
+
* The four house themes come first. `dark` is the default and it is the one
|
|
9
|
+
* that is not a preference: code has been read on a dark ground since
|
|
10
|
+
* terminals, and a block that matched the page would be the one element on it
|
|
11
|
+
* whose colours were chosen by something other than the code. `auto` is the
|
|
12
|
+
* opt-out, and `mono` has no hue in it at all.
|
|
13
|
+
*
|
|
14
|
+
* The eight after them are ports, kept at their published values. They exist
|
|
15
|
+
* because a code block is the one component whose colours a reader already has
|
|
16
|
+
* an opinion about: someone who writes in One Dark all day reads a Dracula
|
|
17
|
+
* block as a different product's documentation.
|
|
18
|
+
*
|
|
19
|
+
* The type is open on purpose. A theme is a set of `--p-code-*` custom
|
|
20
|
+
* properties under a `[data-code-theme]` selector and nothing else, so a
|
|
21
|
+
* consumer who writes one in their own stylesheet has a theme — with nothing to
|
|
22
|
+
* register, nothing to import, and no cost to anybody who did not.
|
|
23
|
+
*/
|
|
24
|
+
export type PlCodeBlockTheme = 'dark' | 'light' | 'auto' | 'mono' | 'one-dark' | 'dracula' | 'monokai' | 'nord' | 'night-owl' | 'gruvbox' | 'github' | 'solarized-light';
|
|
25
|
+
export interface PlCodeBlockProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title' | 'prefix' | 'children' | 'onCopy'> {
|
|
26
|
+
/**
|
|
27
|
+
* The code. Trailing whitespace is trimmed off the end of the block — a
|
|
28
|
+
* template literal is almost always written with a newline before its closing
|
|
29
|
+
* backtick, and that newline is a blank line at the bottom of every block.
|
|
30
|
+
*/
|
|
31
|
+
code: string;
|
|
32
|
+
/**
|
|
33
|
+
* What it is written in — `ts`, `dart`, `bash`, `yml`, `dockerfile`. The
|
|
34
|
+
* common spellings and file extensions are understood, so a value copied off
|
|
35
|
+
* a fenced code block works as-is.
|
|
36
|
+
*
|
|
37
|
+
* A language nothing here knows is drawn plain rather than refused; teach it
|
|
38
|
+
* one with `registerLanguage`.
|
|
39
|
+
*/
|
|
40
|
+
language?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The palette. Independent of the page's light and dark, except on `auto`.
|
|
43
|
+
*
|
|
44
|
+
* Any other string works too, and is how a project brings its own: write
|
|
45
|
+
* `[data-code-theme='ours'] { --p-code-bg: …; --p-code-keyword: … }` in your
|
|
46
|
+
* own CSS and pass the name. Sixteen slots, five of which are derived from
|
|
47
|
+
* the other two and need no declaration.
|
|
48
|
+
* @default 'dark'
|
|
49
|
+
*/
|
|
50
|
+
theme?: PlCodeBlockTheme | (string & {});
|
|
51
|
+
/** The type scale and the air around the code. @default 'md' */
|
|
52
|
+
size?: PlassSize;
|
|
53
|
+
/** @default 'primary' */
|
|
54
|
+
color?: PlassColor;
|
|
55
|
+
/** @default 'default' */
|
|
56
|
+
density?: PlassDensity;
|
|
57
|
+
/** Drop shadow depth. `0` is flat, and is right for a block that is content. @default 0 */
|
|
58
|
+
elevation?: PlassElevation;
|
|
59
|
+
/**
|
|
60
|
+
* Colours the code.
|
|
61
|
+
*
|
|
62
|
+
* Off, nothing is fetched at all: the grammar engine is behind a dynamic
|
|
63
|
+
* import, so a block that does not highlight costs no more than the text in
|
|
64
|
+
* it. On, the block draws plain on the first frame and colours itself when
|
|
65
|
+
* the grammar lands — a few milliseconds, and never a blank space where the
|
|
66
|
+
* code should be.
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
69
|
+
highlight?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The bar over the code, and the master switch for it: with it off there is
|
|
72
|
+
* no bar and none of `showLanguage`, `copyable` or `rawToggle` draws
|
|
73
|
+
* anything, whatever they say.
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
toolbar?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* A name at the start of the bar — a file path, usually. Takes the place the
|
|
79
|
+
* language would otherwise have; both can be shown at once.
|
|
80
|
+
*/
|
|
81
|
+
title?: React.ReactNode;
|
|
82
|
+
/** Names the language at the start of the bar. @default true */
|
|
83
|
+
showLanguage?: boolean;
|
|
84
|
+
/** The button that puts the code on the clipboard. @default true */
|
|
85
|
+
copyable?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* The toggle that drops the colouring and shows the characters as they are.
|
|
88
|
+
* Off by default: it is a second control on a bar that usually wants one, and
|
|
89
|
+
* it means nothing at all when `highlight` is off.
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
92
|
+
rawToggle?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Lines to mark: a tinted row with a rule down its leading edge.
|
|
95
|
+
*
|
|
96
|
+
* A number is one line, a string is a list of lines and ranges — `'4'`,
|
|
97
|
+
* `'4-9'`, `'1,4-9,12'` — and an array is any mix of the two. They are
|
|
98
|
+
* counted the way the gutter counts, so `startLine={286}` means
|
|
99
|
+
* `highlightLines={288}` marks the line the gutter calls 288.
|
|
100
|
+
*
|
|
101
|
+
* The tint is mixed from the theme's own ink rather than from the page's
|
|
102
|
+
* colour family, so it is legible on all twelve palettes and never the one
|
|
103
|
+
* colour on a Dracula block that nobody chose.
|
|
104
|
+
*/
|
|
105
|
+
highlightLines?: number | string | Array<number | string>;
|
|
106
|
+
/** Numbers down the side. @default false */
|
|
107
|
+
lineNumbers?: boolean;
|
|
108
|
+
/** What the first line is numbered. @default 1 */
|
|
109
|
+
startLine?: number;
|
|
110
|
+
/**
|
|
111
|
+
* A shell prompt in front of every line that has something on it — `$`, `#`,
|
|
112
|
+
* `C:\>`, `>>>`.
|
|
113
|
+
*
|
|
114
|
+
* It is drawn but never *present*: the symbol is generated content, so it
|
|
115
|
+
* cannot be selected, cannot be found by find-in-page and is not what the
|
|
116
|
+
* copy button puts on the clipboard. A transcript stays a transcript and
|
|
117
|
+
* still pastes into a shell.
|
|
118
|
+
*/
|
|
119
|
+
prompt?: string;
|
|
120
|
+
/** Wraps long lines instead of scrolling them sideways. @default false */
|
|
121
|
+
wrap?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* How tall the block may get before the code scrolls inside it. A number is
|
|
124
|
+
* pixels; any CSS length works. Left out, the block is as tall as the code.
|
|
125
|
+
*/
|
|
126
|
+
maxHeight?: number | string;
|
|
127
|
+
/** The typeface. Defaults to the page's own monospace stack. */
|
|
128
|
+
fontFamily?: string;
|
|
129
|
+
/** Overrides the size the `size` ladder chose. A number is pixels. */
|
|
130
|
+
fontSize?: number | string;
|
|
131
|
+
/** Overrides the leading. A bare number is a ratio, as in CSS. */
|
|
132
|
+
lineHeight?: number | string;
|
|
133
|
+
/** Tracking. A number is pixels; `-0.01em` and the like work too. */
|
|
134
|
+
letterSpacing?: number | string;
|
|
135
|
+
/** The copy button's label. @default 'Copy' */
|
|
136
|
+
copyLabel?: string;
|
|
137
|
+
/** And what it says once the code is on the clipboard. @default 'Copied' */
|
|
138
|
+
copiedLabel?: string;
|
|
139
|
+
/** And what it says when the clipboard refused. @default 'Copy failed' */
|
|
140
|
+
copyFailedLabel?: string;
|
|
141
|
+
/** The raw toggle's label. @default 'Raw' */
|
|
142
|
+
rawLabel?: string;
|
|
143
|
+
/** What the region is called when there is neither a title nor a language. @default 'Code' */
|
|
144
|
+
codeLabel?: string;
|
|
145
|
+
/** Fires with the copied text once the clipboard has taken it. */
|
|
146
|
+
onCopy?: (code: string) => void;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* A viewer for one line of code or a thousand.
|
|
150
|
+
*
|
|
151
|
+
* Everything it draws above the code is optional and off one prop each, because
|
|
152
|
+
* the same component has to be a snippet inside a sentence — no bar, no
|
|
153
|
+
* numbers, no chrome — and the full transcript at the top of a README, and
|
|
154
|
+
* those are the same block with different things turned on rather than two
|
|
155
|
+
* components.
|
|
156
|
+
*
|
|
157
|
+
* The colouring is highlight.js, and it is the one thing in the library reached
|
|
158
|
+
* through a dynamic import: the grammars are forty kilobytes and there are
|
|
159
|
+
* thirty-five of them, so they arrive as their own chunk, one language at a
|
|
160
|
+
* time, and only for a block that asked to be coloured. See
|
|
161
|
+
* `internal/highlight.ts` for why that is a `dependencies` entry rather than an
|
|
162
|
+
* optional peer.
|
|
163
|
+
*
|
|
164
|
+
* The block is rendered as lines rather than as one run of text — even with no
|
|
165
|
+
* numbers and no prompt — because a line is what carries a number, a prompt and
|
|
166
|
+
* a place in the scroll, and a component that switched between two renderings
|
|
167
|
+
* would have two sets of wrapping behaviour to keep in step.
|
|
168
|
+
*
|
|
169
|
+
* **It is the one surface in the library that is not made of glass.** Every
|
|
170
|
+
* other sheet here is translucent and takes the page's colour family; this one
|
|
171
|
+
* paints its own opaque ground and refuses the family entirely, because the
|
|
172
|
+
* palette is the subject rather than the setting. A Dracula block tinted
|
|
173
|
+
* `primary` would be a Dracula block nobody chose.
|
|
174
|
+
*/
|
|
175
|
+
export declare const PlCodeBlock: React.ForwardRefExoticComponent<PlCodeBlockProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{useDefaults as o}from"../../internal/defaults.js";import{useLabels as l}from"../../internal/labels.js";import{CheckIcon as r,CodeIcon as a,CopyIcon as i}from"../../internal/icons.js";import{canonicalLanguage as s,highlight as c,plainLines as p}from"../../internal/highlight.js";import{cx as d,hasContent as m,metaTextClasses as u,radiusClasses as x,srOnlyClasses as f,surfaceSlots as g,toLength as h,transitionClasses as y}from"../../internal/styles.js";export{registerLanguage}from"../../internal/highlight.js";const v={xs:"text-[0.6875rem]/[1.55]",sm:"text-[0.75rem]/[1.6]",md:"text-[0.8125rem]/[1.65]",lg:"text-[0.875rem]/[1.7]",xl:"text-[1rem]/[1.7]"},b={default:{xs:"py-2",sm:"py-3",md:"py-3.5",lg:"py-4",xl:"py-5"},compact:{xs:"py-1.5",sm:"py-2",md:"py-2.5",lg:"py-3",xl:"py-3.5"}},w={default:{xs:"px-2",sm:"px-3",md:"px-3.5",lg:"px-4",xl:"px-5"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-3.5"}},N={default:{xs:"px-2.5 py-1",sm:"px-3.5 py-1",md:"px-4 py-1.5",lg:"px-4.5 py-2",xl:"px-5.5 py-2"},compact:{xs:"px-2 py-0.5",sm:"px-2.5 py-0.5",md:"px-3 py-1",lg:"px-3.5 py-1",xl:"px-4 py-1.5"}};export const PlCodeBlock=/* @__PURE__ */n.forwardRef(function PlCodeBlock({code:k,language:L,theme:S="dark",size:j,color:C,density:T,elevation:M=0,highlight:_=!0,toolbar:F=!0,title:R,showLanguage:z=!0,copyable:A=!0,rawToggle:H=!1,highlightLines:K,lineNumbers:E=!1,startLine:$=1,prompt:B,wrap:D=!1,maxHeight:P,fontFamily:I,fontSize:q,lineHeight:G,letterSpacing:J,copyLabel:O,copiedLabel:Q,copyFailedLabel:U,rawLabel:V,codeLabel:W,onCopy:X,className:Y,style:Z,...ee},te){const ne=o(),oe=j??ne.size??"md",le=C??ne.color??"primary",re=T??ne.density??"default",ae=l(),ie=O??ae.copy,se=Q??ae.copied,ce=U??ae.copyFailed,pe=V??ae.raw,de=n.useMemo(()=>k.replace(/\r\n?/g,"\n").replace(/\s+$/,""),[k]),me=s(L),[ue,xe]=n.useState(!1),[fe,ge]=n.useState(null),[he,ye]=n.useState(null),ve=_&&!ue&&null!==me;n.useEffect(()=>{if(!ve||!me)return void ye(null);let e=!1;return c(de,me).then(t=>{e||ye(t)},()=>{e||ye(null)}),()=>{e=!0}},[de,me,ve]);const be=n.useMemo(()=>ve&&he?he:p(de),[ve,he,de]),we=`${String($+Math.max(be.length-1,0)).length}ch`,Ne=n.useRef(void 0);n.useEffect(()=>()=>clearTimeout(Ne.current),[]);const ke=n.useMemo(()=>function markedLines(e){const t=new Set;if(void 0===e)return t;for(const n of Array.isArray(e)?e:[e])if("number"!=typeof n)for(const e of n.split(",")){const n=/^\s*(\d+)\s*(?:-\s*(\d+)\s*)?$/.exec(e);if(!n)continue;const o=Number(n[1]),l=void 0===n[2]?o:Number(n[2]);for(let e=Math.min(o,l);e<=Math.max(o,l);e+=1)t.add(e)}else Number.isFinite(n)&&t.add(Math.trunc(n));return t}(K),[K]),Le=n.useRef(null),Se=d("inline-flex shrink-0 cursor-pointer items-center gap-1 border-0 bg-transparent","px-1.5 py-1 text-(--p-code-dim) hover:text-(--p-code-fg) hover:bg-(--p-code-hover)",x.xs,u[oe],"[&_svg]:pointer-events-none [&_svg]:size-[1.15em] [&_svg]:shrink-0",y,"focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-1"),je=m(R)?void 0:me??W??ae.code;return t("div",{ref:te,className:d("plass-code flex min-w-0 flex-col overflow-hidden",x[oe],"border bg-(--p-code-bg) text-(--p-code-fg) [border-color:var(--p-code-rule)]","[box-shadow:var(--p-elev)]",y,Y),"data-code-theme":S,"data-code-wrap":D?"true":void 0,style:{...g(le,M),"--p-code-gutter":we,...I?{fontFamily:I}:null,...void 0===q?null:{fontSize:h(q)},...void 0===G?null:{lineHeight:G},...void 0===J?null:{letterSpacing:h(J)},...Z},...ee,children:[F&&(z||A||H||m(R))?t("div",{className:d("flex min-w-0 items-center gap-1 border-b [border-color:var(--p-code-rule)]",N[re][oe]),children:[m(R)?e("span",{className:d("min-w-0 truncate font-mono",u[oe]),children:R}):null,z&&me?e("span",{className:d("min-w-0 truncate font-mono tracking-wide text-(--p-code-dim) uppercase select-none",u[oe]),children:me}):null,e("span",{className:"flex-1"}),H&&_?e("button",{type:"button","aria-pressed":ue,"aria-label":pe,title:pe,onClick:()=>xe(e=>!e),className:d(Se,ue?"bg-(--p-code-hover) text-(--p-code-fg)":""),children:e(a,{})}):null,A?t("button",{type:"button",onClick:async()=>{const e=await async function writeToClipboard(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.append(t),t.select();const n=document.execCommand("copy");return t.remove(),n}catch{return!1}}(de);clearTimeout(Ne.current),ge(e),Ne.current=setTimeout(()=>ge(null),2e3),e&&X?.(de)},className:Se,children:[e(fe?r:i,{}),e("span",{children:null===fe?ie:fe?se:ce})]}):null]}):null,e("div",{className:d("flex min-h-0 flex-col",v[oe]),children:e("div",{role:"region","aria-label":"string"==typeof R?R:je,tabIndex:0,onKeyDown:e=>{if("a"!==e.key&&"A"!==e.key)return;if(!e.metaKey&&!e.ctrlKey||e.altKey)return;const t=Le.current,n="undefined"==typeof window?null:window.getSelection();if(!t||!n)return;e.preventDefault();const o=document.createRange();o.selectNodeContents(t),n.removeAllRanges(),n.addRange(o)},className:d("min-h-0 overflow-auto",b[re][oe],"focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:-outline-offset-2"),style:void 0===P?void 0:{maxHeight:h(P)},children:e("pre",{ref:Le,className:d("m-0 bg-transparent p-0 font-mono",D?"w-full":"w-max min-w-full"),children:be.map((t,o)=>{const l=$+o;return e("div",{className:d("plass-code-line",w[re][oe]),"data-line":E?l:void 0,"data-mark":ke.has(l)?"":void 0,"data-prompt":B&&t.length>0?B:void 0,children:e("code",{children:t.map((t,o)=>t.token?e("span",{className:t.token,children:t.text},o):e(n.Fragment,{children:t.text},o))})},o)})})})}),e("span",{"aria-live":"polite",className:f,children:null===fe?"":fe?se:ce})]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PlCodeBlock,registerLanguage}from"./PlCodeBlock.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{useDefaults as s}from"../../internal/defaults.js";import{Collapsible as a}from"@base-ui/react/collapsible";import{ChevronIcon as n}from"../../internal/icons.js";import{cx as i,focusRingInsetClasses as r,gapClasses as p,hasContent as o,iconClasses as d,metaTextClasses as c,radiusClasses as m,sheetBodyClasses as f,sheetHeaderGapClasses as h,sheetPaddingXClasses as u,sheetPaddingYClasses as x,sheetRestClasses as b,sheetTitleClasses as g,surfaceSlots as N,transitionClasses as v}from"../../internal/styles.js";const w={default:{xs:"pt-1.5",sm:"pt-2",md:"pt-3",lg:"pt-3.5",xl:"pt-4"},compact:{xs:"pt-1",sm:"pt-1.5",md:"pt-2",lg:"pt-2.5",xl:"pt-3"}},y={default:{xs:"pb-2.5",sm:"pb-3",md:"pb-5",lg:"pb-6",xl:"pb-7"},compact:{xs:"pb-2",sm:"pb-2.5",md:"pb-3.5",lg:"pb-4",xl:"pb-5"}};export const PlCollapsible=/* @__PURE__ */t.forwardRef(function PlCollapsible({variant:t="glass",size:j,color:k,density:C,elevation:O=0,open:_,defaultOpen:P=!1,onOpenChange:z,title:F,subtitle:M,startIcon:R,action:T,trigger:U,indicator:$=!0,disabled:I=!1,padded:q=!0,hiddenUntilFound:A=!1,keepMounted:B=!1,className:D,style:E,children:G,...H},J){const K=s(),L=j??K.size??"md",Q=k??K.color??"primary",S=C??K.density??"default",V=u[S][L],W=x[S][L];return l(a.Root,{ref:J,open:_,defaultOpen:P,onOpenChange:e=>z?.(e),disabled:I,className:i("flex flex-col overflow-hidden",m[L],b[t],v,D),style:{...N(Q,O),...E},...H,children:[U?e(a.Trigger,{render:U}):l("div",{className:"flex w-full items-center",children:[l(a.Trigger,{className:i("flex min-w-0 flex-1 cursor-pointer items-center text-start",V,W,p[L],v,d,r,"hover:bg-(--p-soft)","data-[panel-open]:bg-(--p-soft) data-[panel-open]:text-(--p-accent)","disabled:cursor-not-allowed disabled:bg-transparent disabled:opacity-50"),children:[o(R)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:R}):null,l("span",{className:i("flex min-w-0 flex-1 flex-col",h[L]),children:[o(F)?e("span",{className:i("plass-title truncate font-semibold",g[L]),children:F}):null,o(M)?e("span",{className:i("truncate text-(--plass-muted-fg)",c[L]),children:M}):null]}),$?e("span",{className:i("flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)","[transition:rotate_var(--plass-duration)_var(--plass-ease)]","data-[panel-open]:rotate-180"),children:e(n,{})}):null]}),o(T)?e("span",{className:i("flex shrink-0 items-center",V),children:T}):null]}),e(a.Panel,{hiddenUntilFound:A,keepMounted:B,className:i("h-(--collapsible-panel-height) overflow-hidden","[transition:height_var(--plass-duration-slow)_var(--plass-ease)]","data-[starting-style]:h-0 data-[ending-style]:h-0"),children:e("div",{className:i("min-w-0 text-(--plass-muted-fg)",f[L],q?V:"",q?U?`${w[S][L]} ${y[S][L]}`:y[S][L]:""),children:G})})]})});
|