@tfn-design/design-system 0.3.0 → 0.4.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 (749) hide show
  1. package/README.md +2 -2
  2. package/dist/accordion/accordion.d.ts +1 -1
  3. package/dist/accordion/accordion.js +1 -1
  4. package/dist/accordion/web/ds-accordion.js +5 -4
  5. package/dist/account-password-field/account-password-field.js +1 -1
  6. package/dist/account-switcher/account-switcher.d.ts +11 -4
  7. package/dist/account-switcher/account-switcher.js +2 -1
  8. package/dist/account-switcher/web/ds-account-switcher.js +12 -4
  9. package/dist/ai-attachment/ai-attachment.d.ts +1 -1
  10. package/dist/ai-attachment/ai-attachment.js +1 -1
  11. package/dist/ai-attachment/web/ds-ai-attachment.js +1 -1
  12. package/dist/ai-branch-switcher/web/ds-ai-branch-switcher.js +2 -2
  13. package/dist/ai-composer/ai-composer.d.ts +1 -1
  14. package/dist/ai-composer/ai-composer.js +1 -1
  15. package/dist/ai-composer/native/ds-ai-composer.js +4 -2
  16. package/dist/ai-composer/web/ds-ai-composer.js +2 -3
  17. package/dist/ai-confirmation/ai-confirmation.d.ts +19 -3
  18. package/dist/ai-confirmation/ai-confirmation.js +18 -3
  19. package/dist/ai-confirmation/native/ds-ai-confirmation.js +18 -13
  20. package/dist/ai-confirmation/web/ds-ai-confirmation.d.ts +1 -1
  21. package/dist/ai-confirmation/web/ds-ai-confirmation.js +22 -11
  22. package/dist/ai-context-scope/ai-context-scope.d.ts +10 -2
  23. package/dist/ai-context-scope/ai-context-scope.js +11 -2
  24. package/dist/ai-context-scope/native/ds-ai-context-scope.js +4 -3
  25. package/dist/ai-context-scope/web/ds-ai-context-scope.js +19 -5
  26. package/dist/ai-conversation-list/ai-conversation-list.d.ts +16 -0
  27. package/dist/ai-conversation-list/ai-conversation-list.js +8 -0
  28. package/dist/ai-conversation-list/web/ds-ai-conversation-list.d.ts +10 -6
  29. package/dist/ai-conversation-list/web/ds-ai-conversation-list.js +89 -47
  30. package/dist/ai-diff/ai-diff.d.ts +13 -1
  31. package/dist/ai-diff/ai-diff.js +12 -1
  32. package/dist/ai-diff/native/ds-ai-diff.d.ts +1 -1
  33. package/dist/ai-diff/native/ds-ai-diff.js +4 -6
  34. package/dist/ai-diff/web/ds-ai-diff.d.ts +0 -4
  35. package/dist/ai-diff/web/ds-ai-diff.js +16 -9
  36. package/dist/ai-draft-panel/ai-draft-panel.d.ts +2 -0
  37. package/dist/ai-draft-panel/ai-draft-panel.js +5 -0
  38. package/dist/ai-draft-panel/web/ds-ai-draft-panel.d.ts +3 -1
  39. package/dist/ai-draft-panel/web/ds-ai-draft-panel.js +4 -4
  40. package/dist/ai-empty-state/native/ds-ai-empty-state.js +2 -2
  41. package/dist/ai-empty-state/web/ds-ai-empty-state.js +3 -1
  42. package/dist/ai-error-state/ai-error-state.d.ts +2 -2
  43. package/dist/ai-error-state/ai-error-state.js +2 -2
  44. package/dist/ai-error-state/native/ds-ai-error-state.d.ts +5 -1
  45. package/dist/ai-error-state/native/ds-ai-error-state.js +2 -1
  46. package/dist/ai-error-state/web/ds-ai-error-state.d.ts +5 -1
  47. package/dist/ai-error-state/web/ds-ai-error-state.js +3 -2
  48. package/dist/ai-label/native/ds-ai-label.js +2 -1
  49. package/dist/ai-label/web/ds-ai-label.js +1 -1
  50. package/dist/ai-message/ai-message.d.ts +1 -1
  51. package/dist/ai-message/ai-message.js +1 -1
  52. package/dist/ai-message/native/ds-ai-message.js +4 -3
  53. package/dist/ai-message/web/ds-ai-message-markdown.js +3 -3
  54. package/dist/ai-message/web/ds-ai-message.js +4 -3
  55. package/dist/ai-message-actions/ai-message-actions.d.ts +1 -1
  56. package/dist/ai-message-actions/ai-message-actions.js +1 -1
  57. package/dist/ai-message-actions/native/ds-ai-message-actions.js +1 -1
  58. package/dist/ai-message-actions/web/ds-ai-message-actions.js +1 -1
  59. package/dist/ai-plan/ai-plan.d.ts +1 -1
  60. package/dist/ai-plan/ai-plan.js +1 -1
  61. package/dist/ai-plan/web/ds-ai-plan.js +2 -2
  62. package/dist/ai-side-nav/web/ds-ai-side-nav.js +4 -3
  63. package/dist/ai-summary-card/native/ds-ai-summary-card.js +2 -1
  64. package/dist/ai-summary-card/web/ds-ai-summary-card.js +2 -1
  65. package/dist/ai-thread/web/ds-ai-thread.js +1 -1
  66. package/dist/ai-tool-call/ai-tool-call.d.ts +1 -1
  67. package/dist/ai-tool-call/ai-tool-call.js +1 -1
  68. package/dist/ai-tool-call/native/ds-ai-tool-call.js +3 -2
  69. package/dist/ai-tool-call/web/ds-ai-tool-call.js +4 -3
  70. package/dist/alert/native/ds-alert.js +4 -4
  71. package/dist/alert/web/ds-alert.js +5 -5
  72. package/dist/ambient-gradient/ambient-gradient.d.ts +1 -1
  73. package/dist/amount/amount.d.ts +1 -1
  74. package/dist/amount/amount.js +3 -2
  75. package/dist/amount/native/ds-amount.js +1 -1
  76. package/dist/amount/web/ds-amount.js +1 -1
  77. package/dist/amount-cell/amount-cell.d.ts +5 -2
  78. package/dist/amount-cell/web/ds-amount-cell.d.ts +1 -1
  79. package/dist/amount-cell/web/ds-amount-cell.js +7 -1
  80. package/dist/amount-entry/amount-entry.d.ts +28 -2
  81. package/dist/amount-entry/amount-entry.js +19 -12
  82. package/dist/amount-entry/native/ds-amount-entry.d.ts +1 -1
  83. package/dist/amount-entry/native/ds-amount-entry.js +5 -4
  84. package/dist/amount-entry/web/ds-amount-entry.d.ts +1 -1
  85. package/dist/amount-entry/web/ds-amount-entry.js +5 -4
  86. package/dist/app-shell/app-shell.d.ts +2 -0
  87. package/dist/app-shell/web/ds-app-shell.js +26 -3
  88. package/dist/approval-chain/approval-chain.d.ts +6 -2
  89. package/dist/approval-chain/approval-chain.js +4 -4
  90. package/dist/approval-chain/native/ds-approval-chain.js +16 -9
  91. package/dist/approval-chain/web/ds-approval-chain.d.ts +7 -1
  92. package/dist/approval-chain/web/ds-approval-chain.js +12 -11
  93. package/dist/auth-shell/web/ds-auth-shell.d.ts +5 -1
  94. package/dist/auth-shell/web/ds-auth-shell.js +5 -2
  95. package/dist/balance-header/balance-header.d.ts +8 -4
  96. package/dist/balance-header/native/ds-balance-header.d.ts +3 -3
  97. package/dist/balance-header/native/ds-balance-header.js +11 -4
  98. package/dist/balance-header/web/ds-balance-header.d.ts +1 -1
  99. package/dist/balance-header/web/ds-balance-header.js +7 -4
  100. package/dist/bar-chart/bar-chart.d.ts +46 -5
  101. package/dist/bar-chart/bar-chart.js +64 -6
  102. package/dist/bar-chart/web/ds-bar-chart.d.ts +21 -4
  103. package/dist/bar-chart/web/ds-bar-chart.js +121 -50
  104. package/dist/bottom-nav/bottom-nav.d.ts +8 -3
  105. package/dist/bottom-nav/bottom-nav.js +2 -2
  106. package/dist/bottom-nav/web/ds-bottom-nav.js +2 -2
  107. package/dist/box-plot/box-plot.d.ts +150 -0
  108. package/dist/box-plot/box-plot.js +124 -0
  109. package/dist/box-plot/web/ds-box-plot.d.ts +8 -0
  110. package/dist/box-plot/web/ds-box-plot.js +57 -0
  111. package/dist/brand-lockup/native/ds-brand-lockup.js +1 -1
  112. package/dist/brand-provider/brand-provider.d.ts +29 -0
  113. package/dist/brand-provider/brand-provider.js +9 -0
  114. package/dist/brand-provider/native/ds-brand-provider.d.ts +11 -0
  115. package/dist/brand-provider/native/ds-brand-provider.js +18 -0
  116. package/dist/brand-provider/web/ds-brand-provider.d.ts +10 -0
  117. package/dist/brand-provider/web/ds-brand-provider.js +20 -0
  118. package/dist/bullet-chart/bullet-chart.d.ts +12 -7
  119. package/dist/bullet-chart/bullet-chart.js +5 -4
  120. package/dist/bullet-chart/web/ds-bullet-chart.d.ts +1 -1
  121. package/dist/bullet-chart/web/ds-bullet-chart.js +9 -4
  122. package/dist/button/button.d.ts +1 -1
  123. package/dist/button/native/ds-button.js +2 -2
  124. package/dist/button/web/ds-button.js +1 -1
  125. package/dist/button-group/button-group.d.ts +1 -1
  126. package/dist/button-group/web/ds-button-group.d.ts +2 -2
  127. package/dist/calendar/calendar.d.ts +13 -2
  128. package/dist/calendar/calendar.js +4 -3
  129. package/dist/calendar/web/ds-calendar.d.ts +1 -1
  130. package/dist/calendar/web/ds-calendar.js +6 -5
  131. package/dist/card-carousel/native/ds-card-carousel.js +1 -1
  132. package/dist/card-carousel/web/ds-card-carousel.js +2 -2
  133. package/dist/chart/chart.d.ts +180 -64
  134. package/dist/chart/chart.js +367 -118
  135. package/dist/chart/web/ds-chart.d.ts +17 -7
  136. package/dist/chart/web/ds-chart.js +85 -108
  137. package/dist/check-option/check-option.d.ts +1 -1
  138. package/dist/check-option/check-option.js +1 -1
  139. package/dist/check-option/web/ds-check-option.d.ts +6 -1
  140. package/dist/check-option/web/ds-check-option.js +10 -6
  141. package/dist/checkbox/checkbox.d.ts +2 -2
  142. package/dist/checkbox/checkbox.js +2 -2
  143. package/dist/checkbox/native/ds-checkbox.js +1 -1
  144. package/dist/checkbox/web/checkbox-mark.js +1 -1
  145. package/dist/checkbox/web/ds-checkbox.d.ts +2 -2
  146. package/dist/checkbox/web/ds-checkbox.js +17 -6
  147. package/dist/chip/chip.d.ts +11 -11
  148. package/dist/chip/chip.js +5 -3
  149. package/dist/chip/native/ds-chip.js +1 -1
  150. package/dist/chip/web/ds-chip.js +6 -6
  151. package/dist/code-block/web/ds-code-block.js +3 -3
  152. package/dist/column-picker/web/ds-column-picker.js +2 -1
  153. package/dist/combobox/combobox.d.ts +2 -2
  154. package/dist/combobox/web/ds-combobox.js +4 -2
  155. package/dist/command-palette/command-palette.d.ts +4 -0
  156. package/dist/comment-thread/comment-thread.d.ts +2 -2
  157. package/dist/comment-thread/comment-thread.js +2 -2
  158. package/dist/comment-thread/native/ds-comment-thread.js +10 -9
  159. package/dist/comment-thread/web/ds-comment-thread.js +11 -10
  160. package/dist/condition-builder/condition-builder.d.ts +96 -4
  161. package/dist/condition-builder/condition-builder.js +68 -28
  162. package/dist/condition-builder/web/ds-condition-builder.d.ts +4 -2
  163. package/dist/condition-builder/web/ds-condition-builder.js +97 -57
  164. package/dist/context-switcher/context-switcher.d.ts +10 -1
  165. package/dist/context-switcher/context-switcher.js +5 -2
  166. package/dist/context-switcher/web/ds-context-switcher.d.ts +1 -1
  167. package/dist/context-switcher/web/ds-context-switcher.js +4 -3
  168. package/dist/coordinate-field/coordinate-field.d.ts +46 -5
  169. package/dist/coordinate-field/coordinate-field.js +35 -18
  170. package/dist/coordinate-field/native/ds-coordinate-field.d.ts +1 -1
  171. package/dist/coordinate-field/native/ds-coordinate-field.js +9 -8
  172. package/dist/coordinate-field/web/ds-coordinate-field.d.ts +1 -1
  173. package/dist/coordinate-field/web/ds-coordinate-field.js +10 -9
  174. package/dist/copy-field/copy-field.d.ts +23 -9
  175. package/dist/copy-field/copy-field.js +11 -6
  176. package/dist/copy-field/web/ds-copy-field.d.ts +1 -1
  177. package/dist/copy-field/web/ds-copy-field.js +6 -5
  178. package/dist/copy.d.ts +8 -0
  179. package/dist/copy.js +7 -0
  180. package/dist/count-badge/web/ds-count-badge.js +1 -1
  181. package/dist/countdown/native/ds-countdown.js +1 -1
  182. package/dist/countdown/web/ds-countdown.js +1 -1
  183. package/dist/dashboard-shell/dashboard-shell.d.ts +4 -2
  184. package/dist/data-table/web/data-table-theme.css +340 -52
  185. package/dist/data-table/web/ds-data-table.d.ts +43 -1
  186. package/dist/data-table/web/ds-data-table.js +165 -17
  187. package/dist/date-field/web/ds-date-field.d.ts +1 -1
  188. package/dist/date-field/web/ds-date-field.js +6 -5
  189. package/dist/date-input/date-input.d.ts +26 -5
  190. package/dist/date-input/date-input.js +34 -2
  191. package/dist/date-input/web/ds-date-input.js +13 -4
  192. package/dist/date-picker/date-picker.d.ts +38 -67
  193. package/dist/date-picker/date-picker.js +26 -60
  194. package/dist/date-picker/web/ds-date-picker.d.ts +13 -6
  195. package/dist/date-picker/web/ds-date-picker.js +41 -10
  196. package/dist/date-range-picker/web/ds-date-range-picker.d.ts +10 -4
  197. package/dist/date-range-picker/web/ds-date-range-picker.js +8 -5
  198. package/dist/day-picker/day-picker.d.ts +1 -1
  199. package/dist/day-picker/web/ds-day-picker.js +1 -1
  200. package/dist/delta/delta.d.ts +15 -1
  201. package/dist/delta/delta.js +20 -0
  202. package/dist/delta/native/ds-delta.d.ts +5 -2
  203. package/dist/delta/native/ds-delta.js +4 -3
  204. package/dist/delta/web/ds-delta.d.ts +5 -2
  205. package/dist/delta/web/ds-delta.js +4 -3
  206. package/dist/description-list/description-list.d.ts +4 -2
  207. package/dist/description-list/native/ds-description-list.d.ts +2 -2
  208. package/dist/description-list/native/ds-description-list.js +49 -27
  209. package/dist/description-list/web/ds-description-list.d.ts +2 -2
  210. package/dist/description-list/web/ds-description-list.js +40 -17
  211. package/dist/dialog/dialog.d.ts +12 -1
  212. package/dist/dialog/web/ds-dialog.d.ts +1 -1
  213. package/dist/dialog/web/ds-dialog.js +5 -3
  214. package/dist/diverging-bar-chart/diverging-bar-chart.d.ts +2 -1
  215. package/dist/diverging-bar-chart/diverging-bar-chart.js +2 -1
  216. package/dist/diverging-bar-chart/web/ds-diverging-bar-chart.d.ts +1 -1
  217. package/dist/diverging-bar-chart/web/ds-diverging-bar-chart.js +28 -5
  218. package/dist/donut-chart/donut-chart.d.ts +7 -1
  219. package/dist/donut-chart/donut-chart.js +4 -0
  220. package/dist/donut-chart/web/ds-donut-chart.d.ts +4 -1
  221. package/dist/donut-chart/web/ds-donut-chart.js +43 -24
  222. package/dist/drawer/drawer.d.ts +42 -5
  223. package/dist/drawer/drawer.js +10 -4
  224. package/dist/drawer/native/ds-drawer.d.ts +1 -1
  225. package/dist/drawer/native/ds-drawer.js +17 -7
  226. package/dist/drawer/web/ds-drawer.d.ts +1 -1
  227. package/dist/drawer/web/ds-drawer.js +32 -17
  228. package/dist/dropdown-menu/dropdown-menu.d.ts +10 -5
  229. package/dist/dropdown-menu/dropdown-menu.js +13 -4
  230. package/dist/dropdown-menu/web/ds-dropdown-menu-surface.d.ts +4 -2
  231. package/dist/dropdown-menu/web/ds-dropdown-menu-surface.js +6 -6
  232. package/dist/dropdown-menu/web/ds-dropdown-menu.d.ts +5 -2
  233. package/dist/dropdown-menu/web/ds-dropdown-menu.js +2 -2
  234. package/dist/dumbbell-chart/dumbbell-chart.d.ts +10 -9
  235. package/dist/dumbbell-chart/dumbbell-chart.js +18 -4
  236. package/dist/dumbbell-chart/web/ds-dumbbell-chart.d.ts +4 -1
  237. package/dist/dumbbell-chart/web/ds-dumbbell-chart.js +13 -3
  238. package/dist/editable-row/editable-row.d.ts +5 -1
  239. package/dist/editable-row/editable-row.js +7 -1
  240. package/dist/editable-row/web/ds-editable-row.js +7 -5
  241. package/dist/empty-state/empty-state.d.ts +39 -0
  242. package/dist/empty-state/empty-state.js +21 -0
  243. package/dist/empty-state/web/ds-empty-state.d.ts +19 -8
  244. package/dist/empty-state/web/ds-empty-state.js +15 -3
  245. package/dist/environment-banner/environment-banner.d.ts +1 -1
  246. package/dist/environment-banner/environment-banner.js +1 -1
  247. package/dist/environment-banner/web/ds-environment-banner.js +3 -3
  248. package/dist/evaluation-trace/evaluation-trace.d.ts +1 -1
  249. package/dist/evaluation-trace/evaluation-trace.js +1 -1
  250. package/dist/evaluation-trace/web/ds-evaluation-trace.js +1 -1
  251. package/dist/event-row/web/ds-event-row.d.ts +1 -1
  252. package/dist/event-row/web/ds-event-row.js +2 -1
  253. package/dist/facet-button/facet-button.d.ts +9 -1
  254. package/dist/facet-button/facet-button.js +2 -2
  255. package/dist/facet-button/web/ds-facet-button.d.ts +1 -1
  256. package/dist/facet-button/web/ds-facet-button.js +9 -5
  257. package/dist/facet-menu/facet-menu.d.ts +1 -1
  258. package/dist/facet-menu/facet-menu.js +2 -1
  259. package/dist/facet-menu/web/ds-facet-menu.js +1 -1
  260. package/dist/fact/native/ds-fact.d.ts +4 -1
  261. package/dist/file-dropzone/file-dropzone.d.ts +54 -5
  262. package/dist/file-dropzone/file-dropzone.js +38 -20
  263. package/dist/file-dropzone/web/ds-file-dropzone.d.ts +1 -1
  264. package/dist/file-dropzone/web/ds-file-dropzone.js +16 -15
  265. package/dist/file-field/file-field.d.ts +26 -5
  266. package/dist/file-field/file-field.js +18 -8
  267. package/dist/file-field/web/ds-file-field.d.ts +5 -2
  268. package/dist/file-field/web/ds-file-field.js +6 -5
  269. package/dist/file-import/file-import.d.ts +50 -4
  270. package/dist/file-import/file-import.js +30 -11
  271. package/dist/file-import/web/ds-file-import.d.ts +7 -3
  272. package/dist/file-import/web/ds-file-import.js +11 -10
  273. package/dist/file-upload/file-upload.d.ts +64 -15
  274. package/dist/file-upload/file-upload.js +44 -30
  275. package/dist/file-upload/web/ds-file-upload.d.ts +11 -2
  276. package/dist/file-upload/web/ds-file-upload.js +17 -12
  277. package/dist/filter-bar/web/ds-filter-bar.js +1 -1
  278. package/dist/filter-button/filter-button.d.ts +5 -4
  279. package/dist/filter-button/filter-button.js +1 -1
  280. package/dist/filter-chip/web/ds-filter-chip.js +2 -2
  281. package/dist/filter-popover/web/ds-filter-popover.js +2 -1
  282. package/dist/form-field-group/form-field-group.d.ts +7 -2
  283. package/dist/form-field-group/form-field-group.js +2 -0
  284. package/dist/form-field-group/web/ds-form-field-group.js +2 -1
  285. package/dist/form-section/form-section.d.ts +4 -2
  286. package/dist/form-section/form-section.js +1 -1
  287. package/dist/funnel/funnel.d.ts +2 -1
  288. package/dist/funnel/web/ds-funnel.d.ts +1 -1
  289. package/dist/funnel/web/ds-funnel.js +22 -12
  290. package/dist/gauge/gauge.d.ts +6 -1
  291. package/dist/gauge/gauge.js +9 -1
  292. package/dist/gauge/web/ds-gauge.d.ts +8 -3
  293. package/dist/gauge/web/ds-gauge.js +26 -15
  294. package/dist/geo/geo.d.ts +15 -0
  295. package/dist/geo/geo.js +112 -0
  296. package/dist/geofence-editor/geofence-editor.d.ts +14 -5
  297. package/dist/geofence-editor/geofence-editor.js +32 -7
  298. package/dist/geofence-editor/web/ds-geofence-editor.d.ts +18 -3
  299. package/dist/geofence-editor/web/ds-geofence-editor.js +28 -13
  300. package/dist/group-header/web/ds-group-header.d.ts +1 -1
  301. package/dist/heatmap/heatmap-calendar.d.ts +95 -0
  302. package/dist/heatmap/heatmap-calendar.js +130 -0
  303. package/dist/heatmap/heatmap.d.ts +35 -8
  304. package/dist/heatmap/heatmap.js +61 -7
  305. package/dist/heatmap/web/ds-heatmap-calendar.d.ts +22 -0
  306. package/dist/heatmap/web/ds-heatmap-calendar.js +33 -0
  307. package/dist/heatmap/web/ds-heatmap.d.ts +21 -1
  308. package/dist/heatmap/web/ds-heatmap.js +59 -31
  309. package/dist/helper-text/native/ds-helper-text.js +2 -2
  310. package/dist/helper-text/web/ds-helper-text.js +2 -2
  311. package/dist/histogram/histogram.d.ts +2 -3
  312. package/dist/histogram/web/ds-histogram.d.ts +1 -1
  313. package/dist/histogram/web/ds-histogram.js +8 -2
  314. package/dist/icon/icon.d.ts +11 -0
  315. package/dist/icon/icon.js +52 -0
  316. package/dist/icon/native/ds-icon-provider.d.ts +6 -1
  317. package/dist/icon/native/ds-icon-provider.js +4 -2
  318. package/dist/icon/native/icon-direction.d.ts +10 -0
  319. package/dist/icon/native/icon-direction.js +6 -0
  320. package/dist/icon/native/use-icon-size.d.ts +6 -0
  321. package/dist/icon/native/use-icon-size.js +12 -0
  322. package/dist/icon/web/ds-icon-provider.d.ts +3 -1
  323. package/dist/icon/web/ds-icon-provider.js +1 -0
  324. package/dist/icon/web/icon-direction.css +45 -0
  325. package/dist/icon-button/icon-button.d.ts +6 -0
  326. package/dist/icon-button/native/ds-icon-button.d.ts +1 -1
  327. package/dist/icon-button/native/ds-icon-button.js +2 -1
  328. package/dist/icon-button/web/ds-icon-button.d.ts +1 -1
  329. package/dist/icon-button/web/ds-icon-button.js +8 -5
  330. package/dist/icon-frame/icon-frame.d.ts +2 -2
  331. package/dist/icon-frame/native/ds-icon-frame.js +3 -3
  332. package/dist/icon-frame/web/ds-icon-frame.js +3 -3
  333. package/dist/ident/ident.d.ts +2 -0
  334. package/dist/ident/ident.js +5 -0
  335. package/dist/ident/native/ds-ident.d.ts +30 -0
  336. package/dist/ident/native/ds-ident.js +13 -0
  337. package/dist/index.d.ts +88 -65
  338. package/dist/index.js +47 -36
  339. package/dist/inline-edit/inline-edit.d.ts +34 -4
  340. package/dist/inline-edit/inline-edit.js +19 -7
  341. package/dist/inline-edit/web/ds-inline-edit.d.ts +1 -1
  342. package/dist/inline-edit/web/ds-inline-edit.js +13 -8
  343. package/dist/input/input.d.ts +18 -5
  344. package/dist/input/input.js +17 -13
  345. package/dist/input/native/ds-input.js +1 -1
  346. package/dist/input/web/ds-input.d.ts +7 -1
  347. package/dist/input/web/ds-input.js +11 -9
  348. package/dist/interaction.d.ts +7 -5
  349. package/dist/interaction.js +1 -1
  350. package/dist/json-viewer/web/ds-json-viewer.js +1 -1
  351. package/dist/key-value-editor/key-value-editor.d.ts +57 -3
  352. package/dist/key-value-editor/key-value-editor.js +56 -26
  353. package/dist/key-value-editor/web/ds-key-value-editor.d.ts +1 -1
  354. package/dist/key-value-editor/web/ds-key-value-editor.js +15 -16
  355. package/dist/keypad/keypad.d.ts +21 -11
  356. package/dist/keypad/keypad.js +16 -10
  357. package/dist/keypad/native/ds-keypad.d.ts +1 -1
  358. package/dist/keypad/native/ds-keypad.js +10 -8
  359. package/dist/keypad/web/ds-keypad.d.ts +1 -1
  360. package/dist/keypad/web/ds-keypad.js +5 -4
  361. package/dist/label-picker/label-picker.d.ts +34 -4
  362. package/dist/label-picker/label-picker.js +28 -17
  363. package/dist/label-picker/native/ds-label-picker.d.ts +1 -1
  364. package/dist/label-picker/native/ds-label-picker.js +11 -10
  365. package/dist/label-picker/web/ds-label-picker.d.ts +1 -1
  366. package/dist/label-picker/web/ds-label-picker.js +11 -10
  367. package/dist/labeled-field/labeled-field.d.ts +17 -2
  368. package/dist/labeled-field/labeled-field.js +7 -5
  369. package/dist/labeled-field/web/ds-labeled-field.d.ts +1 -1
  370. package/dist/labeled-field/web/ds-labeled-field.js +6 -2
  371. package/dist/leaderboard/leaderboard.d.ts +4 -3
  372. package/dist/leaderboard/leaderboard.js +4 -1
  373. package/dist/leaderboard/web/ds-leaderboard.d.ts +1 -1
  374. package/dist/leaderboard/web/ds-leaderboard.js +8 -3
  375. package/dist/legend/legend.d.ts +4 -0
  376. package/dist/legend/legend.js +1 -0
  377. package/dist/legend/web/ds-legend.js +18 -11
  378. package/dist/lib/chart-context.d.ts +23 -3
  379. package/dist/lib/chart-context.js +9 -3
  380. package/dist/lib/chart-finish.d.ts +13 -6
  381. package/dist/lib/chart-finish.js +8 -2
  382. package/dist/lib/chart-library.d.ts +1 -1
  383. package/dist/lib/chart-series.d.ts +7 -4
  384. package/dist/lib/chart-series.js +2 -4
  385. package/dist/lib/chart-ticks.d.ts +11 -0
  386. package/dist/lib/chart-ticks.js +11 -0
  387. package/dist/lib/chart-value.d.ts +1 -1
  388. package/dist/lib/chart-value.js +3 -1
  389. package/dist/lib/cn.d.ts +1 -0
  390. package/dist/lib/cn.js +7 -2
  391. package/dist/lib/time-of-day.d.ts +21 -0
  392. package/dist/lib/time-of-day.js +37 -0
  393. package/dist/lib/web/chart-finish.d.ts +1 -1
  394. package/dist/lib/web/chart-finish.js +1 -1
  395. package/dist/lib/web/density.d.ts +1 -0
  396. package/dist/lib/web/density.js +7 -0
  397. package/dist/lib/web/focus-habits.js +20 -8
  398. package/dist/lib/web/focus-trap.d.ts +10 -0
  399. package/dist/lib/web/focus-trap.js +4 -1
  400. package/dist/lib/web/live-announcer.d.ts +2 -0
  401. package/dist/lib/web/live-announcer.js +2 -1
  402. package/dist/lib/web/touch-target.d.ts +4 -4
  403. package/dist/lib/web/touch-target.js +3 -3
  404. package/dist/lib/web/use-anchored-surface.js +3 -2
  405. package/dist/lib/web/use-overlay.js +7 -1
  406. package/dist/list-page/list-page.d.ts +2 -1
  407. package/dist/list-page/web/ds-list-page.js +1 -5
  408. package/dist/list-row/list-row.d.ts +6 -6
  409. package/dist/list-row/list-row.js +4 -5
  410. package/dist/list-row/native/ds-list-row.js +7 -2
  411. package/dist/list-row/web/ds-list-row-group.d.ts +6 -2
  412. package/dist/list-row/web/ds-list-row-group.js +4 -2
  413. package/dist/list-row/web/ds-list-row.js +9 -9
  414. package/dist/loading-screen/native/ds-loading-screen.js +1 -1
  415. package/dist/log-viewer/log-viewer.d.ts +2 -2
  416. package/dist/log-viewer/log-viewer.js +1 -1
  417. package/dist/log-viewer/web/ds-log-viewer.js +6 -5
  418. package/dist/map/map.d.ts +5 -0
  419. package/dist/map/map.js +2 -0
  420. package/dist/map/web/ds-map.js +9 -3
  421. package/dist/map-banner/native/ds-map-banner.js +3 -3
  422. package/dist/map-banner/web/ds-map-banner.js +4 -4
  423. package/dist/map-controls/map-controls.d.ts +3 -5
  424. package/dist/map-controls/map-controls.js +4 -4
  425. package/dist/map-controls/native/ds-map-controls.js +1 -1
  426. package/dist/map-controls/web/ds-map-controls.js +1 -1
  427. package/dist/map-draw-toolbar/web/ds-map-draw-toolbar.js +3 -2
  428. package/dist/map-heatmap-layer/map-heatmap-layer.d.ts +1 -1
  429. package/dist/map-layers/map-layers.d.ts +1 -1
  430. package/dist/map-layers/map-layers.js +1 -1
  431. package/dist/map-layers/native/ds-map-layers.d.ts +4 -2
  432. package/dist/map-layers/native/ds-map-layers.js +5 -4
  433. package/dist/map-layers/web/ds-map-layers.js +4 -4
  434. package/dist/map-list/map-list.d.ts +2 -1
  435. package/dist/map-list/web/ds-map-list.d.ts +1 -1
  436. package/dist/map-list/web/ds-map-list.js +19 -16
  437. package/dist/map-marker/map-marker.d.ts +5 -0
  438. package/dist/map-marker/map-marker.js +6 -0
  439. package/dist/map-marker/web/ds-map-marker.d.ts +12 -3
  440. package/dist/map-marker/web/ds-map-marker.js +18 -8
  441. package/dist/map-search/map-search.d.ts +9 -0
  442. package/dist/map-search/map-search.js +13 -0
  443. package/dist/map-search/native/ds-map-search.d.ts +10 -3
  444. package/dist/map-search/native/ds-map-search.js +32 -19
  445. package/dist/map-search/web/ds-map-search.d.ts +8 -3
  446. package/dist/map-search/web/ds-map-search.js +37 -27
  447. package/dist/map-search-area/native/ds-map-search-area.js +2 -1
  448. package/dist/map-search-area/web/ds-map-search-area.js +2 -1
  449. package/dist/map-sheet/native/ds-map-sheet.js +1 -1
  450. package/dist/map-sheet/web/ds-map-sheet.js +2 -2
  451. package/dist/map-summary/map-summary.d.ts +2 -1
  452. package/dist/map-summary/web/ds-map-summary.d.ts +2 -2
  453. package/dist/map-summary/web/ds-map-summary.js +18 -9
  454. package/dist/mention-input/mention-input.d.ts +23 -2
  455. package/dist/mention-input/mention-input.js +15 -8
  456. package/dist/mention-input/native/ds-mention-input.d.ts +1 -1
  457. package/dist/mention-input/native/ds-mention-input.js +6 -9
  458. package/dist/mention-input/web/ds-mention-input.d.ts +1 -1
  459. package/dist/mention-input/web/ds-mention-input.js +6 -5
  460. package/dist/menu-button/web/ds-menu-button.d.ts +2 -2
  461. package/dist/menu-button/web/ds-menu-button.js +9 -4
  462. package/dist/meter/meter.d.ts +5 -2
  463. package/dist/meter/meter.js +2 -1
  464. package/dist/meter/native/ds-meter.d.ts +2 -2
  465. package/dist/meter/native/ds-meter.js +13 -3
  466. package/dist/meter/web/ds-meter.d.ts +1 -1
  467. package/dist/meter/web/ds-meter.js +16 -9
  468. package/dist/metric/metric.d.ts +13 -9
  469. package/dist/metric/native/ds-metric.d.ts +1 -1
  470. package/dist/metric/native/ds-metric.js +26 -16
  471. package/dist/metric/web/ds-metric.d.ts +1 -1
  472. package/dist/metric/web/ds-metric.js +21 -5
  473. package/dist/metric-card/metric-card.d.ts +4 -3
  474. package/dist/metric-card/web/ds-metric-card.d.ts +1 -1
  475. package/dist/metric-card/web/ds-metric-card.js +4 -2
  476. package/dist/month-picker/web/ds-month-picker.js +2 -1
  477. package/dist/month-strip/web/ds-month-strip.js +1 -1
  478. package/dist/motion.d.ts +18 -3
  479. package/dist/motion.js +3 -1
  480. package/dist/multi-select/multi-select.d.ts +39 -9
  481. package/dist/multi-select/multi-select.js +35 -22
  482. package/dist/multi-select/web/ds-multi-select.d.ts +1 -1
  483. package/dist/multi-select/web/ds-multi-select.js +42 -24
  484. package/dist/native.d.ts +12 -0
  485. package/dist/native.js +8 -0
  486. package/dist/notification-list/native/ds-notification-list.d.ts +1 -1
  487. package/dist/notification-list/native/ds-notification-list.js +14 -7
  488. package/dist/notification-list/notification-list.d.ts +2 -1
  489. package/dist/notification-list/web/ds-notification-list.d.ts +1 -1
  490. package/dist/notification-list/web/ds-notification-list.js +10 -4
  491. package/dist/number-field/native/ds-number-field.js +1 -1
  492. package/dist/number-field/web/ds-number-field.js +1 -1
  493. package/dist/otp/native/ds-otp-field.js +3 -21
  494. package/dist/otp/native/ds-otp.js +3 -3
  495. package/dist/otp/otp.d.ts +3 -3
  496. package/dist/otp/web/ds-otp.js +3 -3
  497. package/dist/overflow-menu/web/ds-overflow-menu.js +7 -2
  498. package/dist/page-head/web/ds-page-head.js +2 -2
  499. package/dist/panel/native/ds-panel.js +1 -1
  500. package/dist/panel/panel.d.ts +1 -1
  501. package/dist/panel/web/ds-panel.d.ts +3 -1
  502. package/dist/panel/web/ds-panel.js +3 -2
  503. package/dist/password-feedback/web/ds-password-feedback.d.ts +1 -1
  504. package/dist/password-feedback/web/ds-password-feedback.js +3 -3
  505. package/dist/password-input/web/ds-password-input.d.ts +7 -2
  506. package/dist/password-input/web/ds-password-input.js +28 -3
  507. package/dist/password-requirements/password-requirements.d.ts +12 -2
  508. package/dist/password-requirements/password-requirements.js +6 -8
  509. package/dist/password-requirements/web/ds-password-requirements.js +5 -5
  510. package/dist/password-strength/web/ds-password-strength.js +2 -2
  511. package/dist/payment-card/native/ds-payment-card.d.ts +1 -1
  512. package/dist/payment-card/native/ds-payment-card.js +1 -1
  513. package/dist/payment-card/web/ds-payment-card.d.ts +1 -1
  514. package/dist/payment-card/web/ds-payment-card.js +1 -1
  515. package/dist/people-cell/people-cell.d.ts +5 -2
  516. package/dist/people-cell/web/ds-people-cell.d.ts +1 -1
  517. package/dist/people-cell/web/ds-people-cell.js +6 -2
  518. package/dist/person-cell/person-cell.d.ts +5 -2
  519. package/dist/person-cell/web/ds-person-cell.d.ts +1 -1
  520. package/dist/person-cell/web/ds-person-cell.js +11 -1
  521. package/dist/phone-field/native/ds-phone-field.js +2 -2
  522. package/dist/phone-field/phone-field.d.ts +35 -0
  523. package/dist/phone-field/phone-field.js +38 -0
  524. package/dist/phone-field/web/ds-phone-field.d.ts +31 -3
  525. package/dist/phone-field/web/ds-phone-field.js +45 -8
  526. package/dist/place-card/native/ds-place-card.d.ts +7 -3
  527. package/dist/place-card/native/ds-place-card.js +32 -21
  528. package/dist/place-card/place-card.d.ts +12 -6
  529. package/dist/place-card/place-card.js +6 -3
  530. package/dist/place-card/web/ds-place-card.d.ts +5 -3
  531. package/dist/place-card/web/ds-place-card.js +39 -27
  532. package/dist/plan-chart/plan-chart.d.ts +2 -3
  533. package/dist/plan-chart/web/ds-plan-chart.d.ts +1 -1
  534. package/dist/plan-chart/web/ds-plan-chart.js +34 -6
  535. package/dist/popover/popover.d.ts +7 -3
  536. package/dist/popover/web/ds-popover.d.ts +5 -1
  537. package/dist/popover/web/ds-popover.js +4 -2
  538. package/dist/priority-indicator/native/ds-priority-indicator.js +4 -4
  539. package/dist/priority-indicator/priority-indicator.d.ts +3 -3
  540. package/dist/priority-indicator/priority-indicator.js +3 -3
  541. package/dist/priority-indicator/web/ds-priority-indicator.js +4 -4
  542. package/dist/profile-card/profile-card.d.ts +2 -1
  543. package/dist/profile-card/web/ds-profile-card.d.ts +2 -2
  544. package/dist/profile-card/web/ds-profile-card.js +16 -3
  545. package/dist/progress-bar/native/ds-progress-bar.js +2 -1
  546. package/dist/progress-bar/web/ds-progress-bar.js +2 -1
  547. package/dist/progress-cell/progress-cell.d.ts +8 -3
  548. package/dist/progress-cell/progress-cell.js +1 -1
  549. package/dist/progress-cell/web/ds-progress-cell.d.ts +5 -2
  550. package/dist/progress-cell/web/ds-progress-cell.js +6 -2
  551. package/dist/progress-ring/native/ds-progress-ring.js +16 -11
  552. package/dist/progress-ring/progress-ring.d.ts +8 -4
  553. package/dist/progress-ring/progress-ring.js +7 -3
  554. package/dist/progress-ring/web/ds-progress-ring.js +16 -10
  555. package/dist/proportion-bar/native/ds-proportion-bar.d.ts +2 -2
  556. package/dist/proportion-bar/native/ds-proportion-bar.js +18 -7
  557. package/dist/proportion-bar/proportion-bar.d.ts +10 -3
  558. package/dist/proportion-bar/proportion-bar.js +6 -1
  559. package/dist/proportion-bar/web/ds-proportion-bar.d.ts +1 -1
  560. package/dist/proportion-bar/web/ds-proportion-bar.js +21 -14
  561. package/dist/quick-actions/native/ds-quick-actions.js +17 -2
  562. package/dist/quick-actions/quick-actions.d.ts +32 -2
  563. package/dist/quick-actions/quick-actions.js +9 -1
  564. package/dist/quick-actions/web/ds-quick-actions.js +20 -6
  565. package/dist/radar-chart/radar-chart.d.ts +11 -3
  566. package/dist/radar-chart/radar-chart.js +21 -3
  567. package/dist/radar-chart/web/ds-radar-chart.d.ts +1 -1
  568. package/dist/radar-chart/web/ds-radar-chart.js +34 -22
  569. package/dist/radial-progress/native/ds-radial-progress.d.ts +6 -2
  570. package/dist/radial-progress/native/ds-radial-progress.js +34 -11
  571. package/dist/radial-progress/radial-progress.d.ts +11 -2
  572. package/dist/radial-progress/radial-progress.js +9 -0
  573. package/dist/radial-progress/web/ds-radial-progress.d.ts +6 -2
  574. package/dist/radial-progress/web/ds-radial-progress.js +24 -10
  575. package/dist/radio/radio.d.ts +4 -4
  576. package/dist/radio/radio.js +4 -4
  577. package/dist/radio/web/ds-radio.d.ts +6 -2
  578. package/dist/radio/web/ds-radio.js +22 -10
  579. package/dist/radio-group/radio-group.d.ts +41 -5
  580. package/dist/radio-group/radio-group.js +5 -0
  581. package/dist/radio-group/web/ds-radio-group.d.ts +1 -1
  582. package/dist/radio-group/web/ds-radio-group.js +7 -2
  583. package/dist/rating-badge/rating-badge.d.ts +8 -2
  584. package/dist/rating-badge/rating-badge.js +5 -0
  585. package/dist/rating-badge/web/ds-rating-badge.d.ts +2 -2
  586. package/dist/rating-badge/web/ds-rating-badge.js +6 -4
  587. package/dist/recipient-select/recipient-select.d.ts +7 -0
  588. package/dist/recipient-select/recipient-select.js +3 -0
  589. package/dist/recipient-select/web/ds-recipient-select.js +4 -4
  590. package/dist/record-panel/record-panel.d.ts +17 -2
  591. package/dist/record-panel/web/ds-record-panel.d.ts +48 -13
  592. package/dist/record-panel/web/ds-record-panel.js +27 -18
  593. package/dist/reorder-list/reorder-list.d.ts +3 -0
  594. package/dist/reorder-list/web/ds-reorder-list.d.ts +6 -1
  595. package/dist/reorder-list/web/ds-reorder-list.js +6 -4
  596. package/dist/resend-control/native/ds-resend-control.d.ts +24 -0
  597. package/dist/resend-control/native/ds-resend-control.js +73 -0
  598. package/dist/resend-control/resend-control.d.ts +2 -0
  599. package/dist/resend-control/resend-control.js +2 -0
  600. package/dist/resend-control/web/ds-resend-control.js +3 -3
  601. package/dist/route-fields/route-fields.d.ts +79 -0
  602. package/dist/route-fields/route-fields.js +71 -0
  603. package/dist/route-fields/web/ds-route-fields.d.ts +5 -0
  604. package/dist/route-fields/web/ds-route-fields.js +83 -0
  605. package/dist/route-line/web/ds-route-line.js +2 -2
  606. package/dist/save-bar/save-bar.d.ts +1 -1
  607. package/dist/save-bar/save-bar.js +1 -1
  608. package/dist/save-bar/web/ds-save-bar.js +2 -2
  609. package/dist/scanner/scanner.d.ts +1 -1
  610. package/dist/scanner/scanner.js +2 -1
  611. package/dist/scatter-chart/scatter-chart.d.ts +2 -3
  612. package/dist/scatter-chart/web/ds-scatter-chart.d.ts +1 -1
  613. package/dist/scatter-chart/web/ds-scatter-chart.js +13 -4
  614. package/dist/schedule-chart/schedule-chart.d.ts +187 -0
  615. package/dist/schedule-chart/schedule-chart.js +285 -0
  616. package/dist/schedule-chart/web/ds-schedule-chart.d.ts +24 -0
  617. package/dist/schedule-chart/web/ds-schedule-chart.js +143 -0
  618. package/dist/segmented-control/native/ds-segmented-control.d.ts +1 -1
  619. package/dist/segmented-control/native/ds-segmented-control.js +1 -1
  620. package/dist/segmented-control/segmented-control.d.ts +7 -0
  621. package/dist/segmented-control/web/ds-segmented-control.d.ts +1 -1
  622. package/dist/segmented-control/web/ds-segmented-control.js +4 -3
  623. package/dist/select/native/ds-select.js +6 -3
  624. package/dist/select/select.d.ts +5 -0
  625. package/dist/select/web/ds-select.d.ts +14 -1
  626. package/dist/select/web/ds-select.js +22 -12
  627. package/dist/settings-directory/native/ds-settings-directory.js +1 -1
  628. package/dist/settings-directory/web/ds-settings-directory.js +1 -1
  629. package/dist/settings-row/web/ds-settings-row.d.ts +3 -1
  630. package/dist/settings-row/web/ds-settings-row.js +2 -2
  631. package/dist/sheet/web/ds-sheet.js +3 -3
  632. package/dist/side-nav/side-nav.d.ts +2 -1
  633. package/dist/side-nav/web/ds-side-nav-collapse.d.ts +4 -1
  634. package/dist/side-nav/web/ds-side-nav-collapse.js +6 -3
  635. package/dist/side-nav/web/ds-side-nav-header.js +1 -1
  636. package/dist/side-nav/web/ds-side-nav-primary.js +1 -1
  637. package/dist/side-nav/web/ds-side-nav-profile.js +1 -1
  638. package/dist/side-nav/web/ds-side-nav.d.ts +1 -1
  639. package/dist/side-nav/web/ds-side-nav.js +3 -3
  640. package/dist/skeleton/skeleton.d.ts +20 -0
  641. package/dist/skeleton/skeleton.js +4 -0
  642. package/dist/slider/native/ds-slider.js +1 -1
  643. package/dist/small-multiples/small-multiples.d.ts +3 -4
  644. package/dist/small-multiples/small-multiples.js +2 -1
  645. package/dist/small-multiples/web/ds-small-multiples.d.ts +1 -1
  646. package/dist/small-multiples/web/ds-small-multiples.js +8 -2
  647. package/dist/sparkline/sparkline.d.ts +19 -7
  648. package/dist/sparkline/sparkline.js +42 -17
  649. package/dist/sparkline/web/ds-sparkline.d.ts +1 -1
  650. package/dist/sparkline/web/ds-sparkline.js +4 -3
  651. package/dist/split-pane/web/ds-split-pane.js +2 -2
  652. package/dist/stat-tile/native/ds-stat-tile.d.ts +3 -3
  653. package/dist/stat-tile/native/ds-stat-tile.js +14 -7
  654. package/dist/stat-tile/stat-tile.d.ts +14 -8
  655. package/dist/stat-tile/web/ds-stat-tile.d.ts +4 -2
  656. package/dist/stat-tile/web/ds-stat-tile.js +8 -5
  657. package/dist/state-message/web/ds-state-message.d.ts +6 -2
  658. package/dist/state-message/web/ds-state-message.js +5 -2
  659. package/dist/status-badge/native/ds-status-badge.js +3 -3
  660. package/dist/status-badge/status-badge.d.ts +3 -3
  661. package/dist/status-badge/status-badge.js +1 -1
  662. package/dist/status-badge/web/ds-status-badge.js +4 -4
  663. package/dist/status-cell/status-cell.d.ts +5 -2
  664. package/dist/status-cell/web/ds-status-cell.d.ts +6 -2
  665. package/dist/status-cell/web/ds-status-cell.js +7 -2
  666. package/dist/status-control/web/ds-status-control.js +3 -3
  667. package/dist/status-dot/native/ds-status-dot.js +1 -1
  668. package/dist/status-dot/status-dot.d.ts +2 -2
  669. package/dist/status-dot/status-dot.js +2 -2
  670. package/dist/status-dot/web/ds-status-dot.js +2 -2
  671. package/dist/stepper-form/stepper-form.d.ts +27 -4
  672. package/dist/stepper-form/stepper-form.js +17 -9
  673. package/dist/stepper-form/web/ds-stepper-form.d.ts +1 -1
  674. package/dist/stepper-form/web/ds-stepper-form.js +7 -5
  675. package/dist/stick-chart/stick-chart.d.ts +2 -1
  676. package/dist/stick-chart/stick-chart.js +2 -1
  677. package/dist/stick-chart/web/ds-stick-chart.d.ts +1 -1
  678. package/dist/stick-chart/web/ds-stick-chart.js +17 -3
  679. package/dist/switch/native/ds-switch.js +1 -1
  680. package/dist/system-state/native/ds-system-state.d.ts +29 -0
  681. package/dist/system-state/native/ds-system-state.js +68 -0
  682. package/dist/system-state/system-state.js +4 -3
  683. package/dist/system-state/web/ds-system-state.js +2 -2
  684. package/dist/table-toolbar/web/ds-table-toolbar.js +1 -1
  685. package/dist/tabs/tabs.d.ts +5 -0
  686. package/dist/tabs/tabs.js +2 -0
  687. package/dist/tabs/web/ds-tabs.js +2 -2
  688. package/dist/task-shell/task-shell.d.ts +15 -6
  689. package/dist/task-shell/task-shell.js +5 -2
  690. package/dist/task-shell/web/ds-task-shell.d.ts +21 -6
  691. package/dist/task-shell/web/ds-task-shell.js +52 -18
  692. package/dist/text/native/ds-text.js +1 -1
  693. package/dist/text/text.d.ts +1 -1
  694. package/dist/text/text.js +1 -1
  695. package/dist/text/web/ds-text.js +1 -1
  696. package/dist/textarea/native/ds-textarea.d.ts +1 -1
  697. package/dist/textarea/native/ds-textarea.js +9 -8
  698. package/dist/textarea/web/ds-textarea.d.ts +1 -1
  699. package/dist/textarea/web/ds-textarea.js +8 -7
  700. package/dist/time-field/time-field.d.ts +37 -0
  701. package/dist/time-field/time-field.js +23 -0
  702. package/dist/time-field/web/ds-time-field.d.ts +8 -0
  703. package/dist/time-field/web/ds-time-field.js +28 -0
  704. package/dist/time-range/time-range.d.ts +35 -26
  705. package/dist/time-range/time-range.js +28 -46
  706. package/dist/time-range/web/ds-time-range.d.ts +1 -1
  707. package/dist/time-range/web/ds-time-range.js +9 -6
  708. package/dist/timeline/native/ds-timeline.d.ts +2 -2
  709. package/dist/timeline/native/ds-timeline.js +21 -7
  710. package/dist/timeline/timeline.d.ts +2 -1
  711. package/dist/timeline/web/ds-timeline.d.ts +2 -2
  712. package/dist/timeline/web/ds-timeline.js +18 -9
  713. package/dist/toast/native/ds-toast.js +1 -1
  714. package/dist/toggle-group/native/ds-toggle-group.js +1 -1
  715. package/dist/token-roles.d.ts +1 -1
  716. package/dist/token-roles.js +18 -0
  717. package/dist/tone.d.ts +4 -4
  718. package/dist/tone.js +1 -5
  719. package/dist/toolbar/toolbar.d.ts +19 -7
  720. package/dist/toolbar/toolbar.js +4 -3
  721. package/dist/toolbar/web/ds-toolbar.d.ts +5 -2
  722. package/dist/toolbar/web/ds-toolbar.js +3 -3
  723. package/dist/track-bars/track-bars.d.ts +3 -4
  724. package/dist/track-bars/web/ds-track-bars.d.ts +1 -1
  725. package/dist/track-bars/web/ds-track-bars.js +9 -3
  726. package/dist/tree/tree.d.ts +1 -1
  727. package/dist/tree/tree.js +1 -1
  728. package/dist/tree/web/ds-tree.js +2 -2
  729. package/dist/treemap/treemap.d.ts +2 -3
  730. package/dist/treemap/web/ds-treemap.d.ts +1 -1
  731. package/dist/treemap/web/ds-treemap.js +14 -3
  732. package/dist/two-line-cell/two-line-cell.d.ts +5 -2
  733. package/dist/two-line-cell/web/ds-two-line-cell.d.ts +1 -1
  734. package/dist/two-line-cell/web/ds-two-line-cell.js +5 -1
  735. package/dist/vehicle-marker/vehicle-marker.d.ts +5 -4
  736. package/dist/vehicle-marker/vehicle-marker.js +3 -3
  737. package/dist/vehicle-marker/web/ds-vehicle-marker.js +9 -6
  738. package/dist/waterfall-chart/waterfall-chart.d.ts +10 -5
  739. package/dist/waterfall-chart/waterfall-chart.js +17 -12
  740. package/dist/waterfall-chart/web/ds-waterfall-chart.d.ts +7 -2
  741. package/dist/waterfall-chart/web/ds-waterfall-chart.js +49 -11
  742. package/dist/web.d.ts +20 -5
  743. package/dist/web.js +10 -2
  744. package/dist/week-schedule/web/ds-week-schedule.d.ts +1 -1
  745. package/dist/week-schedule/web/ds-week-schedule.js +4 -4
  746. package/dist/week-schedule/week-schedule.d.ts +23 -4
  747. package/dist/week-schedule/week-schedule.js +19 -13
  748. package/forced-colors.css +8 -5
  749. package/package.json +10 -15
