@arshad-shah/cynosure 0.4.0 → 0.5.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 (511) hide show
  1. package/README.md +6 -6
  2. package/dist/_virtual/_rolldown/runtime.js +12 -0
  3. package/dist/adapters/astro/index.d.ts +2 -1
  4. package/dist/adapters/astro/index.js.map +1 -1
  5. package/dist/components/Accordion/Accordion.d.ts +1 -1
  6. package/dist/components/Accordion/Accordion.js +26 -26
  7. package/dist/components/Accordion/Accordion.js.map +1 -1
  8. package/dist/components/Announcer/Announcer.d.ts +2 -1
  9. package/dist/components/Announcer/Announcer.js +31 -33
  10. package/dist/components/Announcer/Announcer.js.map +1 -1
  11. package/dist/components/AppShell/AppShell.js +44 -41
  12. package/dist/components/AppShell/AppShell.js.map +1 -1
  13. package/dist/components/Badge/Badge.d.ts +19 -5
  14. package/dist/components/Badge/Badge.js +19 -13
  15. package/dist/components/Badge/Badge.js.map +1 -1
  16. package/dist/components/Button/Button.d.ts +13 -3
  17. package/dist/components/Button/Button.js +34 -33
  18. package/dist/components/Button/Button.js.map +1 -1
  19. package/dist/components/Calendar/Calendar.js +155 -158
  20. package/dist/components/Calendar/Calendar.js.map +1 -1
  21. package/dist/components/Calendar/dates.js +42 -38
  22. package/dist/components/Calendar/dates.js.map +1 -1
  23. package/dist/components/Card/Card.d.ts +14 -1
  24. package/dist/components/Card/Card.js +60 -52
  25. package/dist/components/Card/Card.js.map +1 -1
  26. package/dist/components/ChatMessage/ChatMessage.d.ts +55 -0
  27. package/dist/components/ChatMessage/ChatMessage.js +50 -0
  28. package/dist/components/ChatMessage/ChatMessage.js.map +1 -0
  29. package/dist/components/ChatMessage/index.d.ts +1 -0
  30. package/dist/components/CodeBlock/CodeBlock.d.ts +6 -1
  31. package/dist/components/CodeBlock/CodeBlock.js +40 -37
  32. package/dist/components/CodeBlock/CodeBlock.js.map +1 -1
  33. package/dist/components/ColorField/ColorField.d.ts +3 -2
  34. package/dist/components/ColorField/ColorField.js +138 -139
  35. package/dist/components/ColorField/ColorField.js.map +1 -1
  36. package/dist/components/ColorField/read-color.js +5 -6
  37. package/dist/components/ColorField/read-color.js.map +1 -1
  38. package/dist/components/ColorSwatches/ColorSwatches.js +42 -33
  39. package/dist/components/ColorSwatches/ColorSwatches.js.map +1 -1
  40. package/dist/components/Combobox/Combobox.d.ts +13 -2
  41. package/dist/components/Combobox/Combobox.js +113 -95
  42. package/dist/components/Combobox/Combobox.js.map +1 -1
  43. package/dist/components/CommandPalette/CommandPalette.d.ts +14 -1
  44. package/dist/components/CommandPalette/CommandPalette.js +153 -109
  45. package/dist/components/CommandPalette/CommandPalette.js.map +1 -1
  46. package/dist/components/CommandPalette/index.d.ts +1 -1
  47. package/dist/components/CompareSlider/CompareSlider.js +14 -14
  48. package/dist/components/CompareSlider/CompareSlider.js.map +1 -1
  49. package/dist/components/Container/Container.d.ts +1 -1
  50. package/dist/components/Container/Container.js +1 -1
  51. package/dist/components/Container/Container.js.map +1 -1
  52. package/dist/components/ContextMenu/ContextMenu.d.ts +27 -13
  53. package/dist/components/ContextMenu/ContextMenu.js +64 -46
  54. package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
  55. package/dist/components/CopyButton/CopyButton.js +38 -39
  56. package/dist/components/CopyButton/CopyButton.js.map +1 -1
  57. package/dist/components/DataGrid/DataGrid.d.ts +135 -0
  58. package/dist/components/DataGrid/DataGrid.js +385 -0
  59. package/dist/components/DataGrid/DataGrid.js.map +1 -0
  60. package/dist/components/DataGrid/index.d.ts +1 -0
  61. package/dist/components/DateField/DateField.d.ts +4 -3
  62. package/dist/components/DateField/DateField.js +70 -59
  63. package/dist/components/DateField/DateField.js.map +1 -1
  64. package/dist/components/Dialog/Dialog.js +76 -80
  65. package/dist/components/Dialog/Dialog.js.map +1 -1
  66. package/dist/components/Disclosure/Disclosure.d.ts +15 -1
  67. package/dist/components/Disclosure/Disclosure.js +37 -30
  68. package/dist/components/Disclosure/Disclosure.js.map +1 -1
  69. package/dist/components/DocumentViewport/DocumentViewport.js +54 -57
  70. package/dist/components/DocumentViewport/DocumentViewport.js.map +1 -1
  71. package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +59 -0
  72. package/dist/components/ErrorBoundary/ErrorBoundary.js +53 -0
  73. package/dist/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
  74. package/dist/components/ErrorBoundary/index.d.ts +1 -0
  75. package/dist/components/Field/Field.d.ts +38 -5
  76. package/dist/components/Field/Field.js +47 -39
  77. package/dist/components/Field/Field.js.map +1 -1
  78. package/dist/components/Field/index.d.ts +1 -1
  79. package/dist/components/FileDrop/FileDrop.d.ts +26 -1
  80. package/dist/components/FileDrop/FileDrop.js +149 -98
  81. package/dist/components/FileDrop/FileDrop.js.map +1 -1
  82. package/dist/components/FloatingToolbar/FloatingToolbar.js +83 -81
  83. package/dist/components/FloatingToolbar/FloatingToolbar.js.map +1 -1
  84. package/dist/components/Grid/Grid.d.ts +3 -3
  85. package/dist/components/Grid/Grid.js +55 -47
  86. package/dist/components/Grid/Grid.js.map +1 -1
  87. package/dist/components/HighlightedText/HighlightedText.d.ts +40 -0
  88. package/dist/components/HighlightedText/HighlightedText.js +36 -0
  89. package/dist/components/HighlightedText/HighlightedText.js.map +1 -0
  90. package/dist/components/HighlightedText/index.d.ts +2 -0
  91. package/dist/components/HotkeyField/HotkeyField.d.ts +84 -0
  92. package/dist/components/HotkeyField/HotkeyField.js +161 -0
  93. package/dist/components/HotkeyField/HotkeyField.js.map +1 -0
  94. package/dist/components/HotkeyField/index.d.ts +1 -0
  95. package/dist/components/HoverCard/HoverCard.js +6 -6
  96. package/dist/components/HoverCard/HoverCard.js.map +1 -1
  97. package/dist/components/IconButton/IconButton.js +16 -15
  98. package/dist/components/IconButton/IconButton.js.map +1 -1
  99. package/dist/components/Inline/Inline.d.ts +2 -2
  100. package/dist/components/Inline/Inline.js.map +1 -1
  101. package/dist/components/Kbd/Kbd.d.ts +0 -2
  102. package/dist/components/Kbd/Kbd.js +16 -22
  103. package/dist/components/Kbd/Kbd.js.map +1 -1
  104. package/dist/components/KeyValueEditor/bulk.js +3 -4
  105. package/dist/components/KeyValueEditor/bulk.js.map +1 -1
  106. package/dist/components/ListRow/ListRow.d.ts +105 -0
  107. package/dist/components/ListRow/ListRow.js +164 -0
  108. package/dist/components/ListRow/ListRow.js.map +1 -0
  109. package/dist/components/ListRow/index.d.ts +1 -0
  110. package/dist/components/LoadingDots/LoadingDots.d.ts +7 -2
  111. package/dist/components/LoadingDots/LoadingDots.js +28 -18
  112. package/dist/components/LoadingDots/LoadingDots.js.map +1 -1
  113. package/dist/components/Menu/Menu.d.ts +29 -11
  114. package/dist/components/Menu/Menu.js +204 -111
  115. package/dist/components/Menu/Menu.js.map +1 -1
  116. package/dist/components/Menubar/Menubar.d.ts +40 -0
  117. package/dist/components/Menubar/Menubar.js +82 -0
  118. package/dist/components/Menubar/Menubar.js.map +1 -0
  119. package/dist/components/Menubar/index.d.ts +1 -0
  120. package/dist/components/Notice/Notice.d.ts +11 -2
  121. package/dist/components/Notice/Notice.js +31 -28
  122. package/dist/components/Notice/Notice.js.map +1 -1
  123. package/dist/components/NumberField/NumberField.d.ts +8 -3
  124. package/dist/components/NumberField/NumberField.js +151 -100
  125. package/dist/components/NumberField/NumberField.js.map +1 -1
  126. package/dist/components/OptionList/OptionList.d.ts +36 -3
  127. package/dist/components/OptionList/OptionList.js +65 -42
  128. package/dist/components/OptionList/OptionList.js.map +1 -1
  129. package/dist/components/OptionList/index.d.ts +1 -1
  130. package/dist/components/OverlayFrame/OverlayFrame.d.ts +33 -0
  131. package/dist/components/OverlayFrame/OverlayFrame.js +20 -0
  132. package/dist/components/OverlayFrame/OverlayFrame.js.map +1 -0
  133. package/dist/components/OverlayFrame/index.d.ts +1 -0
  134. package/dist/components/PanZoomCanvas/PanZoomCanvas.d.ts +71 -4
  135. package/dist/components/PanZoomCanvas/PanZoomCanvas.js +197 -141
  136. package/dist/components/PanZoomCanvas/PanZoomCanvas.js.map +1 -1
  137. package/dist/components/PanZoomCanvas/index.d.ts +1 -1
  138. package/dist/components/PathField/PathField.d.ts +68 -0
  139. package/dist/components/PathField/PathField.js +67 -0
  140. package/dist/components/PathField/PathField.js.map +1 -0
  141. package/dist/components/PathField/index.d.ts +1 -0
  142. package/dist/components/Popover/Popover.d.ts +16 -3
  143. package/dist/components/Popover/Popover.js +51 -42
  144. package/dist/components/Popover/Popover.js.map +1 -1
  145. package/dist/components/ProgressBar/ProgressBar.d.ts +4 -3
  146. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  147. package/dist/components/RowActions/RowActions.d.ts +35 -0
  148. package/dist/components/RowActions/RowActions.js +38 -0
  149. package/dist/components/RowActions/RowActions.js.map +1 -0
  150. package/dist/components/RowActions/index.d.ts +1 -0
  151. package/dist/components/ScrollArea/ScrollArea.d.ts +55 -0
  152. package/dist/components/ScrollArea/ScrollArea.js +55 -0
  153. package/dist/components/ScrollArea/ScrollArea.js.map +1 -0
  154. package/dist/components/ScrollArea/index.d.ts +1 -0
  155. package/dist/components/SearchField/SearchField.d.ts +17 -0
  156. package/dist/components/SearchField/SearchField.js +31 -17
  157. package/dist/components/SearchField/SearchField.js.map +1 -1
  158. package/dist/components/SearchField/index.d.ts +1 -1
  159. package/dist/components/Section/Section.d.ts +1 -1
  160. package/dist/components/Section/Section.js +1 -1
  161. package/dist/components/Section/Section.js.map +1 -1
  162. package/dist/components/SegmentedControl/SegmentedControl.d.ts +6 -3
  163. package/dist/components/SegmentedControl/SegmentedControl.js +23 -19
  164. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  165. package/dist/components/Select/Select.d.ts +22 -6
  166. package/dist/components/Select/Select.js +155 -129
  167. package/dist/components/Select/Select.js.map +1 -1
  168. package/dist/components/SelectionFrame/frame-math.js +19 -20
  169. package/dist/components/SelectionFrame/frame-math.js.map +1 -1
  170. package/dist/components/SideNav/SideNav.d.ts +13 -1
  171. package/dist/components/SideNav/SideNav.js +98 -91
  172. package/dist/components/SideNav/SideNav.js.map +1 -1
  173. package/dist/components/SignaturePad/SignaturePad.js +63 -62
  174. package/dist/components/SignaturePad/SignaturePad.js.map +1 -1
  175. package/dist/components/SignaturePad/ink.js +0 -1
  176. package/dist/components/SignaturePad/ink.js.map +1 -1
  177. package/dist/components/Slider/Slider.js +88 -91
  178. package/dist/components/Slider/Slider.js.map +1 -1
  179. package/dist/components/SortButton/SortButton.d.ts +36 -0
  180. package/dist/components/SortButton/SortButton.js +35 -0
  181. package/dist/components/SortButton/SortButton.js.map +1 -0
  182. package/dist/components/SortButton/index.d.ts +1 -0
  183. package/dist/components/SortableList/SortableList.js +145 -119
  184. package/dist/components/SortableList/SortableList.js.map +1 -1
  185. package/dist/components/SplitPane/SplitPane.d.ts +32 -12
  186. package/dist/components/SplitPane/SplitPane.js +105 -59
  187. package/dist/components/SplitPane/SplitPane.js.map +1 -1
  188. package/dist/components/Stack/Stack.d.ts +2 -2
  189. package/dist/components/Stack/Stack.js +24 -17
  190. package/dist/components/Stack/Stack.js.map +1 -1
  191. package/dist/components/Stack/index.d.ts +1 -1
  192. package/dist/components/Stat/Stat.js +6 -6
  193. package/dist/components/Stat/Stat.js.map +1 -1
  194. package/dist/components/StatusBar/StatusBar.d.ts +95 -0
  195. package/dist/components/StatusBar/StatusBar.js +110 -0
  196. package/dist/components/StatusBar/StatusBar.js.map +1 -0
  197. package/dist/components/StatusBar/index.d.ts +1 -0
  198. package/dist/components/Table/Table.d.ts +6 -6
  199. package/dist/components/Table/Table.js +71 -99
  200. package/dist/components/Table/Table.js.map +1 -1
  201. package/dist/components/Tabs/Tabs.d.ts +51 -5
  202. package/dist/components/Tabs/Tabs.js +289 -171
  203. package/dist/components/Tabs/Tabs.js.map +1 -1
  204. package/dist/components/TagInput/TagInput.d.ts +10 -2
  205. package/dist/components/TagInput/TagInput.js +121 -111
  206. package/dist/components/TagInput/TagInput.js.map +1 -1
  207. package/dist/components/Text/Text.d.ts +6 -0
  208. package/dist/components/Text/Text.js +18 -17
  209. package/dist/components/Text/Text.js.map +1 -1
  210. package/dist/components/TextArea/TextArea.d.ts +37 -6
  211. package/dist/components/TextArea/TextArea.js +200 -72
  212. package/dist/components/TextArea/TextArea.js.map +1 -1
  213. package/dist/components/TextArea/index.d.ts +1 -1
  214. package/dist/components/TextField/TextField.d.ts +18 -6
  215. package/dist/components/TextField/TextField.js +59 -54
  216. package/dist/components/TextField/TextField.js.map +1 -1
  217. package/dist/components/TimeField/TimeField.d.ts +4 -3
  218. package/dist/components/TimeField/TimeField.js +197 -183
  219. package/dist/components/TimeField/TimeField.js.map +1 -1
  220. package/dist/components/TitleBar/TitleBar.d.ts +91 -0
  221. package/dist/components/TitleBar/TitleBar.js +80 -0
  222. package/dist/components/TitleBar/TitleBar.js.map +1 -0
  223. package/dist/components/TitleBar/index.d.ts +1 -0
  224. package/dist/components/Toast/Toast.d.ts +17 -2
  225. package/dist/components/Toast/Toast.js +162 -145
  226. package/dist/components/Toast/Toast.js.map +1 -1
  227. package/dist/components/Toast/index.d.ts +1 -1
  228. package/dist/components/Toolbar/Toolbar.js +11 -12
  229. package/dist/components/Toolbar/Toolbar.js.map +1 -1
  230. package/dist/components/Tooltip/Tooltip.d.ts +18 -1
  231. package/dist/components/Tooltip/Tooltip.js +50 -31
  232. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  233. package/dist/components/Tree/Tree.d.ts +92 -11
  234. package/dist/components/Tree/Tree.js +332 -164
  235. package/dist/components/Tree/Tree.js.map +1 -1
  236. package/dist/components/VirtualList/VirtualList.d.ts +27 -4
  237. package/dist/components/VirtualList/VirtualList.js +179 -145
  238. package/dist/components/VirtualList/VirtualList.js.map +1 -1
  239. package/dist/components/VirtualList/index.d.ts +1 -1
  240. package/dist/components/ZoomControls/ZoomControls.d.ts +6 -2
  241. package/dist/components/ZoomControls/ZoomControls.js +37 -37
  242. package/dist/components/ZoomControls/ZoomControls.js.map +1 -1
  243. package/dist/entries/tokens.js +22 -16
  244. package/dist/foundations/ChoiceBase/ChoiceBase.js +15 -13
  245. package/dist/foundations/ChoiceBase/ChoiceBase.js.map +1 -1
  246. package/dist/foundations/LiveRegion/LiveRegion.d.ts +33 -0
  247. package/dist/foundations/LiveRegion/LiveRegion.js +29 -0
  248. package/dist/foundations/LiveRegion/LiveRegion.js.map +1 -0
  249. package/dist/foundations/LiveRegion/index.d.ts +1 -0
  250. package/dist/foundations/canvas-size.d.ts +14 -0
  251. package/dist/foundations/canvas-size.js +32 -0
  252. package/dist/foundations/canvas-size.js.map +1 -0
  253. package/dist/foundations/dir.js +0 -1
  254. package/dist/foundations/dir.js.map +1 -1
  255. package/dist/foundations/draft.d.ts +14 -0
  256. package/dist/foundations/draft.js +22 -0
  257. package/dist/foundations/draft.js.map +1 -0
  258. package/dist/foundations/edge.d.ts +20 -0
  259. package/dist/foundations/edge.js +26 -0
  260. package/dist/foundations/edge.js.map +1 -0
  261. package/dist/foundations/focus.d.ts +5 -0
  262. package/dist/foundations/focus.js +10 -0
  263. package/dist/foundations/focus.js.map +1 -0
  264. package/dist/foundations/hotkey.d.ts +23 -1
  265. package/dist/foundations/hotkey.js +48 -26
  266. package/dist/foundations/hotkey.js.map +1 -1
  267. package/dist/foundations/icon-size.d.ts +7 -0
  268. package/dist/foundations/icon-size.js +6 -0
  269. package/dist/foundations/icon-size.js.map +1 -0
  270. package/dist/foundations/keys.js +12 -13
  271. package/dist/foundations/keys.js.map +1 -1
  272. package/dist/{components/Stack/space.d.ts → foundations/layout.d.ts} +34 -0
  273. package/dist/foundations/layout.js +29 -0
  274. package/dist/foundations/layout.js.map +1 -0
  275. package/dist/foundations/listbox.d.ts +47 -2
  276. package/dist/foundations/listbox.js +56 -25
  277. package/dist/foundations/listbox.js.map +1 -1
  278. package/dist/foundations/math.d.ts +25 -0
  279. package/dist/foundations/math.js +14 -3
  280. package/dist/foundations/math.js.map +1 -1
  281. package/dist/foundations/media-query.d.ts +5 -0
  282. package/dist/foundations/media-query.js +14 -0
  283. package/dist/foundations/media-query.js.map +1 -0
  284. package/dist/foundations/motion.d.ts +12 -0
  285. package/dist/foundations/motion.js +21 -0
  286. package/dist/foundations/motion.js.map +1 -0
  287. package/dist/foundations/option-icon.d.ts +3 -1
  288. package/dist/foundations/option-icon.js +6 -6
  289. package/dist/foundations/option-icon.js.map +1 -1
  290. package/dist/foundations/qr.js +0 -1
  291. package/dist/foundations/qr.js.map +1 -1
  292. package/dist/foundations/refs.d.ts +8 -0
  293. package/dist/foundations/refs.js +14 -0
  294. package/dist/foundations/refs.js.map +1 -0
  295. package/dist/foundations/reorder.js +5 -6
  296. package/dist/foundations/reorder.js.map +1 -1
  297. package/dist/foundations/roving-focus.d.ts +10 -0
  298. package/dist/foundations/roving-focus.js +34 -31
  299. package/dist/foundations/roving-focus.js.map +1 -1
  300. package/dist/foundations/scroll-align.d.ts +11 -0
  301. package/dist/foundations/scroll-align.js +8 -0
  302. package/dist/foundations/scroll-align.js.map +1 -0
  303. package/dist/foundations/sort.d.ts +13 -0
  304. package/dist/foundations/sort.js +26 -0
  305. package/dist/foundations/sort.js.map +1 -0
  306. package/dist/foundations/text-match.d.ts +11 -0
  307. package/dist/foundations/text-match.js +20 -0
  308. package/dist/foundations/text-match.js.map +1 -0
  309. package/dist/foundations/tone-icons.js +4 -5
  310. package/dist/foundations/tone-icons.js.map +1 -1
  311. package/dist/foundations/use-follow.d.ts +29 -0
  312. package/dist/foundations/use-follow.js +51 -0
  313. package/dist/foundations/use-follow.js.map +1 -0
  314. package/dist/foundations/virtual-window.d.ts +22 -5
  315. package/dist/foundations/virtual-window.js +58 -54
  316. package/dist/foundations/virtual-window.js.map +1 -1
  317. package/dist/foundations/zoom-gestures.d.ts +23 -1
  318. package/dist/foundations/zoom-gestures.js +123 -84
  319. package/dist/foundations/zoom-gestures.js.map +1 -1
  320. package/dist/foundations/zoom.d.ts +10 -4
  321. package/dist/foundations/zoom.js +16 -17
  322. package/dist/foundations/zoom.js.map +1 -1
  323. package/dist/icons/boxes.d.ts +2 -0
  324. package/dist/icons/boxes.js +34 -0
  325. package/dist/icons/boxes.js.map +1 -0
  326. package/dist/icons/by-name.d.ts +11 -0
  327. package/dist/icons/by-name.js +11 -0
  328. package/dist/icons/by-name.js.map +1 -0
  329. package/dist/icons/cable.d.ts +2 -0
  330. package/dist/icons/cable.js +14 -0
  331. package/dist/icons/cable.js.map +1 -0
  332. package/dist/icons/check-check.d.ts +2 -0
  333. package/dist/icons/check-check.js +17 -0
  334. package/dist/icons/check-check.js.map +1 -0
  335. package/dist/icons/clipboard-paste.d.ts +2 -0
  336. package/dist/icons/clipboard-paste.js +30 -0
  337. package/dist/icons/clipboard-paste.js.map +1 -0
  338. package/dist/icons/facet.d.ts +274 -0
  339. package/dist/icons/facet.js +830 -0
  340. package/dist/icons/facet.js.map +1 -0
  341. package/dist/icons/file-plus.d.ts +2 -0
  342. package/dist/icons/file-plus.js +14 -0
  343. package/dist/icons/file-plus.js.map +1 -0
  344. package/dist/icons/file-question.d.ts +2 -0
  345. package/dist/icons/file-question.js +14 -0
  346. package/dist/icons/file-question.js.map +1 -0
  347. package/dist/icons/file-search.d.ts +2 -0
  348. package/dist/icons/file-search.js +24 -0
  349. package/dist/icons/file-search.js.map +1 -0
  350. package/dist/icons/function.d.ts +2 -0
  351. package/dist/icons/function.js +20 -0
  352. package/dist/icons/function.js.map +1 -0
  353. package/dist/icons/gauge.d.ts +2 -0
  354. package/dist/icons/gauge.js +14 -0
  355. package/dist/icons/gauge.js.map +1 -0
  356. package/dist/icons/hourglass.d.ts +2 -0
  357. package/dist/icons/hourglass.js +14 -0
  358. package/dist/icons/hourglass.js.map +1 -0
  359. package/dist/icons/index.d.ts +1 -250
  360. package/dist/icons/index.js +548 -500
  361. package/dist/icons/keywords.d.ts +24 -0
  362. package/dist/icons/keywords.js +185 -0
  363. package/dist/icons/keywords.js.map +1 -1
  364. package/dist/icons/languages.d.ts +2 -0
  365. package/dist/icons/languages.js +14 -0
  366. package/dist/icons/languages.js.map +1 -0
  367. package/dist/icons/loader.d.ts +2 -0
  368. package/dist/icons/loader.js +14 -0
  369. package/dist/icons/loader.js.map +1 -0
  370. package/dist/icons/monitor-down.d.ts +2 -0
  371. package/dist/icons/monitor-down.js +24 -0
  372. package/dist/icons/monitor-down.js.map +1 -0
  373. package/dist/icons/panel-right.d.ts +2 -0
  374. package/dist/icons/panel-right.js +20 -0
  375. package/dist/icons/panel-right.js.map +1 -0
  376. package/dist/icons/party-popper.d.ts +2 -0
  377. package/dist/icons/party-popper.js +14 -0
  378. package/dist/icons/party-popper.js.map +1 -0
  379. package/dist/icons/power-off.d.ts +2 -0
  380. package/dist/icons/power-off.js +14 -0
  381. package/dist/icons/power-off.js.map +1 -0
  382. package/dist/icons/rocket.d.ts +2 -0
  383. package/dist/icons/rocket.js +21 -0
  384. package/dist/icons/rocket.js.map +1 -0
  385. package/dist/icons/rows.d.ts +2 -0
  386. package/dist/icons/rows.js +20 -0
  387. package/dist/icons/rows.js.map +1 -0
  388. package/dist/icons/scissors.d.ts +2 -0
  389. package/dist/icons/scissors.js +26 -0
  390. package/dist/icons/scissors.js.map +1 -0
  391. package/dist/icons/shield-question.d.ts +2 -0
  392. package/dist/icons/shield-question.js +14 -0
  393. package/dist/icons/shield-question.js.map +1 -0
  394. package/dist/icons/square-plus.d.ts +2 -0
  395. package/dist/icons/square-plus.js +20 -0
  396. package/dist/icons/square-plus.js.map +1 -0
  397. package/dist/icons/text-select.d.ts +2 -0
  398. package/dist/icons/text-select.js +14 -0
  399. package/dist/icons/text-select.js.map +1 -0
  400. package/dist/icons/window-maximize.d.ts +2 -0
  401. package/dist/icons/window-maximize.js +14 -0
  402. package/dist/icons/window-maximize.js.map +1 -0
  403. package/dist/icons/window-restore.d.ts +2 -0
  404. package/dist/icons/window-restore.js +20 -0
  405. package/dist/icons/window-restore.js.map +1 -0
  406. package/dist/index.d.ts +24 -9
  407. package/dist/index.js +326 -282
  408. package/dist/overlay/dismiss.js +15 -13
  409. package/dist/overlay/dismiss.js.map +1 -1
  410. package/dist/overlay/floating.d.ts +7 -2
  411. package/dist/overlay/floating.js +29 -21
  412. package/dist/overlay/floating.js.map +1 -1
  413. package/dist/overlay/listbox-layer.d.ts +3 -2
  414. package/dist/overlay/listbox-layer.js.map +1 -1
  415. package/dist/overlay/position.d.ts +5 -2
  416. package/dist/overlay/position.js +19 -19
  417. package/dist/overlay/position.js.map +1 -1
  418. package/dist/overlay/toast-host.js +3 -2
  419. package/dist/overlay/toast-host.js.map +1 -1
  420. package/dist/overlay/use-anchored-position.d.ts +2 -2
  421. package/dist/overlay/use-anchored-position.js +25 -25
  422. package/dist/overlay/use-anchored-position.js.map +1 -1
  423. package/dist/styles/badge.css +1 -1
  424. package/dist/styles/base.css +1 -1
  425. package/dist/styles/button.css +1 -1
  426. package/dist/styles/calendar.css +1 -1
  427. package/dist/styles/card.css +1 -1
  428. package/dist/styles/chat-message.css +1 -0
  429. package/dist/styles/code-block.css +1 -1
  430. package/dist/styles/command-palette.css +1 -1
  431. package/dist/styles/data-grid.css +1 -0
  432. package/dist/styles/disclosure.css +1 -1
  433. package/dist/styles/error-boundary.css +1 -0
  434. package/dist/styles/field.css +1 -1
  435. package/dist/styles/file-drop.css +1 -1
  436. package/dist/styles/generated-css.d.ts +1 -1
  437. package/dist/styles/generated-css.js +3 -3
  438. package/dist/styles/generated-css.js.map +1 -1
  439. package/dist/styles/highlighted-text.css +1 -0
  440. package/dist/styles/hotkey-field.css +1 -0
  441. package/dist/styles/list-row.css +1 -0
  442. package/dist/styles/loading-dots.css +1 -1
  443. package/dist/styles/manifest.json +149 -12
  444. package/dist/styles/menu.css +1 -1
  445. package/dist/styles/menubar.css +1 -0
  446. package/dist/styles/notice.css +1 -1
  447. package/dist/styles/option-list.css +1 -1
  448. package/dist/styles/overlay-frame.css +1 -0
  449. package/dist/styles/pan-zoom-canvas.css +1 -1
  450. package/dist/styles/path-field.css +1 -0
  451. package/dist/styles/popover.css +1 -1
  452. package/dist/styles/progress-bar.css +1 -1
  453. package/dist/styles/row-actions.css +1 -0
  454. package/dist/styles/scroll-area.css +1 -0
  455. package/dist/styles/search-field.css +1 -0
  456. package/dist/styles/segmented-control.css +1 -1
  457. package/dist/styles/select.css +1 -1
  458. package/dist/styles/side-nav.css +1 -1
  459. package/dist/styles/sort-button.css +1 -0
  460. package/dist/styles/split-pane.css +1 -1
  461. package/dist/styles/status-bar.css +1 -0
  462. package/dist/styles/table.css +1 -1
  463. package/dist/styles/tabs.css +1 -1
  464. package/dist/styles/text-area.css +1 -1
  465. package/dist/styles/text-field.css +1 -1
  466. package/dist/styles/text.css +1 -1
  467. package/dist/styles/title-bar.css +1 -0
  468. package/dist/styles/toast.css +1 -1
  469. package/dist/styles/tokens.css +3 -3
  470. package/dist/styles/tree.css +1 -1
  471. package/dist/styles/virtual-list.css +1 -1
  472. package/dist/styles.css +3 -3
  473. package/dist/theme/CynosureTheme.d.ts +7 -3
  474. package/dist/theme/CynosureTheme.js +47 -31
  475. package/dist/theme/CynosureTheme.js.map +1 -1
  476. package/dist/theme/index.d.ts +1 -0
  477. package/dist/theme/theme-context.d.ts +9 -0
  478. package/dist/theme/theme-context.js +8 -0
  479. package/dist/theme/theme-context.js.map +1 -0
  480. package/dist/theme/theme-init-script.js +0 -1
  481. package/dist/theme/theme-init-script.js.map +1 -1
  482. package/dist/theme/use-color-mode.d.ts +3 -2
  483. package/dist/theme/use-color-mode.js +35 -38
  484. package/dist/theme/use-color-mode.js.map +1 -1
  485. package/dist/theme/use-cynosure-theme.d.ts +18 -0
  486. package/dist/theme/use-cynosure-theme.js +23 -0
  487. package/dist/theme/use-cynosure-theme.js.map +1 -0
  488. package/dist/tokens/chart-themes.d.ts +38 -0
  489. package/dist/tokens/chart-themes.js +35 -0
  490. package/dist/tokens/chart-themes.js.map +1 -0
  491. package/dist/tokens/create-theme.d.ts +11 -1
  492. package/dist/tokens/create-theme.js +161 -121
  493. package/dist/tokens/create-theme.js.map +1 -1
  494. package/dist/tokens/defaults.d.ts +3 -3
  495. package/dist/tokens/defaults.js +1 -0
  496. package/dist/tokens/defaults.js.map +1 -1
  497. package/dist/tokens/editor-themes.d.ts +9 -2
  498. package/dist/tokens/editor-themes.js +43 -42
  499. package/dist/tokens/editor-themes.js.map +1 -1
  500. package/dist/tokens/index.d.ts +3 -1
  501. package/dist/tokens/named-themes.d.ts +41 -0
  502. package/dist/tokens/named-themes.js +118 -0
  503. package/dist/tokens/named-themes.js.map +1 -0
  504. package/dist/tokens/schema.d.ts +24 -1
  505. package/dist/tokens/schema.js +13 -0
  506. package/dist/tokens/schema.js.map +1 -0
  507. package/dist/tokens/to-css.js +34 -31
  508. package/dist/tokens/to-css.js.map +1 -1
  509. package/package.json +10 -6
  510. package/dist/components/Stack/space.js +0 -23
  511. package/dist/components/Stack/space.js.map +0 -1
