plass-ui 1.7.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 +218 -0
- package/README.md +2 -2
- package/dist/components/accordion/PlAccordion.d.ts +9 -4
- package/dist/components/accordion/PlAccordion.js +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.js +1 -1
- package/dist/components/animate-lighting/PlAnimateLighting.js +1 -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/area-chart/PlAreaChart.js +1 -1
- package/dist/components/avatar/PlAvatar.js +1 -1
- package/dist/components/bar-chart/PlBarChart.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.js +1 -1
- package/dist/components/calendar/PlCalendar.js +1 -1
- package/dist/components/card/PlCard.d.ts +2 -1
- package/dist/components/card/PlCard.js +1 -1
- package/dist/components/carousel/PlCarousel.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.js +1 -1
- package/dist/components/collapsible/PlCollapsible.js +1 -1
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +1 -1
- 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.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/file-picker/PlFilePicker.d.ts +29 -0
- package/dist/components/file-picker/PlFilePicker.js +1 -1
- package/dist/components/file-picker/index.d.ts +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.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.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/image/PlImage.js +1 -1
- package/dist/components/image/PlImagePreview.d.ts +3 -2
- 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 +4 -3
- package/dist/components/mockup/PlMockup.js +1 -1
- package/dist/components/modal/PlModal.js +1 -1
- package/dist/components/navigation-menu/PlNavigationMenu.d.ts +52 -8
- package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +1 -1
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.js +1 -1
- package/dist/components/overlay/PlOverlay.js +1 -1
- package/dist/components/page-layout/PlPageLayout.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 +1 -1
- package/dist/components/pie-chart/PlPieChart.js +1 -1
- package/dist/components/pill/PlPill.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/scatter-chart/PlScatterChart.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.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/tabs/PlTabs.js +1 -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-chart/PlTimelineChart.js +1 -1
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/tour/PlTour.js +1 -1
- 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 +3 -0
- 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.js +1 -1
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +130 -11
- package/dist/internal/chart-frame.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 +34 -1
- 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/form.d.ts +43 -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 +7 -2
- 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/labels.d.ts +5 -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/media.d.ts +6 -0
- package/dist/internal/media.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 +1 -1
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +24 -0
- 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 +15 -8
- package/dist/internal/sizer.js +1 -1
- package/dist/internal/styles.d.ts +22 -6
- package/dist/internal/styles.js +1 -1
- 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 +758 -40
- package/dist/tokens.css +758 -40
- package/dist/types.d.ts +10 -1
- package/package.json +18 -17
|
@@ -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]})})]})]})}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { NavigationMenu as BaseUINavigationMenu } from '@base-ui/react/navigation-menu';
|
|
3
|
+
import type { useRender } from '@base-ui/react/use-render';
|
|
2
4
|
import type { PlassOrientation, PlassStyleProps } from '../../types.js';
|
|
3
5
|
export interface PlNavigationMenuProps extends Pick<PlassStyleProps, 'size' | 'color' | 'density'>, Omit<React.ComponentPropsWithoutRef<'nav'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
4
6
|
/**
|
|
@@ -21,7 +23,7 @@ export interface PlNavigationMenuProps extends Pick<PlassStyleProps, 'size' | 'c
|
|
|
21
23
|
/** The items. */
|
|
22
24
|
children?: React.ReactNode;
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
interface PlNavigationMenuItemBaseProps {
|
|
25
27
|
/** The word in the row. */
|
|
26
28
|
label: React.ReactNode;
|
|
27
29
|
/**
|
|
@@ -46,7 +48,11 @@ export interface PlNavigationMenuItemProps {
|
|
|
46
48
|
* uncontrolled one — Base UI gives each item an identity of its own.
|
|
47
49
|
*/
|
|
48
50
|
value?: string;
|
|
49
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Unavailable. The word stays in the row, dimmed, and opens nothing or goes
|
|
53
|
+
* nowhere: a link item loses its `href` and its `render`. It is announced as
|
|
54
|
+
* unavailable, and neither the arrow keys nor Tab stop on it.
|
|
55
|
+
*/
|
|
50
56
|
disabled?: boolean;
|
|
51
57
|
/**
|
|
52
58
|
* The page the reader is on. A link item is marked `aria-current="page"` and
|
|
@@ -56,13 +62,41 @@ export interface PlNavigationMenuItemProps {
|
|
|
56
62
|
active?: boolean;
|
|
57
63
|
/** How many columns the panel lays its links out in. @default 1 */
|
|
58
64
|
columns?: number;
|
|
59
|
-
/** The panel's contents — usually `PlNavigationMenuLink`s. */
|
|
60
|
-
children?: React.ReactNode;
|
|
61
65
|
/** Classes on the word in the row, alongside the component's own. */
|
|
62
66
|
className?: string;
|
|
63
67
|
/** Inline styles on that word. */
|
|
64
68
|
style?: React.CSSProperties;
|
|
65
69
|
}
|
|
70
|
+
/** An item that goes somewhere: an `href`, a `render`, or both, and no panel. */
|
|
71
|
+
interface PlNavigationMenuItemLinkProps extends PlNavigationMenuItemBaseProps {
|
|
72
|
+
/**
|
|
73
|
+
* Renders the item's link as something other than an `<a>`: the `Link` a
|
|
74
|
+
* router brings. Base UI's own escape hatch, handed to its link part.
|
|
75
|
+
*
|
|
76
|
+
* Giving one makes the item a link, as an `href` does, and an `href` on the
|
|
77
|
+
* element wins over the item's own, as on `PlTextLink`. The arrow keys that
|
|
78
|
+
* move along the row stay Base UI's. A disabled item leaves it out.
|
|
79
|
+
*/
|
|
80
|
+
render?: useRender.RenderProp<BaseUINavigationMenu.Link.State>;
|
|
81
|
+
/** A link has no panel. */
|
|
82
|
+
children?: undefined;
|
|
83
|
+
}
|
|
84
|
+
/** An item that opens a panel. */
|
|
85
|
+
interface PlNavigationMenuItemPanelProps extends PlNavigationMenuItemBaseProps {
|
|
86
|
+
/** The panel's contents — usually `PlNavigationMenuLink`s. */
|
|
87
|
+
children?: React.ReactNode;
|
|
88
|
+
/** Not on an item that opens a panel, which is a trigger rather than a link. */
|
|
89
|
+
render?: undefined;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The props of a `PlNavigationMenuItem`.
|
|
93
|
+
*
|
|
94
|
+
* A union, so that `render` cannot be given to an item that opens a panel. That
|
|
95
|
+
* item is a trigger, and a router's `Link` in its place would be a link that
|
|
96
|
+
* expands, which is neither of the two things a row's word can be. A call
|
|
97
|
+
* without `render` is the same as before.
|
|
98
|
+
*/
|
|
99
|
+
export type PlNavigationMenuItemProps = PlNavigationMenuItemLinkProps | PlNavigationMenuItemPanelProps;
|
|
66
100
|
export interface PlNavigationMenuLinkProps extends Omit<React.ComponentPropsWithoutRef<'a'>, 'color' | 'title'> {
|
|
67
101
|
/** Where it goes. */
|
|
68
102
|
href: string;
|
|
@@ -72,6 +106,14 @@ export interface PlNavigationMenuLinkProps extends Omit<React.ComponentPropsWith
|
|
|
72
106
|
description?: React.ReactNode;
|
|
73
107
|
/** A glyph before the title. */
|
|
74
108
|
startIcon?: React.ReactNode;
|
|
109
|
+
/**
|
|
110
|
+
* Renders the link as something other than an `<a>`: the `Link` a router
|
|
111
|
+
* brings. Base UI's own escape hatch, handed to its link part.
|
|
112
|
+
*
|
|
113
|
+
* An `href` on the element wins over the one above, as on `PlTextLink`, and
|
|
114
|
+
* the arrow keys that move between the links stay Base UI's.
|
|
115
|
+
*/
|
|
116
|
+
render?: useRender.RenderProp<BaseUINavigationMenu.Link.State>;
|
|
75
117
|
}
|
|
76
118
|
/**
|
|
77
119
|
* One row inside a panel: where it goes, what it is called, and a line saying
|
|
@@ -86,11 +128,12 @@ export declare const PlNavigationMenuLink: React.ForwardRefExoticComponent<PlNav
|
|
|
86
128
|
/**
|
|
87
129
|
* One word in the row, and what opens under it.
|
|
88
130
|
*
|
|
89
|
-
* With children it is a trigger and a panel; with an `href`
|
|
90
|
-
* is a link, and the difference is not cosmetic — the second is
|
|
91
|
-
* destination and the first as something that expands.
|
|
131
|
+
* With children it is a trigger and a panel; with an `href` or a `render` and
|
|
132
|
+
* nothing else it is a link, and the difference is not cosmetic — the second is
|
|
133
|
+
* announced as a destination and the first as something that expands. A
|
|
134
|
+
* `render` reaching a trigger from a caller the type did not check is ignored.
|
|
92
135
|
*/
|
|
93
|
-
export declare function PlNavigationMenuItem({ label, href, target, rel, startIcon, value, disabled, active, columns, children, className, style }: PlNavigationMenuItemProps): React.ReactElement;
|
|
136
|
+
export declare function PlNavigationMenuItem({ label, href, target, rel, render, startIcon, value, disabled, active, columns, children, className, style }: PlNavigationMenuItemProps): React.ReactElement;
|
|
94
137
|
/**
|
|
95
138
|
* A site's navigation: a row of destinations, some of which open a panel of
|
|
96
139
|
* more of them.
|
|
@@ -108,3 +151,4 @@ export declare function PlNavigationMenuItem({ label, href, target, rel, startIc
|
|
|
108
151
|
* rather than three.
|
|
109
152
|
*/
|
|
110
153
|
export declare const PlNavigationMenu: React.ForwardRefExoticComponent<PlNavigationMenuProps & React.RefAttributes<HTMLElement>>;
|
|
154
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import*as n from"react";import{useDefaults as r}from"../../internal/defaults.js";import{NavigationMenu as i}from"@base-ui/react/navigation-menu";import{ChevronIcon as o}from"../../internal/icons.js";import{safeRel as s}from"../../internal/link.js";import{controlHeightClasses as l,controlTextClasses as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import*as n from"react";import{useDefaults as r}from"../../internal/defaults.js";import{NavigationMenu as i}from"@base-ui/react/navigation-menu";import{ChevronIcon as o}from"../../internal/icons.js";import{safeRel as s}from"../../internal/link.js";import{controlHeightClasses as l,controlTextClasses as d,controlTextLeadingClasses as p,cx as c,focusRingClasses as u,focusRingInsetClasses as m,gapClasses as f,glassClasses as h,hasContent as g,iconClasses as v,metaTextClasses as y,paddingXClasses as b,radiusClasses as x,surfaceSlots as w,transitionClasses as N}from"../../internal/styles.js";const j=/* @__PURE__ */n.createContext({size:"md",density:"default",orientation:"horizontal"}),P=/* @__PURE__ */["inline-flex shrink-0 cursor-pointer select-none items-center justify-center p-0","whitespace-nowrap font-medium leading-none no-underline","text-(--plass-fg) bg-transparent","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",N,v,u,"hover:bg-(--p-soft)","data-[popup-open]:bg-(--p-soft-hover) data-[popup-open]:text-(--p-accent)","aria-[current=page]:text-(--p-accent)","data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","data-[disabled]:saturate-[0.35] data-[disabled]:hover:bg-transparent"].join(" "),F=/* @__PURE__ */[h,"relative 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] overflow-hidden","w-(--p-panel-w) h-(--p-panel-h)","[transition-duration:var(--plass-duration)] [transition-timing-function:var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),k=/* @__PURE__ */["[transition-property:opacity,width,height]","in-data-[instant]:[transition-property:opacity]"].join(" "),z=/* @__PURE__ */["plass-portal z-(--plass-z-portal) [outline:none]","w-(--p-panel-w) h-(--p-panel-h)","[transition-duration:var(--plass-duration)] [transition-timing-function:var(--plass-ease)]"].join(" "),C=/* @__PURE__ */["[transition-property:top,left,right,bottom]","motion-reduce:[transition-property:none] data-[instant]:[transition-property:none]"].join(" "),S=/* @__PURE__ */new Set(["width","height","top","left","right","bottom"]),M=/* @__PURE__ */["flex min-w-0 cursor-pointer items-start no-underline","text-(--plass-fg) bg-transparent",N,v,"hover:bg-(--p-soft)",m].join(" "),A={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-2.5",xl:"p-3"};export const PlNavigationMenuLink=/* @__PURE__ */n.forwardRef(function PlNavigationMenuLink({href:a,title:r,description:o,startIcon:l,className:d,children:u,target:m,rel:h,render:v,...w},N){const{size:P,density:F}=n.useContext(j);return t(i.Link,{ref:N,render:v,href:a,target:m,rel:s(m,h),className:c(M,x[P],f[P],b[F][P],"py-2",d),...w,children:[g(l)?e("span",{className:c("flex h-[1lh] shrink-0 items-center",p[P]),children:l}):null,t("span",{className:"flex min-w-0 flex-col gap-0.5",children:[e("span",{className:c("font-medium",p[P]),children:r}),g(o)?e("span",{className:c("text-(--plass-muted-fg)",y[P]),children:o}):null,u]})]})});export function PlNavigationMenuItem({label:r,href:p,target:u,rel:m,render:h,startIcon:v,value:y,disabled:w=!1,active:N=!1,columns:F=1,children:k,className:z,style:C}){const{size:S,density:M,orientation:L}=n.useContext(j),R=(void 0!==p||void 0!==h)&&!g(k),I=c(P,"vertical"===L&&"w-full",l[S],d[S],f[S],b[M][S],x[S],z);return e(i.Item,{value:y,children:R?t(i.Link,{render:w?void 0:h,href:w?void 0:p,target:u,rel:s(u,m),"aria-current":N?"page":void 0,role:w?"link":void 0,"aria-disabled":w||void 0,"data-disabled":w?"":void 0,className:I,style:C,children:[g(v)?v:null,r]}):t(a,{children:[t(i.Trigger,{disabled:w,...w?{tabIndex:-1}:{},className:I,style:C,children:[g(v)?v:null,r,e(i.Icon,{className:c("flex items-center","vertical"===L?"-rotate-90 rtl:rotate-90":"[transition:rotate_var(--plass-duration)_var(--plass-ease)] motion-reduce:[transition-duration:0ms] data-[popup-open]:rotate-180"),children:e(o,{})})]}),e(i.Content,{keepMounted:!0,className:c("grid w-max max-w-[calc(var(--available-width)-2px)] gap-1 [&[hidden]]:hidden",A[S]),style:F>1?{gridTemplateColumns:`repeat(${F}, minmax(0, 1fr))`}:void 0,children:k})]})})}export const PlNavigationMenu=/* @__PURE__ */n.forwardRef(function PlNavigationMenu({size:a,color:o,density:s,orientation:l="horizontal",value:d,defaultValue:p,onValueChange:u,delay:m,closeDelay:h,sideOffset:g=8,className:v,style:y,children:b,...N},P){const M=r(),A=a??M.size??"md",L=o??M.color??"primary",R=s??M.density??"default",I=n.useMemo(()=>({size:A,density:R,orientation:l}),[A,R,l]),[V,O]=n.useState(p??null),T=void 0!==d?d:V,[W,q]=n.useState(T),[E,$]=n.useState(!1);W!==T&&(q(T),$(null!==T&&null!==W));const[D,_]=n.useState(null),[B,G]=n.useState(null),H=n.useRef(null),J=n.useCallback(()=>{const e=H.current;if(!D||!e||!B)return;const t=getComputedStyle(B),a=Number.parseFloat(t.width),n=Number.parseFloat(t.height);if(!(a>0&&n>0))return;const r=getComputedStyle(e),i=Number.parseFloat(r.borderLeftWidth)+Number.parseFloat(r.borderRightWidth),o=Number.parseFloat(r.borderTopWidth)+Number.parseFloat(r.borderBottomWidth);D.style.setProperty("--p-panel-w",`${a+i}px`),D.style.setProperty("--p-panel-h",`${n+o}px`)},[D,B]);return n.useLayoutEffect(()=>{null!==T&&J()},[T,J]),n.useEffect(()=>{if(!B||"undefined"==typeof ResizeObserver)return;let e=0;const t=new ResizeObserver(()=>{cancelAnimationFrame(e),e=requestAnimationFrame(J)});return t.observe(B),()=>{cancelAnimationFrame(e),t.disconnect()}},[B,J]),n.useEffect(()=>{const e=H.current;if(!E||!D||!e)return;const t=[D,e];let a=0;const settle=()=>{for(const e of t)getComputedStyle(e).getPropertyValue("width");t.some(e=>e.getAnimations().some(e=>e instanceof CSSTransition&&S.has(e.transitionProperty)&&"finished"!==e.playState))?a=requestAnimationFrame(settle):$(!1)};return a=requestAnimationFrame(settle),()=>{cancelAnimationFrame(a)}},[E,D]),e(j.Provider,{value:I,children:t(i.Root,{ref:P,orientation:l,value:d,defaultValue:p,onValueChange:e=>{void 0===d&&O(e),u?.(e)},delay:m,closeDelay:h,className:v,style:{...w(L,3),...y},...N,children:[e(i.List,{className:c("m-0 flex list-none items-center p-0","vertical"===l?"flex-col items-stretch":"flex-row",f[A]),children:b}),e(i.Portal,{keepMounted:!0,children:e(i.Positioner,{ref:_,className:c(z,E?C:"[transition-property:none]"),side:"vertical"===l?"inline-end":"bottom",align:"vertical"===l?"start":"center",sideOffset:g,collisionPadding:12,children:e(i.Popup,{ref:H,className:c(F,E?k:"[transition-property:opacity]",x[A]),children:e(i.Viewport,{ref:G,className:"w-max"})})})})]})})});
|
|
@@ -151,4 +151,4 @@ export interface PlNumberFieldProps extends PlassStyleProps, Omit<React.Componen
|
|
|
151
151
|
* clamping, the press-and-hold repeat on the steppers, and the hidden input that
|
|
152
152
|
* submits with a form.
|
|
153
153
|
*/
|
|
154
|
-
export declare function PlNumberField({ variant, size: sizeProp, color: colorProp, density: densityProp, elevation, value, defaultValue, onValueChange, onValueCommitted, min, max, step, largeStep, smallStep, snapOnStep, allowWheelScrub, format, locale: localeProp, steppers, incrementLabel: incrementLabelProp, decrementLabel: decrementLabelProp, label, labelPlacement: labelPlacementProp, description, error, invalid, startIcon, endIcon, fullWidth, disabled: disabledProp, readOnly, required, name, placeholder, id, className, hotKeys, classNames, style, ...props }: PlNumberFieldProps): React.JSX.Element;
|
|
154
|
+
export declare function PlNumberField({ variant, size: sizeProp, color: colorProp, density: densityProp, elevation, value, defaultValue, onValueChange, onValueCommitted, min, max, step, largeStep, smallStep, snapOnStep, allowWheelScrub, format, locale: localeProp, steppers, incrementLabel: incrementLabelProp, decrementLabel: decrementLabelProp, label, labelPlacement: labelPlacementProp, description, error, invalid, startIcon, endIcon, fullWidth, disabled: disabledProp, readOnly, required, name, placeholder, id, className, hotKeys, classNames, style, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }: PlNumberFieldProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useDisabled as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{controlNaming as t,useDisabled as a}from"../../internal/form.js";import{useDefaults as n,useLocale as r}from"../../internal/defaults.js";import{ownsPress as s}from"../../internal/focusable.js";import{useLabels as i}from"../../internal/labels.js";import{NumberField as o}from"@base-ui/react/number-field";import{Field as c}from"@base-ui/react/field";import{MinusIcon as d,PlusIcon as m}from"../../internal/icons.js";import{hotKeyHandler as p}from"../../internal/keys.js";import{useFieldLight as u}from"../../internal/glow.js";import{FieldNotch as f,floatControlClassName as h,notchShellStyle as b,resolveNotch as g}from"../../internal/notch.js";import{controlHeightClasses as x,controlTextLeadingClasses as v,cx as y,disabledClasses as j,fieldDescriptionClasses as N,fieldReadOnlyClasses as w,fieldRestClasses as k,fieldSlots as S,focusRingClasses as _,focusWithinRingClasses as V,gapClasses as z,hasContent as D,iconClasses as O,metaTextClasses as C,paddingXClasses as I,radiusClasses as P,stackGapClasses as q,transitionClasses as B}from"../../internal/styles.js";const L=/* @__PURE__ */["relative flex w-full cursor-text items-center","[-webkit-tap-highlight-color:transparent]",B,O].join(" "),W=V,F=/* @__PURE__ */["inline-flex size-[1.7em] shrink-0 cursor-pointer items-center justify-center p-0","rounded-(--plass-radius-xs) text-(--plass-muted-fg) select-none","[&_svg]:size-[0.9em] [&_svg]:shrink-0","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","[transition:background-color_var(--plass-duration)_var(--plass-ease),color_var(--plass-duration)_var(--plass-ease),opacity_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","hover:bg-(--p-soft) enabled:hover:text-(--p-accent)","active:bg-(--p-soft-press)",_,"disabled:cursor-not-allowed disabled:bg-transparent"].join(" ");export function PlNumberField({variant:_="glass",size:V,color:O,density:B,elevation:K=0,value:R,defaultValue:T,onValueChange:E,onValueCommitted:G,min:$,max:A,step:H,largeStep:J,smallStep:M,snapOnStep:Q,allowWheelScrub:U=!1,format:X,locale:Y,steppers:Z="end",incrementLabel:ee,decrementLabel:le,label:te,labelPlacement:ae,description:ne,error:re,invalid:se,startIcon:ie,endIcon:oe,fullWidth:ce=!1,disabled:de=!1,readOnly:me=!1,required:pe=!1,name:ue,placeholder:fe,id:he,className:be,hotKeys:ge,classNames:xe,style:ve,"aria-label":ye,"aria-labelledby":je,...Ne}){const we=n(),ke=a(de),Se=i(),_e=ee??Se.increase,Ve=le??Se.decrease,ze=r(Y),De=V??we.size??"md",Oe=O??we.color??"primary",Ce=B??we.density??"default",Ie=ae??we.labelPlacement??"top",Pe="none"!==Z&&!me,{notched:qe,float:Be}=g(Ie,te,D(ie)||Pe&&"split"===Z),Le=D(re),We=se??Le,Fe=We?"danger":Oe,Ke=!ke&&!me,Re=u(Ke),Te=I[Ce][De],Ee={end:`${Te} pe-1`,split:"px-1",none:Te},Ge=y(F,!ke&&"disabled:opacity-50"),$e=e(o.Decrement,{"aria-label":Ve,className:Ge,children:e(d,{})}),Ae=e(o.Increment,{"aria-label":_e,className:Ge,children:e(m,{})}),He=e(c.Label,{className:y(C[De],"font-semibold",ke?"text-(--plass-muted-fg)":"text-(--plass-fg)",xe?.label),children:te});return l(c.Root,{disabled:ke,invalid:We,className:["flex-col align-top",q[De],ce?"flex w-full":"inline-flex",be??""].filter(Boolean).join(" "),style:{...S(Fe,K),...ve},...Ne,children:[D(te)&&!qe?He:null,e(o.Root,{id:he,name:ue,className:"contents",value:R,defaultValue:T,onValueChange:e=>E?.(e),onValueCommitted:e=>G?.(e),min:$,max:A,step:H,largeStep:J,smallStep:M,snapOnStep:Q,allowWheelScrub:U,format:X,locale:ze,disabled:ke,readOnly:me,required:pe,children:e(f,{notched:qe,size:De,density:Ce,variant:_,disabled:ke,readOnly:me,float:Be,label:He,children:l(o.Group,{style:qe?b:void 0,...Re,onPointerDown:e=>{const l=e.currentTarget.querySelector('input:not([type="hidden"])');ke||s(e.target,e.currentTarget,l)||(e.preventDefault(),l?.focus())},className:[L,qe?"":W,x[De],v[De],P[De],z[De],Pe?Ee[Z]:Te,ke?j[_]:me?w[_]:k[_],Ke?"plass-glow":"",xe?.control].filter(Boolean).join(" "),children:[Pe&&"split"===Z?$e:null,ie?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:ie}):null,e(o.Input,{placeholder:Be?fe||" ":fe,...t(ye,je),onKeyDown:p(ge,void 0),className:["min-w-0 flex-1 self-stretch bg-transparent p-0 [font:inherit] text-inherit","[outline:none]","tabular-nums","split"===Z&&Pe?"text-center":"","placeholder:text-(--plass-muted-fg)","caret-(--p-accent) selection:bg-(--p-soft-press)","disabled:cursor-not-allowed",Be?h:""].filter(Boolean).join(" ")}),oe?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:oe}):null,Pe&&"end"===Z?l("span",{className:"flex shrink-0 items-center gap-0.5",children:[$e,Ae]}):null,Pe&&"split"===Z?Ae:null]})})}),ne?e(c.Description,{className:y(N(De),xe?.description),children:ne}):null,e(c.Error,Le?{match:!0,className:y(C[De],"text-(--p-accent)",xe?.error),children:re}:{className:y(C[De],"text-(--p-accent)",xe?.error)})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{useDisabled as t}from"../../internal/form.js";import{useDefaults as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{useDisabled as r,useLabelReference as t}from"../../internal/form.js";import{useDefaults as n}from"../../internal/defaults.js";import{useLabels as s}from"../../internal/labels.js";import{Field as o}from"@base-ui/react/field";import{OTPField as i}from"@base-ui/react/otp-field";import{hotKeyHandler as m}from"../../internal/keys.js";import{cx as d,disabledClasses as c,fieldDescriptionClasses as u,fieldReadOnlyClasses as p,fieldRestClasses as f,hasContent as h,metaTextClasses as x,stackGapClasses as g,surfaceSlots as b,transitionClasses as y}from"../../internal/styles.js";const v={xs:"h-7 w-6",sm:"h-8 w-7",md:"h-10 w-8",lg:"h-12 w-10",xl:"h-14 w-12"},N={xs:"rounded-[0.3125rem]",sm:"rounded-[0.375rem]",md:"rounded-[0.4375rem]",lg:"rounded-[0.5625rem]",xl:"rounded-[0.6875rem]"},$={xs:"text-[0.8125rem]",sm:"text-[0.9375rem]",md:"text-[1.0625rem]",lg:"text-[1.25rem]",xl:"text-[1.5rem]"},j={default:{xs:"gap-1",sm:"gap-1",md:"gap-1.5",lg:"gap-2",xl:"gap-2.5"},compact:{xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"}},w={numeric:"numeric",alpha:"alpha",alphanumeric:"alphanumeric",any:"none"};export const PlOtpField=/* @__PURE__ */l.forwardRef(function PlOtpField({variant:V="glass",size:F,color:C,density:I,elevation:M=0,length:O=6,charset:S="numeric",mask:k=!1,groupSize:z,separator:R="–",value:q,defaultValue:A,onValueChange:B,onComplete:D,onValueInvalid:K,autoSubmit:L=!1,label:P,description:_,error:E,invalid:T,name:G,required:H=!1,disabled:J=!1,readOnly:Q=!1,autoFocus:U=!1,slotLabel:W,className:X,hotKeys:Y,classNames:Z,style:ee,"aria-label":ae,"aria-labelledby":le,...re},te){const ne=n(),se=r(J),oe=s(),ie=W??oe.otpSlot,me=l.useId(),de=F??ne.size??"md",ce=C??ne.color??"primary",ue=I??ne.density??"default",pe=Math.min(12,Math.max(2,Math.round(O))),fe=h(E),he=T??fe,xe=he?"danger":ce,ge=d("text-center font-medium [font-family:inherit]",v[de],$[de],N[de],y,"caret-(--p-accent) selection:bg-(--p-soft-press)","focus:[outline:2px_solid_var(--p-ring)] focus:[outline-offset:0px]",se?c[V]:Q?p[V]:f[V]),be=z&&z>0?Math.round(z):0,ye=t(ae,le),ve=ye.labelledBy??(h(P)?`${me}-label`:void 0);return a(o.Root,{disabled:se,invalid:he,className:d("inline-flex flex-col align-top",g[de],X),style:{...b(xe,M),...ee},children:[h(P)?e(o.Label,{className:d(x[de],"font-semibold",se?"text-(--plass-muted-fg)":"text-(--plass-fg)",Z?.label),children:e("span",{id:`${me}-label`,children:P})}):null,e(i.Root,{ref:te,onKeyDown:m(Y,void 0),length:pe,validationType:w[S],mask:k,name:G,required:H,disabled:se,readOnly:Q,autoSubmit:L,value:q,defaultValue:A,onValueChange:e=>B?.(e),onValueComplete:e=>D?.(e),onValueInvalid:e=>K?.(e),className:d("flex items-center",j[ue][de],Z?.control),"aria-label":ae,"aria-labelledby":ye.labelledBy,...re,children:Array.from({length:pe},(r,t)=>a(l.Fragment,{children:[be>0&&t>0&&t%be===0?e("span",{"aria-hidden":"true",className:d("select-none px-0.5 text-(--plass-muted-fg)",$[de]),children:R}):null,e(i.Input,{className:ge,autoFocus:U&&0===t,"aria-labelledby":ve?`${ve} ${me}-${t}`:`${me}-${t}`})]},t))}),Array.from({length:pe},(a,l)=>e("span",{id:`${me}-${l}`,hidden:!0,children:ie(l+1,pe)},l)),ye.node,h(_)?e(o.Description,{className:d(u(de),Z?.description),children:_}):null,e(o.Error,fe?{match:!0,className:d(x[de],"text-(--p-accent)",Z?.error),children:E}:{className:d(x[de],"text-(--p-accent)",Z?.error)})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as a,jsxs as e}from"react/jsx-runtime";import{useDefaults as s}from"../../internal/defaults.js";import{useLabels as r}from"../../internal/labels.js";import{Dialog as l}from"@base-ui/react/dialog";import{cx as i,surfaceSlots as t}from"../../internal/styles.js";const o={scrim:"bg-(--plass-scrim) [backdrop-filter:var(--plass-scrim-blur)] [-webkit-backdrop-filter:var(--plass-scrim-blur)]",glass:/* @__PURE__ */["[--p-dim:color-mix(in_oklab,var(--plass-scrim)_45%,transparent)] [background-color:var(--p-dim)]","[backdrop-filter:var(--plass-blur)] [-webkit-backdrop-filter:var(--plass-blur)]","[@media(prefers-reduced-transparency:reduce)]:[background:linear-gradient(var(--p-dim),var(--p-dim)),var(--plass-surface)]"].join(" "),solid:"bg-(--plass-surface)",clear:""},n={start:"items-start",center:"items-center",end:"items-end"},p={xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8",xl:"p-10"},c=/* @__PURE__ */["[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 function PlOverlay({open:m,defaultOpen:d,onOpenChange:u,tone:f="scrim",dismissible:b=!1,modal:y=!0,align:g="center",size:x,color:v,label:j,className:k,classNames:h,style:z,children:w,...N}){const O=s(),P=r(),_=j??P.overlay,B=x??O.size??"md",C=v??O.color??"primary";return a(l.Root,{open:m,defaultOpen:d,modal:y,disablePointerDismissal:!b,onOpenChange:(a,e)=>{b||a||"escape-key"!==e.reason?u?.(a):e.cancel()},children:e(l.Portal,{children:[a(l.Backdrop,{className:i("plass-portal fixed inset-0 z-(--plass-z-portal)",c,o[f],h?.backdrop)}),a(l.Viewport,{className:["plass-portal fixed inset-0 z-(--plass-z-portal) flex justify-center",n[g],p[B]].join(" "),children:a(l.Popup,{"aria-label":_,className:["flex max-h-full max-w-full flex-col items-center justify-center","[outline:none]",c,k??""].filter(Boolean).join(" "),style:{...t(C,0),...z},...N,children:w})})]})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{useDefaults as l}from"../../internal/defaults.js";import{useLabels as r}from"../../internal/labels.js";import{PlPageLayoutContext as n,PlassSidebarSideContext as s}from"../../internal/page-layout.js";import{controlSlots as a,cx as i,hasContent as u,toLength as c}from"../../internal/styles.js";const f=["header","footer"];export const PlPageLayout=/* @__PURE__ */o.forwardRef(function PlPageLayout({header:d,footer:p,sidebar:m,endSidebar:h,headerSpan:v="full",footerSpan:x="full",scroll:y="page",height:b="viewport",collapseBelow:g="md",sidebarOpen:w,defaultSidebarOpen:P=!1,onSidebarOpenChange:k,endSidebarOpen:S,defaultEndSidebarOpen:C=!1,onEndSidebarOpenChange:O,skipLink:j=!0,skipLabel:N,mainId:$="main",mainProps:z,color:L,className:R,style:E,children:M,...B},H){const _=l(),I=r(),T=N??I.skipToContent,V=L??_.color??"primary",q=o.useContext(n).present,A=q?"div":"main",[D,F]=o.useState(P),[G,J]=o.useState(C),K=o.useMemo(()=>({start:w??D,end:S??G}),[w,D,S,G]),Q=o.useCallback((e,t)=>{if("start"===e)return void 0===w&&F(t),void k?.(t);void 0===S&&J(t),O?.(t)},[w,S,k,O]),U=o.useRef(null),W=o.useCallback(e=>{U.current=e,"function"==typeof H?H(e):H&&(H.current=e)},[H]),X=o.useRef({header:null,footer:null}),Y=o.useRef(null),Z=o.useCallback(()=>{const e=U.current;if(!e)return;const t=f.map(e=>{const t=X.current[e];return t?{slot:e,position:getComputedStyle(t).position,extent:t.offsetHeight}:{slot:e,position:null,extent:0}}),write=(t,o)=>{e.style.getPropertyValue(t)!==o&&e.style.setProperty(t,o)};for(const{slot:e,position:o,extent:l}of t){const t="fixed"===o;write(`--p-layout-${e}`,t||"sticky"===o&&"full"===("header"===e?v:x)?`${l}px`:"0px"),write(`--p-layout-${e}-inset`,t?`${l}px`:"0px")}},[v,x]),ee=o.useRef(Z);o.useLayoutEffect(()=>{ee.current=Z,Z()},[Z]),o.useLayoutEffect(()=>{const e=new ResizeObserver(()=>ee.current());for(const t of f){const o=X.current[t];o&&e.observe(o)}return Y.current=e,()=>{e.disconnect(),Y.current=null}},[]);const te=o.useCallback((e,t)=>{const o=X.current[e];if(o===t)return;X.current[e]=t;const l=Y.current;l&&(o&&l.unobserve(o),t?l.observe(t):(U.current?.style.setProperty(`--p-layout-${e}`,"0px"),U.current?.style.setProperty(`--p-layout-${e}-inset`,"0px")))},[]),oe=o.useCallback(()=>ee.current(),[]),le=o.useMemo(()=>({present:!0,register:te,remeasure:oe,collapseBelow:g,open:K,setOpen:Q,scroll:y}),[te,oe,g,K,Q,y]),re=o.useMemo(()=>({...le,register:()=>{},remeasure:()=>{}}),[le]),ne="content"===y,se=c("viewport"===b||"auto"===b?void 0:b),ae=void 0!==se?"":"auto"===b?ne?"h-full":"min-h-full":ne?"h-dvh":"min-h-dvh",ie=u(d)?d:null,ue=u(p)?p:null,ce=(u(m)||u(h))&&("content"===v&&null!==ie||"content"===x&&null!==ue);return e(n.Provider,{value:le,children:t("div",{ref:W,className:i("plass-layout relative flex w-full flex-col",ne?"overflow-hidden":"",ae,"[padding-top:var(--p-layout-header-inset,0px)]","[padding-bottom:var(--p-layout-footer-inset,0px)]",R),style:void 0===se?E:{...ne?{height:se}:{minHeight:se},...E},...B,children:[j&&!q?e("a",{href:`#${$}`,className:i("absolute start-3 top-3 z-40 size-px overflow-hidden whitespace-nowrap","[clip-path:inset(50%)] focus:size-auto focus:overflow-visible focus:[clip-path:none]","focus:rounded-(--plass-radius-md) focus:[background-image:var(--p-fill)]","focus:px-4 focus:py-2 focus:font-medium focus:text-(--p-on-solid) focus:no-underline","focus:[box-shadow:var(--p-elev),var(--p-lift)]","focus:[outline:2px_solid_var(--p-ring)] focus:[outline-offset:0px]"),style:a(V,2,"solid"),children:T}):null,"full"===v?ie:null,t("div",{className:i("flex w-full flex-1",ne?"min-h-0":"",ce?"z-1 [&>aside]:z-21":""),children:[u(m)?e(s.Provider,{value:"start",children:m}):null,t("div",{className:i("flex min-w-0 flex-1 flex-col",ne?"min-h-0":""),children:["content"===v?ie:null,e(A,{...z,id:q?void 0:$,className:i("min-w-0 flex-1",ne?"min-h-0 overflow-y-auto":"",z?.className),children:e(n.Provider,{value:re,children:M})}),"content"===x?ue:null]}),u(h)?e(s.Provider,{value:"end",children:h}):null]}),"full"===x?ue:null]})})});
|
|
@@ -62,7 +62,10 @@ export interface PlPaneProps extends Omit<React.ComponentPropsWithoutRef<'div'>,
|
|
|
62
62
|
* window being resized without a single line of JavaScript running, so the
|
|
63
63
|
* component measures itself only twice — once on mount, to turn a `'240px'`
|
|
64
64
|
* default into a fraction, and once at the start of each drag, to know what a
|
|
65
|
-
* pixel of pointer movement is worth.
|
|
65
|
+
* pixel of pointer movement is worth. Until the first measurement the panes are
|
|
66
|
+
* drawn from their `defaultSize`s alone wherever those settle the split on
|
|
67
|
+
* their own (see `presplit`), so a split rendered on the server does not move
|
|
68
|
+
* as it hydrates.
|
|
66
69
|
*
|
|
67
70
|
* The handles are interleaved here rather than written by the caller, so the
|
|
68
71
|
* children of a `PlPanes` are just panes. That does mean the direct children have
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{useDefaults as r}from"../../internal/defaults.js";import{beginPointerDrag as i}from"../../internal/drag.js";import{layoutBox as o}from"../../internal/layout-box.js";import{cx as a,transitionClasses as s}from"../../internal/styles.js";import{useResponsiveValue as l}from"../../internal/responsive.js";const u="1 1 0%",c=/* @__PURE__ */n.createContext({flex:u,id:void 0}),m={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},f={xs:4,sm:6,md:8,lg:10,xl:12};function parseLength(e){if(null==e)return;if("number"==typeof e)return{amount:e,unit:"%"};const t=/^\s*(-?[\d.]+)\s*(px|rem|em|%)\s*$/.exec(e);if(!t)return;const n=Number(t[1]);return Number.isNaN(n)?void 0:{amount:n,unit:t[2]}}function toPixels(e,t,n){const r=parseLength(e);if(r)switch(r.unit){case"px":return r.amount;case"%":return t*r.amount/100;case"rem":return r.amount*parseFloat(getComputedStyle(document.documentElement).fontSize||"16");case"em":return r.amount*parseFloat(n&&getComputedStyle(n).fontSize||"16")}}function basisOf(e,t){return`calc((100% - ${t}px) * ${e.toFixed(6)})`}function initialFractions(e,t,n){const r=e.map(e=>toPixels(e.defaultSize,t,n)),i=r.reduce((e,t)=>e+(t??0),0),o=r.filter(e=>void 0===e).length,a=o>0?Math.max(0,t-i)/o:0,s=r.map(e=>Math.max(0,e??a)),l=s.reduce((e,t)=>e+t,0);return l<=0?s.map(()=>1/Math.max(1,s.length)):s.map(e=>e/l)}export const PlPanes=/* @__PURE__ */n.forwardRef(function PlPanes({orientation:p,resizable:d=!0,color:x,size:h,onResize:g,onResizeEnd:v,label:b,className:z,style:w,children:y,...P},S){const $=l(p,"horizontal"),M=r(),N=x??M.color??"primary",R=h??M.size??"md",j=n.Children.toArray(y).filter(n.isValidElement),C=j.length,F=n.useId(),paneId=e=>j[e]?.props.id??`${F}-pane-${e}`,k=n.useRef(null),E=n.useCallback(e=>{k.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),A=j.map(e=>e.props),D=n.useRef([]);D.current=A;const[O,I]=n.useState(null),L=O&&O.length===C?O:null,T=n.useRef(null);T.current=L;const X="horizontal"===$,Y=f[R]*Math.max(0,C-1),_=L?null:function presplit(e,t){const n=e.map(e=>parseLength(e.defaultSize)),r=new Set(n.map(e=>e?.unit));return r.has("rem")||r.has("em")?null:r.has("px")&&(r.has("%")||r.has(void 0))?r.has(void 0)?n.map(e=>{if(!e)return u;const n=Math.max(0,e.amount);return"px"===e.unit?`0 0 ${n}px`:`0 0 ${basisOf(n/100,t)}`}):null:initialFractions(e,100,null).map(e=>`0 0 ${basisOf(e,t)}`)}(A,Y);function grip(e){const t=k.current,n=T.current;if(!d||!t||!n||void 0===n[e+1])return null;const{content:r,perPixel:i}=o(t,X),a=r-Y;if(a<=0)return null;const s=D.current[e],l=D.current[e+1],u=n[e]*a,c=u+n[e+1]*a,m=Math.max(toPixels(s?.minSize,a,t)??0,c-(toPixels(l?.maxSize,a,t)??c)),f=Math.min(toPixels(s?.maxSize,a,t)??c,c-(toPixels(l?.minSize,a,t)??0));return f<m?null:{root:t,current:n,extent:a,start:u,pair:c,perPixel:i,resize(t){const r=Math.min(f,Math.max(m,u+t));if(r===u)return n;const i=[...n];return i[e]=r/a,i[e+1]=(c-r)/a,I(i),g?.(i.map(e=>100*e)),i}}}n.useEffect(()=>{const e=k.current;if(!e)return;const measure=()=>{const t=o(e,X).content-Y;t<=0||I(n=>n&&n.length===C?n:initialFractions(D.current,t,e))};measure();const t=new ResizeObserver(measure);return t.observe(e),()=>t.disconnect()},[C,X,Y]);const K=n.useRef(null);n.useEffect(()=>()=>K.current?.(),[]);const U=a("group/handle relative z-1 flex shrink-0 grow-0 items-center justify-center",m[R],s,"[outline:none] focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-0",d?a(X?"cursor-col-resize":"cursor-row-resize","touch-none","hover:bg-(--p-soft) data-[dragging]:bg-(--p-soft)"):"");return e("div",{ref:E,className:a("flex h-full w-full",X?"flex-row":"flex-col","min-h-0 min-w-0",z),style:{"--p-accent":`var(--plass-${N}-accent)`,"--p-soft":`var(--plass-${N}-soft)`,"--p-ring":`var(--plass-${N}-ring)`,...w},...P,children:j.map((r,o)=>t(n.Fragment,{children:[o>0?e("div",{role:"separator","aria-label":b,"aria-controls":paneId(o-1),"aria-orientation":X?"vertical":"horizontal","aria-valuenow":L?Math.round(100*L[o-1]):void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-disabled":!d||void 0,tabIndex:d?0:-1,className:U,onPointerDown:e=>{0===e.button&&function beginDrag(e,t){const n=grip(e);if(!n)return;const r=X?t.clientX:t.clientY,o=X&&"rtl"===getComputedStyle(n.root).direction?-1:1;let a=n.current;const s=i({target:t.currentTarget,pointerId:t.pointerId,onMove:e=>{const t=X?e.clientX:e.clientY;a=n.resize((t-r)*o*n.perPixel)},onEnd:()=>{K.current=null,v?.(a.map(e=>100*e))}});K.current=s}(o-1,e)},onKeyDown:e=>{const t=X?"ArrowLeft":"ArrowUp",n=X?"ArrowRight":"ArrowDown";if(e.key!==t&&e.key!==n)return;e.preventDefault();const r=X&&"rtl"===getComputedStyle(e.currentTarget).direction?-1:1,i=e.key===n?16:-16;!function nudge(e,t){const n=grip(e);if(!n)return;const r=n.resize(t);r!==n.current&&v?.(r.map(e=>100*e))}(o-1,i*r)},children:e("span",{"aria-hidden":"true",className:a("pointer-events-none bg-(--plass-border)",s,X?"h-full w-px":"h-px w-full",d?"group-hover/handle:bg-(--p-accent) group-focus-visible/handle:bg-(--p-accent) group-data-[dragging]/handle:bg-(--p-accent)":"")})}):null,e(c.Provider,{value:{flex:L?`0 0 ${basisOf(L[o],Y)}`:_?.[o]??u,id:paneId(o)},children:r})]},r.key??o))})});export const PlPane=/* @__PURE__ */n.forwardRef(function PlPane({defaultSize:t,minSize:r,maxSize:i,className:o,style:s,children:l,...u},m){const{flex:f,id:p}=n.useContext(c);return e("div",{ref:m,id:p,className:a("relative min-h-0 min-w-0 overflow-auto",o),style:{flex:f,...s},...u,children:l})});
|
|
@@ -80,4 +80,4 @@ export interface PlPieChartProps extends ChartBaseProps {
|
|
|
80
80
|
* A slice's colour follows the slice and not its size, so a chart that is
|
|
81
81
|
* refiltered or resorted keeps every category the colour it had.
|
|
82
82
|
*/
|
|
83
|
-
export declare function PlPieChart({ data, categories, shape, startAngle, innerRadius, padAngle, center, valueLabels, height, format, locale: localeProp, label, legend, tooltip, empty, size: sizeProp, variant, padded, className, ...box }: PlPieChartProps): React.JSX.Element;
|
|
83
|
+
export declare function PlPieChart({ data, categories, shape, startAngle, innerRadius, padAngle, center, valueLabels, height, initialWidth, format, locale: localeProp, label, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, legend, tooltip, empty, size: sizeProp, variant, padded, className, ...box }: PlPieChartProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{ChartDataTable as n,ChartLegendBar as t,ChartStatus as i,ChartSurface as r,ChartTooltipPanel as s,chartTableName as o,givenHeight as d,markTransitionClasses as u,useMeasuredSize as m,useVisibility as c}from"../../internal/chart-frame.js";import{arcPath as h,categoryAt as v,chartFontSizes as f,compactNumber as p,dimmedByHover as b,formatCategory as x,markGap as g,plotHeights as y,seriesColor as M,toValue as N}from"../../internal/chart.js";import{useDefaults as j,useLocale as w}from"../../internal/defaults.js";import{numberFormatter as I}from"../../internal/format.js";import{useLabels as P}from"../../internal/labels.js";import{cx as k,metaTextClasses as z,srOnlyClasses as $}from"../../internal/styles.js";const A={pie:0,donut:.62,semi:.62},clamp=(e,l,a)=>Math.min(a,Math.max(l,e));export function PlPieChart({data:S,categories:B,shape:E="pie",startAngle:L=0,innerRadius:R,padAngle:D,center:O,valueLabels:C="none",height:W,initialWidth:_,format:F,locale:K,label:V,"aria-label":q,"aria-labelledby":G,"aria-describedby":H,legend:J,tooltip:Q,empty:T,size:U,variant:X="ghost",padded:Y=!1,className:Z,...ee}){const le=j(),ae=U??le.size??"md",ne=w(K),te=a.useRef(null),{width:ie,height:re,guessed:se}=m(te,_),oe=P(),de=a.useId(),ue=a.useId(),me=a.useId(),ce=a.useId(),he=a.useCallback(e=>F?I(ne,F).format(e):p(e,ne),[F,ne]),ve=a.useMemo(()=>S.map(N),[S]),fe=a.useMemo(()=>ve.map((e,l)=>({name:x(v(l,B,[ve]),ne),data:[S[l]],color:e.color})),[ve,B,S,ne]),pe=!1===J?{interactive:!1}:!0===J||void 0===J?{}:J,be=!1!==J&&fe.length>1,xe=pe.side??"bottom",ge=c(fe,be&&!1!==pe.interactive),[ye,Me]=a.useState(null),setActive=e=>Me(null===e?null:ge.keys[e]??null),Ne=fe.map((e,l)=>M(e,l)),je=ve.reduce((e,l,a)=>ge.visible[a]&&null!==l.value?e+Math.abs(l.value):e,0),we="semi"===E,Ie=d(W,y[ae]),Pe=Ie??re??0,ke=f[ae],ze=!1===Q?{mode:"none"}:!0===Q||void 0===Q?{}:Q,$e="none"===ze.mode,Ae=ie/2,Se=Math.max(0,Math.min(ie/2,we?Pe:Pe/2)-2),Be=we?Math.min(Pe,Pe/2+Se/2):Pe/2,Ee=Se*clamp(R??A[E],0,.95),Le=je<=0,Re=!Le&&Boolean(O)&&Ee>0,De=void 0===D?Se>0?Math.min(4,g/Se*(180/Math.PI)):0:clamp(D,0,10),Oe=we?180:360,Ce=[];let We=we?-90:L;ve.forEach((e,l)=>{if(!ge.visible[l]||null===e.value||0===e.value)return;const a=Math.abs(e.value)/je,n=a*Oe;Ce.push({index:l,start:We,end:We+n,value:e.value,share:a}),We+=n});const _e=null===ye?-1:ge.keys.indexOf(ye),Fe=Ce.some(e=>e.index===_e)?_e:null;null!==ye&&null===Fe&&Me(null);const share=e=>`${he(e)} · ${Math.round(10*(Math.abs(e)/je*100+Number.EPSILON))/10}%`,Ke=null===Fe?[]:[{seriesIndex:Fe,name:fe[Fe]?.name,color:ve[Fe]?.color??Ne[Fe],value:ve[Fe]?.value??null,formatted:share(ve[Fe]?.value??0),label:ve[Fe]?.label}],Ve=Ke.map(e=>({...e,name:void 0}));return l(r,{...ee,size:ae,variant:X,padded:Y,className:Z,legendSide:xe,legend:be?e(t,{series:fe,colors:Ne,options:pe,visibility:ge,size:ae,values:pe.showValue?ve.map(e=>null===e.value?void 0:he(e.value)):void 0}):null,table:Le?null:e(n,{id:de,...o({label:V,"aria-label":q,"aria-labelledby":G}),categories:fe.map(e=>e.name??""),series:[{name:q??V??"",data:S}],values:[ve],format:he,locale:ne}),children:[l("div",{ref:te,role:"img",tabIndex:Le?void 0:0,"aria-labelledby":G,"aria-label":q??V??oe.chart,"aria-describedby":k(H,Le?me:Re?`${ce} ${ue}`:ue),onPointerLeave:()=>setActive(null),onBlur:()=>setActive(null),onKeyDown:e=>{if($e)return;if("Escape"===e.key&&null!==Fe)return setActive(null),e.stopPropagation(),void e.preventDefault();if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;const l=Ce.map(e=>e.index);if(0===l.length)return;const a=null===Fe?-1:l.indexOf(Fe),n="ArrowRight"===e.key,t=-1===a?n?0:l.length-1:(a+(n?1:-1)+l.length)%l.length;setActive(l[t]),e.preventDefault()},className:k("relative w-full rounded-(--plass-radius-xs)","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-2",se&&"overflow-hidden"),style:{height:Ie??W},children:[Le?e("div",{id:me,className:k("flex h-full items-center justify-center text-(--plass-muted-fg)",z[ae]),children:T??oe.empty}):ie>0&&Se>0?l("svg",{width:ie,height:Pe,viewBox:`0 0 ${ie} ${Pe}`,"aria-hidden":"true",className:"block",children:[Ce.map(l=>{const a=b(ge.hovered,l.index,ge.visible)||null!==Fe&&Fe!==l.index,n=l.end-l.start>2*De?De/2:0;return e("path",{d:h(Ae,Be,Se,Ee,l.start+n,l.end-n),fill:ve[l.index].color??Ne[l.index],opacity:a?.32:1,onPointerEnter:$e?void 0:()=>setActive(l.index),className:u},l.index)}),"all"===C?Ce.map(l=>{const a=((l.start+l.end)/2-90)*(Math.PI/180),n=Ee>0?(Ee+Se)/2:.68*Se,t=`${Math.round(100*l.share)}%`;return(l.end-l.start)*(Math.PI/180)*n<2*ke||Se-Ee<1.6*ke?null:e("text",{x:Ae+n*Math.cos(a),y:Be+n*Math.sin(a),textAnchor:"middle",dominantBaseline:"central",fontSize:ke,fontWeight:600,fill:"var(--plass-surface)",className:"tabular-nums",children:t},l.index)}):null]}):null,Re?e("div",{id:ce,className:"pointer-events-none absolute flex flex-col items-center justify-center text-center",style:{insetInlineStart:Ae-Ee,top:Be-Ee,width:2*Ee,height:we?Ee:2*Ee},children:O}):null,null===Fe||$e?null:ze.render?e("div",{className:"pointer-events-none absolute top-0 start-1/2 z-10",children:ze.render({index:Fe,category:fe[Fe]?.name??Fe,items:Ke})}):e(s,{heading:fe[Fe]?.name,items:Ve,x:Ae,y:8,flip:!1,size:ae})]}),Le?null:e("span",{id:ue,className:$,children:Ce.map((e,n)=>l(a.Fragment,{children:[n>0||Re?", ":null,fe[e.index]?.name," ",ve[e.index]?.label??share(e.value)]},e.index))}),$e?null:e(i,{heading:null===Fe?void 0:fe[Fe]?.name,items:Ve})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s,Fragment as t}from"react/jsx-runtime";import*as l from"react";import{glowPointerMove as o}from"../../internal/glow.js";import{useDefaults as r}from"../../internal/defaults.js";import{inertProps as n}from"../../internal/inert.js";import{controlSlots as i,controlTextClasses as a,cx as c,focusRingClasses as d,forcedEdgeClasses as m,gapClasses as p,glassClasses as f,hasContent as u,iconClasses as x,iconSizeClasses as h,metaTextClasses as v,paddingXClasses as g,sheetBodyClasses as b,transitionClasses as w}from"../../internal/styles.js";const y={solid:`text-(--p-on-solid) [background-image:var(--p-fill)] [box-shadow:var(--p-elev),var(--p-lift)] ${m}`,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:`${f} text-(--p-accent) bg-(--p-soft)`},j={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={xs:"min-h-5.5",sm:"min-h-6.5",md:"min-h-8",lg:"min-h-10",xl:"min-h-12"},k={xs:"rounded-[0.6875rem]",sm:"rounded-[0.8125rem]",md:"rounded-[1rem]",lg:"rounded-[1.25rem]",xl:"rounded-[1.5rem]"},z={default:{xs:"px-3",sm:"px-4",md:"px-5",lg:"px-6",xl:"px-8"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-4"}},P={static:{top:"relative",bottom:"relative"},sticky:{top:"sticky top-3 z-20",bottom:"sticky bottom-3 z-20"},fixed:{top:"fixed inset-x-0 top-3 z-30 mx-auto w-fit",bottom:"fixed inset-x-0 bottom-3 z-30 mx-auto w-fit"}};export const PlPill=/* @__PURE__ */l.forwardRef(function PlPill({variant:m="solid",size:f,color:_,density:R,elevation:C=2,startIcon:I,endIcon:$,title:H,description:M,details:O,expanded:B=!1,position:E="static",side:F="top",className:L,style:S,children:q,onClick:A,onPointerMove:D,...G},J){const K=r(),Q=f??K.size??"md",T=_??K.color??"secondary",U=R??K.density??"default",V=l.useRef(null),W=l.useId(),[X,Y]=l.useState(null),Z=u(O);l.useLayoutEffect(()=>{const e=V.current;if(!e||"undefined"==typeof ResizeObserver)return;const s=new ResizeObserver(()=>Y(e.scrollHeight));return s.observe(e),Y(e.scrollHeight),()=>s.disconnect()},[Z]);const ee=Boolean(A),se=g[U][Q],te=s(t,{children:[u(I)?e("span",{className:c("flex shrink-0 items-center justify-center overflow-hidden rounded-full [&_img]:size-full [&_img]:object-cover",h[Q]),children:I}):null,u(H)||u(M)||u(q)?s("span",{className:c("flex min-w-0 flex-1 flex-col items-center justify-center text-center",z[U][Q]),children:[u(H)?e("span",{className:"max-w-full truncate",children:H}):null,u(M)?e("span",{className:c("max-w-full truncate font-normal",v[Q],"[color:color-mix(in_oklab,currentColor_72%,transparent)]"),children:M}):null,q]}):null]});return s("div",{ref:J,className:c("inline-flex max-w-full flex-col overflow-hidden align-middle",k[Q],"font-medium whitespace-nowrap select-none",a[Q],y[m],w,x,ee?`plass-glow ${j[m]}`:"",P[E][F],L),style:{...i(T,C,m),...S},onPointerMove:o(ee,D),...G,children:[s("div",{className:c("flex shrink-0 items-center py-1",N[Q],p[Q],ee?"ps-0":se,u($)?"pe-1":ee?"pe-0":""),children:[ee?e("button",{type:"button",className:c("flex min-w-0 flex-1 cursor-pointer items-center justify-center self-stretch","rounded-[inherit]",p[Q],se,d),"aria-expanded":Z?B:void 0,"aria-controls":Z?W:void 0,onClick:A,children:te}):te,u($)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:$}):null]}),Z?e("div",{id:W,className:c("overflow-hidden","[transition:height_var(--plass-duration-slow)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]"),style:{height:B?X??"auto":0},...n(!B),children:e("div",{ref:V,className:c("whitespace-normal pb-2",se,b[Q]),children:O})}):null]})});
|
|
1
|
+
"use client";import{jsx as e,jsxs as s,Fragment as t}from"react/jsx-runtime";import*as l from"react";import{glowPointerMove as o}from"../../internal/glow.js";import{useDefaults as r}from"../../internal/defaults.js";import{inertProps as n}from"../../internal/inert.js";import{controlSlots as i,controlTextClasses as a,cx as c,focusRingClasses as d,forcedEdgeClasses as m,gapClasses as p,glassClasses as f,hasContent as u,iconClasses as x,iconSizeClasses as h,metaTextClasses as v,paddingXClasses as g,sheetBodyClasses as b,transitionClasses as w}from"../../internal/styles.js";const y={solid:`text-(--p-on-solid) [background-image:var(--p-fill)] [box-shadow:var(--p-elev),var(--p-lift)] ${m}`,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:`${f} text-(--p-accent) bg-(--p-soft)`},j={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={xs:"min-h-5.5",sm:"min-h-6.5",md:"min-h-8",lg:"min-h-10",xl:"min-h-12"},k={xs:"rounded-[0.6875rem]",sm:"rounded-[0.8125rem]",md:"rounded-[1rem]",lg:"rounded-[1.25rem]",xl:"rounded-[1.5rem]"},z={default:{xs:"px-3",sm:"px-4",md:"px-5",lg:"px-6",xl:"px-8"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-4"}},P={static:{top:"relative",bottom:"relative"},sticky:{top:"sticky top-3 z-20",bottom:"sticky bottom-3 z-20"},fixed:{top:"fixed inset-x-0 top-3 z-30 mx-auto w-fit",bottom:"fixed inset-x-0 bottom-3 z-30 mx-auto w-fit"}};export const PlPill=/* @__PURE__ */l.forwardRef(function PlPill({variant:m="solid",size:f,color:_,density:R,elevation:C=2,startIcon:I,endIcon:$,title:H,description:M,details:O,expanded:B=!1,position:E="static",side:F="top",className:L,style:S,children:q,onClick:A,onPointerMove:D,...G},J){const K=r(),Q=f??K.size??"md",T=_??K.color??"secondary",U=R??K.density??"default",V=l.useRef(null),W=l.useId(),[X,Y]=l.useState(null),Z=u(O);l.useLayoutEffect(()=>{const e=V.current;if(!e||"undefined"==typeof ResizeObserver)return;const s=new ResizeObserver(()=>Y(e.scrollHeight));return s.observe(e),Y(e.scrollHeight),()=>s.disconnect()},[Z]);const ee=Boolean(A),se=g[U][Q],te=s(t,{children:[u(I)?e("span",{className:c("flex shrink-0 items-center justify-center overflow-hidden rounded-full [&_img]:size-full [&_img]:object-cover",h[Q]),children:I}):null,u(H)||u(M)||u(q)?s("span",{className:c("flex min-w-0 flex-1 flex-col items-center justify-center text-center",z[U][Q]),children:[u(H)?e("span",{className:"max-w-full truncate",children:H}):null,u(M)?e("span",{className:c("max-w-full truncate font-normal",v[Q],"[color:color-mix(in_oklab,currentColor_72%,transparent)]"),children:M}):null,q]}):null]});return s("div",{ref:J,className:c("inline-flex max-w-full flex-col overflow-hidden align-middle",k[Q],"font-medium whitespace-nowrap select-none",a[Q],y[m],w,x,ee?`plass-glow ${j[m]}`:"",P[E][F],L),style:{...i(T,C,m),...S},onPointerMove:o(ee,D),...G,children:[s("div",{className:c("flex shrink-0 items-center py-1",N[Q],p[Q],ee?"ps-0":se,u($)?"pe-1":ee?"pe-0":""),children:[ee?e("button",{type:"button",className:c("flex min-w-0 flex-1 cursor-pointer items-center justify-center self-stretch py-0","rounded-[inherit]",p[Q],se,d),"aria-expanded":Z?B:void 0,"aria-controls":Z?W:void 0,onClick:A,children:te}):te,u($)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:$}):null]}),Z?e("div",{id:W,className:c("overflow-hidden","[transition:height_var(--plass-duration-slow)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]"),style:{height:B?X??"auto":0},...n(!B),children:e("div",{ref:V,className:c("whitespace-normal pb-2",se,b[Q]),children:O})}):null]})});
|
|
@@ -1 +1 @@
|
|
|
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{Popover as o}from"@base-ui/react/popover";import{CloseIcon as r}from"../../internal/icons.js";import{PopupArrow as i}from"../../internal/picker.js";import{cx as n,focusRingClasses as t,glassClasses as d,hasContent as m,metaTextClasses as p,radiusClasses as c,sheetBodyClasses as u,sheetHeaderGapClasses as f,sheetPaddingXClasses as g,sheetPaddingYClasses as x,sheetSectionGapClasses as h,sheetTitleClasses as v,surfaceSlots as b,targetClasses as y}from"../../internal/styles.js";const w={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-lg"},j=/* @__PURE__ */[d,"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(" "),N={xs:8,sm:9,md:10,lg:11,xl:12},O=/* @__PURE__ */[y,"flex size-[1.6em] shrink-0 cursor-pointer items-center justify-center","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(" ");export const PlPopoverClose=o.Close;export function PlPopover({size:t,color:d,density:y,trigger:P,title:_,description:z,children:k,side:C="bottom",align:T="center",sideOffset:A=6,alignOffset:D=0,arrow:L=!1,open:R,defaultOpen:W,onOpenChange:$,modal:q=!1,dismissible:B=!0,showClose:E=!1,closeLabel:F,width:G,className:H,style:I,...J}){const K=l(),M=a(),Q=F??M.close,S=t??K.size??"md",U=d??K.color??"primary",V=y??K.density??"default",X=g[V][S],Y=x[V][S],Z=N[S],ss=m(_)||m(z);return e(o.Root,{open:R,defaultOpen:W,modal:q,onOpenChange:(s,e)=>{B||s||"escape-key"!==e.reason&&"outside-press"!==e.reason&&"focus-out"!==e.reason?$?.(s):e.cancel()},children:[P?s(o.Trigger,{render:P}):null,s(o.Portal,{children:s(o.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",side:C,align:T,sideOffset:A,alignOffset:D,children:e(o.Popup,{className:n(j,c[S],u[S],h[S],X,Y,void 0===G?w[S]:"",H),style:{...b(U,3),...void 0===G?null:{maxWidth:"number"==typeof G?`${G}px`:G},...I},...J,children:[L?s(i,{as:o.Arrow,size:Z}):null,ss||E?e("div",{className:"flex shrink-0 items-start gap-3",children:[e("div",{className:n("flex min-w-0 flex-1 flex-col",f[S]),children:[m(_)?s(o.Title,{className:n("m-0 font-semibold",v[S]),children:_}):null,m(z)?s(o.Description,{className:n("m-0 text-(--plass-muted-fg)",p[S]),children:z}):null]}),E?s(o.Close,{"aria-label":Q,className:O,children:s(r,{})}):null]}):null,m(k)?s("div",{className:"min-w-0",children:k}):null]})})})]})}
|
|
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{Popover as o}from"@base-ui/react/popover";import{CloseIcon as r}from"../../internal/icons.js";import{PopupArrow as i}from"../../internal/picker.js";import{cx as n,focusRingClasses as t,glassClasses as d,hasContent as m,metaTextClasses as p,radiusClasses as c,sheetBodyClasses as u,sheetHeaderGapClasses as f,sheetPaddingXClasses as g,sheetPaddingYClasses as x,sheetSectionGapClasses as h,sheetTitleClasses as v,surfaceSlots as b,targetClasses as y}from"../../internal/styles.js";const w={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-lg"},j=/* @__PURE__ */[d,"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(" "),N={xs:8,sm:9,md:10,lg:11,xl:12},O=/* @__PURE__ */[y,"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(" ");export const PlPopoverClose=o.Close;export function PlPopover({size:t,color:d,density:y,trigger:P,title:_,description:z,children:k,side:C="bottom",align:T="center",sideOffset:A=6,alignOffset:D=0,arrow:L=!1,open:R,defaultOpen:W,onOpenChange:$,modal:q=!1,dismissible:B=!0,showClose:E=!1,closeLabel:F,width:G,className:H,style:I,...J}){const K=l(),M=a(),Q=F??M.close,S=t??K.size??"md",U=d??K.color??"primary",V=y??K.density??"default",X=g[V][S],Y=x[V][S],Z=N[S],ss=m(_)||m(z);return e(o.Root,{open:R,defaultOpen:W,modal:q,onOpenChange:(s,e)=>{B||s||"escape-key"!==e.reason&&"outside-press"!==e.reason&&"focus-out"!==e.reason?$?.(s):e.cancel()},children:[P?s(o.Trigger,{render:P}):null,s(o.Portal,{children:s(o.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",side:C,align:T,sideOffset:A,alignOffset:D,children:e(o.Popup,{className:n(j,c[S],u[S],h[S],X,Y,void 0===G?w[S]:"",H),style:{...b(U,3),...void 0===G?null:{maxWidth:"number"==typeof G?`${G}px`:G},...I},...J,children:[L?s(i,{as:o.Arrow,size:Z}):null,ss||E?e("div",{className:"flex shrink-0 items-start gap-3",children:[e("div",{className:n("flex min-w-0 flex-1 flex-col",f[S]),children:[m(_)?s(o.Title,{className:n("m-0 font-semibold",v[S]),children:_}):null,m(z)?s(o.Description,{className:n("m-0 text-(--plass-muted-fg)",p[S]),children:z}):null]}),E?s(o.Close,{"aria-label":Q,className:O,children:s(r,{})}):null]}):null,m(k)?s("div",{className:"min-w-0",children:k}):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 l from"react";import{useDefaults as r,useLocale as s}from"../../internal/defaults.js";import{controlNaming as t}from"../../internal/form.js";import{Progress as i}from"@base-ui/react/progress";import{fillClasses as n,fillTransitionClasses as o,plateGapClasses as m,plateRadiusClasses as c,plateSizeClasses as f,progressAriaText as u,progressFraction as d,progressSlots as p,progressText as x,progressValue as h,trackClasses as b}from"../../internal/progress.js";import{cx as y,metaTextClasses as g,stackGapClasses as j}from"../../internal/styles.js";export const PlProgressBox=/* @__PURE__ */l.forwardRef(function PlProgressBox({size:l,color:w,count:N=4,value:v=null,min:M=0,max:P=100,label:V,showValue:k=!1,format:z,className:A,style:B,"aria-label":R,"aria-labelledby":T,...L},$){const q=r(),C=s(),D=l??q.size??"md",E=w??q.color??"primary",F=d(v,M,P),G=null===F,H=void 0!==z,I=Math.max(1,Math.floor(N));return a(i.Root,{ref:$,value:h(v,M,P),min:M,max:P,format:z,locale:C,getAriaValueText:u(F,H,C),className:y("inline-flex flex-col",j[D],A),style:{...p(E),...B},...t(R,T),...L,children:[V||k?a("div",{className:y("flex items-baseline gap-2",V?"justify-between":"justify-end",g[D]),children:[V?e(i.Label,{className:"min-w-0 truncate text-(--plass-fg)",children:V}):null,k?e(i.Value,{className:"shrink-0 tabular-nums text-(--plass-muted-fg)",children:e=>x(F,e,H,C)}):null]}):null,e(i.Track,{className:y("flex",m[D]),children:Array.from({length:I},(a,l)=>e("span",{className:y("relative overflow-hidden",b,f[D],c[D]),children:e("span",{"aria-hidden":"true",className:y("absolute inset-y-0 start-0",n,G?"plass-plate-wave w-full":o),style:G?{"--p-i":l}:{width:`${Math.min(100,Math.max(0,100*(F*I-l)))}%`}})},l))})]})});
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type PlassProgressProps } from '../../internal/progress.js';
|
|
3
3
|
export interface PlProgressCircularProps extends PlassProgressProps {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Diameter of the ring, and the size of the text beside it. Sits just under
|
|
6
|
+
* the control ladder at every step. `diameter` overrides the ring's part.
|
|
7
|
+
*/
|
|
5
8
|
size?: PlassProgressProps['size'];
|
|
9
|
+
/**
|
|
10
|
+
* The ring's diameter in pixels, for a ring larger than the ladder goes: a
|
|
11
|
+
* loading screen rather than a row. It takes the place of `size`'s diameter
|
|
12
|
+
* and the stroke follows it; `size` still sets the gap and the text beside
|
|
13
|
+
* the ring. Anything but a finite number above zero is ignored.
|
|
14
|
+
*/
|
|
15
|
+
diameter?: number;
|
|
6
16
|
}
|
|
7
17
|
/**
|
|
8
18
|
* A ring that fills, and the one to reach for where there is no room for a bar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as
|
|
1
|
+
"use client";import{jsx as r,jsxs as e}from"react/jsx-runtime";import*as s from"react";import{useDefaults as a,useLocale as t}from"../../internal/defaults.js";import{controlNaming as l}from"../../internal/form.js";import{Progress as o}from"@base-ui/react/progress";import{progressAriaText as i,progressFraction as n,progressSlots as m,progressText as c,progressValue as d,ringMetrics as f}from"../../internal/progress.js";import{cx as u,gapClasses as p,metaTextClasses as h}from"../../internal/styles.js";export const PlProgressCircular=/* @__PURE__ */s.forwardRef(function PlProgressCircular({size:x,diameter:k,color:g,value:v=null,min:y=0,max:$=100,label:b,showValue:j=!1,format:w,className:N,style:P,"aria-label":C,"aria-labelledby":V,...z},D){const I=a(),L=t(),R=x??I.size??"md",W=g??I.color??"primary",_=n(v,y,$),A=null===_,B=void 0!==w,G=`${s.useId()}-fill`,{diameter:M,stroke:T}=f(R,k),q=M/2,E=q-T/2,F=2*Math.PI*E,H=A?`${.28*F} ${F}`:`${F}`,J=A?0:F*(1-_);return e(o.Root,{ref:D,value:d(v,y,$),min:y,max:$,format:w,locale:L,getAriaValueText:i(_,B,L),className:u("inline-flex items-center",p[R],h[R],N),style:{...m(W),...P},...l(C,V),...z,children:[e("svg",{className:u("shrink-0",A&&"plass-ring-spin"),width:M,height:M,viewBox:`0 0 ${M} ${M}`,fill:"none","aria-hidden":"true",children:[r("defs",{children:e("linearGradient",{id:G,x1:"0",y1:"0",x2:"1",y2:"1",children:[r("stop",{offset:"0%",stopColor:"var(--p-solid)"}),r("stop",{offset:"100%",stopColor:"var(--p-solid-to)"})]})}),r("circle",{cx:q,cy:q,r:E,stroke:"var(--plass-track)",strokeWidth:T}),r("circle",{cx:q,cy:q,r:E,stroke:`url(#${G})`,strokeWidth:T,strokeLinecap:"round",strokeDasharray:H,strokeDashoffset:J,transform:`rotate(-90 ${q} ${q})`,className:"[transition:stroke-dashoffset_var(--plass-duration-slow)_var(--plass-ease)] motion-reduce:[transition-duration:0ms]"})]}),b?r(o.Label,{className:"min-w-0 truncate text-(--plass-fg)",children:b}):null,j?r(o.Value,{className:"shrink-0 tabular-nums text-(--plass-muted-fg)",children:r=>c(_,r,B,L)}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as r from"react";import{useDefaults as a,useLocale as s}from"../../internal/defaults.js";import{controlNaming as t}from"../../internal/form.js";import{Progress as o}from"@base-ui/react/progress";import{barThicknessClasses as i,fillClasses as n,fillTransitionClasses as m,progressAriaText as u,progressFraction as f,progressSlots as c,progressText as d,progressValue as p,trackClasses as x}from"../../internal/progress.js";import{cx as b,metaTextClasses as g,stackGapClasses as j}from"../../internal/styles.js";export const PlProgressLinear=/* @__PURE__ */r.forwardRef(function PlProgressLinear({size:r,color:h,value:w=null,min:y=0,max:N=100,label:v,showValue:P=!1,format:L,className:V,style:k,"aria-label":z,"aria-labelledby":R,...T},A){const I=a(),$=s(),q=r??I.size??"md",B=h??I.color??"primary",C=f(w,y,N),D=null===C,E=void 0!==L;return l(o.Root,{ref:A,value:p(w,y,N),min:y,max:N,format:L,locale:$,getAriaValueText:u(C,E,$),className:b("flex w-full flex-col",j[q],V),style:{...c(B),...k},...t(z,R),...T,children:[v||P?l("div",{className:b("flex items-baseline gap-2",v?"justify-between":"justify-end",g[q]),children:[v?e(o.Label,{className:"min-w-0 truncate text-(--plass-fg)",children:v}):null,P?e(o.Value,{className:"shrink-0 tabular-nums text-(--plass-muted-fg)",children:e=>d(C,e,E,$)}):null]}):null,e(o.Track,{className:b("relative w-full overflow-hidden rounded-full",x,i[q]),children:e(o.Indicator,{className:b("rounded-full",n,D?"plass-progress-sweep":`absolute top-0 ${m}`)})})]})});
|