@silverpoint/react 0.1.1 → 0.3.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 (309) hide show
  1. package/dist/activity-grid.js +4 -2
  2. package/dist/area-chart.js +4 -2
  3. package/dist/bar-chart.js +4 -2
  4. package/dist/base-C6zY78Va.d.ts +8 -0
  5. package/dist/bubble-chart.js +4 -2
  6. package/dist/bullet-chart.js +4 -2
  7. package/dist/candlestick-chart.js +4 -2
  8. package/dist/chord-ring.js +4 -2
  9. package/dist/chunk-2JWLXUY5.js +16 -0
  10. package/dist/chunk-2JWLXUY5.js.map +1 -0
  11. package/dist/{chunk-6FZO4SMF.js → chunk-3BREGZ7C.js} +2 -2
  12. package/dist/{chunk-LOIVX5IV.js → chunk-3U3Z5U6H.js} +2 -2
  13. package/dist/chunk-3WUPWJP2.js +17 -0
  14. package/dist/chunk-3WUPWJP2.js.map +1 -0
  15. package/dist/chunk-43AIURD6.js +21 -0
  16. package/dist/chunk-43AIURD6.js.map +1 -0
  17. package/dist/{chunk-INZGRNO3.js → chunk-46S63XYT.js} +10 -3
  18. package/dist/chunk-46S63XYT.js.map +1 -0
  19. package/dist/chunk-4GQ5X2WK.js +10 -0
  20. package/dist/chunk-4GQ5X2WK.js.map +1 -0
  21. package/dist/chunk-5FKONGCL.js +16 -0
  22. package/dist/chunk-5FKONGCL.js.map +1 -0
  23. package/dist/chunk-67FND3TB.js +26 -0
  24. package/dist/chunk-67FND3TB.js.map +1 -0
  25. package/dist/{chunk-PBT76UXS.js → chunk-6EFRIK7Q.js} +2 -2
  26. package/dist/{chunk-CXXCUD4B.js → chunk-6M4REUJE.js} +2 -2
  27. package/dist/chunk-6NXL245Z.js +16 -0
  28. package/dist/chunk-6NXL245Z.js.map +1 -0
  29. package/dist/{chunk-O2DNGRM7.js → chunk-6S6VKQ3E.js} +2 -2
  30. package/dist/{chunk-2JXPSUCK.js → chunk-AEU6UHVG.js} +2 -2
  31. package/dist/chunk-ART7CMBL.js +16 -0
  32. package/dist/chunk-ART7CMBL.js.map +1 -0
  33. package/dist/{chunk-Y7WZS3VB.js → chunk-C3NHZ4N5.js} +2 -2
  34. package/dist/chunk-CWFUPKSS.js +20 -0
  35. package/dist/chunk-CWFUPKSS.js.map +1 -0
  36. package/dist/chunk-DO4VUIUU.js +61 -0
  37. package/dist/chunk-DO4VUIUU.js.map +1 -0
  38. package/dist/{chunk-FDROMD5U.js → chunk-ESFN6FJY.js} +2 -2
  39. package/dist/{chunk-BHZNDYU3.js → chunk-FBJLA3P7.js} +32 -56
  40. package/dist/chunk-FBJLA3P7.js.map +1 -0
  41. package/dist/{chunk-NOVLEZPR.js → chunk-FHX2HWN3.js} +2 -2
  42. package/dist/{chunk-2Q2ZZTUW.js → chunk-FZ46YSJA.js} +2 -2
  43. package/dist/chunk-G7C4CH54.js +17 -0
  44. package/dist/chunk-G7C4CH54.js.map +1 -0
  45. package/dist/{chunk-KTBGRGB7.js → chunk-GSJYA76X.js} +2 -2
  46. package/dist/{chunk-DYK3SUIZ.js → chunk-GUKXFITX.js} +2 -2
  47. package/dist/{chunk-HYQLSAEO.js → chunk-I72JGA6Q.js} +2 -2
  48. package/dist/{chunk-AQMWZQ2P.js → chunk-J3E6IUUQ.js} +2 -2
  49. package/dist/{chunk-4DUH2UHE.js → chunk-JPTK2AAT.js} +2 -2
  50. package/dist/{chunk-YS5YVHK5.js → chunk-JWCVL7VE.js} +2 -2
  51. package/dist/{chunk-KPWHWNZH.js → chunk-KVOBNPDN.js} +2 -2
  52. package/dist/chunk-LSA5XU52.js +18 -0
  53. package/dist/chunk-LSA5XU52.js.map +1 -0
  54. package/dist/chunk-M56MDRNT.js +17 -0
  55. package/dist/chunk-M56MDRNT.js.map +1 -0
  56. package/dist/{chunk-HH2RZCH6.js → chunk-MC7N4KQA.js} +2 -2
  57. package/dist/{chunk-RUC577P7.js → chunk-MYKZWY2E.js} +2 -2
  58. package/dist/{chunk-5LQGSI6N.js → chunk-NA6K372D.js} +2 -2
  59. package/dist/{chunk-JCIEWEQC.js → chunk-NWK6VBCJ.js} +2 -2
  60. package/dist/{chunk-CI4PGKUI.js → chunk-NWRCFNYB.js} +2 -2
  61. package/dist/{chunk-WLHXHAEV.js → chunk-OAH7AEGE.js} +2 -2
  62. package/dist/chunk-OD6N2ATZ.js +45 -0
  63. package/dist/chunk-OD6N2ATZ.js.map +1 -0
  64. package/dist/chunk-OP2WE7MA.js +31 -0
  65. package/dist/chunk-OP2WE7MA.js.map +1 -0
  66. package/dist/{chunk-DZPDZGM7.js → chunk-PRVJKYEQ.js} +2 -2
  67. package/dist/chunk-QRYI7BEO.js +21 -0
  68. package/dist/chunk-QRYI7BEO.js.map +1 -0
  69. package/dist/{chunk-V3PBT4XB.js → chunk-RAATAHXZ.js} +2 -2
  70. package/dist/{chunk-R6PUPQUI.js → chunk-RIGQTEKW.js} +2 -2
  71. package/dist/{chunk-G2A5PWIR.js → chunk-RMIIFPXA.js} +2 -2
  72. package/dist/chunk-SQ6GWXDK.js +48 -0
  73. package/dist/chunk-SQ6GWXDK.js.map +1 -0
  74. package/dist/chunk-TH6Q4E7C.js +21 -0
  75. package/dist/chunk-TH6Q4E7C.js.map +1 -0
  76. package/dist/{chunk-NAYUAF7O.js → chunk-TSQWTDBK.js} +2 -2
  77. package/dist/{chunk-ORIH4UQP.js → chunk-U3LT444G.js} +2 -2
  78. package/dist/{chunk-BIIINOXE.js → chunk-UOOHQAJU.js} +2 -2
  79. package/dist/{chunk-CCFFHU7V.js → chunk-VKNGQ4NW.js} +2 -2
  80. package/dist/{chunk-M3X7JONW.js → chunk-WFO6BICV.js} +2 -2
  81. package/dist/chunk-WMU6O6KZ.js +21 -0
  82. package/dist/chunk-WMU6O6KZ.js.map +1 -0
  83. package/dist/chunk-WZZA2IGN.js +44 -0
  84. package/dist/chunk-WZZA2IGN.js.map +1 -0
  85. package/dist/{chunk-2OAPH7JN.js → chunk-X2F56RYM.js} +2 -2
  86. package/dist/chunk-ZBSCLF56.js +33 -0
  87. package/dist/chunk-ZBSCLF56.js.map +1 -0
  88. package/dist/chunk-ZOB6BH7H.js +21 -0
  89. package/dist/chunk-ZOB6BH7H.js.map +1 -0
  90. package/dist/composed-chart.js +4 -2
  91. package/dist/coxcomb-chart.js +4 -2
  92. package/dist/create-server-chart-DJQCtKVM.d.ts +17 -0
  93. package/dist/dashboard-link.d.ts +20 -0
  94. package/dist/dashboard-link.js +27 -0
  95. package/dist/dashboard-link.js.map +1 -0
  96. package/dist/dashboard-markup-_EoDs-s-.d.ts +21 -0
  97. package/dist/dashboard.d.ts +22 -0
  98. package/dist/dashboard.js +18 -0
  99. package/dist/dashboard.js.map +1 -0
  100. package/dist/donut-chart.js +4 -2
  101. package/dist/funnel-chart.js +4 -2
  102. package/dist/gauge-arc.js +4 -2
  103. package/dist/heatmap-chart.js +4 -2
  104. package/dist/index.js +36 -34
  105. package/dist/index.js.map +1 -1
  106. package/dist/kpi-card.js +4 -2
  107. package/dist/line-chart.js +4 -2
  108. package/dist/meter-chart.js +4 -2
  109. package/dist/orbit-chart.js +4 -2
  110. package/dist/polar-bar-chart.js +4 -2
  111. package/dist/pyramid-chart.js +4 -2
  112. package/dist/radar-chart.js +4 -2
  113. package/dist/radial-arc-group.js +4 -2
  114. package/dist/radial-rings.js +4 -2
  115. package/dist/range-band-chart.js +4 -2
  116. package/dist/sankey-chart.js +4 -2
  117. package/dist/scatter-chart.js +4 -2
  118. package/dist/server/activity-grid.d.ts +9 -2
  119. package/dist/server/activity-grid.js +1 -1
  120. package/dist/server/area-chart.d.ts +9 -2
  121. package/dist/server/area-chart.js +1 -1
  122. package/dist/server/bar-chart.d.ts +9 -2
  123. package/dist/server/bar-chart.js +1 -1
  124. package/dist/server/bubble-chart.d.ts +9 -2
  125. package/dist/server/bubble-chart.js +1 -1
  126. package/dist/server/bullet-chart.d.ts +9 -2
  127. package/dist/server/bullet-chart.js +1 -1
  128. package/dist/server/candlestick-chart.d.ts +9 -2
  129. package/dist/server/candlestick-chart.js +1 -1
  130. package/dist/server/chord-ring.d.ts +9 -2
  131. package/dist/server/chord-ring.js +1 -1
  132. package/dist/server/composed-chart.d.ts +9 -2
  133. package/dist/server/composed-chart.js +1 -1
  134. package/dist/server/coxcomb-chart.d.ts +9 -2
  135. package/dist/server/coxcomb-chart.js +1 -1
  136. package/dist/server/dashboard.d.ts +15 -0
  137. package/dist/server/dashboard.js +15 -0
  138. package/dist/server/dashboard.js.map +1 -0
  139. package/dist/server/donut-chart.d.ts +9 -2
  140. package/dist/server/donut-chart.js +1 -1
  141. package/dist/server/funnel-chart.d.ts +9 -2
  142. package/dist/server/funnel-chart.js +1 -1
  143. package/dist/server/gauge-arc.d.ts +9 -2
  144. package/dist/server/gauge-arc.js +1 -1
  145. package/dist/server/heatmap-chart.d.ts +9 -2
  146. package/dist/server/heatmap-chart.js +1 -1
  147. package/dist/server/kpi-card.d.ts +9 -2
  148. package/dist/server/kpi-card.js +1 -1
  149. package/dist/server/line-chart.d.ts +9 -2
  150. package/dist/server/line-chart.js +1 -1
  151. package/dist/server/meter-chart.d.ts +9 -2
  152. package/dist/server/meter-chart.js +1 -1
  153. package/dist/server/orbit-chart.d.ts +9 -2
  154. package/dist/server/orbit-chart.js +1 -1
  155. package/dist/server/polar-bar-chart.d.ts +9 -2
  156. package/dist/server/polar-bar-chart.js +1 -1
  157. package/dist/server/pyramid-chart.d.ts +9 -2
  158. package/dist/server/pyramid-chart.js +1 -1
  159. package/dist/server/radar-chart.d.ts +9 -2
  160. package/dist/server/radar-chart.js +1 -1
  161. package/dist/server/radial-arc-group.d.ts +9 -2
  162. package/dist/server/radial-arc-group.js +1 -1
  163. package/dist/server/radial-rings.d.ts +9 -2
  164. package/dist/server/radial-rings.js +1 -1
  165. package/dist/server/range-band-chart.d.ts +9 -2
  166. package/dist/server/range-band-chart.js +1 -1
  167. package/dist/server/sankey-chart.d.ts +9 -2
  168. package/dist/server/sankey-chart.js +1 -1
  169. package/dist/server/scatter-chart.d.ts +9 -2
  170. package/dist/server/scatter-chart.js +1 -1
  171. package/dist/server/sparkline-rows.d.ts +9 -2
  172. package/dist/server/sparkline-rows.js +1 -1
  173. package/dist/server/stacked-bar-chart.d.ts +9 -2
  174. package/dist/server/stacked-bar-chart.js +1 -1
  175. package/dist/server/step-chart.d.ts +9 -2
  176. package/dist/server/step-chart.js +1 -1
  177. package/dist/server/stream-chart.d.ts +9 -2
  178. package/dist/server/stream-chart.js +1 -1
  179. package/dist/server/treemap-chart.d.ts +9 -2
  180. package/dist/server/treemap-chart.js +1 -1
  181. package/dist/server/ui/alert.d.ts +17 -0
  182. package/dist/server/ui/alert.js +13 -0
  183. package/dist/server/ui/alert.js.map +1 -0
  184. package/dist/server/ui/badge.d.ts +15 -0
  185. package/dist/server/ui/badge.js +14 -0
  186. package/dist/server/ui/badge.js.map +1 -0
  187. package/dist/server/ui/card.d.ts +18 -0
  188. package/dist/server/ui/card.js +14 -0
  189. package/dist/server/ui/card.js.map +1 -0
  190. package/dist/server/ui/divider.d.ts +12 -0
  191. package/dist/server/ui/divider.js +13 -0
  192. package/dist/server/ui/divider.js.map +1 -0
  193. package/dist/server/ui/progress.d.ts +14 -0
  194. package/dist/server/ui/progress.js +13 -0
  195. package/dist/server/ui/progress.js.map +1 -0
  196. package/dist/server/ui/skeleton.d.ts +14 -0
  197. package/dist/server/ui/skeleton.js +13 -0
  198. package/dist/server/ui/skeleton.js.map +1 -0
  199. package/dist/server/ui/steps.d.ts +14 -0
  200. package/dist/server/ui/steps.js +13 -0
  201. package/dist/server/ui/steps.js.map +1 -0
  202. package/dist/server/ui/tag.d.ts +17 -0
  203. package/dist/server/ui/tag.js +14 -0
  204. package/dist/server/ui/tag.js.map +1 -0
  205. package/dist/server/volvelle-chart.d.ts +9 -2
  206. package/dist/server/volvelle-chart.js +1 -1
  207. package/dist/server/waterfall-chart.d.ts +9 -2
  208. package/dist/server/waterfall-chart.js +1 -1
  209. package/dist/server/wind-rose.d.ts +9 -2
  210. package/dist/server/wind-rose.js +1 -1
  211. package/dist/sparkline-rows.js +4 -2
  212. package/dist/stacked-bar-chart.js +4 -2
  213. package/dist/step-chart.js +4 -2
  214. package/dist/stream-chart.js +4 -2
  215. package/dist/treemap-chart.js +4 -2
  216. package/dist/ui/alert.d.ts +14 -0
  217. package/dist/ui/alert.js +10 -0
  218. package/dist/ui/alert.js.map +1 -0
  219. package/dist/ui/badge.d.ts +12 -0
  220. package/dist/ui/badge.js +10 -0
  221. package/dist/ui/badge.js.map +1 -0
  222. package/dist/ui/button.d.ts +14 -0
  223. package/dist/ui/button.js +10 -0
  224. package/dist/ui/button.js.map +1 -0
  225. package/dist/ui/card.d.ts +14 -0
  226. package/dist/ui/card.js +10 -0
  227. package/dist/ui/card.js.map +1 -0
  228. package/dist/ui/checkbox.d.ts +14 -0
  229. package/dist/ui/checkbox.js +10 -0
  230. package/dist/ui/checkbox.js.map +1 -0
  231. package/dist/ui/divider.d.ts +11 -0
  232. package/dist/ui/divider.js +10 -0
  233. package/dist/ui/divider.js.map +1 -0
  234. package/dist/ui/input.d.ts +19 -0
  235. package/dist/ui/input.js +10 -0
  236. package/dist/ui/input.js.map +1 -0
  237. package/dist/ui/progress.d.ts +11 -0
  238. package/dist/ui/progress.js +10 -0
  239. package/dist/ui/progress.js.map +1 -0
  240. package/dist/ui/radio-group.d.ts +16 -0
  241. package/dist/ui/radio-group.js +10 -0
  242. package/dist/ui/radio-group.js.map +1 -0
  243. package/dist/ui/rate.d.ts +15 -0
  244. package/dist/ui/rate.js +10 -0
  245. package/dist/ui/rate.js.map +1 -0
  246. package/dist/ui/segmented.d.ts +16 -0
  247. package/dist/ui/segmented.js +10 -0
  248. package/dist/ui/segmented.js.map +1 -0
  249. package/dist/ui/skeleton.d.ts +11 -0
  250. package/dist/ui/skeleton.js +10 -0
  251. package/dist/ui/skeleton.js.map +1 -0
  252. package/dist/ui/slider.d.ts +15 -0
  253. package/dist/ui/slider.js +10 -0
  254. package/dist/ui/slider.js.map +1 -0
  255. package/dist/ui/steps.d.ts +11 -0
  256. package/dist/ui/steps.js +10 -0
  257. package/dist/ui/steps.js.map +1 -0
  258. package/dist/ui/switch.d.ts +14 -0
  259. package/dist/ui/switch.js +10 -0
  260. package/dist/ui/switch.js.map +1 -0
  261. package/dist/ui/tabs.d.ts +25 -0
  262. package/dist/ui/tabs.js +12 -0
  263. package/dist/ui/tabs.js.map +1 -0
  264. package/dist/ui/tag.d.ts +14 -0
  265. package/dist/ui/tag.js +10 -0
  266. package/dist/ui/tag.js.map +1 -0
  267. package/dist/ui.d.ts +21 -0
  268. package/dist/ui.js +76 -0
  269. package/dist/ui.js.map +1 -0
  270. package/dist/volvelle-chart.js +4 -2
  271. package/dist/waterfall-chart.js +4 -2
  272. package/dist/wind-rose.js +4 -2
  273. package/package.json +177 -3
  274. package/dist/chunk-BHZNDYU3.js.map +0 -1
  275. package/dist/chunk-INZGRNO3.js.map +0 -1
  276. package/dist/create-server-chart-B0LbkpQP.d.ts +0 -16
  277. /package/dist/{chunk-6FZO4SMF.js.map → chunk-3BREGZ7C.js.map} +0 -0
  278. /package/dist/{chunk-LOIVX5IV.js.map → chunk-3U3Z5U6H.js.map} +0 -0
  279. /package/dist/{chunk-PBT76UXS.js.map → chunk-6EFRIK7Q.js.map} +0 -0
  280. /package/dist/{chunk-CXXCUD4B.js.map → chunk-6M4REUJE.js.map} +0 -0
  281. /package/dist/{chunk-O2DNGRM7.js.map → chunk-6S6VKQ3E.js.map} +0 -0
  282. /package/dist/{chunk-2JXPSUCK.js.map → chunk-AEU6UHVG.js.map} +0 -0
  283. /package/dist/{chunk-Y7WZS3VB.js.map → chunk-C3NHZ4N5.js.map} +0 -0
  284. /package/dist/{chunk-FDROMD5U.js.map → chunk-ESFN6FJY.js.map} +0 -0
  285. /package/dist/{chunk-NOVLEZPR.js.map → chunk-FHX2HWN3.js.map} +0 -0
  286. /package/dist/{chunk-2Q2ZZTUW.js.map → chunk-FZ46YSJA.js.map} +0 -0
  287. /package/dist/{chunk-KTBGRGB7.js.map → chunk-GSJYA76X.js.map} +0 -0
  288. /package/dist/{chunk-DYK3SUIZ.js.map → chunk-GUKXFITX.js.map} +0 -0
  289. /package/dist/{chunk-HYQLSAEO.js.map → chunk-I72JGA6Q.js.map} +0 -0
  290. /package/dist/{chunk-AQMWZQ2P.js.map → chunk-J3E6IUUQ.js.map} +0 -0
  291. /package/dist/{chunk-4DUH2UHE.js.map → chunk-JPTK2AAT.js.map} +0 -0
  292. /package/dist/{chunk-YS5YVHK5.js.map → chunk-JWCVL7VE.js.map} +0 -0
  293. /package/dist/{chunk-KPWHWNZH.js.map → chunk-KVOBNPDN.js.map} +0 -0
  294. /package/dist/{chunk-HH2RZCH6.js.map → chunk-MC7N4KQA.js.map} +0 -0
  295. /package/dist/{chunk-RUC577P7.js.map → chunk-MYKZWY2E.js.map} +0 -0
  296. /package/dist/{chunk-5LQGSI6N.js.map → chunk-NA6K372D.js.map} +0 -0
  297. /package/dist/{chunk-JCIEWEQC.js.map → chunk-NWK6VBCJ.js.map} +0 -0
  298. /package/dist/{chunk-CI4PGKUI.js.map → chunk-NWRCFNYB.js.map} +0 -0
  299. /package/dist/{chunk-WLHXHAEV.js.map → chunk-OAH7AEGE.js.map} +0 -0
  300. /package/dist/{chunk-DZPDZGM7.js.map → chunk-PRVJKYEQ.js.map} +0 -0
  301. /package/dist/{chunk-V3PBT4XB.js.map → chunk-RAATAHXZ.js.map} +0 -0
  302. /package/dist/{chunk-R6PUPQUI.js.map → chunk-RIGQTEKW.js.map} +0 -0
  303. /package/dist/{chunk-G2A5PWIR.js.map → chunk-RMIIFPXA.js.map} +0 -0
  304. /package/dist/{chunk-NAYUAF7O.js.map → chunk-TSQWTDBK.js.map} +0 -0
  305. /package/dist/{chunk-ORIH4UQP.js.map → chunk-U3LT444G.js.map} +0 -0
  306. /package/dist/{chunk-BIIINOXE.js.map → chunk-UOOHQAJU.js.map} +0 -0
  307. /package/dist/{chunk-CCFFHU7V.js.map → chunk-VKNGQ4NW.js.map} +0 -0
  308. /package/dist/{chunk-M3X7JONW.js.map → chunk-WFO6BICV.js.map} +0 -0
  309. /package/dist/{chunk-2OAPH7JN.js.map → chunk-X2F56RYM.js.map} +0 -0
