neba 1.16.2 → 1.17.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 (179) hide show
  1. package/README.md +5 -5
  2. package/dist/a2ui/adapter-catalog.json +1 -0
  3. package/dist/a2ui/catalog.json +632 -145
  4. package/dist/a2ui/components.js +1 -1
  5. package/dist/a2ui/index.d.ts +22 -10
  6. package/dist/a2ui/index.js +1 -1
  7. package/dist/a2ui/schema.d.ts +8 -6
  8. package/dist/a2ui/schema.js +1 -1
  9. package/dist/components/accordion/Accordion.js +1 -1
  10. package/dist/components/agent-steps/AgentSteps.js +1 -1
  11. package/dist/components/alert/Alert.js +1 -1
  12. package/dist/components/anchor/Anchor.d.ts +3 -1
  13. package/dist/components/anchor/Anchor.js +1 -1
  14. package/dist/components/animate-counter/AnimateCounter.d.ts +11 -4
  15. package/dist/components/animate-counter/AnimateCounter.js +1 -1
  16. package/dist/components/animate-scramble/AnimateScramble.d.ts +6 -3
  17. package/dist/components/animate-scramble/AnimateScramble.js +1 -1
  18. package/dist/components/animate-split/AnimateSplit.d.ts +6 -3
  19. package/dist/components/animate-split/AnimateSplit.js +1 -1
  20. package/dist/components/animate-typing/AnimateTyping.js +1 -1
  21. package/dist/components/app-logo/AppLogo.js +1 -1
  22. package/dist/components/approval/Approval.js +1 -1
  23. package/dist/components/avatar/Avatar.js +1 -1
  24. package/dist/components/bar-chart/BarChart.js +1 -1
  25. package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
  26. package/dist/components/box/Box.js +1 -1
  27. package/dist/components/breadcrumb/Breadcrumb.d.ts +3 -3
  28. package/dist/components/breadcrumb/Breadcrumb.js +1 -1
  29. package/dist/components/card/Card.js +1 -1
  30. package/dist/components/chat-bubble/ChatBubble.js +1 -1
  31. package/dist/components/chip/Chip.d.ts +4 -1
  32. package/dist/components/chip/Chip.js +1 -1
  33. package/dist/components/code-block/CodeBlock.js +1 -1
  34. package/dist/components/collapsible/Collapsible.js +1 -1
  35. package/dist/components/color-picker/ColorPicker.d.ts +3 -1
  36. package/dist/components/color-picker/ColorPicker.js +1 -1
  37. package/dist/components/combobox/Combobox.js +1 -1
  38. package/dist/components/command-palette/CommandPalette.js +1 -1
  39. package/dist/components/confirm/Confirm.js +1 -1
  40. package/dist/components/context-window/ContextWindow.d.ts +4 -1
  41. package/dist/components/context-window/ContextWindow.js +1 -1
  42. package/dist/components/data-list/DataList.d.ts +3 -2
  43. package/dist/components/data-list/DataList.js +1 -1
  44. package/dist/components/data-table/DataTable.d.ts +11 -5
  45. package/dist/components/data-table/DataTable.js +1 -1
  46. package/dist/components/date-range-picker/DateRangePicker.d.ts +3 -2
  47. package/dist/components/date-range-picker/DateRangePicker.js +1 -1
  48. package/dist/components/dialog/Dialog.js +1 -1
  49. package/dist/components/drawer/Drawer.js +1 -1
  50. package/dist/components/fieldset/Fieldset.js +1 -1
  51. package/dist/components/file-picker/FilePicker.d.ts +4 -0
  52. package/dist/components/file-picker/FilePicker.js +1 -1
  53. package/dist/components/footer/Footer.d.ts +4 -2
  54. package/dist/components/form/Form.d.ts +0 -14
  55. package/dist/components/form/Form.js +1 -1
  56. package/dist/components/gallery/Gallery.js +1 -1
  57. package/dist/components/gallery/GalleryViewer.js +1 -1
  58. package/dist/components/header/Header.d.ts +4 -3
  59. package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
  60. package/dist/components/hover-card/HoverCard.d.ts +1 -1
  61. package/dist/components/how-to-steps/HowToSteps.d.ts +2 -1
  62. package/dist/components/how-to-steps/HowToSteps.js +1 -1
  63. package/dist/components/image/Image.d.ts +4 -1
  64. package/dist/components/image/Image.js +1 -1
  65. package/dist/components/inline-citation/InlineCitation.d.ts +4 -2
  66. package/dist/components/inline-citation/InlineCitation.js +1 -1
  67. package/dist/components/menu/Menu.d.ts +6 -2
  68. package/dist/components/menu/Menu.js +1 -1
  69. package/dist/components/mockup/Mockup.js +1 -1
  70. package/dist/components/navigation-menu/NavigationMenu.d.ts +1 -1
  71. package/dist/components/navigation-menu/NavigationMenu.js +1 -1
  72. package/dist/components/number-field/NumberField.js +1 -1
  73. package/dist/components/overlay/Overlay.d.ts +1 -1
  74. package/dist/components/page-layout/PageLayout.js +1 -1
  75. package/dist/components/pagination/Pagination.d.ts +3 -2
  76. package/dist/components/panes/Panes.js +1 -1
  77. package/dist/components/pie-chart/PieChart.js +1 -1
  78. package/dist/components/pill/Pill.js +1 -1
  79. package/dist/components/popover/Popover.js +1 -1
  80. package/dist/components/progress-box/ProgressBox.js +1 -1
  81. package/dist/components/prompt-input/PromptInput.d.ts +5 -3
  82. package/dist/components/prompt-input/PromptInput.js +1 -1
  83. package/dist/components/radio-group/RadioGroup.js +1 -1
  84. package/dist/components/rating/Rating.js +1 -1
  85. package/dist/components/reasoning/Reasoning.d.ts +7 -4
  86. package/dist/components/reasoning/Reasoning.js +1 -1
  87. package/dist/components/scatter-chart/ScatterChart.d.ts +7 -1
  88. package/dist/components/scatter-chart/ScatterChart.js +1 -1
  89. package/dist/components/scroll-area/ScrollArea.d.ts +12 -0
  90. package/dist/components/scroll-area/ScrollArea.js +1 -1
  91. package/dist/components/scroll-zone/ScrollZone.js +1 -1
  92. package/dist/components/segmented-button/SegmentedButton.js +1 -1
  93. package/dist/components/select/Select.d.ts +2 -1
  94. package/dist/components/select/Select.js +1 -1
  95. package/dist/components/sidebar/Sidebar.js +1 -1
  96. package/dist/components/sidebar/SidebarTrigger.js +1 -1
  97. package/dist/components/skeleton/Skeleton.js +1 -1
  98. package/dist/components/sources/Sources.d.ts +1 -1
  99. package/dist/components/sources/Sources.js +1 -1
  100. package/dist/components/stack/Stack.js +1 -1
  101. package/dist/components/streaming-text/StreamingText.js +1 -1
  102. package/dist/components/switch/Switch.d.ts +13 -2
  103. package/dist/components/switch/Switch.js +1 -1
  104. package/dist/components/switch/index.d.ts +1 -1
  105. package/dist/components/table/Table.d.ts +4 -2
  106. package/dist/components/tabs/Tabs.js +1 -1
  107. package/dist/components/text-field/TextField.js +1 -1
  108. package/dist/components/text-link/TextLink.js +1 -1
  109. package/dist/components/timeline-chart/TimelineChart.d.ts +6 -1
  110. package/dist/components/timeline-chart/TimelineChart.js +1 -1
  111. package/dist/components/toggle/Toggle.js +1 -1
  112. package/dist/components/tool-call/ToolCall.js +1 -1
  113. package/dist/components/tour/Tour.js +1 -1
  114. package/dist/components/transfer/Transfer.js +1 -1
  115. package/dist/components/tree-select/TreeSelect.js +1 -1
  116. package/dist/components/tree-view/TreeView.js +1 -1
  117. package/dist/components/typography/Typography.js +1 -1
  118. package/dist/components/visually-hidden/VisuallyHidden.d.ts +2 -2
  119. package/dist/components/window-pane/WindowPane.js +1 -1
  120. package/dist/hooks/useElementSize.d.ts +6 -2
  121. package/dist/hooks/useElementSize.js +1 -1
  122. package/dist/hooks/useMediaQuery.d.ts +3 -2
  123. package/dist/hooks/useOnScreen.d.ts +2 -2
  124. package/dist/hooks/useShortcut.d.ts +11 -3
  125. package/dist/hooks/useShortcut.js +1 -1
  126. package/dist/internal/animate.d.ts +8 -0
  127. package/dist/internal/animate.js +1 -1
  128. package/dist/internal/calendar.js +1 -1
  129. package/dist/internal/chart-brush.d.ts +3 -1
  130. package/dist/internal/chart-brush.js +1 -1
  131. package/dist/internal/chart-frame.d.ts +28 -2
  132. package/dist/internal/chart-frame.js +1 -1
  133. package/dist/internal/chart-line.js +1 -1
  134. package/dist/internal/chart.d.ts +21 -0
  135. package/dist/internal/chart.js +1 -1
  136. package/dist/internal/drag.d.ts +15 -0
  137. package/dist/internal/drag.js +1 -1
  138. package/dist/internal/drop.d.ts +12 -8
  139. package/dist/internal/drop.js +1 -1
  140. package/dist/internal/highlight.js +1 -1
  141. package/dist/internal/i18n.d.ts +40 -4
  142. package/dist/internal/i18n.js +1 -1
  143. package/dist/internal/icons.d.ts +3 -0
  144. package/dist/internal/icons.js +1 -1
  145. package/dist/internal/link.d.ts +27 -0
  146. package/dist/internal/link.js +1 -1
  147. package/dist/internal/new-tab.d.ts +21 -0
  148. package/dist/internal/new-tab.js +1 -0
  149. package/dist/internal/notch.d.ts +23 -1
  150. package/dist/internal/notch.js +1 -1
  151. package/dist/internal/observe.d.ts +3 -4
  152. package/dist/internal/picker.d.ts +21 -3
  153. package/dist/internal/picker.js +1 -1
  154. package/dist/internal/run.d.ts +7 -5
  155. package/dist/internal/run.js +1 -1
  156. package/dist/internal/search.d.ts +3 -3
  157. package/dist/internal/styles.d.ts +33 -1
  158. package/dist/internal/styles.js +1 -1
  159. package/dist/locales/ar.js +1 -1
  160. package/dist/locales/de.js +1 -1
  161. package/dist/locales/es.js +1 -1
  162. package/dist/locales/fr.js +1 -1
  163. package/dist/locales/hi.js +1 -1
  164. package/dist/locales/id.js +1 -1
  165. package/dist/locales/it.js +1 -1
  166. package/dist/locales/ja.js +1 -1
  167. package/dist/locales/ko.js +1 -1
  168. package/dist/locales/nl.js +1 -1
  169. package/dist/locales/pl.js +1 -1
  170. package/dist/locales/pt.js +1 -1
  171. package/dist/locales/ru.js +1 -1
  172. package/dist/locales/th.js +1 -1
  173. package/dist/locales/tr.js +1 -1
  174. package/dist/locales/vi.js +1 -1
  175. package/dist/locales/zh-hans.js +1 -1
  176. package/dist/locales/zh-hant.js +1 -1
  177. package/dist/styles.css +1 -1
  178. package/dist/tailwind.css +31 -4
  179. package/package.json +9 -3