@@ -1,13 +1,22 @@
1
1
  import { type ComponentProps, type ReactNode } from 'react';
2
- import { type ChartContract, type ChartPoint, type ChartTrendContract } from '../chart';
2
+ import { type ChartContract, type ChartPoint, type ChartForecastSentence, type ChartTrendContract } from '../chart';
3
3
  export type DSChartSeriesProps = Omit<ComponentProps<'div'>, 'title' | 'children'> & ChartContract & {
4
- /** Draws the series in as the chart first appears: a line uncovered from
5
- * the left, bars rising from the baseline. On by default; a person who has
6
- * asked for less motion sees the finished chart at once. */
4
+ /** Draws the series in as the chart first appears, a line uncovered from
5
+ * the left. On by default; a person who has asked for less motion sees the
6
+ * finished chart at once. */
7
7
  reveal?: boolean | undefined;
8
8
  /** How a figure reads on the axis, in the table and in the summary,
9
9
  * a currency, litres, a count. Defaults to en-ZA grouping. */
10
10
  formatValue?: ((value: number) => string) | undefined;
11
+ /** How a band's two ends are joined in the readout, the table and the
12
+ * summary, given both already formatted: `(low, high) => \`${low} to ${high}\``.
13
+ * The words are the caller's: this package joins nothing in a language of
14
+ * its own. Defaults to "low – high". */
15
+ formatBandRange?: ((low: string, high: string) => string) | undefined;
16
+ /** How the summary says where a forecast ends, given every part already
17
+ * formatted: `(f) => \`${f.series} is expected to reach ${f.value} by day ${f.at}.\``.
18
+ * The words are the caller's. Without it the parts are set side by side. */
19
+ formatForecast?: ((forecast: ChartForecastSentence) => string) | undefined;
11
20
  };
