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 t,Fragment as n}from"react/jsx-runtime";import*as r from"react";import{breadcrumbMessages as a,useMessages as s}from"../../internal/i18n.js";import{ArrowRightIcon as l,ChevronIcon as i,EllipsisIcon as c}from"../../internal/icons.js";import{controlTextClasses as o,cx as m,gapClasses as d,hasContent as u,iconClasses as p,radiusClasses as f,transitionClasses as h}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const g=/*@__PURE__*/r.createContext({size:"md",last:!1}),b={default:{xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"},compact:{xs:"gap-0.5",sm:"gap-1",md:"gap-1",lg:"gap-1.5",xl:"gap-2"}},v={xs:f.xs,sm:f.xs,md:f.xs,lg:f.sm,xl:f.sm};const y=["chevron","arrow","slash","dot"];function N(e){return"string"==typeof e||"number"==typeof e?String(e):Array.isArray(e)?e.map(N).join(""):r.isValidElement(e)?N(e.props.children):""}function w(e,t){if(!t)return e;try{return new URL(e,t).href}catch{return e}}function j(e,t){const n=e.map((e,n)=>{const{href:r,children:a}=e.props;return{"@type":"ListItem",position:n+1,name:N(a),...r?{item:w(r,t)}:null}});return JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:n}).replace(/</g,"\\u003c")}export const Breadcrumb=/*@__PURE__*/r.forwardRef(function(n,d){const{size:u="md",color:f="primary",density:v="default",separator:N="chevron",maxItems:w,itemsBeforeCollapse:k=1,itemsAfterCollapse:C=1,expandable:I=!0,locale:L,label:_,expandLabel:z,structuredData:B=!1,baseUrl:A,className:M,style:S,children:E,...R}=x(n,["size","density","locale"]),$=s(a,L),[F,U]=r.useState(!1),V=r.Children.toArray(E).filter(r.isValidElement),D=V.length,H=V.some(e=>!0===e.props.current),J=!F&&void 0!==w&&D>Math.max(w,1)&&D-k-C>1?[...V.slice(0,Math.max(0,k)),null,...V.slice(D-Math.max(0,C))]:V,O="string"==typeof(P=N)&&y.includes(P)?function(t){switch(t){case"chevron":return e("span",{className:"flex -rotate-90 items-center rtl:rotate-90",children:e(i,{})});case"arrow":return e("span",{className:"flex items-center rtl:rotate-180",children:e(l,{})});case"slash":return e("span",{className:"opacity-70",children:"/"});case"dot":return e("span",{className:"opacity-70",children:"·"});default:return null}}(N):N;var P;const T=m("inline-flex items-center rounded-(--neba-radius-xs) px-0.5","text-(--neba-muted-fg)",h,p,I?m("cursor-pointer hover:bg-(--n-soft) hover:text-(--n-accent)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"):"");return t("nav",{ref:d,"aria-label":_??$.label,className:m("flex",o[u],p,M),style:{"--n-accent":`var(--neba-${f}-accent)`,"--n-soft":`var(--neba-${f}-soft)`,"--n-ring":`var(--neba-${f}-ring)`,...S},...R,children:[B&&D>0?e("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:j(V,A)}}):null,e("ol",{role:"list",className:m("flex list-none flex-wrap items-center p-0",b[v][u]),children:J.map((n,a)=>t(r.Fragment,{children:[a>0?e("li",{"aria-hidden":"true",className:"flex shrink-0 items-center text-(--neba-muted-fg) select-none",children:O}):null,n?e(g.Provider,{value:{size:u,last:!H&&a===J.length-1},children:n}):e("li",{className:"flex shrink-0 items-center",children:I?e("button",{type:"button",className:T,"aria-label":z??$.expand,onClick:()=>U(!0),children:e(c,{})}):e("span",{className:T,"aria-hidden":"true",children:e(c,{})})})]},n?n.key??a:"fold"))})]})});export const BreadcrumbItem=/*@__PURE__*/r.forwardRef(function({href:a,onClick:s,startIcon:l,endIcon:i,current:c,disabled:o=!1,className:p,children:f,...x},b){const{size:y,last:N}=r.useContext(g),w=c??N,j=Boolean(a||s)&&!w&&!o,k=m("inline-flex min-w-0 items-center px-1",d[y],v[y],h,o?"cursor-not-allowed text-(--neba-disabled-fg)":w?"font-medium text-(--neba-fg)":j?m("cursor-pointer text-(--neba-muted-fg)","hover:bg-(--n-soft) hover:text-(--n-accent)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"):"text-(--neba-muted-fg)"),C=t(n,{children:[u(l)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:l}):null,e("span",{className:"truncate",children:f}),u(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:i}):null]});return e("li",{ref:b,className:m("flex min-w-0 items-center",p),...x,children:j&&a?e("a",{href:a,className:k,onClick:s,children:C}):j?e("button",{type:"button",className:k,onClick:s,children:C}):e("span",{className:k,"aria-current":w?"page":void 0,"aria-disabled":o||void 0,children:C})})});
1
+ "use client";import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as n from"react";import{useRender as a}from"@base-ui/react/use-render";import{safeHref as s,safeRel as l}from"../../internal/link.js";import{breadcrumbMessages as i,useMessages as o}from"../../internal/i18n.js";import{ArrowRightIcon as c,ChevronIcon as m,EllipsisIcon as u}from"../../internal/icons.js";import{controlTextClasses as d,cx as p,gapClasses as f,hasContent as h,iconClasses as x,radiusClasses as g,transitionClasses as b}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const v=/*@__PURE__*/n.createContext({size:"md",last:!1}),N={default:{xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"},compact:{xs:"gap-0.5",sm:"gap-1",md:"gap-1",lg:"gap-1.5",xl:"gap-2"}},j={xs:g.xs,sm:g.xs,md:g.xs,lg:g.sm,xl:g.sm};const k=["chevron","arrow","slash","dot"];function w(e){return"string"==typeof e||"number"==typeof e?String(e):Array.isArray(e)?e.map(w).join(""):n.isValidElement(e)?w(e.props.children):""}function C(e,t){if(!t)return e;try{return new URL(e,t).href}catch{return e}}function B(e,t){const r=e.map((e,r)=>{const{children:n}=e.props,a=s(e.props.href);return{"@type":"ListItem",position:r+1,name:w(n),...a?{item:C(a,t)}:null}});return JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:r}).replace(/</g,"\\u003c")}export const Breadcrumb=/*@__PURE__*/n.forwardRef(function Breadcrumb(r,a){const{size:s="md",color:l="primary",density:f="default",separator:h="chevron",maxItems:g,itemsBeforeCollapse:j=1,itemsAfterCollapse:C=1,expandable:I=!0,locale:L,label:$,expandLabel:S,structuredData:_=!1,baseUrl:z,className:A,style:E,children:M,...R}=y(r,["size","density","locale"]),q=o(i,L),F=n.Children.toArray(M).filter(n.isValidElement),T=F.length,U=F.map(e=>`${e.key??""}\0${e.props.href??""}\0${w(e.props.children)}`).join(""),[V,D]=n.useState(null),H=V===U,J=n.useRef(null),O=n.useRef(!1);n.useLayoutEffect(()=>{if(!H||!O.current)return;O.current=!1;const e=J.current?.querySelectorAll(":scope > li:not([aria-hidden])")[Math.max(0,j)];e?.querySelector("a, button")?.focus()},[H,j]);const P=F.some(e=>!0===e.props.current),G=!H&&void 0!==g&&T>Math.max(g,1)&&T-j-C>1?[...F.slice(0,Math.max(0,j)),null,...F.slice(T-Math.max(0,C))]:F,K="string"==typeof(Q=h)&&k.includes(Q)?function(t){switch(t){case"chevron":return e("span",{className:"flex -rotate-90 items-center rtl:rotate-90",children:e(m,{})});case"arrow":return e("span",{className:"flex items-center rtl:rotate-180",children:e(c,{})});case"slash":return e("span",{className:"opacity-70",children:"/"});case"dot":return e("span",{className:"opacity-70",children:"·"});default:return null}}(h):h;var Q;const W=p("inline-flex items-center rounded-(--neba-radius-xs) px-0.5","text-(--neba-muted-fg)",b,x,I?p("cursor-pointer hover:bg-(--n-soft) hover:text-(--n-on-tint)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"):"");return t("nav",{ref:a,"aria-label":$??q.label,className:p("flex",d[s],x,A),style:{"--n-accent":`var(--neba-${l}-accent)`,"--n-on-tint":`var(--neba-${l}-on-tint)`,"--n-soft":`var(--neba-${l}-soft)`,"--n-ring":`var(--neba-${l}-ring)`,...E},...R,children:[_&&T>0?e("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:B(F,z)}}):null,e("ol",{ref:J,role:"list",className:p("flex list-none flex-wrap items-center p-0",N[f][s]),children:G.map((r,a)=>t(n.Fragment,{children:[a>0?e("li",{"aria-hidden":"true",className:"flex shrink-0 items-center text-(--neba-muted-fg) select-none",children:K}):null,r?e(v.Provider,{value:{size:s,last:!P&&a===G.length-1},children:r}):e("li",{className:"flex shrink-0 items-center",children:I?e("button",{type:"button",className:W,"aria-label":S??q.expand,onClick:e=>{O.current=e.currentTarget===document.activeElement,D(U)},children:e(u,{})}):e("span",{className:W,"aria-hidden":"true",children:e(u,{})})})]},r?r.key??a:"fold"))})]})});export const BreadcrumbItem=/*@__PURE__*/n.forwardRef(function BreadcrumbItem({href:i,onClick:o,render:c,target:m,startIcon:u,endIcon:d,current:x,disabled:g=!1,className:y,children:N,...k},w){const{size:C,last:B}=n.useContext(v),I=s(i),L=x??B,$=Boolean(I||o||c)&&!L&&!g,S=$&&Boolean(I||c),_=p("inline-flex min-w-0 items-center px-1",f[C],j[C],b,g?"cursor-not-allowed text-(--neba-disabled-fg)":L?"font-medium text-(--neba-fg)":$?p("cursor-pointer text-(--neba-muted-fg)","hover:bg-(--n-soft) hover:text-(--n-on-tint)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"):"text-(--neba-muted-fg)"),z=t(r,{children:[h(u)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:u}):null,e("span",{className:"truncate",children:N}),h(d)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:d}):null]}),A=a({render:c??e("a",{}),props:{href:I,target:m,rel:l(m,void 0),className:_,onClick:o,children:z}});return e("li",{ref:w,className:p("flex min-w-0 items-center",y),...k,children:S?A:$?e("button",{type:"button",className:_,onClick:o,children:z}):e("span",{className:_,"aria-current":L?"page":void 0,"aria-disabled":g||void 0,children:z})})});
@@ -19,6 +19,17 @@ export interface ButtonProps extends NebaStyleProps, Omit<React.ComponentPropsWi
19
19
  loading?: boolean;
20
20
  /** Inert but not dimmed — the action exists, it just is not available here. */
21
21
  readOnly?: boolean;
22
+ /**
23
+ * Keeps a disabled button in the tab order, announced with `aria-disabled`
24
+ * rather than the `disabled` attribute, and still unable to be pressed.
25
+ *
26
+ * For a button that becomes disabled *because* it was pressed — the Next that
27
+ * reaches the last page — where the `disabled` attribute would drop the focus
28
+ * onto the page in the middle of a keyboard reader's work. Ignored when
29
+ * `render` draws something other than a `<button>`.
30
+ * @default false
31
+ */
32
+ focusableWhenDisabled?: boolean;
22
33
  /** Stretches to the width of the container. */
23
34
  fullWidth?: boolean;