@@ -1,20 +1,31 @@
1
1
  'use client';
2
+ import {
3
+ DashboardLinkContext
4
+ } from "./chunk-4GQ5X2WK.js";
5
+ import {
6
+ SilverpointContext,
7
+ useForcedPrecision,
8
+ useMeasuredWidth,
9
+ useTypefaceCheck
10
+ } from "./chunk-SQ6GWXDK.js";
2
11
 
3
12
  // src/create-chart.tsx
4
13
  import {
14
+ inCell,
5
15
  instanceId,
16
+ linkFrom,
6
17
  reduceInteraction
7
18
  } from "@silverpoint/core";
8
19
  import { renderChart, toSVGString } from "@silverpoint/grounds";
9
20
  import {
10
21
  forwardRef,
11
- useContext,
12
- useEffect as useEffect2,
22
+ useContext as useContext2,
23
+ useEffect,
13
24
  useId,
14
25
  useImperativeHandle,
15
26
  useMemo,
16
27
  useRef,
17
- useState as useState2
28
+ useState
18
29
  } from "react";
19
30
 
20
31
  // src/chart-svg.tsx
@@ -28,6 +39,7 @@ function Path({ path }) {
28
39
  "data-role": path.role,
29
40
  "data-paint": path.paint,
30
41
  "data-dash": path.dash ?? void 0,
42
+ "data-weight": path.weight ?? void 0,
31
43
  fill: path.fill ?? void 0
32
44
  }
