neba 1.13.0 → 1.15.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 (332) 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.js +1 -1
  49. package/dist/components/aspect-ratio/AspectRatio.d.ts +6 -4
  50. package/dist/components/aspect-ratio/AspectRatio.js +1 -1
  51. package/dist/components/avatar/Avatar.js +1 -1
  52. package/dist/components/badge/Badge.js +1 -1
  53. package/dist/components/bar-chart/BarChart.d.ts +1 -1
  54. package/dist/components/bar-chart/BarChart.js +1 -1
  55. package/dist/components/blockquote/Blockquote.js +1 -1
  56. package/dist/components/bottom-navigation/BottomNavigation.d.ts +2 -1
  57. package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
  58. package/dist/components/box/Box.d.ts +5 -0
  59. package/dist/components/box/Box.js +1 -1
  60. package/dist/components/breadcrumb/Breadcrumb.d.ts +10 -0
  61. package/dist/components/breadcrumb/Breadcrumb.js +1 -1
  62. package/dist/components/button/Button.d.ts +11 -0
  63. package/dist/components/button/Button.js +1 -1
  64. package/dist/components/button-group/ButtonGroup.js +1 -1
  65. package/dist/components/calendar/Calendar.js +1 -1
  66. package/dist/components/card/Card.js +1 -1
  67. package/dist/components/carousel/Carousel.d.ts +4 -0
  68. package/dist/components/carousel/Carousel.js +1 -1
  69. package/dist/components/chat-bubble/ChatBubble.js +1 -1
  70. package/dist/components/checkbox/Checkbox.js +1 -1
  71. package/dist/components/chip/Chip.d.ts +3 -1
  72. package/dist/components/chip/Chip.js +1 -1
  73. package/dist/components/code-block/CodeBlock.d.ts +6 -3
  74. package/dist/components/code-block/CodeBlock.js +1 -1
  75. package/dist/components/collapsible/Collapsible.d.ts +11 -1
  76. package/dist/components/collapsible/Collapsible.js +1 -1
  77. package/dist/components/color-picker/ColorPicker.js +1 -1
  78. package/dist/components/combobox/Combobox.d.ts +11 -1
  79. package/dist/components/combobox/Combobox.js +1 -1
  80. package/dist/components/command-palette/CommandPalette.js +1 -1
  81. package/dist/components/confirm/Confirm.js +1 -1
  82. package/dist/components/container/Container.js +1 -1
  83. package/dist/components/context-window/ContextWindow.d.ts +103 -0
  84. package/dist/components/context-window/ContextWindow.js +1 -0
  85. package/dist/components/context-window/index.d.ts +2 -0
  86. package/dist/components/context-window/index.js +1 -0
  87. package/dist/components/data-list/DataList.js +1 -1
  88. package/dist/components/data-table/DataTable.d.ts +12 -1
  89. package/dist/components/data-table/DataTable.js +1 -1
  90. package/dist/components/date-picker/DatePicker.js +1 -1
  91. package/dist/components/date-range-picker/DateRangePicker.js +1 -1
  92. package/dist/components/date-time-picker/DateTimePicker.js +1 -1
  93. package/dist/components/dialog/Dialog.d.ts +12 -0
  94. package/dist/components/dialog/Dialog.js +1 -1
  95. package/dist/components/divider/Divider.js +1 -1
  96. package/dist/components/drawer/Drawer.d.ts +7 -0
  97. package/dist/components/drawer/Drawer.js +1 -1
  98. package/dist/components/empty/Empty.js +1 -1
  99. package/dist/components/fieldset/Fieldset.js +1 -1
  100. package/dist/components/file-picker/FilePicker.d.ts +12 -4
  101. package/dist/components/file-picker/FilePicker.js +1 -1
  102. package/dist/components/flex/Flex.d.ts +8 -2
  103. package/dist/components/flex/Flex.js +1 -1
  104. package/dist/components/floating-action-button/FloatingActionButton.d.ts +16 -1
  105. package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
  106. package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -1
  107. package/dist/components/footer/Footer.d.ts +8 -0
  108. package/dist/components/footer/Footer.js +1 -1
  109. package/dist/components/form/Form.d.ts +4 -2
  110. package/dist/components/form/Form.js +1 -1
  111. package/dist/components/gallery/Gallery.d.ts +56 -3
  112. package/dist/components/gallery/Gallery.js +1 -1
  113. package/dist/components/gallery/GalleryViewer.js +1 -1
  114. package/dist/components/gauge-chart/GaugeChart.js +1 -1
  115. package/dist/components/grid/Grid.js +1 -1
  116. package/dist/components/grid-container/GridContainer.js +1 -1
  117. package/dist/components/header/Header.js +1 -1
  118. package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
  119. package/dist/components/highlight/Highlight.js +1 -1
  120. package/dist/components/how-to-steps/HowToSteps.d.ts +26 -1
  121. package/dist/components/how-to-steps/HowToSteps.js +1 -1
  122. package/dist/components/icon/Icon.js +1 -1
  123. package/dist/components/icon-button/IconButton.d.ts +0 -20
  124. package/dist/components/icon-button/IconButton.js +1 -1
  125. package/dist/components/image/Image.d.ts +137 -11
  126. package/dist/components/image/Image.js +1 -1
  127. package/dist/components/image/index.d.ts +1 -1
  128. package/dist/components/inline-citation/InlineCitation.d.ts +53 -0
  129. package/dist/components/inline-citation/InlineCitation.js +1 -0
  130. package/dist/components/inline-citation/index.d.ts +2 -0
  131. package/dist/components/inline-citation/index.js +1 -0
  132. package/dist/components/list/List.js +1 -1
  133. package/dist/components/menu/Menu.d.ts +7 -4
  134. package/dist/components/menu/Menu.js +1 -1
  135. package/dist/components/menubar/Menubar.js +1 -1
  136. package/dist/components/meter/Meter.d.ts +6 -0
  137. package/dist/components/meter/Meter.js +1 -1
  138. package/dist/components/mockup/Mockup.js +1 -1
  139. package/dist/components/navigation-menu/NavigationMenu.d.ts +10 -1
  140. package/dist/components/navigation-menu/NavigationMenu.js +1 -1
  141. package/dist/components/number-field/NumberField.d.ts +20 -6
  142. package/dist/components/number-field/NumberField.js +1 -1
  143. package/dist/components/otp-field/OtpField.d.ts +7 -0
  144. package/dist/components/otp-field/OtpField.js +1 -1
  145. package/dist/components/overlay/Overlay.d.ts +1 -1
  146. package/dist/components/overlay/Overlay.js +1 -1
  147. package/dist/components/page-layout/PageLayout.d.ts +11 -0
  148. package/dist/components/page-layout/PageLayout.js +1 -1
  149. package/dist/components/pagination/Pagination.js +1 -1
  150. package/dist/components/panes/Panes.d.ts +11 -0
  151. package/dist/components/panes/Panes.js +1 -1
  152. package/dist/components/pie-chart/PieChart.d.ts +5 -3
  153. package/dist/components/pie-chart/PieChart.js +1 -1
  154. package/dist/components/pill/Pill.d.ts +8 -0
  155. package/dist/components/pill/Pill.js +1 -1
  156. package/dist/components/popconfirm/Popconfirm.d.ts +10 -3
  157. package/dist/components/popconfirm/Popconfirm.js +1 -1
  158. package/dist/components/popover/Popover.d.ts +8 -1
  159. package/dist/components/popover/Popover.js +1 -1
  160. package/dist/components/portal/Portal.js +1 -1
  161. package/dist/components/progress-box/ProgressBox.js +1 -1
  162. package/dist/components/progress-circular/ProgressCircular.js +1 -1
  163. package/dist/components/progress-linear/ProgressLinear.js +1 -1
  164. package/dist/components/prompt-input/PromptInput.d.ts +104 -0
  165. package/dist/components/prompt-input/PromptInput.js +1 -0
  166. package/dist/components/prompt-input/index.d.ts +2 -0
  167. package/dist/components/prompt-input/index.js +1 -0
  168. package/dist/components/provider/NebaProvider.d.ts +3 -3
  169. package/dist/components/provider/NebaProvider.js +1 -1
  170. package/dist/components/radio-group/RadioGroup.js +1 -1
  171. package/dist/components/rating/Rating.d.ts +4 -1
  172. package/dist/components/rating/Rating.js +1 -1
  173. package/dist/components/reasoning/Reasoning.d.ts +78 -0
  174. package/dist/components/reasoning/Reasoning.js +1 -0
  175. package/dist/components/reasoning/index.d.ts +2 -0
  176. package/dist/components/reasoning/index.js +1 -0
  177. package/dist/components/scatter-chart/ScatterChart.js +1 -1
  178. package/dist/components/scroll-area/ScrollArea.js +1 -1
  179. package/dist/components/scroll-zone/ScrollZone.d.ts +10 -0
  180. package/dist/components/scroll-zone/ScrollZone.js +1 -1
  181. package/dist/components/segmented-button/SegmentedButton.js +1 -1
  182. package/dist/components/select/Select.js +1 -1
  183. package/dist/components/shortcut/Shortcut.js +1 -1
  184. package/dist/components/show/Show.d.ts +6 -5
  185. package/dist/components/show/Show.js +1 -1
  186. package/dist/components/sidebar/Sidebar.d.ts +7 -5
  187. package/dist/components/sidebar/Sidebar.js +1 -1
  188. package/dist/components/sidebar/SidebarTrigger.js +1 -1
  189. package/dist/components/skeleton/Skeleton.d.ts +1 -1
  190. package/dist/components/skeleton/Skeleton.js +1 -1
  191. package/dist/components/slider/Slider.d.ts +13 -1
  192. package/dist/components/slider/Slider.js +1 -1
  193. package/dist/components/sources/Sources.d.ts +78 -0
  194. package/dist/components/sources/Sources.js +1 -0
  195. package/dist/components/sources/index.d.ts +2 -0
  196. package/dist/components/sources/index.js +1 -0
  197. package/dist/components/sparkline/Sparkline.js +1 -1
  198. package/dist/components/spoiler/Spoiler.js +1 -1
  199. package/dist/components/stack/Stack.d.ts +2 -2
  200. package/dist/components/stack/Stack.js +1 -1
  201. package/dist/components/statistic/Statistic.js +1 -1
  202. package/dist/components/streaming-text/StreamingText.d.ts +75 -0
  203. package/dist/components/streaming-text/StreamingText.js +1 -0
  204. package/dist/components/streaming-text/index.d.ts +2 -0
  205. package/dist/components/streaming-text/index.js +1 -0
  206. package/dist/components/switch/Switch.js +1 -1
  207. package/dist/components/table/Table.d.ts +8 -2
  208. package/dist/components/table/Table.js +1 -1
  209. package/dist/components/tabs/Tabs.js +1 -1
  210. package/dist/components/text-field/TextField.js +1 -1
  211. package/dist/components/text-link/TextLink.js +1 -1
  212. package/dist/components/time-picker/TimePicker.js +1 -1
  213. package/dist/components/timeline/Timeline.d.ts +8 -0
  214. package/dist/components/timeline/Timeline.js +1 -1
  215. package/dist/components/timeline-chart/TimelineChart.js +1 -1
  216. package/dist/components/toast/Toast.d.ts +9 -3
  217. package/dist/components/toast/Toast.js +1 -1
  218. package/dist/components/toggle/Toggle.js +1 -1
  219. package/dist/components/toggle-group/ToggleGroup.js +1 -1
  220. package/dist/components/tool-call/ToolCall.d.ts +104 -0
  221. package/dist/components/tool-call/ToolCall.js +1 -0
  222. package/dist/components/tool-call/index.d.ts +2 -0
  223. package/dist/components/tool-call/index.js +1 -0
  224. package/dist/components/toolbar/Toolbar.d.ts +8 -0
  225. package/dist/components/toolbar/Toolbar.js +1 -1
  226. package/dist/components/tooltip/Tooltip.js +1 -1
  227. package/dist/components/tour/Tour.d.ts +2 -0
  228. package/dist/components/tour/Tour.js +1 -1
  229. package/dist/components/transfer/Transfer.js +1 -1
  230. package/dist/components/tree-select/TreeSelect.js +1 -1
  231. package/dist/components/tree-view/TreeView.d.ts +6 -0
  232. package/dist/components/tree-view/TreeView.js +1 -1
  233. package/dist/components/typography/Typography.js +1 -1
  234. package/dist/components/visually-hidden/VisuallyHidden.d.ts +9 -7
  235. package/dist/components/visually-hidden/VisuallyHidden.js +1 -1
  236. package/dist/components/window-pane/WindowPane.d.ts +2 -2
  237. package/dist/components/window-pane/WindowPane.js +1 -1
  238. package/dist/hooks/useElementSize.d.ts +3 -1
  239. package/dist/hooks/useElementSize.js +1 -1
  240. package/dist/hooks/useOnScreen.d.ts +3 -0
  241. package/dist/hooks/useOnScreen.js +1 -1
  242. package/dist/index.d.ts +9 -0
  243. package/dist/index.js +1 -1
  244. package/dist/internal/animate.d.ts +63 -16
  245. package/dist/internal/animate.js +1 -1
  246. package/dist/internal/calendar.d.ts +6 -1
  247. package/dist/internal/calendar.js +1 -1
  248. package/dist/internal/chart-frame.d.ts +64 -22
  249. package/dist/internal/chart-frame.js +1 -1
  250. package/dist/internal/chart-line.js +1 -1
  251. package/dist/internal/chart.d.ts +55 -4
  252. package/dist/internal/chart.js +1 -1
  253. package/dist/internal/children.d.ts +15 -0
  254. package/dist/internal/children.js +1 -0
  255. package/dist/internal/color.d.ts +4 -0
  256. package/dist/internal/color.js +1 -1
  257. package/dist/internal/csv.d.ts +12 -1
  258. package/dist/internal/csv.js +1 -1
  259. package/dist/internal/data-table.d.ts +28 -10
  260. package/dist/internal/data-table.js +1 -1
  261. package/dist/internal/date.d.ts +12 -5
  262. package/dist/internal/date.js +1 -1
  263. package/dist/internal/defaults.d.ts +6 -1
  264. package/dist/internal/defaults.js +1 -1
  265. package/dist/internal/drag.d.ts +13 -1
  266. package/dist/internal/drag.js +1 -1
  267. package/dist/internal/drop.d.ts +61 -0
  268. package/dist/internal/drop.js +1 -0
  269. package/dist/internal/fieldset.d.ts +13 -0
  270. package/dist/internal/fieldset.js +1 -0
  271. package/dist/internal/glow.d.ts +58 -0
  272. package/dist/internal/glow.js +1 -0
  273. package/dist/internal/highlight.js +1 -1
  274. package/dist/internal/i18n.d.ts +230 -11
  275. package/dist/internal/i18n.js +1 -1
  276. package/dist/internal/icons.d.ts +13 -2
  277. package/dist/internal/icons.js +1 -1
  278. package/dist/internal/inert.d.ts +13 -0
  279. package/dist/internal/inert.js +1 -0
  280. package/dist/internal/initials.d.ts +8 -3
  281. package/dist/internal/initials.js +1 -1
  282. package/dist/internal/keys.d.ts +13 -0
  283. package/dist/internal/keys.js +1 -1
  284. package/dist/internal/link.d.ts +13 -15
  285. package/dist/internal/link.js +1 -1
  286. package/dist/internal/media.d.ts +9 -17
  287. package/dist/internal/media.js +1 -1
  288. package/dist/internal/menu.d.ts +6 -1
  289. package/dist/internal/mockup.d.ts +5 -4
  290. package/dist/internal/mockup.js +1 -1
  291. package/dist/internal/observe.d.ts +12 -0
  292. package/dist/internal/observe.js +1 -1
  293. package/dist/internal/page-layout.d.ts +10 -8
  294. package/dist/internal/page-layout.js +1 -1
  295. package/dist/internal/picker.d.ts +1 -1
  296. package/dist/internal/picker.js +1 -1
  297. package/dist/internal/progress.d.ts +11 -5
  298. package/dist/internal/progress.js +1 -1
  299. package/dist/internal/responsive.d.ts +0 -8
  300. package/dist/internal/responsive.js +1 -1
  301. package/dist/internal/run.d.ts +71 -0
  302. package/dist/internal/run.js +1 -0
  303. package/dist/internal/screen.d.ts +12 -0
  304. package/dist/internal/screen.js +1 -0
  305. package/dist/internal/styles.d.ts +185 -14
  306. package/dist/internal/styles.js +1 -1
  307. package/dist/internal/text.d.ts +3 -3
  308. package/dist/internal/text.js +1 -1
  309. package/dist/internal/window.js +1 -1
  310. package/dist/locales/ar.js +1 -1
  311. package/dist/locales/de.js +1 -1
  312. package/dist/locales/es.js +1 -1
  313. package/dist/locales/fr.js +1 -1
  314. package/dist/locales/hi.js +1 -1
  315. package/dist/locales/id.js +1 -1
  316. package/dist/locales/it.js +1 -1
  317. package/dist/locales/ja.js +1 -1
  318. package/dist/locales/ko.js +1 -1
  319. package/dist/locales/nl.js +1 -1
  320. package/dist/locales/pl.js +1 -1
  321. package/dist/locales/pt.js +1 -1
  322. package/dist/locales/ru.js +1 -1
  323. package/dist/locales/th.js +1 -1
  324. package/dist/locales/tr.js +1 -1
  325. package/dist/locales/vi.js +1 -1
  326. package/dist/locales/zh-hans.js +1 -1
  327. package/dist/locales/zh-hant.js +1 -1
  328. package/dist/styles.css +1 -1
  329. package/dist/tailwind.css +501 -53
  330. package/dist/types.d.ts +34 -7
  331. package/dist/types.js +0 -8
  332. package/package.json +43 -9
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{TreeItem as n,TreeView as r}from"../tree-view/TreeView.js";import{PickerShell as t}from"../../internal/picker.js";import{searchHaystack as o,searchText as i}from"../../internal/search.js";import{actionMessages as s,commandMessages as c,comboboxMessages as d,useMessages as u}from"../../internal/i18n.js";import{useStyleDefaults as h}from"../../internal/defaults.js";function p(e,l=new Map){for(const a of e)l.set(a.value,a),a.children&&p(a.children,l);return l}function m(e,l=new Map){for(const a of e)l.set(a,o([a.searchLabel??("string"==typeof a.label?a.label:String(a.value))])),a.children&&m(a.children,l);return l}function f(e,l,a){if(""===l)return e;const n=[];for(const r of e){const e=r.children?f(r.children,l,a):void 0,t=(a.get(r)??"").includes(l);(t||e&&e.length>0)&&n.push({...r,children:t?r.children:e})}return n}function g(e,l=[]){for(const a of e)a.children&&a.children.length>0&&(l.push(a.value),g(a.children,l));return l}export const TreeSelect=/*@__PURE__*/a.forwardRef(function(o,v){const{items:b=[],value:x,defaultValue:y,onValueChange:w,multiple:C=!1,selectableBranches:S=!1,defaultExpanded:j,expanded:N,onExpandedChange:M,open:O,defaultOpen:z,onOpenChange:V,placeholder:E,clearable:L=!1,clearLabel:T,closeOnSelect:k,searchable:A=!1,searchPlaceholder:I,locale:R,format:B,name:P,size:$="md",color:q="primary",readOnly:D=!1,disabled:F=!1,classNames:G,...H}=h(o,["size","locale"]),J=u(d,R),K=u(c,R),Q=u(s,R),U=e=>null==e?[]:Array.isArray(e)?e:[e],[W,X]=a.useState(()=>U(y)),Y=void 0!==x?U(x):W,[Z,_]=a.useState(z??!1),ee=O??Z,[le,ae]=a.useState(""),ne=a.useMemo(()=>p(b),[b]),re=a.useMemo(()=>m(b),[b]),te=i(le),oe=a.useMemo(()=>f(b,te,re),[b,te,re]),ie=a.useMemo(()=>""===te?void 0:g(oe),[te,oe]),[se,ce]=a.useState(()=>j??[]),de=ie??N??se,ue=e=>{e&&(D||F)||(void 0===O&&_(e),e||ae(""),V?.(e))},he=e=>{void 0===x&&X(e),w?.(e)},pe=e=>e.selectable??(!(e.children&&e.children.length>0)||S),me=Y.map(e=>ne.get(e)).filter(e=>void 0!==e),fe=0===me.length?E??"":B?B(me):me.map(e=>e.label).reduce((e,l,a)=>0===a?[l]:[...e,", ",l],[]),ge=l=>l.map(l=>e(n,{value:l.value,label:l.label,startIcon:l.startIcon,disabled:l.disabled||!pe(l),className:G?.item,children:l.children?ge(l.children):null},l.value));return e(t,{...H,size:$,color:q,readOnly:D,disabled:F,triggerRef:v,display:fe,empty:0===me.length,clearable:L,onClear:()=>he([]),open:ee,onOpenChange:ue,clearLabel:T??Q.clear,popupClassName:G?.popup,hiddenValues:P?Y.map(e=>({name:P,value:String(e)})):void 0,children:l("div",{className:"flex max-h-80 w-64 flex-col gap-2 overflow-hidden",children:[A?e("input",{type:"text",value:le,placeholder:I??K.search,"aria-label":I??K.search,onChange:e=>ae(e.currentTarget.value),className:"w-full shrink-0 bg-transparent px-1 py-1 [font:inherit] text-(--neba-fg) [outline:none] placeholder:text-(--neba-muted-fg)"}):null,e("div",{className:"min-h-0 flex-1 overflow-auto",children:0===oe.length?e("p",{className:`px-1 py-2 text-(--neba-muted-fg) ${G?.empty??""}`,children:J.empty}):e(r,{size:$,color:q,multiple:C,selected:Y,onSelectedChange:e=>{const l=e.filter(e=>{const l=ne.get(e);return void 0!==l&&pe(l)&&!l.disabled});he(C?l:l.slice(-1)),(k??!C)&&ue(!1)},expanded:de,onExpandedChange:ie?()=>{}:e=>{void 0===N&&ce(e),M?.(e)},className:G?.tree,children:ge(oe)})})]})})});
1
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{TreeItem as n,TreeView as r}from"../tree-view/TreeView.js";import{PickerShell as t}from"../../internal/picker.js";import{searchHaystack as o,searchText as i}from"../../internal/search.js";import{actionMessages as s,commandMessages as c,comboboxMessages as d,useMessages as u}from"../../internal/i18n.js";import{useStyleDefaults as p}from"../../internal/defaults.js";function h(e,l=new Map){for(const a of e)l.set(a.value,a),a.children&&h(a.children,l);return l}function m(e,l=new Map){for(const a of e)l.set(a,o([a.searchLabel??("string"==typeof a.label?a.label:String(a.value))])),a.children&&m(a.children,l);return l}function f(e,l,a){if(""===l)return e;const n=[];for(const r of e){const e=r.children?f(r.children,l,a):void 0,t=(a.get(r)??"").includes(l);(t||e&&e.length>0)&&n.push({...r,children:t?r.children:e})}return n}function g(e,l=[]){for(const a of e)a.children&&a.children.length>0&&(l.push(a.value),g(a.children,l));return l}export const TreeSelect=/*@__PURE__*/a.forwardRef(function TreeSelect(o,b){const{items:v=[],value:x,defaultValue:y,onValueChange:S,multiple:w=!1,selectableBranches:C=!1,defaultExpanded:j,expanded:N,onExpandedChange:M,open:O,defaultOpen:z,onOpenChange:T,placeholder:V,clearable:E=!1,clearLabel:L,closeOnSelect:k,searchable:A=!1,searchPlaceholder:I,locale:R,format:B,name:P,size:$="md",color:q="primary",readOnly:D=!1,disabled:F=!1,classNames:G,...H}=p(o,["size","locale"]),J=u(d,R),K=u(c,R),Q=u(s,R),U=e=>null==e?[]:Array.isArray(e)?e:[e],[W,X]=a.useState(()=>U(y)),Y=void 0!==x?U(x):W,[Z,_]=a.useState(z??!1),ee=O??Z,[le,ae]=a.useState(""),ne=a.useMemo(()=>h(v),[v]),re=a.useMemo(()=>m(v),[v]),te=i(le),oe=a.useMemo(()=>f(v,te,re),[v,te,re]),ie=a.useMemo(()=>""===te?void 0:g(oe),[te,oe]),[se,ce]=a.useState(()=>j??[]),de=ie??N??se,ue=e=>{e&&(D||F)||(void 0===O&&_(e),e||ae(""),T?.(e))},pe=e=>{void 0===x&&X(e),S?.(e)},he=e=>e.selectable??(!(e.children&&e.children.length>0)||C),me=Y.map(e=>ne.get(e)).filter(e=>void 0!==e),fe=0===me.length?V??"":B?B(me):me.map(e=>e.label).reduce((e,l,a)=>0===a?[l]:[...e,", ",l],[]),ge=l=>l.map(l=>e(n,{value:l.value,label:l.label,startIcon:l.startIcon,disabled:l.disabled,selectable:he(l),className:G?.item,children:l.children?ge(l.children):null},l.value));return e(t,{...H,size:$,color:q,readOnly:D,disabled:F,triggerRef:b,display:fe,empty:0===me.length,clearable:E,onClear:()=>pe([]),open:ee,onOpenChange:ue,clearLabel:L??Q.clear,popupClassName:G?.popup,hiddenValues:P?Y.map(e=>({name:P,value:String(e)})):void 0,children:l("div",{className:"flex max-h-80 w-64 flex-col gap-2 overflow-hidden",children:[A?e("input",{type:"text",value:le,placeholder:I??K.search,"aria-label":I??K.search,onChange:e=>ae(e.currentTarget.value),className:"neba-input w-full shrink-0 bg-transparent px-1 py-1 [font:inherit] text-(--neba-fg) [outline:none] placeholder:text-(--neba-muted-fg)"}):null,e("div",{className:"min-h-0 flex-1 overflow-auto",children:0===oe.length?e("p",{className:`px-1 py-2 text-(--neba-muted-fg) ${G?.empty??""}`,children:J.empty}):e(r,{size:$,color:q,multiple:w,selected:Y,onSelectedChange:e=>{const l=e.filter(e=>{const l=ne.get(e);return void 0!==l&&he(l)&&!l.disabled});pe(w?l:l.slice(-1)),(k??!w)&&ue(!1)},expanded:de,onExpandedChange:ie?()=>{}:e=>{void 0===N&&ce(e),M?.(e)},className:G?.tree,children:ge(oe)})})]})})});
@@ -85,6 +85,12 @@ export interface TreeItemProps extends Omit<React.ComponentPropsWithoutRef<'li'>
85
85
  expandable?: boolean;
