neba 1.17.1 → 1.18.1

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 (156) hide show
  1. package/dist/a2ui/adapter-catalog.json +1 -1
  2. package/dist/a2ui/catalog.json +2 -2
  3. package/dist/a2ui/index.d.ts +2 -0
  4. package/dist/a2ui/schema.d.ts +11 -1
  5. package/dist/a2ui/schema.js +1 -1
  6. package/dist/components/alert/Alert.js +1 -1
  7. package/dist/components/animate-counter/AnimateCounter.d.ts +6 -0
  8. package/dist/components/animate-counter/AnimateCounter.js +1 -1
  9. package/dist/components/animate-headline/AnimateHeadline.js +1 -1
  10. package/dist/components/animate-scramble/AnimateScramble.d.ts +9 -3
  11. package/dist/components/animate-scramble/AnimateScramble.js +1 -1
  12. package/dist/components/animate-split/AnimateSplit.d.ts +7 -1
  13. package/dist/components/animate-split/AnimateSplit.js +1 -1
  14. package/dist/components/animate-typing/AnimateTyping.d.ts +6 -0
  15. package/dist/components/animate-typing/AnimateTyping.js +1 -1
  16. package/dist/components/app-logo/AppLogo.js +1 -1
  17. package/dist/components/approval/Approval.js +1 -1
  18. package/dist/components/breadcrumb/Breadcrumb.d.ts +16 -0
  19. package/dist/components/breadcrumb/Breadcrumb.js +1 -1
  20. package/dist/components/calendar/Calendar.js +1 -1
  21. package/dist/components/card/Card.js +1 -1
  22. package/dist/components/carousel/Carousel.d.ts +3 -2
  23. package/dist/components/carousel/Carousel.js +1 -1
  24. package/dist/components/chat-bubble/ChatBubble.d.ts +6 -0
  25. package/dist/components/chat-bubble/ChatBubble.js +1 -1
  26. package/dist/components/checkbox/Checkbox.js +1 -1
  27. package/dist/components/checkbox-group/CheckboxGroup.d.ts +84 -0
  28. package/dist/components/checkbox-group/CheckboxGroup.js +1 -0
  29. package/dist/components/checkbox-group/index.d.ts +2 -0
  30. package/dist/components/checkbox-group/index.js +1 -0
  31. package/dist/components/code-block/CodeBlock.d.ts +2 -2
  32. package/dist/components/code-block/CodeBlock.js +1 -1
  33. package/dist/components/code-block/index.d.ts +2 -1
  34. package/dist/components/code-block/index.js +1 -1
  35. package/dist/components/color-picker/ColorPicker.js +1 -1
  36. package/dist/components/combobox/Combobox.js +1 -1
  37. package/dist/components/context-window/ContextWindow.js +1 -1
  38. package/dist/components/data-table/DataTable.d.ts +13 -1
  39. package/dist/components/data-table/DataTable.js +1 -1
  40. package/dist/components/date-picker/DatePicker.js +1 -1
  41. package/dist/components/date-range-picker/DateRangePicker.js +1 -1
  42. package/dist/components/date-time-picker/DateTimePicker.js +1 -1
  43. package/dist/components/drawer/Drawer.d.ts +21 -0
  44. package/dist/components/drawer/Drawer.js +1 -1
  45. package/dist/components/empty/Empty.js +1 -1
  46. package/dist/components/fieldset/Fieldset.d.ts +12 -1
  47. package/dist/components/fieldset/Fieldset.js +1 -1
  48. package/dist/components/file-picker/FilePicker.d.ts +0 -8
  49. package/dist/components/file-picker/FilePicker.js +1 -1
  50. package/dist/components/file-picker/formatFileSize.d.ts +8 -0
  51. package/dist/components/file-picker/formatFileSize.js +1 -0
  52. package/dist/components/file-picker/index.d.ts +2 -1
  53. package/dist/components/file-picker/index.js +1 -1
  54. package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -1
  55. package/dist/components/form/Form.d.ts +8 -2
  56. package/dist/components/form/Form.js +1 -1
  57. package/dist/components/gallery/Gallery.d.ts +45 -3
  58. package/dist/components/gallery/Gallery.js +1 -1
  59. package/dist/components/gallery/GalleryViewer.js +1 -1
  60. package/dist/components/gauge-chart/GaugeChart.js +1 -1
  61. package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
  62. package/dist/components/how-to-steps/HowToSteps.d.ts +14 -0
  63. package/dist/components/how-to-steps/HowToSteps.js +1 -1
  64. package/dist/components/image/Image.d.ts +31 -6
  65. package/dist/components/image/Image.js +1 -1
  66. package/dist/components/list/List.d.ts +9 -0
  67. package/dist/components/list/List.js +1 -1
  68. package/dist/components/menu/Menu.d.ts +17 -0
  69. package/dist/components/menu/Menu.js +1 -1
  70. package/dist/components/meter/Meter.js +1 -1
  71. package/dist/components/mockup/Mockup.js +1 -1
  72. package/dist/components/number-field/NumberField.js +1 -1
  73. package/dist/components/page-layout/PageLayout.js +1 -1
  74. package/dist/components/panes/Panes.js +1 -1
  75. package/dist/components/pie-chart/PieChart.js +1 -1
  76. package/dist/components/pill/Pill.js +1 -1
  77. package/dist/components/progress-box/ProgressBox.js +1 -1
  78. package/dist/components/progress-circular/ProgressCircular.js +1 -1
  79. package/dist/components/progress-linear/ProgressLinear.js +1 -1
  80. package/dist/components/prompt-input/PromptInput.js +1 -1
  81. package/dist/components/provider/NebaProvider.d.ts +3 -22
  82. package/dist/components/provider/NebaProvider.js +1 -1
  83. package/dist/components/provider/colorSchemeScript.d.ts +23 -0
  84. package/dist/components/provider/colorSchemeScript.js +1 -0
  85. package/dist/components/provider/index.d.ts +2 -1
  86. package/dist/components/provider/index.js +1 -1
  87. package/dist/components/radio-group/RadioGroup.d.ts +13 -0
  88. package/dist/components/radio-group/RadioGroup.js +1 -1
  89. package/dist/components/reasoning/Reasoning.d.ts +21 -0
  90. package/dist/components/reasoning/Reasoning.js +1 -1
  91. package/dist/components/scatter-chart/ScatterChart.js +1 -1
  92. package/dist/components/scroll-zone/ScrollZone.js +1 -1
  93. package/dist/components/segmented-button/SegmentedButton.js +1 -1
  94. package/dist/components/select/Select.js +1 -1
  95. package/dist/components/sidebar/Sidebar.d.ts +13 -0
  96. package/dist/components/sidebar/Sidebar.js +1 -1
  97. package/dist/components/slider/Slider.js +1 -1
  98. package/dist/components/sources/Sources.d.ts +11 -0
  99. package/dist/components/sources/Sources.js +1 -1
  100. package/dist/components/spoiler/Spoiler.js +1 -1
  101. package/dist/components/statistic/Statistic.js +1 -1
  102. package/dist/components/streaming-text/StreamingText.d.ts +22 -11
  103. package/dist/components/streaming-text/StreamingText.js +1 -1
  104. package/dist/components/tabs/Tabs.d.ts +12 -1
  105. package/dist/components/tabs/Tabs.js +1 -1
  106. package/dist/components/text-link/TextLink.d.ts +7 -0
  107. package/dist/components/text-link/TextLink.js +1 -1
  108. package/dist/components/time-picker/TimePicker.js +1 -1
  109. package/dist/components/timeline-chart/TimelineChart.js +1 -1
  110. package/dist/components/toast/Toast.js +1 -1
  111. package/dist/components/tool-call/ToolCall.d.ts +11 -0
  112. package/dist/components/tool-call/ToolCall.js +1 -1
  113. package/dist/components/tour/Tour.js +1 -1
  114. package/dist/components/tree-view/TreeView.d.ts +13 -1
  115. package/dist/components/tree-view/TreeView.js +1 -1
  116. package/dist/components/typography/Typography.d.ts +7 -0
  117. package/dist/components/typography/Typography.js +1 -1
  118. package/dist/components/window-pane/WindowPane.js +1 -1
  119. package/dist/hooks/useElementSize.js +1 -1
  120. package/dist/index.d.ts +1 -0
  121. package/dist/index.js +1 -1
  122. package/dist/internal/animate.js +1 -1
  123. package/dist/internal/calendar.d.ts +2 -2
  124. package/dist/internal/calendar.js +1 -1
  125. package/dist/internal/chart-frame.d.ts +59 -2
  126. package/dist/internal/chart-frame.js +1 -1
  127. package/dist/internal/chart-line.js +1 -1
  128. package/dist/internal/checkbox-group.d.ts +29 -0
  129. package/dist/internal/checkbox-group.js +1 -0
  130. package/dist/internal/defaults.d.ts +14 -2
  131. package/dist/internal/format.d.ts +7 -0
  132. package/dist/internal/format.js +1 -1
  133. package/dist/internal/highlight.d.ts +9 -0
  134. package/dist/internal/highlight.js +1 -1
  135. package/dist/internal/layout-effect.d.ts +17 -0
  136. package/dist/internal/layout-effect.js +1 -0
  137. package/dist/internal/media.d.ts +20 -0
  138. package/dist/internal/media.js +1 -1
  139. package/dist/internal/menu.d.ts +5 -0
  140. package/dist/internal/observe.d.ts +4 -1
  141. package/dist/internal/observe.js +1 -1
  142. package/dist/internal/overrides.d.ts +55 -0
  143. package/dist/internal/overrides.js +1 -0
  144. package/dist/internal/page-layout.d.ts +26 -1
  145. package/dist/internal/page-layout.js +1 -1
  146. package/dist/internal/run.d.ts +6 -1
  147. package/dist/internal/run.js +1 -1
  148. package/dist/internal/sizer.d.ts +10 -0
  149. package/dist/internal/sizer.js +1 -1
  150. package/dist/internal/styles.d.ts +41 -3
  151. package/dist/internal/styles.js +1 -1
  152. package/dist/internal/text.d.ts +25 -3
  153. package/dist/internal/text.js +1 -1
  154. package/dist/styles.css +1 -1
  155. package/dist/tailwind.css +94 -73
  156. package/package.json +3 -3
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import*as l from"react";import{glowClasses as a,spotlightSlot as s,trackPointer as o}from"../../internal/glow.js";import{Menu as r}from"@base-ui/react/menu";import{useDirection as i}from"@base-ui/react/direction-provider";import{ContextMenu as c}from"@base-ui/react/context-menu";import{MenuContext as d}from"../../internal/menu.js";import{CheckIcon as u,ChevronIcon as m,DotIcon as p}from"../../internal/icons.js";import{safeHref as h,safeRel as f}from"../../internal/link.js";import{NewTabNote as x}from"../../internal/new-tab.js";import{controlTextLeadingClasses as b,cx as g,gapClasses as y,hasContent as N,iconClasses as v,metaTextClasses as C,popupFadeClasses as k,radiusClasses as z,surfaceClasses as O,surfaceSlots as M,transitionClasses as w}from"../../internal/styles.js";import{useStyleDefaults as I}from"../../internal/defaults.js";const P=[O,"max-h-[min(24rem,var(--available-height))] min-w-40 overflow-y-auto overscroll-contain","border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",k].join(" "),j={default:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-2",xl:"px-3.5 py-2.5"},compact:{xs:"px-1 py-0.5",sm:"px-1.5 py-0.5",md:"px-2 py-1",lg:"px-2.5 py-1",xl:"px-3 py-1.5"}},R={xs:z.xs,sm:z.xs,md:z.sm,lg:z.sm,xl:z.md};function $(e,n,t,l,s){return g("relative flex w-full cursor-pointer items-center select-none",l?a:"",t?"text-(--n-on-tint)":"text-(--neba-fg)",j[n][e],R[e],y[e],b[e],w,v,"data-[highlighted]:bg-(--n-soft-hover)","data-[popup-open]:bg-(--n-soft)","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]",s??"")}const B="flex h-[1lh] w-[1.2em] shrink-0 items-center justify-center";function RowBody({children:t,description:l,size:a}){return N(l)?n("span",{className:"flex min-w-0 flex-1 flex-col text-start",children:[e("span",{className:"truncate",children:t}),e("span",{className:`truncate text-(--neba-muted-fg) ${C[a]}`,children:l})]}):e("span",{className:"min-w-0 flex-1 truncate text-start",children:t})}export function MenuItem({onClick:a,href:i,target:c,rel:u,startIcon:m,endIcon:p,shortcut:b,description:g,color:y,closeOnClick:v=!0,disabled:k=!1,label:z,children:O,className:w,style:I}){const P=l.useContext(d),{size:j,density:R}=P,F=n(t,{children:[N(m)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:m}):null,e(RowBody,{description:g,size:j,children:O}),N(p)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:p}):null,N(b)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${C[j]}`,children:b}):null]}),G={...y?M(y,0):void 0,...s,...I},S=h(i);return void 0===S||k?e(r.Item,{disabled:k,label:z,closeOnClick:v,onClick:a,className:$(j,R,Boolean(y),!k,w),style:G,onPointerMove:o(void 0,!k),children:F}):n(r.LinkItem,{href:S,target:c,rel:f(c,u),label:z,closeOnClick:v,onClick:a,className:$(j,R,Boolean(y),!k,w),style:G,onPointerMove:o(void 0,!0),children:[F,e(x,{target:c})]})}export function MenuCheckboxItem({checked:t,defaultChecked:a,onCheckedChange:i,endIcon:c,shortcut:m,description:p,color:h,closeOnClick:f=!1,disabled:x=!1,label:b,children:g,className:y,style:v}){const{size:k,density:z}=l.useContext(d),O=h?M(h,0):void 0;return n(r.CheckboxItem,{checked:t,defaultChecked:a,onCheckedChange:e=>i?.(e),disabled:x,label:b,closeOnClick:f,className:$(k,z,Boolean(h),!x,y),style:{...O,...s,...v},onPointerMove:o(void 0,!x),children:[e("span",{className:`${B} text-(--n-accent)`,children:e(r.CheckboxItemIndicator,{className:"flex items-center justify-center",children:e(u,{})})}),e(RowBody,{description:p,size:k,children:g}),N(c)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:c}):null,N(m)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${C[k]}`,children:m}):null]})}export function MenuRadioGroup({value:n,defaultValue:t,onValueChange:l,disabled:a=!1,children:s,className:o}){return e(r.RadioGroup,{value:n,defaultValue:t,onValueChange:e=>l?.(e),disabled:a,className:o,children:s})}export function MenuRadioItem({value:t,endIcon:a,shortcut:i,description:c,color:u,closeOnClick:m=!1,disabled:h=!1,label:f,children:x,className:b,style:g}){const{size:y,density:v}=l.useContext(d),k=u?M(u,0):void 0;return n(r.RadioItem,{value:t,disabled:h,label:f,closeOnClick:m,className:$(y,v,Boolean(u),!h,b),style:{...k,...s,...g},onPointerMove:o(void 0,!h),children:[e("span",{className:`${B} text-(--n-accent)`,children:e(r.RadioItemIndicator,{className:"flex items-center justify-center",children:e(p,{})})}),e(RowBody,{description:c,size:y,children:x}),N(a)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:a}):null,N(i)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${C[y]}`,children:i}):null]})}export function MenuGroup({label:t,children:a,className:s}){const{size:o,density:i}=l.useContext(d);return n(r.Group,{className:s,children:[N(t)?e(r.GroupLabel,{className:[j[i][o],C[o],"font-semibold tracking-wide text-(--neba-muted-fg) uppercase"].join(" "),children:t}):null,a]})}export function MenuSeparator({className:n,...t}){return e(r.Separator,{className:g("-mx-1 my-1 h-px bg-(--n-line)",n??""),...t})}export function MenuSubmenu({label:t,startIcon:a,disabled:c=!1,side:u,sideOffset:p=4,children:h,className:f,style:x}){const y=l.useContext(d),{size:v,density:C,color:k}=y,O=i();return n(r.SubmenuRoot,{children:[n(r.SubmenuTrigger,{disabled:c,className:$(v,C,!1,!c),style:s,onPointerMove:o(void 0,!c),children:[N(a)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:a}):null,e("span",{className:"min-w-0 flex-1 truncate text-start",children:t}),e("span",{className:`${B} text-(--neba-muted-fg) ${"rtl"===O?"rotate-90":"-rotate-90"}`,children:e(m,{})})]}),e(r.Portal,{children:e(r.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",side:u??"inline-end",sideOffset:p,align:"start",children:e(r.Popup,{className:g(P,z[v],b[v],f??""),style:{...M(k,3),...x},children:h})})})]})}export function Menu(t){const{size:a="md",color:s="primary",density:o="default",trigger:i,open:c,defaultOpen:u,onOpenChange:m,side:p="bottom",align:h="start",sideOffset:f=6,modal:x,openOnHover:y=!1,loopFocus:N=!0,disabled:v=!1,className:C,style:k,children:O}=I(t,["size","density"]),w=l.useMemo(()=>({size:a,color:s,density:o}),[a,s,o]);return e(d.Provider,{value:w,children:n(r.Root,{open:c,defaultOpen:u,onOpenChange:e=>m?.(e),modal:x,loopFocus:N,disabled:v,children:[i?e(r.Trigger,{render:i,openOnHover:y,disabled:v}):null,e(r.Portal,{children:e(r.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",side:p,align:h,sideOffset:f,children:e(r.Popup,{className:g(P,z[a],b[a],C??""),style:{...M(s,3),...k},children:O})})})]})})}export const ContextMenu=/*@__PURE__*/l.forwardRef(function ContextMenu(t,a){const{size:s="md",color:o="primary",density:r="default",content:i,children:u,open:m,defaultOpen:p,onOpenChange:h,loopFocus:f=!0,disabled:x=!1,className:y,style:N,...v}=I(t,["size","density"]),C=l.useMemo(()=>({size:s,color:o,density:r}),[s,o,r]);return e(d.Provider,{value:C,children:n(c.Root,{open:m,defaultOpen:p,onOpenChange:e=>h?.(e),loopFocus:f,disabled:x,children:[e(c.Trigger,{ref:a,render:u,...v}),e(c.Portal,{children:e(c.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",children:e(c.Popup,{className:g(P,z[s],b[s],y??""),style:{...M(o,3),...N},children:i})})})]})})});
1
+ "use client";import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import*as l from"react";import{glowClasses as a,spotlightSlot as s,trackPointer as o}from"../../internal/glow.js";import{Menu as r}from"@base-ui/react/menu";import{useDirection as i}from"@base-ui/react/direction-provider";import{ContextMenu as c}from"@base-ui/react/context-menu";import{MenuContext as d}from"../../internal/menu.js";import{CheckIcon as u,ChevronIcon as m,DotIcon as p}from"../../internal/icons.js";import{safeHref as h,safeRel as f}from"../../internal/link.js";import{NewTabNote as x}from"../../internal/new-tab.js";import{controlTextLeadingClasses as b,cx as g,gapClasses as y,hasContent as N,iconClasses as k,metaTextClasses as v,popupFadeClasses as C,radiusClasses as M,surfaceClasses as z,surfaceSlots as O,transitionClasses as w}from"../../internal/styles.js";import{useStyleDefaults as I}from"../../internal/defaults.js";const P=[z,"max-h-[min(24rem,var(--available-height))] min-w-40 overflow-y-auto overscroll-contain","border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",C].join(" "),j={default:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-2",xl:"px-3.5 py-2.5"},compact:{xs:"px-1 py-0.5",sm:"px-1.5 py-0.5",md:"px-2 py-1",lg:"px-2.5 py-1",xl:"px-3 py-1.5"}},R={xs:M.xs,sm:M.xs,md:M.sm,lg:M.sm,xl:M.md};function $(e,n,t,l,s){return g("relative flex w-full cursor-pointer items-center select-none",l?a:"",t?"text-(--n-on-tint)":"text-(--neba-fg)",j[n][e],R[e],y[e],b[e],w,k,"data-[highlighted]:bg-(--n-soft-hover)","data-[popup-open]:bg-(--n-soft)","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]",s??"")}const B="flex h-[1lh] w-[1.2em] shrink-0 items-center justify-center";function RowBody({children:t,description:l,size:a}){return N(l)?n("span",{className:"flex min-w-0 flex-1 flex-col text-start",children:[e("span",{className:"truncate",children:t}),e("span",{className:`truncate text-(--neba-muted-fg) ${v[a]}`,children:l})]}):e("span",{className:"min-w-0 flex-1 truncate text-start",children:t})}export function MenuItem({onClick:a,href:i,target:c,rel:u,startIcon:m,endIcon:p,shortcut:b,description:g,color:y,closeOnClick:k=!0,disabled:C=!1,label:M,children:z,className:w,style:I}){const P=l.useContext(d),{size:j,density:R}=P,F=n(t,{children:[N(m)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:m}):null,e(RowBody,{description:g,size:j,children:z}),N(p)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:p}):null,N(b)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${v[j]}`,children:b}):null]}),G={...y?O(y,0):void 0,...s,...I},S=h(i);return void 0===S||C?e(r.Item,{disabled:C,label:M,closeOnClick:k,onClick:a,className:$(j,R,Boolean(y),!C,w),style:G,onPointerMove:o(void 0,!C),children:F}):n(r.LinkItem,{href:S,target:c,rel:f(c,u),label:M,closeOnClick:k,onClick:a,className:$(j,R,Boolean(y),!C,w),style:G,onPointerMove:o(void 0,!0),children:[F,e(x,{target:c})]})}export function MenuCheckboxItem({checked:t,defaultChecked:a,onCheckedChange:i,endIcon:c,shortcut:m,description:p,color:h,closeOnClick:f=!1,disabled:x=!1,label:b,children:g,className:y,style:k}){const{size:C,density:M}=l.useContext(d),z=h?O(h,0):void 0;return n(r.CheckboxItem,{checked:t,defaultChecked:a,onCheckedChange:e=>i?.(e),disabled:x,label:b,closeOnClick:f,className:$(C,M,Boolean(h),!x,y),style:{...z,...s,...k},onPointerMove:o(void 0,!x),children:[e("span",{className:`${B} text-(--n-accent)`,children:e(r.CheckboxItemIndicator,{className:"flex items-center justify-center",children:e(u,{})})}),e(RowBody,{description:p,size:C,children:g}),N(c)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:c}):null,N(m)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${v[C]}`,children:m}):null]})}export function MenuRadioGroup({value:n,defaultValue:t,onValueChange:l,disabled:a=!1,children:s,className:o}){return e(r.RadioGroup,{value:n,defaultValue:t,onValueChange:e=>l?.(e),disabled:a,className:o,children:s})}export function MenuRadioItem({value:t,endIcon:a,shortcut:i,description:c,color:u,closeOnClick:m=!1,disabled:h=!1,label:f,children:x,className:b,style:g}){const{size:y,density:k}=l.useContext(d),C=u?O(u,0):void 0;return n(r.RadioItem,{value:t,disabled:h,label:f,closeOnClick:m,className:$(y,k,Boolean(u),!h,b),style:{...C,...s,...g},onPointerMove:o(void 0,!h),children:[e("span",{className:`${B} text-(--n-accent)`,children:e(r.RadioItemIndicator,{className:"flex items-center justify-center",children:e(p,{})})}),e(RowBody,{description:c,size:y,children:x}),N(a)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:a}):null,N(i)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${v[y]}`,children:i}):null]})}export function MenuGroup({label:t,children:a,className:s}){const{size:o,density:i}=l.useContext(d);return n(r.Group,{className:s,children:[N(t)?e(r.GroupLabel,{className:[j[i][o],v[o],"font-semibold tracking-wide text-(--neba-muted-fg) uppercase"].join(" "),children:t}):null,a]})}export function MenuSeparator({className:n,...t}){return e(r.Separator,{className:g("-mx-1 my-1 h-px bg-(--n-line)",n??""),...t})}export function MenuSubmenu({label:t,startIcon:a,disabled:c=!1,side:u,sideOffset:p=4,children:h,className:f,style:x}){const y=l.useContext(d),{size:k,density:v,color:C,keepMounted:z}=y,w=i();return n(r.SubmenuRoot,{children:[n(r.SubmenuTrigger,{disabled:c,className:$(k,v,!1,!c),style:s,onPointerMove:o(void 0,!c),children:[N(a)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:a}):null,e("span",{className:"min-w-0 flex-1 truncate text-start",children:t}),e("span",{className:`${B} text-(--neba-muted-fg) ${"rtl"===w?"rotate-90":"-rotate-90"}`,children:e(m,{})})]}),e(r.Portal,{keepMounted:z,children:e(r.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",side:u??"inline-end",sideOffset:p,align:"start",children:e(r.Popup,{className:g(P,M[k],b[k],f??""),style:{...O(C,3),...x},children:h})})})]})}export function Menu(t){const{size:a="md",color:s="primary",density:o="default",trigger:i,open:c,defaultOpen:u,onOpenChange:m,side:p="bottom",align:h="start",sideOffset:f=6,modal:x,openOnHover:y=!1,loopFocus:N=!0,disabled:k=!1,keepMounted:v=!1,className:C,style:z,children:w}=I(t,["size","density"]),j=l.useMemo(()=>({size:a,color:s,density:o,keepMounted:v}),[a,s,o,v]);return e(d.Provider,{value:j,children:n(r.Root,{open:c,defaultOpen:u,onOpenChange:e=>m?.(e),modal:x,loopFocus:N,disabled:k,children:[i?e(r.Trigger,{render:i,openOnHover:y,disabled:k}):null,e(r.Portal,{keepMounted:v,children:e(r.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",side:p,align:h,sideOffset:f,children:e(r.Popup,{className:g(P,M[a],b[a],C??""),style:{...O(s,3),...z},children:w})})})]})})}export const ContextMenu=/*@__PURE__*/l.forwardRef(function ContextMenu(t,a){const{size:s="md",color:o="primary",density:r="default",content:i,children:u,open:m,defaultOpen:p,onOpenChange:h,loopFocus:f=!0,disabled:x=!1,keepMounted:y=!1,className:N,style:k,...v}=I(t,["size","density"]),C=l.useMemo(()=>({size:s,color:o,density:r,keepMounted:y}),[s,o,r,y]);return e(d.Provider,{value:C,children:n(c.Root,{open:m,defaultOpen:p,onOpenChange:e=>h?.(e),loopFocus:f,disabled:x,children:[e(c.Trigger,{ref:a,render:u,...v}),e(c.Portal,{keepMounted:y,children:e(c.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",children:e(c.Popup,{className:g(P,M[s],b[s],N??""),style:{...O(o,3),...k},children:i})})})]})})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Meter as r}from"@base-ui/react/meter";import{barThicknessClasses as t,progressAriaText as s,progressFraction as n,progressSlots as o,thresholdColor as i}from"../../internal/progress.js";import{cx as m,metaTextClasses as u,stackGapClasses as c}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";export const Meter=/*@__PURE__*/l.forwardRef(function Meter(l,d){const{value:b,min:h=0,max:x=100,label:p,showValue:v=!1,format:g,locale:j,thresholds:w,thickness:y,size:N="md",color:k="primary",className:M,style:_,...V}=f(l,["size","locale"]),$=n(b,h,x),z=i(b,k,w),R=void 0!==g;return a(r.Root,{ref:d,value:b,min:h,max:x,format:g,locale:j,getAriaValueText:s($,R),className:m("flex w-full flex-col",c[N],M??""),style:{...o(z),..._},...V,children:[p||v?a("div",{className:["flex items-baseline gap-2",p?"justify-between":"justify-end",u[N]].join(" "),children:[p?e(r.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:p}):null,v?e(r.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>R?e:`${Math.round(100*($??0))}%`}):null]}):null,e(r.Track,{className:`relative w-full overflow-hidden rounded-full bg-(--n-soft) ${t[N]}`,style:void 0===y?void 0:{height:`${y}px`},children:e(r.Indicator,{className:"absolute top-0 rounded-full bg-(--n-fill) [transition:width_var(--neba-duration-fill)_var(--neba-ease),background-color_var(--neba-duration)_var(--neba-ease)]"})})]})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Meter as r}from"@base-ui/react/meter";import{barThicknessClasses as t,progressAriaText as s,progressFraction as n,progressSlots as o,thresholdColor as i}from"../../internal/progress.js";import{cx as m,metaTextClasses as u,stackGapClasses as c}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";import{useIntlLocale as d}from"../../internal/media.js";export const Meter=/*@__PURE__*/l.forwardRef(function Meter(l,b){const{value:h,min:p=0,max:x=100,label:v,showValue:j=!1,format:g,locale:w,thresholds:y,thickness:N,size:k="md",color:M="primary",className:_,style:V,...$}=f(l,["size","locale"]),z=d(w),R=n(h,p,x),T=i(h,M,y),A=void 0!==g;return a(r.Root,{ref:b,value:h,min:p,max:x,format:g,locale:z,getAriaValueText:s(R,A),className:m("flex w-full flex-col",c[k],_??""),style:{...o(T),...V},...$,children:[v||j?a("div",{className:["flex items-baseline gap-2",v?"justify-between":"justify-end",u[k]].join(" "),children:[v?e(r.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:v}):null,j?e(r.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>A?e:`${Math.round(100*(R??0))}%`}):null]}):null,e(r.Track,{className:`relative w-full overflow-hidden rounded-full bg-(--n-soft) ${t[k]}`,style:void 0===N?void 0:{height:`${N}px`},children:e(r.Indicator,{className:"absolute top-0 rounded-full bg-(--n-fill) [transition:width_var(--neba-duration-fill)_var(--neba-ease),background-color_var(--neba-duration)_var(--neba-ease)]"})})]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import*as r from"react";import{ScreenContext as n}from"../../internal/screen.js";import{useRender as a}from"@base-ui/react/use-render";import{transitionProps as o}from"../../internal/animate.js";import{MockupCutout as s,defaultNotch as h,elevationFilters as d,finishSlots as l,mockupChrome as c,mockupMetrics as u,resolveOs as m,shellClasses as f}from"../../internal/mockup.js";import{observeResize as p}from"../../internal/observe.js";import{cx as g,surfaceSlots as b}from"../../internal/styles.js";import{useStyleDefaults as v}from"../../internal/defaults.js";const w="undefined"==typeof document?r.useEffect:r.useLayoutEffect;export const Mockup=/*@__PURE__*/r.forwardRef(function Mockup(y,x){const{device:k,os:N,hardware:M="monitor",size:R="md",resolution:$,orientation:j="portrait",bezel:z="standard",finish:W="graphite",notch:H,systemUi:P=!0,scroll:E=!1,wallpaper:L,time:S="9:41",width:B,height:C,color:F="primary",elevation:I=0,transition:T,render:U,className:q,style:A,children:D,...G}=v(y,["size"]),J=m(k,N),K=H??h(k,J),O="desktop"!==k&&"landscape"===j,Q=u({device:k,size:R,resolution:$,orientation:j,bezel:z,hardware:M}),{screen:V,frame:X,body:Y,stand:Z,base:_}=Q,ee=r.useRef(null),[te,ie]=r.useState(null),re="number"==typeof B?"number"==typeof C?Math.min(B/X.width,C/X.height):B/X.width:"number"==typeof C&&void 0===B?C/X.height:null,ne=te??re;w(()=>{const e=ee.current;if(!e)return;const t=()=>{const t=e.offsetWidth,i=e.offsetHeight;if(t<=0||i<=0)return;const r=Math.min(t/X.width,i/X.height);ie(e=>null!==e&&Math.abs(e-r)<1e-4?e:r)};return t(),p(e,t)},[X.width,X.height]);const ae=r.useCallback(e=>{ee.current=e,"function"==typeof x?x(e):x&&(x.current=e)},[x]),oe=P?c({os:J,notch:K,landscape:O,time:S}):{},se=o(T),he="none"===z,de=t("div",{className:"neba-mockup-screen relative flex flex-col overflow-hidden",style:{width:V.width,height:V.height,borderRadius:Q.screenRadius,background:L??"var(--neba-surface)",boxShadow:he?void 0:"inset 0 0 0 1px var(--n-shell-shade)"},children:[oe.top?.node,t("div",{className:"flex min-h-0 flex-1",children:[oe.start?.node,e("div",{className:"min-w-0 flex-1 "+(E?"overflow-auto":"overflow-hidden"),style:{containerType:"size",containerName:"neba-screen"},children:e(n.Provider,{value:!0,children:D})})]}),oe.bottom?.node,e(s,{notch:K,screen:V,landscape:O})]}),le=g("neba-mockup relative block overflow-hidden",se.className,q??"");return a({render:U,ref:ae,props:{className:le,style:{...b(F,I),...l[W],...se.style,width:B??(void 0===C?"100%":"auto"),height:C??"auto",aspectRatio:`${X.width} / ${X.height}`,filter:d[I],...A},children:t("div",{className:"absolute top-1/2 left-1/2 flex flex-col items-center",style:{width:X.width,height:X.height,transform:`translate(-50%, -50%) scale(${ne??1})`,visibility:null===ne?"hidden":void 0},children:[e("div",{className:he?"":f,style:{width:Y.width,height:Y.height,borderRadius:Q.frameRadius,paddingBlock:`${Q.bezel.top}px ${Q.bezel.bottom}px`,paddingInline:Q.bezel.x},children:de}),Z?t(i,{children:[e("div",{"aria-hidden":"true",style:{width:Z.neckWidth,height:Z.neckHeight,background:"var(--n-shell-shade)",clipPath:"polygon(16% 0, 84% 0, 100% 100%, 0 100%)"}}),e("div",{"aria-hidden":"true",className:f,style:{width:Z.footWidth,height:Z.footHeight,borderRadius:Z.footHeight/2}})]}):null,_?e("div",{"aria-hidden":"true",className:`relative ${f}`,style:{width:_.width,height:_.height,borderRadius:`0 0 ${Math.round(.55*_.height)}px ${Math.round(.55*_.height)}px`,clipPath:"polygon(0 0, 100% 0, 98.5% 100%, 1.5% 100%)"},children:e("div",{className:"absolute top-0 left-1/2",style:{width:_.lipWidth,height:Math.round(.34*_.height),marginLeft:-_.lipWidth/2,borderRadius:`0 0 ${Math.round(.2*_.height)}px ${Math.round(.2*_.height)}px`,background:"var(--n-shell-shade)"}})}):null]}),...G}})});
1
+ "use client";import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import*as r from"react";import{useLayoutEffectOnClient as a}from"../../internal/layout-effect.js";import{ScreenContext as n}from"../../internal/screen.js";import{useRender as o}from"@base-ui/react/use-render";import{transitionProps as s}from"../../internal/animate.js";import{MockupCutout as h,defaultNotch as l,elevationFilters as d,finishSlots as c,mockupChrome as u,mockupMetrics as m,resolveOs as f,shellClasses as p}from"../../internal/mockup.js";import{observeResize as g}from"../../internal/observe.js";import{cx as b,surfaceSlots as v}from"../../internal/styles.js";import{useStyleDefaults as w}from"../../internal/defaults.js";export const Mockup=/*@__PURE__*/r.forwardRef(function Mockup(y,x){const{device:k,os:N,hardware:j="monitor",size:M="md",resolution:R,orientation:$="portrait",bezel:z="standard",finish:W="graphite",notch:H,systemUi:P=!0,scroll:S=!1,wallpaper:B,time:C="9:41",width:F,height:I,color:L="primary",elevation:T=0,transition:U,render:q,className:A,style:D,children:E,...G}=w(y,["size"]),J=f(k,N),K=H??l(k,J),O="desktop"!==k&&"landscape"===$,Q=m({device:k,size:M,resolution:R,orientation:$,bezel:z,hardware:j}),{screen:V,frame:X,body:Y,stand:Z,base:_}=Q,ee=r.useRef(null),[te,ie]=r.useState(null),re="number"==typeof F?"number"==typeof I?Math.min(F/X.width,I/X.height):F/X.width:"number"==typeof I&&void 0===F?I/X.height:null,ae=te??re;a(()=>{const e=ee.current;if(!e)return;const t=()=>{const t=e.offsetWidth,i=e.offsetHeight;if(t<=0||i<=0)return;const r=Math.min(t/X.width,i/X.height);ie(e=>null!==e&&Math.abs(e-r)<1e-4?e:r)};return t(),g(e,t)},[X.width,X.height]);const ne=r.useCallback(e=>{ee.current=e,"function"==typeof x?x(e):x&&(x.current=e)},[x]),oe=P?u({os:J,notch:K,landscape:O,time:C}):{},se=s(U),he="none"===z,le=t("div",{className:"neba-mockup-screen relative flex flex-col overflow-hidden",style:{width:V.width,height:V.height,borderRadius:Q.screenRadius,background:B??"var(--neba-surface)",boxShadow:he?void 0:"inset 0 0 0 1px var(--n-shell-shade)"},children:[oe.top?.node,t("div",{className:"flex min-h-0 flex-1",children:[oe.start?.node,e("div",{className:"min-w-0 flex-1 "+(S?"overflow-auto":"overflow-hidden"),style:{containerType:"size",containerName:"neba-screen"},children:e(n.Provider,{value:!0,children:E})})]}),oe.bottom?.node,e(h,{notch:K,screen:V,landscape:O})]}),de=b("neba-mockup relative block overflow-hidden",se.className,A??"");return o({render:q,ref:ne,props:{className:de,style:{...v(L,T),...c[W],...se.style,width:F??(void 0===I?"100%":"auto"),height:I??"auto",aspectRatio:`${X.width} / ${X.height}`,filter:d[T],...D},children:t("div",{className:"absolute top-1/2 left-1/2 flex flex-col items-center",style:{width:X.width,height:X.height,transform:`translate(-50%, -50%) scale(${ae??1})`,visibility:null===ae?"hidden":void 0},children:[e("div",{className:he?"":p,style:{width:Y.width,height:Y.height,borderRadius:Q.frameRadius,paddingBlock:`${Q.bezel.top}px ${Q.bezel.bottom}px`,paddingInline:Q.bezel.x},children:le}),Z?t(i,{children:[e("div",{"aria-hidden":"true",style:{width:Z.neckWidth,height:Z.neckHeight,background:"var(--n-shell-shade)",clipPath:"polygon(16% 0, 84% 0, 100% 100%, 0 100%)"}}),e("div",{"aria-hidden":"true",className:p,style:{width:Z.footWidth,height:Z.footHeight,borderRadius:Z.footHeight/2}})]}):null,_?e("div",{"aria-hidden":"true",className:`relative ${p}`,style:{width:_.width,height:_.height,borderRadius:`0 0 ${Math.round(.55*_.height)}px ${Math.round(.55*_.height)}px`,clipPath:"polygon(0 0, 100% 0, 98.5% 100%, 1.5% 100%)"},children:e("div",{className:"absolute top-0 left-1/2",style:{width:_.lipWidth,height:Math.round(.34*_.height),marginLeft:-_.lipWidth/2,borderRadius:`0 0 ${Math.round(.2*_.height)}px ${Math.round(.2*_.height)}px`,background:"var(--n-shell-shade)"}})}):null]}),...G}})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{NumberField as t}from"@base-ui/react/number-field";import{Field as n}from"@base-ui/react/field";import{numberMessages as r,useMessages as i}from"../../internal/i18n.js";import{MinusIcon as s,PlusIcon as o}from"../../internal/icons.js";import{keyHandler as c}from"../../internal/keys.js";import{FieldNotch as d,NotchFrame as m,restEndOf as u}from"../../internal/notch.js";import{controlTextLeadingClasses as p,cx as b,disabledClasses as f,fieldFocusTransitionClasses as h,fieldHeightClasses as g,fieldReadOnlyClasses as x,fieldRestClasses as v,fieldRingClasses as N,fieldSheetClasses as y,fieldSheetDisabledClasses as j,fieldSheetReadOnlyClasses as w,gapClasses as k,hasContent as _,iconClasses as S,metaTextClasses as C,paddingXClasses as V,radiusClasses as z,readOnlyFilterClasses as O,stackGapClasses as $,surfaceSlots as I,transitionClasses as D}from"../../internal/styles.js";import{useStyleDefaults as F}from"../../internal/defaults.js";import{fieldLight as L,fieldSpotlightSlot as R,glowClasses as q}from"../../internal/glow.js";import{useFieldsetDisabled as E}from"../../internal/fieldset.js";const P=["group relative flex w-full items-center","[-webkit-tap-highlight-color:transparent]",D,h,S].join(" "),W=["relative inline-flex size-[1.7em] shrink-0 cursor-pointer items-center justify-center","neba-hit-row","rounded-(--neba-radius-xs) text-(--neba-muted-fg) select-none","[&_svg]:size-[0.9em] [&_svg]:shrink-0","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","[transition:background-color_var(--neba-duration)_var(--neba-ease),color_var(--neba-duration)_var(--neba-ease)]","active:[transition-duration:0ms]","hover:bg-(--n-soft) hover:text-(--n-on-tint)","active:bg-(--n-soft-press)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1","disabled:cursor-not-allowed disabled:bg-transparent disabled:text-(--neba-disabled-fg)"].join(" ");export const NumberField=/*@__PURE__*/l.forwardRef(function NumberField(l,h){const{variant:S="outline",size:D="md",color:B="primary",density:G="default",elevation:K=0,value:A,defaultValue:H,onValueChange:J,onValueCommitted:M,min:Q,max:T,step:U,largeStep:X,smallStep:Y,snapOnStep:Z,wheel:ee=!0,format:ae,locale:le,steppers:te="end",incrementLabel:ne,decrementLabel:re,label:ie,labelPlacement:se="top",description:oe,error:ce,invalid:de,startIcon:me,endIcon:ue,fullWidth:pe=!1,disabled:be,readOnly:fe=!1,required:he=!1,name:ge,placeholder:xe,id:ve,className:Ne,classNames:ye,shortcuts:je,style:we,"aria-label":ke,"aria-labelledby":_e,...Se}=F(l,["size","density","variant","locale","labelPlacement"]),Ce=E(be),Ve=!Ce&&!fe,ze=i(r,"string"==typeof le?le:void 0),Oe=_(ce),$e=de??Oe,Ie=$e?"danger":B,De=V[G][D],Fe={end:`${De} pe-1`,split:"px-1",none:De},Le=e(t.Decrement,{"aria-label":re??ze.decrease,className:b(W,ye?.stepper),children:e(s,{})}),Re=e(t.Increment,{"aria-label":ne??ze.increase,className:b(W,ye?.stepper),children:e(o,{})}),qe="none"!==te&&!fe,Ee="top"!==se&&_(ie),Pe=Ee&&"float"===se&&!_(me)&&!(qe&&"split"===te),We=a(t.Group,{...L(Ve),className:b(P,g[D],p[D],z[D],k[D],qe?Fe[te]:De,Ee?"":N,Ce?(Ee?j:f)[S]:fe?Ee?`${w[S]} ${O}`:x[S]:`${(Ee?y:v)[S]} ${q}`,Ce?"":"cursor-text",ye?.shell),children:[qe&&"split"===te?Le:null,me?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:me}):null,e(t.Input,{ref:h,"aria-label":ke,"aria-labelledby":_e,onKeyDown:c(je),placeholder:Pe?xe||" ":xe,className:["neba-input min-w-0 flex-1 self-stretch bg-transparent [font:inherit] text-inherit","[outline:none]","tabular-nums","split"===te&&qe?"text-center":"","placeholder:text-(--neba-muted-fg)","caret-(--n-accent) selection:bg-(--n-soft-press)","disabled:cursor-not-allowed",Pe?"neba-float-control":"",ye?.control].filter(Boolean).join(" ")}),ue?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:ue}):null,qe&&"end"===te?a("span",{className:"flex shrink-0 items-center gap-0.5",style:{"--n-hit-gap":"0.125rem"},children:[Le,Re]}):null,qe&&"split"===te?Re:null,Ee?e(d,{label:ie,variant:S,disabled:Ce,readOnly:fe,rests:Pe,labelClassName:ye?.label}):null]});return a(n.Root,{disabled:Ce,invalid:$e,className:b("flex-col align-top",$[D],pe?"flex w-full":"inline-flex",Ne??""),style:{...I(Ie,K),...Ve?R:void 0,...we},...Se,children:[ie&&!Ee?e(n.Label,{className:b(C[D],"font-medium",Ce?"text-(--neba-disabled-fg)":"text-(--neba-fg)",ye?.label),children:ie}):null,e(t.Root,{id:ve,name:ge,className:"contents",value:A,defaultValue:H,onValueChange:e=>J?.(e),onValueCommitted:e=>M?.(e),min:Q,max:T,step:U,largeStep:X,smallStep:Y,snapOnStep:Z,allowWheelScrub:ee,format:ae,locale:le,disabled:Ce,readOnly:fe,required:he,children:Ee?e(m,{label:ie,size:D,density:G,variant:S,rests:Pe,restEnd:u(D,[...ue?[1.2]:[],...qe&&"end"===te?[3.55]:[]]),labelClassName:ye?.label,children:We}):We}),oe?e(n.Description,{className:b(C[D],"text-(--neba-muted-fg)",ye?.description),children:oe}):null,e(n.Error,Oe?{match:!0,className:b(C[D],"text-(--n-accent)",ye?.error),children:ce}:{className:b(C[D],"text-(--n-accent)",ye?.error)})]})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{NumberField as t}from"@base-ui/react/number-field";import{Field as n}from"@base-ui/react/field";import{numberMessages as r,useMessages as i}from"../../internal/i18n.js";import{MinusIcon as s,PlusIcon as o}from"../../internal/icons.js";import{keyHandler as c}from"../../internal/keys.js";import{FieldNotch as d,NotchFrame as m,restEndOf as p}from"../../internal/notch.js";import{controlTextLeadingClasses as u,cx as b,disabledClasses as f,fieldFocusTransitionClasses as h,fieldHeightClasses as g,fieldReadOnlyClasses as x,fieldRestClasses as v,fieldRingClasses as N,fieldSheetClasses as y,fieldSheetDisabledClasses as j,fieldSheetReadOnlyClasses as w,gapClasses as k,hasContent as _,iconClasses as S,metaTextClasses as C,paddingXClasses as V,radiusClasses as z,readOnlyFilterClasses as O,stackGapClasses as $,surfaceSlots as I,transitionClasses as D}from"../../internal/styles.js";import{useStyleDefaults as F}from"../../internal/defaults.js";import{useIntlLocale as L}from"../../internal/media.js";import{fieldLight as R,fieldSpotlightSlot as q,glowClasses as E}from"../../internal/glow.js";import{useFieldsetDisabled as P}from"../../internal/fieldset.js";const W=["group relative flex w-full items-center","[-webkit-tap-highlight-color:transparent]",D,h,S].join(" "),B=["relative inline-flex size-[1.7em] shrink-0 cursor-pointer items-center justify-center","neba-hit-row","rounded-(--neba-radius-xs) text-(--neba-muted-fg) select-none","[&_svg]:size-[0.9em] [&_svg]:shrink-0","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","[transition:background-color_var(--neba-duration)_var(--neba-ease),color_var(--neba-duration)_var(--neba-ease)]","active:[transition-duration:0ms]","hover:bg-(--n-soft) hover:text-(--n-on-tint)","active:bg-(--n-soft-press)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1","disabled:cursor-not-allowed disabled:bg-transparent disabled:text-(--neba-disabled-fg)"].join(" ");export const NumberField=/*@__PURE__*/l.forwardRef(function NumberField(l,h){const{variant:S="outline",size:D="md",color:G="primary",density:K="default",elevation:A=0,value:H,defaultValue:J,onValueChange:M,onValueCommitted:Q,min:T,max:U,step:X,largeStep:Y,smallStep:Z,snapOnStep:ee,wheel:ae=!0,format:le,locale:te,steppers:ne="end",incrementLabel:re,decrementLabel:ie,label:se,labelPlacement:oe="top",description:ce,error:de,invalid:me,startIcon:pe,endIcon:ue,fullWidth:be=!1,disabled:fe,readOnly:he=!1,required:ge=!1,name:xe,placeholder:ve,id:Ne,className:ye,classNames:je,shortcuts:we,style:ke,"aria-label":_e,"aria-labelledby":Se,...Ce}=F(l,["size","density","variant","locale","labelPlacement"]),Ve=P(fe),ze=!Ve&&!he,Oe=i(r,"string"==typeof te?te:void 0),$e=L(void 0),Ie=_(de),De=me??Ie,Fe=De?"danger":G,Le=V[K][D],Re={end:`${Le} pe-1`,split:"px-1",none:Le},qe=e(t.Decrement,{"aria-label":ie??Oe.decrease,className:b(B,je?.stepper),children:e(s,{})}),Ee=e(t.Increment,{"aria-label":re??Oe.increase,className:b(B,je?.stepper),children:e(o,{})}),Pe="none"!==ne&&!he,We="top"!==oe&&_(se),Be=We&&"float"===oe&&!_(pe)&&!(Pe&&"split"===ne),Ge=a(t.Group,{...R(ze),className:b(W,g[D],u[D],z[D],k[D],Pe?Re[ne]:Le,We?"":N,Ve?(We?j:f)[S]:he?We?`${w[S]} ${O}`:x[S]:`${(We?y:v)[S]} ${E}`,Ve?"":"cursor-text",je?.shell),children:[Pe&&"split"===ne?qe:null,pe?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:pe}):null,e(t.Input,{ref:h,"aria-label":_e,"aria-labelledby":Se,onKeyDown:c(we),placeholder:Be?ve||" ":ve,className:["neba-input min-w-0 flex-1 self-stretch bg-transparent [font:inherit] text-inherit","[outline:none]","tabular-nums","split"===ne&&Pe?"text-center":"","placeholder:text-(--neba-muted-fg)","caret-(--n-accent) selection:bg-(--n-soft-press)","disabled:cursor-not-allowed",Be?"neba-float-control":"",je?.control].filter(Boolean).join(" ")}),ue?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:ue}):null,Pe&&"end"===ne?a("span",{className:"flex shrink-0 items-center gap-0.5",style:{"--n-hit-gap":"0.125rem"},children:[qe,Ee]}):null,Pe&&"split"===ne?Ee:null,We?e(d,{label:se,variant:S,disabled:Ve,readOnly:he,rests:Be,labelClassName:je?.label}):null]});return a(n.Root,{disabled:Ve,invalid:De,className:b("flex-col align-top",$[D],be?"flex w-full":"inline-flex",ye??""),style:{...I(Fe,A),...ze?q:void 0,...ke},...Ce,children:[se&&!We?e(n.Label,{className:b(C[D],"font-medium",Ve?"text-(--neba-disabled-fg)":"text-(--neba-fg)",je?.label),children:se}):null,e(t.Root,{id:Ne,name:xe,className:"contents",value:H,defaultValue:J,onValueChange:e=>M?.(e),onValueCommitted:e=>Q?.(e),min:T,max:U,step:X,largeStep:Y,smallStep:Z,snapOnStep:ee,allowWheelScrub:ae,format:le,locale:te??$e,disabled:Ve,readOnly:he,required:ge,children:We?e(m,{label:se,size:D,density:K,variant:S,rests:Be,restEnd:p(D,[...ue?[1.2]:[],...Pe&&"end"===ne?[3.55]:[]]),labelClassName:je?.label,children:Ge}):Ge}),ce?e(n.Description,{className:b(C[D],"text-(--neba-muted-fg)",je?.description),children:ce}):null,e(n.Error,Ie?{match:!0,className:b(C[D],"text-(--n-accent)",je?.error),children:de}:{className:b(C[D],"text-(--n-accent)",je?.error)})]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as l from"react";import{layoutMessages as n,useMessages as t}from"../../internal/i18n.js";import{PageLayoutContext as r,SidebarSideContext as a,PageLayoutSlotContext as s}from"../../internal/page-layout.js";import{observeResize as i}from"../../internal/observe.js";import{controlSlots as u,cx as c,hasContent as d,insetRingClasses as f,toLength as p}from"../../internal/styles.js";import{useStyleDefaults as m}from"../../internal/defaults.js";import{ScreenContext as h}from"../../internal/screen.js";const v=["header","footer"];export const PageLayout=/*@__PURE__*/l.forwardRef(function PageLayout(x,y){const{header:b,footer:w,sidebar:g,endSidebar:P,headerSpan:S="full",footerSpan:k="full",scroll:C="page",height:j="viewport",collapseBelow:N="md",sidebarOpen:O,defaultSidebarOpen:$=!1,onSidebarOpenChange:L,endSidebarOpen:R,defaultEndSidebarOpen:z=!1,onEndSidebarOpenChange:E,skipLink:B=!0,skipLabel:H,main:I,mainId:M="main",mainProps:_,locale:T,color:q="primary",className:A,style:D,children:F,...G}=m(x,["locale"]),J=t(n,T),K=l.useContext(h),Q=I??!K,[U,V]=l.useState($),[W,X]=l.useState(z),Y=l.useMemo(()=>({start:O??U,end:R??W}),[O,U,R,W]),Z=l.useCallback((e,o)=>{if("start"===e)return void 0===O&&V(o),void L?.(o);void 0===R&&X(o),E?.(o)},[O,R,L,E]),ee=l.useRef(null),oe=l.useCallback(e=>{ee.current=e,"function"==typeof y?y(e):y&&(y.current=e)},[y]),le=l.useRef({header:null,footer:null}),ne=l.useRef({header:null,footer:null}),te=l.useCallback(()=>{const e=ee.current;if(e)for(const o of v){const l=le.current[o],n="header"===o?S:k;if(!l){e.style.setProperty(`--n-layout-${o}`,"0px"),e.style.setProperty(`--n-layout-${o}-inset`,"0px");continue}const t=getComputedStyle(l).position,r=`${l.offsetHeight}px`,a="sticky"===t||"fixed"===t;e.style.setProperty(`--n-layout-${o}`,a&&"full"===n?r:"0px"),e.style.setProperty(`--n-layout-${o}-inset`,"fixed"===t?r:"0px")}},[S,k]),re=l.useCallback(()=>{for(const e of v){ne.current[e]?.();const o=le.current[e];ne.current[e]=o?i(o,()=>te()):null}te()},[te]);l.useEffect(()=>{const e=ne.current;return re(),()=>{for(const o of v)e[o]?.(),e[o]=null}},[re]);const ae=l.useCallback((e,o)=>{le.current[e]=o,re()},[re]),se=l.useMemo(()=>({present:!0,register:ae,collapseBelow:N,open:Y,setOpen:Z,scroll:C,locale:T}),[ae,N,Y,Z,C,T]),ie="content"===C,ue=p("viewport"===j||"auto"===j?void 0:j),ce=void 0!==ue?"":"auto"===j?ie?"h-full":"min-h-full":ie?"h-dvh":"min-h-dvh",de=d(b)?e(s.Provider,{value:"header",children:b}):null,fe=d(w)?e(s.Provider,{value:"footer",children:w}):null;return e(r.Provider,{value:se,children:o("div",{ref:oe,className:c("relative flex w-full flex-col",ie?"overflow-hidden":"",ce,"full"===S?"[padding-top:var(--n-layout-header-inset,0px)]":"","full"===k?"[padding-bottom:var(--n-layout-footer-inset,0px)]":"",A),style:void 0===ue?D:{...ie?{height:ue}:{minHeight:ue},...D},...G,children:[B&&Q?e("a",{href:`#${M}`,className:c("absolute start-3 top-3 z-50 size-px overflow-hidden whitespace-nowrap","[clip-path:inset(50%)] focus:size-auto focus:overflow-visible focus:[clip-path:none]","focus:rounded-(--neba-radius-md) focus:bg-(--n-fill) focus:px-4 focus:py-2","focus:font-medium focus:text-(--n-on-solid) focus:no-underline","focus:[box-shadow:var(--neba-shadow-2),var(--neba-plate-solid)]","focus:[outline:2px_solid_var(--n-ring)] focus:outline-offset-2"),style:u(q,2,"solid"),children:H??J.skipToContent}):null,"full"===S?de:null,o("div",{className:c("flex w-full flex-1",ie?"min-h-0":""),children:[d(g)?e(a.Provider,{value:"start",children:g}):null,o("div",{className:c("flex min-w-0 flex-1 flex-col",ie?"min-h-0":"","content"===S?"[padding-top:var(--n-layout-header-inset,0px)]":"","content"===k?"[padding-bottom:var(--n-layout-footer-inset,0px)]":""),children:["content"===S?de:null,Q?e("main",{tabIndex:-1,..._,id:M,className:c("min-w-0 flex-1",f,ie?"min-h-0 overflow-y-auto":"",_?.className),children:F}):e("div",{..._,className:c("min-w-0 flex-1",ie?"min-h-0 overflow-y-auto":"",_?.className),children:F}),"content"===k?fe:null]}),d(P)?e(a.Provider,{value:"end",children:P}):null]}),"full"===k?fe:null]})})});
1
+ "use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as l from"react";import{layoutMessages as n,useMessages as t}from"../../internal/i18n.js";import{headerFloor as r,PageLayoutContext as a,SidebarSideContext as i,PageLayoutSlotContext as s}from"../../internal/page-layout.js";import{useLayoutEffectOnClient as u}from"../../internal/layout-effect.js";import{observeResize as d}from"../../internal/observe.js";import{controlSlots as f,cx as c,hasContent as p,insetRingClasses as m,toLength as h}from"../../internal/styles.js";import{DefaultsContext as v,useStyleDefaults as y}from"../../internal/defaults.js";import{ScreenContext as x}from"../../internal/screen.js";const b=["header","footer"];export const PageLayout=/*@__PURE__*/l.forwardRef(function PageLayout(w,g){const{header:P,footer:C,sidebar:S,endSidebar:j,headerSpan:k="full",footerSpan:N="full",scroll:O="page",height:$="viewport",collapseBelow:z="md",sidebarOpen:L,defaultSidebarOpen:R=!1,onSidebarOpenChange:B,endSidebarOpen:E,defaultEndSidebarOpen:H=!1,onEndSidebarOpenChange:I,skipLink:M=!0,skipLabel:_,main:T,mainId:q="main",mainProps:A,locale:D,color:F="primary",className:G,style:J,children:K,...Q}=y(w,["locale"]),U=t(n,D),V=l.useContext(x),W=l.useContext(v),X=T??!V,[Y,Z]=l.useState(R),[ee,oe]=l.useState(H),le=l.useMemo(()=>({start:L??Y,end:E??ee}),[L,Y,E,ee]),ne=l.useCallback((e,o)=>{if("start"===e)return void 0===L&&Z(o),void B?.(o);void 0===E&&oe(o),I?.(o)},[L,E,B,I]),te=l.useRef(null),re=l.useCallback(e=>{te.current=e,"function"==typeof g?g(e):g&&(g.current=e)},[g]),ae=l.useRef({header:null,footer:null}),ie=l.useRef({header:null,footer:null}),se=l.useCallback(()=>{const e=te.current;if(e)for(const o of b){const l=ae.current[o],n="header"===o?k:N;if(!l){e.style.setProperty(`--n-layout-${o}`,"0px"),e.style.setProperty(`--n-layout-${o}-inset`,"0px");continue}const t=getComputedStyle(l).position,r=`${l.offsetHeight}px`,a="sticky"===t||"fixed"===t;e.style.setProperty(`--n-layout-${o}`,a&&"full"===n?r:"0px"),e.style.setProperty(`--n-layout-${o}-inset`,"fixed"===t?r:"0px")}},[k,N]),ue=l.useCallback(()=>{for(const e of b){ie.current[e]?.();const o=ae.current[e];ie.current[e]=o?d(o,()=>se()):null}se()},[se]);u(()=>{const e=ie.current;return ue(),()=>{for(const o of b)e[o]?.(),e[o]=null}},[ue]);const de=l.useCallback((e,o)=>{ae.current[e]=o,ue()},[ue]),fe=l.useMemo(()=>({present:!0,register:de,collapseBelow:z,open:le,setOpen:ne,scroll:O,locale:D}),[de,z,le,ne,O,D]),ce="content"===O,pe=r(P,W?.size),me=h("viewport"===$||"auto"===$?void 0:$),he=void 0!==me?"":"auto"===$?ce?"h-full":"min-h-full":ce?"h-dvh":"min-h-dvh",ve=p(P)?e(s.Provider,{value:"header",children:P}):null,ye=p(C)?e(s.Provider,{value:"footer",children:C}):null;return e(a.Provider,{value:fe,children:o("div",{ref:re,className:c("relative flex w-full flex-col",ce?"overflow-hidden":"",he,"full"===k?"[padding-top:var(--n-layout-header-inset,var(--n-layout-header-floor,0px))]":"","full"===N?"[padding-bottom:var(--n-layout-footer-inset,0px)]":"",G),style:{...void 0===pe?void 0:{"--n-layout-header-floor":pe},...void 0===me?void 0:ce?{height:me}:{minHeight:me},...J},...Q,children:[M&&X?e("a",{href:`#${q}`,className:c("absolute start-3 top-3 z-50 size-px overflow-hidden whitespace-nowrap","[clip-path:inset(50%)] focus:size-auto focus:overflow-visible focus:[clip-path:none]","focus:rounded-(--neba-radius-md) focus:bg-(--n-fill) focus:px-4 focus:py-2","focus:font-medium focus:text-(--n-on-solid) focus:no-underline","focus:[box-shadow:var(--neba-shadow-2),var(--neba-plate-solid)]","focus:[outline:2px_solid_var(--n-ring)] focus:outline-offset-2"),style:f(F,2,"solid"),children:_??U.skipToContent}):null,"full"===k?ve:null,o("div",{className:c("flex w-full flex-1",ce?"min-h-0":""),children:[p(S)?e(i.Provider,{value:"start",children:S}):null,o("div",{className:c("flex min-w-0 flex-1 flex-col",ce?"min-h-0":"","content"===k?"[padding-top:var(--n-layout-header-inset,var(--n-layout-header-floor,0px))]":"","content"===N?"[padding-bottom:var(--n-layout-footer-inset,0px)]":""),children:["content"===k?ve:null,X?e("main",{tabIndex:-1,...A,id:q,className:c("min-w-0 flex-1",m,ce?"min-h-0 overflow-y-auto":"",A?.className),children:K}):e("div",{...A,className:c("min-w-0 flex-1",ce?"min-h-0 overflow-y-auto":"",A?.className),children:K}),"content"===N?ye:null]}),p(j)?e(i.Provider,{value:"end",children:j}):null]}),"full"===N?ye:null]})})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{beginPointerDrag as r,drawnScale as o}from"../../internal/drag.js";import{observeResize as a}from"../../internal/observe.js";import{cx as i,toPixels as l,transitionClasses as s}from"../../internal/styles.js";import{useStyleDefaults as c}from"../../internal/defaults.js";import{panesMessages as u,useMessages as f}from"../../internal/i18n.js";const m=/*@__PURE__*/t.createContext({basis:null}),d={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},h={xs:4,sm:6,md:8,lg:10,xl:12};function p(e,n,t){if(null!=e)return"number"==typeof e?n*e/100:l(e,{percentOf:n,relativeTo:t})}export const Panes=/*@__PURE__*/t.forwardRef(function Panes(l,g){const{orientation:x="horizontal",resizable:b=!0,color:v="primary",size:z="md",onResize:w,onResizeEnd:y,handleLabel:S,locale:M,className:R,style:$,children:j,...A}=c(l,["size","locale"]),E=t.Children.toArray(j).filter(t.isValidElement),k=E.length,C=f(u,M),N=t.useId(),P=e=>E[e]?.props.id??`${N}-pane-${e}`,D=t.useRef(null),I=t.useCallback(e=>{D.current=e,"function"==typeof g?g(e):g&&(g.current=e)},[g]),L=t.useRef([]);L.current=E.map(e=>e.props);const[T,F]=t.useState(null),H=T&&T.length===k?T:null,W=t.useRef(null);t.useEffect(()=>{W.current=H});const X="horizontal"===x,Y=h[z]*Math.max(0,k-1);function _(e){const n=D.current,t=W.current;if(!b||!n||!t||void 0===t[e+1])return null;const r=(X?n.offsetWidth:n.offsetHeight)-Y;if(r<=0)return null;const o=L.current[e],a=L.current[e+1],i=t[e]*r,l=i+t[e+1]*r,s=Math.max(p(o?.minSize,r,n)??0,l-(p(a?.maxSize,r,n)??l)),c=Math.min(p(o?.maxSize,r,n)??l,l-(p(a?.minSize,r,n)??0));return c<s?null:{root:n,current:t,extent:r,start:i,pair:l,resize(n){const o=Math.min(c,Math.max(s,i+n)),a=[...t];return a[e]=o/r,a[e+1]=(l-o)/r,F(a),w?.(a.map(e=>100*e)),a}}}t.useEffect(()=>{const e=D.current;if(!e)return;const n=()=>{const n=(X?e.offsetWidth:e.offsetHeight)-Y;n<=0||F(t=>t&&t.length===k?t:function(e,n,t){const r=e.map(e=>p(e.defaultSize,n,t)),o=r.reduce((e,n)=>e+(n??0),0),a=r.filter(e=>void 0===e).length,i=a>0?Math.max(0,n-o)/a:0,l=r.map(e=>Math.max(0,e??i)),s=l.reduce((e,n)=>e+n,0);return s<=0?l.map(()=>1/Math.max(1,l.length)):l.map(e=>e/s)}(L.current,n,e))};return n(),a(e,n)},[k,X,Y]);const K=t.useRef(null);t.useEffect(()=>()=>K.current?.(),[]);const O=i("group/handle relative z-1 flex shrink-0 grow-0 items-center justify-center",d[z],s,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-0",b?i(X?"cursor-col-resize":"cursor-row-resize","neba-hit","touch-none","hover:bg-(--n-soft) data-[dragging]:bg-(--n-soft)"):"");return e("div",{ref:I,className:i("flex h-full w-full",X?"flex-row":"flex-col","min-h-0 min-w-0",R),style:{"--n-accent":`var(--neba-${v}-accent)`,"--n-soft":`var(--neba-${v}-soft)`,"--n-ring":`var(--neba-${v}-ring)`,...$},...A,children:E.map((a,l)=>n(t.Fragment,{children:[l>0?e("div",{role:"separator","aria-label":"function"==typeof S?S(l-1):S??C.handle,"aria-controls":`${P(l-1)} ${P(l)}`,"aria-orientation":X?"vertical":"horizontal","aria-valuenow":H?Math.round(100*H[l-1]):void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-disabled":!b||void 0,tabIndex:b?0:-1,className:O,onPointerDown:e=>{0===e.button&&function(e,n){const t=_(e);if(!t)return;const a=n.currentTarget,i=X?n.clientX:n.clientY,l=X&&"rtl"===getComputedStyle(t.root).direction?-1:1,s=o(t.root)[X?"x":"y"];let c=t.current;K.current=r({target:a,pointerId:n.pointerId,onMove:e=>{const n=X?e.clientX:e.clientY;c=t.resize((n-i)/s*l)},onEnd:()=>{K.current=null,y?.(c.map(e=>100*e))}})}(l-1,e)},onKeyDown:e=>{const n=X&&"rtl"===getComputedStyle(e.currentTarget).direction,t=X?n?"ArrowRight":"ArrowLeft":"ArrowUp",r=X?n?"ArrowLeft":"ArrowRight":"ArrowDown";e.key!==t&&e.key!==r||(e.preventDefault(),function(e,n){const t=_(e);if(!t)return;const r=t.resize(n);y?.(r.map(e=>100*e))}(l-1,e.key===r?16:-16))},children:e("span",{"aria-hidden":"true",className:i("pointer-events-none bg-(--neba-border)",s,X?"h-full w-px":"h-px w-full",b?"group-hover/handle:bg-(--n-accent) group-focus-visible/handle:bg-(--n-accent) group-data-[dragging]/handle:bg-(--n-accent)":"")})}):null,e(m.Provider,{value:{basis:H?`calc((100% - ${Y}px) * ${H[l].toFixed(6)})`:null},children:void 0===a.props.id?t.cloneElement(a,{id:P(l)}):a})]},a.key??l))})});export const Pane=/*@__PURE__*/t.forwardRef(function Pane({defaultSize:n,minSize:r,maxSize:o,className:a,style:l,children:s,...c},u){const{basis:f}=t.useContext(m);return e("div",{ref:u,className:i("relative min-h-0 min-w-0 overflow-auto",a),style:{flex:f?`0 0 ${f}`:"1 1 0%",...l},...c,children:s})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{beginPointerDrag as r,drawnScale as o}from"../../internal/drag.js";import{useLayoutEffectOnClient as i}from"../../internal/layout-effect.js";import{observeResize as a}from"../../internal/observe.js";import{cx as l,toPixels as s,transitionClasses as c}from"../../internal/styles.js";import{useStyleDefaults as u}from"../../internal/defaults.js";import{panesMessages as f,useMessages as m}from"../../internal/i18n.js";const d="1 1 0%",p=/*@__PURE__*/n.createContext({flex:d}),h={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},g={xs:4,sm:6,md:8,lg:10,xl:12};function x(e,t,n){if(null!=e)return"number"==typeof e?t*e/100:s(e,{percentOf:t,relativeTo:n})}function v(e,t,n){const r=e.map(e=>x(e.defaultSize,t,n)),o=r.reduce((e,t)=>e+(t??0),0),i=r.filter(e=>void 0===e).length,a=i>0?Math.max(0,t-o)/i:0,l=r.map(e=>Math.max(0,e??a)),s=l.reduce((e,t)=>e+t,0);return s<=0?l.map(()=>1/Math.max(1,l.length)):l.map(e=>e/s)}function b(e,t){return`calc((100% - ${t}px) * ${e.toFixed(6)})`}function z(e){return"string"==typeof e&&!/%\s*$/.test(e)&&void 0!==s(e,{percentOf:0,relativeTo:null})}function y(e,t){if(z(e))return`0 1 ${e}`;const n="number"==typeof e?e/100:"string"==typeof e?s(e,{percentOf:1}):void 0;return void 0===n?d:`0 1 ${b(Math.max(0,n),t)}`}export const Panes=/*@__PURE__*/n.forwardRef(function Panes(s,d){const{orientation:w="horizontal",resizable:S=!0,color:$="primary",size:M="md",onResize:j,onResizeEnd:R,handleLabel:A,locale:k,className:C,style:E,children:N,...P}=u(s,["size","locale"]),D=n.Children.toArray(N).filter(n.isValidElement),I=D.length,T=m(f,k),L=n.useId(),O=e=>D[e]?.props.id??`${L}-pane-${e}`,F=n.useRef(null),H=n.useCallback(e=>{F.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),W=D.map(e=>e.props),X=n.useRef([]);X.current=W;const Y="horizontal"===w,_=g[M]*Math.max(0,I-1),[K,U]=n.useState(null),V=(K&&K.length===I?K:null)??(W.some(e=>z(e.defaultSize))?null:v(W,100,null)),q=n.useRef(null);function B(e){const t=F.current,n=q.current;if(!S||!t||!n||void 0===n[e+1])return null;const r=(Y?t.offsetWidth:t.offsetHeight)-_;if(r<=0)return null;const o=X.current[e],i=X.current[e+1],a=n[e]*r,l=a+n[e+1]*r,s=Math.max(x(o?.minSize,r,t)??0,l-(x(i?.maxSize,r,t)??l)),c=Math.min(x(o?.maxSize,r,t)??l,l-(x(i?.minSize,r,t)??0));return c<s?null:{root:t,current:n,extent:r,start:a,pair:l,resize(t){const o=Math.min(c,Math.max(s,a+t)),i=[...n];return i[e]=o/r,i[e+1]=(l-o)/r,U(i),j?.(i.map(e=>100*e)),i}}}n.useEffect(()=>{q.current=V}),i(()=>{const e=F.current;if(!e)return;const t=()=>{const t=(Y?e.offsetWidth:e.offsetHeight)-_;t<=0||U(n=>n&&n.length===I?n:v(X.current,t,e))};return t(),a(e,t)},[I,Y,_]);const G=n.useRef(null);n.useEffect(()=>()=>G.current?.(),[]);const J=l("group/handle relative z-1 flex shrink-0 grow-0 items-center justify-center",h[M],c,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-0",S?l(Y?"cursor-col-resize":"cursor-row-resize","neba-hit","touch-none","hover:bg-(--n-soft) data-[dragging]:bg-(--n-soft)"):"");return e("div",{ref:H,className:l("flex h-full w-full",Y?"flex-row":"flex-col","min-h-0 min-w-0",C),style:{"--n-accent":`var(--neba-${$}-accent)`,"--n-soft":`var(--neba-${$}-soft)`,"--n-ring":`var(--neba-${$}-ring)`,...E},...P,children:D.map((i,a)=>t(n.Fragment,{children:[a>0?e("div",{role:"separator","aria-label":"function"==typeof A?A(a-1):A??T.handle,"aria-controls":`${O(a-1)} ${O(a)}`,"aria-orientation":Y?"vertical":"horizontal","aria-valuenow":V?Math.round(100*V[a-1]):void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-disabled":!S||void 0,tabIndex:S?0:-1,className:J,onPointerDown:e=>{0===e.button&&function(e,t){const n=B(e);if(!n)return;const i=t.currentTarget,a=Y?t.clientX:t.clientY,l=Y&&"rtl"===getComputedStyle(n.root).direction?-1:1,s=o(n.root)[Y?"x":"y"];let c=n.current;G.current=r({target:i,pointerId:t.pointerId,onMove:e=>{const t=Y?e.clientX:e.clientY;c=n.resize((t-a)/s*l)},onEnd:()=>{G.current=null,R?.(c.map(e=>100*e))}})}(a-1,e)},onKeyDown:e=>{const t=Y&&"rtl"===getComputedStyle(e.currentTarget).direction,n=Y?t?"ArrowRight":"ArrowLeft":"ArrowUp",r=Y?t?"ArrowLeft":"ArrowRight":"ArrowDown";e.key!==n&&e.key!==r||(e.preventDefault(),function(e,t){const n=B(e);if(!n)return;const r=n.resize(t);R?.(r.map(e=>100*e))}(a-1,e.key===r?16:-16))},children:e("span",{"aria-hidden":"true",className:l("pointer-events-none bg-(--neba-border)",c,Y?"h-full w-px":"h-px w-full",S?"group-hover/handle:bg-(--n-accent) group-focus-visible/handle:bg-(--n-accent) group-data-[dragging]/handle:bg-(--n-accent)":"")})}):null,e(p.Provider,{value:{flex:V?`0 0 ${b(V[a],_)}`:y(i.props.defaultSize,_)},children:void 0===i.props.id?n.cloneElement(i,{id:O(a)}):i})]},i.key??a))})});export const Pane=/*@__PURE__*/n.forwardRef(function Pane({defaultSize:t,minSize:r,maxSize:o,className:i,style:a,children:s,...c},u){const{flex:f}=n.useContext(p);return e("div",{ref:u,className:l("relative min-h-0 min-w-0 overflow-auto",i),style:{flex:f,...a},...c,children:s})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{ChartDataTable as n,ChartExport as a,ChartLegendBar as i,ChartStatus as r,ChartSummary as o,ChartSurface as s,ChartTooltipPanel as u,markTransitionClasses as d,summarise as m,useMeasuredWidth as c,useReleaseOutside as h,useVisibility as f,chartHeight as v,useMeasuredHeight as p}from"../../internal/chart-frame.js";import{arcPath as x,categoryAt as g,chartFontSizes as b,compactNumber as y,formatCategory as M,inkOn as N,markGap as j,seriesColor as w,toValue as k,warnPaletteOverflow as E}from"../../internal/chart.js";import{numberFormatter as I}from"../../internal/format.js";import{cx as z,metaTextClasses as P}from"../../internal/styles.js";import{chartMessages as A,emptyMessages as $,useMessages as L}from"../../internal/i18n.js";import{useStyleDefaults as S}from"../../internal/defaults.js";const B={pie:0,donut:.62,semi:.62};export function PieChart(C){const{data:R,categories:D,shape:O="pie",startAngle:_=0,hole:F,gap:H=j,center:K,valueLabels:T="none",height:V,format:W,locale:q,label:G,legend:J,tooltip:Q,empty:U,exportable:X=!1,exportFileName:Y="chart.csv",onExport:Z,size:ee="md",variant:le="text",padded:te=!1,className:ne,...ae}=S(C,["size","variant","locale"]),ie=t.useRef(null),re=c(ie),oe=L($,q),se=L(A,q),ue=t.useId(),de=t.useCallback(e=>W?I(q,W).format(e):y(e,q),[W,q]),me=t.useMemo(()=>R.map(k),[R]),ce=t.useMemo(()=>me.map((e,l)=>({name:M(g(l,D,[me]),q),data:[R[l]],color:e.color})),[me,D,R,q]),he=f(ce);t.useEffect(()=>{E(ce.length)},[ce.length]);const[fe,ve]=t.useState(null);h(ie,null!==fe,()=>ve(null));const pe=t.useId(),xe=ce.map((e,l)=>w(e,l)),ge=me.reduce((e,l,t)=>he.visible[t]&&null!==l.value?e+Math.max(0,l.value):e,0),be="semi"===O,ye=p(ie,"string"==typeof V),Me=v(V,ee,ye),Ne=b[ee],je=!1===J?{interactive:!1}:!0===J||void 0===J?{}:J,we=!1!==J&&ce.length>1,ke=je.side??"bottom",Ee=!1===Q?{mode:"none"}:!0===Q||void 0===Q?{}:Q,Ie="none"===Ee.mode,ze=re/2,Pe=Math.max(0,Math.min(re/2,be?Me:Me/2)-2),Ae=be?Math.min(Me,Me/2+Pe/2):Me/2,$e=Pe*Math.min(.92,Math.max(0,F??B[O])),Le=ge<=0||Pe<=0,Se=Pe>0?Math.min(15,Math.max(0,H)/Pe*(180/Math.PI)):0,Be=be?180:360,Ce=[];let Re=be?-90:_;me.forEach((e,l)=>{if(!he.visible[l]||null===e.value||e.value<=0)return;const t=e.value/ge,n=t*Be;Ce.push({index:l,start:Re,end:Re+n,value:e.value,share:t}),Re+=n});const De=null===fe?[]:[{seriesIndex:fe,name:ce[fe]?.name,color:me[fe]?.color??xe[fe],value:me[fe]?.value??null,formatted:`${de(me[fe]?.value??0)} · ${Math.round(10*(Math.max(0,me[fe]?.value??0)/ge*100+Number.EPSILON))/10}%`,label:me[fe]?.label}];return l(s,{...ae,size:ee,variant:le,padded:te,className:ne,legendSide:ke,legend:we?e(i,{series:ce,colors:xe,options:je,visibility:he,size:ee,values:je.showValue?me.map(e=>null===e.value?void 0:de(e.value)):void 0}):null,table:Le?null:e(n,{id:ue,caption:G,categories:ce.map(e=>e.name??""),series:[{name:G,data:R}],values:[me],format:de,locale:q}),children:[X&&!Le?e(a,{rows:()=>[["",G??se.label],...ce.map((e,l)=>[e.name??"",me[l]?.value??null])],fileName:Y,onExport:Z,label:se.exportCsv}):null,l("div",{ref:ie,role:"img",tabIndex:Le?void 0:0,"aria-label":G??se.label,"aria-describedby":Le?void 0:pe,onPointerLeave:e=>{"touch"!==e.pointerType&&ve(null)},onBlur:()=>ve(null),onKeyDown:e=>{const l=Ce.map(e=>e.index);if("Escape"===e.key){if(null===fe)return;ve(null)}else{if(Ie||0===l.length)return;if("Home"===e.key)ve(l[0]);else if("End"===e.key)ve(l[l.length-1]);else{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;{const t=null===fe?-1:l.indexOf(fe),n="ArrowRight"===e.key?t+1:t-1;ve(l[(n+l.length)%l.length])}}}e.preventDefault()},className:z("relative w-full rounded-(--neba-radius-xs)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"),style:{height:"string"==typeof V?V:Me},children:[Le?e("div",{className:z("flex h-full items-center justify-center text-(--neba-muted-fg)",P[ee]),children:U??oe.title}):re>0?l("svg",{width:re,height:Me,viewBox:`0 0 ${re} ${Me}`,"aria-hidden":"true",className:"block",children:[Ce.map(l=>{const t=null!==he.hovered&&he.hovered!==l.index||null!==fe&&fe!==l.index,n=Ce.length>1&&l.end-l.start>2*Se?Se/2:0;return e("path",{d:x(ze,Ae,Pe,$e,l.start+n,l.end-n),fill:me[l.index].color??xe[l.index],opacity:t?.32:1,onPointerEnter:Ie?void 0:()=>ve(l.index),className:d},l.index)}),"all"===T?Ce.map(l=>{const t=((l.start+l.end)/2-90)*(Math.PI/180),n=$e>0?($e+Pe)/2:.68*Pe,a=`${Math.round(100*l.share)}%`;return(l.end-l.start)*(Math.PI/180)*n<2*Ne||Pe-$e<1.6*Ne?null:e("text",{x:ze+n*Math.cos(t),y:Ae+n*Math.sin(t),textAnchor:"middle",dominantBaseline:"central",fontSize:Ne,fontWeight:600,fill:N(me[l.index].color,l.index),className:"tabular-nums",children:a},l.index)}):null]}):null,K&&$e>0?e("div",{className:"pointer-events-none absolute flex flex-col items-center justify-center text-center",style:{left:ze-$e,top:Ae-$e,width:2*$e,height:be?$e:2*$e},children:K}):null,null===fe||Ie?null:Ee.render?e("div",{className:"pointer-events-none absolute top-0 left-1/2 z-10",children:Ee.render({index:fe,category:ce[fe]?.name??fe,items:De})}):e(u,{heading:ce[fe]?.name,items:De,x:ze,y:8,flip:!1,size:ee})]}),Le?null:e(o,{id:pe,template:se.summary,locale:q,...m(me.filter((e,l)=>he.visible[l]).map(e=>[e]),de)}),Ie?null:e(r,{heading:null===fe?void 0:ce[fe]?.name,items:De})]})}
1
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{ChartDataTable as n,ChartExport as a,ChartLegendBar as i,ChartStatus as r,ChartSummary as o,ChartSurface as s,ChartTooltipPanel as u,markTransitionClasses as d,summarise as m,useMeasuredWidth as c,useReleaseOutside as h,useVisibility as f,chartHeight as p,useMeasuredHeight as v}from"../../internal/chart-frame.js";import{arcPath as x,categoryAt as g,chartFontSizes as b,compactNumber as y,formatCategory as M,inkOn as N,markGap as j,seriesColor as w,toValue as k,warnPaletteOverflow as E}from"../../internal/chart.js";import{numberFormatter as I}from"../../internal/format.js";import{cx as z,metaTextClasses as P}from"../../internal/styles.js";import{chartMessages as A,emptyMessages as $,useMessages as L}from"../../internal/i18n.js";import{useStyleDefaults as S}from"../../internal/defaults.js";import{useIntlLocale as B}from"../../internal/media.js";const C={pie:0,donut:.62,semi:.62};export function PieChart(R){const{data:D,categories:O,shape:_="pie",startAngle:F=0,hole:H,gap:K=j,center:T,valueLabels:V="none",height:W,format:q,locale:G,label:J,legend:Q,tooltip:U,empty:X,exportable:Y=!1,exportFileName:Z="chart.csv",onExport:ee,size:le="md",variant:te="text",padded:ne=!1,className:ae,...ie}=S(R,["size","variant","locale"]),re=t.useRef(null),oe=c(re),se=L($,G),ue=L(A,G),de=B(G),me=t.useId(),ce=t.useCallback(e=>q?I(de,q).format(e):y(e,de),[q,de]),he=t.useMemo(()=>D.map(k),[D]),fe=t.useMemo(()=>he.map((e,l)=>({name:M(g(l,O,[he]),de),data:[D[l]],color:e.color})),[he,O,D,de]),pe=f(fe);t.useEffect(()=>{E(fe.length)},[fe.length]);const[ve,xe]=t.useState(null);h(re,null!==ve,()=>xe(null));const ge=t.useId(),be=fe.map((e,l)=>w(e,l)),ye=he.reduce((e,l,t)=>pe.visible[t]&&null!==l.value?e+Math.max(0,l.value):e,0),Me="semi"===_,Ne=v(re,"string"==typeof W),je=p(W,le,Ne),we=b[le],ke=!1===Q?{interactive:!1}:!0===Q||void 0===Q?{}:Q,Ee=!1!==Q&&fe.length>1,Ie=ke.side??"bottom",ze=!1===U?{mode:"none"}:!0===U||void 0===U?{}:U,Pe="none"===ze.mode,Ae=oe/2,$e=Math.max(0,Math.min(oe/2,Me?je:je/2)-2),Le=Me?Math.min(je,je/2+$e/2):je/2,Se=$e*Math.min(.92,Math.max(0,H??C[_])),Be=ye<=0||$e<=0,Ce=$e>0?Math.min(15,Math.max(0,K)/$e*(180/Math.PI)):0,Re=Me?180:360,De=[];let Oe=Me?-90:F;he.forEach((e,l)=>{if(!pe.visible[l]||null===e.value||e.value<=0)return;const t=e.value/ye,n=t*Re;De.push({index:l,start:Oe,end:Oe+n,value:e.value,share:t}),Oe+=n});const _e=null===ve?[]:[{seriesIndex:ve,name:fe[ve]?.name,color:he[ve]?.color??be[ve],value:he[ve]?.value??null,formatted:`${ce(he[ve]?.value??0)} · ${Math.round(10*(Math.max(0,he[ve]?.value??0)/ye*100+Number.EPSILON))/10}%`,label:he[ve]?.label}];return l(s,{...ie,size:le,variant:te,padded:ne,className:ae,legendSide:Ie,legend:Ee?e(i,{series:fe,colors:be,options:ke,visibility:pe,size:le,values:ke.showValue?he.map(e=>null===e.value?void 0:ce(e.value)):void 0}):null,table:Be?null:e(n,{id:me,caption:J,categories:fe.map(e=>e.name??""),series:[{name:J,data:D}],values:[he],format:ce,locale:de}),children:[Y&&!Be?e(a,{rows:()=>[["",J??ue.label],...fe.map((e,l)=>[e.name??"",he[l]?.value??null])],fileName:Z,onExport:ee,label:ue.exportCsv}):null,l("div",{ref:re,role:"img",tabIndex:Be?void 0:0,"aria-label":J??ue.label,"aria-describedby":Be?void 0:ge,onPointerLeave:e=>{"touch"!==e.pointerType&&xe(null)},onBlur:()=>xe(null),onKeyDown:e=>{const l=De.map(e=>e.index);if("Escape"===e.key){if(null===ve)return;xe(null)}else{if(Pe||0===l.length)return;if("Home"===e.key)xe(l[0]);else if("End"===e.key)xe(l[l.length-1]);else{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;{const t=null===ve?-1:l.indexOf(ve),n="ArrowRight"===e.key?t+1:t-1;xe(l[(n+l.length)%l.length])}}}e.preventDefault()},className:z("relative w-full rounded-(--neba-radius-xs)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"),style:{height:"string"==typeof W?W:je},children:[Be?e("div",{className:z("flex h-full items-center justify-center text-(--neba-muted-fg)",P[le]),children:X??se.title}):oe>0?l("svg",{width:oe,height:je,viewBox:`0 0 ${oe} ${je}`,"aria-hidden":"true",className:"block",children:[De.map(l=>{const t=null!==pe.hovered&&pe.hovered!==l.index||null!==ve&&ve!==l.index,n=De.length>1&&l.end-l.start>2*Ce?Ce/2:0;return e("path",{d:x(Ae,Le,$e,Se,l.start+n,l.end-n),fill:he[l.index].color??be[l.index],opacity:t?.32:1,onPointerEnter:Pe?void 0:()=>xe(l.index),className:d},l.index)}),"all"===V?De.map(l=>{const t=((l.start+l.end)/2-90)*(Math.PI/180),n=Se>0?(Se+$e)/2:.68*$e,a=`${Math.round(100*l.share)}%`;return(l.end-l.start)*(Math.PI/180)*n<2*we||$e-Se<1.6*we?null:e("text",{x:Ae+n*Math.cos(t),y:Le+n*Math.sin(t),textAnchor:"middle",dominantBaseline:"central",fontSize:we,fontWeight:600,fill:N(he[l.index].color,l.index),className:"tabular-nums",children:a},l.index)}):null]}):null,T&&Se>0?e("div",{className:"pointer-events-none absolute flex flex-col items-center justify-center text-center",style:{left:Ae-Se,top:Le-Se,width:2*Se,height:Me?Se:2*Se},children:T}):null,null===ve||Pe?null:ze.render?e("div",{className:"pointer-events-none absolute top-0 left-1/2 z-10",children:ze.render({index:ve,category:fe[ve]?.name??ve,items:_e})}):e(u,{heading:fe[ve]?.name,items:_e,x:Ae,y:8,flip:!1,size:le})]}),Be?null:e(o,{id:ge,template:ue.summary,locale:de,...m(he.filter((e,l)=>pe.visible[l]).map(e=>[e]),ce)}),Pe?null:e(r,{heading:null===ve?void 0:fe[ve]?.name,items:_e})]})}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{trackPointer as i}from"../../internal/glow.js";import{observeResize as l}from"../../internal/observe.js";import{controlSlots as s,controlTextClasses as r,cx as a,gapClasses as c,hasContent as m,iconClasses as d,iconSizeClasses as f,insetRingClasses as x,metaTextClasses as p,paddingXClasses as u,pressTransitionClasses as h,sheetBodyClasses as v,surfaceClasses as b,transitionClasses as g}from"../../internal/styles.js";import{inertValue as w}from"../../internal/inert.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const j={solid:[b,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[b,"border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:`${b} text-(--n-on-tint) bg-(--n-soft)`},_={solid:"hover:bg-(--n-fill-hover) active:bg-(--n-fill-active)",outline:"hover:bg-(--n-panel-hover) active:bg-(--n-panel-press)",text:"hover:bg-(--n-soft) active:bg-(--n-soft-hover)"},k={xs:"min-h-5.5",sm:"min-h-6.5",md:"min-h-8",lg:"min-h-10",xl:"min-h-12"},z={xs:"rounded-[0.6875rem]",sm:"rounded-[0.8125rem]",md:"rounded-[1rem]",lg:"rounded-[1.25rem]",xl:"rounded-[1.5rem]"},N={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"}},$={static:{top:"",bottom:""},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"}},I={static:{top:"",bottom:""},sticky:{top:"sticky top-[calc(0.75rem_+_env(safe-area-inset-top))] z-20",bottom:"sticky bottom-[calc(0.75rem_+_env(safe-area-inset-bottom))] z-20"},fixed:{top:"fixed inset-x-0 top-[calc(0.75rem_+_env(safe-area-inset-top))] z-30 mx-auto w-fit",bottom:"fixed inset-x-0 bottom-[calc(0.75rem_+_env(safe-area-inset-bottom))] z-30 mx-auto w-fit"}};export const Pill=/*@__PURE__*/o.forwardRef(function Pill(b,P){const{variant:C="solid",size:H="md",color:R="secondary",density:A="default",elevation:B=2,startIcon:E,endIcon:F,title:L,description:M,details:S,expanded:q=!1,position:D="static",side:G="top",safeArea:J=!0,className:K,style:O,children:Q,onClick:T,...U}=y(b,["size","density","variant"]),V=o.useRef(null),W=o.useId(),[X,Y]=o.useState(null),Z=m(S);o.useLayoutEffect(()=>{const e=V.current;if(e)return Y(e.scrollHeight),l(e,()=>Y(e.scrollHeight))},[Z]);const ee=Boolean(T),te=u[A][H],ne=t(n,{children:[m(E)?e("span",{className:`flex shrink-0 items-center justify-center overflow-hidden rounded-full [&_img]:size-full [&_img]:object-cover ${f[H]}`,children:E}):null,m(L)||m(M)||m(Q)?t("span",{className:["flex min-w-0 flex-1 flex-col items-center justify-center text-center",N[A][H]].join(" "),children:[m(L)?e("span",{className:"max-w-full truncate",children:L}):null,m(M)?e("span",{className:`max-w-full truncate font-normal ${p[H]}`,children:M}):null,Q]}):null]});return t("div",{ref:P,className:a("inline-flex max-w-full flex-col overflow-hidden align-middle",z[H],"font-medium whitespace-nowrap select-none",r[H],j[C],g,h,d,(J?I:$)[D][G],K??""),style:{...s(R,B,C),...O},...U,children:[t("div",{className:["flex shrink-0 items-center py-1",k[H],c[H],ee?"ps-0":te,m(F)?"pe-1":ee?"pe-0":""].join(" "),children:[ee?e("button",{type:"button",className:["relative flex min-w-0 flex-1 cursor-pointer items-center justify-center self-stretch",z[H],c[H],te,x,"neba-glow",_[C],g,h].join(" "),onPointerMove:i(void 0,!0),"aria-expanded":Z?q:void 0,"aria-controls":Z?W:void 0,onClick:T,children:ne}):ne,m(F)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:F}):null]}),Z?e("div",{id:W,className:["overflow-hidden","[transition:height_var(--neba-duration)_var(--neba-ease)]","motion-reduce:[transition-duration:0ms]"].join(" "),style:{height:q?X??"auto":0},inert:w(!q),children:e("div",{ref:V,className:`whitespace-normal ${te} pb-2 ${v[H]}`,children:S})}):null]})});
1
+ "use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{useLayoutEffectOnClient as i}from"../../internal/layout-effect.js";import{trackPointer as l}from"../../internal/glow.js";import{observeResize as s}from"../../internal/observe.js";import{controlSlots as r,controlTextClasses as a,cx as c,gapClasses as m,hasContent as d,iconClasses as f,iconSizeClasses as x,insetRingClasses as p,metaTextClasses as u,paddingXClasses as h,pressTransitionClasses as v,sheetBodyClasses as b,surfaceClasses as g,transitionClasses as w}from"../../internal/styles.js";import{inertValue as j}from"../../internal/inert.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const _={solid:[g,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[g,"border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:`${g} text-(--n-on-tint) bg-(--n-soft)`},k={solid:"hover:bg-(--n-fill-hover) active:bg-(--n-fill-active)",outline:"hover:bg-(--n-panel-hover) active:bg-(--n-panel-press)",text:"hover:bg-(--n-soft) active:bg-(--n-soft-hover)"},z={xs:"min-h-5.5",sm:"min-h-6.5",md:"min-h-8",lg:"min-h-10",xl:"min-h-12"},N={xs:"rounded-[0.6875rem]",sm:"rounded-[0.8125rem]",md:"rounded-[1rem]",lg:"rounded-[1.25rem]",xl:"rounded-[1.5rem]"},$={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"}},I={static:{top:"",bottom:""},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"}},P={static:{top:"",bottom:""},sticky:{top:"sticky top-[calc(0.75rem_+_env(safe-area-inset-top))] z-20",bottom:"sticky bottom-[calc(0.75rem_+_env(safe-area-inset-bottom))] z-20"},fixed:{top:"fixed inset-x-0 top-[calc(0.75rem_+_env(safe-area-inset-top))] z-30 mx-auto w-fit",bottom:"fixed inset-x-0 bottom-[calc(0.75rem_+_env(safe-area-inset-bottom))] z-30 mx-auto w-fit"}};export const Pill=/*@__PURE__*/o.forwardRef(function Pill(g,C){const{variant:H="solid",size:R="md",color:A="secondary",density:B="default",elevation:F=2,startIcon:M,endIcon:S,title:q,description:D,details:E,expanded:G=!1,position:J="static",side:K="top",safeArea:L=!0,className:O,style:Q,children:T,onClick:U,...V}=y(g,["size","density","variant"]),W=o.useRef(null),X=o.useId(),[Y,Z]=o.useState(null),ee=d(E);i(()=>{const e=W.current;if(e)return Z(e.scrollHeight),s(e,()=>Z(e.scrollHeight))},[ee]);const te=Boolean(U),ne=h[B][R],oe=t(n,{children:[d(M)?e("span",{className:`flex shrink-0 items-center justify-center overflow-hidden rounded-full [&_img]:size-full [&_img]:object-cover ${x[R]}`,children:M}):null,d(q)||d(D)||d(T)?t("span",{className:["flex min-w-0 flex-1 flex-col items-center justify-center text-center",$[B][R]].join(" "),children:[d(q)?e("span",{className:"max-w-full truncate",children:q}):null,d(D)?e("span",{className:`max-w-full truncate font-normal ${u[R]}`,children:D}):null,T]}):null]});return t("div",{ref:C,className:c("inline-flex max-w-full flex-col overflow-hidden align-middle",N[R],"font-medium whitespace-nowrap select-none",a[R],_[H],w,v,f,(L?P:I)[J][K],O??""),style:{...r(A,F,H),...Q},...V,children:[t("div",{className:["flex shrink-0 items-center py-1",z[R],m[R],te?"ps-0":ne,d(S)?"pe-1":te?"pe-0":""].join(" "),children:[te?e("button",{type:"button",className:["relative flex min-w-0 flex-1 cursor-pointer items-center justify-center self-stretch",N[R],m[R],ne,p,"neba-glow",k[H],w,v].join(" "),onPointerMove:l(void 0,!0),"aria-expanded":ee?G:void 0,"aria-controls":ee?X:void 0,onClick:U,children:oe}):oe,d(S)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:S}):null]}),ee?e("div",{id:X,className:["overflow-hidden","[transition:height_var(--neba-duration)_var(--neba-ease)]","motion-reduce:[transition-duration:0ms]"].join(" "),style:{height:G?Y??"auto":0},inert:j(!G),children:e("div",{ref:W,className:`whitespace-normal ${ne} pb-2 ${b[R]}`,children:E})}):null]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Progress as s}from"@base-ui/react/progress";import{plateGapClasses as r,plateRadiusClasses as t,plateSizeClasses as n,progressAriaText as i,progressFraction as o,progressSlots as m,progressText as c}from"../../internal/progress.js";import{cx as u,metaTextClasses as f,stackGapClasses as d}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";export const ProgressBox=/*@__PURE__*/l.forwardRef(function ProgressBox(l,b){const{size:h="md",color:p="primary",count:g=4,value:v=null,min:y=0,max:j=100,label:w,showValue:N=!1,format:M,locale:V,className:k,style:z,...A}=x(l,["size","locale"]),B=o(v,y,j),P=null===B,R=void 0!==M,T=Number.isFinite(g)?Math.max(1,Math.floor(g)):1;return a(s.Root,{ref:b,value:P?null:v,min:y,max:j,format:M,locale:V,getAriaValueText:i(B,R),className:u("inline-flex flex-col",d[h],k??""),style:{...m(p),...z},...A,children:[w||N?a("div",{className:["flex items-baseline gap-2",w?"justify-between":"justify-end",f[h]].join(" "),children:[w?e(s.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:w}):null,N?e(s.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>c(B,e,R)}):null]}):null,e(s.Track,{className:`flex ${r[h]}`,children:Array.from({length:T},(a,l)=>e("span",{className:u("relative overflow-hidden bg-(--n-soft)","[box-shadow:var(--neba-plate-glass)]",n[h],t[h],P?"neba-plate-wave":""),style:P?{"--n-i":l}:void 0,children:P?null:e("span",{className:"absolute inset-y-0 start-0 bg-(--n-fill) [transition:width_var(--neba-duration-fill)_var(--neba-ease)]",style:{width:`${Math.min(100,Math.max(0,100*(B*T-l)))}%`}})},l))})]})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Progress as s}from"@base-ui/react/progress";import{plateGapClasses as r,plateRadiusClasses as t,plateSizeClasses as n,progressAriaText as i,progressFraction as o,progressSlots as m,progressText as c}from"../../internal/progress.js";import{cx as f,metaTextClasses as u,stackGapClasses as d}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";import{useIntlLocale as b}from"../../internal/media.js";export const ProgressBox=/*@__PURE__*/l.forwardRef(function ProgressBox(l,h){const{size:p="md",color:g="primary",count:v=4,value:j=null,min:y=0,max:w=100,label:N,showValue:M=!1,format:V,locale:k,className:z,style:A,...B}=x(l,["size","locale"]),P=b(k),R=o(j,y,w),T=null===R,$=void 0!==V,_=Number.isFinite(v)?Math.max(1,Math.floor(v)):1;return a(s.Root,{ref:h,value:T?null:j,min:y,max:w,format:V,locale:P,getAriaValueText:i(R,$),className:f("inline-flex flex-col",d[p],z??""),style:{...m(g),...A},...B,children:[N||M?a("div",{className:["flex items-baseline gap-2",N?"justify-between":"justify-end",u[p]].join(" "),children:[N?e(s.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:N}):null,M?e(s.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>c(R,e,$)}):null]}):null,e(s.Track,{className:`flex ${r[p]}`,children:Array.from({length:_},(a,l)=>e("span",{className:f("relative overflow-hidden bg-(--n-soft)","[box-shadow:var(--neba-plate-glass)]",n[p],t[p],T?"neba-plate-wave":""),style:T?{"--n-i":l}:void 0,children:T?null:e("span",{className:"absolute inset-y-0 start-0 bg-(--n-fill) [transition:width_var(--neba-duration-fill)_var(--neba-ease)]",style:{width:`${Math.min(100,Math.max(0,100*(R*_-l)))}%`}})},l))})]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{Progress as s}from"@base-ui/react/progress";import{progressAriaText as t,progressFraction as l,progressSlots as n,progressText as i,ringDiameters as o,ringStrokes as c}from"../../internal/progress.js";import{cx as m,gapClasses as u,metaTextClasses as f}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";export const ProgressCircular=/*@__PURE__*/a.forwardRef(function ProgressCircular(a,d){const{size:x="md",color:k="primary",value:p=null,min:g=0,max:b=100,label:v,showValue:y=!1,format:$,locale:j,thickness:N,className:w,style:M,...P}=h(a,["size","locale"]),V=l(p,g,b),z=null===V,C=void 0!==$,D=o[x],L=D/2,R=Math.min(Math.max(N??c[x],.5),L/2),W=L-R/2,_=2*Math.PI*W,A=z?`${.28*_} ${_}`:`${_}`,B=z?0:_*(1-V);return r(s.Root,{ref:d,value:z?null:p,min:g,max:b,format:$,locale:j,getAriaValueText:t(V,C),className:m("inline-flex items-center",u[x],f[x],w??""),style:{...n(k),...M},...P,children:[r("svg",{className:z?"neba-ring-spin shrink-0":"shrink-0",width:D,height:D,viewBox:`0 0 ${D} ${D}`,fill:"none","aria-hidden":"true",children:[e("circle",{cx:L,cy:L,r:W,stroke:"var(--n-soft)",strokeWidth:R}),e("circle",{cx:L,cy:L,r:W,stroke:"var(--n-accent)",strokeWidth:R,strokeLinecap:"round",strokeDasharray:A,strokeDashoffset:B,transform:`rotate(-90 ${L} ${L})`,className:"[transition:stroke-dashoffset_var(--neba-duration-fill)_var(--neba-ease)]"})]}),v?e(s.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:v}):null,y?e(s.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>i(V,e,C)}):null]})});
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{Progress as s}from"@base-ui/react/progress";import{progressAriaText as t,progressFraction as n,progressSlots as i,progressText as l,ringDiameters as o,ringStrokes as c}from"../../internal/progress.js";import{cx as m,gapClasses as f,metaTextClasses as u}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";import{useIntlLocale as d}from"../../internal/media.js";export const ProgressCircular=/*@__PURE__*/a.forwardRef(function ProgressCircular(a,x){const{size:p="md",color:k="primary",value:g=null,min:b=0,max:v=100,label:j,showValue:y=!1,format:$,locale:N,thickness:w,className:M,style:P,...V}=h(a,["size","locale"]),z=d(N),C=n(g,b,v),D=null===C,L=void 0!==$,R=o[p],W=R/2,_=Math.min(Math.max(w??c[p],.5),W/2),A=W-_/2,B=2*Math.PI*A,I=D?`${.28*B} ${B}`:`${B}`,T=D?0:B*(1-C);return r(s.Root,{ref:x,value:D?null:g,min:b,max:v,format:$,locale:z,getAriaValueText:t(C,L),className:m("inline-flex items-center",f[p],u[p],M??""),style:{...i(k),...P},...V,children:[r("svg",{className:D?"neba-ring-spin shrink-0":"shrink-0",width:R,height:R,viewBox:`0 0 ${R} ${R}`,fill:"none","aria-hidden":"true",children:[e("circle",{cx:W,cy:W,r:A,stroke:"var(--n-soft)",strokeWidth:_}),e("circle",{cx:W,cy:W,r:A,stroke:"var(--n-accent)",strokeWidth:_,strokeLinecap:"round",strokeDasharray:I,strokeDashoffset:T,transform:`rotate(-90 ${W} ${W})`,className:"[transition:stroke-dashoffset_var(--neba-duration-fill)_var(--neba-ease)]"})]}),j?e(s.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:j}):null,y?e(s.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>l(C,e,L)}):null]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{Progress as r}from"@base-ui/react/progress";import{barThicknessClasses as s,progressAriaText as n,progressFraction as t,progressSlots as i,progressText as o}from"../../internal/progress.js";import{cx as m,metaTextClasses as u,stackGapClasses as c}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";export const ProgressLinear=/*@__PURE__*/a.forwardRef(function ProgressLinear(a,d){const{size:b="md",color:p="primary",value:g=null,min:x=0,max:h=100,label:j,showValue:v=!1,format:w,locale:y,thickness:N,className:k,style:L,...V}=f(a,["size","locale"]),z=t(g,x,h),P=null===z,R=void 0!==w;return l(r.Root,{ref:d,value:P?null:g,min:x,max:h,format:w,locale:y,getAriaValueText:n(z,R),className:m("flex w-full flex-col",c[b],k??""),style:{...i(p),...L},...V,children:[j||v?l("div",{className:["flex items-baseline gap-2",j?"justify-between":"justify-end",u[b]].join(" "),children:[j?e(r.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:j}):null,v?e(r.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>o(z,e,R)}):null]}):null,e(r.Track,{className:`neba-progress-track relative w-full overflow-hidden rounded-full bg-(--n-soft) ${s[b]}`,style:void 0===N?void 0:{height:`${N}px`},children:e(r.Indicator,{className:["neba-progress-indicator absolute rounded-full bg-(--n-fill)",P?"neba-sweep":"top-0 [transition:width_var(--neba-duration-fill)_var(--neba-ease)]"].join(" ")})})]})});
1
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{Progress as r}from"@base-ui/react/progress";import{barThicknessClasses as s,progressAriaText as n,progressFraction as t,progressSlots as i,progressText as o}from"../../internal/progress.js";import{cx as m,metaTextClasses as u,stackGapClasses as c}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";import{useIntlLocale as d}from"../../internal/media.js";export const ProgressLinear=/*@__PURE__*/a.forwardRef(function ProgressLinear(a,p){const{size:b="md",color:g="primary",value:x=null,min:h=0,max:j=100,label:v,showValue:w=!1,format:y,locale:N,thickness:k,className:L,style:V,...z}=f(a,["size","locale"]),P=d(N),R=t(x,h,j),T=null===R,$=void 0!==y;return l(r.Root,{ref:p,value:T?null:x,min:h,max:j,format:y,locale:P,getAriaValueText:n(R,$),className:m("flex w-full flex-col",c[b],L??""),style:{...i(g),...V},...z,children:[v||w?l("div",{className:["flex items-baseline gap-2",v?"justify-between":"justify-end",u[b]].join(" "),children:[v?e(r.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:v}):null,w?e(r.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>o(R,e,$)}):null]}):null,e(r.Track,{className:`neba-progress-track relative w-full overflow-hidden rounded-full bg-(--n-soft) ${s[b]}`,style:void 0===k?void 0:{height:`${k}px`},children:e(r.Indicator,{className:["neba-progress-indicator absolute rounded-full bg-(--n-fill)",T?"neba-sweep":"top-0 [transition:width_var(--neba-duration-fill)_var(--neba-ease)]"].join(" ")})})]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{IconButton as r}from"../icon-button/IconButton.js";import{useDropZone as l}from"../../internal/drop.js";import{fieldLight as o,fieldSpotlightSlot as i,glowClasses as a}from"../../internal/glow.js";import{matchesShortcut as s}from"../../internal/keys.js";import{observeResize as c}from"../../internal/observe.js";import{promptMessages as m,useMessages as d}from"../../internal/i18n.js";import{controlTextLeadingClasses as u,cx as f,disabledClasses as p,fieldFocusTransitionClasses as h,fieldReadOnlyClasses as g,fieldRestClasses as x,fieldRingClasses as v,hasContent as b,iconClasses as w,metaTextClasses as y,paddingXClasses as $,radiusClasses as j,srOnlyClasses as N,surfaceSlots as k,transitionClasses as I}from"../../internal/styles.js";import{useStyleDefaults as S}from"../../internal/defaults.js";import{useFieldsetDisabled as C}from"../../internal/fieldset.js";function SendIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M8 13V3.5m0 0L3.75 7.75M8 3.5l4.25 4.25",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function StopIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1.5"})})}const D={xs:`${j.sm} ${u.xs}`,sm:`${j.md} ${u.sm}`,md:`${j.lg} ${u.md}`,lg:`${j.xl} ${u.lg}`,xl:`${j.xl} ${u.xl}`},E={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"};export const PromptInput=/*@__PURE__*/n.forwardRef(function PromptInput(u,j){const{variant:F="outline",size:z="md",color:K="primary",density:L="default",elevation:M=0,value:P,defaultValue:R="",onValueChange:V,onSubmit:W,submitting:A=!1,onStop:B,submitKey:H="Enter",onFiles:O,label:q,minRows:T=1,maxRows:G=8,start:J,end:Q,locale:U,labels:X,classNames:Y,id:Z,disabled:_,readOnly:ee=!1,onKeyDown:te,className:ne,style:re,children:le,...oe}=S(u,["size","density","variant","locale"]),ie=C(_),ae=!ie&&!ee,se={...d(m,U),...X},[ce,me]=n.useState(R),de=void 0!==P,ue=de?P:ce,{over:fe,handlers:pe}=l(ae?O:void 0),he=n.useId(),ge=Z??he,xe=n.useRef(null),ve=n.useCallback(e=>{xe.current=e,"function"==typeof j?j(e):j&&(j.current=e)},[j]),be=n.useCallback(()=>{const e=xe.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},[]);n.useLayoutEffect(be,[be,ue,T,G]),n.useEffect(()=>{const e=xe.current;if(!e)return;let t=e.clientWidth,n=0;const r=c(e,()=>{e.clientWidth!==t&&(t=e.clientWidth,cancelAnimationFrame(n),n=requestAnimationFrame(be))});return()=>{r(),cancelAnimationFrame(n)}},[be]);const we=()=>{!ue.trim()||ie||ee||A||W?.(ue)},ye=ue.trim().length>0&&!ie&&!ee;return t("form",{onSubmit:e=>{e.preventDefault(),A?B?.():we()},className:f("flex w-full flex-col",ne??""),style:{...k(K,M),...ae?i:void 0,...re},children:[b(q)?e("label",{htmlFor:ge,className:N,children:q}):null,t("div",{"data-dropping":fe||void 0,...pe,...o(ae),onPointerDown:e=>{e.target!==e.currentTarget||ie||(e.preventDefault(),xe.current?.focus())},className:f("relative flex w-full flex-col py-2","[-webkit-tap-highlight-color:transparent]",D[z],E[z],$[L][z],I,h,v,w,ie?p[F]:ee?g[F]:`${x[F]} ${a}`,fe?"[border-color:var(--n-ring)] bg-(--n-soft)":"",Y?.shell??""),children:[le,e("textarea",{ref:ve,id:ge,rows:T,value:ue,disabled:ie,readOnly:ee,onChange:e=>{de||me(e.target.value),V?.(e.target.value)},className:f("neba-input block w-full resize-none bg-transparent [font:inherit] text-inherit","[outline:none]","min-h-(--n-min-rows) max-h-(--n-max-rows) overflow-y-auto","placeholder:text-(--neba-muted-fg)","caret-(--n-accent) selection:bg-(--n-soft-press)","disabled:cursor-not-allowed",Y?.control??""),style:{"--n-min-rows":`calc(${Math.max(T,1)} * 1lh)`,"--n-max-rows":`calc(${Math.max(G,T,1)} * 1lh)`},enterKeyHint:"Enter"===H?"send":void 0,...oe,onKeyDown:e=>{te?.(e),e.defaultPrevented||!e.nativeEvent.isComposing&&s(e,H)&&(e.preventDefault(),we())}}),t("div",{className:f("flex min-w-0 items-center gap-2",y[z],Y?.toolbar??""),children:[b(J)?e("div",{className:"flex min-w-0 items-center gap-1",children:J}):null,t("div",{className:"ms-auto flex shrink-0 items-center gap-2",children:[b(Q)?e("div",{className:"flex items-center gap-1",children:Q}):null,e(r,{type:"submit",formNoValidate:A||void 0,size:z,color:K,icon:e(A?StopIcon:SendIcon,{}),label:A?se.stop:se.send,disabled:!A&&!ye,className:Y?.send})]})]}),fe?e("div",{"aria-hidden":"true",className:f("pointer-events-none absolute inset-0 flex items-center justify-center","font-medium text-(--n-accent)",D[z]),children:se.drop}):null]})]})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{useLayoutEffectOnClient as r}from"../../internal/layout-effect.js";import{IconButton as l}from"../icon-button/IconButton.js";import{useDropZone as o}from"../../internal/drop.js";import{fieldLight as i,fieldSpotlightSlot as a,glowClasses as s}from"../../internal/glow.js";import{matchesShortcut as c}from"../../internal/keys.js";import{observeResize as m}from"../../internal/observe.js";import{promptMessages as d,useMessages as u}from"../../internal/i18n.js";import{controlTextLeadingClasses as f,cx as p,disabledClasses as h,fieldFocusTransitionClasses as g,fieldReadOnlyClasses as x,fieldRestClasses as v,fieldRingClasses as b,hasContent as w,iconClasses as y,metaTextClasses as j,paddingXClasses as $,radiusClasses as N,srOnlyClasses as k,surfaceSlots as I,transitionClasses as S}from"../../internal/styles.js";import{useStyleDefaults as C}from"../../internal/defaults.js";import{useFieldsetDisabled as D}from"../../internal/fieldset.js";function SendIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M8 13V3.5m0 0L3.75 7.75M8 3.5l4.25 4.25",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function StopIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1.5"})})}const F={xs:`${N.sm} ${f.xs}`,sm:`${N.md} ${f.sm}`,md:`${N.lg} ${f.md}`,lg:`${N.xl} ${f.lg}`,xl:`${N.xl} ${f.xl}`},z={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"};export const PromptInput=/*@__PURE__*/n.forwardRef(function PromptInput(f,N){const{variant:E="outline",size:K="md",color:M="primary",density:P="default",elevation:R=0,value:V,defaultValue:W="",onValueChange:A,onSubmit:B,submitting:L=!1,onStop:H,submitKey:O="Enter",onFiles:q,label:T,minRows:G=1,maxRows:J=8,start:Q,end:U,locale:X,labels:Y,classNames:Z,id:_,disabled:ee,readOnly:te=!1,onKeyDown:ne,className:re,style:le,children:oe,...ie}=C(f,["size","density","variant","locale"]),ae=D(ee),se=!ae&&!te,ce={...u(d,X),...Y},[me,de]=n.useState(W),ue=void 0!==V,fe=ue?V:me,{over:pe,handlers:he}=o(se?q:void 0),ge=n.useId(),xe=_??ge,ve=n.useRef(null),be=n.useCallback(e=>{ve.current=e,"function"==typeof N?N(e):N&&(N.current=e)},[N]),we=n.useCallback(()=>{const e=ve.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},[]);r(we,[we,fe,G,J]),n.useEffect(()=>{const e=ve.current;if(!e)return;let t=e.clientWidth,n=0;const r=m(e,()=>{e.clientWidth!==t&&(t=e.clientWidth,cancelAnimationFrame(n),n=requestAnimationFrame(we))});return()=>{r(),cancelAnimationFrame(n)}},[we]);const ye=()=>{!fe.trim()||ae||te||L||B?.(fe)},je=fe.trim().length>0&&!ae&&!te;return t("form",{onSubmit:e=>{e.preventDefault(),L?H?.():ye()},className:p("flex w-full flex-col",re??""),style:{...I(M,R),...se?a:void 0,...le},children:[w(T)?e("label",{htmlFor:xe,className:k,children:T}):null,t("div",{"data-dropping":pe||void 0,...he,...i(se),onPointerDown:e=>{e.target!==e.currentTarget||ae||(e.preventDefault(),ve.current?.focus())},className:p("relative flex w-full flex-col py-2","[-webkit-tap-highlight-color:transparent]",F[K],z[K],$[P][K],S,g,b,y,ae?h[E]:te?x[E]:`${v[E]} ${s}`,pe?"[border-color:var(--n-ring)] bg-(--n-soft)":"",Z?.shell??""),children:[oe,e("textarea",{ref:be,id:xe,rows:G,value:fe,disabled:ae,readOnly:te,onChange:e=>{ue||de(e.target.value),A?.(e.target.value)},className:p("neba-input block w-full resize-none bg-transparent [font:inherit] text-inherit","[outline:none]","min-h-(--n-min-rows) max-h-(--n-max-rows) overflow-y-auto","placeholder:text-(--neba-muted-fg)","caret-(--n-accent) selection:bg-(--n-soft-press)","disabled:cursor-not-allowed",Z?.control??""),style:{"--n-min-rows":`calc(${Math.max(G,1)} * 1lh)`,"--n-max-rows":`calc(${Math.max(J,G,1)} * 1lh)`},enterKeyHint:"Enter"===O?"send":void 0,...ie,onKeyDown:e=>{ne?.(e),e.defaultPrevented||!e.nativeEvent.isComposing&&c(e,O)&&(e.preventDefault(),ye())}}),t("div",{className:p("flex min-w-0 items-center gap-2",j[K],Z?.toolbar??""),children:[w(Q)?e("div",{className:"flex min-w-0 items-center gap-1",children:Q}):null,t("div",{className:"ms-auto flex shrink-0 items-center gap-2",children:[w(U)?e("div",{className:"flex items-center gap-1",children:U}):null,e(l,{type:"submit",formNoValidate:L||void 0,size:K,color:M,icon:e(L?StopIcon:SendIcon,{}),label:L?ce.stop:ce.send,disabled:!L&&!je,className:Z?.send})]})]}),pe?e("div",{"aria-hidden":"true",className:p("pointer-events-none absolute inset-0 flex items-center justify-center","font-medium text-(--n-accent)",F[K]),children:ce.drop}):null]})]})});
@@ -19,8 +19,9 @@ export interface NebaProviderProps {
19
19
  /**
20
20
  * Prop values every component under it starts from.
21
21
  *
22
- * `size`, `density`, `variant`, `locale` and `labelPlacement` — the axes whose
23
- * right value is a property of the product rather than of the control. A call site still wins:
22
+ * `size`, `density`, `variant`, `locale`, `labelPlacement` and `spacing` — the
23
+ * axes whose right value is a property of the product rather than of the
24
+ * control. A call site still wins:
24
25
  * the order is the caller, then this, then the component's own default.
25
26
  */
26
27
  defaults?: NebaDefaults;
@@ -49,26 +50,6 @@ export interface NebaProviderProps {
49
50
  */
50
51
  direction?: NebaDirection;
51
52
  }
52
- /**
53
- * The script to run before the first paint, so a remembered dark page does not
54
- * flash white on the way in.
55
- *
56
- * The one thing a provider cannot do for you: React runs after the document has
57
- * been painted once, and by then the flash has happened. Inline the string this
58
- * returns in `<head>`, above everything:
59
- *
60
- * ```tsx
61
- * <script dangerouslySetInnerHTML={{ __html: colorSchemeScript() }} />
62
- * ```
63
- *
64
- * It reads the same key and writes the same attribute and `color-scheme` the
65
- * provider does, so the two cannot disagree — which is the reason it is here
66
- * rather than in a documentation snippet somebody copies once and never updates.
67
- */
68
- export declare function colorSchemeScript(options?: {
69
- storageKey?: string;
70
- defaultColorScheme?: NebaColorScheme;
71
- }): string;
72
53
  /**
73
54
  * One place to set what every Neba component under it starts from.
74
55
  *
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{DirectionProvider as r,useDirection as o}from"@base-ui/react/direction-provider";import{DefaultsContext as l}from"../../internal/defaults.js";import{useHydrated as n,useMediaQuery as c}from"../../internal/media.js";const a=/*@__PURE__*/t.createContext(null);export function colorSchemeScript(e={}){const t=e.storageKey??"neba-color-scheme",r=e.defaultColorScheme??"system";return`(function(){try{var s=localStorage.getItem(${s(t)})||${s(r)};if(s==='system'){s=matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}var d=document.documentElement;d.setAttribute('data-theme',s);d.style.colorScheme=s}catch(e){}})()`}function s(e){return JSON.stringify(e).replace(/</g,"\\u003c")}export function NebaProvider({children:s,defaults:i,colorScheme:m,defaultColorScheme:u="system",onColorSchemeChange:d,storageKey:h="neba-color-scheme",colorSchemeElement:f,direction:S}){const g=n(),y=t.useContext(l),v=t.useContext(a),b=o(),[p,C]=t.useState(null),x=t.useMemo(()=>g?function(e){if(!1===e||"undefined"==typeof localStorage)return null;try{const t=localStorage.getItem(e);return"light"===t||"dark"===t||"system"===t?t:null}catch{return null}}(h):null,[g,h]),k=m??p??x??u,E=c("(prefers-color-scheme: dark)"),P="system"===k?E?"dark":"light":k,j=t.useCallback(e=>{if(void 0===m&&C(e),!1!==h)try{localStorage.setItem(h,e)}catch{}d?.(e)},[m,h,d]);t.useEffect(()=>{if(!g)return;const e=f?f():null===v?document.documentElement:null;e&&(e.setAttribute("data-theme",P),e.style.colorScheme=P)},[g,P,f,v]),t.useEffect(()=>{S&&document.documentElement.setAttribute("dir",S)},[S]);const M=t.useMemo(()=>({colorScheme:k,resolvedColorScheme:P,setColorScheme:j,toggleColorScheme:()=>j("dark"===P?"light":"dark")}),[k,P,j]),z=i?.size??y?.size,A=i?.density??y?.density,I=i?.variant??y?.variant,N=i?.locale??y?.locale,w=i?.labelPlacement??y?.labelPlacement,K=null!=i||null!==y,$=t.useMemo(()=>K?{size:z,density:A,variant:I,locale:N,labelPlacement:w}:null,[K,z,A,I,N,w]);return e(l.Provider,{value:$,children:e(a.Provider,{value:M,children:e(r,{direction:S??b,children:s})})})}export function useColorScheme(){const e=t.useContext(a);if(!e)throw new Error("neba: useColorScheme() needs a <NebaProvider> above it.");return e}
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{DirectionProvider as r,useDirection as o}from"@base-ui/react/direction-provider";import{DefaultsContext as n}from"../../internal/defaults.js";import{useHydrated as l,useMediaQuery as c}from"../../internal/media.js";import{DEFAULT_STORAGE_KEY as i}from"./colorSchemeScript.js";const s=/*@__PURE__*/t.createContext(null);export function NebaProvider({children:a,defaults:u,colorScheme:m,defaultColorScheme:d="system",onColorSchemeChange:h,storageKey:f=i,colorSchemeElement:p,direction:S}){const v=l(),g=t.useContext(n),b=t.useContext(s),y=o(),[C,E]=t.useState(null),P=t.useMemo(()=>v?function(e){if(!1===e||"undefined"==typeof localStorage)return null;try{const t=localStorage.getItem(e);return"light"===t||"dark"===t||"system"===t?t:null}catch{return null}}(f):null,[v,f]),x=m??C??P??d,k=c("(prefers-color-scheme: dark)"),w="system"===x?k?"dark":"light":x,N=t.useCallback(e=>{if(void 0===m&&E(e),!1!==f)try{localStorage.setItem(f,e)}catch{}h?.(e)},[m,f,h]);t.useEffect(()=>{if(!v)return;const e=p?p():null===b?document.documentElement:null;e&&(e.setAttribute("data-theme",w),e.style.colorScheme=w)},[v,w,p,b]);const j=t.useRef(!1);t.useEffect(()=>{const e=!j.current;if(j.current=!0,!S)return;const t=document.documentElement.dir;"production"!==process.env.NODE_ENV&&e&&(t||"ltr")!==S&&console.warn(`Neba: a NebaProvider has direction="${S}", and <html> ${t?`has dir="${t}"`:"has no dir"}. The provider sets dir only once it has mounted, so the page is drawn the other way round until then and mirrors when it does. Put dir="${S}" on <html> in the HTML itself.`),document.documentElement.setAttribute("dir",S)},[S]);const M=t.useMemo(()=>({colorScheme:x,resolvedColorScheme:w,setColorScheme:N,toggleColorScheme:()=>N("dark"===w?"light":"dark")}),[x,w,N]),$=u?.size??g?.size,z=u?.density??g?.density,A=u?.variant??g?.variant,I=u?.locale??g?.locale,T=u?.labelPlacement??g?.labelPlacement,D=u?.spacing??g?.spacing,H=null!=u||null!==g,K=t.useMemo(()=>H?{size:$,density:z,variant:A,locale:I,labelPlacement:T,spacing:D}:null,[H,$,z,A,I,T,D]);return e(n.Provider,{value:K,children:e(s.Provider,{value:M,children:e(r,{direction:S??y,children:a})})})}export function useColorScheme(){const e=t.useContext(s);if(!e)throw new Error("neba: useColorScheme() needs a <NebaProvider> above it.");return e}
@@ -0,0 +1,23 @@
1
+ import type { NebaColorScheme } from './NebaProvider.js';
2
+ /** Where the provider and the script below remember the reader's choice. */
3
+ export declare const DEFAULT_STORAGE_KEY = "neba-color-scheme";
4
+ /**
5
+ * The script to run before the first paint, so a remembered dark page does not
6
+ * flash white on the way in.
7
+ *
8
+ * The one thing a provider cannot do for you: React runs after the document has
9
+ * been painted once, and by then the flash has happened. Inline the string this
10
+ * returns in `<head>`, above everything:
11
+ *
12
+ * ```tsx
13
+ * <script dangerouslySetInnerHTML={{ __html: colorSchemeScript() }} />
14
+ * ```
15
+ *
16
+ * It reads the same key and writes the same attribute and `color-scheme` the
17
+ * provider does, so the two cannot disagree — which is the reason it is here
18
+ * rather than in a documentation snippet somebody copies once and never updates.
19
+ */
20
+ export declare function colorSchemeScript(options?: {
21
+ storageKey?: string;
22
+ defaultColorScheme?: NebaColorScheme;
23
+ }): string;
@@ -0,0 +1 @@
1
+ export const DEFAULT_STORAGE_KEY="neba-color-scheme";export function colorSchemeScript(t={}){const c=t.storageKey??"neba-color-scheme",r=t.defaultColorScheme??"system";return`(function(){try{var s=localStorage.getItem(${e(c)})||${e(r)};if(s==='system'){s=matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}var d=document.documentElement;d.setAttribute('data-theme',s);d.style.colorScheme=s}catch(e){}})()`}function e(e){return JSON.stringify(e).replace(/</g,"\\u003c")}
@@ -1,3 +1,4 @@
1
- export { colorSchemeScript, NebaProvider, useColorScheme } from './NebaProvider.js';
1
+ export { colorSchemeScript } from './colorSchemeScript.js';
2
+ export { NebaProvider, useColorScheme } from './NebaProvider.js';
2
3
  export type { ColorSchemeState, NebaColorScheme, NebaDirection, NebaProviderProps } from './NebaProvider.js';
3
4
  export type { NebaDefaults } from '../../internal/defaults.js';
@@ -1 +1 @@
1
- export{colorSchemeScript,NebaProvider,useColorScheme}from"./NebaProvider.js";
1
+ export{colorSchemeScript}from"./colorSchemeScript.js";export{NebaProvider,useColorScheme}from"./NebaProvider.js";
@@ -25,6 +25,19 @@ export interface RadioGroupProps extends Omit<React.ComponentPropsWithoutRef<typ
25
25
  * @default 'vertical'
26
26
  */
27
27
  orientation?: NebaOrientation;
28
+ /**
29
+ * The gap between the options, on Tailwind's spacing scale: `3` is
30
+ * `0.75rem`, the same step `gap-3` is. One length on both axes, so a
31
+ * horizontal group that wraps puts its lines as far apart as its options.
32
+ * Left out, a column follows `size` on the ladder a Form stands its fields
33
+ * on, `3` at `md`, and a row keeps `5` along it with the column's step
34
+ * between its lines.
35
+ *
36
+ * Not read from a `NebaProvider`: the provider's `spacing` is the gap between
37
+ * fields, and a product that spreads its fields apart should not spread every
38
+ * set of options with them.
39
+ */
40
+ spacing?: number;
28
41
  /** The question the options answer. Rendered as the group's legend. */
29
42
  label?: React.ReactNode;
30
43
  /** Helper text under the label. */
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{Field as i}from"@base-ui/react/field";import{controlTextClasses as o,cx as t,hitAreaClasses as s,metaTextClasses as d,surfaceClasses as c,tickDotClasses as b,tickRowLeadingClasses as f,tickSizeClasses as m,transitionClasses as h}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";import{useFieldsetDisabled as u}from"../../internal/fieldset.js";const v=/*@__PURE__*/r.createContext({size:"md",color:"primary",readOnly:!1,disabled:!1}),g=["relative inline-flex shrink-0 items-center justify-center rounded-full border",s,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",h,"active:[transition-duration:0ms]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),x=[c,"cursor-pointer bg-(--n-panel) [border-color:var(--n-line)]","hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)"].join(" "),N=[c,"cursor-default bg-(--n-panel) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]"].join(" "),y=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)] shadow-none","data-[checked]:bg-(--neba-disabled-bg)"].join(" "),j=["neba-radio-dot rounded-full bg-current","[transition:width_var(--neba-duration)_var(--neba-ease),height_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:size-0 data-[ending-style]:size-0"].join(" ");export const Radio=/*@__PURE__*/r.forwardRef(function Radio({label:l,description:s,disabled:c,className:h,classNames:p,style:u,...k},z){const R=r.useContext(v),w=k.readOnly??R.readOnly,$=c??R.disabled;return e(i.Root,{disabled:$,className:t("flex flex-col",h??""),style:u,children:a("div",{className:`flex items-start gap-2 ${o[R.size]} ${f}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(n.Root,{ref:z,className:t(g,m[R.size],$?y:w?N:x,p?.control),disabled:$,...k,children:e(n.Indicator,{className:t(j,b[R.size],p?.indicator)})})}),l||s?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[l?e(i.Label,{className:t("leading-[1.4]",$?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",p?.label),children:l}):null,s?e(i.Description,{className:t(d[R.size],"text-(--neba-muted-fg)",p?.description),children:s}):null]}):null]})})});export const RadioGroup=/*@__PURE__*/r.forwardRef(function RadioGroup(n,o){const{size:s="md",color:c="primary",orientation:b="vertical",label:f,description:m,error:h,invalid:g,disabled:x,readOnly:N=!1,className:y,classNames:j,style:k,children:z,...R}=p(n,["size"]),w=u(x),$=null!=h&&!1!==h&&""!==h,O=g??$,_=O?"danger":c,G={"--n-fill":`var(--neba-${_}-fill)`,"--n-fill-hover":`var(--neba-${_}-fill-hover)`,"--n-on-solid":`var(--neba-${_}-on-solid)`,"--n-accent":`var(--neba-${_}-accent)`,"--n-panel":"var(--neba-panel)","--n-panel-hover":"var(--neba-panel-hover)","--n-line":`var(--neba-${_}-line)`,"--n-line-hover":`var(--neba-${_}-line-hover)`,"--n-ring":`var(--neba-${_}-ring)`},C=r.useMemo(()=>({size:s,color:_,readOnly:N,disabled:w}),[s,_,N,w]);return e(v.Provider,{value:C,children:a(i.Root,{disabled:w,invalid:O,className:t("flex flex-col gap-1.5",y??""),style:{...G,...k},children:[f?e(i.Label,{className:t(d[s],"font-medium",w?"text-(--neba-disabled-fg)":"text-(--neba-fg)",j?.label),children:f}):null,m?e(i.Description,{className:t(d[s],"text-(--neba-muted-fg)",j?.description),children:m}):null,e(l,{ref:o,disabled:w,readOnly:N,className:t("flex","horizontal"===b?"flex-row flex-wrap gap-x-5 gap-y-2":"flex-col gap-2",j?.control),...R,children:z}),e(i.Error,$?{match:!0,className:t(d[s],"text-(--n-accent)",j?.error),children:h}:{className:t(d[s],"text-(--n-accent)",j?.error)})]})})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{Field as i}from"@base-ui/react/field";import{controlTextClasses as o,cx as t,hitAreaClasses as s,metaTextClasses as d,optionGapClasses as c,surfaceClasses as b,tickDotClasses as f,tickRowLeadingClasses as m,tickSizeClasses as h,transitionClasses as p}from"../../internal/styles.js";import{spacingValue as u}from"../../internal/grid.js";import{useStyleDefaults as v}from"../../internal/defaults.js";import{useFieldsetDisabled as g}from"../../internal/fieldset.js";const x=/*@__PURE__*/r.createContext({size:"md",color:"primary",readOnly:!1,disabled:!1}),N=["relative inline-flex shrink-0 items-center justify-center rounded-full border",s,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",p,"active:[transition-duration:0ms]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),y=[b,"cursor-pointer bg-(--n-panel) [border-color:var(--n-line)]","hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)"].join(" "),j=[b,"cursor-default bg-(--n-panel) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]"].join(" "),k=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)] shadow-none","data-[checked]:bg-(--neba-disabled-bg)"].join(" "),z=["neba-radio-dot rounded-full bg-current","[transition:width_var(--neba-duration)_var(--neba-ease),height_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:size-0 data-[ending-style]:size-0"].join(" ");export const Radio=/*@__PURE__*/r.forwardRef(function Radio({label:l,description:s,disabled:c,className:b,classNames:p,style:u,...v},g){const R=r.useContext(x),w=v.readOnly??R.readOnly,$=c??R.disabled;return e(i.Root,{disabled:$,className:t("flex flex-col",b??""),style:u,children:a("div",{className:`flex items-start gap-2 ${o[R.size]} ${m}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(n.Root,{ref:g,className:t(N,h[R.size],$?k:w?j:y,p?.control),disabled:$,...v,children:e(n.Indicator,{className:t(z,f[R.size],p?.indicator)})})}),l||s?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[l?e(i.Label,{className:t("leading-[1.4]",$?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",p?.label),children:l}):null,s?e(i.Description,{className:t(d[R.size],"text-(--neba-muted-fg)",p?.description),children:s}):null]}):null]})})});export const RadioGroup=/*@__PURE__*/r.forwardRef(function RadioGroup(n,o){const{size:s="md",color:b="primary",orientation:f="vertical",spacing:m,label:h,description:p,error:N,invalid:y,disabled:j,readOnly:k=!1,className:z,classNames:R,style:w,children:$,...O}=v(n,["size"]),_=g(j),G=null!=N&&!1!==N&&""!==N,C=y??G,D=C?"danger":b,L={"--n-fill":`var(--neba-${D}-fill)`,"--n-fill-hover":`var(--neba-${D}-fill-hover)`,"--n-on-solid":`var(--neba-${D}-on-solid)`,"--n-accent":`var(--neba-${D}-accent)`,"--n-panel":"var(--neba-panel)","--n-panel-hover":"var(--neba-panel-hover)","--n-line":`var(--neba-${D}-line)`,"--n-line-hover":`var(--neba-${D}-line-hover)`,"--n-ring":`var(--neba-${D}-ring)`},E=r.useMemo(()=>({size:s,color:D,readOnly:k,disabled:_}),[s,D,k,_]);return e(x.Provider,{value:E,children:a(i.Root,{disabled:_,invalid:C,className:t("flex flex-col gap-1.5",z??""),style:{...L,...w},children:[h?e(i.Label,{className:t(d[s],"font-medium",_?"text-(--neba-disabled-fg)":"text-(--neba-fg)",R?.label),children:h}):null,p?e(i.Description,{className:t(d[s],"text-(--neba-muted-fg)",R?.description),children:p}):null,e(l,{ref:o,disabled:_,readOnly:k,className:t("flex","horizontal"===f?"flex-row flex-wrap":"flex-col",void 0===m?c[f][s]:"",R?.control),style:void 0===m?void 0:{gap:u(m)},...O,children:$}),e(i.Error,G?{match:!0,className:t(d[s],"text-(--n-accent)",R?.error),children:N}:{className:t(d[s],"text-(--n-accent)",R?.error)})]})})});
@@ -42,6 +42,27 @@ export interface ReasoningProps extends Pick<NebaStyleProps, 'size' | 'variant'
42
42
  * @default true
43
43
  */
44
44
  autoOpen?: boolean;
45
+ /**
46
+ * Whether `autoOpen` also closes the panel when the stream ends.
47
+ *
48
+ * Turn it off to leave the thinking open once it has arrived. A panel that
49
+ * folds itself away moves everything under it up the page with nobody having
50
+ * pressed anything, and where the answer is already being read below it, that
51
+ * jump is worse than the space the thinking takes. Only read while `autoOpen`
52
+ * is on: with it off, the stream moves nothing in either direction.
53
+ * @default true
54
+ */
55
+ autoClose?: boolean;
56
+ /**
57
+ * Keeps a closed panel in the DOM, hidden until the browser's own page search
58
+ * finds something in it and opens it.
59
+ *
60
+ * On by default, as on a [Collapsible](../surfaces/collapsible): a panel that
61
+ * is not in the markup is not in a server render either. Turn it off to leave
62
+ * a closed panel out of the DOM.
63
+ * @default true
64
+ */
65
+ hiddenUntilFound?: boolean;
45
66
  /** Replaces what the header says. Otherwise it is the `locale`'s sentence. */
46
67
  label?: React.ReactNode;
47
68
  /**
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as a from"react";import{Collapsible as t}from"@base-ui/react/collapsible";import{boxPaddingXClasses as o,boxPaddingYClasses as r}from"../box/Box.js";import{ChevronIcon as l,SpinnerIcon as s}from"../../internal/icons.js";import{formatDuration as i,useElapsed as c}from"../../internal/run.js";import{fillMessage as d,reasoningMessages as m,useMessages as f}from"../../internal/i18n.js";import{collapsiblePanelClasses as p,cx as u,gapClasses as b,hasContent as x,iconClasses as h,radiusClasses as v,sheetBodyClasses as g,sheetTitleClasses as j,surfaceClasses as N,surfaceSlots as y,transitionClasses as w,disclosureChevronClasses as O,disclosureTriggerClasses as R}from"../../internal/styles.js";import{useStyleDefaults as C}from"../../internal/defaults.js";const k={solid:[N,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[N,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};export const Reasoning=/*@__PURE__*/a.forwardRef(function Reasoning(N,z){const{variant:S="text",size:_="md",color:B="secondary",density:P="default",elevation:T=0,streaming:q=!1,duration:A,open:D,defaultOpen:E=!1,onOpenChange:F,autoOpen:G=!0,label:H,icon:I,locale:J,labels:K,classNames:L,className:M,style:Q,children:U,...V}=C(N,["size","density","variant","locale"]),W={...f(m,J),...K},[X,Y]=a.useState(E||G&&q),[Z,$]=a.useState(q),ee=void 0!==D,ne=ee?D:X;Z!==q&&($(q),G&&!ee&&Y(q));const ae=c(q,A),te=null===ae?null:i(ae,J),oe=x(H)?H:q?W.thinking:null===te?W.done:d(W.thought,{duration:te}),re=void 0===I?q?e(s,{}):null:I;return n(t.Root,{ref:z,open:ne,onOpenChange:e=>{ee||Y(e),F?.(e)},"aria-busy":q||void 0,"data-streaming":q||void 0,className:u("flex flex-col overflow-hidden",v[_],k[S],w,h,M??""),style:{...y(B,T),...Q},...V,children:[n(t.Trigger,{className:u("flex w-full cursor-pointer items-center text-start text-(--neba-muted-fg)",R,o[P][_],r[P][_],b[_],j[_],w,"hover:bg-(--n-soft) hover:text-(--n-on-tint)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",L?.header??""),children:[x(re)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:re}):null,e("span",{className:"min-w-0 flex-1 truncate font-medium",children:oe}),e("span",{className:O,children:e(l,{})})]}),e(t.Panel,{className:p,children:e("div",{className:u("min-w-0 border-s-2 text-(--neba-muted-fg) [border-color:var(--n-line)]",o[P][_],"compact"===P?"pb-2":"pb-4",g[_],L?.body??""),children:U})})]})});
1
+ "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{Collapsible as a}from"@base-ui/react/collapsible";import{boxPaddingXClasses as o,boxPaddingYClasses as l}from"../box/Box.js";import{ChevronIcon as r,SpinnerIcon as s}from"../../internal/icons.js";import{formatDuration as i,useElapsed as d}from"../../internal/run.js";import{fillMessage as c,reasoningMessages as m,useMessages as u}from"../../internal/i18n.js";import{collapsiblePanelClasses as f,cx as p,gapClasses as b,hasContent as h,iconClasses as x,radiusClasses as v,sheetBodyClasses as g,sheetTitleClasses as j,surfaceClasses as N,surfaceSlots as y,transitionClasses as w,disclosureChevronClasses as C,disclosureTriggerClasses as O}from"../../internal/styles.js";import{useStyleDefaults as R}from"../../internal/defaults.js";const k={solid:[N,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[N,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};export const Reasoning=/*@__PURE__*/t.forwardRef(function Reasoning(N,z){const{variant:F="text",size:S="md",color:U="secondary",density:_="default",elevation:B=0,streaming:P=!1,duration:T,open:q,defaultOpen:A=!1,onOpenChange:D,autoOpen:E=!0,autoClose:G=!0,hiddenUntilFound:H=!0,label:I,icon:J,locale:K,labels:L,classNames:M,className:Q,style:V,children:W,...X}=R(N,["size","density","variant","locale"]),Y={...u(m,K),...L},[Z,$]=t.useState(A||E&&P),[ee,ne]=t.useState(P),te=void 0!==q,ae=te?q:Z;ee!==P&&(ne(P),E&&!te&&(P||G)&&$(P));const oe=d(P,T),le=null===oe?null:i(oe,K),re=h(I)?I:P?Y.thinking:null===le?Y.done:c(Y.thought,{duration:le}),se=void 0===J?P?e(s,{}):null:J;return n(a.Root,{ref:z,open:ae,onOpenChange:e=>{te||$(e),D?.(e)},"aria-busy":P||void 0,"data-streaming":P||void 0,className:p("flex flex-col overflow-hidden",v[S],k[F],w,x,Q??""),style:{...y(U,B),...V},...X,children:[n(a.Trigger,{className:p("flex w-full cursor-pointer items-center text-start text-(--neba-muted-fg)",O,o[_][S],l[_][S],b[S],j[S],w,"hover:bg-(--n-soft) hover:text-(--n-on-tint)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",M?.header??""),children:[h(se)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:se}):null,e("span",{className:"min-w-0 flex-1 truncate font-medium",children:re}),e("span",{className:C,children:e(r,{})})]}),e(a.Panel,{hiddenUntilFound:H,className:f,children:e("div",{className:p("min-w-0 border-s-2 text-(--neba-muted-fg) [border-color:var(--n-line)]",o[_][S],"compact"===_?"pb-2":"pb-4",g[S],M?.body??""),children:W})})]})});