33
45
  );
@@ -99,47 +111,9 @@ function ChartFrame({ rendered, className, rootProps, rootRef, overlay }) {
99
111
  );
100
112
  }
101
113
 
102
- // src/context.ts
103
- import { createContext } from "react";
104
- var SilverpointContext = createContext({});
105
-
106
- // src/environment.ts
107
- import { checkTypeface, FORCED_PRECISION_QUERY } from "@silverpoint/core";
108
- import { useEffect, useState } from "react";
109
- function useForcedPrecision() {
110
- const [forced, setForced] = useState(false);
111
- useEffect(() => {
112
- if (typeof matchMedia !== "function") return;
113
- const query = matchMedia(FORCED_PRECISION_QUERY);
114
- const update = () => setForced(query.matches);
115
- update();
116
- query.addEventListener?.("change", update);
117
- return () => query.removeEventListener?.("change", update);
118
- }, []);
119
- return forced;
120
- }
121
- function useMeasuredWidth(ref, enabled) {
122
- const [width, setWidth] = useState(void 0);
123
- useEffect(() => {
124
- const element = ref.current;
125
- if (!enabled || !element || typeof ResizeObserver !== "function") return;
126
- const observer = new ResizeObserver((entries) => {
127
- const entry = entries[0];
128
- if (entry) setWidth(entry.contentRect.width);
129
- });
130
- observer.observe(element);
131
- return () => observer.disconnect();
132
- }, [ref, enabled]);
133
- return width;
134
- }
135
- function useTypefaceCheck(chart) {
136
- useEffect(() => {
137
- if (typeof document !== "undefined" && document.fonts) void checkTypeface(document.fonts, chart);
138
- }, [chart]);
139
- }
140
-
141
114
  // src/overlay.tsx
