@ngrok/mantle 0.88.0 → 0.90.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 (247) hide show
  1. package/dist/accordion.d.ts +10 -9
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +1530 -1
  4. package/dist/{alert-DCVfviBx.d.ts → alert-BzPDUaU7.d.ts} +16 -15
  5. package/dist/alert-DO00UiQe.js +1 -0
  6. package/dist/alert-ZaUBtgno.js +1 -0
  7. package/dist/alert-center.d.ts +7 -7
  8. package/dist/alert-center.js +1 -1
  9. package/dist/alert-dialog.d.ts +17 -16
  10. package/dist/alert-dialog.js +1 -1
  11. package/dist/alert.d.ts +1 -1
  12. package/dist/alert.js +1 -1
  13. package/dist/anchor-CgcbWEUs.js +1 -0
  14. package/dist/anchor.js +1 -1
  15. package/dist/app-layout.d.ts +1183 -45
  16. package/dist/app-layout.js +1 -1
  17. package/dist/area-chart.d.ts +41 -18
  18. package/dist/area-chart.js +1 -1
  19. package/dist/avatar.js +1 -1
  20. package/dist/badge.d.ts +3 -2
  21. package/dist/badge.js +1 -1
  22. package/dist/bar-chart.d.ts +37 -13
  23. package/dist/bar-chart.js +1 -1
  24. package/dist/breadcrumb.js +1 -1
  25. package/dist/browser-only.js +1 -1
  26. package/dist/button-69InNC_m.js +1 -0
  27. package/dist/button-BMfUxs_j.js +1 -0
  28. package/dist/{button-DO53OA70.d.ts → button-CHoYpOzx.d.ts} +5 -4
  29. package/dist/{button-B52_vczK.js → button-D8rr-1AB.js} +1 -1
  30. package/dist/{button-crUf0hbR.d.ts → button-DL7V4bzW.d.ts} +5 -4
  31. package/dist/button-b2HKEIE2.js +1 -0
  32. package/dist/{button-B5i9n7Qp.d.ts → button-mzUR1U0Y.d.ts} +5 -4
  33. package/dist/button.d.ts +3 -3
  34. package/dist/button.js +1 -1
  35. package/dist/calendar.d.ts +3 -2
  36. package/dist/calendar.js +1 -1
  37. package/dist/card.d.ts +15 -7
  38. package/dist/card.js +1 -1
  39. package/dist/centered-layout.js +1 -1
  40. package/dist/{chart-DgaWVBqi.d.ts → chart-23KQ1ZNO.d.ts} +128 -62
  41. package/dist/chart-BRkJfptA.js +2 -0
  42. package/dist/checkbox-C3N2afhB.js +1 -0
  43. package/dist/checkbox.d.ts +3 -2
  44. package/dist/checkbox.js +1 -1
  45. package/dist/{choice-PESu-9s8.d.ts → choice-BCiyqLgO.d.ts} +12 -11
  46. package/dist/choice-DQmecLfy.js +1 -0
  47. package/dist/choice.d.ts +1 -1
  48. package/dist/choice.js +1 -1
  49. package/dist/code-block-4Esx_gV-.js +12 -0
  50. package/dist/code-block.d.ts +17 -16
  51. package/dist/code-block.js +6 -6
  52. package/dist/code-block_highlight-utils.js +1 -1
  53. package/dist/code.d.ts +2 -1
  54. package/dist/code.js +1 -1
  55. package/dist/combobox.d.ts +15 -14
  56. package/dist/combobox.js +1 -1
  57. package/dist/command.d.ts +13 -13
  58. package/dist/command.js +1 -1
  59. package/dist/cx-CK7o_rVv.js +1 -0
  60. package/dist/cx.js +1 -1
  61. package/dist/data-table.d.ts +32 -31
  62. package/dist/data-table.js +1 -1
  63. package/dist/description-list.d.ts +6 -6
  64. package/dist/description-list.js +1 -1
  65. package/dist/dialog-CaGJD02w.js +1 -0
  66. package/dist/{dialog-DXpqpdJj.d.ts → dialog-DQdeqvq-.d.ts} +28 -15
  67. package/dist/dialog.d.ts +1 -1
  68. package/dist/dialog.js +1 -1
  69. package/dist/{dropdown-menu-BloQKE_y.d.ts → dropdown-menu-Cef0Cz2B.d.ts} +17 -17
  70. package/dist/dropdown-menu-CutWQ0bl.js +1 -0
  71. package/dist/dropdown-menu-DMA8dGxZ.d.ts +1 -0
  72. package/dist/dropdown-menu.d.ts +2 -2
  73. package/dist/dropdown-menu.js +1 -1
  74. package/dist/empty.d.ts +14 -6
  75. package/dist/empty.js +1 -1
  76. package/dist/field.d.ts +16 -15
  77. package/dist/field.js +1 -1
  78. package/dist/flag.d.ts +4 -3
  79. package/dist/flag.js +1 -1
  80. package/dist/hooks.d.ts +251 -1
  81. package/dist/hooks.js +1 -1
  82. package/dist/hover-card.d.ts +5 -4
  83. package/dist/hover-card.js +1 -1
  84. package/dist/icon-BudQMD2S.js +1 -0
  85. package/dist/icon-kK0c-POG.js +1 -0
  86. package/dist/{icon-w0HUe7tr.d.ts → icon-r2NvfTWW.d.ts} +3 -2
  87. package/dist/{icon-BmJ57Tgh.d.ts → icon-ucVgZeXn.d.ts} +3 -2
  88. package/dist/icon.d.ts +2 -2
  89. package/dist/icon.js +1 -1
  90. package/dist/icons-CAtjMNti.js +1 -0
  91. package/dist/{icons-Bu-2boul.js → icons-CH3tD_wq.js} +1 -1
  92. package/dist/icons-CSwTVV2m.js +1 -0
  93. package/dist/icons.js +1 -1
  94. package/dist/in-view-Dxv_GrUU.js +1 -0
  95. package/dist/input-D_DjD9lT.js +1 -0
  96. package/dist/{input-DpnC3Xgj.d.ts → input-bbB1tC0h.d.ts} +3 -2
  97. package/dist/input.d.ts +5 -4
  98. package/dist/input.js +1 -1
  99. package/dist/kbd-CLHsJ99p.js +1 -0
  100. package/dist/kbd.d.ts +2 -1
  101. package/dist/kbd.js +1 -1
  102. package/dist/label-5T8i7I4X.js +1 -0
  103. package/dist/{label-Bnfe9YJ6.d.ts → label-C-KbNls8.d.ts} +3 -2
  104. package/dist/label.d.ts +1 -1
  105. package/dist/label.js +1 -1
  106. package/dist/{layer-container-R7aux3n8.js → layer-container-DLf-6eBz.js} +1 -1
  107. package/dist/layer-container.js +1 -1
  108. package/dist/line-chart.d.ts +40 -15
  109. package/dist/line-chart.js +1 -1
  110. package/dist/list-DOVZoz9t.js +1 -0
  111. package/dist/list.d.ts +3 -2
  112. package/dist/list.js +1 -1
  113. package/dist/live-region-DQ1QLv3L.js +1 -0
  114. package/dist/live-region.d.ts +3 -2
  115. package/dist/live-region.js +1 -1
  116. package/dist/llms.txt +118 -2
  117. package/dist/{main-Dv2zuT_b.js → main-CC1L9IsH.js} +1 -1
  118. package/dist/main.js +1 -1
  119. package/dist/mantle.css +12 -0
  120. package/dist/media-object.js +1 -1
  121. package/dist/migrations/0002-data-table-action-header.yml +526 -0
  122. package/dist/migrations/0003-dialog-footer-dom-order.yml +271 -0
  123. package/dist/migrations/0004-priority-to-intent.yml +1728 -0
  124. package/dist/migrations/0005-field-item-owns-control-id.yml +234 -0
  125. package/dist/migrations/0006-data-table-tanstack-v9.yml +423 -0
  126. package/dist/migrations/0008-tabs-separator.yml +1212 -0
  127. package/dist/migrations/0009-chart-root-mode.yml +871 -0
  128. package/dist/multi-select.d.ts +23 -22
  129. package/dist/multi-select.js +1 -1
  130. package/dist/otp-input.d.ts +9 -8
  131. package/dist/otp-input.js +1 -1
  132. package/dist/pagination.d.ts +9 -8
  133. package/dist/pagination.js +1 -1
  134. package/dist/{popover-Cco1nw8I.d.ts → popover-Dvls7-j4.d.ts} +5 -4
  135. package/dist/popover-oQDUvcZ2.js +1 -0
  136. package/dist/popover.d.ts +1 -1
  137. package/dist/popover.js +1 -1
  138. package/dist/primitive-AGoxSJBI.js +1 -0
  139. package/dist/progress.d.ts +9 -8
  140. package/dist/progress.js +1 -1
  141. package/dist/qr-code.d.ts +9 -8
  142. package/dist/qr-code.js +1 -1
  143. package/dist/radio-group.d.ts +19 -18
  144. package/dist/radio-group.js +1 -1
  145. package/dist/sandbar.d.ts +7 -7
  146. package/dist/sandbar.js +1 -1
  147. package/dist/{sandboxed-on-click-BLvvSqOP.js → sandboxed-on-click-C7pPu-2M.js} +1 -1
  148. package/dist/sandboxed-on-click.js +1 -1
  149. package/dist/scatter-plot.d.ts +39 -14
  150. package/dist/scatter-plot.js +1 -1
  151. package/dist/select-DcL0-duV.js +1 -0
  152. package/dist/{select-BITJP7I5.d.ts → select-DlohFa54.d.ts} +3 -3
  153. package/dist/select.d.ts +1 -1
  154. package/dist/select.js +1 -1
  155. package/dist/selectable-list.d.ts +16 -15
  156. package/dist/selectable-list.js +1 -1
  157. package/dist/{separator-Bo4nY_3M.d.ts → separator-BWGjCIl7.d.ts} +11 -3
  158. package/dist/separator-DvPe27fH.js +1 -0
  159. package/dist/separator.d.ts +1 -1
  160. package/dist/separator.js +1 -1
  161. package/dist/sheet-H8zvhSuA.js +1 -0
  162. package/dist/sheet.d.ts +13 -12
  163. package/dist/sheet.js +1 -1
  164. package/dist/sidebar.d.ts +163 -102
  165. package/dist/sidebar.js +1 -1
  166. package/dist/skeleton-zfqoDAxT.js +1 -0
  167. package/dist/skeleton.d.ts +3 -2
  168. package/dist/skeleton.js +1 -1
  169. package/dist/skip-to-main-link.js +1 -1
  170. package/dist/slider.d.ts +3 -2
  171. package/dist/slider.js +1 -1
  172. package/dist/{slot-BsvE2ntj.js → slot-DdYN1L1C.js} +1 -1
  173. package/dist/{slot-DdgxmuI5.d.ts → slot-Q996Hqk9.d.ts} +1 -1
  174. package/dist/slot.d.ts +1 -1
  175. package/dist/slot.js +1 -1
  176. package/dist/split-button.d.ts +6 -5
  177. package/dist/split-button.js +1 -1
  178. package/dist/strata.d.ts +544 -0
  179. package/dist/strata.js +1 -0
  180. package/dist/switch.d.ts +3 -2
  181. package/dist/switch.js +1 -1
  182. package/dist/{table-DEI-qvSC.d.ts → table-BhzITa19.d.ts} +10 -9
  183. package/dist/table-DBbKqOVq.js +1 -0
  184. package/dist/table.d.ts +1 -1
  185. package/dist/table.js +1 -1
  186. package/dist/tabs.d.ts +2 -2
  187. package/dist/tabs.js +1 -1
  188. package/dist/text-area.d.ts +3 -2
  189. package/dist/text-area.js +1 -1
  190. package/dist/theme-6Q65C1Rx.js +1 -0
  191. package/dist/theme-switcher.d.ts +3 -3
  192. package/dist/theme-switcher.js +1 -1
  193. package/dist/theme.js +1 -1
  194. package/dist/toast.d.ts +10 -9
  195. package/dist/toast.js +1 -1
  196. package/dist/{tooltip-nuUCoqq8.d.ts → tooltip-CngH7Kl6.d.ts} +7 -6
  197. package/dist/tooltip-NhYXqStK.js +1 -0
  198. package/dist/tooltip.d.ts +1 -1
  199. package/dist/tooltip.js +1 -1
  200. package/dist/truncated-text.d.ts +138 -0
  201. package/dist/truncated-text.js +1 -0
  202. package/dist/types.js +1 -1
  203. package/dist/use-breakpoint--mo7kr9d.js +1 -0
  204. package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +1 -0
  205. package/dist/use-prefers-reduced-motion-DimzRx-M.js +1 -0
  206. package/dist/use-swipe-to-dismiss-Cj-AayFd.js +1 -0
  207. package/dist/utils.js +1 -1
  208. package/dist/visually-hidden.d.ts +2 -1
  209. package/dist/visually-hidden.js +1 -1
  210. package/dist/well.d.ts +10 -2
  211. package/dist/well.js +1 -1
  212. package/package.json +17 -15
  213. package/dist/alert-OP_-aGJD.js +0 -1
  214. package/dist/anchor-BnMhJYS4.js +0 -1
  215. package/dist/button-BFpCB99R.js +0 -1
  216. package/dist/button-Dij5vCQG.js +0 -1
  217. package/dist/button-pwkdtR3U.js +0 -1
  218. package/dist/chart-aZLMj4xx.js +0 -2
  219. package/dist/checkbox-DbJSqSNN.js +0 -1
  220. package/dist/choice-SRyLguqU.js +0 -1
  221. package/dist/code-block-BE3Q0iAo.js +0 -12
  222. package/dist/cx-0HCjnNv1.js +0 -1
  223. package/dist/dialog-HIdb5d3I.js +0 -1
  224. package/dist/dropdown-menu-BR_AQNMj.js +0 -1
  225. package/dist/dropdown-menu-Dlpb7600.d.ts +0 -1
  226. package/dist/icon-BT8FnkkJ.js +0 -1
  227. package/dist/icon-U24NfYv7.js +0 -1
  228. package/dist/icons-BQRcOU6J.js +0 -1
  229. package/dist/icons-C3rVfpx9.js +0 -1
  230. package/dist/in-view-T_AAYaaF.js +0 -1
  231. package/dist/input-yq0jLE4e.js +0 -1
  232. package/dist/kbd-CJ8hNZfS.js +0 -1
  233. package/dist/label-BAy0Mg59.js +0 -1
  234. package/dist/list-BleZ-43e.js +0 -1
  235. package/dist/live-region-B2vJRvPH.js +0 -1
  236. package/dist/popover-BJ5XNwzD.js +0 -1
  237. package/dist/primitive-w3wFk2La.js +0 -1
  238. package/dist/select-CUWLEeuf.js +0 -1
  239. package/dist/separator-D98be0gY.js +0 -1
  240. package/dist/sheet-B5x8EO9Y.js +0 -1
  241. package/dist/skeleton-bVDP8BzY.js +0 -1
  242. package/dist/table-D2jh52KA.js +0 -1
  243. package/dist/theme-C1kFFdIk.js +0 -1
  244. package/dist/tooltip-H03l7E4Y.js +0 -1
  245. package/dist/use-is-hydrated-after-paint-Drj0lNi4.js +0 -1
  246. package/dist/use-prefers-reduced-motion-Cj9tJ181.js +0 -1
  247. /package/dist/{types-D85fCNV3.js → css-properties-D85fCNV3.js} +0 -0
