@silverpoint/react 0.1.1 → 0.2.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 (190) hide show
  1. package/dist/activity-grid.js +3 -2
  2. package/dist/area-chart.js +3 -2
  3. package/dist/bar-chart.js +3 -2
  4. package/dist/bubble-chart.js +3 -2
  5. package/dist/bullet-chart.js +3 -2
  6. package/dist/candlestick-chart.js +3 -2
  7. package/dist/chord-ring.js +3 -2
  8. package/dist/{chunk-FDROMD5U.js → chunk-2NQ4DXLT.js} +2 -2
  9. package/dist/{chunk-INZGRNO3.js → chunk-46S63XYT.js} +10 -3
  10. package/dist/chunk-46S63XYT.js.map +1 -0
  11. package/dist/chunk-4GQ5X2WK.js +10 -0
  12. package/dist/chunk-4GQ5X2WK.js.map +1 -0
  13. package/dist/{chunk-4DUH2UHE.js → chunk-4LS7B7CK.js} +2 -2
  14. package/dist/{chunk-CXXCUD4B.js → chunk-6KPX5HYV.js} +2 -2
  15. package/dist/{chunk-6FZO4SMF.js → chunk-74ONV2GE.js} +2 -2
  16. package/dist/{chunk-ORIH4UQP.js → chunk-7KED5KUU.js} +2 -2
  17. package/dist/{chunk-Y7WZS3VB.js → chunk-A42AKCPS.js} +2 -2
  18. package/dist/{chunk-WLHXHAEV.js → chunk-CERHTEML.js} +2 -2
  19. package/dist/{chunk-2JXPSUCK.js → chunk-DTBEXYYC.js} +2 -2
  20. package/dist/{chunk-JCIEWEQC.js → chunk-E5LIZKJT.js} +2 -2
  21. package/dist/{chunk-R6PUPQUI.js → chunk-FQHAHZBR.js} +2 -2
  22. package/dist/{chunk-HH2RZCH6.js → chunk-FZMY6NWJ.js} +2 -2
  23. package/dist/{chunk-5LQGSI6N.js → chunk-GBTH55AM.js} +2 -2
  24. package/dist/{chunk-KTBGRGB7.js → chunk-GYUTG5R2.js} +2 -2
  25. package/dist/{chunk-NAYUAF7O.js → chunk-H3UH7F5S.js} +2 -2
  26. package/dist/{chunk-AQMWZQ2P.js → chunk-H4NCK6RE.js} +2 -2
  27. package/dist/{chunk-LOIVX5IV.js → chunk-J5OOZDFF.js} +2 -2
  28. package/dist/{chunk-BIIINOXE.js → chunk-JRAHTS5O.js} +2 -2
  29. package/dist/{chunk-2Q2ZZTUW.js → chunk-KDQHOND7.js} +2 -2
  30. package/dist/{chunk-G2A5PWIR.js → chunk-NHUVAE4Z.js} +2 -2
  31. package/dist/{chunk-NOVLEZPR.js → chunk-NW2SQ6QW.js} +2 -2
  32. package/dist/chunk-OD6N2ATZ.js +45 -0
  33. package/dist/chunk-OD6N2ATZ.js.map +1 -0
  34. package/dist/{chunk-DZPDZGM7.js → chunk-OFDVE64G.js} +2 -2
  35. package/dist/{chunk-V3PBT4XB.js → chunk-P53KSCPE.js} +2 -2
  36. package/dist/{chunk-2OAPH7JN.js → chunk-PWFDYIXV.js} +2 -2
  37. package/dist/{chunk-HYQLSAEO.js → chunk-TAQOBBF7.js} +2 -2
  38. package/dist/{chunk-DYK3SUIZ.js → chunk-TKQ2PQDW.js} +2 -2
  39. package/dist/{chunk-RUC577P7.js → chunk-UXVYCPFL.js} +2 -2
  40. package/dist/{chunk-CCFFHU7V.js → chunk-VISNFHPM.js} +2 -2
  41. package/dist/{chunk-YS5YVHK5.js → chunk-WHZ4ALRI.js} +2 -2
  42. package/dist/{chunk-CI4PGKUI.js → chunk-WICFKWEZ.js} +2 -2
  43. package/dist/{chunk-BHZNDYU3.js → chunk-WNX4XCL6.js} +22 -12
  44. package/dist/chunk-WNX4XCL6.js.map +1 -0
  45. package/dist/{chunk-O2DNGRM7.js → chunk-WOKDS6AK.js} +2 -2
  46. package/dist/{chunk-PBT76UXS.js → chunk-X2ACXB2U.js} +2 -2
  47. package/dist/{chunk-KPWHWNZH.js → chunk-XWSCKTPG.js} +2 -2
  48. package/dist/{chunk-M3X7JONW.js → chunk-ZKLVP4JE.js} +2 -2
  49. package/dist/composed-chart.js +3 -2
  50. package/dist/coxcomb-chart.js +3 -2
  51. package/dist/create-server-chart-DJQCtKVM.d.ts +17 -0
  52. package/dist/dashboard-link.d.ts +20 -0
  53. package/dist/dashboard-link.js +27 -0
  54. package/dist/dashboard-link.js.map +1 -0
  55. package/dist/dashboard-markup-_EoDs-s-.d.ts +21 -0
  56. package/dist/dashboard.d.ts +22 -0
  57. package/dist/dashboard.js +18 -0
  58. package/dist/dashboard.js.map +1 -0
  59. package/dist/donut-chart.js +3 -2
  60. package/dist/funnel-chart.js +3 -2
  61. package/dist/gauge-arc.js +3 -2
  62. package/dist/heatmap-chart.js +3 -2
  63. package/dist/index.js +35 -34
  64. package/dist/index.js.map +1 -1
  65. package/dist/kpi-card.js +3 -2
  66. package/dist/line-chart.js +3 -2
  67. package/dist/meter-chart.js +3 -2
  68. package/dist/orbit-chart.js +3 -2
  69. package/dist/polar-bar-chart.js +3 -2
  70. package/dist/pyramid-chart.js +3 -2
  71. package/dist/radar-chart.js +3 -2
  72. package/dist/radial-arc-group.js +3 -2
  73. package/dist/radial-rings.js +3 -2
  74. package/dist/range-band-chart.js +3 -2
  75. package/dist/sankey-chart.js +3 -2
  76. package/dist/scatter-chart.js +3 -2
  77. package/dist/server/activity-grid.d.ts +9 -2
  78. package/dist/server/activity-grid.js +1 -1
  79. package/dist/server/area-chart.d.ts +9 -2
  80. package/dist/server/area-chart.js +1 -1
  81. package/dist/server/bar-chart.d.ts +9 -2
  82. package/dist/server/bar-chart.js +1 -1
  83. package/dist/server/bubble-chart.d.ts +9 -2
  84. package/dist/server/bubble-chart.js +1 -1
  85. package/dist/server/bullet-chart.d.ts +9 -2
  86. package/dist/server/bullet-chart.js +1 -1
  87. package/dist/server/candlestick-chart.d.ts +9 -2
  88. package/dist/server/candlestick-chart.js +1 -1
  89. package/dist/server/chord-ring.d.ts +9 -2
  90. package/dist/server/chord-ring.js +1 -1
  91. package/dist/server/composed-chart.d.ts +9 -2
  92. package/dist/server/composed-chart.js +1 -1
  93. package/dist/server/coxcomb-chart.d.ts +9 -2
  94. package/dist/server/coxcomb-chart.js +1 -1
  95. package/dist/server/dashboard.d.ts +15 -0
  96. package/dist/server/dashboard.js +15 -0
  97. package/dist/server/dashboard.js.map +1 -0
  98. package/dist/server/donut-chart.d.ts +9 -2
  99. package/dist/server/donut-chart.js +1 -1
  100. package/dist/server/funnel-chart.d.ts +9 -2
  101. package/dist/server/funnel-chart.js +1 -1
  102. package/dist/server/gauge-arc.d.ts +9 -2
  103. package/dist/server/gauge-arc.js +1 -1
  104. package/dist/server/heatmap-chart.d.ts +9 -2
  105. package/dist/server/heatmap-chart.js +1 -1
  106. package/dist/server/kpi-card.d.ts +9 -2
  107. package/dist/server/kpi-card.js +1 -1
  108. package/dist/server/line-chart.d.ts +9 -2
  109. package/dist/server/line-chart.js +1 -1
  110. package/dist/server/meter-chart.d.ts +9 -2
  111. package/dist/server/meter-chart.js +1 -1
  112. package/dist/server/orbit-chart.d.ts +9 -2
  113. package/dist/server/orbit-chart.js +1 -1
  114. package/dist/server/polar-bar-chart.d.ts +9 -2
  115. package/dist/server/polar-bar-chart.js +1 -1
  116. package/dist/server/pyramid-chart.d.ts +9 -2
  117. package/dist/server/pyramid-chart.js +1 -1
  118. package/dist/server/radar-chart.d.ts +9 -2
  119. package/dist/server/radar-chart.js +1 -1
  120. package/dist/server/radial-arc-group.d.ts +9 -2
  121. package/dist/server/radial-arc-group.js +1 -1
  122. package/dist/server/radial-rings.d.ts +9 -2
  123. package/dist/server/radial-rings.js +1 -1
  124. package/dist/server/range-band-chart.d.ts +9 -2
  125. package/dist/server/range-band-chart.js +1 -1
  126. package/dist/server/sankey-chart.d.ts +9 -2
  127. package/dist/server/sankey-chart.js +1 -1
  128. package/dist/server/scatter-chart.d.ts +9 -2
  129. package/dist/server/scatter-chart.js +1 -1
  130. package/dist/server/sparkline-rows.d.ts +9 -2
  131. package/dist/server/sparkline-rows.js +1 -1
  132. package/dist/server/stacked-bar-chart.d.ts +9 -2
  133. package/dist/server/stacked-bar-chart.js +1 -1
  134. package/dist/server/step-chart.d.ts +9 -2
  135. package/dist/server/step-chart.js +1 -1
  136. package/dist/server/stream-chart.d.ts +9 -2
  137. package/dist/server/stream-chart.js +1 -1
  138. package/dist/server/treemap-chart.d.ts +9 -2
  139. package/dist/server/treemap-chart.js +1 -1
  140. package/dist/server/volvelle-chart.d.ts +9 -2
  141. package/dist/server/volvelle-chart.js +1 -1
  142. package/dist/server/waterfall-chart.d.ts +9 -2
  143. package/dist/server/waterfall-chart.js +1 -1
  144. package/dist/server/wind-rose.d.ts +9 -2
  145. package/dist/server/wind-rose.js +1 -1
  146. package/dist/sparkline-rows.js +3 -2
  147. package/dist/stacked-bar-chart.js +3 -2
  148. package/dist/step-chart.js +3 -2
  149. package/dist/stream-chart.js +3 -2
  150. package/dist/treemap-chart.js +3 -2
  151. package/dist/volvelle-chart.js +3 -2
  152. package/dist/waterfall-chart.js +3 -2
  153. package/dist/wind-rose.js +3 -2
  154. package/package.json +21 -3
  155. package/dist/chunk-BHZNDYU3.js.map +0 -1
  156. package/dist/chunk-INZGRNO3.js.map +0 -1
  157. package/dist/create-server-chart-B0LbkpQP.d.ts +0 -16
  158. /package/dist/{chunk-FDROMD5U.js.map → chunk-2NQ4DXLT.js.map} +0 -0
  159. /package/dist/{chunk-4DUH2UHE.js.map → chunk-4LS7B7CK.js.map} +0 -0
  160. /package/dist/{chunk-CXXCUD4B.js.map → chunk-6KPX5HYV.js.map} +0 -0
  161. /package/dist/{chunk-6FZO4SMF.js.map → chunk-74ONV2GE.js.map} +0 -0
  162. /package/dist/{chunk-ORIH4UQP.js.map → chunk-7KED5KUU.js.map} +0 -0
  163. /package/dist/{chunk-Y7WZS3VB.js.map → chunk-A42AKCPS.js.map} +0 -0
  164. /package/dist/{chunk-WLHXHAEV.js.map → chunk-CERHTEML.js.map} +0 -0
  165. /package/dist/{chunk-2JXPSUCK.js.map → chunk-DTBEXYYC.js.map} +0 -0
  166. /package/dist/{chunk-JCIEWEQC.js.map → chunk-E5LIZKJT.js.map} +0 -0
  167. /package/dist/{chunk-R6PUPQUI.js.map → chunk-FQHAHZBR.js.map} +0 -0
  168. /package/dist/{chunk-HH2RZCH6.js.map → chunk-FZMY6NWJ.js.map} +0 -0
  169. /package/dist/{chunk-5LQGSI6N.js.map → chunk-GBTH55AM.js.map} +0 -0
  170. /package/dist/{chunk-KTBGRGB7.js.map → chunk-GYUTG5R2.js.map} +0 -0
  171. /package/dist/{chunk-NAYUAF7O.js.map → chunk-H3UH7F5S.js.map} +0 -0
  172. /package/dist/{chunk-AQMWZQ2P.js.map → chunk-H4NCK6RE.js.map} +0 -0
  173. /package/dist/{chunk-LOIVX5IV.js.map → chunk-J5OOZDFF.js.map} +0 -0
  174. /package/dist/{chunk-BIIINOXE.js.map → chunk-JRAHTS5O.js.map} +0 -0
  175. /package/dist/{chunk-2Q2ZZTUW.js.map → chunk-KDQHOND7.js.map} +0 -0
  176. /package/dist/{chunk-G2A5PWIR.js.map → chunk-NHUVAE4Z.js.map} +0 -0
  177. /package/dist/{chunk-NOVLEZPR.js.map → chunk-NW2SQ6QW.js.map} +0 -0
  178. /package/dist/{chunk-DZPDZGM7.js.map → chunk-OFDVE64G.js.map} +0 -0
  179. /package/dist/{chunk-V3PBT4XB.js.map → chunk-P53KSCPE.js.map} +0 -0
  180. /package/dist/{chunk-2OAPH7JN.js.map → chunk-PWFDYIXV.js.map} +0 -0
  181. /package/dist/{chunk-HYQLSAEO.js.map → chunk-TAQOBBF7.js.map} +0 -0
  182. /package/dist/{chunk-DYK3SUIZ.js.map → chunk-TKQ2PQDW.js.map} +0 -0
  183. /package/dist/{chunk-RUC577P7.js.map → chunk-UXVYCPFL.js.map} +0 -0
  184. /package/dist/{chunk-CCFFHU7V.js.map → chunk-VISNFHPM.js.map} +0 -0
  185. /package/dist/{chunk-YS5YVHK5.js.map → chunk-WHZ4ALRI.js.map} +0 -0
  186. /package/dist/{chunk-CI4PGKUI.js.map → chunk-WICFKWEZ.js.map} +0 -0
  187. /package/dist/{chunk-O2DNGRM7.js.map → chunk-WOKDS6AK.js.map} +0 -0
  188. /package/dist/{chunk-PBT76UXS.js.map → chunk-X2ACXB2U.js.map} +0 -0
  189. /package/dist/{chunk-KPWHWNZH.js.map → chunk-XWSCKTPG.js.map} +0 -0
  190. /package/dist/{chunk-M3X7JONW.js.map → chunk-ZKLVP4JE.js.map} +0 -0
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  import {
3
3
  ActivityGrid
4
- } from "./chunk-PBT76UXS.js";
5
- import "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-X2ACXB2U.js";
5
+ import "./chunk-WNX4XCL6.js";
6
+ import "./chunk-4GQ5X2WK.js";
6
7
  export {
7
8
  ActivityGrid
8
9
  };
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  import {
3
3
  AreaChart
4
- } from "./chunk-ORIH4UQP.js";
5
- import "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-7KED5KUU.js";
5
+ import "./chunk-WNX4XCL6.js";
6
+ import "./chunk-4GQ5X2WK.js";
6
7
  export {
7
8
  AreaChart
8
9
  };
