@misoto22/design 0.3.1 → 0.6.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 (266) hide show
  1. package/README.md +124 -0
  2. package/bin/misoto22-design.mjs +205 -0
  3. package/dist/agent/Accordion.md +41 -0
  4. package/dist/agent/Alert.md +42 -0
  5. package/dist/agent/AppShell.md +40 -0
  6. package/dist/agent/AreaChart.md +68 -0
  7. package/dist/agent/Article.md +41 -0
  8. package/dist/agent/Avatar.md +32 -0
  9. package/dist/agent/Badge.md +40 -0
  10. package/dist/agent/BarChart.md +65 -0
  11. package/dist/agent/BarList.md +40 -0
  12. package/dist/agent/BigNumber.md +45 -0
  13. package/dist/agent/BoxPlot.md +58 -0
  14. package/dist/agent/Breadcrumb.md +32 -0
  15. package/dist/agent/BulletChart.md +48 -0
  16. package/dist/agent/Button.md +56 -0
  17. package/dist/agent/Calendar.md +42 -0
  18. package/dist/agent/Card.md +49 -0
  19. package/dist/agent/Checkbox.md +35 -0
  20. package/dist/agent/Collapsible.md +46 -0
  21. package/dist/agent/Combobox.md +50 -0
  22. package/dist/agent/Command.md +93 -0
  23. package/dist/agent/ComposedChart.md +57 -0
  24. package/dist/agent/ContextMenu.md +59 -0
  25. package/dist/agent/DatePicker.md +75 -0
  26. package/dist/agent/Diagram.md +46 -0
  27. package/dist/agent/Dialog.md +52 -0
  28. package/dist/agent/DropdownMenu.md +70 -0
  29. package/dist/agent/EmptyState.md +37 -0
  30. package/dist/agent/ErrorState.md +41 -0
  31. package/dist/agent/Facet.md +82 -0
  32. package/dist/agent/Field.md +37 -0
  33. package/dist/agent/FigureBand.md +37 -0
  34. package/dist/agent/FloatingIconButton.md +38 -0
  35. package/dist/agent/FunnelChart.md +52 -0
  36. package/dist/agent/Heatmap.md +53 -0
  37. package/dist/agent/Histogram.md +63 -0
  38. package/dist/agent/Input.md +30 -0
  39. package/dist/agent/Kbd.md +29 -0
  40. package/dist/agent/LineChart.md +60 -0
  41. package/dist/agent/LinkArrow.md +29 -0
  42. package/dist/agent/NativeSelect.md +40 -0
  43. package/dist/agent/NavItem.md +35 -0
  44. package/dist/agent/Pagination.md +43 -0
  45. package/dist/agent/PieChart.md +55 -0
  46. package/dist/agent/Popover.md +57 -0
  47. package/dist/agent/Progress.md +33 -0
  48. package/dist/agent/RadarChart.md +54 -0
  49. package/dist/agent/RadialChart.md +57 -0
  50. package/dist/agent/RadioGroup.md +44 -0
  51. package/dist/agent/SankeyChart.md +61 -0
  52. package/dist/agent/ScatterChart.md +54 -0
  53. package/dist/agent/ScrollArea.md +40 -0
  54. package/dist/agent/SearchableMenu.md +46 -0
  55. package/dist/agent/Select.md +75 -0
  56. package/dist/agent/Separator.md +35 -0
  57. package/dist/agent/Sheet.md +57 -0
  58. package/dist/agent/Skeleton.md +73 -0
  59. package/dist/agent/Slider.md +39 -0
  60. package/dist/agent/Sparkline.md +45 -0
  61. package/dist/agent/Spinner.md +39 -0
  62. package/dist/agent/StatusDot.md +36 -0
  63. package/dist/agent/StatusPill.md +28 -0
  64. package/dist/agent/Steps.md +44 -0
  65. package/dist/agent/Switch.md +29 -0
  66. package/dist/agent/Table.md +85 -0
  67. package/dist/agent/Tabs.md +48 -0
  68. package/dist/agent/Tag.md +35 -0
  69. package/dist/agent/Textarea.md +26 -0
  70. package/dist/agent/Toast.md +26 -0
  71. package/dist/agent/ToggleGroup.md +44 -0
  72. package/dist/agent/Tooltip.md +51 -0
  73. package/dist/agent/TreemapChart.md +52 -0
  74. package/dist/agent/WaterfallChart.md +62 -0
  75. package/dist/agent/catalog.json +1791 -0
  76. package/dist/agent/index.md +131 -0
  77. package/dist/article.css +393 -0
  78. package/dist/charts/AreaChart/AreaChart.d.ts +191 -0
  79. package/dist/charts/AreaChart/AreaChart.js +480 -0
  80. package/dist/charts/AreaChart/AreaChart.js.map +1 -0
  81. package/dist/charts/BarChart/BarChart.d.ts +179 -0
  82. package/dist/charts/BarChart/BarChart.js +591 -0
  83. package/dist/charts/BarChart/BarChart.js.map +1 -0
  84. package/dist/charts/BarList/BarList.d.ts +57 -0
  85. package/dist/charts/BarList/BarList.js +71 -0
  86. package/dist/charts/BarList/BarList.js.map +1 -0
  87. package/dist/charts/BigNumber/BigNumber.d.ts +56 -0
  88. package/dist/charts/BigNumber/BigNumber.js +31 -0
  89. package/dist/charts/BigNumber/BigNumber.js.map +1 -0
  90. package/dist/charts/BoxPlot/BoxPlot.d.ts +177 -0
  91. package/dist/charts/BoxPlot/BoxPlot.js +495 -0
  92. package/dist/charts/BoxPlot/BoxPlot.js.map +1 -0
  93. package/dist/charts/BulletChart/BulletChart.d.ts +100 -0
  94. package/dist/charts/BulletChart/BulletChart.js +162 -0
  95. package/dist/charts/BulletChart/BulletChart.js.map +1 -0
  96. package/dist/charts/ComposedChart/ComposedChart.d.ts +171 -0
  97. package/dist/charts/ComposedChart/ComposedChart.js +667 -0
  98. package/dist/charts/ComposedChart/ComposedChart.js.map +1 -0
  99. package/dist/charts/Facet/Facet.d.ts +240 -0
  100. package/dist/charts/Facet/Facet.js +133 -0
  101. package/dist/charts/Facet/Facet.js.map +1 -0
  102. package/dist/charts/Facet/panels.d.ts +187 -0
  103. package/dist/charts/Facet/panels.js +203 -0
  104. package/dist/charts/Facet/panels.js.map +1 -0
  105. package/dist/charts/FunnelChart/FunnelChart.d.ts +101 -0
  106. package/dist/charts/FunnelChart/FunnelChart.js +147 -0
  107. package/dist/charts/FunnelChart/FunnelChart.js.map +1 -0
  108. package/dist/charts/Heatmap/Heatmap.d.ts +78 -0
  109. package/dist/charts/Heatmap/Heatmap.js +108 -0
  110. package/dist/charts/Heatmap/Heatmap.js.map +1 -0
  111. package/dist/charts/Histogram/Histogram.d.ts +165 -0
  112. package/dist/charts/Histogram/Histogram.js +350 -0
  113. package/dist/charts/Histogram/Histogram.js.map +1 -0
  114. package/dist/charts/LineChart/LineChart.d.ts +167 -0
  115. package/dist/charts/LineChart/LineChart.js +486 -0
  116. package/dist/charts/LineChart/LineChart.js.map +1 -0
  117. package/dist/charts/PieChart/PieChart.d.ts +128 -0
  118. package/dist/charts/PieChart/PieChart.js +309 -0
  119. package/dist/charts/PieChart/PieChart.js.map +1 -0
  120. package/dist/charts/RadarChart/RadarChart.d.ts +123 -0
  121. package/dist/charts/RadarChart/RadarChart.js +299 -0
  122. package/dist/charts/RadarChart/RadarChart.js.map +1 -0
  123. package/dist/charts/RadialChart/RadialChart.d.ts +124 -0
  124. package/dist/charts/RadialChart/RadialChart.js +257 -0
  125. package/dist/charts/RadialChart/RadialChart.js.map +1 -0
  126. package/dist/charts/SankeyChart/SankeyChart.d.ts +137 -0
  127. package/dist/charts/SankeyChart/SankeyChart.js +501 -0
  128. package/dist/charts/SankeyChart/SankeyChart.js.map +1 -0
  129. package/dist/charts/ScatterChart/ScatterChart.d.ts +128 -0
  130. package/dist/charts/ScatterChart/ScatterChart.js +269 -0
  131. package/dist/charts/ScatterChart/ScatterChart.js.map +1 -0
  132. package/dist/charts/Sparkline/Sparkline.d.ts +53 -0
  133. package/dist/charts/Sparkline/Sparkline.js +93 -0
  134. package/dist/charts/Sparkline/Sparkline.js.map +1 -0
  135. package/dist/charts/TreemapChart/TreemapChart.d.ts +93 -0
  136. package/dist/charts/TreemapChart/TreemapChart.js +118 -0
  137. package/dist/charts/TreemapChart/TreemapChart.js.map +1 -0
  138. package/dist/charts/WaterfallChart/WaterfallChart.d.ts +164 -0
  139. package/dist/charts/WaterfallChart/WaterfallChart.js +319 -0
  140. package/dist/charts/WaterfallChart/WaterfallChart.js.map +1 -0
  141. package/dist/charts/index.d.ts +41 -0
  142. package/dist/charts/index.js +128 -0
  143. package/dist/charts/index.js.map +1 -0
  144. package/dist/charts/lib/annotations.d.ts +103 -0
  145. package/dist/charts/lib/annotations.js +99 -0
  146. package/dist/charts/lib/annotations.js.map +1 -0
  147. package/dist/charts/lib/axis.d.ts +18 -0
  148. package/dist/charts/lib/axis.js +21 -0
  149. package/dist/charts/lib/axis.js.map +1 -0
  150. package/dist/charts/lib/background.d.ts +33 -0
  151. package/dist/charts/lib/background.js +173 -0
  152. package/dist/charts/lib/background.js.map +1 -0
  153. package/dist/charts/lib/brush.d.ts +94 -0
  154. package/dist/charts/lib/brush.js +535 -0
  155. package/dist/charts/lib/brush.js.map +1 -0
  156. package/dist/charts/lib/chart.d.ts +94 -0
  157. package/dist/charts/lib/chart.js +134 -0
  158. package/dist/charts/lib/chart.js.map +1 -0
  159. package/dist/charts/lib/dot.d.ts +29 -0
  160. package/dist/charts/lib/dot.js +78 -0
  161. package/dist/charts/lib/dot.js.map +1 -0
  162. package/dist/charts/lib/empty.d.ts +31 -0
  163. package/dist/charts/lib/empty.js +13 -0
  164. package/dist/charts/lib/empty.js.map +1 -0
  165. package/dist/charts/lib/export.d.ts +103 -0
  166. package/dist/charts/lib/export.js +204 -0
  167. package/dist/charts/lib/export.js.map +1 -0
  168. package/dist/charts/lib/figure.d.ts +61 -0
  169. package/dist/charts/lib/figure.js +59 -0
  170. package/dist/charts/lib/figure.js.map +1 -0
  171. package/dist/charts/lib/format.d.ts +46 -0
  172. package/dist/charts/lib/format.js +56 -0
  173. package/dist/charts/lib/format.js.map +1 -0
  174. package/dist/charts/lib/legend.d.ts +45 -0
  175. package/dist/charts/lib/legend.js +117 -0
  176. package/dist/charts/lib/legend.js.map +1 -0
  177. package/dist/charts/lib/loading.d.ts +48 -0
  178. package/dist/charts/lib/loading.js +105 -0
  179. package/dist/charts/lib/loading.js.map +1 -0
  180. package/dist/charts/lib/paint.d.ts +154 -0
  181. package/dist/charts/lib/paint.js +551 -0
  182. package/dist/charts/lib/paint.js.map +1 -0
  183. package/dist/charts/lib/sonify-control.d.ts +163 -0
  184. package/dist/charts/lib/sonify-control.js +172 -0
  185. package/dist/charts/lib/sonify-control.js.map +1 -0
  186. package/dist/charts/lib/sonify.d.ts +248 -0
  187. package/dist/charts/lib/sonify.js +262 -0
  188. package/dist/charts/lib/sonify.js.map +1 -0
  189. package/dist/charts/lib/toolbar.d.ts +143 -0
  190. package/dist/charts/lib/toolbar.js +156 -0
  191. package/dist/charts/lib/toolbar.js.map +1 -0
  192. package/dist/charts/lib/tooltip.d.ts +59 -0
  193. package/dist/charts/lib/tooltip.js +135 -0
  194. package/dist/charts/lib/tooltip.js.map +1 -0
  195. package/dist/charts/lib/values.d.ts +56 -0
  196. package/dist/charts/lib/values.js +71 -0
  197. package/dist/charts/lib/values.js.map +1 -0
  198. package/dist/charts/lib/zoom.d.ts +139 -0
  199. package/dist/charts/lib/zoom.js +314 -0
  200. package/dist/charts/lib/zoom.js.map +1 -0
  201. package/dist/components/AppShell/AppShell.d.ts +15 -1
  202. package/dist/components/AppShell/AppShell.js +8 -4
  203. package/dist/components/AppShell/AppShell.js.map +1 -1
  204. package/dist/components/Article/Article.d.ts +51 -0
  205. package/dist/components/Article/Article.js +21 -0
  206. package/dist/components/Article/Article.js.map +1 -0
  207. package/dist/components/Button/Button.js +2 -2
  208. package/dist/components/Button/Button.js.map +1 -1
  209. package/dist/components/Calendar/Calendar.d.ts +1 -1
  210. package/dist/components/Calendar/Calendar.js +259 -24
  211. package/dist/components/Calendar/Calendar.js.map +1 -1
  212. package/dist/components/Checkbox/Checkbox.js +1 -1
  213. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  214. package/dist/components/Collapsible/Collapsible.d.ts +15 -1
  215. package/dist/components/Collapsible/Collapsible.js +18 -0
  216. package/dist/components/Collapsible/Collapsible.js.map +1 -1
  217. package/dist/components/Combobox/Combobox.js +1 -1
  218. package/dist/components/Combobox/Combobox.js.map +1 -1
  219. package/dist/components/Command/Command.js +7 -7
  220. package/dist/components/Command/Command.js.map +1 -1
  221. package/dist/components/ContextMenu/ContextMenu.js +2 -2
  222. package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
  223. package/dist/components/Diagram/Diagram.d.ts +81 -0
  224. package/dist/components/Diagram/Diagram.js +139 -0
  225. package/dist/components/Diagram/Diagram.js.map +1 -0
  226. package/dist/components/Dialog/Dialog.js +1 -1
  227. package/dist/components/Dialog/Dialog.js.map +1 -1
  228. package/dist/components/DropdownMenu/DropdownMenu.js +2 -2
  229. package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -1
  230. package/dist/components/FigureBand/FigureBand.js +41 -30
  231. package/dist/components/FigureBand/FigureBand.js.map +1 -1
  232. package/dist/components/Popover/Popover.js +1 -1
  233. package/dist/components/Popover/Popover.js.map +1 -1
  234. package/dist/components/Select/Select.js +2 -2
  235. package/dist/components/Select/Select.js.map +1 -1
  236. package/dist/components/Sheet/Sheet.js +1 -1
  237. package/dist/components/Sheet/Sheet.js.map +1 -1
  238. package/dist/components/Slider/Slider.js +1 -1
  239. package/dist/components/Slider/Slider.js.map +1 -1
  240. package/dist/components/Steps/Steps.d.ts +65 -0
  241. package/dist/components/Steps/Steps.js +55 -0
  242. package/dist/components/Steps/Steps.js.map +1 -0
  243. package/dist/components/Switch/Switch.js +1 -1
  244. package/dist/components/Switch/Switch.js.map +1 -1
  245. package/dist/components/Tooltip/Tooltip.js +1 -1
  246. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  247. package/dist/index.d.ts +4 -1
  248. package/dist/index.js +3 -0
  249. package/dist/index.js.map +1 -1
  250. package/dist/lib/useSelectionIndicator.js +14 -10
  251. package/dist/lib/useSelectionIndicator.js.map +1 -1
  252. package/dist/semantic.css +19 -0
  253. package/dist/styles.css +1 -1
  254. package/dist/themes.css +103 -7
  255. package/dist/tokens.css +193 -10
  256. package/dist/tokens.d.ts +25 -0
  257. package/dist/tokens.js +154 -8
  258. package/dist/tokens.json +154 -8
  259. package/package.json +45 -20
  260. package/skills/misoto22-design/SKILL.md +171 -0
  261. package/skills/misoto22-design/evals/claims.json +95 -0
  262. package/skills/misoto22-design/rules/a11y.md +115 -0
  263. package/skills/misoto22-design/rules/composition.md +108 -0
  264. package/skills/misoto22-design/rules/forms.md +128 -0
  265. package/skills/misoto22-design/rules/naming.md +155 -0
  266. package/skills/misoto22-design/rules/tokens.md +131 -0