86
86
  /** Unavailable. Its branch, if it is open, keeps working. */
87
87
  disabled?: boolean;
88
+ /**
89
+ * Whether pressing the row chooses it. A row that cannot be chosen still
90
+ * opens and shuts — the folder in a tree whose answers are the files.
91
+ * @default true
92
+ */
93
+ selectable?: boolean;
88
94
  /** The rows underneath this one. */
89
95
  children?: React.ReactNode;
90
96
  }
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import*as n from"react";import{ChevronIcon as a}from"../../internal/icons.js";import{controlTextClasses as l,cx as s,gapClasses as o,hasContent as i,iconClasses as c,radiusClasses as d,surfaceClasses as u,surfaceSlots as m,transitionClasses as f}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const g=/*@__PURE__*/n.createContext({size:"md",density:"default",disabled:!1,expandedKeys:new Set,selectedKeys:new Set,activeKey:null,toggle:()=>{},select:()=>{},activate:()=>{},register:()=>()=>{}}),x=/*@__PURE__*/n.createContext(!1),b={solid:[u,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[u,"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"},v={xs:"0.875rem",sm:"1rem",md:"1.25rem",lg:"1.5rem",xl:"1.75rem"},h={xs:"1.375rem",sm:"1.625rem",md:"2rem",lg:"2.5rem",xl:"3rem"},w={default:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-3.5"},compact:{xs:"px-1",sm:"px-1",md:"px-1.5",lg:"px-2",xl:"px-2.5"}},y={xs:"rounded-[0.3125rem]",sm:"rounded-[0.375rem]",md:"rounded-[0.5rem]",lg:"rounded-[0.625rem]",xl:"rounded-[0.75rem]"},k={none:"",simple:"neba-tree-simple",folder:"neba-tree-folder"};function C(e){return Array.from(e.querySelectorAll('[role="treeitem"]')).filter(e=>null===e.closest("[data-closing]"))}const N=e=>String(e);export const TreeView=/*@__PURE__*/n.forwardRef(function(t,r){const{variant:a="outline",size:l="md",color:o="primary",density:i="default",elevation:c=0,lines:u="simple",expanded:x,defaultExpanded:w,onExpandedChange:y,selected:S,defaultSelected:A,onSelectedChange:j,multiple:K=!1,disabled:D=!1,label:E,className:R,style:P,children:I,onKeyDown:_,...z}=p(t,["size","density","variant"]),[F,M]=n.useState(w??[]),[T,V]=n.useState(A??[]),[q,L]=n.useState(null),H=x??F,O=S??T,U=n.useRef(null),B=n.useCallback(e=>{U.current=e,"function"==typeof r?r(e):r&&(r.current=e)},[r]),G=n.useCallback(e=>{const t=N(e),r=x??F,n=r.some(e=>N(e)===t)?r.filter(e=>N(e)!==t):[...r,e];void 0===x&&M(n),y?.(n)},[x,F,y]),J=n.useCallback(e=>{const t=N(e),r=S??T,n=r.some(e=>N(e)===t),a=K?n?r.filter(e=>N(e)!==t):[...r,e]:[e];void 0===S&&V(a),j?.(a)},[K,S,T,j]),Q=n.useRef(new Map),W=n.useCallback((e,t)=>(Q.current.set(e,t),()=>{Q.current.delete(e)}),[]),X=n.useMemo(()=>H.map(N).join("\0"),[H]),Y=n.useMemo(()=>O.map(N).join("\0"),[O]),Z=n.useMemo(()=>({size:l,density:i,disabled:D,expandedKeys:new Set(H.map(N)),selectedKeys:new Set(O.map(N)),activeKey:q,toggle:G,select:J,activate:L,register:W}),[l,i,D,X,Y,q,G,J,W]);n.useEffect(()=>{if(null!==q&&Q.current.has(q))return;const e=U.current;if(!e)return;const t=C(e);0!==t.length&&L(t[0].dataset.nebaValue??null)});const $=s("flex list-none flex-col p-1",d[l],b[a],f,k[u],R);return e(g.Provider,{value:Z,children:e("ul",{ref:B,role:"tree","aria-label":E,"aria-multiselectable":K||void 0,className:$,style:{...m(o,c),"--n-tree-indent":v[l],"--n-tree-row":h[l],...P},onKeyDown:function(e){if(_?.(e),e.defaultPrevented)return;const t=U.current,r=e.target?.closest?.('[role="treeitem"]');if(!t||!r||!t.contains(r))return;const n=C(t),a=n.indexOf(r);if(-1===a)return;const l=t=>{t&&(e.preventDefault(),L(t.dataset.nebaValue??null),t.focus())},s=e=>{const t=e.dataset.nebaValue;t&&Q.current.get(t)?.toggle()},o="rtl"===getComputedStyle(t).direction,i=o?"ArrowLeft":"ArrowRight",c=o?"ArrowRight":"ArrowLeft",d=r.getAttribute("aria-expanded");switch(e.key){case"ArrowDown":l(n[a+1]);break;case"ArrowUp":l(n[a-1]);break;case"Home":l(n[0]);break;case"End":l(n[n.length-1]);break;case i:"false"===d?(e.preventDefault(),s(r)):"true"===d&&l(n[a+1]);break;case c:"true"===d?(e.preventDefault(),s(r)):l(r.parentElement?.closest('[role="treeitem"]'));break;case"Enter":case" ":e.preventDefault(),r.click()}},...z,children:I})})});export const TreeItem=/*@__PURE__*/n.forwardRef(function({value:d,label:u,startIcon:m,endIcon:p,action:b,href:v,expandable:h,disabled:k=!1,className:C,children:S,onClick:A,...j},K){const{size:D,density:E,disabled:R,expandedKeys:P,selectedKeys:I,activeKey:_,toggle:z,select:F,activate:M,register:T}=n.useContext(g),V=n.useId(),q=d??V,L=N(q),H=n.useRef(null),O=n.useCallback(e=>{H.current=e,"function"==typeof K?K(e):K&&(K.current=e)},[K]),U=n.Children.toArray(S),B=h??U.length>0,G=B&&P.has(L),J=I.has(L),Q=k||R,W=n.useRef({toggle:()=>{}});W.current.toggle=()=>{!Q&&B&&z(q)};const X=n.useContext(x);n.useEffect(()=>X?void 0:T(L,W.current),[X,L,T]);const[Y,Z]=n.useState(G),[$,ee]=n.useState(G),te=n.useRef(null);n.useEffect(()=>{if(G){Z(!0);const e=requestAnimationFrame(()=>ee(!0));return()=>cancelAnimationFrame(e)}ee(!1);const e=te.current;(null===e||getComputedStyle(e).transitionDuration.split(",").every(e=>0===parseFloat(e)))&&Z(!1)},[G]);const re=s("flex min-w-0 flex-1 cursor-pointer items-center text-start","h-(--n-tree-row)",w[E][D],y[D],o[D],l[D],f,c,"group-focus-visible/tree-item:[outline:2px_solid_var(--n-ring)]","group-focus-visible/tree-item:outline-offset-[-2px]",Q?"cursor-not-allowed text-(--neba-disabled-fg)":J?"bg-(--n-soft-press) font-medium text-(--n-accent) hover:bg-(--n-soft-press)":"hover:bg-(--n-soft)"),ne=r(t,{children:[e("span",{"aria-hidden":"true",onClick:e=>{!Q&&B&&(e.stopPropagation(),e.preventDefault(),H.current?.focus(),M(L),z(q))},className:s("flex h-[1lh] w-[1.15em] shrink-0 items-center justify-center","[transition:rotate_var(--neba-duration)_var(--neba-ease)]",B?"text-(--neba-muted-fg)":"",G?"rotate-0":"-rotate-90 rtl:rotate-90"),children:B?e(a,{}):null}),i(m)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:m}):null,e("span",{className:"min-w-0 flex-1 truncate",children:u}),i(p)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:p}):null]});return r("li",{ref:O,role:"treeitem","aria-expanded":B?G:void 0,"aria-selected":!!J||void 0,"aria-disabled":Q||void 0,"data-neba-value":L,tabIndex:_===L?0:-1,className:s("group/tree-item relative block [outline:none]",C),onClick:function(e){e.stopPropagation(),Q?e.preventDefault():(H.current?.focus(),M(L),A?.(e),e.defaultPrevented||(B&&z(q),F(q)))},...j,children:[r("div",{className:"flex w-full items-center",children:[v&&!Q?e("a",{href:v,tabIndex:-1,className:re,"aria-current":J?"page":void 0,children:ne}):e("div",{className:re,children:ne}),i(b)?e("span",{className:s("flex shrink-0 items-center",w[E][D]),onClick:e=>e.stopPropagation(),children:b}):null]}),B&&Y&&U.length>0?e("div",{ref:te,"data-closing":G?void 0:"",className:s("grid [transition:grid-template-rows_var(--neba-duration)_var(--neba-ease)]",$?"[grid-template-rows:1fr]":"[grid-template-rows:0fr] pointer-events-none"),onTransitionEnd:e=>{e.target!==e.currentTarget||"grid-template-rows"!==e.propertyName||G||Z(!1)},children:e("ul",{role:"group",className:"min-h-0 list-none overflow-hidden ps-(--n-tree-indent)",children:e(x.Provider,{value:X||!G,children:S})})}):null]})});
1
+ "use client";import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as r from"react";import{safeHref as a}from"../../internal/link.js";import{ChevronIcon as l}from"../../internal/icons.js";import{controlTextClasses as s,cx as o,gapClasses as i,hasContent as d,iconClasses as c,radiusClasses as u,surfaceClasses as m,surfaceSlots as f,transitionClasses as p}from"../../internal/styles.js";import{useStyleDefaults as g}from"../../internal/defaults.js";const x=/*@__PURE__*/r.createContext({size:"md",density:"default",disabled:!1,multiple:!1,expandedKeys:new Set,selectedKeys:new Set,activeKey:null,toggle:()=>{},select:()=>{},activate:()=>{},register:()=>()=>{}}),b=/*@__PURE__*/r.createContext(!1),v={solid:[m,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[m,"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"},h={xs:"0.875rem",sm:"1rem",md:"1.25rem",lg:"1.5rem",xl:"1.75rem"},w={xs:"1.375rem",sm:"1.625rem",md:"2rem",lg:"2.5rem",xl:"3rem"},y={default:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-3.5"},compact:{xs:"px-1",sm:"px-1",md:"px-1.5",lg:"px-2",xl:"px-2.5"}},k={xs:"rounded-[0.3125rem]",sm:"rounded-[0.375rem]",md:"rounded-[0.5rem]",lg:"rounded-[0.625rem]",xl:"rounded-[0.75rem]"},C={none:"",simple:"neba-tree-simple",folder:"neba-tree-folder"};function S(e){return Array.from(e.querySelectorAll('[role="treeitem"]')).filter(e=>null===e.closest("[data-closing]"))}const E=e=>String(e);export const TreeView=/*@__PURE__*/r.forwardRef(function TreeView(t,n){const{variant:a="outline",size:l="md",color:s="primary",density:i="default",elevation:d=0,lines:c="simple",expanded:m,defaultExpanded:b,onExpandedChange:y,selected:k,defaultSelected:N,onSelectedChange:A,multiple:j=!1,disabled:K=!1,label:V,className:D,style:R,children:I,onKeyDown:P,...T}=g(t,["size","density","variant"]),[_,z]=r.useState(b??[]),[F,M]=r.useState(N??[]),[q,L]=r.useState(null),H=m??_,O=k??F,U=r.useRef(null),B=r.useCallback(e=>{U.current=e,"function"==typeof n?n(e):n&&(n.current=e)},[n]),G=r.useRef({expandedValues:H,selectedValues:O,controlledExpanded:void 0!==m,controlledSelected:void 0!==k,multiple:j,onExpandedChange:y,onSelectedChange:A});G.current={expandedValues:H,selectedValues:O,controlledExpanded:void 0!==m,controlledSelected:void 0!==k,multiple:j,onExpandedChange:y,onSelectedChange:A};const J=r.useCallback(e=>{const{expandedValues:t,controlledExpanded:n,onExpandedChange:r}=G.current,a=E(e),l=t.some(e=>E(e)===a)?t.filter(e=>E(e)!==a):[...t,e];n||z(l),r?.(l)},[]),Q=r.useCallback(e=>{const{selectedValues:t,controlledSelected:n,multiple:r,onSelectedChange:a}=G.current,l=E(e),s=t.some(e=>E(e)===l),o=r?s?t.filter(e=>E(e)!==l):[...t,e]:[e];n||M(o),a?.(o)},[]),W=r.useRef(new Map),X=r.useCallback((e,t)=>(W.current.set(e,t),()=>{W.current.delete(e)}),[]),Y=r.useMemo(()=>H.map(E).join("\0"),[H]),Z=r.useMemo(()=>O.map(E).join("\0"),[O]),$=r.useMemo(()=>({size:l,density:i,disabled:K,multiple:j,expandedKeys:new Set(H.map(E)),selectedKeys:new Set(O.map(E)),activeKey:q,toggle:J,select:Q,activate:L,register:X}),[l,i,K,j,Y,Z,q,J,Q,X]);r.useEffect(()=>{if(null!==q&&W.current.has(q))return;const e=U.current;if(!e)return;const t=S(e);if(0===t.length)return;const n=t.find(e=>"true"===e.getAttribute("aria-selected"))??t[0];L(n.dataset.nebaValue??null)});const ee=o("flex list-none flex-col p-1",u[l],v[a],p,C[c],D);return e(x.Provider,{value:$,children:e("ul",{ref:B,role:"tree","aria-label":V,"aria-multiselectable":j||void 0,className:ee,style:{...f(s,d),"--n-tree-indent":h[l],"--n-tree-row":w[l],...R},onKeyDown:function(e){if(P?.(e),e.defaultPrevented)return;const t=U.current,n=e.target?.closest?.('[role="treeitem"]');if(!t||!n||!t.contains(n))return;if(e.target!==n)return;const r=S(t),a=r.indexOf(n);if(-1===a)return;const l=t=>{t&&(e.preventDefault(),L(t.dataset.nebaValue??null),t.focus())},s=e=>{const t=e.dataset.nebaValue;t&&W.current.get(t)?.toggle()},o="rtl"===getComputedStyle(t).direction,i=o?"ArrowLeft":"ArrowRight",d=o?"ArrowRight":"ArrowLeft",c=n.getAttribute("aria-expanded");switch(e.key){case"ArrowDown":l(r[a+1]);break;case"ArrowUp":l(r[a-1]);break;case"Home":l(r[0]);break;case"End":l(r[r.length-1]);break;case i:"false"===c?(e.preventDefault(),s(n)):"true"===c&&l(r[a+1]);break;case d:"true"===c?(e.preventDefault(),s(n)):l(n.parentElement?.closest('[role="treeitem"]'));break;case"Enter":case" ":e.preventDefault();(("Enter"===e.key?n.querySelector(":scope > div > a[href]"):null)??n).click();break}},...T,children:I})})});export const TreeItem=/*@__PURE__*/r.forwardRef(function TreeItem({value:u,label:m,startIcon:f,endIcon:g,action:v,href:h,expandable:w,disabled:C=!1,selectable:S=!0,className:N,children:A,onClick:j,...K},V){const{size:D,density:R,disabled:I,expandedKeys:P,selectedKeys:T,activeKey:_,toggle:z,select:F,activate:M,register:q,multiple:L}=r.useContext(x),H=r.useId(),O=u??H,U=E(O),B=r.useRef(null),G=r.useCallback(e=>{B.current=e,"function"==typeof V?V(e):V&&(V.current=e)},[V]),J=r.Children.toArray(A),Q=w??J.length>0,W=Q&&P.has(U),X=T.has(U),Y=C||I,Z=r.useRef({toggle:()=>{}});Z.current.toggle=()=>{!Y&&Q&&z(O)};const $=r.useContext(b);r.useEffect(()=>$?void 0:q(U,Z.current),[$,U,q]);const[ee,te]=r.useState(W),[ne,re]=r.useState(W),ae=r.useRef(null);r.useEffect(()=>{if(W){te(!0);const e=requestAnimationFrame(()=>re(!0));return()=>cancelAnimationFrame(e)}re(!1);const e=ae.current;(null===e||getComputedStyle(e).transitionDuration.split(",").every(e=>0===parseFloat(e)))&&te(!1)},[W]);const le=o("flex min-w-0 flex-1 cursor-pointer items-center text-start","h-(--n-tree-row)",y[R][D],k[D],i[D],s[D],p,c,"group-focus-visible/tree-item:[outline:2px_solid_var(--n-ring)]","group-focus-visible/tree-item:outline-offset-[-2px]",Y?"cursor-not-allowed text-(--neba-disabled-fg)":X?"bg-(--n-soft-press) font-medium text-(--n-on-tint) hover:bg-(--n-soft-press)":"hover:bg-(--n-soft)"),se=n(t,{children:[e("span",{"aria-hidden":"true",onClick:e=>{!Y&&Q&&(e.stopPropagation(),e.preventDefault(),B.current?.focus(),M(U),z(O))},className:o("flex h-[1lh] w-[1.15em] shrink-0 items-center justify-center","[transition:rotate_var(--neba-duration)_var(--neba-ease)]",Q?"text-(--neba-muted-fg)":"",W?"rotate-0":"-rotate-90 rtl:rotate-90"),children:Q?e(l,{}):null}),d(f)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:f}):null,e("span",{className:"min-w-0 flex-1 truncate",children:m}),d(g)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:g}):null]});return n("li",{ref:G,role:"treeitem","aria-expanded":Q?W:void 0,"aria-selected":!!X||(!L||!S)&&void 0,"aria-disabled":Y||void 0,"data-neba-value":U,tabIndex:_===U?0:-1,className:o("group/tree-item relative block [outline:none]",N),onClick:function(e){e.stopPropagation(),Y?e.preventDefault():(B.current?.focus(),M(U),j?.(e),e.defaultPrevented||(Q&&z(O),S&&F(O)))},...K,children:[n("div",{className:"flex w-full items-center",children:[void 0===a(h)||Y?e("div",{className:le,children:se}):e("a",{href:a(h),tabIndex:-1,className:le,"aria-current":X?"page":void 0,children:se}),d(v)?e("span",{className:o("flex shrink-0 items-center",y[R][D]),onClick:e=>e.stopPropagation(),children:v}):null]}),Q&&ee&&J.length>0?e("div",{ref:ae,"data-closing":W?void 0:"",className:o("grid [transition:grid-template-rows_var(--neba-duration)_var(--neba-ease)]",ne?"[grid-template-rows:1fr]":"[grid-template-rows:0fr] pointer-events-none"),onTransitionEnd:e=>{e.target!==e.currentTarget||"grid-template-rows"!==e.propertyName||W||te(!1)},children:e("ul",{role:"group",className:"min-h-0 list-none overflow-hidden ps-(--n-tree-indent)",children:e(b.Provider,{value:$||!W,children:A})})}):null]})});
@@ -1 +1 @@
1
- "use client";import*as e from"react";import{useRender as t}from"@base-ui/react/use-render";import{transitionProps as r}from"../../internal/animate.js";import{clampClasses as n,cx as m}from"../../internal/styles.js";const a={h1:"text-[1.875rem]/[1.2] tracking-[-0.02em]",h2:"text-[1.5rem]/[1.25] tracking-[-0.015em]",h3:"text-[1.25rem]/[1.3] tracking-[-0.01em]",h4:"text-[1.0625rem]/[1.41176]",h5:"text-[0.9375rem]/[1.46667]",h6:"text-[0.8125rem]/[1.53846]",lead:"text-[1.0625rem]/[1.64706]",body:"text-[0.8125rem]/[1.69231]",caption:"text-[0.75rem]/[1.5]",overline:"text-[0.6875rem]/[1.45455] tracking-[0.08em] uppercase"},o={h1:"semibold",h2:"semibold",h3:"semibold",h4:"semibold",h5:"semibold",h6:"semibold",lead:"regular",body:"regular",caption:"regular",overline:"medium"},i={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",caption:"span",overline:"span"},l=new Set(["caption","overline"]),s={h1:"mb-4",h2:"mb-3.5",h3:"mb-3",h4:"mb-2.5",h5:"mb-2",h6:"mb-2",lead:"mb-4",body:"mb-3",caption:"mb-2",overline:"mb-2"},h={regular:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},c={start:"text-start",center:"text-center",end:"text-end",justify:"text-justify"};export const Typography=/*@__PURE__*/e.forwardRef(function({level:d="body",color:b,weight:p,align:x,lines:u,gutter:f=!1,transition:y,render:g,className:v,style:j,children:k,...w},N){const E=r(y),R=m("neba-typography",a[d],h[p??o[d]],x?c[x]:"",u?n(u):"",f?s[d]:"",b?"text-(--n-accent)":l.has(d)?"text-(--neba-muted-fg)":"text-(--neba-fg)",E.className,v??"");return t({render:g??e.createElement(i[d]),ref:N,props:{className:R,style:b?{"--n-accent":`var(--neba-${b}-accent)`,...E.style,...j}:{...E.style,...j},children:k,...w}})});
1
+ "use client";import*as e from"react";import{useRender as a}from"@base-ui/react/use-render";import{transitionProps as t}from"../../internal/animate.js";import{clampClasses as r,clampSlot as n,cx as p}from"../../internal/styles.js";const o={h1:"[&.neba-typography]:text-[1.875rem]/[1.2] [&.neba-typography]:tracking-[-0.02em]",h2:"[&.neba-typography]:text-[1.5rem]/[1.25] [&.neba-typography]:tracking-[-0.015em]",h3:"[&.neba-typography]:text-[1.25rem]/[1.3] [&.neba-typography]:tracking-[-0.01em]",h4:"[&.neba-typography]:text-[1.0625rem]/[1.41176] [&.neba-typography]:tracking-normal",h5:"[&.neba-typography]:text-[0.9375rem]/[1.46667] [&.neba-typography]:tracking-normal",h6:"[&.neba-typography]:text-[0.8125rem]/[1.53846] [&.neba-typography]:tracking-normal",lead:"[&.neba-typography]:text-[1.0625rem]/[1.64706] [&.neba-typography]:tracking-normal",body:"[&.neba-typography]:text-[0.8125rem]/[1.69231] [&.neba-typography]:tracking-normal",caption:"[&.neba-typography]:text-[0.75rem]/[1.5] [&.neba-typography]:tracking-normal",overline:"[&.neba-typography]:text-[0.6875rem]/[1.45455] [&.neba-typography]:tracking-[0.08em] uppercase"},y={h1:"semibold",h2:"semibold",h3:"semibold",h4:"semibold",h5:"semibold",h6:"semibold",lead:"regular",body:"regular",caption:"regular",overline:"medium"},h={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",caption:"span",overline:"span"},b=new Set(["caption","overline"]),m={h1:"[&.neba-typography]:mb-4",h2:"[&.neba-typography]:mb-3.5",h3:"[&.neba-typography]:mb-3",h4:"[&.neba-typography]:mb-2.5",h5:"[&.neba-typography]:mb-2",h6:"[&.neba-typography]:mb-2",lead:"[&.neba-typography]:mb-4",body:"[&.neba-typography]:mb-3",caption:"[&.neba-typography]:mb-2",overline:"[&.neba-typography]:mb-2"},g={regular:"[&.neba-typography]:font-normal",medium:"[&.neba-typography]:font-medium",semibold:"[&.neba-typography]:font-semibold",bold:"[&.neba-typography]:font-bold"},i={start:"text-start",center:"text-center",end:"text-end",justify:"text-justify"};export const Typography=/*@__PURE__*/e.forwardRef(function Typography({level:l="body",color:s,weight:c,align:d,lines:u,gutter:x=!1,transition:f,render:k,className:v,style:j,children:w,...N},T){const E=t(f),R=p("neba-typography",o[l],g[c??y[l]],d?i[d]:"","span"===h[l]&&(d||x)?"block":"",u?r(u):"",x?m[l]:"[&.neba-typography]:my-0",s?"[&.neba-typography]:text-(--n-accent)":b.has(l)?"[&.neba-typography]:text-(--neba-muted-fg)":"",E.className,v??"");return a({render:k??e.createElement(h[l]),ref:T,props:{className:R,style:s?{"--n-accent":`var(--neba-${s}-accent)`,...n(u),...E.style,...j}:{...n(u),...E.style,...j},children:w,...N}})});
@@ -22,13 +22,15 @@ export interface VisuallyHiddenProps extends React.ComponentPropsWithoutRef<'spa
22
22
  * screen reader instead of a picture. This is the same 1px clipped box, offered
23
23
  * so an application's own markup can say the same things.
24
24
  *
25
- * The form matters and there is only one that works. `hidden` and
26
- * `display: none` take the text off the accessibility tree along with the
27
- * screen, which is the opposite of the job. `opacity: 0` leaves a clickable
28
- * ghost the size of the words, and a pointer finds it. `text-indent: -9999px`
29
- * makes a box that wide and a horizontal scrollbar with it. A 1px box with its
30
- * contents clipped is invisible to a sighted reader and present to every other
31
- * kind, and it is what every serious implementation converged on.
25
+ * The form matters and there is only one that works. `hidden`,
26
+ * `display: none` and `visibility: hidden` take the text off the accessibility
27
+ * tree along with the screen, which is the opposite of the job. `opacity: 0`
28
+ * leaves a clickable ghost the size of the words, and a pointer finds it.
29
+ * `text-indent: -9999px` makes a box that wide and a horizontal scrollbar with
30
+ * it, and `font-size: 0` is announced by some screen readers as nothing at all.
31
+ * A 1px box with its contents clipped is invisible to a sighted reader and
32
+ * present to every other kind, and it is what every serious implementation
33
+ * converged on.
32
34
  *
33
35
  * There is no `aria-hidden` here, deliberately: that is the *other* half of the
34
36
  * pair — visible and not announced — and it is an attribute rather than a
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import*as e from"react";import{useRender as s}from"@base-ui/react/use-render";import{cx as t,srOnlyClasses as a}from"../../internal/styles.js";export const VisuallyHidden=/*@__PURE__*/e.forwardRef(function({visible:e=!1,render:i,className:o,...n},m){return s({render:i??r("span",{}),ref:m,props:{...n,className:t(e?void 0:a,o)}})});
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import*as e from"react";import{useRender as s}from"@base-ui/react/use-render";import{cx as i,srOnlyClasses as a}from"../../internal/styles.js";export const VisuallyHidden=/*@__PURE__*/e.forwardRef(function VisuallyHidden({visible:e=!1,render:t,className:n,...o},m){return s({render:t??r("span",{}),ref:m,props:{...o,className:i(e?void 0:a,n)}})});
@@ -74,7 +74,7 @@ export interface WindowPaneProps extends Omit<React.ComponentPropsWithoutRef<'di
74
74
  *
75
75
  * What being in front looks like is the system's: coloured traffic lights on
76
76
  * macOS against grey ones, an accent title bar and an accent border on
77
- * Windows 10, a tinted header bar on GNOME — and, on all four, a window one
77
+ * Windows 10, a tinted header bar on GNOME — and, on every one of them, a window one
78
78
  * step further off the page than the ones behind it.
79
79
  */
80
80
  active?: boolean;
@@ -155,7 +155,7 @@ export interface WindowPaneProps extends Omit<React.ComponentPropsWithoutRef<'di
155
155
  children?: React.ReactNode;
156
156
  }
157
157
  /**
158
- * A window, drawn the way one of four systems draws it, with anything at all
158
+ * A window, drawn the way one of eight systems draws it, with anything at all
159
159
  * inside it.
160
160
  *
161
161
  * It is not a real window and does not pretend to be one: there is no desktop,
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from"react";import{useRender as o}from"@base-ui/react/use-render";import{beginPointerDrag as r}from"../../internal/drag.js";import{actionMessages as a,useMessages as s,windowMessages as l}from"../../internal/i18n.js";import{cx as d,hasContent as c,iconClasses as u,surfaceClasses as m}from"../../internal/styles.js";import{WindowControls as h,orderControls as f,windowChrome as w,windowMetrics as g,windowSlots as p}from"../../internal/window.js";import{useStyleDefaults as b}from"../../internal/defaults.js";function v(e,t,n){const[o,r]=i.useState(t),a=void 0!==e;return[a?e:o,i.useCallback(e=>{a||r(e),n?.(e)},[a,n])]}const x=[{edge:"n",className:"inset-x-3 top-0 h-1.5 cursor-ns-resize"},{edge:"s",className:"inset-x-3 bottom-0 h-1.5 cursor-ns-resize"},{edge:"w",className:"inset-y-3 left-0 w-1.5 cursor-ew-resize"},{edge:"e",className:"inset-y-3 right-0 w-1.5 cursor-ew-resize"},{edge:"nw",className:"top-0 left-0 size-3 cursor-nwse-resize"},{edge:"ne",className:"top-0 right-0 size-3 cursor-nesw-resize"},{edge:"sw",className:"bottom-0 left-0 size-3 cursor-nesw-resize"},{edge:"se",className:"right-0 bottom-0 size-3 cursor-nwse-resize"}];export const WindowPane=/*@__PURE__*/i.forwardRef(function(z,y){const{os:N="macos",title:M,icon:C,actions:E,controls:S=!0,size:k="md",color:L="primary",accent:j=!1,transparency:I=0,active:R,elevation:B=2,position:D="static",draggable:A=!1,resizable:T=!1,width:H,height:P,minWidth:W=180,minHeight:O,offset:X,defaultOffset:$,onOffsetChange:F,onResize:Y,open:_,defaultOpen:q=!0,onOpenChange:K,minimized:U,defaultMinimized:G=!1,onMinimizedChange:J,maximized:Q,defaultMaximized:V=!1,onMaximizedChange:Z,scroll:ee=!0,locale:te,minimizeLabel:ne,maximizeLabel:ie,restoreLabel:oe,closeLabel:re,resizeLabel:ae,render:se,className:le,style:de,children:ce,...ue}=b(z,["size","locale"]),me=s(l,te),he=s(a,te),fe=w(N),we=g(N,k),ge=i.useId(),[pe,be]=v(_,q,K),[ve,xe]=v(U,G,J),[ze,ye]=v(Q,V,Z),[Ne,Me]=v(X,$??{x:0,y:0},F),[Ce,Ee]=i.useState(null),[Se,ke]=i.useState(!0),Le=R??Se,[je,Ie]=i.useState(null),[Re,Be]=i.useState(null),[De,Ae]=i.useState(!1),[Te,He]=i.useState(!1),[Pe,We]=i.useState(pe);Pe!==pe&&(We(pe),He(!pe)),i.useEffect(()=>{if(!Te)return;const e=window.setTimeout(()=>He(!1),260);return()=>window.clearTimeout(e)},[Te]);const Oe=i.useRef(null),Xe=i.useCallback(e=>{Oe.current=e,"function"==typeof y?y(e):y&&(y.current=e)},[y]);i.useEffect(()=>{if(void 0!==R)return;const e=Oe.current;if(!e)return;const t=t=>{const n=t.target;if(!(n instanceof Node))return;if(e.contains(n))return void ke(!0);const i=n instanceof Element?n:n.parentElement;i?.closest(".neba-window")&&ke(!1)};return document.addEventListener("pointerdown",t,!0),document.addEventListener("focusin",t,!0),()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("focusin",t,!0)}},[R]);const $e=i.useRef(null);function Fe(e,t){if(0!==e.button)return;$e.current?.();const n=e.currentTarget,i=e.clientX,o=e.clientY;Ae(!0);const a=()=>{$e.current=null,Ae(!1)},s=r({target:n,pointerId:e.pointerId,onMove:e=>t(e.clientX-i,e.clientY-o),onEnd:a});$e.current=()=>{s(),a()}}i.useEffect(()=>()=>$e.current?.(),[]);const Ye={width:Math.max(0,W),height:Math.max(we.bar,O??we.bar)};function _e(e){Ee(e),Y?.(e)}const qe=f(N,!0===S?["minimize","maximize","close"]:!1===S?[]:S),Ke=qe.includes("maximize");i.useEffect(()=>{if(ve||null===Re)return;const e=window.setTimeout(()=>Be(null),400);return()=>window.clearTimeout(e)},[ve,Re]);const Ue={minimize:ne??me.minimize,maximize:ie??me.maximize,restore:oe??me.restore,close:re??he.close},Ge=e(h,{os:N,metrics:we,controls:qe,maximized:ze,active:Le,labels:Ue,onCommand:function(e){"close"===e?be(!1):"minimize"===e?function(e){const t=Oe.current,n=t?.firstElementChild;if(t&&n instanceof HTMLElement&&Ie(n.offsetHeight+(t.offsetHeight-t.clientHeight)),e&&void 0===(Ce?.height??P)&&t)return Be(t.getBoundingClientRect().height),void requestAnimationFrame(()=>xe(!0));xe(e)}(!ve):ye(!ze)}}),Je=c(M)?e("span",{id:ge,className:"min-w-0 truncate",children:M}):null,Qe=c(C)?e("span",{className:"flex shrink-0 items-center",children:C}):null,Ve=t("div",{className:d("relative flex shrink-0 items-center select-none",u,A&&!ze?"cursor-grab active:cursor-grabbing":""),style:{height:we.bar,textShadow:"var(--n-window-bar-shadow)",fontWeight:we.weight,paddingInlineStart:we.padX,paddingInlineEnd:we.padEnd,gap:Math.round(.7*we.title),fontSize:we.title,backgroundColor:"var(--n-window-bar)",backgroundImage:"var(--n-window-bar-image)",color:"var(--n-window-bar-fg)",borderBlockEnd:fe.rule?"1px solid var(--n-window-line)":void 0},onPointerDown:function(e){if(!A||ze)return;const t={...Ne};Fe(e,(e,n)=>Me({x:t.x+e,y:t.y+n}))},onDoubleClick:Ke?()=>ye(!ze):void 0,children:["start"===fe.controlsSide?Ge:null,"center"===fe.titleAlign?e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 flex items-center justify-center",style:{paddingInline:we.controlsWidth(qe.length)+2*we.padX},children:t("span",{className:"flex min-w-0 items-center",style:{gap:Math.round(.5*we.title)},children:[Qe,Je]})}):t(n,{children:[Qe,Je]}),e("span",{className:"flex-1"}),c(E)?e("span",{className:"flex shrink-0 items-center",style:{gap:Math.round(.5*we.title)},onPointerDown:e=>e.stopPropagation(),children:E}):null,"end"===fe.controlsSide?Ge:null]}),Ze=ze?{left:0,top:0,width:"100%",height:"100%"}:{left:Ne.x,top:Ne.y,width:Ce?.width??H,height:ve?je??we.bar:Ce?.height??P??Re??void 0},et=o({render:se,ref:Xe,props:{role:"group","aria-labelledby":Je?ge:void 0,className:d("neba-window relative flex min-w-0 flex-col overflow-hidden",I>0?m:"",fe.glass&&0===I?"[backdrop-filter:var(--neba-blur)]":"","[transition-property:left,top,width,height,opacity,box-shadow,background-color,border-color,border-radius]","[transition-duration:var(--neba-duration-window)]","[transition-timing-function:var(--neba-ease)]","motion-reduce:[transition-duration:0ms]","data-[gesture]:[transition-property:none]",le),"data-gesture":De?"":void 0,inert:!pe||void 0,style:{opacity:pe?void 0:0,...p({os:N,color:L,accent:j,transparency:I,active:Le,elevation:B}),position:"static"===D?"relative":D,...Ze,borderRadius:ze?0:`${we.radius}px ${we.radius}px ${we.radiusBottom}px ${we.radiusBottom}px`,borderStyle:"solid",borderWidth:we.frame,borderColor:"var(--n-window-line)",backgroundColor:"var(--n-window-band)",boxShadow:"var(--n-window-shadow), var(--neba-plate-glass)",...de},children:t(n,{children:[Ve,e("div",{className:d("min-h-0 flex-1",ee?"overflow-auto":"overflow-hidden"),style:{backgroundColor:"var(--n-window-body)",marginInline:we.band.side,marginBottom:we.band.bottom,boxShadow:we.band.side>0?"inset 0 0 0 1px rgb(0 0 0 / 0.12)":void 0},inert:ve,children:ce}),!T||ze||ve?null:x.map(t=>{const n="se"===t.edge;return e("div",{role:n?"button":void 0,tabIndex:n?0:void 0,"aria-label":n?ae??me.resize:void 0,"aria-hidden":n?void 0:"true",className:d("absolute z-10 touch-none",t.className,n?"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]":""),onPointerDown:e=>function(e,t){const n=Oe.current;if(!n||ze)return;const i=n.getBoundingClientRect(),o={width:i.width,height:i.height,x:Ne.x,y:Ne.y},r=e.includes("e"),a=e.includes("w"),s=e.includes("n"),l=e.includes("s");Fe(t,(e,t)=>{let{width:n,height:i}=o,{x:d,y:c}=o;r&&(n=Math.max(Ye.width,o.width+e)),l&&(i=Math.max(Ye.height,o.height+t)),a&&(n=Math.max(Ye.width,o.width-e),d=o.x+(o.width-n)),s&&(i=Math.max(Ye.height,o.height-t),c=o.y+(o.height-i)),_e({width:n,height:i}),(a||s)&&Me({x:d,y:c})})}(t.edge,e),onKeyDown:n?e=>{const t={ArrowRight:[16,0],ArrowLeft:[-16,0],ArrowDown:[0,16],ArrowUp:[0,-16]}[e.key];t&&(e.preventDefault(),function(e,t){const n=Oe.current;if(!n)return;const i=n.getBoundingClientRect();_e({width:Math.max(Ye.width,i.width+e),height:Math.max(Ye.height,i.height+t)})}(t[0],t[1]))}:void 0},t.edge)})]}),...ue}});return pe||Te?et:null});
1
+ "use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from"react";import{useRender as o}from"@base-ui/react/use-render";import{beginPointerDrag as r}from"../../internal/drag.js";import{actionMessages as s,useMessages as a,windowMessages as l}from"../../internal/i18n.js";import{cx as d,hasContent as c,iconClasses as u,surfaceClasses as h}from"../../internal/styles.js";import{WindowControls as m,orderControls as f,windowChrome as g,windowMetrics as w,windowSlots as p}from"../../internal/window.js";import{inertValue as b}from"../../internal/inert.js";import{useStyleDefaults as x}from"../../internal/defaults.js";function v(e,t,n){const[o,r]=i.useState(t),s=void 0!==e;return[s?e:o,i.useCallback(e=>{s||r(e),n?.(e)},[s,n])]}const z=[{edge:"n",className:"inset-x-3 top-0 h-1.5 cursor-ns-resize"},{edge:"s",className:"inset-x-3 bottom-0 h-1.5 cursor-ns-resize"},{edge:"w",className:"inset-y-3 left-0 w-1.5 cursor-ew-resize"},{edge:"e",className:"inset-y-3 right-0 w-1.5 cursor-ew-resize"},{edge:"nw",className:"top-0 left-0 size-3 cursor-nwse-resize"},{edge:"ne",className:"top-0 right-0 size-3 cursor-nesw-resize"},{edge:"sw",className:"bottom-0 left-0 size-3 cursor-nesw-resize"},{edge:"se",className:"right-0 bottom-0 size-3 cursor-nwse-resize"}],y=[];export const WindowPane=/*@__PURE__*/i.forwardRef(function WindowPane(M,E){const{os:N="macos",title:H,icon:S,actions:C,controls:k=!0,size:L="md",color:W="primary",accent:j=!1,transparency:I=0,active:P,elevation:D=2,position:T="static",draggable:R=!1,resizable:A=!1,width:O,height:B,minWidth:X=180,minHeight:$,offset:F,defaultOffset:Y,onOffsetChange:_,onResize:q,open:K,defaultOpen:U=!0,onOpenChange:G,minimized:J,defaultMinimized:Q=!1,onMinimizedChange:V,maximized:Z,defaultMaximized:ee=!1,onMaximizedChange:te,scroll:ne=!0,locale:ie,minimizeLabel:oe,maximizeLabel:re,restoreLabel:se,closeLabel:ae,resizeLabel:le,render:de,className:ce,style:ue,children:he,...me}=x(M,["size","locale"]),fe=a(l,ie),ge=i.useId(),we=a(s,ie),pe=g(N),be=w(N,L),xe=i.useId(),[ve,ze]=v(K,U,G),[ye,Me]=v(J,Q,V),[Ee,Ne]=v(Z,ee,te),[He,Se]=v(F,Y??{x:0,y:0},_),[Ce,ke]=i.useState(null),[Le,We]=i.useState({width:O,height:B});Le.width===O&&Le.height===B||(We({width:O,height:B}),ke(null));const[je,Ie]=i.useState(!0),Pe=P??je,[De,Te]=i.useState(null),[Re,Ae]=i.useState(null),[Oe,Be]=i.useState(!1),[Xe,$e]=i.useState(!1),[Fe,Ye]=i.useState(ve);Fe!==ve&&(Ye(ve),$e(!ve)),i.useEffect(()=>{if(!Xe)return;const e=window.setTimeout(()=>$e(!1),260);return()=>window.clearTimeout(e)},[Xe]);const _e=i.useRef(null),qe=i.useCallback(e=>{_e.current=e,"function"==typeof E?E(e):E&&(E.current=e)},[E]);i.useEffect(()=>{if(void 0!==P||!ve)return;const e=_e.current;if(!e)return;const t=e=>Ie(e);y.push(t);const n=n=>{const i=n.target;if(!(i instanceof Node))return;if(e.contains(i))return y.splice(y.indexOf(t),1),y.push(t),void Ie(!0);const o=i instanceof Element?i:i.parentElement;o?.closest(".neba-window")&&Ie(!1)};return document.addEventListener("pointerdown",n,!0),document.addEventListener("focusin",n,!0),()=>{document.removeEventListener("pointerdown",n,!0),document.removeEventListener("focusin",n,!0);const e=y.indexOf(t),i=e===y.length-1;y.splice(e,1),i&&y[y.length-1]?.(!0)}},[P,ve]);const Ke=i.useRef(null);function Ue(e,t){if(0!==e.button)return;Ke.current?.();const n=e.currentTarget,i=e.clientX,o=e.clientY,s=_e.current,a=s?.getBoundingClientRect(),l=s&&a&&s.offsetWidth>0&&a.width/s.offsetWidth||1,d=s&&a&&s.offsetHeight>0&&a.height/s.offsetHeight||1;Be(!0);const c=()=>{Ke.current=null,Be(!1)},u=r({target:n,pointerId:e.pointerId,onMove:e=>t((e.clientX-i)/l,(e.clientY-o)/d),onEnd:c});Ke.current=()=>{u(),c()}}i.useEffect(()=>()=>Ke.current?.(),[]);const Ge={width:Math.max(0,X),height:Math.max(be.bar,$??be.bar)};function Je(e){ke(e),q?.(e)}const Qe=f(N,!0===k?["minimize","maximize","close"]:!1===k?[]:k),Ve=Qe.includes("maximize");i.useLayoutEffect(()=>{if(!ye||null!==De)return;const e=_e.current,t=e?.firstElementChild;e&&t instanceof HTMLElement&&Te(t.offsetHeight+(e.offsetHeight-e.clientHeight))},[ye,De]),i.useEffect(()=>{if(ye||null===Re)return;const e=window.setTimeout(()=>Ae(null),400);return()=>window.clearTimeout(e)},[ye,Re]);const Ze={minimize:oe??fe.minimize,maximize:re??fe.maximize,restore:se??fe.restore,close:ae??we.close},et=e(m,{os:N,metrics:be,controls:Qe,maximized:Ee,active:Pe,labels:Ze,onCommand:function(e){"close"===e?ze(!1):"minimize"===e?function(e){const t=_e.current,n=t?.firstElementChild;if(t&&n instanceof HTMLElement&&Te(n.offsetHeight+(t.offsetHeight-t.clientHeight)),e&&void 0===(Ce?.height??B)&&t)return Ae(t.offsetHeight),void requestAnimationFrame(()=>Me(!0));Me(e)}(!ye):Ne(!Ee)}}),tt=c(H)?e("span",{id:xe,className:"min-w-0 truncate",children:H}):null,nt=c(S)?e("span",{className:"flex shrink-0 items-center",children:S}):null,it=t("div",{className:d("relative flex shrink-0 items-center select-none",u,R&&!Ee?"cursor-grab touch-none active:cursor-grabbing":""),style:{height:be.bar,textShadow:"var(--n-window-bar-shadow)",fontWeight:be.weight,paddingInlineStart:be.padX,paddingInlineEnd:be.padEnd,gap:Math.round(.7*be.title),fontSize:be.title,backgroundColor:"var(--n-window-bar)",backgroundImage:"var(--n-window-bar-image)",color:"var(--n-window-bar-fg)",borderBlockEnd:pe.rule?"1px solid var(--n-window-line)":void 0},onPointerDown:function(e){if(!R||Ee)return;const t={...He},n=_e.current,i="fixed"===T?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:"absolute"===T&&n?.offsetParent instanceof HTMLElement?{width:n.offsetParent.clientWidth,height:n.offsetParent.clientHeight}:null,o=n?.offsetWidth??0,r=Math.min(o,48);Ue(e,(e,n)=>{const s=t.x+e,a=t.y+n;Se(i?{x:Math.min(Math.max(s,r-o),i.width-r),y:Math.min(Math.max(a,0),Math.max(0,i.height-be.bar))}:{x:s,y:a})})},onDoubleClick:Ve?()=>Ne(!Ee):void 0,children:["start"===pe.controlsSide?et:null,"center"===pe.titleAlign?e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 flex items-center justify-center",style:{paddingInline:be.controlsWidth(Qe.length)+2*be.padX},children:t("span",{className:"flex min-w-0 items-center",style:{gap:Math.round(.5*be.title)},children:[nt,tt]})}):t(n,{children:[nt,tt]}),e("span",{className:"flex-1"}),c(C)?e("span",{className:"flex shrink-0 items-center",style:{gap:Math.round(.5*be.title)},onPointerDown:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:C}):null,"end"===pe.controlsSide?et:null]}),ot=Ee?{left:0,top:0,width:"100%",height:"100%"}:{left:He.x,top:He.y,width:Ce?.width??O,height:ye?De??be.bar:Ce?.height??B??Re??void 0},rt=o({render:de,ref:qe,props:{role:"group","aria-labelledby":tt?xe:void 0,className:d("neba-window relative flex min-w-0 flex-col overflow-hidden",I>0?h:"",pe.glass&&0===I?"[backdrop-filter:var(--neba-blur)]":"","[transition-property:left,top,width,height,opacity,box-shadow,background-color,border-color,border-radius]","[transition-duration:var(--neba-duration-window)]","[transition-timing-function:var(--neba-ease)]","motion-reduce:[transition-duration:0ms]","data-[gesture]:[transition-property:none]",ce),"data-gesture":Oe?"":void 0,inert:b(!ve),style:{opacity:ve?void 0:0,...p({os:N,color:W,accent:j,transparency:I,active:Pe,elevation:D}),position:"static"===T?"relative":T,...ot,borderRadius:Ee?0:`${be.radius}px ${be.radius}px ${be.radiusBottom}px ${be.radiusBottom}px`,borderStyle:"solid",borderWidth:be.frame,borderColor:"var(--n-window-line)",backgroundColor:"var(--n-window-band)",boxShadow:"var(--n-window-shadow), var(--neba-plate-glass)",...ue},children:t(n,{children:[it,e("div",{className:d("min-h-0 flex-1",ne?"overflow-auto":"overflow-hidden"),style:{backgroundColor:"var(--n-window-body)",marginInline:be.band.side,marginBottom:be.band.bottom,boxShadow:be.band.side>0?"inset 0 0 0 1px rgb(0 0 0 / 0.12)":void 0},inert:b(ye),children:he}),!A||Ee||ye?null:e("span",{id:ge,hidden:!0,children:fe.resizeHint}),!A||Ee||ye?null:z.map(t=>{const n="se"===t.edge;return e("div",{role:n?"button":void 0,tabIndex:n?0:void 0,"aria-label":n?le??fe.resize:void 0,"aria-describedby":n?ge:void 0,"aria-hidden":n?void 0:"true",className:d("absolute z-10 touch-none",t.className,n?"neba-hit":"",n?"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]":""),onPointerDown:e=>function(e,t){const n=_e.current;if(!n||Ee)return;const i={width:n.offsetWidth,height:n.offsetHeight,x:He.x,y:He.y},o=e.includes("e"),r=e.includes("w"),s=e.includes("n"),a=e.includes("s");Ue(t,(e,t)=>{let{width:n,height:l}=i,{x:d,y:c}=i;o&&(n=Math.max(Ge.width,i.width+e)),a&&(l=Math.max(Ge.height,i.height+t)),r&&(n=Math.max(Ge.width,i.width-e),d=i.x+(i.width-n)),s&&(l=Math.max(Ge.height,i.height-t),c=i.y+(i.height-l)),Je({width:n,height:l}),(r||s)&&Se({x:d,y:c})})}(t.edge,e),onKeyDown:n?e=>{const t={ArrowRight:[16,0],ArrowLeft:[-16,0],ArrowDown:[0,16],ArrowUp:[0,-16]}[e.key];t&&(e.preventDefault(),function(e,t){const n=_e.current;n&&Je({width:Math.max(Ge.width,n.offsetWidth+e),height:Math.max(Ge.height,n.offsetHeight+t)})}(t[0],t[1]))}:void 0},t.edge)})]}),...me}});return ve||Xe?rt:null});
@@ -15,7 +15,9 @@ export interface ElementSize {
15
15
  * The ref goes on the element to watch. It measures once as soon as that
16
16
  * element is there rather than waiting to be told, because a `ResizeObserver`
17
17
  * that is missing — an old browser, a server — never says anything at all, and
18
- * a component sized `0 × 0` forever is worse than one measured once.
18
+ * a component sized `0 × 0` forever is worse than one measured once. An element
19
+ * put on the ref after the first render, behind a loading state for instance, is
20
+ * measured when it arrives.
19
21
  */
20
22
  export declare function useElementSize<E extends Element = HTMLElement>(): [
21
23
  React.RefObject<E | null>,
@@ -1 +1 @@
1
- "use client";import*as t from"react";import{observeResize as e}from"../internal/observe.js";export function useElementSize(){const i=t.useRef(null),[n,r]=t.useState({width:0,height:0});return t.useLayoutEffect(()=>{const t=i.current;if(!t)return;const n=()=>{const e=t.getBoundingClientRect();r(t=>t.width===e.width&&t.height===e.height?t:{width:e.width,height:e.height})};return n(),e(t,n)},[]),[i,n]}
1
+ "use client";import*as t from"react";import{attachedRef as e,observeResize as i}from"../internal/observe.js";export function useElementSize(){const[n,h]=t.useState(null),[r]=t.useState(()=>e(h)),[u,o]=t.useState({width:0,height:0});return t.useLayoutEffect(()=>{if(!n)return;const t=()=>{const t=n.getBoundingClientRect();o(e=>e.width===t.width&&e.height===t.height?e:{width:t.width,height:t.height})};return t(),i(n,t)},[n]),[r,u]}
@@ -20,5 +20,8 @@ export interface OnScreenOptions {
20
20
  * It answers `true` where there is no `IntersectionObserver` rather than
21
21
  * `false`, and that is the load-bearing part: a caller cannot know without one,
22
22
  * and the right fallback is to show the thing rather than to hide it forever.
23
+ *
24
+ * An element put on the ref after the first render, behind a loading state for
25
+ * instance, is watched from when it arrives.
23
26
  */
24
27
  export declare function useOnScreen<E extends Element = HTMLElement>(options?: OnScreenOptions): [React.RefObject<E | null>, boolean];
@@ -1 +1 @@
1
- "use client";import*as e from"react";import{observeVisibility as r}from"../internal/observe.js";export function useOnScreen(t={}){const{threshold:n=0,once:o=!0}=t,s=e.useRef(null),[u,c]=e.useState(!1);return e.useEffect(()=>{const e=s.current;if(!e)return;const t=r(e,n,e=>{c(e),e&&o&&t?.()});if(t)return t;c(!0)},[n,o]),[s,u]}
1
+ "use client";import*as e from"react";import{attachedRef as t,observeVisibility as r}from"../internal/observe.js";export function useOnScreen(n={}){const{threshold:s=0,once:o=!0}=n,[u,c]=e.useState(null),[f]=e.useState(()=>t(c)),[i,a]=e.useState(!1);return e.useEffect(()=>{if(!u)return;const e=r(u,s,t=>{a(t),t&&o&&e?.()});if(e)return e;a(!0)},[u,s,o]),[f,i]}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  export * from './types.js';
2
2
  export * from './hooks/index.js';
3
3
  export * from './components/accordion/index.js';
4
+ export * from './components/agent-steps/index.js';
4
5
  export * from './components/alert/index.js';
5
6
  export * from './components/anchor/index.js';
6
7
  export * from './components/animate-appear/index.js';
7
8
  export * from './components/app-logo/index.js';
9
+ export * from './components/approval/index.js';
8
10
  export * from './components/animate-blink/index.js';
9
11
  export * from './components/animate-counter/index.js';
10
12
  export * from './components/animate-fade/index.js';
@@ -45,6 +47,7 @@ export * from './components/combobox/index.js';
45
47
  export * from './components/command-palette/index.js';
46
48
  export * from './components/confirm/index.js';
47
49
  export * from './components/container/index.js';
50
+ export * from './components/context-window/index.js';
48
51
  export * from './components/data-list/index.js';
49
52
  export * from './components/data-table/index.js';
50
53
  export * from './components/date-picker/index.js';
@@ -73,6 +76,7 @@ export * from './components/how-to-steps/index.js';
73
76
  export * from './components/icon/index.js';
74
77
  export * from './components/icon-button/index.js';
75
78
  export * from './components/image/index.js';
79
+ export * from './components/inline-citation/index.js';
76
80
  export * from './components/line-chart/index.js';
77
81
  export * from './components/list/index.js';
78
82
  export * from './components/menu/index.js';
@@ -94,8 +98,10 @@ export * from './components/portal/index.js';
94
98
  export * from './components/progress-box/index.js';
95
99
  export * from './components/progress-circular/index.js';
96
100
  export * from './components/progress-linear/index.js';
101
+ export * from './components/prompt-input/index.js';
97
102
  export * from './components/provider/index.js';
98
103
  export * from './components/radio-group/index.js';
104
+ export * from './components/reasoning/index.js';
99
105
  export * from './components/rating/index.js';
100
106
  export * from './components/scatter-chart/index.js';
101
107
  export * from './components/scroll-area/index.js';
@@ -109,8 +115,10 @@ export * from './components/skeleton/index.js';
109
115
  export * from './components/slider/index.js';
110
116
  export * from './components/sparkline/index.js';
111
117
  export * from './components/spoiler/index.js';
118
+ export * from './components/sources/index.js';
112
119
  export * from './components/stack/index.js';
113
120
  export * from './components/statistic/index.js';
121
+ export * from './components/streaming-text/index.js';
114
122
  export * from './components/switch/index.js';
115
123
  export * from './components/table/index.js';
116
124
  export * from './components/tabs/index.js';
@@ -123,6 +131,7 @@ export * from './components/toast/index.js';
123
131
  export * from './components/toggle/index.js';
124
132
  export * from './components/toggle-group/index.js';
125
133
  export * from './components/toolbar/index.js';
134
+ export * from './components/tool-call/index.js';
126
135
  export * from './components/tooltip/index.js';
127
136
  export * from './components/tour/index.js';
128
137
  export * from './components/transfer/index.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export*from"./types.js";export*from"./hooks/index.js";export*from"./components/accordion/index.js";export*from"./components/alert/index.js";export*from"./components/anchor/index.js";export*from"./components/animate-appear/index.js";export*from"./components/app-logo/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-counter/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-float/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-reveal/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-scramble/index.js";export*from"./components/animate-shake/index.js";export*from"./components/animate-split/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/area-chart/index.js";export*from"./components/aspect-ratio/index.js";export*from"./components/avatar/index.js";export*from"./components/badge/index.js";export*from"./components/bar-chart/index.js";export*from"./components/blockquote/index.js";export*from"./components/bottom-navigation/index.js";export*from"./components/box/index.js";export*from"./components/breadcrumb/index.js";export*from"./components/button/index.js";export*from"./components/button-group/index.js";export*from"./components/calendar/index.js";export*from"./components/card/index.js";export*from"./components/carousel/index.js";export*from"./components/chat-bubble/index.js";export*from"./components/checkbox/index.js";export*from"./components/chip/index.js";export*from"./components/code-block/index.js";export*from"./components/collapsible/index.js";export*from"./components/color-picker/index.js";export*from"./components/combobox/index.js";export*from"./components/command-palette/index.js";export*from"./components/confirm/index.js";export*from"./components/container/index.js";export*from"./components/data-list/index.js";export*from"./components/data-table/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-range-picker/index.js";export*from"./components/date-time-picker/index.js";export*from"./components/dialog/index.js";export*from"./components/divider/index.js";export*from"./components/drawer/index.js";export*from"./components/empty/index.js";export*from"./components/fieldset/index.js";export*from"./components/file-picker/index.js";export*from"./components/flex/index.js";export*from"./components/form/index.js";export*from"./components/gallery/index.js";export*from"./components/gauge-chart/index.js";export*from"./components/grid/index.js";export*from"./components/floating-action-button/index.js";export*from"./components/floating-bottom-navigation/index.js";export*from"./components/footer/index.js";export*from"./components/grid-container/index.js";export*from"./components/header/index.js";export*from"./components/heatmap-chart/index.js";export*from"./components/highlight/index.js";export*from"./components/hover-card/index.js";export*from"./components/how-to-steps/index.js";export*from"./components/icon/index.js";export*from"./components/icon-button/index.js";export*from"./components/image/index.js";export*from"./components/line-chart/index.js";export*from"./components/list/index.js";export*from"./components/menu/index.js";export*from"./components/menubar/index.js";export*from"./components/meter/index.js";export*from"./components/mockup/index.js";export*from"./components/navigation-menu/index.js";export*from"./components/number-field/index.js";export*from"./components/otp-field/index.js";export*from"./components/overlay/index.js";export*from"./components/page-layout/index.js";export*from"./components/pagination/index.js";export*from"./components/panes/index.js";export*from"./components/pie-chart/index.js";export*from"./components/pill/index.js";export*from"./components/popconfirm/index.js";export*from"./components/popover/index.js";export*from"./components/portal/index.js";export*from"./components/progress-box/index.js";export*from"./components/progress-circular/index.js";export*from"./components/progress-linear/index.js";export*from"./components/provider/index.js";export*from"./components/radio-group/index.js";export*from"./components/rating/index.js";export*from"./components/scatter-chart/index.js";export*from"./components/scroll-area/index.js";export*from"./components/scroll-zone/index.js";export*from"./components/segmented-button/index.js";export*from"./components/select/index.js";export*from"./components/shortcut/index.js";export*from"./components/show/index.js";export*from"./components/sidebar/index.js";export*from"./components/skeleton/index.js";export*from"./components/slider/index.js";export*from"./components/sparkline/index.js";export*from"./components/spoiler/index.js";export*from"./components/stack/index.js";export*from"./components/statistic/index.js";export*from"./components/switch/index.js";export*from"./components/table/index.js";export*from"./components/tabs/index.js";export*from"./components/text-field/index.js";export*from"./components/text-link/index.js";export*from"./components/time-picker/index.js";export*from"./components/timeline/index.js";export*from"./components/timeline-chart/index.js";export*from"./components/toast/index.js";export*from"./components/toggle/index.js";export*from"./components/toggle-group/index.js";export*from"./components/toolbar/index.js";export*from"./components/tooltip/index.js";export*from"./components/tour/index.js";export*from"./components/transfer/index.js";export*from"./components/tree-select/index.js";export*from"./components/tree-view/index.js";export*from"./components/typography/index.js";export*from"./components/visually-hidden/index.js";export*from"./components/window-pane/index.js";
1
+ export*from"./types.js";export*from"./hooks/index.js";export*from"./components/accordion/index.js";export*from"./components/agent-steps/index.js";export*from"./components/alert/index.js";export*from"./components/anchor/index.js";export*from"./components/animate-appear/index.js";export*from"./components/app-logo/index.js";export*from"./components/approval/index.js";export*from"./components/animate-blink/index.js";export*from"./components/animate-counter/index.js";export*from"./components/animate-fade/index.js";export*from"./components/animate-float/index.js";export*from"./components/animate-grow/index.js";export*from"./components/animate-headline/index.js";export*from"./components/animate-lighting/index.js";export*from"./components/animate-marquee/index.js";export*from"./components/animate-reveal/index.js";export*from"./components/animate-rotate/index.js";export*from"./components/animate-scramble/index.js";export*from"./components/animate-shake/index.js";export*from"./components/animate-split/index.js";export*from"./components/animate-slide/index.js";export*from"./components/animate-typing/index.js";export*from"./components/animate-zoom/index.js";export*from"./components/area-chart/index.js";export*from"./components/aspect-ratio/index.js";export*from"./components/avatar/index.js";export*from"./components/badge/index.js";export*from"./components/bar-chart/index.js";export*from"./components/blockquote/index.js";export*from"./components/bottom-navigation/index.js";export*from"./components/box/index.js";export*from"./components/breadcrumb/index.js";export*from"./components/button/index.js";export*from"./components/button-group/index.js";export*from"./components/calendar/index.js";export*from"./components/card/index.js";export*from"./components/carousel/index.js";export*from"./components/chat-bubble/index.js";export*from"./components/checkbox/index.js";export*from"./components/chip/index.js";export*from"./components/code-block/index.js";export*from"./components/collapsible/index.js";export*from"./components/color-picker/index.js";export*from"./components/combobox/index.js";export*from"./components/command-palette/index.js";export*from"./components/confirm/index.js";export*from"./components/container/index.js";export*from"./components/context-window/index.js";export*from"./components/data-list/index.js";export*from"./components/data-table/index.js";export*from"./components/date-picker/index.js";export*from"./components/date-range-picker/index.js";export*from"./components/date-time-picker/index.js";export*from"./components/dialog/index.js";export*from"./components/divider/index.js";export*from"./components/drawer/index.js";export*from"./components/empty/index.js";export*from"./components/fieldset/index.js";export*from"./components/file-picker/index.js";export*from"./components/flex/index.js";export*from"./components/form/index.js";export*from"./components/gallery/index.js";export*from"./components/gauge-chart/index.js";export*from"./components/grid/index.js";export*from"./components/floating-action-button/index.js";export*from"./components/floating-bottom-navigation/index.js";export*from"./components/footer/index.js";export*from"./components/grid-container/index.js";export*from"./components/header/index.js";export*from"./components/heatmap-chart/index.js";export*from"./components/highlight/index.js";export*from"./components/hover-card/index.js";export*from"./components/how-to-steps/index.js";export*from"./components/icon/index.js";export*from"./components/icon-button/index.js";export*from"./components/image/index.js";export*from"./components/inline-citation/index.js";export*from"./components/line-chart/index.js";export*from"./components/list/index.js";export*from"./components/menu/index.js";export*from"./components/menubar/index.js";export*from"./components/meter/index.js";export*from"./components/mockup/index.js";export*from"./components/navigation-menu/index.js";export*from"./components/number-field/index.js";export*from"./components/otp-field/index.js";export*from"./components/overlay/index.js";export*from"./components/page-layout/index.js";export*from"./components/pagination/index.js";export*from"./components/panes/index.js";export*from"./components/pie-chart/index.js";export*from"./components/pill/index.js";export*from"./components/popconfirm/index.js";export*from"./components/popover/index.js";export*from"./components/portal/index.js";export*from"./components/progress-box/index.js";export*from"./components/progress-circular/index.js";export*from"./components/progress-linear/index.js";export*from"./components/prompt-input/index.js";export*from"./components/provider/index.js";export*from"./components/radio-group/index.js";export*from"./components/reasoning/index.js";export*from"./components/rating/index.js";export*from"./components/scatter-chart/index.js";export*from"./components/scroll-area/index.js";export*from"./components/scroll-zone/index.js";export*from"./components/segmented-button/index.js";export*from"./components/select/index.js";export*from"./components/shortcut/index.js";export*from"./components/show/index.js";export*from"./components/sidebar/index.js";export*from"./components/skeleton/index.js";export*from"./components/slider/index.js";export*from"./components/sparkline/index.js";export*from"./components/spoiler/index.js";export*from"./components/sources/index.js";export*from"./components/stack/index.js";export*from"./components/statistic/index.js";export*from"./components/streaming-text/index.js";export*from"./components/switch/index.js";export*from"./components/table/index.js";export*from"./components/tabs/index.js";export*from"./components/text-field/index.js";export*from"./components/text-link/index.js";export*from"./components/time-picker/index.js";export*from"./components/timeline/index.js";export*from"./components/timeline-chart/index.js";export*from"./components/toast/index.js";export*from"./components/toggle/index.js";export*from"./components/toggle-group/index.js";export*from"./components/toolbar/index.js";export*from"./components/tool-call/index.js";export*from"./components/tooltip/index.js";export*from"./components/tour/index.js";export*from"./components/transfer/index.js";export*from"./components/tree-select/index.js";export*from"./components/tree-view/index.js";export*from"./components/typography/index.js";export*from"./components/visually-hidden/index.js";export*from"./components/window-pane/index.js";
@@ -3,7 +3,7 @@
3
3
  * with it.
4
4
  *
5
5
  * It lives in `internal/` for the reason `button-group.ts` and `menu.ts` do:
6
- * eleven components need it and none of them should have to import another. The
6
+ * seventeen components need it and none of them should have to import another. The
7
7
  * `transition` prop needs the same table from the other side — a Card and an
8
8
  * `AnimateFade` must produce the same fade, or the library has two fades.
9
9
  *
@@ -18,7 +18,7 @@
18
18
  *
19
19
  * Because the from-state is the *keyframe* rather than a second class, running
20
20
  * an effect backwards is `animation-direction: reverse` and nothing else. That
21
- * is what makes `mode="out"` free on all six.
21
+ * is what makes `mode="out"` free on every one of them.
22
22
  *
23
23
  * ## What is deliberately not here
24
24
  *
@@ -40,6 +40,11 @@ import type { NebaAnimateRepeat, NebaAnimateTimeline, NebaAnimateTrigger, NebaAn
40
40
  export declare const animationClasses: Record<NebaAnimation, string>;
41
41
  /** The class that reads the slots. Always paired with one of the above. */
42
42
  export declare const animBaseClass = "neba-anim";
43
+ /**
44
+ * The parts a replay rewinds when the effect was handed to each child rather
45
+ * than run on the root, read from the root. See `AnimationRunOptions.parts`.
46
+ */
47
+ export declare const childAnimations = ":scope > .neba-anim";
43
48
  /**
44
49
  * How long each effect takes when nobody said.
45
50
  *
@@ -117,6 +122,15 @@ export declare function staggers({ stagger, durationStep }: StaggerOptions): boo
117
122
  * how to opt part of a list out — group it.
118
123
  */
119
124
  export declare function staggerChildren(children: React.ReactNode, effectClass: string, slots: AnimationSlotOptions, { stagger, durationStep, reverse }: StaggerOptions): React.ReactNode[];
125
+ /**
126
+ * The shortest a blink may run, in milliseconds.
127
+ *
128
+ * One blink is one flash, full to faint and back, and more than three flashes
129
+ * in a second is what WCAG 2.3.1 rules out, because that is the rate at which a
130
+ * flash can bring on a seizure. A shorter `duration` is raised to this rather
131
+ * than refused, wherever a blink is asked for.
132
+ */
133
+ export declare const MIN_BLINK_DURATION = 334;
120
134
  /**
121
135
  * What a component's `transition` prop turns into: one class pair and a handful
122
136
  * of custom properties, merged into whatever the component was already writing.
@@ -130,6 +144,11 @@ export declare function transitionProps(transition: NebaTransition | undefined):
130
144
  className: string;
131
145
  style: React.CSSProperties;
132
146
  };
147
+ /** An effect, and the slots it reads. */
148
+ export interface TransitionParts {
149
+ effect: NebaAnimation;
150
+ slots: AnimationSlotOptions;
151
+ }
133
152
  /**
134
153
  * The same reading, one step before it becomes a class and a style object.
135
154
  *
@@ -138,27 +157,44 @@ export declare function transitionProps(transition: NebaTransition | undefined):
138
157
  * add to the delay before the slots are filled. Splitting it here is what keeps
139
158
  * one table: `transition="fade"` on a Card and on a Stack item are the same
140
159
  * fade, read by the same code.
160
+ *
161
+ * Given an effect it always has an answer, and the overload says so: AnimateSplit
162
+ * names one every time, and a `null` it could never receive was two branches of
163
+ * code that never ran.
141
164
  */
142
- export declare function transitionParts(transition: NebaTransition | undefined): {
143
- effect: NebaAnimation;
144
- slots: AnimationSlotOptions;
145
- } | null;
165
+ export declare function transitionParts(transition: NebaTransition): TransitionParts;
166
+ export declare function transitionParts(transition: NebaTransition | undefined): TransitionParts | null;
146
167
  /**
147
- * Whether the reader has asked for less motion — the hook the three effects
168
+ * Whether the reader has asked for less motion — the hook the four effects
148
169
  * with motion written in JavaScript read. It lives in `media.ts` beside the
149
170
  * query it asks, so a Carousel and a ScrollZone can ask the same question
150
- * without pulling the eleven effects below in with the answer.
171
+ * without pulling the table of effects below in with the answer.
151
172
  */
152
173
  export { usePrefersReducedMotion } from './media.js';
153
174
  export interface AnimationRunOptions {
154
175
  trigger: NebaAnimateTrigger;
155
- play?: boolean;
176
+ play?: boolean | number;
156
177
  once: boolean;
157
178
  threshold: number;
158
179
  paused?: boolean;
159
180
  /** An infinite effect stops when the pointer leaves; a finite one finishes. */
160
181
  infinite: boolean;
182
+ /**
183
+ * The descendants a replay rewinds along with the root, as a selector read
184
+ * from it: `childAnimations` for an effect handed to each child. Only the
185
+ * component's own parts, so an animation of somebody else's inside it is
186
+ * left where it is.
187
+ */
188
+ parts?: string;
189
+ /**
190
+ * The caller's own props, read for the four events a `hover` trigger listens
191
+ * to. Their handlers run beside the trigger's: spread in one order the
192
+ * trigger threw them away, and spread in the other they took the trigger off.
193
+ */
194
+ caller?: TriggerHandlers;
161
195
  }
196
+ /** The events a `hover` trigger listens to. */
197
+ type TriggerHandlers = Pick<React.HTMLAttributes<HTMLElement>, 'onPointerEnter' | 'onPointerLeave' | 'onFocus' | 'onBlur'>;
162
198
  export interface AnimationRun {
163
199
  /** Goes on the animated element. */
164
200
  ref: React.RefCallback<HTMLElement>;
@@ -166,8 +202,17 @@ export interface AnimationRun {
166
202
  state: 'running' | 'paused';
167
203
  /** Whether the animation has been let go at all, for `data-state`. */
168
204
  started: boolean;
169
- /** Spread onto the element when `trigger` is `hover`; empty otherwise. */
170
- handlers: React.HTMLAttributes<HTMLElement>;
205
+ /**
206
+ * Spread onto the element after the caller's props when `trigger` is
207
+ * `hover`, with the caller's handlers already inside; empty otherwise.
208
+ */
209
+ handlers: TriggerHandlers;
210
+ /**
211
+ * An endless effect that is off the screen, and held where it is until it
212
+ * comes back. Already folded into `state`; a loop written in JavaScript reads
213
+ * it beside `paused`.
214
+ */
215
+ offscreen: boolean;
171
216
  }
172
217
  /**
173
218
  * Starts, restarts and holds an animation.
@@ -188,7 +233,7 @@ export interface AnimationRun {
188
233
  * style to settle, and putting it back is the one move that rewinds the element
189
234
  * and leaves everything inside it alone.
190
235
  */
191
- export declare function useAnimationRun({ trigger, play, once, threshold, paused, infinite }: AnimationRunOptions): AnimationRun;
236
+ export declare function useAnimationRun({ trigger, play, once, threshold, paused, infinite, caller, parts }: AnimationRunOptions): AnimationRun;
192
237
  export interface AnimateElementParams extends AnimationSlotOptions, AnimationRunOptions {
193
238
  /** Which keyframe, out of the shared table. `null` to bring your own. */
194
239
  effect: NebaAnimation | null;
@@ -222,11 +267,13 @@ export interface AnimateElement {
222
267
  /**
223
268
  * Everything an `Animate*` root needs, in one call.
224
269
  *
225
- * The six effect components differ only in their defaults and in which slots
270
+ * The ten effect components differ only in their defaults and in which slots
226
271
  * they fill, so this is where the identical two-thirds of each of them lives.
227
- * The four that have to understand their children — Typing, Marquee, Headline,
228
- * Appear — call `useAnimationRun` directly and put the classes where their own
229
- * structure needs them, which is why `effect` is allowed to be `null`.
272
+ * The seven that have to understand their children or their text — Typing,
273
+ * Marquee, Headline, Appear, Split, Scramble and Counter — call
274
+ * `useAnimationRun` directly and put the classes where their own structure
275
+ * needs them. `effect` may be `null` for the one effect component, Lighting,
276
+ * whose keyframe runs on a pseudo-element rather than on its root.
230
277
  *
231
278
  * `data-neba-animation` and `data-state` are here rather than in each component
232
279
  * because they are the same two facts every time, and because a test that has
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import*as n from"react";import{observeVisibility as t}from"./observe.js";import{cx as a}from"./styles.js";export const animationClasses={fade:"neba-anim-fade",grow:"neba-anim-scale",slide:"neba-anim-slide",zoom:"neba-anim-scale",rotate:"neba-anim-rotate",blink:"neba-anim-blink",reveal:"neba-anim-reveal"};export const animBaseClass="neba-anim";export const defaultDurations={fade:320,grow:340,slide:380,zoom:340,rotate:460,blink:900,reveal:620};export function revealClip(e){switch(e){case"top":return"inset(0 0 100% 0)";case"bottom":return"inset(100% 0 0 0)";case"right":return"inset(0 0 0 100%)";default:return"inset(0 100% 0 0)"}}export function lengthValue(e){return"number"==typeof e?`${e}px`:e}export function isInfinite(e){return"infinite"===e}export function animationSlots(e){const n={"--n-anim-duration":`${e.duration}ms`,"--n-anim-delay":`${e.delay}ms`,"--n-anim-repeat":(r=e.repeat,"infinite"===r?"infinite":String(r)),"--n-anim-direction":(t=e.mode??"in",a=e.alternate,"out"===t?a?"alternate-reverse":"reverse":a?"alternate":"normal")};var t,a,r;return e.easing&&(n["--n-anim-ease"]=e.easing),void 0!==e.opacity&&(n["--n-anim-opacity"]=String(e.opacity)),void 0!==e.scale&&(n["--n-anim-scale"]=String(e.scale)),void 0!==e.x&&(n["--n-anim-x"]=e.x),void 0!==e.y&&(n["--n-anim-y"]=e.y),void 0!==e.angle&&(n["--n-anim-angle"]=e.angle),void 0!==e.angleTo&&(n["--n-anim-angle-to"]=e.angleTo),void 0!==e.clip&&(n["--n-anim-clip"]=e.clip),"view"===e.timeline&&(n["--n-anim-timeline"]="view()",n["--n-anim-range"]=e.range??"entry 0% cover 45%"),n}export function slideOffsets(e,n){const t=lengthValue(n),a="number"==typeof n?-n+"px":`calc(-1 * ${t})`;switch(e){case"top":return{x:"0px",y:a};case"bottom":return{x:"0px",y:t};case"left":return{x:a,y:"0px"};default:return{x:t,y:"0px"}}}export function staggers({stagger:e,durationStep:n}){return 0!==e||0!==n}export function staggerChildren(t,r,i,{stagger:s,durationStep:o,reverse:l}){const u=n.Children.toArray(t);return u.map((t,c)=>{const m=l?u.length-1-c:c,f=animationSlots({...i,delay:i.delay+m*s,duration:Math.max(0,i.duration+m*o)});if(!n.isValidElement(t))return e("span",{className:r,style:f,children:t},c);const d=t.props;return n.cloneElement(t,{className:a(r,d.className),style:{...f,...d.style}})})}export function transitionProps(e){const n=transitionParts(e);return n?{className:`neba-anim ${animationClasses[n.effect]}`,style:animationSlots(n.slots)}:{className:"",style:{}}}export function transitionParts(e){if(!e)return null;const n="string"==typeof e?{type:e}:e,{type:t}=n,a={duration:n.duration??defaultDurations[t],delay:n.delay??0,easing:n.easing,repeat:n.repeat??("blink"===t?"infinite":1),alternate:n.alternate,timeline:n.timeline,range:n.range};if("grow"!==t&&"zoom"!==t||(a.scale=n.scale??("zoom"===t?.4:.8)),"slide"===t){const{x:e,y:t}=slideOffsets(n.from??"bottom",n.distance??"100%");a.x=e,a.y=t}return"rotate"===t&&(a.angle=`${n.angle??-180}deg`),"reveal"===t&&(a.clip=revealClip(n.side??"left")),{effect:t,slots:a}}export{usePrefersReducedMotion}from"./media.js";export function useAnimationRun({trigger:e,play:a,once:r,threshold:i,paused:s,infinite:o}){const l=n.useRef(null),[u,c]=n.useState("mount"===e),[m,f]=n.useState(0),d=n.useCallback(()=>{c(!0),f(e=>e+1)},[]);n.useLayoutEffect(()=>{const e=l.current;if(!e||0===m)return;const n=[e,...e.querySelectorAll(".neba-anim, .neba-marquee-track")];for(const e of n)e.style.animationName="none";e.offsetWidth;for(const e of n)e.style.animationName=""},[m]),n.useEffect(()=>{if("visible"!==e)return;const n=l.current;if(!n)return;let a=null;if(a=t(n,i,e=>{e?(d(),r&&(a?.(),a=null)):r||c(!1)}),a)return()=>a?.();c(!0)},[e,r,i,d]),n.useEffect(()=>{"manual"===e&&(a?d():c(!1))},[e,a,d]);const p="hover"===e?{onPointerEnter:d,onFocus:d,onPointerLeave:()=>{o&&c(!1)},onBlur:()=>{o&&c(!1)}}:{};return{ref:n.useCallback(e=>{l.current=e},[]),state:u&&!s?"running":"paused",started:u,handlers:p}}export function useAnimateElement(e){const{effect:n,trigger:t,play:a,once:r,threshold:i,paused:s,infinite:o,children:l,stagger:u=0,durationStep:c=0,reverse:m=!1,effectClass:f,name:d,...p}=e,g=useAnimationRun({trigger:t,play:a,once:r,threshold:i,paused:s,infinite:o}),y=n?animationClasses[n]:f,x=y?`neba-anim ${y}`:"",v=""!==x&&staggers({stagger:u,durationStep:c,reverse:m}),b="view"===p.timeline?"running":g.state;return{ref:g.ref,className:v?"":x,style:v?{"--n-anim-state":b}:{...animationSlots(p),"--n-anim-state":b},props:{...g.handlers,"data-neba-animation":d??n??void 0,"data-state":b},children:v?staggerChildren(l,x,p,{stagger:u,durationStep:c,reverse:m}):l}}
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import*as n from"react";import{observeVisibility as t}from"./observe.js";import{cx as a}from"./styles.js";export const animationClasses={fade:"neba-anim-fade",grow:"neba-anim-scale",slide:"neba-anim-slide",zoom:"neba-anim-scale",rotate:"neba-anim-rotate",blink:"neba-anim-blink",reveal:"neba-anim-reveal"};export const animBaseClass="neba-anim";export const childAnimations=":scope > .neba-anim";export const defaultDurations={fade:320,grow:340,slide:380,zoom:340,rotate:460,blink:900,reveal:620};export function revealClip(e){switch(e){case"top":return"inset(0 0 100% 0)";case"bottom":return"inset(100% 0 0 0)";case"right":return"inset(0 0 0 100%)";default:return"inset(0 100% 0 0)"}}export function lengthValue(e){return"number"==typeof e?`${e}px`:e}export function isInfinite(e){return"infinite"===e}export function animationSlots(e){const n={"--n-anim-duration":`${e.duration}ms`,"--n-anim-delay":`${e.delay}ms`,"--n-anim-repeat":(r=e.repeat,"infinite"===r?"infinite":String(r)),"--n-anim-direction":(t=e.mode??"in",a=e.alternate,"out"===t?a?"alternate-reverse":"reverse":a?"alternate":"normal")};var t,a,r;return e.easing&&(n["--n-anim-ease"]=e.easing),void 0!==e.opacity&&(n["--n-anim-opacity"]=String(e.opacity)),void 0!==e.scale&&(n["--n-anim-scale"]=String(e.scale)),void 0!==e.x&&(n["--n-anim-x"]=e.x),void 0!==e.y&&(n["--n-anim-y"]=e.y),void 0!==e.angle&&(n["--n-anim-angle"]=e.angle),void 0!==e.angleTo&&(n["--n-anim-angle-to"]=e.angleTo),void 0!==e.clip&&(n["--n-anim-clip"]=e.clip),"view"===e.timeline&&(n["--n-anim-timeline"]="view()",n["--n-anim-range"]=e.range??"entry 0% cover 45%"),n}export function slideOffsets(e,n){const t=lengthValue(n),a="number"==typeof n?-n+"px":`calc(-1 * ${t})`;switch(e){case"top":return{x:"0px",y:a};case"bottom":return{x:"0px",y:t};case"left":return{x:a,y:"0px"};default:return{x:t,y:"0px"}}}export function staggers({stagger:e,durationStep:n}){return 0!==e||0!==n}export function staggerChildren(t,r,i,{stagger:s,durationStep:o,reverse:l}){const c=n.Children.toArray(t);return c.map((t,u)=>{const m=l?c.length-1-u:u,f=animationSlots({...i,delay:i.delay+m*s,duration:Math.max(0,i.duration+m*o)});if(!n.isValidElement(t))return e("span",{className:r,style:f,children:t},u);const d=t.props;return n.cloneElement(t,{className:a(r,d.className),style:{...f,...d.style}})})}export const MIN_BLINK_DURATION=334;export function transitionProps(e){const n=transitionParts(e);return n?{className:`neba-anim ${animationClasses[n.effect]}`,style:{...animationSlots(n.slots),"--n-anim-state":"running"}}:{className:"",style:{}}}export function transitionParts(e){if(!e)return null;const n="string"==typeof e?{type:e}:e,{type:t}=n,a=n.duration??defaultDurations[t],r={duration:"blink"===t?Math.max(a,334):a,delay:n.delay??0,easing:n.easing,repeat:n.repeat??("blink"===t?"infinite":1),alternate:n.alternate,timeline:n.timeline,range:n.range};if("grow"!==t&&"zoom"!==t||(r.scale=n.scale??("zoom"===t?.4:.8)),"slide"===t){const{x:e,y:t}=slideOffsets(n.from??"bottom",n.distance??"100%");r.x=e,r.y=t}return"rotate"===t&&(r.angle=`${n.angle??-180}deg`),"reveal"===t&&(r.clip=revealClip(n.side??"left")),{effect:t,slots:r}}export{usePrefersReducedMotion}from"./media.js";export function useAnimationRun({trigger:e,play:a,once:r,threshold:i,paused:s,infinite:o,caller:l,parts:c}){const u=n.useRef(null),[m,f]=n.useState("mount"===e),[d,p]=n.useState(0),[g,y]=n.useState(!1),x=n.useCallback(()=>{f(!0),p(e=>e+1)},[]);n.useLayoutEffect(()=>{const e=u.current;if(!e||0===d)return;const n=[e,...c?e.querySelectorAll(c):[]];for(const e of n)e.style.animationName="none";e.offsetWidth;for(const e of n)e.style.animationName=""},[d,c]),n.useEffect(()=>{if("visible"!==e)return;const n=u.current;if(!n)return;let a=null;if(a=t(n,i,e=>{e?(x(),r&&(a?.(),a=null)):r||f(!1)}),a)return()=>a?.();f(!0)},[e,r,i,x]),n.useEffect(()=>{const e=u.current;if(o&&e)return t(e,0,e=>y(!e))??void 0},[o]),n.useEffect(()=>{"manual"===e&&(a?x():f(!1))},[e,a,x]);const v=e=>e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget),b="hover"===e?{onPointerEnter:e=>{l?.onPointerEnter?.(e),x()},onFocus:e=>{l?.onFocus?.(e),v(e)||x()},onPointerLeave:e=>{l?.onPointerLeave?.(e),o&&f(!1)},onBlur:e=>{l?.onBlur?.(e),o&&!v(e)&&f(!1)}}:{};return{ref:n.useCallback(e=>{u.current=e},[]),state:!m||s||o&&g?"paused":"running",started:m,handlers:b,offscreen:o&&g}}export function useAnimateElement(e){const{effect:n,trigger:t,play:a,once:r,threshold:i,paused:s,infinite:o,caller:l,children:c,stagger:u=0,durationStep:m=0,reverse:f=!1,effectClass:d,name:p,...g}=e,y=n?animationClasses[n]:d,x=y?`neba-anim ${y}`:"",v=""!==x&&staggers({stagger:u,durationStep:m,reverse:f}),b=useAnimationRun({trigger:t,play:a,once:r,threshold:i,paused:s,infinite:o,caller:l,parts:v?childAnimations:void 0}),h="view"===g.timeline?"running":b.state;return{ref:b.ref,className:v?"":x,style:v?{"--n-anim-state":h}:{...animationSlots(g),"--n-anim-state":h},props:{...b.handlers,"data-neba-animation":p??n??void 0,"data-state":h},children:v?staggerChildren(c,x,g,{stagger:u,durationStep:m,reverse:f}):c}}
@@ -83,6 +83,11 @@ export interface CalendarProps {
83
83
  renderDay?: (date: Date) => React.ReactNode;
84
84
  /** Takes the focus on mount — the popup has just opened. */
85
85
  autoFocus?: boolean;
86
+ /**
87
+ * More than one cell can be selected at once — a `multiple` calendar or a
88
+ * range — which a screen reader is told on the grid a pick is made in.
89
+ */
90
+ multiselectable?: boolean;
86
91
  showPreviousButton?: boolean;
87
92
  showNextButton?: boolean;
88
93
  labels: PickerLabels;
@@ -109,7 +114,7 @@ export interface CalendarProps {
109
114
  * grid instead of walking forty-two cells — the pattern the ARIA date-picker
110
115
  * practice describes, and the reason none of the cells is a `disabled` button.
111
116
  */
112
- export declare function Calendar({ size, color, locale, weekStartsOn, month, onMonthChange, selected, rangeStart, rangeEnd, onSelect, granularity, renderDay, onPreviewChange, minDate, maxDate, shouldDisableDate, showOutsideDays, autoFocus, showPreviousButton, showNextButton, labels, className }: CalendarProps): React.JSX.Element;
117
+ export declare function Calendar({ size, color, locale, weekStartsOn, month, onMonthChange, selected, rangeStart, rangeEnd, onSelect, granularity, renderDay, onPreviewChange, minDate, maxDate, shouldDisableDate, showOutsideDays, autoFocus, multiselectable, showPreviousButton, showNextButton, labels, className }: CalendarProps): React.JSX.Element;
113
118
  export type { TimeUnit };
114
119
  export interface TimeGridProps {
115
120
  size: NebaSize;