@@ -1,56 +1,60 @@
1
- "use client";
2
- var s = /^(\d{4})-(\d{2})-(\d{2})$/, c = (e, n = 2) => String(e).padStart(n, "0"), l = (e) => `${c(e.getFullYear(), 4)}-${c(e.getMonth() + 1)}-${c(e.getDate())}`;
3
- function u(e) {
4
- const n = s.exec(e.trim());
5
- if (!n) return null;
1
+ var D = /^(\d{4})-(\d{2})-(\d{2})$/, u = (n, e = 2) => String(n).padStart(e, "0"), c = (n) => `${u(n.getFullYear(), 4)}-${u(n.getMonth() + 1)}-${u(n.getDate())}`;
2
+ function s(n) {
3
+ const e = D.exec(n.trim());
4
+ if (!e) return null;
6
5
  const [t, a, r] = [
7
- Number(n[1]),
8
- Number(n[2]),
9
- Number(n[3])
6
+ Number(e[1]),
7
+ Number(e[2]),
8
+ Number(e[3])
10
9
  ], o = new Date(t, a - 1, r);
11
10
  return o.setFullYear(t), o.getMonth() === a - 1 && o.getDate() === r ? o : null;
12
11
  }
13
- var g = (e) => u(e) !== null, D = (e, n) => {
14
- const t = u(e);
15
- return t.setDate(t.getDate() + n), l(t);
12
+ var f = (n) => s(n) !== null, i = (n, e) => {
13
+ const t = s(n);
14
+ return t.setDate(t.getDate() + e), c(t);
16
15
  };
17
- function f(e, n) {
18
- const t = u(e), a = t.getDate();
19
- t.setDate(1), t.setMonth(t.getMonth() + n);
16
+ function d(n, e) {
17
+ const t = s(n), a = t.getDate();
18
+ t.setDate(1), t.setMonth(t.getMonth() + e);
20
19
  const r = new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate();
21
- return t.setDate(Math.min(a, r)), l(t);
20
+ return t.setDate(Math.min(a, r)), c(t);
22
21
  }
23
- var i = (e, n, t) => n && e < n ? n : t && e > t ? t : e;
24
- function d(e) {
22
+ var w = (n, e, t) => e && n < e ? e : t && n > t ? t : n, l = /* @__PURE__ */ new Map();
23
+ function g(n) {
25
24
  try {
26
- const n = new Intl.Locale(e ?? navigator.language), t = n.getWeekInfo?.() ?? n.weekInfo;
27
- if (t) return t.firstDay % 7;
25
+ const e = n ?? navigator.language;
26
+ let t = l.get(e);
27
+ if (t === void 0) {
28
+ const a = new Intl.Locale(e);
29
+ t = a.getWeekInfo?.() ?? a.weekInfo ?? null, l.set(e, t);
30
+ }
31
+ return t;
28
32
  } catch {
33
+ return null;
29
34
  }
30
- return 1;
31
35
  }
32
- function h(e, n) {
33
- const t = u(`${n}-01`), a = new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate();
34
- return `${n}-${c(Math.min(Number(e.slice(8)), a))}`;
36
+ function M(n) {
37
+ const e = g(n);
38
+ return e ? e.firstDay % 7 : 1;
35
39
  }
36
- function w(e) {
37
- try {
38
- const n = new Intl.Locale(e ?? navigator.language), t = (n.getWeekInfo?.() ?? n.weekInfo)?.weekend;
39
- if (t) return t.map((a) => a % 7);
40
- } catch {
41
- }
42
- return [6, 0];
40
+ function h(n, e) {
41
+ const t = s(`${e}-01`), a = new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate();
42
+ return `${e}-${u(Math.min(Number(n.slice(8)), a))}`;
43
+ }
44
+ function v(n) {
45
+ const e = g(n)?.weekend;
46
+ return e ? e.map((t) => t % 7) : [6, 0];
43
47
  }
44
48
  export {
45
- D as addDays,
46
- f as addMonths,
47
- i as clampDate,
48
- d as firstDayOfWeek,
49
- u as fromISODate,
49
+ i as addDays,
50
+ d as addMonths,
51
+ w as clampDate,
52
+ M as firstDayOfWeek,
53
+ s as fromISODate,
50
54
  h as inMonth,
51
- g as isISODate,
52
- l as toISODate,
53
- w as weekendDays
55
+ f as isISODate,
56
+ c as toISODate,
57
+ v as weekendDays
54
58
  };
55
59
 
56
60
  //# sourceMappingURL=dates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dates.js","names":["ISO","pad","n","width","toISODate","date","fromISODate","iso","m","y","mo","d","isISODate","addDays","days","addMonths","months","day","last","clampDate","min","max","firstDayOfWeek","locale","loc","info","inMonth","month","first","weekendDays","weekend"],"sources":["../../../src/components/Calendar/dates.ts"],"sourcesContent":["/**\n * Plain calendar dates as ISO strings (`2026-11-10`): no time and no time zone, so a date picked in Dublin is the same\n * date in Lahore. Strings compare in date order, and they are what forms and APIs already exchange.\n */\n\nconst ISO = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst pad = (n: number, width = 2) => String(n).padStart(width, \"0\");\n\n/** `2026-11-10` from a Date's local year, month and day. */\nexport const toISODate = (date: Date) =>\n `${pad(date.getFullYear(), 4)}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;\n\n/** A Date at local midnight, or null when `iso` is not a real date (2026-02-30 is not). */\nexport function fromISODate(iso: string): Date | null {\n const m = ISO.exec(iso.trim());\n if (!m) return null;\n const [y, mo, d] = [Number(m[1]), Number(m[2]), Number(m[3])];\n const date = new Date(y, mo - 1, d);\n date.setFullYear(y); // years below 100 would otherwise be read as 19xx\n return date.getMonth() === mo - 1 && date.getDate() === d ? date : null;\n}\n\n/** Whether `iso` is a real date, written `YYYY-MM-DD`. */\nexport const isISODate = (iso: string) => fromISODate(iso) !== null;\n\nexport const addDays = (iso: string, days: number) => {\n const date = fromISODate(iso) as Date;\n date.setDate(date.getDate() + days);\n return toISODate(date);\n};\n\n/** Months later (or earlier), keeping the day where it exists: 31 January plus a month is 28 or 29 February. */\nexport function addMonths(iso: string, months: number) {\n const date = fromISODate(iso) as Date;\n const day = date.getDate();\n date.setDate(1);\n date.setMonth(date.getMonth() + months);\n const last = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();\n date.setDate(Math.min(day, last));\n return toISODate(date);\n}\n\n/** `iso` kept within `min` and `max` (either may be absent). */\nexport const clampDate = (iso: string, min?: string, max?: string) =>\n min && iso < min ? min : max && iso > max ? max : iso;\n\n/** The weekday a week starts on in `locale` (0 Sunday to 6 Saturday), where the browser knows it; else Monday. */\nexport function firstDayOfWeek(locale?: string): number {\n try {\n // `getWeekInfo()` is the standard; `weekInfo` is the older accessor some engines still have.\n const loc = new Intl.Locale(locale ?? navigator.language) as Intl.Locale & {\n getWeekInfo?: () => { firstDay: number };\n weekInfo?: { firstDay: number };\n };\n const info = loc.getWeekInfo?.() ?? loc.weekInfo;\n if (info) return info.firstDay % 7;\n } catch {\n // An unknown locale falls through to Monday.\n }\n return 1;\n}\n\n/** The day of `iso` in `month` (`YYYY-MM`), or that month's last day when it is shorter. */\nexport function inMonth(iso: string, month: string) {\n const first = fromISODate(`${month}-01`) as Date;\n const last = new Date(first.getFullYear(), first.getMonth() + 1, 0).getDate();\n return `${month}-${pad(Math.min(Number(iso.slice(8)), last))}`;\n}\n\n/** The weekend's weekdays in `locale` (0 Sunday to 6 Saturday), where the browser knows them; else Saturday and Sunday. */\nexport function weekendDays(locale?: string): number[] {\n try {\n const loc = new Intl.Locale(locale ?? navigator.language) as Intl.Locale & {\n getWeekInfo?: () => { weekend?: number[] };\n weekInfo?: { weekend?: number[] };\n };\n const weekend = (loc.getWeekInfo?.() ?? loc.weekInfo)?.weekend;\n if (weekend) return weekend.map((day) => day % 7);\n } catch {\n // An unknown locale falls through to Saturday and Sunday.\n }\n return [6, 0];\n}\n"],"mappings":";AAKA,IAAMA,IAAM,6BACNC,IAAA,CAAOC,GAAWC,IAAQ,MAAM,OAAOD,CAAC,EAAE,SAASC,GAAO,GAAG,GAGtDC,IAAA,CAAaC,MACxB,GAAGJ,EAAII,EAAK,YAAY,GAAG,CAAC,CAAA,IAAKJ,EAAII,EAAK,SAAS,IAAI,CAAC,CAAA,IAAKJ,EAAII,EAAK,QAAQ,CAAC,CAAA;AAGjF,SAAgBC,EAAYC,GAA0B;AACpD,QAAMC,IAAIR,EAAI,KAAKO,EAAI,KAAK,CAAC;AAC7B,MAAI,CAACC,EAAG,QAAO;AACf,QAAM,CAACC,GAAGC,GAAIC,CAAA,IAAK;AAAA,IAAC,OAAOH,EAAE,CAAA,CAAE;AAAA,IAAG,OAAOA,EAAE,CAAA,CAAE;AAAA,IAAG,OAAOA,EAAE,CAAA,CAAE;AAAA,EAAC,GACtDH,IAAO,IAAI,KAAKI,GAAGC,IAAK,GAAGC,CAAC;AAClC,SAAAN,EAAK,YAAYI,CAAC,GACXJ,EAAK,SAAS,MAAMK,IAAK,KAAKL,EAAK,QAAQ,MAAMM,IAAIN,IAAO;AACrE;AAGA,IAAaO,IAAA,CAAaL,MAAgBD,EAAYC,CAAG,MAAM,MAElDM,IAAA,CAAWN,GAAaO,MAAiB;AACpD,QAAMT,IAAOC,EAAYC,CAAG;AAC5B,SAAAF,EAAK,QAAQA,EAAK,QAAQ,IAAIS,CAAI,GAC3BV,EAAUC,CAAI;AACvB;AAGA,SAAgBU,EAAUR,GAAaS,GAAgB;AACrD,QAAMX,IAAOC,EAAYC,CAAG,GACtBU,IAAMZ,EAAK,QAAQ;AACzB,EAAAA,EAAK,QAAQ,CAAC,GACdA,EAAK,SAASA,EAAK,SAAS,IAAIW,CAAM;AACtC,QAAME,IAAO,IAAI,KAAKb,EAAK,YAAY,GAAGA,EAAK,SAAS,IAAI,GAAG,CAAC,EAAE,QAAQ;AAC1E,SAAAA,EAAK,QAAQ,KAAK,IAAIY,GAAKC,CAAI,CAAC,GACzBd,EAAUC,CAAI;AACvB;AAGA,IAAac,IAAA,CAAaZ,GAAaa,GAAcC,MACnDD,KAAOb,IAAMa,IAAMA,IAAMC,KAAOd,IAAMc,IAAMA,IAAMd;AAGpD,SAAgBe,EAAeC,GAAyB;AACtD,MAAI;AAEF,UAAMC,IAAM,IAAI,KAAK,OAAOD,KAAU,UAAU,QAAQ,GAIlDE,IAAOD,EAAI,cAAc,KAAKA,EAAI;AACxC,QAAIC,EAAM,QAAOA,EAAK,WAAW;AAAA,EACnC,QAAQ;AAAA,EAER;AACA,SAAO;AACT;AAGA,SAAgBC,EAAQnB,GAAaoB,GAAe;AAClD,QAAMC,IAAQtB,EAAY,GAAGqB,CAAA,KAAU,GACjCT,IAAO,IAAI,KAAKU,EAAM,YAAY,GAAGA,EAAM,SAAS,IAAI,GAAG,CAAC,EAAE,QAAQ;AAC5E,SAAO,GAAGD,CAAA,IAAS1B,EAAI,KAAK,IAAI,OAAOM,EAAI,MAAM,CAAC,CAAC,GAAGW,CAAI,CAAC,CAAA;AAC7D;AAGA,SAAgBW,EAAYN,GAA2B;AACrD,MAAI;AACF,UAAMC,IAAM,IAAI,KAAK,OAAOD,KAAU,UAAU,QAAQ,GAIlDO,KAAWN,EAAI,cAAc,KAAKA,EAAI,WAAW;AACvD,QAAIM,EAAS,QAAOA,EAAQ,IAAA,CAAKb,MAAQA,IAAM,CAAC;AAAA,EAClD,QAAQ;AAAA,EAER;AACA,SAAO,CAAC,GAAG,CAAC;AACd"}
1
+ {"version":3,"file":"dates.js","names":["ISO","pad","width","toISODate","date","fromISODate","iso","m","y","mo","d","isISODate","addDays","days","addMonths","months","day","last","clampDate","min","max","weeks","weekInfo","locale","name","info","loc","firstDayOfWeek","inMonth","month","first","weekendDays","weekend"],"sources":["../../../src/components/Calendar/dates.ts"],"sourcesContent":["/**\n * Plain calendar dates as ISO strings (`2026-11-10`): no time and no time zone, so a date picked in Dublin is the same\n * date in Lahore. Strings compare in date order, and they are what forms and APIs already exchange.\n */\n\nconst ISO = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst pad = (n: number, width = 2) => String(n).padStart(width, \"0\");\n\n/** `2026-11-10` from a Date's local year, month and day. */\nexport const toISODate = (date: Date) =>\n `${pad(date.getFullYear(), 4)}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;\n\n/** A Date at local midnight, or null when `iso` is not a real date (2026-02-30 is not). */\nexport function fromISODate(iso: string): Date | null {\n const m = ISO.exec(iso.trim());\n if (!m) return null;\n const [y, mo, d] = [Number(m[1]), Number(m[2]), Number(m[3])];\n const date = new Date(y, mo - 1, d);\n date.setFullYear(y); // years below 100 would otherwise be read as 19xx\n return date.getMonth() === mo - 1 && date.getDate() === d ? date : null;\n}\n\n/** Whether `iso` is a real date, written `YYYY-MM-DD`. */\nexport const isISODate = (iso: string) => fromISODate(iso) !== null;\n\nexport const addDays = (iso: string, days: number) => {\n const date = fromISODate(iso) as Date;\n date.setDate(date.getDate() + days);\n return toISODate(date);\n};\n\n/** Months later (or earlier), keeping the day where it exists: 31 January plus a month is 28 or 29 February. */\nexport function addMonths(iso: string, months: number) {\n const date = fromISODate(iso) as Date;\n const day = date.getDate();\n date.setDate(1);\n date.setMonth(date.getMonth() + months);\n const last = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();\n date.setDate(Math.min(day, last));\n return toISODate(date);\n}\n\n/** `iso` kept within `min` and `max` (either may be absent). */\nexport const clampDate = (iso: string, min?: string, max?: string) =>\n min && iso < min ? min : max && iso > max ? max : iso;\n\ninterface WeekInfo {\n firstDay: number;\n weekend?: number[];\n}\nconst weeks = new Map<string, WeekInfo | null>();\n/** A locale's week (`Intl.Locale` week info), read once per locale; null where the browser does not know it. */\nfunction weekInfo(locale?: string): WeekInfo | null {\n try {\n const name = locale ?? navigator.language;\n let info = weeks.get(name);\n if (info === undefined) {\n // `getWeekInfo()` is the standard; `weekInfo` is the older accessor some engines still have.\n const loc = new Intl.Locale(name) as Intl.Locale & {\n getWeekInfo?: () => WeekInfo;\n weekInfo?: WeekInfo;\n };\n info = loc.getWeekInfo?.() ?? loc.weekInfo ?? null;\n weeks.set(name, info);\n }\n return info;\n } catch {\n // An unknown locale (or no navigator) is read as unknown.\n return null;\n }\n}\n\n/** The weekday a week starts on in `locale` (0 Sunday to 6 Saturday), where the browser knows it; else Monday. */\nexport function firstDayOfWeek(locale?: string): number {\n const info = weekInfo(locale);\n return info ? info.firstDay % 7 : 1;\n}\n\n/** The day of `iso` in `month` (`YYYY-MM`), or that month's last day when it is shorter. */\nexport function inMonth(iso: string, month: string) {\n const first = fromISODate(`${month}-01`) as Date;\n const last = new Date(first.getFullYear(), first.getMonth() + 1, 0).getDate();\n return `${month}-${pad(Math.min(Number(iso.slice(8)), last))}`;\n}\n\n/** The weekend's weekdays in `locale` (0 Sunday to 6 Saturday), where the browser knows them; else Saturday and Sunday. */\nexport function weekendDays(locale?: string): number[] {\n const weekend = weekInfo(locale)?.weekend;\n return weekend ? weekend.map((day) => day % 7) : [6, 0];\n}\n"],"mappings":"AAKA,IAAMA,IAAM,6BACNC,IAAA,CAAO,GAAWC,IAAQ,MAAM,OAAO,CAAC,EAAE,SAASA,GAAO,GAAG,GAGtDC,IAAA,CAAaC,MACxB,GAAGH,EAAIG,EAAK,YAAY,GAAG,CAAC,CAAA,IAAKH,EAAIG,EAAK,SAAS,IAAI,CAAC,CAAA,IAAKH,EAAIG,EAAK,QAAQ,CAAC,CAAA;AAGjF,SAAgBC,EAAYC,GAA0B;AACpD,QAAMC,IAAIP,EAAI,KAAKM,EAAI,KAAK,CAAC;AAC7B,MAAI,CAACC,EAAG,QAAO;AACf,QAAM,CAACC,GAAGC,GAAIC,CAAA,IAAK;AAAA,IAAC,OAAOH,EAAE,CAAA,CAAE;AAAA,IAAG,OAAOA,EAAE,CAAA,CAAE;AAAA,IAAG,OAAOA,EAAE,CAAA,CAAE;AAAA,EAAC,GACtDH,IAAO,IAAI,KAAKI,GAAGC,IAAK,GAAGC,CAAC;AAClC,SAAAN,EAAK,YAAYI,CAAC,GACXJ,EAAK,SAAS,MAAMK,IAAK,KAAKL,EAAK,QAAQ,MAAMM,IAAIN,IAAO;AACrE;AAGA,IAAaO,IAAA,CAAaL,MAAgBD,EAAYC,CAAG,MAAM,MAElDM,IAAA,CAAWN,GAAaO,MAAiB;AACpD,QAAMT,IAAOC,EAAYC,CAAG;AAC5B,SAAAF,EAAK,QAAQA,EAAK,QAAQ,IAAIS,CAAI,GAC3BV,EAAUC,CAAI;AACvB;AAGA,SAAgBU,EAAUR,GAAaS,GAAgB;AACrD,QAAMX,IAAOC,EAAYC,CAAG,GACtBU,IAAMZ,EAAK,QAAQ;AACzB,EAAAA,EAAK,QAAQ,CAAC,GACdA,EAAK,SAASA,EAAK,SAAS,IAAIW,CAAM;AACtC,QAAME,IAAO,IAAI,KAAKb,EAAK,YAAY,GAAGA,EAAK,SAAS,IAAI,GAAG,CAAC,EAAE,QAAQ;AAC1E,SAAAA,EAAK,QAAQ,KAAK,IAAIY,GAAKC,CAAI,CAAC,GACzBd,EAAUC,CAAI;AACvB;AAGA,IAAac,IAAA,CAAaZ,GAAaa,GAAcC,MACnDD,KAAOb,IAAMa,IAAMA,IAAMC,KAAOd,IAAMc,IAAMA,IAAMd,GAM9Ce,IAAQ,oBAAI,IAA6B;AAE/C,SAASC,EAASC,GAAkC;AAClD,MAAI;AACF,UAAMC,IAAOD,KAAU,UAAU;AACjC,QAAIE,IAAOJ,EAAM,IAAIG,CAAI;AACzB,QAAIC,MAAS,QAAW;AAEtB,YAAMC,IAAM,IAAI,KAAK,OAAOF,CAAI;AAIhC,MAAAC,IAAOC,EAAI,cAAc,KAAKA,EAAI,YAAY,MAC9CL,EAAM,IAAIG,GAAMC,CAAI;AAAA,IACtB;AACA,WAAOA;AAAA,EACT,QAAQ;AAEN,WAAO;AAAA,EACT;AACF;AAGA,SAAgBE,EAAeJ,GAAyB;AACtD,QAAME,IAAOH,EAASC,CAAM;AAC5B,SAAOE,IAAOA,EAAK,WAAW,IAAI;AACpC;AAGA,SAAgBG,EAAQtB,GAAauB,GAAe;AAClD,QAAMC,IAAQzB,EAAY,GAAGwB,CAAA,KAAU,GACjCZ,IAAO,IAAI,KAAKa,EAAM,YAAY,GAAGA,EAAM,SAAS,IAAI,GAAG,CAAC,EAAE,QAAQ;AAC5E,SAAO,GAAGD,CAAA,IAAS5B,EAAI,KAAK,IAAI,OAAOK,EAAI,MAAM,CAAC,CAAC,GAAGW,CAAI,CAAC,CAAA;AAC7D;AAGA,SAAgBc,EAAYR,GAA2B;AACrD,QAAMS,IAAUV,EAASC,CAAM,GAAG;AAClC,SAAOS,IAAUA,EAAQ,IAAA,CAAKhB,MAAQA,IAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AACxD"}
@@ -1,6 +1,9 @@
1
1
  import { type AriaAttributes, type CSSProperties, type MouseEventHandler, type ReactNode } from "react";
2
+ import { type Edge } from "../../foundations/edge.js";
2
3
  import type { Tone } from "../../tokens/schema.js";
3
4
  export interface CardTokens {
5
+ /** Font size of the `title`. Default: the large font size. */
6
+ titleSize: string;
4
7
  /** Border colour of the current card of a set (`aria-current`). Default: the accent. */
5
8
  currentBorder: string;
6
9
  bg: string;
@@ -27,7 +30,17 @@ export interface CardProps {
27
30
  * uses that tone's colour; any other string is a CSS colour. Colour alone carries no meaning for many people: say
28
31
  * the same thing in the card's text or a Badge. Default: no edge.
29
32
  */
30
- edge?: Tone | (string & {});
33
+ edge?: Edge;
34
+ /**
35
+ * A heading at the top of the card, above the content, beside the `actions`. In a static or link card it is a
36
+ * heading (`headingLevel`); in a button card it is plain text, as a button may not hold a heading. A `section`,
37
+ * `article` or `aside` card is named by it.
38
+ */
39
+ title?: ReactNode;
40
+ /** A quieter line under the title. */
41
+ description?: ReactNode;
42
+ /** Heading level of the title, to fit the page outline. Default 3. */
43
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
31
44
  /** Element for a static card. Ignored when `href` or `onClick` makes the whole card interactive. */
32
45
  as?: "div" | "section" | "article" | "li" | "aside";
33
46
  /** Makes the whole card a link (rendered through LinkBase, so unsafe schemes are not linked). */
@@ -1,69 +1,77 @@
1
1
  "use client";
2
- import { ButtonBase as w } from "../../foundations/ButtonBase/ButtonBase.js";
3
- import { LinkBase as R } from "../../foundations/LinkBase/LinkBase.js";
4
- import { forwardRef as b } from "react";
5
- import { jsx as t, jsxs as v } from "react/jsx-runtime";
6
- var E = [
7
- "accent",
8
- "neutral",
9
- "danger",
10
- "success",
11
- "warning",
12
- "info"
13
- ], u = b(function(a, c) {
14
- if (a.actions !== void 0 && (a.href !== void 0 || a.onClick)) {
15
- const { actions: x, style: B, ...j } = a;
16
- return /* @__PURE__ */ v("div", {
2
+ import { ButtonBase as q } from "../../foundations/ButtonBase/ButtonBase.js";
3
+ import { edgeProps as z } from "../../foundations/edge.js";
4
+ import { LinkBase as A } from "../../foundations/LinkBase/LinkBase.js";
5
+ import { createElement as b, forwardRef as D, useId as G } from "react";
6
+ import { Fragment as H, jsx as a, jsxs as t } from "react/jsx-runtime";
7
+ var C = D(function(e, d) {
8
+ const u = `${G()}-title`, s = e.title != null || e.description != null;
9
+ if (e.actions !== void 0 && (e.href !== void 0 || e.onClick)) {
10
+ const { actions: R, style: E, ...P } = e;
11
+ return /* @__PURE__ */ t("div", {
17
12
  className: "cy-card-frame cy-reset",
18
- style: B,
19
- children: [/* @__PURE__ */ t(u, {
20
- ref: c,
21
- ...j
22
- }), /* @__PURE__ */ t("div", {
13
+ "data-header": s ? "" : void 0,
14
+ style: E,
15
+ children: [/* @__PURE__ */ a(C, {
16
+ ref: d,
17
+ ...P
18
+ }), /* @__PURE__ */ a("div", {
23
19
  className: "cy-card-actions cy-reset",
24
- children: x
20
+ children: R
25
21
  })]
26
22
  });
27
23
  }
28
- const { variant: f = "surface", padding: y = "md", tone: g = "neutral", as: h = "div", href: n, target: N, onClick: r, disabled: C, actions: s, edge: e, className: o, style: l, children: d, ...k } = a, m = !!e && !E.includes(e), i = {
29
- ...k,
30
- className: o ? `cy-card ${o}` : "cy-card",
31
- style: m ? {
32
- "--_edge": e,
33
- ...l
34
- } : l,
35
- "data-edge": e ? m ? "custom" : e : void 0,
36
- "data-variant": f,
37
- "data-padding": y,
38
- "data-tone": g
24
+ const { variant: x = "surface", padding: B = "md", tone: $ = "neutral", as: i = "div", href: r, target: k, onClick: c, disabled: j, actions: n, edge: w, title: l, description: f, headingLevel: F = 3, className: N, style: I, children: o, ...g } = e, m = r === void 0 && !!c, y = m ? "span" : "div", p = r === void 0 && !c, v = s ? /* @__PURE__ */ t(H, { children: [/* @__PURE__ */ t(y, {
25
+ className: "cy-card-header cy-reset",
26
+ children: [/* @__PURE__ */ t(y, {
27
+ className: "cy-card-heading cy-reset",
28
+ children: [l != null && b(m ? "span" : `h${F}`, {
29
+ id: u,
30
+ className: "cy-card-title cy-reset"
31
+ }, l), f != null && b(m ? "span" : "p", { className: "cy-card-description cy-reset" }, f)]
32
+ }), p && n !== void 0 && /* @__PURE__ */ a("div", {
33
+ className: "cy-card-actions cy-reset",
34
+ children: n
35
+ })]
36
+ }), o != null && /* @__PURE__ */ a(y, {
37
+ className: "cy-card-body cy-reset",
38
+ children: o
39
+ })] }) : o, L = p && l != null && !g["aria-label"] && (i === "section" || i === "article" || i === "aside"), h = {
40
+ ...g,
41
+ "aria-labelledby": L ? u : void 0,
42
+ className: N ? `cy-card ${N}` : "cy-card",
43
+ ...z(w, I),
44
+ "data-variant": x,
45
+ "data-padding": B,
46
+ "data-tone": $
39
47
  };
40
- return n !== void 0 ? /* @__PURE__ */ t(R, {
41
- ref: c,
42
- ...i,
43
- href: n,
44
- target: N,
48
+ return r !== void 0 ? /* @__PURE__ */ a(A, {
49
+ ref: d,
50
+ ...h,
51
+ href: r,
52
+ target: k,
45
53
  "data-interactive": "",
46
- onClick: r,
47
- children: d
48
- }) : r ? /* @__PURE__ */ t(w, {
49
- ref: c,
50
- ...i,
51
- onClick: r,
52
- disabled: C,
54
+ onClick: c,
55
+ children: v
56
+ }) : c ? /* @__PURE__ */ a(q, {
57
+ ref: d,
58
+ ...h,
59
+ onClick: c,
60
+ disabled: j,
53
61
  "data-interactive": "",
54
- children: d
55
- }) : /* @__PURE__ */ v(h, {
56
- ref: c,
57
- ...i,
58
- children: [d, s !== void 0 && /* @__PURE__ */ t("div", {
62
+ children: v
63
+ }) : /* @__PURE__ */ t(i, {
64
+ ref: d,
65
+ ...h,
66
+ children: [v, !s && n !== void 0 && /* @__PURE__ */ a("div", {
59
67
  className: "cy-card-actions cy-reset",
60
- children: s
68
+ children: n
61
69
  })]
62
70
  });
63
71
  });
64
- u.displayName = "Card";
72
+ C.displayName = "Card";
65
73
  export {
66
- u as Card
74
+ C as Card
67
75
  };
68
76
 
69
77
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","names":["Tag","ButtonBase","LinkBase","forwardRef","jsx","jsxs","TONES","Card","props","ref","actions","style","card","variant","padding","tone","as","href","target","onClick","disabled","edge","className","children","rest","custom","common"],"sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import {\n type AriaAttributes,\n type CSSProperties,\n type ElementType,\n forwardRef,\n type MouseEventHandler,\n type ReactNode,\n} from \"react\";\nimport { ButtonBase } from \"../../foundations/ButtonBase/ButtonBase.js\";\nimport { LinkBase } from \"../../foundations/LinkBase/LinkBase.js\";\nimport type { Tone } from \"../../tokens/schema.js\";\n\nexport interface CardTokens {\n /** Border colour of the current card of a set (`aria-current`). Default: the accent. */\n currentBorder: string;\n bg: string;\n border: string;\n radius: string;\n shadow: string;\n softMix: string;\n edgeWidth: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n card: CardTokens;\n }\n}\n\nconst TONES: readonly string[] = [\"accent\", \"neutral\", \"danger\", \"success\", \"warning\", \"info\"];\n\nexport interface CardProps {\n /** `surface` raised panel, `outline` border only, `soft` tone-tinted fill. */\n variant?: \"surface\" | \"outline\" | \"soft\";\n /** Space between the card's edge and its content. Default \"md\". */\n padding?: \"none\" | \"sm\" | \"md\" | \"lg\";\n /** Semantic colour. Default \"neutral\". */\n tone?: Tone;\n /**\n * A coloured edge on the card's inline-start side (left in left-to-right text), e.g. a task's category. A tone name\n * uses that tone's colour; any other string is a CSS colour. Colour alone carries no meaning for many people: say\n * the same thing in the card's text or a Badge. Default: no edge.\n */\n edge?: Tone | (string & {});\n /** Element for a static card. Ignored when `href` or `onClick` makes the whole card interactive. */\n as?: \"div\" | \"section\" | \"article\" | \"li\" | \"aside\";\n /** Makes the whole card a link (rendered through LinkBase, so unsafe schemes are not linked). */\n href?: string;\n /** With `href`: where it opens, e.g. `_blank`. */\n target?: string;\n /** Makes the whole card a button. */\n onClick?: MouseEventHandler<HTMLElement>;\n /** With `onClick` (and no `href`): the card cannot be pressed. */\n disabled?: boolean;\n /**\n * Buttons that sit on the card but act on their own (a game card's 2-player mode, a file card's menu). They are placed\n * over the card's top end, outside its one link or button, so nothing interactive is nested.\n */\n actions?: ReactNode;\n /** Added to the card element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n /** The card's content. Keep it non-interactive when the card is a link or a button. */\n children?: ReactNode;\n /** Accessible name of the card, set on the card element. */\n \"aria-label\"?: string;\n /**\n * Marks a link or button card as the current one of a set: `\"page\"` for the page being shown (a card grid of\n * sections), or `\"step\"`, `\"location\"`, `true`. Read by screen readers, and the card's border takes the accent.\n */\n \"aria-current\"?: AriaAttributes[\"aria-current\"];\n /** Set on the card element, to find it in tests. */\n \"data-testid\"?: string;\n}\n\n/** Content container. With `href` or `onClick` the whole card is one link or button (no nested controls). */\nexport const Card = forwardRef<HTMLElement, CardProps>(function CardRender(props, ref) {\n // With actions, the card itself stays one target and the actions are its siblings in a shared frame. Layout\n // (`style`) goes on the frame; the card fills it.\n if (props.actions !== undefined && (props.href !== undefined || props.onClick)) {\n const { actions, style, ...card } = props;\n return (\n <div className=\"cy-card-frame cy-reset\" style={style}>\n <Card ref={ref} {...card} />\n <div className=\"cy-card-actions cy-reset\">{actions}</div>\n </div>\n );\n }\n const {\n variant = \"surface\",\n padding = \"md\",\n tone = \"neutral\",\n as = \"div\",\n href,\n target,\n onClick,\n disabled,\n actions,\n edge,\n className,\n style,\n children,\n ...rest\n } = props;\n // A tone name is mapped to its token in CSS; any other colour is handed over as a private custom property.\n const custom = !!edge && !TONES.includes(edge);\n const common = {\n ...rest,\n className: className ? `cy-card ${className}` : \"cy-card\",\n style: custom ? ({ \"--_edge\": edge, ...style } as CSSProperties) : style,\n \"data-edge\": edge ? (custom ? \"custom\" : edge) : undefined,\n \"data-variant\": variant,\n \"data-padding\": padding,\n \"data-tone\": tone,\n };\n if (href !== undefined)\n return (\n <LinkBase\n ref={ref as never}\n {...common}\n href={href}\n target={target}\n data-interactive=\"\"\n onClick={onClick}\n >\n {children}\n </LinkBase>\n );\n if (onClick)\n return (\n <ButtonBase ref={ref as never} {...common} onClick={onClick} disabled={disabled} data-interactive=\"\">\n {children}\n </ButtonBase>\n );\n const Tag = as as ElementType;\n return (\n <Tag ref={ref} {...common}>\n {children}\n {actions !== undefined && <div className=\"cy-card-actions cy-reset\">{actions}</div>}\n </Tag>\n );\n});\nCard.displayName = \"Card\";\n"],"mappings":";;;;;AA6BA,IAAMM,IAA2B;AAAA,EAAC;AAAA,EAAU;AAAA,EAAW;AAAA,EAAU;AAAA,EAAW;AAAA,EAAW;AAAM,GAgDhFC,IAAOJ,EAAmC,SAAoBK,GAAOC,GAAK;AAGrF,MAAID,EAAM,YAAY,WAAcA,EAAM,SAAS,UAAaA,EAAM,UAAU;AAC9E,UAAM,EAAE,SAAAE,GAAS,OAAAC,GAAO,GAAGC,EAAA,IAASJ;AACpC,WACE,gBAAAH,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAAgC,OAAAM;AAAA,MAA/C,UAAA,CACE,gBAAAP,EAACG,GAAD;AAAA,QAAW,KAAAE;AAAA,QAAK,GAAIG;AAAA,MAAO,CAAA,GAC3B,gBAAAR,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,QAA4B,UAAAM;AAAA,MAAa,CAAA,CACrD;AAAA,I;A,EAET;AACA,QAAM,EACJ,SAAAG,IAAU,WACV,SAAAC,IAAU,MACV,MAAAC,IAAO,WACP,IAAAC,IAAK,OACL,MAAAC,GACA,QAAAC,GACA,SAAAC,GACA,UAAAC,GACA,SAAAV,GACA,MAAAW,GACA,WAAAC,GACA,OAAAX,GACA,UAAAY,GACA,GAAGC,EAAA,IACDhB,GAEEiB,IAAS,CAAC,CAACJ,KAAQ,CAACf,EAAM,SAASe,CAAI,GACvCK,IAAS;AAAA,IACb,GAAGF;AAAA,IACH,WAAWF,IAAY,WAAWA,CAAA,KAAc;AAAA,IAChD,OAAOG,IAAU;AAAA,MAAE,WAAWJ;AAAA,MAAM,GAAGV;AAAA,IAAM,IAAsBA;AAAA,IACnE,aAAaU,IAAQI,IAAS,WAAWJ,IAAQ;AAAA,IACjD,gBAAgBR;AAAA,IAChB,gBAAgBC;AAAA,IAChB,aAAaC;AAAA,EACf;AACA,SAAIE,MAAS,SAET,gBAAAb,EAACF,GAAD;AAAA,IACO,KAAAO;AAAA,IACL,GAAIiB;AAAA,IACE,MAAAT;AAAA,IACE,QAAAC;AAAA,IACR,oBAAiB;AAAA,IACR,SAAAC;AAAA,IAER,UAAAI;AAAA,EACO,CAAA,IAEVJ,IAEA,gBAAAf,EAACH,GAAD;AAAA,IAAiB,KAAAQ;AAAA,IAAc,GAAIiB;AAAA,IAAiB,SAAAP;AAAA,IAAmB,UAAAC;AAAA,IAAU,oBAAiB;AAAA,IAC/F,UAAAG;AAAA,EACS,CAAA,IAId,gBAAAlB,EAACL,GAAD;AAAA,IAAU,KAAAS;AAAA,IAAK,GAAIiB;AAAA,IAAnB,UAAA,CACGH,GACAb,MAAY,UAAa,gBAAAN,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAA4B,UAAAM;AAAA,IAAa,CAAA,CAC/E;AAAA,E;AAET,CAAC;AACDH,EAAK,cAAc"}
1
+ {"version":3,"file":"Card.js","names":["_Fragment","Tag","ButtonBase","edgeProps","LinkBase","createElement","forwardRef","useId","Fragment$1","jsx","jsxs","Card","props","ref","titleId","headed","actions","style","card","variant","padding","tone","as","href","target","onClick","disabled","edge","title","description","headingLevel","className","children","rest","phrasing","Box","own","content","named","common"],"sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import {\n type AriaAttributes,\n type CSSProperties,\n createElement,\n type ElementType,\n forwardRef,\n type MouseEventHandler,\n type ReactNode,\n useId,\n} from \"react\";\nimport { ButtonBase } from \"../../foundations/ButtonBase/ButtonBase.js\";\nimport { type Edge, edgeProps } from \"../../foundations/edge.js\";\nimport { LinkBase } from \"../../foundations/LinkBase/LinkBase.js\";\nimport type { Tone } from \"../../tokens/schema.js\";\n\nexport interface CardTokens {\n /** Font size of the `title`. Default: the large font size. */\n titleSize: string;\n /** Border colour of the current card of a set (`aria-current`). Default: the accent. */\n currentBorder: string;\n bg: string;\n border: string;\n radius: string;\n shadow: string;\n softMix: string;\n edgeWidth: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n card: CardTokens;\n }\n}\n\nexport interface CardProps {\n /** `surface` raised panel, `outline` border only, `soft` tone-tinted fill. */\n variant?: \"surface\" | \"outline\" | \"soft\";\n /** Space between the card's edge and its content. Default \"md\". */\n padding?: \"none\" | \"sm\" | \"md\" | \"lg\";\n /** Semantic colour. Default \"neutral\". */\n tone?: Tone;\n /**\n * A coloured edge on the card's inline-start side (left in left-to-right text), e.g. a task's category. A tone name\n * uses that tone's colour; any other string is a CSS colour. Colour alone carries no meaning for many people: say\n * the same thing in the card's text or a Badge. Default: no edge.\n */\n edge?: Edge;\n /**\n * A heading at the top of the card, above the content, beside the `actions`. In a static or link card it is a\n * heading (`headingLevel`); in a button card it is plain text, as a button may not hold a heading. A `section`,\n * `article` or `aside` card is named by it.\n */\n title?: ReactNode;\n /** A quieter line under the title. */\n description?: ReactNode;\n /** Heading level of the title, to fit the page outline. Default 3. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** Element for a static card. Ignored when `href` or `onClick` makes the whole card interactive. */\n as?: \"div\" | \"section\" | \"article\" | \"li\" | \"aside\";\n /** Makes the whole card a link (rendered through LinkBase, so unsafe schemes are not linked). */\n href?: string;\n /** With `href`: where it opens, e.g. `_blank`. */\n target?: string;\n /** Makes the whole card a button. */\n onClick?: MouseEventHandler<HTMLElement>;\n /** With `onClick` (and no `href`): the card cannot be pressed. */\n disabled?: boolean;\n /**\n * Buttons that sit on the card but act on their own (a game card's 2-player mode, a file card's menu). They are placed\n * over the card's top end, outside its one link or button, so nothing interactive is nested.\n */\n actions?: ReactNode;\n /** Added to the card element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n /** The card's content. Keep it non-interactive when the card is a link or a button. */\n children?: ReactNode;\n /** Accessible name of the card, set on the card element. */\n \"aria-label\"?: string;\n /**\n * Marks a link or button card as the current one of a set: `\"page\"` for the page being shown (a card grid of\n * sections), or `\"step\"`, `\"location\"`, `true`. Read by screen readers, and the card's border takes the accent.\n */\n \"aria-current\"?: AriaAttributes[\"aria-current\"];\n /** Set on the card element, to find it in tests. */\n \"data-testid\"?: string;\n}\n\n/** Content container. With `href` or `onClick` the whole card is one link or button (no nested controls). */\nexport const Card = forwardRef<HTMLElement, CardProps>(function CardRender(props, ref) {\n const titleId = `${useId()}-title`;\n const headed = props.title != null || props.description != null;\n // With actions, the card itself stays one target and the actions are its siblings in a shared frame. Layout\n // (`style`) goes on the frame; the card fills it. With a header, the frame keeps a column for the actions that the\n // header stops before.\n if (props.actions !== undefined && (props.href !== undefined || props.onClick)) {\n const { actions, style, ...card } = props;\n return (\n <div className=\"cy-card-frame cy-reset\" data-header={headed ? \"\" : undefined} style={style}>\n <Card ref={ref} {...card} />\n <div className=\"cy-card-actions cy-reset\">{actions}</div>\n </div>\n );\n }\n const {\n variant = \"surface\",\n padding = \"md\",\n tone = \"neutral\",\n as = \"div\",\n href,\n target,\n onClick,\n disabled,\n actions,\n edge,\n title,\n description,\n headingLevel = 3,\n className,\n style,\n children,\n ...rest\n } = props;\n // A button holds phrasing content only: its header and body are spans, and the title is not a heading.\n const phrasing = href === undefined && !!onClick;\n const Box = phrasing ? \"span\" : \"div\";\n const own = href === undefined && !onClick;\n const content = headed ? (\n <>\n <Box className=\"cy-card-header cy-reset\">\n <Box className=\"cy-card-heading cy-reset\">\n {title != null &&\n createElement(\n phrasing ? \"span\" : `h${headingLevel}`,\n { id: titleId, className: \"cy-card-title cy-reset\" },\n title,\n )}\n {description != null &&\n createElement(\n phrasing ? \"span\" : \"p\",\n { className: \"cy-card-description cy-reset\" },\n description,\n )}\n </Box>\n {own && actions !== undefined && <div className=\"cy-card-actions cy-reset\">{actions}</div>}\n </Box>\n {children != null && <Box className=\"cy-card-body cy-reset\">{children}</Box>}\n </>\n ) : (\n children\n );\n // A sectioning card is a landmark or an article: its title names it.\n const named =\n own && title != null && !rest[\"aria-label\"] && (as === \"section\" || as === \"article\" || as === \"aside\");\n const common = {\n ...rest,\n \"aria-labelledby\": named ? titleId : undefined,\n className: className ? `cy-card ${className}` : \"cy-card\",\n ...edgeProps(edge, style),\n \"data-variant\": variant,\n \"data-padding\": padding,\n \"data-tone\": tone,\n };\n if (href !== undefined)\n return (\n <LinkBase\n ref={ref as never}\n {...common}\n href={href}\n target={target}\n data-interactive=\"\"\n onClick={onClick}\n >\n {content}\n </LinkBase>\n );\n if (onClick)\n return (\n <ButtonBase ref={ref as never} {...common} onClick={onClick} disabled={disabled} data-interactive=\"\">\n {content}\n </ButtonBase>\n );\n const Tag = as as ElementType;\n return (\n <Tag ref={ref} {...common}>\n {content}\n {!headed && actions !== undefined && <div className=\"cy-card-actions cy-reset\">{actions}</div>}\n </Tag>\n );\n});\nCard.displayName = \"Card\";\n"],"mappings":";;;;;;AA0FA,IAAaW,IAAOL,EAAmC,SAAoBM,GAAOC,GAAK;AACrF,QAAMC,IAAU,GAAGP,EAAM,CAAA,UACnBQ,IAASH,EAAM,SAAS,QAAQA,EAAM,eAAe;AAI3D,MAAIA,EAAM,YAAY,WAAcA,EAAM,SAAS,UAAaA,EAAM,UAAU;AAC9E,UAAM,EAAE,SAAAI,GAAS,OAAAC,GAAO,GAAGC,EAAA,IAASN;AACpC,WACE,gBAAAF,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAAyB,eAAaK,IAAS,KAAK;AAAA,MAAkB,OAAAE;AAAA,MAArF,UAAA,CACE,gBAAAR,EAACE,GAAD;AAAA,QAAW,KAAAE;AAAA,QAAK,GAAIK;AAAA,MAAO,CAAA,GAC3B,gBAAAT,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,QAA4B,UAAAO;AAAA,MAAa,CAAA,CACrD;AAAA,I;A,EAET;AACA,QAAM,EACJ,SAAAG,IAAU,WACV,SAAAC,IAAU,MACV,MAAAC,IAAO,WACP,IAAAC,IAAK,OACL,MAAAC,GACA,QAAAC,GACA,SAAAC,GACA,UAAAC,GACA,SAAAV,GACA,MAAAW,GACA,OAAAC,GACA,aAAAC,GACA,cAAAC,IAAe,GACf,WAAAC,GACA,OAAAd,GACA,UAAAe,GACA,GAAGC,EAAA,IACDrB,GAEEsB,IAAWX,MAAS,UAAa,CAAC,CAACE,GACnCU,IAAMD,IAAW,SAAS,OAC1BE,IAAMb,MAAS,UAAa,CAACE,GAC7BY,IAAUtB,IACd,gBAAAL,EAAAV,GAAA,EAAA,UAAA,CACE,gBAAAU,EAACyB,GAAD;AAAA,IAAK,WAAU;AAAA,IAAf,UAAA,CACE,gBAAAzB,EAACyB,GAAD;AAAA,MAAK,WAAU;AAAA,MAAf,UAAA,CACGP,KAAS,QACRvB,EACE6B,IAAW,SAAS,IAAIJ,CAAA,IACxB;AAAA,QAAE,IAAIhB;AAAA,QAAS,WAAW;AAAA,MAAyB,GACnDc,CACF,GACDC,KAAe,QACdxB,EACE6B,IAAW,SAAS,KACpB,EAAE,WAAW,+BAA+B,GAC5CL,CACF,CACC;AAAA,IACJ,CAAA,GAAAO,KAAOpB,MAAY,UAAa,gBAAAP,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAA4B,UAAAO;AAAA,IAAa,CAAA,CACtF;AAAA,EACJ,CAAA,GAAAgB,KAAY,QAAQ,gBAAAvB,EAAC0B,GAAD;AAAA,IAAK,WAAU;AAAA,IAAyB,UAAAH;AAAA,EAAc,CAAA,CAC3E,EAAA,CAAA,IAEFA,GAGIM,IACJF,KAAOR,KAAS,QAAQ,CAACK,EAAK,YAAA,MAAkBX,MAAO,aAAaA,MAAO,aAAaA,MAAO,UAC3FiB,IAAS;AAAA,IACb,GAAGN;AAAA,IACH,mBAAmBK,IAAQxB,IAAU;AAAA,IACrC,WAAWiB,IAAY,WAAWA,CAAA,KAAc;AAAA,IAChD,GAAG5B,EAAUwB,GAAMV,CAAK;AAAA,IACxB,gBAAgBE;AAAA,IAChB,gBAAgBC;AAAA,IAChB,aAAaC;AAAA,EACf;AACA,SAAIE,MAAS,SAET,gBAAAd,EAACL,GAAD;AAAA,IACO,KAAAS;AAAA,IACL,GAAI0B;AAAA,IACE,MAAAhB;AAAA,IACE,QAAAC;AAAA,IACR,oBAAiB;AAAA,IACR,SAAAC;AAAA,IAER,UAAAY;AAAA,EACO,CAAA,IAEVZ,IAEA,gBAAAhB,EAACP,GAAD;AAAA,IAAiB,KAAAW;AAAA,IAAc,GAAI0B;AAAA,IAAiB,SAAAd;AAAA,IAAmB,UAAAC;AAAA,IAAU,oBAAiB;AAAA,IAC/F,UAAAW;AAAA,EACS,CAAA,IAId,gBAAA3B,EAACT,GAAD;AAAA,IAAU,KAAAY;AAAA,IAAK,GAAI0B;AAAA,IAAnB,UAAA,CACGF,GACA,CAACtB,KAAUC,MAAY,UAAa,gBAAAP,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAA4B,UAAAO;AAAA,IAAa,CAAA,CAC1F;AAAA,E;AAET,CAAC;AACDL,EAAK,cAAc"}
@@ -0,0 +1,55 @@
1
+ import { type CSSProperties, type ReactNode } from "react";
2
+ export interface ChatMessageTokens {
3
+ caret: string;
4
+ maxWidth: string;
5
+ userColor: string;
6
+ userBg: string;
7
+ border: string;
8
+ bg: string;
9
+ padding: string;
10
+ radius: string;
11
+ gap: string;
12
+ }
13
+ declare module "../../tokens/schema.js" {
14
+ interface ComponentTokens {
15
+ chatMessage: ChatMessageTokens;
16
+ }
17
+ }
18
+ export interface ChatMessageLabels {
19
+ /** The name of a message the person wrote. Default "You". */
20
+ user: string;
21
+ /** The name of a message the assistant wrote. Default "Assistant". */
22
+ assistant: string;
23
+ /** The name of the toolbar of `actions`. Default "Message actions". */
24
+ actions: string;
25
+ }
26
+ export interface ChatMessageProps {
27
+ /** Who wrote it: the person's messages sit at the end, filled; the assistant's at the start, after `avatar`. */
28
+ role: "user" | "assistant";
29
+ /** A picture at the start of the message (end, for the person's), usually a decorative Avatar. */
30
+ avatar?: ReactNode;
31
+ /** "danger" for a message that reports a failure (the request failed, the model refused). Default "neutral". */
32
+ tone?: "neutral" | "danger";
33
+ /** Content that needs the whole row (tables, code): the bubble takes the full width instead of hugging its text. */
34
+ wide?: boolean;
35
+ /**
36
+ * Controls for the message (CopyButton, a retry IconButton), in a toolbar under it: one Tab stop, arrows between
37
+ * them. Shown while the message is hovered or holds focus, and always on screens without hover.
38
+ */
39
+ actions?: ReactNode;
40
+ /** Text is still arriving: a blinking caret follows the content and the message is busy (`aria-busy`). */
41
+ streaming?: boolean;
42
+ /** Replace the built-in English names of the message and its actions. */
43
+ labels?: Partial<ChatMessageLabels>;
44
+ /** Added to the root element, for layout. */
45
+ className?: string;
46
+ /** Layout only. Restyle through --cy-chat-message-* tokens. */
47
+ style?: CSSProperties;
48
+ /** The content. Render markdown into a Prose yourself; plain text keeps its line breaks. */
49
+ children?: ReactNode;
50
+ }
51
+ /**
52
+ * One message in an assistant chat: the person's at the end, filled with the accent; the assistant's at the start with
53
+ * its avatar. Holds any content (markdown rendered into Prose), a caret while it streams, and actions shown on hover.
54
+ */
55
+ export declare const ChatMessage: import("react").ForwardRefExoticComponent<ChatMessageProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { RowActions as y } from "../RowActions/RowActions.js";
3
+ import { Toolbar as f } from "../Toolbar/Toolbar.js";
4
+ import { forwardRef as b } from "react";
5
+ import { jsx as a, jsxs as e } from "react/jsx-runtime";
6
+ var g = {
7
+ user: "You",
8
+ assistant: "Assistant",
9
+ actions: "Message actions"
10
+ }, A = b(function({ role: t, avatar: c, tone: l = "neutral", wide: n = !1, actions: r, streaming: i = !1, labels: d, className: o, style: m, children: h }, u) {
11
+ const s = {
12
+ ...g,
13
+ ...d
14
+ };
15
+ return /* @__PURE__ */ e("article", {
16
+ ref: u,
17
+ className: `cy-chat-message${o ? ` ${o}` : ""}`,
18
+ "data-role": t,
19
+ "data-row-actions-host": "",
20
+ "data-tone": l,
21
+ "data-wide": n ? "" : void 0,
22
+ "aria-label": t === "user" ? s.user : s.assistant,
23
+ "aria-busy": i || void 0,
24
+ style: m,
25
+ children: [c && /* @__PURE__ */ a("div", {
26
+ className: "cy-chat-message-avatar cy-reset",
27
+ children: c
28
+ }), /* @__PURE__ */ e("div", {
29
+ className: "cy-chat-message-body cy-reset",
30
+ children: [/* @__PURE__ */ e("div", {
31
+ className: "cy-chat-message-bubble",
32
+ children: [h, i && /* @__PURE__ */ a("span", {
33
+ className: "cy-chat-message-caret cy-reset",
34
+ "aria-hidden": "true"
35
+ })]
36
+ }), r && /* @__PURE__ */ a(y, {
37
+ className: "cy-chat-message-actions",
38
+ children: /* @__PURE__ */ a(f, {
39
+ label: s.actions,
40
+ children: r
41
+ })
42
+ })]
43
+ })]
44
+ });
45
+ });
46
+ export {
47
+ A as ChatMessage
48
+ };
49
+
50
+ //# sourceMappingURL=ChatMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessage.js","names":["RowActions","Toolbar","forwardRef","jsx","jsxs","DEFAULT_LABELS","ChatMessage","role","avatar","tone","wide","actions","streaming","labels","className","style","children","ref","text"],"sources":["../../../src/components/ChatMessage/ChatMessage.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type ReactNode } from \"react\";\nimport { RowActions } from \"../RowActions/RowActions.js\";\nimport { Toolbar } from \"../Toolbar/Toolbar.js\";\n\nexport interface ChatMessageTokens {\n caret: string;\n maxWidth: string;\n userColor: string;\n userBg: string;\n border: string;\n bg: string;\n padding: string;\n radius: string;\n gap: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n chatMessage: ChatMessageTokens;\n }\n}\n\nexport interface ChatMessageLabels {\n /** The name of a message the person wrote. Default \"You\". */\n user: string;\n /** The name of a message the assistant wrote. Default \"Assistant\". */\n assistant: string;\n /** The name of the toolbar of `actions`. Default \"Message actions\". */\n actions: string;\n}\n\nexport interface ChatMessageProps {\n /** Who wrote it: the person's messages sit at the end, filled; the assistant's at the start, after `avatar`. */\n role: \"user\" | \"assistant\";\n /** A picture at the start of the message (end, for the person's), usually a decorative Avatar. */\n avatar?: ReactNode;\n /** \"danger\" for a message that reports a failure (the request failed, the model refused). Default \"neutral\". */\n tone?: \"neutral\" | \"danger\";\n /** Content that needs the whole row (tables, code): the bubble takes the full width instead of hugging its text. */\n wide?: boolean;\n /**\n * Controls for the message (CopyButton, a retry IconButton), in a toolbar under it: one Tab stop, arrows between\n * them. Shown while the message is hovered or holds focus, and always on screens without hover.\n */\n actions?: ReactNode;\n /** Text is still arriving: a blinking caret follows the content and the message is busy (`aria-busy`). */\n streaming?: boolean;\n /** Replace the built-in English names of the message and its actions. */\n labels?: Partial<ChatMessageLabels>;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. Restyle through --cy-chat-message-* tokens. */\n style?: CSSProperties;\n /** The content. Render markdown into a Prose yourself; plain text keeps its line breaks. */\n children?: ReactNode;\n}\n\nconst DEFAULT_LABELS: ChatMessageLabels = { user: \"You\", assistant: \"Assistant\", actions: \"Message actions\" };\n\n/**\n * One message in an assistant chat: the person's at the end, filled with the accent; the assistant's at the start with\n * its avatar. Holds any content (markdown rendered into Prose), a caret while it streams, and actions shown on hover.\n */\nexport const ChatMessage = forwardRef<HTMLElement, ChatMessageProps>(function ChatMessage(\n {\n role,\n avatar,\n tone = \"neutral\",\n wide = false,\n actions,\n streaming = false,\n labels,\n className,\n style,\n children,\n },\n ref,\n) {\n const text = { ...DEFAULT_LABELS, ...labels };\n return (\n <article\n ref={ref}\n className={`cy-chat-message${className ? ` ${className}` : \"\"}`}\n data-role={role}\n // The whole message is the row its actions show for, not only the bubble beside them.\n data-row-actions-host=\"\"\n data-tone={tone}\n data-wide={wide ? \"\" : undefined}\n aria-label={role === \"user\" ? text.user : text.assistant}\n aria-busy={streaming || undefined}\n style={style}\n >\n {avatar && <div className=\"cy-chat-message-avatar cy-reset\">{avatar}</div>}\n <div className=\"cy-chat-message-body cy-reset\">\n <div className=\"cy-chat-message-bubble\">\n {children}\n {streaming && <span className=\"cy-chat-message-caret cy-reset\" aria-hidden=\"true\" />}\n </div>\n {actions && (\n // Messages are not a roving list, so the actions are always in the Tab order: one stop, arrows between them.\n <RowActions className=\"cy-chat-message-actions\">\n <Toolbar label={text.actions}>{actions}</Toolbar>\n </RowActions>\n )}\n </div>\n </article>\n );\n});\n"],"mappings":";;;;;AAyDA,IAAMK,IAAoC;AAAA,EAAE,MAAM;AAAA,EAAO,WAAW;AAAA,EAAa,SAAS;AAAkB,GAM/FC,IAAcJ,EAA0C,SACnE,EACE,MAAAK,GACA,QAAAC,GACA,MAAAC,IAAO,WACP,MAAAC,IAAO,IACP,SAAAC,GACA,WAAAC,IAAY,IACZ,QAAAC,GACA,WAAAC,GACA,OAAAC,GACA,UAAAC,EAAA,GAEFC,GACA;AACA,QAAMC,IAAO;AAAA,IAAE,GAAGb;AAAA,IAAgB,GAAGQ;AAAA,EAAO;AAC5C,SACE,gBAAAT,EAAC,WAAD;AAAA,IACO,KAAAa;AAAA,IACL,WAAW,kBAAkBH,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IAC3D,aAAWP;AAAA,IAEX,yBAAsB;AAAA,IACtB,aAAWE;AAAA,IACX,aAAWC,IAAO,KAAK;AAAA,IACvB,cAAYH,MAAS,SAASW,EAAK,OAAOA,EAAK;AAAA,IAC/C,aAAWN,KAAa;AAAA,IACjB,OAAAG;AAAA,IAVT,UAAA,CAYGP,KAAU,gBAAAL,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAAmC,UAAAK;AAAA,IAAY,CAAA,GACzE,gBAAAJ,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAAf,UAAA,CACE,gBAAAA,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,QAAf,UAAA,CACGY,GACAJ,KAAa,gBAAAT,EAAC,QAAD;AAAA,UAAM,WAAU;AAAA,UAAiC,eAAY;AAAA,QAAQ,CAAA,CAChF;AAAA,MACJ,CAAA,GAAAQ,KAEC,gBAAAR,EAACH,GAAD;AAAA,QAAY,WAAU;AAAA,QACpB,UAAA,gBAAAG,EAACF,GAAD;AAAA,UAAS,OAAOiB,EAAK;AAAA,UAAU,UAAAP;AAAA,QAAiB,CAAA;AAAA,MACtC,CAAA,CAEX;AAAA,IACE,CAAA,CAAA;AAAA,E;AAEb,CAAC"}
@@ -0,0 +1 @@
1
+ export { ChatMessage, type ChatMessageLabels, type ChatMessageProps, type ChatMessageTokens, } from "./ChatMessage.js";
@@ -38,6 +38,11 @@ export interface CodeBlockProps {
38
38
  activeLines?: readonly number[] | undefined;
39
39
  /** Wrap long lines instead of scrolling sideways (line numbers are then left out, as they would not line up). */
40
40
  wrap?: boolean;
41
+ /**
42
+ * Buttons in the header beside the copy button, such as "Insert into editor" or "Run". Use `Button` or
43
+ * `IconButton` at `size="sm"`; they come before the copy button in the reading and tab order.
44
+ */
45
+ actions?: ReactNode;
41
46
  /** Show the copy button. Default true. */
42
47
  copyable?: boolean;
43
48
  /** Passed to the copy button (extensions can copy through their own channel). */
@@ -55,4 +60,4 @@ export interface CodeBlockProps {
55
60
  * Code to read and copy: a header with the file name or language and a copy button, then the code with optional line
56
61
  * numbers. Bring your own highlighter through `highlight`.
57
62
  */
58
- export declare function CodeBlock({ code, language, title, highlight, lineNumbers, activeLines, wrap, copyable, copy, size, labels, className, style, }: CodeBlockProps): import("react").JSX.Element;
63
+ export declare function CodeBlock({ code, language, title, highlight, lineNumbers, activeLines, wrap, actions, copyable, copy, size, labels, className, style, }: CodeBlockProps): import("react").JSX.Element;
@@ -1,72 +1,75 @@
1
1
  "use client";
2
- import { CopyButton as C } from "../CopyButton/CopyButton.js";
3
- import { useId as z } from "react";
4
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
5
- var B = (s) => `${s.length === 1 ? "Line" : "Lines"} ${s.join(", ")} highlighted`;
6
- function L({ code: s, language: t, title: i, highlight: y, lineNumbers: g = !1, activeLines: h, wrap: a = !1, copyable: p = !0, copy: b, size: $ = "md", labels: o, className: k, style: x }) {
7
- const u = z(), n = s.replace(/\n$/, ""), v = n.split(`
8
- `), f = typeof i == "string" ? i : t ?? o?.region ?? "Code", d = i ?? t, j = g && !a, r = !a && h?.length ? h.filter((c) => c >= 1 && c <= v.length) : [], N = /* @__PURE__ */ e("code", {
2
+ import { CopyButton as z } from "../CopyButton/CopyButton.js";
3
+ import { useId as B } from "react";
4
+ import { jsx as e, jsxs as d } from "react/jsx-runtime";
5
+ var I = (s) => `${s.length === 1 ? "Line" : "Lines"} ${s.join(", ")} highlighted`;
6
+ function P({ code: s, language: t, title: i, highlight: p, lineNumbers: $ = !1, activeLines: b, wrap: a = !1, actions: n, copyable: m = !0, copy: k, size: x = "md", labels: o, className: u, style: j }) {
7
+ const v = B(), y = s.replace(/\n$/, ""), N = y.split(`
8
+ `), f = typeof i == "string" ? i : t ?? o?.region ?? "Code", r = i ?? t, C = $ && !a, l = !a && b?.length ? b.filter((c) => c >= 1 && c <= N.length) : [], g = /* @__PURE__ */ e("code", {
9
9
  className: "cy-code-block-code cy-reset",
10
10
  "data-language": t,
11
- children: y ? y(n, t) : n
11
+ children: p ? p(y, t) : y
12
12
  });
13
- return /* @__PURE__ */ l("figure", {
14
- className: k ? `cy-code-block ${k}` : "cy-code-block",
15
- "data-size": $,
13
+ return /* @__PURE__ */ d("figure", {
14
+ className: u ? `cy-code-block ${u}` : "cy-code-block",
15
+ "data-size": x,
16
16
  "data-wrap": a ? "" : void 0,
17
- "aria-labelledby": d ? `${u}-title` : void 0,
18
- "aria-label": d ? void 0 : f,
19
- style: x,
17
+ "aria-labelledby": r ? `${v}-title` : void 0,
18
+ "aria-label": r ? void 0 : f,
19
+ style: j,
20
20
  children: [
21
- (d || p) && /* @__PURE__ */ l("div", {
21
+ (r || m || n) && /* @__PURE__ */ d("div", {
22
22
  className: "cy-code-block-header cy-reset",
23
23
  children: [/* @__PURE__ */ e("span", {
24
24
  className: "cy-code-block-title cy-reset",
25
- id: `${u}-title`,
26
- children: d
27
- }), p && /* @__PURE__ */ e(C, {
28
- value: s,
29
- size: "sm",
30
- variant: "ghost",
31
- tooltipPlacement: "start",
32
- ...b ? { copy: b } : {},
33
- ...o ? { labels: o } : {}
25
+ id: `${v}-title`,
26
+ children: r
27
+ }), (n || m) && /* @__PURE__ */ d("div", {
28
+ className: "cy-code-block-actions cy-reset",
29
+ children: [n, m && /* @__PURE__ */ e(z, {
30
+ value: s,
31
+ size: "sm",
32
+ variant: "ghost",
33
+ tooltipPlacement: "start",
34
+ ...k ? { copy: k } : {},
35
+ ...o ? { labels: o } : {}
36
+ })]
34
37
  })]
35
38
  }),
36
- /* @__PURE__ */ l("div", {
39
+ /* @__PURE__ */ d("div", {
37
40
  className: "cy-code-block-body cy-reset",
38
- children: [j && /* @__PURE__ */ e("span", {
41
+ children: [C && /* @__PURE__ */ e("span", {
39
42
  className: "cy-code-block-gutter cy-reset",
40
43
  "aria-hidden": "true",
41
- children: v.map((c, m) => /* @__PURE__ */ e("span", {
44
+ children: N.map((c, h) => /* @__PURE__ */ e("span", {
42
45
  className: "cy-reset",
43
- "data-active": r.includes(m + 1) ? "" : void 0,
44
- children: m + 1
45
- }, m))
46
+ "data-active": l.includes(h + 1) ? "" : void 0,
47
+ children: h + 1
48
+ }, h))
46
49
  }), a ? /* @__PURE__ */ e("pre", {
47
50
  className: "cy-code-block-pre cy-reset",
48
- children: N
49
- }) : /* @__PURE__ */ l("pre", {
51
+ children: g
52
+ }) : /* @__PURE__ */ d("pre", {
50
53
  className: "cy-code-block-pre cy-reset",
51
54
  tabIndex: 0,
52
55
  role: "region",
53
56
  "aria-label": f,
54
- children: [r.map((c) => /* @__PURE__ */ e("span", {
57
+ children: [l.map((c) => /* @__PURE__ */ e("span", {
55
58
  className: "cy-code-block-mark cy-reset",
56
59
  style: { "--_line": c - 1 },
57
60
  "aria-hidden": "true"
58
- }, c)), N]
61
+ }, c)), g]
59
62
  })]
60
63
  }),
61
- r.length > 0 && /* @__PURE__ */ e("span", {
64
+ l.length > 0 && /* @__PURE__ */ e("span", {
62
65
  className: "cy-visually-hidden",
63
- children: (o?.active ?? B)(r)
66
+ children: (o?.active ?? I)(l)
64
67
  })
65
68
  ]
66
69
  });
67
70
  }
68
71
  export {
69
- L as CodeBlock
72
+ P as CodeBlock
70
73
  };
71
74
 
72
75
  //# sourceMappingURL=CodeBlock.js.map