142
- import { readout } from "@silverpoint/core";
115
+ import { linkedMarks, readout } from "@silverpoint/core";
116
+ import { useContext } from "react";
143
117
  import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
144
118
  function Overlay({
145
119
  rendered,
@@ -147,7 +121,9 @@ function Overlay({
147
121
  tooltip
148
122
  }) {
149
123
  const current = active ? readout(rendered, active) : null;
124
+ const linked = linkedMarks(rendered, useContext(DashboardLinkContext)?.state);
150
125
  return /* @__PURE__ */ jsxs3(Fragment, { children: [
126
+ linked.length > 0 && /* @__PURE__ */ jsx3("svg", { className: "sp-marker", part: "linked", viewBox: rendered.view.svg.viewBox, "aria-hidden": "true", focusable: "false", children: linked.map((d, index) => /* @__PURE__ */ jsx3("path", { d }, index)) }),
151
127
  current && active && /* @__PURE__ */ jsxs3(Fragment, { children: [
152
128
  /* @__PURE__ */ jsx3("svg", { className: "sp-marker", viewBox: rendered.view.svg.viewBox, "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsx3("path", { d: current.marker.d }) }),
153
129
  /* @__PURE__ */ jsx3("div", { className: "sp-readout", style: { left: current.left, top: current.top }, "aria-hidden": "true", children: tooltip ? tooltip(active, current) : /* @__PURE__ */ jsxs3(Fragment, { children: [
@@ -164,29 +140,30 @@ import { jsx as jsx4 } from "react/jsx-runtime";
164
140
  function createClientChart(recipe) {
165
141
  const Chart = forwardRef(function Chart2(allProps, ref) {
166
142
  const { onActiveChange, onSelect, tooltip } = allProps;
167
- const provider = useContext(SilverpointContext);
143
+ const provider = useContext2(SilverpointContext);
144
+ const link = useContext2(DashboardLinkContext);
168
145
  const generated = useId();
169
146
  const rootRef = useRef(null);
170
147
  const forcedPrecision = useForcedPrecision();
171
148
  useTypefaceCheck(recipe.name);
172
149
  const measured = useMeasuredWidth(rootRef, allProps.width === void 0);
173
- const rendered = useMemo(
174
- () => renderChart(recipe, allProps, {
150
+ const rendered = useMemo(() => {
151
+ const { dashboardCell, ...own } = allProps;
152
+ const fitted = inCell(own, dashboardCell, recipe);
153
+ return renderChart(recipe, fitted.props, {
175
154
  id: instanceId(recipe.name, generated),
176
- width: measured,
155
+ width: measured ?? fitted.width,
177
156
  provider,
178
157
  forcedPrecision
179
- }),
180
- // Keyed on the props object React hands in, which is stable across this component's own
181
- // state changes, so moving the pointer never re-inks the chart.
182
- [allProps, generated, measured, provider, forcedPrecision]
183
- );
184
- const [active, setActive] = useState2(null);
158
+ });
159
+ }, [allProps, generated, measured, provider, forcedPrecision]);
160
+ const [active, setActive] = useState(null);
185
161
  const dispatch = (event) => {
186
162
  const result = reduceInteraction(rendered.geometry, active, event);
187
163
  if (result.changed) {
188
164
  setActive(result.active);
189
165
  onActiveChange?.(result.active);
166
+ link?.set(linkFrom(link.key, rendered.id, result.active));
190
167
  }
191
168
  if (result.selected) onSelect?.(result.selected);
192
169
  return result.handled;
@@ -194,7 +171,7 @@ function createClientChart(recipe) {
194
171
  const latest = useRef(dispatch);
195
172
  latest.current = dispatch;
196
173
  const showing = active !== null;
197
- useEffect2(() => {
174
+ useEffect(() => {
198
175
  if (!showing) return void 0;
199
176
  const onKey = (event) => {
200
177
  if (event.key === "Escape" && !rootRef.current?.contains(event.target)) latest.current({ type: "key", key: "Escape" });
@@ -251,7 +228,6 @@ function createClientChart(recipe) {
251
228
  }
252
229
 
253
230
  export {
254
- SilverpointContext,
255
231
  createClientChart
256
232
  };
257
- //# sourceMappingURL=chunk-BHZNDYU3.js.map
233
+ //# sourceMappingURL=chunk-FBJLA3P7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/create-chart.tsx","../src/chart-svg.tsx","../src/chart-frame.tsx","../src/overlay.tsx"],"sourcesContent":["import {\n inCell,\n instanceId,\n linkFrom,\n reduceInteraction,\n type ActiveItem,\n type ChartHandle,\n type ChartRecipe,\n type CommonChartProps,\n type InteractionEvent,\n type PointerKind,\n} from '@silverpoint/core';\nimport { renderChart, toSVGString } from '@silverpoint/grounds';\nimport {\n forwardRef,\n useContext,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type ForwardRefExoticComponent,\n type KeyboardEvent,\n type PointerEvent,\n type RefAttributes,\n} from 'react';\nimport { ChartFrame } from './chart-frame';\nimport type { CellChartProps } from './dashboard-markup';\nimport { DashboardLinkContext } from './link-context';\nimport { SilverpointContext } from './context';\nimport { useForcedPrecision, useMeasuredWidth, useTypefaceCheck } from './environment';\nimport { Overlay, type TooltipRenderer } from './overlay';\n\nexport type { ChartHandle };\n\n/** Interaction props of the client components (API Spec §9). */\nexport interface InteractionProps {\n /** The active item changed, or `null` when it cleared (REQ-141, REQ-143). */\n onActiveChange?: (item: ActiveItem | null) => void;\n /** An item was chosen by click, Enter or Space. */\n onSelect?: (item: ActiveItem) => void;\n /** Replaces the built-in readout (REQ-142). */\n tooltip?: TooltipRenderer;\n}\n\nexport type ClientChart<P> = ForwardRefExoticComponent<P & InteractionProps & RefAttributes<ChartHandle>>;\n\n/**\n * The client component of a recipe: it measures, renders through the core pipeline and forwards\n * interaction events to the core's reducer. Every client chart is this function applied to its\n * recipe, so the charts differ only in the recipe (Art. 2).\n */\nexport function createClientChart<P extends CommonChartProps>(recipe: ChartRecipe<P>): ClientChart<P> {\n const Chart = forwardRef<ChartHandle, P & InteractionProps & CellChartProps>(function Chart(allProps, ref) {\n const { onActiveChange, onSelect, tooltip } = allProps;\n const provider = useContext(SilverpointContext);\n const link = useContext(DashboardLinkContext);\n const generated = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const forcedPrecision = useForcedPrecision();\n useTypefaceCheck(recipe.name);\n const measured = useMeasuredWidth(rootRef, allProps.width === undefined);\n\n const rendered = useMemo(() => {\n // Inside a dashboard cell: its id, height and config, and its nominal width until measured\n // (REQ-206, REQ-207, REQ-209, REQ-212); the chart's own props win.\n const { dashboardCell, ...own } = allProps;\n const fitted = inCell(own as unknown as P, dashboardCell, recipe);\n return renderChart(recipe, fitted.props, {\n id: instanceId(recipe.name, generated),\n width: measured ?? fitted.width,\n provider,\n forcedPrecision,\n });\n // Keyed on the props object React hands in, which is stable across this component's own\n // state changes, so moving the pointer never re-inks the chart.\n }, [allProps, generated, measured, provider, forcedPrecision]);\n\n const [active, setActive] = useState<ActiveItem | null>(null);\n const dispatch = (event: InteractionEvent): boolean => {\n const result = reduceInteraction(rendered.geometry, active, event);\n if (result.changed) {\n setActive(result.active);\n onActiveChange?.(result.active);\n // In a linked dashboard this chart becomes the source, or clears the link (REQ-216, REQ-218).\n link?.set(linkFrom(link.key, rendered.id, result.active));\n }\n if (result.selected) onSelect?.(result.selected);\n return result.handled;\n };\n // WCAG 1.4.13: a readout shown by the pointer is dismissible with Escape wherever focus is.\n const latest = useRef(dispatch);\n latest.current = dispatch;\n const showing = active !== null;\n useEffect(() => {\n if (!showing) return undefined;\n const onKey = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape' && !rootRef.current?.contains(event.target as Node)) latest.current({ type: 'key', key: 'Escape' });\n };\n document.addEventListener('keydown', onKey);\n return () => document.removeEventListener('keydown', onKey);\n }, [showing]);\n const pointer = (type: 'pointer' | 'click') => (event: PointerEvent<HTMLDivElement>) => {\n const svg = rootRef.current?.querySelector('svg.sp-chart');\n if (!svg) return;\n const box = svg.getBoundingClientRect();\n dispatch({\n type,\n client: { x: event.clientX, y: event.clientY },\n box: { left: box.left, top: box.top, width: box.width, height: box.height },\n kind: (event.pointerType || 'mouse') as PointerKind,\n });\n };\n const rootProps = {\n tabIndex: 0,\n role: 'group',\n 'aria-label': rendered.name,\n onPointerMove: pointer('pointer'),\n onPointerDown: pointer('pointer'),\n onClick: pointer('click'),\n onPointerLeave: () => dispatch({ type: 'leave' }),\n onFocus: () => dispatch({ type: 'focus' }),\n onBlur: () => dispatch({ type: 'blur' }),\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => {\n if (dispatch({ type: 'key', key: event.key })) event.preventDefault();\n },\n };\n\n useImperativeHandle(\n ref,\n () => ({\n getGeometry: () => rendered.geometry,\n toSVGString: () => toSVGString(rendered),\n }),\n [rendered],\n );\n\n return (\n <ChartFrame\n rendered={rendered}\n className={allProps.className}\n rootRef={rootRef}\n rootProps={rootProps}\n overlay={<Overlay rendered={rendered} active={active} tooltip={tooltip} />}\n />\n );\n });\n Chart.displayName = recipe.name;\n return Chart as ClientChart<P>;\n}\n","import type { PathView, SvgView } from '@silverpoint/core';\n\nfunction Path({ path }: { readonly path: PathView }) {\n return (\n <path\n d={path.d}\n part={path.part}\n data-role={path.role}\n data-paint={path.paint}\n data-dash={path.dash ?? undefined}\n data-weight={path.weight ?? undefined}\n fill={path.fill ?? undefined}\n />\n );\n}\n\n/** Writes the core's SVG view one field to one attribute; computes nothing (Art. 2). */\nexport function ChartSvg({ view }: { readonly view: SvgView }) {\n const { svg } = view;\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={svg.viewBox}\n width={svg.width}\n height={svg.height}\n className={svg.class}\n data-substrate={svg.substrate}\n data-mode={svg.mode}\n role={svg.role}\n aria-labelledby={svg.labelledby}\n >\n <title id={view.title.id}>{view.title.text}</title>\n <desc id={view.desc.id}>{view.desc.text}</desc>\n {view.patterns.length > 0 && (\n <defs>\n {view.patterns.map((pattern) => (\n <pattern\n key={pattern.id}\n id={pattern.id}\n width={pattern.width}\n height={pattern.height}\n patternUnits=\"userSpaceOnUse\"\n patternTransform={pattern.transform}\n >\n {pattern.paths.map((path, index) => (\n <Path key={index} path={path} />\n ))}\n </pattern>\n ))}\n </defs>\n )}\n {view.paths.map((path, index) => (\n <Path key={index} path={path} />\n ))}\n {view.texts.map((text, index) => (\n <text key={index} x={text.x} y={text.y} part={text.part} data-kind={text.kind} textAnchor={text.anchor}>\n {text.text}\n </text>\n ))}\n </svg>\n );\n}\n","import type { DataTable } from '@silverpoint/core';\nimport type { RenderedChart } from '@silverpoint/grounds';\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { ChartSvg } from './chart-svg';\n\nfunction Table({ table, id, visibility }: { readonly table: DataTable; readonly id: string; readonly visibility: string }) {\n return (\n <div className=\"sp-table-box\" data-visibility={visibility}>\n <table className=\"sp-table\" id={id} data-visibility={visibility}>\n <caption>{table.caption}</caption>\n <thead>\n <tr>\n {table.columns.map((column, index) => (\n <th key={index} scope=\"col\">\n {column}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {table.rows.map((row, index) => (\n <tr key={index}>\n {row.map((cell, column) =>\n column === 0 ? (\n <th key={column} scope=\"row\">\n {cell}\n </th>\n ) : (\n <td key={column}>{cell}</td>\n ),\n )}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\nexport interface ChartFrameProps {\n readonly rendered: RenderedChart;\n readonly className?: string;\n /** Interaction handlers and focus attributes, supplied by the client component only. */\n readonly rootProps?: HTMLAttributes<HTMLDivElement>;\n readonly rootRef?: Ref<HTMLDivElement>;\n /** Readout and marker, drawn over the chart by the client component. */\n readonly overlay?: ReactNode;\n}\n\n/** The chart's DOM: root, SVG, overlay and tabular alternative (API Spec §10). */\nexport function ChartFrame({ rendered, className, rootProps, rootRef, overlay }: ChartFrameProps) {\n const classes = ['sp-root', `sp-ground-${rendered.ground}`, className].filter(Boolean).join(' ');\n return (\n <div\n className={classes}\n data-substrate={rendered.substrate}\n data-chrome={rendered.chrome}\n data-status={rendered.status}\n ref={rootRef}\n {...rootProps}\n >\n <ChartSvg view={rendered.view} />\n {overlay}\n {rendered.dataTable !== 'none' && (\n <Table table={rendered.table} id={rendered.ids.table} visibility={rendered.dataTable} />\n )}\n </div>\n );\n}\n","import { linkedMarks, readout, type ActiveItem, type Readout } from '@silverpoint/core';\nimport type { RenderedChart } from '@silverpoint/grounds';\nimport { useContext, type ReactNode } from 'react';\nimport { DashboardLinkContext } from './link-context';\n\n/** A consumer-supplied readout renderer (REQ-142). */\nexport type TooltipRenderer = (active: ActiveItem, readout: Readout) => ReactNode;\n\n/**\n * Marker, readout and live region of the active item (REQ-141, REQ-122). Every number comes from\n * the core's `readout`; this component only places it.\n */\nexport function Overlay({\n rendered,\n active,\n tooltip,\n}: {\n readonly rendered: RenderedChart;\n readonly active: ActiveItem | null;\n readonly tooltip?: TooltipRenderer;\n}) {\n const current = active ? readout(rendered, active) : null;\n // Another chart's linked item, marked here and hidden from assistive technology (REQ-216, REQ-218).\n const linked = linkedMarks(rendered, useContext(DashboardLinkContext)?.state);\n return (\n <>\n {linked.length > 0 && (\n <svg className=\"sp-marker\" part=\"linked\" viewBox={rendered.view.svg.viewBox} aria-hidden=\"true\" focusable=\"false\">\n {linked.map((d, index) => (\n <path key={index} d={d} />\n ))}\n </svg>\n )}\n {current && active && (\n <>\n <svg className=\"sp-marker\" viewBox={rendered.view.svg.viewBox} aria-hidden=\"true\" focusable=\"false\">\n <path d={current.marker.d} />\n </svg>\n <div className=\"sp-readout\" style={{ left: current.left, top: current.top }} aria-hidden=\"true\">\n {tooltip ? (\n tooltip(active, current)\n ) : (\n <>\n <span className=\"sp-readout-heading\">{current.heading}</span>\n {current.text}\n </>\n )}\n </div>\n </>\n )}\n <div className=\"sp-live\" aria-live=\"polite\">\n {current ? current.announcement : ''}\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP,SAAS,aAAa,mBAAmB;AACz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AAA,QAC5B,aAAa,MAAM,YAAY,QAAQ;AAAA,MACzC;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AAEA,WACE,gBAAAF;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,SAAS;AAAA,QACpB;AAAA,QACA;AAAA,QACA,SAAS,gBAAAA,KAAC,WAAQ,UAAoB,QAAgB,SAAkB;AAAA;AAAA,IAC1E;AAAA,EAEJ,CAAC;AACD,QAAM,cAAc,OAAO;AAC3B,SAAO;AACT;","names":["useContext","jsx","jsxs","jsx","jsxs","jsx","Chart","useContext"]}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/waterfall-chart.tsx
7
7
  import { waterfallChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var WaterfallChart = createClientChart(waterfallChart);
10
10
  export {
11
11
  WaterfallChart
12
12
  };
13
- //# sourceMappingURL=chunk-NOVLEZPR.js.map
13
+ //# sourceMappingURL=chunk-FHX2HWN3.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/pyramid-chart.tsx
7
7
  import { pyramidChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var PyramidChart = createClientChart(pyramidChart);
10
10
  export {
11
11
  PyramidChart
12
12
  };
13
- //# sourceMappingURL=chunk-2Q2ZZTUW.js.map
13
+ //# sourceMappingURL=chunk-FZ46YSJA.js.map
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import {
3
+ renderUi,
4
+ textOf,
5
+ useUi
6
+ } from "./chunk-DO4VUIUU.js";
7
+
8
+ // src/ui/badge.tsx
9
+ import { uiBadgeView } from "@silverpoint/core/ui";
10
+ function SpBadge({ children, dashboardCell, ...props }) {
11
+ return renderUi(uiBadgeView(props, useUi(props, dashboardCell), { text: textOf(children) }), { slots: { content: children } });
12
+ }
13
+
14
+ export {
15
+ SpBadge
16
+ };
17
+ //# sourceMappingURL=chunk-G7C4CH54.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/badge.tsx"],"sourcesContent":["import { uiBadgeView, type SpBadgeProps as CoreProps } from '@silverpoint/core/ui';\nimport type { ReactElement, ReactNode } from 'react';\nimport { textOf, useUi, type UiCellProps } from './base';\nimport { renderUi } from './render';\n\nexport interface SpBadgeProps extends CoreProps, UiCellProps {\n readonly children?: ReactNode;\n}\n\n/** `SpBadge`: its count is text, in the accessible name (REQ-318). */\nexport function SpBadge({ children, dashboardCell, ...props }: SpBadgeProps) {\n return renderUi(uiBadgeView(props, useUi(props, dashboardCell), { text: textOf(children) }), { slots: { content: children } }) as ReactElement;\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,mBAAmD;AAUrD,SAAS,QAAQ,EAAE,UAAU,eAAe,GAAG,MAAM,GAAiB;AAC3E,SAAO,SAAS,YAAY,OAAO,MAAM,OAAO,aAAa,GAAG,EAAE,MAAM,OAAO,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;AAC/H;","names":[]}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/heatmap-chart.tsx
7
7
  import { heatmapChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var HeatmapChart = createClientChart(heatmapChart);
10
10
  export {
11
11
  HeatmapChart
12
12
  };
13
- //# sourceMappingURL=chunk-KTBGRGB7.js.map
13
+ //# sourceMappingURL=chunk-GSJYA76X.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/scatter-chart.tsx
7
7
  import { scatterChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var ScatterChart = createClientChart(scatterChart);
10
10
  export {
11
11
  ScatterChart
12
12
  };
13
- //# sourceMappingURL=chunk-DYK3SUIZ.js.map
13
+ //# sourceMappingURL=chunk-GUKXFITX.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/volvelle-chart.tsx
7
7
  import { volvelleChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var VolvelleChart = createClientChart(volvelleChart);
10
10
  export {
11
11
  VolvelleChart
12
12
  };
13
- //# sourceMappingURL=chunk-HYQLSAEO.js.map
13
+ //# sourceMappingURL=chunk-I72JGA6Q.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/gauge-arc.tsx
7
7
  import { gaugeArc } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var GaugeArc = createClientChart(gaugeArc);
10
10
  export {
11
11
  GaugeArc
12
12
  };
13
- //# sourceMappingURL=chunk-AQMWZQ2P.js.map
13
+ //# sourceMappingURL=chunk-J3E6IUUQ.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/bar-chart.tsx
7
7
  import { barChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var BarChart = createClientChart(barChart);
10
10
  export {
11
11
  BarChart
12
12
  };
13
- //# sourceMappingURL=chunk-4DUH2UHE.js.map
13
+ //# sourceMappingURL=chunk-JPTK2AAT.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/donut-chart.tsx
7
7
  import { donutChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var DonutChart = createClientChart(donutChart);
10
10
  export {
11
11
  DonutChart
12
12
  };
13
- //# sourceMappingURL=chunk-YS5YVHK5.js.map
13
+ //# sourceMappingURL=chunk-JWCVL7VE.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/candlestick-chart.tsx
7
7
  import { candlestickChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var CandlestickChart = createClientChart(candlestickChart);
10
10
  export {
11
11
  CandlestickChart
12
12
  };
13
- //# sourceMappingURL=chunk-KPWHWNZH.js.map
13
+ //# sourceMappingURL=chunk-KVOBNPDN.js.map
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import {
3
+ renderUi,
4
+ textOf,
5
+ useUi
6
+ } from "./chunk-DO4VUIUU.js";
7
+
8
+ // src/ui/tag.tsx
9
+ import { uiTagView } from "@silverpoint/core/ui";
10
+ function SpTag({ children, onClose, dashboardCell, ...props }) {
11
+ const view = uiTagView(props, useUi(props, dashboardCell), { text: textOf(children) });
12
+ return renderUi(view, { close: { onClick: onClose }, slots: { content: children } });
13
+ }
14
+
15
+ export {
16
+ SpTag
17
+ };
18
+ //# sourceMappingURL=chunk-LSA5XU52.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/tag.tsx"],"sourcesContent":["import { uiTagView, type SpTagProps as CoreProps } from '@silverpoint/core/ui';\nimport type { MouseEvent, ReactElement, ReactNode } from 'react';\nimport { textOf, useUi, type UiCellProps } from './base';\nimport { renderUi } from './render';\n\nexport interface SpTagProps extends CoreProps, UiCellProps {\n readonly children?: ReactNode;\n /** From the close button of a closable tag. */\n readonly onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n}\n\n/** `SpTag`: framed and toned; closable, a native close button (REQ-308). */\nexport function SpTag({ children, onClose, dashboardCell, ...props }: SpTagProps) {\n const view = uiTagView(props, useUi(props, dashboardCell), { text: textOf(children) });\n return renderUi(view, { close: { onClick: onClose }, slots: { content: children } }) as ReactElement;\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,iBAA+C;AAYjD,SAAS,MAAM,EAAE,UAAU,SAAS,eAAe,GAAG,MAAM,GAAe;AAChF,QAAM,OAAO,UAAU,OAAO,MAAM,OAAO,aAAa,GAAG,EAAE,MAAM,OAAO,QAAQ,EAAE,CAAC;AACrF,SAAO,SAAS,MAAM,EAAE,OAAO,EAAE,SAAS,QAAQ,GAAG,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;AACrF;","names":[]}
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import {
3
+ renderUi,
4
+ useUi
5
+ } from "./chunk-DO4VUIUU.js";
6
+
7
+ // src/ui/alert.tsx
8
+ import { uiAlertView } from "@silverpoint/core/ui";
9
+ function SpAlert({ children, onClose, dashboardCell, ...props }) {
10
+ const view = uiAlertView(props, useUi(props, dashboardCell), { closable: props.closable === true });
11
+ return renderUi(view, { close: { onClick: onClose }, slots: { content: children } });
12
+ }
13
+
14
+ export {
15
+ SpAlert
16
+ };
17
+ //# sourceMappingURL=chunk-M56MDRNT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/alert.tsx"],"sourcesContent":["import { uiAlertView, type SpAlertProps as CoreProps } from '@silverpoint/core/ui';\nimport type { MouseEvent, ReactElement, ReactNode } from 'react';\nimport { useUi, type UiCellProps } from './base';\nimport { renderUi } from './render';\n\nexport interface SpAlertProps extends CoreProps, UiCellProps {\n readonly children?: ReactNode;\n /** From the close button of a closable alert. */\n readonly onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n}\n\n/** `SpAlert`: `alert` or `status` by kind (REQ-318); closable, a native close button. */\nexport function SpAlert({ children, onClose, dashboardCell, ...props }: SpAlertProps) {\n const view = uiAlertView(props, useUi(props, dashboardCell), { closable: props.closable === true });\n return renderUi(view, { close: { onClick: onClose }, slots: { content: children } }) as ReactElement;\n}\n"],"mappings":";;;;;;;AAAA,SAAS,mBAAmD;AAYrD,SAAS,QAAQ,EAAE,UAAU,SAAS,eAAe,GAAG,MAAM,GAAiB;AACpF,QAAM,OAAO,YAAY,OAAO,MAAM,OAAO,aAAa,GAAG,EAAE,UAAU,MAAM,aAAa,KAAK,CAAC;AAClG,SAAO,SAAS,MAAM,EAAE,OAAO,EAAE,SAAS,QAAQ,GAAG,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;AACrF;","names":[]}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/treemap-chart.tsx
7
7
  import { treemapChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var TreemapChart = createClientChart(treemapChart);
10
10
  export {
11
11
  TreemapChart
12
12
  };
13
- //# sourceMappingURL=chunk-HH2RZCH6.js.map
13
+ //# sourceMappingURL=chunk-MC7N4KQA.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/wind-rose.tsx
7
7
  import { windRose } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var WindRose = createClientChart(windRose);
10
10
  export {
11
11
  WindRose
12
12
  };
13
- //# sourceMappingURL=chunk-RUC577P7.js.map
13
+ //# sourceMappingURL=chunk-MYKZWY2E.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/polar-bar-chart.tsx
7
7
  import { polarBarChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var PolarBarChart = createClientChart(polarBarChart);
10
10
  export {
11
11
  PolarBarChart
12
12
  };
13
- //# sourceMappingURL=chunk-5LQGSI6N.js.map
13
+ //# sourceMappingURL=chunk-NA6K372D.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/sparkline-rows.tsx
7
7
  import { sparklineRows } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var SparklineRows = createClientChart(sparklineRows);
10
10
  export {
11
11
  SparklineRows
12
12
  };
13
- //# sourceMappingURL=chunk-JCIEWEQC.js.map
13
+ //# sourceMappingURL=chunk-NWK6VBCJ.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/range-band-chart.tsx
7
7
  import { rangeBandChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var RangeBandChart = createClientChart(rangeBandChart);
10
10
  export {
11
11
  RangeBandChart
12
12
  };
13
- //# sourceMappingURL=chunk-CI4PGKUI.js.map
13
+ //# sourceMappingURL=chunk-NWRCFNYB.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/radial-arc-group.tsx
7
7
  import { radialArcGroup } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var RadialArcGroup = createClientChart(radialArcGroup);
10
10
  export {
11
11
  RadialArcGroup
12
12
  };
13
- //# sourceMappingURL=chunk-WLHXHAEV.js.map
13
+ //# sourceMappingURL=chunk-OAH7AEGE.js.map
@@ -0,0 +1,45 @@
1
+ // src/dashboard-markup.tsx
2
+ import { dashboardView } from "@silverpoint/core";
3
+ import { Children, cloneElement, isValidElement } from "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ function DashboardCell({ children }) {
6
+ return /* @__PURE__ */ jsx(Fragment, { children });
7
+ }
8
+ var asStyle = (vars) => vars;
9
+ function DashboardMarkup({ children, wrapGrid, ...props }) {
10
+ const given = Children.toArray(children).map((child) => {
11
+ const marked = isValidElement(child) && child.type === DashboardCell;
12
+ const content = marked ? child.props.children : child;
13
+ const chart = isValidElement(content) ? content : void 0;
14
+ return { cell: marked ? child.props.cell : void 0, id: chart?.props.id, content, chart };
15
+ });
16
+ const view = dashboardView(props, given.map(({ cell, id }) => ({ cell, id })));
17
+ const Heading = view.heading ? `h${view.heading.level}` : void 0;
18
+ const grid = /* @__PURE__ */ jsx("div", { className: "sp-dashboard-grid", part: "dashboard-grid", children: view.cells.map((cell) => {
19
+ const { chart, content } = given[cell.child];
20
+ return /* @__PURE__ */ jsx("article", { className: "sp-dashboard-cell", part: "dashboard-cell", "aria-labelledby": cell.labelledby, style: asStyle(cell.style), children: chart ? cloneElement(chart, { dashboardCell: cell.context }) : content }, cell.context.chartId);
21
+ }) });
22
+ return /* @__PURE__ */ jsxs(
23
+ "section",
24
+ {
25
+ className: view.section.className,
26
+ part: "dashboard",
27
+ "data-substrate": view.section.substrate,
28
+ "aria-labelledby": view.section.labelledby,
29
+ "aria-describedby": view.section.describedby,
30
+ "aria-label": view.section.label,
31
+ style: asStyle(view.section.style),
32
+ children: [
33
+ Heading && view.heading && /* @__PURE__ */ jsx(Heading, { className: "sp-dashboard-title", part: "dashboard-title", id: view.heading.id, children: view.heading.text }),
34
+ view.description && /* @__PURE__ */ jsx("p", { className: "sp-dashboard-description", part: "dashboard-description", id: view.description.id, children: view.description.text }),
35
+ wrapGrid ? wrapGrid(grid) : grid
36
+ ]
37
+ }
38
+ );
39
+ }
40
+
41
+ export {
42
+ DashboardCell,
43
+ DashboardMarkup
44
+ };
45
+ //# sourceMappingURL=chunk-OD6N2ATZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/dashboard-markup.tsx"],"sourcesContent":["import { dashboardView, type DashboardCellContext, type DashboardProps } from '@silverpoint/core';\nimport { Children, cloneElement, isValidElement, type CSSProperties, type ReactElement, type ReactNode } from 'react';\n\nexport interface DashboardCellProps {\n /** The layout cell this child fills. Omitted: next in source order, span 1 (API Spec §7.1). */\n readonly cell?: string;\n /** The chart. A single element receives the cell's id, size and configuration. */\n readonly children?: ReactNode;\n}\n\n/**\n * Marks a child of `Dashboard` with its layout cell. Rendered on its own it is its children; inside\n * a dashboard, the dashboard reads its `cell` and emits it as an `article` (REQ-200).\n */\nexport function DashboardCell({ children }: DashboardCellProps) {\n return <>{children}</>;\n}\n\n/** The internal prop through which a cell hands its chart id, box and config (TD §3.3). */\nexport interface CellChartProps {\n readonly dashboardCell?: DashboardCellContext;\n}\n\nconst asStyle = (vars: Readonly<Record<string, string>>) => vars as CSSProperties;\n\n/**\n * The dashboard's DOM (API Spec §10), shared by the client and server entries. It computes\n * nothing: the core's `dashboardView` gives every attribute, and each cell's chart gets its\n * context as a prop, which crosses a Server Components boundary as plain data (Art. 2).\n */\nexport function DashboardMarkup({ children, wrapGrid, ...props }: DashboardProps & { readonly children?: ReactNode; readonly wrapGrid?: (grid: ReactNode) => ReactNode }) {\n const given = Children.toArray(children).map((child) => {\n const marked = isValidElement<DashboardCellProps>(child) && child.type === DashboardCell;\n const content = marked ? child.props.children : child;\n const chart = isValidElement<{ id?: string }>(content) ? content : undefined;\n return { cell: marked ? child.props.cell : undefined, id: chart?.props.id, content, chart };\n });\n const view = dashboardView(props, given.map(({ cell, id }) => ({ cell, id })));\n const Heading = view.heading ? (`h${view.heading.level}` as const) : undefined;\n const grid = (\n <div className=\"sp-dashboard-grid\" part=\"dashboard-grid\">\n {view.cells.map((cell) => {\n const { chart, content } = given[cell.child]!;\n return (\n <article key={cell.context.chartId} className=\"sp-dashboard-cell\" part=\"dashboard-cell\" aria-labelledby={cell.labelledby} style={asStyle(cell.style)}>\n {chart ? cloneElement(chart as ReactElement<CellChartProps>, { dashboardCell: cell.context }) : content}\n </article>\n );\n })}\n </div>\n );\n return (\n <section\n className={view.section.className}\n part=\"dashboard\"\n data-substrate={view.section.substrate}\n aria-labelledby={view.section.labelledby}\n aria-describedby={view.section.describedby}\n aria-label={view.section.label}\n style={asStyle(view.section.style)}\n >\n {Heading && view.heading && (\n <Heading className=\"sp-dashboard-title\" part=\"dashboard-title\" id={view.heading.id}>\n {view.heading.text}\n </Heading>\n )}\n {view.description && (\n <p className=\"sp-dashboard-description\" part=\"dashboard-description\" id={view.description.id}>\n {view.description.text}\n </p>\n )}\n {wrapGrid ? wrapGrid(grid) : grid}\n </section>\n );\n}\n"],"mappings":";AAAA,SAAS,qBAAqE;AAC9E,SAAS,UAAU,cAAc,sBAA6E;AAcrG,wBAqCL,YArCK;AADF,SAAS,cAAc,EAAE,SAAS,GAAuB;AAC9D,SAAO,gCAAG,UAAS;AACrB;AAOA,IAAM,UAAU,CAAC,SAA2C;AAOrD,SAAS,gBAAgB,EAAE,UAAU,UAAU,GAAG,MAAM,GAA2G;AACxK,QAAM,QAAQ,SAAS,QAAQ,QAAQ,EAAE,IAAI,CAAC,UAAU;AACtD,UAAM,SAAS,eAAmC,KAAK,KAAK,MAAM,SAAS;AAC3E,UAAM,UAAU,SAAS,MAAM,MAAM,WAAW;AAChD,UAAM,QAAQ,eAAgC,OAAO,IAAI,UAAU;AACnE,WAAO,EAAE,MAAM,SAAS,MAAM,MAAM,OAAO,QAAW,IAAI,OAAO,MAAM,IAAI,SAAS,MAAM;AAAA,EAC5F,CAAC;AACD,QAAM,OAAO,cAAc,OAAO,MAAM,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,EAAE,MAAM,GAAG,EAAE,CAAC;AAC7E,QAAM,UAAU,KAAK,UAAW,IAAI,KAAK,QAAQ,KAAK,KAAe;AACrE,QAAM,OACJ,oBAAC,SAAI,WAAU,qBAAoB,MAAK,kBACrC,eAAK,MAAM,IAAI,CAAC,SAAS;AACxB,UAAM,EAAE,OAAO,QAAQ,IAAI,MAAM,KAAK,KAAK;AAC3C,WACE,oBAAC,aAAmC,WAAU,qBAAoB,MAAK,kBAAiB,mBAAiB,KAAK,YAAY,OAAO,QAAQ,KAAK,KAAK,GAChJ,kBAAQ,aAAa,OAAuC,EAAE,eAAe,KAAK,QAAQ,CAAC,IAAI,WADpF,KAAK,QAAQ,OAE3B;AAAA,EAEJ,CAAC,GACH;AAEF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,KAAK,QAAQ;AAAA,MACxB,MAAK;AAAA,MACL,kBAAgB,KAAK,QAAQ;AAAA,MAC7B,mBAAiB,KAAK,QAAQ;AAAA,MAC9B,oBAAkB,KAAK,QAAQ;AAAA,MAC/B,cAAY,KAAK,QAAQ;AAAA,MACzB,OAAO,QAAQ,KAAK,QAAQ,KAAK;AAAA,MAEhC;AAAA,mBAAW,KAAK,WACf,oBAAC,WAAQ,WAAU,sBAAqB,MAAK,mBAAkB,IAAI,KAAK,QAAQ,IAC7E,eAAK,QAAQ,MAChB;AAAA,QAED,KAAK,eACJ,oBAAC,OAAE,WAAU,4BAA2B,MAAK,yBAAwB,IAAI,KAAK,YAAY,IACvF,eAAK,YAAY,MACpB;AAAA,QAED,WAAW,SAAS,IAAI,IAAI;AAAA;AAAA;AAAA,EAC/B;AAEJ;","names":[]}
@@ -0,0 +1,31 @@
1
+ 'use client';
2
+ import {
3
+ renderUi,
4
+ useUi,
5
+ useValue
6
+ } from "./chunk-DO4VUIUU.js";
7
+
8
+ // src/ui/tabs.tsx
9
+ import { uiItems, uiRovingFocus, uiSelectedKey, uiTabPanelView, uiTabsView } from "@silverpoint/core/ui";
10
+ import { createContext, useContext } from "react";
11
+ import { jsx } from "react/jsx-runtime";
12
+ var TabsContext = createContext({ value: null });
13
+ function SpTabs({ value, defaultValue, onChange, children, dashboardCell, ...props }) {
14
+ const [current, set] = useValue(value, defaultValue, onChange);
15
+ const view = uiTabsView(props, useUi(props, dashboardCell), { value: current ?? null });
16
+ const selected = uiSelectedKey(uiItems(props.items, "SpTabs"), current, "first");
17
+ const native = { onClick: (event) => set(String(event.currentTarget.dataset.key)) };
18
+ const orientation = props.orientation ?? "horizontal";
19
+ const onKeyDown = (event) => uiRovingFocus(event, event.currentTarget, '[role="tab"]', orientation, props.activation !== "manual");
20
+ const content = /* @__PURE__ */ jsx(TabsContext.Provider, { value: { id: props.id, value: selected }, children });
21
+ return renderUi(view, { root: { onKeyDown }, native, slots: { content } });
22
+ }
23
+ function SpTabPanel({ value, children }) {
24
+ return renderUi(uiTabPanelView({ value }, useContext(TabsContext)), { slots: { content: children } });
25
+ }
26
+
27
+ export {
28
+ SpTabs,
29
+ SpTabPanel
30
+ };
31
+ //# sourceMappingURL=chunk-OP2WE7MA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/tabs.tsx"],"sourcesContent":["import { uiItems, uiRovingFocus, uiSelectedKey, uiTabPanelView, uiTabsView, type SpTabsProps as CoreProps } from '@silverpoint/core/ui';\nimport { createContext, useContext, type KeyboardEvent, type MouseEvent, type ReactElement, type ReactNode } from 'react';\nimport { useUi, useValue, type UiCellProps } from './base';\nimport { renderUi } from './render';\n\nexport interface SpTabsProps extends CoreProps, UiCellProps {\n /** Controlled key; an unknown one shows the first enabled tab. */\n readonly value?: string;\n readonly defaultValue?: string;\n /** The key selected, not the DOM event (REQ-322). */\n readonly onChange?: (value: string) => void;\n /** `SpTabPanel` elements. */\n readonly children?: ReactNode;\n}\n\n/** What a panel reads from its tabs: their id, for the ids that relate them, and the selected key. */\nconst TabsContext = createContext<{ readonly id?: string; readonly value: string | null }>({ value: null });\n\n/** `SpTabs`: a tablist of native buttons, one tab stop; arrows through the core, `activation` as APG (REQ-315). */\nexport function SpTabs({ value, defaultValue, onChange, children, dashboardCell, ...props }: SpTabsProps) {\n const [current, set] = useValue<string | undefined>(value, defaultValue, onChange as (next: string | undefined) => void);\n const view = uiTabsView(props, useUi(props, dashboardCell), { value: current ?? null });\n const selected = uiSelectedKey(uiItems(props.items, 'SpTabs'), current, 'first');\n const native = { onClick: (event: MouseEvent<HTMLButtonElement>) => set(String(event.currentTarget.dataset.key)) };\n const orientation = props.orientation ?? 'horizontal';\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) =>\n uiRovingFocus(event, event.currentTarget, '[role=\"tab\"]', orientation, props.activation !== 'manual');\n const content = <TabsContext.Provider value={{ id: props.id, value: selected }}>{children}</TabsContext.Provider>;\n return renderUi(view, { root: { onKeyDown }, native, slots: { content } }) as ReactElement;\n}\n\nexport interface SpTabPanelProps {\n /** The key of the tab that shows this panel. */\n readonly value: string;\n readonly children?: ReactNode;\n}\n\n/** `SpTabPanel`: a `tabpanel` labelled by its tab, hidden unless its tab is selected. */\nexport function SpTabPanel({ value, children }: SpTabPanelProps) {\n return renderUi(uiTabPanelView({ value }, useContext(TabsContext)), { slots: { content: children } }) as ReactElement;\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,SAAS,eAAe,eAAe,gBAAgB,kBAAiD;AACjH,SAAS,eAAe,kBAA0F;AA0BhG;AAXlB,IAAM,cAAc,cAAuE,EAAE,OAAO,KAAK,CAAC;AAGnG,SAAS,OAAO,EAAE,OAAO,cAAc,UAAU,UAAU,eAAe,GAAG,MAAM,GAAgB;AACxG,QAAM,CAAC,SAAS,GAAG,IAAI,SAA6B,OAAO,cAAc,QAA8C;AACvH,QAAM,OAAO,WAAW,OAAO,MAAM,OAAO,aAAa,GAAG,EAAE,OAAO,WAAW,KAAK,CAAC;AACtF,QAAM,WAAW,cAAc,QAAQ,MAAM,OAAO,QAAQ,GAAG,SAAS,OAAO;AAC/E,QAAM,SAAS,EAAE,SAAS,CAAC,UAAyC,IAAI,OAAO,MAAM,cAAc,QAAQ,GAAG,CAAC,EAAE;AACjH,QAAM,cAAc,MAAM,eAAe;AACzC,QAAM,YAAY,CAAC,UACjB,cAAc,OAAO,MAAM,eAAe,gBAAgB,aAAa,MAAM,eAAe,QAAQ;AACtG,QAAM,UAAU,oBAAC,YAAY,UAAZ,EAAqB,OAAO,EAAE,IAAI,MAAM,IAAI,OAAO,SAAS,GAAI,UAAS;AAC1F,SAAO,SAAS,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,QAAQ,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC3E;AASO,SAAS,WAAW,EAAE,OAAO,SAAS,GAAoB;AAC/D,SAAO,SAAS,eAAe,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;AACtG;","names":[]}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-FBJLA3P7.js";
5
5
 
6
6
  // src/radar-chart.tsx
7
7
  import { radarChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var RadarChart = createClientChart(radarChart);
10
10
  export {
11
11
  RadarChart
12
12
  };
13
- //# sourceMappingURL=chunk-DZPDZGM7.js.map
13
+ //# sourceMappingURL=chunk-PRVJKYEQ.js.map