@@ -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=["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,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 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{StarIcon as t,StarOutlineIcon as r}from"../../internal/icons.js";import{fillMessage as i,ratingMessages as l,useMessages as o}from"../../internal/i18n.js";import{controlSlots as s,cx as d,focusWithinRingClasses as m,gapClasses as c,iconSizeClasses as u,radiusClasses as h,srOnlyClasses as f,transitionClasses as b}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const v="flex items-center justify-center";export const Rating=/*@__PURE__*/n.forwardRef(function Rating(x,y){const{value:g,defaultValue:j=0,onValueChange:M,count:N=5,precision:w=1,icon:k,emptyIcon:S,clearable:C=!0,readOnly:L=!1,disabled:P=!1,name:q,required:I=!1,size:R="md",color:z="warning",locale:A,label:V,valueLabel:_,className:E,style:F,onPointerLeave:O,...$}=p(x,["size","locale"]),B=o(l,A),D=n.useId(),G=q??D,H=void 0===q?`${D}-no-form`:void 0,[J,K]=n.useState(j),Q=void 0!==g,T=Q?g:J,[U,W]=n.useState(null),X=Math.max(1,Math.floor(N)),Y=w>0&&w<=1?w:1,Z=Math.round(1/Y),ee=Math.max(0,Math.min(X,U??T)),ae=n.useCallback(e=>_?_(e,X):e<=0?B.empty:i(B.value,{value:String(Math.round(10*e)/10),max:String(X)}),[_,X,B]),ne=e=>{Q||K(e),M?.(e)},te=Array.from({length:X},(n,i)=>{const l=Math.max(0,Math.min(1,ee-i));return a("span",{className:d("relative inline-flex shrink-0",u[R],h.xs,L||P?"":m),children:[e("span",{className:[v,u[R],P?"text-(--neba-disabled-fg)":"text-(--n-empty)"].join(" "),children:S??e(r,{})}),e("span",{"aria-hidden":"true",className:d("pointer-events-none absolute inset-y-0 start-0 overflow-hidden","[transition:width_var(--neba-duration)_var(--neba-ease)]"),style:{width:100*l+"%"},children:e("span",{className:[v,u[R],P?"text-(--neba-disabled-fg)":"text-(--n-fill)",b].join(" "),children:k??e(t,{})})}),L?null:Array.from({length:Z},(a,n)=>{const t=Number((i+(n+1)*Y).toFixed(4));return e("label",{className:["absolute inset-y-0",P?"cursor-not-allowed":"cursor-pointer"].join(" "),style:{insetInlineStart:100*n/Z+"%",width:100/Z+"%"},onPointerEnter:()=>{P||W(t)},children:e("input",{type:"radio",className:f,name:G,form:H,value:t,checked:T===t,disabled:P,required:I,"aria-label":ae(t),onChange:()=>ne(t),onClick:()=>{C&&T===t&&ne(0)}})},t)})]},i)}),re=d("inline-flex items-center align-middle",c[R],P?"cursor-not-allowed":"",E??""),ie={...s(z,0,"solid"),"--n-empty":"color-mix(in oklab, var(--neba-muted-fg) 40%, transparent)",...F};return e("div",L?{ref:y,role:"img","aria-label":ae(Math.max(0,Math.min(X,T))),className:re,style:ie,onPointerLeave:O,...$,children:te}:{ref:y,role:"radiogroup","aria-label":V??B.label,"aria-disabled":P||void 0,"aria-required":I||void 0,className:re,style:ie,onPointerLeave:e=>{W(null),O?.(e)},...$,children:te})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{StarIcon as r,StarOutlineIcon as t}from"../../internal/icons.js";import{fillMessage as i,ratingMessages as l,useMessages as o}from"../../internal/i18n.js";import{controlSlots as s,cx as m,focusWithinRingClasses as d,gapClasses as c,iconSizeClasses as u,radiusClasses as h,srOnlyClasses as f,transitionClasses as b}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const v="flex items-center justify-center",x={xs:"0.25rem",sm:"0.375rem",md:"0.375rem",lg:"0.5rem",xl:"0.625rem"};export const Rating=/*@__PURE__*/n.forwardRef(function Rating(g,y){const{value:j,defaultValue:M=0,onValueChange:N,count:w=5,precision:k=1,icon:S,emptyIcon:C,clearable:L=!0,readOnly:P=!1,disabled:q=!1,name:I,required:R=!1,size:z="md",color:A="warning",locale:V,label:_,valueLabel:E,className:F,style:O,onPointerLeave:$,...B}=p(g,["size","locale"]),D=o(l,V),G=n.useId(),H=I??G,J=void 0===I?`${G}-no-form`:void 0,[K,Q]=n.useState(M),T=void 0!==j,U=T?j:K,[W,X]=n.useState(null),Y=Math.max(1,Math.floor(w)),Z=k>0&&k<=1?k:1,ee=Math.round(1/Z),ae=Math.max(0,Math.min(Y,W??U)),ne=n.useCallback(e=>E?E(e,Y):e<=0?D.empty:i(D.value,{value:String(Math.round(10*e)/10),max:String(Y)}),[E,Y,D]),re=e=>{T||Q(e),N?.(e)},te=Array.from({length:Y},(n,i)=>{const l=Math.max(0,Math.min(1,ae-i));return a("span",{className:m("relative inline-flex shrink-0",u[z],h.xs,P||q?"":d),children:[e("span",{className:[v,u[z],q?"text-(--neba-disabled-fg)":"text-(--n-empty)"].join(" "),children:C??e(t,{})}),e("span",{"aria-hidden":"true",className:m("pointer-events-none absolute inset-y-0 start-0 overflow-hidden","[transition:width_var(--neba-duration)_var(--neba-ease)]"),style:{width:100*l+"%"},children:e("span",{className:[v,u[z],q?"text-(--neba-disabled-fg)":"text-(--n-fill)",b].join(" "),children:S??e(r,{})})}),P?null:Array.from({length:ee},(a,n)=>{const r=Number((i+(n+1)*Z).toFixed(4));return e("label",{className:["neba-hit-row absolute inset-y-0",q?"cursor-not-allowed":"cursor-pointer"].join(" "),style:{insetInlineStart:100*n/ee+"%",width:100/ee+"%","--n-hit-gap":1===ee?x[z]:void 0},onPointerEnter:()=>{q||X(r)},children:e("input",{type:"radio",className:f,name:H,form:J,value:r,checked:U===r,disabled:q,required:R,"aria-label":ne(r),onChange:()=>re(r),onClick:()=>{L&&U===r&&re(0)}})},r)})]},i)}),ie=m("inline-flex items-center align-middle",c[z],q?"cursor-not-allowed":"",F??""),le={...s(A,0,"solid"),"--n-empty":P?"color-mix(in oklab, var(--neba-muted-fg) 40%, transparent)":"color-mix(in oklab, var(--neba-muted-fg) 80%, transparent)",...O};return e("div",P?{ref:y,role:"img","aria-label":ne(Math.max(0,Math.min(Y,U))),className:ie,style:le,onPointerLeave:$,...B,children:te}:{ref:y,role:"radiogroup","aria-label":_??D.label,"aria-disabled":q||void 0,"aria-required":R||void 0,className:ie,style:le,onPointerLeave:e=>{X(null),$?.(e)},...B,children:te})});
@@ -13,9 +13,9 @@ export interface ReasoningProps extends Pick<NebaStyleProps, 'size' | 'variant'
13
13
  /**
14
14
  * How long the thinking took, in milliseconds.
15
15
  *
16
- * Left out, the panel counts its own from the moment `streaming` went true
17
- * and keeps the last figure once it stops — which is where "Thought for 4s"
18
- * comes from. A stretch shorter than a second never gets a number, and the
16
+ * Left out, the panel counts its own from the moment `streaming` went true,
17
+ * and measures it once more when the stream stops — which is where "Thought
18
+ * for 4.9s" comes from. A panel that never streamed has no figure, and the
19
19
  * header says so in words instead.
20
20
  */
21
21
  duration?: number;
@@ -26,7 +26,10 @@ export interface ReasoningProps extends Pick<NebaStyleProps, 'size' | 'variant'
26
26
  * @default false
27
27
  */
28
28
  defaultOpen?: boolean;
29
- /** Called when the header, or the stream, opens or closes the panel. */
29
+ /**
30
+ * Called when the header opens or closes the panel. The stream opening and
31
+ * closing it under `autoOpen` does not call it.
32
+ */
30
33
  onOpenChange?: (open: boolean) => void;
31
34
  /**
32
35
  * Opens the panel while the stream runs and closes it when the stream ends.
@@ -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 h,iconClasses as v,radiusClasses as x,sheetBodyClasses as g,sheetTitleClasses as j,surfaceClasses as N,surfaceSlots as y,transitionClasses as w}from"../../internal/styles.js";import{useStyleDefaults as O}from"../../internal/defaults.js";const R={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,_){const{variant:k="text",size:C="md",color:z="secondary",density:S="default",elevation:B=0,streaming:P=!1,duration:T,open:q,defaultOpen:A=!1,onOpenChange:D,autoOpen:E=!0,label:F,icon:G,locale:H,labels:I,classNames:J,className:K,style:L,children:M,...Q}=O(N,["size","density","variant","locale"]),U={...f(m,H),...I},[V,W]=a.useState(A||E&&P),[X,Y]=a.useState(P),Z=void 0!==q,$=Z?q:V;X!==P&&(Y(P),E&&!Z&&W(P));const ee=c(P,T),ne=null===ee?null:i(ee,H),ae=h(F)?F:P?U.thinking:null===ne?U.done:d(U.thought,{duration:ne}),te=void 0===G?P?e(s,{}):null:G;return n(t.Root,{ref:_,open:$,onOpenChange:e=>{Z||W(e),D?.(e)},"aria-busy":P||void 0,"data-streaming":P||void 0,className:u("flex flex-col overflow-hidden",x[C],R[k],w,v,K??""),style:{...y(z,B),...L},...Q,children:[n(t.Trigger,{className:u("flex w-full cursor-pointer items-center text-start text-(--neba-muted-fg)",o[S][C],r[S][C],b[C],j[C],w,"hover:bg-(--n-soft) hover:text-(--n-on-tint)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",J?.header??""),children:[h(te)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:te}):null,e("span",{className:"min-w-0 flex-1 truncate font-medium",children:ae}),e("span",{className:["flex h-[1lh] shrink-0 items-center","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[panel-open]:rotate-180"].join(" "),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[S][C],"compact"===S?"pb-2":"pb-4",g[C],J?.body??""),children:M})})]})});
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,7 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { type CartesianChartProps } from '../../internal/chart-frame.js';
3
3
  import { type MarkShape } from '../../internal/chart.js';
4
- export interface ScatterChartProps extends CartesianChartProps {
4
+ /**
5
+ * `brush` and `secondaryAxis` are left out because a scatter cannot honour
6
+ * either: a brush windows a series by index, which on a cloud of points is an
7
+ * arbitrary cut rather than a range of x, and a second value axis has no
8
+ * table, tooltip or summary here that would write its numbers in its format.
9
+ */
10
+ export interface ScatterChartProps extends Omit<CartesianChartProps, 'brush' | 'secondaryAxis'> {
5
11
  /**
6
12
  * What each mark is drawn as.
7
13
  *
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{CartesianChart as a,markTransitionClasses as l}from"../../internal/chart-frame.js";import{bubbleRadius as i,formatCategory as s,markerRadii as o,markGap as n,markPath as c,markShapes as u,plotHeights as d,pointX as m}from"../../internal/chart.js";import{numberFormatter as h}from"../../internal/format.js";import{chartMessages as f,useMessages as p}from"../../internal/i18n.js";import{cx as x,srOnlyClasses as b}from"../../internal/styles.js";import{useStyleDefaults as v}from"../../internal/defaults.js";export function ScatterChart(r){const{shape:l="auto",pointRadius:s,maxRadius:n,series:h,categories:f,size:p="md",xAxis:x,...b}=v(r,["size","locale"]),g=s??o[p],z=n??Math.max(g+2,("number"==typeof b.height?b.height:d[p])/12),j=h.reduce((e,r)=>r.color?e:e+1,0),k="auto"===l||"varied"===l?"circle":l,M="varied"===l||"auto"===l&&j>3,S=t.useCallback(e=>M?u[e%u.length]:k,[M,k]),$=t.useCallback(e=>{const r=[];let t=0;return e.values.forEach(e=>{e.forEach(e=>{null!==e.value&&void 0!==e.z&&Number.isFinite(e.z)&&(t=Math.max(t,e.z))})}),e.values.forEach((a,l)=>{e.visible[l]&&a.forEach((a,s)=>{if(null===a.value)return;const o=m(a,s,f);null!==o&&r.push({series:l,index:s,x:e.categoryValuePx(o),y:e.valuePx(a.value,l),r:void 0===a.z?g:i(a.z,t,z,2)})})}),r},[f,g,z]);return e(a,{...b,series:h,categories:f,size:p,xScale:"value",xAxis:x,marks:$,markInset:z,includeZero:!1,swatch:(r,t)=>e("svg",{viewBox:"0 0 10 10",className:"size-2.5 overflow-visible","aria-hidden":"true",children:e("path",{d:c(S(r),5,5,4),fill:t})}),table:(r,t)=>e(y,{id:r,series:h,categories:f,label:b.label,xLabel:x?.label,yLabel:b.yAxis?.label,locale:b.locale,format:t}),children:r=>e(ScatterMarks,{context:r,shapeOf:S})})}function ScatterMarks({context:r,shapeOf:a}){const{marks:i,values:s,colors:o,hovered:u,activeMark:d}=r,m=t.useMemo(()=>[...i].sort((e,r)=>r.r-e.r),[i]);return e("g",{children:m.map(r=>{const t=s[r.series]?.[r.index],i=null!==u&&u!==r.series,m=d?.series===r.series&&d?.index===r.index;return e("path",{d:c(a(r.series),r.x,r.y,r.r),fill:t?.color??o[r.series],stroke:"var(--neba-chart-gap)",strokeWidth:n,opacity:i?.28:1,className:l,style:{transformBox:"view-box",transformOrigin:`${r.x}px ${r.y}px`,scale:String(m&&r.r>0?(r.r+1)/r.r:1)}},`${r.series}-${r.index}`)})})}const y=/*@__PURE__*/t.memo(function ScatterTable({id:t,series:a,categories:l,label:i,xLabel:o,yLabel:n,locale:c,format:u}){const d=p(f,c),m=a.some(e=>e.data.some(e=>"object"==typeof e&&null!==e&&void 0!==e.z));return r("table",{id:t,className:x(b),children:[i?e("caption",{children:i}):null,e("thead",{children:r("tr",{children:[e("th",{scope:"col"}),e("th",{scope:"col",children:o??"x"}),e("th",{scope:"col",children:n??"y"}),m?e("th",{scope:"col",children:d.size}):null]})}),e("tbody",{children:a.flatMap((t,a)=>t.data.map((i,o)=>{const n="object"==typeof i&&null!==i?i:null,d=n?n.y:"number"==typeof i?i:null,f=n?.x??l?.[o]??o;return r("tr",{children:[e("th",{scope:"row",children:t.name??a+1}),e("td",{children:"number"==typeof f?h(c,{}).format(f):s(f,c)}),e("td",{children:null!==d&&Number.isFinite(d)?u(d):""}),m?e("td",{children:void 0===n?.z?"":h(c,{}).format(n.z)}):null]},`${a}-${o}`)}))})]})});
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{CartesianChart as l,markTransitionClasses as a}from"../../internal/chart-frame.js";import{bubbleRadius as s,formatCategory as i,markerRadii as o,markGap as n,markPath as c,markShapes as u,plotHeights as d,pointX as m}from"../../internal/chart.js";import{numberFormatter as h}from"../../internal/format.js";import{chartMessages as f,useMessages as p}from"../../internal/i18n.js";import{cx as x,srOnlyClasses as b}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";export function ScatterChart(r){const{shape:a="auto",pointRadius:i,maxRadius:n,series:h,categories:x,size:b="md",xAxis:z,...g}=y(r,["size","locale"]),j=i??o[b],k=n??Math.max(j+2,("number"==typeof g.height?g.height:d[b])/12),M=h.reduce((e,r)=>r.color?e:e+1,0),$="auto"===a||"varied"===a?"circle":a,w="varied"===a||"auto"===a&&M>3,N=t.useCallback(e=>w?u[e%u.length]:$,[w,$]),S=t.useCallback(e=>{const r=[];let t=0;return e.values.forEach(e=>{e.forEach(e=>{null!==e.value&&void 0!==e.z&&Number.isFinite(e.z)&&(t=Math.max(t,e.z))})}),e.values.forEach((l,a)=>{e.visible[a]&&l.forEach((l,i)=>{if(null===l.value)return;const o=m(l,i,x);null!==o&&r.push({series:a,index:i,x:e.categoryValuePx(o),y:e.valuePx(l.value,a),r:void 0===l.z?j:s(l.z,t,k,2)})})}),r},[x,j,k]),A=p(f,g.locale);return e(l,{...g,series:h,categories:x,size:b,xScale:"value",xAxis:z,brush:void 0,secondaryAxis:void 0,marks:S,markInset:k,includeZero:!1,swatch:(r,t)=>e("svg",{viewBox:"0 0 10 10",className:"size-2.5 overflow-visible","aria-hidden":"true",children:e("path",{d:c(N(r),5,5,4),fill:t})}),exportRows:()=>function(e,r,t,l,a){const s=e.some(e=>e.data.some(e=>"object"==typeof e&&null!==e&&void 0!==e.z));return[["","string"==typeof t?t:"x","string"==typeof l?l:"y",...s?[a]:[]],...e.flatMap((e,t)=>e.data.map((l,a)=>{const i="object"==typeof l&&null!==l?l:null,o=i?i.y:"number"==typeof l?l:null,n=i?.x??r?.[a]??a;return[e.name??`${t+1}`,n,null!==o&&Number.isFinite(o)?o:null,...s?[i?.z??null]:[]]}))]}(h,x,z?.label,g.yAxis?.label,A.size),table:(r,t)=>e(v,{id:r,series:h,categories:x,label:g.label,xLabel:z?.label,yLabel:g.yAxis?.label,locale:g.locale,format:t}),children:r=>e(ScatterMarks,{context:r,shapeOf:N})})}function ScatterMarks({context:r,shapeOf:l}){const{marks:s,values:i,colors:o,hovered:u,activeMark:d}=r,m=t.useMemo(()=>[...s].sort((e,r)=>r.r-e.r),[s]);return e("g",{children:m.map(r=>{const t=i[r.series]?.[r.index],s=null!==u&&u!==r.series,m=d?.series===r.series&&d?.index===r.index;return e("path",{d:c(l(r.series),r.x,r.y,r.r),fill:t?.color??o[r.series],stroke:"var(--neba-chart-gap)",strokeWidth:n,opacity:s?.28:1,className:a,style:{transformBox:"view-box",transformOrigin:`${r.x}px ${r.y}px`,scale:String(m&&r.r>0?(r.r+1)/r.r:1)}},`${r.series}-${r.index}`)})})}const v=/*@__PURE__*/t.memo(function ScatterTable({id:t,series:l,categories:a,label:s,xLabel:o,yLabel:n,locale:c,format:u}){const d=p(f,c),m=l.some(e=>e.data.some(e=>"object"==typeof e&&null!==e&&void 0!==e.z));return r("table",{id:t,className:x(b),children:[s?e("caption",{children:s}):null,e("thead",{children:r("tr",{children:[e("th",{scope:"col"}),e("th",{scope:"col",children:o??"x"}),e("th",{scope:"col",children:n??"y"}),m?e("th",{scope:"col",children:d.size}):null]})}),e("tbody",{children:l.flatMap((t,l)=>t.data.map((s,o)=>{const n="object"==typeof s&&null!==s?s:null,d=n?n.y:"number"==typeof s?s:null,f=n?.x??a?.[o]??o;return r("tr",{children:[e("th",{scope:"row",children:t.name??l+1}),e("td",{children:"number"==typeof f?h(c,{}).format(f):i(f,c)}),e("td",{children:null!==d&&Number.isFinite(d)?u(d):""}),m?e("td",{children:void 0===n?.z?"":h(c,{}).format(n.z)}):null]},`${l}-${o}`)}))})]})});
@@ -30,6 +30,18 @@ export interface ScrollAreaProps extends Omit<React.ComponentPropsWithoutRef<'di
30
30
  * @default false
31
31
  */
32
32
  fade?: boolean;
33
+ /**
34
+ * What the scrolling content is — "Terms of service", "Activity". The
35
+ * viewport is a tab stop whenever it overflows, and with a `label` it is a
36
+ * `region` named by it; without one it is a group named "Scrollable
37
+ * content", so the focus never lands on something that says nothing.
38
+ */
39
+ label?: string;
40
+ /**
41
+ * Which language the fallback name is in — a BCP 47 tag such as `ko`,
42
+ * `pt-BR` or `zh-Hant`. Unsupported tags fall back to English.
43
+ */
44
+ locale?: string;
33
45
  children?: React.ReactNode;
34
46
  }
35
47
  /**
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as e}from"react/jsx-runtime";import*as a from"react";import{ScrollArea as n}from"@base-ui/react/scroll-area";import{cx as o,toLength as l}from"../../internal/styles.js";import{useStyleDefaults as t}from"../../internal/defaults.js";const i={xs:"0.25rem",sm:"0.3125rem",md:"0.375rem",lg:"0.5rem",xl:"0.625rem"},s={xs:"1rem",sm:"1.25rem",md:"1.5rem",lg:"2rem",xl:"2.5rem"},c=["flex touch-none select-none rounded-full p-px","bg-transparent hover:bg-(--n-soft)","opacity-0 transition-[opacity,background-color] duration-(--neba-duration) ease-(--neba-ease)","data-[hovering]:opacity-100 data-[scrolling]:opacity-100 data-[scrolling]:duration-0"].join(" "),m="flex-1 rounded-full bg-(--n-thumb) hover:bg-(--n-thumb-hover)";export const ScrollArea=/*@__PURE__*/a.forwardRef(function ScrollArea(a,h){const{orientation:d="vertical",height:u,maxHeight:b,size:f="md",color:g="primary",fade:p=!1,className:x,style:v,children:y,...N}=t(a,["size"]),j="vertical"===d||"both"===d,w="horizontal"===d||"both"===d;return e(n.Root,{ref:h,className:o("relative overflow-hidden",x??""),style:{"--n-soft":`var(--neba-${g}-soft)`,"--n-ring":`var(--neba-${g}-ring)`,"--n-thumb":`color-mix(in oklab, var(--neba-${g}-accent) 35%, transparent)`,"--n-thumb-hover":`color-mix(in oklab, var(--neba-${g}-accent) 55%, transparent)`,"--n-rail":i[f],"--n-fade":s[f],height:l(u),maxHeight:l(b),...v},...N,children:[r(n.Viewport,{style:{height:"100%",width:"100%",maxHeight:"inherit"},className:o("overscroll-contain","[outline:0_solid_var(--n-ring)] outline-offset-[-2px] focus-visible:[outline:2px_solid_var(--n-ring)]",p?"neba-scroll-fade":""),children:r(n.Content,{className:"min-w-full",children:y})}),j?r(n.Scrollbar,{orientation:"vertical",className:`${c} w-(--n-rail) [margin-block:2px]`,children:r(n.Thumb,{className:m})}):null,w?r(n.Scrollbar,{orientation:"horizontal",className:`${c} h-(--n-rail) [margin-inline:2px]`,children:r(n.Thumb,{className:m})}):null,j&&w?r(n.Corner,{}):null]})});
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{ScrollArea as n}from"@base-ui/react/scroll-area";import{scrollMessages as l,useMessages as o}from"../../internal/i18n.js";import{cx as i,toLength as t}from"../../internal/styles.js";import{useStyleDefaults as s}from"../../internal/defaults.js";const c={xs:"0.25rem",sm:"0.3125rem",md:"0.375rem",lg:"0.5rem",xl:"0.625rem"},m={xs:"1rem",sm:"1.25rem",md:"1.5rem",lg:"2rem",xl:"2.5rem"},h=["flex touch-none select-none rounded-full p-px","bg-transparent hover:bg-(--n-soft)","opacity-0 transition-[opacity,background-color] duration-(--neba-duration) ease-(--neba-ease)","data-[hovering]:opacity-100 data-[scrolling]:opacity-100 data-[scrolling]:duration-0"].join(" "),b="flex-1 rounded-full bg-(--n-thumb) hover:bg-(--n-thumb-hover)";export const ScrollArea=/*@__PURE__*/a.forwardRef(function ScrollArea(a,d){const{orientation:u="vertical",height:f,maxHeight:g,size:p="md",color:x="primary",fade:v=!1,label:y,locale:N,className:j,style:w,children:$,...S}=s(a,["size","locale"]),k=o(l,N),z="vertical"===u||"both"===u,_="horizontal"===u||"both"===u;return r(n.Root,{ref:d,className:i("relative overflow-hidden",j??""),style:{"--n-soft":`var(--neba-${x}-soft)`,"--n-ring":`var(--neba-${x}-ring)`,"--n-thumb":`color-mix(in oklab, var(--neba-${x}-accent) 35%, transparent)`,"--n-thumb-hover":`color-mix(in oklab, var(--neba-${x}-accent) 55%, transparent)`,"--n-rail":c[p],"--n-fade":m[p],height:t(f),maxHeight:t(g),...w},...S,children:[e(n.Viewport,{style:{height:"100%",width:"100%",maxHeight:"inherit"},role:y?"region":"group","aria-label":y??k.label,className:i("overscroll-contain","[outline:0_solid_var(--n-ring)] outline-offset-[-2px] focus-visible:[outline:2px_solid_var(--n-ring)]",v?"neba-scroll-fade":""),children:e(n.Content,{className:"min-w-full",children:$})}),z?e(n.Scrollbar,{orientation:"vertical",className:`${h} w-(--n-rail) [margin-block:2px]`,children:e(n.Thumb,{className:b})}):null,_?e(n.Scrollbar,{orientation:"horizontal",className:`${h} h-(--n-rail) [margin-inline:2px]`,children:e(n.Thumb,{className:b})}):null,z&&_?e(n.Corner,{}):null]})});
@@ -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{spacingValue as o}from"../../internal/grid.js";import{scrollMessages as l,useMessages as s}from"../../internal/i18n.js";import{ChevronIcon as i}from"../../internal/icons.js";import{queryMatches as a,reducedMotionQuery as c}from"../../internal/media.js";import{observeResize as u}from"../../internal/observe.js";import{cx as d}from"../../internal/styles.js";import{bindAxisWheel as f}from"../../internal/wheel.js";import{useStyleDefaults as m}from"../../internal/defaults.js";const p={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-3",xl:"p-4"},b={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-3",xl:"gap-4"};export const ScrollZone=/*@__PURE__*/n.forwardRef(function ScrollZone(v,w){const{orientation:g="horizontal",lines:y=1,spacing:h=2,buttons:x="auto",buttonPlacement:k="inline",mode:E="item",step:L=1,speed:C=900,snap:j=!1,drag:P=!0,wheel:R=!1,scrollbar:S=!1,variant:T="solid",size:N="md",color:A="primary",density:M="default",locale:D,label:z,previousLabel:B,nextLabel:F,scrollerRef:W,onScroll:H,className:I,style:$,children:q,...X}=m(v,["size","density","variant","locale"]),Y=s(l,D),Z="horizontal"===g,_=Math.max(1,Math.round(y)),K=Math.max(1,Math.round(L)),V=n.useRef(null),G=n.useRef(null),J=n.useCallback(e=>{V.current=e,"function"==typeof W?W(e):W&&(W.current=e)},[W]),[O,Q]=n.useState({back:!1,forward:!1}),[U,ee]=n.useState(null),te=n.useCallback(()=>{const e=V.current;if(!e)return;const t=Z?e.clientWidth:e.clientHeight,n=Z?e.scrollWidth:e.scrollHeight,r=Math.abs(Z?e.scrollLeft:e.scrollTop);Q(e=>{const o=r>1,l=n-t-r>1;return e.back===o&&e.forward===l?e:{back:o,forward:l}})},[Z]);n.useEffect(()=>{const e=V.current,t=G.current;if(!e)return;te();const n=[u(e,te),t?u(t,te):null];return()=>{for(const e of n)e?.()}},[te]);const ne=n.useCallback(()=>{const e=V.current;return e&&Z&&"rtl"===getComputedStyle(e).direction?-1:1},[Z]),re=n.useCallback((e,t)=>{const n=V.current;if(!n)return;const r=t?a(c)?"auto":"smooth":"auto";n.scrollBy(Z?{left:e,behavior:r}:{top:e,behavior:r})},[Z]),oe=n.useCallback(()=>{const e=V.current,t=G.current;if(!e||!t)return[];const n=Z&&"rtl"===getComputedStyle(e).direction,r=Z?n?"right":"left":"top",o=n?-1:1,l=e.getBoundingClientRect()[r],s=[];for(const e of Array.from(t.children)){const t=Math.round((e.getBoundingClientRect()[r]-l)*o);s.includes(t)||s.push(t)}return s.sort((e,t)=>e-t)},[Z]),le=n.useCallback((e,t=E)=>{const n=V.current;if(!n)return;const r=ne(),o=Z?n.clientWidth:n.clientHeight;if("page"===t)return void re(o*(e?1:-1)*r,!0);const l=oe(),s=l.filter(e=>e>1),i=l.filter(e=>e<-1),a=e?s[K-1]:i[i.length-K];re(void 0!==a?a*r:o*(e?1:-1)*r,!0)},[ne,Z,oe,K,E,re]),se=n.useRef(null);n.useEffect(()=>()=>se.current?.(),[]);const ie=n.useCallback((e,t)=>{if(se.current)return;const n=ne(),r=performance.now();let o=r,l=0;const s=t=>{const r=t-o;o=t,re(C*r/1e3*(e?1:-1)*n,!1),l=requestAnimationFrame(s)};l=requestAnimationFrame(s);const i=()=>{cancelAnimationFrame(l),se.current=null,window.removeEventListener(t,i),window.removeEventListener("pointercancel",i),window.removeEventListener("blur",i),performance.now()-r<140&&le(e,"item")};se.current=i,window.addEventListener(t,i),window.addEventListener("pointercancel",i),window.addEventListener("blur",i)},[le,ne,re,C]),ae=n.useRef(null);function ce(e){return"hold"!==E?{onClick:()=>le(e)}:{onPointerDown:t=>{0===t.button&&ie(e,"pointerup")},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),ie(e,"keyup"))}}}n.useEffect(()=>()=>ae.current?.(),[]),n.useEffect(()=>{const e=V.current;if(e&&R&&Z)return f(e)},[Z,R]);const ue="none"!==x&&("always"===x||O.back||O.forward),de="inline"===k;function fe(t){const n=t?O.forward:O.back,o=t?"forward":"back";if("auto"===x&&!n&&!de&&U!==o)return e("span",{});const l=Z?t?"-rotate-90 rtl:rotate-90":"rotate-90 rtl:-rotate-90":t?"":"rotate-180",s=e(r,{variant:T,size:N,color:A,density:M,elevation:1,label:t?F??Y.next:B??Y.previous,disabled:!n,focusableWhenDisabled:!0,onFocus:()=>ee(o),onBlur:()=>ee(e=>e===o?null:e),className:"pointer-events-auto",icon:e("span",{className:d("flex items-center",l),children:e(i,{})}),...ce(t)});return de?e("span",{className:"flex shrink-0 items-center justify-center",children:s}):s}return t("div",{ref:w,className:d("relative flex min-w-0",de&&Z?"flex-row items-stretch":"flex-col",de?b[N]:"",I),style:{"--n-ring":`var(--neba-${A}-ring)`,...$},...X,children:[ue&&de?fe(!1):null,e("div",{ref:J,tabIndex:0,role:"group","aria-label":z??Y.label,className:d("min-h-0 min-w-0 grow",Z?"overflow-x-auto overflow-y-hidden":"overflow-y-auto overflow-x-hidden","overscroll-contain",j?Z?"snap-x snap-mandatory":"snap-y snap-mandatory":"",S?"":"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",P&&(O.back||O.forward)?"cursor-grab data-[dragging]:cursor-grabbing":"","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"),onScroll:e=>{te(),H?.(e)},onPointerDown:function(e){if(!P||"touch"===e.pointerType||0!==e.button)return;ae.current?.();const t=e.currentTarget,n=e.clientX,r=e.clientY,o=t.scrollLeft,l=t.scrollTop;let s=!1;const i=document.body.style.getPropertyValue("-webkit-user-select"),a=e=>{const i=e.clientX-n,a=e.clientY-r;if(!s){if(Math.abs(Z?i:a)<4)return;s=!0,t.setPointerCapture(e.pointerId),t.dataset.dragging="true",document.body.style.setProperty("-webkit-user-select","none"),j&&(t.style.scrollSnapType="none")}Z?t.scrollLeft=o-i:t.scrollTop=l-a},c=()=>{ae.current=null,t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",c),delete t.dataset.dragging,t.style.removeProperty("scroll-snap-type"),i?document.body.style.setProperty("-webkit-user-select",i):document.body.style.removeProperty("-webkit-user-select")},u=()=>{const e=s;if(c(),!e)return;const n=e=>{e.stopPropagation(),e.preventDefault()};t.addEventListener("click",n,{capture:!0,once:!0}),window.setTimeout(()=>t.removeEventListener("click",n,!0),0)};ae.current=c,t.addEventListener("pointermove",a),t.addEventListener("pointerup",u),t.addEventListener("pointercancel",c)},children:e("div",{ref:G,className:d(j?"[&>*]:snap-start":""),style:{display:"grid",gap:o(h),gridAutoFlow:Z?"column":"row",...Z?{width:"max-content",gridTemplateRows:`repeat(${_}, auto)`,gridAutoColumns:"max-content"}:{gridTemplateColumns:`repeat(${_}, minmax(0, 1fr))`,gridAutoRows:"max-content"}},children:q})}),ue&&de?fe(!0):null,ue&&!de?t("div",{className:d("pointer-events-none absolute inset-0 flex justify-between",Z?"items-center":"flex-col items-center",p[N]),children:[fe(!1),fe(!0)]}):null]})});
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{drawnScale as o}from"../../internal/drag.js";import{spacingValue as l}from"../../internal/grid.js";import{scrollMessages as i,useMessages as s}from"../../internal/i18n.js";import{ChevronIcon as a}from"../../internal/icons.js";import{queryMatches as c,reducedMotionQuery as u}from"../../internal/media.js";import{observeResize as d}from"../../internal/observe.js";import{cx as f}from"../../internal/styles.js";import{bindAxisWheel as m}from"../../internal/wheel.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const b={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-3",xl:"p-4"},v={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-3",xl:"gap-4"};export const ScrollZone=/*@__PURE__*/n.forwardRef(function ScrollZone(w,g){const{orientation:y="horizontal",lines:h=1,spacing:x=2,buttons:k="auto",buttonPlacement:E="inline",mode:L="item",step:j=1,speed:C=900,snap:P=!1,drag:R=!0,wheel:S=!1,scrollbar:T=!1,variant:N="solid",size:A="md",color:M="primary",density:D="default",locale:z,label:B,previousLabel:F,nextLabel:W,scrollerRef:H,onScroll:I,className:$,style:q,children:X,...Y}=p(w,["size","density","variant","locale"]),Z=s(i,z),_="horizontal"===y,K=Math.max(1,Math.round(h)),V=Math.max(1,Math.round(j)),G=n.useRef(null),J=n.useRef(null),O=n.useCallback(e=>{G.current=e,"function"==typeof H?H(e):H&&(H.current=e)},[H]),[Q,U]=n.useState({back:!1,forward:!1}),[ee,te]=n.useState(null),ne=n.useCallback(()=>{const e=G.current;if(!e)return;const t=_?e.clientWidth:e.clientHeight,n=_?e.scrollWidth:e.scrollHeight,r=Math.abs(_?e.scrollLeft:e.scrollTop);U(e=>{const o=r>1,l=n-t-r>1;return e.back===o&&e.forward===l?e:{back:o,forward:l}})},[_]);n.useEffect(()=>{const e=G.current,t=J.current;if(!e)return;ne();const n=[d(e,ne),t?d(t,ne):null];return()=>{for(const e of n)e?.()}},[ne]);const re=n.useCallback(()=>{const e=G.current;return e&&_&&"rtl"===getComputedStyle(e).direction?-1:1},[_]),oe=n.useCallback((e,t)=>{const n=G.current;if(!n)return;const r=t?c(u)?"auto":"smooth":"auto";n.scrollBy(_?{left:e,behavior:r}:{top:e,behavior:r})},[_]),le=n.useCallback(()=>{const e=G.current,t=J.current;if(!e||!t)return[];const n=_&&"rtl"===getComputedStyle(e).direction,r=_?n?"right":"left":"top",o=n?-1:1,l=e.getBoundingClientRect()[r],i=[];for(const e of Array.from(t.children)){const t=Math.round((e.getBoundingClientRect()[r]-l)*o);i.includes(t)||i.push(t)}return i.sort((e,t)=>e-t)},[_]),ie=n.useCallback((e,t=L)=>{const n=G.current;if(!n)return;const r=re(),o=_?n.clientWidth:n.clientHeight;if("page"===t)return void oe(o*(e?1:-1)*r,!0);const l=le(),i=l.filter(e=>e>1),s=l.filter(e=>e<-1),a=e?i[V-1]:s[s.length-V];oe(void 0!==a?a*r:o*(e?1:-1)*r,!0)},[re,_,le,V,L,oe]),se=n.useRef(null);n.useEffect(()=>()=>se.current?.(),[]);const ae=n.useCallback((e,t)=>{if(se.current)return;const n=re(),r=performance.now();let o=r,l=0;const i=t=>{const r=t-o;o=t,oe(C*r/1e3*(e?1:-1)*n,!1),l=requestAnimationFrame(i)};l=requestAnimationFrame(i);const s=()=>{cancelAnimationFrame(l),se.current=null,window.removeEventListener(t,s),window.removeEventListener("pointercancel",s),window.removeEventListener("blur",s),performance.now()-r<140&&ie(e,"item")};se.current=s,window.addEventListener(t,s),window.addEventListener("pointercancel",s),window.addEventListener("blur",s)},[ie,re,oe,C]),ce=n.useRef(null);function ue(e){return"hold"!==L?{onClick:()=>ie(e)}:{onPointerDown:t=>{0===t.button&&ae(e,"pointerup")},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),ae(e,"keyup"))}}}n.useEffect(()=>()=>ce.current?.(),[]),n.useEffect(()=>{const e=G.current;if(e&&S&&_)return m(e)},[_,S]);const de="none"!==k&&("always"===k||Q.back||Q.forward),fe="inline"===E;function me(t){const n=t?Q.forward:Q.back,o=t?"forward":"back";if("auto"===k&&!n&&!fe&&ee!==o)return e("span",{});const l=_?t?"-rotate-90 rtl:rotate-90":"rotate-90 rtl:-rotate-90":t?"":"rotate-180",i=e(r,{variant:N,size:A,color:M,density:D,elevation:1,label:t?W??Z.next:F??Z.previous,disabled:!n,focusableWhenDisabled:!0,onFocus:()=>te(o),onBlur:()=>te(e=>e===o?null:e),className:"pointer-events-auto",icon:e("span",{className:f("flex items-center",l),children:e(a,{})}),...ue(t)});return fe?e("span",{className:"flex shrink-0 items-center justify-center",children:i}):i}return t("div",{ref:g,className:f("relative flex min-w-0",fe&&_?"flex-row items-stretch":"flex-col",fe?v[A]:"",$),style:{"--n-ring":`var(--neba-${M}-ring)`,...q},...Y,children:[de&&fe?me(!1):null,e("div",{ref:O,tabIndex:Q.back||Q.forward?0:-1,role:"group","aria-label":B??Z.label,className:f("min-h-0 min-w-0 grow",_?"overflow-x-auto overflow-y-hidden":"overflow-y-auto overflow-x-hidden","overscroll-contain",P?_?"snap-x snap-mandatory":"snap-y snap-mandatory":"",T?"":"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",R&&(Q.back||Q.forward)?"cursor-grab data-[dragging]:cursor-grabbing":"","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"),onScroll:e=>{ne(),I?.(e)},onPointerDown:function(e){if(!R||"touch"===e.pointerType||0!==e.button)return;ce.current?.();const t=e.currentTarget,n=e.clientX,r=e.clientY,l=t.scrollLeft,i=t.scrollTop,s=o(t);let a=!1;const c=document.body.style.getPropertyValue("-webkit-user-select"),u=e=>{if(0===e.buttons)return void d();const o=e.clientX-n,c=e.clientY-r;if(!a){if(Math.abs(_?o:c)<4)return;a=!0,t.setPointerCapture(e.pointerId),t.dataset.dragging="true",document.body.style.setProperty("-webkit-user-select","none"),P&&(t.style.scrollSnapType="none")}_?t.scrollLeft=l-o/s.x:t.scrollTop=i-c/s.y},d=()=>{ce.current=null,t.removeEventListener("pointermove",u),t.removeEventListener("pointerup",f),t.removeEventListener("pointercancel",d),delete t.dataset.dragging,t.style.removeProperty("scroll-snap-type"),c?document.body.style.setProperty("-webkit-user-select",c):document.body.style.removeProperty("-webkit-user-select")},f=()=>{const e=a;if(d(),!e)return;const n=e=>{e.stopPropagation(),e.preventDefault()};t.addEventListener("click",n,{capture:!0,once:!0}),window.setTimeout(()=>t.removeEventListener("click",n,!0),0)};ce.current=d,t.addEventListener("pointermove",u),t.addEventListener("pointerup",f),t.addEventListener("pointercancel",d)},children:e("div",{ref:J,className:f(P?"[&>*]:snap-start":""),style:{display:"grid",gap:l(x),gridAutoFlow:_?"column":"row",..._?{width:"max-content",gridTemplateRows:`repeat(${K}, auto)`,gridAutoColumns:"max-content"}:{gridTemplateColumns:`repeat(${K}, minmax(0, 1fr))`,gridAutoRows:"max-content"}},children:X})}),de&&fe?me(!0):null,de&&!fe?t("div",{className:f("pointer-events-none absolute inset-0 flex justify-between",_?"items-center":"flex-col items-center",b[A]),children:[me(!1),me(!0)]}):null]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{glowClasses as n,trackPointer as r}from"../../internal/glow.js";import{Radio as o}from"@base-ui/react/radio";import{RadioGroup as s}from"@base-ui/react/radio-group";import{observeResize as l}from"../../internal/observe.js";import{controlHeightClasses as i,controlSlots as d,controlTextClasses as u,cx as f,gapClasses as c,hasContent as b,iconClasses as p,paddingXClasses as h,surfaceClasses as m,transitionClasses as g}from"../../internal/styles.js";import{useStyleDefaults as v}from"../../internal/defaults.js";const x=/*@__PURE__*/a.createContext({variant:"outline",size:"md",density:"default",fullWidth:!1,disabled:!1}),y={solid:`${m} bg-(--n-panel) p-1 [box-shadow:var(--n-elev),var(--neba-plate-glass)]`,outline:`${m} border bg-(--n-panel) p-1 [border-color:var(--n-line)] [box-shadow:var(--n-elev),var(--neba-plate-glass)]`,text:""},w={solid:"bg-transparent p-1",outline:"border bg-transparent p-1 [border-color:var(--neba-disabled-border)]",text:""},j={solid:`${m} bg-(--n-fill) [box-shadow:var(--neba-shadow-1),var(--neba-plate-solid)]`,outline:`${m} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,text:`${m} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`},k="data-[off]:bg-(--neba-disabled-bg) data-[off]:[box-shadow:none]",$={solid:"data-[checked]:text-(--n-on-solid)",outline:"data-[checked]:text-(--n-on-tint)",text:"data-[checked]:text-(--n-on-tint)"};export const Segment=/*@__PURE__*/a.forwardRef(function Segment({value:s,startIcon:l,endIcon:d,disabled:m=!1,className:v,children:y,...w},j){const k=a.useContext(x),{variant:N,size:P,density:R,fullWidth:z}=k,A=m||k.disabled;return t(o.Root,{ref:j,value:s,disabled:m,"data-segment":"",className:f("relative z-10 inline-flex shrink-0 items-center justify-center select-none","whitespace-nowrap font-medium","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",i[P],u[P],c[P],h[R][P],"rounded-full",g,p,A?"cursor-not-allowed text-(--neba-disabled-fg)":f("cursor-pointer text-(--neba-muted-fg) hover:text-(--neba-fg)",$[N],n),"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]","data-[readonly]:cursor-default",z?"flex-1":"",v??""),...w,onPointerMove:r(w.onPointerMove,!A),children:[b(l)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:l}):null,y,b(d)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:d}):null]})});export const SegmentedButton=/*@__PURE__*/a.forwardRef(function SegmentedButton(n,r){const{variant:o="outline",size:i="md",color:u="primary",density:f="default",elevation:c=0,value:b,defaultValue:p=null,onValueChange:h,disabled:m=!1,readOnly:$=!1,name:N,fullWidth:P=!1,className:R,style:z,children:A,...S}=v(n,["size","density","variant"]),[W,C]=a.useState(p),B=void 0!==b,M=B?b:W,V=a.useRef(null),E=a.useRef(null),I=a.useCallback(e=>{const t=V.current,a=E.current;if(!t||!a)return;const n=t.querySelector("[data-segment][data-checked]");if(a.hidden=!n,!n)return void a.removeAttribute("data-ready");a.toggleAttribute("data-off",n.hasAttribute("data-disabled"));const r=!e||!a.hasAttribute("data-ready");r&&a.removeAttribute("data-ready"),a.style.setProperty("--n-seg-x",`${n.offsetLeft}px`),a.style.setProperty("--n-seg-y",`${n.offsetTop}px`),a.style.setProperty("--n-seg-w",`${n.offsetWidth}px`),a.style.setProperty("--n-seg-h",`${n.offsetHeight}px`),r&&a.offsetWidth,a.setAttribute("data-ready","")},[]);a.useLayoutEffect(()=>{I(!0)},[I,M,o,i,f,P,m,A]),a.useEffect(()=>{const e=V.current;if(e)return l(e,()=>I(!1))},[I]);const L=a.useMemo(()=>({variant:o,size:i,density:f,fullWidth:P,disabled:m}),[o,i,f,P,m]);return e(x.Provider,{value:L,children:t(s,{ref:e=>{V.current=e,"function"==typeof r?r(e):r&&(r.current=e)},value:M,onValueChange:e=>{const t=e??null;B||C(t),h?.(t)},disabled:m,readOnly:$,name:N,className:["relative items-center rounded-full",m?w[o]:y[o],g,$?"[filter:saturate(0.55)]":"",P?"flex w-full":"inline-flex",R??""].filter(Boolean).join(" "),style:{...d(u,c,o),...z},...S,children:[null!=M?e("span",{ref:E,"aria-hidden":"true",className:["pointer-events-none absolute rounded-full","left-(--n-seg-x) top-(--n-seg-y) h-(--n-seg-h) w-(--n-seg-w)",j[o],k,"[transition-property:left,top,width,height]","[transition-timing-function:var(--neba-ease)]","[transition-duration:0ms] data-[ready]:[transition-duration:var(--neba-duration)]"].join(" ")}):null,A]})})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{glowClasses as n,trackPointer as r}from"../../internal/glow.js";import{Radio as o}from"@base-ui/react/radio";import{RadioGroup as s}from"@base-ui/react/radio-group";import{observeResize as l}from"../../internal/observe.js";import{controlHeightClasses as i,controlSlots as d,controlTextClasses as u,cx as f,gapClasses as c,hasContent as b,iconClasses as p,paddingXClasses as h,surfaceClasses as m,transitionClasses as g}from"../../internal/styles.js";import{useStyleDefaults as v}from"../../internal/defaults.js";const x=/*@__PURE__*/a.createContext({variant:"outline",size:"md",density:"default",fullWidth:!1,disabled:!1,readOnly:!1}),y={solid:`${m} bg-(--n-panel) p-1 [box-shadow:var(--n-elev),var(--neba-plate-glass)]`,outline:`${m} border bg-(--n-panel) p-1 [border-color:var(--n-line)] [box-shadow:var(--n-elev),var(--neba-plate-glass)]`,text:""},w={solid:"bg-transparent p-1",outline:"border bg-transparent p-1 [border-color:var(--neba-disabled-border)]",text:""},j={solid:`${m} bg-(--n-fill) [box-shadow:var(--neba-shadow-1),var(--neba-plate-solid)]`,outline:`${m} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,text:`${m} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`},k="data-[off]:bg-(--neba-disabled-bg) data-[off]:[box-shadow:none]",$={solid:"data-[checked]:text-(--n-on-solid)",outline:"data-[checked]:text-(--n-on-tint)",text:"data-[checked]:text-(--n-on-tint)"};export const Segment=/*@__PURE__*/a.forwardRef(function Segment({value:s,startIcon:l,endIcon:d,disabled:m=!1,className:v,children:y,...w},j){const k=a.useContext(x),{variant:N,size:P,density:R,fullWidth:z}=k,A=m||k.disabled,S=k.readOnly&&!A;return t(o.Root,{ref:j,value:s,disabled:m,"data-segment":"",className:f("neba-segment relative z-10 inline-flex shrink-0 items-center justify-center select-none","whitespace-nowrap font-medium","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",i[P],u[P],c[P],h[R][P],"rounded-full",g,p,A?"cursor-not-allowed text-(--neba-disabled-fg)":S?f("cursor-default text-(--neba-muted-fg)",$[N]):f("cursor-pointer text-(--neba-muted-fg) hover:text-(--neba-fg)",$[N],n),"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",z?"flex-1":"",v??""),...w,onPointerMove:r(w.onPointerMove,!A&&!S),children:[b(l)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:l}):null,y,b(d)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:d}):null]})});export const SegmentedButton=/*@__PURE__*/a.forwardRef(function SegmentedButton(n,r){const{variant:o="outline",size:i="md",color:u="primary",density:f="default",elevation:c=0,value:b,defaultValue:p=null,onValueChange:h,disabled:m=!1,readOnly:$=!1,name:N,fullWidth:P=!1,className:R,style:z,children:A,...S}=v(n,["size","density","variant"]),[W,C]=a.useState(p),O=void 0!==b,B=O?b:W,M=a.useRef(null),V=a.useRef(null),E=a.useCallback(e=>{const t=M.current,a=V.current;if(!t||!a)return;const n=t.querySelector("[data-segment][data-checked]");if(a.hidden=!n,!n)return void a.removeAttribute("data-ready");a.toggleAttribute("data-off",n.hasAttribute("data-disabled"));const r=!e||!a.hasAttribute("data-ready");r&&a.removeAttribute("data-ready"),a.style.setProperty("--n-seg-x",`${n.offsetLeft}px`),a.style.setProperty("--n-seg-y",`${n.offsetTop}px`),a.style.setProperty("--n-seg-w",`${n.offsetWidth}px`),a.style.setProperty("--n-seg-h",`${n.offsetHeight}px`),r&&a.offsetWidth,a.setAttribute("data-ready","")},[]);a.useLayoutEffect(()=>{E(!0)},[E,B,o,i,f,P,m,A]),a.useEffect(()=>{const e=M.current;if(e)return l(e,()=>E(!1))},[E]);const I=a.useMemo(()=>({variant:o,size:i,density:f,fullWidth:P,disabled:m,readOnly:$}),[o,i,f,P,m,$]);return e(x.Provider,{value:I,children:t(s,{ref:e=>{M.current=e,"function"==typeof r?r(e):r&&(r.current=e)},value:B,onValueChange:e=>{const t=e??null;O||C(t),h?.(t)},disabled:m,readOnly:$,name:N,className:["relative items-center rounded-full",m?w[o]:y[o],g,$?"[filter:saturate(0.55)]":"",P?"flex w-full":"inline-flex",R??""].filter(Boolean).join(" "),style:{...d(u,c,o),...z},...S,children:[null!=B?e("span",{ref:V,"aria-hidden":"true",className:["pointer-events-none absolute rounded-full","left-(--n-seg-x) top-(--n-seg-y) h-(--n-seg-h) w-(--n-seg-w)",j[o],k,"[transition-property:left,top,width,height]","[transition-timing-function:var(--neba-ease)]","[transition-duration:0ms] data-[ready]:[transition-duration:var(--neba-duration)]"].join(" ")}):null,A]})})});
@@ -64,7 +64,8 @@ export interface SelectProps extends NebaStyleProps, Omit<React.ComponentPropsWi
64
64
  label?: React.ReactNode;
65
65
  /**
66
66
  * Where the label is drawn: above the trigger, in a notch cut into its top
67
- * edge, or inside it until something is chosen or the list is open. A
67
+ * edge, or inside it while nothing is chosen, the trigger does not hold the
68
+ * focus and the list is closed. A
68
69
  * `startIcon` keeps a `float` label in the notch.
69
70
  * @default 'top'
70
71
  */
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Select as t}from"@base-ui/react/select";import{Field as r}from"@base-ui/react/field";import{CheckIcon as n,ChevronIcon as i}from"../../internal/icons.js";import{WidthSizer as s}from"../../internal/sizer.js";import{controlTextLeadingClasses as o,cx as d,disabledClasses as c,fieldFocusTransitionClasses as m,fieldHeightClasses as u,fieldReadOnlyClasses as p,fieldRestClasses as b,fieldRingClasses as f,fieldSheetClasses as h,fieldSheetDisabledClasses as g,fieldSheetReadOnlyClasses as v,gapClasses as x,hasContent as N,iconClasses as j,metaTextClasses as y,paddingXClasses as w,popupFadeClasses as $,radiusClasses as z,readOnlyFilterClasses as I,stackGapClasses as S,surfaceClasses as P,surfaceSlots as V,transitionClasses as k}from"../../internal/styles.js";import{useStyleDefaults as C}from"../../internal/defaults.js";import{FieldNotch as M,NotchFrame as O}from"../../internal/notch.js";import{fieldSpotlightSlot as R,glowClasses as T,trackPointer as q}from"../../internal/glow.js";import{useFieldsetDisabled as G}from"../../internal/fieldset.js";const L=["group relative flex w-full cursor-pointer items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",k,m,j].join(" "),W=[P,"max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain","min-w-[var(--anchor-width)] border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",$].join(" "),_=["py-1.5 pe-2 ps-7 font-semibold tracking-wide text-(--neba-muted-fg) uppercase"].join(" "),D=["relative flex cursor-pointer items-center gap-2 select-none","rounded-(--neba-radius-xs) py-1.5 pe-2 ps-7",k,"data-[highlighted]:bg-(--n-soft-hover) data-[highlighted]:text-(--n-on-tint)","data-[selected]:text-(--n-on-tint) data-[selected]:font-medium","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]"].join(" ");export const Select=/*@__PURE__*/l.forwardRef(function Select(m,j){const{variant:$="outline",size:P="md",color:k="primary",density:E="default",elevation:A=0,items:B,value:F,defaultValue:H,onValueChange:J,placeholder:K,label:Q,labelPlacement:U="top",description:X,error:Y,invalid:Z,startIcon:ee,fullWidth:ae=!1,disabled:le,readOnly:te=!1,required:re=!1,name:ne,id:ie,className:se,classNames:oe,style:de,"aria-label":ce,"aria-labelledby":me,...ue}=C(m,["size","density","variant","labelPlacement"]),pe=G(le),be=!pe&&!te,fe=null!=Y&&!1!==Y&&""!==Y,he=Z??fe,ge=he?"danger":k,ve=l.useMemo(()=>B.map(e=>({label:e.label??String(e.value),value:e.value})),[B]),xe=l.useMemo(()=>function(e){const a=[];for(const l of e){const e=a.at(-1);e&&e.label===l.group?e.items.push(l):a.push({label:l.group,items:[l]})}return a}(B),[B]),Ne="top"!==U&&N(Q),je=Ne&&"float"===U&&!N(ee),ye=l.useMemo(()=>[...B.map(e=>e.label??String(e.value)),...N(K)?[K]:[],...je?[Q]:[]],[B,K,je,Q]),we=a(t.Trigger,{ref:j,onPointerMove:q(void 0,be),"aria-label":ce,"aria-labelledby":me,className:d(L,u[P],o[P],z[P],x[P],w[E][P],Ne?"":f,pe?(Ne?g:c)[$]:te?`${(Ne?v:p)[$]} cursor-default`:`${(Ne?h:b)[$]} ${T}`,je?"neba-float-control":"",oe?.control),children:[ee?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:ee}):null,a("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(t.Value,{className:["w-full truncate text-start","data-[placeholder]:text-(--neba-muted-fg)"].join(" "),placeholder:K}),e(s,{samples:ye})]}),e(t.Icon,{className:["flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[popup-open]:rotate-180"].join(" "),children:e(i,{})})]});return a(r.Root,{disabled:pe,invalid:he,className:d("flex-col align-top",S[P],ae?"flex w-full":"inline-flex",se??""),style:{...V(ge,A),...be?R:void 0,...de},...ue,children:[Q&&!Ne?e(r.Label,{className:d(y[P],"font-medium",pe?"text-(--neba-disabled-fg)":"text-(--neba-fg)",oe?.label),children:Q}):null,a(t.Root,{id:ie,name:ne,items:ve,value:F,defaultValue:H,onValueChange:e=>J?.(e),disabled:pe,readOnly:te,required:re,children:[Ne?a(O,{label:Q,size:P,density:E,variant:$,labelClassName:oe?.label,className:d(z[P],pe?"cursor-not-allowed":te?`cursor-default ${I}`:"cursor-pointer"),children:[we,e(M,{label:Q,variant:$,disabled:pe,readOnly:te,rests:je,beside:!0,labelClassName:oe?.label})]}):we,e(t.Portal,{children:e(t.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",sideOffset:6,alignItemWithTrigger:!1,children:e(t.Popup,{className:d(W,z[P],o[P],oe?.popup),style:V(ge,3),children:xe.map((l,r)=>{const i=l.items.map(l=>a(t.Item,{value:l.value,disabled:l.disabled,className:d(D,oe?.item),children:[e(t.ItemIndicator,{className:"absolute start-1.5 flex size-4 items-center justify-center",children:e(n,{})}),e(t.ItemText,{className:"truncate",children:l.label??String(l.value)})]},String(l.value)));return void 0===l.label?i:a(t.Group,{children:[e(t.GroupLabel,{className:`${_} ${y[P]}`,children:l.label}),i]},`${l.label}-${r}`)})})})})]}),X?e(r.Description,{className:d(y[P],"text-(--neba-muted-fg)",oe?.description),children:X}):null,e(r.Error,fe?{match:!0,className:d(y[P],"text-(--n-accent)",oe?.error),children:Y}:{className:d(y[P],"text-(--n-accent)",oe?.error)})]})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Select as t}from"@base-ui/react/select";import{Field as r}from"@base-ui/react/field";import{CheckIcon as n,ChevronIcon as i}from"../../internal/icons.js";import{WidthSizer as s}from"../../internal/sizer.js";import{controlTextLeadingClasses as o,cx as d,disabledClasses as c,fieldFocusTransitionClasses as m,fieldHeightClasses as u,fieldReadOnlyClasses as p,fieldRestClasses as b,fieldRingClasses as f,fieldSheetClasses as h,fieldSheetDisabledClasses as g,fieldSheetReadOnlyClasses as v,gapClasses as x,hasContent as N,iconClasses as j,metaTextClasses as y,paddingXClasses as w,popupFadeClasses as $,radiusClasses as z,readOnlyFilterClasses as I,stackGapClasses as S,surfaceClasses as P,surfaceSlots as V,transitionClasses as k}from"../../internal/styles.js";import{useStyleDefaults as C}from"../../internal/defaults.js";import{FieldNotch as M,NotchFrame as O}from"../../internal/notch.js";import{fieldSpotlightSlot as R,glowClasses as T,trackPointer as q}from"../../internal/glow.js";import{useFieldsetDisabled as G}from"../../internal/fieldset.js";const L=["group relative flex w-full cursor-pointer items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",k,m,j].join(" "),W=[P,"max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain","min-w-[var(--anchor-width)] border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",$].join(" "),_=["py-1.5 pe-2 ps-7 font-semibold tracking-wide text-(--neba-muted-fg) uppercase"].join(" "),D=["relative flex cursor-pointer items-center gap-2 select-none","rounded-(--neba-radius-xs) py-1.5 pe-2 ps-7",k,"data-[highlighted]:bg-(--n-soft-hover) data-[highlighted]:text-(--n-on-tint)","data-[selected]:text-(--n-on-tint) data-[selected]:font-medium","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]"].join(" ");export const Select=/*@__PURE__*/l.forwardRef(function Select(m,j){const{variant:$="outline",size:P="md",color:k="primary",density:E="default",elevation:A=0,items:B,value:F,defaultValue:H,onValueChange:J,placeholder:K,label:Q,labelPlacement:U="top",description:X,error:Y,invalid:Z,startIcon:ee,fullWidth:ae=!1,disabled:le,readOnly:te=!1,required:re=!1,name:ne,id:ie,className:se,classNames:oe,style:de,"aria-label":ce,"aria-labelledby":me,...ue}=C(m,["size","density","variant","labelPlacement"]),pe=G(le),be=!pe&&!te,fe=null!=Y&&!1!==Y&&""!==Y,he=Z??fe,ge=he?"danger":k,ve=l.useMemo(()=>B.map(e=>({label:e.label??String(e.value),value:e.value})),[B]),xe=l.useMemo(()=>function(e){const a=[];for(const l of e){const e=a.at(-1);e&&e.label===l.group?e.items.push(l):a.push({label:l.group,items:[l]})}return a}(B),[B]),Ne="top"!==U&&N(Q),je=Ne&&"float"===U&&!N(ee),ye=l.useMemo(()=>[...B.map(e=>e.label??String(e.value)),...N(K)?[K]:[],...je?[Q]:[]],[B,K,je,Q]),we=a(t.Trigger,{ref:j,onPointerMove:q(void 0,be),"aria-label":ce,"aria-labelledby":me,className:d(L,u[P],o[P],z[P],x[P],w[E][P],Ne?"":f,pe?(Ne?g:c)[$]:te?Ne?`${v[$]} ${I} cursor-default`:`${p[$]} cursor-default`:`${(Ne?h:b)[$]} ${T}`,je?"neba-float-control":"",oe?.control),children:[ee?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:ee}):null,a("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(t.Value,{className:["w-full truncate text-start","data-[placeholder]:text-(--neba-muted-fg)"].join(" "),placeholder:K}),e(s,{samples:ye})]}),e(t.Icon,{className:["flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[popup-open]:rotate-180"].join(" "),children:e(i,{})})]});return a(r.Root,{disabled:pe,invalid:he,className:d("flex-col align-top",S[P],ae?"flex w-full":"inline-flex",se??""),style:{...V(ge,A),...be?R:void 0,...de},...ue,children:[Q&&!Ne?e(r.Label,{className:d(y[P],"font-medium",pe?"text-(--neba-disabled-fg)":"text-(--neba-fg)",oe?.label),children:Q}):null,a(t.Root,{id:ie,name:ne,items:ve,value:F,defaultValue:H,onValueChange:e=>J?.(e),disabled:pe,readOnly:te,required:re,children:[Ne?a(O,{label:Q,size:P,density:E,variant:$,labelClassName:oe?.label,className:d(z[P],pe?"cursor-not-allowed":te?"cursor-default":"cursor-pointer"),children:[we,e(M,{label:Q,variant:$,disabled:pe,readOnly:te,rests:je,beside:!0,labelClassName:oe?.label})]}):we,e(t.Portal,{children:e(t.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",sideOffset:6,alignItemWithTrigger:!1,children:e(t.Popup,{className:d(W,z[P],o[P],oe?.popup),style:V(ge,3),children:xe.map((l,r)=>{const i=l.items.map(l=>a(t.Item,{value:l.value,disabled:l.disabled,className:d(D,oe?.item),children:[e(t.ItemIndicator,{className:"absolute start-1.5 flex size-4 items-center justify-center",children:e(n,{})}),e(t.ItemText,{className:"truncate",children:l.label??String(l.value)})]},String(l.value)));return void 0===l.label?i:a(t.Group,{children:[e(t.GroupLabel,{className:`${_} ${y[P]}`,children:l.label}),i]},`${l.label}-${r}`)})})})})]}),X?e(r.Description,{className:d(y[P],"text-(--neba-muted-fg)",oe?.description),children:X}):null,e(r.Error,fe?{match:!0,className:d(y[P],"text-(--n-accent)",oe?.error),children:Y}:{className:d(y[P],"text-(--n-accent)",oe?.error)})]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{boxPaddingXClasses as n,boxPaddingYClasses as o}from"../box/Box.js";import{Drawer as a}from"../drawer/Drawer.js";import{beginPointerDrag as s}from"../../internal/drag.js";import{layoutMessages as i,useMessages as l}from"../../internal/i18n.js";import{drawerSide as c,expandedOnlyClasses as u,PageLayoutContext as d,SidebarSideContext as f,useCollapsed as p}from"../../internal/page-layout.js";import{cx as b,surfaceClasses as m,surfaceSlots as g,toLength as h,toPixels as w,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const x={xs:"11rem",sm:"13rem",md:"16rem",lg:"18rem",xl:"21rem"},R={solid:[m,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[m,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};export const Sidebar=/*@__PURE__*/r.forwardRef(function Sidebar(m,S){const{side:j,width:B,minWidth:C=160,maxWidth:z=480,resizable:E=!1,onResize:N,onResizeEnd:k,collapseBelow:A,open:M,defaultOpen:O=!1,onOpenChange:D,sticky:L,title:P,variant:T="outline",size:I="md",color:W="primary",density:$="default",elevation:_=0,divider:X=!0,padded:K=!0,label:V,locale:q,className:F,style:G,children:H,...J}=y(m,["size","density","variant","locale"]),Q=r.useContext(d),U=r.useContext(f),Y=j??U??"start",Z=q??Q.locale,ee=l(i,Z),te=A??(Q.present?Q.collapseBelow:"none"),re=p(te),ne=L??Q.present;r.useEffect(()=>{"production"!==process.env.NODE_ENV&&Q.present&&void 0!==A&&A!==Q.collapseBelow&&console.warn(`Neba: a Sidebar collapses below "${A}" and its PageLayout below "${Q.collapseBelow}". A SidebarTrigger follows the layout, so between the two widths the drawer has nothing to open it. Set collapseBelow on the PageLayout instead.`)},[Q.present,Q.collapseBelow,A]);const[oe,ae]=r.useState(O),se=void 0!==M,ie=se?M:Q.present?Q.open[Y]:oe,le=e=>{se||(Q.present?Q.setOpen(Y,e):ae(e)),D?.(e)},ce=r.useRef(ie),ue=r.useRef(le),de=r.useRef(re);r.useEffect(()=>{ce.current=ie,ue.current=le}),r.useEffect(()=>{de.current&&!re&&ce.current&&ue.current(!1),de.current=re},[re]);const fe=h(B)??x[I],pe=r.useRef(null),be=r.useCallback(e=>{pe.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),me=r.useRef(null);r.useEffect(()=>()=>me.current?.(),[]);const ge=r.useRef(null),he=(e,t,r)=>null==t?r:"number"==typeof t?t:w(t,{percentOf:"undefined"==typeof window?0:window.innerWidth,relativeTo:e})??r,we=(e,t)=>{const r=ge.current;r&&(r.setAttribute("aria-valuenow",String(Math.round(t))),r.setAttribute("aria-valuemin",String(Math.round(he(e,C,160)))),r.setAttribute("aria-valuemax",String(Math.round(he(e,z,480)))))};r.useEffect(()=>{const e=pe.current;E&&e&&we(e,e.getBoundingClientRect().width)},[E,C,z,fe]);const ve=e=>{const t=pe.current;if(!t)return e;const r=Math.min(he(t,z,480),Math.max(he(t,C,160),Math.round(e)));return t.style.setProperty("--n-sidebar-w",`${r}px`),we(t,r),r},ye=e("div",{className:b("min-h-0 flex-1 overflow-y-auto overscroll-contain",K?b(n[$][I],o[$][I]):""),children:H});return re?e(a,{side:c(Y),mode:"overlay",open:ie,onOpenChange:le,title:P,size:I,color:W,density:$,locale:Z,closeLabel:ee.closeSidebar,extent:void 0===B?void 0:fe,"aria-label":P?void 0:V??ee.sidebar,className:F,style:G,...J,children:H}):t("aside",{ref:be,"aria-label":V??ee.sidebar,className:b("relative flex min-w-0 shrink-0 flex-col","w-(--n-sidebar-w)",R[T],X?b("start"===Y?"border-e":"border-s","[border-color:var(--n-line)]"):"","content"===Q.scroll?"h-full":ne?b("self-start","sticky [top:var(--n-layout-header,0px)]","[height:calc(100dvh-var(--n-layout-header,0px)-var(--n-layout-footer,0px))]"):"",u[te],v,F),style:{...g(W,_),"--n-sidebar-w":fe,...G},...J,children:[ye,E?e("div",{ref:ge,role:"separator","aria-orientation":"vertical","aria-label":ee.resizeSidebar,tabIndex:0,className:b("neba-hit absolute inset-y-0 z-1 w-2 cursor-col-resize touch-none","start"===Y?"end-0 -me-1":"start-0 -ms-1","bg-transparent hover:bg-(--n-soft) data-[dragging]:bg-(--n-soft)",v,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-0"),onPointerDown:e=>{const t=pe.current;if(!t||0!==e.button)return;const r=e.currentTarget,n=e.clientX,o=t.getBoundingClientRect().width,a="rtl"===getComputedStyle(t).direction,i="start"===Y===a?-1:1;let l=o;me.current=s({target:r,pointerId:e.pointerId,onMove:e=>{l=ve(o+(e.clientX-n)*i),N?.(l)},onEnd:()=>{me.current=null,k?.(l)}})},onKeyDown:e=>{if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const t="rtl"===getComputedStyle(e.currentTarget).direction,r="start"===Y===t?-1:1;(e=>{const t=pe.current;if(!t)return;const r=ve(t.getBoundingClientRect().width+e);N?.(r),k?.(r)})(("ArrowRight"===e.key?16:-16)*r)}}):null]})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{boxPaddingXClasses as n,boxPaddingYClasses as o}from"../box/Box.js";import{Drawer as a}from"../drawer/Drawer.js";import{beginPointerDrag as s,drawnScale as l}from"../../internal/drag.js";import{layoutMessages as i,useMessages as c}from"../../internal/i18n.js";import{drawerSide as u,expandedOnlyClasses as d,PageLayoutContext as f,SidebarSideContext as p,useCollapsed as b}from"../../internal/page-layout.js";import{cx as m,surfaceClasses as h,surfaceSlots as v,toLength as w,toPixels as g,transitionClasses as y}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const S={xs:"11rem",sm:"13rem",md:"16rem",lg:"18rem",xl:"21rem"},j={solid:[h,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[h,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};export const Sidebar=/*@__PURE__*/r.forwardRef(function Sidebar(h,R){const z=r.useContext(f),{side:E,width:N,minWidth:k=160,maxWidth:A=480,resizable:B=!1,onResize:C,onResizeEnd:M,collapseBelow:O,open:W,defaultOpen:D=!1,onOpenChange:L,sticky:P,title:T,variant:I="outline",size:$="md",color:_="primary",density:X="default",elevation:K=0,divider:V=!0,padded:q=!0,label:F,locale:G,className:H,style:J,children:Q,...U}=x(h,["size","density","variant","locale"],{locale:z.locale}),Y=r.useContext(p),Z=E??Y??"start",ee=G??z.locale,te=c(i,ee),re=O??(z.present?z.collapseBelow:"none"),ne=b(re),oe=P??z.present;r.useEffect(()=>{"production"!==process.env.NODE_ENV&&z.present&&void 0!==O&&O!==z.collapseBelow&&console.warn(`Neba: a Sidebar collapses below "${O}" and its PageLayout below "${z.collapseBelow}". A SidebarTrigger follows the layout, so between the two widths the drawer has nothing to open it. Set collapseBelow on the PageLayout instead.`)},[z.present,z.collapseBelow,O]);const[ae,se]=r.useState(D),le=void 0!==W,ie=le?W:z.present?z.open[Z]:ae,ce=e=>{le||(z.present?z.setOpen(Z,e):se(e)),L?.(e)},ue=r.useRef(ie),de=r.useRef(ce),fe=r.useRef(ne);r.useEffect(()=>{ue.current=ie,de.current=ce}),r.useEffect(()=>{fe.current&&!ne&&ue.current&&de.current(!1),fe.current=ne},[ne]);const pe=w(N)??S[$],be=r.useRef(null),me=r.useCallback(e=>{be.current=e,"function"==typeof R?R(e):R&&(R.current=e)},[R]),he=r.useRef(null);r.useEffect(()=>()=>he.current?.(),[]);const ve=r.useRef(null),we=(e,t,r)=>null==t?r:"number"==typeof t?t:g(t,{percentOf:"undefined"==typeof window?0:window.innerWidth,relativeTo:e})??r,ge=(e,t)=>{const r=ve.current;r&&(r.setAttribute("aria-valuenow",String(Math.round(t))),r.setAttribute("aria-valuemin",String(Math.round(we(e,k,160)))),r.setAttribute("aria-valuemax",String(Math.round(we(e,A,480)))))};r.useEffect(()=>{const e=be.current;B&&e&&ge(e,e.offsetWidth)},[B,k,A,pe,ne]);const ye=e=>{const t=be.current;if(!t)return e;const r=Math.min(we(t,A,480),Math.max(we(t,k,160),Math.round(e)));return t.style.setProperty("--n-sidebar-w",`${r}px`),ge(t,r),r},xe=e("div",{className:m("min-h-0 flex-1 overflow-y-auto overscroll-contain",q?m(n[X][$],o[X][$]):""),children:Q});return ne?e(a,{side:u(Z),mode:"overlay",open:ie,onOpenChange:ce,title:T,size:$,color:_,density:X,locale:ee,closeLabel:te.closeSidebar,extent:void 0===N?void 0:pe,"aria-label":T?void 0:F??te.sidebar,className:H,style:J,...U,children:Q}):t("aside",{ref:me,"aria-label":F??te.sidebar,className:m("relative flex min-w-0 shrink-0 flex-col","w-(--n-sidebar-w)",j[I],V?m("start"===Z?"border-e":"border-s","[border-color:var(--n-line)]"):"","content"===z.scroll?"h-full":oe?m("self-start","sticky [top:var(--n-layout-header,0px)]","[height:calc(100dvh-var(--n-layout-header,0px)-var(--n-layout-footer,0px))]"):"",d[re],y,H),style:{...v(_,K),"--n-sidebar-w":pe,...J},...U,children:[xe,B?e("div",{ref:ve,role:"separator","aria-orientation":"vertical","aria-label":te.resizeSidebar,tabIndex:0,className:m("neba-hit absolute inset-y-0 z-1 w-2 cursor-col-resize touch-none","start"===Z?"end-0 -me-1":"start-0 -ms-1","bg-transparent hover:bg-(--n-soft) data-[dragging]:bg-(--n-soft)",y,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-0"),onPointerDown:e=>{const t=be.current;if(!t||0!==e.button)return;const r=e.currentTarget,n=e.clientX,o=t.offsetWidth,a=l(t).x,i="rtl"===getComputedStyle(t).direction,c="start"===Z===i?-1:1;let u=o;he.current=s({target:r,pointerId:e.pointerId,onMove:e=>{u=ye(o+(e.clientX-n)/a*c),C?.(u)},onEnd:()=>{he.current=null,M?.(u)}})},onKeyDown:e=>{if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const t="rtl"===getComputedStyle(e.currentTarget).direction,r="start"===Z===t?-1:1;(e=>{const t=be.current;if(!t)return;const r=ye(t.offsetWidth+e);C?.(r),M?.(r)})(("ArrowRight"===e.key?16:-16)*r)}}):null]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{IconButton as o}from"../icon-button/IconButton.js";import{layoutMessages as n,useMessages as t}from"../../internal/i18n.js";import{collapsedOnlyClasses as a,PageLayoutContext as i}from"../../internal/page-layout.js";import{cx as l}from"../../internal/styles.js";import{useStyleDefaults as s}from"../../internal/defaults.js";function MenuIcon(){return e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:e("path",{d:"M4 7h16M4 12h16M4 17h16",strokeLinecap:"round"})})}export const SidebarTrigger=/*@__PURE__*/r.forwardRef(function SidebarTrigger(c,p){const{side:u="start",collapseBelow:m,icon:d,label:f,locale:b,variant:h="text",className:j,onClick:x,...g}=s(c,["variant","locale"]),k=r.useContext(i),v=b??k.locale,M=t(n,v);if(!k.present)return null;const w=m??k.collapseBelow,B=k.open[u];return e(o,{ref:p,variant:h,icon:d??e(MenuIcon,{}),label:f??(B?M.closeSidebar:M.openSidebar),"aria-expanded":B,className:l(a[w],j),onClick:e=>{k.setOpen(u,!B),x?.(e)},...g})});
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{IconButton as o}from"../icon-button/IconButton.js";import{layoutMessages as n,useMessages as t}from"../../internal/i18n.js";import{collapsedOnlyClasses as a,PageLayoutContext as i}from"../../internal/page-layout.js";import{cx as l}from"../../internal/styles.js";import{useStyleDefaults as s}from"../../internal/defaults.js";function MenuIcon(){return e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:e("path",{d:"M4 7h16M4 12h16M4 17h16",strokeLinecap:"round"})})}export const SidebarTrigger=/*@__PURE__*/r.forwardRef(function SidebarTrigger(c,p){const u=r.useContext(i),{side:m="start",collapseBelow:d,icon:f,label:b,locale:h,variant:j="text",className:x,onClick:g,...k}=s(c,["variant","locale"],{locale:u.locale}),v=h??u.locale,M=t(n,v);if(!u.present)return null;const w=d??u.collapseBelow,B=u.open[m];return e(o,{ref:p,variant:j,icon:f??e(MenuIcon,{}),label:b??(B?M.closeSidebar:M.openSidebar),"aria-expanded":B,className:l(a[w],x),onClick:e=>{u.setOpen(m,!B),g?.(e)},...k})});
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useRender as l}from"@base-ui/react/use-render";import{controlHeightClasses as n,controlSquareClasses as s,cx as d,srOnlyClasses as o,surfaceSlots as a}from"../../internal/styles.js";import{useStyleDefaults as m}from"../../internal/defaults.js";const i={xs:"h-[0.6875rem]",sm:"h-[0.75rem]",md:"h-[0.8125rem]",lg:"h-[0.9375rem]",xl:"h-[1.0625rem]"},t={xs:"gap-[0.3125rem]",sm:"gap-[0.375rem]",md:"gap-[0.5625rem]",lg:"gap-[0.5625rem]",xl:"gap-[0.6875rem]"},u={xs:"rounded-[0.3125rem]",sm:"rounded-[0.3125rem]",md:"rounded-[0.375rem]",lg:"rounded-[0.4375rem]",xl:"rounded-[0.5rem]"},h={xs:"h-12",sm:"h-16",md:"h-20",lg:"h-28",xl:"h-36"},f={xs:"rounded-(--neba-radius-xs)",sm:"rounded-(--neba-radius-sm)",md:"rounded-(--neba-radius-md)",lg:"rounded-(--neba-radius-lg)",xl:"rounded-(--neba-radius-xl)"},c="relative overflow-hidden bg-(--n-soft-hover)";function x(e){if(void 0!==e)return"number"==typeof e?`${e}px`:e}export const Skeleton=/*@__PURE__*/r.forwardRef(function Skeleton(r,p){const{shape:g="line",lines:b=1,size:w="md",color:$="secondary",width:v,height:y,animated:j=!0,label:k,render:N,className:z,style:S,...A}=m(r,["size"]),B=j?"neba-skeleton":"",R="circle"===g?`rounded-full ${n[w]} ${s[w]} shrink-0`:"rect"===g?`w-full ${f[w]} ${void 0===y?h[w]:""}`:`w-full ${u[w]} ${i[w]}`,q=k?{role:"status"}:{"aria-hidden":!0},C=k?e("span",{className:o,children:k}):null,D="line"===g&&b>1;return l({render:N,ref:p,props:{className:(D?["flex w-full flex-col",t[w],z??""]:[c,B,R,z??""]).filter(Boolean).join(" "),style:{...a($,0),width:x(v),height:x(y),...S},...q,...D?{children:[C,...Array.from({length:b},(r,l)=>e("div",{className:d(c,B,u[w],i[w],l===b-1?"w-3/5":"w-full")},l))]}:{children:C},...A}})});
1
+ "use client";import{jsx as e,Fragment as r,jsxs as l}from"react/jsx-runtime";import*as n from"react";import{useRender as s}from"@base-ui/react/use-render";import{controlHeightClasses as d,controlSquareClasses as a,cx as o,srOnlyClasses as m,surfaceSlots as i}from"../../internal/styles.js";import{useStyleDefaults as t}from"../../internal/defaults.js";const u={xs:"h-[0.6875rem]",sm:"h-[0.75rem]",md:"h-[0.8125rem]",lg:"h-[0.9375rem]",xl:"h-[1.0625rem]"},h={xs:"gap-[0.3125rem]",sm:"gap-[0.375rem]",md:"gap-[0.5625rem]",lg:"gap-[0.5625rem]",xl:"gap-[0.6875rem]"},f={xs:"rounded-[0.3125rem]",sm:"rounded-[0.3125rem]",md:"rounded-[0.375rem]",lg:"rounded-[0.4375rem]",xl:"rounded-[0.5rem]"},c={xs:"h-12",sm:"h-16",md:"h-20",lg:"h-28",xl:"h-36"},x={xs:"rounded-(--neba-radius-xs)",sm:"rounded-(--neba-radius-sm)",md:"rounded-(--neba-radius-md)",lg:"rounded-(--neba-radius-lg)",xl:"rounded-(--neba-radius-xl)"},p="relative overflow-hidden bg-(--n-soft-hover)";function g(e){if(void 0!==e)return"number"==typeof e?`${e}px`:e}export const Skeleton=/*@__PURE__*/n.forwardRef(function Skeleton(n,b){const{shape:w="line",lines:$=1,size:j="md",color:v="secondary",width:y,height:k,animated:N=!0,label:z,render:S,className:A,style:B,...F}=t(n,["size"]),R=N?"neba-skeleton":"",q="circle"===w?`rounded-full ${d[j]} ${a[j]} shrink-0`:"rect"===w?`w-full ${x[j]} ${void 0===k?c[j]:""}`:`w-full ${f[j]} ${u[j]}`,C=z?{role:"status"}:{"aria-hidden":!0},D=z?e("span",{className:m,children:z}):null,E="line"===w&&$>1;return s({render:S,ref:b,props:{className:(E?["flex w-full flex-col",h[j],A??""]:[p,R,q,A??""]).filter(Boolean).join(" "),style:{...i(v,0),width:g(y),height:g(k),...B},...C,...E?{children:l(r,{children:[D,Array.from({length:$},(r,l)=>e("div",{className:o(p,R,f[j],u[j],l===$-1?"w-3/5":"w-full")},l))]})}:{children:D},...F}})});
@@ -15,7 +15,7 @@ export interface SourceItem {
15
15
  description?: React.ReactNode;
16
16
  /** Where it came from, set beside the title. A domain, a publication. */
17
17
  site?: React.ReactNode;
18
- /** A favicon or a thumbnail, in the square before the number. */
18
+ /** A favicon or a thumbnail, in the square between the number and the title. */
19
19
  icon?: React.ReactNode;
20
20
  /**
21
21
  * The number this source is cited by, overriding its place in the list. For a
@@ -1 +1 @@
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 l,boxPaddingYClasses as s}from"../box/Box.js";import{ChevronIcon as i}from"../../internal/icons.js";import{TextLink as r}from"../text-link/TextLink.js";import{safeHref as o,safeRel as m}from"../../internal/link.js";import{sourcesMessages as c,useMessages as d}from"../../internal/i18n.js";import{citationMarkClasses as f,collapsiblePanelClasses as p,cx as u,gapClasses as b,hasContent as h,iconClasses as x,metaTextClasses as g,radiusClasses as v,sheetBodyClasses as N,sheetTitleClasses as j,surfaceClasses as w,surfaceSlots as y,transitionClasses as z}from"../../internal/styles.js";import{useStyleDefaults as k}from"../../internal/defaults.js";const _={solid:[w,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[w,"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"},C={xs:"size-3.5",sm:"size-4",md:"size-4.5",lg:"size-5",xl:"size-6"};export const Sources=/*@__PURE__*/t.forwardRef(function Sources(w,O){const{variant:S="text",size:R="md",color:T="primary",density:$="default",elevation:B=0,items:L,title:P,collapsible:q=!0,open:A,defaultOpen:D=!1,onOpenChange:E,numbered:F=!0,locale:G,labels:H,classNames:I,className:J,style:K,...M}=k(w,["size","density","variant","locale"]),Q={...d(c,G),...H},[U,V]=t.useState(D),W=void 0!==A,X=W?A:U,Y=l[$][R],Z=s[$][R],ee=h(P)?P:Q.title,ne=e("ol",{role:"list",className:u("m-0 flex list-none flex-col gap-2 p-0",Y,"compact"===$?"pb-2":"pb-4",N[R],I?.list??""),children:L.map((t,a)=>{const l=t.index??a+1,s=o(t.href),i=n("span",{className:"min-w-0 font-medium",children:[t.title,h(t.site)?e("span",{className:u("ms-2 font-normal text-(--neba-muted-fg)",g[R]),children:t.site}):null]});return n("li",{className:u("flex min-w-0 items-baseline gap-2",I?.item??""),children:[F?e("span",{"aria-hidden":"true",className:f,children:l}):null,h(t.icon)?e("span",{className:u("inline-flex shrink-0 items-center justify-center self-center overflow-hidden","rounded-[0.25rem] [&_img]:size-full [&_img]:object-cover",C[R]),children:t.icon}):null,n("span",{className:"flex min-w-0 flex-col gap-0.5",children:[s?e(r,{href:s,underline:"hover",target:t.target,rel:m(t.target,t.rel),className:"min-w-0",children:i}):i,h(t.description)?e("span",{className:u("min-w-0 text-(--neba-muted-fg)",g[R]),children:t.description}):null]})]},`${l}-${s??a}`)})}),te=u("flex flex-col overflow-hidden",v[R],_[S],z,x,J??""),ae={...y(T,B),...K};return q?n(a.Root,{ref:O,open:X,onOpenChange:e=>{W||V(e),E?.(e)},className:te,style:ae,...M,children:[n(a.Trigger,{className:u("flex w-full cursor-pointer items-center text-start font-semibold text-(--neba-fg)",Y,Z,b[R],j[R],z,"hover:bg-(--n-soft)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",I?.header??""),children:[e("span",{className:"min-w-0 truncate",children:ee}),e("span",{className:"shrink-0 font-normal text-(--neba-muted-fg) tabular-nums",children:L.length}),e("span",{className:["ms-auto flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[panel-open]:rotate-180"].join(" "),children:e(i,{})})]}),e(a.Panel,{className:p,children:ne})]}):n("div",{ref:O,className:te,style:ae,...M,children:[n("div",{className:u("flex items-center font-semibold text-(--neba-fg)",Y,Z,b[R],j[R],I?.header??""),children:[ee,e("span",{className:"text-(--neba-muted-fg) tabular-nums",children:L.length})]}),ne]})});
1
+ "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as l from"react";import{Collapsible as s}from"@base-ui/react/collapsible";import{boxPaddingXClasses as t,boxPaddingYClasses as a}from"../box/Box.js";import{ChevronIcon as i}from"../../internal/icons.js";import{TextLink as r}from"../text-link/TextLink.js";import{safeHref as o,safeRel as m}from"../../internal/link.js";import{sourcesMessages as c,useMessages as d}from"../../internal/i18n.js";import{citationMarkClasses as f,collapsiblePanelClasses as p,cx as u,gapClasses as x,hasContent as b,iconClasses as h,metaTextClasses as g,radiusClasses as v,sheetBodyClasses as N,sheetTitleClasses as j,surfaceClasses as w,surfaceSlots as y,transitionClasses as z,disclosureChevronClasses as k,disclosureTriggerClasses as _}from"../../internal/styles.js";import{useStyleDefaults as C}from"../../internal/defaults.js";const O={solid:[w,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[w,"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"},S={xs:"size-3.5",sm:"size-4",md:"size-4.5",lg:"size-5",xl:"size-6"};export const Sources=/*@__PURE__*/l.forwardRef(function Sources(w,$){const{variant:R="text",size:T="md",color:B="primary",density:L="default",elevation:P=0,items:q,title:A,collapsible:D=!0,open:E,defaultOpen:F=!1,onOpenChange:G,numbered:H=!0,locale:I,labels:J,classNames:K,className:M,style:Q,...U}=C(w,["size","density","variant","locale"]),V={...d(c,I),...J},[W,X]=l.useState(F),Y=void 0!==E,Z=Y?E:W,ee=t[L][T],ne=a[L][T],le=b(A)?A:V.title,se=e("ol",{role:"list",className:u("m-0 flex list-none flex-col gap-2 p-0",ee,"compact"===L?"pb-2":"pb-4",N[T],K?.list??""),children:q.map((l,s)=>{const t=l.index??s+1,a=o(l.href),i=n("span",{className:"min-w-0 font-medium",children:[l.title,b(l.site)?e("span",{className:u("ms-2 font-normal text-(--neba-muted-fg)",g[T]),children:l.site}):null]});return n("li",{className:u("flex min-w-0 items-baseline gap-2",K?.item??""),children:[H?e("span",{"aria-hidden":"true",className:f,children:t}):null,b(l.icon)?e("span",{className:u("inline-flex shrink-0 items-center justify-center self-center overflow-hidden","rounded-[0.25rem] [&_img]:size-full [&_img]:object-cover",S[T]),children:l.icon}):null,n("span",{className:"flex min-w-0 flex-col gap-0.5",children:[a?e(r,{href:a,underline:"hover",target:l.target,rel:m(l.target,l.rel),locale:I,className:"min-w-0",children:i}):i,b(l.description)?e("span",{className:u("min-w-0 text-(--neba-muted-fg)",g[T]),children:l.description}):null]})]},`${t}-${a??s}`)})}),te=u("flex flex-col overflow-hidden",v[T],O[R],z,h,M??""),ae={...y(B,P),...Q};return D?n(s.Root,{ref:$,open:Z,onOpenChange:e=>{Y||X(e),G?.(e)},className:te,style:ae,...U,children:[n(s.Trigger,{className:u("flex w-full cursor-pointer items-center text-start font-semibold text-(--neba-fg)",_,ee,ne,x[T],j[T],z,"hover:bg-(--n-soft)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",K?.header??""),children:[e("span",{className:"min-w-0 truncate",children:le}),e("span",{className:"shrink-0 font-normal text-(--neba-muted-fg) tabular-nums",children:q.length}),e("span",{className:`${k} ms-auto text-(--neba-muted-fg)`,children:e(i,{})})]}),e(s.Panel,{className:p,children:se})]}):n("div",{ref:$,className:te,style:ae,...U,children:[n("div",{className:u("flex items-center font-semibold text-(--neba-fg)",ee,ne,x[T],j[T],K?.header??""),children:[le,e("span",{className:"text-(--neba-muted-fg) tabular-nums",children:q.length})]}),se]})});
@@ -1 +1 @@
1
- "use client";import{jsx as t}from"react/jsx-runtime";import*as e from"react";import{animBaseClass as r,animationClasses as a,animationSlots as l,transitionParts as n}from"../../internal/animate.js";import{cx as i,toLength as s}from"../../internal/styles.js";import{childKey as o}from"../../internal/children.js";import{useStyleDefaults as c}from"../../internal/defaults.js";const m={xs:"0.375rem",sm:"0.5rem",md:"0.625rem",lg:"0.75rem",xl:"0.875rem"};export const Stack=/*@__PURE__*/e.forwardRef(function Stack(d,f){const{direction:p="horizontal",overlap:g,drop:h,size:u="md",max:x,total:y,overflow:v,front:S="first",scaleStep:j=1,opacityStep:$=1,ring:k=!1,transition:z,stagger:w=0,durationStep:M=0,reverse:N=!1,className:b,style:B,children:I,...A}=c(d,["size"]),C=e.Children.toArray(I),R=void 0===x?C:C.slice(0,Math.max(0,x)),q=Math.max(0,(y??C.length)-R.length),D=q>0?v?.(q):null,E=null==D?R:[...R,D],F=s(g??m[u]),G=s(h??g??m[u]),H="vertical"===p,J="diagonal"===p,K=n(z),L=K?`${r} ${a[K.effect]}`:"";return t("span",{ref:f,className:i("isolate inline-flex",H?"flex-col items-start":"items-start",k?"[&>*>*>*]:ring-2 [&>*>*>*]:ring-(--neba-surface)":"",b??""),style:B,...A,children:E.map((e,r)=>{const a=N?E.length-1-r:r,n=K?l({...K.slots,delay:K.slots.delay+a*w,duration:Math.max(0,K.slots.duration+a*M)}):void 0;return t("span",{"data-neba-stack-item":"",className:L||void 0,style:{...n,...0===r?null:H?{marginBlockStart:`calc(${F} * -1)`}:{marginInlineStart:`calc(${F} * -1)`},...J?{marginBlockStart:`calc(${G} * ${r})`}:null,zIndex:"first"===S?E.length-r:r+1},children:t("span",{style:{display:"inline-flex",scale:1===j?void 0:String(j**r),opacity:1===$?void 0:$**r},children:e})},r===R.length?"overflow":o(e,r))})})});
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import*as e from"react";import{animBaseClass as r,animationClasses as a,animationSlots as n,transitionParts as l}from"../../internal/animate.js";import{cx as i,toLength as s}from"../../internal/styles.js";import{childKey as o}from"../../internal/children.js";import{useStyleDefaults as c}from"../../internal/defaults.js";const m={xs:"0.375rem",sm:"0.5rem",md:"0.625rem",lg:"0.75rem",xl:"0.875rem"};export const Stack=/*@__PURE__*/e.forwardRef(function Stack(d,f){const{direction:p="horizontal",overlap:g,drop:h,size:u="md",max:x,total:y,overflow:v,front:S="first",scaleStep:j=1,opacityStep:$=1,ring:k=!1,transition:z,stagger:w=0,durationStep:M=0,reverse:N=!1,className:b,style:B,children:I,...A}=c(d,["size"]),C=e.Children.toArray(I),R=void 0===x?C:C.slice(0,Math.max(0,x)),q=Math.max(0,(y??C.length)-R.length),D=q>0?v?.(q):null,E=null==D?R:[...R,D],F=s(g??m[u]),G=s(h??g??m[u]),H="vertical"===p,J="diagonal"===p,K=l(z),L=K?`${r} ${a[K.effect]}`:"";return t("span",{ref:f,className:i("isolate inline-flex",H?"flex-col items-start":"items-start",k?"[&>*>*>*]:ring-2 [&>*>*>*]:ring-(--neba-surface)":"",b??""),style:B,...A,children:E.map((e,r)=>{const a=N?E.length-1-r:r,l=K?{...n({...K.slots,delay:K.slots.delay+a*w,duration:Math.max(0,K.slots.duration+a*M)}),"--n-anim-state":"running"}:void 0;return t("span",{"data-neba-stack-item":"",className:L||void 0,style:{...l,...0===r?null:H?{marginBlockStart:`calc(${F} * -1)`}:{marginInlineStart:`calc(${F} * -1)`},...J?{marginBlockStart:`calc(${G} * ${r})`}:null,zIndex:"first"===S?E.length-r:r+1},children:t("span",{style:{display:"inline-flex",scale:1===j?void 0:String(j**r),opacity:1===$?void 0:$**r},children:e})},r===R.length?"overflow":o(e,r))})})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as r,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{useRender as s}from"@base-ui/react/use-render";import{cx as t,hasContent as i}from"../../internal/styles.js";export const StreamingText=/*@__PURE__*/n.forwardRef(function StreamingText({children:l,streaming:c=!1,cursor:m=!0,fade:o=!0,lines:d=1,color:u="primary",render:p,className:f,style:h,...g},x){const v="string"==typeof l?l:null,y=n.useMemo(()=>null!==v&&o?function(e){return e.split(/(\s+)/).filter(e=>""!==e)}(v):null,[v,o]),b=c&&!1!==m?!0===m?e("span",{"aria-hidden":"true",className:"neba-stream-caret"}):m:null;return s({render:p??e("div",{}),ref:x,props:{"aria-busy":c||void 0,"data-streaming":c||void 0,className:t("min-h-(--n-reserve) whitespace-pre-wrap",f),style:{"--n-reserve":`calc(${Math.max(d,0)} * 1lh)`,"--n-accent":`var(--neba-${u}-accent)`,...h},children:a(r,{children:[y?y.map((r,a)=>/\s/.test(r)?e(n.Fragment,{children:r},a):e("span",{className:"neba-stream-word",children:r},a)):l,i(b)?b:null]}),...g}})});
1
+ "use client";import{jsx as r,Fragment as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{useRender as n}from"@base-ui/react/use-render";import{segmenter as s}from"../../internal/format.js";import{cx as i,hasContent as c}from"../../internal/styles.js";const l=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Thai}\p{Script=Lao}\p{Script=Khmer}\p{Script=Myanmar}]/u;export const StreamingText=/*@__PURE__*/t.forwardRef(function StreamingText({children:m,streaming:p=!1,cursor:o=!0,fade:d=!0,lines:u=1,color:f="primary",render:h,className:g,style:S,...v},x){const y="string"==typeof m?m:null,b=t.useMemo(()=>null!==y&&d?function(r){const e=r.split(/(\s+)/).filter(r=>""!==r),a=l.test(r)?s(void 0,"word"):null;return a?e.flatMap(r=>l.test(r)?[...a.segment(r)].map(r=>r.segment):[r]):e}(y):null,[y,d]),j=p&&!1!==o?!0===o?r("span",{"aria-hidden":"true",className:"neba-stream-caret"}):o:null;return n({render:h??r("div",{}),ref:x,props:{"aria-busy":p||void 0,"data-streaming":p||void 0,className:i("min-h-(--n-reserve) whitespace-pre-wrap",g),style:{"--n-reserve":`calc(${Math.max(u,0)} * 1lh)`,"--n-accent":`var(--neba-${f}-accent)`,...S},children:a(e,{children:[b?b.map((e,a)=>/\s/.test(e)?r(t.Fragment,{children:e},a):r("span",{className:"neba-stream-word",children:e},a)):m,c(j)?j:null]}),...v}})});
@@ -2,7 +2,10 @@ import * as React from 'react';
2
2
  import { Switch as BaseUISwitch } from '@base-ui/react/switch';
3
3
  import type { NebaColor, NebaFieldSlot, NebaSize, NebaSlots } from '../../types.js';
4
4
  /** Which side of the track the label sits on. */
5
- export type SwitchLabelPlacement = 'start' | 'end';
5
+ /** Which side of the track the label sits on. */
6
+ export type SwitchLabelSide = 'start' | 'end';
7
+ /** @deprecated Use `SwitchLabelSide`. */
8
+ export type SwitchLabelPlacement = SwitchLabelSide;
6
9
  type BaseSwitchProps = Omit<React.ComponentPropsWithoutRef<typeof BaseUISwitch.Root>, 'className' | 'style' | 'render' | 'children'>;
7
10
  /**
8
11
  * The parts a Switch draws behind its root.
@@ -30,7 +33,15 @@ export interface SwitchProps extends BaseSwitchProps {
30
33
  * switch lines up on the right.
31
34
  * @default 'end'
32
35
  */
33
- labelPlacement?: SwitchLabelPlacement;
36
+ labelSide?: SwitchLabelSide;
37
+ /**
38
+ * @deprecated Use `labelSide`. On every field `labelPlacement` says where the
39
+ * label is drawn relative to the field — above it, on its edge, inside it —
40
+ * and a `NebaProvider` fills it in for all of them; here it said which side,
41
+ * so one name meant two things. Read only when `labelSide` is left out, and
42
+ * removed in the next minor release.
43
+ */
44
+ labelPlacement?: SwitchLabelSide;
34
45
  /** Class names for the field wrapper, not for the track. */
35
46
  className?: string;
36
47
  /**
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a,Fragment as r}from"react/jsx-runtime";import*as n from"react";import{Switch as l}from"@base-ui/react/switch";import{Field as t}from"@base-ui/react/field";import{controlTextClasses as o,cx as i,hitAreaClasses as s,metaTextClasses as c,surfaceClasses as d,tickRowLeadingClasses as b}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";import{useFieldsetDisabled as m}from"../../internal/fieldset.js";const f={xs:"h-3.5 w-6",sm:"h-4 w-7",md:"h-5 w-9",lg:"h-6 w-11",xl:"h-7 w-13"},u={xs:"data-[checked]:start-[calc(100%-0.75rem)]",sm:"data-[checked]:start-[calc(100%-0.875rem)]",md:"data-[checked]:start-[calc(100%-1.125rem)]",lg:"data-[checked]:start-[calc(100%-1.375rem)]",xl:"data-[checked]:start-[calc(100%-1.625rem)]"},v={xs:"",sm:"",md:"py-[calc((1.25rem-1lh)/2)]",lg:"py-[calc((1.5rem-1lh)/2)]",xl:"py-[calc((1.75rem-1lh)/2)]"},g=["relative inline-flex shrink-0 border",s,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","rounded-full","[transition-property:background-color,border-color,box-shadow]","[transition-duration:var(--neba-duration-fill),var(--neba-duration),var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),p=[d,"cursor-pointer bg-(--neba-groove) [border-color:var(--n-line)]","hover:bg-(--neba-groove-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)"].join(" "),x=[d,"cursor-default bg-(--neba-groove) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:[border-color:transparent]"].join(" "),w=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)] shadow-none","data-[checked]:bg-(--neba-disabled-bg)"].join(" "),k=["absolute inset-y-0.5 start-0.5 aspect-square rounded-full bg-(--neba-surface)","[box-shadow:var(--neba-shadow-1)]","[transition:inset-inline-start_var(--neba-duration)_var(--neba-ease)]"].join(" ");export const Switch=/*@__PURE__*/n.forwardRef(function Switch(n,s){const{size:d="md",color:N="primary",label:j,description:y,error:$,invalid:_,labelPlacement:R="end",disabled:S,readOnly:z=!1,className:O,classNames:q,style:D,...E}=h(n,["size"]),F=m(S),L=null!=$&&!1!==$&&""!==$,P=_??L,T=P?"danger":N,A={"--n-fill":`var(--neba-${T}-fill)`,"--n-fill-hover":`var(--neba-${T}-fill-hover)`,"--n-accent":`var(--neba-${T}-accent)`,"--n-line":`var(--neba-${T}-line)`,"--n-line-hover":`var(--neba-${T}-line-hover)`,"--n-ring":`var(--neba-${T}-ring)`},B=e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(l.Root,{ref:s,className:i("neba-switch",g,f[d],F?w:z?x:p,q?.control),disabled:F,readOnly:z,...E,children:e(l.Thumb,{className:i("neba-switch-thumb",k,u[d],q?.thumb)})})}),C=j||y?a("span",{className:i("flex min-w-0 flex-col gap-0.5","start"===R?"flex-1":""),children:[j?e(t.Label,{className:i("leading-[1.4]",F?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",q?.label),children:j}):null,y?e(t.Description,{className:i(c[d],"text-(--neba-muted-fg)",q?.description),children:y}):null]}):null;return a(t.Root,{disabled:F,invalid:P,className:i("inline-flex flex-col gap-1 align-top",O??""),style:{...A,...D},children:[e("div",{className:i("flex items-start gap-2.5",o[d],b,v[d]),children:a(r,"start"===R?{children:[C,B]}:{children:[B,C]})}),e(t.Error,L?{match:!0,className:i(c[d],"text-(--n-accent)",q?.error),children:$}:{className:i(c[d],"text-(--n-accent)",q?.error)})]})});
1
+ "use client";import{jsx as e,jsxs as a,Fragment as r}from"react/jsx-runtime";import*as n from"react";import{Switch as l}from"@base-ui/react/switch";import{Field as t}from"@base-ui/react/field";import{controlTextClasses as i,cx as o,hitAreaClasses as s,metaTextClasses as c,surfaceClasses as d,tickRowLeadingClasses as b}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";import{useFieldsetDisabled as m}from"../../internal/fieldset.js";const f={xs:"h-3.5 w-6",sm:"h-4 w-7",md:"h-5 w-9",lg:"h-6 w-11",xl:"h-7 w-13"},u={xs:"data-[checked]:start-[calc(100%-0.75rem)]",sm:"data-[checked]:start-[calc(100%-0.875rem)]",md:"data-[checked]:start-[calc(100%-1.125rem)]",lg:"data-[checked]:start-[calc(100%-1.375rem)]",xl:"data-[checked]:start-[calc(100%-1.625rem)]"},v={xs:"",sm:"",md:"py-[calc((1.25rem-1lh)/2)]",lg:"py-[calc((1.5rem-1lh)/2)]",xl:"py-[calc((1.75rem-1lh)/2)]"},g=["relative inline-flex shrink-0 border",s,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","rounded-full","[transition-property:background-color,border-color,box-shadow]","[transition-duration:var(--neba-duration-fill),var(--neba-duration),var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),p=[d,"cursor-pointer bg-(--neba-groove) [border-color:var(--n-line)]","hover:bg-(--neba-groove-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)"].join(" "),x=[d,"cursor-default bg-(--neba-groove) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:[border-color:transparent]"].join(" "),w=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)] shadow-none","data-[checked]:bg-(--neba-disabled-bg)"].join(" "),k=["absolute inset-y-0.5 start-0.5 aspect-square rounded-full bg-(--neba-surface)","[box-shadow:var(--neba-shadow-1)]","[transition:inset-inline-start_var(--neba-duration)_var(--neba-ease)]"].join(" ");export const Switch=/*@__PURE__*/n.forwardRef(function Switch(n,s){const{size:d="md",color:N="primary",label:j,description:y,error:$,invalid:S,labelSide:_,labelPlacement:R,disabled:z,readOnly:O=!1,className:q,classNames:D,style:E,...F}=h(n,["size"]),L=m(z),P=_??R??"end",T=null!=$&&!1!==$&&""!==$,A=S??T,B=A?"danger":N,C={"--n-fill":`var(--neba-${B}-fill)`,"--n-fill-hover":`var(--neba-${B}-fill-hover)`,"--n-accent":`var(--neba-${B}-accent)`,"--n-line":`var(--neba-${B}-line)`,"--n-line-hover":`var(--neba-${B}-line-hover)`,"--n-ring":`var(--neba-${B}-ring)`},G=e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(l.Root,{ref:s,className:o("neba-switch",g,f[d],L?w:O?x:p,D?.control),disabled:L,readOnly:O,...F,children:e(l.Thumb,{className:o("neba-switch-thumb",k,u[d],D?.thumb)})})}),H=j||y?a("span",{className:o("flex min-w-0 flex-col gap-0.5","start"===P?"flex-1":""),children:[j?e(t.Label,{className:o("leading-[1.4]",L?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",D?.label),children:j}):null,y?e(t.Description,{className:o(c[d],"text-(--neba-muted-fg)",D?.description),children:y}):null]}):null;return a(t.Root,{disabled:L,invalid:A,className:o("inline-flex flex-col gap-1 align-top",q??""),style:{...C,...E},children:[e("div",{className:o("flex items-start gap-2.5",i[d],b,v[d]),children:a(r,"start"===P?{children:[H,G]}:{children:[G,H]})}),e(t.Error,T?{match:!0,className:o(c[d],"text-(--n-accent)",D?.error),children:$}:{className:o(c[d],"text-(--n-accent)",D?.error)})]})});
@@ -1,2 +1,2 @@
1
1
  export { Switch } from './Switch.js';
2
- export type { SwitchLabelPlacement, SwitchProps } from './Switch.js';
2
+ export type { SwitchLabelPlacement, SwitchLabelSide, SwitchProps } from './Switch.js';
@@ -48,8 +48,10 @@ export interface TableColumn<Row> {
48
48
  * cell's padding, alignment and background are written as **inline styles**,
49
49
  * because `.vp-doc td` and `.prose td` outrank any one-class utility. A class
50
50
  * handed to `headCell`, `cell` or `empty` can add anything the component does
51
- * not already set inline — a colour, a font, a border — but to change one of
52
- * those three it has to be an important one (`p-4!`).
51
+ * not already set inline — a font, a border — but to change one of those three
52
+ * it has to be an important one (`p-4!`). A header cell's ink and the empty
53
+ * line's are inline as well and read `--n-cell-ink`, so a class sets that slot:
54
+ * `[--n-cell-ink:var(--neba-fg)]`.
53
55
  */
54
56
  export type TableSlot = 'table' | 'caption' | 'head' | 'headCell' | 'body' | 'row' | 'cell' | 'empty';
55
57
  export interface TableProps<Row> extends Omit<BoxProps, 'padded' | 'children' | 'render' | 'title'> {
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{glowClasses as o,spotlightSlot as n,trackPointer as l}from"../../internal/glow.js";import{Tabs as i}from"@base-ui/react/tabs";import{controlHeightClasses as r,controlHeightValues as s,controlTextClasses as c,cx as d,gapClasses as f,hasContent as u,iconClasses as b,paddingXClasses as v,radiusClasses as h,surfaceClasses as p,surfaceSlots as m,transitionClasses as x}from"../../internal/styles.js";import{observeResize as g}from"../../internal/observe.js";import{bindAxisWheel as w}from"../../internal/wheel.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const z=/*@__PURE__*/a.createContext({variant:"outline",size:"md",density:"default",orientation:"horizontal",fullWidth:!1,align:"center"}),j={solid:{horizontal:`${p} inline-flex bg-(--n-panel) p-1 [box-shadow:var(--neba-plate-glass)]`,vertical:`${p} inline-flex flex-col bg-(--n-panel) p-1 [box-shadow:var(--neba-plate-glass)]`},outline:{horizontal:"flex border-b [border-color:var(--n-line)]",vertical:"flex flex-col border-e [border-color:var(--n-line)]"},text:{horizontal:"flex",vertical:"flex flex-col"}},N={solid:{horizontal:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width)",vertical:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width)"},outline:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"},text:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"}},T={horizontal:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width) border-b-2 [border-color:var(--n-accent)] !bg-transparent",vertical:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width) border-e-2 [border-color:var(--n-accent)] !bg-transparent"},$={solid:`${p} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,outline:"bg-(--n-accent)",text:"bg-(--n-accent)"},k={start:"justify-start",center:"justify-center",end:"justify-end"},M={solid:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)",outline:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)",text:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)"};export const Tab=/*@__PURE__*/a.forwardRef(function Tab({value:s,startIcon:p,endIcon:m,disabled:g=!1,className:w,style:y,children:j,...N},T){const{variant:$,size:E,density:P,fullWidth:C,align:R}=a.useContext(z);return t(i.Tab,{ref:T,value:s,disabled:g,style:{...g?void 0:n,...y},className:d("relative z-10 inline-flex shrink-0 cursor-pointer items-center select-none","whitespace-nowrap font-medium",k[R],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",r[E],c[E],f[E],v[P][E],"solid"===$?h[E]:"",x,b,M[$],"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)",g?"":o,C?"flex-1":"",w??""),...N,onPointerMove:l(N.onPointerMove,!g),children:[u(p)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:p}):null,j,u(m)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:m}):null]})});export const TabPanel=/*@__PURE__*/a.forwardRef(function TabPanel({value:t,keepMounted:o=!1,className:n,children:l,...r},s){const{size:c}=a.useContext(z);return e(i.Panel,{ref:s,value:t,keepMounted:o,className:["min-w-0 flex-1 text-(--neba-fg)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2","data-[starting-style]:opacity-0","[transition:opacity_var(--neba-duration)_var(--neba-ease)]",h[c],n??""].filter(Boolean).join(" "),...r,children:l})});export const Tabs=/*@__PURE__*/a.forwardRef(function Tabs(o,n){const{variant:l="outline",size:r="md",color:c="primary",density:f="default",value:u,defaultValue:b,onValueChange:v,orientation:p="horizontal",activateOnFocus:x=!1,loopFocus:k=!0,overflow:M="scroll",lines:E,wheel:P=!0,fullWidth:C=!1,align:R="center",className:V,style:W,children:_,...F}=y(o,["size","density","variant"]),A="horizontal"===p,L="wrap"===M,H=a.useRef(null),I=a.useRef(null),O=a.useMemo(()=>({variant:l,size:r,density:f,orientation:p,fullWidth:C,align:R}),[l,r,f,p,C,R]),B=[],q=[],D=e=>a.Children.forEach(e,e=>{a.isValidElement(e)&&e.type===a.Fragment?D(e.props.children):a.isValidElement(e)&&e.type===TabPanel?q.push(e):null!=e&&!1!==e&&B.push(e)});D(_);const G=B.length;return a.useEffect(()=>{const e=I.current,t=H.current;if(!e||!t)return;const a=()=>{const a=Math.abs(A?e.scrollLeft:e.scrollTop),o=A?e.clientWidth:e.clientHeight,n=A?e.scrollWidth:e.scrollHeight,l=A?"x":"y",i=A?"y":"x";t.toggleAttribute(`data-overflow-${l}-start`,a>1),t.toggleAttribute(`data-overflow-${l}-end`,n-o-a>1),t.removeAttribute(`data-overflow-${i}-start`),t.removeAttribute(`data-overflow-${i}-end`)};a(),e.addEventListener("scroll",a,{passive:!0});const o=g(e,a);return()=>{e.removeEventListener("scroll",a),o()}},[A,G]),a.useEffect(()=>{const e=I.current;if(e&&P)return w(e)},[P]),e(z.Provider,{value:O,children:t(i.Root,{ref:e=>{H.current=e,"function"==typeof n?n(e):n&&(n.current=e)},value:u,defaultValue:b,onValueChange:e=>v?.(e),orientation:p,className:d("flex min-w-0","vertical"===p?"flex-row gap-4":"flex-col gap-4",V??""),style:{...m(c,0),...W},...F,children:[t(i.List,{ref:I,activateOnFocus:x,loopFocus:k,className:d("relative shrink-0",j[l][p],"solid"===l?h[r]:"",C&&"horizontal"===p?"w-full":"",L?"flex-wrap":A?"overflow-x-auto":"",L&&void 0!==E?A?"overflow-y-auto":"overflow-x-auto":"",!L&&A?"overflow-y-hidden":"","overscroll-contain","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","neba-scroll-fade"),style:{"--n-fade":"2rem",maxHeight:L&&void 0!==E?`calc(${s[r]} * ${Math.max(1,Math.round(E))}${"solid"===l?" + 0.5rem":"outline"===l&&A?" + 1px":""})`:void 0},children:[B,e(i.Indicator,{className:["pointer-events-none",L&&"solid"!==l?T[p]:N[l][p],$[l],"solid"===l?h[r]:"rounded-full","[transition-property:left,top,width,height]","[transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]"].join(" ")})]}),q]})})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{glowClasses as o,spotlightSlot as n,trackPointer as l}from"../../internal/glow.js";import{Tabs as i}from"@base-ui/react/tabs";import{controlHeightClasses as r,controlHeightValues as s,controlTextClasses as c,cx as d,gapClasses as f,hasContent as u,iconClasses as b,paddingXClasses as v,radiusClasses as h,surfaceClasses as p,surfaceSlots as m,transitionClasses as x}from"../../internal/styles.js";import{observeResize as g}from"../../internal/observe.js";import{bindAxisWheel as w}from"../../internal/wheel.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const z=/*@__PURE__*/a.createContext({variant:"outline",size:"md",density:"default",orientation:"horizontal",fullWidth:!1,align:"center"}),j={solid:{horizontal:`${p} inline-flex bg-(--n-panel) p-1 [box-shadow:var(--neba-plate-glass)]`,vertical:`${p} inline-flex flex-col bg-(--n-panel) p-1 [box-shadow:var(--neba-plate-glass)]`},outline:{horizontal:"flex border-b [border-color:var(--n-line)]",vertical:"flex flex-col border-e [border-color:var(--n-line)]"},text:{horizontal:"flex",vertical:"flex flex-col"}},N={solid:{horizontal:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width)",vertical:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width)"},outline:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"},text:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"}},T={horizontal:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width) border-b-2 [border-color:var(--n-accent)] !bg-transparent",vertical:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width) border-e-2 [border-color:var(--n-accent)] !bg-transparent"},$={solid:`${p} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,outline:"bg-(--n-accent)",text:"bg-(--n-accent)"},k={start:"justify-start",center:"justify-center",end:"justify-end"},M={solid:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)",outline:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)",text:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)"};export const Tab=/*@__PURE__*/a.forwardRef(function Tab({value:s,startIcon:p,endIcon:m,disabled:g=!1,className:w,style:y,children:j,...N},T){const{variant:$,size:E,density:P,fullWidth:C,align:R}=a.useContext(z);return t(i.Tab,{ref:T,value:s,disabled:g,style:{...g?void 0:n,...y},className:d("relative z-10 inline-flex shrink-0 cursor-pointer items-center select-none","whitespace-nowrap font-medium",k[R],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",r[E],c[E],f[E],v[P][E],"solid"===$?h[E]:"",x,b,M[$],"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)",g?"":o,C?"flex-1":"",w??""),...N,onPointerMove:l(N.onPointerMove,!g),children:[u(p)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:p}):null,j,u(m)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:m}):null]})});export const TabPanel=/*@__PURE__*/a.forwardRef(function TabPanel({value:t,keepMounted:o=!1,className:n,children:l,...r},s){const{size:c}=a.useContext(z);return e(i.Panel,{ref:s,value:t,keepMounted:o,className:["min-w-0 flex-1 text-(--neba-fg)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2","data-[starting-style]:opacity-0","[transition:opacity_var(--neba-duration)_var(--neba-ease)]",h[c],n??""].filter(Boolean).join(" "),...r,children:l})});export const Tabs=/*@__PURE__*/a.forwardRef(function Tabs(o,n){const{variant:l="outline",size:r="md",color:c="primary",density:f="default",value:u,defaultValue:b,onValueChange:v,orientation:p="horizontal",activateOnFocus:x=!1,loopFocus:k=!0,overflow:M="scroll",lines:E,wheel:P=!0,fullWidth:C=!1,align:R="center",className:V,style:W,children:_,...F}=y(o,["size","density","variant"]),A="horizontal"===p,L="wrap"===M,H=a.useRef(null),I=a.useRef(null),O=a.useMemo(()=>({variant:l,size:r,density:f,orientation:p,fullWidth:C,align:R}),[l,r,f,p,C,R]),B=[],q=[],D=e=>a.Children.forEach(e,e=>{a.isValidElement(e)&&e.type===a.Fragment?D(e.props.children):a.isValidElement(e)&&e.type===TabPanel?q.push(e):null!=e&&!1!==e&&B.push(e)});D(_);const G=B.length;return a.useEffect(()=>{const e=I.current,t=H.current;if(!e||!t)return;const a=()=>{const a=Math.abs(A?e.scrollLeft:e.scrollTop),o=A?e.clientWidth:e.clientHeight,n=A?e.scrollWidth:e.scrollHeight,l=A?"x":"y",i=A?"y":"x";t.toggleAttribute(`data-overflow-${l}-start`,a>1),t.toggleAttribute(`data-overflow-${l}-end`,n-o-a>1),t.removeAttribute(`data-overflow-${i}-start`),t.removeAttribute(`data-overflow-${i}-end`)};a(),e.addEventListener("scroll",a,{passive:!0});const o=g(e,a);return()=>{e.removeEventListener("scroll",a),o()}},[A,G]),a.useEffect(()=>{const e=I.current;if(e&&P)return w(e)},[P]),e(z.Provider,{value:O,children:t(i.Root,{ref:e=>{H.current=e,"function"==typeof n?n(e):n&&(n.current=e)},value:u,defaultValue:b,onValueChange:e=>v?.(e),orientation:p,className:d("flex min-w-0","vertical"===p?"flex-row gap-4":"flex-col gap-4",V??""),style:{...m(c,0),...W},...F,children:[t(i.List,{ref:I,activateOnFocus:x,loopFocus:k,className:d("relative shrink-0",j[l][p],"solid"===l?h[r]:"",C&&"horizontal"===p?"w-full":"",L?"flex-wrap":A?"overflow-x-auto":"overflow-y-auto",L&&void 0!==E?A?"overflow-y-auto":"overflow-x-auto":"",!L&&A?"overflow-y-hidden":"","overscroll-contain","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","neba-scroll-fade"),style:{"--n-fade":"2rem",maxHeight:L&&void 0!==E?`calc(${s[r]} * ${Math.max(1,Math.round(E))}${"solid"===l?" + 0.5rem":"outline"===l&&A?" + 1px":""})`:void 0},children:[B,e(i.Indicator,{className:["pointer-events-none",L&&"solid"!==l?T[p]:N[l][p],$[l],"solid"===l?h[r]:"rounded-full","[transition-property:left,top,width,height]","[transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]"].join(" ")})]}),q]})})});