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.
Files changed (165) hide show
  1. package/CHANGELOG.md +276 -0
  2. package/README.md +3 -1
  3. package/dist/components/accordion/PlAccordion.d.ts +13 -0
  4. package/dist/components/accordion/PlAccordion.js +1 -1
  5. package/dist/components/accordion/index.d.ts +1 -1
  6. package/dist/components/alert/PlAlert.js +1 -1
  7. package/dist/components/animate-headline/PlAnimateHeadline.d.ts +10 -1
  8. package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +8 -1
  9. package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
  10. package/dist/components/app-logo/PlAppLogo.js +1 -1
  11. package/dist/components/area-chart/PlAreaChart.d.ts +35 -6
  12. package/dist/components/area-chart/PlAreaChart.js +1 -1
  13. package/dist/components/aspect-ratio/PlAspectRatio.js +1 -1
  14. package/dist/components/avatar/PlAvatar.js +1 -1
  15. package/dist/components/back-top/PlBackTop.d.ts +5 -5
  16. package/dist/components/back-top/PlBackTop.js +1 -1
  17. package/dist/components/badge/PlBadge.js +1 -1
  18. package/dist/components/bar-chart/PlBarChart.d.ts +54 -2
  19. package/dist/components/bar-chart/PlBarChart.js +1 -1
  20. package/dist/components/blockquote/PlBlockquote.d.ts +2 -2
  21. package/dist/components/blockquote/PlBlockquote.js +1 -1
  22. package/dist/components/bottom-navigation/PlBottomNavigation.js +1 -1
  23. package/dist/components/button/PlButton.d.ts +7 -0
  24. package/dist/components/button/PlButton.js +1 -1
  25. package/dist/components/calendar/PlCalendar.js +1 -1
  26. package/dist/components/card/PlCard.d.ts +7 -4
  27. package/dist/components/carousel/PlCarousel.d.ts +14 -4
  28. package/dist/components/carousel/PlCarousel.js +1 -1
  29. package/dist/components/chat-bubble/PlChatBubble.js +1 -1
  30. package/dist/components/checkbox/PlCheckbox.js +1 -1
  31. package/dist/components/chip/PlChip.d.ts +2 -1
  32. package/dist/components/chip/PlChip.js +1 -1
  33. package/dist/components/collapsible/PlCollapsible.d.ts +11 -0
  34. package/dist/components/collapsible/PlCollapsible.js +1 -1
  35. package/dist/components/color-picker/PlColorPicker.d.ts +3 -1
  36. package/dist/components/color-picker/PlColorPicker.js +1 -1
  37. package/dist/components/combobox/PlCombobox.d.ts +11 -5
  38. package/dist/components/combobox/PlCombobox.js +1 -1
  39. package/dist/components/command-palette/PlCommandPalette.js +1 -1
  40. package/dist/components/confirm/PlConfirmProvider.js +1 -1
  41. package/dist/components/data-table/PlDataTable.d.ts +13 -2
  42. package/dist/components/data-table/PlDataTable.js +1 -1
  43. package/dist/components/drawer/PlDrawer.js +1 -1
  44. package/dist/components/fieldset/PlFieldset.js +1 -1
  45. package/dist/components/file-picker/PlFilePicker.d.ts +3 -1
  46. package/dist/components/file-picker/PlFilePicker.js +1 -1
  47. package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +5 -0
  48. package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -1
  49. package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +1 -1
  50. package/dist/components/footer/PlFooter.d.ts +3 -1
  51. package/dist/components/gallery/PlGallery.js +1 -1
  52. package/dist/components/gauge-chart/PlGaugeChart.js +1 -1
  53. package/dist/components/header/PlHeader.d.ts +4 -2
  54. package/dist/components/header/PlHeader.js +1 -1
  55. package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -1
  56. package/dist/components/hover-card/PlHoverCard.js +1 -1
  57. package/dist/components/how-to-steps/PlHowToSteps.js +1 -1
  58. package/dist/components/image/PlImage.js +1 -1
  59. package/dist/components/line-chart/PlLineChart.d.ts +32 -6
  60. package/dist/components/line-chart/PlLineChart.js +1 -1
  61. package/dist/components/menu/PlMenu.js +1 -1
  62. package/dist/components/mockup/PlMockup.d.ts +5 -0
  63. package/dist/components/mockup/PlMockup.js +1 -1
  64. package/dist/components/modal/PlModal.js +1 -1
  65. package/dist/components/navigation-menu/PlNavigationMenu.d.ts +4 -3
  66. package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
  67. package/dist/components/number-field/PlNumberField.d.ts +7 -5
  68. package/dist/components/number-field/PlNumberField.js +1 -1
  69. package/dist/components/otp-field/PlOtpField.js +1 -1
  70. package/dist/components/overlay/PlOverlay.js +1 -1
  71. package/dist/components/page-layout/PlPageLayout.d.ts +14 -3
  72. package/dist/components/page-layout/PlPageLayout.js +1 -1
  73. package/dist/components/pagination/PlPagination.js +1 -1
  74. package/dist/components/panes/PlPanes.js +1 -1
  75. package/dist/components/pie-chart/PlPieChart.d.ts +26 -1
  76. package/dist/components/pie-chart/PlPieChart.js +1 -1
  77. package/dist/components/pill/PlPill.js +1 -1
  78. package/dist/components/popconfirm/PlPopconfirm.d.ts +8 -1
  79. package/dist/components/popconfirm/PlPopconfirm.js +1 -1
  80. package/dist/components/popover/PlPopover.js +1 -1
  81. package/dist/components/progress-box/PlProgressBox.js +1 -1
  82. package/dist/components/progress-circular/PlProgressCircular.js +1 -1
  83. package/dist/components/progress-linear/PlProgressLinear.js +1 -1
  84. package/dist/components/radio-group/PlRadioGroup.js +1 -1
  85. package/dist/components/rating/PlRating.js +1 -1
  86. package/dist/components/scatter-chart/PlScatterChart.js +1 -1
  87. package/dist/components/scroll-area/PlScrollArea.js +1 -1
  88. package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
  89. package/dist/components/select/PlSelect.d.ts +4 -1
  90. package/dist/components/select/PlSelect.js +1 -1
  91. package/dist/components/sidebar/PlSidebar.js +1 -1
  92. package/dist/components/slider/PlSlider.js +1 -1
  93. package/dist/components/sparkline/PlSparkline.js +1 -1
  94. package/dist/components/stepper/PlStepper.js +1 -1
  95. package/dist/components/switch/PlSwitch.js +1 -1
  96. package/dist/components/table/PlTable.d.ts +11 -1
  97. package/dist/components/table/PlTable.js +1 -1
  98. package/dist/components/tabs/PlTabs.d.ts +18 -1
  99. package/dist/components/tabs/PlTabs.js +1 -1
  100. package/dist/components/text-field/PlTextField.d.ts +6 -8
  101. package/dist/components/text-field/PlTextField.js +1 -1
  102. package/dist/components/text-link/PlTextLink.js +1 -1
  103. package/dist/components/timeline-chart/PlTimelineChart.js +1 -1
  104. package/dist/components/toast/PlToast.js +1 -1
  105. package/dist/components/toggle/PlToggle.js +1 -1
  106. package/dist/components/tooltip/PlTooltip.d.ts +4 -0
  107. package/dist/components/tooltip/PlTooltip.js +1 -1
  108. package/dist/components/tour/PlTour.js +1 -1
  109. package/dist/components/transfer/PlTransfer.d.ts +5 -2
  110. package/dist/components/transfer/PlTransfer.js +1 -1
  111. package/dist/components/tree/PlTree.js +1 -1
  112. package/dist/components/window-pane/PlWindowPane.d.ts +13 -3
  113. package/dist/components/window-pane/PlWindowPane.js +1 -1
  114. package/dist/internal/animate.js +1 -1
  115. package/dist/internal/bottom-bar.d.ts +29 -0
  116. package/dist/internal/bottom-bar.js +1 -0
  117. package/dist/internal/calendar.js +1 -1
  118. package/dist/internal/chart-frame.d.ts +88 -10
  119. package/dist/internal/chart-frame.js +1 -1
  120. package/dist/internal/chart-line.d.ts +11 -6
  121. package/dist/internal/chart-line.js +1 -1
  122. package/dist/internal/chart.d.ts +149 -1
  123. package/dist/internal/chart.js +1 -1
  124. package/dist/internal/defaults.d.ts +2 -2
  125. package/dist/internal/focusable.d.ts +10 -0
  126. package/dist/internal/focusable.js +1 -1
  127. package/dist/internal/form.d.ts +29 -0
  128. package/dist/internal/form.js +1 -1
  129. package/dist/internal/glow.d.ts +32 -1
  130. package/dist/internal/glow.js +1 -1
  131. package/dist/internal/icons.d.ts +24 -0
  132. package/dist/internal/icons.js +1 -1
  133. package/dist/internal/labels.d.ts +22 -0
  134. package/dist/internal/labels.js +1 -1
  135. package/dist/internal/loading.d.ts +13 -0
  136. package/dist/internal/loading.js +1 -0
  137. package/dist/internal/mockup.js +1 -1
  138. package/dist/internal/notch.d.ts +57 -3
  139. package/dist/internal/notch.js +1 -1
  140. package/dist/internal/picker.d.ts +8 -2
  141. package/dist/internal/picker.js +1 -1
  142. package/dist/internal/progress.d.ts +17 -6
  143. package/dist/internal/progress.js +1 -1
  144. package/dist/internal/sizer.d.ts +12 -11
  145. package/dist/internal/sizer.js +1 -1
  146. package/dist/internal/steps.d.ts +0 -15
  147. package/dist/internal/steps.js +1 -1
  148. package/dist/internal/styles.d.ts +114 -8
  149. package/dist/internal/styles.js +1 -1
  150. package/dist/internal/table-scroll.d.ts +42 -0
  151. package/dist/internal/table-scroll.js +1 -0
  152. package/dist/internal/table.js +1 -1
  153. package/dist/internal/text.d.ts +8 -5
  154. package/dist/internal/window.js +1 -1
  155. package/dist/locales/de.js +1 -1
  156. package/dist/locales/es.js +1 -1
  157. package/dist/locales/fr.js +1 -1
  158. package/dist/locales/ja.js +1 -1
  159. package/dist/locales/ko.js +1 -1
  160. package/dist/locales/zh-Hans.js +1 -1
  161. package/dist/styles.css +1 -1
  162. package/dist/tailwind.css +406 -42
  163. package/dist/tokens.css +406 -42
  164. package/dist/types.d.ts +217 -13
  165. 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 t}from"../../internal/labels.js";import{NumberField as s}from"@base-ui/react/number-field";import{Field as n}from"@base-ui/react/field";import{MinusIcon as r,PlusIcon as i}from"../../internal/icons.js";import{hotKeyHandler as o}from"../../internal/keys.js";import{glowPointerMove as c}from"../../internal/glow.js";import{FieldNotch as d,notchShellStyle as m}from"../../internal/notch.js";import{controlHeightClasses as p,controlTextLeadingClasses as u,cx as f,disabledClasses as h,fieldReadOnlyClasses as b,fieldRestClasses as g,focusRingClasses as x,focusWithinRingClasses as v,gapClasses as y,hasContent as N,iconClasses as j,metaTextClasses as w,paddingXClasses as k,radiusClasses as S,stackGapClasses as _,surfaceSlots as V,transitionClasses as z}from"../../internal/styles.js";const O=/* @__PURE__ */["group relative flex w-full cursor-text items-center","[-webkit-tap-highlight-color:transparent]",z,"focus-within:[transition-duration:0ms]",j].join(" "),C=v,I=/* @__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)]","active:[transition-duration:0ms]","hover:bg-(--p-soft) hover:text-(--p-accent)","active:bg-(--p-soft-press)",x,"disabled:cursor-not-allowed disabled:bg-transparent disabled:opacity-40"].join(" ");export function PlNumberField({variant:x="glass",size:v,color:j,density:z,elevation:P=0,value:B,defaultValue:D,onValueChange:L,onValueCommitted:W,min:q,max:F,step:K,largeStep:R,smallStep:E,snapOnStep:G,allowWheelScrub:M=!1,format:$,locale:A,steppers:H="end",incrementLabel:J,decrementLabel:Q,label:T,labelPlacement:U,description:X,error:Y,invalid:Z,startIcon:ee,endIcon:le,fullWidth:ae=!1,disabled:te=!1,readOnly:se=!1,required:ne=!1,name:re,placeholder:ie,id:oe,className:ce,hotKeys:de,classNames:me,style:pe,...ue}){const fe=a(),he=t(),be=J??he.increase,ge=Q??he.decrease,xe=A??fe.locale,ve=v??fe.size??"md",ye=j??fe.color??"primary",Ne=z??fe.density??"default",je="notch"===(U??fe.labelPlacement??"top")&&N(T),we=N(Y),ke=Z??we,Se=ke?"danger":ye,_e=!te&&!se,Ve=k[Ne][ve],ze={end:`${Ve} pe-1`,split:"px-1",none:Ve},Oe=e(s.Decrement,{"aria-label":ge,className:I,children:e(r,{})}),Ce=e(s.Increment,{"aria-label":be,className:I,children:e(i,{})}),Ie="none"!==H&&!se,Pe=e(n.Label,{className:f(w[ve],"font-semibold",te?"text-(--plass-muted-fg)":"text-(--plass-fg)",me?.label),children:T});return l(n.Root,{disabled:te,invalid:ke,className:["flex-col align-top",_[ve],ae?"flex w-full":"inline-flex",ce??""].filter(Boolean).join(" "),style:{...V(Se,P),...pe},...ue,children:[N(T)&&!je?Pe:null,e(s.Root,{id:oe,name:re,className:"contents",value:B,defaultValue:D,onValueChange:e=>L?.(e),onValueCommitted:e=>W?.(e),min:q,max:F,step:K,largeStep:R,smallStep:E,snapOnStep:G,allowWheelScrub:M,format:$,locale:xe,disabled:te,readOnly:se,required:ne,children:e(d,{notched:je,size:ve,density:Ne,variant:x,disabled:te,readOnly:se,label:Pe,children:l(s.Group,{style:je?m:void 0,onPointerMove:c(_e),className:[O,je?"":C,p[ve],u[ve],S[ve],y[ve],Ie?ze[H]:Ve,te?h[x]:se?b[x]:g[x],_e?"plass-glow":"",me?.control].filter(Boolean).join(" "),children:[Ie&&"split"===H?Oe:null,ee?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:ee}):null,e(s.Input,{placeholder:ie,onKeyDown:o(de,void 0),className:["min-w-0 flex-1 self-stretch bg-transparent [font:inherit] text-inherit","[outline:none]","tabular-nums","split"===H&&Ie?"text-center":"","placeholder:text-(--plass-muted-fg)","caret-(--p-accent) selection:bg-(--p-soft-press)","disabled:cursor-not-allowed"].filter(Boolean).join(" ")}),le?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:le}):null,Ie&&"end"===H?l("span",{className:"flex shrink-0 items-center gap-0.5",children:[Oe,Ce]}):null,Ie&&"split"===H?Ce:null]})})}),X?e(n.Description,{className:f("m-0",w[ve],"text-(--plass-muted-fg)",me?.description),children:X}):null,e(n.Error,we?{match:!0,className:f(w[ve],"text-(--p-accent)",me?.error),children:Y}:{className:f(w[ve],"text-(--p-accent)",me?.error)})]})}
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{useDefaults as t}from"../../internal/defaults.js";import{useLabels as r}from"../../internal/labels.js";import{Field as n}from"@base-ui/react/field";import{OTPField as s}from"@base-ui/react/otp-field";import{hotKeyHandler as o}from"../../internal/keys.js";import{cx as i,disabledClasses as m,fieldReadOnlyClasses as d,fieldRestClasses as c,hasContent as u,metaTextClasses as p,stackGapClasses as f,surfaceSlots as h,transitionClasses as x}from"../../internal/styles.js";const g={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"},b={xs:"rounded-[0.3125rem]",sm:"rounded-[0.375rem]",md:"rounded-[0.4375rem]",lg:"rounded-[0.5625rem]",xl:"rounded-[0.6875rem]"},y={xs:"text-[0.8125rem]",sm:"text-[0.9375rem]",md:"text-[1.0625rem]",lg:"text-[1.25rem]",xl:"text-[1.5rem]"},v={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"}},N={numeric:"numeric",alpha:"alpha",alphanumeric:"alphanumeric",any:"none"};export const PlOtpField=/* @__PURE__ */l.forwardRef(function PlOtpField({variant:$="glass",size:j,color:w,density:V,elevation:F=0,length:C=6,charset:I="numeric",mask:M=!1,groupSize:O,separator:S="–",value:k,defaultValue:z,onValueChange:R,onComplete:q,onValueInvalid:A,autoSubmit:D=!1,label:K,description:L,error:P,invalid:_,name:E,required:T=!1,disabled:B=!1,readOnly:G=!1,autoFocus:H=!1,slotLabel:J,className:Q,hotKeys:U,classNames:W,style:X,...Y},Z){const ee=t(),ae=r(),le=J??ae.otpSlot,te=l.useId(),re=j??ee.size??"md",ne=w??ee.color??"primary",se=V??ee.density??"default",oe=Math.min(12,Math.max(2,Math.round(C))),ie=u(P),me=_??ie,de=me?"danger":ne,ce=i("text-center font-medium [font-family:inherit]",g[re],y[re],b[re],x,"caret-(--p-accent) selection:bg-(--p-soft-press)","focus:[outline:2px_solid_var(--p-ring)] focus:[outline-offset:0px]","focus:[transition-duration:0ms]",B?m[$]:G?d[$]:c[$]),ue=O&&O>0?Math.round(O):0;return a(n.Root,{disabled:B,invalid:me,className:i("inline-flex flex-col align-top",f[re],Q),style:{...h(de,F),...X},children:[u(K)?e(n.Label,{className:i(p[re],"font-semibold",B?"text-(--plass-muted-fg)":"text-(--plass-fg)",W?.label),children:e("span",{id:`${te}-label`,children:K})}):null,e(s.Root,{ref:Z,onKeyDown:o(U,void 0),length:oe,validationType:N[I],mask:M,name:E,required:T,disabled:B,readOnly:G,autoSubmit:D,value:k,defaultValue:z,onValueChange:e=>R?.(e),onValueComplete:e=>q?.(e),onValueInvalid:e=>A?.(e),className:i("flex items-center",v[se][re],W?.control),...Y,children:Array.from({length:oe},(t,r)=>a(l.Fragment,{children:[ue>0&&r>0&&r%ue===0?e("span",{"aria-hidden":"true",className:i("select-none px-0.5 text-(--plass-muted-fg)",y[re]),children:S}):null,e(s.Input,{className:ce,autoFocus:H&&0===r,"aria-labelledby":u(K)?`${te}-label ${te}-${r}`:`${te}-${r}`})]},r))}),Array.from({length:oe},(a,l)=>e("span",{id:`${te}-${l}`,hidden:!0,children:le(l+1,oe)},l)),u(L)?e(n.Description,{className:i("m-0",p[re],"text-(--plass-muted-fg)",W?.description),children:L}):null,e(n.Error,ie?{match:!0,className:i(p[re],"text-(--p-accent)",W?.error),children:P}:{className:i(p[re],"text-(--p-accent)",W?.error)})]})});
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:b="scrim",dismissible:u=!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:!u,onOpenChange:(e,a)=>{u||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[b],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})})]})})}
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
- /** Anything else the `<main>` needs — a `className`, an `aria-label`. */
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 a,cx as i,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:$="main",mainProps:R,color:z,className:L,style:E,children:M,...B},H){const _=t(),I=n(),T=N??I.skipToContent,q=z??_.color??"primary",[A,D]=o.useState(P),[F,G]=o.useState(C),J=o.useMemo(()=>({start:w??A,end:S??F}),[w,A,S,F]),K=o.useCallback((e,l)=>{if("start"===e)return void 0===w&&D(l),void k?.(l);void 0===S&&G(l),O?.(l)},[w,S,k,O]),Q=o.useRef(null),U=o.useCallback(e=>{Q.current=e,"function"==typeof H?H(e):H&&(H.current=e)},[H]),V=o.useRef({header:null,footer:null}),W=o.useRef(null),X=o.useCallback(()=>{const e=Q.current;if(e)for(const l of d){const o=V.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="sticky"===n||"fixed"===n;e.style.setProperty(`--p-layout-${l}`,s&&"full"===t?r:"0px"),e.style.setProperty(`--p-layout-${l}-inset`,"fixed"===n?r:"0px")}},[v,x]),Y=o.useCallback(()=>{const e=W.current;if(e){e.disconnect();for(const l of d){const o=V.current[l];o&&e.observe(o)}}X()},[X]);o.useEffect(()=>(W.current=new ResizeObserver(()=>X()),Y(),()=>{W.current?.disconnect(),W.current=null}),[X,Y]);const Z=o.useCallback((e,l)=>{V.current[e]=l,Y()},[Y]),ee=o.useMemo(()=>({present:!0,register:Z,collapseBelow:g,open:J,setOpen:K,scroll:y}),[Z,g,J,K,y]),le=o.useMemo(()=>({...ee,register:()=>{}}),[ee]),oe="content"===y,te=c("viewport"===b||"auto"===b?void 0:b),ne=void 0!==te?"":"auto"===b?oe?"h-full":"min-h-full":oe?"h-dvh":"min-h-dvh",re=u(f)?f:null,se=u(p)?p:null;return e(r.Provider,{value:ee,children:l("div",{ref:U,className:i("relative flex w-full flex-col",oe?"overflow-hidden":"",ne,"full"===v?"[padding-top:var(--p-layout-header-inset,0px)]":"","full"===x?"[padding-bottom:var(--p-layout-footer-inset,0px)]":"",L),style:void 0===te?E:{...oe?{height:te}:{minHeight:te},...E},...B,children:[j?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(q,2,"solid"),children:T}):null,"full"===v?re:null,l("div",{className:i("flex w-full flex-1",oe?"min-h-0":""),children:[u(m)?e(s.Provider,{value:"start",children:m}):null,l("div",{className:i("flex min-w-0 flex-1 flex-col",oe?"min-h-0":"","content"===v?"[padding-top:var(--p-layout-header-inset,0px)]":"","content"===x?"[padding-bottom:var(--p-layout-footer-inset,0px)]":""),children:["content"===v?re:null,e("main",{...R,id:$,className:i("min-w-0 flex-1",oe?"min-h-0 overflow-y-auto":"",R?.className),children:e(r.Provider,{value:le,children:M})}),"content"===x?se:null]}),u(h)?e(s.Provider,{value:"end",children:h}):null]}),"full"===x?se:null]})})});
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 t from"react";import{useDefaults as n}from"../../internal/defaults.js";import{useLabels as r}from"../../internal/labels.js";import{PlButton as i}from"../button/PlButton.js";import{ChevronIcon as l}from"../../internal/icons.js";import{controlTextClasses as o,gapClasses as s,srOnlyClasses as c}from"../../internal/styles.js";function range(e,a){return Array.from({length:Math.max(0,a-e+1)},(a,t)=>e+t)}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 m={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"};export const PlPagination=/* @__PURE__ */t.forwardRef(function PlPagination({variant:u="ghost",size:d,color:h,density:f,elevation:p=0,count:g,page:b,defaultPage:x=1,onPageChange:v,siblingCount:y=1,boundaryCount:M=1,showEdges:j=!1,showArrows:w=!0,disabled:L=!1,getPageHref:N,renderLink:P,label:C,pageLabel:k,previousLabel:D,nextLabel:I,firstLabel:z,lastLabel:K,statusLabel:B,className:$,children:A,...R},S){const W=n(),E=r(),F=C??E.pagination,H=D??E.paginationPrevious,q=I??E.paginationNext,G=z??E.paginationFirst,J=K??E.paginationLast,O=k??E.paginationPage,Q=B??E.paginationStatus,T=d??W.size??"md",U=h??W.color??"primary",V=f??W.density??"compact",[X,Y]=t.useState(x),Z=Math.min(Math.max(b??X,1),Math.max(g,1));if(g<2)return null;const _=function paginationRange(e,a,t,n){const r=range(1,Math.min(n,e)),i=range(Math.max(e-n+1,n+1),e),l=Math.max(Math.min(a-t,e-n-2*t-1),n+2),o=Math.min(Math.max(a+t,n+2*t+2),i.length>0?i[0]-2:e-1);return[...r,...l>n+2?["start-ellipsis"]:n+1<e-n?[n+1]:[],...range(l,o),...o<e-n-1?["end-ellipsis"]:e-n>n?[e-n]:[],...i]}(g,Z,y,M),ee=Z<=1,ae=Z>=g,linkProps=(a,t,n)=>{if(!N||L)return null;if(t)return{render:e("a",{role:"link"}),"aria-disabled":!0,tabIndex:0};const r=N(a);return{render:P?P(a,r):e("a",{href:r}),rel:n}},press=(e,a)=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||N&&!v||(e.preventDefault(),(e=>{const a=Math.min(Math.max(e,1),g);a!==Z&&(void 0===b&&Y(a),v?.(a))})(a))},stepper=(a,t,n,r,l,o,s)=>e("li",{className:"flex",children:e(i,{variant:u,size:T,color:U,density:V,elevation:p,disabled:L||r,focusableWhenDisabled:!L,"aria-label":t,startIcon:e("span",{className:`flex items-center ${l}`,children:o}),onClick:e=>press(e,n),...linkProps(n,r,s)})},a);return a("nav",{ref:S,"aria-label":F,className:["flex items-center",$??""].filter(Boolean).join(" "),...R,children:[a("ul",{role:"list",className:`m-0 flex list-none items-center p-0 ${s[T]}`,children:[j?stepper("first",G,1,ee,"rotate-180 rtl:rotate-0",e(DoubleChevronIcon,{})):null,w?stepper("previous",H,Z-1,ee,"rotate-90 rtl:-rotate-90",e(l,{}),"prev"):null,_.map((a,t)=>e("li","number"==typeof a?{className:"flex",children:e(i,{variant:a===Z?"solid":u,size:T,color:U,density:V,elevation:p,disabled:L,"aria-label":O(a),"aria-current":a===Z?"page":void 0,className:"tabular-nums",onClick:e=>press(e,a),...linkProps(a,!1),children:a})}:{"aria-hidden":"true",className:["flex select-none items-center justify-center","text-(--plass-muted-fg)",o[T],m[T]].join(" "),children:"…"},`slot-${t}`)),w?stepper("next",q,Z+1,ae,"-rotate-90 rtl:rotate-90",e(l,{}),"next"):null,j?stepper("last",J,g,ae,"rtl:rotate-180",e(DoubleChevronIcon,{})):null]}),e("span",{className:c,"aria-live":"polite",children:Q(Z,g)}),A]})});
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:m=!0,color:f,size:p,onResize:g,onResizeEnd:h,label:x,className:v,style:b,children:z,...w},y){const P=a(d,"horizontal"),S=n(),R=f??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(!m||!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)),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",m?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":!m||void 0,tabIndex:m?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);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",m?"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:m,id:f}=r.useContext(l);return e("div",{ref:d,id:f,className:o("relative min-h-0 min-w-0 overflow-auto",s),style:{flex:m?`0 0 ${m}`:"1 1 0%",...a},...u,children:c})});
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 a from"react";import{ChartDataTable as t,ChartLegendBar as n,ChartStatus as i,ChartSurface as r,ChartTooltipPanel as s,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 f,formatCategory as p,markGap as x,plotHeights as b,seriesColor as g,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 w,metaTextClasses as I,srOnlyClasses as P}from"../../internal/styles.js";const z={pie:0,donut:.62,semi:.62};export function PlPieChart({data:k,categories:A,shape:S="pie",startAngle:$=0,center:L,valueLabels:B="none",height:E,format:R,locale:C,label:D,legend:O,tooltip:_,empty:F,size:K,variant:V="ghost",padded:W=!1,className:q,...G}){const H=M(),J=K??H.size??"md",Q=C??H.locale,T=a.useRef(null),U=d(T),X=j(),Y=a.useId(),Z=a.useId(),ee=a.useCallback(e=>R?N(Q,R).format(e):v(e,Q),[R,Q]),le=a.useMemo(()=>k.map(y),[k]),ae=a.useMemo(()=>le.map((e,l)=>({name:p(c(l,A,[le]),Q),data:[k[l]],color:e.color})),[le,A,k,Q]),te=u(ae),[ne,ie]=a.useState(null),re=ae.map((e,l)=>g(e,l)),se=le.reduce((e,l,a)=>te.visible[a]&&null!==l.value?e+Math.abs(l.value):e,0),oe="semi"===S,de="number"==typeof E?E:b[J],ue=h[J],me=!1===O?{interactive:!1}:!0===O||void 0===O?{}:O,ce=!1!==O&&ae.length>1,he=me.side??"bottom",ve=!1===_?{mode:"none"}:!0===_||void 0===_?{}:_,fe="none"===ve.mode,pe=U/2,xe=Math.max(0,Math.min(U/2,oe?de:de/2)-2),be=oe?Math.min(de,de/2+xe/2):de/2,ge=xe*z[S],ye=se<=0,Me=xe>0?Math.min(4,x/xe*(180/Math.PI)):0,Ne=oe?180:360,je=[];let we=oe?-90:$;le.forEach((e,l)=>{if(!te.visible[l]||null===e.value||0===e.value)return;const a=Math.abs(e.value)/se,t=a*Ne;je.push({index:l,start:we,end:we+t,value:e.value,share:a}),we+=t});const share=e=>`${ee(e)} · ${Math.round(10*(Math.abs(e)/se*100+Number.EPSILON))/10}%`,Ie=null===ne?[]:[{seriesIndex:ne,name:ae[ne]?.name,color:le[ne]?.color??re[ne],value:le[ne]?.value??null,formatted:share(le[ne]?.value??0),label:le[ne]?.label}];return l(r,{...G,size:J,variant:V,padded:W,className:q,legendSide:he,legend:ce?e(n,{series:ae,colors:re,options:me,visibility:te,size:J,values:me.showValue?le.map(e=>null===e.value?void 0:ee(e.value)):void 0}):null,table:ye?null:e(t,{id:Y,caption:D,categories:ae.map(e=>e.name??""),series:[{name:D,data:k}],values:[le],format:ee,locale:Q}),children:[l("div",{ref:T,role:"img",tabIndex:ye?void 0:0,"aria-label":D??X.chart,"aria-describedby":ye?void 0:Z,onPointerLeave:()=>ie(null),onBlur:()=>ie(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;const l=je.map(e=>e.index);if(0===l.length)return;const a=null===ne?-1:l.indexOf(ne),t="ArrowRight"===e.key?a+1:a-1;ie(l[(t+l.length)%l.length]),e.preventDefault()},className:w("relative w-full rounded-(--plass-radius-xs)","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-2"),style:{height:de},children:[ye?e("div",{className:w("flex h-full items-center justify-center text-(--plass-muted-fg)",I[J]),children:F??X.empty}):U>0&&xe>0?l("svg",{width:U,height:de,viewBox:`0 0 ${U} ${de}`,"aria-hidden":"true",className:"block",children:[je.map(l=>{const a=f(te.hovered,l.index,te.visible)||null!==ne&&ne!==l.index,t=l.end-l.start>2*Me?Me/2:0;return e("path",{d:m(pe,be,xe,ge,l.start+t,l.end-t),fill:le[l.index].color??re[l.index],opacity:a?.32:1,onPointerEnter:fe?void 0:()=>ie(l.index),className:o},l.index)}),"all"===B?je.map(l=>{const a=((l.start+l.end)/2-90)*(Math.PI/180),t=ge>0?(ge+xe)/2:.68*xe,n=`${Math.round(100*l.share)}%`;return(l.end-l.start)*(Math.PI/180)*t<2*ue||xe-ge<1.6*ue?null:e("text",{x:pe+t*Math.cos(a),y:be+t*Math.sin(a),textAnchor:"middle",dominantBaseline:"central",fontSize:ue,fontWeight:600,fill:"var(--plass-surface)",className:"tabular-nums",children:n},l.index)}):null]}):null,L&&ge>0?e("div",{className:"pointer-events-none absolute flex flex-col items-center justify-center text-center",style:{insetInlineStart:pe-ge,top:be-ge,width:2*ge,height:oe?ge:2*ge},children:L}):null,null===ne||fe?null:ve.render?e("div",{className:"pointer-events-none absolute top-0 start-1/2 z-10",children:ve.render({index:ne,category:ae[ne]?.name??ne,items:Ie})}):e(s,{heading:ae[ne]?.name,items:Ie,x:pe,y:8,flip:!1,size:J})]}),ye?null:e("span",{id:Z,className:P,children:je.map((e,t)=>l(a.Fragment,{children:[t>0?", ":null,ae[e.index]?.name," ",le[e.index]?.label??share(e.value)]},e.index))}),fe?null:e(i,{heading:null===ne?void 0:ae[ne]?.name,items:Ie})]})}
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 r}from"../../internal/glow.js";import{useDefaults as o}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 x,iconClasses as u,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:S,style:q,children:A,onClick:D,onPointerMove:G,...J},K){const L=o(),Q=f??L.size??"md",T=_??L.color??"secondary",U=R??L.density??"default",V=l.useRef(null),W=l.useId(),[X,Y]=l.useState(0),Z=x(O);l.useEffect(()=>{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(D),se=g[U][Q],te=s(t,{children:[x(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,x(H)||x(M)||x(A)?s("span",{className:c("flex min-w-0 flex-1 flex-col items-center justify-center text-center",z[U][Q]),children:[x(H)?e("span",{className:"max-w-full truncate",children:H}):null,x(M)?e("span",{className:c("max-w-full truncate font-normal",v[Q],"[color:color-mix(in_oklab,currentColor_72%,transparent)]"),children:M}):null,A]}):null]});return s("div",{ref:K,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,u,ee?`plass-glow ${j[m]}`:"",P[E][F],S),style:{...i(T,C,m),...q},onPointerMove:r(ee,G),...J,children:[s("div",{className:c("flex shrink-0 items-center py-1",N[Q],p[Q],ee?"ps-0":se,x($)?"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:D,children:te}):te,x($)?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: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","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 t from"react";import{PlButton as i}from"../button/PlButton.js";import{PlPopover as n}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:p,cancelLabel:d,onConfirm:f,onCancel:u,color:g,size:h,side:j="top",align:y="center",width:C=280,open:x,defaultOpen:P,onOpenChange:b,className:v}){const w=r(),z=s(),N=p??z.confirm,O=d??z.cancel,k=h??w.size??"md",L=g??"danger",[S,B]=t.useState(P??!1),F=x??S,[q,A]=t.useState(!1),setOpen=e=>{void 0===x&&B(e),b?.(e)};return e(n,{trigger:l,open:F,onOpenChange:e=>{q||(e||u?.(),setOpen(e))},title:c,description:m,side:j,align:y,width:C,color:L,size:k,showClose:!1,className:v,children:o("div",{className:a("mt-3 flex flex-wrap items-center justify-end gap-2"),children:[e(i,{variant:"ghost",color:"secondary",size:k,density:"compact",disabled:q,onClick:()=>{u?.(),setOpen(!1)},children:O}),e(i,{color:L,size:k,density:"compact",loading:q,autoFocus:!0,onClick:async()=>{const e=f?.();if(e instanceof Promise){A(!0);try{await e,setOpen(!1)}catch{}finally{A(!1)}}else setOpen(!1)},children:N})]})})}
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 p,hasContent as d,metaTextClasses as c,radiusClasses as m,sheetBodyClasses as f,sheetHeaderGapClasses as u,sheetPaddingXClasses as g,sheetPaddingYClasses as x,sheetSectionGapClasses as h,sheetTitleClasses as v,surfaceSlots as b}from"../../internal/styles.js";const y={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-lg"},w=/* @__PURE__ */[p,"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)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),j={xs:8,sm:9,md:10,lg:11,xl:12},N=/* @__PURE__ */["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)]","hover:bg-(--p-soft) hover:text-(--plass-fg)",t].join(" ");export const PlPopoverClose=o.Close;export function PlPopover({size:t,color:p,density:O,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=p??K.color??"primary",V=O??K.density??"default",X=g[V][S],Y=x[V][S],Z=j[S],ss=d(_)||d(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(w,m[S],f[S],h[S],X,Y,void 0===G?y[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",u[S]),children:[d(_)?s(o.Title,{className:n("m-0 font-semibold",v[S]),children:_}):null,d(z)?s(o.Description,{className:n("m-0 text-(--plass-muted-fg)",c[S]),children:z}):null]}),E?s(o.Close,{"aria-label":Q,className:N,children:s(r,{})}):null]}):null,d(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","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 n,plateRadiusClasses as i,plateSizeClasses as m,progressAriaText as c,progressFraction as u,progressSlots as f,progressText as d,trackClasses as p}from"../../internal/progress.js";import{cx as x,metaTextClasses as h,stackGapClasses as g}from"../../internal/styles.js";export const PlProgressBox=/* @__PURE__ */a.forwardRef(function PlProgressBox({size:a,color:y,count:j=4,value:w=null,min:N=0,max:b=100,label:v,showValue:M=!1,format:P,className:V,style:k,...z},A){const B=s(),R=a??B.size??"md",T=y??B.color??"primary",L=u(w,N,b),$=null===L,q=void 0!==P,C=Math.max(1,Math.floor(j));return l(r.Root,{ref:A,value:w??null,min:N,max:b,format:P,locale:B.locale,getAriaValueText:c(L,q,B.locale),className:x("inline-flex flex-col",g[R],V),style:{...f(T),...k},...z,children:[v||M?l("div",{className:x("flex items-baseline gap-2",v?"justify-between":"justify-end",h[R]),children:[v?e(r.Label,{className:"min-w-0 truncate text-(--plass-fg)",children:v}):null,M?e(r.Value,{className:"shrink-0 tabular-nums text-(--plass-muted-fg)",children:e=>d(L,e,q,B.locale)}):null]}):null,e(r.Track,{className:x("flex",n[R]),children:Array.from({length:C},(l,a)=>e("span",{className:x("relative overflow-hidden",p,m[R],i[R]),children:e("span",{"aria-hidden":"true",className:x("absolute inset-y-0 start-0",t,$?"plass-plate-wave w-full":o),style:$?{"--p-i":a}:{width:`${Math.min(100,Math.max(0,100*(L*C-a)))}%`}})},a))})]})});
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 l}from"@base-ui/react/progress";import{progressAriaText as t,progressFraction as o,progressSlots as i,progressText as n,ringDiameters as c,ringStrokes as m}from"../../internal/progress.js";import{cx as f,gapClasses as u,metaTextClasses as d}from"../../internal/styles.js";export const PlProgressCircular=/* @__PURE__ */e.forwardRef(function PlProgressCircular({size:p,color:h,value:x=null,min:k=0,max:g=100,label:v,showValue:y=!1,format:$,className:j,style:w,...N},P){const b=a(),C=p??b.size??"md",V=h??b.color??"primary",z=o(x,k,g),D=null===z,I=void 0!==$,L=`${e.useId()}-fill`,R=c[C],W=m[C],_=R/2,A=_-W/2,B=2*Math.PI*A,G=D?`${.28*B} ${B}`:`${B}`,M=D?0:B*(1-z);return s(l.Root,{ref:P,value:x??null,min:k,max:g,format:$,locale:b.locale,getAriaValueText:t(z,I,b.locale),className:f("inline-flex items-center",u[C],d[C],j),style:{...i(V),...w},...N,children:[s("svg",{className:f("shrink-0",D&&"plass-ring-spin"),width:R,height:R,viewBox:`0 0 ${R} ${R}`,fill:"none","aria-hidden":"true",children:[r("defs",{children:s("linearGradient",{id:L,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:_,cy:_,r:A,stroke:"var(--plass-track)",strokeWidth:W}),r("circle",{cx:_,cy:_,r:A,stroke:`url(#${L})`,strokeWidth:W,strokeLinecap:"round",strokeDasharray:G,strokeDashoffset:M,transform:`rotate(-90 ${_} ${_})`,className:"[transition:stroke-dashoffset_var(--plass-duration-slow)_var(--plass-ease)]"})]}),v?r(l.Label,{className:"min-w-0 truncate text-(--plass-fg)",children:v}):null,y?r(l.Value,{className:"shrink-0 tabular-nums text-(--plass-muted-fg)",children:r=>n(z,r,I,b.locale)}):null]})});
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 u,progressText as c,trackClasses as f}from"../../internal/progress.js";import{cx as d,metaTextClasses as p,stackGapClasses as x}from"../../internal/styles.js";export const PlProgressLinear=/* @__PURE__ */s.forwardRef(function PlProgressLinear({size:s,color:g,value:h=null,min:j=0,max:w=100,label:b,showValue:N=!1,format:v,className:y,style:P,...L},V){const k=r(),z=s??k.size??"md",R=g??k.color??"primary",T=m(h,j,w),A=null===T,I=void 0!==v;return l(a.Root,{ref:V,value:h??null,min:j,max:w,format:v,locale:k.locale,getAriaValueText:i(T,I,k.locale),className:d("flex w-full flex-col",x[z],y),style:{...u(R),...P},...L,children:[b||N?l("div",{className:d("flex items-baseline gap-2",b?"justify-between":"justify-end",p[z]),children:[b?e(a.Label,{className:"min-w-0 truncate text-(--plass-fg)",children:b}):null,N?e(a.Value,{className:"shrink-0 tabular-nums text-(--plass-muted-fg)",children:e=>c(T,e,I,k.locale)}):null]}):null,e(a.Track,{className:d("relative w-full overflow-hidden rounded-full",f,o[z]),children:e(a.Indicator,{className:d("rounded-full",t,A?"plass-progress-sweep":`absolute top-0 ${n}`)})})]})});
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 a}from"react/jsx-runtime";import*as r from"react";import{useDefaults as l}from"../../internal/defaults.js";import{Radio as o}from"@base-ui/react/radio";import{RadioGroup as s}from"@base-ui/react/radio-group";import{Field as t}from"@base-ui/react/field";import{controlSlots as i,cx as n,focusRingClasses as d,forcedCheckedClasses as c,forcedDisabledCheckedClasses as p,glassClasses as m,hasContent as u,metaTextClasses as f,tickDotClasses as h,tickRowTextClasses as b,tickSizeClasses as g,transitionClasses as x}from"../../internal/styles.js";const v=/* @__PURE__ */r.createContext({size:"md",color:"primary",readOnly:!1,disabled:!1}),k=/* @__PURE__ */["relative inline-flex shrink-0 items-center justify-center rounded-full border","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",x,d].join(" "),y=/* @__PURE__ */[m,"cursor-pointer bg-(--plass-glass) [border-color:var(--plass-border)]","hover:bg-(--plass-glass-hover) hover:[border-color:var(--p-line)]","data-[checked]:[background-image:var(--p-fill)] data-[checked]:text-(--p-on-solid)","data-[checked]:[border-color:transparent] data-[checked]:hover:brightness-105",c].join(" "),N=/* @__PURE__ */[m,"cursor-default bg-(--plass-glass) [border-color:var(--plass-border)]","saturate-[0.55]","data-[checked]:[background-image:var(--p-fill)] data-[checked]:text-(--p-on-solid)","data-[checked]:[border-color:transparent]",c].join(" "),j=/* @__PURE__ */[m,"cursor-not-allowed bg-(--plass-glass) [border-color:var(--plass-border)]","opacity-50 saturate-[0.35]","data-[checked]:[background-image:var(--p-fill)] data-[checked]:text-(--p-on-solid)","data-[checked]:[border-color:transparent]",p].join(" "),R=/* @__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__ */r.forwardRef(function PlRadio({label:l,description:s,disabled:i=!1,className:n,style:d,...c},p){const m=r.useContext(v),u=c.readOnly??m.readOnly,x=i||m.disabled;return e(t.Root,{disabled:i,className:["flex flex-col",n??""].filter(Boolean).join(" "),style:d,children:a("div",{className:`flex items-start gap-2 ${b[m.size]}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(o.Root,{ref:p,className:[k,g[m.size],x?j:u?N:y].join(" "),disabled:i,...c,children:e(o.Indicator,{keepMounted:!0,className:`${R} ${h[m.size]}`})})}),l||s?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[l?e(t.Label,{className:x?"text-(--plass-muted-fg)":"cursor-pointer text-(--plass-fg)",children:l}):null,s?e(t.Description,{className:`m-0 ${f[m.size]} text-(--plass-muted-fg)`,children:s}):null]}):null]})})});export const PlRadioGroup=/* @__PURE__ */r.forwardRef(function PlRadioGroup({size:o,color:d,orientation:c="vertical",label:p,description:m,error:h,invalid:b,disabled:g=!1,readOnly:x=!1,className:k,classNames:y,style:N,children:j,...R},z){const w=l(),O=o??w.size??"md",P=d??w.color??"primary",$=u(h),G=b??$,B=G?"danger":P,C=r.useMemo(()=>({size:O,color:B,readOnly:x,disabled:g}),[O,B,x,g]);return e(v.Provider,{value:C,children:a(t.Root,{disabled:g,invalid:G,className:["flex flex-col gap-1.5",k??""].filter(Boolean).join(" "),style:{...i(B,0,"solid"),...N},children:[p?e(t.Label,{className:n(f[O],"font-semibold",g?"text-(--plass-muted-fg)":"text-(--plass-fg)",y?.label),children:p}):null,m?e(t.Description,{className:n("m-0",f[O],"text-(--plass-muted-fg)",y?.description),children:m}):null,e(s,{ref:z,disabled:g,readOnly:x,className:n("flex","horizontal"===c?"flex-row flex-wrap gap-x-5 gap-y-2":"flex-col gap-2",y?.control),...R,children:j}),e(t.Error,$?{match:!0,className:n(f[O],"text-(--p-accent)",y?.error),children:h}:{className:n(f[O],"text-(--p-accent)",y?.error)})]})})});
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{useDefaults as t}from"../../internal/defaults.js";import{useLabels as n}from"../../internal/labels.js";import{StarIcon as l,StarOutlineIcon as i}from"../../internal/icons.js";import{controlSlots as s,cx as o,focusWithinRingClasses as c,gapClasses as m,iconSizeClasses as d,radiusClasses as u,srOnlyClasses as h,transitionClasses as p}from"../../internal/styles.js";const f="flex items-center justify-center";export const PlRating=/* @__PURE__ */r.forwardRef(function PlRating({value:y,defaultValue:x=0,onValueChange:b,count:g=5,precision:v=1,icon:N,emptyIcon:M,clearable:j=!0,readOnly:w=!1,disabled:P=!1,name:k,required:L=!1,size:q,color:C,label:I,valueLabel:R,className:S,style:V,onPointerLeave:z,...A},E){const F=t(),O=n(),B=I??O.rating,D=R??((e,a)=>e<=0?O.ratingNone:O.ratingValue(e,a)),G=q??F.size??"md",H=C??F.color??"warning",J=r.useId(),K=k??J,[Q,T]=r.useState(x),U=void 0!==y,W=U?y:Q,[X,Y]=r.useState(null),Z=Math.max(1,Math.floor(g)),$=v>0&&v<=1?v:1,_=Math.round(1/$),ee=Math.max(0,Math.min(Z,X??W)),change=e=>{U||T(e),b?.(e)},ae=Array.from({length:Z},(r,t)=>{const n=Math.max(0,Math.min(1,ee-t));return a("span",{className:o("relative inline-flex shrink-0",d[G],u.xs,w||P?"":c),children:[e("span",{className:o(f,d[G],"text-(--p-empty)"),children:M??e(i,{})}),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:o(f,d[G],"text-(--p-accent)",p),children:N??e(l,{})})}),w?null:Array.from({length:_},(a,r)=>{const n=Number((t+(r+1)*$).toFixed(4));return e("label",{className:o("absolute inset-y-0",P?"cursor-not-allowed":"cursor-pointer"),style:{insetInlineStart:100*r/_+"%",width:100/_+"%"},onPointerEnter:()=>{P||Y(n)},children:e("input",{type:"radio",className:h,name:K,value:n,checked:W===n,disabled:P,required:L,"aria-label":D(n,Z),onChange:()=>change(n),onClick:()=>{j&&W===n&&change(0)}})},n)})]},t)}),re=o("inline-flex items-center align-middle",m[G],P?"cursor-not-allowed opacity-50 saturate-[0.35]":"",S),te={...s(H,0,"solid"),"--p-empty":"color-mix(in oklab, var(--plass-muted-fg) 40%, transparent)",...V};return e("div",w?{ref:E,role:"img","aria-label":D(Math.max(0,Math.min(Z,W)),Z),className:re,style:te,onPointerLeave:z,...A,children:ae}:{ref:E,role:"radiogroup","aria-label":B,"aria-disabled":P||void 0,"aria-required":L||void 0,className:re,style:te,onPointerLeave:e=>{Y(null),z?.(e)},...A,children:ae})});
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 i,formatCategory as o,markerRadii as c,markGap as n,markPath as u,markShapes as d,plotHeights as h,pointX as m}from"../../internal/chart.js";import{useDefaults as x}from"../../internal/defaults.js";import{cx as f,srOnlyClasses as p}from"../../internal/styles.js";export function PlScatterChart({shape:r="auto",pointRadius:l,maxRadius:i,series:o,categories:n,size:f,xAxis:p,...b}){const v=x(),y=f??v.size??"md",g=l??c[y],z=i??Math.max(g+2,("number"==typeof b.height?b.height:h[y])/12),k=o.reduce((e,r)=>r.color?e:e+1,0),j="auto"===r||"varied"===r?"circle":r,M="varied"===r||"auto"===r&&k>3,w=a.useCallback(e=>M?d[e%d.length]:j,[M,j]),N=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,i)=>{if(null===t.value)return;const o=m(t,i,n);null!==o&&r.push({series:l,index:i,x:e.categoryValuePx(o),y:e.valuePx(t.value),r:void 0===t.z?g:s(t.z,a,z,2)})})}),r},[n,g,z]);return e(t,{...b,series:o,categories:n,size:y,xScale:"value",xAxis:p,marks:N,markInset:z,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:u(w(r),5,5,4),fill:a})}),table:r=>e(ScatterTable,{id:r,series:o,categories:n,label:b.label,xLabel:p?.label,yLabel:b.yAxis?.label,locale:b.locale??v.locale,format:b.format}),children:r=>e(ScatterMarks,{context:r,shapeOf:w})})}function ScatterMarks({context:r,shapeOf:t}){const{marks:s,values:o,colors:c,visible:d,hovered:h,activeMark:m}=r,x=a.useMemo(()=>[...s].sort((e,r)=>r.r-e.r),[s]);return e("g",{children:x.map(r=>{const a=o[r.series]?.[r.index],s=i(h,r.series,d),x=m?.series===r.series&&m?.index===r.index;return e("path",{d:u(t(r.series),r.x,r.y,r.r),fill:a?.color??c[r.series],stroke:"var(--plass-chart-gap)",strokeWidth:n,opacity:s?.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:t,series:l,categories:s,label:i,xLabel:c,yLabel:n,locale:u,format:d}){const h=a.useMemo(()=>new Intl.NumberFormat(u,d??{maximumFractionDigits:2}),[u,d]),m=l.some(e=>e.data.some(e=>"object"==typeof e&&null!==e&&void 0!==e.z));return r("table",{id:t,className:f(p),children:[i?e("caption",{children:i}):null,e("thead",{children:r("tr",{children:[e("th",{scope:"col"}),e("th",{scope:"col",children:c??"x"}),e("th",{scope:"col",children:n??"y"}),m?e("th",{scope:"col",children:"z"}):null]})}),e("tbody",{children:l.flatMap((a,t)=>a.data.map((l,i)=>{const c="object"==typeof l&&null!==l?l:null,n=c?c.y:"number"==typeof l?l:null,d=c?.x??s?.[i]??i;return r("tr",{children:[e("th",{scope:"row",children:a.name??t+1}),e("td",{children:o(d,u)}),e("td",{children:null!==n&&Number.isFinite(n)?h.format(n):""}),m?e("td",{children:void 0===c?.z?"":h.format(c.z)}):null]},`${t}-${i}`)}))})]})}
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 e,focusRingInsetClasses as i,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=e("flex touch-none select-none","p-[0.125rem]",c[S],"[transition:opacity_var(--plass-duration)_var(--plass-ease)]","always"===f?"opacity-100":"opacity-0 data-[hovering]:opacity-100 data-[scrolling]:opacity-100",v?.scrollbar);return o(r.Root,{ref:N,className:e("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:e("size-full overscroll-contain",n[S],i,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:e(h,v?.thumb)})}):null,T?a(r.Scrollbar,{orientation:"horizontal",className:k,children:a(r.Thumb,{className:e(h,v?.thumb)})}):null,C&&T?a(r.Corner,{}):null]})});
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{glowPointerMove as a}from"../../internal/glow.js";import{useDefaults as r}from"../../internal/defaults.js";import{Radio as l}from"@base-ui/react/radio";import{RadioGroup as o}from"@base-ui/react/radio-group";import{controlHeightClasses as n,controlSlots as i,controlTextClasses as d,focusRingInsetClasses as c,forcedCheckedTextClasses as u,forcedFieldEdgeClasses as p,forcedFillClasses as f,gapClasses as h,glassClasses as g,hasContent as m,iconClasses as v,paddingXClasses as y,transitionClasses as b}from"../../internal/styles.js";const x=/* @__PURE__ */s.createContext({variant:"glass",size:"md",density:"default",fullWidth:!1}),w={solid:`${g} bg-(--plass-glass-press) p-1 [box-shadow:var(--p-elev),var(--plass-well)] ${p}`,glass:`${g} border bg-(--plass-glass) p-1 [border-color:var(--plass-glass-line)] [box-shadow:var(--p-elev),var(--plass-well)]`,ghost:""},k={solid:"[background-image:var(--p-fill)] [box-shadow:var(--plass-shadow-1),var(--p-lift)]",glass:`${g} bg-(--plass-glass-press) [box-shadow:var(--plass-shadow-1),var(--plass-gloss-glass)]`,ghost:`${g} 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:r,startIcon:o,endIcon:i,disabled:p=!1,className:f,children:g,onPointerMove:w,...k},j){const{variant:$,size:R,density:z,fullWidth:N}=s.useContext(x);return t(l.Root,{ref:j,value:r,disabled:p,"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]",n[R],d[R],h[R],y[z][R],"rounded-full",b,v,p?"":"plass-glow","not-data-[checked]:[--p-glow:var(--p-soft)]","not-data-[checked]:[--p-flash:var(--p-soft-hover)]","text-(--plass-muted-fg) hover:text-(--plass-fg)",P[$],u,c,"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50","data-[readonly]:cursor-default",N?"flex-1":"",f??""].filter(Boolean).join(" "),onPointerMove:a(!p,w),...k,children:[m(o)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:o}):null,g,m(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:i}):null]})});export const PlSegmentedButton=/* @__PURE__ */s.forwardRef(function PlSegmentedButton({variant:a="glass",size:l,color:n,density:d,elevation:c=0,value:u,defaultValue:p=null,onValueChange:h,disabled:g=!1,readOnly:m=!1,name:v,fullWidth:y=!1,className:P,style:j,children:$,...R},z){const N=r(),S=l??N.size??"md",W=n??N.color??"primary",C=d??N.density??"default",[B,A]=s.useState(p),M=void 0!==u,O=M?u:B,V=s.useRef(null),E=s.useRef(null),I=s.useCallback(e=>{const t=V.current,s=E.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.useLayoutEffect(()=>{I(!0)},[I,O,a,S,C,y,$]),s.useEffect(()=>{const e=V.current;if(!e)return;const t=new ResizeObserver(()=>I(!1));return t.observe(e),()=>t.disconnect()},[I]);const L=s.useMemo(()=>({variant:a,size:S,density:C,fullWidth:y}),[a,S,C,y]);return e(x.Provider,{value:L,children:t(o,{ref:e=>{V.current=e,"function"==typeof z?z(e):z&&(z.current=e)},value:O,onValueChange:e=>{const t=e??null;M||A(t),h?.(t)},disabled:g,readOnly:m,name:v,className:["relative inline-flex items-center rounded-full",w[a],b,m?"saturate-[0.55]":"",g?"opacity-50 saturate-[0.35]":"",y?"flex w-full":"",P??""].filter(Boolean).join(" "),style:{...i(W,c,a),...j},...R,children:[null!=O?e("span",{ref:E,"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)",k[a],f,"[transition-property:left,top,width,height]","[transition-timing-function:var(--plass-ease)]","[transition-duration:0ms] data-[ready]:[transition-duration:var(--plass-duration)]"].join(" ")}):null,$]})})});
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,$]})})});