12
21
  export type DSChartTrendProps = Omit<ComponentProps<'div'>, 'role' | 'aria-label' | 'children'> & ChartTrendContract & {
13
22
  /** What the plot is OF. Required for the reason `DSMeter`'s is: a graphic
@@ -53,9 +62,10 @@ export type DSChartTrendProps = Omit<ComponentProps<'div'>, 'role' | 'aria-label
53
62
  /** What the period before is called in the readout and to a screen reader, "Last month". Required whenever `compare` is passed. */
54
63
  compareLabel?: string;
55
64
  };
56
- /** Either shape: the full chart (`kind` 'line' | 'bar' | 'grouped-bar'), or the
65
+ /** Either shape: the full chart (`kind` 'line' | 'stacked-area'), or the
57
66
  * trend (`kind` 'trend', or absent with a bare `values` array). */
58
67
  export type DSChartProps = DSChartSeriesProps | DSChartTrendProps;
59
- /** A line, bar or grouped-bar chart with a legend, a text summary and its data
60
- * as a table, or, given only `values`, a trend line for a metric card. */
68
+ /** A line or stacked-area chart with a legend, a text summary and its data as a
69
+ * table, or, given only `values`, a trend line for a metric card. For bars, use
70
+ * `DSBarChart`. */
61
71
  export declare function DSChart(props: DSChartProps): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Fragment, useEffect, useId, useRef, useState, } from 'react';
