plass-ui 1.6.0 → 1.8.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 +494 -0
- package/README.md +5 -3
- package/dist/components/accordion/PlAccordion.d.ts +19 -1
- package/dist/components/accordion/PlAccordion.js +1 -1
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/alert/PlAlert.js +1 -1
- package/dist/components/anchor/PlAnchor.js +1 -1
- package/dist/components/animate-appear/PlAnimateAppear.js +1 -1
- package/dist/components/animate-counter/PlAnimateCounter.d.ts +5 -2
- package/dist/components/animate-counter/PlAnimateCounter.js +1 -1
- package/dist/components/animate-float/PlAnimateFloat.js +1 -1
- package/dist/components/animate-headline/PlAnimateHeadline.d.ts +10 -1
- package/dist/components/animate-headline/PlAnimateHeadline.js +1 -1
- package/dist/components/animate-lighting/PlAnimateLighting.js +1 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +8 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
- package/dist/components/animate-scramble/PlAnimateScramble.js +1 -1
- package/dist/components/animate-shake/PlAnimateShake.js +1 -1
- package/dist/components/animate-split/PlAnimateSplit.js +1 -1
- package/dist/components/animate-typing/PlAnimateTyping.js +1 -1
- package/dist/components/app-logo/PlAppLogo.d.ts +51 -15
- package/dist/components/app-logo/PlAppLogo.js +1 -1
- package/dist/components/area-chart/PlAreaChart.d.ts +35 -6
- package/dist/components/area-chart/PlAreaChart.js +1 -1
- package/dist/components/aspect-ratio/PlAspectRatio.js +1 -1
- package/dist/components/avatar/PlAvatar.js +1 -1
- package/dist/components/back-top/PlBackTop.d.ts +5 -5
- package/dist/components/back-top/PlBackTop.js +1 -1
- package/dist/components/badge/PlBadge.js +1 -1
- package/dist/components/bar-chart/PlBarChart.d.ts +54 -2
- package/dist/components/bar-chart/PlBarChart.js +1 -1
- package/dist/components/blockquote/PlBlockquote.d.ts +2 -2
- package/dist/components/blockquote/PlBlockquote.js +1 -1
- package/dist/components/bottom-navigation/PlBottomNavigation.d.ts +15 -5
- package/dist/components/bottom-navigation/PlBottomNavigation.js +1 -1
- package/dist/components/breadcrumb/PlBreadcrumb.d.ts +16 -3
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button/PlButton.d.ts +7 -0
- package/dist/components/button/PlButton.js +1 -1
- package/dist/components/calendar/PlCalendar.js +1 -1
- package/dist/components/card/PlCard.d.ts +9 -5
- package/dist/components/card/PlCard.js +1 -1
- package/dist/components/carousel/PlCarousel.d.ts +14 -4
- 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.d.ts +2 -1
- package/dist/components/chip/PlChip.js +1 -1
- package/dist/components/code-block/PlCodeBlock.js +1 -1
- package/dist/components/collapsible/PlCollapsible.d.ts +11 -0
- package/dist/components/collapsible/PlCollapsible.js +1 -1
- package/dist/components/color-picker/PlColorPicker.d.ts +3 -1
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +11 -5
- package/dist/components/combobox/PlCombobox.js +1 -1
- package/dist/components/command-palette/PlCommandPalette.js +1 -1
- package/dist/components/confirm/PlConfirmProvider.js +1 -1
- package/dist/components/data-table/PlDataTable.d.ts +13 -2
- package/dist/components/data-table/PlDataTable.js +1 -1
- package/dist/components/date-picker/PlDatePicker.js +1 -1
- package/dist/components/date-range-picker/PlDateRangePicker.js +1 -1
- package/dist/components/date-time-picker/PlDateTimePicker.js +1 -1
- package/dist/components/drawer/PlDrawer.d.ts +27 -2
- package/dist/components/drawer/PlDrawer.js +1 -1
- package/dist/components/empty/PlEmpty.d.ts +4 -1
- package/dist/components/empty/PlEmpty.js +1 -1
- package/dist/components/fieldset/PlFieldset.js +1 -1
- package/dist/components/file-picker/PlFilePicker.d.ts +32 -1
- package/dist/components/file-picker/PlFilePicker.js +1 -1
- package/dist/components/file-picker/index.d.ts +1 -1
- package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +5 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -1
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.d.ts +10 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +1 -1
- package/dist/components/footer/PlFooter.d.ts +3 -1
- package/dist/components/footer/PlFooter.js +1 -1
- package/dist/components/gallery/PlGallery.js +1 -1
- package/dist/components/gauge-chart/PlGaugeChart.d.ts +11 -2
- package/dist/components/gauge-chart/PlGaugeChart.js +1 -1
- package/dist/components/header/PlHeader.d.ts +4 -2
- package/dist/components/header/PlHeader.js +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.d.ts +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -1
- package/dist/components/hover-card/PlHoverCard.js +1 -1
- package/dist/components/how-to-steps/PlHowToSteps.js +1 -1
- package/dist/components/image/PlImage.js +1 -1
- package/dist/components/image/PlImagePreview.d.ts +3 -2
- package/dist/components/line-chart/PlLineChart.d.ts +32 -6
- package/dist/components/line-chart/PlLineChart.js +1 -1
- package/dist/components/list/PlList.d.ts +16 -5
- package/dist/components/list/PlList.js +1 -1
- package/dist/components/menu/PlMenu.d.ts +19 -7
- package/dist/components/menu/PlMenu.js +1 -1
- package/dist/components/menubar/PlMenubar.js +1 -1
- package/dist/components/meter/PlMeter.js +1 -1
- package/dist/components/mockup/PlMockup.d.ts +6 -0
- package/dist/components/mockup/PlMockup.js +1 -1
- package/dist/components/modal/PlModal.js +1 -1
- package/dist/components/navigation-menu/PlNavigationMenu.d.ts +56 -11
- package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +7 -5
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.js +1 -1
- package/dist/components/overlay/PlOverlay.js +1 -1
- package/dist/components/page-layout/PlPageLayout.d.ts +14 -3
- package/dist/components/page-layout/PlPageLayout.js +1 -1
- package/dist/components/pagination/PlPagination.js +1 -1
- package/dist/components/panes/PlPanes.d.ts +4 -1
- package/dist/components/panes/PlPanes.js +1 -1
- package/dist/components/pie-chart/PlPieChart.d.ts +26 -1
- package/dist/components/pie-chart/PlPieChart.js +1 -1
- package/dist/components/pill/PlPill.js +1 -1
- package/dist/components/popconfirm/PlPopconfirm.d.ts +8 -1
- package/dist/components/popconfirm/PlPopconfirm.js +1 -1
- package/dist/components/popover/PlPopover.js +1 -1
- package/dist/components/progress-box/PlProgressBox.js +1 -1
- package/dist/components/progress-circular/PlProgressCircular.d.ts +11 -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.js +1 -1
- package/dist/components/scroll-area/PlScrollArea.js +1 -1
- 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 +4 -1
- package/dist/components/select/PlSelect.js +1 -1
- package/dist/components/sidebar/PlSidebar.d.ts +12 -0
- package/dist/components/sidebar/PlSidebar.js +1 -1
- package/dist/components/slider/PlSlider.d.ts +2 -1
- package/dist/components/slider/PlSlider.js +1 -1
- package/dist/components/sparkline/PlSparkline.d.ts +15 -3
- package/dist/components/sparkline/PlSparkline.js +1 -1
- package/dist/components/stepper/PlStepper.d.ts +11 -0
- package/dist/components/stepper/PlStepper.js +1 -1
- package/dist/components/switch/PlSwitch.js +1 -1
- package/dist/components/table/PlTable.d.ts +11 -1
- package/dist/components/table/PlTable.js +1 -1
- package/dist/components/tabs/PlTabs.d.ts +18 -1
- package/dist/components/tabs/PlTabs.js +1 -1
- package/dist/components/text-field/PlTextField.d.ts +6 -8
- 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-chart/PlTimelineChart.js +1 -1
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/tooltip/PlTooltip.d.ts +4 -0
- package/dist/components/tooltip/PlTooltip.js +1 -1
- package/dist/components/tour/PlTour.js +1 -1
- package/dist/components/transfer/PlTransfer.d.ts +5 -2
- package/dist/components/transfer/PlTransfer.js +1 -1
- package/dist/components/tree/PlTree.d.ts +12 -0
- package/dist/components/tree/PlTree.js +1 -1
- package/dist/components/tree-select/PlTreeSelect.js +1 -1
- package/dist/components/typography/PlTypography.d.ts +20 -7
- package/dist/components/typography/PlTypography.js +1 -1
- package/dist/components/visually-hidden/PlVisuallyHidden.d.ts +12 -3
- package/dist/components/visually-hidden/PlVisuallyHidden.js +1 -1
- package/dist/components/window-pane/PlWindowPane.d.ts +16 -3
- package/dist/components/window-pane/PlWindowPane.js +1 -1
- package/dist/css/accordion.css +4 -0
- package/dist/css/alert.css +5 -0
- package/dist/css/anchor.css +6 -0
- package/dist/css/animate-appear.css +3 -0
- package/dist/css/animate-blink.css +3 -0
- package/dist/css/animate-counter.css +4 -0
- package/dist/css/animate-fade.css +3 -0
- package/dist/css/animate-float.css +3 -0
- package/dist/css/animate-grow.css +3 -0
- package/dist/css/animate-headline.css +3 -0
- package/dist/css/animate-lighting.css +4 -0
- package/dist/css/animate-marquee.css +4 -0
- package/dist/css/animate-reveal.css +3 -0
- package/dist/css/animate-rotate.css +3 -0
- package/dist/css/animate-scramble.css +5 -0
- package/dist/css/animate-shake.css +3 -0
- package/dist/css/animate-slide.css +3 -0
- package/dist/css/animate-split.css +4 -0
- package/dist/css/animate-typing.css +4 -0
- package/dist/css/animate-zoom.css +3 -0
- package/dist/css/app-logo.css +2 -0
- package/dist/css/area-chart.css +12 -0
- package/dist/css/aspect-ratio.css +2 -0
- package/dist/css/avatar.css +2 -0
- package/dist/css/back-top.css +11 -0
- package/dist/css/badge.css +2 -0
- package/dist/css/bar-chart.css +10 -0
- package/dist/css/base.css +2 -3
- package/dist/css/blockquote.css +2 -0
- package/dist/css/bottom-navigation.css +4 -0
- package/dist/css/box.css +2 -0
- package/dist/css/breadcrumb.css +6 -0
- package/dist/css/button-group.css +2 -0
- package/dist/css/button.css +7 -0
- package/dist/css/calendar.css +17 -0
- package/dist/css/card.css +2 -0
- package/dist/css/carousel.css +10 -0
- package/dist/css/chat-bubble.css +6 -0
- package/dist/css/checkbox.css +3 -0
- package/dist/css/chip.css +8 -0
- package/dist/css/code-block.css +6 -0
- package/dist/css/collapsible.css +3 -0
- package/dist/css/color-picker.css +17 -0
- package/dist/css/combobox.css +10 -0
- package/dist/css/command-palette.css +7 -0
- package/dist/css/confirm.css +9 -0
- package/dist/css/container.css +5 -0
- package/dist/css/data-list.css +2 -0
- package/dist/css/data-table.css +15 -0
- package/dist/css/date-picker.css +16 -0
- package/dist/css/date-range-picker.css +16 -0
- package/dist/css/date-time-picker.css +16 -0
- package/dist/css/divider.css +2 -0
- package/dist/css/drawer.css +6 -0
- package/dist/css/empty.css +2 -0
- package/dist/css/fieldset.css +2 -0
- package/dist/css/file-picker.css +8 -0
- package/dist/css/flex.css +5 -0
- package/dist/css/floating-action-button.css +7 -0
- package/dist/css/floating-bottom-navigation.css +5 -0
- package/dist/css/footer.css +6 -0
- package/dist/css/form.css +2 -0
- package/dist/css/gallery.css +15 -0
- package/dist/css/gauge-chart.css +11 -0
- package/dist/css/grid.css +5 -0
- package/dist/css/header.css +6 -0
- package/dist/css/heatmap-chart.css +10 -0
- package/dist/css/highlight.css +2 -0
- package/dist/css/hot-keys.css +3 -0
- package/dist/css/hover-card.css +9 -0
- package/dist/css/how-to-steps.css +3 -0
- package/dist/css/icon-button.css +7 -0
- package/dist/css/icon.css +1 -0
- package/dist/css/image.css +7 -0
- package/dist/css/line-chart.css +12 -0
- package/dist/css/list.css +2 -0
- package/dist/css/menu.css +5 -0
- package/dist/css/menubar.css +5 -0
- package/dist/css/meter.css +6 -0
- package/dist/css/mockup.css +4 -0
- package/dist/css/modal.css +5 -0
- package/dist/css/navigation-menu.css +4 -0
- package/dist/css/number-field.css +10 -0
- package/dist/css/otp-field.css +6 -0
- package/dist/css/overlay.css +4 -0
- package/dist/css/page-layout.css +7 -0
- package/dist/css/pagination.css +8 -0
- package/dist/css/panes.css +7 -0
- package/dist/css/pie-chart.css +10 -0
- package/dist/css/pill.css +4 -0
- package/dist/css/popconfirm.css +12 -0
- package/dist/css/popover.css +11 -0
- package/dist/css/portal.css +1 -0
- package/dist/css/progress-box.css +5 -0
- package/dist/css/progress-circular.css +5 -0
- package/dist/css/progress-linear.css +5 -0
- package/dist/css/radio-group.css +3 -0
- package/dist/css/rating.css +6 -0
- package/dist/css/scatter-chart.css +10 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/scroll-zone.css +15 -0
- package/dist/css/segmented-button.css +5 -0
- package/dist/css/select.css +9 -0
- package/dist/css/show.css +1 -0
- package/dist/css/sidebar.css +16 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +3 -0
- package/dist/css/sparkline.css +10 -0
- package/dist/css/spoiler.css +10 -0
- package/dist/css/stack.css +5 -0
- package/dist/css/stat.css +2 -0
- package/dist/css/stepper.css +8 -0
- package/dist/css/switch.css +3 -0
- package/dist/css/table.css +3 -0
- package/dist/css/tabs.css +7 -0
- package/dist/css/text-field.css +8 -0
- package/dist/css/text-link.css +6 -0
- package/dist/css/time-picker.css +16 -0
- package/dist/css/timeline-chart.css +10 -0
- package/dist/css/timeline.css +6 -0
- package/dist/css/toast.css +5 -0
- package/dist/css/toggle.css +5 -0
- package/dist/css/toolbar.css +2 -0
- package/dist/css/tooltip.css +9 -0
- package/dist/css/tour.css +10 -0
- package/dist/css/transfer.css +13 -0
- package/dist/css/tree-select.css +14 -0
- package/dist/css/tree.css +3 -0
- package/dist/css/visually-hidden.css +2 -0
- package/dist/css/window-pane.css +9 -0
- package/dist/internal/animate.d.ts +59 -4
- package/dist/internal/animate.js +1 -1
- package/dist/internal/bottom-bar.d.ts +29 -0
- package/dist/internal/bottom-bar.js +1 -0
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +216 -19
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.d.ts +11 -6
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +149 -1
- package/dist/internal/chart.js +1 -1
- package/dist/internal/commit-change.d.ts +38 -0
- package/dist/internal/commit-change.js +1 -0
- package/dist/internal/data-table.d.ts +2 -2
- package/dist/internal/data-table.js +1 -1
- package/dist/internal/date.d.ts +9 -0
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +36 -3
- package/dist/internal/defaults.js +1 -1
- package/dist/internal/direction.d.ts +8 -2
- package/dist/internal/direction.js +1 -1
- package/dist/internal/focusable.d.ts +10 -0
- package/dist/internal/focusable.js +1 -1
- package/dist/internal/form.d.ts +72 -0
- package/dist/internal/form.js +1 -1
- package/dist/internal/format.d.ts +4 -1
- package/dist/internal/format.js +1 -1
- package/dist/internal/gallery.d.ts +28 -0
- package/dist/internal/gallery.js +1 -1
- package/dist/internal/glow.d.ts +39 -3
- package/dist/internal/glow.js +1 -1
- package/dist/internal/heading.d.ts +11 -0
- package/dist/internal/heading.js +1 -0
- package/dist/internal/highlight.d.ts +4 -2
- package/dist/internal/highlight.js +1 -1
- package/dist/internal/icons.d.ts +24 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/labels.d.ts +27 -0
- package/dist/internal/labels.js +1 -1
- package/dist/internal/layout-box.d.ts +35 -0
- package/dist/internal/layout-box.js +1 -0
- package/dist/internal/lazy.d.ts +37 -0
- package/dist/internal/lazy.js +1 -0
- package/dist/internal/loading.d.ts +13 -0
- package/dist/internal/loading.js +1 -0
- package/dist/internal/media.d.ts +6 -0
- package/dist/internal/media.js +1 -1
- package/dist/internal/mockup.js +1 -1
- package/dist/internal/notch.d.ts +57 -3
- package/dist/internal/notch.js +1 -1
- package/dist/internal/page-layout.d.ts +24 -13
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +8 -2
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +41 -6
- package/dist/internal/progress.js +1 -1
- package/dist/internal/search.d.ts +12 -0
- package/dist/internal/search.js +1 -1
- package/dist/internal/sizer.d.ts +18 -10
- package/dist/internal/sizer.js +1 -1
- package/dist/internal/steps.d.ts +0 -15
- package/dist/internal/steps.js +1 -1
- package/dist/internal/styles.d.ts +136 -14
- package/dist/internal/styles.js +1 -1
- package/dist/internal/table-scroll.d.ts +42 -0
- package/dist/internal/table-scroll.js +1 -0
- package/dist/internal/table.js +1 -1
- package/dist/internal/text.d.ts +8 -5
- package/dist/internal/wheel.d.ts +13 -1
- package/dist/internal/wheel.js +1 -1
- package/dist/internal/window.js +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1163 -81
- package/dist/tokens.css +1163 -81
- package/dist/types.d.ts +226 -13
- package/package.json +18 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{ChartScaleLegend as n,ChartStatus as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{ChartScaleLegend as n,ChartStatus as a,ChartSurface as i,ChartTooltipPanel as r,chartTableName as o,givenHeight as d,markTransitionClasses as h,useMeasuredSize as s}from"../../internal/chart-frame.js";import{categoryAt as c,chartFontSizes as u,compactNumber as m,formatCategory as x,markGap as f,plotHeights as p,rampFill as g,rampInk as w,rampStep as b,rampSteps as v,squarify as y,textWidth as M,tickStride as $,toValues as k,truncate as A}from"../../internal/chart.js";import{numberFormatter as N}from"../../internal/format.js";import{cx as j,metaTextClasses as z,srOnlyClasses as E}from"../../internal/styles.js";import{useLabels as B}from"../../internal/labels.js";import{useDefaults as I,useLocale as S}from"../../internal/defaults.js";export function PlHeatmapChart({series:C,categories:D,shape:P="grid",scale:L="sequential",midpoint:R=0,min:U,max:W,valueLabels:_="none",height:q,initialWidth:F,format:H,locale:K,label:G,"aria-label":J,"aria-labelledby":O,"aria-describedby":Q,legend:T,tooltip:V,empty:X,size:Y,variant:Z="ghost",padded:ee=!1,className:le,...te}){const ne=I(),ae=Y??ne.size??"md",ie=S(K),re=t.useRef(null),{width:oe,height:de,guessed:he}=s(re,F),se=B(),ce=t.useId(),ue=t.useId(),me=t.useId(),[xe,fe]=t.useState(null),pe=t.useCallback(e=>H?N(ie,H).format(e):m(e,ie),[H,ie]),ge=t.useMemo(()=>k(C),[C]),we=ge.reduce((e,l)=>Math.max(e,l.length),0),be=t.useMemo(()=>Array.from({length:we},(e,l)=>c(l,D,ge)),[we,D,ge]),ve=t.useMemo(()=>C.map((e,l)=>e.name??`${l+1}`),[C]),ye=t.useMemo(()=>ge.map((e,l)=>{const t=e.map(e=>e.value).filter(e=>null!==e);return{name:ve[l],low:0===t.length?null:Math.min(...t),high:0===t.length?null:Math.max(...t)}}),[ge,ve]),Me=t.useMemo(()=>{let e=1/0,l=-1/0,t=!1;for(const n of ge)for(const a of n)null!==a.value&&(t=!0,e=Math.min(e,a.value),l=Math.max(l,a.value));return t?{min:e,max:l}:null},[ge]),$e=U??Me?.min??0,ke=W??Me?.max??1,Ae=t.useCallback(e=>b(e,$e,ke,L,R),[$e,ke,L,R]),Ne=d(q,p[ae]??220),je=Ne??de??0,ze=u[ae],Ee=!0===T||void 0===T||!1===T?{}:T,Be=!1!==T,Ie=Ee.side??"bottom",Se=!1===V?{mode:"none"}:!0===V||void 0===V?{}:V,Ce="none"===Se.mode,De=null===Me||0===we||0===C.length,Pe=t.useMemo(()=>{if("treemap"===P||oe<=0)return{texts:[],band:0};const e=Math.min(150,.25*oe),l=ve.map(l=>A(l,e,ze));return{texts:l,band:l.reduce((e,l)=>Math.max(e,M(l,ze)),0)+10}},[P,ve,oe,ze]),Le="treemap"===P?0:ze+8,Re={left:Pe.band,width:Math.max(0,oe-Pe.band),height:Math.max(0,je-Le)},Ue=t.useMemo(()=>{if("treemap"===P)return{texts:[],widest:0};const e=be.map(e=>x(e,ie));return{texts:e,widest:e.reduce((e,l)=>Math.max(e,M(l,ze)),0)}},[P,be,ie,ze]),We=$(we,Re.width,Ue.widest+8),_e=t.useMemo(()=>{if(Re.width<=0||Re.height<=0)return[];if("treemap"===P){const e=[];return ge.forEach((l,t)=>l.forEach((l,n)=>{null!==l.value&&e.push({row:t,index:n,cell:l})})),y(e.map(e=>Math.max(0,e.cell.value??0)),Re.width,Re.height).map(l=>({row:e[l.index].row,index:e[l.index].index,cell:e[l.index].cell,x:Re.left+l.x,y:l.y,width:l.width,height:l.height}))}const e=Re.height/Math.max(1,C.length),l=Re.width/Math.max(1,we),t=[];return ge.forEach((n,a)=>n.forEach((n,i)=>{null!==n.value&&t.push({row:a,index:i,cell:n,x:Re.left+i*l,y:a*e,width:l,height:e})})),t},[P,ge,C.length,we,Re.left,Re.width,Re.height]),qe=t.useCallback((e,l)=>x(e.x??D?.[l]??be[l]??l,ie),[D,be,ie]),Fe=t.useCallback(e=>qe(e.cell,e.index),[qe]),He=null===xe?null:_e.find(e=>e.row===xe.row&&e.index===xe.index)??null;null!==xe&&null===He&&fe(null);const Ke=null===He?[]:[{seriesIndex:He.row,color:He.cell.color??g(Ae(He.cell.value??0),L),value:He.cell.value,formatted:pe(He.cell.value??0),label:He.cell.label}],Ge=Array.from({length:v},(e,l)=>g(l,L)),Je=o({label:G,"aria-label":J,"aria-labelledby":O});return l(i,{...te,size:ae,variant:Z,padded:ee,className:le,legendSide:Ie,legend:Be&&!De?e(n,{steps:Ge,from:pe("diverging"===L?-reach($e,ke,R)+R:$e),to:pe("diverging"===L?reach($e,ke,R)+R:ke),middle:"diverging"===L?pe(R):void 0,align:Ee.align??"center",vertical:"left"===Ie||"right"===Ie,size:ae}):null,table:De?null:l("table","treemap"===P?{id:ce,className:E,"aria-labelledby":Je.labelledBy,children:[Je.caption?e("caption",{children:Je.caption}):null,ge.map((t,n)=>l("tbody",{children:[e("tr",{children:e("th",{scope:"rowgroup",colSpan:2,children:ve[n]})}),t.map((t,n)=>null===t.value?null:l("tr",{children:[e("th",{scope:"row",children:qe(t,n)}),e("td",{children:void 0!==t.label?t.label:pe(t.value)})]},n))]},n))]}:{id:ce,className:E,"aria-labelledby":Je.labelledBy,children:[Je.caption?e("caption",{children:Je.caption}):null,e("thead",{children:l("tr",{children:[e("th",{scope:"col"}),be.map((l,t)=>e("th",{scope:"col",children:x(l,ie)},t))]})}),e("tbody",{children:ge.map((t,n)=>l("tr",{children:[e("th",{scope:"row",children:ve[n]}),be.map((l,n)=>{const a=t[n];return e("td",{children:void 0!==a?.label?a.label:null==a?.value?"":pe(a.value)},n)})]},n))})]}),children:[l("div",{ref:re,role:"img",tabIndex:De?void 0:0,"aria-labelledby":O,"aria-label":J??G??se.chart,"aria-describedby":j(Q,De?me:ue),onPointerLeave:()=>fe(null),onBlur:()=>fe(null),onKeyDown:e=>{if(Ce||0===_e.length)return;const l=null===xe?-1:_e.findIndex(e=>e.row===xe.row&&e.index===xe.index);if("grid"!==P||-1===l||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)if("ArrowRight"===e.key||"ArrowDown"===e.key){const e=_e[Math.min(_e.length-1,l+1)];fe({row:e.row,index:e.index})}else if("ArrowLeft"===e.key||"ArrowUp"===e.key){const e=_e[Math.max(0,(-1===l?_e.length:l)-1)];fe({row:e.row,index:e.index})}else{if("Escape"!==e.key||null===xe)return;fe(null),e.stopPropagation()}else{const t="ArrowDown"===e.key?1:-1;let n=l+t;for(;n>=0&&n<_e.length&&_e[n].index!==_e[l].index;)n+=t;n>=0&&n<_e.length&&fe({row:_e[n].row,index:_e[n].index})}e.preventDefault()},className:j("relative w-full rounded-(--plass-radius-xs)","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-2",he&&"overflow-hidden"),style:{height:Ne??q},children:[De?e("div",{id:me,className:j("flex h-full items-center justify-center text-(--plass-muted-fg)",z[ae]),children:X??se.empty}):oe>0&&(null!==Ne||je>0)?l("svg",{width:oe,height:je,viewBox:`0 0 ${oe} ${je}`,"aria-hidden":"true",className:"block",children:[_e.map(t=>{const n=Ae(t.cell.value??0),a=xe?.row===t.row&&xe?.index===t.index,i=Math.max(0,t.width-f),r=Math.max(0,t.height-f);if(i<=0||r<=0)return null;const o=pe(t.cell.value??0),d="treemap"===P?"all"===_?[Fe(t),o]:[Fe(t)]:"all"===_?[o]:[],s=d.filter(e=>function fits(e,l,t,n){return t>=1.8*n&&l>=Math.min(M(e,n),2.5*n)+8}(e,i,r/d.length,ze)),c=t.cell.color?"var(--plass-surface)":w(n,L);return l("g",{children:[e("rect",{x:t.x+f/2,y:t.y+f/2,width:i,height:r,rx:Math.min(3,i/2,r/2),fill:t.cell.color??g(n,L),opacity:a?1:.94,onPointerEnter:Ce?void 0:()=>fe({row:t.row,index:t.index}),className:h}),s.map((l,n)=>e("text",{x:t.x+t.width/2,y:t.y+t.height/2+(n-(s.length-1)/2)*(ze+2),textAnchor:"middle",dominantBaseline:"central",fontSize:ze,fontWeight:0===n?500:400,fill:c,opacity:0===n?1:.85,pointerEvents:"none",className:0===n&&"treemap"===P?void 0:"tabular-nums",children:A(l,t.width-8,ze)},n))]},`${t.row}-${t.index}`)}),"grid"===P?Pe.texts.map((l,t)=>e("text",{x:Re.left-8,y:(t+.5)*Re.height/Math.max(1,C.length),textAnchor:"end",dominantBaseline:"central",fontSize:ze,fill:"var(--plass-muted-fg)",children:l},`row-${t}`)):null,"grid"===P?Ue.texts.map((l,t)=>{const n=Re.width/Math.max(1,we);return t%We!==0?null:e("text",{x:Re.left+(t+.5)*n,y:Re.height+ze,textAnchor:"middle",fontSize:ze,fill:"var(--plass-muted-fg)",children:l},`col-${t}`)}):null]}):null,He&&!Ce?Se.render?e("div",{className:"pointer-events-none absolute z-10",style:{left:He.x+He.width/2,top:He.y},children:Se.render({index:He.index,category:He.cell.x??be[He.index]??He.index,items:Ke})}):e(r,{heading:`${ve[He.row]} · ${Fe(He)}`,items:Ke,x:He.x+He.width/2,y:He.y,flip:He.x+He.width/2>.6*oe,size:ae}):null]}),De?null:e("span",{id:ue,className:E,children:ye.map((e,n)=>l(t.Fragment,{children:[n>0?", ":null,null===e.low?e.name:e.low===e.high?`${e.name} ${pe(e.low)}`:`${e.name} ${pe(e.low)}–${pe(e.high)}`]},n))}),Ce?null:e(a,{heading:He?`${ve[He.row]} · ${Fe(He)}`:void 0,items:Ke})]})}function reach(e,l,t){return Math.max(Math.abs(l-t),Math.abs(t-e))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import{PreviewCard as l}from"@base-ui/react/preview-card";import{useDefaults as a}from"../../internal/defaults.js";import{PopupArrow as
|
|
1
|
+
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import{PreviewCard as l}from"@base-ui/react/preview-card";import{useDefaults as a}from"../../internal/defaults.js";import{PopupArrow as i}from"../../internal/picker.js";import{cx as r,glassClasses as n,hasContent as t,metaTextClasses as o,radiusClasses as d,sheetBodyClasses as m,sheetHeaderGapClasses as c,sheetPaddingXClasses as p,sheetPaddingYClasses as f,sheetSectionGapClasses as u,sheetTitleClasses as g,surfaceSlots as x}from"../../internal/styles.js";const y={xs:"max-w-64",sm:"max-w-72",md:"max-w-sm",lg:"max-w-md",xl:"max-w-lg"},h=/* @__PURE__ */[n,"relative flex flex-col","border text-(--plass-fg) bg-(--plass-glass-press)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--plass-shadow-3),var(--plass-gloss-glass)]","[outline:none]","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),v={xs:8,sm:9,md:10,lg:11,xl:12};export function PlHoverCard({size:n,color:w,density:b,trigger:O,title:j,description:N,children:z,side:P="bottom",align:C="center",sideOffset:D=8,alignOffset:_=0,delay:k=600,closeDelay:A=300,arrow:H=!1,open:R,defaultOpen:T,onOpenChange:W,width:$,className:q,style:B,...E}){const F=a(),G=n??F.size??"md",I=w??F.color??"primary",J=b??F.density??"default",K=v[G],L=t(j)||t(N);return s(l.Root,{open:R,defaultOpen:T,onOpenChange:e=>W?.(e),children:[e(l.Trigger,{delay:k,closeDelay:A,render:O}),e(l.Portal,{children:e(l.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",side:P,align:C,sideOffset:D,alignOffset:_,children:s(l.Popup,{className:r(h,d[G],m[G],u[G],p[J][G],f[J][G],void 0===$?y[G]:"",q),style:{...x(I,3),...void 0===$?null:{maxWidth:"number"==typeof $?`${$}px`:$},...B},...E,children:[H?e(i,{as:l.Arrow,size:K}):null,L?s("div",{className:r("flex min-w-0 flex-col",c[G]),children:[t(j)?e("div",{className:r("m-0 font-semibold",g[G]),children:j}):null,t(N)?e("div",{className:r("m-0 text-(--plass-muted-fg)",o[G]),children:N}):null]}):null,t(z)?e("div",{className:"min-w-0",children:z}):null]})})})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{useRender as s}from"@base-ui/react/use-render";import{useDefaults as r}from"../../internal/defaults.js";import{bulletGapClasses as n,bulletSizeValues as o,bulletStatusClasses as i,connectorColorClasses as a,connectorStyleClasses as c,statusAt as d,titleStatusClasses as m}from"../../internal/steps.js";import{cx as p,hasContent as f,iconClasses as u,sheetBodyClasses as x,sheetTitleClasses as h,surfaceSlots as g,transitionClasses as v}from"../../internal/styles.js";const w=/* @__PURE__ */t.createContext(null),y=/* @__PURE__ */t.createContext({index:0,last:!1}),N={default:{xs:"gap-4",sm:"gap-5",md:"gap-6",lg:"gap-7",xl:"gap-8"},compact:{xs:"gap-2.5",sm:"gap-3",md:"gap-4",lg:"gap-4",xl:"gap-5"}};export const PlHowToSteps=/* @__PURE__ */t.forwardRef(function PlHowToSteps({active:l,numbered:n=!0,connector:o="solid",size:i,color:a,density:c,render:d,className:m,style:f,children:u,...h},v){const b=r(),P=i??b.size??"md",j=a??b.color??"primary",H=c??b.density??"default",S=t.Children.toArray(u).filter(t.isValidElement),T=t.useMemo(()=>({size:P,density:H,color:j,active:l??null,numbered:n,connector:o}),[P,H,j,l,n,o]);return e(w.Provider,{value:T,children:s({render:d??e("ol",{}),ref:v,props:{role:"list",className:p("m-0 flex list-none flex-col p-0",N[H][P],x[P],m),style:{...g(j,0),...f},children:S.map((l,t)=>e(y.Provider,{value:{index:t,last:t===S.length-1},children:l},l.key??t)),...h}})})});export const PlHowToStep=/* @__PURE__ */t.forwardRef(function PlHowToStep({title:s,icon:r,status:x,className:N,children:b,...P},j){const H=t.useContext(w),{index:S,last:T}=t.useContext(y);if(!H)throw new Error("PlHowToStep has to be inside a PlHowToSteps.");const{size:C,color:z,active:k,numbered:E,connector:R}=H,$=x??d(S,k),A=o[C];return l("li",{ref:j,"aria-current":"current"===$?"step":void 0,className:p("relative flex",n[C],N),style:{...g(z,0),"--p-fill":`var(--plass-${z}-fill)`,"--p-on-solid":`var(--plass-${z}-on-solid)`},...P,children:[l("div",{className:"flex flex-col items-center self-stretch",children:[e("span",{"aria-hidden":"true",className:p("flex shrink-0 items-center justify-center rounded-full font-semibold","text-[0.7em] leading-none",u,i[$],v),style:{width:A,height:A},children:f(r)?r:E?S+1:null}),T||"none"===R?null:e("span",{"aria-hidden":"true",className:p("mt-1 w-0 flex-1 border-s-2",c[R],a[$],v)})]}),l("div",{className:"min-w-0 flex-1 pb-0.5",children:[f(s)?e("div",{className:p("font-semibold",h[C],m[$],v),children:s}):null,f(b)?e("div",{className:p(f(s)?"mt-1":"","text-(--plass-muted-fg)"),children:b}):null]})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import*as n from"react";import{useDefaults as l}from"../../internal/defaults.js";import{useLabels as o}from"../../internal/labels.js";import{lazyPart as i}from"../../internal/lazy.js";import{PlSkeleton as a}from"../skeleton/PlSkeleton.js";import{PlassWatermark as s}from"../../internal/watermark.js";import{isSideways as u,layerStyle as c,objectPosition as d,poseStyle as f,quartersOf as h}from"../../internal/image.js";import{cx as p,focusRingClasses as b,radiusClasses as m,transitionClasses as v}from"../../internal/styles.js";function boxLength(e){return"number"==typeof e||/^\d+(\.\d+)?$/.test(e.trim())?`${Number(e)}px`:e}const g=Number.parseInt(n.version,10)>=19?"fetchPriority":"fetchpriority",y={none:"none",grayscale:"grayscale(1)",sepia:"sepia(0.72)",saturate:"saturate(1.35)",desaturate:"saturate(0.45)",contrast:"contrast(1.2)",dim:"brightness(0.82)"},w={draggable:!1,onDragStart:e=>e.preventDefault(),onContextMenu:e=>e.preventDefault()},j={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"};function subscribeToNothing(){return()=>{}}function onClient(){return!1}function onServer(){return!0}const S=/* @__PURE__ */i(()=>import("./PlImagePreview.js").then(e=>e.PlImagePreview));export const PlImage=/* @__PURE__ */n.forwardRef(function PlImage({alt:i,src:x,ratio:k,fit:P="cover",position:N,letterbox:z="none",rotate:L=0,flip:R="none",filter:$,watermark:C,protect:E=!1,rounded:I=!1,size:U,color:W,placeholder:O,fallback:T,preview:B=!1,previewLabel:D,onStatusChange:F,className:q,style:A,loading:H,priority:M=!1,width:V,height:G,...J},K){const Q=l(),X=o(),Y=D??X.preview,Z=U??Q.size??"md",_=W??Q.color??"primary",[ee,te]=n.useState({status:"loading",natural:null}),re=ee.status,[ne,le]=n.useState(!1),[oe,ie]=n.useState(!1),ae=function useServedSrc(e){const t=n.useSyncExternalStore(subscribeToNothing,onClient,onServer),[r]=n.useState(t?e:void 0);return r}(x),se=Boolean(x)&&ae===x&&void 0===C&&!E,ue=se||"loaded"===re?"opacity-100":"opacity-0",ce=H??(M?"eager":"lazy"),de=J.fetchPriority??(M?"high":void 0),fe=void 0===de?null:{[g]:de},he=function isPicturePlaceholder(e){return"object"==typeof e&&null!==e&&!n.isValidElement(e)&&"src"in e}(O)?O:null,pe=function useStandInUrl(e){const[t,r]=n.useState(null);return n.useEffect(()=>{if("undefined"==typeof Blob||!(e instanceof Blob))return;const t=URL.createObjectURL(e);return r({blob:e,url:t}),()=>URL.revokeObjectURL(t)},[e]),"string"==typeof e?e:null!==t&&t.blob===e?t.url:void 0}(he?.src),be=n.useRef(null),me=n.useCallback(e=>{be.current=e,"function"==typeof K?K(e):K&&(K.current=e)},[K]),ve=n.useRef("loading"),ge=n.useRef(x),ye=n.useRef(null),settle=(e,t)=>{const r="loaded"===e?function naturalSize(e){return null!==e&&e.naturalWidth>0?{width:e.naturalWidth,height:e.naturalHeight}:null}(t):null;te(t=>t.status===e&&t.natural?.width===r?.width&&t.natural?.height===r?.height?t:{status:e,natural:r}),ve.current!==e&&(ve.current=e,F?.(e))};n.useLayoutEffect(()=>{const e=be.current;if(null!==e){if(ge.current!==x&&(ge.current=x,ve.current="loading"),e.getAttribute("src")&&e.complete)return e.naturalWidth>0&&(ye.current={src:x,file:e.currentSrc}),void settle(e.naturalWidth>0?"loaded":"error",e);te(e=>"loading"===e.status?e:{status:"loading",natural:null})}},[x]);const we=I?m[Z]:"",je=void 0===$?void 0:y[$]??$,Se=h(L),xe=u(Se),ke=f(Se,R),Pe=void 0===N?void 0:d(N,Se,R),Ne=void 0===je&&null===ke&&void 0===Pe?void 0:{...void 0===je?null:{"--p-filter":je},objectPosition:Pe,...ke},ze="blur"===z&&"cover"!==P&&"fill"!==P,Le="none"===z||"blur"===z?void 0:z,Re=void 0===je||"none"===je?"":`${je} `,$e=ze&&"error"!==re?e("img",{src:x,srcSet:J.srcSet,sizes:J.sizes,loading:ce,decoding:J.decoding,crossOrigin:J.crossOrigin,referrerPolicy:J.referrerPolicy,...fe,alt:"","aria-hidden":"true",draggable:!1,className:p("pointer-events-none block object-cover select-none",v,ue),style:{...c(Se,R,48),objectPosition:Pe,filter:`${Re}blur(24px)`}}):null,Ce=null!==he&&he.blur?!0===he.blur?20:he.blur:0,Ee=null===he||void 0===pe||"error"===re?null:e("img",{src:pe,alt:"","aria-hidden":"true",draggable:!1,className:p("pointer-events-none block select-none","[--p-hold:var(--plass-duration)] motion-reduce:[--p-hold:0ms]",j[P]),style:{...c(Se,R,2*Ce),objectPosition:Pe,filter:""===Re&&0===Ce?void 0:`${Re}blur(${Ce}px)`,..."loaded"===re?{opacity:0,transition:"opacity 0ms linear var(--p-hold)"}:null}}),Ie="loading"===re&&null===he?e("span",{className:"absolute inset-0",children:void 0===O?e(a,{shape:"rect",color:_,size:Z,width:"100%",height:"100%",className:we}):O}):null,Ue=e("img",{ref:me,src:x,alt:i,loading:ce,width:V,height:G,onLoad:e=>{const t=e.currentTarget,r=ye.current;ye.current=null,null!==r&&r.src!==x&&r.file===t.currentSrc||settle("loaded",t)},onError:()=>settle("error",null),style:Ne,className:p("block size-full",j[P],void 0===je?"":"[filter:var(--p-filter,none)]",v,ze||null!==Ee||se&&null!==Ie?"relative":"",ue,"error"===re?"hidden":"",E?"select-none [-webkit-touch-callout:none]":""),...fe,...J,...E?w:null}),We=r(t,{children:[$e,Ee,se?Ie:null,Ue,se?null:Ie,"error"===re?e("span",{className:"absolute inset-0 flex items-center justify-center bg-(--plass-glass-press) p-3 text-center text-[0.8125rem] text-(--plass-muted-fg)",children:T??i}):null,void 0!==C&&"loaded"===re?e(s,{watermark:C}):null]}),Oe=function pixelSize(e,t){const r=Number(e),n=Number(t);return void 0!==e&&void 0!==t&&r>0&&n>0?{width:r,height:n}:null}(V,G)??ee.natural,Te=void 0===G&&void 0!==V?boxLength(V):void 0,Be=void 0===V&&void 0!==G?boxLength(G):void 0,De=void 0===k&&xe&&null!==Oe&&void 0===Be?`${Oe.height} / ${Oe.width}`:k,Fe=p("relative block overflow-hidden",we,q),qe={...void 0===Te?null:{width:Te,maxWidth:"100%"},...void 0===Be?null:{height:Be,...void 0===k?null:{width:"auto",maxWidth:"100%"}},aspectRatio:De,background:Le,containerType:xe?"size":void 0,...A};return B?r(t,{children:[e("button",{type:"button","aria-label":i?`${i} — ${Y.toLowerCase()}`:Y,onClick:()=>{ie(!0),le(!0)},onPointerEnter:S.preload,onFocus:S.preload,onTouchStart:S.preload,disabled:"loaded"!==re,className:p(Fe,"w-full cursor-zoom-in p-0",b),style:qe,children:We}),oe?e(n.Suspense,{fallback:null,children:e(S,{open:ne,onOpenChange:le,onUnavailable:()=>{le(!1),ie(!1)},src:x,alt:i,label:Y,color:_,protect:E,watermark:C,quarters:Se,flip:R,file:Oe})}):null]}):e("span",{className:Fe,style:qe,children:We})});
|
|
@@ -49,8 +49,9 @@ export interface PlImagePreviewProps {
|
|
|
49
49
|
* overlay and the chrome around it — several times the weight of the picture
|
|
50
50
|
* component that opens it — and `preview` is off by default, so a page drawing
|
|
51
51
|
* a wall of thumbnails would otherwise be paying for a lightbox it never shows.
|
|
52
|
-
* Reached through `React.lazy
|
|
53
|
-
*
|
|
52
|
+
* Reached through `React.lazy` and rendered from the first open, the chunk is
|
|
53
|
+
* fetched once a reader points at, focuses or opens a picture, and never on a
|
|
54
|
+
* page where nobody does.
|
|
54
55
|
*
|
|
55
56
|
* The same bargain `PlGallery` makes with `PlGalleryViewer`, for the same
|
|
56
57
|
* reason.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type CartesianChartProps } from '../../internal/chart-frame.js';
|
|
3
3
|
import { type ChartMarkers } from '../../internal/chart-line.js';
|
|
4
|
-
import type { PlassChartCurve, PlassChartValueLabels } from '../../types.js';
|
|
4
|
+
import type { PlassChartCurve, PlassChartLabelColor, PlassChartNulls, PlassChartValueLabels } from '../../types.js';
|
|
5
5
|
export interface PlLineChartProps extends CartesianChartProps {
|
|
6
6
|
/**
|
|
7
7
|
* How the line gets from one point to the next.
|
|
@@ -33,11 +33,24 @@ export interface PlLineChartProps extends CartesianChartProps {
|
|
|
33
33
|
*/
|
|
34
34
|
gradient?: boolean;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* What a gap in a series does to the line.
|
|
37
37
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
38
|
+
* - `gap` — it breaks at the `null`. The default, and the only answer that
|
|
39
|
+
* claims nothing the data did not: the blank says the reading is missing.
|
|
40
|
+
* - `connect` — the two sides are joined. Only when the gap is an artefact of
|
|
41
|
+
* how the data was collected; otherwise the segment is a number the chart
|
|
42
|
+
* made up.
|
|
43
|
+
* - `zero` — the gap is read as a zero, everywhere: on the axis, in the
|
|
44
|
+
* tooltip and in the table as well as under the line. For a missing row
|
|
45
|
+
* that genuinely means none.
|
|
46
|
+
* @default 'gap'
|
|
47
|
+
*/
|
|
48
|
+
nulls?: PlassChartNulls;
|
|
49
|
+
/**
|
|
50
|
+
* Bridges a gap instead of breaking at it.
|
|
51
|
+
* @deprecated Use `nulls`. `connectNulls` is `nulls="connect"`, and `nulls`
|
|
52
|
+
* also has the third answer — reading the gap as a zero — which a boolean
|
|
53
|
+
* cannot express. It is still honoured when `nulls` is not given.
|
|
41
54
|
*/
|
|
42
55
|
connectNulls?: boolean;
|
|
43
56
|
/**
|
|
@@ -47,6 +60,19 @@ export interface PlLineChartProps extends CartesianChartProps {
|
|
|
47
60
|
* @default 'none'
|
|
48
61
|
*/
|
|
49
62
|
valueLabels?: PlassChartValueLabels;
|
|
63
|
+
/**
|
|
64
|
+
* What colour those numbers are written in.
|
|
65
|
+
*
|
|
66
|
+
* `series` — the default — gives each label the colour of the line it is
|
|
67
|
+
* sitting on, so a plot with four labelled series says which number belongs
|
|
68
|
+
* to which without the reader tracing it back. `ink` writes them all in the
|
|
69
|
+
* page's own foreground: the chart palette clears 4:1 against the sheet,
|
|
70
|
+
* which is the floor a *mark* is held to rather than the 4.5:1 body text
|
|
71
|
+
* wants, so reach for it where the labels have to meet the text contrast rule
|
|
72
|
+
* on their own.
|
|
73
|
+
* @default 'series'
|
|
74
|
+
*/
|
|
75
|
+
valueLabelColor?: PlassChartLabelColor;
|
|
50
76
|
/**
|
|
51
77
|
* Stacks the series, each line riding on the total of the ones below it.
|
|
52
78
|
*
|
|
@@ -71,4 +97,4 @@ export interface PlLineChartProps extends CartesianChartProps {
|
|
|
71
97
|
* from the shared frame, which is what makes a PlLineChart and a PlBarChart on one
|
|
72
98
|
* dashboard read as one drawing rather than two.
|
|
73
99
|
*/
|
|
74
|
-
export declare function PlLineChart({ curve, markers, gradient, connectNulls, valueLabels, stacked, ...props }: PlLineChartProps): React.JSX.Element;
|
|
100
|
+
export declare function PlLineChart({ curve, markers, gradient, nulls: nullsProp, connectNulls, valueLabels, valueLabelColor, stacked, series, ...props }: PlLineChartProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{CartesianChart as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{CartesianChart as a}from"../../internal/chart-frame.js";import{zeroNulls as t}from"../../internal/chart.js";import{LineSeries as n}from"../../internal/chart-line.js";export function PlLineChart({curve:o="linear",markers:s="auto",gradient:l=!1,nulls:i,connectNulls:c=!1,valueLabels:u="none",valueLabelColor:m="series",stacked:d=!1,series:f,...p}){const h=r.useId().replace(/:/g,""),k=i??(c?"connect":"gap"),v=r.useMemo(()=>"zero"===k?t(f):f,[k,f]);return e(a,{...p,series:v,stacked:d,stroked:!0,inset:!0,includeZero:!1,headroom:"none"===u?0:10,children:r=>e(n,{context:r,curve:o,filled:!1,stacked:d,markers:s,valueLabels:u,valueLabelColor:m,nulls:k,gradient:l,idPrefix:h})})}
|
|
@@ -52,6 +52,15 @@ export interface PlListItemProps extends Omit<React.ComponentPropsWithoutRef<'li
|
|
|
52
52
|
selected?: boolean;
|
|
53
53
|
/** Unavailable. The light goes out, the same way it does everywhere else. */
|
|
54
54
|
disabled?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Renders the row's link as something other than an `<a>`: the `Link` a
|
|
57
|
+
* router brings. Base UI's own escape hatch, as on `PlTextLink`.
|
|
58
|
+
*
|
|
59
|
+
* Giving one makes the row a link, as an `href` does, and an `href` on the
|
|
60
|
+
* element wins over the row's own. A disabled row goes nowhere, so it does
|
|
61
|
+
* not use it.
|
|
62
|
+
*/
|
|
63
|
+
render?: useRender.RenderProp;
|
|
55
64
|
/** The label. */
|
|
56
65
|
children?: React.ReactNode;
|
|
57
66
|
}
|
|
@@ -73,10 +82,12 @@ export declare const PlList: React.ForwardRefExoticComponent<PlListProps & React
|
|
|
73
82
|
* One row.
|
|
74
83
|
*
|
|
75
84
|
* The shell is always an `<li>`. What changes is what is inside it: a plain run
|
|
76
|
-
* of content, or — when `onClick` or `
|
|
77
|
-
* `<a>` wrapping that content, with `action` sitting outside it
|
|
78
|
-
* control. This is the same shape a `PlChip` uses, for the same
|
|
79
|
-
* `<span>` carrying a click handler is invisible to a keyboard,
|
|
80
|
-
* `<button>` inside a `<button>` is markup the browser silently un-nests.
|
|
85
|
+
* of content, or — when `onClick`, `href` or `render` is given — a real
|
|
86
|
+
* `<button>` or `<a>` wrapping that content, with `action` sitting outside it
|
|
87
|
+
* as a separate control. This is the same shape a `PlChip` uses, for the same
|
|
88
|
+
* two reasons: a `<span>` carrying a click handler is invisible to a keyboard,
|
|
89
|
+
* and a `<button>` inside a `<button>` is markup the browser silently un-nests.
|
|
90
|
+
* A disabled row keeps its element: the `<a>` loses its address and the
|
|
91
|
+
* `<button>` takes `disabled`.
|
|
81
92
|
*/
|
|
82
93
|
export declare const PlListItem: React.ForwardRefExoticComponent<PlListItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s,Fragment as l}from"react/jsx-runtime";import*as r from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useRender as a}from"@base-ui/react/use-render";import{focusRingClasses as i,gapClasses as n,glassClasses as o,hasContent as d,iconClasses as c,metaTextClasses as p,paddingXClasses as m,radiusClasses as f,sheetBodyClasses as x,surfaceSlots as u,transitionClasses as h}from"../../internal/styles.js";const
|
|
1
|
+
"use client";import{jsx as e,jsxs as s,Fragment as l}from"react/jsx-runtime";import*as r from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useRender as a}from"@base-ui/react/use-render";import{focusRingClasses as i,gapClasses as n,glassClasses as o,hasContent as d,iconClasses as c,metaTextClasses as p,paddingXClasses as m,radiusClasses as f,sheetBodyClasses as x,surfaceSlots as u,transitionClasses as h}from"../../internal/styles.js";const v=/* @__PURE__ */r.createContext({size:"md",density:"default",dividers:!1}),g={solid:/* @__PURE__ */[o,"text-(--plass-fg) bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */[o,"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-transparent"},y={default:{xs:"py-1",sm:"py-1.5",md:"py-2",lg:"py-2.5",xl:"py-3"},compact:{xs:"py-0.5",sm:"py-0.5",md:"py-1",lg:"py-1.5",xl:"py-2"}},b=m,N={xs:f.xs,sm:f.xs,md:f.sm,lg:f.sm,xl:f.md};export const PlList=/* @__PURE__ */r.forwardRef(function PlList({variant:s="glass",size:l,color:i,density:n,elevation:o=0,dividers:d=!1,render:c,className:p,style:m,children:x,...y},b){const N=t(),j=l??N.size??"md",w=i??N.color??"primary",k=n??N.density??"default",z=r.useMemo(()=>({size:j,density:k,dividers:d}),[j,k,d]),B=["m-0 flex list-none flex-col",f[j],g[s],h,d?"overflow-hidden p-0 [&>li+li]:border-t [&>li+li]:[border-color:var(--plass-divider)]":"p-1",p??""].filter(Boolean).join(" "),C=a({render:c,ref:b,props:{role:"list",className:B,style:{...u(w,o),...m},children:x,...y}});return e(v.Provider,{value:z,children:C})});export const PlListItem=/* @__PURE__ */r.forwardRef(function PlListItem({startIcon:t,endIcon:o,description:m,action:f,href:u,selected:g=!1,disabled:j=!1,render:w,className:k,children:z,onClick:B,...C},P){const{size:I,density:L,dividers:$}=r.useContext(v),R=Boolean(u||w),F=(R||Boolean(B))&&!j,M=b[L][I],q=["flex min-w-0 flex-1 items-center text-start",M,y[L][I],n[I],x[I],h,c,$?"":N[I],j?"cursor-not-allowed opacity-50 saturate-[0.35]":g?"bg-(--p-soft-press) font-medium text-(--p-accent)":"",F?`cursor-pointer ${i}`:"",F&&!g?"hover:bg-(--p-soft)":"",F&&g?"hover:bg-(--p-soft-press)":""].filter(Boolean).join(" "),A=s(l,{children:[d(t)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:t}):null,s("span",{className:"flex min-w-0 flex-1 flex-col",children:[d(z)?e("span",{className:"truncate",children:z}):null,d(m)?e("span",{className:`truncate text-(--plass-muted-fg) ${p[I]}`,children:m}):null]}),d(o)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:o}):null]}),D=a({render:j?e("a",{}):w??e("a",{}),enabled:R,props:{href:j?void 0:u,role:j?"link":void 0,"aria-disabled":j||void 0,className:q,"aria-current":g&&!j?"page":void 0,onClick:j?void 0:B,children:A}});return s("li",{ref:P,className:["flex w-full items-center",k??""].filter(Boolean).join(" "),...C,children:[D||(B?e("button",{type:"button",className:q,disabled:j,"aria-current":!(!g||j)||void 0,onClick:B,children:A}):e("div",{className:q,"aria-disabled":j||void 0,children:A})),d(f)?e("div",{className:`flex shrink-0 items-center ${M}`,children:f}):null]})});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { Menu as BaseUIMenu } from '@base-ui/react/menu';
|
|
3
|
+
import type { useRender } from '@base-ui/react/use-render';
|
|
2
4
|
import type { PlassAlign, PlassColor, PlassSide, PlassStyleProps } from '../../types.js';
|
|
3
5
|
/**
|
|
4
6
|
* A menu takes `size`, `color` and `density` and stops there.
|
|
@@ -73,6 +75,16 @@ export interface PlMenuItemProps {
|
|
|
73
75
|
target?: string;
|
|
74
76
|
/** The link's `rel`. Ignored without `href`. */
|
|
75
77
|
rel?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Renders the row's link as something other than an `<a>`: the `Link` a
|
|
80
|
+
* router brings. Base UI's own escape hatch, handed to its link row.
|
|
81
|
+
*
|
|
82
|
+
* Giving one makes the row a link, as an `href` does, and an `href` on the
|
|
83
|
+
* element wins over the row's own. The row's role, its highlight and the
|
|
84
|
+
* arrow keys stay Base UI's. A disabled row is not a link, so it does not use
|
|
85
|
+
* it.
|
|
86
|
+
*/
|
|
87
|
+
render?: useRender.RenderProp<BaseUIMenu.LinkItem.State>;
|
|
76
88
|
/** Content before the label — an icon, a swatch, a check. */
|
|
77
89
|
startIcon?: React.ReactNode;
|
|
78
90
|
/** Content after the label, before any `shortcut`. */
|
|
@@ -124,7 +136,7 @@ export interface PlMenuGroupProps {
|
|
|
124
136
|
className?: string;
|
|
125
137
|
style?: React.CSSProperties;
|
|
126
138
|
}
|
|
127
|
-
export interface PlMenuCheckboxItemProps extends Omit<PlMenuItemProps, 'href' | 'target' | 'rel' | 'startIcon' | 'onClick'> {
|
|
139
|
+
export interface PlMenuCheckboxItemProps extends Omit<PlMenuItemProps, 'href' | 'target' | 'rel' | 'render' | 'startIcon' | 'onClick'> {
|
|
128
140
|
checked?: boolean;
|
|
129
141
|
defaultChecked?: boolean;
|
|
130
142
|
onCheckedChange?: (checked: boolean) => void;
|
|
@@ -145,7 +157,7 @@ export interface PlMenuRadioGroupProps {
|
|
|
145
157
|
className?: string;
|
|
146
158
|
style?: React.CSSProperties;
|
|
147
159
|
}
|
|
148
|
-
export interface PlMenuRadioItemProps extends Omit<PlMenuItemProps, 'href' | 'target' | 'rel' | 'startIcon' | 'onClick'> {
|
|
160
|
+
export interface PlMenuRadioItemProps extends Omit<PlMenuItemProps, 'href' | 'target' | 'rel' | 'render' | 'startIcon' | 'onClick'> {
|
|
149
161
|
/** What this row sets the group to. */
|
|
150
162
|
value: string | number;
|
|
151
163
|
/** @default false */
|
|
@@ -155,12 +167,12 @@ export type PlMenuSeparatorProps = React.ComponentPropsWithoutRef<'div'>;
|
|
|
155
167
|
/**
|
|
156
168
|
* One row of a menu.
|
|
157
169
|
*
|
|
158
|
-
* Renders a real `<a>` when it is given an `href` and Base UI's
|
|
159
|
-
* otherwise — the same split `PlListItem` makes, for the same reason.
|
|
160
|
-
* links that are not links cannot be opened in a new tab, cannot be
|
|
161
|
-
* tells a screen reader the wrong thing about every one of them.
|
|
170
|
+
* Renders a real `<a>` when it is given an `href` or a `render` and Base UI's
|
|
171
|
+
* own item otherwise — the same split `PlListItem` makes, for the same reason.
|
|
172
|
+
* A menu of links that are not links cannot be opened in a new tab, cannot be
|
|
173
|
+
* copied, and tells a screen reader the wrong thing about every one of them.
|
|
162
174
|
*/
|
|
163
|
-
export declare function PlMenuItem({ onClick, href, target, rel, startIcon, endIcon, shortcut, description, color, closeOnClick, disabled, label, children, className, style }: PlMenuItemProps): React.JSX.Element;
|
|
175
|
+
export declare function PlMenuItem({ onClick, href, target, rel, render, startIcon, endIcon, shortcut, description, color, closeOnClick, disabled, label, children, className, style }: PlMenuItemProps): React.JSX.Element;
|
|
164
176
|
/** A row that ticks. The tick lands in the same slot a `startIcon` would. */
|
|
165
177
|
export declare function PlMenuCheckboxItem({ checked, defaultChecked, onCheckedChange, endIcon, shortcut, description, color, closeOnClick, disabled, label, children, className, style }: PlMenuCheckboxItemProps): React.JSX.Element;
|
|
166
178
|
/** One choice out of a set. Wraps the rows that make up the set. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s,Fragment as l}from"react/jsx-runtime";import*as n from"react";import{useDefaults as t}from"../../internal/defaults.js";import{Menu as a}from"@base-ui/react/menu";import{ContextMenu as o}from"@base-ui/react/context-menu";import{safeRel as r}from"../../internal/link.js";import{MenuContext as i}from"../../internal/menu.js";import{CheckIcon as c,ChevronIcon as d,DotIcon as p}from"../../internal/icons.js";import{controlTextLeadingClasses as u,cx as m,forcedHighlightedClasses as h,gapClasses as f,glassClasses as x,hasContent as y,iconClasses as g,metaTextClasses as b,radiusClasses as C,surfaceSlots as N,transitionClasses as v}from"../../internal/styles.js";const k=/* @__PURE__ */[x,"max-h-[min(24rem,var(--available-height))] min-w-40 overflow-y-auto overscroll-contain","border bg-(--plass-glass-press) p-1","[border-color:var(--plass-glass-line)]","[box-shadow:var(--plass-shadow-3),var(--plass-gloss-glass)]","[outline:none]","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),w={default:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-2",xl:"px-3.5 py-2.5"},compact:{xs:"px-1 py-0.5",sm:"px-1.5 py-0.5",md:"px-2 py-1",lg:"px-2.5 py-1",xl:"px-3 py-1.5"}},z={xs:C.xs,sm:C.xs,md:C.sm,lg:C.sm,xl:C.md};function rowClasses(e,s,l,n){return m("relative flex w-full cursor-pointer items-center select-none",l?"text-(--p-accent)":"text-(--plass-fg)",w[s][e],z[e],f[e],u[e],v,g,"data-[highlighted]:bg-(--p-soft-hover)",h,"data-[popup-open]:bg-(--p-soft)","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","[outline:none]",n)}const O="flex h-[1lh] w-[1.2em] shrink-0 items-center justify-center";function shortcutClasses(e){return m("ms-2 shrink-0 text-(--plass-muted-fg) tabular-nums",b[e])}function RowBody({children:l,description:n,size:t}){return y(n)?s("span",{className:"flex min-w-0 flex-1 flex-col text-start",children:[e("span",{className:"truncate",children:l}),e("span",{className:m("truncate text-(--plass-muted-fg)",b[t]),children:n})]}):e("span",{className:"min-w-0 flex-1 truncate text-start",children:l})}export function PlMenuItem({onClick:t,href:o,target:c,rel:d,
|
|
1
|
+
"use client";import{jsx as e,jsxs as s,Fragment as l}from"react/jsx-runtime";import*as n from"react";import{useDefaults as t}from"../../internal/defaults.js";import{Menu as a}from"@base-ui/react/menu";import{ContextMenu as o}from"@base-ui/react/context-menu";import{safeRel as r}from"../../internal/link.js";import{MenuContext as i}from"../../internal/menu.js";import{CheckIcon as c,ChevronIcon as d,DotIcon as p}from"../../internal/icons.js";import{controlTextLeadingClasses as u,cx as m,forcedHighlightedClasses as h,gapClasses as f,glassClasses as x,hasContent as y,iconClasses as g,metaTextClasses as b,radiusClasses as C,surfaceSlots as N,transitionClasses as v}from"../../internal/styles.js";const k=/* @__PURE__ */[x,"max-h-[min(24rem,var(--available-height))] min-w-40 overflow-y-auto overscroll-contain","border bg-(--plass-glass-press) p-1","[border-color:var(--plass-glass-line)]","[box-shadow:var(--plass-shadow-3),var(--plass-gloss-glass)]","[outline:none]","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),w={default:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-2",xl:"px-3.5 py-2.5"},compact:{xs:"px-1 py-0.5",sm:"px-1.5 py-0.5",md:"px-2 py-1",lg:"px-2.5 py-1",xl:"px-3 py-1.5"}},z={xs:C.xs,sm:C.xs,md:C.sm,lg:C.sm,xl:C.md};function rowClasses(e,s,l,n){return m("relative flex w-full cursor-pointer items-center select-none",l?"text-(--p-accent)":"text-(--plass-fg)",w[s][e],z[e],f[e],u[e],v,g,"data-[highlighted]:bg-(--p-soft-hover)",h,"data-[popup-open]:bg-(--p-soft)","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","[outline:none]",n)}const O="flex h-[1lh] w-[1.2em] shrink-0 items-center justify-center";function shortcutClasses(e){return m("ms-2 shrink-0 text-(--plass-muted-fg) tabular-nums",b[e])}function RowBody({children:l,description:n,size:t}){return y(n)?s("span",{className:"flex min-w-0 flex-1 flex-col text-start",children:[e("span",{className:"truncate",children:l}),e("span",{className:m("truncate text-(--plass-muted-fg)",b[t]),children:n})]}):e("span",{className:"min-w-0 flex-1 truncate text-start",children:l})}export function PlMenuItem({onClick:t,href:o,target:c,rel:d,render:p,startIcon:u,endIcon:h,shortcut:f,description:x,color:g,closeOnClick:b=!0,disabled:C=!1,label:v,children:k,className:w,style:z}){const{size:P,density:I}=n.useContext(i),M=s(l,{children:[y(u)?e("span",{className:m(O,"text-(--plass-muted-fg)"),children:u}):null,e(RowBody,{description:x,size:P,children:k}),y(h)?e("span",{className:m(O,"text-(--plass-muted-fg)"),children:h}):null,y(f)?e("span",{className:shortcutClasses(P),children:f}):null]}),j=g?N(g,0):void 0,R=j||z?{...j,...z}:void 0;return void 0===o&&void 0===p||C?e(a.Item,{disabled:C,label:v,closeOnClick:b,onClick:t,className:rowClasses(P,I,Boolean(g),w),style:R,children:M}):e(a.LinkItem,{render:p,href:o,target:c,rel:r(c,d),label:v,closeOnClick:b,onClick:t,className:rowClasses(P,I,Boolean(g),w),style:R,children:M})}export function PlMenuCheckboxItem({checked:l,defaultChecked:t,onCheckedChange:o,endIcon:r,shortcut:d,description:p,color:u,closeOnClick:h=!1,disabled:f=!1,label:x,children:g,className:b,style:C}){const{size:v,density:k}=n.useContext(i),w=u?N(u,0):void 0;return s(a.CheckboxItem,{checked:l,defaultChecked:t,onCheckedChange:e=>o?.(e),disabled:f,label:x,closeOnClick:h,className:rowClasses(v,k,Boolean(u),b),style:w||C?{...w,...C}:void 0,children:[e("span",{className:m(O,"text-(--p-accent)"),children:e(a.CheckboxItemIndicator,{className:"flex items-center justify-center",children:e(c,{})})}),e(RowBody,{description:p,size:v,children:g}),y(r)?e("span",{className:m(O,"text-(--plass-muted-fg)"),children:r}):null,y(d)?e("span",{className:shortcutClasses(v),children:d}):null]})}export function PlMenuRadioGroup({value:s,defaultValue:l,onValueChange:n,disabled:t=!1,children:o,className:r,style:i}){return e(a.RadioGroup,{value:s,defaultValue:l,onValueChange:e=>n?.(e),disabled:t,className:r,style:i,children:o})}export function PlMenuRadioItem({value:l,endIcon:t,shortcut:o,description:r,color:c,closeOnClick:d=!1,disabled:u=!1,label:h,children:f,className:x,style:g}){const{size:b,density:C}=n.useContext(i),v=c?N(c,0):void 0;return s(a.RadioItem,{value:l,disabled:u,label:h,closeOnClick:d,className:rowClasses(b,C,Boolean(c),x),style:v||g?{...v,...g}:void 0,children:[e("span",{className:m(O,"text-(--p-accent)"),children:e(a.RadioItemIndicator,{className:"flex items-center justify-center",children:e(p,{})})}),e(RowBody,{description:r,size:b,children:f}),y(t)?e("span",{className:m(O,"text-(--plass-muted-fg)"),children:t}):null,y(o)?e("span",{className:shortcutClasses(b),children:o}):null]})}export function PlMenuGroup({label:l,children:t,className:o,style:r}){const{size:c,density:d}=n.useContext(i);return s(a.Group,{className:o,style:r,children:[y(l)?e(a.GroupLabel,{className:m(w[d][c],b[c],"font-semibold tracking-wide text-(--plass-muted-fg) uppercase"),children:l}):null,t]})}export function PlMenuSeparator({className:s,...l}){return e(a.Separator,{className:m("-mx-1 my-1 h-px bg-(--plass-divider)",s),...l})}export function PlMenuSubmenu({label:l,startIcon:t,disabled:o=!1,side:r,sideOffset:c=4,children:p,className:h,style:f}){const{size:x,density:g,color:b}=n.useContext(i);return s(a.SubmenuRoot,{children:[s(a.SubmenuTrigger,{disabled:o,className:rowClasses(x,g,!1),children:[y(t)?e("span",{className:m(O,"text-(--plass-muted-fg)"),children:t}):null,e("span",{className:"min-w-0 flex-1 truncate text-start",children:l}),e("span",{className:m(O,"text-(--plass-muted-fg) -rotate-90 rtl:rotate-90"),children:e(d,{})})]}),e(a.Portal,{children:e(a.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",side:r??"inline-end",sideOffset:c,align:"start",children:e(a.Popup,{className:m(k,C[x],u[x],h),style:{...N(b,3),...f},children:p})})})]})}export function PlMenu({size:l,color:o,density:r,trigger:c,open:d,defaultOpen:p,onOpenChange:h,side:f="bottom",align:x="start",sideOffset:y=6,modal:g=!0,openOnHover:b=!1,loopFocus:v=!0,disabled:w=!1,className:z,style:O,children:P}){const I=t(),M=l??I.size??"md",j=o??I.color??"primary",R=r??I.density??"default",B=n.useMemo(()=>({size:M,color:j,density:R}),[M,j,R]);return e(i.Provider,{value:B,children:s(a.Root,{open:d,defaultOpen:p,onOpenChange:e=>h?.(e),modal:g,loopFocus:v,disabled:w,children:[c?e(a.Trigger,{render:c,openOnHover:b,disabled:w}):null,e(a.Portal,{children:e(a.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",side:f,align:x,sideOffset:y,children:e(a.Popup,{className:m(k,C[M],u[M],z),style:{...N(j,3),...O},children:P})})})]})})}export function PlContextMenu({size:l,color:a,density:r,content:c,children:d,open:p,defaultOpen:h,onOpenChange:f,loopFocus:x=!0,disabled:y=!1,className:g,style:b}){const v=t(),w=l??v.size??"md",z=a??v.color??"primary",O=r??v.density??"default",P=n.useMemo(()=>({size:w,color:z,density:O}),[w,z,O]);return e(i.Provider,{value:P,children:s(o.Root,{open:p,defaultOpen:h,onOpenChange:e=>f?.(e),loopFocus:x,disabled:y,children:[e(o.Trigger,{children:d}),e(o.Portal,{children:e(o.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",children:e(o.Popup,{className:m(k,C[w],u[w],g),style:{...N(z,3),...b},children:c})})})]})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import*as s from"react";import{useDefaults as o}from"../../internal/defaults.js";import{Menubar as r}from"@base-ui/react/menubar";import{PlMenu as n}from"../menu/PlMenu.js";import{MenuContext as a}from"../../internal/menu.js";import{controlTextClasses as i,cx as l,gapClasses as c,hasContent as p,iconClasses as d,paddingXClasses as u,radiusClasses as m,transitionClasses as f}from"../../internal/styles.js";const b={xs:"h-4.5",sm:"h-5.5",md:"h-6.5",lg:"h-8",xl:"h-10"},h=/* @__PURE__ */["inline-flex shrink-0 cursor-pointer select-none items-center justify-center","whitespace-nowrap font-medium leading-none","text-(--plass-fg) bg-transparent","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",f,d,"hover:bg-(--p-soft)","data-[popup-open]:bg-(--p-soft-hover) data-[popup-open]:text-(--p-accent)","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]","disabled:cursor-not-allowed disabled:opacity-50 disabled:saturate-[0.35]","disabled:hover:bg-transparent"].join(" ");export function PlMenubarMenu({label:o,startIcon:r,disabled:d=!1,children:f,className:v,style:x}){const{size:g,color:y,density:j}=s.useContext(a);return t(n,{size:g,color:y,density:j,disabled:d,openOnHover:!0,sideOffset:4,trigger:e("button",{type:"button",disabled:d,className:l(h,b[g],i[g],c[g],u["default"===j?"compact":j][g],m[g],v),style:x,children:[p(r)?r:null,o]}),children:f})}export const PlMenubar=/* @__PURE__ */s.forwardRef(function PlMenubar({size:e,color:n,density:i,orientation:p="horizontal",modal:d=!0,loopFocus:u=!0,disabled:m=!1,className:f,style:b,children:h,...v},x){const g=o(),y=e??g.size??"md",j=n??g.color??"primary",M=i??g.density??"default",w=s.useMemo(()=>({size:y,color:j,density:M}),[y,j,M]);return t(a.Provider,{value:w,children:t(r,{ref:x,orientation:p,modal:d,loopFocus:u,disabled:m,className:l("flex items-center","vertical"===p?"flex-col items-stretch":"flex-row",c[y],f),style:{"--p-soft":`var(--plass-${j}-soft)`,"--p-soft-hover":`var(--plass-${j}-soft-hover)`,"--p-accent":`var(--plass-${j}-accent)`,"--p-ring":`var(--plass-${j}-ring)`,...b},...v,children:h})})});
|
|
1
|
+
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import*as s from"react";import{useDefaults as o}from"../../internal/defaults.js";import{Menubar as r}from"@base-ui/react/menubar";import{PlMenu as n}from"../menu/PlMenu.js";import{MenuContext as a}from"../../internal/menu.js";import{controlTextClasses as i,cx as l,gapClasses as c,hasContent as p,iconClasses as d,paddingXClasses as u,radiusClasses as m,transitionClasses as f}from"../../internal/styles.js";const b={xs:"h-4.5",sm:"h-5.5",md:"h-6.5",lg:"h-8",xl:"h-10"},h=/* @__PURE__ */["inline-flex shrink-0 cursor-pointer select-none items-center justify-center p-0","whitespace-nowrap font-medium leading-none","text-(--plass-fg) bg-transparent","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",f,d,"hover:bg-(--p-soft)","data-[popup-open]:bg-(--p-soft-hover) data-[popup-open]:text-(--p-accent)","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]","disabled:cursor-not-allowed disabled:opacity-50 disabled:saturate-[0.35]","disabled:hover:bg-transparent"].join(" ");export function PlMenubarMenu({label:o,startIcon:r,disabled:d=!1,children:f,className:v,style:x}){const{size:g,color:y,density:j}=s.useContext(a);return t(n,{size:g,color:y,density:j,disabled:d,openOnHover:!0,sideOffset:4,trigger:e("button",{type:"button",disabled:d,className:l(h,b[g],i[g],c[g],u["default"===j?"compact":j][g],m[g],v),style:x,children:[p(r)?r:null,o]}),children:f})}export const PlMenubar=/* @__PURE__ */s.forwardRef(function PlMenubar({size:e,color:n,density:i,orientation:p="horizontal",modal:d=!0,loopFocus:u=!0,disabled:m=!1,className:f,style:b,children:h,...v},x){const g=o(),y=e??g.size??"md",j=n??g.color??"primary",M=i??g.density??"default",w=s.useMemo(()=>({size:y,color:j,density:M}),[y,j,M]);return t(a.Provider,{value:w,children:t(r,{ref:x,orientation:p,modal:d,loopFocus:u,disabled:m,className:l("flex items-center","vertical"===p?"flex-col items-stretch":"flex-row",c[y],f),style:{"--p-soft":`var(--plass-${j}-soft)`,"--p-soft-hover":`var(--plass-${j}-soft-hover)`,"--p-accent":`var(--plass-${j}-accent)`,"--p-ring":`var(--plass-${j}-ring)`,...b},...v,children:h})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as r from"react";import{Meter as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as r from"react";import{Meter as a}from"@base-ui/react/meter";import{useDefaults as s,useLocale as t}from"../../internal/defaults.js";import{controlNaming as o}from"../../internal/form.js";import{barThicknessClasses as i,fillClasses as m,fillTransitionClasses as n,progressSlots as f,trackClasses as c}from"../../internal/progress.js";import{cx as u,metaTextClasses as d,stackGapClasses as p}from"../../internal/styles.js";import{bandColor as h}from"../../internal/threshold.js";export const PlMeter=/* @__PURE__ */r.forwardRef(function PlMeter({value:r,min:x=0,max:j=100,label:b,showValue:w=!1,format:y,thresholds:N,size:v,color:g,className:k,style:z,"aria-label":M,"aria-labelledby":P,...R},V){const I=s(),L=t(),T=v??I.size??"md",q=g??I.color??"primary";return l(a.Root,{ref:V,value:r,min:x,max:j,format:y,locale:L,className:u("flex w-full flex-col",p[T],k),style:{...f(h(r,q,N)),...z},...o(M,P),...R,children:[b||w?l("div",{className:u("flex items-baseline gap-2",b?"justify-between":"justify-end",d[T]),children:[b?e(a.Label,{className:"min-w-0 truncate text-(--plass-fg)",children:b}):null,w?e(a.Value,{className:"shrink-0 tabular-nums text-(--plass-muted-fg)"}):null]}):null,e(a.Track,{className:u("relative w-full overflow-hidden rounded-full",c,i[T]),children:e(a.Indicator,{className:u("rounded-full",m,n)})})]})});
|
|
@@ -99,6 +99,12 @@ export interface PlMockupProps extends Omit<React.ComponentPropsWithoutRef<'div'
|
|
|
99
99
|
* any CSS length. The device is laid out at its own resolution and then scaled
|
|
100
100
|
* to whatever this comes to, so the content inside is genuinely a screen's
|
|
101
101
|
* worth rather than a page's worth shrunk.
|
|
102
|
+
*
|
|
103
|
+
* A number, with `height` left out or a number too, is a size known on the
|
|
104
|
+
* server, and the device is drawn at that scale in the first HTML. With any
|
|
105
|
+
* other length the stylesheet works the scale out from the box until the
|
|
106
|
+
* browser has measured it, so a server-rendered page has the device in its
|
|
107
|
+
* first HTML either way.
|
|
102
108
|
* @default '100%'
|
|
103
109
|
*/
|
|
104
110
|
width?: number | string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import*as a from"react";import{useRender as r}from"@base-ui/react/use-render";import{PlMockupCutout as h,defaultNotch as s,elevationFilters as l,finishSlots as o,mockupChrome as n,mockupMetrics as d,resolveOs as c,shellClasses as p}from"../../internal/mockup.js";import{cx as m,surfaceSlots as u}from"../../internal/styles.js";import{usePlElementSize as f}from"../../hooks/usePlElementSize.js";import{useDefaults as g}from"../../internal/defaults.js";export const PlMockup=/* @__PURE__ */a.forwardRef(function PlMockup(w,v){const{device:b,os:x,hardware:y="monitor",size:k,resolution:N,orientation:$="portrait",bezel:z="standard",finish:R="graphite",notch:M,systemUi:j=!0,scroll:P=!1,wallpaper:H,time:W="9:41",width:q,height:S,color:T,elevation:B=0,render:E,className:F,style:I,children:U,...A}=w,C=g(),D=k??C.size??"md",G=T??C.color??"primary",J=c(b,x),K=M??s(b,J),L="desktop"!==b&&"landscape"===$,O=d({device:b,size:D,resolution:N,orientation:$,bezel:z,hardware:y}),{screen:Q,frame:V,body:X,stand:Y,base:Z}=O,_=a.useRef(null),ee=f(_),te=null!==ee&&(ee.width<=0||ee.height<=0),ie=null===ee||te?null:Math.min(ee.width/V.width,ee.height/V.height),ae="number"==typeof q&&q>0?void 0===S?q/V.width:"number"==typeof S&&S>0?Math.min(q/V.width,S/V.height):null:"number"==typeof S&&S>0&&void 0===q?S/V.height:null,re=ie??ae??`min(tan(atan2(100cqw, ${V.width}px)), tan(atan2(100cqh, ${V.height}px)))`,he=j?n({os:J,notch:K,landscape:L,time:W}):{},se="none"===z,le=t("div",{className:"plass-mockup-screen relative flex flex-col overflow-hidden",style:{width:Q.width,height:Q.height,borderRadius:O.screenRadius,background:H??"var(--plass-surface)",boxShadow:se?void 0:"inset 0 0 0 1px var(--p-shell-shade)"},children:[he.top?.node,t("div",{className:"flex min-h-0 flex-1",children:[he.start?.node,e("div",{className:"min-w-0 flex-1 "+(P?"overflow-auto":"overflow-hidden"),style:{containerType:"size",containerName:"plass-screen"},children:U})]}),he.bottom?.node,e(h,{notch:K,screen:Q,landscape:L})]}),oe=m("plass-mockup relative block",F??"");return r({render:E,ref:v,props:{className:oe,style:{...u(G,B),...o[R],width:q??(void 0===S?"100%":"auto"),height:S??"auto",aspectRatio:`${V.width} / ${V.height}`,filter:l[B],...I},children:e("div",{ref:_,className:"absolute inset-0 flex items-center justify-center",style:{containerType:"size",visibility:te&&null===ae?"hidden":void 0},children:t("div",{className:"flex shrink-0 flex-col items-center",style:{width:V.width,height:V.height,transform:`scale(${re})`},children:[e("div",{className:se?"":p,style:{width:X.width,height:X.height,borderRadius:O.frameRadius,paddingBlock:`${O.bezel.top}px ${O.bezel.bottom}px`,paddingInline:O.bezel.x},children:le}),Y?t(i,{children:[e("div",{"aria-hidden":"true",style:{width:Y.neckWidth,height:Y.neckHeight,background:"var(--p-shell-shade)",clipPath:"polygon(16% 0, 84% 0, 100% 100%, 0 100%)"}}),e("div",{"aria-hidden":"true",className:p,style:{width:Y.footWidth,height:Y.footHeight,borderRadius:Y.footHeight/2}})]}):null,Z?e("div",{"aria-hidden":"true",className:`relative ${p}`,style:{width:Z.width,height:Z.height,borderRadius:`0 0 ${Math.round(.55*Z.height)}px ${Math.round(.55*Z.height)}px`,clipPath:"polygon(0 0, 100% 0, 98.5% 100%, 1.5% 100%)"},children:e("div",{className:"absolute inset-x-0 top-0 mx-auto",style:{width:Z.lipWidth,height:Math.round(.34*Z.height),borderRadius:`0 0 ${Math.round(.2*Z.height)}px ${Math.round(.2*Z.height)}px`,background:"var(--p-shell-shade)"}})}):null]})}),...A}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as s,jsxs as e}from"react/jsx-runtime";import{useDefaults as l}from"../../internal/defaults.js";import{useLabels as a}from"../../internal/labels.js";import{Dialog as i}from"@base-ui/react/dialog";import{CloseIcon as o}from"../../internal/icons.js";import{cx as r,focusRingClasses as t,glassClasses as n,hasContent as d,metaTextClasses as c,radiusClasses as p,sheetBodyClasses as m,sheetHeaderGapClasses as u,sheetLineClasses as f,sheetPaddingXClasses as x,sheetPaddingYClasses as h,sheetSectionGapClasses as g,sheetTitleClasses as v,surfaceSlots as y,targetClasses as b}from"../../internal/styles.js";const w={xs:"max-w-80",sm:"max-w-96",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"},j=/* @__PURE__ */[n,"relative flex w-full flex-col overflow-hidden","border text-(--plass-fg) bg-(--plass-glass-press)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--plass-shadow-4),var(--plass-gloss-glass)]","[outline:none]","[transition:opacity_var(--plass-duration-slow)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),N=/* @__PURE__ */["fixed inset-0 z-(--plass-z-portal) bg-(--plass-scrim)","[backdrop-filter:var(--plass-scrim-blur)] [-webkit-backdrop-filter:var(--plass-scrim-blur)]","[transition:opacity_var(--plass-duration-slow)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" ");export const PlModalClose=i.Close;export function PlModal({size:n,color:k,density:$,open:_,defaultOpen:z,onOpenChange:C,trigger:P,title:B,description:O,actions:D,dividers:M=!1,showClose:T=!0,closeLabel:W,width:L,fullWidth:R=!0,fullScreen:S=!1,modal:V=!0,dismissible:q=!0,className:A,classNames:E,style:F,children:G,...H}){const I=l(),J=a(),K=W??J.close,Q=n??I.size??"md",U=k??I.color??"primary",X=$??I.density??"default",Y=x[X][Q],Z=h[X][Q],ss=M?`${Y} ${Z}`:Y,es=d(B)||d(O),ls=d(D);return e(i.Root,{open:_,defaultOpen:z,modal:V,disablePointerDismissal:!q,onOpenChange:(s,e)=>{q||s||"escape-key"!==e.reason?C?.(s):e.cancel()},children:[P?s(i.Trigger,{render:P}):null,e(i.Portal,{children:[s(i.Backdrop,{className:r("plass-portal",N,E?.backdrop)}),s(i.Viewport,{className:["plass-portal fixed inset-0 z-(--plass-z-portal) flex justify-center",S?"items-stretch":"items-center p-4"].join(" "),children:e(i.Popup,{className:[j,m[Q],S?"h-full max-w-none rounded-none":`max-h-full ${p[Q]} ${void 0===L?w[Q]:""}`,S||R?"":"w-auto",M?"":`${Z} ${g[Q]}`,A??""].filter(Boolean).join(" "),style:{...y(U,3),...void 0===L?null:{maxWidth:"number"==typeof L?`${L}px`:L},...F},...H,children:[es||T?e("div",{className:`flex shrink-0 items-start gap-3 ${ss}`,children:[e("div",{className:`flex min-w-0 flex-1 flex-col ${u[Q]}`,children:[d(B)?s(i.Title,{className:`m-0 font-semibold ${v[Q]}`,children:B}):null,d(O)?s(i.Description,{className:`m-0 text-(--plass-muted-fg) ${c[Q]}`,children:O}):null]}),T?s(i.Close,{"aria-label":K,className:[b,"flex size-[1.6em] shrink-0 cursor-pointer items-center justify-center p-0","rounded-full text-(--plass-muted-fg)","[&_svg]:size-[1.1em] [&_svg]:shrink-0","[transition:background-color_var(--plass-duration)_var(--plass-ease),color_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","hover:bg-(--p-soft) hover:text-(--plass-fg)",t].join(" "),children:s(o,{})}):null]}):null,d(G)?s("div",{className:["min-h-0 flex-1 overflow-y-auto overscroll-contain",ss,M&&(es||T)?f:"",M?"":"-my-1 py-1"].filter(Boolean).join(" "),children:G}):null,ls?s("div",{className:["flex shrink-0 flex-wrap items-center justify-end gap-2",ss,M?f:""].filter(Boolean).join(" "),children:D}):null]})})]})]})}
|