package/dist/calendar.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./icon-BT8FnkkJ.js";import{t as n}from"./button-B52_vczK.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";import{CaretRightIcon as a}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as o}from"@phosphor-icons/react/CaretLeft";import{DayPicker as s}from"react-day-picker";const c=n({appearance:`ghost`,intent:`neutral`,size:`sm`});function l(e){let n=r(2),{orientation:s}=e,c;return n[0]===s?c=n[1]:(c=i(t,{svg:i(s===`left`?o:a,{}),className:`size-4`}),n[0]=s,n[1]=c),c}const u={Chevron:l},d={button_next:e(c,`absolute right-0`),button_previous:e(c,`absolute left-0`),caption_label:`text-sm font-medium`,day_button:`day size-full rounded-md not-aria-selected:not-disabled:hover:bg-filled-accent/15`,disabled:`text-muted opacity-50`,hidden:`invisible`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center`,month_grid:`w-full border-collapse space-y-1`,months:`flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min`,nav:`flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10`,outside:`day-outside aria-selected:text-on-filled opacity-50 text-muted`,range_end:`day-range-end [&:not(.day-range-start)]:rounded-l-none`,range_middle:`day-range-middle not-disabled:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none not-disabled:aria-selected:hover:bg-filled-accent/25`,range_start:`day-range-start [&:not(.day-range-end)]:rounded-r-none`,selected:`not-disabled:bg-filled-accent text-on-filled not-disabled:hover:bg-filled-accent`,today:`not-aria-selected:not-disabled:text-accent-600 font-medium not-aria-selected:not-disabled:bg-filled-accent/10 rounded-md`,week:`flex w-full mt-1`,weekday:`text-body w-7 text-[0.8rem] text-center font-normal`,weekdays:`flex`};function f(t){let n=r(23),a,o,c,l;n[0]===t?(a=n[1],o=n[2],c=n[3],l=n[4]):({className:a,classNames:o,showOutsideDays:l,...c}=t,n[0]=t,n[1]=a,n[2]=o,n[3]=c,n[4]=l);let f=l!==void 0&&l,p=c.mode,m;n[5]===o?m=n[6]:(m=o??{},n[5]=o,n[6]=m);let h,g;n[7]===m?(h=n[8],g=n[9]):({root:g,...h}=m,n[7]=m,n[8]=h,n[9]=g);let _;n[10]!==a||n[11]!==g?(_=e(`isolate`,a,g),n[10]=a,n[11]=g,n[12]=_):_=n[12];let v=p===`range`&&`first:has-aria-selected:rounded-l-md last:has-aria-selected:rounded-r-md`,y;n[13]===v?y=n[14]:(y=e(`overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md`,v),n[13]=v,n[14]=y);let b;n[15]!==h||n[16]!==_||n[17]!==y?(b={...d,root:_,day:y,...h},n[15]=h,n[16]=_,n[17]=y,n[18]=b):b=n[18];let x=b,S;return n[19]!==x||n[20]!==c||n[21]!==f?(S=i(s,{"data-slot":`calendar`,animate:!1,components:u,classNames:x,showOutsideDays:f,...c}),n[19]=x,n[20]=c,n[21]=f,n[22]=S):S=n[22],S}export{f as Calendar};
1
+ import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{t as r}from"./button-D8rr-1AB.js";import{c as i}from"react/compiler-runtime";import{jsx as a}from"react/jsx-runtime";import{CaretRightIcon as o}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as s}from"@phosphor-icons/react/CaretLeft";import{DayPicker as c}from"react-day-picker";const l=r({appearance:`ghost`,intent:`neutral`,size:`sm`});function u(e){let t=i(2),{orientation:r}=e,c;return t[0]===r?c=t[1]:(c=/* @__PURE__ */ a(n,{svg:a(r===`left`?s:o,{}),className:`size-4`}),t[0]=r,t[1]=c),c}const d={Chevron:u},f={button_next:e(l,`absolute right-0`),button_previous:e(l,`absolute left-0`),caption_label:`text-sm font-medium`,day_button:`day size-full rounded-md not-aria-selected:not-disabled:hover:bg-filled-accent/15`,disabled:`text-muted opacity-50`,hidden:`invisible`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center`,month_grid:`w-full border-collapse space-y-1`,months:`flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min`,nav:`flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10`,outside:`day-outside aria-selected:text-on-filled opacity-50 text-muted`,range_end:`day-range-end [&:not(.day-range-start)]:rounded-l-none`,range_middle:`day-range-middle not-disabled:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none not-disabled:aria-selected:hover:bg-filled-accent/25`,range_start:`day-range-start [&:not(.day-range-end)]:rounded-r-none`,selected:`not-disabled:bg-filled-accent text-on-filled not-disabled:hover:bg-filled-accent`,today:`not-aria-selected:not-disabled:text-accent-600 font-medium not-aria-selected:not-disabled:bg-filled-accent/10 rounded-md`,week:`flex w-full mt-1`,weekday:`text-body w-7 text-[0.8rem] text-center font-normal`,weekdays:`flex`};function p(n){let r=i(27),o,s,l,u,p;r[0]===n?(o=r[1],s=r[2],l=r[3],u=r[4],p=r[5]):({"data-slot":l,className:o,classNames:s,showOutsideDays:p,...u}=n,r[0]=n,r[1]=o,r[2]=s,r[3]=l,r[4]=u,r[5]=p);let m=p!==void 0&&p,h=u.mode,g;r[6]===s?g=r[7]:(g=s??{},r[6]=s,r[7]=g);let _,v;r[8]===g?(_=r[9],v=r[10]):({root:v,..._}=g,r[8]=g,r[9]=_,r[10]=v);let y;r[11]!==o||r[12]!==v?(y=e(`isolate`,o,v),r[11]=o,r[12]=v,r[13]=y):y=r[13];let b=h===`range`&&`first:has-aria-selected:rounded-l-md last:has-aria-selected:rounded-r-md`,x;r[14]===b?x=r[15]:(x=e(`overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md`,b),r[14]=b,r[15]=x);let S;r[16]!==_||r[17]!==y||r[18]!==x?(S={...f,root:y,day:x,..._},r[16]=_,r[17]=y,r[18]=x,r[19]=S):S=r[19];let C=S,w;r[20]===l?w=r[21]:(w=t(l,`calendar`),r[20]=l,r[21]=w);let T;return r[22]!==C||r[23]!==u||r[24]!==m||r[25]!==w?(T=/* @__PURE__ */ a(c,{"data-slot":w,animate:!1,components:d,classNames:C,showOutsideDays:m,...u}),r[22]=C,r[23]=u,r[24]=m,r[25]=w,r[26]=T):T=r[26],T}export{p as Calendar};
package/dist/card.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
+ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
2
3
  import "./index-DA4ig3gj.js";
3
4
  import { ComponentProps } from "react";
4
5
  //#region src/components/card/card.d.ts
5
- type CardProps = ComponentProps<"div"> & WithAsChild;
6
+ type CardProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
6
7
  /**
7
8
  * A container that displays content in a box resembling a physical card. The
8
9
  * outermost part. Every other `Card` part nests inside it.
@@ -30,7 +31,7 @@ type CardProps = ComponentProps<"div"> & WithAsChild;
30
31
  * </Card.Root>
31
32
  * ```
32
33
  */
33
- declare const Root: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
34
+ declare const Root: ({ "data-slot": dataSlot, asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
34
35
  /**
35
36
  * The main content of a card. Usually composed as a direct child of a `Card` component.
36
37
  *
@@ -57,7 +58,7 @@ declare const Root: ({ asChild, className, children, ref, ...rest }: CardProps)
57
58
  * </Card.Root>
58
59
  * ```
59
60
  */
60
- declare const Body: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
61
+ declare const Body: ({ "data-slot": dataSlot, asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
61
62
  /**
62
63
  * The band below `Card.Body`. Unless it is the first child, it draws a top border
63
64
  * dividing the two. Pass it as a direct child of `Card.Root`.
@@ -79,7 +80,7 @@ declare const Body: ({ asChild, className, children, ref, ...rest }: CardProps)
79
80
  * </Card.Root>
80
81
  * ```
81
82
  */
82
- declare const Footer: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
83
+ declare const Footer: ({ "data-slot": dataSlot, asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
83
84
  /**
84
85
  * The band above `Card.Body` that holds `Card.Title`. Pass it as a direct child
85
86
  * of `Card.Root`.
@@ -101,8 +102,8 @@ declare const Footer: ({ asChild, className, children, ref, ...rest }: CardProps
101
102
  * </Card.Root>
102
103
  * ```
103
104
  */
104
- declare const Header: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
105
- type CardTitleProps = ComponentProps<"h3"> & WithAsChild;
105
+ declare const Header: ({ "data-slot": dataSlot, asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
106
+ type CardTitleProps = ComponentProps<"h3"> & WithAsChild & WithDataSlot;
106
107
  /**
107
108
  * The heading inside `Card.Header`. Renders an `h3` by default; pass `asChild`
108
109
  * to fit the surrounding document outline. Keep it a heading element
@@ -125,10 +126,17 @@ type CardTitleProps = ComponentProps<"h3"> & WithAsChild;
125
126
  * </Card.Root>
126
127
  * ```
127
128
  */
128
- declare const Title: ({ className, asChild, ref, ...props }: CardTitleProps) => import("react").JSX.Element;
129
+ declare const Title: ({ "data-slot": dataSlot, className, asChild, ref, ...props }: CardTitleProps) => import("react").JSX.Element;
129
130
  /**
130
131
  * A container that displays content in a box resembling a physical card.
131
132
  *
133
+ * @useWhen Group related content in a raised box, with an optional header and footer.
134
+ *
135
+ * @siblings
136
+ * - `Well`: the content is secondary and sits inset in the page, such as a code sample, a note, or a read-only summary.
137
+ * - `Separator`: adjacent content needs a divider and no box.
138
+ * - `MediaObject`: an icon or a figure sits beside a block of text, with no border.
139
+ *
132
140
  * @see https://mantle.ngrok.com/components/structure/card
133
141
  *
134
142
  * @example
package/dist/card.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./slot-BsvE2ntj.js";import{c as n}from"react/compiler-runtime";import{jsx as r}from"react/jsx-runtime";const i={Root:i=>{let a=n(14),o,s,c,l,u;a[0]===i?(o=a[1],s=a[2],c=a[3],l=a[4],u=a[5]):({asChild:u,className:s,children:o,ref:c,...l}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=u);let d=u!==void 0&&u?t:`div`,f;a[6]===s?f=a[7]:(f=e(`border-card bg-card relative rounded-md border`,s),a[6]=s,a[7]=f);let p;return a[8]!==d||a[9]!==o||a[10]!==c||a[11]!==l||a[12]!==f?(p=r(d,{ref:c,"data-slot":`card`,className:f,...l,children:o}),a[8]=d,a[9]=o,a[10]=c,a[11]=l,a[12]=f,a[13]=p):p=a[13],p},Body:i=>{let a=n(14),o,s,c,l,u;a[0]===i?(o=a[1],s=a[2],c=a[3],l=a[4],u=a[5]):({asChild:u,className:s,children:o,ref:c,...l}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=u);let d=u!==void 0&&u?t:`div`,f;a[6]===s?f=a[7]:(f=e(`p-6 border-t border-card-muted first:border-t-0`,s),a[6]=s,a[7]=f);let p;return a[8]!==d||a[9]!==o||a[10]!==c||a[11]!==l||a[12]!==f?(p=r(d,{ref:c,"data-slot":`card-body`,className:f,...l,children:o}),a[8]=d,a[9]=o,a[10]=c,a[11]=l,a[12]=f,a[13]=p):p=a[13],p},Footer:i=>{let a=n(14),o,s,c,l,u;a[0]===i?(o=a[1],s=a[2],c=a[3],l=a[4],u=a[5]):({asChild:u,className:s,children:o,ref:c,...l}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=u);let d=u!==void 0&&u?t:`div`,f;a[6]===s?f=a[7]:(f=e(`px-6 py-3 border-t border-card-muted first:border-t-0`,s),a[6]=s,a[7]=f);let p;return a[8]!==d||a[9]!==o||a[10]!==c||a[11]!==l||a[12]!==f?(p=r(d,{ref:c,"data-slot":`card-footer`,className:f,...l,children:o}),a[8]=d,a[9]=o,a[10]=c,a[11]=l,a[12]=f,a[13]=p):p=a[13],p},Header:i=>{let a=n(14),o,s,c,l,u;a[0]===i?(o=a[1],s=a[2],c=a[3],l=a[4],u=a[5]):({asChild:u,className:s,children:o,ref:c,...l}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=u);let d=u!==void 0&&u?t:`div`,f;a[6]===s?f=a[7]:(f=e(`px-6 py-3 border-t border-card-muted first:border-t-0`,s),a[6]=s,a[7]=f);let p;return a[8]!==d||a[9]!==o||a[10]!==c||a[11]!==l||a[12]!==f?(p=r(d,{ref:c,"data-slot":`card-header`,className:f,...l,children:o}),a[8]=d,a[9]=o,a[10]=c,a[11]=l,a[12]=f,a[13]=p):p=a[13],p},Title:i=>{let a=n(12),o,s,c,l;a[0]===i?(o=a[1],s=a[2],c=a[3],l=a[4]):({className:s,asChild:o,ref:l,...c}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=l);let u=o?t:`h3`,d;a[5]===s?d=a[6]:(d=e(`text-strong text-base font-medium`,s),a[5]=s,a[6]=d);let f;return a[7]!==u||a[8]!==c||a[9]!==l||a[10]!==d?(f=r(u,{ref:l,"data-slot":`card-title`,className:d,...c}),a[7]=u,a[8]=c,a[9]=l,a[10]=d,a[11]=f):f=a[11],f}};export{i as Card};
1
+ import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DdYN1L1C.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`div`,m;o[7]===l?m=o[8]:(m=t(l,`card`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`border-card bg-card relative rounded-md border`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Body:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`div`,m;o[7]===l?m=o[8]:(m=t(l,`card-body`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`p-6 border-t border-card-muted first:border-t-0`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Footer:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`div`,m;o[7]===l?m=o[8]:(m=t(l,`card-footer`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`px-6 py-3 border-t border-card-muted first:border-t-0`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Header:a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":l,asChild:f,className:c,children:s,ref:u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p=f!==void 0&&f?n:`div`,m;o[7]===l?m=o[8]:(m=t(l,`card-header`),o[7]=l,o[8]=m);let h;o[9]===c?h=o[10]:(h=e(`px-6 py-3 border-t border-card-muted first:border-t-0`,c),o[9]=c,o[10]=h);let g;return o[11]!==p||o[12]!==s||o[13]!==u||o[14]!==d||o[15]!==m||o[16]!==h?(g=/* @__PURE__ */ i(p,{ref:u,"data-slot":m,className:h,...d,children:s}),o[11]=p,o[12]=s,o[13]=u,o[14]=d,o[15]=m,o[16]=h,o[17]=g):g=o[17],g},Title:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":l,className:c,asChild:s,ref:d,...u}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`h3`,p;o[6]===l?p=o[7]:(p=t(l,`card-title`),o[6]=l,o[7]=p);let m;o[8]===c?m=o[9]:(m=e(`text-strong text-base font-medium`,c),o[8]=c,o[9]=m);let h;return o[10]!==f||o[11]!==u||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{ref:d,"data-slot":p,className:m,...u}),o[10]=f,o[11]=u,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{a as Card};
@@ -1 +1 @@
1
- import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex min-h-full flex-col`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Notice:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-notice`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`w-full shrink-0`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Header:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`header`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-header`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex shrink-0 items-center px-4 py-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Body:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-body`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-1 flex-col items-center justify-center gap-6 py-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Footer:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`footer`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-footer`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex shrink-0 items-center px-4 py-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{a as CenteredLayout};
1
+ import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DdYN1L1C.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex min-h-full flex-col`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Notice:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-notice`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`w-full shrink-0`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Header:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`header`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-header`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex shrink-0 items-center px-4 py-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Body:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-body`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-1 flex-col items-center justify-center gap-6 py-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Footer:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`footer`,p;o[6]===u?p=o[7]:(p=t(u,`centered-layout-footer`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex shrink-0 items-center px-4 py-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{a as CenteredLayout};
@@ -212,10 +212,16 @@ type YDomain = [number | "auto", number | "auto"];
212
212
  *
213
213
  * Interaction is the Root's UNCONDITIONAL contract: the crosshair/hover band,
214
214
  * tooltip, keyboard stepping (arrows / PageUp / PageDown / Home / End /
215
- * Escape, Enter/Space to activate), aria-live announcements, and the sr-only
216
- * data table all ship with Root itself. The composed Tooltip part customizes
217
- * the readout; omitting it never removes the hover layer, and no part removal
218
- * can strip keyboard access to the data.
215
+ * Escape, Enter/Space to activate), aria-live announcements, the sr-only
216
+ * description, and the sr-only data table all ship with Root itself. The
217
+ * composed Tooltip part customizes the readout; omitting it never removes the
218
+ * hover layer, and no part removal can strip keyboard access to the data.
219
+ *
220
+ * A Root mounts dormant: it ingests its data and answers the keyboard, but it
221
+ * paints and allocates its canvas once it nears the viewport, and it mounts
222
+ * the data table once focus lands inside it. A list of 100 charts pays for
223
+ * the ones a reader can see, and a table of sparklines holds no hidden
224
+ * tables until a reader asks for one.
219
225
  *
220
226
  * This module is internal shared implementation — it is not exported from the
221
227
  * package.
@@ -237,14 +243,14 @@ type ChartAccessibleName = {
237
243
  "aria-label"?: never;
238
244
  };
239
245
  /**
240
- * The interaction props an interactive chart may wire — the controlled
246
+ * The interaction props an interactive chart may wire: the controlled
241
247
  * `activeIndex` and the two notification callbacks. Modeled apart from the base
242
- * props so a decorative chart can forbid them: a decorative chart has no hover
243
- * UI and never activates a datum, so these would be dead code.
248
+ * props so a static or decorative chart can forbid them: neither has a hover
249
+ * UI or activates a datum, so these would be dead code.
244
250
  */
245
251
  type ChartInteractionProps = {
246
252
  /**
247
- * Controlled active datum index — an index into `data` (`null` = none).
253
+ * Controlled active datum index, an index into `data` (`null` = none).
248
254
  * Omit for uncontrolled hover.
249
255
  */
250
256
  activeIndex?: number | null;
@@ -253,66 +259,125 @@ type ChartInteractionProps = {
253
259
  /** Notified on datum activation: mark click, or Enter/Space on the focused chart. */
254
260
  onDatumActivate?: (event: ChartDatumEvent) => void;
255
261
  };
262
+ /** The interaction props a static or decorative chart forbids. */
263
+ type ChartNoInteractionProps = {
264
+ activeIndex?: never;
265
+ onActiveIndexChange?: never;
266
+ onDatumActivate?: never;
267
+ };
268
+ /** The accessible-name props a decorative chart forbids. */
269
+ type ChartNoAccessibleName = {
270
+ "aria-label"?: never;
271
+ "aria-labelledby"?: never;
272
+ };
273
+ /**
274
+ * How much of the chart's contract a Root exposes: `"interactive"` (the
275
+ * default), `"static"`, or `"decorative"`. See the `mode` prop.
276
+ */
277
+ type ChartMode = "interactive" | "static" | "decorative";
256
278
  /**
257
- * The accessibility + interactivity contract every chart Root takes, modeled
258
- * as a discriminated union over `decorative` so invalid combinations are
259
- * unrepresentable:
279
+ * The accessibility and interactivity contract every chart Root takes, keyed
280
+ * by `mode`, so an invalid combination does not compile:
281
+ *
282
+ * - **`"interactive"`** (the default): requires an accessible name
283
+ * (`aria-label` xor `aria-labelledby`) and may wire the interaction props.
284
+ * - **`"static"`**: requires an accessible name and forbids the interaction
285
+ * props.
286
+ * - **`"decorative"`**: forbids the accessible name and the interaction props.
260
287
  *
261
- * - **Interactive** (the default — `decorative` omitted or `false`): the chart
262
- * carries real data. It requires an accessible name (`aria-label` xor
263
- * `aria-labelledby`) and may wire the interaction callbacks. This is the
264
- * full contract charts have always had.
265
- * - **Decorative** (`decorative: true`): the chart is a placeholder or
266
- * atmospheric graphic whose values are not real data — synthetic bars behind
267
- * an empty state, a hero backdrop. It still renders and animates, but it is
268
- * hidden from assistive technology (no accessible name, no sr-only data
269
- * table, no live region), removed from the tab order, and inert to pointer
270
- * and keyboard, so the accessible-name and interaction props are forbidden.
271
- * It also paints every series in one neutral fill instead of the categorical
272
- * palette, low enough in contrast that a message laid over it stays readable.
288
+ * Each arm pins `mode` to its own literal, and the two noninteractive arms
289
+ * require it. A union `TMode` then satisfies every arm it can take, so a
290
+ * `mode` picked at runtime between `"decorative"` and `"interactive"` still
291
+ * needs the name. An explicit `"static"` or `"decorative"` type argument
292
+ * cannot omit `mode`, which would select the interactive runtime default.
273
293
  *
274
- * `decorative` communicates intent — "these values are not information" —
275
- * where a `disabled` flag would be ambiguous (a chart is not a form control).
294
+ * Why a type parameter and not a union over `mode`: a family Root infers
295
+ * `TMode` from the `mode` it is given, so the props resolve to one shape.
296
+ * A union would make TypeScript relate a Root with no `mode` to the static
297
+ * shape as well, and a `zKey={maybe}` prop then fails to type-check.
276
298
  */
277
- type ChartAccessibilityProps = ({
278
- decorative?: false;
279
- } & ChartAccessibleName & ChartInteractionProps) | {
299
+ type ChartAccessibilityProps<TMode extends ChartMode = ChartMode> = {
280
300
  /**
281
- * Render the chart as a decorative placeholder — a backdrop whose
282
- * values are not information. Use it for an empty-state graphic or an
283
- * atmospheric hero, never for data a reader might act on.
301
+ * How much of the chart's contract this Root exposes. Pick by what a
302
+ * reader does with the chart:
284
303
  *
285
- * A decorative chart keeps its canvas rendering and its animation. It
286
- * drops every layer that only real data needs:
304
+ * | `mode` | Use it for | A reader gets |
305
+ * | --- | --- | --- |
306
+ * | `"interactive"` (default) | A chart a reader explores: a dashboard panel, a detail page, a report with a question behind it. | A named `role="application"` Tab stop, hover and keyboard point cursor, a tooltip readout, polite announcements, and an sr-only data table on focus. |
307
+ * | `"static"` | A chart a reader glances at while the exact values sit beside it: a sparkline in a table row or a card, a trend in a print report. | A named `role="img"` with a text description (kind, count, range, series), no Tab stop, no hover, no tooltip, no table. `animate` defaults to `false`. |
308
+ * | `"decorative"` | A placeholder whose values are not information: synthetic bars behind an empty state, a hero backdrop. | Nothing: hidden from assistive technology, out of the tab order, inert, every series in one neutral fill. |
287
309
  *
288
- * - hidden from assistive technology — no accessible name, no sr-only
289
- * data table, no live region
290
- * - out of the tab order, and inert to pointer and keyboard — no hover
291
- * band, no tooltip, no activation
292
- * - the accessible-name and interaction props are forbidden at the type
293
- * level, because they have no meaning without real data
310
+ * **Noninteractive is not decorative.** A sparkline beside a total still
311
+ * tells a reader when activity happened and how it varied, so it keeps a
312
+ * name and a description; only its values live in the text beside it.
313
+ * One hundred sparklines in a table as one hundred Tab stops is a focus
314
+ * order no reader wants, and a readout that only a pointer can reach
315
+ * fails WCAG 1.4.13, so `"static"` offers neither. A chart that is the
316
+ * only source of its values stays `"interactive"`.
294
317
  *
295
- * It also drops the categorical palette. Every series paints
318
+ * **`"static"`** names the plot `role="img"`, with the consumer's
319
+ * `aria-label` or `aria-labelledby` and an `aria-describedby` to the
320
+ * description, so a screen reader hears what the chart holds without a
321
+ * Tab stop. There is no overlay: no hover band, no tooltip, no keyboard
322
+ * point cursor, no data table, no live region, and a composed `Tooltip`
323
+ * part has no effect. Pointer events pass through to the row or card
324
+ * behind it. The series keep their colors. `animate` defaults to `false`,
325
+ * because a list of sparklines that each play a reveal as the reader
326
+ * scrolls is motion with no information in it; pass `animate` to opt in.
327
+ *
328
+ * **`"decorative"`** keeps the canvas rendering and the animation and
329
+ * drops every layer that only real data needs: it is hidden from assistive
330
+ * technology (no name, no description, no table, no live region), out of
331
+ * the tab order, and inert to pointer and keyboard. Every series paints
296
332
  * `--color-chart-decorative`, one neutral fill that outranks a series'
297
- * `color` and `seriesSlot` — a backdrop encodes no series identity, and
298
- * a hue on values that are not information invites a reader to decode
299
- * it. The token is the darkest neutral step that keeps `text-muted`
300
- * over the WCAG AA floor for 14px text in all four themes (4.56:1 in
301
- * light, 4.93:1 in dark), so an overlaid message needs no scrim, no
302
- * blur, and no dimming to stay readable.
303
- * `chart/decorative-contrast.test.tsx` measures every theme.
333
+ * `color` and `seriesSlot`: a backdrop encodes no series identity, and a
334
+ * hue on values that are not information invites a reader to decode it.
335
+ * The token is the darkest neutral step that keeps `text-muted` over the
336
+ * WCAG AA floor for 14px text in all four themes (4.56:1 in light, 4.93:1
337
+ * in dark), so an overlaid message needs no scrim, no blur, and no
338
+ * dimming to stay readable; `chart/decorative-contrast.test.tsx` measures
339
+ * every theme. Retune the fill per chart by redeclaring the token in
340
+ * `className` (`[--color-chart-decorative:var(--color-neutral-100)]`) and
341
+ * re-measure the message against the new value.
304
342
  *
305
- * Retune the fill per chart by redeclaring the token in `className`:
306
- * `[--color-chart-decorative:var(--color-neutral-100)]`. Re-measure the
307
- * message against the new value when you do.
343
+ * @default "interactive"
308
344
  *
309
- * @default false
345
+ * @example
346
+ * ```tsx
347
+ * // Interactive: a dashboard panel a reader explores.
348
+ * <LineChart.Root data={latency} xKey="time" aria-labelledby="latency-heading">
349
+ * <LineChart.Grid />
350
+ * <LineChart.XAxis />
351
+ * <LineChart.YAxis />
352
+ * <LineChart.Line dataKey="p50" label="p50" />
353
+ * <LineChart.Line dataKey="p99" label="p99" />
354
+ * <LineChart.Tooltip />
355
+ * <LineChart.Legend />
356
+ * </LineChart.Root>
357
+ * ```
358
+ *
359
+ * @example
360
+ * ```tsx
361
+ * // Static: a sparkline in a table cell, with the total beside it as text.
362
+ * <div className="flex items-center gap-2">
363
+ * <BarChart.Root
364
+ * data={service.requests}
365
+ * xKey="day"
366
+ * mode="static"
367
+ * aria-label={`Requests for ${service.name}, last 30 days`}
368
+ * className="aspect-auto h-6 w-28"
369
+ * >
370
+ * <BarChart.Bar dataKey="count" label="Requests" />
371
+ * </BarChart.Root>
372
+ * <span className="text-muted text-xs tabular-nums">{compact(service.requestTotal)}</span>
373
+ * </div>
374
+ * ```
310
375
  *
311
376
  * @example
312
377
  * ```tsx
313
- * // The message is a sibling of the chart, so AT still announces it.
378
+ * // Decorative: the message is a sibling of the chart, so AT still announces it.
314
379
  * <div className="relative w-full">
315
- * <BarChart.Root data={placeholderUsage} xKey="day" decorative>
380
+ * <BarChart.Root data={placeholderUsage} xKey="day" mode="decorative">
316
381
  * <BarChart.Bar dataKey="value" />
317
382
  * </BarChart.Root>
318
383
  * <Empty.Root className="absolute inset-0 m-auto h-fit w-fit">
@@ -324,19 +389,20 @@ type ChartAccessibilityProps = ({
324
389
  * </div>
325
390
  * ```
326
391
  */
327
- decorative: true;
328
- "aria-label"?: never;
329
- "aria-labelledby"?: never;
330
- activeIndex?: never;
331
- onActiveIndexChange?: never;
332
- onDatumActivate?: never;
333
- };
392
+ mode?: TMode;
393
+ } & (TMode extends "decorative" ? {
394
+ mode: "decorative";
395
+ } & ChartNoAccessibleName & ChartNoInteractionProps : TMode extends "static" ? {
396
+ mode: "static";
397
+ } & ChartAccessibleName & ChartNoInteractionProps : {
398
+ mode?: "interactive";
399
+ } & ChartAccessibleName & ChartInteractionProps);
334
400
  /**
335
401
  * Root props shared by every chart kind, WITHOUT the accessibility/interaction
336
402
  * union or the data/x props. Public wrappers `Omit` from this base and
337
403
  * re-intersect `ChartAccessibilityProps` — `Omit` over a union type flattens
338
404
  * it, which would silently make the required accessible name optional and
339
- * erase the `decorative` discriminant.
405
+ * erase the `mode` discriminant.
340
406
  */
341
407
  type ChartRootBaseProps = Omit<ComponentProps<"div">, "aria-label" | "aria-labelledby"> & WithDataSlot & {
342
408
  /** Override the automatic y domain. */
@@ -428,4 +494,4 @@ type CopyButtonPrimitiveProps = Omit<ComponentProps<"button">, "aria-label" | "c
428
494
  onCopyError?: (error: unknown) => void;
429
495
  };
430
496
  //#endregion
431
- export { PointShape as _, LegendPrimitiveProps as a, XAxisPrimitiveProps as c, BarTexture as d, ChartDatum as f, CurveKind as g, ContinuousXScale as h, GridPrimitiveProps as i, YAxisPrimitiveProps as l, ChartSeriesSlot as m, ChartRootBaseProps as n, ReferenceLinePrimitiveProps as o, ChartDatumEvent as p, CopyButtonPrimitiveProps as r, TooltipPrimitiveProps as s, ChartAccessibilityProps as t, BarOrientation as u, SeriesColor as v };
497
+ export { CurveKind as _, GridPrimitiveProps as a, TooltipPrimitiveProps as c, BarOrientation as d, BarTexture as f, ContinuousXScale as g, ChartSeriesSlot as h, CopyButtonPrimitiveProps as i, XAxisPrimitiveProps as l, ChartDatumEvent as m, ChartMode as n, LegendPrimitiveProps as o, ChartDatum as p, ChartRootBaseProps as r, ReferenceLinePrimitiveProps as s, ChartAccessibilityProps as t, YAxisPrimitiveProps as u, PointShape as v, SeriesColor as y };