2
+ import { useEffect, useId, useRef, useState, } from 'react';
3
3
  import { DSButton } from '../../button/web/ds-button';
4
4
  import { DSEmptyState } from '../../empty-state/web/ds-empty-state';
5
5
  import { DSSkeleton } from '../../skeleton/web/ds-skeleton';
6
+ import { loadingSpoken } from '../../skeleton/skeleton';
7
+ import { SpokenRegion } from '../../lib/web/spoken-region';
6
8
  import { DSText } from '../../text/web/ds-text';
7
- import { CHART_FINISH_GRID_MIN_PX, CHART_FINISH_PARTNER, chartFinishGlowStops, chartFinishGridLines, chartFinishHueVar, chartFinishStagger, chartFinishSvgId, chartSeriesWashStops, } from '../../lib/chart-finish';
9
+ import { CHART_FINISH_GRID_MIN_PX, CHART_FINISH_PARTNER, chartFinishGlowStops, chartFinishGridLines, chartFinishHueVar, chartFinishSvgId, chartSeriesWashStops, } from '../../lib/chart-finish';
8
10
  import { CHART_ACCENT, CHART_QUIET, CHART_SERIES_BG, CHART_SERIES_FILL, CHART_SERIES_STROKE, chartSeriesSlot, } from '../../lib/chart-series';
9
- import { CHART_FINISH_ORNAMENT, CHART_FINISH_READOUT, ChartFinishGradient, FillSheenGradient, } from '../../lib/web/chart-finish';
11
+ import { CHART_FINISH_ORNAMENT, CHART_FINISH_READOUT, ChartFinishGradient, } from '../../lib/web/chart-finish';
10
12
  import { CHART_TABLE_CLASSES } from '../../lib/chart-table';
11
13
  import { cn } from '../../lib/cn';
12
- import { CHART_AXIS_BAND_PX, CHART_AXIS_GAP_PX, CHART_CATEGORY_BASELINE_PX, CHART_THIN_BAR_PX, CHART_DASH_ARRAYS, CHART_MAX_SERIES, CHART_PLAIN_LOOK, CHART_RIGHT_PAD_PX, CHART_TOP_PAD_PX, CHART_TREND_KIND, CHART_VIEWBOX, allSeries, axisGutter, bandLayout, categorySpacing, CHART_BAR_EDGE_PX, chartBarEdgePath, chartBarPath, chartCategoryAt, chartCategoryStep, chartNearest, chartScale, chartDrawsWash, chartSeriesCapIssue, chartSeriesCapNote, chartSeriesLooks, chartSeriesPaths, chartSpec, chartStep, chartTrendSpec, chartCompareNeedsALabel, CHART_COMPARE_NEEDS_A_LABEL, describeChart, describeMarks, chartStack, chartStackPaths, formatChartValue, isChartEmpty, labelStride, tableToggleLabel, valueY, visibleSeries, } from '../chart';
14
+ import { CHART_AXIS_BAND_PX, CHART_AXIS_GAP_PX, CHART_CATEGORY_BASELINE_PX, CHART_DASH_ARRAYS, CHART_MAX_SERIES, CHART_PLAIN_LOOK, CHART_RIGHT_PAD_PX, CHART_TOP_PAD_PX, CHART_TREND_KIND, CHART_VIEWBOX, allSeries, axisGutter, bandLayout, categorySpacing, chartBandAt, chartBandPath, chartBandRangeDefault, chartCategoryAt, chartCategoryStep, chartNearest, chartScale, chartDrawsWash, chartForecastIssues, chartIsExpected, chartProjectionIndex, chartRangeFor, chartReadingRows, chartSeriesCapIssue, chartSeriesCapNote, chartSeriesLooks, chartSeriesPaths, chartSpec, chartStep, chartTrendSpec, chartCompareNeedsALabel, CHART_COMPARE_NEEDS_A_LABEL, describeChart, chartReferenceLabelPlace, chartOverReference, describeMarks, chartStack, chartStackPaths, formatChartValue, isChartEmpty, labelStride, tableToggleLabel, valueY, visibleSeries, } from '../chart';
13
15
  const INK_SLOT = {
14
16
  'chart-series-1': 1,
15
17
  'chart-series-2': 2,
@@ -79,17 +81,6 @@ function useBoxSize(ref, active) {
79
81
  }, [ref, active]);
80
82
  return size;
81
83
  }
82
- function barPaint(spec, patternId) {
83
- return spec.pattern === 'solid'
84
- ? { className: INK_FILL[spec.ink], fill: undefined, ink: 'fill' }
85
- : { className: INK_STROKE[spec.ink], fill: `url(#${patternId})`, ink: 'stroke' };
86
- }
87
- function seriesLooks(kind, series, texture) {
88
- const looks = chartSeriesLooks(series, texture);
89
- return kind === 'bar' && series.length === 1
90
- ? looks.map((look) => ({ ...look, ink: 'chart-quiet' }))
91
- : looks;
92
- }
93
84
  function lookAt(looks, index) {
94
85
  return looks[index] ?? { ink: 'chart-series-1', ...CHART_PLAIN_LOOK };
95
86
  }
@@ -106,36 +97,26 @@ function Marker({ shape, ink }) {
106
97
  return _jsx("path", { d: "M0,-4.6 L4.6,0 L0,4.6 L-4.6,0 Z", className: className, "data-chart-ink": "fill" });
107
98
  }
108
99
  }
