@nocoo/basalt 2.0.2 → 2.1.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 (300) hide show
  1. package/README.md +134 -15
  2. package/ai/COMPATIBILITY.md +180 -0
  3. package/ai/INTEGRATION.md +1760 -0
  4. package/ai/RECIPES.md +161 -0
  5. package/ai/USAGE.md +99 -0
  6. package/ai/registry.json +38099 -0
  7. package/ai/sources.json +10 -0
  8. package/dist/assets/brand-mark.d.ts +1 -0
  9. package/dist/assets/brand-mark.js +7 -0
  10. package/dist/assets/brand-mark.js.map +1 -0
  11. package/dist/charts/area.d.ts +58 -5
  12. package/dist/charts/area.js +20 -12
  13. package/dist/charts/area.js.map +1 -1
  14. package/dist/charts/bar.d.ts +54 -5
  15. package/dist/charts/bar.js +16 -10
  16. package/dist/charts/bar.js.map +1 -1
  17. package/dist/charts/bullet.d.ts +18 -1
  18. package/dist/charts/bullet.js +6 -3
  19. package/dist/charts/bullet.js.map +1 -1
  20. package/dist/charts/charts.d.ts +58 -5
  21. package/dist/charts/charts.js +13 -2
  22. package/dist/charts/charts.js.map +1 -1
  23. package/dist/charts/config.d.ts +7 -0
  24. package/dist/charts/config.js +5 -1
  25. package/dist/charts/config.js.map +1 -1
  26. package/dist/charts/custom-chart.d.ts +58 -5
  27. package/dist/charts/custom-chart.js +13 -2
  28. package/dist/charts/custom-chart.js.map +1 -1
  29. package/dist/charts/donut.d.ts +18 -1
  30. package/dist/charts/donut.js +6 -3
  31. package/dist/charts/donut.js.map +1 -1
  32. package/dist/charts/frame.d.ts +40 -3
  33. package/dist/charts/frame.js +55 -28
  34. package/dist/charts/frame.js.map +1 -1
  35. package/dist/charts/funnel.d.ts +18 -1
  36. package/dist/charts/funnel.js +5 -1
  37. package/dist/charts/funnel.js.map +1 -1
  38. package/dist/charts/gauge.d.ts +18 -1
  39. package/dist/charts/gauge.js +38 -20
  40. package/dist/charts/gauge.js.map +1 -1
  41. package/dist/charts/grouped-bar.d.ts +54 -5
  42. package/dist/charts/grouped-bar.js +16 -10
  43. package/dist/charts/grouped-bar.js.map +1 -1
  44. package/dist/charts/heatmap-calendar.d.ts +61 -0
  45. package/dist/charts/heatmap-calendar.js +287 -96
  46. package/dist/charts/heatmap-calendar.js.map +1 -1
  47. package/dist/charts/heatmap-matrix.d.ts +99 -0
  48. package/dist/charts/heatmap-matrix.js +249 -0
  49. package/dist/charts/heatmap-matrix.js.map +1 -0
  50. package/dist/charts/line.d.ts +66 -5
  51. package/dist/charts/line.js +37 -30
  52. package/dist/charts/line.js.map +1 -1
  53. package/dist/charts/palette.d.ts +1 -0
  54. package/dist/charts/palette.js +7 -1
  55. package/dist/charts/palette.js.map +1 -1
  56. package/dist/charts/radar.d.ts +18 -1
  57. package/dist/charts/radar.js +26 -19
  58. package/dist/charts/radar.js.map +1 -1
  59. package/dist/charts/sankey.d.ts +18 -1
  60. package/dist/charts/sankey.js +4 -1
  61. package/dist/charts/sankey.js.map +1 -1
  62. package/dist/charts/series.d.ts +5 -7
  63. package/dist/charts/series.js.map +1 -1
  64. package/dist/charts/slot-bar.d.ts +38 -6
  65. package/dist/charts/slot-bar.js +5 -2
  66. package/dist/charts/slot-bar.js.map +1 -1
  67. package/dist/charts/sparkline.d.ts +35 -5
  68. package/dist/charts/sparkline.js +22 -18
  69. package/dist/charts/sparkline.js.map +1 -1
  70. package/dist/charts/stacked-bar.d.ts +58 -5
  71. package/dist/charts/stacked-bar.js +19 -12
  72. package/dist/charts/stacked-bar.js.map +1 -1
  73. package/dist/charts/stat-card.d.ts +51 -1
  74. package/dist/charts/stat-card.js +66 -39
  75. package/dist/charts/stat-card.js.map +1 -1
  76. package/dist/charts/timeline.d.ts +3 -0
  77. package/dist/charts/timeline.js +4 -3
  78. package/dist/charts/timeline.js.map +1 -1
  79. package/dist/charts/timeseries.d.ts +58 -5
  80. package/dist/charts/timeseries.js +13 -2
  81. package/dist/charts/timeseries.js.map +1 -1
  82. package/dist/charts/tooltip.d.ts +57 -0
  83. package/dist/charts/tooltip.js +119 -2
  84. package/dist/charts/tooltip.js.map +1 -1
  85. package/dist/components/accordion.d.ts +117 -2
  86. package/dist/components/accordion.js +20 -13
  87. package/dist/components/accordion.js.map +1 -1
  88. package/dist/components/alert-dialog.d.ts +131 -13
  89. package/dist/components/alert-dialog.js +13 -10
  90. package/dist/components/alert-dialog.js.map +1 -1
  91. package/dist/components/app-header.js +18 -17
  92. package/dist/components/app-header.js.map +1 -1
  93. package/dist/components/app-shell.js +15 -14
  94. package/dist/components/app-shell.js.map +1 -1
  95. package/dist/components/autocomplete.d.ts +4 -0
  96. package/dist/components/autocomplete.js.map +1 -1
  97. package/dist/components/avatar.d.ts +76 -3
  98. package/dist/components/avatar.js.map +1 -1
  99. package/dist/components/badge.d.ts +15 -1
  100. package/dist/components/badge.js +17 -16
  101. package/dist/components/badge.js.map +1 -1
  102. package/dist/components/banner.d.ts +88 -2
  103. package/dist/components/banner.js +41 -40
  104. package/dist/components/banner.js.map +1 -1
  105. package/dist/components/basalt-mark.js +14 -8
  106. package/dist/components/basalt-mark.js.map +1 -1
  107. package/dist/components/battery-meter.d.ts +10 -0
  108. package/dist/components/battery-meter.js +56 -0
  109. package/dist/components/battery-meter.js.map +1 -0
  110. package/dist/components/breadcrumbs.d.ts +27 -7
  111. package/dist/components/breadcrumbs.js +21 -20
  112. package/dist/components/breadcrumbs.js.map +1 -1
  113. package/dist/components/button.d.ts +48 -2
  114. package/dist/components/button.js +87 -36
  115. package/dist/components/button.js.map +1 -1
  116. package/dist/components/chat-bubble.d.ts +24 -0
  117. package/dist/components/chat-bubble.js +26 -0
  118. package/dist/components/chat-bubble.js.map +1 -0
  119. package/dist/components/chat-composer.d.ts +45 -0
  120. package/dist/components/chat-composer.js +74 -0
  121. package/dist/components/chat-composer.js.map +1 -0
  122. package/dist/components/chat-header.d.ts +25 -0
  123. package/dist/components/chat-header.js +34 -0
  124. package/dist/components/chat-header.js.map +1 -0
  125. package/dist/components/chat-inbox.d.ts +33 -0
  126. package/dist/components/chat-inbox.js +44 -0
  127. package/dist/components/chat-inbox.js.map +1 -0
  128. package/dist/components/checkbox.js +84 -53
  129. package/dist/components/checkbox.js.map +1 -1
  130. package/dist/components/clipboard-text.d.ts +13 -2
  131. package/dist/components/clipboard-text.js +4 -4
  132. package/dist/components/clipboard-text.js.map +1 -1
  133. package/dist/components/collapsible.d.ts +58 -15
  134. package/dist/components/collapsible.js.map +1 -1
  135. package/dist/components/command-palette.d.ts +151 -61
  136. package/dist/components/command-palette.js.map +1 -1
  137. package/dist/components/confirm-dialog.d.ts +1 -1
  138. package/dist/components/confirm-dialog.js +6 -4
  139. package/dist/components/confirm-dialog.js.map +1 -1
  140. package/dist/components/context-menu.d.ts +210 -2
  141. package/dist/components/context-menu.js +7 -4
  142. package/dist/components/context-menu.js.map +1 -1
  143. package/dist/components/data-table.d.ts +40 -2
  144. package/dist/components/data-table.js +168 -120
  145. package/dist/components/data-table.js.map +1 -1
  146. package/dist/components/date-picker.d.ts +53 -2
  147. package/dist/components/date-picker.js +387 -219
  148. package/dist/components/date-picker.js.map +1 -1
  149. package/dist/components/delete-resource.d.ts +7 -1
  150. package/dist/components/delete-resource.js +22 -18
  151. package/dist/components/delete-resource.js.map +1 -1
  152. package/dist/components/description-list.js +16 -15
  153. package/dist/components/description-list.js.map +1 -1
  154. package/dist/components/dialog.d.ts +141 -12
  155. package/dist/components/dialog.js +43 -39
  156. package/dist/components/dialog.js.map +1 -1
  157. package/dist/components/dock.d.ts +39 -0
  158. package/dist/components/dock.js +97 -0
  159. package/dist/components/dock.js.map +1 -0
  160. package/dist/components/dropdown-menu.d.ts +229 -15
  161. package/dist/components/dropdown-menu.js +9 -6
  162. package/dist/components/dropdown-menu.js.map +1 -1
  163. package/dist/components/editable-nav-item.d.ts +33 -0
  164. package/dist/components/editable-nav-item.js +90 -0
  165. package/dist/components/editable-nav-item.js.map +1 -0
  166. package/dist/components/empty.d.ts +22 -2
  167. package/dist/components/empty.js +22 -13
  168. package/dist/components/empty.js.map +1 -1
  169. package/dist/components/fab.d.ts +23 -0
  170. package/dist/components/fab.js +25 -0
  171. package/dist/components/fab.js.map +1 -0
  172. package/dist/components/field.js +31 -30
  173. package/dist/components/field.js.map +1 -1
  174. package/dist/components/file-dropzone.d.ts +37 -0
  175. package/dist/components/file-dropzone.js +103 -0
  176. package/dist/components/file-dropzone.js.map +1 -0
  177. package/dist/components/filter-bar.d.ts +34 -0
  178. package/dist/components/filter-bar.js +52 -0
  179. package/dist/components/filter-bar.js.map +1 -0
  180. package/dist/components/flow.js +19 -18
  181. package/dist/components/flow.js.map +1 -1
  182. package/dist/components/grid.d.ts +3 -1
  183. package/dist/components/grid.js.map +1 -1
  184. package/dist/components/hover-card.d.ts +111 -1
  185. package/dist/components/hover-card.js +9 -6
  186. package/dist/components/hover-card.js.map +1 -1
  187. package/dist/components/icon-picker.d.ts +34 -0
  188. package/dist/components/icon-picker.js +77 -0
  189. package/dist/components/icon-picker.js.map +1 -0
  190. package/dist/components/inline-editable.d.ts +46 -0
  191. package/dist/components/inline-editable.js +124 -0
  192. package/dist/components/inline-editable.js.map +1 -0
  193. package/dist/components/input-area.js +3 -3
  194. package/dist/components/input-group.js +7 -7
  195. package/dist/components/input.js +3 -3
  196. package/dist/components/label.js +18 -17
  197. package/dist/components/label.js.map +1 -1
  198. package/dist/components/layer-card.d.ts +10 -2
  199. package/dist/components/layer-card.js +71 -68
  200. package/dist/components/layer-card.js.map +1 -1
  201. package/dist/components/loader.d.ts +10 -2
  202. package/dist/components/loader.js.map +1 -1
  203. package/dist/components/menu-bar.d.ts +174 -6
  204. package/dist/components/menu-bar.js +33 -29
  205. package/dist/components/menu-bar.js.map +1 -1
  206. package/dist/components/meter.d.ts +27 -2
  207. package/dist/components/meter.js.map +1 -1
  208. package/dist/components/multi-select.d.ts +64 -0
  209. package/dist/components/multi-select.js +218 -0
  210. package/dist/components/multi-select.js.map +1 -0
  211. package/dist/components/navigation-menu.d.ts +88 -5
  212. package/dist/components/navigation-menu.js.map +1 -1
  213. package/dist/components/overlay.js +6 -5
  214. package/dist/components/overlay.js.map +1 -1
  215. package/dist/components/page-header.js +23 -21
  216. package/dist/components/page-header.js.map +1 -1
  217. package/dist/components/pagination.js +7 -7
  218. package/dist/components/popover.d.ts +136 -16
  219. package/dist/components/popover.js +32 -28
  220. package/dist/components/popover.js.map +1 -1
  221. package/dist/components/radio.js +38 -37
  222. package/dist/components/radio.js.map +1 -1
  223. package/dist/components/resource-list.d.ts +26 -1
  224. package/dist/components/resource-list.js +28 -15
  225. package/dist/components/resource-list.js.map +1 -1
  226. package/dist/components/responsive-master-detail.d.ts +27 -0
  227. package/dist/components/responsive-master-detail.js +85 -0
  228. package/dist/components/responsive-master-detail.js.map +1 -0
  229. package/dist/components/section-rule.js +23 -22
  230. package/dist/components/section-rule.js.map +1 -1
  231. package/dist/components/select.d.ts +27 -3
  232. package/dist/components/select.js +11 -11
  233. package/dist/components/select.js.map +1 -1
  234. package/dist/components/sheet.d.ts +115 -11
  235. package/dist/components/sheet.js +37 -30
  236. package/dist/components/sheet.js.map +1 -1
  237. package/dist/components/sidebar.d.ts +109 -17
  238. package/dist/components/sidebar.js +109 -108
  239. package/dist/components/sidebar.js.map +1 -1
  240. package/dist/components/skeleton-line.d.ts +22 -2
  241. package/dist/components/skeleton-line.js.map +1 -1
  242. package/dist/components/slider.d.ts +61 -1
  243. package/dist/components/slider.js +31 -15
  244. package/dist/components/slider.js.map +1 -1
  245. package/dist/components/stat-strip.js +16 -15
  246. package/dist/components/stat-strip.js.map +1 -1
  247. package/dist/components/switch.js +78 -47
  248. package/dist/components/switch.js.map +1 -1
  249. package/dist/components/table-of-contents.js +18 -17
  250. package/dist/components/table-of-contents.js.map +1 -1
  251. package/dist/components/table-pager.js +20 -19
  252. package/dist/components/table-pager.js.map +1 -1
  253. package/dist/components/table.d.ts +9 -3
  254. package/dist/components/table.js +19 -18
  255. package/dist/components/table.js.map +1 -1
  256. package/dist/components/tabs.js +29 -22
  257. package/dist/components/tabs.js.map +1 -1
  258. package/dist/components/tag-badge.d.ts +58 -0
  259. package/dist/components/tag-badge.js +72 -0
  260. package/dist/components/tag-badge.js.map +1 -0
  261. package/dist/components/tag-color-picker.d.ts +20 -0
  262. package/dist/components/tag-color-picker.js +42 -0
  263. package/dist/components/tag-color-picker.js.map +1 -0
  264. package/dist/components/text.js +17 -16
  265. package/dist/components/text.js.map +1 -1
  266. package/dist/components/toast.d.ts +173 -3
  267. package/dist/components/toast.js +1 -1
  268. package/dist/components/toast.js.map +1 -1
  269. package/dist/components/toggle-group.d.ts +88 -2
  270. package/dist/components/toggle-group.js +32 -31
  271. package/dist/components/toggle-group.js.map +1 -1
  272. package/dist/components/toggle.d.ts +35 -2
  273. package/dist/components/toggle.js +12 -11
  274. package/dist/components/toggle.js.map +1 -1
  275. package/dist/components/tooltip.d.ts +144 -6
  276. package/dist/components/tooltip.js +9 -6
  277. package/dist/components/tooltip.js.map +1 -1
  278. package/dist/components/typeahead-field.js +193 -132
  279. package/dist/components/typeahead-field.js.map +1 -1
  280. package/dist/components/upload-queue.d.ts +51 -0
  281. package/dist/components/upload-queue.js +116 -0
  282. package/dist/components/upload-queue.js.map +1 -0
  283. package/dist/providers/accent.d.ts +46 -2
  284. package/dist/providers/accent.js +358 -172
  285. package/dist/providers/accent.js.map +1 -1
  286. package/dist/providers/link.d.ts +14 -4
  287. package/dist/providers/link.js.map +1 -1
  288. package/dist/providers/theme.d.ts +38 -2
  289. package/dist/providers/theme.js +160 -27
  290. package/dist/providers/theme.js.map +1 -1
  291. package/dist/styles/base.css +83 -0
  292. package/dist/styles/standalone.css +820 -120
  293. package/dist/styles/tailwind.css +21 -7
  294. package/dist/styles/tokens.css +146 -91
  295. package/dist/utils/control-surface.d.ts +2 -1
  296. package/dist/utils/control-surface.js +4 -4
  297. package/dist/utils/control-surface.js.map +1 -1
  298. package/dist/utils/selection-indicator.js +2 -2
  299. package/dist/utils/selection-indicator.js.map +1 -1
  300. package/package.json +8 -4
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from "react";
1
2
  import type { ChartSeriesDescriptor } from "./series.js";