@@ -0,0 +1,57 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface BarListItem {
5
+ /** What the row is. Doubles as its key, so it must be unique. */
6
+ name: string;
7
+ value: number;
8
+ /** Turns the row's name into a link. */
9
+ href?: string;
10
+ /** Drawn before the name — a favicon, a status dot, a flag. */
11
+ icon?: ReactNode;
12
+ }
13
+ interface BarListProps {
14
+ /** What the list ranks. Required: it names the table for a screen reader. */
15
+ label: string;
16
+ /** Prints the label above the list instead of hiding it from sight. */
17
+ showLabel?: boolean;
18
+ items: BarListItem[];
19
+ /** Keeps the top N and folds the rest into one "Other" row. */
20
+ limit?: number;
21
+ /** Formats each value. Defaults to the same compact form the axes use. */
22
+ formatValue?: (value: number) => string;
23
+ /**
24
+ * The scale's ceiling. Derived from the largest row when omitted.
25
+ *
26
+ * Pin it to compare two lists side by side — on independent scales the
27
+ * leading row of each fills its track, and two very different numbers look
28
+ * identical.
29
+ */
30
+ max?: number;
31
+ /** Sorts descending before rendering. */
32
+ sort?: boolean;
33
+ className?: string;
34
+ }
35
+ /**
36
+ * A ranked list, with the bar behind the name rather than beside it.
37
+ *
38
+ * The answer to "top referrers", "slowest endpoints", "biggest accounts" — and
39
+ * a better one than a horizontal bar chart, which spends a third of its width
40
+ * on a category axis repeating labels the rows could simply contain. Reading a
41
+ * name off a y-axis and matching it to a bar is two steps; reading it off the
42
+ * bar is none.
43
+ *
44
+ * It is a `<table>`, because that is what it is: two columns, a header, and one
45
+ * row per thing. The bar is a background on the name cell, so it never becomes
46
+ * a second element a screen reader has to walk past.
47
+ *
48
+ * Reach for `<BarChart orientation="horizontal">` instead when the categories
49
+ * are few and fixed and the axis is doing real work — a scale a reader needs to
50
+ * read values off, rather than a ranking they need to skim.
51
+ *
52
+ * @example
53
+ * <BarList label="Top referrers" items={referrers} limit={5} />
54
+ */
55
+ declare function BarList({ label, showLabel, items, limit, formatValue, max, sort, className, }: BarListProps): react.JSX.Element;
56
+
57
+ export { BarList, type BarListItem, type BarListProps, BarList as default };
@@ -0,0 +1,71 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/cn.js";
3
+ import { defaultTick } from "../lib/format.js";
4
+ function BarList({
5
+ label,
6
+ showLabel = false,
7
+ items,
8
+ limit,
9
+ formatValue = defaultTick,
10
+ max,
11
+ sort = true,
12
+ className
13
+ }) {
14
+ const ordered = sort ? [...items].sort((a, b) => b.value - a.value) : items;
15
+ const shown = limit !== void 0 && ordered.length > limit ? [
16
+ ...ordered.slice(0, limit),
17
+ {
18
+ name: "Other",
19
+ value: ordered.slice(limit).reduce((sum, item) => sum + item.value, 0)
20
+ }
21
+ ] : ordered;
22
+ const ceiling = max ?? Math.max(1, ...shown.map((item) => item.value));
23
+ return /* @__PURE__ */ jsx("div", { className: cn("flex w-full flex-col gap-2", className), children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-sm", children: [
24
+ /* @__PURE__ */ jsx(
25
+ "caption",
26
+ {
27
+ className: cn(
28
+ "text-start",
29
+ showLabel ? "mb-2 eyebrow text-(--ink-3-aa)" : "sr-only"
30
+ ),
31
+ children: label
32
+ }
33
+ ),
34
+ /* @__PURE__ */ jsx("thead", { className: "sr-only", children: /* @__PURE__ */ jsxs("tr", { children: [
35
+ /* @__PURE__ */ jsx("th", { scope: "col", children: "Name" }),
36
+ /* @__PURE__ */ jsx("th", { scope: "col", children: "Value" })
37
+ ] }) }),
38
+ /* @__PURE__ */ jsx("tbody", { children: shown.map((item) => {
39
+ const share = Math.max(0, Math.min(1, item.value / ceiling));
40
+ return /* @__PURE__ */ jsxs("tr", { className: "align-middle", children: [
41
+ /* @__PURE__ */ jsx("th", { scope: "row", className: "w-full py-1 pe-3 text-start font-normal", children: /* @__PURE__ */ jsxs(
42
+ "span",
43
+ {
44
+ className: "flex h-8 items-center gap-2 rounded-(--radius-sm) px-2 text-(--ink)",
45
+ style: {
46
+ background: `linear-gradient(to right, color-mix(in srgb, var(--series-1) calc(var(--chart-fill) * 100%), transparent) ${share * 100}%, transparent ${share * 100}%)`
47
+ },
48
+ children: [
49
+ item.icon && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "flex shrink-0 items-center text-(--ink-3-aa)", children: item.icon }),
50
+ item.href ? /* @__PURE__ */ jsx(
51
+ "a",
52
+ {
53
+ href: item.href,
54
+ className: "truncate underline-offset-2 hover:underline focus-visible:underline",
55
+ children: item.name
56
+ }
57
+ ) : /* @__PURE__ */ jsx("span", { className: "truncate", children: item.name })
58
+ ]
59
+ }
60
+ ) }),
61
+ /* @__PURE__ */ jsx("td", { className: "py-1 text-end font-mono text-xs whitespace-nowrap tabular-nums text-(--ink-2)", children: formatValue(item.value) })
62
+ ] }, item.name);
63
+ }) })
64
+ ] }) });
65
+ }
66
+ var BarList_default = BarList;
67
+ export {
68
+ BarList,
69
+ BarList_default as default
70
+ };
71
+ //# sourceMappingURL=BarList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/charts/BarList/BarList.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\nimport { defaultTick } from '../lib/format'\n\nexport interface BarListItem {\n /** What the row is. Doubles as its key, so it must be unique. */\n name: string\n value: number\n /** Turns the row's name into a link. */\n href?: string\n /** Drawn before the name — a favicon, a status dot, a flag. */\n icon?: ReactNode\n}\n\nexport interface BarListProps {\n /** What the list ranks. Required: it names the table for a screen reader. */\n label: string\n /** Prints the label above the list instead of hiding it from sight. */\n showLabel?: boolean\n items: BarListItem[]\n /** Keeps the top N and folds the rest into one \"Other\" row. */\n limit?: number\n /** Formats each value. Defaults to the same compact form the axes use. */\n formatValue?: (value: number) => string\n /**\n * The scale's ceiling. Derived from the largest row when omitted.\n *\n * Pin it to compare two lists side by side — on independent scales the\n * leading row of each fills its track, and two very different numbers look\n * identical.\n */\n max?: number\n /** Sorts descending before rendering. */\n sort?: boolean\n className?: string\n}\n\n/**\n * A ranked list, with the bar behind the name rather than beside it.\n *\n * The answer to \"top referrers\", \"slowest endpoints\", \"biggest accounts\" — and\n * a better one than a horizontal bar chart, which spends a third of its width\n * on a category axis repeating labels the rows could simply contain. Reading a\n * name off a y-axis and matching it to a bar is two steps; reading it off the\n * bar is none.\n *\n * It is a `<table>`, because that is what it is: two columns, a header, and one\n * row per thing. The bar is a background on the name cell, so it never becomes\n * a second element a screen reader has to walk past.\n *\n * Reach for `<BarChart orientation=\"horizontal\">` instead when the categories\n * are few and fixed and the axis is doing real work — a scale a reader needs to\n * read values off, rather than a ranking they need to skim.\n *\n * @example\n * <BarList label=\"Top referrers\" items={referrers} limit={5} />\n */\nexport function BarList({\n label,\n showLabel = false,\n items,\n limit,\n formatValue = defaultTick,\n max,\n sort = true,\n className,\n}: BarListProps) {\n const ordered = sort ? [...items].sort((a, b) => b.value - a.value) : items\n\n // The tail is summed rather than dropped: a \"top five\" that silently discards\n // the other forty misstates the whole, and the reader has no way to tell.\n const shown =\n limit !== undefined && ordered.length > limit\n ? [\n ...ordered.slice(0, limit),\n {\n name: 'Other',\n value: ordered.slice(limit).reduce((sum, item) => sum + item.value, 0),\n },\n ]\n : ordered\n\n const ceiling = max ?? Math.max(1, ...shown.map((item) => item.value))\n\n return (\n <div className={cn('flex w-full flex-col gap-2', className)}>\n <table className=\"w-full border-collapse text-sm\">\n <caption\n className={cn(\n 'text-start',\n showLabel ? 'mb-2 eyebrow text-(--ink-3-aa)' : 'sr-only',\n )}\n >\n {label}\n </caption>\n <thead className=\"sr-only\">\n <tr>\n <th scope=\"col\">Name</th>\n <th scope=\"col\">Value</th>\n </tr>\n </thead>\n <tbody>\n {shown.map((item) => {\n const share = Math.max(0, Math.min(1, item.value / ceiling))\n\n return (\n <tr key={item.name} className=\"align-middle\">\n <th scope=\"row\" className=\"w-full py-1 pe-3 text-start font-normal\">\n {/* The bar is a background on the cell, not a sibling: an\n empty <div> beside the name would be one more thing in the\n accessibility tree saying nothing. */}\n <span\n className=\"flex h-8 items-center gap-2 rounded-(--radius-sm) px-2 text-(--ink)\"\n style={{\n background: `linear-gradient(to right, color-mix(in srgb, var(--series-1) calc(var(--chart-fill) * 100%), transparent) ${share * 100}%, transparent ${share * 100}%)`,\n }}\n >\n {item.icon && (\n <span aria-hidden className=\"flex shrink-0 items-center text-(--ink-3-aa)\">\n {item.icon}\n </span>\n )}\n {item.href ? (\n <a\n href={item.href}\n className=\"truncate underline-offset-2 hover:underline focus-visible:underline\"\n >\n {item.name}\n </a>\n ) : (\n <span className=\"truncate\">{item.name}</span>\n )}\n </span>\n </th>\n <td className=\"py-1 text-end font-mono text-xs whitespace-nowrap tabular-nums text-(--ink-2)\">\n {formatValue(item.value)}\n </td>\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n )\n}\n\nexport default BarList\n"],"mappings":"AAuFQ,cASE,YATF;AAtFR,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAuDrB,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA,OAAO;AAAA,EACP;AACF,GAAiB;AACf,QAAM,UAAU,OAAO,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,KAAK,IAAI;AAItE,QAAM,QACJ,UAAU,UAAa,QAAQ,SAAS,QACpC;AAAA,IACE,GAAG,QAAQ,MAAM,GAAG,KAAK;AAAA,IACzB;AAAA,MACE,MAAM;AAAA,MACN,OAAO,QAAQ,MAAM,KAAK,EAAE,OAAO,CAAC,KAAK,SAAS,MAAM,KAAK,OAAO,CAAC;AAAA,IACvE;AAAA,EACF,IACA;AAEN,QAAM,UAAU,OAAO,KAAK,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC;AAErE,SACE,oBAAC,SAAI,WAAW,GAAG,8BAA8B,SAAS,GACxD,+BAAC,WAAM,WAAU,kCACf;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,YAAY,mCAAmC;AAAA,QACjD;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IACA,oBAAC,WAAM,WAAU,WACf,+BAAC,QACC;AAAA,0BAAC,QAAG,OAAM,OAAM,kBAAI;AAAA,MACpB,oBAAC,QAAG,OAAM,OAAM,mBAAK;AAAA,OACvB,GACF;AAAA,IACA,oBAAC,WACE,gBAAM,IAAI,CAAC,SAAS;AACnB,YAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,QAAQ,OAAO,CAAC;AAE3D,aACE,qBAAC,QAAmB,WAAU,gBAC5B;AAAA,4BAAC,QAAG,OAAM,OAAM,WAAU,2CAIxB;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,YAAY,6GAA6G,QAAQ,GAAG,kBAAkB,QAAQ,GAAG;AAAA,YACnK;AAAA,YAEC;AAAA,mBAAK,QACJ,oBAAC,UAAK,eAAW,MAAC,WAAU,gDACzB,eAAK,MACR;AAAA,cAED,KAAK,OACJ;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAM,KAAK;AAAA,kBACX,WAAU;AAAA,kBAET,eAAK;AAAA;AAAA,cACR,IAEA,oBAAC,UAAK,WAAU,YAAY,eAAK,MAAK;AAAA;AAAA;AAAA,QAE1C,GACF;AAAA,QACA,oBAAC,QAAG,WAAU,iFACX,sBAAY,KAAK,KAAK,GACzB;AAAA,WA9BO,KAAK,IA+Bd;AAAA,IAEJ,CAAC,GACH;AAAA,KACF,GACF;AAEJ;AAEA,IAAO,kBAAQ;","names":[]}
@@ -0,0 +1,56 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ /** Which way a change is good. */
5
+ type DeltaIntent = 'up-is-good' | 'down-is-good' | 'neutral';
6
+ interface BigNumberDelta {
7
+ /** The change, already computed. Positive is up, whatever that means here. */
8
+ value: number;
9
+ /** What it is a change from — "vs last week". */
10
+ label?: ReactNode;
11
+ /**
12
+ * Which direction counts as good.
13
+ *
14
+ * Required rather than assumed, because the assumption is wrong half the
15
+ * time: revenue up is good, error rate up is not, and a component that
16
+ * guesses will confidently colour a bad number green.
17
+ */
18
+ intent?: DeltaIntent;
19
+ /** Formats the change. Defaults to a signed percentage. */
20
+ format?: (value: number) => string;
21
+ }
22
+ interface BigNumberProps {
23
+ /** What the number counts. */
24
+ label: ReactNode;
25
+ /** The number, already formatted — this component does not guess a unit. */
26
+ value: ReactNode;
27
+ delta?: BigNumberDelta;
28
+ /** A sparkline, a note, a caveat. Sits under the number. */
29
+ children?: ReactNode;
30
+ className?: string;
31
+ }
32
+ /**
33
+ * One number, at the size of a headline.
34
+ *
35
+ * The form most dashboards need most often and most chart libraries do not
36
+ * ship, on the grounds that it is not a chart. It is the right answer whenever
37
+ * there is exactly one figure to report: a plot of a single value is a plot
38
+ * whose shape carries nothing, and the reader has to decode an axis to recover
39
+ * a number that could simply have been printed.
40
+ *
41
+ * The delta is where this earns its place over a `<p>`. Direction is stated by
42
+ * the CALL SITE (`intent`), never inferred: "errors down 12%" is good news and
43
+ * "revenue down 12%" is not, and no component can tell which it is holding.
44
+ * Where the direction is known, the arrow and the word carry it — the status
45
+ * colour is the third signal, never the only one.
46
+ *
47
+ * @example
48
+ * <BigNumber
49
+ * label="Monthly revenue"
50
+ * value="$48,210"
51
+ * delta={{ value: 0.124, label: 'vs last month', intent: 'up-is-good' }}
52
+ * />
53
+ */
54
+ declare function BigNumber({ label, value, delta, children, className }: BigNumberProps): react.JSX.Element;
55
+
56
+ export { BigNumber, type BigNumberDelta, type BigNumberProps, type DeltaIntent, BigNumber as default };
@@ -0,0 +1,31 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/cn.js";
3
+ const signed = (value) => `${value > 0 ? "+" : ""}${(value * 100).toFixed(1).replace(/\.0$/, "")}%`;
4
+ function BigNumber({ label, value, delta, children, className }) {
5
+ const intent = delta?.intent ?? "neutral";
6
+ const format = delta?.format ?? signed;
7
+ const rising = (delta?.value ?? 0) > 0;
8
+ const flat = (delta?.value ?? 0) === 0;
9
+ const good = intent === "neutral" ? null : intent === "up-is-good" ? rising : !rising;
10
+ const tone = flat || good === null ? "text-(--ink-2)" : good ? "text-(--ok)" : "text-(--danger)";
11
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
12
+ /* @__PURE__ */ jsx("span", { className: "eyebrow text-(--ink-3-aa)", children: label }),
13
+ /* @__PURE__ */ jsx("span", { className: "font-heading text-[length:var(--fs-lead)] leading-none text-(--ink) tabular-nums", children: value }),
14
+ delta && /* @__PURE__ */ jsxs("span", { className: cn("flex items-baseline gap-1.5 mono-meta", tone), children: [
15
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: flat ? "\u2192" : rising ? "\u2191" : "\u2193" }),
16
+ /* @__PURE__ */ jsx("span", { children: format(delta.value) }),
17
+ /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
18
+ flat ? "no change" : rising ? "up" : "down",
19
+ good === null ? "" : good ? ", better" : ", worse"
20
+ ] }),
21
+ delta.label && /* @__PURE__ */ jsx("span", { className: "text-(--ink-3-aa)", children: delta.label })
22
+ ] }),
23
+ children && /* @__PURE__ */ jsx("div", { className: "mt-2", children })
24
+ ] });
25
+ }
26
+ var BigNumber_default = BigNumber;
27
+ export {
28
+ BigNumber,
29
+ BigNumber_default as default
30
+ };
31
+ //# sourceMappingURL=BigNumber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/charts/BigNumber/BigNumber.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\n\n/** Which way a change is good. */\nexport type DeltaIntent = 'up-is-good' | 'down-is-good' | 'neutral'\n\nexport interface BigNumberDelta {\n /** The change, already computed. Positive is up, whatever that means here. */\n value: number\n /** What it is a change from — \"vs last week\". */\n label?: ReactNode\n /**\n * Which direction counts as good.\n *\n * Required rather than assumed, because the assumption is wrong half the\n * time: revenue up is good, error rate up is not, and a component that\n * guesses will confidently colour a bad number green.\n */\n intent?: DeltaIntent\n /** Formats the change. Defaults to a signed percentage. */\n format?: (value: number) => string\n}\n\nexport interface BigNumberProps {\n /** What the number counts. */\n label: ReactNode\n /** The number, already formatted — this component does not guess a unit. */\n value: ReactNode\n delta?: BigNumberDelta\n /** A sparkline, a note, a caveat. Sits under the number. */\n children?: ReactNode\n className?: string\n}\n\nconst signed = (value: number): string =>\n `${value > 0 ? '+' : ''}${(value * 100).toFixed(1).replace(/\\.0$/, '')}%`\n\n/**\n * One number, at the size of a headline.\n *\n * The form most dashboards need most often and most chart libraries do not\n * ship, on the grounds that it is not a chart. It is the right answer whenever\n * there is exactly one figure to report: a plot of a single value is a plot\n * whose shape carries nothing, and the reader has to decode an axis to recover\n * a number that could simply have been printed.\n *\n * The delta is where this earns its place over a `<p>`. Direction is stated by\n * the CALL SITE (`intent`), never inferred: \"errors down 12%\" is good news and\n * \"revenue down 12%\" is not, and no component can tell which it is holding.\n * Where the direction is known, the arrow and the word carry it — the status\n * colour is the third signal, never the only one.\n *\n * @example\n * <BigNumber\n * label=\"Monthly revenue\"\n * value=\"$48,210\"\n * delta={{ value: 0.124, label: 'vs last month', intent: 'up-is-good' }}\n * />\n */\nexport function BigNumber({ label, value, delta, children, className }: BigNumberProps) {\n const intent = delta?.intent ?? 'neutral'\n const format = delta?.format ?? signed\n const rising = (delta?.value ?? 0) > 0\n const flat = (delta?.value ?? 0) === 0\n\n const good = intent === 'neutral' ? null : intent === 'up-is-good' ? rising : !rising\n const tone = flat || good === null ? 'text-(--ink-2)' : good ? 'text-(--ok)' : 'text-(--danger)'\n\n return (\n <div className={cn('flex flex-col gap-1', className)}>\n <span className=\"eyebrow text-(--ink-3-aa)\">{label}</span>\n\n {/* The serif, at the record-title step. A number this size is the page's\n headline, and the system sets headlines in the editorial face. */}\n <span className=\"font-heading text-[length:var(--fs-lead)] leading-none text-(--ink) tabular-nums\">\n {value}\n </span>\n\n {delta && (\n <span className={cn('flex items-baseline gap-1.5 mono-meta', tone)}>\n {/* The arrow is the second carrier and the word is the third, so the\n reading survives greyscale, forced colours and colour blindness —\n which the status tint alone does not. */}\n <span aria-hidden>{flat ? '→' : rising ? '↑' : '↓'}</span>\n <span>{format(delta.value)}</span>\n <span className=\"sr-only\">\n {flat ? 'no change' : rising ? 'up' : 'down'}\n {good === null ? '' : good ? ', better' : ', worse'}\n </span>\n {delta.label && <span className=\"text-(--ink-3-aa)\">{delta.label}</span>}\n </span>\n )}\n\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n )\n}\n\nexport default BigNumber\n"],"mappings":"AAsEM,cAeI,YAfJ;AArEN,SAAS,UAAU;AAiCnB,MAAM,SAAS,CAAC,UACd,GAAG,QAAQ,IAAI,MAAM,EAAE,IAAI,QAAQ,KAAK,QAAQ,CAAC,EAAE,QAAQ,QAAQ,EAAE,CAAC;AAwBjE,SAAS,UAAU,EAAE,OAAO,OAAO,OAAO,UAAU,UAAU,GAAmB;AACtF,QAAM,SAAS,OAAO,UAAU;AAChC,QAAM,SAAS,OAAO,UAAU;AAChC,QAAM,UAAU,OAAO,SAAS,KAAK;AACrC,QAAM,QAAQ,OAAO,SAAS,OAAO;AAErC,QAAM,OAAO,WAAW,YAAY,OAAO,WAAW,eAAe,SAAS,CAAC;AAC/E,QAAM,OAAO,QAAQ,SAAS,OAAO,mBAAmB,OAAO,gBAAgB;AAE/E,SACE,qBAAC,SAAI,WAAW,GAAG,uBAAuB,SAAS,GACjD;AAAA,wBAAC,UAAK,WAAU,6BAA6B,iBAAM;AAAA,IAInD,oBAAC,UAAK,WAAU,oFACb,iBACH;AAAA,IAEC,SACC,qBAAC,UAAK,WAAW,GAAG,yCAAyC,IAAI,GAI/D;AAAA,0BAAC,UAAK,eAAW,MAAE,iBAAO,WAAM,SAAS,WAAM,UAAI;AAAA,MACnD,oBAAC,UAAM,iBAAO,MAAM,KAAK,GAAE;AAAA,MAC3B,qBAAC,UAAK,WAAU,WACb;AAAA,eAAO,cAAc,SAAS,OAAO;AAAA,QACrC,SAAS,OAAO,KAAK,OAAO,aAAa;AAAA,SAC5C;AAAA,MACC,MAAM,SAAS,oBAAC,UAAK,WAAU,qBAAqB,gBAAM,OAAM;AAAA,OACnE;AAAA,IAGD,YAAY,oBAAC,SAAI,WAAU,QAAQ,UAAS;AAAA,KAC/C;AAEJ;AAEA,IAAO,oBAAQ;","names":[]}
@@ -0,0 +1,177 @@
1
+ import { ChartTooltipSlotProps } from '../AreaChart/AreaChart.js';
2
+ import { ChartXAxisProps, ChartYAxisProps } from '../BarChart/BarChart.js';
3
+ import * as react from 'react';
4
+ import { ReactNode, ComponentProps } from 'react';
5
+ import { BarChart, Bar, CartesianGrid } from 'recharts';
6
+ import { ChartConfig } from '../lib/chart.js';
7
+ import { ChartEmptyProps } from '../lib/empty.js';
8
+ import { ChartBackgroundVariant } from '../lib/background.js';
9
+ import { ReferenceLine, ReferenceBand, Annotation } from '../lib/annotations.js';
10
+ import '../lib/values.js';
11
+ import '../lib/sonify-control.js';
12
+ import '../lib/sonify.js';
13
+ import '../lib/brush.js';
14
+ import '../lib/toolbar.js';
15
+ import '../lib/zoom.js';
16
+ import '../lib/figure.js';
17
+ import '../lib/paint.js';
18
+ import '../lib/dot.js';
19
+ import '../lib/legend.js';
20
+ import '../lib/tooltip.js';
21
+ import 'recharts/types/component/DefaultTooltipContent';
22
+
23
+ /** Which way the boxes run. */
24
+ type BoxPlotOrientation = 'vertical' | 'horizontal';
25
+ /** A category summarised into the five numbers a box is drawn from. */
26
+ interface BoxPlotSummary {
27
+ /** What the box describes. Doubles as its key, so it must be unique. */
28
+ name: string;
29
+ /** The low whisker's end — the smallest observation inside the fence. */
30
+ min: number;
31
+ q1: number;
32
+ median: number;
33
+ q3: number;
34
+ /** The high whisker's end — the largest observation inside the fence. */
35
+ max: number;
36
+ /** Points outside the fences, drawn one dot each. */
37
+ outliers?: number[];
38
+ /**
39
+ * How many observations the box stands for.
40
+ *
41
+ * Needed for a notch, and worth carrying anyway: a box drawn from six points
42
+ * and a box drawn from six thousand look identical, and only one of them
43
+ * means anything.
44
+ */
45
+ count?: number;
46
+ }
47
+ /** A category handed over as raw observations, for the chart to summarise. */
48
+ interface BoxPlotSample {
49
+ /** What the box describes. Doubles as its key, so it must be unique. */
50
+ name: string;
51
+ /** Every observation in this category, in any order. */
52
+ values: number[];
53
+ min?: never;
54
+ q1?: never;
55
+ median?: never;
56
+ q3?: never;
57
+ max?: never;
58
+ }
59
+ /**
60
+ * One category: either the raw observations, or the summary itself.
61
+ *
62
+ * Both forms exist because both are real. A chart fed from a warehouse gets
63
+ * percentiles back from the query and never sees a row; a chart fed from a
64
+ * browser has the array in hand and should not have to compute quartiles to
65
+ * draw them.
66
+ */
67
+ type BoxPlotDatum = BoxPlotSample | (BoxPlotSummary & {
68
+ values?: never;
69
+ });
70
+ interface BoxPlotProps {
71
+ /**
72
+ * The single series — its label and its paint. Only the FIRST entry is read;
73
+ * a box plot has one measurement and as many categories as it has boxes.
74
+ */
75
+ config?: ChartConfig;
76
+ /** One entry per category, as raw observations or as a summary. */
77
+ data: BoxPlotDatum[];
78
+ /**
79
+ * What the chart shows, in a sentence a reader could act on. Required, and
80
+ * announced to a screen reader even when it is not printed.
81
+ */
82
+ title: string;
83
+ /** Prints the title above the plot instead of hiding it from sight. */
84
+ showTitle?: boolean;
85
+ /** A line under the title — the unit, the window, the caveat. */
86
+ description?: ReactNode;
87
+ /** The composed parts — axes, grid, tooltip, and `<BoxPlot.Boxes>`. */
88
+ children: ReactNode;
89
+ /** Merged onto the figure, last, so a call site can size or space it. */
90
+ className?: string;
91
+ /** Escape hatch onto the raw Recharts chart element. */
92
+ chartProps?: ComponentProps<typeof BarChart>;
93
+ /**
94
+ * Which way the boxes run. Reach for `horizontal` when the category names
95
+ * are long enough to need rotating under a column.
96
+ */
97
+ orientation?: BoxPlotOrientation;
98
+ /** Formats every number the chart prints — ticks, tooltip, table. */
99
+ formatValue?: (value: number) => string;
100
+ /** Drops the hidden table view. Only correct when the page prints the data itself. */
101
+ hideDataTable?: boolean;
102
+ /**
103
+ * What the chart shows when it has nothing to draw. `false` keeps the axes,
104
+ * for a chart whose emptiness is itself the reading.
105
+ */
106
+ empty?: ChartEmptyProps | false;
107
+ }
108
+ /**
109
+ * The spread of a measurement, per category — median, middle half, reach, and
110
+ * the points that sit outside it.
111
+ *
112
+ * The form to reach for when the question is "how variable is this", and the
113
+ * one that answers it in a tenth of the ink a histogram per category would
114
+ * take. Six response-time distributions fit across one screen as six boxes;
115
+ * as six histograms they do not fit at all.
116
+ *
117
+ * **What a box plot hides is multimodality.** A box is five numbers, and five
118
+ * numbers cannot tell a single hump from two. A bimodal distribution — a fast
119
+ * cache path and a slow database path, two cohorts inside one average — draws
120
+ * exactly the same box as a smooth one centred in the same place, and the
121
+ * reader has no way to tell from the picture that the middle of the box is a
122
+ * value almost nothing takes. It also hides sample size: a box over six points
123
+ * and a box over six thousand are drawn identically, which is why `count` is
124
+ * worth carrying and why a notch, which does read `count`, is worth turning on
125
+ * when medians are being compared. When the SHAPE of one distribution is the
126
+ * question, reach for `<Histogram>`; when there are few enough observations to
127
+ * draw them all, reach for `<ScatterChart>` and plot the points.
128
+ *
129
+ * Recharts earns its place here: the boxes need a shared value axis with real
130
+ * ticks, a category axis, a grid and a tooltip, which is most of a cartesian
131
+ * chart. What it does not have is a box mark, so each box is drawn as a custom
132
+ * shape over a range bar — the bar supplies the category band and the scale,
133
+ * and the glyph inside it is ours.
134
+ *
135
+ * @example
136
+ * <BoxPlot title="Response time by region" data={regions}>
137
+ * <BoxPlot.Grid />
138
+ * <BoxPlot.XAxis />
139
+ * <BoxPlot.YAxis label="ms" />
140
+ * <BoxPlot.Tooltip />
141
+ * <BoxPlot.Boxes showOutliers />
142
+ * </BoxPlot>
143
+ *
144
+ * @example
145
+ * // Raw observations, summarised for you with Tukey's fences.
146
+ * const data = [{ name: 'Sydney', values: [180, 194, 210, 205, 640] }]
147
+ */
148
+ declare function BoxPlot({ config, data, title, showTitle, description, children, className, chartProps, orientation, formatValue, hideDataTable, empty, }: BoxPlotProps): react.JSX.Element;
149
+ declare namespace BoxPlot {
150
+ var Boxes: ({ showOutliers, notch, barProps }: BoxPlotBoxesProps) => react.JSX.Element;
151
+ var XAxis: ({ dataKey, tickLine, axisLine, tickMargin, minTickGap, type, label, tickFormatter, domain, ...rest }: ChartXAxisProps) => react.JSX.Element;
152
+ var YAxis: ({ dataKey, tickLine, axisLine, tickMargin, minTickGap, width, type, label, tickFormatter, domain, ...rest }: ChartYAxisProps) => react.JSX.Element;
153
+ var Grid: ({ strokeDasharray, vertical, horizontal, ...rest }: ComponentProps<typeof CartesianGrid>) => react.JSX.Element;
154
+ var Tooltip: ({ variant, roundness, defaultIndex }: ChartTooltipSlotProps) => react.JSX.Element;
155
+ var Background: ({ variant }: {
156
+ variant: ChartBackgroundVariant;
157
+ }) => react.JSX.Element;
158
+ var ReferenceLine: typeof ReferenceLine;
159
+ var ReferenceBand: typeof ReferenceBand;
160
+ var Annotation: typeof Annotation;
161
+ }
162
+ interface BoxPlotBoxesProps {
163
+ /** Draws the points outside the fences as individual dots. */
164
+ showOutliers?: boolean;
165
+ /**
166
+ * Pinches the box in at the median by `1.58 × IQR / √n`.
167
+ *
168
+ * A confidence interval on the median drawn INSIDE the shape it belongs to,
169
+ * which is the only place a reader will actually look at it. Needs `count`
170
+ * on every box; a box without one is drawn square.
171
+ */
172
+ notch?: boolean;
173
+ /** Escape hatch onto the range bar the boxes are drawn over. */
174
+ barProps?: ComponentProps<typeof Bar>;
175
+ }
176
+
177
+ export { BoxPlot, type BoxPlotBoxesProps, type BoxPlotDatum, type BoxPlotOrientation, type BoxPlotProps, type BoxPlotSample, type BoxPlotSummary, BoxPlot as default };