109
- function Patterns({ idFor, looks, }) {
110
- return (_jsx("svg", { width: 0, height: 0, className: "absolute", "aria-hidden": "true", focusable: "false", children: _jsx("defs", { children: looks.map((spec, j) => {
111
- if (spec.pattern === 'solid')
112
- return null;
113
- const stroke = INK_STROKE[spec.ink];
114
- return (_jsxs("pattern", { id: idFor(j), width: 6, height: 6, patternUnits: "userSpaceOnUse", children: [spec.pattern === 'hatch' && (_jsx("path", { d: "M-1,1 l2,-2 M0,6 l6,-6 M5,7 l2,-2", strokeWidth: 1.5, className: stroke, "data-chart-ink": "stroke" })), spec.pattern === 'dots' && (_jsx("circle", { cx: 3, cy: 3, r: 1.4, className: INK_FILL[spec.ink], "data-chart-ink": "fill" })), spec.pattern === 'cross' && (_jsx("path", { d: "M0,0 L6,6 M6,0 L0,6", strokeWidth: 1, className: stroke, "data-chart-ink": "stroke" }))] }, j));
115
- }) }) }));
116
- }
117
- function Swatch({ kind, count, index, look, patternId, emphasis, }) {
100
+ function Swatch({ kind, count, index, look, emphasis, }) {
118
101
  const spec = look;
119
102
  const comparison = spec.ink === 'chart-comparison';
120
- if (comparison && (kind === 'line' || kind === 'stacked-area')) {
103
+ if (comparison) {
121
104
  return (_jsx("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: _jsx("line", { x1: 1, x2: 27, y1: 6, y2: 6, strokeWidth: 1.5, strokeLinecap: "round", className: INK_STROKE[spec.ink], "data-chart-ink": "stroke" }) }));
122
105
  }
123
- if (kind === 'line' && !comparison && emphasis !== undefined && emphasis >= 0 && emphasis < count) {
106
+ if (kind === 'line' && emphasis !== undefined && emphasis >= 0 && emphasis < count) {
124
107
  const story = emphasis === index;
125
108
  return (_jsx("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: _jsx("line", { x1: 1, x2: 27, y1: 6, y2: 6, strokeWidth: story ? 2.5 : 1.5, strokeLinecap: "round", className: story ? CHART_ACCENT.stroke : 'stroke-muted-foreground opacity-40', "data-chart-ink": "stroke" }) }));
126
109
  }
127
- if (kind === 'line' || kind === 'stacked-area') {
128
- return (_jsxs("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: [_jsx("line", { x1: 1, x2: 27, y1: 6, y2: 6, strokeWidth: 2, strokeDasharray: CHART_DASH_ARRAYS[spec.dash], strokeLinecap: "round", className: INK_STROKE[spec.ink], "data-chart-ink": "stroke" }), _jsx("g", { transform: "translate(14,6)", children: _jsx(Marker, { shape: spec.marker, ink: spec.ink }) })] }));
129
- }
130
- const paint = barPaint(spec, patternId);
131
- return (_jsx("svg", { width: 14, height: 14, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: _jsx("rect", { x: 1, y: 1, width: 12, height: 12, rx: 3, strokeWidth: paint.ink === 'stroke' ? 1.5 : 0, fill: paint.fill, className: paint.className, "data-chart-ink": paint.ink }) }));
110
+ return (_jsxs("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: [_jsx("line", { x1: 1, x2: 27, y1: 6, y2: 6, strokeWidth: 2, strokeDasharray: CHART_DASH_ARRAYS[spec.dash], strokeLinecap: "round", className: INK_STROKE[spec.ink], "data-chart-ink": "stroke" }), _jsx("g", { transform: "translate(14,6)", children: _jsx(Marker, { shape: spec.marker, ink: spec.ink }) })] }));
132
111
  }
133
- function SeriesChart({ kind, title, categoryLabel, categories, series, emptyDescription, loading = false, summary, area = true, texture = false, reveal = true, formatValue = formatChartValue, references = [], events = [], emphasis, className, ...props }) {
112
+ function ChartSkeleton() {
113
+ return (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-3", "data-chart-loading": "", children: [_jsxs("div", { className: "flex gap-4", children: [_jsx(DSSkeleton, { fits: "body-sm", className: "w-20" }), _jsx(DSSkeleton, { fits: "body-sm", className: "w-16" })] }), _jsxs("div", { className: "flex min-h-0 flex-1 gap-3", children: [_jsx("div", { className: "flex w-10 flex-col justify-between pb-6", children: Array.from({ length: 4 }, (_, i) => (_jsx(DSSkeleton, { fits: "body-xs", className: "w-full" }, i))) }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [_jsx("div", { className: "flex min-h-0 flex-1 items-end gap-2", children: _jsx(DSSkeleton, { className: "h-full w-full rounded-xs" }) }), _jsx("div", { className: "flex justify-between", children: Array.from({ length: 6 }, (_, i) => (_jsx(DSSkeleton, { fits: "body-xs", className: "w-8" }, i))) })] })] }), _jsxs("div", { className: "flex flex-col", children: [_jsx(DSSkeleton, { fits: "body-sm", className: "w-full" }), _jsx(DSSkeleton, { fits: "body-sm", className: "w-2/3" })] })] }));
114
+ }
115
+ function SeriesChart({ kind, title, categoryLabel, categories, series, emptyDescription, loading = false, loadingLabel, summary, area = true, texture = false, reveal = true, formatValue = formatChartValue, references = [], events = [], emphasis, projectFrom, projectionLabel, projectionMarkerLabel, bandLabel, valueRange, formatBandRange = chartBandRangeDefault, formatForecast, className, ...props }) {
134
116
  const uid = useId().replace(/[^a-zA-Z0-9_-]/g, '');
135
117
  const summaryId = `${uid}-summary`;
136
118
  const tableId = `${uid}-table`;
137
119
  const captionId = `${uid}-caption`;
138
- const patternId = (j) => `${uid}-pattern-${String(j)}`;
139
120
  const [open, setOpen] = useState(false);
140
121
  const plotRef = useRef(null);
141
122
  const [active, setActive] = useState(undefined);
@@ -145,22 +126,33 @@ function SeriesChart({ kind, title, categoryLabel, categories, series, emptyDesc
145
126
  const shown = visibleSeries(categories, series);
146
127
  const everySeries = allSeries(categories, series);
147
128
  const capNote = chartSeriesCapNote(series.length);
129
+ const bandColumns = kind === 'line' && (bandLabel ?? '') !== ''
130
+ ? everySeries.flatMap((s, j) => (s.comparison !== true && s.band !== undefined ? [j] : []))
131
+ : [];
148
132
  if (process.env['NODE_ENV'] !== 'production' && series.length > CHART_MAX_SERIES) {
149
133
  console.warn(`DSChart: ${chartSeriesCapIssue(series.length)}`);
150
134
  }
151
- const looks = seriesLooks(kind, shown, texture);
135
+ const looks = chartSeriesLooks(shown, texture);
152
136
  const spec = chartSpec();
153
137
  const reach = references.map((r) => r.value);
154
- const scale = chartScale(kind === 'stacked-area' ? chartStack(shown) : shown, undefined, reach);
138
+ const split = kind === 'line' ? chartProjectionIndex(projectFrom, categories.length) : undefined;
139
+ const bandSeries = kind === 'line' ? shown.flatMap((s, j) => (s.comparison !== true && s.band !== undefined ? [j] : [])) : [];
140
+ const leadSeries = shown.findIndex((s) => s.comparison !== true);
141
+ if (process.env['NODE_ENV'] !== 'production') {
142
+ for (const issue of chartForecastIssues({ kind, categories, series, projectFrom, projectionLabel, projectionMarkerLabel, bandLabel, valueRange })) {
143
+ console.error(`DSChart: ${issue}`);
144
+ }
145
+ }
146
+ const range = chartRangeFor(kind, valueRange);
147
+ const scale = chartScale(kind === 'stacked-area' ? chartStack(shown) : shown, undefined, reach, range);
155
148
  const gutter = axisGutter(scale.ticks.map(formatValue));
156
149
  const plotWidth = Math.max(0, width - gutter - CHART_RIGHT_PAD_PX);
157
- const bands = bandLayout(categories.length, kind === 'line' || kind === 'stacked-area' ? 1 : shown.length, plotWidth);
150
+ const bands = bandLayout(categories.length, plotWidth);
158
151
  const reported = active ?? Math.max(0, categories.length - 1);
152
+ const words = { projectFrom: split, projectionLabel, bandLabel };
153
+ const readingRows = (i) => chartReadingRows(shown, i, words, formatValue, formatBandRange);
159
154
  function describePoint(i) {
160
- const parts = shown.map((s) => {
161
- const v = s.values[i] ?? null;
162
- return `${s.label} ${v === null ? 'no figure' : formatValue(v)}`;
163
- });
155
+ const parts = readingRows(i).map((row) => `${row.label} ${row.text}`);
164
156
  return `${categories[i] ?? ''}: ${parts.join(', ')}`;
165
157
  }
166
158
  function onPointer(event) {
@@ -195,98 +187,83 @@ function SeriesChart({ kind, title, categoryLabel, categories, series, emptyDesc
195
187
  }
196
188
  const description = summary !== undefined && summary.trim() !== ''
197
189
  ? summary
198
- : describeChart({ kind, categories, series }, formatValue);
199
- const marks = describeMarks(references, events, categories, formatValue);
200
- return (_jsxs("div", { className: cn('min-w-0', className), "data-forced-colors": "chart", ...props, children: [_jsx("span", { role: "status", className: "sr-only", children: loading ? `Loading ${title}` : '' }), _jsxs("div", { className: "flex h-80 min-w-0 flex-col gap-3", "aria-busy": loading ? true : undefined, "data-chart-body": "", children: [loading && (_jsxs(_Fragment, { children: [_jsx(DSSkeleton, { className: "w-1/3" }), _jsx(DSSkeleton, { className: "h-auto min-h-0 w-full flex-1 rounded-xs" }), _jsx(DSSkeleton, { className: "w-2/3" })] })), empty && (_jsx(DSEmptyState, { description: emptyDescription, className: "flex h-full flex-col items-center justify-center" })), drawn && (_jsxs(_Fragment, { children: [_jsx(Patterns, { idFor: patternId, looks: looks }), _jsx("ul", { className: "flex flex-wrap gap-x-4 gap-y-1", "aria-label": "Series", children: shown.map((s, j) => (_jsxs("li", { className: "flex items-center gap-2", children: [_jsx(Swatch, { kind: kind, count: shown.length, index: j, look: lookAt(looks, j), patternId: patternId(j), emphasis: emphasis }), _jsx(DSText, { variant: "body-sm", children: s.label })] }, j))) }), _jsx("div", { ref: plotRef, role: "slider", tabIndex: 0, "aria-label": title, "aria-describedby": summaryId, "aria-orientation": "horizontal", "aria-valuemin": 0, "aria-valuemax": Math.max(0, categories.length - 1), "aria-valuenow": reported, "aria-valuetext": describePoint(reported), className: "focusable relative min-h-0 min-w-0 flex-1 cursor-crosshair touch-pan-y rounded-xs", onPointerMove: onPointer, onPointerDown: onPointer, onPointerUp: onPointerEnd, onPointerLeave: onPointerEnd, onPointerCancel: onPointerEnd, onKeyDown: onKeyDown, onBlur: () => {
190
+ : describeChart({ kind, categories, series, projectFrom: split, projectionLabel, bandLabel }, formatValue, formatBandRange, formatForecast);
191
+ const marks = describeMarks(references, events, categories, formatValue, shown, { kind, projectFrom: split });
192
+ return (_jsxs("div", { className: cn('min-w-0', className), "data-forced-colors": "chart", ...props, children: [_jsx(SpokenRegion, { text: loadingSpoken(loading, loadingLabel) }), _jsxs("div", { className: "flex h-80 min-w-0 flex-col gap-3", "aria-busy": loading ? true : undefined, "data-chart-body": "", children: [loading && _jsx(ChartSkeleton, {}), empty && (_jsx(DSEmptyState, { description: emptyDescription, className: "flex h-full flex-col items-center justify-center" })), drawn && (_jsxs(_Fragment, { children: [_jsxs("ul", { className: "flex flex-wrap gap-x-4 gap-y-1", "aria-label": "Series", children: [shown.map((s, j) => (_jsxs("li", { className: "flex items-center gap-2", children: [_jsx(Swatch, { kind: kind, count: shown.length, index: j, look: lookAt(looks, j), emphasis: emphasis }), _jsx(DSText, { variant: "body-sm", children: s.label })] }, j))), split !== undefined && (projectionLabel ?? '') !== '' && leadSeries >= 0 && (_jsxs("li", { className: "flex items-center gap-2", "data-chart-legend": "projection", children: [_jsx("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: _jsx("line", { x1: 1, x2: 27, y1: 6, y2: 6, strokeWidth: 2, strokeDasharray: CHART_DASH_ARRAYS.dashed, strokeLinecap: "round", className: emphasis === leadSeries ? CHART_ACCENT.stroke : INK_STROKE[lookAt(looks, leadSeries).ink], "data-chart-ink": "stroke" }) }), _jsx(DSText, { variant: "body-sm", children: projectionLabel })] })), bandSeries.length > 0 && (bandLabel ?? '') !== '' && (_jsxs("li", { className: "flex items-center gap-2", "data-chart-legend": "band", children: [_jsx("svg", { width: 28, height: 12, "aria-hidden": "true", focusable: "false", className: "shrink-0", children: _jsx("rect", { x: 1, y: 1, width: 26, height: 10, rx: 3, className: cn(INK_FILL[lookAt(looks, bandSeries[0] ?? 0).ink], CHART_BAND_OPACITY), "data-chart-ink": "fill" }) }), _jsx(DSText, { variant: "body-sm", children: bandLabel })] }))] }), _jsx("div", { ref: plotRef, role: "slider", tabIndex: 0, "aria-label": title, "aria-describedby": summaryId, "aria-orientation": "horizontal", "aria-valuemin": 0, "aria-valuemax": Math.max(0, categories.length - 1), "aria-valuenow": reported, "aria-valuetext": describePoint(reported), className: "focusable relative min-h-0 min-w-0 flex-1 cursor-crosshair touch-pan-y rounded-xs", onPointerMove: onPointer, onPointerDown: onPointer, onPointerUp: onPointerEnd, onPointerLeave: onPointerEnd, onPointerCancel: onPointerEnd, onKeyDown: onKeyDown, onBlur: () => {
201
193
  setActive(undefined);
202
- }, children: _jsx(Plot, { kind: kind, uid: uid, title: title, categories: categories, series: shown, width: width, height: height, formatValue: formatValue, patternId: patternId, spec: spec, area: area, looks: looks, reveal: reveal, active: active, references: references, events: events, emphasis: emphasis }) }), _jsx(DSText, { as: "p", id: summaryId, variant: "body-sm", tone: "muted", children: marks === '' ? description : `${description} ${marks}` }), capNote !== '' && (_jsx(DSText, { as: "p", variant: "body-sm", tone: "muted", "data-chart-cap": "", children: capNote })), _jsx("div", { children: _jsx(DSButton, { variant: "link", quiet: true, labelSize: "sm", "aria-expanded": open, "aria-controls": tableId, onClick: () => {
194
+ }, children: _jsx(Plot, { kind: kind, uid: uid, title: title, categories: categories, series: shown, width: width, height: height, formatValue: formatValue, spec: spec, area: area, looks: looks, reveal: reveal, active: active, references: references, events: events, emphasis: emphasis, range: range, split: split, markerLabel: projectionMarkerLabel, readingRows: readingRows }) }), _jsx(DSText, { as: "p", id: summaryId, variant: "body-sm", tone: "muted", children: marks === '' ? description : `${description} ${marks}` }), capNote !== '' && (_jsx(DSText, { as: "p", variant: "body-sm", tone: "muted", "data-chart-cap": "", children: capNote })), _jsx("div", { children: _jsx(DSButton, { variant: "link", quiet: true, labelSize: "sm", "aria-expanded": open, "aria-controls": tableId, onClick: () => {
203
195
  setOpen((was) => !was);
204
- }, children: tableToggleLabel(open) }) })] }))] }), drawn && (_jsx("div", { id: tableId, hidden: !open, role: "region", "aria-labelledby": captionId, tabIndex: 0, className: "focusable mt-3 overflow-x-auto rounded-xs", children: _jsxs("table", { className: "w-full border-collapse text-body-sm text-card-foreground", children: [_jsx("caption", { id: captionId, className: CHART_TABLE_CLASSES.caption, children: title }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: "py-1 pr-4 text-left text-label-sm text-muted-foreground", children: categoryLabel }), everySeries.map((s, j) => (_jsx("th", { scope: "col", className: "py-1 pl-4 text-right text-label-sm text-muted-foreground", children: s.label }, j)))] }) }), _jsx("tbody", { children: categories.map((category, i) => (_jsxs("tr", { className: "border-t border-border", children: [_jsx("th", { scope: "row", className: "py-1 pr-4 text-left font-normal", children: category }), everySeries.map((s, j) => {
196
+ }, children: tableToggleLabel(open) }) })] }))] }), drawn && (_jsx("div", { id: tableId, hidden: !open, role: "region", "aria-labelledby": captionId, tabIndex: 0, className: "focusable mt-3 overflow-x-auto rounded-xs", children: _jsxs("table", { className: "w-full border-collapse text-body-sm text-card-foreground", children: [_jsx("caption", { id: captionId, className: CHART_TABLE_CLASSES.caption, children: title }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: "py-1 pr-4 text-left text-label-sm text-muted-foreground", children: categoryLabel }), everySeries.map((s, j) => (_jsx("th", { scope: "col", className: "py-1 pl-4 text-right text-label-sm text-muted-foreground", children: s.label }, j))), bandColumns.map((j) => (_jsx("th", { scope: "col", className: CHART_TABLE_CLASSES.figureHead, children: bandColumns.length === 1 ? bandLabel : `${everySeries[j]?.label ?? ''} ${bandLabel ?? ''}` }, `band-${String(j)}`)))] }) }), _jsx("tbody", { children: categories.map((category, i) => (_jsxs("tr", { className: "border-t border-border", children: [_jsx("th", { scope: "row", className: "py-1 pr-4 text-left font-normal", children: category }), everySeries.map((s, j) => {
205
197
  const value = s.values[i] ?? null;
206
- return (_jsx("td", { className: "py-1 pl-4 text-right tabular-nums", children: value === null ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u2014" }), _jsx("span", { className: "sr-only", children: "No figure" })] })) : (formatValue(value)) }, j));
198
+ return (_jsx("td", { className: "py-1 pl-4 text-right tabular-nums", children: value === null ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u2014" }), _jsx("span", { className: "sr-only", children: "No figure" })] })) : (_jsxs(_Fragment, { children: [formatValue(value), split !== undefined && (projectionLabel ?? '') !== '' && chartIsExpected(s, i, split) && (_jsx(DSText, { as: "span", variant: "label-sm", tone: "muted", className: "pl-2", children: projectionLabel }))] })) }, j));
199
+ }), bandColumns.map((j) => {
200
+ const band = chartBandAt(everySeries[j] ?? { label: '', values: [] }, i);
201
+ return (_jsx("td", { className: "py-1 pl-4 text-right tabular-nums", children: band === undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u2014" }), _jsx("span", { className: "sr-only", children: "No figure" })] })) : (formatBandRange(formatValue(band.low), formatValue(band.high))) }, `band-${String(j)}`));
207
202
  })] }, i))) })] }) }))] }));
208
203
  }
209
204
  const CHART_WASH_LEAD_SHARE = 0.7;
205
+ const CHART_BAND_OPACITY = 'opacity-16';
210
206
  const TOOLTIP_GAP_PX = 12;
211
- function Plot({ kind, uid, categories, series, width, height, formatValue, patternId, spec, area, looks, reveal, active, references, events, emphasis, }) {
207
+ function Plot({ kind, uid, categories, series, width, height, formatValue, spec, area, looks, reveal, active, references, events, emphasis, range, split, markerLabel, readingRows, }) {
212
208
  const isComparison = (j) => series[j]?.comparison === true;
213
209
  const quiet = (j) => emphasis !== undefined && emphasis >= 0 && emphasis < series.length && j !== emphasis && !isComparison(j);
214
- const washed = kind === 'line' && chartDrawsWash(series, area);
210
+ const hasBand = kind === 'line' && series.some((s, j) => s.comparison !== true && s.band !== undefined && !quiet(j));
211
+ const washed = kind === 'line' && !hasBand && chartDrawsWash(series, area);
215
212
  const washOwner = series.findIndex((s) => s.comparison !== true);
216
213
  const stack = kind === 'stacked-area' ? chartStack(series) : [];
217
- const scale = chartScale(kind === 'stacked-area' ? stack : series, undefined, references.map((r) => r.value));
214
+ const scale = chartScale(kind === 'stacked-area' ? stack : series, undefined, references.map((r) => r.value), range);
218
215
  const tickLabels = scale.ticks.map(formatValue);
219
216
  const gutter = axisGutter(tickLabels);
220
217
  const plotWidth = Math.max(0, width - gutter - CHART_RIGHT_PAD_PX);
221
218
  const plotHeight = Math.max(0, height - CHART_TOP_PAD_PX - CHART_AXIS_BAND_PX);
222
219
  const ready = plotWidth > 0 && plotHeight > 0;
223
- const bands = bandLayout(categories.length, kind === 'line' || kind === 'stacked-area' ? 1 : series.length, plotWidth);
220
+ const bands = bandLayout(categories.length, plotWidth);
224
221
  const stride = labelStride(categories.length, plotWidth, categorySpacing(categories));
225
- const edge = bands.barWidth < CHART_THIN_BAR_PX ? 0.75 : 1.5;
226
222
  const y = (value) => valueY(value, scale, plotHeight);
227
223
  const zero = y(Math.min(Math.max(0, scale.min), scale.max));
228
224
  const clipId = `${uid}-reveal`;
229
225
  const inspecting = active !== undefined;
230
- const single = series.length === 1;
226
+ const drawnLines = kind === 'line'
227
+ ? series.map((s) => s.values.flatMap((value, i) => (value === null ? [] : [{ x: bands.centre(i), y: y(value) }])))
228
+ : [];
231
229
  const activeCentre = active === undefined ? 0 : bands.centre(active);
232
230
  const beside = activeCentre > plotWidth / 2 ? 'left' : 'right';
233
- return (_jsxs(_Fragment, { children: [_jsx("svg", { "aria-hidden": "true", focusable: "false", width: width, height: height, className: "pointer-events-none absolute inset-0 block overflow-visible", "data-chart-plot": kind, children: ready && (_jsxs(_Fragment, { children: [_jsxs("defs", { children: [reveal && (_jsx("clipPath", { id: clipId, children: _jsx("rect", { x: 0, y: -CHART_TOP_PAD_PX, width: plotWidth, height: plotHeight + CHART_TOP_PAD_PX * 2, className: "transform-fill origin-left animate-reveal-x" }) })), _jsx(FillSheenGradient, { id: `${uid}-sheen`, upright: true }), washed && washOwner >= 0 && (_jsx(ChartFinishGradient, { id: `${uid}-wash-${String(washOwner)}`, vertical: true, stops: chartSeriesWashStops(INK_SLOT[lookAt(looks, washOwner).ink], CHART_WASH_LEAD_SHARE) }))] }), _jsxs("g", { transform: `translate(${String(gutter)},${String(CHART_TOP_PAD_PX)})`, className: "text-label-sm", children: [scale.ticks.map((tick, t) => (_jsxs("g", { children: [_jsx("line", { x1: 0, x2: plotWidth, y1: y(tick), y2: y(tick), strokeWidth: 1, className: GRID_STROKE[spec.grid], "data-chart-ink": "grid" }), _jsx("text", { x: -CHART_AXIS_GAP_PX, y: y(tick), textAnchor: "end", dominantBaseline: "middle", className: cn('tabular-nums', AXIS_FILL[spec.axis]), "data-chart-ink": "axis", children: tickLabels[t] })] }, t))), events.map((e) => categories[e.index] === undefined ? null : (_jsxs("g", { "data-chart-event": "", children: [_jsx("line", { x1: bands.centre(e.index), x2: bands.centre(e.index), y1: 0, y2: plotHeight, strokeWidth: 1, className: "stroke-muted-foreground", "data-chart-ink": "axis-line" }), _jsx("circle", { cx: bands.centre(e.index), cy: 0, r: 4, strokeWidth: 1.5, className: "fill-card stroke-muted-foreground", "data-chart-ink": "axis-line" })] }, `${e.label}-${String(e.index)}`))), inspecting && (kind === 'line' || kind === 'stacked-area') && (_jsx("line", { x1: activeCentre, x2: activeCentre, y1: 0, y2: plotHeight, strokeWidth: 1, className: "stroke-muted-foreground", "data-chart-ink": "axis-line" })), kind === 'stacked-area' ? (_jsx("g", { ...(reveal ? { clipPath: `url(#${clipId})` } : {}), children: chartStackPaths(stack, (i) => bands.centre(i), y, zero).map((paths, j) => {
231
+ return (_jsxs(_Fragment, { children: [_jsx("svg", { "aria-hidden": "true", focusable: "false", width: width, height: height, className: "pointer-events-none absolute inset-0 block overflow-visible", "data-chart-plot": kind, children: ready && (_jsxs(_Fragment, { children: [_jsxs("defs", { children: [reveal && (_jsx("clipPath", { id: clipId, children: _jsx("rect", { x: 0, y: -CHART_TOP_PAD_PX, width: plotWidth, height: plotHeight + CHART_TOP_PAD_PX * 2, className: "transform-fill origin-left animate-reveal-x" }) })), washed && washOwner >= 0 && (_jsx(ChartFinishGradient, { id: `${uid}-wash-${String(washOwner)}`, vertical: true, stops: chartSeriesWashStops(INK_SLOT[lookAt(looks, washOwner).ink], CHART_WASH_LEAD_SHARE) }))] }), _jsxs("g", { transform: `translate(${String(gutter)},${String(CHART_TOP_PAD_PX)})`, className: "text-label-sm", children: [scale.ticks.map((tick, t) => (_jsxs("g", { children: [_jsx("line", { x1: 0, x2: plotWidth, y1: y(tick), y2: y(tick), strokeWidth: 1, className: GRID_STROKE[spec.grid], "data-chart-ink": "grid" }), _jsx("text", { x: -CHART_AXIS_GAP_PX, y: y(tick), textAnchor: "end", dominantBaseline: "middle", className: cn('tabular-nums', AXIS_FILL[spec.axis]), "data-chart-ink": "axis", children: tickLabels[t] })] }, t))), events.map((e) => categories[e.index] === undefined ? null : (_jsxs("g", { "data-chart-event": "", children: [_jsx("line", { x1: bands.centre(e.index), x2: bands.centre(e.index), y1: 0, y2: plotHeight, strokeWidth: 1, className: "stroke-muted-foreground", "data-chart-ink": "axis-line" }), _jsx("circle", { cx: bands.centre(e.index), cy: 0, r: 4, strokeWidth: 1.5, className: "fill-card stroke-muted-foreground", "data-chart-ink": "axis-line" })] }, `${e.label}-${String(e.index)}`))), split !== undefined && (_jsx("line", { x1: bands.centre(split - 1), x2: bands.centre(split - 1), y1: 0, y2: plotHeight, strokeWidth: 1, className: "stroke-border-subtle", "data-chart-today": "", "data-chart-ink": "grid" })), inspecting && (_jsx("line", { x1: activeCentre, x2: activeCentre, y1: 0, y2: plotHeight, strokeWidth: 1, className: "stroke-muted-foreground", "data-chart-ink": "axis-line" })), kind === 'stacked-area' ? (_jsx("g", { ...(reveal ? { clipPath: `url(#${clipId})` } : {}), children: chartStackPaths(stack, (i) => bands.centre(i), y, zero).map((paths, j) => {
234
232
  const seriesSpec = lookAt(looks, j);
235
233
  return (_jsxs("g", { "data-chart-series": j, children: [_jsx("path", { d: paths.band, className: cn(INK_FILL[seriesSpec.ink], 'opacity-55 forced-colors:hidden print:hidden'), "data-chart-ink": "wash" }), _jsx("path", { d: paths.line, fill: "none", strokeWidth: 2, strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: CHART_DASH_ARRAYS[seriesSpec.dash], className: INK_STROKE[seriesSpec.ink], "data-chart-ink": "stroke" })] }, j));
236
- }) })) : kind === 'line' ? (_jsx("g", { ...(reveal ? { clipPath: `url(#${clipId})` } : {}), children: [...series.keys()]
237
- .reverse()
238
- .toSorted((a, b) => Number(!isComparison(a)) + Number(!quiet(a)) - (Number(!isComparison(b)) + Number(!quiet(b))))
239
- .map((j) => {
240
- const s = series[j];
241
- if (s === undefined)
242
- return null;
243
- const seriesSpec = lookAt(looks, j);
244
- const comparison = isComparison(j);
245
- const paths = chartSeriesPaths(s.values, (i) => bands.centre(i), y, plotHeight);
246
- return (_jsxs("g", { "data-chart-series": j, "data-chart-quiet": quiet(j) ? '' : undefined, children: [washed && j === washOwner && paths.area !== '' && (_jsx("path", { d: paths.area, fill: `url(#${uid}-wash-${String(j)})`, className: "forced-colors:hidden print:hidden", "data-chart-ink": "wash" })), _jsx("path", { d: paths.line, fill: "none", strokeWidth: comparison || quiet(j) ? 1.5 : emphasis === j ? 2.5 : 2, strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: quiet(j) || emphasis === j ? undefined : CHART_DASH_ARRAYS[seriesSpec.dash], className: quiet(j)
247
- ? 'stroke-muted-foreground opacity-40'
248
- : emphasis === j
249
- ? CHART_ACCENT.stroke
250
- : INK_STROKE[seriesSpec.ink], "data-chart-ink": "stroke" }), s.values.map((value, i) => value !== null && (paths.lone.includes(i) || active === i) ? (_jsx("g", { transform: `translate(${String(bands.centre(i))},${String(y(value))})`, children: _jsx("circle", { r: active === i ? 5 : 4, strokeWidth: 2, className: cn(INK_FILL[seriesSpec.ink], 'stroke-card'), "data-chart-ink": "fill" }) }, i)) : null)] }, j));
251
- }) })) : (_jsxs(_Fragment, { children: [active !== undefined && (_jsx("path", { d: chartBarPath(bands.barX(active, 0), 0, bands.barX(active, series.length - 1) + bands.barWidth - bands.barX(active, 0), plotHeight, true), className: "fill-accent opacity-60 forced-colors:hidden", "data-chart-track": "" })), series.map((s, j) => {
234
+ }) })) : (_jsxs("g", { ...(reveal ? { clipPath: `url(#${clipId})` } : {}), children: [series.map((s, j) => {
235
+ if (s.band === undefined || isComparison(j) || quiet(j))
236
+ return null;
237
+ const d = chartBandPath(s.band, (i) => bands.centre(i), y);
238
+ if (d === '')
239
+ return null;
240
+ return (_jsx("path", { d: d, className: cn(emphasis === j ? CHART_ACCENT.fill : INK_FILL[lookAt(looks, j).ink], CHART_BAND_OPACITY, 'forced-colors:hidden print:hidden'), "data-chart-band": j, "data-chart-ink": "wash" }, `band-${String(j)}`));
241
+ }), [...series.keys()]
242
+ .reverse()
243
+ .toSorted((a, b) => Number(!isComparison(a)) + Number(!quiet(a)) - (Number(!isComparison(b)) + Number(!quiet(b))))
244
+ .map((j) => {
245
+ const s = series[j];
246
+ if (s === undefined)
247
+ return null;
252
248
  const seriesSpec = lookAt(looks, j);
253
- const paint = barPaint(seriesSpec, patternId(j));
254
- return (_jsx("g", { "data-chart-series": j, children: s.values.map((value, i) => {
255
- if (value === null)
256
- return null;
257
- const top = Math.min(y(value), zero);
258
- const length = Math.abs(zero - y(value));
259
- const lifted = single && active === i;
260
- const solid = lifted || paint.ink === 'fill';
261
- const rise = reveal
262
- ? { animationDelay: `${String(chartFinishStagger(i, categories.length))}ms` }
263
- : {};
264
- return (_jsxs(Fragment, { children: [_jsx("path", { d: chartBarPath(bands.barX(i, j), top, bands.barWidth, length, value >= 0), strokeWidth: paint.ink === 'stroke' ? edge : 0, fill: lifted ? undefined : paint.fill, className: cn(lifted ? CHART_ACCENT.fill : paint.className, reveal && 'transform-fill origin-bottom animate-rise-y'), style: solid ? { ...rise, fillOpacity: 'var(--chart-bar-body, 1)' } : rise, "data-chart-ink": lifted ? 'fill' : paint.ink }), solid && (_jsx("path", { d: chartBarEdgePath(bands.barX(i, j), top, bands.barWidth, length, value >= 0, CHART_BAR_EDGE_PX / 2), fill: "none", strokeWidth: CHART_BAR_EDGE_PX, strokeLinecap: "round", "data-forced-colors": "mark", "data-chart-bar-edge": "", className: cn(lifted ? CHART_ACCENT.stroke : INK_STROKE[seriesSpec.ink], reveal && 'transform-fill origin-bottom animate-rise-y'), style: { ...rise, strokeOpacity: 'var(--chart-bar-mark, 0)' } }))] }, i));
265
- }) }, j));
266
- }), _jsx("g", { "data-chart-sheen": "", className: CHART_FINISH_ORNAMENT, children: series.map((s, j) => {
267
- const look = lookAt(looks, j);
268
- const paint = barPaint(look, patternId(j));
269
- if (look.ink === 'chart-comparison')
270
- return null;
271
- return s.values.map((value, i) => {
272
- if (value === null || (paint.ink !== 'fill' && !(single && active === i)))
273
- return null;
274
- const top = Math.min(y(value), zero);
275
- const length = Math.abs(zero - y(value));
276
- return (_jsx("path", { d: chartBarPath(bands.barX(i, j), top, bands.barWidth, length, value >= 0), fill: `url(#${uid}-sheen)`, className: cn(reveal && 'transform-fill origin-bottom animate-rise-y'), style: {
277
- ...(reveal
278
- ? { animationDelay: `${String(chartFinishStagger(i, categories.length))}ms` }
279
- : {}),
280
- fillOpacity: 'calc(1 - var(--chart-bar-mark, 0))',
281
- } }, `${String(j)}-${String(i)}`));
282
- });
283
- }) })] })), references.map((r) => (_jsxs("g", { "data-chart-reference": "", children: [_jsx("line", { x1: 0, x2: plotWidth, y1: y(r.value), y2: y(r.value), strokeWidth: 1, strokeDasharray: "4 3", className: "stroke-card-foreground", "data-chart-ink": "axis-line" }), _jsx("text", { x: plotWidth, y: y(r.value) - 4, textAnchor: "end", strokeWidth: 3, strokeLinejoin: "round", style: { paintOrder: 'stroke' }, className: "fill-card-foreground stroke-card", "data-chart-ink": "axis", children: r.label })] }, `${r.label}-${String(r.value)}`))), events.map((e) => categories[e.index] === undefined ? null : (_jsx("text", { x: bands.centre(e.index) + 8, y: 4, strokeWidth: 3, strokeLinejoin: "round", style: { paintOrder: 'stroke' }, className: cn('stroke-card', AXIS_FILL[spec.axis]), "data-chart-ink": "axis", children: e.label }, `${e.label}-${String(e.index)}`))), _jsx("line", { x1: 0, x2: plotWidth, y1: zero, y2: zero, strokeWidth: 1, className: GRID_STROKE[spec.grid], "data-chart-ink": "grid" }), categories.map((category, i) => i % stride === 0 ? (_jsx("text", { x: bands.centre(i), y: plotHeight + CHART_AXIS_BAND_PX - CHART_CATEGORY_BASELINE_PX, textAnchor: "middle", className: cn(AXIS_FILL[spec.axis], active === i && 'font-semibold'), "data-chart-ink": "axis", children: category }, i)) : null)] })] })) }), ready && active !== undefined && (_jsxs("div", { "aria-hidden": "true", "data-chart-tooltip": "", className: cn(CHART_FINISH_READOUT, 'absolute flex flex-col gap-1 px-2 py-2 whitespace-nowrap', beside === 'left' && '-translate-x-full'), style: {
249
+ const comparison = isComparison(j);
250
+ const paths = chartSeriesPaths(s.values, (i) => bands.centre(i), y, plotHeight, comparison ? undefined : split);
251
+ const lineClass = quiet(j)
252
+ ? 'stroke-muted-foreground opacity-40'
253
+ : emphasis === j
254
+ ? CHART_ACCENT.stroke
255
+ : INK_STROKE[seriesSpec.ink];
256
+ const lineWeight = comparison || quiet(j) ? 1.5 : emphasis === j ? 2.5 : 2;
257
+ const endValue = paths.end === undefined ? null : (s.values[paths.end] ?? null);
258
+ return (_jsxs("g", { "data-chart-series": j, "data-chart-quiet": quiet(j) ? '' : undefined, children: [washed && j === washOwner && paths.area !== '' && (_jsx("path", { d: paths.area, fill: `url(#${uid}-wash-${String(j)})`, className: "forced-colors:hidden print:hidden", "data-chart-ink": "wash" })), _jsx("path", { d: paths.line, fill: "none", strokeWidth: lineWeight, strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: quiet(j) || emphasis === j ? undefined : CHART_DASH_ARRAYS[seriesSpec.dash], className: lineClass, "data-chart-ink": "stroke" }), paths.projection !== '' && (_jsx("path", { d: paths.projection, fill: "none", strokeWidth: lineWeight, strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: CHART_DASH_ARRAYS.dashed, className: lineClass, "data-chart-projection": "", "data-chart-ink": "stroke" })), paths.end !== undefined && endValue !== null && (_jsx("circle", { cx: bands.centre(paths.end), cy: y(endValue), r: 4, strokeWidth: 2, className: cn(emphasis === j ? CHART_ACCENT.fill : INK_FILL[seriesSpec.ink], 'stroke-card'), "data-chart-end": "", "data-chart-ink": "fill" })), s.values.map((value, i) => value !== null && i !== paths.end && (paths.lone.includes(i) || active === i) ? (_jsx("g", { transform: `translate(${String(bands.centre(i))},${String(y(value))})`, children: _jsx("circle", { r: active === i ? 5 : 4, strokeWidth: 2, className: cn(INK_FILL[seriesSpec.ink], 'stroke-card'), "data-chart-ink": "fill" }) }, i)) : null)] }, j));
259
+ })] })), references.map((r) => {
260
+ const place = chartReferenceLabelPlace(y(r.value), r.label, plotWidth, drawnLines);
261
+ return (_jsxs("g", { "data-chart-reference": "", children: [_jsx("line", { x1: 0, x2: plotWidth, y1: y(r.value), y2: y(r.value), strokeWidth: 1, strokeDasharray: "4 3", className: "stroke-card-foreground", "data-chart-ink": "axis-line" }), _jsx("text", { x: place.x, y: place.y, textAnchor: place.anchor, strokeWidth: 3, strokeLinejoin: "round", style: { paintOrder: 'stroke' }, className: "fill-card-foreground stroke-card", "data-chart-ink": "axis", children: r.label })] }, `${r.label}-${String(r.value)}`));
262
+ }), kind === 'line' &&
263
+ chartOverReference(series, references, { kind, projectFrom: split }).map((o) => (_jsx("circle", { cx: bands.centre(o.index), cy: y(o.value), r: 4, strokeWidth: 2, className: "fill-chart-needs-you stroke-card", "data-chart-over": "" }, `over-${String(o.series)}-${String(o.index)}`))), events.map((e) => categories[e.index] === undefined ? null : (_jsx("text", { x: bands.centre(e.index) + 8, y: 4, strokeWidth: 3, strokeLinejoin: "round", style: { paintOrder: 'stroke' }, className: cn('stroke-card', AXIS_FILL[spec.axis]), "data-chart-ink": "axis", children: e.label }, `${e.label}-${String(e.index)}`))), split !== undefined && (markerLabel ?? '') !== '' && (_jsx("text", { x: bands.centre(split - 1) + 8, y: plotHeight - 6, strokeWidth: 3, strokeLinejoin: "round", style: { paintOrder: 'stroke' }, className: cn('stroke-card', AXIS_FILL[spec.axis]), "data-chart-today-label": "", "data-chart-ink": "axis", children: markerLabel })), _jsx("line", { x1: 0, x2: plotWidth, y1: zero, y2: zero, strokeWidth: 1, className: GRID_STROKE[spec.grid], "data-chart-ink": "grid" }), categories.map((category, i) => i % stride === 0 ? (_jsx("text", { x: bands.centre(i), y: plotHeight + CHART_AXIS_BAND_PX - CHART_CATEGORY_BASELINE_PX, textAnchor: "middle", className: cn(AXIS_FILL[spec.axis], active === i && 'font-semibold'), "data-chart-ink": "axis", children: category }, i)) : null)] })] })) }), ready && active !== undefined && (_jsxs("div", { "aria-hidden": "true", "data-chart-tooltip": "", className: cn(CHART_FINISH_READOUT, 'absolute flex flex-col gap-1 px-2 py-2 whitespace-nowrap', beside === 'left' && '-translate-x-full'), style: {
284
264
  top: CHART_TOP_PAD_PX,
285
265
  left: gutter + activeCentre + (beside === 'left' ? -TOOLTIP_GAP_PX : TOOLTIP_GAP_PX),
286
- }, children: [_jsx(DSText, { as: "span", variant: "label-sm", className: "text-muted-foreground", children: categories[active] }), series.map((s, j) => {
287
- const value = s.values[active] ?? null;
288
- return (_jsxs("span", { className: "flex items-center gap-2 text-label-sm tabular-nums", children: [_jsx("span", { "data-forced-colors": "mark", className: cn('size-2 shrink-0 rounded-full', INK_BG[lookAt(looks, j).ink]) }), _jsx("span", { className: "text-muted-foreground", children: s.label }), _jsx("span", { className: "ml-auto pl-3", children: value === null ? 'No figure' : formatValue(value) })] }, j));
289
- })] }))] }));
266
+ }, children: [_jsx(DSText, { as: "span", variant: "label-sm", className: "text-muted-foreground", children: categories[active] }), readingRows(active).map((row, r) => (_jsxs("span", { className: "flex items-center gap-2 text-label-sm tabular-nums", "data-chart-reading": row.kind, children: [_jsx("span", { "data-forced-colors": "mark", className: cn('size-2 shrink-0', row.kind === 'band' ? ['rounded-xs', CHART_BAND_OPACITY] : 'rounded-full', INK_BG[lookAt(looks, row.series).ink]) }), _jsx("span", { className: "text-muted-foreground", children: row.label }), _jsx("span", { className: "ml-auto pl-3", children: row.missing ? 'No figure' : row.text })] }, r)))] }))] }));
290
267
  }
291
268
  const hueStroke = (hue) => CHART_SERIES_STROKE[chartSeriesSlot(hue)];
292
269
  const hueDot = (hue) => CHART_SERIES_BG[chartSeriesSlot(hue)];
@@ -294,7 +271,7 @@ const READOUT_EDGE_PERCENT = 15;
294
271
  const TREND_LABEL_GUTTER_PX = 40;
295
272
  const LINE_WEIGHT = 2;
296
273
  const REFLECTION_SHARE = 0.55;
297
- function TrendChart({ kind = CHART_TREND_KIND, values, projectFrom, compare, compareLabel, series = 1, shape = 'line', reflection = false, label, height = 64, startLabel, endLabel, valueLabel, emptyLabel, reveal = false, scrub = false, formatValue = (value) => value.toLocaleString(), pointLabel, onScrub, className, ...props }) {
274
+ function TrendChart({ kind = CHART_TREND_KIND, values, projectFrom, compare, compareLabel, series = 1, shape = 'line', reflection = false, label, height = 64, startLabel, endLabel, valueLabel, emptyLabel, reveal = false, scrub = false, formatValue = formatChartValue, pointLabel, onScrub, className, ...props }) {
298
275
  const spec = chartTrendSpec({ values, projectFrom, series, ...(compare === undefined ? {} : { compare }) });
299
276
  if (process.env['NODE_ENV'] !== 'production' && chartCompareNeedsALabel(compare, compareLabel)) {
300
277
  console.error(`DSChart: ${CHART_COMPARE_NEEDS_A_LABEL}`);
@@ -378,12 +355,12 @@ function TrendChart({ kind = CHART_TREND_KIND, values, projectFrom, compare, com
378
355
  const dotClass = silhouette ? 'bg-hero-foreground' : hueDot(spec.series);
379
356
  const mirrorHeight = Math.round(height * REFLECTION_SHARE);
380
357
  const hero = height >= CHART_FINISH_GRID_MIN_PX;
381
- const grid = filled ? [] : chartFinishGridLines(height);
358
+ const grid = filled || chartFinishGridLines(height).length === 0 ? [] : [spec.zero];
382
359
  const viewBox = `0 0 ${String(CHART_VIEWBOX.width)} ${String(CHART_VIEWBOX.height)}`;
383
360
  const clip = reveal ? { clipPath: `url(#${clipId})` } : {};
384
361
  const across = { x1: 0, y1: 0, x2: CHART_VIEWBOX.width, y2: 0 };
385
362
  return (_jsxs("div", { className: cn('flex w-full flex-col gap-2 overflow-x-clip', className), "data-forced-colors": "chart", "data-chart-kind": kind, ...props, children: [_jsx("div", { className: "relative w-full", style: { height }, children: spec.empty ? (_jsx("div", { role: "img", "aria-label": `${label}: ${emptyLabel}`, className: "border-border text-muted-foreground flex h-full w-full items-center justify-center rounded-xs border border-dashed", children: _jsx("span", { className: "bg-muted rounded-xs px-3 py-2 text-body-sm", children: emptyLabel }) })) : (_jsxs(_Fragment, { children: [_jsxs("div", { ref: plotRef, className: cn('absolute inset-y-0 left-0', scrubbing &&
386
- 'focusable cursor-crosshair touch-pan-y rounded-xs focus-visible:-outline-offset-(--size-focus-ring-offset) focus-visible:shadow-none'), style: { right: gutter }, ...(scrubbing && reported !== undefined
363
+ 'focusable-inset cursor-crosshair touch-pan-y rounded-xs'), style: { right: gutter }, ...(scrubbing && reported !== undefined
387
364
  ? {
388
365
  role: 'slider',
389
366
  tabIndex: 0,
@@ -408,7 +385,7 @@ function TrendChart({ kind = CHART_TREND_KIND, values, projectFrom, compare, com
408
385
  ] }), _jsx("mask", { id: mountainMaskId, children: _jsx("rect", { x: 0, y: 0, width: CHART_VIEWBOX.width, height: CHART_VIEWBOX.height, fill: `url(#${mountainFadeId})` }) })] })), silhouette && (_jsx(ChartFinishGradient, { id: frostId, vertical: true, stops: [
409
386
  { offset: 0, color: 'var(--color-hero-foreground)', opacity: 0.32 },
410
387
  { offset: 1, color: 'var(--color-hero-foreground)', opacity: 0.06 },
411
- ] }))] }), spec.compare !== '' && (_jsx("path", { d: spec.compare, fill: "none", strokeWidth: weight * 0.75, strokeDasharray: "3 3", strokeLinecap: "round", vectorEffect: "non-scaling-stroke", className: "stroke-muted-foreground opacity-60", "data-chart-compare": "" })), _jsxs("g", { ...clip, children: [mountain ? (_jsx("path", { d: spec.curveBleed, fill: `url(#${mountainId})`, mask: `url(#${mountainMaskId})`, className: CHART_FINISH_ORNAMENT })) : silhouette ? (_jsx("path", { d: spec.curveBleed, fill: `url(#${frostId})`, className: CHART_FINISH_ORNAMENT })) : (_jsx("path", { d: spec.curveArea, className: CHART_FINISH_ORNAMENT, fill: `url(#${washId})` })), _jsx("path", { d: spec.curve, fill: "none", strokeWidth: weight, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", className: lineClass, "data-chart-ink": "stroke" }), spec.curveProjection !== '' && (_jsx("path", { d: spec.curveProjection, fill: "none", strokeWidth: weight, strokeDasharray: "3 3", vectorEffect: "non-scaling-stroke", className: lineClass, "data-chart-ink": "stroke" }))] })] }), spec.head !== undefined && active === undefined && (_jsxs("div", { "aria-hidden": true, className: "pointer-events-none absolute", style: { left: `${String(spec.head.x)}%`, top: `${String(spec.head.y)}%` }, children: [_jsx("span", { className: cn('absolute -translate-x-1/2 -translate-y-1/2 rounded-full opacity-(--chart-glow-opacity) blur-xs', hero ? 'size-6' : 'size-4', dotClass, CHART_FINISH_ORNAMENT) }), changed && (_jsx("span", { className: cn('animate-value-flash absolute size-5 -translate-x-1/2 -translate-y-1/2 rounded-full', hueDot(spec.series), CHART_FINISH_ORNAMENT) }, String(spec.last))), _jsx("span", { className: cn('absolute -translate-x-1/2 -translate-y-1/2 rounded-full', silhouette ? 'ring-hero' : 'ring-card', hero ? 'size-2 ring-2' : 'size-1.5 ring-1', dotClass) })] })), scrubbing && active !== undefined && (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": true, className: "via-muted-foreground pointer-events-none absolute inset-y-0 w-px bg-linear-to-b from-transparent to-transparent opacity-60", style: { left: `${String(active.x)}%` } }), _jsxs("div", { "aria-hidden": true, className: "pointer-events-none absolute", style: { left: `${String(active.x)}%`, top: `${String(active.y)}%` }, children: [_jsx("span", { className: cn('absolute size-7 -translate-x-1/2 -translate-y-1/2 rounded-full opacity-(--chart-glow-opacity) blur-xs', hueDot(spec.series), CHART_FINISH_ORNAMENT) }), _jsx("span", { className: cn('ring-card shadow-low absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2', hueDot(spec.series)) })] }), _jsxs("div", { "aria-hidden": true, className: cn(CHART_FINISH_READOUT, 'absolute bottom-full mb-2 flex flex-col gap-1 px-3 py-2 whitespace-nowrap', readoutAt), style: { left: `${String(active.x)}%` }, children: [pointLabel !== undefined && (_jsx(DSText, { as: "span", variant: "label-sm", className: "text-muted-foreground", children: pointLabel(active.index) })), _jsxs("span", { className: "text-body-sm flex items-center gap-2 font-medium tabular-nums", children: [_jsx("span", { className: cn('size-2 shrink-0 rounded-full', hueDot(spec.series)) }), formatValue(active.value)] }), before(active) !== undefined && (_jsxs(DSText, { as: "span", variant: "body-xs", className: "text-muted-foreground flex items-center gap-2 tabular-nums", children: [_jsx("span", { className: "border-muted-foreground w-2 shrink-0 border-t border-dashed" }), compareLabel === undefined
388
+ ] }))] }), spec.compare !== '' && (_jsx("path", { d: spec.compare, fill: "none", strokeWidth: weight * 0.75, strokeDasharray: "3 3", strokeLinecap: "round", vectorEffect: "non-scaling-stroke", className: "stroke-muted-foreground opacity-60", "data-chart-compare": "" })), _jsxs("g", { ...clip, children: [mountain ? (_jsx("path", { d: spec.curveBleed, fill: `url(#${mountainId})`, mask: `url(#${mountainMaskId})`, className: CHART_FINISH_ORNAMENT })) : silhouette ? (_jsx("path", { d: spec.curveBleed, fill: `url(#${frostId})`, className: CHART_FINISH_ORNAMENT })) : (_jsx("path", { d: spec.curveArea, className: CHART_FINISH_ORNAMENT, fill: `url(#${washId})` })), _jsx("path", { d: spec.curve, fill: "none", strokeWidth: weight, strokeLinecap: "round", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", className: lineClass, "data-chart-ink": "stroke" }), spec.curveProjection !== '' && (_jsx("path", { d: spec.curveProjection, fill: "none", strokeWidth: weight, strokeDasharray: "3 3", vectorEffect: "non-scaling-stroke", className: lineClass, "data-chart-ink": "stroke" }))] })] }), spec.lone.map((p) => (_jsx("span", { "aria-hidden": true, "data-chart-lone": "", className: cn('pointer-events-none absolute size-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full', dotClass), style: { left: `${String(p.x)}%`, top: `${String(p.y)}%` } }, p.index))), spec.head !== undefined && active === undefined && (_jsxs("div", { "aria-hidden": true, className: "pointer-events-none absolute", style: { left: `${String(spec.head.x)}%`, top: `${String(spec.head.y)}%` }, children: [_jsx("span", { className: cn('absolute -translate-x-1/2 -translate-y-1/2 rounded-full opacity-(--chart-glow-opacity) blur-xs', hero ? 'size-6' : 'size-4', dotClass, CHART_FINISH_ORNAMENT) }), changed && (_jsx("span", { className: cn('animate-value-flash absolute size-5 -translate-x-1/2 -translate-y-1/2 rounded-full', hueDot(spec.series), CHART_FINISH_ORNAMENT) }, String(spec.last))), _jsx("span", { className: cn('absolute -translate-x-1/2 -translate-y-1/2 rounded-full', silhouette ? 'ring-hero' : 'ring-card', hero ? 'size-2 ring-2' : 'size-1.5 ring-1', dotClass) })] })), scrubbing && active !== undefined && (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": true, className: "via-muted-foreground pointer-events-none absolute inset-y-0 w-px bg-linear-to-b from-transparent to-transparent opacity-60", style: { left: `${String(active.x)}%` } }), _jsxs("div", { "aria-hidden": true, className: "pointer-events-none absolute", style: { left: `${String(active.x)}%`, top: `${String(active.y)}%` }, children: [_jsx("span", { className: cn('absolute size-7 -translate-x-1/2 -translate-y-1/2 rounded-full opacity-(--chart-glow-opacity) blur-xs', hueDot(spec.series), CHART_FINISH_ORNAMENT) }), _jsx("span", { className: cn('ring-card shadow-low absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2', hueDot(spec.series)) })] }), _jsxs("div", { "aria-hidden": true, className: cn(CHART_FINISH_READOUT, 'absolute bottom-full mb-2 flex flex-col gap-1 px-3 py-2 whitespace-nowrap', readoutAt), style: { left: `${String(active.x)}%` }, children: [pointLabel !== undefined && (_jsx(DSText, { as: "span", variant: "label-sm", className: "text-muted-foreground", children: pointLabel(active.index) })), _jsxs("span", { className: "text-body-sm flex items-center gap-2 font-medium tabular-nums", children: [_jsx("span", { className: cn('size-2 shrink-0 rounded-full', hueDot(spec.series)) }), formatValue(active.value)] }), before(active) !== undefined && (_jsxs(DSText, { as: "span", variant: "body-xs", className: "text-muted-foreground flex items-center gap-2 tabular-nums", children: [_jsx("span", { className: "border-muted-foreground w-2 shrink-0 border-t border-dashed" }), compareLabel === undefined
412
389
  ? formatValue(before(active)?.value ?? 0)
413
390
  : `${compareLabel} ${formatValue(before(active)?.value ?? 0)}`] }))] })] }))] }), valueLabel !== undefined && (_jsx(DSText, { as: "span", variant: "body-xs", className: cn('text-muted-foreground absolute right-0 -translate-y-1/2 tabular-nums', active !== undefined && 'opacity-0'), style: { top: `${String(spec.lastY)}%` }, children: valueLabel }))] })) }), reflection && filled && !spec.empty && (_jsxs("svg", { "aria-hidden": true, width: "100%", height: mirrorHeight, className: cn('-mt-2 block w-full', CHART_FINISH_ORNAMENT), viewBox: viewBox, preserveAspectRatio: "none", style: { marginRight: gutter }, children: [_jsxs("defs", { children: [_jsx(ChartFinishGradient, { id: mirrorFadeId, vertical: true, stops: [
414
391
  { offset: 0, color: 'var(--color-hero-foreground)', opacity: 0.4 },
@@ -15,7 +15,7 @@ export type CheckOptionAppearance = (typeof CHECK_OPTION_APPEARANCES)[number];
15
15
  /** The card's resting fill. A neutral step, not the brand tint, see above. */
16
16
  export declare const CHECK_OPTION_CARD_SURFACE: "muted";
17
17
  export declare const CHECK_OPTION_CHECKED_SURFACE: "background";
18
- export declare const CHECK_OPTION_CHECKED_BORDER: "primary";
18
+ export declare const CHECK_OPTION_CHECKED_BORDER: "border-selected";
19
19
  /** The card's inset. Wider than it is tall, which is what stops a two-line
20
20
  * option reading as a paragraph with a tick in front of it. Both even. */
21
21
  export declare const CHECK_OPTION_CARD_PADDING_BLOCK_PX = 16;
@@ -6,7 +6,7 @@ export const CHECK_OPTION_CONTROLS = ['checkbox', 'radio'];
6
6
  export const CHECK_OPTION_APPEARANCES = ['row', 'card'];
7
7
  export const CHECK_OPTION_CARD_SURFACE = 'muted';
8
8
  export const CHECK_OPTION_CHECKED_SURFACE = 'background';
9
- export const CHECK_OPTION_CHECKED_BORDER = 'primary';
9
+ export const CHECK_OPTION_CHECKED_BORDER = 'border-selected';
10
10
  export const CHECK_OPTION_CARD_PADDING_BLOCK_PX = 16;
11
11
  export const CHECK_OPTION_CARD_PADDING_INLINE_PX = 20;
12
12
  export const CHECK_OPTION_CARD_BORDER_PX = 1;
@@ -22,7 +22,12 @@ export type DSCheckOptionProps = Omit<ComponentProps<'div'>, 'onChange' | 'title
22
22
  label: string;
23
23
  content: ReactNode;
24
24
  };
25
+ /** Why a box that must be ticked has not been: "Accept the terms to
26
+ * continue". Drawn under the title in the error ink and read with the box,
27
+ * and it marks the box invalid. For ONE box standing alone (terms, an
28
+ * agreement). A group's rule is the group's to say, see `invalid`. */
29
+ error?: ReactNode;
25
30
  onCheckedChange: (next: boolean) => void;
26
31
  };
27
32
  /** A checkbox and the sentence it belongs to. */
28
- export declare function DSCheckOption({ checked, appearance, control, name, disabled, invalid, title, description, meta, info, onCheckedChange, className, ...props }: DSCheckOptionProps): import("react/jsx-runtime").JSX.Element;
33
+ export declare function DSCheckOption({ checked, appearance, control, name, disabled, invalid, title, description, meta, info, error, onCheckedChange, className, ...props }: DSCheckOptionProps): import("react/jsx-runtime").JSX.Element;
@@ -3,9 +3,10 @@ import { useId } from 'react';
3
3
  import { Info } from 'lucide-react';
4
4
  import { checkOptionSpec, CHECK_OPTION_DESCRIPTION_INK, CHECK_OPTION_META_INK, } from '../check-option';
5
5
  import { DSCheckbox } from '../../checkbox/web/ds-checkbox';
6
+ import { DSHelperText } from '../../helper-text/web/ds-helper-text';
6
7
  import { DSTooltip } from '../../tooltip/web/ds-tooltip';
7
8
  import { cn } from '../../lib/cn';
8
- import { COARSE_POINTER_REACH } from '../../lib/web/touch-target';
9
+ import { SMALL_CONTROL_HIT_AREA } from '../../lib/web/touch-target';
9
10
  import { DSText } from '../../text/web/ds-text';
10
11
  const GEOMETRY = {
11
12
  row: 'rounded-field p-3 -mx-3',
@@ -17,7 +18,7 @@ const SURFACE = {
17
18
  };
18
19
  const CHECKED = {
19
20
  row: '',
20
- card: 'border border-transparent has-[input:checked]:bg-background has-[input:checked]:border-primary',
21
+ card: 'border border-transparent has-[input:checked]:bg-background has-[input:checked]:border-border-selected',
21
22
  };
22
23
  const STATE = {
23
24
  row: 'state-layer',
@@ -38,17 +39,20 @@ const DESCRIPTION_TYPE = {
38
39
  row: 'text-label-sm',
39
40
  card: 'text-body-sm',
40
41
  };
41
- export function DSCheckOption({ checked, appearance = 'row', control = 'checkbox', name, disabled, invalid, title, description, meta, info, onCheckedChange, className, ...props }) {
42
+ export function DSCheckOption({ checked, appearance = 'row', control = 'checkbox', name, disabled, invalid, title, description, meta, info, error, onCheckedChange, className, ...props }) {
42
43
  const spec = checkOptionSpec(appearance);
43
44
  const isDisabled = disabled === true;
44
45
  const generated = useId();
45
46
  const inputId = `${generated}-control`;
46
47
  const descriptionId = description === undefined ? undefined : `${generated}-description`;
47
48
  const infoId = info === undefined ? undefined : `${generated}-info`;
48
- const describedBy = [descriptionId, infoId].filter(Boolean).join(' ') || undefined;
49
- return (_jsxs("div", { className: cn('relative flex cursor-pointer items-start gap-3', GEOMETRY[spec.appearance], SURFACE[spec.appearance], CHECKED[spec.appearance], isDisabled ? cn('cursor-not-allowed', DISABLED_INK) : STATE[spec.appearance], 'focusable-within', className), ...(isDisabled ? { 'aria-disabled': true } : {}), ...props, children: [_jsx("span", { className: "flex h-5 flex-none items-center", children: _jsx(DSCheckbox, { id: inputId, control: control, size: spec.box, name: name, checked: checked, disabled: isDisabled, ...(invalid === true ? { invalid: true } : {}), ...(describedBy === undefined ? {} : { 'aria-describedby': describedBy }), onCheckedChange: (next) => {
49
+ const hasError = error !== undefined && error !== null && error !== false && error !== '';
50
+ const errorId = hasError ? `${generated}-error` : undefined;
51
+ const isInvalid = invalid === true || hasError;
52
+ const describedBy = [descriptionId, infoId, errorId].filter(Boolean).join(' ') || undefined;
53
+ return (_jsxs("div", { className: cn('relative flex cursor-pointer items-start gap-3', GEOMETRY[spec.appearance], SURFACE[spec.appearance], CHECKED[spec.appearance], isDisabled ? cn('cursor-not-allowed', DISABLED_INK) : STATE[spec.appearance], 'focusable-within', className), ...(isDisabled ? { 'aria-disabled': true } : {}), ...props, children: [_jsx("span", { className: "flex h-5 flex-none items-center", children: _jsx(DSCheckbox, { id: inputId, control: control, size: spec.box, name: name, checked: checked, disabled: isDisabled, ...(isInvalid ? { invalid: true } : {}), ...(describedBy === undefined ? {} : { 'aria-describedby': describedBy }), onCheckedChange: (next) => {
50
54
  if (control === 'radio' && !next)
51
55
  return;
52
56
  onCheckedChange(next);
53
- }, className: "focus-visible:outline-none focus-visible:shadow-none" }) }), _jsxs("span", { className: "block min-w-0 flex-1", children: [_jsxs("span", { className: cn('flex items-center gap-1', TITLE_TYPE[spec.appearance]), children: [_jsx("label", { htmlFor: inputId, className: "min-w-0 after:absolute after:inset-0", children: title }), info === undefined ? null : (_jsx(DSTooltip, { content: info.content, id: infoId, children: _jsx("button", { type: "button", "aria-label": info.label, className: cn('state-layer relative grid size-5 shrink-0 place-items-center rounded-xxs text-muted-foreground focusable', COARSE_POINTER_REACH), children: _jsx(Info, { "aria-hidden": true, className: "size-3.5" }) }) }))] }), description === undefined ? null : (_jsx("span", { id: descriptionId, className: cn('mt-1 block', DESCRIPTION_TYPE[spec.appearance], isDisabled ? DISABLED_INK : DESCRIPTION_INK[CHECK_OPTION_DESCRIPTION_INK]), children: description }))] }), meta === undefined ? null : (_jsx(DSText, { as: "span", variant: "label-sm", className: cn('flex-none tabular-nums', isDisabled ? DISABLED_INK : META_INK[CHECK_OPTION_META_INK]), children: meta }))] }));
57
+ }, className: "focus-visible:outline-none focus-visible:shadow-none" }) }), _jsxs("div", { className: "block min-w-0 flex-1", children: [_jsxs("span", { className: cn('flex items-center gap-1', TITLE_TYPE[spec.appearance]), children: [_jsx("label", { htmlFor: inputId, className: "min-w-0 after:absolute after:inset-0", children: title }), info === undefined ? null : (_jsx(DSTooltip, { content: info.content, id: infoId, children: _jsx("button", { type: "button", "aria-label": info.label, className: cn('state-layer relative grid size-5 shrink-0 place-items-center rounded-xxs text-muted-foreground focusable', SMALL_CONTROL_HIT_AREA), children: _jsx(Info, { "aria-hidden": true, className: "size-3.5" }) }) }))] }), description === undefined ? null : (_jsx("span", { id: descriptionId, className: cn('mt-1 block', DESCRIPTION_TYPE[spec.appearance], isDisabled ? DISABLED_INK : DESCRIPTION_INK[CHECK_OPTION_DESCRIPTION_INK]), children: description })), !hasError ? null : (_jsx(DSHelperText, { id: errorId, tone: "error", className: "mt-1", children: error }))] }), meta === undefined ? null : (_jsx(DSText, { as: "span", variant: "label-sm", className: cn('flex-none tabular-nums', isDisabled ? DISABLED_INK : META_INK[CHECK_OPTION_META_INK]), children: meta }))] }));
54
58
  }
@@ -35,7 +35,7 @@ export declare const CHECKBOX_STATE_SPECS: {
35
35
  readonly invalid: {
36
36
  readonly surface: "card";
37
37
  readonly mark: "primary-foreground";
38
- readonly border: "destructive";
38
+ readonly border: "error";
39
39
  };
40
40
  };
41
41
  export declare const CHECKBOX_DISABLED_SPEC: {
@@ -44,7 +44,7 @@ export declare const CHECKBOX_DISABLED_SPEC: {
44
44
  readonly border: "disabled-border";
45
45
  };
46
46
  /** The edge a box takes when its answer is wrong, ticked or not. */
47
- export declare const CHECKBOX_INVALID_BORDER: "destructive";
47
+ export declare const CHECKBOX_INVALID_BORDER: "error";
48
48
  export type CheckboxSurfaceRole = (typeof CHECKBOX_STATE_SPECS)[CheckboxState]['surface'] | typeof CHECKBOX_DISABLED_SPEC.surface;
49
49
  export type CheckboxMarkRole = (typeof CHECKBOX_STATE_SPECS)[CheckboxState]['mark'] | typeof CHECKBOX_DISABLED_SPEC.mark;
50
50
  export type CheckboxBorderRole = (typeof CHECKBOX_STATE_SPECS)[CheckboxState]['border'] | typeof CHECKBOX_DISABLED_SPEC.border;
@@ -4,14 +4,14 @@ export const CHECKBOX_STATE_SPECS = {
4
4
  unchecked: { surface: 'card', mark: 'primary-foreground', border: 'input' },
5
5
  checked: { surface: 'primary', mark: 'primary-foreground', border: 'primary' },
6
6
  indeterminate: { surface: 'primary', mark: 'primary-foreground', border: 'primary' },
7
- invalid: { surface: 'card', mark: 'primary-foreground', border: 'destructive' },
7
+ invalid: { surface: 'card', mark: 'primary-foreground', border: 'error' },
8
8
  };
9
9
  export const CHECKBOX_DISABLED_SPEC = {
10
10
  surface: 'disabled',
11
11
  mark: 'disabled-foreground',
12
12
  border: 'disabled-border',
13
13
  };
14
- export const CHECKBOX_INVALID_BORDER = 'destructive';
14
+ export const CHECKBOX_INVALID_BORDER = 'error';
15
15
  export const CHECKBOX_SIZE_SPECS = {
16
16
  sm: { box: 3.5, radius: 'sm', minHeight: 'touch' },
17
17
  md: { box: 4.5, radius: 'sm', minHeight: 'touch' },
@@ -14,7 +14,7 @@ const SURFACE = {
14
14
  const BORDER = {
15
15
  input: 'border border-input',
16
16
  primary: 'border border-primary',
17
- destructive: 'border border-destructive',
17
+ error: 'border border-error',
18
18
  'disabled-border': 'border border-disabled-border',
19
19
  };
20
20
  const MARK = {
@@ -10,7 +10,7 @@ const SURFACE = {
10
10
  const BORDER = {
11
11
  input: 'border-input',
12
12
  primary: 'border-primary',
13
- destructive: 'border-destructive',
13
+ error: 'border-error',
14
14
  'disabled-border': 'border-disabled-border',
15
15
  };
16
16
  const MARK = {