plass-ui 1.6.0 → 1.7.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 +276 -0
- package/README.md +3 -1
- package/dist/components/accordion/PlAccordion.d.ts +13 -0
- 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/animate-headline/PlAnimateHeadline.d.ts +10 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +8 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
- 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.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 +7 -4
- 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/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/drawer/PlDrawer.js +1 -1
- package/dist/components/fieldset/PlFieldset.js +1 -1
- package/dist/components/file-picker/PlFilePicker.d.ts +3 -1
- package/dist/components/file-picker/PlFilePicker.js +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.js +1 -1
- package/dist/components/footer/PlFooter.d.ts +3 -1
- package/dist/components/gallery/PlGallery.js +1 -1
- 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.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/line-chart/PlLineChart.d.ts +32 -6
- package/dist/components/line-chart/PlLineChart.js +1 -1
- package/dist/components/menu/PlMenu.js +1 -1
- package/dist/components/mockup/PlMockup.d.ts +5 -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 +4 -3
- 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.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.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/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.js +1 -1
- package/dist/components/slider/PlSlider.js +1 -1
- package/dist/components/sparkline/PlSparkline.js +1 -1
- 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/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.js +1 -1
- package/dist/components/window-pane/PlWindowPane.d.ts +13 -3
- package/dist/components/window-pane/PlWindowPane.js +1 -1
- 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 +88 -10
- 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/defaults.d.ts +2 -2
- package/dist/internal/focusable.d.ts +10 -0
- package/dist/internal/focusable.js +1 -1
- package/dist/internal/form.d.ts +29 -0
- package/dist/internal/form.js +1 -1
- package/dist/internal/glow.d.ts +32 -1
- package/dist/internal/glow.js +1 -1
- package/dist/internal/icons.d.ts +24 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/labels.d.ts +22 -0
- package/dist/internal/labels.js +1 -1
- package/dist/internal/loading.d.ts +13 -0
- package/dist/internal/loading.js +1 -0
- 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/picker.d.ts +8 -2
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +17 -6
- package/dist/internal/progress.js +1 -1
- package/dist/internal/sizer.d.ts +12 -11
- 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 +114 -8
- 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/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 +406 -42
- package/dist/tokens.css +406 -42
- package/dist/types.d.ts +217 -13
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useDefaults as a}from"../../internal/defaults.js";import{useLabels as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useDisabled as t}from"../../internal/form.js";import{useDefaults as a}from"../../internal/defaults.js";import{ownsPress as n}from"../../internal/focusable.js";import{useLabels as r}from"../../internal/labels.js";import{NumberField as s}from"@base-ui/react/number-field";import{Field as i}from"@base-ui/react/field";import{MinusIcon as o,PlusIcon as c}from"../../internal/icons.js";import{hotKeyHandler as d}from"../../internal/keys.js";import{useFieldLight as m}from"../../internal/glow.js";import{FieldNotch as p,floatControlClassName as u,notchShellStyle as f,resolveNotch as h}from"../../internal/notch.js";import{controlHeightClasses as b,controlTextLeadingClasses as g,cx as x,disabledClasses as v,fieldDescriptionClasses as y,fieldReadOnlyClasses as j,fieldRestClasses as N,fieldSlots as w,focusRingClasses as k,focusWithinRingClasses as S,gapClasses as _,hasContent as V,iconClasses as z,metaTextClasses as D,paddingXClasses as O,radiusClasses as C,stackGapClasses as I,transitionClasses as P}from"../../internal/styles.js";const q=/* @__PURE__ */["relative flex w-full cursor-text items-center","[-webkit-tap-highlight-color:transparent]",P,z].join(" "),B=S,L=/* @__PURE__ */["inline-flex size-[1.7em] shrink-0 cursor-pointer items-center justify-center","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)",k,"disabled:cursor-not-allowed disabled:bg-transparent"].join(" ");export function PlNumberField({variant:k="glass",size:S,color:z,density:P,elevation:W=0,value:F,defaultValue:K,onValueChange:R,onValueCommitted:T,min:E,max:G,step:$,largeStep:A,smallStep:H,snapOnStep:J,allowWheelScrub:M=!1,format:Q,locale:U,steppers:X="end",incrementLabel:Y,decrementLabel:Z,label:ee,labelPlacement:le,description:te,error:ae,invalid:ne,startIcon:re,endIcon:se,fullWidth:ie=!1,disabled:oe=!1,readOnly:ce=!1,required:de=!1,name:me,placeholder:pe,id:ue,className:fe,hotKeys:he,classNames:be,style:ge,...xe}){const ve=a(),ye=t(oe),je=r(),Ne=Y??je.increase,we=Z??je.decrease,ke=U??ve.locale,Se=S??ve.size??"md",_e=z??ve.color??"primary",Ve=P??ve.density??"default",ze=le??ve.labelPlacement??"top",De="none"!==X&&!ce,{notched:Oe,float:Ce}=h(ze,ee,V(re)||De&&"split"===X),Ie=V(ae),Pe=ne??Ie,qe=Pe?"danger":_e,Be=!ye&&!ce,Le=m(Be),We=O[Ve][Se],Fe={end:`${We} pe-1`,split:"px-1",none:We},Ke=x(L,!ye&&"disabled:opacity-50"),Re=e(s.Decrement,{"aria-label":we,className:Ke,children:e(o,{})}),Te=e(s.Increment,{"aria-label":Ne,className:Ke,children:e(c,{})}),Ee=e(i.Label,{className:x(D[Se],"font-semibold",ye?"text-(--plass-muted-fg)":"text-(--plass-fg)",be?.label),children:ee});return l(i.Root,{disabled:ye,invalid:Pe,className:["flex-col align-top",I[Se],ie?"flex w-full":"inline-flex",fe??""].filter(Boolean).join(" "),style:{...w(qe,W),...ge},...xe,children:[V(ee)&&!Oe?Ee:null,e(s.Root,{id:ue,name:me,className:"contents",value:F,defaultValue:K,onValueChange:e=>R?.(e),onValueCommitted:e=>T?.(e),min:E,max:G,step:$,largeStep:A,smallStep:H,snapOnStep:J,allowWheelScrub:M,format:Q,locale:ke,disabled:ye,readOnly:ce,required:de,children:e(p,{notched:Oe,size:Se,density:Ve,variant:k,disabled:ye,readOnly:ce,float:Ce,label:Ee,children:l(s.Group,{style:Oe?f:void 0,...Le,onPointerDown:e=>{const l=e.currentTarget.querySelector('input:not([type="hidden"])');ye||n(e.target,e.currentTarget,l)||(e.preventDefault(),l?.focus())},className:[q,Oe?"":B,b[Se],g[Se],C[Se],_[Se],De?Fe[X]:We,ye?v[k]:ce?j[k]:N[k],Be?"plass-glow":"",be?.control].filter(Boolean).join(" "),children:[De&&"split"===X?Re:null,re?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:re}):null,e(s.Input,{placeholder:Ce?pe||" ":pe,onKeyDown:d(he,void 0),className:["min-w-0 flex-1 self-stretch bg-transparent [font:inherit] text-inherit","[outline:none]","tabular-nums","split"===X&&De?"text-center":"","placeholder:text-(--plass-muted-fg)","caret-(--p-accent) selection:bg-(--p-soft-press)","disabled:cursor-not-allowed",Ce?u:""].filter(Boolean).join(" ")}),se?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:se}):null,De&&"end"===X?l("span",{className:"flex shrink-0 items-center gap-0.5",children:[Re,Te]}):null,De&&"split"===X?Te:null]})})}),te?e(i.Description,{className:x(y(Se),be?.description),children:te}):null,e(i.Error,Ie?{match:!0,className:x(D[Se],"text-(--p-accent)",be?.error),children:ae}:{className:x(D[Se],"text-(--p-accent)",be?.error)})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{
|
|
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 r}from"../../internal/defaults.js";import{useLabels as n}from"../../internal/labels.js";import{Field as s}from"@base-ui/react/field";import{OTPField as o}from"@base-ui/react/otp-field";import{hotKeyHandler as i}from"../../internal/keys.js";import{cx as m,disabledClasses as d,fieldDescriptionClasses as c,fieldReadOnlyClasses as u,fieldRestClasses as p,hasContent as f,metaTextClasses as h,stackGapClasses as x,surfaceSlots as g,transitionClasses as b}from"../../internal/styles.js";const y={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"},v={xs:"rounded-[0.3125rem]",sm:"rounded-[0.375rem]",md:"rounded-[0.4375rem]",lg:"rounded-[0.5625rem]",xl:"rounded-[0.6875rem]"},N={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"}},$={numeric:"numeric",alpha:"alpha",alphanumeric:"alphanumeric",any:"none"};export const PlOtpField=/* @__PURE__ */l.forwardRef(function PlOtpField({variant:w="glass",size:V,color:F,density:C,elevation:I=0,length:M=6,charset:O="numeric",mask:S=!1,groupSize:k,separator:z="–",value:R,defaultValue:q,onValueChange:A,onComplete:D,onValueInvalid:K,autoSubmit:L=!1,label:P,description:_,error:E,invalid:T,name:B,required:G=!1,disabled:H=!1,readOnly:J=!1,autoFocus:Q=!1,slotLabel:U,className:W,hotKeys:X,classNames:Y,style:Z,...ee},ae){const le=r(),te=t(H),re=n(),ne=U??re.otpSlot,se=l.useId(),oe=V??le.size??"md",ie=F??le.color??"primary",me=C??le.density??"default",de=Math.min(12,Math.max(2,Math.round(M))),ce=f(E),ue=T??ce,pe=ue?"danger":ie,fe=m("text-center font-medium [font-family:inherit]",y[oe],N[oe],v[oe],b,"caret-(--p-accent) selection:bg-(--p-soft-press)","focus:[outline:2px_solid_var(--p-ring)] focus:[outline-offset:0px]",te?d[w]:J?u[w]:p[w]),he=k&&k>0?Math.round(k):0;return a(s.Root,{disabled:te,invalid:ue,className:m("inline-flex flex-col align-top",x[oe],W),style:{...g(pe,I),...Z},children:[f(P)?e(s.Label,{className:m(h[oe],"font-semibold",te?"text-(--plass-muted-fg)":"text-(--plass-fg)",Y?.label),children:e("span",{id:`${se}-label`,children:P})}):null,e(o.Root,{ref:ae,onKeyDown:i(X,void 0),length:de,validationType:$[O],mask:S,name:B,required:G,disabled:te,readOnly:J,autoSubmit:L,value:R,defaultValue:q,onValueChange:e=>A?.(e),onValueComplete:e=>D?.(e),onValueInvalid:e=>K?.(e),className:m("flex items-center",j[me][oe],Y?.control),...ee,children:Array.from({length:de},(t,r)=>a(l.Fragment,{children:[he>0&&r>0&&r%he===0?e("span",{"aria-hidden":"true",className:m("select-none px-0.5 text-(--plass-muted-fg)",N[oe]),children:z}):null,e(o.Input,{className:fe,autoFocus:Q&&0===r,"aria-labelledby":f(P)?`${se}-label ${se}-${r}`:`${se}-${r}`})]},r))}),Array.from({length:de},(a,l)=>e("span",{id:`${se}-${l}`,hidden:!0,children:ne(l+1,de)},l)),f(_)?e(s.Description,{className:m(c(oe),Y?.description),children:_}):null,e(s.Error,ce?{match:!0,className:m(h[oe],"text-(--p-accent)",Y?.error),children:E}:{className:m(h[oe],"text-(--p-accent)",Y?.error)})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useDefaults as s}from"../../internal/defaults.js";import{useLabels as l}from"../../internal/labels.js";import{Dialog as r}from"@base-ui/react/dialog";import{cx as t,surfaceSlots as i}from"../../internal/styles.js";const o={scrim:"bg-(--plass-scrim) [backdrop-filter:blur(2px)] [-webkit-backdrop-filter:blur(2px)]",glass:/* @__PURE__ */["[background-color:color-mix(in_oklab,var(--plass-scrim)_45%,transparent)]","[backdrop-filter:var(--plass-blur)] [-webkit-backdrop-filter:var(--plass-blur)]"].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)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" ");export function PlOverlay({open:m,defaultOpen:d,onOpenChange:f,tone:
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useDefaults as s}from"../../internal/defaults.js";import{useLabels as l}from"../../internal/labels.js";import{Dialog as r}from"@base-ui/react/dialog";import{cx as t,surfaceSlots as i}from"../../internal/styles.js";const o={scrim:"bg-(--plass-scrim) [backdrop-filter:blur(2px)] [-webkit-backdrop-filter:blur(2px)]",glass:/* @__PURE__ */["[background-color:color-mix(in_oklab,var(--plass-scrim)_45%,transparent)]","[backdrop-filter:var(--plass-blur)] [-webkit-backdrop-filter:var(--plass-blur)]"].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:f,tone:u="scrim",dismissible:b=!1,modal:x=!0,align:y="center",size:g,color:j,label:k,className:h,classNames:v,style:z,children:w,...N}){const O=s(),P=l(),_=k??P.overlay,B=g??O.size??"md",C=j??O.color??"primary";return e(r.Root,{open:m,defaultOpen:d,modal:x,disablePointerDismissal:!b,onOpenChange:(e,a)=>{b||e||"escape-key"!==a.reason?f?.(e):a.cancel()},children:a(r.Portal,{children:[e(r.Backdrop,{className:t("plass-portal fixed inset-0 z-(--plass-z-portal)",c,o[u],v?.backdrop)}),e(r.Viewport,{className:["plass-portal fixed inset-0 z-(--plass-z-portal) flex justify-center",n[y],p[B]].join(" "),children:e(r.Popup,{"aria-label":_,className:["flex max-h-full max-w-full flex-col items-center justify-center","[outline:none]",c,h??""].filter(Boolean).join(" "),style:{...i(C,0),...z},...N,children:w})})]})})}
|
|
@@ -28,13 +28,17 @@ export interface PlPageLayoutProps extends React.ComponentPropsWithoutRef<'div'>
|
|
|
28
28
|
* - `content` — the sidebars run the full height of the window and the header
|
|
29
29
|
* sits between them, belonging to the view rather than to the site. The
|
|
30
30
|
* arrangement of an application.
|
|
31
|
+
*
|
|
32
|
+
* A `fixed` header spans the window whatever this says, so the sidebars
|
|
33
|
+
* start below it; a header meant to sit between them is `sticky`.
|
|
31
34
|
* @default 'full'
|
|
32
35
|
*/
|
|
33
36
|
headerSpan?: PlPageLayoutSpan;
|
|
34
37
|
/**
|
|
35
38
|
* The same question for the footer, and it is worth answering separately: a
|
|
36
39
|
* dashboard with a full-height navigation rail still usually wants its
|
|
37
|
-
* copyright line under the content rather than under the rail.
|
|
40
|
+
* copyright line under the content rather than under the rail. A `fixed`
|
|
41
|
+
* footer spans the window whatever this says, so the sidebars end above it.
|
|
38
42
|
* @default 'full'
|
|
39
43
|
*/
|
|
40
44
|
footerSpan?: PlPageLayoutSpan;
|
|
@@ -95,17 +99,24 @@ export interface PlPageLayoutProps extends React.ComponentPropsWithoutRef<'div'>
|
|
|
95
99
|
* to walk past all forty on every page before reaching the article, and this
|
|
96
100
|
* is the one link that spares them. It costs a sighted reader nothing,
|
|
97
101
|
* because it is invisible until it is tabbed to.
|
|
102
|
+
*
|
|
103
|
+
* Never drawn by a layout inside another `PlPageLayout`, whose content is a
|
|
104
|
+
* `<div>` rather than a second `<main>`: the page has one of each already.
|
|
98
105
|
* @default true
|
|
99
106
|
*/
|
|
100
107
|
skipLink?: boolean;
|
|
101
108
|
/** What that link says. @default 'Skip to content' */
|
|
102
109
|
skipLabel?: React.ReactNode;
|
|
103
110
|
/**
|
|
104
|
-
* The `id` the skip link jumps to, put on the `<main>`.
|
|
111
|
+
* The `id` the skip link jumps to, put on the `<main>`. Not put anywhere by
|
|
112
|
+
* a layout inside another, which has neither.
|
|
105
113
|
* @default 'main'
|
|
106
114
|
*/
|
|
107
115
|
mainId?: string;
|
|
108
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Anything else the `<main>` needs — a `className`, an `aria-label`. Inside
|
|
118
|
+
* another layout it goes on the `<div>` that takes the `<main>`'s place.
|
|
119
|
+
*/
|
|
109
120
|
mainProps?: Omit<React.ComponentPropsWithoutRef<'main'>, 'id' | 'children'>;
|
|
110
121
|
/** The colour family the skip link lights up in. @default 'primary' */
|
|
111
122
|
color?: PlassColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as o from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useLabels as n}from"../../internal/labels.js";import{PlPageLayoutContext as r,PlassSidebarSideContext as s}from"../../internal/page-layout.js";import{controlSlots as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as o from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useLabels as n}from"../../internal/labels.js";import{PlPageLayoutContext as r,PlassSidebarSideContext as s}from"../../internal/page-layout.js";import{controlSlots as i,cx as a,hasContent as u,toLength as c}from"../../internal/styles.js";const d=["header","footer"];export const PlPageLayout=/* @__PURE__ */o.forwardRef(function PlPageLayout({header:f,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:z="main",mainProps:$,color:R,className:L,style:E,children:M,...B},H){const _=t(),I=n(),T=N??I.skipToContent,q=R??_.color??"primary",A=o.useContext(r).present,D=A?"div":"main",[F,G]=o.useState(P),[J,K]=o.useState(C),Q=o.useMemo(()=>({start:w??F,end:S??J}),[w,F,S,J]),U=o.useCallback((e,l)=>{if("start"===e)return void 0===w&&G(l),void k?.(l);void 0===S&&K(l),O?.(l)},[w,S,k,O]),V=o.useRef(null),W=o.useCallback(e=>{V.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=V.current;if(e)for(const l of d){const o=X.current[l],t="header"===l?v:x;if(!o){e.style.setProperty(`--p-layout-${l}`,"0px"),e.style.setProperty(`--p-layout-${l}-inset`,"0px");continue}const n=getComputedStyle(o).position,r=`${o.offsetHeight}px`,s="fixed"===n;e.style.setProperty(`--p-layout-${l}`,s||"sticky"===n&&"full"===t?r:"0px"),e.style.setProperty(`--p-layout-${l}-inset`,s?r:"0px")}},[v,x]),ee=o.useCallback(()=>{const e=Y.current;if(e){e.disconnect();for(const l of d){const o=X.current[l];o&&e.observe(o)}}Z()},[Z]);o.useEffect(()=>(Y.current=new ResizeObserver(()=>Z()),ee(),()=>{Y.current?.disconnect(),Y.current=null}),[Z,ee]);const le=o.useCallback((e,l)=>{X.current[e]=l,ee()},[ee]),oe=o.useMemo(()=>({present:!0,register:le,collapseBelow:g,open:Q,setOpen:U,scroll:y}),[le,g,Q,U,y]),te=o.useMemo(()=>({...oe,register:()=>{}}),[oe]),ne="content"===y,re=c("viewport"===b||"auto"===b?void 0:b),se=void 0!==re?"":"auto"===b?ne?"h-full":"min-h-full":ne?"h-dvh":"min-h-dvh",ie=u(f)?f:null,ae=u(p)?p:null,ue=(u(m)||u(h))&&("content"===v&&null!==ie||"content"===x&&null!==ae);return e(r.Provider,{value:oe,children:l("div",{ref:W,className:a("relative flex w-full flex-col",ne?"overflow-hidden":"",se,"[padding-top:var(--p-layout-header-inset,0px)]","[padding-bottom:var(--p-layout-footer-inset,0px)]",L),style:void 0===re?E:{...ne?{height:re}:{minHeight:re},...E},...B,children:[j&&!A?e("a",{href:`#${z}`,className:a("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:i(q,2,"solid"),children:T}):null,"full"===v?ie:null,l("div",{className:a("flex w-full flex-1",ne?"min-h-0":"",ue?"z-1 [&>aside]:z-21":""),children:[u(m)?e(s.Provider,{value:"start",children:m}):null,l("div",{className:a("flex min-w-0 flex-1 flex-col",ne?"min-h-0":""),children:["content"===v?ie:null,e(D,{...$,id:A?void 0:z,className:a("min-w-0 flex-1",ne?"min-h-0 overflow-y-auto":"",$?.className),children:e(r.Provider,{value:te,children:M})}),"content"===x?ae:null]}),u(h)?e(s.Provider,{value:"end",children:h}):null]}),"full"===x?ae:null]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{useDisabled as t}from"../../internal/form.js";import{useDefaults as r}from"../../internal/defaults.js";import{useLabels as i}from"../../internal/labels.js";import{PlButton as l}from"../button/PlButton.js";import{ChevronIcon as o}from"../../internal/icons.js";import{controlTextClasses as s,gapClasses as m,srOnlyClasses as c}from"../../internal/styles.js";function range(e,a){return Array.from({length:Math.max(0,a-e+1)},(a,n)=>e+n)}function DoubleChevronIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"m7.5 4.5 3.5 3.5-3.5 3.5M3.5 4.5 7 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const u={xs:"h-6 min-w-6",sm:"h-8 min-w-8",md:"h-10 min-w-10",lg:"h-12 min-w-12",xl:"h-14 min-w-14"},d={backgroundImage:"none"};export const PlPagination=/* @__PURE__ */n.forwardRef(function PlPagination({variant:h="ghost",size:f,color:p,density:g,elevation:b=0,count:x,page:v,defaultPage:y=1,onPageChange:j,siblingCount:M=1,boundaryCount:N=1,showEdges:w=!1,showArrows:L=!0,disabled:P=!1,getPageHref:k,renderLink:C,label:I,pageLabel:D,previousLabel:z,nextLabel:K,firstLabel:B,lastLabel:$,statusLabel:A,className:R,children:S,...W},E){const F=r(),H=t(P),q=i(),G=I??q.pagination,J=z??q.paginationPrevious,O=K??q.paginationNext,Q=B??q.paginationFirst,T=$??q.paginationLast,U=D??q.paginationPage,V=A??q.paginationStatus,X=f??F.size??"md",Y=p??F.color??"primary",Z=g??F.density??"compact",[_,ee]=n.useState(y),ae=Math.min(Math.max(v??_,1),Math.max(x,1));if(x<2)return null;const ne=function paginationRange(e,a,n,t){const r=range(1,Math.min(t,e)),i=range(Math.max(e-t+1,t+1),e),l=Math.max(Math.min(a-n,e-t-2*n-1),t+2),o=Math.min(Math.max(a+n,t+2*n+2),i.length>0?i[0]-2:e-1);return[...r,...l>t+2?["start-ellipsis"]:t+1<e-t?[t+1]:[],...range(l,o),...o<e-t-1?["end-ellipsis"]:e-t>t?[e-t]:[],...i]}(x,ae,M,N),te=ae<=1,re=ae>=x,linkProps=(a,n,t)=>{if(!k||H)return null;if(n)return{render:e("a",{role:"link"}),"aria-disabled":!0,tabIndex:0};const r=k(a);return{render:C?C(a,r):e("a",{href:r}),rel:t}},press=(e,a)=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||k&&!j||(e.preventDefault(),(e=>{const a=Math.min(Math.max(e,1),x);a!==ae&&(void 0===v&&ee(a),j?.(a))})(a))},stepper=(a,n,t,r,i,o,s)=>e("li",{className:"flex",children:e(l,{variant:h,size:X,color:Y,density:Z,elevation:b,disabled:H||r,focusableWhenDisabled:!H,"aria-label":n,startIcon:e("span",{className:`flex items-center ${i}`,children:o}),onClick:e=>press(e,t),...linkProps(t,r,s)})},a);return a("nav",{ref:E,"aria-label":G,className:["flex items-center",R??""].filter(Boolean).join(" "),...W,children:[a("ul",{role:"list",className:`m-0 flex list-none items-center p-0 ${m[X]}`,children:[w?stepper("first",Q,1,te,"rotate-180 rtl:rotate-0",e(DoubleChevronIcon,{})):null,L?stepper("previous",J,ae-1,te,"rotate-90 rtl:-rotate-90",e(o,{}),"prev"):null,ne.map((n,t)=>e("li","number"==typeof n?{className:"flex",children:a(l,{variant:n===ae?"solid":h,size:X,color:Y,density:Z,elevation:b,disabled:H,"aria-label":U(n),"aria-current":n===ae?"page":void 0,className:n===ae||"solid"===h?"tabular-nums [--p-fill-on:1]":"tabular-nums",style:d,onClick:e=>press(e,n),...linkProps(n,!1),children:[e("span",{"aria-hidden":"true",className:"plass-fill-layer"}),n]})}:{"aria-hidden":"true",className:["flex select-none items-center justify-center","text-(--plass-muted-fg)",s[X],u[X]].join(" "),children:"…"},`slot-${t}`)),L?stepper("next",O,ae+1,re,"-rotate-90 rtl:rotate-90",e(o,{}),"next"):null,w?stepper("last",T,x,re,"rtl:rotate-180",e(DoubleChevronIcon,{})):null]}),e("span",{className:c,"aria-live":"polite",children:V(ae,x)}),S]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{useDefaults as n}from"../../internal/defaults.js";import{beginPointerDrag as i}from"../../internal/drag.js";import{cx as o,transitionClasses as s}from"../../internal/styles.js";import{useResponsiveValue as a}from"../../internal/responsive.js";const l=/* @__PURE__ */r.createContext({basis:null,id:void 0}),c={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},u={xs:4,sm:6,md:8,lg:10,xl:12};function toPixels(e,t,r){if(null==e)return;if("number"==typeof e)return t*e/100;const n=/^\s*(-?[\d.]+)\s*(px|rem|em|%)\s*$/.exec(e);if(!n)return;const i=Number(n[1]);if(!Number.isNaN(i))switch(n[2]){case"px":return i;case"%":return t*i/100;case"rem":return i*parseFloat(getComputedStyle(document.documentElement).fontSize||"16");case"em":return i*parseFloat(r&&getComputedStyle(r).fontSize||"16");default:return}}export const PlPanes=/* @__PURE__ */r.forwardRef(function PlPanes({orientation:d,resizable:
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{useDefaults as n}from"../../internal/defaults.js";import{beginPointerDrag as i}from"../../internal/drag.js";import{cx as o,transitionClasses as s}from"../../internal/styles.js";import{useResponsiveValue as a}from"../../internal/responsive.js";const l=/* @__PURE__ */r.createContext({basis:null,id:void 0}),c={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},u={xs:4,sm:6,md:8,lg:10,xl:12};function toPixels(e,t,r){if(null==e)return;if("number"==typeof e)return t*e/100;const n=/^\s*(-?[\d.]+)\s*(px|rem|em|%)\s*$/.exec(e);if(!n)return;const i=Number(n[1]);if(!Number.isNaN(i))switch(n[2]){case"px":return i;case"%":return t*i/100;case"rem":return i*parseFloat(getComputedStyle(document.documentElement).fontSize||"16");case"em":return i*parseFloat(r&&getComputedStyle(r).fontSize||"16");default:return}}export const PlPanes=/* @__PURE__ */r.forwardRef(function PlPanes({orientation:d,resizable:f=!0,color:m,size:p,onResize:g,onResizeEnd:h,label:x,className:v,style:b,children:z,...w},y){const P=a(d,"horizontal"),S=n(),R=m??S.color??"primary",C=p??S.size??"md",M=r.Children.toArray(z).filter(r.isValidElement),N=M.length,$=r.useId(),paneId=e=>M[e]?.props.id??`${$}-pane-${e}`,j=r.useRef(null),k=r.useCallback(e=>{j.current=e,"function"==typeof y?y(e):y&&(y.current=e)},[y]),E=r.useRef([]);E.current=M.map(e=>e.props);const[A,D]=r.useState(null),F=A&&A.length===N?A:null,I=r.useRef(null);I.current=F;const B="horizontal"===P,T=u[C]*Math.max(0,N-1);function grip(e){const t=j.current,r=I.current;if(!f||!t||!r||void 0===r[e+1])return null;const n=t.getBoundingClientRect(),i=(B?n.width:n.height)-T;if(i<=0)return null;const o=E.current[e],s=E.current[e+1],a=r[e]*i,l=a+r[e+1]*i,c=Math.max(toPixels(o?.minSize,i,t)??0,l-(toPixels(s?.maxSize,i,t)??l)),u=Math.min(toPixels(o?.maxSize,i,t)??l,l-(toPixels(s?.minSize,i,t)??0));return u<c?null:{root:t,current:r,extent:i,start:a,pair:l,resize(t){const n=Math.min(u,Math.max(c,a+t));if(n===a)return r;const o=[...r];return o[e]=n/i,o[e+1]=(l-n)/i,D(o),g?.(o.map(e=>100*e)),o}}}r.useEffect(()=>{const e=j.current;if(!e)return;const measure=()=>{const t=e.getBoundingClientRect(),r=(B?t.width:t.height)-T;r<=0||D(t=>t&&t.length===N?t:function initialFractions(e,t,r){const n=e.map(e=>toPixels(e.defaultSize,t,r)),i=n.reduce((e,t)=>e+(t??0),0),o=n.filter(e=>void 0===e).length,s=o>0?Math.max(0,t-i)/o:0,a=n.map(e=>Math.max(0,e??s)),l=a.reduce((e,t)=>e+t,0);return l<=0?a.map(()=>1/Math.max(1,a.length)):a.map(e=>e/l)}(E.current,r,e))};measure();const t=new ResizeObserver(measure);return t.observe(e),()=>t.disconnect()},[N,B,T]);const X=r.useRef(null);r.useEffect(()=>()=>X.current?.(),[]);const Y=o("group/handle relative z-1 flex shrink-0 grow-0 items-center justify-center",c[C],s,"[outline:none] focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-0",f?o(B?"cursor-col-resize":"cursor-row-resize","touch-none","hover:bg-(--p-soft) data-[dragging]:bg-(--p-soft)"):"");return e("div",{ref:k,className:o("flex h-full w-full",B?"flex-row":"flex-col","min-h-0 min-w-0",v),style:{"--p-accent":`var(--plass-${R}-accent)`,"--p-soft":`var(--plass-${R}-soft)`,"--p-ring":`var(--plass-${R}-ring)`,...b},...w,children:M.map((n,a)=>t(r.Fragment,{children:[a>0?e("div",{role:"separator","aria-label":x,"aria-controls":paneId(a-1),"aria-orientation":B?"vertical":"horizontal","aria-valuenow":F?Math.round(100*F[a-1]):void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-disabled":!f||void 0,tabIndex:f?0:-1,className:Y,onPointerDown:e=>{0===e.button&&function beginDrag(e,t){const r=grip(e);if(!r)return;const n=B?t.clientX:t.clientY,o=B&&"rtl"===getComputedStyle(r.root).direction?-1:1;let s=r.current;const a=i({target:t.currentTarget,pointerId:t.pointerId,onMove:e=>{const t=B?e.clientX:e.clientY;s=r.resize((t-n)*o)},onEnd:()=>{X.current=null,h?.(s.map(e=>100*e))}});X.current=a}(a-1,e)},onKeyDown:e=>{const t=B?"ArrowLeft":"ArrowUp",r=B?"ArrowRight":"ArrowDown";if(e.key!==t&&e.key!==r)return;e.preventDefault();const n=B&&"rtl"===getComputedStyle(e.currentTarget).direction?-1:1,i=e.key===r?16:-16;!function nudge(e,t){const r=grip(e);if(!r)return;const n=r.resize(t);n!==r.current&&h?.(n.map(e=>100*e))}(a-1,i*n)},children:e("span",{"aria-hidden":"true",className:o("pointer-events-none bg-(--plass-border)",s,B?"h-full w-px":"h-px w-full",f?"group-hover/handle:bg-(--p-accent) group-focus-visible/handle:bg-(--p-accent) group-data-[dragging]/handle:bg-(--p-accent)":"")})}):null,e(l.Provider,{value:{basis:F?`calc((100% - ${T}px) * ${F[a].toFixed(6)})`:null,id:paneId(a)},children:n})]},n.key??a))})});export const PlPane=/* @__PURE__ */r.forwardRef(function PlPane({defaultSize:t,minSize:n,maxSize:i,className:s,style:a,children:c,...u},d){const{basis:f,id:m}=r.useContext(l);return e("div",{ref:d,id:m,className:o("relative min-h-0 min-w-0 overflow-auto",s),style:{flex:f?`0 0 ${f}`:"1 1 0%",...a},...u,children:c})});
|
|
@@ -26,6 +26,31 @@ export interface PlPieChartProps extends ChartBaseProps {
|
|
|
26
26
|
* @default 0
|
|
27
27
|
*/
|
|
28
28
|
startAngle?: number;
|
|
29
|
+
/**
|
|
30
|
+
* How much of the middle is cut out, as a fraction of the radius: `0` is a
|
|
31
|
+
* filled disc and `0.8` is a thin band. Clamped to `0`–`0.95`.
|
|
32
|
+
*
|
|
33
|
+
* `shape` already picks one — nothing for a `pie`, and a little under two
|
|
34
|
+
* thirds for a `donut` and a `semi`, which is the proportion that leaves a
|
|
35
|
+
* ring thick enough to read a colour off and a hole big enough to put the
|
|
36
|
+
* total in. This is for when the hole has a particular job: a wider one for a
|
|
37
|
+
* two-line readout, a narrower one on a small dashboard tile. Setting it on a
|
|
38
|
+
* `pie` opens a hole in one, which is a `donut` by another name.
|
|
39
|
+
*/
|
|
40
|
+
innerRadius?: number;
|
|
41
|
+
/**
|
|
42
|
+
* The gap between two neighbouring slices, in degrees. Clamped to `0`–`10`.
|
|
43
|
+
*
|
|
44
|
+
* Left alone it is the 2px the library puts between any two marks, worked out
|
|
45
|
+
* at the rim — so the gap is a constant *on screen* rather than a constant in
|
|
46
|
+
* the data, and a small pie is not drawn with the same sliver of surface a
|
|
47
|
+
* large one gets. Widen it to make a ring read as separate segments; `0`
|
|
48
|
+
* closes it, which is what a pie of two or three slices usually wants.
|
|
49
|
+
*
|
|
50
|
+
* A slice narrower than twice the gap keeps none of it, or a one-degree
|
|
51
|
+
* sliver would invert and draw the whole circle instead of nothing.
|
|
52
|
+
*/
|
|
53
|
+
padAngle?: number;
|
|
29
54
|
/**
|
|
30
55
|
* What goes in the hole. A `donut` or a `semi` with nothing in the middle is
|
|
31
56
|
* a pie with a bite out of it; the total, or the one figure the chart is
|
|
@@ -55,4 +80,4 @@ export interface PlPieChartProps extends ChartBaseProps {
|
|
|
55
80
|
* A slice's colour follows the slice and not its size, so a chart that is
|
|
56
81
|
* refiltered or resorted keeps every category the colour it had.
|
|
57
82
|
*/
|
|
58
|
-
export declare function PlPieChart({ data, categories, shape, startAngle, 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, format, locale: localeProp, label, 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 n from"react";import{ChartDataTable as a,ChartLegendBar as t,ChartStatus as i,ChartSurface as s,ChartTooltipPanel as r,markTransitionClasses as o,useMeasuredWidth as d,useVisibility as u}from"../../internal/chart-frame.js";import{arcPath as m,categoryAt as c,chartFontSizes as h,compactNumber as v,dimmedByHover as p,formatCategory as f,markGap as x,plotHeights as g,seriesColor as b,toValue as y}from"../../internal/chart.js";import{useDefaults as M}from"../../internal/defaults.js";import{numberFormatter as N}from"../../internal/format.js";import{useLabels as j}from"../../internal/labels.js";import{cx as I,metaTextClasses as w,srOnlyClasses as P}from"../../internal/styles.js";const k={pie:0,donut:.62,semi:.62},clamp=(e,l,n)=>Math.min(n,Math.max(l,e));export function PlPieChart({data:z,categories:$,shape:A="pie",startAngle:S=0,innerRadius:B,padAngle:E,center:L,valueLabels:R="none",height:D,format:O,locale:C,label:_,legend:F,tooltip:K,empty:V,size:W,variant:q="ghost",padded:G=!1,className:H,...J}){const Q=M(),T=W??Q.size??"md",U=C??Q.locale,X=n.useRef(null),Y=d(X),Z=j(),ee=n.useId(),le=n.useId(),ne=n.useId(),ae=n.useId(),te=n.useCallback(e=>O?N(U,O).format(e):v(e,U),[O,U]),ie=n.useMemo(()=>z.map(y),[z]),se=n.useMemo(()=>ie.map((e,l)=>({name:f(c(l,$,[ie]),U),data:[z[l]],color:e.color})),[ie,$,z,U]),re=!1===F?{interactive:!1}:!0===F||void 0===F?{}:F,oe=!1!==F&&se.length>1,de=re.side??"bottom",ue=u(se,oe&&!1!==re.interactive),[me,ce]=n.useState(null),setActive=e=>ce(null===e?null:ue.keys[e]??null),he=se.map((e,l)=>b(e,l)),ve=ie.reduce((e,l,n)=>ue.visible[n]&&null!==l.value?e+Math.abs(l.value):e,0),pe="semi"===A,fe="number"==typeof D?D:g[T],xe=h[T],ge=!1===K?{mode:"none"}:!0===K||void 0===K?{}:K,be="none"===ge.mode,ye=Y/2,Me=Math.max(0,Math.min(Y/2,pe?fe:fe/2)-2),Ne=pe?Math.min(fe,fe/2+Me/2):fe/2,je=Me*clamp(B??k[A],0,.95),Ie=ve<=0,we=!Ie&&Boolean(L)&&je>0,Pe=void 0===E?Me>0?Math.min(4,x/Me*(180/Math.PI)):0:clamp(E,0,10),ke=pe?180:360,ze=[];let $e=pe?-90:S;ie.forEach((e,l)=>{if(!ue.visible[l]||null===e.value||0===e.value)return;const n=Math.abs(e.value)/ve,a=n*ke;ze.push({index:l,start:$e,end:$e+a,value:e.value,share:n}),$e+=a});const Ae=null===me?-1:ue.keys.indexOf(me),Se=ze.some(e=>e.index===Ae)?Ae:null;null!==me&&null===Se&&ce(null);const share=e=>`${te(e)} · ${Math.round(10*(Math.abs(e)/ve*100+Number.EPSILON))/10}%`,Be=null===Se?[]:[{seriesIndex:Se,name:se[Se]?.name,color:ie[Se]?.color??he[Se],value:ie[Se]?.value??null,formatted:share(ie[Se]?.value??0),label:ie[Se]?.label}],Ee=Be.map(e=>({...e,name:void 0}));return l(s,{...J,size:T,variant:q,padded:G,className:H,legendSide:de,legend:oe?e(t,{series:se,colors:he,options:re,visibility:ue,size:T,values:re.showValue?ie.map(e=>null===e.value?void 0:te(e.value)):void 0}):null,table:Ie?null:e(a,{id:ee,caption:_,categories:se.map(e=>e.name??""),series:[{name:_,data:z}],values:[ie],format:te,locale:U}),children:[l("div",{ref:X,role:"img",tabIndex:Ie?void 0:0,"aria-label":_??Z.chart,"aria-describedby":Ie?ne:we?`${ae} ${le}`:le,onPointerLeave:()=>setActive(null),onBlur:()=>setActive(null),onKeyDown:e=>{if(be)return;if("Escape"===e.key&&null!==Se)return setActive(null),e.stopPropagation(),void e.preventDefault();if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;const l=ze.map(e=>e.index);if(0===l.length)return;const n=null===Se?-1:l.indexOf(Se),a="ArrowRight"===e.key,t=-1===n?a?0:l.length-1:(n+(a?1:-1)+l.length)%l.length;setActive(l[t]),e.preventDefault()},className:I("relative w-full rounded-(--plass-radius-xs)","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-2"),style:{height:fe},children:[Ie?e("div",{id:ne,className:I("flex h-full items-center justify-center text-(--plass-muted-fg)",w[T]),children:V??Z.empty}):Y>0&&Me>0?l("svg",{width:Y,height:fe,viewBox:`0 0 ${Y} ${fe}`,"aria-hidden":"true",className:"block",children:[ze.map(l=>{const n=p(ue.hovered,l.index,ue.visible)||null!==Se&&Se!==l.index,a=l.end-l.start>2*Pe?Pe/2:0;return e("path",{d:m(ye,Ne,Me,je,l.start+a,l.end-a),fill:ie[l.index].color??he[l.index],opacity:n?.32:1,onPointerEnter:be?void 0:()=>setActive(l.index),className:o},l.index)}),"all"===R?ze.map(l=>{const n=((l.start+l.end)/2-90)*(Math.PI/180),a=je>0?(je+Me)/2:.68*Me,t=`${Math.round(100*l.share)}%`;return(l.end-l.start)*(Math.PI/180)*a<2*xe||Me-je<1.6*xe?null:e("text",{x:ye+a*Math.cos(n),y:Ne+a*Math.sin(n),textAnchor:"middle",dominantBaseline:"central",fontSize:xe,fontWeight:600,fill:"var(--plass-surface)",className:"tabular-nums",children:t},l.index)}):null]}):null,we?e("div",{id:ae,className:"pointer-events-none absolute flex flex-col items-center justify-center text-center",style:{insetInlineStart:ye-je,top:Ne-je,width:2*je,height:pe?je:2*je},children:L}):null,null===Se||be?null:ge.render?e("div",{className:"pointer-events-none absolute top-0 start-1/2 z-10",children:ge.render({index:Se,category:se[Se]?.name??Se,items:Be})}):e(r,{heading:se[Se]?.name,items:Ee,x:ye,y:8,flip:!1,size:T})]}),Ie?null:e("span",{id:le,className:P,children:ze.map((e,a)=>l(n.Fragment,{children:[a>0||we?", ":null,se[e.index]?.name," ",ie[e.index]?.label??share(e.value)]},e.index))}),be?null:e(i,{heading:null===Se?void 0:se[Se]?.name,items:Ee})]})}
|
|
@@ -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
|
|
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]})});
|
|
@@ -21,6 +21,13 @@ export interface PlPopconfirmProps {
|
|
|
21
21
|
* the caller's, and `onConfirm` is where to report it from.
|
|
22
22
|
*/
|
|
23
23
|
onConfirm?: () => void | Promise<unknown>;
|
|
24
|
+
/**
|
|
25
|
+
* The word a screen reader hears after the confirming button's name while it
|
|
26
|
+
* waits on `onConfirm` — "Deleting", "Revoking". It takes the place of the
|
|
27
|
+
* label set's `loading` for that button.
|
|
28
|
+
* @default 'Loading'
|
|
29
|
+
*/
|
|
30
|
+
loadingLabel?: string;
|
|
24
31
|
/** What cancelling does, beyond closing. */
|
|
25
32
|
onCancel?: () => void;
|
|
26
33
|
/** @default 'danger' */
|
|
@@ -58,4 +65,4 @@ export interface PlPopconfirmProps {
|
|
|
58
65
|
* is not an inconsistency: nobody reaches for a popconfirm to ask whether to
|
|
59
66
|
* save.
|
|
60
67
|
*/
|
|
61
|
-
export declare function PlPopconfirm({ trigger, title, description, confirmLabel: confirmLabelProp, cancelLabel: cancelLabelProp, onConfirm, onCancel, color: colorProp, size: sizeProp, side, align, width, open: openProp, defaultOpen, onOpenChange, className }: PlPopconfirmProps): React.JSX.Element;
|
|
68
|
+
export declare function PlPopconfirm({ trigger, title, description, confirmLabel: confirmLabelProp, cancelLabel: cancelLabelProp, onConfirm, loadingLabel, onCancel, color: colorProp, size: sizeProp, side, align, width, open: openProp, defaultOpen, onOpenChange, className }: PlPopconfirmProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as i from"react";import{PlButton as n}from"../button/PlButton.js";import{PlPopover as t}from"../popover/PlPopover.js";import{useDefaults as r}from"../../internal/defaults.js";import{useLabels as s}from"../../internal/labels.js";import{cx as a}from"../../internal/styles.js";export function PlPopconfirm({trigger:l,title:c,description:m,confirmLabel:d,cancelLabel:p,onConfirm:f,loadingLabel:g,onCancel:u,color:h,size:j,side:y="top",align:b="center",width:C=280,open:x,defaultOpen:P,onOpenChange:v,className:w}){const z=r(),L=s(),N=d??L.confirm,O=p??L.cancel,k=j??z.size??"md",S=h??"danger",[B,F]=i.useState(P??!1),q=x??B,[A,D]=i.useState(!1),setOpen=e=>{void 0===x&&F(e),v?.(e)};return e(t,{trigger:l,open:q,onOpenChange:e=>{A||(e||u?.(),setOpen(e))},title:c,description:m,side:y,align:b,width:C,color:S,size:k,showClose:!1,className:w,children:o("div",{className:a("mt-3 flex flex-wrap items-center justify-end gap-2"),children:[e(n,{variant:"ghost",color:"secondary",size:k,density:"compact",disabled:A,onClick:()=>{u?.(),setOpen(!1)},children:O}),e(n,{color:S,size:k,density:"compact",loading:A,loadingLabel:g,autoFocus:!0,onClick:async()=>{const e=f?.();if(e instanceof Promise){D(!0);try{await e,setOpen(!1)}catch{}finally{D(!1)}}else setOpen(!1)},children:N})]})})}
|
|
@@ -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
|
|
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 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{useDefaults as s}from"../../internal/defaults.js";import{Progress as r}from"@base-ui/react/progress";import{fillClasses as t,fillTransitionClasses as o,plateGapClasses as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{useDefaults as s}from"../../internal/defaults.js";import{Progress as r}from"@base-ui/react/progress";import{fillClasses as t,fillTransitionClasses as o,plateGapClasses as i,plateRadiusClasses as n,plateSizeClasses as m,progressAriaText as c,progressFraction as u,progressSlots as f,progressText as d,progressValue as p,trackClasses as x}from"../../internal/progress.js";import{cx as h,metaTextClasses as g,stackGapClasses as y}from"../../internal/styles.js";export const PlProgressBox=/* @__PURE__ */a.forwardRef(function PlProgressBox({size:a,color:j,count:w=4,value:N=null,min:b=0,max:v=100,label:M,showValue:P=!1,format:V,className:k,style:z,...A},B){const R=s(),T=a??R.size??"md",L=j??R.color??"primary",$=u(N,b,v),q=null===$,C=void 0!==V,D=Math.max(1,Math.floor(w));return l(r.Root,{ref:B,value:p(N,b,v),min:b,max:v,format:V,locale:R.locale,getAriaValueText:c($,C,R.locale),className:h("inline-flex flex-col",y[T],k),style:{...f(L),...z},...A,children:[M||P?l("div",{className:h("flex items-baseline gap-2",M?"justify-between":"justify-end",g[T]),children:[M?e(r.Label,{className:"min-w-0 truncate text-(--plass-fg)",children:M}):null,P?e(r.Value,{className:"shrink-0 tabular-nums text-(--plass-muted-fg)",children:e=>d($,e,C,R.locale)}):null]}):null,e(r.Track,{className:h("flex",i[T]),children:Array.from({length:D},(l,a)=>e("span",{className:h("relative overflow-hidden",x,m[T],n[T]),children:e("span",{"aria-hidden":"true",className:h("absolute inset-y-0 start-0",t,q?"plass-plate-wave w-full":o),style:q?{"--p-i":a}:{width:`${Math.min(100,Math.max(0,100*($*D-a)))}%`}})},a))})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as s}from"react/jsx-runtime";import*as e from"react";import{useDefaults as a}from"../../internal/defaults.js";import{Progress as
|
|
1
|
+
"use client";import{jsx as r,jsxs as s}from"react/jsx-runtime";import*as e from"react";import{useDefaults as a}from"../../internal/defaults.js";import{Progress as t}from"@base-ui/react/progress";import{progressAriaText as l,progressFraction as o,progressSlots as i,progressText as n,progressValue as c,ringDiameters as m,ringStrokes as f}from"../../internal/progress.js";import{cx as u,gapClasses as d,metaTextClasses as p}from"../../internal/styles.js";export const PlProgressCircular=/* @__PURE__ */e.forwardRef(function PlProgressCircular({size:h,color:x,value:k=null,min:g=0,max:v=100,label:y,showValue:$=!1,format:j,className:w,style:N,...P},b){const C=a(),V=h??C.size??"md",z=x??C.color??"primary",D=o(k,g,v),I=null===D,L=void 0!==j,R=`${e.useId()}-fill`,W=m[V],_=f[V],A=W/2,B=A-_/2,G=2*Math.PI*B,M=I?`${.28*G} ${G}`:`${G}`,T=I?0:G*(1-D);return s(t.Root,{ref:b,value:c(k,g,v),min:g,max:v,format:j,locale:C.locale,getAriaValueText:l(D,L,C.locale),className:u("inline-flex items-center",d[V],p[V],w),style:{...i(z),...N},...P,children:[s("svg",{className:u("shrink-0",I&&"plass-ring-spin"),width:W,height:W,viewBox:`0 0 ${W} ${W}`,fill:"none","aria-hidden":"true",children:[r("defs",{children:s("linearGradient",{id:R,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:A,cy:A,r:B,stroke:"var(--plass-track)",strokeWidth:_}),r("circle",{cx:A,cy:A,r:B,stroke:`url(#${R})`,strokeWidth:_,strokeLinecap:"round",strokeDasharray:M,strokeDashoffset:T,transform:`rotate(-90 ${A} ${A})`,className:"[transition:stroke-dashoffset_var(--plass-duration-slow)_var(--plass-ease)] motion-reduce:[transition-duration:0ms]"})]}),y?r(t.Label,{className:"min-w-0 truncate text-(--plass-fg)",children:y}):null,$?r(t.Value,{className:"shrink-0 tabular-nums text-(--plass-muted-fg)",children:r=>n(D,r,L,C.locale)}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as s from"react";import{useDefaults as r}from"../../internal/defaults.js";import{Progress as a}from"@base-ui/react/progress";import{barThicknessClasses as o,fillClasses as t,fillTransitionClasses as n,progressAriaText as i,progressFraction as m,progressSlots as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as s from"react";import{useDefaults as r}from"../../internal/defaults.js";import{Progress as a}from"@base-ui/react/progress";import{barThicknessClasses as o,fillClasses as t,fillTransitionClasses as n,progressAriaText as i,progressFraction as m,progressSlots as c,progressText as u,progressValue as f,trackClasses as d}from"../../internal/progress.js";import{cx as p,metaTextClasses as x,stackGapClasses as g}from"../../internal/styles.js";export const PlProgressLinear=/* @__PURE__ */s.forwardRef(function PlProgressLinear({size:s,color:h,value:j=null,min:w=0,max:b=100,label:N,showValue:v=!1,format:y,className:P,style:L,...V},k){const z=r(),R=s??z.size??"md",T=h??z.color??"primary",A=m(j,w,b),I=null===A,$=void 0!==y;return l(a.Root,{ref:k,value:f(j,w,b),min:w,max:b,format:y,locale:z.locale,getAriaValueText:i(A,$,z.locale),className:p("flex w-full flex-col",g[R],P),style:{...c(T),...L},...V,children:[N||v?l("div",{className:p("flex items-baseline gap-2",N?"justify-between":"justify-end",x[R]),children:[N?e(a.Label,{className:"min-w-0 truncate text-(--plass-fg)",children:N}):null,v?e(a.Value,{className:"shrink-0 tabular-nums text-(--plass-muted-fg)",children:e=>u(A,e,$,z.locale)}):null]}):null,e(a.Track,{className:p("relative w-full overflow-hidden rounded-full",d,o[R]),children:e(a.Indicator,{className:p("rounded-full",t,I?"plass-progress-sweep":`absolute top-0 ${n}`)})})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{useDisabled as l}from"../../internal/form.js";import{useDefaults as o}from"../../internal/defaults.js";import{Radio as s}from"@base-ui/react/radio";import{RadioGroup as t}from"@base-ui/react/radio-group";import{Field as i}from"@base-ui/react/field";import{controlSlots as n,cx as d,fieldDescriptionClasses as c,focusRingClasses as p,forcedCheckedClasses as m,forcedDisabledCheckedClasses as f,glassClasses as u,hasContent as h,metaTextClasses as b,tickDotClasses as x,tickRowTextClasses as g,tickSizeClasses as v,transitionClasses as y}from"../../internal/styles.js";const N=/* @__PURE__ */a.createContext({size:"md",color:"primary",readOnly:!1,disabled:!1}),j=/* @__PURE__ */["relative inline-flex shrink-0 items-center justify-center rounded-full border","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","plass-fill [--p-fill-edge:1px]",y,p].join(" "),k=/* @__PURE__ */[u,"cursor-pointer bg-(--plass-glass) [border-color:var(--plass-border)]","hover:bg-(--plass-glass-hover) hover:[border-color:var(--p-line)]","data-[checked]:[--p-fill-on:1] data-[checked]:text-(--p-on-solid)","data-[checked]:[border-color:transparent] data-[checked]:hover:brightness-105",m].join(" "),R=/* @__PURE__ */[u,"cursor-default bg-(--plass-glass) [border-color:var(--plass-border)]","saturate-[0.55]","data-[checked]:[--p-fill-on:1] data-[checked]:text-(--p-on-solid)","data-[checked]:[border-color:transparent]",m].join(" "),z=/* @__PURE__ */[u,"cursor-not-allowed bg-(--plass-glass) [border-color:var(--plass-border)]","opacity-50 saturate-[0.35]","data-[checked]:[--p-fill-on:1] data-[checked]:text-(--p-on-solid)","data-[checked]:[border-color:transparent]",f].join(" "),w=/* @__PURE__ */["rounded-full bg-current","[transition-property:width,height]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]","motion-reduce:[transition-duration:0ms]"].join(" ");export const PlRadio=/* @__PURE__ */a.forwardRef(function PlRadio({label:l,description:o,disabled:t=!1,className:n,style:d,...c},p){const m=a.useContext(N),f=c.readOnly??m.readOnly,u=t||m.disabled;return e(i.Root,{disabled:t,className:["flex flex-col",n??""].filter(Boolean).join(" "),style:d,children:r("div",{className:`flex items-start gap-2 ${g[m.size]}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(s.Root,{ref:p,className:[j,v[m.size],u?z:f?R:k].join(" "),disabled:t,...c,children:e(s.Indicator,{keepMounted:!0,className:`${w} ${x[m.size]}`})})}),l||o?r("span",{className:"flex min-w-0 flex-col gap-0.5",children:[l?e(i.Label,{className:u?"text-(--plass-muted-fg)":"cursor-pointer text-(--plass-fg)",children:l}):null,o?e(i.Description,{className:`m-0 ${b[m.size]} text-(--plass-muted-fg)`,children:o}):null]}):null]})})});export const PlRadioGroup=/* @__PURE__ */a.forwardRef(function PlRadioGroup({size:s,color:p,orientation:m="vertical",label:f,description:u,error:x,invalid:g,disabled:v=!1,readOnly:y=!1,className:j,classNames:k,style:R,children:z,...w},O){const P=o(),$=l(v),G=s??P.size??"md",B=p??P.color??"primary",C=h(x),D=g??C,L=D?"danger":B,M=a.useMemo(()=>({size:G,color:L,readOnly:y,disabled:$}),[G,L,y,$]);return e(N.Provider,{value:M,children:r(i.Root,{disabled:$,invalid:D,className:["flex flex-col gap-1.5",j??""].filter(Boolean).join(" "),style:{...n(L,0,"solid"),...R},children:[f?e(i.Label,{className:d(b[G],"font-semibold",$?"text-(--plass-muted-fg)":"text-(--plass-fg)",k?.label),children:f}):null,u?e(i.Description,{className:d(c(G),k?.description),children:u}):null,e(t,{ref:O,disabled:$,readOnly:y,className:d("flex","horizontal"===m?"flex-row flex-wrap gap-x-5 gap-y-2":"flex-col gap-2",k?.control),...w,children:z}),e(i.Error,C?{match:!0,className:d(b[G],"text-(--p-accent)",k?.error),children:x}:{className:d(b[G],"text-(--p-accent)",k?.error)})]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{useDisabled as t}from"../../internal/form.js";import{useDefaults as n}from"../../internal/defaults.js";import{useLabels as l}from"../../internal/labels.js";import{StarIcon as i,StarOutlineIcon as s}from"../../internal/icons.js";import{controlSlots as o,cx as m,focusWithinRingClasses as c,gapClasses as d,iconSizeClasses as u,radiusClasses as p,srOnlyClasses as h,transitionClasses as f}from"../../internal/styles.js";const y="flex items-center justify-center";export const PlRating=/* @__PURE__ */r.forwardRef(function PlRating({value:x,defaultValue:b=0,onValueChange:g,count:v=5,precision:N=1,icon:j,emptyIcon:M,clearable:w=!0,readOnly:P=!1,disabled:k=!1,name:L,required:q=!1,size:C,color:I,label:R,valueLabel:S,className:V,style:z,onPointerLeave:A,...E},F){const O=n(),B=t(k),D=l(),G=R??D.rating,H=S??((e,a)=>e<=0?D.ratingNone:D.ratingValue(e,a)),J=C??O.size??"md",K=I??O.color??"warning",Q=r.useId(),T=L??Q,[U,W]=r.useState(b),X=void 0!==x,Y=X?x:U,[Z,$]=r.useState(null),_=Math.max(1,Math.floor(v)),ee=N>0&&N<=1?N:1,ae=Math.round(1/ee),re=Math.max(0,Math.min(_,Z??Y)),change=e=>{X||W(e),g?.(e)},te=Array.from({length:_},(r,t)=>{const n=Math.max(0,Math.min(1,re-t));return a("span",{className:m("relative inline-flex shrink-0",u[J],p.xs,P||B?"":c),children:[e("span",{className:m(y,u[J],"text-(--p-empty)"),children:M??e(s,{})}),e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0 start-0 overflow-hidden",style:{width:100*n+"%"},children:e("span",{className:m(y,u[J],"text-(--p-accent)",f),children:j??e(i,{})})}),P?null:Array.from({length:ae},(a,r)=>{const n=Number((t+(r+1)*ee).toFixed(4));return e("label",{className:m("absolute inset-y-0",B?"cursor-not-allowed":"cursor-pointer"),style:{insetInlineStart:100*r/ae+"%",width:100/ae+"%"},onPointerEnter:()=>{B||$(n)},children:e("input",{type:"radio",className:h,name:T,value:n,checked:Y===n,disabled:B,required:q,"aria-label":H(n,_),onChange:()=>change(n),onClick:()=>{w&&Y===n&&change(0)}})},n)})]},t)}),ne=m("inline-flex items-center align-middle",d[J],B?"cursor-not-allowed opacity-50 saturate-[0.35]":"",V),le={...o(K,0,"solid"),"--p-empty":"color-mix(in oklab, var(--plass-muted-fg) 40%, transparent)",...z};return e("div",P?{ref:F,role:"img","aria-label":H(Math.max(0,Math.min(_,Y)),_),className:ne,style:le,onPointerLeave:A,...E,children:te}:{ref:F,role:"radiogroup","aria-label":G,"aria-disabled":B||void 0,"aria-required":q||void 0,className:ne,style:le,onPointerLeave:e=>{$(null),A?.(e)},...E,children:te})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as t,markTransitionClasses as l}from"../../internal/chart-frame.js";import{bubbleRadius as s,dimmedByHover as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as t,markTransitionClasses as l}from"../../internal/chart-frame.js";import{bubbleRadius as i,compactNumber as s,dimmedByHover as o,formatCategory as n,markerRadii as c,markGap as u,markPath as d,markShapes as m,plotHeights as h,pointX as x,seriesColor as f,toValues as p,writeChartValue as b}from"../../internal/chart.js";import{useDefaults as v}from"../../internal/defaults.js";import{cx as y,srOnlyClasses as k}from"../../internal/styles.js";import{textOf as z}from"../../internal/text.js";function writeX(e,r,a,t){return"number"!=typeof e?n(e,t):a?z(a(e,r)):s(e,t)}export function PlScatterChart({shape:r="auto",pointRadius:l,maxRadius:s,series:o,categories:n,size:u,xAxis:y,...k}){const z=v(),g=u??z.size??"md",j=k.locale??z.locale,M=k.format,w=l??c[g],F=a.useMemo(()=>p(o),[o]),S=a.useMemo(()=>o.map((e,r)=>f(e,r)),[o]),$=s??Math.max(w+2,("number"==typeof k.height?k.height:h[g])/12),N=o.reduce((e,r)=>r.color?e:e+1,0),C="auto"===r||"varied"===r?"circle":r,E="varied"===r||"auto"===r&&N>3,L=a.useCallback(e=>E?m[e%m.length]:C,[E,C]),A=a.useCallback(e=>{const r=[];let a=0;return e.values.forEach(e=>{e.forEach(e=>{null!==e.value&&void 0!==e.z&&Number.isFinite(e.z)&&(a=Math.max(a,e.z))})}),e.values.forEach((t,l)=>{e.visible[l]&&t.forEach((t,s)=>{if(null===t.value)return;const o=x(t,s,n);null!==o&&r.push({series:l,index:s,x:e.categoryValuePx(o),y:e.valuePx(t.value),r:void 0===t.z?w:i(t.z,a,$,2)})})}),r},[n,w,$]),O=a.useCallback(e=>{const r=F[e.series]?.[e.index];if(!r||null===r.value)return null;const a=[{seriesIndex:e.series,name:o[e.series]?.name,color:r.color??S[e.series],value:r.value,formatted:b(r.value,M,j),label:r.label,aside:void 0===r.z?void 0:b(r.z,M,j)}];return{heading:writeX(r.x??n?.[e.index]??e.index,e.index,y?.tickFormat,j),items:a}},[F,o,S,n,y?.tickFormat,M,j]);return e(t,{...k,series:o,categories:n,size:g,xScale:"value",xAxis:y,marks:A,markTooltip:O,markInset:$,includeZero:!1,swatch:(r,a)=>e("svg",{viewBox:"0 0 10 10",className:"size-2.5 overflow-visible","aria-hidden":"true",children:e("path",{d:d(L(r),5,5,4),fill:a})}),table:r=>e(ScatterTable,{id:r,series:o,categories:n,label:k.label,xLabel:y?.label,yLabel:k.yAxis?.label,xFormat:y?.tickFormat,locale:j,format:M}),children:r=>e(ScatterMarks,{context:r,shapeOf:L})})}function ScatterMarks({context:r,shapeOf:t}){const{marks:i,values:s,colors:n,visible:c,hovered:m,activeMark:h}=r,x=a.useMemo(()=>[...i].sort((e,r)=>r.r-e.r),[i]);return e("g",{children:x.map(r=>{const a=s[r.series]?.[r.index],i=o(m,r.series,c),x=h?.series===r.series&&h?.index===r.index;return e("path",{d:d(t(r.series),r.x,r.y,r.r),fill:a?.color??n[r.series],stroke:"var(--plass-chart-gap)",strokeWidth:u,opacity:i?.28:1,className:l,style:{transformBox:"view-box",transformOrigin:`${r.x}px ${r.y}px`,scale:x&&r.r>0?(r.r+1)/r.r:1}},`${r.series}-${r.index}`)})})}function ScatterTable({id:a,series:t,categories:l,label:i,xLabel:s,yLabel:o,xFormat:n,locale:c,format:u}){const d=t.some(e=>e.data.some(e=>"object"==typeof e&&null!==e&&void 0!==e.z));return r("table",{id:a,className:y(k),children:[i?e("caption",{children:i}):null,e("thead",{children:r("tr",{children:[e("th",{scope:"col"}),e("th",{scope:"col",children:s??"x"}),e("th",{scope:"col",children:o??"y"}),d?e("th",{scope:"col",children:"z"}):null]})}),e("tbody",{children:t.flatMap((a,t)=>a.data.map((i,s)=>{const o="object"==typeof i&&null!==i?i:null,m=o?o.y:"number"==typeof i?i:null,h=o?.x??l?.[s]??s;return r("tr",{children:[e("th",{scope:"row",children:a.name??t+1}),e("td",{children:writeX(h,s,n,c)}),e("td",{children:void 0!==o?.label?o.label:null!==m&&Number.isFinite(m)?b(m,u,c):""}),d?e("td",{children:void 0===o?.z?"":b(o.z,u,c)}):null]},`${t}-${s}`)}))})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as o}from"react/jsx-runtime";import*as t from"react";import{ScrollArea as r}from"@base-ui/react/scroll-area";import{useDefaults as l}from"../../internal/defaults.js";import{cx as
|
|
1
|
+
"use client";import{jsx as a,jsxs as o}from"react/jsx-runtime";import*as t from"react";import{ScrollArea as r}from"@base-ui/react/scroll-area";import{useDefaults as l}from"../../internal/defaults.js";import{cx as i,focusRingInsetClasses as e,radiusClasses as n,toLength as s}from"../../internal/styles.js";const c={xs:"w-2 data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-auto",sm:"w-2.5 data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:w-auto",md:"w-3 data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:w-auto",lg:"w-3.5 data-[orientation=horizontal]:h-3.5 data-[orientation=horizontal]:w-auto",xl:"w-4 data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-auto"},h="flex-1 rounded-full bg-(--plass-track) forced-colors:[background-color:CanvasText]";export const PlScrollArea=/* @__PURE__ */t.forwardRef(function PlScrollArea({orientation:t="vertical",height:d,maxHeight:m,width:u,maxWidth:w,scrollbars:f="auto",label:p,size:z,classNames:v,className:b,style:x,children:g,...y},N){const j=l(),S=z??j.size??"md",C="horizontal"!==t,T="vertical"!==t,k=i("flex touch-none select-none","p-[0.125rem]",c[S],"[transition:opacity_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","always"===f?"opacity-100":"opacity-0 data-[hovering]:opacity-100 data-[scrolling]:opacity-100",v?.scrollbar);return o(r.Root,{ref:N,className:i("plass-scroll-area relative overflow-hidden",n[S],b),style:{height:s(d),maxHeight:s(m),width:s(u),maxWidth:s(w),...x},...y,children:[a(r.Viewport,{role:p?"region":void 0,"aria-label":p,className:i("size-full overscroll-contain",n[S],e,v?.viewport),style:{overflowX:T?"scroll":"hidden",overflowY:C?"scroll":"hidden"},children:a(r.Content,{children:g})}),C?a(r.Scrollbar,{orientation:"vertical",className:k,children:a(r.Thumb,{className:i(h,v?.thumb)})}):null,T?a(r.Scrollbar,{orientation:"horizontal",className:k,children:a(r.Thumb,{className:i(h,v?.thumb)})}):null,C&&T?a(r.Corner,{}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as s from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as s from"react";import{useDisabled as a}from"../../internal/form.js";import{glowPointerMove as r}from"../../internal/glow.js";import{useDefaults as l}from"../../internal/defaults.js";import{Radio as o}from"@base-ui/react/radio";import{RadioGroup as n}from"@base-ui/react/radio-group";import{controlHeightClasses as i,controlSlots as d,controlTextClasses as c,focusRingInsetClasses as u,forcedCheckedTextClasses as p,forcedFieldEdgeClasses as f,forcedFillClasses as h,gapClasses as g,glassClasses as m,hasContent as v,iconClasses as y,paddingXClasses as b,transitionClasses as x}from"../../internal/styles.js";const w=/* @__PURE__ */s.createContext({variant:"glass",size:"md",density:"default",fullWidth:!1,disabled:!1,readOnly:!1}),k={solid:`${m} bg-(--plass-glass-press) p-1 [box-shadow:var(--p-elev),var(--plass-well)] ${f}`,glass:`${m} border bg-(--plass-glass) p-1 [border-color:var(--plass-glass-line)] [box-shadow:var(--p-elev),var(--plass-well)]`,ghost:""},j={solid:"plass-fill data-[placed]:[--p-fill-on:1] [box-shadow:var(--plass-shadow-1),var(--p-lift)]",glass:`${m} bg-(--plass-glass-press) [box-shadow:var(--plass-shadow-1),var(--plass-gloss-glass)]`,ghost:`${m} bg-(--plass-glass-press) [box-shadow:var(--plass-shadow-1),var(--plass-gloss-glass)]`},P={solid:"data-[checked]:text-(--p-on-solid)",glass:"data-[checked]:text-(--p-accent)",ghost:"data-[checked]:text-(--p-accent)"};export const PlSegment=/* @__PURE__ */s.forwardRef(function PlSegment({value:l,startIcon:n,endIcon:d,disabled:f=!1,className:h,children:m,onPointerMove:k,...j},R){const{variant:$,size:z,density:N,fullWidth:C,disabled:O,readOnly:S}=s.useContext(w),W=a(f),A=!W&&!O&&!S;return t(o.Root,{ref:R,value:l,disabled:W,"data-segment":"",className:["relative z-10 inline-flex shrink-0 cursor-pointer items-center justify-center select-none","font-semibold whitespace-nowrap","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",i[z],c[z],g[z],b[N][z],"rounded-full",x,y,A?"plass-glow":"","not-data-[checked]:[--p-glow:var(--p-soft)]","not-data-[checked]:[--p-flash:var(--p-soft-hover)]","text-(--plass-muted-fg) not-data-[checked]:not-data-[disabled]:not-data-[readonly]:hover:text-(--plass-fg)",P[$],p,u,"data-[disabled]:cursor-not-allowed",O?"":"data-[disabled]:opacity-50","data-[readonly]:cursor-default",C?"flex-1":"",h??""].filter(Boolean).join(" "),onPointerMove:r(A,k),...j,children:[v(n)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:n}):null,m,v(d)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:d}):null]})});export const PlSegmentedButton=/* @__PURE__ */s.forwardRef(function PlSegmentedButton({variant:r="glass",size:o,color:i,density:c,elevation:u=0,value:p,defaultValue:f=null,onValueChange:g,disabled:m=!1,readOnly:v=!1,name:y,fullWidth:b=!1,className:P,style:R,children:$,...z},N){const C=l(),O=a(m),S=o??C.size??"md",W=i??C.color??"primary",A=c??C.density??"default",[B,E]=s.useState(f),M=void 0!==p,V=M?p:B,I=s.useRef(null),L=s.useRef(null),q=s.useRef(!1);s.useEffect(()=>{q.current=!0},[]);const G=s.useCallback(e=>{L.current=e,e&&!q.current&&e.setAttribute("data-placed","")},[]),H=s.useCallback(e=>{const t=I.current,s=L.current;if(!t||!s)return;const a=t.querySelector("[data-segment][data-checked]");if(!a)return;const r=!e||!s.hasAttribute("data-ready");r&&s.removeAttribute("data-ready"),s.style.setProperty("--p-seg-x",`${a.offsetLeft}px`),s.style.setProperty("--p-seg-y",`${a.offsetTop}px`),s.style.setProperty("--p-seg-w",`${a.offsetWidth}px`),s.style.setProperty("--p-seg-h",`${a.offsetHeight}px`),r&&s.offsetWidth,s.setAttribute("data-ready",""),s.setAttribute("data-placed","")},[]);s.useLayoutEffect(()=>{H(!0)},[H,V,r,S,A,b,$]),s.useEffect(()=>{const e=I.current;if(!e)return;const t=new ResizeObserver(()=>H(!1));return t.observe(e),()=>t.disconnect()},[H]);const T=s.useMemo(()=>({variant:r,size:S,density:A,fullWidth:b,disabled:O,readOnly:v}),[r,S,A,b,O,v]);return e(w.Provider,{value:T,children:t(n,{ref:e=>{I.current=e,"function"==typeof N?N(e):N&&(N.current=e)},value:V,onValueChange:e=>{const t=e??null;M||E(t),g?.(t)},disabled:O,readOnly:v,name:y,className:["relative inline-flex items-center rounded-full",k[r],x,v?"saturate-[0.55]":"",O?"opacity-50 saturate-[0.35]":"",b?"flex w-full":"",P??""].filter(Boolean).join(" "),style:{...d(W,u,r),...R},...z,children:[null!=V?e("span",{ref:G,"aria-hidden":"true",className:["pointer-events-none absolute rounded-full","top-(--p-seg-y) left-(--p-seg-x) h-(--p-seg-h) w-(--p-seg-w)",j[r],h,"[transition-property:left,top,width,height]","[transition-timing-function:var(--plass-ease)]","[transition-duration:0ms] motion-safe:data-[ready]:[transition-duration:var(--plass-duration)]"].join(" ")}):null,$]})})});
|