package/dist/bar-chart.js CHANGED
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  import {
3
3
  BarChart
4
- } from "./chunk-4DUH2UHE.js";
5
- import "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-4LS7B7CK.js";
5
+ import "./chunk-WNX4XCL6.js";
6
+ import "./chunk-4GQ5X2WK.js";
6
7
  export {
7
8
  BarChart
8
9
  };
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  import {
3
3
  BubbleChart
4
- } from "./chunk-6FZO4SMF.js";
5
- import "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-74ONV2GE.js";
5
+ import "./chunk-WNX4XCL6.js";
6
+ import "./chunk-4GQ5X2WK.js";
6
7
  export {
7
8
  BubbleChart
8
9
  };
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  import {
3
3
  BulletChart
4
- } from "./chunk-O2DNGRM7.js";
5
- import "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WOKDS6AK.js";
5
+ import "./chunk-WNX4XCL6.js";
6
+ import "./chunk-4GQ5X2WK.js";
6
7
  export {
7
8
  BulletChart
8
9
  };
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  import {
3
3
  CandlestickChart
4
- } from "./chunk-KPWHWNZH.js";
5
- import "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-XWSCKTPG.js";
5
+ import "./chunk-WNX4XCL6.js";
6
+ import "./chunk-4GQ5X2WK.js";
6
7
  export {
7
8
  CandlestickChart
8
9
  };