2
3
  export type GaugeProps = {
3
4
  value: number;
@@ -7,5 +8,21 @@ export type GaugeProps = {
7
8
  className?: string;
8
9
  hideValue?: boolean;
9
10
  valueFormatter?: (value: number) => string;
11
+ /**
12
+ * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.
13
+ * Associated with the chart via useId and aria-describedby.
14
+ */
15
+ summary?: ReactNode;
16
+ /**
17
+ * Accessible tabular or structured data alternative rendered outside the plot area.
18
+ */
19
+ dataAlternative?: ReactNode;
20
+ /**
21
+ * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.
22
+ * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.
23
+ * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.
24
+ * @default true
25
+ */
26
+ accessibilityLayer?: boolean;
10
27
  };
11
- export declare function Gauge({ value, max, series, ariaLabel, className, hideValue, valueFormatter, }: GaugeProps): import("react").JSX.Element;
28
+ export declare function Gauge({ value, max, series, ariaLabel, className, hideValue, valueFormatter, summary, dataAlternative, accessibilityLayer, }: GaugeProps): import("react").JSX.Element;
@@ -1,47 +1,65 @@
1
1
  "use client";
2
2
  import { cn as e } from "../utils/cn.js";
3
- import { CHART_COLORS as t } from "./palette.js";
4
- import { seriesColor as n } from "./config.js";
5
- import { ChartFrame as r } from "./frame.js";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { PolarAngleAxis as o, RadialBar as s, RadialBarChart as c } from "recharts";
3
+ import { chartMuted as t } from "./palette.js";
4
+ import { ANIMATION_PROPS as n, seriesColor as r } from "./config.js";
5
+ import { ChartFrame as i } from "./frame.js";
6
+ import { useId as a } from "react";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
+ import { PolarAngleAxis as c, RadialBar as l, RadialBarChart as u } from "recharts";
8
9
  //#region src/charts/gauge.tsx
9
- function l({ value: l, max: u = 100, series: d, ariaLabel: f = "Gauge", className: p, hideValue: m = !1, valueFormatter: h }) {
10
- let g = u === 0 ? 0 : Math.min(100, Math.max(0, l / u * 100)), _ = h ? h(l) : String(l);
11
- return /* @__PURE__ */ a("div", {
12
- className: e("relative h-36 w-36", p),
13
- children: [/* @__PURE__ */ i(r, {
14
- ariaLabel: f,
10
+ function d({ value: d, max: f = 100, series: p, ariaLabel: m = "Gauge", className: h, hideValue: g = !1, valueFormatter: _, summary: v, dataAlternative: y, accessibilityLayer: b }) {
11
+ let x = a(), S = f === 0 ? 0 : Math.min(100, Math.max(0, d / f * 100)), C = _ ? _(d) : String(d), w = v != null && v !== !1, T = y != null && y !== !1, E = /* @__PURE__ */ s("div", {
12
+ className: e("relative h-36 w-36", h),
13
+ children: [/* @__PURE__ */ o(i, {
14
+ ariaLabel: m,
15
15
  className: "h-full w-full",
16
16
  size: "h-full w-full",
17
- children: /* @__PURE__ */ a(c, {
17
+ accessibilityLayer: b,
18
+ children: /* @__PURE__ */ s(u, {
18
19
  cx: "50%",
19
20
  cy: "50%",
20
21
  innerRadius: "75%",
21
22
  outerRadius: "95%",
22
23
  startAngle: 90,
23
24
  endAngle: -270,
24
- data: [{ value: g }],
25
+ data: [{ value: S }],
25
26
  barSize: 12,
26
- children: [/* @__PURE__ */ i(o, {
27
+ ...w ? { "aria-describedby": x } : {},
28
+ children: [/* @__PURE__ */ o(c, {
27
29
  type: "number",
28
30
  domain: [0, 100],
29
31
  angleAxisId: 0,
30
32
  tick: !1
31
- }), /* @__PURE__ */ i(s, {
33
+ }), /* @__PURE__ */ o(l, {
32
34
  dataKey: "value",
33
35
  cornerRadius: 6,
34
- fill: n(d?.[0], 4),
35
- background: { fill: t[23] }
36
+ fill: r(p?.[0], 2),
37
+ background: { fill: t },
38
+ ...n
36
39
  })]
37
40
  })
38
- }), m ? null : /* @__PURE__ */ i("span", {
41
+ }), g ? null : /* @__PURE__ */ o("span", {
39
42
  className: "pointer-events-none absolute inset-0 flex items-center justify-center text-sm font-semibold text-basalt-foreground",
40
- children: _
43
+ children: C
41
44
  })]
42
45
  });
46
+ return !w && !T ? E : /* @__PURE__ */ s("div", {
47
+ className: "flex flex-col gap-2 min-h-0 min-w-0",
48
+ children: [
49
+ w ? /* @__PURE__ */ o("div", {
50
+ id: x,
51
+ className: "text-xs text-basalt-muted-foreground",
52
+ children: v
53
+ }) : null,
54
+ E,
55
+ T ? /* @__PURE__ */ o("div", {
56
+ className: "text-xs text-basalt-muted-foreground",
57
+ children: y
58
+ }) : null
59
+ ]
60
+ });
43
61
  }
44
62
  //#endregion
45
- export { l as Gauge };
63
+ export { d as Gauge };
46
64
 
47
65
  //# sourceMappingURL=gauge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gauge.js","names":[],"sources":["../../src/charts/gauge.tsx"],"sourcesContent":["import { PolarAngleAxis, RadialBar, RadialBarChart } from \"recharts\";\nimport { cn } from \"../utils/cn\";\nimport { seriesColor } from \"./config\";\nimport { ChartFrame } from \"./frame\";\nimport { CHART_COLORS } from \"./palette\";\nimport type { ChartSeriesDescriptor } from \"./series\";\n\nexport type GaugeProps = {\n\tvalue: number;\n\tmax?: number;\n\tseries?: ChartSeriesDescriptor[];\n\tariaLabel?: string;\n\tclassName?: string;\n\thideValue?: boolean;\n\tvalueFormatter?: (value: number) => string;\n};\n\nexport function Gauge({\n\tvalue,\n\tmax = 100,\n\tseries,\n\tariaLabel = \"Gauge\",\n\tclassName,\n\thideValue = false,\n\tvalueFormatter,\n}: GaugeProps) {\n\tconst percent = max === 0 ? 0 : Math.min(100, Math.max(0, (value / max) * 100));\n\tconst display = valueFormatter ? valueFormatter(value) : String(value);\n\treturn (\n\t\t<div className={cn(\"relative h-36 w-36\", className)}>\n\t\t\t<ChartFrame ariaLabel={ariaLabel} className=\"h-full w-full\" size=\"h-full w-full\">\n\t\t\t\t<RadialBarChart\n\t\t\t\t\tcx=\"50%\"\n\t\t\t\t\tcy=\"50%\"\n\t\t\t\t\tinnerRadius=\"75%\"\n\t\t\t\t\touterRadius=\"95%\"\n\t\t\t\t\tstartAngle={90}\n\t\t\t\t\tendAngle={-270}\n\t\t\t\t\tdata={[{ value: percent }]}\n\t\t\t\t\tbarSize={12}\n\t\t\t\t>\n\t\t\t\t\t<PolarAngleAxis type=\"number\" domain={[0, 100]} angleAxisId={0} tick={false} />\n\t\t\t\t\t<RadialBar\n\t\t\t\t\t\tdataKey=\"value\"\n\t\t\t\t\t\tcornerRadius={6}\n\t\t\t\t\t\tfill={seriesColor(series?.[0], 4)}\n\t\t\t\t\t\tbackground={{ fill: CHART_COLORS[23] }}\n\t\t\t\t\t/>\n\t\t\t\t</RadialBarChart>\n\t\t\t</ChartFrame>\n\t\t\t{hideValue ? null : (\n\t\t\t\t<span className=\"pointer-events-none absolute inset-0 flex items-center justify-center text-sm font-semibold text-basalt-foreground\">\n\t\t\t\t\t{display}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAiBA,SAAgB,EAAM,EACrB,UACA,SAAM,KACN,WACA,eAAY,SACZ,cACA,eAAY,IACZ,qBACc;CACd,IAAM,IAAU,MAAQ,IAAI,IAAI,KAAK,IAAI,KAAK,KAAK,IAAI,GAAI,IAAQ,IAAO,GAAG,CAAC,GACxE,IAAU,IAAiB,EAAe,CAAK,IAAI,OAAO,CAAK;CACrE,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,sBAAsB,CAAS;EAAlD,UAAA,CACC,kBAAC,GAAD;GAAuB;GAAW,WAAU;GAAgB,MAAK;GAChE,UAAA,kBAAC,GAAD;IACC,IAAG;IACH,IAAG;IACH,aAAY;IACZ,aAAY;IACZ,YAAY;IACZ,UAAU;IACV,MAAM,CAAC,EAAE,OAAO,EAAQ,CAAC;IACzB,SAAS;IARV,UAAA,CAUC,kBAAC,GAAD;KAAgB,MAAK;KAAS,QAAQ,CAAC,GAAG,GAAG;KAAG,aAAa;KAAG,MAAM;IAAQ,CAAA,GAC9E,kBAAC,GAAD;KACC,SAAQ;KACR,cAAc;KACd,MAAM,EAAY,IAAS,IAAI,CAAC;KAChC,YAAY,EAAE,MAAM,EAAa,IAAI;IACrC,CAAA,CACc;;EACL,CAAA,GACX,IAAY,OACZ,kBAAC,QAAD;GAAM,WAAU;GACd,UAAA;EACI,CAAA,CAEH;;AAEP"}
1
+ {"version":3,"file":"gauge.js","names":[],"sources":["../../src/charts/gauge.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useId } from \"react\";\nimport { PolarAngleAxis, RadialBar, RadialBarChart } from \"recharts\";\nimport { cn } from \"../utils/cn\";\nimport { ANIMATION_PROPS, seriesColor } from \"./config\";\nimport { ChartFrame } from \"./frame\";\nimport { chartMuted } from \"./palette\";\nimport type { ChartSeriesDescriptor } from \"./series\";\n\nexport type GaugeProps = {\n\tvalue: number;\n\tmax?: number;\n\tseries?: ChartSeriesDescriptor[];\n\tariaLabel?: string;\n\tclassName?: string;\n\thideValue?: boolean;\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function Gauge({\n\tvalue,\n\tmax = 100,\n\tseries,\n\tariaLabel = \"Gauge\",\n\tclassName,\n\thideValue = false,\n\tvalueFormatter,\n\tsummary,\n\tdataAlternative,\n\taccessibilityLayer,\n}: GaugeProps) {\n\tconst summaryId = useId();\n\tconst percent = max === 0 ? 0 : Math.min(100, Math.max(0, (value / max) * 100));\n\tconst display = valueFormatter ? valueFormatter(value) : String(value);\n\tconst hasSummary = summary !== undefined && summary !== null && summary !== false;\n\tconst hasAlternative =\n\t\tdataAlternative !== undefined && dataAlternative !== null && dataAlternative !== false;\n\n\tconst plot = (\n\t\t<div className={cn(\"relative h-36 w-36\", className)}>\n\t\t\t<ChartFrame\n\t\t\t\tariaLabel={ariaLabel}\n\t\t\t\tclassName=\"h-full w-full\"\n\t\t\t\tsize=\"h-full w-full\"\n\t\t\t\taccessibilityLayer={accessibilityLayer}\n\t\t\t>\n\t\t\t\t<RadialBarChart\n\t\t\t\t\tcx=\"50%\"\n\t\t\t\t\tcy=\"50%\"\n\t\t\t\t\tinnerRadius=\"75%\"\n\t\t\t\t\touterRadius=\"95%\"\n\t\t\t\t\tstartAngle={90}\n\t\t\t\t\tendAngle={-270}\n\t\t\t\t\tdata={[{ value: percent }]}\n\t\t\t\t\tbarSize={12}\n\t\t\t\t\t{...(hasSummary ? { \"aria-describedby\": summaryId } : {})}\n\t\t\t\t>\n\t\t\t\t\t<PolarAngleAxis type=\"number\" domain={[0, 100]} angleAxisId={0} tick={false} />\n\t\t\t\t\t<RadialBar\n\t\t\t\t\t\tdataKey=\"value\"\n\t\t\t\t\t\tcornerRadius={6}\n\t\t\t\t\t\tfill={seriesColor(series?.[0], 2)}\n\t\t\t\t\t\tbackground={{ fill: chartMuted }}\n\t\t\t\t\t\t{...ANIMATION_PROPS}\n\t\t\t\t\t/>\n\t\t\t\t</RadialBarChart>\n\t\t\t</ChartFrame>\n\t\t\t{hideValue ? null : (\n\t\t\t\t<span className=\"pointer-events-none absolute inset-0 flex items-center justify-center text-sm font-semibold text-basalt-foreground\">\n\t\t\t\t\t{display}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n\n\tif (!hasSummary && !hasAlternative) {\n\t\treturn plot;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-2 min-h-0 min-w-0\">\n\t\t\t{hasSummary ? (\n\t\t\t\t<div id={summaryId} className=\"text-xs text-basalt-muted-foreground\">\n\t\t\t\t\t{summary}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t{plot}\n\t\t\t{hasAlternative ? (\n\t\t\t\t<div className=\"text-xs text-basalt-muted-foreground\">{dataAlternative}</div>\n\t\t\t) : null}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;AAmCA,SAAgB,EAAM,EACrB,UACA,SAAM,KACN,WACA,eAAY,SACZ,cACA,eAAY,IACZ,mBACA,YACA,oBACA,yBACc;CACd,IAAM,IAAY,EAAM,GAClB,IAAU,MAAQ,IAAI,IAAI,KAAK,IAAI,KAAK,KAAK,IAAI,GAAI,IAAQ,IAAO,GAAG,CAAC,GACxE,IAAU,IAAiB,EAAe,CAAK,IAAI,OAAO,CAAK,GAC/D,IAAa,KAAqC,QAAQ,MAAY,IACtE,IACL,KAAqD,QAAQ,MAAoB,IAE5E,IACL,kBAAC,OAAD;EAAK,WAAW,EAAG,sBAAsB,CAAS;EAAlD,UAAA,CACC,kBAAC,GAAD;GACY;GACX,WAAU;GACV,MAAK;GACe;GAEpB,UAAA,kBAAC,GAAD;IACC,IAAG;IACH,IAAG;IACH,aAAY;IACZ,aAAY;IACZ,YAAY;IACZ,UAAU;IACV,MAAM,CAAC,EAAE,OAAO,EAAQ,CAAC;IACzB,SAAS;IACT,GAAK,IAAa,EAAE,oBAAoB,EAAU,IAAI,CAAC;IATxD,UAAA,CAWC,kBAAC,GAAD;KAAgB,MAAK;KAAS,QAAQ,CAAC,GAAG,GAAG;KAAG,aAAa;KAAG,MAAM;IAAQ,CAAA,GAC9E,kBAAC,GAAD;KACC,SAAQ;KACR,cAAc;KACd,MAAM,EAAY,IAAS,IAAI,CAAC;KAChC,YAAY,EAAE,MAAM,EAAW;KAC/B,GAAI;IACJ,CAAA,CACc;;EACL,CAAA,GACX,IAAY,OACZ,kBAAC,QAAD;GAAM,WAAU;GACd,UAAA;EACI,CAAA,CAEH;;CAON,OAJI,CAAC,KAAc,CAAC,IACZ,IAIP,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,IACA,kBAAC,OAAD;IAAK,IAAI;IAAW,WAAU;IAC5B,UAAA;GACG,CAAA,IACF;GACH;GACA,IACA,kBAAC,OAAD;IAAK,WAAU;IAAwC,UAAA;GAAqB,CAAA,IACzE;EACA;;AAEP"}
@@ -1,11 +1,60 @@
1
- import { type XYPoint, type XYSeriesDescriptor } from "./series.js";
2
- export type GroupedBarChartProps = {
3
- data: XYPoint[];
4
- series?: XYSeriesDescriptor[];
1
+ import type { ReactNode } from "react";
2
+ import type { LineChartAxisDomain, LineChartLegendRenderer, LineChartNumericKeys, LineChartTooltipRenderer } from "./line.js";
3
+ import { type ChartSeriesDescriptor, type XYPoint } from "./series.js";
4
+ export type GroupedBarChartProps<TData extends {
5
+ x: string | number;
6
+ } = XYPoint, K extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string> = {
7
+ /**
8
+ * Dataset array where each record requires an `x` category or time coordinate.
9
+ * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.
10
+ */
11
+ data: TData[];
12
+ /**
13
+ * Series descriptors identifying which numeric keys to plot.
14
+ * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).
15
+ */
16
+ series?: Array<ChartSeriesDescriptor<NoInfer<K>>>;
5
17
  ariaLabel?: string;
6
18
  className?: string;
7
19
  showAxes?: boolean;
8
20
  showLegend?: boolean;
21
+ /**
22
+ * Value formatter for Y-axis tick values and fallback tooltip values.
23
+ */
9
24
  valueFormatter?: (value: number) => string;
25
+ /**
26
+ * Formatter for X-axis category or time tick labels.
27
+ */
28
+ xValueFormatter?: (value: string | number) => string;
29
+ /**
30
+ * Custom numerical or keyword bounds for the Y-axis.
31
+ */
32
+ yDomain?: LineChartAxisDomain;
33
+ /**
34
+ * Custom legend slot or render function receiving resolved series descriptors.
35
+ */
36
+ legend?: ReactNode | LineChartLegendRenderer<K>;
37
+ /**
38
+ * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.
39
+ */
40
+ customTooltip?: LineChartTooltipRenderer;
41
+ /**
42
+ * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.
43
+ * Associated with the chart via useId and aria-describedby.
44
+ */
45
+ summary?: ReactNode;
46
+ /**
47
+ * Accessible tabular or structured data alternative rendered outside the plot area.
48
+ */
49
+ dataAlternative?: ReactNode;
50
+ /**
51
+ * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.
52
+ * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.
53
+ * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.
54
+ * @default true
55
+ */
56
+ accessibilityLayer?: boolean;
10
57
  };
11
- export declare function GroupedBarChart({ data, series, ariaLabel, className, showAxes, showLegend, valueFormatter, }: GroupedBarChartProps): import("react").JSX.Element;
58
+ export declare function GroupedBarChart<TData extends {
59
+ x: string | number;
60
+ } = XYPoint, K extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string>({ data, series, ariaLabel, className, showAxes, showLegend, valueFormatter, xValueFormatter, yDomain, legend, customTooltip, summary, dataAlternative, accessibilityLayer, }: GroupedBarChartProps<TData, K>): import("react").JSX.Element;
@@ -6,15 +6,18 @@ import { ChartLegend as u } from "./legend.js";
6
6
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
7
  import { Bar as p, BarChart as m, CartesianGrid as h, Tooltip as g, XAxis as _, YAxis as v } from "recharts";
8
8
  //#region src/charts/grouped-bar.tsx
9
- function y({ data: y, series: b, ariaLabel: x = "Grouped bar chart", className: S, showAxes: C = !1, showLegend: w = !1, valueFormatter: T }) {
10
- let E = c(b, ["y", "y2"]);
9
+ function y({ data: y, series: b, ariaLabel: x = "Grouped bar chart", className: S, showAxes: C = !1, showLegend: w = !1, valueFormatter: T, xValueFormatter: E, yDomain: D, legend: O, customTooltip: k, summary: A, dataAlternative: j, accessibilityLayer: M }) {
10
+ let N = c(b, ["y", "y2"]), P = O === void 0 ? w ? /* @__PURE__ */ d(u, {
11
+ items: N,
12
+ shape: "bar"
13
+ }) : void 0 : typeof O == "function" ? O({ items: N }) : O;
11
14
  return /* @__PURE__ */ d(l, {
12
15
  ariaLabel: x,
13
16
  className: S,
14
- legend: w ? /* @__PURE__ */ d(u, {
15
- items: E,
16
- shape: "bar"
17
- }) : void 0,
17
+ legend: P,
18
+ summary: A,
19
+ dataAlternative: j,
20
+ accessibilityLayer: M,
18
21
  children: /* @__PURE__ */ f(m, {
19
22
  data: y,
20
23
  margin: C ? n : r,
@@ -22,17 +25,20 @@ function y({ data: y, series: b, ariaLabel: x = "Grouped bar chart", className:
22
25
  C ? /* @__PURE__ */ d(h, { ...i }) : null,
23
26
  /* @__PURE__ */ d(_, {
24
27
  dataKey: "x",
25
- ...a(!C)
28
+ ...a(!C),
29
+ tickFormatter: E
26
30
  }),
27
31
  /* @__PURE__ */ d(v, {
28
32
  ...a(!C),
29
- tickFormatter: T
33
+ tickFormatter: T,
34
+ ...D ? { domain: D } : {}
30
35
  }),
31
36
  /* @__PURE__ */ d(g, { ...o({
32
37
  formatter: T,
33
- cursor: "bar"
38
+ cursor: "bar",
39
+ customTooltip: k
34
40
  }) }),
35
- E.map((n, r) => /* @__PURE__ */ d(p, {
41
+ N.map((n, r) => /* @__PURE__ */ d(p, {
36
42
  dataKey: n.key,
37
43
  name: n.label ?? n.key,
38
44
  fill: s(n, r),
@@ -1 +1 @@
1
- {"version":3,"file":"grouped-bar.js","names":[],"sources":["../../src/charts/grouped-bar.tsx"],"sourcesContent":["import { Bar, CartesianGrid, BarChart as RechartsBar, Tooltip, XAxis, YAxis } from \"recharts\";\nimport {\n\tANIMATION_PROPS,\n\tBAR_RADIUS,\n\tCHART_PLOT_MARGIN,\n\tCHART_PLOT_MARGIN_BARE,\n\tcartesianAxisProps,\n\tchartTooltipProps,\n\tGRID_PROPS,\n\tseriesColor,\n} from \"./config\";\nimport { ChartShell } from \"./frame\";\nimport { ChartLegend } from \"./legend\";\nimport { resolveChartSeries, type XYPoint, type XYSeriesDescriptor } from \"./series\";\n\nexport type GroupedBarChartProps = {\n\tdata: XYPoint[];\n\tseries?: XYSeriesDescriptor[];\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\tvalueFormatter?: (value: number) => string;\n};\n\nexport function GroupedBarChart({\n\tdata,\n\tseries,\n\tariaLabel = \"Grouped bar chart\",\n\tclassName,\n\tshowAxes = false,\n\tshowLegend = false,\n\tvalueFormatter,\n}: GroupedBarChartProps) {\n\tconst bars = resolveChartSeries(series, [\"y\", \"y2\"]);\n\treturn (\n\t\t<ChartShell\n\t\t\tariaLabel={ariaLabel}\n\t\t\tclassName={className}\n\t\t\tlegend={showLegend ? <ChartLegend items={bars} shape=\"bar\" /> : undefined}\n\t\t>\n\t\t\t<RechartsBar data={data} margin={showAxes ? CHART_PLOT_MARGIN : CHART_PLOT_MARGIN_BARE}>\n\t\t\t\t{showAxes ? <CartesianGrid {...GRID_PROPS} /> : null}\n\t\t\t\t<XAxis dataKey=\"x\" {...cartesianAxisProps(!showAxes)} />\n\t\t\t\t<YAxis {...cartesianAxisProps(!showAxes)} tickFormatter={valueFormatter} />\n\t\t\t\t<Tooltip {...chartTooltipProps({ formatter: valueFormatter, cursor: \"bar\" })} />\n\t\t\t\t{bars.map((item, index) => (\n\t\t\t\t\t<Bar\n\t\t\t\t\t\tkey={item.key}\n\t\t\t\t\t\tdataKey={item.key}\n\t\t\t\t\t\tname={item.label ?? item.key}\n\t\t\t\t\t\tfill={seriesColor(item, index)}\n\t\t\t\t\t\tradius={BAR_RADIUS.vertical}\n\t\t\t\t\t\t{...ANIMATION_PROPS}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</RechartsBar>\n\t\t</ChartShell>\n\t);\n}\n"],"mappings":";;;;;;;;AAyBA,SAAgB,EAAgB,EAC/B,SACA,WACA,eAAY,qBACZ,cACA,cAAW,IACX,gBAAa,IACb,qBACwB;CACxB,IAAM,IAAO,EAAmB,GAAQ,CAAC,KAAK,IAAI,CAAC;CACnD,OACC,kBAAC,GAAD;EACY;EACA;EACX,QAAQ,IAAa,kBAAC,GAAD;GAAa,OAAO;GAAM,OAAM;EAAO,CAAA,IAAI,KAAA;EAEhE,UAAA,kBAAC,GAAD;GAAmB;GAAM,QAAQ,IAAW,IAAoB;GAAhE,UAAA;IACE,IAAW,kBAAC,GAAD,EAAe,GAAI,EAAa,CAAA,IAAI;IAChD,kBAAC,GAAD;KAAO,SAAQ;KAAI,GAAI,EAAmB,CAAC,CAAQ;IAAI,CAAA;IACvD,kBAAC,GAAD;KAAO,GAAI,EAAmB,CAAC,CAAQ;KAAG,eAAe;IAAiB,CAAA;IAC1E,kBAAC,GAAD,EAAS,GAAI,EAAkB;KAAE,WAAW;KAAgB,QAAQ;IAAM,CAAC,EAAI,CAAA;IAC9E,EAAK,KAAK,GAAM,MAChB,kBAAC,GAAD;KAEC,SAAS,EAAK;KACd,MAAM,EAAK,SAAS,EAAK;KACzB,MAAM,EAAY,GAAM,CAAK;KAC7B,QAAQ,EAAW;KACnB,GAAI;IACJ,GANK,EAAK,GAMV,CACD;GACW;;CACF,CAAA;AAEd"}
1
+ {"version":3,"file":"grouped-bar.js","names":[],"sources":["../../src/charts/grouped-bar.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Bar, CartesianGrid, BarChart as RechartsBar, Tooltip, XAxis, YAxis } from \"recharts\";\nimport {\n\tANIMATION_PROPS,\n\tBAR_RADIUS,\n\tCHART_PLOT_MARGIN,\n\tCHART_PLOT_MARGIN_BARE,\n\tcartesianAxisProps,\n\tchartTooltipProps,\n\tGRID_PROPS,\n\tseriesColor,\n} from \"./config\";\nimport { ChartShell } from \"./frame\";\nimport { ChartLegend } from \"./legend\";\nimport type {\n\tLineChartAxisDomain,\n\tLineChartLegendRenderer,\n\tLineChartNumericKeys,\n\tLineChartTooltipRenderer,\n} from \"./line\";\nimport { type ChartSeriesDescriptor, resolveChartSeries, type XYPoint } from \"./series\";\n\nexport type GroupedBarChartProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function GroupedBarChart<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({\n\tdata,\n\tseries,\n\tariaLabel = \"Grouped bar chart\",\n\tclassName,\n\tshowAxes = false,\n\tshowLegend = false,\n\tvalueFormatter,\n\txValueFormatter,\n\tyDomain,\n\tlegend,\n\tcustomTooltip,\n\tsummary,\n\tdataAlternative,\n\taccessibilityLayer,\n}: GroupedBarChartProps<TData, K>) {\n\tconst defaultKeys = [\"y\", \"y2\"] as K[];\n\tconst bars = resolveChartSeries(series, defaultKeys);\n\tconst resolvedLegend =\n\t\tlegend !== undefined ? (\n\t\t\ttypeof legend === \"function\" ? (\n\t\t\t\tlegend({ items: bars })\n\t\t\t) : (\n\t\t\t\tlegend\n\t\t\t)\n\t\t) : showLegend ? (\n\t\t\t<ChartLegend items={bars} shape=\"bar\" />\n\t\t) : undefined;\n\n\treturn (\n\t\t<ChartShell\n\t\t\tariaLabel={ariaLabel}\n\t\t\tclassName={className}\n\t\t\tlegend={resolvedLegend}\n\t\t\tsummary={summary}\n\t\t\tdataAlternative={dataAlternative}\n\t\t\taccessibilityLayer={accessibilityLayer}\n\t\t>\n\t\t\t<RechartsBar data={data} margin={showAxes ? CHART_PLOT_MARGIN : CHART_PLOT_MARGIN_BARE}>\n\t\t\t\t{showAxes ? <CartesianGrid {...GRID_PROPS} /> : null}\n\t\t\t\t<XAxis dataKey=\"x\" {...cartesianAxisProps(!showAxes)} tickFormatter={xValueFormatter} />\n\t\t\t\t<YAxis\n\t\t\t\t\t{...cartesianAxisProps(!showAxes)}\n\t\t\t\t\ttickFormatter={valueFormatter}\n\t\t\t\t\t{...(yDomain ? { domain: yDomain as [number, number] } : {})}\n\t\t\t\t/>\n\t\t\t\t<Tooltip\n\t\t\t\t\t{...chartTooltipProps({\n\t\t\t\t\t\tformatter: valueFormatter,\n\t\t\t\t\t\tcursor: \"bar\",\n\t\t\t\t\t\tcustomTooltip,\n\t\t\t\t\t})}\n\t\t\t\t/>\n\t\t\t\t{bars.map((item, index) => (\n\t\t\t\t\t<Bar\n\t\t\t\t\t\tkey={item.key}\n\t\t\t\t\t\tdataKey={item.key}\n\t\t\t\t\t\tname={item.label ?? item.key}\n\t\t\t\t\t\tfill={seriesColor(item, index)}\n\t\t\t\t\t\tradius={BAR_RADIUS.vertical}\n\t\t\t\t\t\t{...ANIMATION_PROPS}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</RechartsBar>\n\t\t</ChartShell>\n\t);\n}\n"],"mappings":";;;;;;;;AA8EA,SAAgB,EAGd,EACD,SACA,WACA,eAAY,qBACZ,cACA,cAAW,IACX,gBAAa,IACb,mBACA,oBACA,YACA,WACA,kBACA,YACA,oBACA,yBACkC;CAElC,IAAM,IAAO,EAAmB,GAAQ,CADnB,KAAK,IACc,CAAW,GAC7C,IACL,MAAW,KAAA,IAMP,IACH,kBAAC,GAAD;EAAa,OAAO;EAAM,OAAM;CAAO,CAAA,IACpC,KAAA,IAPH,OAAO,KAAW,aACjB,EAAO,EAAE,OAAO,EAAK,CAAC,IAEtB;CAMH,OACC,kBAAC,GAAD;EACY;EACA;EACX,QAAQ;EACC;EACQ;EACG;EAEpB,UAAA,kBAAC,GAAD;GAAmB;GAAM,QAAQ,IAAW,IAAoB;GAAhE,UAAA;IACE,IAAW,kBAAC,GAAD,EAAe,GAAI,EAAa,CAAA,IAAI;IAChD,kBAAC,GAAD;KAAO,SAAQ;KAAI,GAAI,EAAmB,CAAC,CAAQ;KAAG,eAAe;IAAkB,CAAA;IACvF,kBAAC,GAAD;KACC,GAAI,EAAmB,CAAC,CAAQ;KAChC,eAAe;KACf,GAAK,IAAU,EAAE,QAAQ,EAA4B,IAAI,CAAC;IAC1D,CAAA;IACD,kBAAC,GAAD,EACC,GAAI,EAAkB;KACrB,WAAW;KACX,QAAQ;KACR;IACD,CAAC,EACD,CAAA;IACA,EAAK,KAAK,GAAM,MAChB,kBAAC,GAAD;KAEC,SAAS,EAAK;KACd,MAAM,EAAK,SAAS,EAAK;KACzB,MAAM,EAAY,GAAM,CAAK;KAC7B,QAAQ,EAAW;KACnB,GAAI;IACJ,GANK,EAAK,GAMV,CACD;GACW;;CACF,CAAA;AAEd"}
@@ -9,24 +9,85 @@ export declare const heatmapColorScales: {
9
9
  readonly orange: readonly ["hsl(var(--basalt-muted))", "hsl(var(--basalt-heatmap-orange-1))", "hsl(var(--basalt-heatmap-orange-2))", "hsl(var(--basalt-heatmap-orange-3))", "hsl(var(--basalt-heatmap-orange-4))"];
10
10
  };
11
11
  export type HeatmapCalendarValuesProps = {
12
+ /**
13
+ * Numeric values sequence to display in a compact 7-column grid.
14
+ */
12
15
  values: number[];
16
+ /**
17
+ * Accessible name describing the heatmap purpose or data.
18
+ * @default "Heatmap calendar"
19
+ */
13
20
  ariaLabel?: string;
21
+ /**
22
+ * Additional CSS class names for the outer container.
23
+ */
14
24
  className?: string;
15
25
  };
16
26
  export type HeatmapCalendarYearProps = {
27
+ /**
28
+ * Dataset of daily metrics with ISO date strings ("YYYY-MM-DD") and numeric values.
29
+ */
17
30
  data: HeatmapDataPoint[];
31
+ /**
32
+ * Calendar year to render.
33
+ */
18
34
  year: number;
35
+ /**
36
+ * Array of color values forming the intensity gradient from lowest to highest.
37
+ * @default heatmapColorScales.green
38
+ */
19
39
  colorScale?: readonly string[];
40
+ /**
41
+ * Formatter for tooltip value display and accessible label.
42
+ * @default (value) => value.toLocaleString()
43
+ */
20
44
  valueFormatter?: (value: number, date: string) => string;
45
+ /**
46
+ * Name of the metric for accessible labeling and tooltips.
47
+ * @default "Value"
48
+ */
21
49
  metricLabel?: string;
50
+ /**
51
+ * Pixel width and height of each day cell.
52
+ * @default 12
53
+ */
22
54
  cellSize?: number;
55
+ /**
56
+ * Pixel gap between adjacent cells.
57
+ * @default 2
58
+ */
23
59
  cellGap?: number;
60
+ /**
61
+ * BCP 47 locale tag used for weekday and month label formatting.
62
+ * @default "en-US"
63
+ */
24
64
  locale?: string;
65
+ /**
66
+ * Explicit custom weekday labels override.
67
+ */
25
68
  weekdayLabels?: string[];
69
+ /**
70
+ * Explicit custom month labels override.
71
+ */
26
72
  monthLabels?: string[];
73
+ /**
74
+ * Label text for the lower end of the color scale legend.
75
+ * @default "Less"
76
+ */
27
77
  lessLabel?: string;
78
+ /**
79
+ * Label text for the upper end of the color scale legend.
80
+ * @default "More"
81
+ */
28
82
  moreLabel?: string;
83
+ /**
84
+ * Accessible name describing the yearly heatmap dataset.
85
+ * @default "Heatmap calendar"
86
+ */
29
87
  ariaLabel?: string;
88
+ /**
89
+ * Additional CSS class names for the outer scrollable container.
90
+ */
30
91
  className?: string;
31
92
  };
32
93
  export type HeatmapCalendarProps = HeatmapCalendarValuesProps | HeatmapCalendarYearProps;