rift-ds 1.9.0 → 1.11.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 (377) hide show
  1. package/README.md +3 -3
  2. package/behaviors/useFocusScope.d.ts +12 -6
  3. package/behaviors/useFocusScope.js +12 -2
  4. package/behaviors/useLayer.d.ts +39 -15
  5. package/behaviors/useLayer.js +23 -11
  6. package/bin/templates/chat/app/api/chat/route.ts +3 -0
  7. package/chat/AssistantTurn.d.ts +18 -1
  8. package/chat/AssistantTurn.js +25 -5
  9. package/chat/ChatAgentPane.d.ts +22 -4
  10. package/chat/ChatAgentPane.js +20 -6
  11. package/chat/ChatArtifactPane.d.ts +16 -1
  12. package/chat/ChatArtifactPane.js +12 -10
  13. package/chat/ChatLauncher.d.ts +12 -5
  14. package/chat/ChatLauncher.js +3 -1
  15. package/chat/ChatProvider.d.ts +5 -4
  16. package/chat/ChatProvider.js +1 -1
  17. package/chat/ChatTabs.d.ts +6 -1
  18. package/chat/ChatTabs.js +3 -2
  19. package/chat/ChatThreads.d.ts +19 -4
  20. package/chat/ChatThreads.js +22 -3
  21. package/chat/ChatWidget.css +5 -4
  22. package/chat/ChatWidget.d.ts +119 -5
  23. package/chat/ChatWidget.js +159 -70
  24. package/chat/DemoWelcome.js +17 -5
  25. package/chat/FollowupSuggestions.d.ts +10 -4
  26. package/chat/FollowupSuggestions.js +13 -5
  27. package/chat/ResponseActions.d.ts +14 -0
  28. package/chat/ResponseActions.js +15 -6
  29. package/chat/TurnQuestion.d.ts +24 -0
  30. package/chat/TurnQuestion.js +46 -0
  31. package/chat/demo-card-components.js +2 -1
  32. package/chat/demo-script.js +256 -50
  33. package/chat/followups.d.ts +2 -2
  34. package/chat/followups.js +1 -0
  35. package/chat/index.d.ts +3 -2
  36. package/chat/index.js +11 -0
  37. package/chat/queries.d.ts +2 -2
  38. package/chat/queries.js +3 -2
  39. package/chat/questions.d.ts +97 -0
  40. package/chat/questions.js +140 -0
  41. package/chat/registry.json.d.ts +3 -2
  42. package/chat/registry.json.js +1 -1
  43. package/chat/server.d.ts +19 -0
  44. package/chat/server.js +45 -1
  45. package/chat/sim.d.ts +12 -1
  46. package/chat/sim.js +19 -3
  47. package/chat/threads.d.ts +17 -0
  48. package/chat/threads.js +22 -14
  49. package/chat/types.d.ts +58 -1
  50. package/chat/types.js +1 -0
  51. package/chat/useChat.d.ts +24 -3
  52. package/chat/useChat.js +42 -4
  53. package/components/Accordion/Accordion.d.ts +18 -3
  54. package/components/Accordion/Accordion.js +71 -69
  55. package/components/AgentPlan/AgentPlan.d.ts +16 -0
  56. package/components/AgentPlan/AgentPlan.js +8 -3
  57. package/components/AgentRail/AgentRail.d.ts +24 -4
  58. package/components/AgentRail/AgentRail.js +13 -6
  59. package/components/AgentStatus/AgentStatus.css +1 -0
  60. package/components/AiButton/AiButton.css +3 -1
  61. package/components/AiButton/AiButton.d.ts +7 -1
  62. package/components/AiButton/AiButton.js +6 -3
  63. package/components/Alert/Alert.d.ts +15 -4
  64. package/components/Alert/Alert.js +46 -40
  65. package/components/AlertDialog/AlertDialog.css +1 -1
  66. package/components/AlertDialog/AlertDialog.d.ts +21 -5
  67. package/components/AlertDialog/AlertDialog.js +34 -15
  68. package/components/AnchorNav/AnchorNav.css +1 -1
  69. package/components/AnchorNav/AnchorNav.d.ts +4 -1
  70. package/components/AnchorNav/AnchorNav.js +8 -8
  71. package/components/AppLayout/AppLayout.d.ts +10 -2
  72. package/components/AppLayout/AppLayout.js +55 -42
  73. package/components/AppSidebar/AppSidebar.css +9 -9
  74. package/components/AppSidebar/AppSidebar.d.ts +27 -2
  75. package/components/AppSidebar/AppSidebar.js +30 -15
  76. package/components/ArtifactPanel/ArtifactPanel.d.ts +3 -0
  77. package/components/ArtifactPanel/ArtifactPanel.js +6 -5
  78. package/components/Attachment/Attachment.css +4 -1
  79. package/components/Attachment/AttachmentGroup.d.ts +6 -0
  80. package/components/Attachment/AttachmentGroup.js +10 -1
  81. package/components/Attachment/AttachmentTile.d.ts +2 -0
  82. package/components/Attachment/AttachmentTile.js +3 -2
  83. package/components/Attachment/AttachmentViewer.js +4 -4
  84. package/components/Attachment/fileTypes.d.ts +8 -0
  85. package/components/Avatar/Avatar.css +3 -3
  86. package/components/Avatar/Avatar.d.ts +11 -3
  87. package/components/Avatar/Avatar.js +56 -51
  88. package/components/AvatarGroup/AvatarGroup.css +3 -3
  89. package/components/AvatarGroup/AvatarGroup.d.ts +6 -3
  90. package/components/AvatarGroup/AvatarGroup.js +5 -2
  91. package/components/Badge/Badge.d.ts +9 -2
  92. package/components/Badge/Badge.js +10 -10
  93. package/components/Banner/Banner.d.ts +2 -0
  94. package/components/Banner/Banner.js +2 -1
  95. package/components/BentoTile/BentoTile.css +527 -0
  96. package/components/BentoTile/BentoTile.d.ts +64 -0
  97. package/components/BentoTile/BentoTile.js +303 -0
  98. package/components/BentoTile/BentoTileArt.d.ts +28 -0
  99. package/components/BentoTile/BentoTileArt.js +19 -0
  100. package/components/BottomNav/BottomNav.css +3 -3
  101. package/components/BottomNav/BottomNav.d.ts +6 -0
  102. package/components/BottomNav/BottomNav.js +3 -1
  103. package/components/Breadcrumb/Breadcrumb.d.ts +16 -5
  104. package/components/Breadcrumb/Breadcrumb.js +32 -33
  105. package/components/Button/Button.css +123 -20
  106. package/components/Button/Button.d.ts +18 -3
  107. package/components/Button/Button.js +19 -2
  108. package/components/ButtonGroup/ButtonGroup.d.ts +17 -3
  109. package/components/ButtonGroup/ButtonGroup.js +24 -24
  110. package/components/CardStack/CardStack.d.ts +5 -0
  111. package/components/CardStack/CardStack.js +3 -7
  112. package/components/Carousel/Carousel.d.ts +33 -3
  113. package/components/Carousel/Carousel.js +178 -137
  114. package/components/Chart/AreaChart.d.ts +11 -3
  115. package/components/Chart/AreaChart.js +20 -11
  116. package/components/Chart/BarChart.d.ts +11 -3
  117. package/components/Chart/BarChart.js +19 -9
  118. package/components/Chart/Chart.css +1 -0
  119. package/components/Chart/ComboChart.d.ts +11 -3
  120. package/components/Chart/ComboChart.js +21 -11
  121. package/components/Chart/LineChart.d.ts +11 -3
  122. package/components/Chart/LineChart.js +19 -10
  123. package/components/Chart/PieChart.d.ts +11 -3
  124. package/components/Chart/PieChart.js +18 -9
  125. package/components/Chart/RadarChart.d.ts +11 -3
  126. package/components/Chart/RadarChart.js +20 -11
  127. package/components/Chart/RadialChart.d.ts +11 -3
  128. package/components/Chart/RadialChart.js +18 -9
  129. package/components/Chart/ScatterChart.d.ts +11 -3
  130. package/components/Chart/ScatterChart.js +23 -11
  131. package/components/Chart/StackedBarChart.d.ts +11 -3
  132. package/components/Chart/StackedBarChart.js +19 -10
  133. package/components/Chart/Treemap.d.ts +13 -3
  134. package/components/Chart/Treemap.js +23 -13
  135. package/components/Chart/palette.d.ts +9 -0
  136. package/components/Chart/palette.js +8 -1
  137. package/components/Chart/useChartAnimation.d.ts +42 -0
  138. package/components/Chart/useChartAnimation.js +32 -0
  139. package/components/ChatMessage/ChatMessage.css +1 -0
  140. package/components/ChatThread/ChatThread.css +21 -0
  141. package/components/ChatThread/ChatThread.d.ts +12 -1
  142. package/components/ChatThread/ChatThread.js +48 -1
  143. package/components/Checkbox/Checkbox.d.ts +12 -2
  144. package/components/Checkbox/Checkbox.js +13 -3
  145. package/components/Chip/Chip.css +24 -1
  146. package/components/Chip/Chip.d.ts +28 -7
  147. package/components/Chip/Chip.js +80 -64
  148. package/components/CircularButton/CircularButton.css +127 -1
  149. package/components/CircularButton/CircularButton.d.ts +18 -4
  150. package/components/CircularButton/CircularButton.js +14 -2
  151. package/components/CodeBlock/CodeBlock.d.ts +24 -3
  152. package/components/CodeBlock/CodeBlock.js +93 -80
  153. package/components/CodeDiff/CodeDiff.d.ts +30 -4
  154. package/components/CodeDiff/CodeDiff.js +64 -20
  155. package/components/ColorPicker/ColorPicker.css +1 -1
  156. package/components/ColorPicker/ColorPicker.d.ts +18 -0
  157. package/components/ColorPicker/ColorPicker.js +27 -21
  158. package/components/ColourSwatch/ColourSwatch.css +1 -1
  159. package/components/Combobox/Combobox.css +2 -1
  160. package/components/Combobox/Combobox.d.ts +26 -8
  161. package/components/Combobox/Combobox.js +30 -17
  162. package/components/CommandPalette/CommandPalette.css +13 -1
  163. package/components/CommandPalette/CommandPalette.d.ts +27 -4
  164. package/components/CommandPalette/CommandPalette.js +108 -70
  165. package/components/Composer/Composer.css +2 -1
  166. package/components/Composer/Composer.d.ts +10 -0
  167. package/components/Composer/Composer.js +7 -0
  168. package/components/ContactCard/ContactCard.css +1 -1
  169. package/components/ContactCard/ContactCard.d.ts +34 -5
  170. package/components/ContactCard/ContactCard.js +72 -58
  171. package/components/ContextMenu/ContextMenu.css +4 -4
  172. package/components/ContextMenu/ContextMenu.js +7 -10
  173. package/components/ContributionGraph/ContributionGraph.d.ts +37 -3
  174. package/components/ContributionGraph/ContributionGraph.js +32 -31
  175. package/components/DataTable/DataTable.d.ts +29 -0
  176. package/components/DataTable/DataTable.js +15 -10
  177. package/components/DateInput/DateInput.js +2 -2
  178. package/components/DatePicker/DatePicker.css +19 -4
  179. package/components/DatePicker/DatePicker.d.ts +31 -0
  180. package/components/DatePicker/DatePicker.js +145 -61
  181. package/components/Dialog/Dialog.css +1 -1
  182. package/components/Dialog/Dialog.d.ts +2 -0
  183. package/components/Dialog/Dialog.js +4 -3
  184. package/components/Divider/Divider.d.ts +10 -2
  185. package/components/Divider/Divider.js +56 -25
  186. package/components/DocumentChip/DocumentChip.d.ts +3 -1
  187. package/components/DocumentChip/DocumentChip.js +3 -2
  188. package/components/Drawer/Drawer.css +2 -1
  189. package/components/Drawer/Drawer.d.ts +2 -0
  190. package/components/Drawer/Drawer.js +4 -3
  191. package/components/Dropdown/Dropdown.css +1 -1
  192. package/components/Dropdown/Dropdown.d.ts +9 -2
  193. package/components/Dropdown/Dropdown.js +26 -16
  194. package/components/DropdownMenu/DropdownMenu.css +5 -5
  195. package/components/DropdownMenu/DropdownMenu.d.ts +13 -4
  196. package/components/DropdownMenu/DropdownMenu.js +41 -22
  197. package/components/EmptyState/EmptyState.d.ts +12 -4
  198. package/components/EmptyState/EmptyState.js +30 -26
  199. package/components/EntityCard/EntityCard.d.ts +7 -2
  200. package/components/EntityCard/EntityCard.js +19 -21
  201. package/components/EventCalendar/EventCalendar.d.ts +28 -0
  202. package/components/EventCalendar/EventCalendar.js +29 -27
  203. package/components/Figure/Figure.d.ts +14 -5
  204. package/components/Figure/Figure.js +19 -21
  205. package/components/FileInput/FileInput.d.ts +6 -0
  206. package/components/FileInput/FileInput.js +9 -9
  207. package/components/FilterBar/FilterBar.css +3 -3
  208. package/components/FilterBar/FilterBar.d.ts +6 -1
  209. package/components/FilterBar/FilterBar.js +15 -11
  210. package/components/FunnelChart/FunnelChart.d.ts +13 -1
  211. package/components/FunnelChart/FunnelChart.js +8 -1
  212. package/components/GanttChart/GanttChart.css +1 -1
  213. package/components/GanttChart/GanttChart.d.ts +19 -2
  214. package/components/GanttChart/GanttChart.js +17 -8
  215. package/components/Gauge/Gauge.d.ts +4 -1
  216. package/components/Globe/Globe.css +23 -0
  217. package/components/Globe/Globe.d.ts +19 -2
  218. package/components/Globe/Globe.js +66 -19
  219. package/components/HoverCard/HoverCard.css +1 -1
  220. package/components/HoverCard/HoverCard.d.ts +4 -1
  221. package/components/HoverCard/HoverCard.js +26 -15
  222. package/components/ImageCompare/ImageCompare.d.ts +4 -0
  223. package/components/ImageCompare/ImageCompare.js +4 -2
  224. package/components/Input/Input.js +2 -2
  225. package/components/Inspector/Inspector.css +55 -38
  226. package/components/Inspector/InspectorDropdown.d.ts +6 -1
  227. package/components/Inspector/InspectorDropdown.js +2 -0
  228. package/components/Inspector/InspectorSegmentedControl.d.ts +4 -3
  229. package/components/Inspector/InspectorSegmentedControl.js +63 -11
  230. package/components/Inspector/InspectorToggleSwitch.d.ts +4 -3
  231. package/components/Inspector/InspectorToggleSwitch.js +35 -2
  232. package/components/Instructions/Instructions.css +1 -1
  233. package/components/Instructions/Instructions.d.ts +16 -5
  234. package/components/Instructions/Instructions.js +31 -26
  235. package/components/InterruptCard/InterruptCard.d.ts +13 -2
  236. package/components/InterruptCard/InterruptCard.js +9 -7
  237. package/components/Lightbox/Lightbox.css +1 -1
  238. package/components/Lightbox/Lightbox.d.ts +8 -0
  239. package/components/Lightbox/Lightbox.js +10 -6
  240. package/components/LinkList/LinkList.css +2 -2
  241. package/components/LinkList/LinkList.d.ts +11 -2
  242. package/components/LinkList/LinkList.js +40 -36
  243. package/components/Mention/Mention.d.ts +4 -1
  244. package/components/MessageActions/MessageActions.css +8 -0
  245. package/components/MessageActions/MessageActions.d.ts +2 -0
  246. package/components/MessageActions/MessageActions.js +2 -1
  247. package/components/MessageCard/MessageCard.d.ts +4 -1
  248. package/components/Meter/Meter.d.ts +5 -1
  249. package/components/ModelPicker/ModelPicker.css +2 -2
  250. package/components/ModelPicker/ModelPicker.d.ts +12 -1
  251. package/components/ModelPicker/ModelPicker.js +27 -16
  252. package/components/MotionSwatch/MotionSwatch.d.ts +3 -1
  253. package/components/MotionSwatch/MotionSwatch.js +2 -1
  254. package/components/Nav/Nav.d.ts +2 -2
  255. package/components/Nav/Nav.js +17 -21
  256. package/components/NavList/NavList.d.ts +4 -0
  257. package/components/NavList/NavList.js +3 -1
  258. package/components/NotificationCenter/NotificationCenter.css +1 -1
  259. package/components/NotificationCenter/NotificationCenter.d.ts +48 -5
  260. package/components/NotificationCenter/NotificationCenter.js +32 -15
  261. package/components/NumberInput/NumberInput.d.ts +4 -0
  262. package/components/NumberInput/NumberInput.js +4 -2
  263. package/components/Pagination/Pagination.d.ts +33 -7
  264. package/components/Pagination/Pagination.js +67 -55
  265. package/components/PinInput/PinInput.d.ts +6 -0
  266. package/components/PinInput/PinInput.js +3 -1
  267. package/components/Popover/Popover.css +1 -1
  268. package/components/Popover/Popover.d.ts +21 -5
  269. package/components/Popover/Popover.js +102 -97
  270. package/components/ProgressBar/ProgressBar.d.ts +10 -3
  271. package/components/ProgressBar/ProgressBar.js +34 -22
  272. package/components/PromptSuggestions/PromptSuggestions.css +67 -0
  273. package/components/PromptSuggestions/PromptSuggestions.d.ts +10 -0
  274. package/components/PromptSuggestions/PromptSuggestions.js +41 -26
  275. package/components/QuestionCard/QuestionCard.css +358 -0
  276. package/components/QuestionCard/QuestionCard.d.ts +138 -0
  277. package/components/QuestionCard/QuestionCard.js +378 -0
  278. package/components/Quote/Quote.d.ts +8 -3
  279. package/components/Quote/Quote.js +18 -21
  280. package/components/RadioButton/RadioButton.d.ts +6 -1
  281. package/components/RadioButton/RadioButton.js +7 -2
  282. package/components/Rating/Rating.d.ts +6 -0
  283. package/components/Rating/Rating.js +4 -2
  284. package/components/Reasoning/Reasoning.css +1 -0
  285. package/components/Reasoning/Reasoning.d.ts +7 -1
  286. package/components/Reasoning/Reasoning.js +4 -1
  287. package/components/RichDropdown/RichDropdown.css +1 -1
  288. package/components/RichDropdown/RichDropdown.d.ts +3 -1
  289. package/components/RichDropdown/RichDropdown.js +20 -15
  290. package/components/SectionTitle/SectionTitle.d.ts +15 -3
  291. package/components/SectionTitle/SectionTitle.js +15 -17
  292. package/components/SegmentedControl/SegmentedControl.css +3 -2
  293. package/components/SegmentedControl/SegmentedControl.d.ts +49 -7
  294. package/components/SegmentedControl/SegmentedControl.js +248 -223
  295. package/components/SelectionCard/SelectionCard.d.ts +7 -1
  296. package/components/SelectionCard/SelectionCard.js +16 -2
  297. package/components/ShaderField/ShaderField.js +2 -1
  298. package/components/ShaderField/useShaderField.js +3 -2
  299. package/components/SidebarPanel/SidebarPanel.d.ts +6 -1
  300. package/components/SidebarPanel/SidebarPanel.js +2 -1
  301. package/components/Skeleton/Skeleton.d.ts +12 -3
  302. package/components/Skeleton/Skeleton.js +53 -19
  303. package/components/Slider/Slider.d.ts +11 -2
  304. package/components/Slider/Slider.js +11 -6
  305. package/components/SourceChip/SourceChip.css +1 -1
  306. package/components/SourceChip/SourceChip.d.ts +5 -2
  307. package/components/SourceChip/SourceChip.js +14 -13
  308. package/components/SourceTrail/SourceTrail.d.ts +15 -0
  309. package/components/SourceTrail/SourceTrail.js +10 -4
  310. package/components/Sparkline/Sparkline.d.ts +4 -3
  311. package/components/Sparkline/Sparkline.js +2 -1
  312. package/components/Spinner/Spinner.d.ts +21 -4
  313. package/components/Spinner/Spinner.js +38 -37
  314. package/components/SplitButton/SplitButton.d.ts +10 -1
  315. package/components/SplitButton/SplitButton.js +13 -3
  316. package/components/Stat/Stat.d.ts +7 -2
  317. package/components/Stat/Stat.js +30 -25
  318. package/components/StatusDot/StatusDot.css +1 -0
  319. package/components/Stepper/Stepper.css +13 -0
  320. package/components/Stepper/Stepper.d.ts +6 -0
  321. package/components/Stepper/Stepper.js +2 -0
  322. package/components/StreamingText/StreamingText.d.ts +4 -4
  323. package/components/StreamingText/StreamingText.js +3 -2
  324. package/components/Tabs/Tabs.d.ts +41 -6
  325. package/components/Tabs/Tabs.js +99 -69
  326. package/components/TagInput/TagInput.d.ts +2 -0
  327. package/components/TagInput/TagInput.js +7 -2
  328. package/components/Textarea/Textarea.d.ts +6 -1
  329. package/components/Textarea/Textarea.js +11 -5
  330. package/components/ThreadPanel/ThreadPanel.css +1 -1
  331. package/components/ThreadPanel/ThreadPanel.d.ts +11 -4
  332. package/components/ThreadPanel/ThreadPanel.js +3 -1
  333. package/components/ThreadTabs/ThreadTabs.d.ts +7 -2
  334. package/components/ThreadTabs/ThreadTabs.js +1 -1
  335. package/components/TimePicker/TimePicker.css +1 -1
  336. package/components/TimePicker/TimePicker.d.ts +14 -1
  337. package/components/TimePicker/TimePicker.js +22 -17
  338. package/components/Timeline/Timeline.css +2 -2
  339. package/components/Timeline/Timeline.d.ts +11 -2
  340. package/components/Timeline/Timeline.js +37 -26
  341. package/components/Toast/Toast.css +2 -2
  342. package/components/Toast/Toast.d.ts +24 -6
  343. package/components/Toast/Toast.js +50 -41
  344. package/components/ToggleGroup/ToggleGroup.css +3 -2
  345. package/components/ToggleGroup/ToggleGroup.d.ts +26 -4
  346. package/components/ToggleGroup/ToggleGroup.js +12 -5
  347. package/components/ToggleSwitch/ToggleSwitch.d.ts +6 -1
  348. package/components/ToggleSwitch/ToggleSwitch.js +7 -2
  349. package/components/ToolCall/ToolCall.js +1 -1
  350. package/components/Tooltip/Tooltip.css +5 -5
  351. package/components/Tooltip/Tooltip.d.ts +15 -4
  352. package/components/Tooltip/Tooltip.js +80 -61
  353. package/components/TopAppBar/TopAppBar.css +1 -1
  354. package/components/TopAppBar/TopAppBar.d.ts +9 -1
  355. package/components/TopAppBar/TopAppBar.js +3 -1
  356. package/components/TypographySwatch/TypographySwatch.css +1 -1
  357. package/components/UsageCard/UsageCard.d.ts +4 -1
  358. package/components/Waveform/Waveform.css +1 -0
  359. package/components/Waveform/Waveform.d.ts +1 -1
  360. package/components/WorldMap/WorldMap.d.ts +12 -0
  361. package/components/WorldMap/WorldMap.js +11 -5
  362. package/components/registry.json +44 -19
  363. package/components/registry.json.d.ts +44 -19
  364. package/components/registry.json.js +1 -1
  365. package/index.d.ts +3 -0
  366. package/index.js +7 -0
  367. package/package.json +5 -1
  368. package/tokens/breakpoints.d.ts +60 -0
  369. package/tokens/breakpoints.js +92 -0
  370. package/tokens/motion.d.ts +14 -0
  371. package/tokens/motion.js +15 -1
  372. package/tokens/registry.d.ts +1 -1
  373. package/tokens/registry.json +21 -0
  374. package/tokens/registry.json.d.ts +21 -0
  375. package/tokens/registry.json.js +1 -1
  376. package/tokens/tokens-dark.css +7 -0
  377. package/tokens/tokens-light.css +41 -0