@@ -1,8 +1,9 @@
1
1
  'use client';
2
2
  import {
3
3
  ChordRing
4
- } from "./chunk-2OAPH7JN.js";
5
- import "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-PWFDYIXV.js";
5
+ import "./chunk-WNX4XCL6.js";
6
+ import "./chunk-4GQ5X2WK.js";
6
7
  export {
7
8
  ChordRing
8
9
  };
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/step-chart.tsx
7
7
  import { stepChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var StepChart = createClientChart(stepChart);
10
10
  export {
11
11
  StepChart
12
12
  };
13
- //# sourceMappingURL=chunk-FDROMD5U.js.map
13
+ //# sourceMappingURL=chunk-2NQ4DXLT.js.map
@@ -1,4 +1,5 @@
1
1
  // src/server/create-server-chart.tsx
2
+ import { diagnose, inCell, instanceId } from "@silverpoint/core";
2
3
  import { renderChart } from "@silverpoint/grounds";
3
4
 
4
5
  // src/chart-svg.tsx
@@ -12,6 +13,7 @@ function Path({ path }) {
12
13
  "data-role": path.role,
13
14
  "data-paint": path.paint,
14
15
  "data-dash": path.dash ?? void 0,
16
+ "data-weight": path.weight ?? void 0,
15
17
  fill: path.fill ?? void 0
16
18
  }
17
19
  );
