neba 1.13.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/README.md +22 -30
  2. package/dist/a2ui/catalog.json +1466 -0
  3. package/dist/a2ui/components.d.ts +21 -0
  4. package/dist/a2ui/components.js +1 -0
  5. package/dist/a2ui/index.d.ts +62 -0
  6. package/dist/a2ui/index.js +1 -0
  7. package/dist/a2ui/schema.d.ts +47 -0
  8. package/dist/a2ui/schema.js +1 -0
  9. package/dist/components/accordion/Accordion.d.ts +5 -1
  10. package/dist/components/accordion/Accordion.js +1 -1
  11. package/dist/components/agent-steps/AgentSteps.d.ts +80 -0
  12. package/dist/components/agent-steps/AgentSteps.js +1 -0
  13. package/dist/components/agent-steps/index.d.ts +2 -0
  14. package/dist/components/agent-steps/index.js +1 -0
  15. package/dist/components/alert/Alert.js +1 -1
  16. package/dist/components/anchor/Anchor.d.ts +3 -2
  17. package/dist/components/anchor/Anchor.js +1 -1
  18. package/dist/components/animate-appear/AnimateAppear.js +1 -1
  19. package/dist/components/animate-blink/AnimateBlink.d.ts +3 -0
  20. package/dist/components/animate-blink/AnimateBlink.js +1 -1
  21. package/dist/components/animate-counter/AnimateCounter.d.ts +3 -1
  22. package/dist/components/animate-counter/AnimateCounter.js +1 -1
  23. package/dist/components/animate-fade/AnimateFade.js +1 -1
  24. package/dist/components/animate-float/AnimateFloat.js +1 -1
  25. package/dist/components/animate-grow/AnimateGrow.js +1 -1
  26. package/dist/components/animate-headline/AnimateHeadline.d.ts +9 -2
  27. package/dist/components/animate-headline/AnimateHeadline.js +1 -1
  28. package/dist/components/animate-lighting/AnimateLighting.d.ts +1 -1
  29. package/dist/components/animate-lighting/AnimateLighting.js +1 -1
  30. package/dist/components/animate-marquee/AnimateMarquee.d.ts +15 -6
  31. package/dist/components/animate-marquee/AnimateMarquee.js +1 -1
  32. package/dist/components/animate-reveal/AnimateReveal.js +1 -1
  33. package/dist/components/animate-rotate/AnimateRotate.js +1 -1
  34. package/dist/components/animate-scramble/AnimateScramble.d.ts +5 -3
  35. package/dist/components/animate-scramble/AnimateScramble.js +1 -1
  36. package/dist/components/animate-shake/AnimateShake.js +1 -1
  37. package/dist/components/animate-slide/AnimateSlide.js +1 -1
  38. package/dist/components/animate-split/AnimateSplit.d.ts +3 -1
  39. package/dist/components/animate-split/AnimateSplit.js +1 -1
  40. package/dist/components/animate-typing/AnimateTyping.d.ts +12 -4
  41. package/dist/components/animate-typing/AnimateTyping.js +1 -1
  42. package/dist/components/animate-zoom/AnimateZoom.js +1 -1
  43. package/dist/components/app-logo/AppLogo.js +1 -1
  44. package/dist/components/approval/Approval.d.ts +115 -0
  45. package/dist/components/approval/Approval.js +1 -0
  46. package/dist/components/approval/index.d.ts +2 -0
  47. package/dist/components/approval/index.js +1 -0
  48. package/dist/components/area-chart/AreaChart.d.ts +16 -5
  49. package/dist/components/area-chart/AreaChart.js +1 -1
  50. package/dist/components/aspect-ratio/AspectRatio.d.ts +6 -4
  51. package/dist/components/aspect-ratio/AspectRatio.js +1 -1
  52. package/dist/components/avatar/Avatar.js +1 -1
  53. package/dist/components/badge/Badge.js +1 -1
  54. package/dist/components/bar-chart/BarChart.d.ts +1 -1
  55. package/dist/components/bar-chart/BarChart.js +1 -1
  56. package/dist/components/blockquote/Blockquote.js +1 -1
  57. package/dist/components/bottom-navigation/BottomNavigation.d.ts +2 -1
  58. package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
  59. package/dist/components/box/Box.d.ts +5 -0
  60. package/dist/components/box/Box.js +1 -1
  61. package/dist/components/breadcrumb/Breadcrumb.d.ts +10 -0
  62. package/dist/components/breadcrumb/Breadcrumb.js +1 -1
  63. package/dist/components/button/Button.d.ts +11 -0
  64. package/dist/components/button/Button.js +1 -1
  65. package/dist/components/button-group/ButtonGroup.js +1 -1
  66. package/dist/components/calendar/Calendar.js +1 -1
  67. package/dist/components/card/Card.js +1 -1
  68. package/dist/components/carousel/Carousel.d.ts +4 -0
  69. package/dist/components/carousel/Carousel.js +1 -1
  70. package/dist/components/chat-bubble/ChatBubble.js +1 -1
  71. package/dist/components/checkbox/Checkbox.js +1 -1
  72. package/dist/components/chip/Chip.d.ts +3 -1
  73. package/dist/components/chip/Chip.js +1 -1
  74. package/dist/components/code-block/CodeBlock.d.ts +6 -3
  75. package/dist/components/code-block/CodeBlock.js +1 -1
  76. package/dist/components/collapsible/Collapsible.d.ts +11 -1
  77. package/dist/components/collapsible/Collapsible.js +1 -1
  78. package/dist/components/color-picker/ColorPicker.js +1 -1
  79. package/dist/components/combobox/Combobox.d.ts +11 -1
  80. package/dist/components/combobox/Combobox.js +1 -1
  81. package/dist/components/command-palette/CommandPalette.js +1 -1
  82. package/dist/components/confirm/Confirm.js +1 -1
  83. package/dist/components/container/Container.js +1 -1
  84. package/dist/components/context-window/ContextWindow.d.ts +103 -0
  85. package/dist/components/context-window/ContextWindow.js +1 -0
  86. package/dist/components/context-window/index.d.ts +2 -0
  87. package/dist/components/context-window/index.js +1 -0
  88. package/dist/components/data-list/DataList.js +1 -1
  89. package/dist/components/data-table/DataTable.d.ts +12 -1
  90. package/dist/components/data-table/DataTable.js +1 -1
  91. package/dist/components/date-picker/DatePicker.js +1 -1
  92. package/dist/components/date-range-picker/DateRangePicker.js +1 -1
  93. package/dist/components/date-time-picker/DateTimePicker.js +1 -1
  94. package/dist/components/dialog/Dialog.d.ts +12 -0
  95. package/dist/components/dialog/Dialog.js +1 -1
  96. package/dist/components/divider/Divider.js +1 -1
  97. package/dist/components/drawer/Drawer.d.ts +7 -0
  98. package/dist/components/drawer/Drawer.js +1 -1
  99. package/dist/components/empty/Empty.js +1 -1
  100. package/dist/components/fieldset/Fieldset.js +1 -1
  101. package/dist/components/file-picker/FilePicker.d.ts +12 -4
  102. package/dist/components/file-picker/FilePicker.js +1 -1
  103. package/dist/components/flex/Flex.d.ts +8 -2
  104. package/dist/components/flex/Flex.js +1 -1
  105. package/dist/components/floating-action-button/FloatingActionButton.d.ts +16 -1
  106. package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
  107. package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -1
  108. package/dist/components/footer/Footer.d.ts +8 -0
  109. package/dist/components/footer/Footer.js +1 -1
  110. package/dist/components/form/Form.d.ts +4 -2
  111. package/dist/components/form/Form.js +1 -1
  112. package/dist/components/gallery/Gallery.d.ts +56 -3
  113. package/dist/components/gallery/Gallery.js +1 -1
  114. package/dist/components/gallery/GalleryViewer.js +1 -1
  115. package/dist/components/gauge-chart/GaugeChart.d.ts +1 -1
  116. package/dist/components/gauge-chart/GaugeChart.js +1 -1
  117. package/dist/components/grid/Grid.js +1 -1
  118. package/dist/components/grid-container/GridContainer.js +1 -1
  119. package/dist/components/header/Header.js +1 -1
  120. package/dist/components/heatmap-chart/HeatmapChart.d.ts +20 -1
  121. package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
  122. package/dist/components/highlight/Highlight.js +1 -1
  123. package/dist/components/how-to-steps/HowToSteps.d.ts +26 -1
  124. package/dist/components/how-to-steps/HowToSteps.js +1 -1
  125. package/dist/components/icon/Icon.js +1 -1
  126. package/dist/components/icon-button/IconButton.d.ts +0 -20
  127. package/dist/components/icon-button/IconButton.js +1 -1
  128. package/dist/components/image/Image.d.ts +137 -11
  129. package/dist/components/image/Image.js +1 -1
  130. package/dist/components/image/index.d.ts +1 -1
  131. package/dist/components/inline-citation/InlineCitation.d.ts +53 -0
  132. package/dist/components/inline-citation/InlineCitation.js +1 -0
  133. package/dist/components/inline-citation/index.d.ts +2 -0
  134. package/dist/components/inline-citation/index.js +1 -0
  135. package/dist/components/line-chart/LineChart.d.ts +16 -5
  136. package/dist/components/line-chart/LineChart.js +1 -1
  137. package/dist/components/list/List.js +1 -1
  138. package/dist/components/menu/Menu.d.ts +25 -11
  139. package/dist/components/menu/Menu.js +1 -1
  140. package/dist/components/menubar/Menubar.js +1 -1
  141. package/dist/components/meter/Meter.d.ts +6 -0
  142. package/dist/components/meter/Meter.js +1 -1
  143. package/dist/components/mockup/Mockup.js +1 -1
  144. package/dist/components/navigation-menu/NavigationMenu.d.ts +10 -1
  145. package/dist/components/navigation-menu/NavigationMenu.js +1 -1
  146. package/dist/components/number-field/NumberField.d.ts +20 -6
  147. package/dist/components/number-field/NumberField.js +1 -1
  148. package/dist/components/otp-field/OtpField.d.ts +7 -0
  149. package/dist/components/otp-field/OtpField.js +1 -1
  150. package/dist/components/overlay/Overlay.d.ts +1 -1
  151. package/dist/components/overlay/Overlay.js +1 -1
  152. package/dist/components/page-layout/PageLayout.d.ts +11 -0
  153. package/dist/components/page-layout/PageLayout.js +1 -1
  154. package/dist/components/pagination/Pagination.js +1 -1
  155. package/dist/components/panes/Panes.d.ts +11 -0
  156. package/dist/components/panes/Panes.js +1 -1
  157. package/dist/components/pie-chart/PieChart.d.ts +34 -3
  158. package/dist/components/pie-chart/PieChart.js +1 -1
  159. package/dist/components/pill/Pill.d.ts +8 -0
  160. package/dist/components/pill/Pill.js +1 -1
  161. package/dist/components/popconfirm/Popconfirm.d.ts +10 -3
  162. package/dist/components/popconfirm/Popconfirm.js +1 -1
  163. package/dist/components/popover/Popover.d.ts +8 -1
  164. package/dist/components/popover/Popover.js +1 -1
  165. package/dist/components/portal/Portal.js +1 -1
  166. package/dist/components/progress-box/ProgressBox.js +1 -1
  167. package/dist/components/progress-circular/ProgressCircular.js +1 -1
  168. package/dist/components/progress-linear/ProgressLinear.js +1 -1
  169. package/dist/components/prompt-input/PromptInput.d.ts +104 -0
  170. package/dist/components/prompt-input/PromptInput.js +1 -0
  171. package/dist/components/prompt-input/index.d.ts +2 -0
  172. package/dist/components/prompt-input/index.js +1 -0
  173. package/dist/components/provider/NebaProvider.d.ts +3 -3
  174. package/dist/components/provider/NebaProvider.js +1 -1
  175. package/dist/components/radio-group/RadioGroup.js +1 -1
  176. package/dist/components/rating/Rating.d.ts +4 -1
  177. package/dist/components/rating/Rating.js +1 -1
  178. package/dist/components/reasoning/Reasoning.d.ts +78 -0
  179. package/dist/components/reasoning/Reasoning.js +1 -0
  180. package/dist/components/reasoning/index.d.ts +2 -0
  181. package/dist/components/reasoning/index.js +1 -0
  182. package/dist/components/scatter-chart/ScatterChart.js +1 -1
  183. package/dist/components/scroll-area/ScrollArea.js +1 -1
  184. package/dist/components/scroll-zone/ScrollZone.d.ts +10 -0
  185. package/dist/components/scroll-zone/ScrollZone.js +1 -1
  186. package/dist/components/segmented-button/SegmentedButton.js +1 -1
  187. package/dist/components/select/Select.js +1 -1
  188. package/dist/components/shortcut/Shortcut.js +1 -1
  189. package/dist/components/show/Show.d.ts +6 -5
  190. package/dist/components/show/Show.js +1 -1
  191. package/dist/components/sidebar/Sidebar.d.ts +7 -5
  192. package/dist/components/sidebar/Sidebar.js +1 -1
  193. package/dist/components/sidebar/SidebarTrigger.js +1 -1
  194. package/dist/components/skeleton/Skeleton.d.ts +1 -1
  195. package/dist/components/skeleton/Skeleton.js +1 -1
  196. package/dist/components/slider/Slider.d.ts +13 -1
  197. package/dist/components/slider/Slider.js +1 -1
  198. package/dist/components/sources/Sources.d.ts +78 -0
  199. package/dist/components/sources/Sources.js +1 -0
  200. package/dist/components/sources/index.d.ts +2 -0
  201. package/dist/components/sources/index.js +1 -0
  202. package/dist/components/sparkline/Sparkline.d.ts +14 -1
  203. package/dist/components/sparkline/Sparkline.js +1 -1
  204. package/dist/components/spoiler/Spoiler.js +1 -1
  205. package/dist/components/stack/Stack.d.ts +2 -2
  206. package/dist/components/stack/Stack.js +1 -1
  207. package/dist/components/statistic/Statistic.js +1 -1
  208. package/dist/components/streaming-text/StreamingText.d.ts +75 -0
  209. package/dist/components/streaming-text/StreamingText.js +1 -0
  210. package/dist/components/streaming-text/index.d.ts +2 -0
  211. package/dist/components/streaming-text/index.js +1 -0
  212. package/dist/components/switch/Switch.js +1 -1
  213. package/dist/components/table/Table.d.ts +8 -2
  214. package/dist/components/table/Table.js +1 -1
  215. package/dist/components/tabs/Tabs.d.ts +17 -1
  216. package/dist/components/tabs/Tabs.js +1 -1
  217. package/dist/components/text-field/TextField.js +1 -1
  218. package/dist/components/text-link/TextLink.js +1 -1
  219. package/dist/components/time-picker/TimePicker.js +1 -1
  220. package/dist/components/timeline/Timeline.d.ts +8 -0
  221. package/dist/components/timeline/Timeline.js +1 -1
  222. package/dist/components/timeline-chart/TimelineChart.js +1 -1
  223. package/dist/components/toast/Toast.d.ts +9 -3
  224. package/dist/components/toast/Toast.js +1 -1
  225. package/dist/components/toggle/Toggle.js +1 -1
  226. package/dist/components/toggle-group/ToggleGroup.js +1 -1
  227. package/dist/components/tool-call/ToolCall.d.ts +104 -0
  228. package/dist/components/tool-call/ToolCall.js +1 -0
  229. package/dist/components/tool-call/index.d.ts +2 -0
  230. package/dist/components/tool-call/index.js +1 -0
  231. package/dist/components/toolbar/Toolbar.d.ts +8 -0
  232. package/dist/components/toolbar/Toolbar.js +1 -1
  233. package/dist/components/tooltip/Tooltip.js +1 -1
  234. package/dist/components/tour/Tour.d.ts +2 -0
  235. package/dist/components/tour/Tour.js +1 -1
  236. package/dist/components/transfer/Transfer.js +1 -1
  237. package/dist/components/tree-select/TreeSelect.js +1 -1
  238. package/dist/components/tree-view/TreeView.d.ts +6 -0
  239. package/dist/components/tree-view/TreeView.js +1 -1
  240. package/dist/components/typography/Typography.js +1 -1
  241. package/dist/components/visually-hidden/VisuallyHidden.d.ts +9 -7
  242. package/dist/components/visually-hidden/VisuallyHidden.js +1 -1
  243. package/dist/components/window-pane/WindowPane.d.ts +2 -2
  244. package/dist/components/window-pane/WindowPane.js +1 -1
  245. package/dist/hooks/useElementSize.d.ts +3 -1
  246. package/dist/hooks/useElementSize.js +1 -1
  247. package/dist/hooks/useOnScreen.d.ts +3 -0
  248. package/dist/hooks/useOnScreen.js +1 -1
  249. package/dist/index.d.ts +9 -0
  250. package/dist/index.js +1 -1
  251. package/dist/internal/animate.d.ts +63 -16
  252. package/dist/internal/animate.js +1 -1
  253. package/dist/internal/calendar.d.ts +6 -1
  254. package/dist/internal/calendar.js +1 -1
  255. package/dist/internal/chart-brush.d.ts +53 -0
  256. package/dist/internal/chart-brush.js +1 -0
  257. package/dist/internal/chart-frame.d.ts +186 -30
  258. package/dist/internal/chart-frame.js +1 -1
  259. package/dist/internal/chart-line.js +1 -1
  260. package/dist/internal/chart.d.ts +133 -6
  261. package/dist/internal/chart.js +1 -1
  262. package/dist/internal/children.d.ts +15 -0
  263. package/dist/internal/children.js +1 -0
  264. package/dist/internal/color.d.ts +4 -0
  265. package/dist/internal/color.js +1 -1
  266. package/dist/internal/csv.d.ts +12 -1
  267. package/dist/internal/csv.js +1 -1
  268. package/dist/internal/data-table.d.ts +28 -10
  269. package/dist/internal/data-table.js +1 -1
  270. package/dist/internal/date.d.ts +12 -5
  271. package/dist/internal/date.js +1 -1
  272. package/dist/internal/defaults.d.ts +6 -1
  273. package/dist/internal/defaults.js +1 -1
  274. package/dist/internal/drag.d.ts +13 -1
  275. package/dist/internal/drag.js +1 -1
  276. package/dist/internal/drop.d.ts +61 -0
  277. package/dist/internal/drop.js +1 -0
  278. package/dist/internal/fieldset.d.ts +13 -0
  279. package/dist/internal/fieldset.js +1 -0
  280. package/dist/internal/glow.d.ts +102 -0
  281. package/dist/internal/glow.js +1 -0
  282. package/dist/internal/highlight.js +1 -1
  283. package/dist/internal/i18n.d.ts +232 -11
  284. package/dist/internal/i18n.js +1 -1
  285. package/dist/internal/icons.d.ts +13 -2
  286. package/dist/internal/icons.js +1 -1
  287. package/dist/internal/inert.d.ts +13 -0
  288. package/dist/internal/inert.js +1 -0
  289. package/dist/internal/initials.d.ts +8 -3
  290. package/dist/internal/initials.js +1 -1
  291. package/dist/internal/keys.d.ts +13 -0
  292. package/dist/internal/keys.js +1 -1
  293. package/dist/internal/link.d.ts +13 -15
  294. package/dist/internal/link.js +1 -1
  295. package/dist/internal/media.d.ts +9 -17
  296. package/dist/internal/media.js +1 -1
  297. package/dist/internal/menu.d.ts +6 -1
  298. package/dist/internal/mockup.d.ts +5 -4
  299. package/dist/internal/mockup.js +1 -1
  300. package/dist/internal/observe.d.ts +12 -0
  301. package/dist/internal/observe.js +1 -1
  302. package/dist/internal/page-layout.d.ts +10 -8
  303. package/dist/internal/page-layout.js +1 -1
  304. package/dist/internal/picker.d.ts +1 -1
  305. package/dist/internal/picker.js +1 -1
  306. package/dist/internal/progress.d.ts +11 -5
  307. package/dist/internal/progress.js +1 -1
  308. package/dist/internal/responsive.d.ts +0 -8
  309. package/dist/internal/responsive.js +1 -1
  310. package/dist/internal/run.d.ts +71 -0
  311. package/dist/internal/run.js +1 -0
  312. package/dist/internal/screen.d.ts +12 -0
  313. package/dist/internal/screen.js +1 -0
  314. package/dist/internal/styles.d.ts +185 -14
  315. package/dist/internal/styles.js +1 -1
  316. package/dist/internal/text.d.ts +3 -3
  317. package/dist/internal/text.js +1 -1
  318. package/dist/internal/window.js +1 -1
  319. package/dist/locales/ar.js +1 -1
  320. package/dist/locales/de.js +1 -1
  321. package/dist/locales/es.js +1 -1
  322. package/dist/locales/fr.js +1 -1
  323. package/dist/locales/hi.js +1 -1
  324. package/dist/locales/id.js +1 -1
  325. package/dist/locales/it.js +1 -1
  326. package/dist/locales/ja.js +1 -1
  327. package/dist/locales/ko.js +1 -1
  328. package/dist/locales/nl.js +1 -1
  329. package/dist/locales/pl.js +1 -1
  330. package/dist/locales/pt.js +1 -1
  331. package/dist/locales/ru.js +1 -1
  332. package/dist/locales/th.js +1 -1
  333. package/dist/locales/tr.js +1 -1
  334. package/dist/locales/vi.js +1 -1
  335. package/dist/locales/zh-hans.js +1 -1
  336. package/dist/locales/zh-hant.js +1 -1
  337. package/dist/styles.css +1 -1
  338. package/dist/tailwind.css +516 -53
  339. package/dist/types.d.ts +167 -7
  340. package/dist/types.js +0 -8
  341. package/package.json +43 -9
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as l from"react";import{CartesianChart as a,markTransitionClasses as t}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 h}from"../../internal/chart.js";import{cx as m,srOnlyClasses as x}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";export function ScatterChart(r){const{shape:t="auto",pointRadius:i,maxRadius:n,series:m,categories:x,size:v="md",xAxis:y,...z}=p(r,["size"]),g=i??o[v],j=n??Math.max(g+2,("number"==typeof z.height?z.height:d[v])/12),k=m.reduce((e,r)=>r.color?e:e+1,0),$="auto"===t||"varied"===t?"circle":t,w="varied"===t||"auto"===t&&k>3,M=l.useCallback(e=>w?u[e%u.length]:$,[w,$]),N=l.useCallback(e=>{const r=[];let l=0;return e.values.forEach(e=>{e.forEach(e=>{null!==e.value&&void 0!==e.z&&Number.isFinite(e.z)&&(l=Math.max(l,e.z))})}),e.values.forEach((a,t)=>{e.visible[t]&&a.forEach((a,i)=>{if(null===a.value)return;const o=h(a,i,x);null!==o&&r.push({series:t,index:i,x:e.categoryValuePx(o),y:e.valuePx(a.value),r:void 0===a.z?g:s(a.z,l,j,2)})})}),r},[x,g,j]);return e(a,{...z,series:m,categories:x,size:v,xScale:"value",xAxis:y,marks:N,markInset:j,includeZero:!1,swatch:(r,l)=>e("svg",{viewBox:"0 0 10 10",className:"size-2.5 overflow-visible","aria-hidden":"true",children:e("path",{d:c(M(r),5,5,4),fill:l})}),table:(r,l)=>e(b,{id:r,series:m,categories:x,label:z.label,xLabel:y?.label,yLabel:z.yAxis?.label,locale:z.locale,format:l}),children:r=>e(f,{context:r,shapeOf:M})})}function f({context:r,shapeOf:a}){const{marks:s,values:i,colors:o,hovered:u,activeMark:d}=r,h=l.useMemo(()=>[...s].sort((e,r)=>r.r-e.r),[s]);return e("g",{children:h.map(r=>{const l=i[r.series]?.[r.index],s=null!==u&&u!==r.series,h=d?.series===r.series&&d?.index===r.index;return e("path",{d:c(a(r.series),r.x,r.y,r.r),fill:l?.color??o[r.series],stroke:"var(--neba-chart-gap)",strokeWidth:n,opacity:s?.28:1,className:t,style:{transformBox:"view-box",transformOrigin:`${r.x}px ${r.y}px`,scale:h&&r.r>0?(r.r+1)/r.r:1}},`${r.series}-${r.index}`)})})}const b=/*@__PURE__*/l.memo(function({id:l,series:a,categories:t,label:s,xLabel:o,yLabel:n,locale:c,format:u}){const d=a.some(e=>e.data.some(e=>"object"==typeof e&&null!==e&&void 0!==e.z));return r("table",{id:l,className:m(x),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"}),d?e("th",{scope:"col",children:"z"}):null]})}),e("tbody",{children:a.flatMap((l,a)=>l.data.map((s,o)=>{const n="object"==typeof s&&null!==s?s:null,h=n?n.y:"number"==typeof s?s:null,m=n?.x??t?.[o]??o;return r("tr",{children:[e("th",{scope:"row",children:l.name??a+1}),e("td",{children:i(m,c)}),e("td",{children:null!==h&&Number.isFinite(h)?u(h):""}),d?e("td",{children:void 0===n?.z?"":u(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 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 +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,focusRingClasses as l,toLength as t}from"../../internal/styles.js";import{useStyleDefaults as i}from"../../internal/defaults.js";const s={xs:"0.25rem",sm:"0.3125rem",md:"0.375rem",lg:"0.5rem",xl:"0.625rem"},c={xs:"1rem",sm:"1.25rem",md:"1.5rem",lg:"2rem",xl:"2.5rem"},m=["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(" "),h="flex-1 rounded-full bg-(--n-thumb) hover:bg-(--n-thumb-hover)";export const ScrollArea=/*@__PURE__*/a.forwardRef(function(a,d){const{orientation:b="vertical",height:u,maxHeight:f,size:g="md",color:p="primary",fade:x=!1,className:v,style:y,children:N,...j}=i(a,["size"]),w="vertical"===b||"both"===b,$="horizontal"===b||"both"===b;return e(n.Root,{ref:d,className:o("relative overflow-hidden",v??""),style:{"--n-soft":`var(--neba-${p}-soft)`,"--n-ring":`var(--neba-${p}-ring)`,"--n-thumb":`color-mix(in oklab, var(--neba-${p}-accent) 35%, transparent)`,"--n-thumb-hover":`color-mix(in oklab, var(--neba-${p}-accent) 55%, transparent)`,"--n-rail":s[g],"--n-fade":c[g],height:t(u),maxHeight:t(f),...y},...j,children:[r(n.Viewport,{style:{height:"100%",width:"100%"},className:o("overscroll-contain",l,x?"neba-scroll-fade":""),children:r(n.Content,{className:"min-w-full",children:N})}),w?r(n.Scrollbar,{orientation:"vertical",className:`${m} w-(--n-rail) [margin-block:2px]`,children:r(n.Thumb,{className:h})}):null,$?r(n.Scrollbar,{orientation:"horizontal",className:`${m} h-(--n-rail) [margin-inline:2px]`,children:r(n.Thumb,{className:h})}):null,w&&$?r(n.Corner,{}):null]})});
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]})});
@@ -124,6 +124,16 @@ export interface ScrollZoneProps extends NebaStyleProps, Omit<React.ComponentPro
124
124
  /** Overrides the buttons' own names. */
125
125
  previousLabel?: string;
126
126
  nextLabel?: string;
127
+ /**
128
+ * A ref to the box that scrolls. `ref` is the root, which also holds the
129
+ * buttons, so this is the one to read or restore a scroll position through.
130
+ */
131
+ scrollerRef?: React.Ref<HTMLDivElement>;
132
+ /**
133
+ * Called when the strip scrolls. It is the scrolling box's event rather than
134
+ * the root's, because a scroll does not bubble.
135
+ */
136
+ onScroll?: React.UIEventHandler<HTMLDivElement>;
127
137
  /** What is being laid out. Every top-level child is one item of the strip. */
128
138
  children?: React.ReactNode;
129
139
  }
@@ -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 i,useMessages as l}from"../../internal/i18n.js";import{ChevronIcon as s}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 m}from"../../internal/wheel.js";import{useStyleDefaults as f}from"../../internal/defaults.js";const p={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(b,g){const{orientation:w="horizontal",lines:h=1,spacing:y=2,buttons:x="auto",buttonPlacement:k="inline",mode:E="item",step:L=1,speed:j=900,snap:C=!1,drag:P=!0,wheel:R=!1,scrollbar:N=!1,variant:T="solid",size:A="md",color:M="primary",density:z="default",locale:D,label:S,previousLabel:B,nextLabel:F,className:H,style:I,children:W,...$}=f(b,["size","density","variant","locale"]),q=l(i,D),X="horizontal"===w,Y=Math.max(1,Math.round(h)),_=Math.max(1,Math.round(L)),K=n.useRef(null),V=n.useRef(null),[Z,G]=n.useState({back:!1,forward:!1}),J=n.useCallback(()=>{const e=K.current;if(!e)return;const t=X?e.clientWidth:e.clientHeight,n=X?e.scrollWidth:e.scrollHeight,r=Math.abs(X?e.scrollLeft:e.scrollTop);G(e=>{const o=r>1,i=n-t-r>1;return e.back===o&&e.forward===i?e:{back:o,forward:i}})},[X]);n.useEffect(()=>{const e=K.current,t=V.current;if(!e)return;J();const n=[u(e,J),t?u(t,J):null];return()=>{for(const e of n)e?.()}},[J]);const O=n.useCallback(()=>{const e=K.current;return e&&X&&"rtl"===getComputedStyle(e).direction?-1:1},[X]),Q=n.useCallback((e,t)=>{const n=K.current;if(!n)return;const r=t?a(c)?"auto":"smooth":"auto";n.scrollBy(X?{left:e,behavior:r}:{top:e,behavior:r})},[X]),U=n.useCallback(()=>{const e=K.current,t=V.current;if(!e||!t)return[];const n=X&&"rtl"===getComputedStyle(e).direction,r=X?n?"right":"left":"top",o=n?-1:1,i=e.getBoundingClientRect()[r],l=[];for(const e of Array.from(t.children)){const t=Math.round((e.getBoundingClientRect()[r]-i)*o);l.includes(t)||l.push(t)}return l.sort((e,t)=>e-t)},[X]),ee=n.useCallback((e,t=E)=>{const n=K.current;if(!n)return;const r=O(),o=X?n.clientWidth:n.clientHeight;if("page"===t)return void Q(o*(e?1:-1)*r,!0);const i=U(),l=i.filter(e=>e>1),s=i.filter(e=>e<-1),a=e?l[_-1]:s[s.length-_];Q(void 0!==a?a*r:o*(e?1:-1)*r,!0)},[O,X,U,_,E,Q]),te=n.useRef(null);n.useEffect(()=>()=>te.current?.(),[]);const ne=n.useCallback((e,t)=>{if(te.current)return;const n=O(),r=performance.now();let o=r,i=0;const l=t=>{const r=t-o;o=t,Q(j*r/1e3*(e?1:-1)*n,!1),i=requestAnimationFrame(l)};i=requestAnimationFrame(l);const s=()=>{cancelAnimationFrame(i),te.current=null,window.removeEventListener(t,s),window.removeEventListener("pointercancel",s),window.removeEventListener("blur",s),performance.now()-r<140&&ee(e,"item")};te.current=s,window.addEventListener(t,s),window.addEventListener("pointercancel",s),window.addEventListener("blur",s)},[ee,O,Q,j]),re=n.useRef(null);function oe(e){return"hold"!==E?{onClick:()=>ee(e)}:{onPointerDown:t=>{0===t.button&&ne(e,"pointerup")},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),ne(e,"keyup"))}}}n.useEffect(()=>()=>re.current?.(),[]),n.useEffect(()=>{const e=K.current;if(e&&R&&X)return m(e)},[X,R]);const ie="none"!==x&&("always"===x||Z.back||Z.forward),le="inline"===k;function se(t){const n=t?Z.forward:Z.back;if("auto"===x&&!n&&!le)return e("span",{});const o=X?t?"-rotate-90 rtl:rotate-90":"rotate-90 rtl:-rotate-90":t?"":"rotate-180",i=e(r,{variant:T,size:A,color:M,density:z,elevation:1,label:t?F??q.next:B??q.previous,disabled:!n,className:"pointer-events-auto",icon:e("span",{className:d("flex items-center",o),children:e(s,{})}),...oe(t)});return le?e("span",{className:"flex shrink-0 items-center justify-center",children:i}):i}return t("div",{ref:g,className:d("relative flex min-w-0",le&&X?"flex-row items-stretch":"flex-col",le?v[A]:"",H),style:{"--n-ring":`var(--neba-${M}-ring)`,...I},...$,children:[ie&&le?se(!1):null,e("div",{ref:K,tabIndex:0,role:"group","aria-label":S??q.label,className:d("min-h-0 min-w-0 grow",X?"overflow-x-auto overflow-y-hidden":"overflow-y-auto overflow-x-hidden","overscroll-contain",C?X?"snap-x snap-mandatory":"snap-y snap-mandatory":"",N?"":"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",P&&(Z.back||Z.forward)?"cursor-grab data-[dragging]:cursor-grabbing":"","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"),onScroll:J,onPointerDown:function(e){if(!P||"touch"===e.pointerType||0!==e.button)return;re.current?.();const t=e.currentTarget,n=e.clientX,r=e.clientY,o=t.scrollLeft,i=t.scrollTop;let l=!1;const s=document.body.style.getPropertyValue("-webkit-user-select"),a=e=>{const s=e.clientX-n,a=e.clientY-r;if(!l){if(Math.abs(X?s:a)<4)return;l=!0,t.setPointerCapture(e.pointerId),t.dataset.dragging="true",document.body.style.setProperty("-webkit-user-select","none")}X?t.scrollLeft=o-s:t.scrollTop=i-a},c=()=>{re.current=null,t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",c),delete t.dataset.dragging,s?document.body.style.setProperty("-webkit-user-select",s):document.body.style.removeProperty("-webkit-user-select")},u=()=>{const e=l;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)};re.current=c,t.addEventListener("pointermove",a),t.addEventListener("pointerup",u),t.addEventListener("pointercancel",c)},children:e("div",{ref:V,className:d(C?"[&>*]:snap-start":""),style:{display:"grid",gap:o(y),gridAutoFlow:X?"column":"row",...X?{width:"max-content",gridTemplateRows:`repeat(${Y}, auto)`,gridAutoColumns:"max-content"}:{gridTemplateColumns:`repeat(${Y}, minmax(0, 1fr))`,gridAutoRows:"max-content"}},children:W})}),ie&&le?se(!0):null,ie&&!le?t("div",{className:d("pointer-events-none absolute inset-0 flex justify-between",X?"items-center":"flex-col items-center",p[A]),children:[se(!1),se(!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{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 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as r}from"@base-ui/react/radio-group";import{observeResize as s}from"../../internal/observe.js";import{controlHeightClasses as l,controlSlots as o,controlTextClasses as i,cx as d,gapClasses as u,hasContent as c,iconClasses as f,paddingXClasses as p,surfaceClasses as h,transitionClasses as b}from"../../internal/styles.js";const m=/*@__PURE__*/a.createContext({variant:"outline",size:"md",density:"default",fullWidth:!1}),v={solid:`${h} bg-(--n-panel) p-1 [box-shadow:var(--n-elev),var(--neba-plate-glass)]`,outline:`${h} border bg-(--n-panel) p-1 [border-color:var(--n-line)] [box-shadow:var(--n-elev),var(--neba-plate-glass)]`,text:""},x={solid:`${h} bg-(--n-fill) [box-shadow:var(--neba-shadow-1),var(--neba-plate-solid)]`,outline:`${h} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,text:`${h} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`},g={solid:"data-[checked]:text-(--n-on-solid)",outline:"data-[checked]:text-(--n-accent)",text:"data-[checked]:text-(--n-accent)"};export const Segment=/*@__PURE__*/a.forwardRef(function({value:r,startIcon:s,endIcon:o,disabled:h=!1,className:v,children:x,...y},w){const{variant:k,size:$,density:j,fullWidth:N}=a.useContext(m);return t(n.Root,{ref:w,value:r,disabled:h,"data-segment":"",className:d("relative z-10 inline-flex shrink-0 cursor-pointer items-center justify-center select-none","whitespace-nowrap font-medium","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",l[$],i[$],u[$],p[j][$],"rounded-full",b,f,"text-(--neba-muted-fg) hover:text-(--neba-fg)",g[k],"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","data-[readonly]:cursor-default",N?"flex-1":"",v??""),...y,children:[c(s)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:s}):null,x,c(o)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:o}):null]})});export const SegmentedButton=/*@__PURE__*/a.forwardRef(function({variant:n="outline",size:l="md",color:i="primary",density:d="default",elevation:u=0,value:c,defaultValue:f=null,onValueChange:p,disabled:h=!1,readOnly:g=!1,name:y,fullWidth:w=!1,className:k,style:$,children:j,...N},R){const[W,z]=a.useState(f),C=void 0!==c,P=C?c:W,S=a.useRef(null),A=a.useRef(null),V=a.useCallback(e=>{const t=S.current,a=A.current;if(!t||!a)return;const n=t.querySelector("[data-segment][data-checked]");if(!n)return;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(()=>{V(!0)},[V,P,n,l,d,w,j]),a.useEffect(()=>{const e=S.current;if(e)return s(e,()=>V(!1))},[V]);const B=a.useMemo(()=>({variant:n,size:l,density:d,fullWidth:w}),[n,l,d,w]);return e(m.Provider,{value:B,children:t(r,{ref:e=>{S.current=e,"function"==typeof R?R(e):R&&(R.current=e)},value:P,onValueChange:e=>{const t=e??null;C||z(t),p?.(t)},disabled:h,readOnly:g,name:y,className:["relative inline-flex items-center rounded-full",v[n],b,g?"[filter:saturate(0.55)]":"",w?"flex w-full":"",k??""].filter(Boolean).join(" "),style:{...o(i,u,n),...$},...N,children:[null!=P?e("span",{ref:A,"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)",x[n],"[transition-property:left,top,width,height]","[transition-timing-function:var(--neba-ease)]","[transition-duration:0ms] data-[ready]:[transition-duration:var(--neba-duration)]"].join(" ")}):null,j]})})});
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 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{Select as l}from"@base-ui/react/select";import{Field as n}from"@base-ui/react/field";import{CheckIcon as r,ChevronIcon as i}from"../../internal/icons.js";import{WidthSizer as s}from"../../internal/sizer.js";import{controlTextLeadingClasses as o,cx as c,disabledClasses as d,fieldFocusTransitionClasses as m,fieldHeightClasses as u,fieldReadOnlyClasses as p,fieldRestClasses as f,fieldRingClasses as h,gapClasses as b,hasContent as g,iconClasses as x,metaTextClasses as v,paddingXClasses as N,popupFadeClasses as j,radiusClasses as w,stackGapClasses as y,surfaceClasses as I,surfaceSlots as z,transitionClasses as S}from"../../internal/styles.js";import{useStyleDefaults as V}from"../../internal/defaults.js";const $=["group relative flex w-full cursor-pointer items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",S,m,h,x].join(" "),k=[I,"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]",j].join(" "),M=["py-1.5 pe-2 ps-7 font-semibold tracking-wide text-(--neba-muted-fg) uppercase"].join(" "),O=["relative flex cursor-pointer items-center gap-2 select-none","rounded-(--neba-radius-xs) py-1.5 pe-2 ps-7",S,"data-[highlighted]:bg-(--n-soft-hover) data-[highlighted]:text-(--n-accent)","data-[selected]:text-(--n-accent) data-[selected]:font-medium","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]"].join(" ");export const Select=/*@__PURE__*/t.forwardRef(function(m,h){const{variant:x="outline",size:j="md",color:I="primary",density:S="default",elevation:P=0,items:R,value:T,defaultValue:q,onValueChange:C,placeholder:G,label:L,description:W,error:_,invalid:D,startIcon:E,fullWidth:A=!1,disabled:B=!1,readOnly:F=!1,required:H=!1,name:J,id:K,className:Q,classNames:U,style:X,...Y}=V(m,["size","density","variant"]),Z=null!=_&&!1!==_&&""!==_,ee=D??Z,ae=ee?"danger":I,te=t.useMemo(()=>R.map(e=>({label:e.label??String(e.value),value:e.value})),[R]),le=t.useMemo(()=>function(e){const a=[];for(const t of e){const e=a.at(-1);e&&e.label===t.group?e.items.push(t):a.push({label:t.group,items:[t]})}return a}(R),[R]),ne=t.useMemo(()=>[...R.map(e=>e.label??String(e.value)),...g(G)?[G]:[]],[R,G]);return a(n.Root,{disabled:B,invalid:ee,className:c("flex-col align-top",y[j],A?"flex w-full":"inline-flex",Q??""),style:{...z(ae,P),...X},...Y,children:[L?e(n.Label,{className:c(v[j],"font-medium",B?"text-(--neba-disabled-fg)":"text-(--neba-fg)",U?.label),children:L}):null,a(l.Root,{id:K,name:J,items:te,value:T,defaultValue:q,onValueChange:e=>C?.(e),disabled:B,readOnly:F,required:H,children:[a(l.Trigger,{ref:h,className:c($,u[j],o[j],w[j],b[j],N[S][j],B?d[x]:F?`${p[x]} cursor-default`:f[x],U?.control),children:[E?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:E}):null,a("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(l.Value,{className:["w-full truncate text-start","data-[placeholder]:text-(--neba-muted-fg)"].join(" "),placeholder:G}),e(s,{samples:ne})]}),e(l.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,{})})]}),e(l.Portal,{children:e(l.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",sideOffset:6,alignItemWithTrigger:!1,children:e(l.Popup,{className:c(k,w[j],o[j],U?.popup),style:z(ae,3),children:le.map((t,n)=>{const i=t.items.map(t=>a(l.Item,{value:t.value,disabled:t.disabled,className:c(O,U?.item),children:[e(l.ItemIndicator,{className:"absolute start-1.5 flex size-4 items-center justify-center",children:e(r,{})}),e(l.ItemText,{className:"truncate",children:t.label??String(t.value)})]},String(t.value)));return void 0===t.label?i:a(l.Group,{children:[e(l.GroupLabel,{className:`${M} ${v[j]}`,children:t.label}),i]},`${t.label}-${n}`)})})})})]}),W?e(n.Description,{className:c(v[j],"text-(--neba-muted-fg)",U?.description),children:W}):null,e(n.Error,Z?{match:!0,className:c(v[j],"text-(--n-accent)",U?.error),children:_}:{className:c(v[j],"text-(--n-accent)",U?.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 n}from"@base-ui/react/field";import{CheckIcon as r,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 f,fieldRingClasses as b,gapClasses as h,hasContent as g,iconClasses as v,metaTextClasses as x,paddingXClasses as N,popupFadeClasses as j,radiusClasses as y,stackGapClasses as w,surfaceClasses as I,surfaceSlots as S,transitionClasses as $}from"../../internal/styles.js";import{useStyleDefaults as z}from"../../internal/defaults.js";import{fieldSpotlightSlot as V,glowClasses as k,trackPointer as M}from"../../internal/glow.js";import{useFieldsetDisabled as P}from"../../internal/fieldset.js";const O=["group relative flex w-full cursor-pointer items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",$,m,b,v].join(" "),R=[I,"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]",j].join(" "),T=["py-1.5 pe-2 ps-7 font-semibold tracking-wide text-(--neba-muted-fg) uppercase"].join(" "),q=["relative flex cursor-pointer items-center gap-2 select-none","rounded-(--neba-radius-xs) py-1.5 pe-2 ps-7",$,"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,b){const{variant:v="outline",size:j="md",color:I="primary",density:$="default",elevation:C=0,items:G,value:L,defaultValue:W,onValueChange:_,placeholder:D,label:E,description:A,error:B,invalid:F,startIcon:H,fullWidth:J=!1,disabled:K,readOnly:Q=!1,required:U=!1,name:X,id:Y,className:Z,classNames:ee,style:ae,"aria-label":le,"aria-labelledby":te,...ne}=z(m,["size","density","variant"]),re=P(K),ie=!re&&!Q,se=null!=B&&!1!==B&&""!==B,oe=F??se,de=oe?"danger":I,ce=l.useMemo(()=>G.map(e=>({label:e.label??String(e.value),value:e.value})),[G]),me=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}(G),[G]),ue=l.useMemo(()=>[...G.map(e=>e.label??String(e.value)),...g(D)?[D]:[]],[G,D]);return a(n.Root,{disabled:re,invalid:oe,className:d("flex-col align-top",w[j],J?"flex w-full":"inline-flex",Z??""),style:{...S(de,C),...ie?V:void 0,...ae},...ne,children:[E?e(n.Label,{className:d(x[j],"font-medium",re?"text-(--neba-disabled-fg)":"text-(--neba-fg)",ee?.label),children:E}):null,a(t.Root,{id:Y,name:X,items:ce,value:L,defaultValue:W,onValueChange:e=>_?.(e),disabled:re,readOnly:Q,required:U,children:[a(t.Trigger,{ref:b,onPointerMove:M(void 0,ie),"aria-label":le,"aria-labelledby":te,className:d(O,u[j],o[j],y[j],h[j],N[$][j],re?c[v]:Q?`${p[v]} cursor-default`:`${f[v]} ${k}`,ee?.control),children:[H?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:H}):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:D}),e(s,{samples:ue})]}),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,{})})]}),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(R,y[j],o[j],ee?.popup),style:S(de,3),children:me.map((l,n)=>{const i=l.items.map(l=>a(t.Item,{value:l.value,disabled:l.disabled,className:d(q,ee?.item),children:[e(t.ItemIndicator,{className:"absolute start-1.5 flex size-4 items-center justify-center",children:e(r,{})}),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:`${T} ${x[j]}`,children:l.label}),i]},`${l.label}-${n}`)})})})})]}),A?e(n.Description,{className:d(x[j],"text-(--neba-muted-fg)",ee?.description),children:A}):null,e(n.Error,se?{match:!0,className:d(x[j],"text-(--n-accent)",ee?.error),children:B}:{className:d(x[j],"text-(--n-accent)",ee?.error)})]})});
@@ -1 +1 @@
1
- "use client";import{jsx as n,Fragment as e,jsxs as a}from"react/jsx-runtime";import*as s from"react";import{controlHeightClasses as o,controlSlots as l,controlTextClasses as t,cx as r,paddingXClasses as m,radiusClasses as i,srOnlyClasses as c,surfaceClasses as d,transitionClasses as w}from"../../internal/styles.js";import{canonicalKey as u,readOS as b,tokenize as p}from"../../internal/keys.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const f=n=>({symbol:n,name:n}),y={mod:{mac:{symbol:"⌘",name:"Command"},windows:f("Ctrl"),linux:f("Ctrl")},meta:{mac:{symbol:"⌘",name:"Command"},windows:f("Win"),linux:f("Super")},ctrl:{mac:{symbol:"⌃",name:"Control"},windows:f("Ctrl"),linux:f("Ctrl")},alt:{mac:{symbol:"⌥",name:"Option"},windows:f("Alt"),linux:f("Alt")},shift:{mac:{symbol:"⇧",name:"Shift"},windows:f("Shift"),linux:f("Shift")},enter:{mac:{symbol:"↩",name:"Enter"},windows:f("Enter"),linux:f("Enter")},tab:{mac:{symbol:"⇥",name:"Tab"},windows:f("Tab"),linux:f("Tab")},escape:{mac:{symbol:"⎋",name:"Escape"},windows:f("Esc"),linux:f("Esc")},backspace:{mac:{symbol:"⌫",name:"Backspace"},windows:f("Backspace"),linux:f("Backspace")},delete:{mac:{symbol:"⌦",name:"Delete"},windows:f("Del"),linux:f("Del")},capslock:{mac:{symbol:"⇪",name:"Caps Lock"},windows:f("Caps Lock"),linux:f("Caps Lock")}},h={arrowup:{symbol:"↑",name:"Arrow up"},arrowdown:{symbol:"↓",name:"Arrow down"},arrowleft:{symbol:"←",name:"Arrow left"},arrowright:{symbol:"→",name:"Arrow right"}};function g(){return()=>{}}function k(){return"windows"}const v={xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"lg"},C={solid:[d,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[d,"border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-accent) bg-(--n-soft)"},j={xs:"min-w-5.5",sm:"min-w-6.5",md:"min-w-8",lg:"min-w-10",xl:"min-w-12"};export const Shortcut=/*@__PURE__*/s.forwardRef(function(d,E){const{variant:S="outline",size:A="md",color:N="secondary",density:B="compact",elevation:D=0,keys:L,os:T="auto",separator:z,className:F,style:O,...R}=x(d,["size","density","variant"]),U=s.useSyncExternalStore(g,b,k),W="auto"===T?U:T,q=v[A],G=p(L).map(n=>function(n,e){const a=u(n),s=h[a];if(s)return s;const o=y[a];return o?o[e]:f(1===n.length?n.toUpperCase():n)}(n,W)),H=void 0===z?"mac"===W?null:"+":z,I=["inline-flex shrink-0 items-center justify-center","font-mono font-medium leading-none whitespace-nowrap tabular-nums",o[q],t[q],j[q],m[B][q],i[q],C[S],w].join(" ");return n("span",{ref:E,className:r("inline-flex max-w-full items-center gap-1 align-middle",F??""),style:{...l(N,D,S),...O},...R,children:G.map((o,l)=>a(s.Fragment,{children:[l>0&&null!==H?n("span",{"aria-hidden":"true",className:"text-(--neba-muted-fg)",children:H}):null,n("kbd",{className:I,children:o.symbol===o.name?o.symbol:a(e,{children:[n("span",{"aria-hidden":"true",children:o.symbol}),n("span",{className:c,children:o.name})]})})]},l))})});
1
+ "use client";import{jsx as n,Fragment as e,jsxs as a}from"react/jsx-runtime";import*as s from"react";import{controlHeightClasses as o,controlSlots as t,controlTextClasses as l,cx as r,paddingXClasses as i,radiusClasses as m,srOnlyClasses as c,surfaceClasses as d,transitionClasses as u}from"../../internal/styles.js";import{canonicalKey as w,readOS as b,tokenize as p}from"../../internal/keys.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const f=n=>({symbol:n,name:n}),y={mod:{mac:{symbol:"⌘",name:"Command"},windows:f("Ctrl"),linux:f("Ctrl")},meta:{mac:{symbol:"⌘",name:"Command"},windows:f("Win"),linux:f("Super")},ctrl:{mac:{symbol:"⌃",name:"Control"},windows:f("Ctrl"),linux:f("Ctrl")},alt:{mac:{symbol:"⌥",name:"Option"},windows:f("Alt"),linux:f("Alt")},shift:{mac:{symbol:"⇧",name:"Shift"},windows:f("Shift"),linux:f("Shift")},enter:{mac:{symbol:"↩",name:"Enter"},windows:f("Enter"),linux:f("Enter")},tab:{mac:{symbol:"⇥",name:"Tab"},windows:f("Tab"),linux:f("Tab")},escape:{mac:{symbol:"⎋",name:"Escape"},windows:f("Esc"),linux:f("Esc")},backspace:{mac:{symbol:"⌫",name:"Backspace"},windows:f("Backspace"),linux:f("Backspace")},delete:{mac:{symbol:"⌦",name:"Delete"},windows:f("Del"),linux:f("Del")},capslock:{mac:{symbol:"⇪",name:"Caps Lock"},windows:f("Caps Lock"),linux:f("Caps Lock")}},h={arrowup:{symbol:"↑",name:"Arrow up"},arrowdown:{symbol:"↓",name:"Arrow down"},arrowleft:{symbol:"←",name:"Arrow left"},arrowright:{symbol:"→",name:"Arrow right"}},g={ctrl:0,alt:1,shift:2,meta:3,mod:3};function k(){return()=>{}}function v(){return"windows"}const C={xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"lg"},j={solid:[d,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[d,"border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-on-tint) bg-(--n-soft)"},S={xs:"min-w-5.5",sm:"min-w-6.5",md:"min-w-8",lg:"min-w-10",xl:"min-w-12"};export const Shortcut=/*@__PURE__*/s.forwardRef(function Shortcut(d,E){const{variant:A="outline",size:N="md",color:B="secondary",density:D="compact",elevation:L=0,keys:T,os:z="auto",separator:F,className:O,style:R,...U}=x(d,["size","density","variant"]),W=s.useSyncExternalStore(k,b,v),q="auto"===z?W:z,G=C[N],H=("mac"===q?function(n){const e=n.slice(0,-1);return e.every(n=>w(n)in g)?[...e.sort((n,e)=>g[w(n)]-g[w(e)]),...n.slice(-1)]:n}(p(T)):p(T)).map(n=>function(n,e){const a=w(n),s=h[a];if(s)return s;const o=y[a];return o?o[e]:f(1===n.length?n.toUpperCase():n)}(n,q)),I=void 0===F?"mac"===q?null:"+":F,J=["inline-flex shrink-0 items-center justify-center","font-mono font-medium leading-none whitespace-nowrap tabular-nums",o[G],l[G],S[G],i[D][G],m[G],j[A],u].join(" ");return n("span",{ref:E,className:r("inline-flex max-w-full items-center gap-1 align-middle",O??""),style:{...t(B,L,A),...R},...U,children:H.map((o,t)=>a(s.Fragment,{children:[t>0&&null!==I?n("span",{"aria-hidden":"true",className:"text-(--neba-muted-fg)",children:I}):null,n("kbd",{className:J,children:o.symbol===o.name?o.symbol:a(e,{children:[n("span",{"aria-hidden":"true",children:o.symbol}),n("span",{className:c,children:o.name})]})})]},t))})});
@@ -51,10 +51,11 @@ export interface ShowProps extends React.ComponentPropsWithoutRef<'div'> {
51
51
  * {useBreakpoint('md') && <Map />}
52
52
  * ```
53
53
  *
54
- * The wrapper is `display: contents`, so it adds no box: a `Show` inside a
55
- * `GridContainer` leaves its children as grid items, and one inside a flex row
56
- * leaves them as flex items. Nothing it is given to style — padding, a
57
- * background — would have anywhere to land, so put those on an element inside
58
- * it or name the element with `render`.
54
+ * Without `render` the wrapper is `display: contents`, so it adds no box: a
55
+ * `Show` inside a `GridContainer` leaves its children as grid items, and one
56
+ * inside a flex row leaves them as flex items. Nothing it is given to style —
57
+ * padding, a background — would have anywhere to land, so put those on an
58
+ * element inside it. An element named with `render` keeps its own box, so a
59
+ * `<td>` keeps its padding and border and only the hiding is added.
59
60
  */
60
61
  export declare const Show: React.ForwardRefExoticComponent<ShowProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- "use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{hiddenBelowClasses as o,hiddenFromClasses as n}from"../../internal/responsive.js";import{cx as s}from"../../internal/styles.js";export const Show=/*@__PURE__*/e.forwardRef(function({above:e,below:t,render:a,className:i,children:c,...m},l){const f=s("contents",e?o[e]:"",t?n[t]:"",i??"");return r({render:a,ref:l,props:{className:f,children:c,...m}})});
1
+ "use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{hiddenBelowClasses as o,hiddenFromClasses as n}from"../../internal/responsive.js";import{cx as s}from"../../internal/styles.js";export const Show=/*@__PURE__*/e.forwardRef(function Show({above:e,below:t,render:a,className:i,children:c,...m},l){const f=s(a?"":"contents",e?o[e]:"",t?n[t]:"",i??"");return r({render:a,ref:l,props:{className:f,children:c,...m}})});
@@ -65,11 +65,13 @@ export interface SidebarProps extends Omit<React.ComponentPropsWithoutRef<'aside
65
65
  /**
66
66
  * Whether the column holds its place while the page scrolls past it.
67
67
  *
68
- * On by default, and it costs nothing when it is not needed: with the page
69
- * scrolling it becomes a `sticky` column as tall as what is left of the
70
- * window under the header, and with only the content scrolling it is already
71
- * as tall as the layout and this changes nothing.
72
- * @default true
68
+ * On inside a PageLayout, where it costs nothing when it is not needed: with
69
+ * the page scrolling it becomes a `sticky` column as tall as what is left of
70
+ * the window under the header, and with only the content scrolling it is
71
+ * already as tall as the layout and this changes nothing. Off outside one,
72
+ * where a column the height of the window would reach past the box it was put
73
+ * in and leave its last items out of reach.
74
+ * @default true inside a PageLayout, false outside one
73
75
  */
74
76
  sticky?: boolean;
75
77
  /**
@@ -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 i}from"../../internal/drag.js";import{layoutMessages as l,useMessages as s}from"../../internal/i18n.js";import{drawerSide as d,expandedOnlyClasses as c,PageLayoutContext as u,SidebarSideContext as p,useCollapsed as f}from"../../internal/page-layout.js";import{cx as m,surfaceClasses as b,surfaceSlots as v,toLength as g,toPixels as h,transitionClasses as x}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const w={xs:"11rem",sm:"13rem",md:"16rem",lg:"18rem",xl:"21rem"},j={solid:[b,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[b,"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(b,z){const{side:C,width:R,minWidth:k=160,maxWidth:S=480,resizable:B=!1,onResize:N,onResizeEnd:O,collapseBelow:D,open:M,defaultOpen:A=!1,onOpenChange:E,sticky:I=!0,title:T,variant:W="outline",size:L="md",color:P="primary",density:X="default",elevation:_=0,divider:K=!0,padded:$=!0,label:q,locale:F,className:G,style:H,children:J,...Q}=y(b,["size","density","variant","locale"]),U=r.useContext(u),V=r.useContext(p),Y=C??V??"start",Z=F??U.locale,ee=s(l,Z),te=D??(U.present?U.collapseBelow:"none"),re=f(te),[ne,oe]=r.useState(A),ae=void 0!==M,ie=ae?M:U.present?U.open[Y]:ne,le=e=>{ae||(U.present?U.setOpen(Y,e):oe(e)),E?.(e)},se=g(R)??w[L],de=r.useRef(null),ce=r.useCallback(e=>{de.current=e,"function"==typeof z?z(e):z&&(z.current=e)},[z]),ue=r.useRef(null);r.useEffect(()=>()=>ue.current?.(),[]);const pe=e=>{const t=de.current;if(!t)return e;const r=(e,r)=>null==e?r:"number"==typeof e?e:h(e,{percentOf:"undefined"==typeof window?0:window.innerWidth,relativeTo:t})??r,n=Math.min(r(S,480),Math.max(r(k,160),Math.round(e)));return t.style.setProperty("--n-sidebar-w",`${n}px`),n},fe=e("div",{className:m("min-h-0 flex-1 overflow-y-auto overscroll-contain",$?m(n[X][L],o[X][L]):""),children:J});return re?e(a,{side:d(Y),mode:"overlay",open:ie,onOpenChange:le,title:T,size:L,color:P,density:X,locale:Z,closeLabel:ee.closeSidebar,extent:void 0===R?void 0:se,"aria-label":T?void 0:q??ee.sidebar,className:G,style:H,...Q,children:J}):t("aside",{ref:ce,"aria-label":q??ee.sidebar,className:m("relative flex min-w-0 shrink-0 flex-col","w-(--n-sidebar-w)",j[W],K?m("start"===Y?"border-e":"border-s","[border-color:var(--n-line)]"):"","content"===U.scroll?"h-full":I?m("self-start","sticky [top:var(--n-layout-header,0px)]","[height:calc(100dvh-var(--n-layout-header,0px)-var(--n-layout-footer,0px))]"):"",c[te],x,G),style:{...v(P,_),"--n-sidebar-w":se,...H},...Q,children:[fe,B?e("div",{role:"separator","aria-orientation":"vertical","aria-label":ee.resizeSidebar,tabIndex:0,className:m("absolute inset-y-0 z-1 w-2 cursor-col-resize","start"===Y?"end-0 -me-1":"start-0 -ms-1","bg-transparent hover:bg-(--n-soft) data-[dragging]:bg-(--n-soft)",x,"[outline:none] focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-0"),onPointerDown:e=>{const t=de.current;if(!t||0!==e.button)return;const r=e.currentTarget,n=e.clientX,o=t.getBoundingClientRect().width,a="rtl"===getComputedStyle(t).direction,l="start"===Y===a?-1:1;let s=o;ue.current=i({target:r,pointerId:e.pointerId,onMove:e=>{s=pe(o+(e.clientX-n)*l),N?.(s)},onEnd:()=>{ue.current=null,O?.(s)}})},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=de.current;if(!t)return;const r=pe(t.getBoundingClientRect().width+e);N?.(r),O?.(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}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 +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 t,useMessages as n}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 c(){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(p,m){const{side:u="start",collapseBelow:f,icon:d,label:h,locale:j,variant:x="text",className:b,onClick:k,...v}=s(p,["variant","locale"]),g=r.useContext(i),w=j??g.locale,B=n(t,w);if(!g.present)return null;const C=f??g.collapseBelow,M=g.open[u];return e(o,{ref:m,variant:x,icon:d??e(c,{}),label:h??(M?B.closeSidebar:B.openSidebar),"aria-expanded":M,className:l(a[C],b),onClick:e=>{g.setOpen(u,!M),k?.(e)},...v})});
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})});
@@ -52,7 +52,7 @@ export interface SkeletonProps extends Omit<React.ComponentPropsWithoutRef<'div'
52
52
  * Unset — the default — the placeholder is `aria-hidden`, because a dozen
53
53
  * boxes each announcing themselves is worse than silence. Give the *one*
54
54
  * skeleton that stands for the whole region a label and it becomes a live
55
- * `status` instead.
55
+ * `status` holding the label as visually hidden text.
56
56
  */
57
57
  label?: string;
58
58
  /**
@@ -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,surfaceSlots as a}from"../../internal/styles.js";import{useStyleDefaults as o}from"../../internal/defaults.js";const m={xs:"h-[0.6875rem]",sm:"h-[0.75rem]",md:"h-[0.8125rem]",lg:"h-[0.9375rem]",xl:"h-[1.0625rem]"},i={xs:"gap-[0.3125rem]",sm:"gap-[0.375rem]",md:"gap-[0.5625rem]",lg:"gap-[0.5625rem]",xl:"gap-[0.6875rem]"},t={xs:"rounded-[0.3125rem]",sm:"rounded-[0.3125rem]",md:"rounded-[0.375rem]",lg:"rounded-[0.4375rem]",xl:"rounded-[0.5rem]"},u={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)"},h="relative overflow-hidden bg-(--n-soft-hover)";function c(e){if(void 0!==e)return"number"==typeof e?`${e}px`:e}export const Skeleton=/*@__PURE__*/r.forwardRef(function(r,x){const{shape:p="line",lines:g=1,size:b="md",color:w="secondary",width:y,height:$,animated:v=!0,label:j,render:k,className:N,style:z,...A}=o(r,["size"]),B=v?"neba-skeleton":"",R="circle"===p?`rounded-full ${n[b]} ${s[b]} shrink-0`:"rect"===p?`w-full ${f[b]} ${void 0===$?u[b]:""}`:`w-full ${t[b]} ${m[b]}`,S=j?{role:"status","aria-busy":!0,"aria-label":j}:{"aria-hidden":!0},q="line"===p&&g>1;return l({render:k,ref:x,props:{className:(q?["flex w-full flex-col",i[b],N??""]:[h,B,R,N??""]).filter(Boolean).join(" "),style:{...a(w,0),width:c(y),height:c($),...z},...S,...q?{children:Array.from({length:g},(r,l)=>e("div",{className:d(h,B,t[b],m[b],l===g-1?"w-3/5":"w-full")},l))}:null,...A}})});
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}})});
@@ -45,13 +45,25 @@ export interface SliderProps extends BaseSliderProps {
45
45
  * An array is the marks, each at its own `value`, and a mark with no `label`
46
46
  * is a tick on its own. `true` is a tick at every `step`, which is worth
47
47
  * pairing with a step you chose — the default `step={1}` over the default
48
- * range is a hundred of them.
48
+ * range is a hundred and one of them, and past a hundred steps none are drawn.
49
49
  *
50
50
  * A mark is read by the eye and not by a screen reader: the value is already
51
51
  * announced by the thumb, and a second reading of the same numbers is noise.
52
52
  * @default false
53
53
  */
54
54
  marks?: boolean | readonly SliderMark[];
55
+ /**
56
+ * Names each thumb, by its index. A range slider's two thumbs are otherwise
57
+ * both named by `label`, which leaves a screen reader two controls called the
58
+ * same thing: `(index) => (index === 0 ? 'Minimum price' : 'Maximum price')`.
59
+ */
60
+ getAriaLabel?: (index: number) => string;
61
+ /**
62
+ * What a thumb's value is read out as. Handed the value as the slider shows
63
+ * it, the number itself and the thumb's index — the way to say "20 dollars"
64
+ * rather than "20", or to replace the English Base UI reads for a range.
65
+ */
66
+ getAriaValueText?: (formattedValue: string, value: number, index: number) => string;
55
67
  /** Class names for the root: the column holding the label, the strip and the
56
68
  * line under it. The parts behind it are `classNames`. */
57
69
  className?: string;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{Slider as s}from"@base-ui/react/slider";import{cx as r,hasContent as n,metaTextClasses as t,surfaceClasses as o,transitionClasses as i}from"../../internal/styles.js";import{WidthSizer as c}from"../../internal/sizer.js";import{useStyleDefaults as m}from"../../internal/defaults.js";const u={xs:"h-1",sm:"h-1.5",md:"h-1.5",lg:"h-2",xl:"h-2.5"},f={xs:"w-1",sm:"w-1.5",md:"w-1.5",lg:"w-2",xl:"w-2.5"},d={xs:"size-3",sm:"size-3.5",md:"size-4",lg:"size-5",xl:"size-6"},h={xs:"h-4",sm:"h-4.5",md:"h-5",lg:"h-6",xl:"h-7"},b={xs:"w-4",sm:"w-4.5",md:"w-5",lg:"w-6",xl:"w-7"},x=`rounded-full bg-(--n-fill) ${i}`,p=["rounded-full border bg-(--neba-surface)",o,"[border-color:var(--n-line-hover)]","[box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]","cursor-grab select-none active:cursor-grabbing",i,"hover:[box-shadow:var(--neba-shadow-2),0_0_0_4px_var(--n-soft)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2","data-[dragging]:[box-shadow:var(--neba-shadow-1),0_0_0_6px_var(--n-soft-hover)]"].join(" ");function v(e,l,a,s){const r=(e.value-l)/(a-l)*100;return s?{insetBlockEnd:`${r}%`}:{insetInlineStart:`${r}%`}}export const Slider=/*@__PURE__*/a.forwardRef(function(o,i){const{size:g="md",color:w="primary",orientation:N="horizontal",label:$,description:y,showValue:_=!1,marks:z=!1,disabled:j=!1,classNames:k,min:A=0,max:S=100,step:V=1,className:I,style:M,...R}=m(o,["size"]),T="vertical"===N,B=a.useMemo(()=>!0===z?function(e,l,a){const s=l-e;if(!(a>0)||!(s>0)||s/a>100)return[];const r=Math.floor(s/a);return Array.from({length:r+1},(l,s)=>({value:e+s*a}))}(A,S,V):!1===z?[]:[...z],[z,A,S,V]),C={"--n-fill":`var(--neba-${w}-fill)`,"--n-accent":`var(--neba-${w}-accent)`,"--n-soft":`var(--neba-${w}-soft)`,"--n-soft-hover":`var(--neba-${w}-soft-hover)`,"--n-line-hover":`var(--neba-${w}-line-hover)`,"--n-ring":`var(--neba-${w}-ring)`},E=R.value??R.defaultValue,L=Array.isArray(E)?E.length:1,q=e(s.Control,{className:r("flex touch-none select-none items-center justify-center",T?`${b[g]} h-full flex-col`:`w-full ${h[g]}`,k?.control),children:l(s.Track,{className:r("rounded-full bg-(--n-soft)",T?`${f[g]} h-full`:`${u[g]} w-full`,k?.track),children:[e(s.Indicator,{className:r(x,k?.indicator)}),Array.from({length:L},(l,a)=>e(s.Thumb,{index:a,className:r(p,d[g],k?.thumb)},a))]})}),D=B.some(e=>n(e.label)),F=B.length>0?l("div",{"aria-hidden":"true",className:r("relative",t[g],T?"h-full ps-3":D?"h-[calc(1lh+0.375rem)] w-full":"h-1.5 w-full"),children:[B.map((a,s)=>l("span",{className:r("absolute flex text-(--neba-muted-fg)",T?"start-0 h-0 items-center gap-1.5":"top-0 w-0 flex-col items-center",k?.mark),style:v(a,A,S,T),children:[e("span",{className:r("shrink-0 rounded-full bg-(--neba-border)",T?"h-px w-1.5":"h-1.5 w-px")}),n(a.label)?e("span",{className:"whitespace-nowrap",children:a.label}):null]},`${a.value}:${s}`)),T?e(c,{samples:B.filter(e=>n(e.label)).map(e=>e.label)}):null]}):null;return l(s.Root,{ref:i,orientation:N,disabled:j,className:r("flex",T?"w-fit flex-col items-center gap-2":"w-full flex-col gap-1.5",j?"[filter:saturate(0.25)] opacity-70 [&_*]:cursor-not-allowed":"",I??""),style:{...C,...M},min:A,max:S,step:V,...R,children:[$||_?l("div",{className:`flex w-full items-baseline gap-2 ${t[g]}`,children:[$?e(s.Label,{className:r("font-medium",j?"text-(--neba-disabled-fg)":"text-(--neba-fg)",k?.label),children:$}):null,_?e(s.Value,{className:"ms-auto tabular-nums text-(--neba-muted-fg)",children:"function"==typeof _?_:null}):null]}):null,T?l("div",{className:"flex h-40 items-stretch",children:[q,F]}):q,T?null:F,y?e("div",{className:r(t[g],"text-(--neba-muted-fg)",k?.description),children:y}):null]})});
1
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{Slider as r}from"@base-ui/react/slider";import{cx as n,hasContent as s,metaTextClasses as i,surfaceClasses as t,transitionClasses as o}from"../../internal/styles.js";import{WidthSizer as d}from"../../internal/sizer.js";import{useStyleDefaults as c}from"../../internal/defaults.js";const b={xs:"h-1",sm:"h-1.5",md:"h-1.5",lg:"h-2",xl:"h-2.5"},u={xs:"w-1",sm:"w-1.5",md:"w-1.5",lg:"w-2",xl:"w-2.5"},f={xs:"size-3",sm:"size-3.5",md:"size-4",lg:"size-5",xl:"size-6"},m={xs:"h-4",sm:"h-4.5",md:"h-5",lg:"h-6",xl:"h-7"},h={xs:"w-4",sm:"w-4.5",md:"w-5",lg:"w-6",xl:"w-7"},g=`neba-slider-indicator rounded-full bg-(--n-fill) ${o}`,x=["neba-slider-thumb rounded-full border bg-(--neba-surface)",t,"[border-color:var(--n-line-hover)]","[box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]","cursor-grab select-none active:cursor-grabbing",o,"hover:[box-shadow:var(--neba-shadow-2),0_0_0_4px_var(--n-soft)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2","data-[dragging]:[box-shadow:var(--neba-shadow-1),0_0_0_6px_var(--n-soft-hover)]"].join(" "),v=["neba-slider-thumb rounded-full border bg-(--neba-surface)",t,"[border-color:var(--neba-disabled-border)] shadow-none"].join(" ");function p(e,l,a,r){const n=(e.value-l)/(a-l)*100;return r?{insetBlockEnd:`${n}%`}:{insetInlineStart:`${n}%`}}export const Slider=/*@__PURE__*/a.forwardRef(function Slider(t,o){const{size:w="md",color:N="primary",orientation:$="horizontal",label:y,description:_,showValue:j=!1,marks:z=!1,disabled:A=!1,classNames:k,min:V=0,max:S=100,step:T=1,getAriaLabel:I,getAriaValueText:L,className:B,style:M,"aria-label":R,"aria-labelledby":C,"aria-describedby":E,...q}=c(t,["size"]),D="vertical"===$,F=a.useId(),G=[E,s(_)?F:void 0].filter(Boolean).join(" ")||void 0,H=a.useMemo(()=>!0===z?function(e,l,a){const r=l-e;if(!(a>0)||!(r>0)||r/a>100)return[];const n=Math.floor(r/a+1e-9);return Array.from({length:n+1},(l,r)=>({value:e+r*a}))}(V,S,T):!1===z?[]:[...z],[z,V,S,T]),J={"--n-fill":`var(--neba-${N}-fill)`,"--n-accent":`var(--neba-${N}-accent)`,"--n-soft":`var(--neba-${N}-soft)`,"--n-soft-hover":`var(--neba-${N}-soft-hover)`,"--n-line-hover":`var(--neba-${N}-line-hover)`,"--n-ring":`var(--neba-${N}-ring)`},K=q.value??q.defaultValue,O=Array.isArray(K)?K.length:1,P=e(r.Control,{className:n("flex touch-none select-none items-center justify-center",D?`${h[w]} h-full flex-col`:`w-full ${m[w]}`,k?.control),children:l(r.Track,{className:n(A?"neba-slider-rail rounded-full bg-(--neba-disabled-bg)":"neba-slider-rail rounded-full bg-(--n-soft)",D?`${u[w]} h-full`:`${b[w]} w-full`,k?.track),children:[e(r.Indicator,{className:n(A?"neba-slider-indicator rounded-full bg-(--neba-disabled-fg)":g,k?.indicator)}),Array.from({length:O},(l,a)=>e(r.Thumb,{index:a,"aria-label":R,"aria-labelledby":C,"aria-describedby":G,getAriaLabel:I,getAriaValueText:L,className:n(A?v:x,f[w],k?.thumb)},a))]})}),Q=H.some(e=>s(e.label)),U=H.length>0?l("div",{"aria-hidden":"true",className:n("relative",i[w],D?"h-full ps-3":Q?"h-[calc(1lh+0.375rem)] w-full":"h-1.5 w-full"),children:[H.map((a,r)=>l("span",{className:n("absolute flex text-(--neba-muted-fg)",D?"start-0 h-0 items-center gap-1.5":"top-0 w-0 flex-col items-center",k?.mark),style:p(a,V,S,D),children:[e("span",{className:n("shrink-0 rounded-full bg-(--neba-border)",D?"h-px w-1.5":"h-1.5 w-px")}),s(a.label)?e("span",{className:"whitespace-nowrap",children:a.label}):null]},`${a.value}:${r}`)),D?e(d,{samples:H.filter(e=>s(e.label)).map(e=>e.label)}):null]}):null;return l(r.Root,{ref:o,orientation:$,disabled:A,className:n("flex",D?"w-fit flex-col items-center gap-2":"w-full flex-col gap-1.5",A?"[&_*]:cursor-not-allowed":"",B??""),style:{...J,...M},min:V,max:S,step:T,...q,children:[y||j?l("div",{className:`flex w-full items-baseline gap-2 ${i[w]}`,children:[y?e(r.Label,{className:n("font-medium",A?"text-(--neba-disabled-fg)":"text-(--neba-fg)",k?.label),children:y}):null,j?e(r.Value,{className:"ms-auto tabular-nums text-(--neba-muted-fg)",children:"function"==typeof j?j:null}):null]}):null,D?l("div",{className:"flex h-40 items-stretch",children:[P,U]}):P,D?null:U,_?e("div",{id:F,className:n(i[w],"text-(--neba-muted-fg)",k?.description),children:_}):null]})});
@@ -0,0 +1,78 @@
1
+ import * as React from 'react';
2
+ import { type SourcesMessages } from '../../internal/i18n.js';
3
+ import type { NebaElevation, NebaSlots, NebaStyleProps } from '../../types.js';
4
+ /** One thing an answer was built out of. */
5
+ export interface SourceItem {
6
+ /** Its name. The link text, and the heading of an [InlineCitation]'s preview. */
7
+ title: React.ReactNode;
8
+ /**
9
+ * Where it points. A scheme outside `http`, `https`, `mailto` and `tel`
10
+ * leaves the row without a link rather than writing it out, because a URL in
11
+ * a search result was not written by the page's author.
12
+ */
13
+ href?: string;
14
+ /** The line under the title — the passage that matched, the publisher, a date. */
15
+ description?: React.ReactNode;
16
+ /** Where it came from, set beside the title. A domain, a publication. */
17
+ site?: React.ReactNode;
18
+ /** A favicon or a thumbnail, in the square before the number. */
19
+ icon?: React.ReactNode;
20
+ /**
21
+ * The number this source is cited by, overriding its place in the list. For a
22
+ * list that shows only the sources actually cited, out of a longer set.
23
+ */
24
+ index?: number;
25
+ /** Where the link opens. `rel` gains `noopener noreferrer` whenever it leaves the tab. */
26
+ target?: string;
27
+ rel?: string;
28
+ }
29
+ /** The parts a Sources draws behind its root. */
30
+ export type SourcesSlot = 'header' | 'list' | 'item';
31
+ export interface SourcesProps extends Pick<NebaStyleProps, 'size' | 'variant' | 'color' | 'density'>, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title' | 'onChange'> {
32
+ /** The sources, in the order they are numbered. */
33
+ items: readonly SourceItem[];
34
+ /** The heading. Defaults to the `locale`'s word for it. */
35
+ title?: React.ReactNode;
36
+ /**
37
+ * Folds the list behind the heading.
38
+ *
39
+ * On, because a list of sources is the longest thing in an answer and the
40
+ * least often read: what a reader wants from it most of the time is to know
41
+ * how many there were. Off, the heading is a plain line and the list is open.
42
+ * @default true
43
+ */
44
+ collapsible?: boolean;
45
+ /** Whether the list is showing. Pass it to drive the disclosure yourself. */
46
+ open?: boolean;
47
+ /** Where an uncontrolled Sources starts. @default false */
48
+ defaultOpen?: boolean;
49
+ /** Called when the heading opens or closes the list. */
50
+ onOpenChange?: (open: boolean) => void;
51
+ /**
52
+ * Numbers the rows, so a citation in the body has something to point at.
53
+ * @default true
54
+ */
55
+ numbered?: boolean;
56
+ /**
57
+ * Drop shadow depth. `0` (the default) is flat.
58
+ * @default 0
59
+ */
60
+ elevation?: NebaElevation;
61
+ /** Which language the heading is written in, as a BCP 47 tag. */
62
+ locale?: string;
63
+ /** Those words, written out. Overrides the `locale`'s. */
64
+ labels?: Partial<SourcesMessages>;
65
+ /** Class names for the parts behind the root. */
66
+ classNames?: NebaSlots<SourcesSlot>;
67
+ }
68
+ /**
69
+ * The list of things an answer was built out of.
70
+ *
71
+ * A [List](../display/list) would draw the rows. What it has no way to do is
72
+ * the part that makes this a component: the rows are *numbered*, and the
73
+ * numbers are what an [InlineCitation](./inline-citation) in the body points
74
+ * at. Numbering a list by hand is numbering it twice — once here and once in
75
+ * every sentence that cites it — and the second copy is the one that goes
76
+ * wrong.
77
+ */
78
+ export declare const Sources: React.ForwardRefExoticComponent<SourcesProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +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]})});
@@ -0,0 +1,2 @@
1
+ export { Sources } from './Sources.js';
2
+ export type { SourceItem, SourcesProps, SourcesSlot } from './Sources.js';
@@ -0,0 +1 @@
1
+ export{Sources}from"./Sources.js";
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { NebaChartCurve, NebaChartDatum, NebaColor, NebaSize } from '../../types.js';
2
+ import type { NebaChartCurve, NebaChartDatum, NebaChartNulls, NebaColor, NebaSize } from '../../types.js';
3
3
  export interface SparklineProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'children'> {
4
4
  /** The values. `null` is a gap, exactly as it is on every other chart. */
5
5
  data: readonly NebaChartDatum[];
@@ -12,6 +12,19 @@ export interface SparklineProps extends Omit<React.ComponentPropsWithoutRef<'div
12
12
  shape?: 'line' | 'area' | 'bar';
13
13
  /** @default 'linear' */
14
14
  curve?: NebaChartCurve;
15
+ /**
16
+ * What the strip does where a value is missing: break at it, bridge it, or
17
+ * read it as a nought. The same three answers a
18
+ * [LineChart](./line-chart) gives, and they mean the same things.
19
+ *
20
+ * It matters more here than on a full chart, because there is no tooltip and
21
+ * no axis to notice the hole with: a strip that quietly closes over three
22
+ * missing weeks is a trend nobody can tell was interpolated. `zero` rewrites
23
+ * the values, so the range the strip scales itself to takes the nought in and
24
+ * the numbers read out to a screen reader say `0` as well.
25
+ * @default 'gap'
26
+ */
27
+ nulls?: NebaChartNulls;
15
28
  /**
16
29
  * How tall the strip is. Sized against the line of text it sits beside rather
17
30
  * than against the page — a sparkline is a word in a sentence, not a picture.
@@ -1 +1 @@
1
- "use client";import{jsx as a,jsxs as e,Fragment as l}from"react/jsx-runtime";import*as t from"react";import{areaPath as r,barMaxThickness as n,barPath as i,barRadius as o,extentOf as s,lineWidths as m,markerRadii as h,markGap as u,resolveColor as c,sparklineHeights as d,toValue as f}from"../../internal/chart.js";import{useMeasuredWidth as p}from"../../internal/chart-frame.js";import{cx as x,srOnlyClasses as v}from"../../internal/styles.js";import{linePath as b}from"../../internal/chart.js";import{useStyleDefaults as g}from"../../internal/defaults.js";export const Sparkline=/*@__PURE__*/t.forwardRef(function(M,k){const{data:y,shape:j="line",curve:w="linear",size:$="md",color:N,endDot:W=!1,baseline:z,min:C,max:L,width:R,label:B,className:D,style:F,...G}=g(M,["size"]),I=t.useRef(null),S=p(I),q=t.useId().replace(/:/g,""),A=t.useMemo(()=>y.map(f),[y]),E=d[$],H=m[$],J=h[$],K=s([A],!1),O=C??(K?Math.min(K.min,z??K.min):0),P=(L??(K?Math.max(K.max,z??K.max):1))-O||1,Q="number"==typeof R?R:S,T=c(N??"var(--neba-chart-1)"),U="bar"===j?0:H/2+(W?J:0),V=U,X=Math.max(1,E-2*U),Y=a=>V+(1-(a-O)/P)*X,Z=A.length>1?Q/(A.length-1):Q,_=A.map((a,e)=>null===a.value?null:{x:e*Z,y:Y(a.value)}),aa=(()=>{for(let a=A.length-1;a>=0;a--)if(null!==A[a].value)return a;return-1})(),ea=Math.min(n[$]/2,Math.max(1,Q/Math.max(1,A.length)-u));return e("div",{ref:k,className:x("relative block",D??void 0),style:{width:R??"100%",height:E,...F},...G,children:[a("div",{ref:I,className:"absolute inset-0",children:Q>0&&A.length>0?e("svg",{width:Q,height:E,viewBox:`0 0 ${Q} ${E}`,role:B?"img":"presentation","aria-label":B,"aria-hidden":!B||void 0,className:"block overflow-visible",children:["area"===j?e(l,{children:[a("defs",{children:e("linearGradient",{id:`${q}-fill`,x1:"0",y1:"0",x2:"0",y2:"1",children:[a("stop",{offset:"0%",stopColor:`color-mix(in oklab, ${T} 32%, transparent)`}),a("stop",{offset:"100%",stopColor:`color-mix(in oklab, ${T} 2%, transparent)`})]})}),a("path",{d:r(_,E,w),fill:`url(#${q}-fill)`})]}):null,void 0!==z?a("line",{x1:0,x2:Q,y1:Y(z),y2:Y(z),stroke:"var(--neba-chart-baseline)",strokeWidth:1}):null,"bar"===j?A.map((e,l)=>null===e.value?null:a("path",{d:i(l*(Q/Math.max(1,A.length))+(Q/Math.max(1,A.length)-ea)/2,Math.min(Y(e.value),Y(Math.max(O,0))),ea,Math.max(1,Math.abs(Y(e.value)-Y(Math.max(O,0)))),o/2,e.value>=0?"up":"down"),fill:e.color??T},l)):a("path",{d:b(_,w),fill:"none",stroke:T,strokeWidth:H,strokeLinecap:"round",strokeLinejoin:"round"}),W&&aa>=0&&"bar"!==j?a("circle",{cx:_[aa].x,cy:_[aa].y,r:J,fill:T,stroke:"var(--neba-chart-gap)",strokeWidth:u}):null]}):null}),B?a("span",{className:v,children:A.map(a=>null===a.value?"—":a.value).join(", ")}):null]})});
1
+ "use client";import{jsx as e,jsxs as a,Fragment as l}from"react/jsx-runtime";import*as r from"react";import{areaPath as t,barMaxThickness as n,barPath as i,barRadius as o,extentOf as s,lineWidths as m,markerRadii as h,markGap as u,resolveColor as c,sparklineHeights as d,toValue as p}from"../../internal/chart.js";import{useMeasuredWidth as f}from"../../internal/chart-frame.js";import{cx as x,srOnlyClasses as v}from"../../internal/styles.js";import{linePath as b}from"../../internal/chart.js";import{useStyleDefaults as g}from"../../internal/defaults.js";export const Sparkline=/*@__PURE__*/r.forwardRef(function Sparkline(k,M){const{data:y,shape:j="line",curve:w="linear",nulls:$="gap",size:N="md",color:z,endDot:W=!1,baseline:B,min:C,max:L,width:R,label:S,className:D,style:F,...G}=g(k,["size"]),I=r.useRef(null),q=f(I),A=r.useId().replace(/:/g,""),E=r.useMemo(()=>{const e=y.map(p);return"zero"===$?e.map(e=>null===e.value?{...e,value:0}:e):e},[y,$]),H=d[N],J=m[N],K=h[N],O=s([E],!1),P="bar"===j,Q=C??(O?Math.min(O.min,B??O.min,P?0:O.min):0),T=L??(O?Math.max(O.max,B??O.max,P?0:O.max):1),U=T-Q||1,V=T===Q&&!P,X=Math.min(Math.max(Q,0),T),Y="number"==typeof R?R:q,Z=c(z??"var(--neba-chart-1)"),_="bar"===j?0:J/2+(W?K:0),ee=_,ae=Math.max(1,H-2*_),le=e=>V?ee+ae/2:ee+(1-(e-Q)/U)*ae,re=E.length>1?Y/(E.length-1):Y,te=E.map((e,a)=>null===e.value?null:{x:a*re,y:le(e.value)}),ne="connect"===$?te.filter(Boolean):te,ie=(()=>{for(let e=E.length-1;e>=0;e--)if(null!==E[e].value)return e;return-1})(),oe=Math.min(n[N]/2,Math.max(1,Y/Math.max(1,E.length)-u));return a("div",{ref:M,className:x("relative block",D??void 0),style:{width:R??"100%",height:H,...F},...G,children:[e("div",{ref:I,className:"absolute inset-0",children:Y>0&&E.length>0?a("svg",{width:Y,height:H,viewBox:`0 0 ${Y} ${H}`,role:S?"img":"presentation","aria-label":S,"aria-hidden":!S||void 0,className:"block overflow-visible",children:["area"===j?a(l,{children:[e("defs",{children:a("linearGradient",{id:`${A}-fill`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"0%",stopColor:`color-mix(in oklab, ${Z} 32%, transparent)`}),e("stop",{offset:"100%",stopColor:`color-mix(in oklab, ${Z} 2%, transparent)`})]})}),e("path",{d:t(ne,H,w),fill:`url(#${A}-fill)`})]}):null,void 0!==B?e("line",{x1:0,x2:Y,y1:le(B),y2:le(B),stroke:"var(--neba-chart-baseline)",strokeWidth:1}):null,"bar"===j?E.map((a,l)=>null===a.value?null:e("path",{d:i(l*(Y/Math.max(1,E.length))+(Y/Math.max(1,E.length)-oe)/2,Math.min(le(a.value),le(X)),oe,Math.max(1,Math.abs(le(a.value)-le(X))),o/2,a.value>=0?"up":"down"),fill:a.color??Z},l)):e("path",{d:b(ne,w),fill:"none",stroke:Z,strokeWidth:J,strokeLinecap:"round",strokeLinejoin:"round"}),W&&ie>=0&&"bar"!==j?e("circle",{cx:te[ie].x,cy:te[ie].y,r:K,fill:Z,stroke:"var(--neba-chart-gap)",strokeWidth:u}):null]}):null}),S?e("span",{className:v,children:E.map(e=>null===e.value?"—":e.value).join(", ")}):null]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import*as r from"react";import{Button as a}from"../button/Button.js";import{spoilerMessages as n,useMessages as t}from"../../internal/i18n.js";import{boxPaddingClasses as l,boxPaddingXClasses as o,boxPaddingYClasses as s}from"../box/Box.js";import{cx as d,hasContent as c,metaTextClasses as m,radiusClasses as v,surfaceClasses as u,surfaceSlots as f,transitionClasses as p}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";const x={solid:[u,"bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[u,"border bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"bg-transparent"};export const Spoiler=/*@__PURE__*/r.forwardRef(function(u,h){const{revealed:g,defaultRevealed:j=!1,onRevealedChange:y,locale:w,label:N,hideLabel:z,description:C,action:R,reversible:k=!1,maxHeight:_,blur:A=10,padded:B=!0,variant:H="outline",size:S="md",color:T="primary",density:$="default",elevation:I=0,className:L,style:q,children:D,...E}=b(u,["size","density","variant","locale"]),F=t(n,w),G=r.useId(),[J,K]=r.useState(j),M=g??J,O=e=>{void 0===g&&K(e),y?.(e)},P=!1===C?null:C??F.notice;return i("div",{ref:h,className:d("isolate grid overflow-hidden",v[S],x[H],p,L??""),style:{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:k?"auto auto":"auto",...f(T,I),...q},...E,children:[e("div",{id:G,className:d("min-w-0",B?l[$][S]:"","[transition:filter_var(--neba-duration-fill)_var(--neba-ease)]","motion-reduce:[transition-duration:0ms]",M?"":"select-none"),style:{gridArea:"1 / 1",filter:M?void 0:`blur(${A}px)`,maxHeight:M?void 0:_,overflow:M?void 0:"hidden"},inert:!M,children:D}),k?e("div",{className:[M?"":"invisible","flex justify-end",o[$][S],s[$][S],"pt-0"].join(" "),style:{gridArea:"2 / 1"},inert:!M,children:e(a,{variant:"text",size:S,color:T,density:$,onClick:()=>O(!1),"aria-expanded":!0,"aria-controls":G,children:z??F.hide})}):null,i("div",{className:d("z-10 flex flex-col items-center justify-center gap-2 text-center",l[$][S],M?"invisible":"[background-color:color-mix(in_oklab,var(--neba-surface)_55%,transparent)]"),style:{gridRow:"1 / -1",gridColumn:"1"},inert:M,children:[c(P)?e("p",{className:`m-0 text-(--neba-muted-fg) ${m[S]}`,children:P}):null,R??e(a,{size:S,color:T,density:$,onClick:()=>O(!0),"aria-expanded":!1,"aria-controls":G,children:N??F.reveal})]})]})});
1
+ "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as r from"react";import{Button as t}from"../button/Button.js";import{spoilerMessages as i,useMessages as a}from"../../internal/i18n.js";import{boxPaddingClasses as o,boxPaddingXClasses as l,boxPaddingYClasses as s}from"../box/Box.js";import{cx as d,hasContent as c,metaTextClasses as u,radiusClasses as m,surfaceClasses as f,surfaceSlots as v,transitionClasses as p}from"../../internal/styles.js";import{inertValue as b}from"../../internal/inert.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const h={solid:[f,"bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[f,"border bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"bg-transparent"};export const Spoiler=/*@__PURE__*/r.forwardRef(function Spoiler(f,g){const{revealed:y,defaultRevealed:j=!1,onRevealedChange:w,locale:R,label:N,hideLabel:z,description:C,action:S,reversible:k=!1,maxHeight:E,blur:_=10,padded:H=!0,variant:L="outline",size:T="md",color:A="primary",density:B="default",elevation:I=0,className:$,style:q,children:M,...D}=x(f,["size","density","variant","locale"]),F=a(i,R),G=r.useId(),[J,K]=r.useState(j),O=y??J,P=e=>{void 0===y&&K(e),w?.(e)},Q=!1===C?null:C??F.notice,U=r.useRef(null),V=r.useRef(null);return r.useLayoutEffect(()=>{const e=U.current?.parentElement,n=document.activeElement;if(!(e&&n instanceof HTMLElement&&e.contains(n)))return;if(!n.closest("[inert]"))return;const r=O?U.current:V.current?.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');r?.focus({preventScroll:!0})},[O]),n("div",{ref:g,className:d("isolate grid overflow-hidden",m[T],h[L],p,$??""),style:{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:k?"auto auto":"auto",...v(A,I),...q},...D,children:[e("div",{ref:U,id:G,tabIndex:-1,className:d("min-w-0 [outline:none]",H?o[B][T]:"","[transition:filter_var(--neba-duration-fill)_var(--neba-ease)]","motion-reduce:[transition-duration:0ms]",O?"":"select-none"),style:{gridArea:"1 / 1",filter:O?void 0:`blur(${_}px)`,maxHeight:O?void 0:E,overflow:O?void 0:"hidden"},inert:b(!O),children:M}),k?e("div",{className:[O?"":"invisible","flex justify-end",l[B][T],s[B][T],"pt-0"].join(" "),style:{gridArea:"2 / 1"},inert:b(!O),children:e(t,{variant:"text",size:T,color:A,density:B,onClick:()=>P(!1),"aria-expanded":!0,"aria-controls":G,children:z??F.hide})}):null,n("div",{ref:V,className:d("z-10 flex flex-col items-center justify-center gap-2 text-center",o[B][T],O?"invisible":"[background-color:color-mix(in_oklab,var(--neba-surface)_55%,transparent)]"),style:{gridRow:"1 / -1",gridColumn:"1"},inert:b(O),children:[c(Q)?e("p",{className:`m-0 text-(--neba-muted-fg) ${u[T]}`,children:Q}):null,S??e(t,{size:T,color:A,density:B,onClick:()=>P(!0),"aria-expanded":!1,"aria-controls":G,children:N??F.reveal})]})]})});
@@ -11,7 +11,7 @@ import type { NebaSize, NebaStaggerProps, NebaTransition } from '../../types.js'
11
11
  * rather than its edge. How far it drops is `drop`.
12
12
  */
13
13
  export type StackDirection = 'horizontal' | 'vertical' | 'diagonal';
14
- export interface StackProps extends NebaStaggerProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
14
+ export interface StackProps extends NebaStaggerProps, Omit<React.ComponentPropsWithoutRef<'span'>, 'color'> {
15
15
  /** Which way the pile grows. @default 'horizontal' */
16
16
  direction?: StackDirection;
17
17
  /**
@@ -123,4 +123,4 @@ export interface StackProps extends NebaStaggerProps, Omit<React.ComponentPropsW
123
123
  * has to follow the shape it is around: a hairline on the wrapper of a circular
124
124
  * avatar is a square.
125
125
  */
126
- export declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
126
+ export declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLSpanElement>>;