@@ -116,7 +116,7 @@
116
116
 
117
117
  /* Align dot markers with the title's line box */
118
118
  .ds-timeline--vertical .ds-timeline__marker {
119
- margin-top: 6px;
119
+ margin-top: 6px; /* ds-allow(spacing): centres the dot on the title's first line box */
120
120
  }
121
121
 
122
122
  .ds-timeline--vertical .ds-timeline__marker--badge,
@@ -315,7 +315,7 @@
315
315
 
316
316
  .ds-timeline__role-bullets {
317
317
  margin: 0;
318
- padding-left: 20px;
318
+ padding-left: var(--padding-500);
319
319
  list-style: disc;
320
320
  display: flex;
321
321
  flex-direction: column;
@@ -54,14 +54,23 @@ export interface TimelineCompanyProps {
54
54
  variant: 'company';
55
55
  /** Ordered list of company/tool entries */
56
56
  items: TimelineCompany[];
57
+ /** Text shown in place of the end date for a role marked `present` */
58
+ presentLabel?: string;
57
59
  /** Additional CSS classes */
58
60
  className?: string;
59
61
  }
60
- export type TimelineProps = TimelineDefaultProps | TimelineCompanyProps;
62
+ /**
63
+ * Timeline props: one of the two variants' own props, plus the native `<ol>`
64
+ * attributes, which reach the list in both variants.
65
+ */
66
+ export type TimelineProps = (TimelineDefaultProps | TimelineCompanyProps) & Omit<React.ComponentPropsWithoutRef<'ol'>, keyof TimelineDefaultProps | keyof TimelineCompanyProps | 'children'>;
61
67
  /**
62
68
  * Timeline component — an ordered sequence of steps or events with
63
69
  * connected markers. Vertical for histories and process narratives,
64
70
  * horizontal for compact steppers. The `company` variant groups one or
65
71
  * more roles under a logo marker for résumé/pipeline histories.
72
+ *
73
+ * The forwarded ref and any unrecognised props target the `<ol>` in both
74
+ * variants.
66
75
  */
67
- export declare const Timeline: (props: TimelineProps) => React.JSX.Element;
76
+ export declare const Timeline: React.ForwardRefExoticComponent<TimelineProps & React.RefAttributes<HTMLOListElement>>;
@@ -1,40 +1,50 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import "react";
2
+ import React from "react";
3
3
  import "./Timeline.css";
4
4
  import "../../fonts/material-symbols.css";
5
5
  const BASE_CLASS = "ds-timeline";
6
- const renderRoleDates = (role) => {
6
+ const renderRoleDates = (role, presentLabel) => {
7
7
  if (!role.start) return null;
8
8
  return /* @__PURE__ */ jsxs("span", { className: `${BASE_CLASS}__role-dates`, children: [
9
9
  role.start,
10
10
  " –",
11
11
  " ",
12
- role.present ? /* @__PURE__ */ jsx("span", { className: `${BASE_CLASS}__present`, children: "Present" }) : role.end
12
+ role.present ? /* @__PURE__ */ jsx("span", { className: `${BASE_CLASS}__present`, children: presentLabel }) : role.end
13
13
  ] });
14
14
  };
15
- const CompanyTimeline = ({ items, className = "" }) => {
16
- const classes = [BASE_CLASS, `${BASE_CLASS}--vertical`, `${BASE_CLASS}--company`, className].filter(Boolean).join(" ");
17
- return /* @__PURE__ */ jsx("ol", { className: classes, children: items.map((company, index) => /* @__PURE__ */ jsxs("li", { className: `${BASE_CLASS}__item`, children: [
18
- /* @__PURE__ */ jsx("span", { className: `${BASE_CLASS}__marker ${BASE_CLASS}__marker--logo`, "aria-hidden": "true", children: company.logo }),
19
- /* @__PURE__ */ jsxs("div", { className: `${BASE_CLASS}__content`, children: [
20
- /* @__PURE__ */ jsx("span", { className: `${BASE_CLASS}__company-name`, children: company.name }),
21
- /* @__PURE__ */ jsx("div", { className: `${BASE_CLASS}__roles`, children: company.roles.map((role, roleIndex) => /* @__PURE__ */ jsxs("div", { className: `${BASE_CLASS}__role`, children: [
22
- /* @__PURE__ */ jsxs("div", { className: `${BASE_CLASS}__role-header`, children: [
23
- /* @__PURE__ */ jsx("h3", { className: `${BASE_CLASS}__role-title`, children: role.title }),
24
- renderRoleDates(role)
25
- ] }),
26
- role.subtitle && /* @__PURE__ */ jsx("p", { className: `${BASE_CLASS}__role-subtitle`, children: role.subtitle }),
27
- role.description && /* @__PURE__ */ jsx("p", { className: `${BASE_CLASS}__role-description`, children: role.description }),
28
- role.bullets && role.bullets.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${BASE_CLASS}__role-bullets`, children: role.bullets.map((bullet, bulletIndex) => /* @__PURE__ */ jsx("li", { children: bullet }, bulletIndex)) })
29
- ] }, `${role.title}-${roleIndex}`)) })
30
- ] })
31
- ] }, `${company.name}-${index}`)) });
32
- };
33
- const Timeline = (props) => {
15
+ const CompanyTimeline = React.forwardRef(
16
+ // `variant` is the discriminant, not an <ol> attribute, so it is held back from the spread.
17
+ ({ variant: _variant, items, presentLabel = "Present", className = "", ...rest }, ref) => {
18
+ const classes = [BASE_CLASS, `${BASE_CLASS}--vertical`, `${BASE_CLASS}--company`, className].filter(Boolean).join(" ");
19
+ return /* @__PURE__ */ jsx("ol", { ...rest, ref, className: classes, children: items.map((company, index) => /* @__PURE__ */ jsxs("li", { className: `${BASE_CLASS}__item`, children: [
20
+ /* @__PURE__ */ jsx("span", { className: `${BASE_CLASS}__marker ${BASE_CLASS}__marker--logo`, "aria-hidden": "true", children: company.logo }),
21
+ /* @__PURE__ */ jsxs("div", { className: `${BASE_CLASS}__content`, children: [
22
+ /* @__PURE__ */ jsx("span", { className: `${BASE_CLASS}__company-name`, children: company.name }),
23
+ /* @__PURE__ */ jsx("div", { className: `${BASE_CLASS}__roles`, children: company.roles.map((role, roleIndex) => /* @__PURE__ */ jsxs("div", { className: `${BASE_CLASS}__role`, children: [
24
+ /* @__PURE__ */ jsxs("div", { className: `${BASE_CLASS}__role-header`, children: [
25
+ /* @__PURE__ */ jsx("h3", { className: `${BASE_CLASS}__role-title`, children: role.title }),
26
+ renderRoleDates(role, presentLabel)
27
+ ] }),
28
+ role.subtitle && /* @__PURE__ */ jsx("p", { className: `${BASE_CLASS}__role-subtitle`, children: role.subtitle }),
29
+ role.description && /* @__PURE__ */ jsx("p", { className: `${BASE_CLASS}__role-description`, children: role.description }),
30
+ role.bullets && role.bullets.length > 0 && /* @__PURE__ */ jsx("ul", { className: `${BASE_CLASS}__role-bullets`, children: role.bullets.map((bullet, bulletIndex) => /* @__PURE__ */ jsx("li", { children: bullet }, bulletIndex)) })
31
+ ] }, `${role.title}-${roleIndex}`)) })
32
+ ] })
33
+ ] }, `${company.name}-${index}`)) });
34
+ }
35
+ );
36
+ CompanyTimeline.displayName = "CompanyTimeline";
37
+ const Timeline = React.forwardRef(({
38
+ orientation = "vertical",
39
+ numbered = false,
40
+ presentLabel = "Present",
41
+ className = "",
42
+ ...props
43
+ }, ref) => {
34
44
  if (props.variant === "company") {
35
- return /* @__PURE__ */ jsx(CompanyTimeline, { ...props });
45
+ return /* @__PURE__ */ jsx(CompanyTimeline, { ...props, presentLabel, className, ref });
36
46
  }
37
- const { items, orientation = "vertical", numbered = false, className = "" } = props;
47
+ const { variant: _variant, items, ...rest } = props;
38
48
  const classes = [
39
49
  BASE_CLASS,
40
50
  `${BASE_CLASS}--${orientation}`,
@@ -53,7 +63,7 @@ const Timeline = (props) => {
53
63
  }
54
64
  return null;
55
65
  };
56
- return /* @__PURE__ */ jsx("ol", { className: classes, children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: `${BASE_CLASS}__item`, children: [
66
+ return /* @__PURE__ */ jsx("ol", { ...rest, ref, className: classes, children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: `${BASE_CLASS}__item`, children: [
57
67
  /* @__PURE__ */ jsx(
58
68
  "span",
59
69
  {
@@ -67,7 +77,8 @@ const Timeline = (props) => {
67
77
  item.description && /* @__PURE__ */ jsx("div", { className: `${BASE_CLASS}__description`, children: item.description })
68
78
  ] })
69
79
  ] }, `${item.title}-${index}`)) });
70
- };
80
+ });
81
+ Timeline.displayName = "Timeline";
71
82
  export {
72
83
  Timeline
73
84
  };
@@ -17,7 +17,7 @@
17
17
 
18
18
  .ds-toast-container {
19
19
  position: fixed;
20
- z-index: var(--ds-toast-z, 200);
20
+ z-index: var(--ds-toast-z, var(--layer-toast));
21
21
  display: flex;
22
22
  flex-direction: column;
23
23
  gap: var(--gap-200); /* 8px */
@@ -170,7 +170,7 @@
170
170
  height: 3px;
171
171
  width: 100%;
172
172
  transform-origin: left;
173
- animation: ds-toast-progress linear forwards;
173
+ animation: ds-toast-progress var(--motion-ease-linear) forwards;
174
174
  }
175
175
 
176
176
  /* ============================================
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  export interface ToastData {
3
3
  /** Unique ID (auto-generated if not provided) */
4
4
  id?: string;
@@ -22,6 +22,10 @@ export interface ToastProviderProps {
22
22
  position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
23
23
  /** Maximum number of visible toasts */
24
24
  maxToasts?: number;
25
+ /** Accessible name of the toast stack's region landmark */
26
+ regionLabel?: string;
27
+ /** Accessible name of every toast's dismiss button */
28
+ dismissLabel?: string;
25
29
  }
26
30
  export interface ToastContextValue {
27
31
  /** Add a toast */
@@ -41,23 +45,37 @@ export declare const useToast: () => ToastContextValue;
41
45
  * toast context. Renders a fixed container that stacks
42
46
  * toast notifications.
43
47
  */
44
- export declare const ToastProvider: ({ children, position, maxToasts, }: ToastProviderProps) => import("react").JSX.Element;
45
- export interface ToastProps {
46
- /** Toast title text */
48
+ export declare const ToastProvider: ({ children, position, maxToasts, regionLabel, dismissLabel, }: ToastProviderProps) => React.JSX.Element;
49
+ /** Props owned by the standalone Toast itself — everything else falls through to its `role="status"` `<div>`. */
50
+ type ToastOwnProps = {
51
+ /**
52
+ * Toast title text.
53
+ * Note: this shadows the native `title` tooltip attribute, which Toast does not expose.
54
+ */
47
55
  title?: string;
48
56
  /** Toast description / body text */
49
57
  description?: string;
50
58
  /** Toast variant */
51
59
  variant?: 'info' | 'positive' | 'warning' | 'error' | 'neutral';
52
- /** Whether the toast can be manually dismissed */
60
+ /** Whether the toast can be manually dismissed. The dismiss button renders only when `onDismiss` is also given */
53
61
  dismissible?: boolean;
54
62
  /** Custom icon override — Material Symbol name (string) or custom element (ReactNode) */
55
63
  icon?: string | React.ReactNode;
64
+ /** Fires when the dismiss button is pressed. The button renders only when this is given (and `dismissible` is not false); the host owns removing the toast */
65
+ onDismiss?: () => void;
66
+ /** Accessible name of the dismiss button */
67
+ dismissLabel?: string;
56
68
  /** Additional CSS classes */
57
69
  className?: string;
70
+ };
71
+ export interface ToastProps extends ToastOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof ToastOwnProps | 'role' | 'children'> {
58
72
  }
59
73
  /**
60
74
  * Standalone Toast component for static display.
61
75
  * For dynamic toast notifications, use ToastProvider + useToast.
76
+ *
77
+ * The forwarded ref and any unrecognised props target the `role="status"`
78
+ * `<div>`.
62
79
  */
63
- export declare const Toast: ({ title, description, variant, dismissible, icon, className, }: ToastProps) => import("react").JSX.Element;
80
+ export declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLDivElement>>;
81
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
- import { useState, useSyncExternalStore, useCallback, useContext, createContext, useRef, useEffect } from "react";
3
+ import React, { useState, useSyncExternalStore, useCallback, useContext, createContext, useRef, useEffect } from "react";
4
4
  import { MOTION_AUTO_DISMISS_MS, MOTION_EXIT_SYNC_MS } from "../../tokens/motion.js";
5
5
  import ReactDOM from "react-dom";
6
6
  import "./Toast.css";
@@ -31,6 +31,7 @@ const ToastItem = ({
31
31
  dismissible,
32
32
  icon,
33
33
  duration,
34
+ dismissLabel,
34
35
  onDismiss
35
36
  }) => {
36
37
  const [exiting, setExiting] = useState(false);
@@ -87,7 +88,7 @@ const ToastItem = ({
87
88
  type: "button",
88
89
  className: `${baseClass}__dismiss`,
89
90
  onClick: handleDismiss,
90
- "aria-label": "Dismiss notification",
91
+ "aria-label": dismissLabel,
91
92
  children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", "aria-hidden": "true", children: "close" })
92
93
  }
93
94
  ),
@@ -108,7 +109,9 @@ const ToastItem = ({
108
109
  const ToastProvider = ({
109
110
  children,
110
111
  position = "bottom-right",
111
- maxToasts = 5
112
+ maxToasts = 5,
113
+ regionLabel = "Notifications",
114
+ dismissLabel = "Dismiss notification"
112
115
  }) => {
113
116
  const [toasts, setToasts] = useState([]);
114
117
  const mounted = useSyncExternalStore(emptySubscribe, () => true, () => false);
@@ -149,7 +152,7 @@ const ToastProvider = ({
149
152
  {
150
153
  className: containerClasses,
151
154
  role: "region",
152
- "aria-label": "Notifications",
155
+ "aria-label": regionLabel,
153
156
  "aria-live": "polite",
154
157
  children: toasts.map((t) => /* @__PURE__ */ jsx(
155
158
  ToastItem,
@@ -161,6 +164,7 @@ const ToastProvider = ({
161
164
  dismissible: t.dismissible ?? true,
162
165
  icon: t.icon,
163
166
  duration: t.duration ?? MOTION_AUTO_DISMISS_MS,
167
+ dismissLabel,
164
168
  onDismiss: dismiss
165
169
  },
166
170
  t.id
@@ -171,43 +175,48 @@ const ToastProvider = ({
171
175
  )
172
176
  ] });
173
177
  };
174
- const Toast = ({
175
- title,
176
- description,
177
- variant = "info",
178
- dismissible = true,
179
- icon,
180
- className = ""
181
- }) => {
182
- const baseClass = "ds-toast";
183
- const iconName = icon || defaultIcons[variant];
184
- const classes = [baseClass, `${baseClass}--${variant}`, className].filter(Boolean).join(" ");
185
- return /* @__PURE__ */ jsxs("div", { className: classes, role: "status", children: [
186
- /* @__PURE__ */ jsx(
187
- "span",
188
- {
189
- className: `${baseClass}__icon${typeof iconName === "string" ? " material-symbols-rounded" : ""}`,
190
- "aria-hidden": "true",
191
- children: iconName
192
- }
193
- ),
194
- /* @__PURE__ */ jsxs("div", { className: `${baseClass}__content`, children: [
195
- title && /* @__PURE__ */ jsx("p", { className: `${baseClass}__title`, children: title }),
196
- description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, children: description })
197
- ] }),
198
- dismissible && /* @__PURE__ */ jsx(
199
- "button",
200
- {
201
- type: "button",
202
- className: `${baseClass}__dismiss`,
203
- onClick: () => {
204
- },
205
- "aria-label": "Dismiss notification",
206
- children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", "aria-hidden": "true", children: "close" })
207
- }
208
- )
209
- ] });
210
- };
178
+ const Toast = React.forwardRef(
179
+ ({
180
+ title,
181
+ description,
182
+ variant = "info",
183
+ dismissible = true,
184
+ icon,
185
+ onDismiss,
186
+ dismissLabel = "Dismiss notification",
187
+ className = "",
188
+ ...rest
189
+ }, ref) => {
190
+ const baseClass = "ds-toast";
191
+ const iconName = icon || defaultIcons[variant];
192
+ const classes = [baseClass, `${baseClass}--${variant}`, className].filter(Boolean).join(" ");
193
+ return /* @__PURE__ */ jsxs("div", { ...rest, ref, className: classes, role: "status", children: [
194
+ /* @__PURE__ */ jsx(
195
+ "span",
196
+ {
197
+ className: `${baseClass}__icon${typeof iconName === "string" ? " material-symbols-rounded" : ""}`,
198
+ "aria-hidden": "true",
199
+ children: iconName
200
+ }
201
+ ),
202
+ /* @__PURE__ */ jsxs("div", { className: `${baseClass}__content`, children: [
203
+ title && /* @__PURE__ */ jsx("p", { className: `${baseClass}__title`, children: title }),
204
+ description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, children: description })
205
+ ] }),
206
+ dismissible && onDismiss && /* @__PURE__ */ jsx(
207
+ "button",
208
+ {
209
+ type: "button",
210
+ className: `${baseClass}__dismiss`,
211
+ onClick: () => onDismiss(),
212
+ "aria-label": dismissLabel,
213
+ children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", "aria-hidden": "true", children: "close" })
214
+ }
215
+ )
216
+ ] });
217
+ }
218
+ );
219
+ Toast.displayName = "Toast";
211
220
  export {
212
221
  Toast,
213
222
  ToastProvider,
@@ -63,9 +63,10 @@
63
63
  }
64
64
 
65
65
  /* ============================================
66
- NEUTRAL VARIANT
66
+ NEUTRAL TONE (tone="neutral"; the legacy
67
+ variant="neutral" keeps this class)
67
68
  Active items fill grey instead of the action
68
- teal — for sets where the selection should
69
+ colour — for sets where the selection should
69
70
  not carry the action colour's weight.
70
71
  ============================================ */
71
72
 
@@ -11,13 +11,32 @@ export interface ToggleGroupItem {
11
11
  type ToggleGroupOwnProps = {
12
12
  /** Available items */
13
13
  items: ToggleGroupItem[];
14
- /** Currently active value(s) */
14
+ /**
15
+ * Currently active value(s), controlled. Leave undefined to let the group
16
+ * keep its own selection, seeded from `defaultValue`.
17
+ */
15
18
  value?: string | string[];
16
- /** Allow multiple selection */
19
+ /** Active value(s) on first render when uncontrolled (`value` undefined). */
20
+ defaultValue?: string | string[];
21
+ /**
22
+ * Allow multiple selection, where each item toggles on or off. Without it
23
+ * exactly one item is active once chosen, and pressing it again keeps it.
24
+ */
17
25
  multiple?: boolean;
18
26
  /** Component size */
19
27
  size?: 'default' | 'compact';
20
- /** Visual treatment of active items — teal by default, `neutral` fills them grey */
28
+ /**
29
+ * Colour of active items: `default` takes the action colour, `neutral`
30
+ * fills them grey, for a set whose selection should not carry the action
31
+ * colour's weight.
32
+ */
33
+ tone?: 'default' | 'neutral';
34
+ /**
35
+ * Legacy name for `tone`, from before colour moved onto its own prop:
36
+ * `primary` is `tone="default"`.
37
+ *
38
+ * @deprecated Use `tone` instead.
39
+ */
21
40
  variant?: 'primary' | 'neutral';
22
41
  /** Whether the whole group is disabled */
23
42
  disabled?: boolean;
@@ -41,7 +60,10 @@ type ToggleGroupOwnProps = {
41
60
  export interface ToggleGroupProps extends ToggleGroupOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof ToggleGroupOwnProps> {
42
61
  }
43
62
  /**
44
- * ToggleGroup is a set of two-state buttons that can be toggled on or off.
63
+ * ToggleGroup is a set of pressable buttons. By default it is single
64
+ * selection: pressing an item makes it the one active item, and pressing the
65
+ * active item again keeps it active. With `multiple`, each item toggles on or
66
+ * off independently.
45
67
  *
46
68
  * Forwards a ref to the wrapping group element and spreads unrecognised props
47
69
  * onto it.
@@ -5,10 +5,12 @@ import "./ToggleGroup.css";
5
5
  const ToggleGroup = React.forwardRef(
6
6
  ({
7
7
  items,
8
- value = [],
8
+ value,
9
+ defaultValue = [],
9
10
  multiple = false,
10
11
  size = "default",
11
- variant = "primary",
12
+ tone,
13
+ variant,
12
14
  disabled = false,
13
15
  onValueChange,
14
16
  onChange,
@@ -17,15 +19,20 @@ const ToggleGroup = React.forwardRef(
17
19
  ...rest
18
20
  }, ref) => {
19
21
  const baseClass = "ds-toggle-group";
22
+ const resolvedTone = tone ?? (variant === "neutral" ? "neutral" : "default");
20
23
  const classes = [
21
24
  baseClass,
22
25
  `${baseClass}--${size}`,
23
- `${baseClass}--${variant}`,
26
+ `${baseClass}--${resolvedTone === "neutral" ? "neutral" : "primary"}`,
24
27
  disabled ? `${baseClass}--disabled` : "",
25
28
  className
26
29
  ].filter(Boolean).join(" ");
27
- const activeValues = Array.isArray(value) ? value : [value];
30
+ const [internalValue, setInternalValue] = React.useState(defaultValue);
31
+ const isControlled = value !== void 0;
32
+ const currentValue = isControlled ? value : internalValue;
33
+ const activeValues = Array.isArray(currentValue) ? currentValue : [currentValue];
28
34
  const emit = (next) => {
35
+ if (!isControlled) setInternalValue(next);
29
36
  onValueChange?.(next);
30
37
  onChange?.(next);
31
38
  };
@@ -45,7 +52,7 @@ const ToggleGroup = React.forwardRef(
45
52
  ref,
46
53
  className: classes,
47
54
  role: "group",
48
- "aria-label": ariaLabel || rest["aria-label"],
55
+ "aria-label": rest["aria-label"] ?? ariaLabel,
49
56
  children: items.map((item) => {
50
57
  const isActive = activeValues.includes(item.value);
51
58
  const btnClass = [`${baseClass}__item`, isActive ? `${baseClass}__item--active` : ""].filter(Boolean).join(" ");
@@ -1,8 +1,13 @@
1
1
  import { default as React } from 'react';
2
2
  /** Props owned by ToggleSwitch itself — everything else falls through to the <button>. */
3
3
  type ToggleSwitchOwnProps = {
4
- /** Whether the toggle is on (checked) */
4
+ /**
5
+ * Whether the toggle is on, controlled. Leave undefined to let the switch
6
+ * keep its own state, seeded from `defaultChecked`.
7
+ */
5
8
  checked?: boolean;
9
+ /** Whether the toggle starts on when uncontrolled (`checked` undefined). Defaults to true, so an uncontrolled switch starts on unless this is false. */
10
+ defaultChecked?: boolean;
6
11
  /** Label text displayed next to the toggle */
7
12
  label?: string;
8
13
  /** Whether to show the label */
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
- import React, { useId } from "react";
3
+ import React, { useState, useId } from "react";
4
4
  import "./ToggleSwitch.css";
5
5
  import "../../fonts/material-symbols.css";
6
6
  const ToggleSwitch = React.forwardRef(
7
7
  ({
8
- checked = true,
8
+ checked: checkedProp,
9
+ defaultChecked = true,
9
10
  label = "Toggle",
10
11
  showLabel = true,
11
12
  helperText,
@@ -20,6 +21,9 @@ const ToggleSwitch = React.forwardRef(
20
21
  ...rest
21
22
  }, ref) => {
22
23
  const baseClass = "ds-toggle-switch";
24
+ const [internalChecked, setInternalChecked] = useState(defaultChecked);
25
+ const isControlled = checkedProp !== void 0;
26
+ const checked = isControlled ? checkedProp : internalChecked;
23
27
  const generatedId = useId();
24
28
  const helperId = helperText ? `${generatedId}-helper` : void 0;
25
29
  const describedBy = helperId ?? rest["aria-describedby"];
@@ -35,6 +39,7 @@ const ToggleSwitch = React.forwardRef(
35
39
  const handleClick = (e) => {
36
40
  onClick?.(e);
37
41
  if (disabled) return;
42
+ if (!isControlled) setInternalChecked(!checked);
38
43
  onCheckedChange?.(!checked);
39
44
  onChange?.(!checked);
40
45
  };
@@ -50,7 +50,7 @@ const ToolCall = React.forwardRef(
50
50
  className
51
51
  ].filter(Boolean).join(" ");
52
52
  const header = /* @__PURE__ */ jsxs(Fragment, { children: [
53
- /* @__PURE__ */ jsx("span", { className: `${baseClass}__indicator`, "aria-hidden": "true", children: status === "running" ? /* @__PURE__ */ jsx(Spinner, { size: "sm", variant: "inherit" }) : /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", children: STATUS_ICONS[status] }) }),
53
+ /* @__PURE__ */ jsx("span", { className: `${baseClass}__indicator`, "aria-hidden": "true", children: status === "running" ? /* @__PURE__ */ jsx(Spinner, { size: "sm", tone: "inherit" }) : /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", children: STATUS_ICONS[status] }) }),
54
54
  /* @__PURE__ */ jsx("span", { className: `${baseClass}__name`, children: name }),
55
55
  summary && /* @__PURE__ */ jsx("span", { className: `${baseClass}__summary`, children: summary }),
56
56
  /* @__PURE__ */ jsx("span", { className: `${baseClass}__status`, children: statusLabel ?? DEFAULT_STATUS_LABELS[status] }),
@@ -14,7 +14,7 @@
14
14
 
15
15
  .ds-tooltip__panel {
16
16
  position: absolute;
17
- z-index: 50;
17
+ z-index: var(--layer-floating);
18
18
  padding: var(--padding-150) var(--padding-200); /* 6px 8px */
19
19
  border-radius: var(--radius-100); /* 4px */
20
20
  /* The floating surface, same recipe as Popover: page background (the
@@ -142,7 +142,7 @@
142
142
  .ds-tooltip__panel--top .ds-tooltip__arrow {
143
143
  bottom: -5px;
144
144
  left: 50%;
145
- margin-left: -4px;
145
+ margin-left: -4px; /* ds-allow(spacing): half the 8px arrow, centring it on the panel edge */
146
146
  border-right: var(--border-025) solid var(--color-bg-container-border);
147
147
  border-bottom: var(--border-025) solid var(--color-bg-container-border);
148
148
  }
@@ -151,7 +151,7 @@
151
151
  .ds-tooltip__panel--bottom .ds-tooltip__arrow {
152
152
  top: -5px;
153
153
  left: 50%;
154
- margin-left: -4px;
154
+ margin-left: -4px; /* ds-allow(spacing): half the 8px arrow */
155
155
  border-top: var(--border-025) solid var(--color-bg-container-border);
156
156
  border-left: var(--border-025) solid var(--color-bg-container-border);
157
157
  }
@@ -160,7 +160,7 @@
160
160
  .ds-tooltip__panel--left .ds-tooltip__arrow {
161
161
  right: -5px;
162
162
  top: 50%;
163
- margin-top: -4px;
163
+ margin-top: -4px; /* ds-allow(spacing): half the 8px arrow */
164
164
  border-top: var(--border-025) solid var(--color-bg-container-border);
165
165
  border-right: var(--border-025) solid var(--color-bg-container-border);
166
166
  }
@@ -169,7 +169,7 @@
169
169
  .ds-tooltip__panel--right .ds-tooltip__arrow {
170
170
  left: -5px;
171
171
  top: 50%;
172
- margin-top: -4px;
172
+ margin-top: -4px; /* ds-allow(spacing): half the 8px arrow */
173
173
  border-bottom: var(--border-025) solid var(--color-bg-container-border);
174
174
  border-left: var(--border-025) solid var(--color-bg-container-border);
175
175
  }
@@ -1,8 +1,11 @@
1
- import { ReactNode } from 'react';
2
- export interface TooltipProps {
1
+ import { default as React, ReactNode } from 'react';
2
+ type TooltipOwnProps = {
3
3
  /** Trigger element */
4
4
  children?: ReactNode;
5
- /** Tooltip text content */
5
+ /**
6
+ * Tooltip text content. Replaces the native `content` attribute, which only
7
+ * means something on a `<meta>` element.
8
+ */
6
9
  content: string;
7
10
  /** Preferred position */
8
11
  position?: 'top' | 'bottom' | 'left' | 'right';
@@ -12,11 +15,19 @@ export interface TooltipProps {
12
15
  hideDelay?: number;
13
16
  /** Additional CSS classes */
14
17
  className?: string;
18
+ };
19
+ export interface TooltipProps extends TooltipOwnProps, Omit<React.ComponentPropsWithoutRef<'span'>, keyof TooltipOwnProps> {
15
20
  }
16
21
  /**
17
22
  * Tooltip component for contextual text labels.
18
23
  * Appears on hover or focus with a short delay.
19
24
  * Rides the system's floating surface — page background, hairline border,
20
25
  * floating shadow — so the bubble stays light in light theme and dark in dark.
26
+ *
27
+ * A visible tooltip is a layer on the shared dismissal stack
28
+ * (src/behaviors/useLayer): Escape hides it wherever focus is (WCAG 1.4.13),
29
+ * and hides only it, so inside a Dialog the first Escape clears the tooltip
30
+ * and the second closes the Dialog.
21
31
  */
22
- export declare const Tooltip: ({ children, content, position, showDelay, hideDelay, className, }: TooltipProps) => import("react").JSX.Element;
32
+ export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLSpanElement>>;
33
+ export {};