@@ -86,8 +88,13 @@ function ChartFrame({ rendered, className, rootProps, rootRef, overlay }) {
86
88
  // src/server/create-server-chart.tsx
87
89
  import { jsx as jsx3 } from "react/jsx-runtime";
88
90
  function createServerChart(recipe) {
89
- function Chart(props) {
90
- const rendered = renderChart(recipe, props, { id: props.id });
91
+ function Chart({ dashboardCell, ...own }) {
92
+ const { props, width } = inCell(own, dashboardCell, recipe);
93
+ if (process.env.NODE_ENV !== "production") {
94
+ if (props.id === void 0) diagnose("SP002", recipe.name, { property: "id", message: "A server chart outside a Dashboard needs an `id`; a fixed one is used, which two such charts on a page would share." });
95
+ if (width === void 0) diagnose("SP003", recipe.name, { property: "width", message: "A server chart cannot be measured: pass `width`, or place it in a Dashboard." });
96
+ }
97
+ const rendered = renderChart(recipe, props, { id: props.id ?? instanceId(recipe.name, "server"), width });
91
98
  return /* @__PURE__ */ jsx3(ChartFrame, { rendered, className: props.className });
92
99
  }
93
100
  Chart.displayName = recipe.name;
@@ -97,4 +104,4 @@ function createServerChart(recipe) {
97
104
  export {
98
105
  createServerChart
99
106
  };
100
- //# sourceMappingURL=chunk-INZGRNO3.js.map
107
+ //# sourceMappingURL=chunk-46S63XYT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/server/create-server-chart.tsx","../src/chart-svg.tsx","../src/chart-frame.tsx"],"sourcesContent":["import { diagnose, inCell, instanceId, type ChartRecipe, type CommonChartProps } from '@silverpoint/core';\nimport { renderChart } from '@silverpoint/grounds';\nimport { ChartFrame } from '../chart-frame';\nimport type { CellChartProps } from '../dashboard-markup';\n\n/**\n * Props of a server chart: pure SVG, no client JavaScript (REQ-104); interaction props do not\n * exist here. Nothing can be measured on the server and a server component has no mount position\n * to derive a unique id from (TD §6), so a chart standing alone passes `id`, `width` and `height`;\n * inside a `Dashboard` the cell supplies them (REQ-206, REQ-209).\n */\nexport type ServerChartProps<P extends CommonChartProps> = Omit<P, 'id' | 'width' | 'height'> & {\n readonly id?: string;\n readonly width?: number;\n readonly height?: number;\n readonly onActiveChange?: never;\n readonly onSelect?: never;\n};\n\n/** The server component of a recipe, for React Server Components and static rendering. */\nexport function createServerChart<P extends CommonChartProps>(recipe: ChartRecipe<P>) {\n function Chart({ dashboardCell, ...own }: ServerChartProps<P> & CellChartProps) {\n const { props, width } = inCell(own as unknown as P, dashboardCell, recipe);\n if (process.env.NODE_ENV !== 'production') {\n if (props.id === undefined) diagnose('SP002', recipe.name, { property: 'id', message: 'A server chart outside a Dashboard needs an `id`; a fixed one is used, which two such charts on a page would share.' });\n if (width === undefined) diagnose('SP003', recipe.name, { property: 'width', message: 'A server chart cannot be measured: pass `width`, or place it in a Dashboard.' });\n }\n const rendered = renderChart(recipe, props, { id: props.id ?? instanceId(recipe.name, 'server'), width });\n return <ChartFrame rendered={rendered} className={props.className} />;\n }\n Chart.displayName = recipe.name;\n return Chart;\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} />\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A,MAEJ;AAAA,wBAAAD,KAAC,YAAS,MAAM,SAAS,MAAM;AAAA,QAC9B;AAAA,QACA,SAAS,cAAc,UACtB,gBAAAA,KAAC,SAAM,OAAO,SAAS,OAAO,IAAI,SAAS,IAAI,OAAO,YAAY,SAAS,WAAW;AAAA;AAAA;AAAA,EAE1F;AAEJ;;;AFxCW,gBAAAE,YAAA;AARJ,SAAS,kBAA8C,QAAwB;AACpF,WAAS,MAAM,EAAE,eAAe,GAAG,IAAI,GAAyC;AAC9E,UAAM,EAAE,OAAO,MAAM,IAAI,OAAO,KAAqB,eAAe,MAAM;AAC1E,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAI,MAAM,OAAO,OAAW,UAAS,SAAS,OAAO,MAAM,EAAE,UAAU,MAAM,SAAS,sHAAsH,CAAC;AAC7M,UAAI,UAAU,OAAW,UAAS,SAAS,OAAO,MAAM,EAAE,UAAU,SAAS,SAAS,+EAA+E,CAAC;AAAA,IACxK;AACA,UAAM,WAAW,YAAY,QAAQ,OAAO,EAAE,IAAI,MAAM,MAAM,WAAW,OAAO,MAAM,QAAQ,GAAG,MAAM,CAAC;AACxG,WAAO,gBAAAA,KAAC,cAAW,UAAoB,WAAW,MAAM,WAAW;AAAA,EACrE;AACA,QAAM,cAAc,OAAO;AAC3B,SAAO;AACT;","names":["jsx","jsxs","jsx"]}
@@ -0,0 +1,10 @@
1
+ 'use client';
2
+
3
+ // src/link-context.ts
4
+ import { createContext } from "react";
5
+ var DashboardLinkContext = createContext(null);
6
+
7
+ export {
8
+ DashboardLinkContext
9
+ };
10
+ //# sourceMappingURL=chunk-4GQ5X2WK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/link-context.ts"],"sourcesContent":["import type { LinkState } from '@silverpoint/core';\nimport { createContext } from 'react';\n\n/** A linked dashboard's one reactive value, and how a chart sets it (TD DD-016, REQ-216). */\nexport interface DashboardLinkValue {\n readonly key: string;\n readonly state: LinkState | null;\n set(next: LinkState | null): void;\n}\n\nexport const DashboardLinkContext = createContext<DashboardLinkValue | null>(null);\n"],"mappings":";;;AACA,SAAS,qBAAqB;AASvB,IAAM,uBAAuB,cAAyC,IAAI;","names":[]}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-4LS7B7CK.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/line-chart.tsx
7
7
  import { lineChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var LineChart = createClientChart(lineChart);
10
10
  export {
11
11
  LineChart
12
12
  };
13
- //# sourceMappingURL=chunk-CXXCUD4B.js.map
13
+ //# sourceMappingURL=chunk-6KPX5HYV.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/bubble-chart.tsx
7
7
  import { bubbleChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var BubbleChart = createClientChart(bubbleChart);
10
10
  export {
11
11
  BubbleChart
12
12
  };
13
- //# sourceMappingURL=chunk-6FZO4SMF.js.map
13
+ //# sourceMappingURL=chunk-74ONV2GE.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/area-chart.tsx
7
7
  import { areaChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var AreaChart = createClientChart(areaChart);
10
10
  export {
11
11
  AreaChart
12
12
  };
13
- //# sourceMappingURL=chunk-ORIH4UQP.js.map
13
+ //# sourceMappingURL=chunk-7KED5KUU.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/composed-chart.tsx
7
7
  import { composedChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var ComposedChart = createClientChart(composedChart);
10
10
  export {
11
11
  ComposedChart
12
12
  };
13
- //# sourceMappingURL=chunk-Y7WZS3VB.js.map
13
+ //# sourceMappingURL=chunk-A42AKCPS.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-CERHTEML.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/stacked-bar-chart.tsx
7
7
  import { stackedBarChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var StackedBarChart = createClientChart(stackedBarChart);
10
10
  export {
11
11
  StackedBarChart
12
12
  };
13
- //# sourceMappingURL=chunk-2JXPSUCK.js.map
13
+ //# sourceMappingURL=chunk-DTBEXYYC.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-E5LIZKJT.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/funnel-chart.tsx
7
7
  import { funnelChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var FunnelChart = createClientChart(funnelChart);
10
10
  export {
11
11
  FunnelChart
12
12
  };
13
- //# sourceMappingURL=chunk-R6PUPQUI.js.map
13
+ //# sourceMappingURL=chunk-FQHAHZBR.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-FZMY6NWJ.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-GBTH55AM.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-GYUTG5R2.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/orbit-chart.tsx
7
7
  import { orbitChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var OrbitChart = createClientChart(orbitChart);
10
10
  export {
11
11
  OrbitChart
12
12
  };
13
- //# sourceMappingURL=chunk-NAYUAF7O.js.map
13
+ //# sourceMappingURL=chunk-H3UH7F5S.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-H4NCK6RE.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/meter-chart.tsx
7
7
  import { meterChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var MeterChart = createClientChart(meterChart);
10
10
  export {
11
11
  MeterChart
12
12
  };
13
- //# sourceMappingURL=chunk-LOIVX5IV.js.map
13
+ //# sourceMappingURL=chunk-J5OOZDFF.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/stream-chart.tsx
7
7
  import { streamChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var StreamChart = createClientChart(streamChart);
10
10
  export {
11
11
  StreamChart
12
12
  };
13
- //# sourceMappingURL=chunk-BIIINOXE.js.map
13
+ //# sourceMappingURL=chunk-JRAHTS5O.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-KDQHOND7.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/coxcomb-chart.tsx
7
7
  import { coxcombChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var CoxcombChart = createClientChart(coxcombChart);
10
10
  export {
11
11
  CoxcombChart
12
12
  };
13
- //# sourceMappingURL=chunk-G2A5PWIR.js.map
13
+ //# sourceMappingURL=chunk-NHUVAE4Z.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-NW2SQ6QW.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,OAA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
@@ -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-OFDVE64G.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/sankey-chart.tsx
7
7
  import { sankeyChart } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var SankeyChart = createClientChart(sankeyChart);
10
10
  export {
11
11
  SankeyChart
12
12
  };
13
- //# sourceMappingURL=chunk-V3PBT4XB.js.map
13
+ //# sourceMappingURL=chunk-P53KSCPE.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/chord-ring.tsx
7
7
  import { chordRing } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var ChordRing = createClientChart(chordRing);
10
10
  export {
11
11
  ChordRing
12
12
  };
13
- //# sourceMappingURL=chunk-2OAPH7JN.js.map
13
+ //# sourceMappingURL=chunk-PWFDYIXV.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-TAQOBBF7.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-TKQ2PQDW.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.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-UXVYCPFL.js.map
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  createClientChart
4
- } from "./chunk-BHZNDYU3.js";
4
+ } from "./chunk-WNX4XCL6.js";
5
5
 
6
6
  // src/kpi-card.tsx
7
7
  import { kpiCard } from "@silverpoint/core";
@@ -10,4 +10,4 @@ var KpiCard = createClientChart(kpiCard);
10
10
  export {
11
11
  KpiCard
12
12
  };
13
- //# sourceMappingURL=chunk-CCFFHU7V.js.map
13
+ //# sourceMappingURL=chunk-VISNFHPM.js.map