24
35
  /**
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as n,jsxs as o}from"react/jsx-runtime";import*as t from"react";import{Button as r}from"@base-ui/react/button";import{useRender as a}from"@base-ui/react/use-render";import{ButtonGroupContext as l}from"../../internal/button-group.js";import{SpinnerIcon as s}from"../../internal/icons.js";import{controlHeightClasses as i,controlSlots as d,controlSquareClasses as v,controlTextClasses as c,cx as p,disabledClasses as x,focusRingClasses as b,gapClasses as m,iconClasses as u,paddingXClasses as f,pressTransitionClasses as g,radiusClasses as h,readOnlyFilterClasses as $,surfaceClasses as j,transitionClasses as y}from"../../internal/styles.js";import{useStyleDefaults as w}from"../../internal/defaults.js";const P={xs:`${i.xs} ${m.xs} ${h.xs} ${c.xs}`,sm:`${i.sm} ${m.sm} ${h.sm} ${c.sm}`,md:`${i.md} ${m.md} ${h.md} ${c.md}`,lg:`${i.lg} ${m.lg} ${h.lg} ${c.lg}`,xl:`${i.xl} ${m.xl} ${h.xl} ${c.xl}`},k={xs:`${v.xs} px-0`,sm:`${v.sm} px-0`,md:`${v.md} px-0`,lg:`${v.lg} px-0`,xl:`${v.xl} px-0`},z=["relative inline-flex shrink-0 select-none items-center justify-center","whitespace-nowrap align-middle font-medium leading-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",y,g,b,u].join(" "),C={solid:[j,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[j,"border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-accent) bg-transparent"},B={solid:["hover:bg-(--n-fill-hover)","hover:[box-shadow:var(--n-elev-hover),var(--neba-plate-solid)]","active:bg-(--n-fill-active)","active:[box-shadow:var(--n-elev-press),var(--neba-plate-solid)]"].join(" "),outline:["hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","hover:[box-shadow:var(--n-elev-hover),var(--neba-plate-glass)]","active:bg-(--n-panel-press)","active:[box-shadow:var(--n-elev-press),var(--neba-plate-glass)]"].join(" "),text:"hover:bg-(--n-soft) active:bg-(--n-soft-hover)"},E={solid:[j,$,"cursor-default text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--neba-plate-solid)]"].join(" "),outline:[j,$,"cursor-default border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)] [box-shadow:var(--neba-plate-glass)]"].join(" "),text:`${$} cursor-default text-(--n-accent) bg-transparent`};export const Button=/*@__PURE__*/t.forwardRef(function(i,v){const{variant:c,size:b,color:m,density:u,elevation:g,startIcon:h,endIcon:$,loading:j=!1,readOnly:y=!1,fullWidth:I=!1,disabled:M,render:N,className:D,style:F,children:O,onClick:R,onPointerMove:T,...W}=w(i,["size","density","variant"]),X=t.useContext(l),Y=c??X?.variant??"solid",q=b??X?.size??"md",A=m??X?.color??"primary",G=u??X?.density??"default",H=g??X?.elevation??0,J=M??X?.disabled??!1,K=j||y,L=p(z,P[q],null==O||!1===O?k[q]:f[G][q],J?x[Y]:y?E[Y]:C[Y],J||K?"":[B[Y],"neba-glow","cursor-pointer"].join(" "),j?"cursor-progress":"",I?"w-full":"",D??"");return a({render:N??e(r,{disabled:J}),ref:v,props:{className:L,style:{...d(A,H,Y),...F},"aria-disabled":K||void 0,"aria-busy":j||void 0,"data-loading":j||void 0,"data-readonly":y||void 0,onClick:e=>{if(K)return e.preventDefault(),void e.stopPropagation();R?.(e)},onPointerMove:e=>{if(!J&&!K){const n=e.currentTarget;n.style.setProperty("--n-mx",`${e.nativeEvent.offsetX}px`),n.style.setProperty("--n-my",`${e.nativeEvent.offsetY}px`)}T?.(e)},...W,children:o(n,{children:[j?e(s,{}):h,O,$]})}})});
1
+ "use client";import{jsx as e,Fragment as o,jsxs as n}from"react/jsx-runtime";import*as r from"react";import{Button as t}from"@base-ui/react/button";import{useRender as a}from"@base-ui/react/use-render";import{trackPointer as l}from"../../internal/glow.js";import{ButtonGroupContext as s}from"../../internal/button-group.js";import{SpinnerIcon as i}from"../../internal/icons.js";import{controlHeightClasses as d,controlSlots as v,controlSquareClasses as b,controlTextClasses as p,cx as c,disabledClasses as m,focusRingClasses as x,gapClasses as u,iconClasses as g,paddingXClasses as f,pressTransitionClasses as h,radiusClasses as $,readOnlyFilterClasses as j,surfaceClasses as w,transitionClasses as y}from"../../internal/styles.js";import{useStyleDefaults as k}from"../../internal/defaults.js";const z={xs:`${d.xs} ${u.xs} ${$.xs} ${p.xs}`,sm:`${d.sm} ${u.sm} ${$.sm} ${p.sm}`,md:`${d.md} ${u.md} ${$.md} ${p.md}`,lg:`${d.lg} ${u.lg} ${$.lg} ${p.lg}`,xl:`${d.xl} ${u.xl} ${$.xl} ${p.xl}`},B={xs:`${b.xs} px-0`,sm:`${b.sm} px-0`,md:`${b.md} px-0`,lg:`${b.lg} px-0`,xl:`${b.xl} px-0`},C=["relative inline-flex shrink-0 select-none items-center justify-center","whitespace-nowrap align-middle font-medium leading-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",y,h,x,g].join(" "),D={solid:[w,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[w,"border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-on-tint) bg-transparent"},P={solid:["hover:bg-(--n-fill-hover)","hover:[box-shadow:var(--n-elev-hover),var(--neba-plate-solid)]","active:bg-(--n-fill-active)","active:[box-shadow:var(--n-elev-press),var(--neba-plate-solid)]"].join(" "),outline:["hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","hover:[box-shadow:var(--n-elev-hover),var(--neba-plate-glass)]","active:bg-(--n-panel-press)","active:[box-shadow:var(--n-elev-press),var(--neba-plate-glass)]"].join(" "),text:"hover:bg-(--n-soft) active:bg-(--n-soft-hover)"},W={solid:[w,j,"cursor-default text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--neba-plate-solid)]"].join(" "),outline:[w,j,"cursor-default border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)] [box-shadow:var(--neba-plate-glass)]"].join(" "),text:`${j} cursor-default text-(--n-on-tint) bg-transparent`};export const Button=/*@__PURE__*/r.forwardRef(function Button(d,b){const p=r.useContext(s),{variant:x,size:u,color:g,density:h,elevation:$,startIcon:j,endIcon:w,loading:y=!1,readOnly:I=!1,fullWidth:M=!1,disabled:N,focusableWhenDisabled:F=!1,render:O,className:R,style:q,children:A,onClick:E,onPointerMove:G,...H}=k(d,["size","density","variant"],p),J=x??p?.variant??"solid",K=u??p?.size??"md",L=g??p?.color??"primary",Q=h??p?.density??"default",S=$??p?.elevation??0,T=N??p?.disabled??!1,U=y||I,V=c(C,z[K],null==A||!1===A?B[K]:f[Q][K],T?m[J]:I?W[J]:D[J],T||U?"":[P[J],"neba-glow","cursor-pointer"].join(" "),y?"cursor-progress":"",M?"w-full":"",R??"");return a({render:O??e(t,{disabled:T,focusableWhenDisabled:F}),ref:b,props:{className:V,style:{...v(L,S,J),...q},...U?{"aria-disabled":!0}:null,"aria-busy":y||void 0,"data-loading":y||void 0,"data-readonly":I||void 0,onClick:e=>{if(U)return e.preventDefault(),void e.stopPropagation();E?.(e)},onPointerMove:l(G,!T&&!U),...H,children:n(o,{children:[y?e(i,{}):j,A,w]})}})});
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import*as i from"react";import{ButtonGroupContext as o}from"../../internal/button-group.js";import{cx as t}from"../../internal/styles.js";import{useStyleDefaults as n}from"../../internal/defaults.js";const r={horizontal:"[&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none",vertical:"[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none"},l={horizontal:"[&>*:not(:first-child)]:-ms-px",vertical:"[&>*:not(:first-child)]:-mt-px"},s=["inline-flex align-middle","[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10","[&>*]:shrink-0"].join(" ");export const ButtonGroup=/*@__PURE__*/i.forwardRef(function(a,d){const{variant:c,size:f,color:u,density:m,elevation:h,orientation:v="horizontal",disabled:p,fullWidth:x=!1,className:z,children:j,...b}=n(a,["size","density","variant"]),y=i.useMemo(()=>({variant:c,size:f,color:u,density:m,elevation:h,disabled:p}),[c,f,u,m,h,p]);return e(o.Provider,{value:y,children:e("div",{ref:d,role:"group",className:t(s,"vertical"===v?"flex-col":"flex-row",r[v],"outline"===(c??"solid")?l[v]:"",x?"flex w-full [&>*]:flex-1":"",z??""),...b,children:j})})});
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import*as o from"react";import{ButtonGroupContext as i}from"../../internal/button-group.js";import{cx as t}from"../../internal/styles.js";import{useStyleDefaults as n}from"../../internal/defaults.js";const r={horizontal:"[&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none",vertical:"[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none"},l={horizontal:"[&>*:not(:first-child)]:-ms-px",vertical:"[&>*:not(:first-child)]:-mt-px"},s=["align-middle","[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10","[&>*]:shrink-0"].join(" ");export const ButtonGroup=/*@__PURE__*/o.forwardRef(function ButtonGroup(a,d){const{variant:c,size:f,color:u,density:m,elevation:h,orientation:v="horizontal",disabled:p,fullWidth:x=!1,className:z,children:j,...b}=n(a,["size","density","variant"]),y=o.useMemo(()=>({variant:c,size:f,color:u,density:m,elevation:h,disabled:p}),[c,f,u,m,h,p]);return e(i.Provider,{value:y,children:e("div",{ref:d,role:"group",className:t(s,"vertical"===v?"flex-col":"flex-row",r[v],"outline"===(c??"solid")?l[v]:"",x?"flex w-full [&>*]:flex-1":"inline-flex",z??""),...b,children:j})})});
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{Calendar as n,usePickerLabels as r}from"../../internal/calendar.js";import{compareDay as a,isSameDay as l,isValidDate as s,localeWeekStart as o,startOfMonth as i,startOfUnit as d,today as u}from"../../internal/date.js";import{cx as m,radiusClasses as c,surfaceSlots as f}from"../../internal/styles.js";import{useStyleDefaults as g}from"../../internal/defaults.js";const h={single:null,multiple:[],range:{start:null,end:null}};function p(e,t){if("multiple"===e)return t??[];if("range"===e){const e=t??h.range;return[e.start,e.end]}return[t]}export const Calendar=/*@__PURE__*/t.forwardRef(function(D,y){const{mode:v="single",value:b,defaultValue:j,onValueChange:S,size:w="md",color:x="primary",elevation:C=0,bordered:O=!0,month:k,defaultMonth:z,onMonthChange:M,granularity:N="day",minDate:V,maxDate:E,shouldDisableDate:R,locale:q,weekStartsOn:A,showOutsideDays:B=!0,renderDay:F,labels:G,className:H,style:I,...J}=g(D,["size","locale"]),K=r(G,q),L=A??o(q),[P,Q]=t.useState(()=>j??h[v]),T=void 0!==b?b:P,U=p(v,T).find(s),[W,X]=t.useState(()=>i(U??z??u())),Y=k??W,Z=e=>{void 0===b&&Q(e),S?.(e)},$="range"===v?T??h.range:h.range;return e("div",{ref:y,className:m("inline-block",O&&"border p-3 [border-color:var(--n-line)] bg-(--n-panel-press)",O&&c[w],H),style:{...f(x,C),...I},...J,children:e(n,{size:w,color:x,locale:q,weekStartsOn:L,month:Y,onMonthChange:e=>{void 0===k&&X(e),M?.(e)},selected:p(v,T),rangeStart:$.start,rangeEnd:$.end,onSelect:e=>{const t=d(e,N);if("multiple"===v){const e=T??[],n=e.filter(e=>!l(e,t));return void Z(n.length===e.length?[...e,t]:n)}if("range"===v){const e=T??h.range;return!s(e.start)||s(e.end)?void Z({start:t,end:null}):void Z(a(t,e.start)<0?{start:t,end:null}:{start:e.start,end:t})}Z(t)},granularity:N,minDate:V,maxDate:E,shouldDisableDate:R,showOutsideDays:B,renderDay:F,labels:K})})});
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import*as a from"react";import{Calendar as t,usePickerLabels as n}from"../../internal/calendar.js";import{compareDay as r,isSameDay as l,isValidDate as s,localeWeekStart as o,startOfMonth as i,startOfUnit as d,today as u}from"../../internal/date.js";import{popupPaddingClasses as m}from"../../internal/picker.js";import{cx as c,radiusClasses as g,surfaceClasses as f,surfaceSlots as h}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const v={single:null,multiple:[],range:{start:null,end:null}};function b(e,a){if("multiple"===e)return a??[];if("range"===e){const e=a??v.range;return[e.start,e.end]}return[a]}export const Calendar=/*@__PURE__*/a.forwardRef(function Calendar(D,y){const{mode:j="single",value:w,defaultValue:x,onValueChange:C,size:S="md",color:k="primary",elevation:O=0,bordered:z=!0,month:M,defaultMonth:N,onMonthChange:V,granularity:E="day",minDate:R,maxDate:q,shouldDisableDate:A,locale:B,weekStartsOn:F,showOutsideDays:G=!0,renderDay:H,labels:I,className:J,style:K,...L}=p(D,["size","locale"]),P=n(I,B),Q=F??o(B),[T,U]=a.useState(()=>x??v[j]),W=void 0!==w?w:T,X=b(j,W).find(s),[Y,Z]=a.useState(()=>i(X??N??u())),$=M??Y,_=e=>{void 0===w&&U(e),C?.(e)},ee="range"===j?W??v.range:v.range;return e("div",{ref:y,className:c("inline-block",z?c(f,"border bg-(--n-panel-press) [border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]",g[S],m[S]):"[box-shadow:var(--n-elev)]",J),style:{...h(k,O),...K},...L,children:e(t,{size:S,color:k,locale:B,weekStartsOn:Q,month:$,onMonthChange:e=>{void 0===M&&Z(e),V?.(e)},selected:b(j,W),rangeStart:ee.start,rangeEnd:ee.end,onSelect:e=>{const a=d(e,E);if("multiple"===j){const e=W??[],t=e.filter(e=>!l(e,a));return void _(t.length===e.length?[...e,a]:t)}if("range"===j){const e=W??v.range;return!s(e.start)||s(e.end)?void _({start:a,end:null}):void _(r(a,e.start)<0?{start:a,end:null}:{start:e.start,end:a})}_(a)},granularity:E,minDate:R,maxDate:q,shouldDisableDate:A,showOutsideDays:G,renderDay:H,multiselectable:"single"!==j,labels:P})})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import*as s from"react";import{Box as n,boxPaddingXClasses as a,boxPaddingYClasses as r}from"../box/Box.js";import{cx as i,hasContent as o,metaTextClasses as c,sheetBodyClasses as d,sheetHeaderGapClasses as m,sheetSectionGapClasses as f,sheetTitleClasses as u}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";export const Card=/*@__PURE__*/s.forwardRef(function(s,h){const{size:p="md",density:N="default",title:y,subtitle:$,headerAction:b,footer:v,dividers:j=!1,className:k,children:g,...w}=x(s,["size","density"]),z=a[N][p],A=r[N][p],B=j?`${z} ${A}`:z,C=o(y)||o($)||o(b),F=l(t,{children:[o(y)||o($)?l("div",{className:`flex min-w-0 flex-1 flex-col ${m[p]}`,children:[o(y)?e("div",{className:`neba-title font-semibold ${u[p]}`,children:y}):null,o($)?e("div",{className:`text-(--neba-muted-fg) ${c[p]}`,children:$}):null]}):null,o(b)?e("div",{className:"ml-auto shrink-0",children:b}):null]}),R=[C?{key:"header",className:"flex items-start gap-3",content:F}:null,o(g)?{key:"content",className:d[p],content:g}:null,o(v)?{key:"footer",className:`flex flex-wrap items-center gap-2 ${d[p]}`,content:v}:null].filter(e=>null!==e);return e(n,{ref:h,size:p,density:N,padded:!1,className:i("flex flex-col",j?"":`${A} ${f[p]}`,k??""),...w,children:R.map((l,t)=>e("div",{className:i(B,l.className,j&&t>0?"border-t [border-color:var(--n-line)]":""),children:l.content},l.key))})});
1
+ "use client";import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import*as s from"react";import{Box as n,boxPaddingXClasses as a,boxPaddingYClasses as r}from"../box/Box.js";import{cx as i,hasContent as o,metaTextClasses as c,sheetBodyClasses as d,sheetHeaderGapClasses as m,sheetSectionGapClasses as f,sheetTitleClasses as u}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";export const Card=/*@__PURE__*/s.forwardRef(function Card(s,h){const{size:p="md",density:N="default",title:y,subtitle:$,headerAction:b,footer:v,dividers:j=!1,className:k,children:g,...w}=x(s,["size","density"]),z=a[N][p],C=r[N][p],A=j?`${z} ${C}`:z,B=o(y)||o($)||o(b),F=l(t,{children:[o(y)||o($)?l("div",{className:`flex min-w-0 flex-1 flex-col ${m[p]}`,children:[o(y)?e("div",{className:`neba-title font-semibold ${u[p]}`,children:y}):null,o($)?e("div",{className:`text-(--neba-muted-fg) ${c[p]}`,children:$}):null]}):null,o(b)?e("div",{className:"ml-auto shrink-0",children:b}):null]}),R=[B?{key:"header",className:"flex items-start gap-3",content:F}:null,o(g)?{key:"content",className:d[p],content:g}:null,o(v)?{key:"footer",className:`flex flex-wrap items-center gap-2 ${d[p]}`,content:v}:null].filter(e=>null!==e);return e(n,{ref:h,size:p,density:N,padded:!1,className:i("flex flex-col",j?"":`${C} ${f[p]}`,k??""),...w,children:R.map((l,t)=>e("div",{className:i(A,l.className,j&&t>0?"border-t [border-color:var(--n-line)]":""),children:l.content},l.key))})});
@@ -84,6 +84,10 @@ export interface CarouselProps extends NebaStyleProps, Omit<React.ComponentProps
84
84
  * for reduced motion gets an instant cut from the same code path rather than
85
85
  * from a second one written to remember them.
86
86
  *
87
+ * The same choice is what the component leaves out. A fade cannot be drawn
88
+ * over a scroll offset, a vertical strip is what a scrolling list already is,
89
+ * and several slides in view at once is a ScrollZone.
90
+ *
87
91
  * Slides are not a sub-component. Every top-level child is wrapped in its own
88
92
  * slide, so `<Carousel><img /><img /></Carousel>` is the whole API — and the
89
93
  * wrapper is what carries the snap point, the width and the
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{IconButton as n}from"../icon-button/IconButton.js";import{carouselMessages as a,fillMessage as l,useMessages as i}from"../../internal/i18n.js";import{ChevronIcon as o,PauseIcon as s,PlayIcon as c}from"../../internal/icons.js";import{usePrefersReducedMotion as u}from"../../internal/media.js";import{cx as d,radiusClasses as f,srOnlyClasses as m,surfaceClasses as p,surfaceSlots as b,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";const g={solid:[p,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[p,"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"},x={xs:"start-1 end-1",sm:"start-1.5 end-1.5",md:"start-2 end-2",lg:"start-3 end-3",xl:"start-4 end-4"},w={xs:{rest:"h-1 w-1",current:"h-1 w-3",gap:"gap-1"},sm:{rest:"h-1 w-1",current:"h-1 w-3.5",gap:"gap-1"},md:{rest:"h-1.5 w-1.5",current:"h-1.5 w-4",gap:"gap-1.5"},lg:{rest:"h-1.5 w-1.5",current:"h-1.5 w-5",gap:"gap-2"},xl:{rest:"h-2 w-2",current:"h-2 w-6",gap:"gap-2"}};export const Carousel=/*@__PURE__*/r.forwardRef(function(p,y){const{variant:N="outline",size:j="md",color:k="primary",density:C="default",elevation:L=0,value:M,defaultValue:R=0,onValueChange:S,loop:_=!0,autoPlay:z=!1,interval:I=5e3,arrows:$=!0,indicators:E=!0,locale:P,label:V,previousLabel:B,nextLabel:T,pauseLabel:W,playLabel:A,slideLabel:F,className:q,style:D,children:G,...H}=h(p,["size","density","variant","locale"]),J=i(a,P),K=F??((e,t)=>l(J.slide,{index:String(e),total:String(t)})),O=r.Children.toArray(G),Q=O.length,[U,X]=r.useState(R),Y=Math.min(Math.max(M??U,0),Math.max(Q-1,0)),Z=r.useRef(null),ee=r.useRef([]),te=r.useRef(!1),re=r.useRef(!1),ne=r.useRef(!1),[ae,le]=r.useState(!1),[ie,oe]=r.useState(!1),se=r.useCallback((e,t=!1)=>{if(0===Q)return;const r=_?(e%Q+Q)%Q:Math.min(Math.max(e,0),Q-1);te.current=t,void 0===M&&X(r),r!==Y&&S?.(r)},[Q,_,M,Y,S]);r.useEffect(()=>{if(te.current)return void(te.current=!1);if(!re.current)return void(re.current=!0);ee.current[Y]?.scrollIntoView({block:"nearest",inline:"start"}),ne.current=!0;const e=window.setTimeout(()=>{ne.current=!1},700);return()=>window.clearTimeout(e)},[Y]);const ce=u();r.useEffect(()=>{if(!z||ie||ae||ce||Q<2)return;const e=window.setInterval(()=>{document.hidden||se(Y+1)},I);return()=>window.clearInterval(e)},[z,ie,ae,ce,Q,I,Y,se]);const ue=Y<=0,de=Y>=Q-1,fe=z&&!ce&&Q>1,me=E&&Q>1;return t("div",{ref:y,role:"region","aria-roledescription":"carousel","aria-label":V??J.label,className:d("flex flex-col",q??""),style:{...b(k,L),...D},onPointerEnter:()=>le(!0),onPointerLeave:()=>le(!1),onFocus:()=>le(!0),onBlur:()=>le(!1),...H,children:[t("div",{className:["relative min-w-0 overflow-hidden",f[j],g[N],v].join(" "),children:[e("div",{ref:Z,tabIndex:0,role:"group","aria-label":V??J.label,className:["flex min-w-0 snap-x snap-mandatory overflow-x-auto scroll-smooth","motion-reduce:scroll-auto","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"].join(" "),onScroll:()=>{const e=Z.current;if(ne.current||!e||0===e.clientWidth)return;const t=Math.round(Math.abs(e.scrollLeft)/e.clientWidth);t!==Y&&t>=0&&t<Q&&se(t,!0)},children:O.map((t,r)=>e("div",{ref:e=>{ee.current[r]=e},role:"group","aria-roledescription":"slide","aria-label":K(r+1,Q),className:"w-full shrink-0 grow-0 basis-full snap-start",children:t},r))}),$&&Q>1?t("div",{className:`pointer-events-none absolute inset-y-0 flex items-center ${x[j]}`,children:[e(n,{variant:"solid",size:j,color:k,density:C,elevation:1,label:B??J.previous,disabled:!_&&ue,className:"pointer-events-auto",icon:e("span",{className:"flex items-center rotate-90 rtl:-rotate-90",children:e(o,{})}),onClick:()=>se(Y-1)}),e("span",{className:"flex-1"}),e(n,{variant:"solid",size:j,color:k,density:C,elevation:1,label:T??J.next,disabled:!_&&de,className:"pointer-events-auto",icon:e("span",{className:"flex items-center -rotate-90 rtl:rotate-90",children:e(o,{})}),onClick:()=>se(Y+1)})]}):null]}),fe||me?t("div",{className:"grid shrink-0 grid-cols-[1fr_auto_1fr] items-center pt-2",children:[e("span",{className:"flex justify-start",children:fe?e(n,{variant:"text",size:j,color:k,density:C,label:ie?A??J.play:W??J.pause,icon:e(ie?c:s,{}),onClick:()=>oe(e=>!e)}):null}),e("span",{className:`flex items-center ${w[j].gap}`,children:me?O.map((t,r)=>e("button",{type:"button","aria-label":K(r+1,Q),"aria-current":r===Y?"true":void 0,className:["cursor-pointer rounded-full","[transition-property:width,background-color]","[transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2",r===Y?`${w[j].current} bg-(--n-accent)`:`${w[j].rest} bg-(--n-line-hover) hover:bg-(--n-accent)`].join(" "),onClick:()=>se(r)},r)):null}),e("span",{})]}):null,e("span",{className:m,"aria-live":fe&&!ie?"off":"polite",children:Q>0?K(Y+1,Q):""})]})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{IconButton as n}from"../icon-button/IconButton.js";import{childKey as a}from"../../internal/children.js";import{carouselMessages as l,fillMessage as o,useMessages as i}from"../../internal/i18n.js";import{ChevronIcon as s,PauseIcon as c,PlayIcon as u}from"../../internal/icons.js";import{usePrefersReducedMotion as d}from"../../internal/media.js";import{cx as m,radiusClasses as f,srOnlyClasses as p,surfaceClasses as b,surfaceSlots as h,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as g}from"../../internal/defaults.js";const x={solid:[b,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[b,"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"},w={xs:"start-1 end-1",sm:"start-1.5 end-1.5",md:"start-2 end-2",lg:"start-3 end-3",xl:"start-4 end-4"},y={xs:{rest:"h-1 w-1",current:"h-1 w-3",gap:"gap-1"},sm:{rest:"h-1 w-1",current:"h-1 w-3.5",gap:"gap-1"},md:{rest:"h-1.5 w-1.5",current:"h-1.5 w-4",gap:"gap-1.5"},lg:{rest:"h-1.5 w-1.5",current:"h-1.5 w-5",gap:"gap-2"},xl:{rest:"h-2 w-2",current:"h-2 w-6",gap:"gap-2"}},j={xs:"0.25rem",sm:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.5rem"};export const Carousel=/*@__PURE__*/r.forwardRef(function Carousel(b,N){const{variant:C="outline",size:k="md",color:L="primary",density:S="default",elevation:M=0,value:_,defaultValue:z=0,onValueChange:P,loop:R=!0,autoPlay:T=!1,interval:W=5e3,arrows:E=!0,indicators:I=!0,locale:$,label:B,previousLabel:D,nextLabel:F,pauseLabel:V,playLabel:A,slideLabel:q,className:G,style:H,children:J,onPointerEnter:K,onPointerLeave:O,onFocus:Q,onBlur:U,...X}=g(b,["size","density","variant","locale"]),Y=i(l,$),Z=q??((e,t)=>o(Y.slide,{index:String(e),total:String(t)})),ee=r.Children.toArray(J),te=ee.length,[re,ne]=r.useState(z),ae=Math.min(Math.max(_??re,0),Math.max(te-1,0)),le=r.useRef(null),oe=r.useRef(!1),ie=r.useRef(!1),se=r.useRef(!1),[ce,ue]=r.useState(!1),[de,me]=r.useState(!1),fe=ce||de,[pe,be]=r.useState(!1),he=r.useCallback((e,t=!1)=>{if(0===te)return;const r=R?(e%te+te)%te:Math.min(Math.max(e,0),te-1);oe.current=t,void 0===_&&ne(r),r!==ae&&P?.(r)},[te,R,_,ae,P]);r.useEffect(()=>{if(oe.current)return void(oe.current=!1);const e=!ie.current;if(ie.current=!0,e&&0===ae)return;const t=le.current;if(t){const r="rtl"===getComputedStyle(t).direction?-1:1;t.scrollTo({left:r*ae*t.clientWidth,...e?{behavior:"instant"}:null})}se.current=!0;const r=window.setTimeout(()=>{se.current=!1},700);return()=>window.clearTimeout(r)},[ae]);const ve=d();r.useEffect(()=>{if(!T||pe||fe||ve||te<2)return;const e=window.setInterval(()=>{document.hidden||he(ae+1)},W);return()=>window.clearInterval(e)},[T,pe,fe,ve,te,W,ae,he]);const ge=ae<=0,xe=ae>=te-1,we=T&&!ve&&te>1,ye=I&&te>1;return t("div",{ref:N,role:"region","aria-roledescription":"carousel","aria-label":B??Y.label,className:m("flex flex-col",G??""),style:{...h(L,M),...H},onPointerEnter:e=>{ue(!0),K?.(e)},onPointerLeave:e=>{ue(!1),O?.(e)},onFocus:e=>{me(!0),Q?.(e)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||me(!1),U?.(e)},...X,children:[t("div",{className:["relative min-w-0 overflow-hidden",f[k],x[C],v].join(" "),children:[e("div",{ref:le,tabIndex:0,role:"group","aria-label":B??Y.label,className:["flex min-w-0 snap-x snap-mandatory overflow-x-auto scroll-smooth","motion-reduce:scroll-auto","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"].join(" "),onScroll:()=>{const e=le.current;if(se.current||!e||0===e.clientWidth)return;const t=Math.round(Math.abs(e.scrollLeft)/e.clientWidth);t!==ae&&t>=0&&t<te&&he(t,!0)},children:ee.map((t,r)=>e("div",{role:"group","aria-roledescription":"slide","aria-label":Z(r+1,te),className:"w-full shrink-0 grow-0 basis-full snap-start",children:t},a(t,r)))}),E&&te>1?t("div",{className:`pointer-events-none absolute inset-y-0 flex items-center ${w[k]}`,children:[e(n,{variant:"solid",size:k,color:L,density:S,elevation:1,label:D??Y.previous,disabled:!R&&ge,focusableWhenDisabled:!0,className:"pointer-events-auto",icon:e("span",{className:"flex items-center rotate-90 rtl:-rotate-90",children:e(s,{})}),onClick:()=>he(ae-1)}),e("span",{className:"flex-1"}),e(n,{variant:"solid",size:k,color:L,density:S,elevation:1,label:F??Y.next,disabled:!R&&xe,focusableWhenDisabled:!0,className:"pointer-events-auto",icon:e("span",{className:"flex items-center -rotate-90 rtl:rotate-90",children:e(s,{})}),onClick:()=>he(ae+1)})]}):null]}),we||ye?t("div",{className:"grid shrink-0 grid-cols-[1fr_auto_1fr] items-center pt-2",children:[e("span",{className:"flex justify-start",children:we?e(n,{variant:"text",size:k,color:L,density:S,label:pe?A??Y.play:V??Y.pause,icon:e(pe?u:c,{}),onClick:()=>be(e=>!e)}):null}),e("span",{className:`flex items-center ${y[k].gap}`,style:{"--n-hit-gap":j[k]},children:ye?ee.map((t,r)=>e("button",{type:"button","aria-label":Z(r+1,te),"aria-current":r===ae?"true":void 0,className:["neba-hit-row relative cursor-pointer rounded-full","[transition-property:width,background-color]","[transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2",r===ae?`${y[k].current} bg-(--n-accent)`:`${y[k].rest} bg-(--n-line-hover) hover:bg-(--n-accent)`].join(" "),onClick:()=>he(r)},r)):null}),e("span",{})]}):null,e("span",{className:p,"aria-live":!we||pe||fe?"polite":"off",children:te>0?Z(ae+1,te):""})]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as a from"react";import{chatMessages as l,useMessages as r}from"../../internal/i18n.js";import{CheckIcon as i,ClockIcon as t,DangerIcon as s,LinkIcon as o}from"../../internal/icons.js";import{safeRel as d}from"../../internal/link.js";import{controlSlots as c,cx as m,hasContent as p,metaTextClasses as u,radiusClasses as b,sheetBodyClasses as f,sheetHeaderGapClasses as v,srOnlyClasses as x,surfaceClasses as h,transitionClasses as g}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const w={default:{xs:"px-2 py-1",sm:"px-2.5 py-1.5",md:"px-3 py-2",lg:"px-3.5 py-2.5",xl:"px-4 py-3"},compact:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-1.5",xl:"px-3.5 py-2"}},k={start:"[border-start-start-radius:0.25rem]",end:"[border-start-end-radius:0.25rem]"},N={solid:[h,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[h,"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-(--n-soft) [box-shadow:var(--n-elev)]"};function j(){return n("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e("path",{d:"m1.5 8.5 2.75 2.75L9.5 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M7 10.75 8.25 12l5.25-5.25",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}const _={sending:e(t,{}),sent:e(i,{}),delivered:e(j,{}),read:e(j,{}),failed:e(s,{})},z={sending:"text-(--neba-muted-fg)",sent:"text-(--neba-muted-fg)",delivered:"text-(--neba-muted-fg)",read:"text-(--n-accent)",failed:"text-(--neba-danger-accent)"},C=["block overflow-hidden rounded-(--neba-radius-sm) border no-underline","[border-color:color-mix(in_oklab,currentColor_18%,transparent)]","[background-color:color-mix(in_oklab,currentColor_7%,transparent)]","hover:[background-color:color-mix(in_oklab,currentColor_12%,transparent)]","[transition-property:background-color] [transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),L=["shrink-0 opacity-0","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","group-hover/bubble:opacity-100 group-focus-within/bubble:opacity-100","[@media(hover:none)]:opacity-100"].join(" ");export const ChatBubble=/*@__PURE__*/a.forwardRef(function(a,i){const{side:t="start",name:s,time:o,avatar:d,status:h,statusLabel:j,typing:C=!1,media:M,preview:R,actions:T,locale:$,variant:q="outline",size:A="md",color:D="primary",density:E="default",elevation:F=0,className:G,style:H,children:I,...J}=y(a,["size","density","variant","locale"]),K=r(l,$),O="end"===t,P=p(s)||p(o),Q=C||p(I)||Boolean(R),S=["flex min-w-0 flex-col overflow-hidden",b[A],k[t],N[q],g].join(" "),U=h?j??K[h]:"";return n("div",{ref:i,className:m("group/bubble flex w-full items-start gap-2",O?"flex-row-reverse":"",G??""),style:{...c(D,F,q),...H},...J,children:[p(d)?e("div",{className:"shrink-0",children:d}):null,n("div",{className:["flex min-w-0 max-w-[min(100%,32rem)] flex-col",v[A],O?"items-end":"items-start"].join(" "),children:[P?n("div",{className:`flex items-baseline gap-2 ${u[A]}`,children:[p(s)?e("span",{className:"font-semibold",children:s}):null,p(o)?e("span",{className:"text-(--neba-muted-fg)",children:o}):null]}):null,n("div",{className:"flex min-w-0 items-center gap-1 "+(O?"flex-row-reverse":""),children:[n("div",{className:S,children:[p(M)?e("div",{className:"[&_img]:block [&_img]:w-full [&_video]:block [&_video]:w-full",children:M}):null,Q?n("div",{className:[w[E][A],"flex min-w-0 flex-col gap-2",f[A]].join(" "),children:[C?e(B,{label:K.typing}):p(I)?e("div",{className:"min-w-0 break-words whitespace-pre-line",children:I}):null,R?e(W,{preview:R}):null]}):null]}),p(T)?e("div",{className:L,children:T}):null]}),h?n("div",{className:["flex items-center gap-1",u[A],z[h],"[&_svg]:size-[1.15em] [&_svg]:shrink-0"].join(" "),children:[_[h],e("span",{className:x,children:U})]}):null]})]})});function B({label:a}){return n("div",{className:"flex items-center gap-1 py-[0.35em]",role:"status",children:[[0,1,2].map(n=>e("span",{"aria-hidden":"true",className:"neba-typing-dot size-[0.45em] rounded-full",style:{"--n-i":n}},n)),e("span",{className:x,children:a})]})}function W({preview:a}){const{url:l,title:r,description:i,image:t,site:s,newTab:c=!1}=a,m=c?"_blank":void 0;return n("a",{href:l,target:m,rel:d(m,void 0),className:C,children:[t?e("img",{src:t,alt:"",loading:"lazy",decoding:"async",className:"block h-28 w-full object-cover"}):null,n("div",{className:"flex flex-col gap-0.5 p-2",children:[p(s)?n("span",{className:"flex items-center gap-1 text-[0.85em] opacity-70 [&_svg]:size-[1em] [&_svg]:shrink-0",children:[e(o,{}),e("span",{className:"truncate",children:s})]}):null,p(r)?e("span",{className:"font-semibold",children:r}):null,p(i)?e("span",{className:"line-clamp-2 text-[0.9em] opacity-80",children:i}):null]})]})}
1
+ "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as r from"react";import{chatMessages as l,useMessages as i}from"../../internal/i18n.js";import{CheckIcon as a,ClockIcon as t,DangerIcon as s,LinkIcon as o}from"../../internal/icons.js";import{safeHref as c,safeRel as d}from"../../internal/link.js";import{controlSlots as m,cx as u,hasContent as p,metaTextClasses as f,radiusClasses as b,sheetBodyClasses as h,sheetHeaderGapClasses as v,srOnlyClasses as x,surfaceClasses as g,transitionClasses as k}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const w={default:{xs:"px-2 py-1",sm:"px-2.5 py-1.5",md:"px-3 py-2",lg:"px-3.5 py-2.5",xl:"px-4 py-3"},compact:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-1.5",xl:"px-3.5 py-2"}},N={start:"[border-start-start-radius:0.25rem]",end:"[border-start-end-radius:0.25rem]"},j={solid:[g,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[g,"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-(--n-soft) [box-shadow:var(--n-elev)]"};const _={sending:e(t,{}),sent:e(a,{}),delivered:e(function DoubleCheckIcon(){return n("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e("path",{d:"m1.5 8.5 2.75 2.75L9.5 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M7 10.75 8.25 12l5.25-5.25",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})},{}),read:e(function ReadIcon(){const l=r.useId();return n("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[n("mask",{id:l,children:[e("rect",{width:"16",height:"16",fill:"white"}),n("g",{transform:"translate(2.375 1.25) scale(0.75)",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e("path",{d:"m1.5 8.5 2.75 2.75L9.5 6"}),e("path",{d:"M7 10.75 8.25 12l5.25-5.25"})]})]}),e("circle",{cx:"8",cy:"8",r:"7.25",fill:"currentColor",mask:`url(#${l})`})]})},{}),failed:e(s,{})},L={sending:"text-(--neba-muted-fg)",sent:"text-(--neba-muted-fg)",delivered:"text-(--neba-muted-fg)",read:"text-(--n-accent)",failed:"text-(--neba-danger-accent)"},C=["block overflow-hidden rounded-(--neba-radius-sm) border no-underline","[border-color:color-mix(in_oklab,currentColor_18%,transparent)]","[background-color:color-mix(in_oklab,currentColor_7%,transparent)]","hover:[background-color:color-mix(in_oklab,currentColor_12%,transparent)]","[transition-property:background-color] [transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),z=["shrink-0 opacity-0","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","group-hover/bubble:opacity-100 group-focus-within/bubble:opacity-100","[@media(hover:none)]:opacity-100"].join(" ");export const ChatBubble=/*@__PURE__*/r.forwardRef(function ChatBubble(r,a){const{side:t="start",name:s,time:o,avatar:c,status:d,statusLabel:g,typing:C=!1,media:B,preview:D,actions:I,locale:T,variant:W="outline",size:M="md",color:P="primary",density:R="default",elevation:$=0,className:q,style:A,children:E,...F}=y(r,["size","density","variant","locale"]),G=i(l,T),H="end"===t,J=p(s)||p(o),K=C||p(E)||Boolean(D),O=["flex min-w-0 flex-col overflow-hidden",b[M],N[t],j[W],k].join(" "),Q=d?g??G[d]:"";return n("div",{ref:a,className:u("group/bubble flex w-full items-start gap-2",H?"flex-row-reverse":"",q??""),style:{...m(P,$,W),...A},...F,children:[p(c)?e("div",{className:"shrink-0",children:c}):null,n("div",{className:["flex min-w-0 max-w-[min(100%,32rem)] flex-col",v[M],H?"items-end":"items-start"].join(" "),children:[J?n("div",{className:`flex items-baseline gap-2 ${f[M]}`,children:[p(s)?e("span",{className:"font-semibold",children:s}):null,p(o)?e("span",{className:"text-(--neba-muted-fg)",children:o}):null]}):null,n("div",{className:"flex min-w-0 items-center gap-1 "+(H?"flex-row-reverse":""),children:[n("div",{className:O,children:[p(B)?e("div",{className:"[&_img]:block [&_img]:w-full [&_video]:block [&_video]:w-full",children:B}):null,K?n("div",{className:[w[R][M],"flex min-w-0 flex-col gap-2",h[M]].join(" "),children:[C?e(TypingDots,{label:G.typing}):p(E)?e("div",{className:"min-w-0 break-words whitespace-pre-line",children:E}):null,D?e(LinkPreview,{preview:D}):null]}):null]}),p(I)?e("div",{className:z,children:I}):null]}),d?n("div",{className:["flex items-center gap-1",f[M],L[d],"[&_svg]:size-[1.15em] [&_svg]:shrink-0"].join(" "),children:[_[d],e("span",{className:x,children:Q})]}):null]})]})});function TypingDots({label:r}){return n("div",{className:"flex items-center gap-1 py-[0.35em]",role:"status",children:[[0,1,2].map(n=>e("span",{"aria-hidden":"true",className:"neba-typing-dot size-[0.45em] rounded-full",style:{"--n-i":n}},n)),e("span",{className:x,children:r})]})}function LinkPreview({preview:r}){const{url:l,title:i,description:a,image:t,site:s,newTab:m=!1}=r,u=m?"_blank":void 0;return n("a",{href:c(l),target:u,rel:d(u,void 0),className:C,children:[t?e("img",{src:t,alt:"",loading:"lazy",decoding:"async",className:"block h-28 w-full object-cover"}):null,n("div",{className:"flex flex-col gap-0.5 p-2",children:[p(s)?n("span",{className:"flex items-center gap-1 text-[0.85em] opacity-70 [&_svg]:size-[1em] [&_svg]:shrink-0",children:[e(o,{}),e("span",{className:"truncate",children:s})]}):null,p(i)?e("span",{className:"font-semibold",children:i}):null,p(a)?e("span",{className:"line-clamp-2 text-[0.9em] opacity-80",children:a}):null]})]})}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{Checkbox as r}from"@base-ui/react/checkbox";import{Field as t}from"@base-ui/react/field";import{controlTextClasses as i,cx as o,hitAreaClasses as l,metaTextClasses as s,surfaceClasses as d,tickRadiusClasses as c,tickRowLeadingClasses as h,tickSizeClasses as b,transitionClasses as f}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const m=["relative inline-flex shrink-0 items-center justify-center border",l,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",f,"active:[transition-duration:0ms]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),u=[d,"cursor-pointer bg-(--n-panel) [border-color:var(--n-line)]","hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)","data-[indeterminate]:bg-(--n-fill) data-[indeterminate]:text-(--n-on-solid)","data-[indeterminate]:[border-color:transparent]"].join(" "),v=[d,"cursor-default bg-(--n-panel) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]"].join(" "),g=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)]","text-(--neba-disabled-fg) shadow-none","data-[checked]:bg-(--neba-disabled-bg)","data-[indeterminate]:bg-(--neba-disabled-bg)"].join(" "),x=["flex size-[70%] items-center justify-center","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0","[&_path]:[stroke-dasharray:1]","[&_path]:[transition:stroke-dashoffset_var(--neba-duration)_var(--neba-ease)]","[&[data-starting-style]_path]:[stroke-dashoffset:1]","[&[data-ending-style]_path]:[stroke-dashoffset:1]"].join(" ");function k(){return e("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"size-full",children:e("path",{d:"M2 6.2 4.6 8.8 10 3.4",pathLength:"1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function y(){return e("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"size-full",children:e("path",{d:"M2.5 6h7",pathLength:"1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}export const Checkbox=/*@__PURE__*/n.forwardRef(function(n,l){const{size:d="md",color:f="primary",label:j,description:N,error:_,invalid:$,disabled:w=!1,readOnly:L=!1,className:z,classNames:C,style:R,...B}=p(n,["size"]),M=null!=_&&!1!==_&&""!==_,O=$??M,W=O?"danger":f,D={"--n-fill":`var(--neba-${W}-fill)`,"--n-fill-hover":`var(--neba-${W}-fill-hover)`,"--n-on-solid":`var(--neba-${W}-on-solid)`,"--n-accent":`var(--neba-${W}-accent)`,"--n-panel":"var(--neba-panel)","--n-panel-hover":"var(--neba-panel-hover)","--n-line":`var(--neba-${W}-line)`,"--n-line-hover":`var(--neba-${W}-line-hover)`,"--n-ring":`var(--neba-${W}-ring)`},E=[m,b[d],c[d],w?g:L?v:u].join(" ");return a(t.Root,{disabled:w,invalid:O,className:o("inline-flex flex-col gap-1 align-top",z??""),style:{...D,...R},children:[a("div",{className:`flex items-start gap-2 ${i[d]} ${h}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(r.Root,{ref:l,className:o(E,C?.control),disabled:w,readOnly:L,...B,children:e(r.Indicator,{className:o(x,C?.indicator),children:B.indeterminate?e(y,{}):e(k,{})})})}),j||N?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[j?e(t.Label,{className:o("leading-[1.4]",w?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",C?.label),children:j}):null,N?e(t.Description,{className:o(s[d],"text-(--neba-muted-fg)",C?.description),children:N}):null]}):null]}),e(t.Error,M?{match:!0,className:o(s[d],"text-(--n-accent)",C?.error),children:_}:{className:o(s[d],"text-(--n-accent)",C?.error)})]})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{Checkbox as r}from"@base-ui/react/checkbox";import{Field as t}from"@base-ui/react/field";import{controlTextClasses as i,cx as o,hitAreaClasses as l,metaTextClasses as s,surfaceClasses as d,tickRadiusClasses as c,tickRowLeadingClasses as h,tickSizeClasses as b,transitionClasses as f}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";import{useFieldsetDisabled as m}from"../../internal/fieldset.js";const u=["relative inline-flex shrink-0 items-center justify-center border",l,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",f,"active:[transition-duration:0ms]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),v=[d,"cursor-pointer bg-(--n-panel) [border-color:var(--n-line)]","hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)","data-[indeterminate]:bg-(--n-fill) data-[indeterminate]:text-(--n-on-solid)","data-[indeterminate]:[border-color:transparent]"].join(" "),g=[d,"cursor-default bg-(--n-panel) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]","data-[indeterminate]:bg-(--n-fill) data-[indeterminate]:text-(--n-on-solid)","data-[indeterminate]:[border-color:transparent]"].join(" "),k=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)]","text-(--neba-disabled-fg) shadow-none","data-[checked]:bg-(--neba-disabled-bg)","data-[indeterminate]:bg-(--neba-disabled-bg)"].join(" "),x=["flex size-[70%] items-center justify-center","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0","[&_path]:[stroke-dasharray:1]","[&_path]:[transition:stroke-dashoffset_var(--neba-duration)_var(--neba-ease)]","[&[data-starting-style]_path]:[stroke-dashoffset:1]","[&[data-ending-style]_path]:[stroke-dashoffset:1]"].join(" ");function CheckMark(){return e("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"size-full",children:e("path",{d:"M2 6.2 4.6 8.8 10 3.4",pathLength:"1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function DashMark(){return e("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"size-full",children:e("path",{d:"M2.5 6h7",pathLength:"1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}export const Checkbox=/*@__PURE__*/n.forwardRef(function Checkbox(n,l){const{size:d="md",color:f="primary",label:y,description:j,error:N,invalid:_,disabled:$,readOnly:w=!1,className:C,classNames:L,style:M,...z}=p(n,["size"]),D=m($),R=null!=N&&!1!==N&&""!==N,B=_??R,O=B?"danger":f,W={"--n-fill":`var(--neba-${O}-fill)`,"--n-fill-hover":`var(--neba-${O}-fill-hover)`,"--n-on-solid":`var(--neba-${O}-on-solid)`,"--n-accent":`var(--neba-${O}-accent)`,"--n-panel":"var(--neba-panel)","--n-panel-hover":"var(--neba-panel-hover)","--n-line":`var(--neba-${O}-line)`,"--n-line-hover":`var(--neba-${O}-line-hover)`,"--n-ring":`var(--neba-${O}-ring)`},E=[u,b[d],c[d],D?k:w?g:v].join(" ");return a(t.Root,{disabled:D,invalid:B,className:o("inline-flex flex-col gap-1 align-top",C??""),style:{...W,...M},children:[a("div",{className:`flex items-start gap-2 ${i[d]} ${h}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(r.Root,{ref:l,className:o(E,L?.control),disabled:D,readOnly:w,...z,children:e(r.Indicator,{className:o(x,L?.indicator),children:z.indeterminate?e(DashMark,{}):e(CheckMark,{})})})}),y||j?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[y?e(t.Label,{className:o("leading-[1.4]",D?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",L?.label),children:y}):null,j?e(t.Description,{className:o(s[d],"text-(--neba-muted-fg)",L?.description),children:j}):null]}):null]}),e(t.Error,R?{match:!0,className:o(s[d],"text-(--n-accent)",L?.error),children:N}:{className:o(s[d],"text-(--n-accent)",L?.error)})]})});
@@ -41,7 +41,9 @@ export interface ChipProps extends NebaStyleProps, Omit<React.ComponentPropsWith
41
41
  * Marks the chip as chosen — a filter that is on. `selected` deepens the
42
42
  * surface a step rather than changing the colour family, so a row of chips
43
43
  * stays one row of chips.
44
- * @default false
44
+ *
45
+ * Passing it, `false` included, is what makes a pressable chip a toggle to a
46
+ * screen reader. A chip with `onClick` and no `selected` is a plain button.
45
47
  */
46
48
  selected?: boolean;
47
49
  /** Unavailable. Drops the colour family for neutral grey, as everywhere else. */
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{actionMessages as o,useMessages as i}from"../../internal/i18n.js";import{CloseIcon as r}from"../../internal/icons.js";import{transitionProps as s}from"../../internal/animate.js";import{chipRemoveClasses as a,controlHeightClasses as c,controlSlots as d,controlTextClasses as m,disabledClasses as p,focusRingClasses as b,gapClasses as f,iconClasses as u,paddingXClasses as v,pressTransitionClasses as h,radiusClasses as x,surfaceClasses as g,transitionClasses as j}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const w={xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"lg"},N={solid:[g,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[g,"border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-accent) bg-(--n-soft)"},k={solid:"bg-(--n-fill-active)",outline:"bg-(--n-panel-press) [border-color:var(--n-line-hover)]",text:"bg-(--n-soft-press)"},C={solid:"hover:bg-(--n-fill-hover) active:bg-(--n-fill-active)",outline:"hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)] active:bg-(--n-panel-press)",text:"hover:bg-(--n-soft-hover) active:bg-(--n-soft-press)"},$=["relative inline-flex max-w-full shrink-0 select-none items-center","align-middle font-medium leading-none whitespace-nowrap","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",j,h,u].join(" "),z=["flex min-w-0 flex-1 cursor-pointer items-center justify-center self-stretch rounded-[inherit]",b].join(" ");export const Chip=/*@__PURE__*/l.forwardRef(function(l,b){const{variant:u="outline",size:h="md",color:g="primary",density:j="default",elevation:B=0,startIcon:I,endIcon:D,count:F,onDelete:L,locale:R,deleteLabel:q,transition:A,selected:E=!1,disabled:G=!1,className:H,style:J,children:K,onClick:M,...O}=y(l,["size","density","variant","locale"]),P=i(o,R),Q=Boolean(M)&&!G,S=w[h],T=s(A),U=v[j][S],V=[$,c[S],m[S],f[S],x[S],G?p[u]:N[u],!G&&E?k[u]:"",Q?C[u]:"",Q?"ps-0":U,L?"pe-1":Q?"pe-0":"",T.className,H??""].filter(Boolean).join(" "),W=t(n,{children:[I,null!=K&&!1!==K?e("span",{className:"min-w-0 truncate",children:K}):null,D,null!=F&&!1!==F?e("span",{className:["ms-0.5 inline-flex shrink-0 items-center justify-center rounded-full px-1.5 py-px","text-[0.85em] leading-none font-semibold tabular-nums","solid"===u?"bg-(--neba-glow-on-fill) text-(--n-on-solid)":"bg-(--n-soft-press) text-(--n-accent)"].join(" "),children:F}):null]});return t("span",{ref:b,className:V,style:{...d(g,B,u),...T.style,...J},"aria-disabled":!(!G||Q)||void 0,...O,children:[Q?e("button",{type:"button","aria-pressed":E,className:`${z} ${f[S]} ${U}`,onClick:M,children:W}):W,L?e("button",{type:"button","aria-label":q??P.remove,disabled:G,className:a,onClick:L,children:e(r,{})}):null]})});
1
+ "use client";import{jsx as e,Fragment as n,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{actionMessages as i,useMessages as o}from"../../internal/i18n.js";import{CloseIcon as r}from"../../internal/icons.js";import{transitionProps as a}from"../../internal/animate.js";import{chipRemoveClasses as s,controlHeightClasses as c,controlSlots as d,controlTextClasses as m,disabledClasses as p,focusRingClasses as b,gapClasses as f,iconClasses as u,paddingXClasses as h,pressTransitionClasses as v,radiusClasses as x,surfaceClasses as g,transitionClasses as j}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const w={xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"lg"},N={solid:[g,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[g,"border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-on-tint) bg-(--n-soft)"},k={solid:"bg-(--n-fill-active)",outline:"bg-(--n-panel-press) [border-color:var(--n-line-hover)]",text:"bg-(--n-soft-press)"},C={solid:"hover:bg-(--n-fill-hover) active:bg-(--n-fill-active)",outline:"hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)] active:bg-(--n-panel-press)",text:"hover:bg-(--n-soft-hover) active:bg-(--n-soft-press)"},$=["relative inline-flex max-w-full shrink-0 select-none items-center","align-middle font-medium leading-none whitespace-nowrap","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",j,v,u].join(" "),z=["flex min-w-0 flex-1 cursor-pointer items-center justify-center self-stretch rounded-[inherit]",b].join(" ");export const Chip=/*@__PURE__*/t.forwardRef(function Chip(t,b){const{variant:u="outline",size:v="md",color:g="primary",density:j="default",elevation:B=0,startIcon:I,endIcon:D,count:F,onDelete:L,locale:R,deleteLabel:q,transition:A,selected:E,disabled:G=!1,className:H,style:J,children:K,onClick:M,...O}=y(t,["size","density","variant","locale"]),P=o(i,R),Q=Boolean(M)&&!G,S=w[v],T=a(A),U=h[j][S],V=[$,c[S],m[S],f[S],x[S],G?p[u]:N[u],!G&&E?k[u]:"",Q?C[u]:"",Q?"ps-0":U,L?"pe-1":Q?"pe-0":"",T.className,H??""].filter(Boolean).join(" "),W=l(n,{children:[I,null!=K&&!1!==K?e("span",{className:"min-w-0 truncate leading-[normal]",children:K}):null,D,null!=F&&!1!==F?e("span",{className:["ms-0.5 inline-flex shrink-0 items-center justify-center rounded-full px-1.5 py-px","text-[0.85em] leading-none font-semibold tabular-nums","solid"===u?"bg-(--neba-glow-on-fill) text-(--n-on-solid)":"bg-(--n-fill) text-(--n-on-solid)"].join(" "),children:F}):null]});return l("span",{ref:b,className:V,style:{...d(g,B,u),...T.style,...J},"aria-disabled":!(!G||Q)||void 0,...O,children:[Q?e("button",{type:"button","aria-pressed":E,className:`${z} ${f[S]} ${U}`,onClick:M,children:W}):W,L?e("button",{type:"button","aria-label":q??P.remove,disabled:G,className:s,onClick:L,children:e(r,{})}):null]})});
@@ -26,6 +26,9 @@ export interface CodeBlockProps extends Omit<React.ComponentPropsWithoutRef<'div
26
26
  * The code. Trailing whitespace is trimmed off the end of the block — a
27
27
  * template literal is almost always written with a newline before its closing
28
28
  * backtick, and that newline is a blank line at the bottom of every block.
29
+ *
30
+ * A prop rather than `children`, because it is a string and not markup: a
31
+ * template literal keeps its own indentation, and JSX would collapse it.
29
32
  */
30
33
  code: string;
31
34
  /**
@@ -41,9 +44,9 @@ export interface CodeBlockProps extends Omit<React.ComponentPropsWithoutRef<'div
41
44
  * The palette. Independent of the page's light and dark, except on `auto`.
42
45
  *
43
46
  * Any other string works too, and is how a project brings its own: write
44
- * `[data-code-theme='ours'] { --n-code-bg: …; --n-code-keyword: … }` in your
45
- * own CSS and pass the name. Sixteen slots, five of which are derived from
46
- * the other two and need no declaration.
47
+ * `.neba-code[data-code-theme='ours'] { --n-code-bg: …; --n-code-keyword: … }`
48
+ * in your own CSS and pass the name. Nineteen slots, five of which are mixed
49
+ * from `--n-code-bg` and `--n-code-fg` and need no declaration.
47
50
  * @default 'dark'
48
51
  */
49
52
  theme?: CodeBlockTheme | (string & {});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{CheckIcon as o,CodeIcon as l,CopyIcon as r}from"../../internal/icons.js";import{codeMessages as i,useMessages as a}from"../../internal/i18n.js";import{canonicalLanguage as s,highlight as c,plainLines as d}from"../../internal/highlight.js";import{cx as p,hasContent as m,metaTextClasses as u,radiusClasses as f,srOnlyClasses as x,surfaceSlots as g,toLength as h,transitionClasses as y}from"../../internal/styles.js";import{useStyleDefaults as v}from"../../internal/defaults.js";export{registerLanguage}from"../../internal/highlight.js";const b={xs:"text-[0.6875rem]/[1.55]",sm:"text-[0.75rem]/[1.6]",md:"text-[0.8125rem]/[1.65]",lg:"text-[0.875rem]/[1.7]",xl:"text-[1rem]/[1.7]"},w={default:{xs:"py-2",sm:"py-3",md:"py-3.5",lg:"py-4",xl:"py-5"},compact:{xs:"py-1.5",sm:"py-2",md:"py-2.5",lg:"py-3",xl:"py-3.5"}},N={default:{xs:"px-2",sm:"px-3",md:"px-3.5",lg:"px-4",xl:"px-5"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-3.5"}},k={default:{xs:"px-2.5 py-1",sm:"px-3.5 py-1",md:"px-4 py-1.5",lg:"px-4.5 py-2",xl:"px-5.5 py-2"},compact:{xs:"px-2 py-0.5",sm:"px-2.5 py-0.5",md:"px-3 py-1",lg:"px-3.5 py-1",xl:"px-4 py-1.5"}};export const CodeBlock=/*@__PURE__*/n.forwardRef(function(S,j){const{code:L,language:M,theme:T="dark",size:C="md",color:_="primary",density:A="default",elevation:F=0,highlight:R=!0,toolbar:z=!0,title:E,showLanguage:H=!0,copyable:K=!0,rawToggle:$=!1,highlightLines:D,lineNumbers:B=!1,startLine:I=1,prompt:q,wrap:G=!1,maxHeight:J,fontFamily:O,fontSize:P,lineHeight:Q,letterSpacing:U,locale:V,copyLabel:W,copiedLabel:X,rawLabel:Y,onCopy:Z,className:ee,style:te,...ne}=v(S,["size","density","locale"]),oe=a(i,V),le=n.useMemo(()=>L.replace(/\r\n?/g,"\n").replace(/\s+$/,""),[L]),re=s(M),[ie,ae]=n.useState(!1),[se,ce]=n.useState(null),[de,pe]=n.useState(null),me=R&&!ie&&null!==re;n.useEffect(()=>{if(!me||!re)return void pe(null);let e=!1;return c(le,re).then(t=>{e||pe(t)},()=>{e||pe(null)}),()=>{e=!0}},[le,re,me]);const ue=n.useMemo(()=>me&&de?de:d(le),[me,de,le]),fe=`${String(I+Math.max(ue.length-1,0)).length}ch`,xe=n.useRef(void 0);n.useEffect(()=>()=>clearTimeout(xe.current),[]);const ge=n.useMemo(()=>function(e){const t=new Set;if(void 0===e)return t;for(const n of Array.isArray(e)?e:[e])if("number"!=typeof n)for(const e of n.split(",")){const n=/^\s*(\d+)\s*(?:-\s*(\d+)\s*)?$/.exec(e);if(!n)continue;const o=Number(n[1]),l=void 0===n[2]?o:Number(n[2]);for(let e=Math.min(o,l);e<=Math.max(o,l);e+=1)t.add(e)}else Number.isFinite(n)&&t.add(Math.trunc(n));return t}(D),[D]),he=n.useRef(null),ye=W??oe.copy,ve=X??oe.copied,be=Y??oe.raw,we=p("inline-flex shrink-0 cursor-pointer items-center gap-1 border-0 bg-transparent","px-1.5 py-1 text-(--n-code-dim) hover:text-(--n-code-fg) hover:bg-(--n-code-hover)",f.xs,u[C],"[&_svg]:pointer-events-none [&_svg]:size-[1.15em] [&_svg]:shrink-0",y,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"),Ne=m(E)?void 0:re??oe.code,ke=e("div",{role:"region","aria-label":"string"==typeof E?E:Ne,tabIndex:0,onKeyDown:e=>{if("a"!==e.key&&"A"!==e.key)return;if(!e.metaKey&&!e.ctrlKey||e.altKey)return;const t=he.current,n="undefined"==typeof window?null:window.getSelection();if(!t||!n)return;e.preventDefault();const o=document.createRange();o.selectNodeContents(t),n.removeAllRanges(),n.addRange(o)},className:p("min-h-0 overflow-auto",w[A][C],"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:-outline-offset-2"),style:void 0===J?void 0:{maxHeight:h(J)},children:e("pre",{ref:he,className:p("m-0 bg-transparent p-0 font-mono",G?"w-full":"w-max min-w-full"),children:ue.map((t,o)=>{const l=I+o;return e("div",{className:p("neba-code-line",N[A][C]),"data-line":B?l:void 0,"data-mark":ge.has(l)?"":void 0,"data-prompt":q&&t.length>0?q:void 0,children:e("code",{children:t.map((t,o)=>t.token?e("span",{className:t.token,children:t.text},o):e(n.Fragment,{children:t.text},o))})},o)})})});return t("div",{ref:j,className:p("neba-code flex min-w-0 flex-col overflow-hidden",f[C],"border bg-(--n-code-bg) text-(--n-code-fg) [border-color:var(--n-code-rule)]","[box-shadow:var(--n-elev)]",y,ee),"data-code-theme":T,"data-code-wrap":G?"true":void 0,style:{...g(_,F),"--n-code-gutter":fe,...O?{fontFamily:O}:null,...void 0===P?null:{fontSize:h(P)},...void 0===Q?null:{lineHeight:Q},...void 0===U?null:{letterSpacing:h(U)},...te},...ne,children:[z&&(H||K||$||m(E))?t("div",{className:p("flex min-w-0 items-center gap-1 border-b [border-color:var(--n-code-rule)]",k[A][C]),children:[m(E)?e("span",{className:p("min-w-0 truncate font-mono",u[C]),children:E}):null,H&&re?e("span",{className:p("min-w-0 truncate font-mono tracking-wide text-(--n-code-dim) uppercase select-none",u[C]),children:re}):null,e("span",{className:"flex-1"}),$&&R?e("button",{type:"button","aria-pressed":ie,"aria-label":be,title:be,onClick:()=>ae(e=>!e),className:p(we,ie?"text-(--n-code-fg) bg-(--n-code-hover)":""),children:e(l,{})}):null,K?t("button",{type:"button",onClick:async()=>{const e=await async function(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const t=document.activeElement;try{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.append(t),t.select();const n=document.execCommand("copy");return t.remove(),n}catch{return!1}finally{t instanceof HTMLElement&&t.isConnected&&t.focus()}}(le);clearTimeout(xe.current),ce(e),xe.current=setTimeout(()=>ce(null),2e3),e&&Z?.(le)},className:we,children:[e(se?o:r,{}),e("span",{children:null===se?ye:se?ve:oe.copyFailed})]}):null]}):null,e("div",{className:p("flex min-h-0 flex-col",b[C]),children:ke}),e("span",{"aria-live":"polite",className:x,children:null===se?"":se?ve:oe.copyFailed})]})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{CheckIcon as o,CodeIcon as l,CopyIcon as r}from"../../internal/icons.js";import{codeMessages as i,useMessages as a}from"../../internal/i18n.js";import{observeResize as s}from"../../internal/observe.js";import{canonicalLanguage as c,highlight as d,plainLines as m}from"../../internal/highlight.js";import{cx as u,hasContent as p,metaTextClasses as f,radiusClasses as x,srOnlyClasses as h,surfaceSlots as g,toLength as y,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";export{registerLanguage}from"../../internal/highlight.js";const w={xs:"text-[0.6875rem]/[1.55]",sm:"text-[0.75rem]/[1.6]",md:"text-[0.8125rem]/[1.65]",lg:"text-[0.875rem]/[1.7]",xl:"text-[1rem]/[1.7]"},N={default:{xs:"py-2",sm:"py-3",md:"py-3.5",lg:"py-4",xl:"py-5"},compact:{xs:"py-1.5",sm:"py-2",md:"py-2.5",lg:"py-3",xl:"py-3.5"}},k={default:{xs:"px-2",sm:"px-3",md:"px-3.5",lg:"px-4",xl:"px-5"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-3.5"}},M={default:{xs:"px-2.5 py-1",sm:"px-3.5 py-1",md:"px-4 py-1.5",lg:"px-4.5 py-2",xl:"px-5.5 py-2"},compact:{xs:"px-2 py-0.5",sm:"px-2.5 py-0.5",md:"px-3 py-1",lg:"px-3.5 py-1",xl:"px-4 py-1.5"}};export const CodeBlock=/*@__PURE__*/n.forwardRef(function CodeBlock(S,j){const{code:C,language:L,theme:T="dark",size:A="md",color:E="primary",density:H="default",elevation:R=0,highlight:_=!0,toolbar:z=!0,title:F,showLanguage:K=!0,copyable:$=!0,rawToggle:B=!1,highlightLines:D,lineNumbers:W=!1,startLine:I=1,prompt:q,wrap:G=!1,maxHeight:J,fontFamily:O,fontSize:P,lineHeight:Q,letterSpacing:U,locale:V,copyLabel:X,copiedLabel:Y,rawLabel:Z,onCopy:ee,className:te,style:ne,...oe}=b(S,["size","density","locale"]),le=a(i,V),re=n.useMemo(()=>C.replace(/\r\n?/g,"\n").trimEnd(),[C]),ie=c(L),[ae,se]=n.useState(!1),[ce,de]=n.useState(null),[me,ue]=n.useState(null),pe=_&&!ae&&null!==ie;n.useEffect(()=>{if(!pe||!ie)return void ue(null);let e=!1;return d(re,ie).then(t=>{e||ue(t?{source:re,name:ie,lines:t}:null)},()=>{e||ue(null)}),()=>{e=!0}},[re,ie,pe]);const fe=n.useMemo(()=>pe&&me&&me.source===re&&me.name===ie?me.lines:m(re),[pe,me,re,ie]),xe=`${String(I+Math.max(fe.length-1,0)).length}ch`,he=n.useRef(void 0);n.useEffect(()=>()=>clearTimeout(he.current),[]);const ge=I+Math.max(fe.length-1,0),ye=n.useMemo(()=>function(e,t,n){const o=new Set;if(void 0===e)return o;for(const l of Array.isArray(e)?e:[e])if("number"!=typeof l)for(const e of l.split(",")){const l=/^\s*(\d+)\s*(?:-\s*(\d+)\s*)?$/.exec(e);if(!l)continue;const r=Number(l[1]),i=void 0===l[2]?r:Number(l[2]),a=Math.max(Math.min(r,i),t),s=Math.min(Math.max(r,i),n);for(let e=a;e<=s;e+=1)o.add(e)}else Number.isFinite(l)&&o.add(Math.trunc(l));return o}(D,I,ge),[D,I,ge]),ve=n.useRef(null),be=n.useRef(null),[we,Ne]=n.useState(!1);n.useEffect(()=>{const e=be.current,t=ve.current;if(!e||!t)return;const n=()=>Ne(e.scrollWidth>e.clientWidth+1||e.scrollHeight>e.clientHeight+1);n();const o=s(e,n),l=s(t,n);return()=>{o(),l()}},[]);const ke=X??le.copy,Me=Y??le.copied,Se=Z??le.raw,je=u("inline-flex shrink-0 cursor-pointer items-center gap-1 border-0 bg-transparent","px-1.5 py-1 text-(--n-code-dim) hover:text-(--n-code-fg) hover:bg-(--n-code-hover)",x.xs,f[A],"[&_svg]:pointer-events-none [&_svg]:size-[1.15em] [&_svg]:shrink-0",v,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"),Ce=p(F)?void 0:ie??le.code,Le=e("div",{ref:be,role:we?"region":void 0,"aria-label":we?"string"==typeof F?F:Ce:void 0,tabIndex:we?0:void 0,onKeyDown:e=>{if(!("a"===e.key||"A"===e.key||!/^[a-z]$/i.test(e.key)&&"KeyA"===e.code))return;if(!e.metaKey&&!e.ctrlKey||e.altKey)return;const t=ve.current,n="undefined"==typeof window?null:window.getSelection();if(!t||!n)return;e.preventDefault();const o=document.createRange();o.selectNodeContents(t),n.removeAllRanges(),n.addRange(o)},className:u("min-h-0 overflow-auto",N[H][A],"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:-outline-offset-2"),style:void 0===J?void 0:{maxHeight:y(J)},children:e("pre",{ref:ve,className:u("m-0 bg-transparent p-0 font-mono",G?"w-full":"w-max min-w-full"),children:fe.map((t,o)=>{const l=I+o;return e("div",{className:u("neba-code-line",k[H][A]),"data-line":W?l:void 0,"data-mark":ye.has(l)?"":void 0,"data-prompt":q&&t.length>0?q:void 0,children:e("code",{children:t.map((t,o)=>t.token?e("span",{className:t.token,children:t.text},o):e(n.Fragment,{children:t.text},o))})},o)})})});return t("div",{ref:j,className:u("neba-code flex min-w-0 flex-col overflow-hidden",x[A],"border bg-(--n-code-bg) text-(--n-code-fg) [border-color:var(--n-code-rule)]","[box-shadow:var(--n-elev)]",v,te),"data-code-theme":T,"data-code-wrap":G?"true":void 0,style:{...g(E,R),"--n-code-gutter":xe,...O?{fontFamily:O}:null,...void 0===P?null:{fontSize:y(P)},...void 0===Q?null:{lineHeight:Q},...void 0===U?null:{letterSpacing:y(U)},...ne},...oe,children:[z&&(K&&ie||$||B&&_||p(F))?t("div",{className:u("flex min-w-0 items-center gap-1 border-b [border-color:var(--n-code-rule)]",M[H][A]),children:[p(F)?e("span",{className:u("min-w-0 truncate font-mono",f[A]),children:F}):null,K&&ie?e("span",{className:u("min-w-0 truncate font-mono tracking-wide text-(--n-code-dim) uppercase select-none",f[A]),children:ie}):null,e("span",{className:"flex-1"}),B&&_?e("button",{type:"button","aria-pressed":ae,"aria-label":Se,title:Se,onClick:()=>se(e=>!e),className:u(je,ae?"text-(--n-code-fg) bg-(--n-code-hover)":""),children:e(l,{})}):null,$?t("button",{type:"button",onClick:async()=>{const e=await async function(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const t=document.activeElement;try{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.append(t),t.select();const n=document.execCommand("copy");return t.remove(),n}catch{return!1}finally{t instanceof HTMLElement&&t.isConnected&&t.focus()}}(re);clearTimeout(he.current),de(e),he.current=setTimeout(()=>de(null),2e3),e&&ee?.(re)},className:je,children:[e(ce?o:r,{}),e("span",{children:null===ce?ke:ce?Me:le.copyFailed})]}):null]}):null,e("div",{className:u("flex min-h-0 flex-col",w[A]),children:Le}),e("span",{"aria-live":"polite",className:h,children:null===ce?"":ce?Me:le.copyFailed})]})});
@@ -14,6 +14,12 @@ export interface CollapsibleProps extends NebaStyleProps, Omit<React.ComponentPr
14
14
  title?: React.ReactNode;
15
15
  /** A second line under the title, one step down the type scale and muted. */
16
16
  subtitle?: React.ReactNode;
17
+ /**
18
+ * Cuts the title and the subtitle off after this many lines, with an
19
+ * ellipsis. Unset, both wrap, as on an AccordionItem: a title that is a
20
+ * question loses the question when it ends in an ellipsis.
21
+ */
22
+ lines?: number;
17
23
  /** Content before the title — an icon, a status dot, a count. */
18
24
  startIcon?: React.ReactNode;
19
25
  /**
@@ -55,7 +61,11 @@ export interface CollapsibleProps extends NebaStyleProps, Omit<React.ComponentPr
55
61
  /**
56
62
  * Keeps a closed panel in the DOM so the browser's own page search can find
57
63
  * and open it. Overrides `keepMounted`.
58
- * @default false
64
+ *
65
+ * On by default, because a closed panel that is not in the markup is not in a
66
+ * server render either, and a crawler reads the server render. Turn it off
67
+ * for a panel that is expensive to build and only needs to exist when open.
68
+ * @default true
59
69
  */
60
70
  hiddenUntilFound?: boolean;
61
71
  /**
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as a from"react";import{Collapsible as t}from"@base-ui/react/collapsible";import{boxPaddingXClasses as l,boxPaddingYClasses as i}from"../box/Box.js";import{ChevronIcon as r}from"../../internal/icons.js";import{gapClasses as s,hasContent as o,iconClasses as d,metaTextClasses as c,radiusClasses as f,sheetBodyClasses as m,sheetHeaderGapClasses as p,sheetTitleClasses as b,surfaceClasses as u,surfaceSlots as h,transitionClasses as x}from"../../internal/styles.js";import{useStyleDefaults as g}from"../../internal/defaults.js";const v={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"};export const Collapsible=/*@__PURE__*/a.forwardRef(function(a,u){const{variant:j="outline",size:N="md",color:w="primary",density:y="default",elevation:_=0,open:k,defaultOpen:C=!1,onOpenChange:O,title:$,subtitle:B,startIcon:z,action:F,trigger:M,indicator:R=!0,disabled:T=!1,padded:U=!0,hiddenUntilFound:I=!1,keepMounted:P=!1,className:q,style:A,children:D,...E}=g(a,["size","density","variant"]),G=l[y][N],H=i[y][N];return n(t.Root,{ref:u,open:k,defaultOpen:C,onOpenChange:e=>O?.(e),disabled:T,className:["flex flex-col overflow-hidden",f[N],v[j],x,q??""].filter(Boolean).join(" "),style:{...h(w,_),...A},...E,children:[M?e(t.Trigger,{render:M}):n("div",{className:"flex w-full items-center",children:[n(t.Trigger,{className:["flex min-w-0 flex-1 cursor-pointer items-center text-start",G,H,s[N],x,d,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]","hover:bg-(--n-soft)","data-[panel-open]:text-(--n-accent)","disabled:cursor-not-allowed disabled:bg-transparent disabled:text-(--neba-disabled-fg)"].join(" "),children:[o(z)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:z}):null,n("span",{className:`flex min-w-0 flex-1 flex-col ${p[N]}`,children:[o($)?e("span",{className:`truncate font-semibold ${b[N]}`,children:$}):null,o(B)?e("span",{className:`truncate text-(--neba-muted-fg) ${c[N]}`,children:B}):null]}),R?e("span",{className:["flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[panel-open]:rotate-180"].join(" "),children:e(r,{})}):null]}),o(F)?e("span",{className:`flex shrink-0 items-center ${G}`,children:F}):null]}),e(t.Panel,{hiddenUntilFound:I,keepMounted:P,className:["h-(--collapsible-panel-height) overflow-hidden","[transition:height_var(--neba-duration)_var(--neba-ease)]","motion-reduce:[transition-duration:0ms]","data-[starting-style]:h-0 data-[ending-style]:h-0"].join(" "),children:e("div",{className:["min-w-0 text-(--neba-muted-fg)",m[N],U?G:"",U?M?H:"compact"===y?"pb-2":"pb-4":""].filter(Boolean).join(" "),children:D})})]})});
1
+ "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{Collapsible as l}from"@base-ui/react/collapsible";import{boxPaddingXClasses as a,boxPaddingYClasses as s}from"../box/Box.js";import{ChevronIcon as i}from"../../internal/icons.js";import{collapsiblePanelClasses as r,gapClasses as o,hasContent as d,iconClasses as c,metaTextClasses as f,radiusClasses as p,sheetBodyClasses as m,sheetHeaderGapClasses as b,sheetTitleClasses as u,surfaceClasses as x,surfaceSlots as h,transitionClasses as g,clampClasses as v,clampSlot as j}from"../../internal/styles.js";import{useStyleDefaults as N}from"../../internal/defaults.js";const w={solid:[x,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[x,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};export const Collapsible=/*@__PURE__*/t.forwardRef(function Collapsible(t,x){const{variant:y="outline",size:$="md",color:k="primary",density:C="default",elevation:O=0,open:_,defaultOpen:B=!1,onOpenChange:z,title:F,subtitle:M,lines:R,startIcon:T,action:U,trigger:I,indicator:P=!0,disabled:q=!1,padded:A=!0,hiddenUntilFound:D=!0,keepMounted:E=!1,className:G,style:H,children:J,...K}=N(t,["size","density","variant"]),L=R?v(R):"",Q=j(R),S=a[C][$],V=s[C][$];return n(l.Root,{ref:x,open:_,defaultOpen:B,onOpenChange:e=>z?.(e),disabled:q,className:["flex flex-col overflow-hidden",p[$],w[y],g,G??""].filter(Boolean).join(" "),style:{...h(k,O),...H},...K,children:[I?e(l.Trigger,{render:I}):n("div",{className:"flex w-full items-center",children:[n(l.Trigger,{className:["flex min-w-0 flex-1 items-center text-start",S,V,o[$],g,c,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",q?"cursor-not-allowed bg-transparent text-(--neba-disabled-fg)":"cursor-pointer hover:bg-(--n-soft) data-[panel-open]:text-(--n-on-tint)"].join(" "),children:[d(T)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:T}):null,n("span",{className:`flex min-w-0 flex-1 flex-col ${b[$]}`,children:[d(F)?e("span",{className:`${L} font-semibold ${u[$]}`,style:Q,children:F}):null,d(M)?e("span",{className:`${L} text-(--neba-muted-fg) ${f[$]}`,style:Q,children:M}):null]}),P?e("span",{className:["flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[panel-open]:rotate-180"].join(" "),children:e(i,{})}):null]}),d(U)?e("span",{className:`flex shrink-0 items-center ${S}`,children:U}):null]}),e(l.Panel,{hiddenUntilFound:D,keepMounted:E,className:r,children:e("div",{className:["min-w-0 text-(--neba-muted-fg)",m[$],A?S:"",A?I?V:"compact"===C?"pb-2":"pb-4":""].filter(Boolean).join(" "),children:J})})]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{PickerShell as l}from"../../internal/picker.js";import{CheckIcon as n}from"../../internal/icons.js";import{colorMessages as t,useMessages as o}from"../../internal/i18n.js";import{checkerBackground as s,clamp as i,cssColor as d,defaultSwatches as h,formatColor as c,parseColor as u,readableInk as f}from"../../internal/color.js";import{controlTextClasses as p,cx as b,focusRingClasses as m,metaTextClasses as g,radiusClasses as v,stackGapClasses as x,surfaceSlots as y}from"../../internal/styles.js";import{useStyleDefaults as w}from"../../internal/defaults.js";const N={xs:"w-40",sm:"w-44",md:"w-52",lg:"w-60",xl:"w-72"},k={xs:"h-24",sm:"h-28",md:"h-32",lg:"h-40",xl:"h-48"},C={xs:"h-2.5",sm:"h-3",md:"h-3.5",lg:"h-4",xl:"h-5"},_={xs:"gap-1.5",sm:"gap-2",md:"gap-2.5",lg:"gap-3",xl:"gap-3.5"},j={xs:10,sm:12,md:14,lg:16,xl:18},z=["relative overflow-hidden border","[border-color:var(--neba-border)]","[box-shadow:var(--neba-plate-glass)]"].join(" "),I=["pointer-events-none absolute rounded-full border-2 border-white","[box-shadow:0_0_0_1px_rgba(0,0,0,0.35),0_1px_3px_rgba(0,0,0,0.4)]"].join(" ");function T(e){const a=e.currentTarget.getBoundingClientRect();return{x:0===a.width?0:i((e.clientX-a.left)/a.width,0,1),y:0===a.height?0:i((e.clientY-a.top)/a.height,0,1)}}function A(e){const a=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":return{x:-a,y:0};case"ArrowRight":return{x:a,y:0};case"ArrowUp":return{x:0,y:a};case"ArrowDown":return{x:0,y:-a};default:return null}}function D({hsv:r,alphaValue:l,onChange:t,text:o,onTextChange:h,withAlpha:p,swatches:x,editable:y,size:w,inert:D,labels:M}){const O=j[w],L=-O/2,P=d({h:r.h,s:100,v:100}),V=d(r),$=e=>({onPointerDown:a=>{D||(a.currentTarget.setPointerCapture(a.pointerId),e(a))},onPointerMove:a=>{!D&&a.currentTarget.hasPointerCapture(a.pointerId)&&e(a)}}),S=(e,a,r,l)=>({role:"slider",tabIndex:D?-1:0,"aria-label":e,"aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":Math.round(a),"aria-orientation":"horizontal","aria-disabled":D||void 0,onKeyDown:e=>{const a=A(e);!D&&a&&0!==a.x&&(e.preventDefault(),l(a.x))}});return a("div",{className:b("flex flex-col",N[w],_[w]),children:[e("div",{...$(e=>{const{x:a,y:n}=T(e);t({hsv:{h:r.h,s:100*a,v:100*(1-n)},alpha:l})}),role:"slider",tabIndex:D?-1:0,"aria-label":M.area,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r.s),"aria-valuetext":`${Math.round(r.s)}%, ${Math.round(r.v)}%`,"aria-disabled":D||void 0,onKeyDown:e=>{const a=A(e);!D&&a&&(e.preventDefault(),t({hsv:{h:r.h,s:i(r.s+a.x,0,100),v:i(r.v+a.y,0,100)},alpha:l}))},className:b(z,k[w],v[w],m,D?"cursor-default":"cursor-crosshair touch-none"),style:{backgroundColor:P,backgroundImage:"linear-gradient(to top, #000000, rgba(0, 0, 0, 0)), linear-gradient(to right, #ffffff, rgba(255, 255, 255, 0))"},children:e("span",{className:I,style:{width:O,height:O,left:`${r.s}%`,top:100-r.v+"%",marginLeft:L,marginTop:L,backgroundColor:V}})}),e("div",{...$(e=>t({hsv:{...r,h:360*T(e).x},alpha:l})),...S(M.hue,r.h,360,e=>t({hsv:{...r,h:(r.h+2*e+360)%360},alpha:l})),className:b(z,C[w],"rounded-full",m,D?"cursor-default":"cursor-pointer touch-none"),style:{backgroundImage:"linear-gradient(to right, #ff0000 0%, #ffff00 16.66%, #00ff00 33.33%, #00ffff 50%, #0000ff 66.66%, #ff00ff 83.33%, #ff0000 100%)"},children:e("span",{className:I,style:{width:O,height:O,left:r.h/360*100+"%",top:"50%",marginLeft:L,marginTop:L,backgroundColor:P}})}),p?a("div",{...$(e=>t({hsv:r,alpha:T(e).x})),...S(M.alpha,100*l,100,e=>t({hsv:r,alpha:i(l+e/100,0,1)})),className:b(z,C[w],"rounded-full",m,D?"cursor-default":"cursor-pointer touch-none"),style:s,children:[e("span",{"aria-hidden":"true",className:"absolute inset-0",style:{backgroundImage:`linear-gradient(to right, ${d(r,0)}, ${V})`}}),e("span",{className:I,style:{width:O,height:O,left:100*l+"%",top:"50%",marginLeft:L,marginTop:L,backgroundColor:d(r,l)}})]}):null,y?a("div",{className:b("flex items-center",_[w]),children:[e("span",{"aria-hidden":"true",className:b("shrink-0 rounded-full border","[border-color:var(--neba-border)]"),style:{width:O+6,height:O+6,...s},children:e("span",{className:"block size-full rounded-full",style:{backgroundColor:d(r,l)}})}),e("input",{type:"text",value:o,readOnly:D,spellCheck:!1,autoComplete:"off","aria-label":M.value,onChange:e=>h(e.target.value),className:b("min-w-0 flex-1 border bg-transparent px-1.5 py-1 font-mono lowercase","[border-color:var(--neba-border)]",v.xs,g[w],"text-(--neba-fg)","[outline:none] focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1")})]}):null,x&&x.length>0?e("div",{role:"group","aria-label":M.swatches,className:"grid grid-cols-8 gap-1",children:x.map(a=>{const o=u(a),s=null!==o&&c(o.hsv,o.alpha,"hex")===c(r,l,"hex");return e("button",{type:"button",disabled:D,"aria-label":a,"aria-pressed":s,onClick:()=>{o&&t(o)},className:b("flex aspect-square items-center justify-center rounded-full border","[border-color:color-mix(in_oklab,var(--neba-fg)_18%,transparent)]","[transition:box-shadow_var(--neba-duration)_var(--neba-ease)]",m,D?"cursor-default":"cursor-pointer hover:[box-shadow:var(--neba-shadow-1)]","[&_svg]:size-3"),style:{backgroundColor:a},children:s&&o?e("span",{style:{color:f(o.hsv)},children:e(n,{})}):null},a)})}):null]})}function M(e,a){return"hex"===e?[a?"#ffffffff":"#ffffff"]:"rgb"===e?[a?"rgba(255, 255, 255, 0.55)":"rgb(255, 255, 255)"]:[a?"hsla(360, 100%, 100%, 0.55)":"hsl(360, 100%, 100%)"]}const O={h:217,s:87,v:82};export const ColorPicker=/*@__PURE__*/r.forwardRef(function(n,i){const{value:f,defaultValue:m="#1a58d1",onValueChange:v,format:N="hex",alpha:k=!1,swatches:C=h,inline:_=!1,editable:j=!0,label:z,description:I,error:T,invalid:A,required:L=!1,disabled:P=!1,readOnly:V=!1,fullWidth:$=!1,clearable:S=!1,name:q,open:K,defaultOpen:R=!1,onOpenChange:B,locale:W,labels:E,variant:U="outline",size:X="md",color:Y="primary",density:F="default",elevation:G=0,className:H,style:J,...Q}=w(n,["size","density","variant","locale"]),Z=o(t,W),ee=r.useMemo(()=>({...Z,...E}),[Z,E]),[ae,re]=r.useState(m),le=f??ae,[ne,te]=r.useState(R),oe=K??ne,[se,ie]=r.useState(()=>u(le)??{hsv:O,alpha:1}),[de,he]=r.useState(()=>le||""),ce=c(se.hsv,k?se.alpha:1,N),ue=""===le;r.useEffect(()=>{const e=u(le);e?c(e.hsv,k?e.alpha:1,N)!==ce&&(he(le),ie(e)):he(le)},[le,ce,k,N]);const fe=(e,a)=>{ie(e);const r=c(e.hsv,k?e.alpha:1,N);he(a??r),void 0===f&&re(r),v?.(r)},pe=P||V,be=e(D,{hsv:se.hsv,alphaValue:se.alpha,onChange:fe,text:de,onTextChange:e=>{he(e);const a=u(e);a&&fe(a,e)},withAlpha:k,swatches:C,editable:j,size:X,inert:pe,labels:ee}),me=q?e("input",{type:"hidden",name:q,value:ue?"":ce}):null;if(_){const r=A??Boolean(T)?"danger":Y;return a("div",{ref:i,className:b("flex flex-col",x[X],H),style:{...y(r,G),...J},...Q,children:[z?e("span",{className:b(g[X],"font-medium",P?"text-(--neba-disabled-fg)":"text-(--neba-fg)"),children:z}):null,be,I?e("span",{className:b(g[X],"text-(--neba-muted-fg)"),children:I}):null,T?e("span",{className:b(g[X],"text-(--n-accent)"),children:T}):null,me]})}return e("div",{ref:i,className:$?"w-full":"inline-block",...Q,children:e(l,{variant:U,size:X,color:Y,density:F,elevation:G,style:J,label:z,description:I,error:T,invalid:A,required:L,disabled:P,readOnly:V,fullWidth:$,className:H,startIcon:e("span",{"aria-hidden":"true",className:b("block size-[1.15em] shrink-0 rounded-full border","[border-color:color-mix(in_oklab,var(--neba-fg)_18%,transparent)]"),style:s,children:e("span",{className:"block size-full rounded-full",style:{backgroundColor:ue?"transparent":d(se.hsv,k?se.alpha:1)}})}),display:ue?ee.empty:ce,samples:M(N,k),empty:ue,clearable:S,onClear:()=>{void 0===f&&re(""),he(""),v?.("")},open:oe,onOpenChange:e=>{void 0===K&&te(e),B?.(e)},clearLabel:ee.clear,hiddenValues:q?[{name:q,value:ue?"":ce}]:void 0,children:e("div",{className:p[X],children:be})})})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{PickerShell as l}from"../../internal/picker.js";import{CheckIcon as n}from"../../internal/icons.js";import{colorMessages as o,useMessages as t}from"../../internal/i18n.js";import{checkerBackground as s,clamp as i,cssColor as d,defaultSwatches as h,formatColor as c,parseColor as u,readableInk as f}from"../../internal/color.js";import{controlTextClasses as p,cx as b,focusRingClasses as m,metaTextClasses as g,radiusClasses as v,stackGapClasses as x,surfaceSlots as y,transitionClasses as w}from"../../internal/styles.js";import{useStyleDefaults as C}from"../../internal/defaults.js";const k={xs:"w-40",sm:"w-44",md:"w-52",lg:"w-60",xl:"w-72"},N={xs:"h-24",sm:"h-28",md:"h-32",lg:"h-40",xl:"h-48"},_={xs:"h-2.5",sm:"h-3",md:"h-3.5",lg:"h-4",xl:"h-5"},j={xs:"gap-1.5",sm:"gap-2",md:"gap-2.5",lg:"gap-3",xl:"gap-3.5"},I={xs:10,sm:12,md:14,lg:16,xl:18},z=["relative overflow-hidden border","[border-color:var(--neba-border)]","[box-shadow:var(--neba-plate-glass)]"].join(" "),P=["pointer-events-none absolute rounded-full border-2 border-white","[box-shadow:0_0_0_1px_rgba(0,0,0,0.35),0_1px_3px_rgba(0,0,0,0.4)]"].join(" ");function T(e){const a=e.currentTarget.getBoundingClientRect();return{x:0===a.width?0:i((e.clientX-a.left)/a.width,0,1),y:0===a.height?0:i((e.clientY-a.top)/a.height,0,1)}}function A(e){const a=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":return{x:-a,y:0};case"ArrowRight":return{x:a,y:0};case"ArrowUp":return{x:0,y:a};case"ArrowDown":return{x:0,y:-a};default:return null}}function ColorPanel({hsv:r,alphaValue:l,onChange:o,text:t,onTextChange:h,withAlpha:p,swatches:x,editable:y,size:C,inert:D,disabled:M,labels:O}){const L=I[C],V=-L/2,$=d({h:r.h,s:100,v:100}),B=d(r),S=e=>({onPointerDown:a=>{D||(a.currentTarget.setPointerCapture(a.pointerId),e(a))},onPointerMove:a=>{!D&&a.currentTarget.hasPointerCapture(a.pointerId)&&e(a)}}),q=(e,a,r,l)=>({role:"slider",tabIndex:D?-1:0,"aria-label":e,"aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":Math.round(a),"aria-orientation":"horizontal","aria-disabled":D||void 0,onKeyDown:e=>{const a=A(e);!D&&a&&0!==a.x&&(e.preventDefault(),l(a.x))}});return a("div",{className:b("flex flex-col",k[C],j[C]),children:[e("div",{...S(e=>{const{x:a,y:n}=T(e);o({hsv:{h:r.h,s:100*a,v:100*(1-n)},alpha:l})}),role:"slider",tabIndex:D?-1:0,"aria-label":O.area,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r.s),"aria-valuetext":`${Math.round(r.s)}%, ${Math.round(r.v)}%`,"aria-disabled":D||void 0,onKeyDown:e=>{const a=A(e);!D&&a&&(e.preventDefault(),o({hsv:{h:r.h,s:i(r.s+a.x,0,100),v:i(r.v+a.y,0,100)},alpha:l}))},className:b(z,N[C],v[C],m,D?"cursor-default":"cursor-crosshair touch-none"),style:{backgroundColor:$,backgroundImage:"linear-gradient(to top, #000000, rgba(0, 0, 0, 0)), linear-gradient(to right, #ffffff, rgba(255, 255, 255, 0))"},children:e("span",{className:P,style:{width:L,height:L,left:`${r.s}%`,top:100-r.v+"%",marginLeft:V,marginTop:V,backgroundColor:B}})}),e("div",{...S(e=>o({hsv:{...r,h:360*T(e).x},alpha:l})),...q(O.hue,r.h,360,e=>o({hsv:{...r,h:(r.h+2*e+360)%360},alpha:l})),className:b(z,_[C],"rounded-full",m,D?"cursor-default":"cursor-pointer touch-none"),style:{backgroundImage:"linear-gradient(to right, #ff0000 0%, #ffff00 16.66%, #00ff00 33.33%, #00ffff 50%, #0000ff 66.66%, #ff00ff 83.33%, #ff0000 100%)"},children:e("span",{className:P,style:{width:L,height:L,left:r.h/360*100+"%",top:"50%",marginLeft:V,marginTop:V,backgroundColor:$}})}),p?a("div",{...S(e=>o({hsv:r,alpha:T(e).x})),...q(O.alpha,100*l,100,e=>o({hsv:r,alpha:i(l+e/100,0,1)})),className:b(z,_[C],"rounded-full",m,D?"cursor-default":"cursor-pointer touch-none"),style:s,children:[e("span",{"aria-hidden":"true",className:"absolute inset-0",style:{backgroundImage:`linear-gradient(to right, ${d(r,0)}, ${B})`}}),e("span",{className:P,style:{width:L,height:L,left:100*l+"%",top:"50%",marginLeft:V,marginTop:V,backgroundColor:d(r,l)}})]}):null,y?a("div",{className:b("flex items-center",j[C]),children:[e("span",{"aria-hidden":"true",className:b("shrink-0 rounded-full border","[border-color:var(--neba-border)]"),style:{width:L+6,height:L+6,...s},children:e("span",{className:"block size-full rounded-full",style:{backgroundColor:d(r,l)}})}),e("input",{type:"text",value:t,readOnly:D,disabled:M,spellCheck:!1,autoComplete:"off","aria-label":O.value,onChange:e=>h(e.target.value),className:b("neba-input min-w-0 flex-1 border bg-transparent px-1.5 py-1 font-mono lowercase","[border-color:var(--neba-border)]",v.xs,g[C],"text-(--neba-fg)",w,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1")})]}):null,x&&x.length>0?e("div",{role:"group","aria-label":O.swatches,className:"grid grid-cols-8 gap-1",children:x.map(a=>{const t=u(a),s=null!==t&&c(t.hsv,t.alpha,"hex")===c(r,l,"hex");return e("button",{type:"button",disabled:D,"aria-label":a,"aria-pressed":s,onClick:()=>{t&&o(t)},className:b("flex aspect-square items-center justify-center rounded-full border","[border-color:color-mix(in_oklab,var(--neba-fg)_18%,transparent)]","[transition:box-shadow_var(--neba-duration)_var(--neba-ease)]",m,D?"cursor-default":"cursor-pointer hover:[box-shadow:var(--neba-shadow-1)]","[&_svg]:size-3"),style:{backgroundColor:a},children:s&&t?e("span",{style:{color:f(t.hsv)},children:e(n,{})}):null},a)})}):null]})}function D(e,a){return"hex"===e?[a?"#ffffffff":"#ffffff"]:"rgb"===e?[a?"rgba(255, 255, 255, 0.55)":"rgb(255, 255, 255)"]:[a?"hsla(360, 100%, 100%, 0.55)":"hsl(360, 100%, 100%)"]}const M={h:217,s:87,v:82};export const ColorPicker=/*@__PURE__*/r.forwardRef(function ColorPicker(n,i){const{value:f,defaultValue:m="#1a58d1",onValueChange:v,format:w="hex",alpha:k=!1,swatches:N=h,inline:_=!1,editable:j=!0,label:I,description:z,error:P,invalid:T,required:A=!1,disabled:O=!1,readOnly:L=!1,fullWidth:V=!1,clearable:$=!1,name:B,open:S,defaultOpen:q=!1,onOpenChange:K,locale:R,labels:W,variant:E="outline",size:U="md",color:X="primary",density:Y="default",elevation:F=0,className:G,style:H,...J}=C(n,["size","density","variant","locale"]),Q=t(o,R),Z=r.useMemo(()=>({...Q,...W}),[Q,W]),[ee,ae]=r.useState(m),re=f??ee,[le,ne]=r.useState(q),oe=S??le,[te,se]=r.useState(()=>u(re)??{hsv:M,alpha:1}),[ie,de]=r.useState(()=>re||""),he=c(te.hsv,k?te.alpha:1,w),ce=""===re;r.useEffect(()=>{const e=u(re);e?c(e.hsv,k?e.alpha:1,w)!==he&&(de(re),se(e)):de(re)},[re,he,k,w]);const ue=(e,a)=>{se(e);const r=c(e.hsv,k?e.alpha:1,w);de(a??r),void 0===f&&ae(r),v?.(r)},fe=O||L,pe=r.useId(),be=r.useId(),me=r.useId(),ge=e(ColorPanel,{hsv:te.hsv,alphaValue:te.alpha,onChange:ue,text:ie,onTextChange:e=>{de(e);const a=u(e);a&&ue(a,e)},withAlpha:k,swatches:N,editable:j,size:U,inert:fe,disabled:Boolean(O),labels:Z}),ve=B?e("input",{type:"hidden",name:B,value:ce?"":he}):null;if(_){const r=T??Boolean(P)?"danger":X,l=[z?be:"",P?me:""].filter(Boolean).join(" ");return a("div",{ref:i,role:"group","aria-labelledby":I?pe:void 0,"aria-describedby":l||void 0,className:b("flex flex-col",x[U],G),style:{...y(r,F),...H},...J,children:[I?e("span",{id:pe,className:b(g[U],"font-medium",O?"text-(--neba-disabled-fg)":"text-(--neba-fg)"),children:I}):null,ge,z?e("span",{id:be,className:b(g[U],"text-(--neba-muted-fg)"),children:z}):null,P?e("span",{id:me,className:b(g[U],"text-(--n-accent)"),children:P}):null,ve]})}return e("div",{ref:i,className:V?"w-full":"inline-block",...J,children:e(l,{variant:E,size:U,color:X,density:Y,elevation:F,style:H,label:I,description:z,error:P,invalid:T,required:A,disabled:O,readOnly:L,fullWidth:V,className:G,startIcon:e("span",{"aria-hidden":"true",className:b("block size-[1.15em] shrink-0 rounded-full border","[border-color:color-mix(in_oklab,var(--neba-fg)_18%,transparent)]"),style:s,children:e("span",{className:"block size-full rounded-full",style:{backgroundColor:ce?"transparent":d(te.hsv,k?te.alpha:1)}})}),display:ce?Z.empty:he,samples:D(w,k),empty:ce,clearable:$,onClear:()=>{void 0===f&&ae(""),de(""),v?.("")},open:oe,onOpenChange:e=>{void 0===S&&ne(e),K?.(e)},clearLabel:Z.clear,hiddenValues:B?[{name:B,value:ce?"":he}]:void 0,children:e("div",{className:p[U],children:ge})})})});
@@ -102,7 +102,12 @@ export interface ComboboxProps<Multiple extends boolean | undefined = false> ext
102
102
  * to the `locale`'s wording.
103
103
  */
104
104
  emptyMessage?: React.ReactNode;
105
- /** The most rows the list will show at once. `-1` is all of them. @default -1 */
105
+ /**
106
+ * The most options the list will show at once. `-1` is all of them. The row
107
+ * that offers to add what was typed is drawn beyond it, so a full list can
108
+ * still take a new value.
109
+ * @default -1
110
+ */
106
111
  limit?: number;
107
112
  /** Shown in the input while nothing is typed. */
108
113
  placeholder?: string;
@@ -139,6 +144,11 @@ export interface ComboboxProps<Multiple extends boolean | undefined = false> ext
139
144
  onOpenChange?: (open: boolean) => void;
140
145
  /** Accessible name of the clear button. Defaults to the `locale`'s word. */
141
146
  clearLabel?: string;
147
+ /**
148
+ * Accessible name of the chevron that opens the list, when the field has no
149
+ * string `label` to name it by. Defaults to the `locale`'s word.
150
+ */
151
+ openLabel?: string;
142
152
  /**
143
153
  * Accessible name of a chip's remove button. Receives the chip's label, and
144
154
  * defaults to the `locale`'s wording.
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Combobox as t}from"@base-ui/react/combobox";import{Field as n}from"@base-ui/react/field";import{Chip as i}from"../chip/Chip.js";import{actionMessages as r,comboboxMessages as s,fillMessage as o,useMessages as c}from"../../internal/i18n.js";import{CheckIcon as d,ChevronIcon as m,CloseIcon as u,PlusIcon as p}from"../../internal/icons.js";import{keyHandler as h}from"../../internal/keys.js";import{chipRemoveClasses as b,controlTextLeadingClasses as f,cx as g,disabledClasses as x,fieldFocusTransitionClasses as v,fieldHeightClasses as y,fieldReadOnlyClasses as N,fieldRestClasses as w,fieldRingClasses as j,gapClasses as C,hasContent as L,iconClasses as I,metaTextClasses as S,paddingXClasses as z,popupFadeClasses as O,radiusClasses as V,stackGapClasses as _,surfaceClasses as $,surfaceSlots as k,transitionClasses as A}from"../../internal/styles.js";import{useStyleDefaults as M}from"../../internal/defaults.js";const R=["group relative flex w-full cursor-text items-center","[-webkit-tap-highlight-color:transparent]",A,v,j,I].join(" "),T={xs:"min-h-5.5 py-0",sm:"min-h-6.5 py-[2px]",md:"min-h-8 py-[3px]",lg:"min-h-10 py-[4px]",xl:"min-h-12 py-[4px]"},q=[$,"max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain","w-[var(--anchor-width)] border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",O].join(" "),E=["relative flex cursor-pointer items-center gap-2 select-none","rounded-(--neba-radius-xs) py-1.5 pe-2 ps-7",A,"data-[highlighted]:bg-(--n-soft-hover) data-[highlighted]:text-(--n-accent)","data-[selected]:text-(--n-accent) data-[selected]:font-medium","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]"].join(" "),F=["inline-flex h-[1lh] shrink-0 cursor-pointer items-center justify-center","rounded-(--neba-radius-xs) text-(--neba-muted-fg)","[transition:color_var(--neba-duration)_var(--neba-ease)]","hover:text-(--n-accent)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1","disabled:cursor-not-allowed disabled:text-(--neba-disabled-fg)"].join(" ");function P(e){return null==e?[]:Array.isArray(e)?e.slice():[e]}export function Combobox(v){const{variant:j="outline",size:I="md",color:O="primary",density:$="default",elevation:A=0,items:B,multiple:D,value:G,defaultValue:H,onValueChange:K,filter:W,onInputValueChange:J,allowCustom:Q=!0,customLabel:U,clearable:X=!1,locale:Y,emptyMessage:Z,limit:ee,placeholder:ae,label:le,description:te,error:ne,invalid:ie,startIcon:re,fullWidth:se=!1,disabled:oe=!1,readOnly:ce=!1,required:de=!1,name:me,open:ue,defaultOpen:pe,onOpenChange:he,clearLabel:be,removeLabel:fe,inputRef:ge,shortcuts:xe,id:ve,className:ye,classNames:Ne,style:we,...je}=M(v,["size","density","variant","locale"]),Ce=c(s,Y),Le=c(r,Y),Ie=fe??(e=>o(Ce.remove,{label:e})),Se=L(ne),ze=ie??Se,Oe=ze?"danger":O,Ve=!0===D,_e=l.useMemo(()=>B.map(e=>({value:e.value,label:e.label??String(e.value),disabled:e.disabled})),[B]),[$e,ke]=l.useState(()=>P(H)),Ae=void 0===G?$e:P(G),[Me,Re]=l.useState(""),Te=l.useMemo(()=>new Map(_e.map(e=>[e.value,e])),[_e]),qe=l.useCallback(e=>Te.get(e)??{value:e,label:String(e),custom:!0},[Te]),Ee=Me.trim(),Fe=Ee.toLocaleLowerCase(),Pe=""===Ee||_e.some(e=>e.label.toLocaleLowerCase()===Fe||String(e.value).toLocaleLowerCase()===Fe)||Ae.some(e=>String(e).toLocaleLowerCase()===Fe),Be=!Q||ce||oe||Pe?null:Ee,De=l.useMemo(()=>null===Be?_e:[..._e,{value:Be,label:Be,custom:!0}],[_e,Be]),Ge=Ve?Ae.map(qe):Ae.length>0?qe(Ae[0]):null;const He=z[$][I],Ke=[R,f[I],V[I],C[I],Ve?T[I]:y[I],`${He} pe-1.5`,oe?x[j]:ce?N[j]:w[j],Ne?.shell].filter(Boolean).join(" "),We=["min-w-0 flex-1 self-stretch bg-transparent [font:inherit] text-inherit","[outline:none]","placeholder:text-(--neba-muted-fg)","caret-(--n-accent) selection:bg-(--n-soft-press)","disabled:cursor-not-allowed",Ne?.control].filter(Boolean).join(" "),Je=a=>e(t.Input,{ref:ge,onKeyDown:h(xe),placeholder:ae,className:Ve?`${We} min-w-16 ${a?"ms-1.5":""}`:We});return a(n.Root,{disabled:oe,invalid:ze,className:g("flex-col align-top",_[I],se?"flex w-full":"inline-flex",ye??""),style:{...k(Oe,A),...we},...je,children:[le?e(n.Label,{className:g(S[I],"font-medium",oe?"text-(--neba-disabled-fg)":"text-(--neba-fg)",Ne?.label),children:le}):null,a(t.Root,{id:ve,name:me,items:De,multiple:Ve,value:Ge,onValueChange:e=>{!function(e){void 0===G&&ke(e),K?.(Ve?e:e[0]??null)}((null===e?[]:Array.isArray(e)?e:[e]).map(e=>e.value))},onInputValueChange:e=>{Re(e),J?.(e)},open:ue,defaultOpen:pe,onOpenChange:e=>he?.(e),autoHighlight:!0,itemToStringLabel:e=>e.label,itemToStringValue:e=>String(e.value),isItemEqualToValue:(e,a)=>e.value===a.value,limit:ee,filter:!1===W?null:W?(e,a)=>!0===e.custom||W(e,a):void 0,disabled:oe,readOnly:ce,required:de,children:[a(t.InputGroup,{className:Ke,children:[re?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:re}):null,Ve?e(t.Chips,{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:e(t.Value,{children:n=>a(l.Fragment,{children:[n.map(a=>e(t.Chip,{render:e(i,{variant:"outline",size:I,color:Oe,density:"compact",disabled:oe,className:Ne?.chip,endIcon:ce||oe?null:e(t.ChipRemove,{"aria-label":Ie(a.label),className:b,children:e(u,{})})}),children:a.label},String(a.value))),Je(n.length>0)]})})}):Je(!1),X&&!ce?e(t.Clear,{"aria-label":be??Le.clear,className:F,children:e(u,{})}):null,e(t.Trigger,{"aria-label":"string"==typeof le?void 0:"Open",className:F,children:e(t.Icon,{className:["flex items-center","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[popup-open]:rotate-180"].join(" "),children:e(m,{})})})]}),e(t.Portal,{children:e(t.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",sideOffset:6,children:a(t.Popup,{className:g(q,V[I],f[I],Ne?.popup),style:k(Oe,3),children:[e(t.Empty,{className:"px-2 py-1.5 text-(--neba-muted-fg) empty:hidden",children:Z??Ce.empty}),e(t.List,{children:n=>e(t.Item,{value:n,disabled:n.disabled,className:g(E,Ne?.item),children:n.custom?a(l.Fragment,{children:[e("span",{className:"absolute start-1.5 flex size-4 items-center justify-center text-(--n-accent) [&_svg]:size-4",children:e(p,{})}),e("span",{className:"truncate",children:U?U(n.label):`Add “${n.label}”`})]}):a(l.Fragment,{children:[e(t.ItemIndicator,{className:"absolute start-1.5 flex size-4 items-center justify-center",children:e(d,{})}),e("span",{className:"truncate",children:n.label})]})},`${n.custom?"custom:":""}${String(n.value)}`)})]})})})]}),te?e(n.Description,{className:g(S[I],"text-(--neba-muted-fg)",Ne?.description),children:te}):null,e(n.Error,Se?{match:!0,className:g(S[I],"text-(--n-accent)",Ne?.error),children:ne}:{className:g(S[I],"text-(--n-accent)",Ne?.error)})]})}
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Combobox as t}from"@base-ui/react/combobox";import{Field as n}from"@base-ui/react/field";import{Chip as i}from"../chip/Chip.js";import{actionMessages as r,comboboxMessages as o,fillMessage as s,useMessages as c}from"../../internal/i18n.js";import{CheckIcon as d,ChevronIcon as m,CloseIcon as u,PlusIcon as p}from"../../internal/icons.js";import{keyHandler as b}from"../../internal/keys.js";import{chipRemoveClasses as h,controlTextLeadingClasses as f,cx as g,disabledClasses as v,fieldFocusTransitionClasses as x,fieldHeightClasses as y,fieldReadOnlyClasses as N,fieldRestClasses as w,fieldRingClasses as j,gapClasses as C,hasContent as L,iconClasses as I,metaTextClasses as S,paddingXClasses as z,popupFadeClasses as V,radiusClasses as O,stackGapClasses as $,surfaceClasses as _,surfaceSlots as M,transitionClasses as k}from"../../internal/styles.js";import{useStyleDefaults as A}from"../../internal/defaults.js";import{spotlightSlot as F,glowClasses as P,trackPointer as R}from"../../internal/glow.js";import{useFieldsetDisabled as T}from"../../internal/fieldset.js";const q=["group relative flex w-full cursor-text items-center","[-webkit-tap-highlight-color:transparent]",k,x,j,I].join(" "),E={xs:"min-h-5.5 py-0",sm:"min-h-6.5 py-[2px]",md:"min-h-8 py-[3px]",lg:"min-h-10 py-[4px]",xl:"min-h-12 py-[4px]"},B=[_,"max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain","w-[var(--anchor-width)] border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",V].join(" "),D=["relative flex cursor-pointer items-center gap-2 select-none","rounded-(--neba-radius-xs) py-1.5 pe-2 ps-7",k,"data-[highlighted]:bg-(--n-soft-hover) data-[highlighted]:text-(--n-on-tint)","data-[selected]:text-(--n-on-tint) data-[selected]:font-medium","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]"].join(" "),G=["inline-flex h-[1lh] shrink-0 cursor-pointer items-center justify-center","rounded-(--neba-radius-xs) text-(--neba-muted-fg)","[transition:color_var(--neba-duration)_var(--neba-ease)]","hover:text-(--n-accent)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1","disabled:cursor-not-allowed disabled:text-(--neba-disabled-fg)"].join(" ");function H(e){return null==e?[]:Array.isArray(e)?e.slice():[e]}export function Combobox(x){const{variant:j="outline",size:I="md",color:V="primary",density:_="default",elevation:k=0,items:K,multiple:W,value:J,defaultValue:Q,onValueChange:U,filter:X,onInputValueChange:Y,allowCustom:Z=!0,customLabel:ee,clearable:ae=!1,locale:le,emptyMessage:te,limit:ne,placeholder:ie,label:re,description:oe,error:se,invalid:ce,startIcon:de,fullWidth:me=!1,disabled:ue,readOnly:pe=!1,required:be=!1,name:he,open:fe,defaultOpen:ge,onOpenChange:ve,clearLabel:xe,openLabel:ye,removeLabel:Ne,inputRef:we,shortcuts:je,id:Ce,className:Le,classNames:Ie,style:Se,"aria-label":ze,"aria-labelledby":Ve,...Oe}=A(x,["size","density","variant","locale"]),$e=T(ue),_e=!$e&&!pe,Me=c(o,le),ke=c(r,le),Ae=Ne??(e=>s(Me.remove,{label:e})),Fe=L(se),Pe=ce??Fe,Re=Pe?"danger":V,Te=!0===W,qe=l.useMemo(()=>K.map(e=>({value:e.value,label:e.label??String(e.value),disabled:e.disabled})),[K]),[Ee,Be]=l.useState(()=>H(Q)),De=void 0===J?Ee:H(J),[Ge,He]=l.useState(""),Ke=l.useMemo(()=>new Map(qe.map(e=>[e.value,e])),[qe]),We=l.useCallback(e=>Ke.get(e)??{value:e,label:String(e),custom:!0},[Ke]),Je=Ge.trim(),Qe=Je.toLocaleLowerCase(),Ue=""===Je||qe.some(e=>e.label.toLocaleLowerCase()===Qe||String(e.value).toLocaleLowerCase()===Qe)||De.some(e=>String(e).toLocaleLowerCase()===Qe),Xe=!Z||pe||$e||Ue?null:Je,Ye=t.useFilter({locale:le}),Ze=null!==Xe&&void 0!==ne&&ne>-1,ea=l.useMemo(()=>{if(null===Xe)return qe;const e={value:Xe,label:Xe,custom:!0};if(!Ze)return[...qe,e];return[...(!1===X?qe:qe.filter(e=>X?X(e,Xe):Ye.contains(e.label,Xe))).slice(0,ne),e]},[qe,Xe,Ze,X,Ye,ne]),aa=Te?De.map(We):De.length>0?We(De[0]):null;const la=z[_][I],ta=[q,f[I],O[I],C[I],Te?E[I]:y[I],`${la} pe-1.5`,$e?v[j]:pe?N[j]:`${w[j]} ${P}`,Ie?.shell].filter(Boolean).join(" "),na=["neba-input min-w-0 flex-1 self-stretch bg-transparent [font:inherit] text-inherit","[outline:none]","placeholder:text-(--neba-muted-fg)","caret-(--n-accent) selection:bg-(--n-soft-press)","disabled:cursor-not-allowed",Ie?.control].filter(Boolean).join(" "),ia=a=>e(t.Input,{ref:we,"aria-label":ze,"aria-labelledby":Ve,onKeyDown:b(je),placeholder:ie,className:Te?`${na} min-w-16 ${a?"ms-1.5":""}`:na});return a(n.Root,{disabled:$e,invalid:Pe,className:g("flex-col align-top",$[I],me?"flex w-full":"inline-flex",Le??""),style:{...M(Re,k),..._e?F:void 0,...Se},...Oe,children:[re?e(n.Label,{className:g(S[I],"font-medium",$e?"text-(--neba-disabled-fg)":"text-(--neba-fg)",Ie?.label),children:re}):null,a(t.Root,{id:Ce,name:he,items:ea,multiple:Te,value:aa,onValueChange:e=>{!function(e){void 0===J&&Be(e),U?.(Te?e:e[0]??null)}((null===e?[]:Array.isArray(e)?e:[e]).map(e=>e.value))},onInputValueChange:e=>{He(e),Y?.(e)},open:fe,defaultOpen:ge,onOpenChange:e=>ve?.(e),autoHighlight:!0,itemToStringLabel:e=>e.label,itemToStringValue:e=>String(e.value),isItemEqualToValue:(e,a)=>e.value===a.value,limit:Ze?-1:ne,filter:Ze||!1===X?null:X?(e,a)=>!0===e.custom||X(e,a):void 0,disabled:$e,readOnly:pe,required:be,children:[a(t.InputGroup,{className:ta,onPointerMove:R(void 0,_e),children:[de?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:de}):null,Te?e(t.Chips,{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:e(t.Value,{children:n=>a(l.Fragment,{children:[n.map(a=>e(t.Chip,{render:e(i,{variant:"outline",size:I,color:Re,density:"compact",disabled:$e,className:Ie?.chip,endIcon:pe||$e?null:e(t.ChipRemove,{"aria-label":Ae(a.label),className:h,children:e(u,{})})}),children:a.label},String(a.value))),ia(n.length>0)]})})}):ia(!1),ae&&!pe?e(t.Clear,{"aria-label":xe??ke.clear,className:G,children:e(u,{})}):null,e(t.Trigger,{"aria-label":"string"==typeof re?void 0:ye??Me.open,className:G,children:e(t.Icon,{className:["flex items-center","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[popup-open]:rotate-180"].join(" "),children:e(m,{})})})]}),e(t.Portal,{children:e(t.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",sideOffset:6,children:a(t.Popup,{className:g(B,O[I],f[I],Ie?.popup),style:M(Re,3),children:[e(t.Empty,{className:"px-2 py-1.5 text-(--neba-muted-fg) empty:hidden",children:te??Me.empty}),e(t.List,{children:n=>e(t.Item,{value:n,disabled:n.disabled,className:g(D,Ie?.item),children:n.custom?a(l.Fragment,{children:[e("span",{className:"absolute start-1.5 flex size-4 items-center justify-center text-(--n-accent) [&_svg]:size-4",children:e(p,{})}),e("span",{className:"truncate",children:ee?ee(n.label):s(Me.add,{label:n.label})})]}):a(l.Fragment,{children:[e(t.ItemIndicator,{className:"absolute start-1.5 flex size-4 items-center justify-center",children:e(d,{})}),e("span",{className:"truncate",children:n.label})]})},`${n.custom?"custom:":""}${String(n.value)}`)})]})})})]}),oe?e(n.Description,{className:g(S[I],"text-(--neba-muted-fg)",Ie?.description),children:oe}):null,e(n.Error,Fe?{match:!0,className:g(S[I],"text-(--n-accent)",Ie?.error),children:se}:{className:g(S[I],"text-(--n-accent)",Ie?.error)})]})}