@dodopayments/ui 1.3.0 → 1.5.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 (304) hide show
  1. package/ai/component-registry.json +642 -99
  2. package/ai/component-registry.md +4 -0
  3. package/ai/components/activity-timeline.md +3 -1
  4. package/ai/components/area-chart.md +4 -4
  5. package/ai/components/avatar.md +1 -1
  6. package/ai/components/bar-chart.md +18 -18
  7. package/ai/components/brand-logos.md +1 -1
  8. package/ai/components/button-group.md +65 -0
  9. package/ai/components/chart-tooltip.md +3 -3
  10. package/ai/components/chart.md +6 -6
  11. package/ai/components/checkout-page.md +1 -1
  12. package/ai/components/collapsible.md +1 -1
  13. package/ai/components/color-input.md +56 -0
  14. package/ai/components/composed-chart.md +7 -7
  15. package/ai/components/copyable-id.md +1 -0
  16. package/ai/components/data-grid.md +8 -5
  17. package/ai/components/file-upload.md +25 -1
  18. package/ai/components/filter-grid.md +4 -7
  19. package/ai/components/funnel-chart.md +14 -12
  20. package/ai/components/gauge-chart.md +9 -11
  21. package/ai/components/line-chart.md +2 -2
  22. package/ai/components/list-toolbar.md +3 -3
  23. package/ai/components/logo.md +3 -1
  24. package/ai/components/money.md +3 -3
  25. package/ai/components/pagination.md +1 -0
  26. package/ai/components/pie-chart.md +11 -2
  27. package/ai/components/product-card.md +2 -1
  28. package/ai/components/radio-group.md +85 -6
  29. package/ai/components/reorder-list.md +1 -1
  30. package/ai/components/ring-chart.md +17 -8
  31. package/ai/components/sale-share-card.md +48 -0
  32. package/ai/components/sankey-chart.md +23 -23
  33. package/ai/components/scaled-frame.md +41 -0
  34. package/ai/components/skeleton.md +1 -1
  35. package/ai/components/stat-card.md +32 -5
  36. package/ai/components/sunburst-chart.md +7 -4
  37. package/ai/components/test-mode-banner.md +3 -3
  38. package/ai/skills/dodo-charts/SKILL.md +12 -7
  39. package/ai/skills/dodo-design/SKILL.md +4 -2
  40. package/dist/components/activity-timeline/activity-timeline.d.ts +22 -2
  41. package/dist/components/activity-timeline/activity-timeline.d.ts.map +1 -1
  42. package/dist/components/activity-timeline/activity-timeline.js +11 -5
  43. package/dist/components/activity-timeline/activity-timeline.js.map +1 -1
  44. package/dist/components/avatar/avatar.d.ts +9 -7
  45. package/dist/components/avatar/avatar.d.ts.map +1 -1
  46. package/dist/components/avatar/avatar.js +9 -7
  47. package/dist/components/avatar/avatar.js.map +1 -1
  48. package/dist/components/brand-logos/brand-artwork.d.ts +16 -1
  49. package/dist/components/brand-logos/brand-artwork.d.ts.map +1 -1
  50. package/dist/components/brand-logos/brand-artwork.js +16 -1
  51. package/dist/components/brand-logos/brand-artwork.js.map +1 -1
  52. package/dist/components/brand-logos/brand-logos.d.ts +2 -2
  53. package/dist/components/brand-logos/brand-logos.d.ts.map +1 -1
  54. package/dist/components/brand-logos/brand-logos.js +7 -1
  55. package/dist/components/brand-logos/brand-logos.js.map +1 -1
  56. package/dist/components/button-group/button-group.d.ts +21 -0
  57. package/dist/components/button-group/button-group.d.ts.map +1 -0
  58. package/dist/components/button-group/button-group.js +16 -0
  59. package/dist/components/button-group/button-group.js.map +1 -0
  60. package/dist/components/button-group/index.d.ts +2 -0
  61. package/dist/components/button-group/index.d.ts.map +1 -0
  62. package/dist/components/button-group/index.js +2 -0
  63. package/dist/components/button-group/index.js.map +1 -0
  64. package/dist/components/color-input/color-input.d.ts +21 -0
  65. package/dist/components/color-input/color-input.d.ts.map +1 -0
  66. package/dist/components/color-input/color-input.js +28 -0
  67. package/dist/components/color-input/color-input.js.map +1 -0
  68. package/dist/components/color-input/index.d.ts +2 -0
  69. package/dist/components/color-input/index.d.ts.map +1 -0
  70. package/dist/components/color-input/index.js +2 -0
  71. package/dist/components/color-input/index.js.map +1 -0
  72. package/dist/components/copyable-id/copyable-id.d.ts +7 -1
  73. package/dist/components/copyable-id/copyable-id.d.ts.map +1 -1
  74. package/dist/components/copyable-id/copyable-id.js +21 -3
  75. package/dist/components/copyable-id/copyable-id.js.map +1 -1
  76. package/dist/components/data-grid/bulk-actions.d.ts +4 -2
  77. package/dist/components/data-grid/bulk-actions.d.ts.map +1 -1
  78. package/dist/components/data-grid/bulk-actions.js +65 -4
  79. package/dist/components/data-grid/bulk-actions.js.map +1 -1
  80. package/dist/components/data-grid/data-grid.d.ts +15 -4
  81. package/dist/components/data-grid/data-grid.d.ts.map +1 -1
  82. package/dist/components/data-grid/data-grid.js +57 -16
  83. package/dist/components/data-grid/data-grid.js.map +1 -1
  84. package/dist/components/data-grid/table.d.ts +1 -1
  85. package/dist/components/data-grid/table.d.ts.map +1 -1
  86. package/dist/components/data-grid/table.js +6 -1
  87. package/dist/components/data-grid/table.js.map +1 -1
  88. package/dist/components/file-upload/file-upload.d.ts +21 -0
  89. package/dist/components/file-upload/file-upload.d.ts.map +1 -1
  90. package/dist/components/file-upload/file-upload.js +42 -20
  91. package/dist/components/file-upload/file-upload.js.map +1 -1
  92. package/dist/components/file-upload/index.d.ts +1 -1
  93. package/dist/components/file-upload/index.d.ts.map +1 -1
  94. package/dist/components/file-upload/index.js +1 -1
  95. package/dist/components/file-upload/index.js.map +1 -1
  96. package/dist/components/filter-grid/filter-grid.d.ts +7 -2
  97. package/dist/components/filter-grid/filter-grid.d.ts.map +1 -1
  98. package/dist/components/filter-grid/filter-grid.js +3 -2
  99. package/dist/components/filter-grid/filter-grid.js.map +1 -1
  100. package/dist/components/funnel-chart/funnel-chart.d.ts +3 -2
  101. package/dist/components/funnel-chart/funnel-chart.d.ts.map +1 -1
  102. package/dist/components/funnel-chart/funnel-chart.js +3 -2
  103. package/dist/components/funnel-chart/funnel-chart.js.map +1 -1
  104. package/dist/components/gauge-chart/gauge-chart.d.ts +3 -4
  105. package/dist/components/gauge-chart/gauge-chart.d.ts.map +1 -1
  106. package/dist/components/gauge-chart/gauge-chart.js +3 -4
  107. package/dist/components/gauge-chart/gauge-chart.js.map +1 -1
  108. package/dist/components/list-toolbar/list-toolbar.d.ts +3 -3
  109. package/dist/components/list-toolbar/list-toolbar.js +4 -4
  110. package/dist/components/list-toolbar/list-toolbar.js.map +1 -1
  111. package/dist/components/live-activity/live-activity.d.ts.map +1 -1
  112. package/dist/components/live-activity/live-activity.js +8 -3
  113. package/dist/components/live-activity/live-activity.js.map +1 -1
  114. package/dist/components/logo/logo.d.ts +5 -1
  115. package/dist/components/logo/logo.d.ts.map +1 -1
  116. package/dist/components/logo/logo.js +6 -2
  117. package/dist/components/logo/logo.js.map +1 -1
  118. package/dist/components/page-header/page-header.d.ts.map +1 -1
  119. package/dist/components/page-header/page-header.js +4 -2
  120. package/dist/components/page-header/page-header.js.map +1 -1
  121. package/dist/components/pagination/pagination.d.ts +7 -1
  122. package/dist/components/pagination/pagination.d.ts.map +1 -1
  123. package/dist/components/pagination/pagination.js +7 -4
  124. package/dist/components/pagination/pagination.js.map +1 -1
  125. package/dist/components/payment-method-list/payment-method-list.d.ts.map +1 -1
  126. package/dist/components/payment-method-list/payment-method-list.js +4 -1
  127. package/dist/components/payment-method-list/payment-method-list.js.map +1 -1
  128. package/dist/components/product-card/product-card.d.ts +8 -2
  129. package/dist/components/product-card/product-card.d.ts.map +1 -1
  130. package/dist/components/product-card/product-card.js +2 -2
  131. package/dist/components/product-card/product-card.js.map +1 -1
  132. package/dist/components/radio-group/radio-group.d.ts +28 -6
  133. package/dist/components/radio-group/radio-group.d.ts.map +1 -1
  134. package/dist/components/radio-group/radio-group.js +37 -4
  135. package/dist/components/radio-group/radio-group.js.map +1 -1
  136. package/dist/components/sale-share-card/index.d.ts +2 -0
  137. package/dist/components/sale-share-card/index.d.ts.map +1 -0
  138. package/dist/components/sale-share-card/index.js +2 -0
  139. package/dist/components/sale-share-card/index.js.map +1 -0
  140. package/dist/components/sale-share-card/sale-share-card.d.ts +27 -0
  141. package/dist/components/sale-share-card/sale-share-card.d.ts.map +1 -0
  142. package/dist/components/sale-share-card/sale-share-card.js +46 -0
  143. package/dist/components/sale-share-card/sale-share-card.js.map +1 -0
  144. package/dist/components/sankey-chart/sankey-chart.d.ts +4 -4
  145. package/dist/components/sankey-chart/sankey-chart.js +4 -4
  146. package/dist/components/scaled-frame/index.d.ts +2 -0
  147. package/dist/components/scaled-frame/index.d.ts.map +1 -0
  148. package/dist/components/scaled-frame/index.js +2 -0
  149. package/dist/components/scaled-frame/index.js.map +1 -0
  150. package/dist/components/scaled-frame/scaled-frame.d.ts +17 -0
  151. package/dist/components/scaled-frame/scaled-frame.d.ts.map +1 -0
  152. package/dist/components/scaled-frame/scaled-frame.js +43 -0
  153. package/dist/components/scaled-frame/scaled-frame.js.map +1 -0
  154. package/dist/components/skeleton/skeleton.d.ts +1 -1
  155. package/dist/components/skeleton/skeleton.d.ts.map +1 -1
  156. package/dist/components/skeleton/skeleton.js +13 -9
  157. package/dist/components/skeleton/skeleton.js.map +1 -1
  158. package/dist/components/slider/slider-thumb.d.ts +2 -2
  159. package/dist/components/slider/slider-thumb.d.ts.map +1 -1
  160. package/dist/components/slider/slider-thumb.js +2 -2
  161. package/dist/components/slider/slider-thumb.js.map +1 -1
  162. package/dist/components/slider/slider.js +1 -1
  163. package/dist/components/slider/slider.js.map +1 -1
  164. package/dist/components/stat-card/index.d.ts +1 -1
  165. package/dist/components/stat-card/index.d.ts.map +1 -1
  166. package/dist/components/stat-card/index.js +1 -1
  167. package/dist/components/stat-card/index.js.map +1 -1
  168. package/dist/components/stat-card/stat-card.d.ts +47 -7
  169. package/dist/components/stat-card/stat-card.d.ts.map +1 -1
  170. package/dist/components/stat-card/stat-card.js +72 -12
  171. package/dist/components/stat-card/stat-card.js.map +1 -1
  172. package/dist/components/sunburst-chart/sunburst-chart.d.ts +2 -1
  173. package/dist/components/sunburst-chart/sunburst-chart.d.ts.map +1 -1
  174. package/dist/components/sunburst-chart/sunburst-chart.js +2 -1
  175. package/dist/components/sunburst-chart/sunburst-chart.js.map +1 -1
  176. package/dist/components/timestamp/timestamp.js +1 -1
  177. package/dist/components/timestamp/timestamp.js.map +1 -1
  178. package/dist/icons/index.d.ts +5 -2
  179. package/dist/icons/index.js +5 -2
  180. package/dist/icons/ui/coins.d.ts +3 -0
  181. package/dist/icons/ui/coins.js +5 -0
  182. package/dist/icons/ui/report.d.ts +3 -0
  183. package/dist/icons/ui/report.js +5 -0
  184. package/dist/icons/ui/ticket.d.ts +3 -0
  185. package/dist/icons/ui/ticket.js +5 -0
  186. package/dist/index.d.ts +1 -0
  187. package/dist/index.d.ts.map +1 -1
  188. package/dist/index.js +1 -0
  189. package/dist/index.js.map +1 -1
  190. package/dist/lib/cn-tables.js +5 -5
  191. package/dist/lib/cn-tables.js.map +1 -1
  192. package/dist/primitives/charts/area-chart.js +1 -1
  193. package/dist/primitives/charts/area-chart.js.map +1 -1
  194. package/dist/primitives/charts/area.d.ts +1 -1
  195. package/dist/primitives/charts/area.d.ts.map +1 -1
  196. package/dist/primitives/charts/bar-chart.js +1 -1
  197. package/dist/primitives/charts/bar-chart.js.map +1 -1
  198. package/dist/primitives/charts/bar-squares.d.ts +1 -1
  199. package/dist/primitives/charts/bar-squares.d.ts.map +1 -1
  200. package/dist/primitives/charts/bar.d.ts +6 -5
  201. package/dist/primitives/charts/bar.d.ts.map +1 -1
  202. package/dist/primitives/charts/bar.js +1 -1
  203. package/dist/primitives/charts/bar.js.map +1 -1
  204. package/dist/primitives/charts/chart-context.js +2 -2
  205. package/dist/primitives/charts/chart-context.js.map +1 -1
  206. package/dist/primitives/charts/composed-chart.js +3 -3
  207. package/dist/primitives/charts/composed-chart.js.map +1 -1
  208. package/dist/primitives/charts/funnel-chart.d.ts +12 -8
  209. package/dist/primitives/charts/funnel-chart.d.ts.map +1 -1
  210. package/dist/primitives/charts/funnel-chart.js +38 -9
  211. package/dist/primitives/charts/funnel-chart.js.map +1 -1
  212. package/dist/primitives/charts/gauge.d.ts +4 -4
  213. package/dist/primitives/charts/gauge.js +7 -7
  214. package/dist/primitives/charts/gauge.js.map +1 -1
  215. package/dist/primitives/charts/line-chart.js +1 -1
  216. package/dist/primitives/charts/line-chart.js.map +1 -1
  217. package/dist/primitives/charts/line-series-terminal-marker.d.ts.map +1 -1
  218. package/dist/primitives/charts/line-series-terminal-marker.js +1 -1
  219. package/dist/primitives/charts/line-series-terminal-marker.js.map +1 -1
  220. package/dist/primitives/charts/line.d.ts +1 -1
  221. package/dist/primitives/charts/line.d.ts.map +1 -1
  222. package/dist/primitives/charts/notch-gauge-shared.d.ts.map +1 -1
  223. package/dist/primitives/charts/notch-gauge-shared.js +4 -3
  224. package/dist/primitives/charts/notch-gauge-shared.js.map +1 -1
  225. package/dist/primitives/charts/pie-context.d.ts +3 -2
  226. package/dist/primitives/charts/pie-context.d.ts.map +1 -1
  227. package/dist/primitives/charts/pie-context.js +7 -6
  228. package/dist/primitives/charts/pie-context.js.map +1 -1
  229. package/dist/primitives/charts/pie-slice.d.ts +2 -2
  230. package/dist/primitives/charts/pie-slice.js +1 -1
  231. package/dist/primitives/charts/pie-slice.js.map +1 -1
  232. package/dist/primitives/charts/ring-context.d.ts +4 -2
  233. package/dist/primitives/charts/ring-context.d.ts.map +1 -1
  234. package/dist/primitives/charts/ring-context.js +8 -6
  235. package/dist/primitives/charts/ring-context.js.map +1 -1
  236. package/dist/primitives/charts/ring.d.ts +8 -8
  237. package/dist/primitives/charts/ring.d.ts.map +1 -1
  238. package/dist/primitives/charts/ring.js +4 -4
  239. package/dist/primitives/charts/ring.js.map +1 -1
  240. package/dist/primitives/charts/sankey/sankey-link.d.ts +9 -10
  241. package/dist/primitives/charts/sankey/sankey-link.d.ts.map +1 -1
  242. package/dist/primitives/charts/sankey/sankey-link.js +14 -9
  243. package/dist/primitives/charts/sankey/sankey-link.js.map +1 -1
  244. package/dist/primitives/charts/sankey/sankey-node.d.ts +5 -5
  245. package/dist/primitives/charts/sankey/sankey-node.d.ts.map +1 -1
  246. package/dist/primitives/charts/sankey/sankey-node.js +6 -6
  247. package/dist/primitives/charts/sankey/sankey-node.js.map +1 -1
  248. package/dist/primitives/charts/series-bar.d.ts +4 -4
  249. package/dist/primitives/charts/series-bar.d.ts.map +1 -1
  250. package/dist/primitives/charts/series-bar.js +1 -1
  251. package/dist/primitives/charts/series-bar.js.map +1 -1
  252. package/dist/primitives/charts/sunburst-context.d.ts +3 -2
  253. package/dist/primitives/charts/sunburst-context.d.ts.map +1 -1
  254. package/dist/primitives/charts/sunburst-context.js +6 -5
  255. package/dist/primitives/charts/sunburst-context.js.map +1 -1
  256. package/dist/primitives/charts/sunburst-legend.d.ts +7 -2
  257. package/dist/primitives/charts/sunburst-legend.d.ts.map +1 -1
  258. package/dist/primitives/charts/sunburst-legend.js +8 -6
  259. package/dist/primitives/charts/sunburst-legend.js.map +1 -1
  260. package/dist/primitives/charts/sunburst-segment.d.ts +3 -3
  261. package/dist/primitives/charts/sunburst-segment.js +2 -2
  262. package/dist/primitives/charts/sunburst-segment.js.map +1 -1
  263. package/dist/primitives/charts/tooltip/date-ticker.js +2 -2
  264. package/dist/primitives/charts/tooltip/date-ticker.js.map +1 -1
  265. package/dist/primitives/charts/tooltip/tooltip-box.js +1 -1
  266. package/dist/primitives/charts/tooltip/tooltip-box.js.map +1 -1
  267. package/dist/primitives/ui/alert-dialog.js +1 -1
  268. package/dist/primitives/ui/alert-dialog.js.map +1 -1
  269. package/dist/primitives/ui/autocomplete.js +1 -1
  270. package/dist/primitives/ui/autocomplete.js.map +1 -1
  271. package/dist/primitives/ui/dialog.js +1 -1
  272. package/dist/primitives/ui/dialog.js.map +1 -1
  273. package/dist/primitives/ui/drawer.js +1 -1
  274. package/dist/primitives/ui/drawer.js.map +1 -1
  275. package/dist/primitives/ui/popover.js +1 -1
  276. package/dist/primitives/ui/popover.js.map +1 -1
  277. package/dist/primitives/ui/preview-card.js +1 -1
  278. package/dist/primitives/ui/preview-card.js.map +1 -1
  279. package/dist/primitives/ui/sheet.js +2 -2
  280. package/dist/primitives/ui/sheet.js.map +1 -1
  281. package/dist/primitives/ui/slider.js +1 -1
  282. package/dist/primitives/ui/slider.js.map +1 -1
  283. package/dist/primitives/ui/switch.d.ts +1 -1
  284. package/dist/primitives/ui/switch.d.ts.map +1 -1
  285. package/dist/primitives/ui/switch.js +1 -1
  286. package/dist/primitives/ui/switch.js.map +1 -1
  287. package/dist/primitives/ui/table.js +2 -2
  288. package/dist/primitives/ui/table.js.map +1 -1
  289. package/dist/primitives/ui/toast.js +2 -2
  290. package/dist/primitives/ui/toast.js.map +1 -1
  291. package/dist/primitives/ui/tooltip.js +1 -1
  292. package/dist/primitives/ui/tooltip.js.map +1 -1
  293. package/dist/styles/theme.css +9 -0
  294. package/dist/styles/tokens.css +96 -36
  295. package/dist/styles/tokens.test.tsx +20 -2
  296. package/dist/theme/color.d.ts +5 -0
  297. package/dist/theme/color.d.ts.map +1 -1
  298. package/dist/theme/color.js +22 -0
  299. package/dist/theme/color.js.map +1 -1
  300. package/dist/theme/css.d.ts +3 -3
  301. package/dist/theme/css.d.ts.map +1 -1
  302. package/dist/theme/css.js +29 -11
  303. package/dist/theme/css.js.map +1 -1
  304. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://dodo-ui.dev/schema/component-registry.json",
3
3
  "name": "@dodopayments/ui",
4
- "version": "1.3.0",
4
+ "version": "1.5.0",
5
5
  "components": [
6
6
  {
7
7
  "slug": "alert",
@@ -336,7 +336,7 @@
336
336
  "name": "fill",
337
337
  "type": "string",
338
338
  "required": false,
339
- "description": "Fill color for the area gradient start. Default: var(--chart-1)",
339
+ "description": "Fill color for the area gradient start. Default: var(--chart-solid-1)",
340
340
  "source": "dodo"
341
341
  },
342
342
  {
@@ -582,7 +582,7 @@
582
582
  "examples": [
583
583
  {
584
584
  "name": "area-chart/default",
585
- "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, XAxis, YAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Daily gross revenue for September.\nconst data = Array.from({ length: 30 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n revenue: Math.round(4200 + 1500 * Math.sin(day / 4) + 110 * day),\n}));\n\nconst usd = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\nconst usdCompact = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n notation: \"compact\",\n});\n\nexport default function AreaChartDefault() {\n return (\n <AreaChart data={data} label=\"Gross revenue, September 2026\" margin={{ left: 56 }}>\n <ChartGrid horizontal />\n <Area dataKey=\"revenue\" />\n <XAxis />\n <YAxis formatValue={(value) => usdCompact.format(value)} />\n <ChartTooltip\n rows={(point) => [\n { color: \"var(--chart-1)\", label: \"Gross revenue\", value: usd.format(point[\"revenue\"] as number) },\n ]}\n />\n </AreaChart>\n );\n}"
585
+ "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, XAxis, YAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Daily gross revenue for September.\nconst data = Array.from({ length: 30 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n revenue: Math.round(4200 + 1500 * Math.sin(day / 4) + 110 * day),\n}));\n\nconst usd = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\nconst usdCompact = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n notation: \"compact\",\n});\n\nexport default function AreaChartDefault() {\n return (\n <AreaChart data={data} label=\"Gross revenue, September 2026\" margin={{ left: 56 }}>\n <ChartGrid horizontal />\n <Area dataKey=\"revenue\" />\n <XAxis />\n <YAxis formatValue={(value) => usdCompact.format(value)} />\n <ChartTooltip\n rows={(point) => [\n { color: \"var(--chart-solid-1)\", label: \"Gross revenue\", value: usd.format(point[\"revenue\"] as number) },\n ]}\n />\n </AreaChart>\n );\n}"
586
586
  },
587
587
  {
588
588
  "name": "area-chart/loading",
@@ -590,11 +590,11 @@
590
590
  },
591
591
  {
592
592
  "name": "area-chart/multiple",
593
- "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { Legend, LegendItem, LegendLabel, LegendMarker } from \"@dodopayments/ui/chart-legend\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Weekly revenue by plan, for one quarter.\nconst data = Array.from({ length: 13 }, (_, week) => ({\n date: new Date(2026, 6, 6 + week * 7),\n scale: Math.round(9200 + 2100 * Math.sin(week / 3) + 380 * week),\n growth: Math.round(6100 + 1200 * Math.cos(week / 2.5) + 210 * week),\n starter: Math.round(2400 + 500 * Math.sin(week / 2) + 90 * week),\n}));\n\nconst series = [\n { key: \"scale\", label: \"Scale\", color: \"var(--chart-1)\" },\n { key: \"growth\", label: \"Growth\", color: \"var(--chart-2)\" },\n { key: \"starter\", label: \"Starter\", color: \"var(--chart-3)\" },\n] as const;\n\nconst legendItems = series.map(({ label, color }) => ({ label, value: 0, color }));\n\nconst usd = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\n\nexport default function AreaChartMultiple() {\n return (\n <div className=\"flex w-full flex-col gap-3\">\n <Legend items={legendItems} className=\"flex-row flex-wrap gap-1\">\n <LegendItem className=\"flex items-center gap-2\">\n <LegendMarker />\n <LegendLabel />\n </LegendItem>\n </Legend>\n <AreaChart data={data} label=\"Weekly revenue by plan, Q3 2026\">\n <ChartGrid horizontal />\n {series.map(({ key, color }) => (\n <Area key={key} dataKey={key} fill={color} fillOpacity={0.25} />\n ))}\n <XAxis />\n <ChartTooltip\n rows={(point) =>\n series.map(({ key, label, color }) => ({\n color,\n label,\n value: usd.format(point[key] as number),\n }))\n }\n />\n </AreaChart>\n </div>\n );\n}"
593
+ "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { Legend, LegendItem, LegendLabel, LegendMarker } from \"@dodopayments/ui/chart-legend\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Weekly revenue by plan, for one quarter.\nconst data = Array.from({ length: 13 }, (_, week) => ({\n date: new Date(2026, 6, 6 + week * 7),\n scale: Math.round(9200 + 2100 * Math.sin(week / 3) + 380 * week),\n growth: Math.round(6100 + 1200 * Math.cos(week / 2.5) + 210 * week),\n starter: Math.round(2400 + 500 * Math.sin(week / 2) + 90 * week),\n}));\n\nconst series = [\n { key: \"scale\", label: \"Scale\", color: \"var(--chart-solid-1)\" },\n { key: \"growth\", label: \"Growth\", color: \"var(--chart-2)\" },\n { key: \"starter\", label: \"Starter\", color: \"var(--chart-3)\" },\n] as const;\n\nconst legendItems = series.map(({ label, color }) => ({ label, value: 0, color }));\n\nconst usd = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\n\nexport default function AreaChartMultiple() {\n return (\n <div className=\"flex w-full flex-col gap-3\">\n <Legend items={legendItems} className=\"flex-row flex-wrap gap-1\">\n <LegendItem className=\"flex items-center gap-2\">\n <LegendMarker />\n <LegendLabel />\n </LegendItem>\n </Legend>\n <AreaChart data={data} label=\"Weekly revenue by plan, Q3 2026\">\n <ChartGrid horizontal />\n {series.map(({ key, color }) => (\n <Area key={key} dataKey={key} fill={color} fillOpacity={0.25} />\n ))}\n <XAxis />\n <ChartTooltip\n rows={(point) =>\n series.map(({ key, label, color }) => ({\n color,\n label,\n value: usd.format(point[key] as number),\n }))\n }\n />\n </AreaChart>\n </div>\n );\n}"
594
594
  },
595
595
  {
596
596
  "name": "area-chart/reference-area",
597
- "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, ReferenceArea, XAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Daily checkouts for September, with a launch promotion from Sep 12 to Sep 18.\nconst data = Array.from({ length: 30 }, (_, day) => {\n const promo = day >= 11 && day <= 17 ? 380 : 0;\n return {\n date: new Date(2026, 8, 1 + day),\n checkouts: Math.round(820 + 160 * Math.sin(day / 3.5) + 9 * day + promo),\n };\n});\n\nexport default function AreaChartReferenceArea() {\n return (\n <AreaChart data={data} label=\"Daily checkouts, September 2026, with the launch promotion marked\">\n <ChartGrid horizontal />\n <ReferenceArea\n x1={new Date(2026, 8, 12)}\n x2={new Date(2026, 8, 18)}\n pattern=\"diagonal\"\n patternColor=\"var(--chart-scale-pattern-color)\"\n strokeStyle=\"dashed\"\n />\n <Area dataKey=\"checkouts\" fill=\"var(--chart-1)\" />\n <XAxis />\n <ChartTooltip />\n </AreaChart>\n );\n}"
597
+ "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, ReferenceArea, XAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Daily checkouts for September, with a launch promotion from Sep 12 to Sep 18.\nconst data = Array.from({ length: 30 }, (_, day) => {\n const promo = day >= 11 && day <= 17 ? 380 : 0;\n return {\n date: new Date(2026, 8, 1 + day),\n checkouts: Math.round(820 + 160 * Math.sin(day / 3.5) + 9 * day + promo),\n };\n});\n\nexport default function AreaChartReferenceArea() {\n return (\n <AreaChart data={data} label=\"Daily checkouts, September 2026, with the launch promotion marked\">\n <ChartGrid horizontal />\n <ReferenceArea\n x1={new Date(2026, 8, 12)}\n x2={new Date(2026, 8, 18)}\n pattern=\"diagonal\"\n patternColor=\"var(--chart-scale-pattern-color)\"\n strokeStyle=\"dashed\"\n />\n <Area dataKey=\"checkouts\" fill=\"var(--chart-solid-1)\" />\n <XAxis />\n <ChartTooltip />\n </AreaChart>\n );\n}"
598
598
  }
599
599
  ],
600
600
  "docsUrl": "/charts#area-chart"
@@ -703,11 +703,11 @@
703
703
  },
704
704
  {
705
705
  "value": "purple",
706
- "description": "The `warning` tone: a soft amber fill with amber initials."
706
+ "description": "The violet category tone: a soft violet fill with violet initials."
707
707
  },
708
708
  {
709
709
  "value": "pink",
710
- "description": "The `error` tone: a soft red fill with red initials."
710
+ "description": "The pink category tone: a soft pink fill with pink initials."
711
711
  },
712
712
  {
713
713
  "value": "lime",
@@ -1547,7 +1547,7 @@
1547
1547
  "name": "fill",
1548
1548
  "type": "string",
1549
1549
  "required": false,
1550
- "description": "Fill color for the bar. Can be a color, gradient url, or pattern url. Default: var(--chart-1)",
1550
+ "description": "Fill color for the bar. Can be a color, gradient url, or pattern url. Default: var(--chart-solid-1)",
1551
1551
  "source": "dodo"
1552
1552
  },
1553
1553
  {
@@ -1603,7 +1603,7 @@
1603
1603
  "name": "variant",
1604
1604
  "type": "\"tint\" | \"solid\"",
1605
1605
  "required": false,
1606
- "description": "`\"tint\"`: the radar look, an opaque 20% wash of the colour (mixed into the card, so gridlines stay behind it) with\na solid 3px edge at the value end (35% while hovered).\n`\"solid\"`: the full colour. A gradient or pattern `fill` without `stroke`, and `perspective` bars, stay solid.\nDefault: \"tint\"",
1606
+ "description": "`\"solid\"`: the full colour, the default look of the bar charts.\n`\"tint\"`: the radar look, an opaque 20% wash of the colour (mixed into the card, so gridlines stay behind it) with\na solid 3px edge at the value end (35% while hovered). A gradient or pattern `fill` without `stroke`, and\n`perspective` bars, stay solid.\nDefault: \"solid\"",
1607
1607
  "source": "dodo"
1608
1608
  },
1609
1609
  {
@@ -1780,7 +1780,7 @@
1780
1780
  "name": "fill",
1781
1781
  "type": "string",
1782
1782
  "required": false,
1783
- "description": "Fill color. Default: var(--chart-1)",
1783
+ "description": "Fill color. Default: var(--chart-solid-1)",
1784
1784
  "source": "dodo"
1785
1785
  },
1786
1786
  {
@@ -1801,7 +1801,7 @@
1801
1801
  "name": "variant",
1802
1802
  "type": "\"tint\" | \"solid\"",
1803
1803
  "required": false,
1804
- "description": "`\"tint\"`: the look of `Bar`, an opaque 20% wash of the colour (35% for the hovered point) with a solid 3px edge\nalong the top. `\"solid\"`: the full colour. A gradient or pattern `fill` without `stroke` stays solid.\nDefault: \"tint\"",
1804
+ "description": "`\"solid\"`: the full colour, as `Bar`. `\"tint\"`: an opaque 20% wash of the colour (35% for the hovered point)\nwith a solid 3px edge along the top. A gradient or pattern `fill` without `stroke` stays solid.\nDefault: \"solid\"",
1805
1805
  "source": "dodo"
1806
1806
  }
1807
1807
  ]
@@ -1890,7 +1890,7 @@
1890
1890
  "name": "fill",
1891
1891
  "type": "string",
1892
1892
  "required": false,
1893
- "description": "Fill color, gradient url, or pattern url. Default: var(--chart-1)",
1893
+ "description": "Fill color, gradient url, or pattern url. Default: var(--chart-solid-1)",
1894
1894
  "source": "dodo"
1895
1895
  },
1896
1896
  {
@@ -2076,11 +2076,11 @@
2076
2076
  "examples": [
2077
2077
  {
2078
2078
  "name": "bar-chart/grouped",
2079
- "code": "\"use client\";\n\nimport { Bar, BarChart, BarXAxis } from \"@dodopayments/ui/bar-chart\";\nimport { ChartGrid } from \"@dodopayments/ui/chart\";\nimport { Legend, LegendItem, LegendLabel, LegendMarker } from \"@dodopayments/ui/chart-legend\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Monthly gross revenue and net revenue (after refunds and fees), first half of 2026.\nconst data = [\n { month: \"Jan\", gross: 42800, net: 37100 },\n { month: \"Feb\", gross: 46300, net: 40200 },\n { month: \"Mar\", gross: 44100, net: 38400 },\n { month: \"Apr\", gross: 51900, net: 45600 },\n { month: \"May\", gross: 55200, net: 48100 },\n { month: \"Jun\", gross: 61400, net: 53900 },\n];\n\nconst legendItems = [\n { label: \"Gross revenue\", value: 0, color: \"var(--chart-1)\" },\n { label: \"Net revenue\", value: 0, color: \"var(--chart-2)\" },\n];\n\nconst usd = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\n\nexport default function BarChartGrouped() {\n return (\n <div className=\"flex w-full flex-col gap-3\">\n <Legend items={legendItems} className=\"flex-row flex-wrap gap-1\">\n <LegendItem className=\"flex items-center gap-2\">\n <LegendMarker variant=\"bar\" />\n <LegendLabel />\n </LegendItem>\n </Legend>\n <BarChart data={data} xDataKey=\"month\" label=\"Gross and net revenue by month, January to June 2026\">\n <ChartGrid horizontal />\n <Bar dataKey=\"gross\" fill=\"var(--chart-1)\" />\n <Bar dataKey=\"net\" fill=\"var(--chart-2)\" />\n <BarXAxis />\n <ChartTooltip\n rows={(point) => [\n { color: \"var(--chart-1)\", label: \"Gross\", value: usd.format(point.gross as number) },\n { color: \"var(--chart-2)\", label: \"Net\", value: usd.format(point.net as number) },\n ]}\n />\n </BarChart>\n </div>\n );\n}"
2079
+ "code": "\"use client\";\n\nimport { Bar, BarChart, BarXAxis } from \"@dodopayments/ui/bar-chart\";\nimport { ChartGrid } from \"@dodopayments/ui/chart\";\nimport { Legend, LegendItem, LegendLabel, LegendMarker } from \"@dodopayments/ui/chart-legend\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Monthly gross revenue and net revenue (after refunds and fees), first half of 2026.\nconst data = [\n { month: \"Jan\", gross: 42800, net: 37100 },\n { month: \"Feb\", gross: 46300, net: 40200 },\n { month: \"Mar\", gross: 44100, net: 38400 },\n { month: \"Apr\", gross: 51900, net: 45600 },\n { month: \"May\", gross: 55200, net: 48100 },\n { month: \"Jun\", gross: 61400, net: 53900 },\n];\n\nconst legendItems = [\n { label: \"Gross revenue\", value: 0, color: \"var(--chart-solid-1)\" },\n { label: \"Net revenue\", value: 0, color: \"var(--chart-solid-2)\" },\n];\n\nconst usd = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\n\nexport default function BarChartGrouped() {\n return (\n <div className=\"flex w-full flex-col gap-3\">\n <Legend items={legendItems} className=\"flex-row flex-wrap gap-1\">\n <LegendItem className=\"flex items-center gap-2\">\n <LegendMarker />\n <LegendLabel />\n </LegendItem>\n </Legend>\n <BarChart data={data} xDataKey=\"month\" label=\"Gross and net revenue by month, January to June 2026\">\n <ChartGrid horizontal />\n <Bar dataKey=\"gross\" fill=\"var(--chart-solid-1)\" />\n <Bar dataKey=\"net\" fill=\"var(--chart-solid-2)\" />\n <BarXAxis />\n <ChartTooltip\n rows={(point) => [\n { color: \"var(--chart-solid-1)\", label: \"Gross\", value: usd.format(point.gross as number) },\n { color: \"var(--chart-solid-2)\", label: \"Net\", value: usd.format(point.net as number) },\n ]}\n />\n </BarChart>\n </div>\n );\n}"
2080
2080
  },
2081
2081
  {
2082
2082
  "name": "bar-chart/horizontal",
2083
- "code": "\"use client\";\n\nimport { Bar, BarChart, BarYAxis } from \"@dodopayments/ui/bar-chart\";\nimport { ChartGrid } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Top products by revenue, last 30 days.\nconst data = [\n { product: \"Pro plan\", revenue: 48200 },\n { product: \"Team plan\", revenue: 36900 },\n { product: \"API credits\", revenue: 21400 },\n { product: \"Starter plan\", revenue: 15800 },\n { product: \"Add-on seats\", revenue: 9300 },\n];\n\nconst usd = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\n\nexport default function BarChartHorizontal() {\n return (\n <BarChart\n data={data}\n xDataKey=\"product\"\n orientation=\"horizontal\"\n margin={{ left: 96 }}\n aspectRatio=\"5 / 2\"\n label=\"Top products by revenue, last 30 days\"\n >\n <ChartGrid horizontal={false} vertical />\n <Bar dataKey=\"revenue\" fill=\"var(--chart-1)\" />\n <BarYAxis />\n <ChartTooltip\n showCrosshair={false}\n rows={(point) => [\n { color: \"var(--chart-1)\", label: \"Revenue\", value: usd.format(point.revenue as number) },\n ]}\n />\n </BarChart>\n );\n}"
2083
+ "code": "\"use client\";\n\nimport { Bar, BarChart, BarYAxis } from \"@dodopayments/ui/bar-chart\";\nimport { ChartGrid } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Top products by revenue, last 30 days.\nconst data = [\n { product: \"Pro plan\", revenue: 48200 },\n { product: \"Team plan\", revenue: 36900 },\n { product: \"API credits\", revenue: 21400 },\n { product: \"Starter plan\", revenue: 15800 },\n { product: \"Add-on seats\", revenue: 9300 },\n];\n\nconst usd = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\n\nexport default function BarChartHorizontal() {\n return (\n <BarChart\n data={data}\n xDataKey=\"product\"\n orientation=\"horizontal\"\n margin={{ left: 96 }}\n aspectRatio=\"5 / 2\"\n label=\"Top products by revenue, last 30 days\"\n >\n <ChartGrid horizontal={false} vertical />\n <Bar dataKey=\"revenue\" fill=\"var(--chart-solid-1)\" />\n <BarYAxis />\n <ChartTooltip\n showCrosshair={false}\n rows={(point) => [\n { color: \"var(--chart-solid-1)\", label: \"Revenue\", value: usd.format(point.revenue as number) },\n ]}\n />\n </BarChart>\n );\n}"
2084
2084
  },
2085
2085
  {
2086
2086
  "name": "bar-chart/loading",
@@ -2088,7 +2088,7 @@
2088
2088
  },
2089
2089
  {
2090
2090
  "name": "bar-chart/stacked",
2091
- "code": "\"use client\";\n\nimport { Bar, BarChart, BarXAxis } from \"@dodopayments/ui/bar-chart\";\nimport { ChartGrid } from \"@dodopayments/ui/chart\";\nimport { Legend, LegendItem, LegendLabel, LegendMarker } from \"@dodopayments/ui/chart-legend\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Weekly payouts, split by payout method.\nconst data = [\n { week: \"W1\", bank: 18200, card: 6400, wallet: 2100 },\n { week: \"W2\", bank: 21500, card: 7100, wallet: 2600 },\n { week: \"W3\", bank: 19800, card: 6900, wallet: 3200 },\n { week: \"W4\", bank: 24300, card: 8200, wallet: 3800 },\n { week: \"W5\", bank: 22700, card: 7600, wallet: 4100 },\n { week: \"W6\", bank: 26900, card: 9100, wallet: 4700 },\n];\n\nconst series = [\n { key: \"bank\", label: \"Bank transfer\", color: \"var(--chart-1)\" },\n { key: \"card\", label: \"Card\", color: \"var(--chart-2)\" },\n { key: \"wallet\", label: \"Wallet\", color: \"var(--chart-3)\" },\n] as const;\n\nconst legendItems = series.map(({ label, color }) => ({ label, value: 0, color }));\n\nconst usd = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\n\nexport default function BarChartStacked() {\n return (\n <div className=\"flex w-full flex-col gap-3\">\n <Legend items={legendItems} className=\"flex-row flex-wrap gap-1\">\n <LegendItem className=\"flex items-center gap-2\">\n <LegendMarker variant=\"bar\" />\n <LegendLabel />\n </LegendItem>\n </Legend>\n <BarChart data={data} xDataKey=\"week\" stacked stackGap={2} label=\"Payouts by method, last 6 weeks\">\n <ChartGrid horizontal />\n {series.map(({ key, color }) => (\n <Bar key={key} dataKey={key} fill={color} />\n ))}\n <BarXAxis />\n <ChartTooltip\n rows={(point) =>\n series.map(({ key, label, color }) => ({\n color,\n label,\n value: usd.format(point[key] as number),\n }))\n }\n />\n </BarChart>\n </div>\n );\n}"
2091
+ "code": "\"use client\";\n\nimport { Bar, BarChart, BarXAxis } from \"@dodopayments/ui/bar-chart\";\nimport { ChartGrid } from \"@dodopayments/ui/chart\";\nimport { Legend, LegendItem, LegendLabel, LegendMarker } from \"@dodopayments/ui/chart-legend\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Weekly payouts, split by payout method.\nconst data = [\n { week: \"W1\", bank: 18200, card: 6400, wallet: 2100 },\n { week: \"W2\", bank: 21500, card: 7100, wallet: 2600 },\n { week: \"W3\", bank: 19800, card: 6900, wallet: 3200 },\n { week: \"W4\", bank: 24300, card: 8200, wallet: 3800 },\n { week: \"W5\", bank: 22700, card: 7600, wallet: 4100 },\n { week: \"W6\", bank: 26900, card: 9100, wallet: 4700 },\n];\n\nconst series = [\n { key: \"bank\", label: \"Bank transfer\", color: \"var(--chart-solid-1)\" },\n { key: \"card\", label: \"Card\", color: \"var(--chart-solid-2)\" },\n { key: \"wallet\", label: \"Wallet\", color: \"var(--chart-solid-3)\" },\n] as const;\n\nconst legendItems = series.map(({ label, color }) => ({ label, value: 0, color }));\n\nconst usd = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\n\nexport default function BarChartStacked() {\n return (\n <div className=\"flex w-full flex-col gap-3\">\n <Legend items={legendItems} className=\"flex-row flex-wrap gap-1\">\n <LegendItem className=\"flex items-center gap-2\">\n <LegendMarker />\n <LegendLabel />\n </LegendItem>\n </Legend>\n <BarChart data={data} xDataKey=\"week\" stacked stackGap={2} label=\"Payouts by method, last 6 weeks\">\n <ChartGrid horizontal />\n {series.map(({ key, color }) => (\n <Bar key={key} dataKey={key} fill={color} />\n ))}\n <BarXAxis />\n <ChartTooltip\n rows={(point) =>\n series.map(({ key, label, color }) => ({\n color,\n label,\n value: usd.format(point[key] as number),\n }))\n }\n />\n </BarChart>\n </div>\n );\n}"
2092
2092
  }
2093
2093
  ],
2094
2094
  "docsUrl": "/charts#bar-chart"
@@ -2388,7 +2388,7 @@
2388
2388
  "name": "stroke",
2389
2389
  "type": "string",
2390
2390
  "required": false,
2391
- "description": "Stroke color. Default: var(--chart-1), or var(--chart-comparison) for `variant=\"comparison\"`",
2391
+ "description": "Stroke color. Default: var(--chart-solid-1), or var(--chart-comparison) for `variant=\"comparison\"`",
2392
2392
  "source": "dodo"
2393
2393
  },
2394
2394
  {
@@ -3168,7 +3168,7 @@
3168
3168
  },
3169
3169
  {
3170
3170
  "name": "line-chart/default",
3171
- "code": "\"use client\";\n\nimport { ChartGrid, ChartUpdated, XAxis, YAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\nimport { Line, LineChart } from \"@dodopayments/ui/line-chart\";\nimport { StatCard } from \"@dodopayments/ui/stat-card\";\nimport { useState } from \"react\";\n\nconst DAY_MS = 24 * 60 * 60 * 1000;\nconst PERIOD_DAYS = 30;\n\n// Daily gross volume for Sep 26 to Oct 25, against the 30 days before it.\nconst data = Array.from({ length: PERIOD_DAYS }, (_, day) => ({\n date: new Date(2026, 8, 26 + day),\n current: Math.round(1180 + 420 * Math.sin(day / 3.1) + 38 * day),\n previous: Math.round(1320 + 360 * Math.cos(day / 2.6) + 12 * day),\n}));\n\nconst sum = (key: \"current\" | \"previous\") => data.reduce((total, row) => total + row[key], 0);\nconst current = sum(\"current\");\nconst previous = sum(\"previous\");\nconst change = Math.abs((current - previous) / previous);\n\nconst money = new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\nconst axisMoney = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\nconst shortDate = new Intl.DateTimeFormat(\"en-US\", { month: \"short\", day: \"numeric\" });\nconst previousDate = (date: Date) => new Date(date.getTime() - PERIOD_DAYS * DAY_MS);\n\nexport default function LineChartDefault() {\n const [updatedAt, setUpdatedAt] = useState(() => Date.now() - 40 * 60_000);\n const [refreshing, setRefreshing] = useState(false);\n // Simulate reloading the widget's data.\n const refresh = () => {\n setRefreshing(true);\n setTimeout(() => {\n setUpdatedAt(Date.now());\n setRefreshing(false);\n }, 900);\n };\n\n return (\n <StatCard\n label=\"Gross volume\"\n help=\"Everything your customers paid, before refunds, fees and taxes.\"\n value={money.format(current)}\n trend={{\n value: `${(change * 100).toFixed(0)}%`,\n direction: current >= previous ? \"up\" : \"down\",\n }}\n comparison={`vs Aug 27 – Sep 25: ${money.format(previous)}`}\n className=\"w-full max-w-150\"\n footer={<ChartUpdated updatedAt={updatedAt} onRefresh={refresh} refreshing={refreshing} />}\n >\n <LineChart\n data={data}\n label=\"Gross volume, Sep 26 to Oct 25 2026, against the previous 30 days\"\n aspectRatio=\"5 / 2\"\n margin={{ top: 16, right: 8, bottom: 32, left: 48 }}\n >\n <ChartGrid horizontal numTicksRows={4} />\n <Line dataKey=\"previous\" variant=\"comparison\" />\n <Line dataKey=\"current\" />\n <XAxis numTicks={2} />\n <YAxis numTicks={4} formatValue={(value) => axisMoney.format(value)} />\n <ChartTooltip\n title=\"Gross volume\"\n rows={(point) => [\n {\n color: \"var(--chart-1)\",\n label: shortDate.format(point.date as Date),\n value: money.format(point.current as number),\n },\n {\n color: \"var(--chart-comparison)\",\n label: shortDate.format(previousDate(point.date as Date)),\n value: money.format(point.previous as number),\n },\n ]}\n />\n </LineChart>\n </StatCard>\n );\n}"
3171
+ "code": "\"use client\";\n\nimport { ChartGrid, ChartUpdated, XAxis, YAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\nimport { Line, LineChart } from \"@dodopayments/ui/line-chart\";\nimport { StatCard } from \"@dodopayments/ui/stat-card\";\nimport { useState } from \"react\";\n\nconst DAY_MS = 24 * 60 * 60 * 1000;\nconst PERIOD_DAYS = 30;\n\n// Daily gross volume for Sep 26 to Oct 25, against the 30 days before it.\nconst data = Array.from({ length: PERIOD_DAYS }, (_, day) => ({\n date: new Date(2026, 8, 26 + day),\n current: Math.round(1180 + 420 * Math.sin(day / 3.1) + 38 * day),\n previous: Math.round(1320 + 360 * Math.cos(day / 2.6) + 12 * day),\n}));\n\nconst sum = (key: \"current\" | \"previous\") => data.reduce((total, row) => total + row[key], 0);\nconst current = sum(\"current\");\nconst previous = sum(\"previous\");\nconst change = Math.abs((current - previous) / previous);\n\nconst money = new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\nconst axisMoney = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n maximumFractionDigits: 0,\n});\nconst shortDate = new Intl.DateTimeFormat(\"en-US\", { month: \"short\", day: \"numeric\" });\nconst previousDate = (date: Date) => new Date(date.getTime() - PERIOD_DAYS * DAY_MS);\n\nexport default function LineChartDefault() {\n const [updatedAt, setUpdatedAt] = useState(() => Date.now() - 40 * 60_000);\n const [refreshing, setRefreshing] = useState(false);\n // Simulate reloading the widget's data.\n const refresh = () => {\n setRefreshing(true);\n setTimeout(() => {\n setUpdatedAt(Date.now());\n setRefreshing(false);\n }, 900);\n };\n\n return (\n <StatCard\n label=\"Gross volume\"\n help=\"Everything your customers paid, before refunds, fees and taxes.\"\n value={money.format(current)}\n trend={{\n value: `${(change * 100).toFixed(0)}%`,\n direction: current >= previous ? \"up\" : \"down\",\n }}\n comparison={`vs Aug 27 – Sep 25: ${money.format(previous)}`}\n className=\"w-full max-w-150\"\n footer={<ChartUpdated updatedAt={updatedAt} onRefresh={refresh} refreshing={refreshing} />}\n >\n <LineChart\n data={data}\n label=\"Gross volume, Sep 26 to Oct 25 2026, against the previous 30 days\"\n aspectRatio=\"5 / 2\"\n margin={{ top: 16, right: 8, bottom: 32, left: 48 }}\n >\n <ChartGrid horizontal numTicksRows={4} />\n <Line dataKey=\"previous\" variant=\"comparison\" />\n <Line dataKey=\"current\" />\n <XAxis numTicks={2} />\n <YAxis numTicks={4} formatValue={(value) => axisMoney.format(value)} />\n <ChartTooltip\n title=\"Gross volume\"\n rows={(point) => [\n {\n color: \"var(--chart-solid-1)\",\n label: shortDate.format(point.date as Date),\n value: money.format(point.current as number),\n },\n {\n color: \"var(--chart-comparison)\",\n label: shortDate.format(previousDate(point.date as Date)),\n value: money.format(point.previous as number),\n },\n ]}\n />\n </LineChart>\n </StatCard>\n );\n}"
3172
3172
  },
3173
3173
  {
3174
3174
  "name": "line-chart/profit-loss",
@@ -3315,11 +3315,11 @@
3315
3315
  "examples": [
3316
3316
  {
3317
3317
  "name": "composed-chart/default",
3318
- "code": "\"use client\";\n\nimport { SeriesBar } from \"@dodopayments/ui/bar-chart\";\nimport { ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { Legend, LegendItem, LegendLabel, LegendMarker } from \"@dodopayments/ui/chart-legend\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\nimport { ComposedChart } from \"@dodopayments/ui/composed-chart\";\nimport { Line } from \"@dodopayments/ui/line-chart\";\n\n// Daily orders (tinted columns), revenue in $K (line) and the 7-day revenue run rate in $K (dashed grey line).\nconst data = Array.from({ length: 30 }, (_, day) => {\n const revenue = 42 + 9 * Math.sin(day / 4) + 0.6 * day + 3 * Math.cos(day * 1.3);\n return {\n date: new Date(2026, 8, 1 + day),\n orders: Math.round(revenue * 0.9 + 4 * Math.sin(day * 2.1)),\n revenue: Number(revenue.toFixed(1)),\n runRate: Number((42 + 8 * Math.sin((day - 2) / 4) + 0.6 * day).toFixed(1)),\n };\n});\n\nconst legendItems = [\n { label: \"Orders\", value: 0, color: \"var(--chart-2)\" },\n { label: \"Revenue ($K)\", value: 0, color: \"var(--chart-1)\" },\n { label: \"7-day run rate ($K)\", value: 0, color: \"var(--chart-comparison)\" },\n];\n\nexport default function ComposedChartDefault() {\n return (\n <div className=\"flex w-full flex-col gap-3\">\n <Legend items={legendItems} className=\"flex-row flex-wrap gap-1\">\n <LegendItem className=\"flex items-center gap-2\">\n <LegendMarker />\n <LegendLabel />\n </LegendItem>\n </Legend>\n <ComposedChart\n data={data}\n label=\"Orders, revenue and 7-day run rate, September 2026\"\n barGap={0}\n maxBarSize={32}\n >\n <ChartGrid horizontal />\n <SeriesBar dataKey=\"orders\" fill=\"var(--chart-2)\" radius={4} />\n <Line dataKey=\"runRate\" variant=\"comparison\" />\n <Line dataKey=\"revenue\" stroke=\"var(--chart-1)\" />\n <XAxis numTicks={6} />\n <ChartTooltip showCrosshair={false} />\n </ComposedChart>\n </div>\n );\n}"
3318
+ "code": "\"use client\";\n\nimport { SeriesBar } from \"@dodopayments/ui/bar-chart\";\nimport { ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { Legend, LegendItem, LegendLabel, LegendMarker } from \"@dodopayments/ui/chart-legend\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\nimport { ComposedChart } from \"@dodopayments/ui/composed-chart\";\nimport { Line } from \"@dodopayments/ui/line-chart\";\n\n// Daily orders (tinted columns), revenue in $K (line) and the 7-day revenue run rate in $K (dashed grey line).\nconst data = Array.from({ length: 30 }, (_, day) => {\n const revenue = 42 + 9 * Math.sin(day / 4) + 0.6 * day + 3 * Math.cos(day * 1.3);\n return {\n date: new Date(2026, 8, 1 + day),\n orders: Math.round(revenue * 0.9 + 4 * Math.sin(day * 2.1)),\n revenue: Number(revenue.toFixed(1)),\n runRate: Number((42 + 8 * Math.sin((day - 2) / 4) + 0.6 * day).toFixed(1)),\n };\n});\n\nconst legendItems = [\n { label: \"Orders\", value: 0, color: \"var(--chart-solid-2)\" },\n { label: \"Revenue ($K)\", value: 0, color: \"var(--chart-solid-1)\" },\n { label: \"7-day run rate ($K)\", value: 0, color: \"var(--chart-comparison)\" },\n];\n\nexport default function ComposedChartDefault() {\n return (\n <div className=\"flex w-full flex-col gap-3\">\n <Legend items={legendItems} className=\"flex-row flex-wrap gap-1\">\n <LegendItem className=\"flex items-center gap-2\">\n <LegendMarker />\n <LegendLabel />\n </LegendItem>\n </Legend>\n <ComposedChart\n data={data}\n label=\"Orders, revenue and 7-day run rate, September 2026\"\n barGap={0}\n maxBarSize={32}\n >\n <ChartGrid horizontal />\n <SeriesBar dataKey=\"orders\" fill=\"var(--chart-solid-2)\" radius={4} />\n <Line dataKey=\"runRate\" variant=\"comparison\" />\n <Line dataKey=\"revenue\" stroke=\"var(--chart-solid-1)\" />\n <XAxis numTicks={6} />\n <ChartTooltip showCrosshair={false} />\n </ComposedChart>\n </div>\n );\n}"
3319
3319
  },
3320
3320
  {
3321
3321
  "name": "composed-chart/stacked",
3322
- "code": "\"use client\";\n\nimport { SeriesBar } from \"@dodopayments/ui/bar-chart\";\nimport { ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { Legend, LegendItem, LegendLabel, LegendMarker } from \"@dodopayments/ui/chart-legend\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\nimport { ComposedChart } from \"@dodopayments/ui/composed-chart\";\nimport { Line } from \"@dodopayments/ui/line-chart\";\n\n// Weekly payments by method (stacked columns) and the refund count (line), in thousands.\nconst data = Array.from({ length: 12 }, (_, week) => ({\n date: new Date(2026, 6, 6 + week * 7),\n card: Number((14 + 3 * Math.sin(week / 2) + 0.5 * week).toFixed(1)),\n bank: Number((8 + 2 * Math.cos(week / 3) + 0.3 * week).toFixed(1)),\n wallet: Number((3 + Math.sin(week / 1.5) + 0.2 * week).toFixed(1)),\n refunds: Number((4 + 1.5 * Math.sin(week / 2.4 + 1)).toFixed(1)),\n}));\n\nconst bars = [\n { key: \"card\", label: \"Card\", color: \"var(--chart-1)\" },\n { key: \"bank\", label: \"Bank transfer\", color: \"var(--chart-2)\" },\n { key: \"wallet\", label: \"Wallet\", color: \"var(--chart-3)\" },\n] as const;\n\nconst legendItems = [\n ...bars.map(({ label, color }) => ({ label, value: 0, color })),\n { label: \"Refunds\", value: 0, color: \"var(--chart-5)\" },\n];\n\nexport default function ComposedChartStacked() {\n return (\n <div className=\"flex w-full flex-col gap-3\">\n <Legend items={legendItems} className=\"flex-row flex-wrap gap-1\">\n <LegendItem className=\"flex items-center gap-2\">\n <LegendMarker />\n <LegendLabel />\n </LegendItem>\n </Legend>\n <ComposedChart\n data={data}\n label=\"Weekly payments by method and refunds, Q3 2026, in thousands\"\n stacked\n stackGap={2}\n >\n <ChartGrid horizontal />\n {bars.map(({ key, color }) => (\n <SeriesBar key={key} dataKey={key} fill={color} />\n ))}\n <Line dataKey=\"refunds\" stroke=\"var(--chart-5)\" />\n <XAxis />\n <ChartTooltip showCrosshair={false} />\n </ComposedChart>\n </div>\n );\n}"
3322
+ "code": "\"use client\";\n\nimport { SeriesBar } from \"@dodopayments/ui/bar-chart\";\nimport { ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { Legend, LegendItem, LegendLabel, LegendMarker } from \"@dodopayments/ui/chart-legend\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\nimport { ComposedChart } from \"@dodopayments/ui/composed-chart\";\nimport { Line } from \"@dodopayments/ui/line-chart\";\n\n// Weekly payments by method (stacked columns) and the refund count (line), in thousands.\nconst data = Array.from({ length: 12 }, (_, week) => ({\n date: new Date(2026, 6, 6 + week * 7),\n card: Number((14 + 3 * Math.sin(week / 2) + 0.5 * week).toFixed(1)),\n bank: Number((8 + 2 * Math.cos(week / 3) + 0.3 * week).toFixed(1)),\n wallet: Number((3 + Math.sin(week / 1.5) + 0.2 * week).toFixed(1)),\n refunds: Number((4 + 1.5 * Math.sin(week / 2.4 + 1)).toFixed(1)),\n}));\n\nconst bars = [\n { key: \"card\", label: \"Card\", color: \"var(--chart-solid-1)\" },\n { key: \"bank\", label: \"Bank transfer\", color: \"var(--chart-solid-2)\" },\n { key: \"wallet\", label: \"Wallet\", color: \"var(--chart-solid-3)\" },\n] as const;\n\nconst legendItems = [\n ...bars.map(({ label, color }) => ({ label, value: 0, color })),\n { label: \"Refunds\", value: 0, color: \"var(--chart-5)\" },\n];\n\nexport default function ComposedChartStacked() {\n return (\n <div className=\"flex w-full flex-col gap-3\">\n <Legend items={legendItems} className=\"flex-row flex-wrap gap-1\">\n <LegendItem className=\"flex items-center gap-2\">\n <LegendMarker />\n <LegendLabel />\n </LegendItem>\n </Legend>\n <ComposedChart\n data={data}\n label=\"Weekly payments by method and refunds, Q3 2026, in thousands\"\n stacked\n stackGap={2}\n >\n <ChartGrid horizontal />\n {bars.map(({ key, color }) => (\n <SeriesBar key={key} dataKey={key} fill={color} />\n ))}\n <Line dataKey=\"refunds\" stroke=\"var(--chart-5)\" />\n <XAxis />\n <ChartTooltip showCrosshair={false} />\n </ComposedChart>\n </div>\n );\n}"
3323
3323
  }
3324
3324
  ],
3325
3325
  "docsUrl": "/charts#composed-chart"
@@ -3883,7 +3883,7 @@
3883
3883
  "title": "Gauge Chart",
3884
3884
  "category": "Charts",
3885
3885
  "status": "stable",
3886
- "description": "One value from 0 to 100 as a row of notches, around an arc (default) or along a horizontal track\n(`orientation=\"linear\"`), on the bklit `Gauge` primitive. `value` sets how many notches fill.\n`centerValue` adds an optional animated statistic with a `defaultLabel` caption: in the arc\ncentre, or above / below the linear track (`labelPlacement`, `labelAlign`). Filled notches use the\ntint look of the other charts (a 20% wash with a solid 3px outer edge); `variant=\"solid\"` fills\nthem with the full colour. Set `useGradient` for\na colour ramp across the notches, or pass `PatternLines` / `LinearGradient` children and point\n`activeFill` / `inactiveFill` at them with `url(#id)`. The plot is a `role=\"meter\"` with\n`aria-valuenow`. Notches pop in on mount (instant under reduced motion). It has no loading or\nempty state.",
3886
+ "description": "One value from 0 to 100 as a row of notches, around an arc (default) or along a horizontal track\n(`orientation=\"linear\"`), on the bklit `Gauge` primitive. `value` sets how many notches fill.\n`centerValue` adds an optional animated statistic with a `defaultLabel` caption: in the arc\ncentre, or above / below the linear track (`labelPlacement`, `labelAlign`). Filled notches are the full\ncolour by default; `variant=\"tint\"` gives the tint look of the other charts (a 20% wash with a solid 3px outer\nedge). Set `useGradient` for a colour ramp across the notches (blue to violet unless `activeGradient` sets one), or pass `PatternLines` / `LinearGradient` children and point\n`activeFill` / `inactiveFill` at them with `url(#id)`. The plot is a `role=\"meter\"` with\n`aria-valuenow`. Notches pop in on mount (instant under reduced motion). It has no loading or\nempty state.",
3887
3887
  "importPath": "@dodopayments/ui/gauge-chart",
3888
3888
  "exports": [
3889
3889
  "GaugeChart",
@@ -3895,7 +3895,7 @@
3895
3895
  "parts": [
3896
3896
  {
3897
3897
  "name": "GaugeChart",
3898
- "description": "One value from 0 to 100 as a row of notches, around an arc (default) or along a horizontal track\n(`orientation=\"linear\"`), on the bklit `Gauge` primitive. `value` sets how many notches fill.\n`centerValue` adds an optional animated statistic with a `defaultLabel` caption: in the arc\ncentre, or above / below the linear track (`labelPlacement`, `labelAlign`). Filled notches use the\ntint look of the other charts (a 20% wash with a solid 3px outer edge); `variant=\"solid\"` fills\nthem with the full colour. Set `useGradient` for\na colour ramp across the notches, or pass `PatternLines` / `LinearGradient` children and point\n`activeFill` / `inactiveFill` at them with `url(#id)`. The plot is a `role=\"meter\"` with\n`aria-valuenow`. Notches pop in on mount (instant under reduced motion). It has no loading or\nempty state.",
3898
+ "description": "One value from 0 to 100 as a row of notches, around an arc (default) or along a horizontal track\n(`orientation=\"linear\"`), on the bklit `Gauge` primitive. `value` sets how many notches fill.\n`centerValue` adds an optional animated statistic with a `defaultLabel` caption: in the arc\ncentre, or above / below the linear track (`labelPlacement`, `labelAlign`). Filled notches are the full\ncolour by default; `variant=\"tint\"` gives the tint look of the other charts (a 20% wash with a solid 3px outer\nedge). Set `useGradient` for a colour ramp across the notches (blue to violet unless `activeGradient` sets one), or pass `PatternLines` / `LinearGradient` children and point\n`activeFill` / `inactiveFill` at them with `url(#id)`. The plot is a `role=\"meter\"` with\n`aria-valuenow`. Notches pop in on mount (instant under reduced motion). It has no loading or\nempty state.",
3899
3899
  "props": [
3900
3900
  {
3901
3901
  "name": "label",
@@ -4132,7 +4132,7 @@
4132
4132
  "name": "variant",
4133
4133
  "type": "\"tint\" | \"solid\"",
4134
4134
  "required": false,
4135
- "description": "`\"tint\"`: the radar look of the other charts, each filled notch an opaque 20% wash of its colour\n(mixed into the card) with a solid 3px edge on its outer side.\n`\"solid\"`: the full colour. A gradient or pattern `activeFill` (`url(#id)`) and the theme palette\ngradient stay solid. Default: \"tint\"",
4135
+ "description": "`\"solid\"`: the full colour, as the bar, pie and ring charts.\n`\"tint\"`: each filled notch an opaque 20% wash of its colour (mixed into the card) with a solid 3px\nedge on its outer side. A gradient or pattern `activeFill` (`url(#id)`) and the theme palette\ngradient stay solid. Default: \"solid\"",
4136
4136
  "source": "dodo"
4137
4137
  },
4138
4138
  {
@@ -4152,11 +4152,11 @@
4152
4152
  },
4153
4153
  {
4154
4154
  "name": "gauge-chart/gradient",
4155
- "code": "\"use client\";\n\nimport { GaugeChart } from \"@dodopayments/ui/gauge-chart\";\n\nexport default function GaugeChartGradient() {\n return (\n <div className=\"grid w-full gap-6 @xl:grid-cols-2\">\n <GaugeChart\n label=\"Authorization rate\"\n value={94}\n centerValue={0.94}\n defaultLabel=\"Auth rate\"\n formatOptions={{ style: \"percent\", maximumFractionDigits: 0 }}\n useGradient\n activeGradient={[\"var(--chart-2)\", \"var(--chart-3)\"]}\n inactiveFillOpacity={0.4}\n minWidth={240}\n />\n <GaugeChart\n label=\"Annual revenue goal reached\"\n value={58}\n centerValue={1_160_000}\n defaultLabel=\"of $2M goal\"\n formatOptions={{ style: \"currency\", currency: \"USD\", notation: \"compact\" }}\n totalNotches={24}\n notchCornerRadius={4}\n uniformWidth\n inactiveFillOpacity={0.4}\n minWidth={240}\n />\n </div>\n );\n}"
4155
+ "code": "\"use client\";\n\nimport { GaugeChart } from \"@dodopayments/ui/gauge-chart\";\n\nexport default function GaugeChartGradient() {\n return (\n <div className=\"grid w-full gap-6 @xl:grid-cols-2\">\n <GaugeChart\n label=\"Authorization rate\"\n value={94}\n centerValue={0.94}\n defaultLabel=\"Auth rate\"\n formatOptions={{ style: \"percent\", maximumFractionDigits: 0 }}\n useGradient\n activeGradient={[\"var(--chart-solid-2)\", \"var(--chart-solid-3)\"]}\n inactiveFillOpacity={0.4}\n minWidth={240}\n />\n <GaugeChart\n label=\"Annual revenue goal reached\"\n value={58}\n centerValue={1_160_000}\n defaultLabel=\"of $2M goal\"\n formatOptions={{ style: \"currency\", currency: \"USD\", notation: \"compact\" }}\n totalNotches={24}\n notchCornerRadius={4}\n uniformWidth\n inactiveFillOpacity={0.4}\n minWidth={240}\n />\n </div>\n );\n}"
4156
4156
  },
4157
4157
  {
4158
4158
  "name": "gauge-chart/linear",
4159
- "code": "\"use client\";\n\nimport { GaugeChart } from \"@dodopayments/ui/gauge-chart\";\n\nexport default function GaugeChartLinear() {\n return (\n <div className=\"flex w-full flex-col gap-8\">\n <GaugeChart\n label=\"Checkout conversion this week\"\n orientation=\"linear\"\n value={38}\n centerValue={0.38}\n defaultLabel=\"Checkout conversion\"\n formatOptions={{ style: \"percent\", maximumFractionDigits: 0 }}\n totalNotches={50}\n spacing={0}\n notchCornerRadius={3}\n inactiveFillOpacity={0.4}\n />\n <GaugeChart\n label=\"Refund rate against the 2% limit\"\n orientation=\"linear\"\n value={72}\n centerValue={1.44}\n defaultLabel=\"Refund rate, limit 2%\"\n suffix=\"%\"\n formatOptions={{ maximumFractionDigits: 2 }}\n labelPlacement=\"bottom\"\n labelAlign=\"end\"\n totalNotches={50}\n spacing={0}\n notchCornerRadius={3}\n activeFill=\"var(--chart-2)\"\n inactiveFillOpacity={0.4}\n />\n </div>\n );\n}"
4159
+ "code": "\"use client\";\n\nimport { GaugeChart } from \"@dodopayments/ui/gauge-chart\";\n\nexport default function GaugeChartLinear() {\n return (\n <div className=\"flex w-full flex-col gap-8\">\n <GaugeChart\n label=\"Checkout conversion this week\"\n orientation=\"linear\"\n value={38}\n centerValue={0.38}\n defaultLabel=\"Checkout conversion\"\n formatOptions={{ style: \"percent\", maximumFractionDigits: 0 }}\n totalNotches={50}\n spacing={0}\n notchCornerRadius={3}\n inactiveFillOpacity={0.4}\n />\n <GaugeChart\n label=\"Refund rate against the 2% limit\"\n orientation=\"linear\"\n value={72}\n centerValue={1.44}\n defaultLabel=\"Refund rate, limit 2%\"\n suffix=\"%\"\n formatOptions={{ maximumFractionDigits: 2 }}\n labelPlacement=\"bottom\"\n labelAlign=\"end\"\n totalNotches={50}\n spacing={0}\n notchCornerRadius={3}\n activeFill=\"var(--chart-solid-2)\"\n inactiveFillOpacity={0.4}\n />\n </div>\n );\n}"
4160
4160
  }
4161
4161
  ],
4162
4162
  "docsUrl": "/charts#gauge-chart"
@@ -4166,7 +4166,7 @@
4166
4166
  "title": "Funnel Chart",
4167
4167
  "category": "Charts",
4168
4168
  "status": "stable",
4169
- "description": "Drop-off through the stages of a flow (visited, started checkout, paid), on the bklit\n`FunnelChart` primitive. `data` is a list of `{ label, value, displayValue?, color?, gradient? }`,\nfirst stage first; each segment is sized as a share of the first stage and shows its value, a\npercentage chip and the stage label, and each boundary shows the step conversion (\"→ 54%\") from the\nstage before. Segments use the tint look of the other charts (a 20% wash with a solid 2px edge on the\nouter sides); `variant=\"solid\"` draws the full colour as `layers` halo rings. Segments grow in with a stagger on mount; hovering one dims\nthe others. `orientation=\"vertical\"` stacks the stages top to bottom; `grid` adds background bands\nand divider lines. Height comes from the aspect ratio unless a class sets it. It has no loading\nstate and renders an empty frame when `data` is empty.",
4169
+ "description": "Drop-off through the stages of a flow (visited, started checkout, paid), on the bklit\n`FunnelChart` primitive. `data` is a list of `{ label, value, displayValue?, color?, gradient? }`,\nfirst stage first; each segment is sized as a share of the first stage and shows its value, a\npercentage chip and the stage label, and each boundary shows the step conversion (\"→ 54%\") from the\nstage before. Segments are solid by default: a full-colour core inside faint halo bands (`layers` rings);\n`variant=\"tint\"` gives the wash of the tint look (20% with a solid 2px edge on the outer sides). Each stage takes the\nnext palette colour unless `color` sets one. Segments grow in with a stagger on mount; hovering one dims\nthe others. `orientation=\"vertical\"` stacks the stages top to bottom; `grid` adds background bands\nand divider lines. Height comes from the aspect ratio unless a class sets it. It has no loading\nstate and renders an empty frame when `data` is empty.",
4170
4170
  "importPath": "@dodopayments/ui/funnel-chart",
4171
4171
  "exports": [
4172
4172
  "FunnelChart",
@@ -4177,7 +4177,7 @@
4177
4177
  "parts": [
4178
4178
  {
4179
4179
  "name": "FunnelChart",
4180
- "description": "Drop-off through the stages of a flow (visited, started checkout, paid), on the bklit\n`FunnelChart` primitive. `data` is a list of `{ label, value, displayValue?, color?, gradient? }`,\nfirst stage first; each segment is sized as a share of the first stage and shows its value, a\npercentage chip and the stage label, and each boundary shows the step conversion (\"→ 54%\") from the\nstage before. Segments use the tint look of the other charts (a 20% wash with a solid 2px edge on the\nouter sides); `variant=\"solid\"` draws the full colour as `layers` halo rings. Segments grow in with a stagger on mount; hovering one dims\nthe others. `orientation=\"vertical\"` stacks the stages top to bottom; `grid` adds background bands\nand divider lines. Height comes from the aspect ratio unless a class sets it. It has no loading\nstate and renders an empty frame when `data` is empty.",
4180
+ "description": "Drop-off through the stages of a flow (visited, started checkout, paid), on the bklit\n`FunnelChart` primitive. `data` is a list of `{ label, value, displayValue?, color?, gradient? }`,\nfirst stage first; each segment is sized as a share of the first stage and shows its value, a\npercentage chip and the stage label, and each boundary shows the step conversion (\"→ 54%\") from the\nstage before. Segments are solid by default: a full-colour core inside faint halo bands (`layers` rings);\n`variant=\"tint\"` gives the wash of the tint look (20% with a solid 2px edge on the outer sides). Each stage takes the\nnext palette colour unless `color` sets one. Segments grow in with a stagger on mount; hovering one dims\nthe others. `orientation=\"vertical\"` stacks the stages top to bottom; `grid` adds background bands\nand divider lines. Height comes from the aspect ratio unless a class sets it. It has no loading\nstate and renders an empty frame when `data` is empty.",
4181
4181
  "props": [
4182
4182
  {
4183
4183
  "name": "data",
@@ -4204,7 +4204,7 @@
4204
4204
  "name": "color",
4205
4205
  "type": "string",
4206
4206
  "required": false,
4207
- "description": "",
4207
+ "description": "One colour for every stage. Without it, each stage takes the next palette colour: `--chart-solid-1` to\n`--chart-solid-3` (the bar colours), then `--chart-4` and `--chart-5`, repeated.",
4208
4208
  "source": "dodo"
4209
4209
  },
4210
4210
  {
@@ -4295,7 +4295,7 @@
4295
4295
  "name": "layers",
4296
4296
  "type": "number",
4297
4297
  "required": false,
4298
- "description": "Halo rings of the `\"solid\"` look. Default 3",
4298
+ "description": "Rings of the `\"solid\"` look: the core plus `layers - 1` halo bands. Default 3",
4299
4299
  "source": "dodo"
4300
4300
  },
4301
4301
  {
@@ -4358,7 +4358,7 @@
4358
4358
  "name": "variant",
4359
4359
  "type": "\"tint\" | \"solid\"",
4360
4360
  "required": false,
4361
- "description": "`\"tint\"`: the radar look of the other charts, each segment an opaque 20% wash of its colour\n(mixed into the card) with a solid 2px edge along its outer sides.\n`\"solid\"`: the full colour drawn as `layers` nested halo rings. A `renderPattern` fill stays\nsolid. Default: \"tint\"",
4361
+ "description": "`\"solid\"`: a full-colour core inside `layers - 1` faint halo bands, as the bar, pie and ring\ncharts. `\"tint\"`: each segment an opaque 20% wash of its colour (mixed into the card) with a solid\n2px edge along its outer sides. A `renderPattern` fill stays solid. Default: \"solid\"",
4362
4362
  "source": "dodo"
4363
4363
  }
4364
4364
  ]
@@ -4371,11 +4371,11 @@
4371
4371
  },
4372
4372
  {
4373
4373
  "name": "funnel-chart/colors",
4374
- "code": "\"use client\";\n\nimport { FunnelChart, type FunnelStage } from \"@dodopayments/ui/funnel-chart\";\n\nconst compact = new Intl.NumberFormat(\"en-US\", { notation: \"compact\" });\n\n// Payouts through review: each stage has its own colour, the last one a gradient.\nconst payouts: FunnelStage[] = [\n { label: \"Requested\", value: 1_240, color: \"var(--chart-1)\" },\n { label: \"Verified\", value: 1_090, color: \"var(--chart-2)\" },\n { label: \"Approved\", value: 1_010, color: \"var(--chart-3)\" },\n {\n label: \"Paid out\",\n value: 980,\n gradient: [\n { offset: 0, color: \"var(--chart-3)\" },\n { offset: 1, color: \"var(--chart-5)\" },\n ],\n },\n];\n\nexport default function FunnelChartColors() {\n return (\n <FunnelChart\n data={payouts}\n label=\"Payouts through review, this month\"\n formatValue={(value) => compact.format(value)}\n formatPercentage={(pct) => `${pct.toFixed(1)}%`}\n />\n );\n}"
4374
+ "code": "\"use client\";\n\nimport { FunnelChart, type FunnelStage } from \"@dodopayments/ui/funnel-chart\";\n\nconst compact = new Intl.NumberFormat(\"en-US\", { notation: \"compact\" });\n\n// Payouts through review: each stage has its own colour, the last one a gradient.\nconst payouts: FunnelStage[] = [\n { label: \"Requested\", value: 1_240, color: \"var(--chart-solid-2)\" },\n { label: \"Verified\", value: 1_090, color: \"var(--chart-solid-3)\" },\n { label: \"Approved\", value: 1_010, color: \"var(--chart-5)\" },\n {\n label: \"Paid out\",\n value: 980,\n gradient: [\n { offset: 0, color: \"var(--chart-solid-3)\" },\n { offset: 1, color: \"var(--chart-5)\" },\n ],\n },\n];\n\nexport default function FunnelChartColors() {\n return (\n <FunnelChart\n data={payouts}\n label=\"Payouts through review, this month\"\n formatValue={(value) => compact.format(value)}\n formatPercentage={(pct) => `${pct.toFixed(1)}%`}\n />\n );\n}"
4375
4375
  },
4376
4376
  {
4377
4377
  "name": "funnel-chart/vertical",
4378
- "code": "\"use client\";\n\nimport { FunnelChart, type FunnelStage } from \"@dodopayments/ui/funnel-chart\";\n\n// Subscription trial funnel for September.\nconst trials: FunnelStage[] = [\n { label: \"Trials started\", value: 3_200 },\n { label: \"Added a card\", value: 2_150 },\n { label: \"First invoice\", value: 1_480 },\n { label: \"Renewed\", value: 1_120 },\n { label: \"Upgraded\", value: 310 },\n];\n\nexport default function FunnelChartVertical() {\n return (\n <div className=\"mx-auto w-full max-w-md\">\n <FunnelChart\n data={trials}\n label=\"Trial to paid funnel, September\"\n orientation=\"vertical\"\n color=\"var(--chart-2)\"\n edges=\"straight\"\n grid\n />\n </div>\n );\n}"
4378
+ "code": "\"use client\";\n\nimport { FunnelChart, type FunnelStage } from \"@dodopayments/ui/funnel-chart\";\n\n// Subscription trial funnel for September.\nconst trials: FunnelStage[] = [\n { label: \"Trials started\", value: 3_200 },\n { label: \"Added a card\", value: 2_150 },\n { label: \"First invoice\", value: 1_480 },\n { label: \"Renewed\", value: 1_120 },\n { label: \"Upgraded\", value: 310 },\n];\n\nexport default function FunnelChartVertical() {\n return (\n <div className=\"mx-auto w-full max-w-md\">\n <FunnelChart\n data={trials}\n label=\"Trial to paid funnel, September\"\n orientation=\"vertical\"\n color=\"var(--chart-solid-2)\"\n edges=\"straight\"\n grid\n />\n </div>\n );\n}"
4379
4379
  }
4380
4380
  ],
4381
4381
  "docsUrl": "/charts#funnel-chart"
@@ -4577,7 +4577,7 @@
4577
4577
  "name": "variant",
4578
4578
  "type": "\"tint\" | \"solid\"",
4579
4579
  "required": false,
4580
- "description": "`\"tint\"`: the bar charts' look, an opaque 20% wash of the colour (mixed into the card) with a solid 3px arc on the\nouter rim. `\"solid\"`: the full colour. A gradient or pattern `fill` stays solid. Default: \"tint\"",
4580
+ "description": "`\"solid\"`: the full colour, as the bars. `\"tint\"`: an opaque 20% wash of the colour (mixed into the card) with a\nsolid 3px arc on the outer rim. A gradient or pattern `fill` stays solid. Default: \"solid\"",
4581
4581
  "source": "dodo"
4582
4582
  }
4583
4583
  ]
@@ -4662,7 +4662,7 @@
4662
4662
  },
4663
4663
  {
4664
4664
  "name": "pie-chart/donut",
4665
- "code": "\"use client\";\n\nimport {\n Legend,\n type LegendItemData,\n LegendItem,\n LegendLabel,\n LegendMarker,\n LegendValue,\n} from \"@dodopayments/ui/chart-legend\";\nimport { PieCenter, PieChart, type PieData, PieSlice } from \"@dodopayments/ui/pie-chart\";\nimport { useState } from \"react\";\n\n// Gross revenue by payment method, September 2026, in USD.\nconst revenue: PieData[] = [\n { label: \"Cards\", value: 62400 },\n { label: \"UPI\", value: 24100 },\n { label: \"Wallets\", value: 13800 },\n { label: \"Bank transfer\", value: 8600 },\n { label: \"BNPL\", value: 4100 },\n];\n\nconst total = revenue.reduce((sum, row) => sum + row.value, 0);\nconst usd = new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\", maximumFractionDigits: 0 });\n\nconst legendItems: LegendItemData[] = revenue.map((row, index) => ({\n label: row.label,\n value: row.value,\n maxValue: total,\n color: `var(--chart-${index + 1})`,\n}));\n\nexport default function PieChartDonut() {\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n\n return (\n <div className=\"flex w-full flex-col items-center gap-6 @xl:flex-row @xl:gap-10\">\n <div className=\"w-full max-w-72 flex-1\">\n <PieChart\n data={revenue}\n label=\"Gross revenue by payment method, September 2026\"\n innerRadius={80}\n padAngle={0.02}\n cornerRadius={4}\n hoveredIndex={hoveredIndex}\n onHoverChange={setHoveredIndex}\n >\n {revenue.map((row, index) => (\n <PieSlice key={row.label} index={index} />\n ))}\n <PieCenter defaultLabel=\"Gross revenue\" prefix=\"$\" formatOptions={{ notation: \"compact\" }} />\n </PieChart>\n </div>\n <Legend\n items={legendItems}\n hoveredIndex={hoveredIndex}\n onHoverChange={setHoveredIndex}\n title=\"Payment method\"\n className=\"w-full max-w-64\"\n >\n <LegendItem className=\"flex items-center gap-3\">\n <LegendMarker />\n <LegendLabel className=\"flex-1\" />\n <LegendValue formatValue={(value) => usd.format(value)} showPercentage />\n </LegendItem>\n </Legend>\n </div>\n );\n}"
4665
+ "code": "\"use client\";\n\nimport {\n Legend,\n type LegendItemData,\n LegendItem,\n LegendLabel,\n LegendMarker,\n LegendValue,\n} from \"@dodopayments/ui/chart-legend\";\nimport { PieCenter, PieChart, type PieData, PieSlice } from \"@dodopayments/ui/pie-chart\";\nimport { useState } from \"react\";\n\n// Gross revenue by payment method, September 2026, in USD.\nconst revenue: PieData[] = [\n { label: \"Cards\", value: 62400 },\n { label: \"UPI\", value: 24100 },\n { label: \"Wallets\", value: 13800 },\n { label: \"Bank transfer\", value: 8600 },\n { label: \"BNPL\", value: 4100 },\n];\n\nconst total = revenue.reduce((sum, row) => sum + row.value, 0);\nconst usd = new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\", maximumFractionDigits: 0 });\n\n// The pie's default slice colours, in order: the bars' solid series, then the chart palette.\nconst sliceColors = [\n \"var(--chart-solid-1)\",\n \"var(--chart-solid-2)\",\n \"var(--chart-solid-3)\",\n \"var(--chart-4)\",\n \"var(--chart-5)\",\n];\n\nconst legendItems: LegendItemData[] = revenue.map((row, index) => ({\n label: row.label,\n value: row.value,\n maxValue: total,\n color: sliceColors[index % sliceColors.length] ?? \"var(--chart-solid-1)\",\n}));\n\nexport default function PieChartDonut() {\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n\n return (\n <div className=\"flex w-full flex-col items-center gap-6 @xl:flex-row @xl:gap-10\">\n <div className=\"w-full max-w-72 flex-1\">\n <PieChart\n data={revenue}\n label=\"Gross revenue by payment method, September 2026\"\n innerRadius={80}\n padAngle={0.02}\n cornerRadius={4}\n hoveredIndex={hoveredIndex}\n onHoverChange={setHoveredIndex}\n >\n {revenue.map((row, index) => (\n <PieSlice key={row.label} index={index} />\n ))}\n <PieCenter defaultLabel=\"Gross revenue\" prefix=\"$\" formatOptions={{ notation: \"compact\" }} />\n </PieChart>\n </div>\n <Legend\n items={legendItems}\n hoveredIndex={hoveredIndex}\n onHoverChange={setHoveredIndex}\n title=\"Payment method\"\n className=\"w-full max-w-64\"\n >\n <LegendItem className=\"flex items-center gap-3\">\n <LegendMarker />\n <LegendLabel className=\"flex-1\" />\n <LegendValue formatValue={(value) => usd.format(value)} showPercentage />\n </LegendItem>\n </Legend>\n </div>\n );\n}"
4666
4666
  },
4667
4667
  {
4668
4668
  "name": "pie-chart/grow",
@@ -4804,7 +4804,7 @@
4804
4804
  },
4805
4805
  {
4806
4806
  "name": "Ring",
4807
- "description": "One ring of a `RingChart`: a grey track and a progress arc for the data row at `index` (by default a light `--muted`\ntrack and a 25% wash of the ring's colour with a solid end cap; `variant=\"solid\"` for a `--border` track and a solid\narc). The\ntrack scales in, then the arc fills. On hover the ring grows a little, the outer rings move out and\nthe other rings fade; the hover index drives `RingCenter` and a linked `Legend`.",
4807
+ "description": "One ring of a `RingChart`: a grey track and a progress arc for the data row at `index` (by default a `--border`\ntrack and a solid arc, as the bars; `variant=\"tint\"` for a light `--muted` track and a 25% wash of the ring's colour\nwith a solid end cap). The\ntrack scales in, then the arc fills. On hover the ring grows a little, the outer rings move out and\nthe other rings fade; the hover index drives `RingCenter` and a linked `Legend`.",
4808
4808
  "props": [
4809
4809
  {
4810
4810
  "name": "index",
@@ -4824,7 +4824,7 @@
4824
4824
  "name": "color",
4825
4825
  "type": "string",
4826
4826
  "required": false,
4827
- "description": "Color override. Falls back to the row's `color`, then to `--chart-1..5`.",
4827
+ "description": "Color override. Falls back to the row's `color`, then to `--chart-solid-1..3` and `--chart-4..5`.",
4828
4828
  "source": "dodo"
4829
4829
  },
4830
4830
  {
@@ -4845,7 +4845,7 @@
4845
4845
  "name": "variant",
4846
4846
  "type": "\"tint\" | \"solid\"",
4847
4847
  "required": false,
4848
- "description": "`\"tint\"`: the toned-down look of the other charts, a light grey `--muted` track for what is not covered yet, the\nprogress as a 25% wash of the ring's colour (mixed into the card) and a solid 3px cap where it ends. `\"solid\"`: a\n`--border` track and a solid arc.\nDefault: \"tint\"",
4848
+ "description": "`\"solid\"`: a `--border` track and a solid arc, as the bars. `\"tint\"`: a light grey `--muted` track for what is not\ncovered yet, the progress as a 25% wash of the ring's colour (mixed into the card) and a solid 3px cap where it\nends.\nDefault: \"solid\"",
4849
4849
  "source": "dodo"
4850
4850
  }
4851
4851
  ]
@@ -4930,7 +4930,7 @@
4930
4930
  },
4931
4931
  {
4932
4932
  "name": "ring-chart/legend",
4933
- "code": "\"use client\";\n\nimport {\n Legend,\n type LegendItemData,\n LegendItem,\n LegendLabel,\n LegendMarker,\n LegendProgress,\n LegendValue,\n} from \"@dodopayments/ui/chart-legend\";\nimport { Ring, RingCenter, RingChart, type RingData } from \"@dodopayments/ui/ring-chart\";\nimport { useState } from \"react\";\n\n// Revenue by customer country against each country's Q3 2026 target, in USD.\nconst countries: RingData[] = [\n { label: \"United States\", value: 84200, maxValue: 100000 },\n { label: \"India\", value: 51600, maxValue: 60000 },\n { label: \"Germany\", value: 23900, maxValue: 40000 },\n { label: \"Brazil\", value: 11300, maxValue: 25000 },\n];\n\nconst usd = new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\", notation: \"compact\" });\n\nconst legendItems: LegendItemData[] = countries.map((row, index) => ({\n label: row.label,\n value: row.value,\n maxValue: row.maxValue,\n color: `var(--chart-${index + 1})`,\n}));\n\nexport default function RingChartLegend() {\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n\n return (\n <div className=\"flex w-full flex-col items-center gap-6 @xl:flex-row @xl:gap-10\">\n <div className=\"w-full max-w-72 flex-1\">\n <RingChart\n data={countries}\n label=\"Revenue against target by country, Q3 2026\"\n hoveredIndex={hoveredIndex}\n onHoverChange={setHoveredIndex}\n >\n {countries.map((row, index) => (\n <Ring key={row.label} index={index} />\n ))}\n <RingCenter defaultLabel=\"Q3 revenue\" prefix=\"$\" formatOptions={{ notation: \"compact\" }} />\n </RingChart>\n </div>\n <Legend\n items={legendItems}\n hoveredIndex={hoveredIndex}\n onHoverChange={setHoveredIndex}\n title=\"Against target\"\n className=\"w-full max-w-64\"\n >\n <LegendItem className=\"grid grid-cols-[auto_1fr_auto] items-center gap-x-3 gap-y-1\">\n <LegendMarker variant=\"bar\" />\n <LegendLabel />\n <LegendValue formatValue={(value) => usd.format(value)} showPercentage />\n <div className=\"col-span-full\">\n <LegendProgress variant=\"tint\" />\n </div>\n </LegendItem>\n </Legend>\n </div>\n );\n}"
4933
+ "code": "\"use client\";\n\nimport {\n Legend,\n type LegendItemData,\n LegendItem,\n LegendLabel,\n LegendMarker,\n LegendProgress,\n LegendValue,\n} from \"@dodopayments/ui/chart-legend\";\nimport { Ring, RingCenter, RingChart, type RingData } from \"@dodopayments/ui/ring-chart\";\nimport { useState } from \"react\";\n\n// Revenue by customer country against each country's Q3 2026 target, in USD.\nconst countries: RingData[] = [\n { label: \"United States\", value: 84200, maxValue: 100000 },\n { label: \"India\", value: 51600, maxValue: 60000 },\n { label: \"Germany\", value: 23900, maxValue: 40000 },\n { label: \"Brazil\", value: 11300, maxValue: 25000 },\n];\n\nconst usd = new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\", notation: \"compact\" });\n\n// The ring's default colours, in order: the bars' solid series, then the chart palette.\nconst ringColors = [\n \"var(--chart-solid-1)\",\n \"var(--chart-solid-2)\",\n \"var(--chart-solid-3)\",\n \"var(--chart-4)\",\n \"var(--chart-5)\",\n];\n\nconst legendItems: LegendItemData[] = countries.map((row, index) => ({\n label: row.label,\n value: row.value,\n maxValue: row.maxValue,\n color: ringColors[index % ringColors.length] ?? \"var(--chart-solid-1)\",\n}));\n\nexport default function RingChartLegend() {\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n\n return (\n <div className=\"flex w-full flex-col items-center gap-6 @xl:flex-row @xl:gap-10\">\n <div className=\"w-full max-w-72 flex-1\">\n <RingChart\n data={countries}\n label=\"Revenue against target by country, Q3 2026\"\n hoveredIndex={hoveredIndex}\n onHoverChange={setHoveredIndex}\n >\n {countries.map((row, index) => (\n <Ring key={row.label} index={index} />\n ))}\n <RingCenter defaultLabel=\"Q3 revenue\" prefix=\"$\" formatOptions={{ notation: \"compact\" }} />\n </RingChart>\n </div>\n <Legend\n items={legendItems}\n hoveredIndex={hoveredIndex}\n onHoverChange={setHoveredIndex}\n title=\"Against target\"\n className=\"w-full max-w-64\"\n >\n <LegendItem className=\"grid grid-cols-[auto_1fr_auto] items-center gap-x-3 gap-y-1\">\n <LegendMarker />\n <LegendLabel />\n <LegendValue formatValue={(value) => usd.format(value)} showPercentage />\n <div className=\"col-span-full\">\n <LegendProgress />\n </div>\n </LegendItem>\n </Legend>\n </div>\n );\n}"
4934
4934
  }
4935
4935
  ],
4936
4936
  "docsUrl": "/charts#ring-chart"
@@ -4940,7 +4940,7 @@
4940
4940
  "title": "Sunburst Chart",
4941
4941
  "category": "Charts",
4942
4942
  "status": "stable",
4943
- "description": "A hierarchy as rings around a center, on the bklit `SunburstChart` primitive. Compose it from\nchildren: one `SunburstSegment` per arc of `buildArcs(data).arcs`, plus `SunburstCenter` (the hub:\nthe focused total with `formatValue`, and a click zooms out), `SunburstLabels`, `SunburstBreadcrumb`\n(drill-down path, above), `SunburstLegend` (branches with value and share, beside the rings) and\n`SunburstHint` (live hint, below). `data` is a `SunburstNode` tree; leaves carry `value`. Segments are\ntinted washes with a solid rim, like the bar and pie charts. Click a segment with children to zoom in.\nThe SVG is decorative and pointer-only: `SunburstLegend` rows zoom in and `SunburstBreadcrumb` buttons\nzoom out by keyboard, so keep both in the chart when focus can change. Rings reveal on mount;\nthere is no loading or empty state. `size` (default 520) is the largest diameter; the chart never\ngets wider than its container.",
4943
+ "description": "A hierarchy as rings around a center, on the bklit `SunburstChart` primitive. Compose it from\nchildren: one `SunburstSegment` per arc of `buildArcs(data).arcs`, plus `SunburstCenter` (the hub:\nthe focused total with `formatValue`, and a click zooms out), `SunburstLabels`, `SunburstBreadcrumb`\n(drill-down path, above), `SunburstLegend` (branches with value and share, beside the rings) and\n`SunburstHint` (live hint, below). `data` is a `SunburstNode` tree; leaves carry `value`. Segments are\nsolid by default (full colour, fading by ring), like the bar and pie charts; `variant=\"tint\"` on\n`SunburstSegment` gives the wash with a solid rim. Click a segment with children to zoom in.\nThe SVG is decorative and pointer-only: `SunburstLegend` rows zoom in and `SunburstBreadcrumb` buttons\nzoom out by keyboard, so keep both in the chart when focus can change. Rings reveal on mount;\nthere is no loading or empty state. `size` (default 520) is the largest diameter; the chart never\ngets wider than its container.",
4944
4944
  "importPath": "@dodopayments/ui/sunburst-chart",
4945
4945
  "exports": [
4946
4946
  "SunburstArc",
@@ -4968,7 +4968,7 @@
4968
4968
  "parts": [
4969
4969
  {
4970
4970
  "name": "SunburstChart",
4971
- "description": "A hierarchy as rings around a center, on the bklit `SunburstChart` primitive. Compose it from\nchildren: one `SunburstSegment` per arc of `buildArcs(data).arcs`, plus `SunburstCenter` (the hub:\nthe focused total with `formatValue`, and a click zooms out), `SunburstLabels`, `SunburstBreadcrumb`\n(drill-down path, above), `SunburstLegend` (branches with value and share, beside the rings) and\n`SunburstHint` (live hint, below). `data` is a `SunburstNode` tree; leaves carry `value`. Segments are\ntinted washes with a solid rim, like the bar and pie charts. Click a segment with children to zoom in.\nThe SVG is decorative and pointer-only: `SunburstLegend` rows zoom in and `SunburstBreadcrumb` buttons\nzoom out by keyboard, so keep both in the chart when focus can change. Rings reveal on mount;\nthere is no loading or empty state. `size` (default 520) is the largest diameter; the chart never\ngets wider than its container.",
4971
+ "description": "A hierarchy as rings around a center, on the bklit `SunburstChart` primitive. Compose it from\nchildren: one `SunburstSegment` per arc of `buildArcs(data).arcs`, plus `SunburstCenter` (the hub:\nthe focused total with `formatValue`, and a click zooms out), `SunburstLabels`, `SunburstBreadcrumb`\n(drill-down path, above), `SunburstLegend` (branches with value and share, beside the rings) and\n`SunburstHint` (live hint, below). `data` is a `SunburstNode` tree; leaves carry `value`. Segments are\nsolid by default (full colour, fading by ring), like the bar and pie charts; `variant=\"tint\"` on\n`SunburstSegment` gives the wash with a solid rim. Click a segment with children to zoom in.\nThe SVG is decorative and pointer-only: `SunburstLegend` rows zoom in and `SunburstBreadcrumb` buttons\nzoom out by keyboard, so keep both in the chart when focus can change. Rings reveal on mount;\nthere is no loading or empty state. `size` (default 520) is the largest diameter; the chart never\ngets wider than its container.",
4972
4972
  "props": [
4973
4973
  {
4974
4974
  "name": "data",
@@ -5099,7 +5099,7 @@
5099
5099
  "name": "variant",
5100
5100
  "type": "\"tint\" | \"solid\"",
5101
5101
  "required": false,
5102
- "description": "`\"tint\"`: the bar and pie charts' look, the branch colour washed 20% into the card on every ring (35% while\nhovered) with a solid 3px rim on the outer edge. `\"solid\"`: the full colour, fading by ring. A gradient or pattern\n`fill` stays solid. Default: \"tint\"",
5102
+ "description": "`\"solid\"`: the full colour, fading by ring, as the bar, pie and ring charts. `\"tint\"`: the branch colour washed 20%\ninto the card on every ring (35% while hovered) with a solid 3px rim on the outer edge. A gradient or pattern\n`fill` stays solid. Default: \"solid\"",
5103
5103
  "source": "dodo"
5104
5104
  }
5105
5105
  ]
@@ -5174,7 +5174,7 @@
5174
5174
  },
5175
5175
  {
5176
5176
  "name": "SunburstLegend",
5177
- "description": "The branches of a `SunburstChart` as a list beside it: a marker in the ring's tint, the name, the value and its share.\nIt follows the drill-down (the focused node's children) and the hover, both ways. A row with children is a button\nthat zooms in, so it is also the keyboard way into the hierarchy. Put it inside `SunburstChart`; the chart places it\nbeside the rings, or under them when there is no room.",
5177
+ "description": "The branches of a `SunburstChart` as a list beside it: a marker in the branch colour, the name, the value and its share.\nIt follows the drill-down (the focused node's children) and the hover, both ways. A row with children is a button\nthat zooms in, so it is also the keyboard way into the hierarchy. Put it inside `SunburstChart`; the chart places it\nbeside the rings, or under them when there is no room.",
5178
5178
  "props": [
5179
5179
  {
5180
5180
  "name": "className",
@@ -5197,6 +5197,13 @@
5197
5197
  "description": "Show each row's share of the focused node. Default: true",
5198
5198
  "source": "dodo"
5199
5199
  },
5200
+ {
5201
+ "name": "variant",
5202
+ "type": "\"tint\" | \"solid\"",
5203
+ "required": false,
5204
+ "description": "The marker, to match the segments: `\"solid\"` fills it with the branch colour; `\"tint\"` is a 20% wash with a solid\n2px top edge. Default: \"solid\"",
5205
+ "source": "dodo"
5206
+ },
5200
5207
  {
5201
5208
  "name": "zoomInLabel",
5202
5209
  "type": "string",
@@ -6086,7 +6093,7 @@
6086
6093
  "title": "Sankey Chart",
6087
6094
  "category": "Charts",
6088
6095
  "status": "stable",
6089
- "description": "A Sankey diagram on the bklit `SankeyChart` primitive (visx, d3-sankey): flows between nodes, each\nband as wide as its value. Use it to show where an amount goes, e.g. gross volume into fees,\nrefunds and payouts. Compose it from children: `SankeyLink` (the bands), `SankeyNode` (the bars\nand their labels) and `SankeyTooltip`. `data` is `{ nodes, links }`: each node has a `name`, each\nlink a `source` and `target` node index and a `value`. Nodes and bands grow in on mount over\n`animationDuration`. Nodes and bands use the tint look of the other charts by default (nodes a 20%\nwash with a solid edge on their label side, bands a lighter 12% wash in their source node's colour, 24% while\nhighlighted); set\n`variant=\"solid\"` on `SankeyLink` / `SankeyNode` for full colour. The chart is as wide as its container; height comes from `aspectRatio`\n(default `\"2 / 1\"`). The default `margin` keeps 180px on each side for node labels.",
6096
+ "description": "A Sankey diagram on the bklit `SankeyChart` primitive (visx, d3-sankey): flows between nodes, each\nband as wide as its value. Use it to show where an amount goes, e.g. gross volume into fees,\nrefunds and payouts. Compose it from children: `SankeyLink` (the bands), `SankeyNode` (the bars\nand their labels) and `SankeyTooltip`. `data` is `{ nodes, links }`: each node has a `name`, each\nlink a `source` and `target` node index and a `value`. Nodes and bands grow in on mount over\n`animationDuration`. Nodes and bands are solid by default: nodes in full colour, each band its source node's\ncolour at 35% opacity, so crossing bands blend; set `useGradient` on `SankeyLink` for a source-to-target gradient.\n`variant=\"tint\"` on `SankeyLink` / `SankeyNode` gives the tint look of the other charts (nodes a 20% wash with a\nsolid edge on their label side, bands a 12% wash, 24% while highlighted). The chart is as wide as its container; height comes from `aspectRatio`\n(default `\"2 / 1\"`). The default `margin` keeps 180px on each side for node labels.",
6090
6097
  "importPath": "@dodopayments/ui/sankey-chart",
6091
6098
  "exports": [
6092
6099
  "SankeyChart",
@@ -6108,7 +6115,7 @@
6108
6115
  "parts": [
6109
6116
  {
6110
6117
  "name": "SankeyChart",
6111
- "description": "A Sankey diagram on the bklit `SankeyChart` primitive (visx, d3-sankey): flows between nodes, each\nband as wide as its value. Use it to show where an amount goes, e.g. gross volume into fees,\nrefunds and payouts. Compose it from children: `SankeyLink` (the bands), `SankeyNode` (the bars\nand their labels) and `SankeyTooltip`. `data` is `{ nodes, links }`: each node has a `name`, each\nlink a `source` and `target` node index and a `value`. Nodes and bands grow in on mount over\n`animationDuration`. Nodes and bands use the tint look of the other charts by default (nodes a 20%\nwash with a solid edge on their label side, bands a lighter 12% wash in their source node's colour, 24% while\nhighlighted); set\n`variant=\"solid\"` on `SankeyLink` / `SankeyNode` for full colour. The chart is as wide as its container; height comes from `aspectRatio`\n(default `\"2 / 1\"`). The default `margin` keeps 180px on each side for node labels.",
6118
+ "description": "A Sankey diagram on the bklit `SankeyChart` primitive (visx, d3-sankey): flows between nodes, each\nband as wide as its value. Use it to show where an amount goes, e.g. gross volume into fees,\nrefunds and payouts. Compose it from children: `SankeyLink` (the bands), `SankeyNode` (the bars\nand their labels) and `SankeyTooltip`. `data` is `{ nodes, links }`: each node has a `name`, each\nlink a `source` and `target` node index and a `value`. Nodes and bands grow in on mount over\n`animationDuration`. Nodes and bands are solid by default: nodes in full colour, each band its source node's\ncolour at 35% opacity, so crossing bands blend; set `useGradient` on `SankeyLink` for a source-to-target gradient.\n`variant=\"tint\"` on `SankeyLink` / `SankeyNode` gives the tint look of the other charts (nodes a 20% wash with a\nsolid edge on their label side, bands a 12% wash, 24% while highlighted). The chart is as wide as its container; height comes from `aspectRatio`\n(default `\"2 / 1\"`). The default `margin` keeps 180px on each side for node labels.",
6112
6119
  "props": [
6113
6120
  {
6114
6121
  "name": "data",
@@ -6198,7 +6205,7 @@
6198
6205
  },
6199
6206
  {
6200
6207
  "name": "SankeyLink",
6201
- "description": "The flow bands of a Sankey diagram, one per link, drawn from left to right on mount. By default\n(`variant=\"tint\"`) each band is a soft wash of its source node's colour; `variant=\"solid\"` draws a\ngradient from the source colour to the target colour. Hovering a band highlights it and feeds\n`SankeyTooltip`.",
6208
+ "description": "The flow bands of a Sankey diagram, one per link, drawn from left to right on mount. By default\n(`variant=\"solid\"`) each band is its source node's colour at 35% opacity; `useGradient` runs it\nfrom the source colour to the target colour, and `variant=\"tint\"` draws an opaque soft wash. Hovering a band highlights it and feeds\n`SankeyTooltip`.",
6202
6209
  "props": [
6203
6210
  {
6204
6211
  "name": "fadedOpacity",
@@ -6239,35 +6246,35 @@
6239
6246
  "name": "stroke",
6240
6247
  "type": "string",
6241
6248
  "required": false,
6242
- "description": "Stroke color for links (overrides gradient). Default: uses gradient",
6249
+ "description": "Stroke color for every link (overrides the source colour and the gradient).",
6243
6250
  "source": "dodo"
6244
6251
  },
6245
6252
  {
6246
6253
  "name": "strokeOpacity",
6247
6254
  "type": "number",
6248
6255
  "required": false,
6249
- "description": "Stroke opacity of the `\"solid\"` look. Default: 0.5",
6256
+ "description": "Stroke opacity of the `\"solid\"` look. Default: 0.35",
6250
6257
  "source": "dodo"
6251
6258
  },
6252
6259
  {
6253
6260
  "name": "useGradient",
6254
6261
  "type": "boolean",
6255
6262
  "required": false,
6256
- "description": "Use gradient from source to target color. Default: true",
6263
+ "description": "`\"solid\"` only: a gradient from the source to the target colour instead of the source colour. Default: false",
6257
6264
  "source": "dodo"
6258
6265
  },
6259
6266
  {
6260
6267
  "name": "variant",
6261
6268
  "type": "\"tint\" | \"solid\"",
6262
6269
  "required": false,
6263
- "description": "`\"tint\"`: the radar look of the other charts, each band an opaque 12% wash of one colour (its\nsource node's, or `stroke` / `getLinkColor`), 24% while highlighted, lighter than the 20% nodes so\nthey stand out; no gradient between two hues.\n`\"solid\"`: the full colour at `strokeOpacity`, a source-to-target gradient by default.\nA pattern from `getLinkPattern` stays as it is. Default: \"tint\"",
6270
+ "description": "`\"solid\"`: each band its source node's colour (or `stroke` / `getLinkColor`) at `strokeOpacity`,\ntranslucent so crossing bands blend, as the bar, pie and ring charts' solid look.\n`\"tint\"`: each band an opaque 12% wash of that colour, 24% while highlighted.\nA pattern from `getLinkPattern` stays as it is. Default: \"solid\"",
6264
6271
  "source": "dodo"
6265
6272
  }
6266
6273
  ]
6267
6274
  },
6268
6275
  {
6269
6276
  "name": "SankeyNode",
6270
- "description": "The node bars of a Sankey diagram, with a name and a value label beside each. Nodes on the left\nhalf label to their left, the others to their right. By default (`variant=\"tint\"`) each node is a\nsoft wash of its colour with a solid edge on its label side; `variant=\"solid\"` fills it fully. Hovering a node highlights its links and\nfeeds `SankeyTooltip`.",
6277
+ "description": "The node bars of a Sankey diagram, with a name and a value label beside each. Nodes on the left\nhalf label to their left, the others to their right. By default (`variant=\"solid\"`) each node is\nits full colour; `variant=\"tint\"` draws a soft wash with a solid edge on its label side. Hovering a node highlights its links and\nfeeds `SankeyTooltip`.",
6271
6278
  "props": [
6272
6279
  {
6273
6280
  "name": "fadedOpacity",
@@ -6280,7 +6287,7 @@
6280
6287
  "name": "fill",
6281
6288
  "type": "string",
6282
6289
  "required": false,
6283
- "description": "Fill color for nodes. Default: uses theme colors",
6290
+ "description": "Fill color for every node. Default: `--chart-solid-1` to `--chart-solid-3`, then `--chart-4` and `--chart-5`, by node",
6284
6291
  "source": "dodo"
6285
6292
  },
6286
6293
  {
@@ -6329,7 +6336,7 @@
6329
6336
  "name": "variant",
6330
6337
  "type": "\"tint\" | \"solid\"",
6331
6338
  "required": false,
6332
- "description": "`\"tint\"`: the radar look of the other charts, each node an opaque 20% wash of its colour with a\nsolid 3px edge on its label side. `\"solid\"`: the full colour. Default: \"tint\"",
6339
+ "description": "`\"solid\"`: the full colour, as the bar, pie and ring charts. `\"tint\"`: an opaque 20% wash of the\ncolour with a solid 3px edge on its label side. Default: \"solid\"",
6333
6340
  "source": "dodo"
6334
6341
  }
6335
6342
  ]
@@ -6399,11 +6406,11 @@
6399
6406
  "examples": [
6400
6407
  {
6401
6408
  "name": "sankey-chart/checkout",
6402
- "code": "\"use client\";\n\nimport {\n type SankeyData,\n SankeyChart,\n SankeyLink,\n SankeyNode,\n SankeyTooltip,\n} from \"@dodopayments/ui/sankey-chart\";\n\n// Checkout sessions this week: how many paid, and with which method.\nconst data: SankeyData = {\n nodes: [\n { name: \"Checkouts\", category: \"source\" },\n { name: \"Paid\" },\n { name: \"Abandoned\" },\n { name: \"Failed\" },\n { name: \"Card\" },\n { name: \"UPI\" },\n { name: \"Wallet\" },\n ],\n links: [\n { source: 0, target: 1, value: 6_420 },\n { source: 0, target: 2, value: 2_310 },\n { source: 0, target: 3, value: 540 },\n { source: 1, target: 4, value: 3_880 },\n { source: 1, target: 5, value: 1_910 },\n { source: 1, target: 6, value: 630 },\n ],\n};\n\nexport default function SankeyChartCheckout() {\n return (\n <SankeyChart\n data={data}\n label=\"Checkout sessions by outcome and payment method, this week\"\n aspectRatio=\"16 / 9\"\n margin={{ top: 16, right: 96, bottom: 16, left: 96 }}\n >\n <SankeyLink stroke=\"var(--chart-1)\" />\n <SankeyNode fill=\"var(--chart-1)\" />\n <SankeyTooltip nodeValueLabel=\"Sessions\" linkValueLabel=\"Sessions\" />\n </SankeyChart>\n );\n}"
6409
+ "code": "\"use client\";\n\nimport {\n type SankeyData,\n SankeyChart,\n SankeyLink,\n SankeyNode,\n SankeyTooltip,\n} from \"@dodopayments/ui/sankey-chart\";\n\n// Checkout sessions this week: how many paid, and with which method.\nconst data: SankeyData = {\n nodes: [\n { name: \"Checkouts\", category: \"source\" },\n { name: \"Paid\" },\n { name: \"Abandoned\" },\n { name: \"Failed\" },\n { name: \"Card\" },\n { name: \"UPI\" },\n { name: \"Wallet\" },\n ],\n links: [\n { source: 0, target: 1, value: 6_420 },\n { source: 0, target: 2, value: 2_310 },\n { source: 0, target: 3, value: 540 },\n { source: 1, target: 4, value: 3_880 },\n { source: 1, target: 5, value: 1_910 },\n { source: 1, target: 6, value: 630 },\n ],\n};\n\nexport default function SankeyChartCheckout() {\n return (\n <SankeyChart\n data={data}\n label=\"Checkout sessions by outcome and payment method, this week\"\n aspectRatio=\"16 / 9\"\n margin={{ top: 16, right: 96, bottom: 16, left: 96 }}\n >\n <SankeyLink stroke=\"var(--chart-solid-1)\" />\n <SankeyNode fill=\"var(--chart-solid-1)\" />\n <SankeyTooltip nodeValueLabel=\"Sessions\" linkValueLabel=\"Sessions\" />\n </SankeyChart>\n );\n}"
6403
6410
  },
6404
6411
  {
6405
6412
  "name": "sankey-chart/payment-flow",
6406
- "code": "\"use client\";\n\nimport {\n type SankeyData,\n SankeyChart,\n SankeyLink,\n SankeyNode,\n SankeyTooltip,\n} from \"@dodopayments/ui/sankey-chart\";\n\n// Where September's gross volume went: fees and refunds out, then net payouts by currency.\nconst data: SankeyData = {\n nodes: [\n { name: \"Gross volume\", category: \"source\" },\n { name: \"Processing fees\" },\n { name: \"Refunds\" },\n { name: \"Net volume\" },\n { name: \"USD payouts\" },\n { name: \"EUR payouts\" },\n { name: \"GBP payouts\" },\n { name: \"INR payouts\" },\n ],\n links: [\n { source: 0, target: 1, value: 14_600 },\n { source: 0, target: 2, value: 9_800 },\n { source: 0, target: 3, value: 386_200 },\n { source: 3, target: 4, value: 211_400 },\n { source: 3, target: 5, value: 88_300 },\n { source: 3, target: 6, value: 51_900 },\n { source: 3, target: 7, value: 34_600 },\n ],\n};\n\nconst COLORS: Record<string, string> = {\n \"Gross volume\": \"var(--chart-1)\",\n \"Processing fees\": \"var(--muted-foreground)\",\n Refunds: \"var(--chart-negative)\",\n \"Net volume\": \"var(--chart-2)\",\n};\n\nconst nodeColor = (node: { name: string }) => COLORS[node.name] ?? \"var(--chart-3)\";\n\nconst usdCompact = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n notation: \"compact\",\n maximumFractionDigits: 1,\n});\n\nexport default function SankeyChartPaymentFlow() {\n return (\n <SankeyChart\n data={data}\n label=\"Gross volume to net payouts by currency, September 2026\"\n aspectRatio=\"16 / 9\"\n margin={{ top: 16, right: 112, bottom: 16, left: 112 }}\n >\n <SankeyLink getNodeColor={nodeColor} />\n <SankeyNode getNodeColor={nodeColor} formatValue={(value) => usdCompact.format(value)} />\n <SankeyTooltip\n nodeValueLabel=\"Amount\"\n linkValueLabel=\"Amount\"\n formatValue={(value) => usdCompact.format(value)}\n />\n </SankeyChart>\n );\n}"
6413
+ "code": "\"use client\";\n\nimport {\n type SankeyData,\n SankeyChart,\n SankeyLink,\n SankeyNode,\n SankeyTooltip,\n} from \"@dodopayments/ui/sankey-chart\";\n\n// Where September's gross volume went: fees and refunds out, then net payouts by currency.\nconst data: SankeyData = {\n nodes: [\n { name: \"Gross volume\", category: \"source\" },\n { name: \"Processing fees\" },\n { name: \"Refunds\" },\n { name: \"Net volume\" },\n { name: \"USD payouts\" },\n { name: \"EUR payouts\" },\n { name: \"GBP payouts\" },\n { name: \"INR payouts\" },\n ],\n links: [\n { source: 0, target: 1, value: 14_600 },\n { source: 0, target: 2, value: 9_800 },\n { source: 0, target: 3, value: 386_200 },\n { source: 3, target: 4, value: 211_400 },\n { source: 3, target: 5, value: 88_300 },\n { source: 3, target: 6, value: 51_900 },\n { source: 3, target: 7, value: 34_600 },\n ],\n};\n\nconst COLORS: Record<string, string> = {\n \"Gross volume\": \"var(--chart-solid-1)\",\n \"Processing fees\": \"var(--muted-foreground)\",\n Refunds: \"var(--chart-negative)\",\n \"Net volume\": \"var(--chart-solid-2)\",\n};\n\nconst nodeColor = (node: { name: string }) => COLORS[node.name] ?? \"var(--chart-solid-3)\";\n\nconst usdCompact = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n notation: \"compact\",\n maximumFractionDigits: 1,\n});\n\nexport default function SankeyChartPaymentFlow() {\n return (\n <SankeyChart\n data={data}\n label=\"Gross volume to net payouts by currency, September 2026\"\n aspectRatio=\"16 / 9\"\n margin={{ top: 16, right: 112, bottom: 16, left: 112 }}\n >\n <SankeyLink getNodeColor={nodeColor} />\n <SankeyNode getNodeColor={nodeColor} formatValue={(value) => usdCompact.format(value)} />\n <SankeyTooltip\n nodeValueLabel=\"Amount\"\n linkValueLabel=\"Amount\"\n formatValue={(value) => usdCompact.format(value)}\n />\n </SankeyChart>\n );\n}"
6407
6414
  }
6408
6415
  ],
6409
6416
  "docsUrl": "/charts#sankey-chart"
@@ -7340,6 +7347,77 @@
7340
7347
  ],
7341
7348
  "docsUrl": "/components/button"
7342
7349
  },
7350
+ {
7351
+ "slug": "button-group",
7352
+ "title": "Button group",
7353
+ "category": "Actions",
7354
+ "status": "stable",
7355
+ "description": "Joins buttons into one control: a split button (a primary action beside a `Menu` of related ones,\ne.g. Save with Copy to live mode behind a `⋯`) or a row of related actions. The inner corners and\nborders meet. Name the group with `aria-label` when its buttons share one purpose.",
7356
+ "importPath": "@dodopayments/ui/button-group",
7357
+ "exports": [
7358
+ "ButtonGroup",
7359
+ "ButtonGroupProps",
7360
+ "ButtonGroupSeparator",
7361
+ "ButtonGroupSeparatorProps"
7362
+ ],
7363
+ "parts": [
7364
+ {
7365
+ "name": "ButtonGroup",
7366
+ "description": "Joins buttons into one control: a split button (a primary action beside a `Menu` of related ones,\ne.g. Save with Copy to live mode behind a `⋯`) or a row of related actions. The inner corners and\nborders meet. Name the group with `aria-label` when its buttons share one purpose.",
7367
+ "props": [
7368
+ {
7369
+ "name": "className",
7370
+ "type": "string",
7371
+ "required": false,
7372
+ "description": "Additional Tailwind classes, merged last.",
7373
+ "source": "dodo"
7374
+ },
7375
+ {
7376
+ "name": "orientation",
7377
+ "type": "\"vertical\" | \"horizontal\" | null",
7378
+ "required": false,
7379
+ "description": "",
7380
+ "source": "dodo"
7381
+ }
7382
+ ]
7383
+ },
7384
+ {
7385
+ "name": "ButtonGroupSeparator",
7386
+ "description": "The rule between two buttons of a {@link ButtonGroup}: vertical by default, for a row of buttons.",
7387
+ "props": [
7388
+ {
7389
+ "name": "className",
7390
+ "type": "string | (string & ((state: SeparatorState) => string | undefined))",
7391
+ "required": false,
7392
+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state.",
7393
+ "source": "dodo"
7394
+ },
7395
+ {
7396
+ "name": "orientation",
7397
+ "type": "\"vertical\" | \"horizontal\"",
7398
+ "required": false,
7399
+ "default": "\"vertical\"",
7400
+ "description": "Direction of the rule: vertical between the buttons of a row, horizontal in a column.",
7401
+ "source": "dodo"
7402
+ },
7403
+ {
7404
+ "name": "render",
7405
+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SeparatorState>",
7406
+ "required": false,
7407
+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render.",
7408
+ "source": "base-ui"
7409
+ }
7410
+ ]
7411
+ }
7412
+ ],
7413
+ "examples": [
7414
+ {
7415
+ "name": "button-group/split",
7416
+ "code": "\"use client\";\n\nimport { Button } from \"@dodopayments/ui/button\";\nimport { ButtonGroup, ButtonGroupSeparator } from \"@dodopayments/ui/button-group\";\nimport { DotsIcon } from \"@dodopayments/ui/icons\";\nimport { Menu, MenuContent, MenuItem, MenuTrigger } from \"@dodopayments/ui/menu\";\n\nexport default function ButtonGroupSplit() {\n return (\n <ButtonGroup aria-label=\"Save actions\">\n <Button variant=\"secondary\">Save</Button>\n <ButtonGroupSeparator />\n <Menu>\n <MenuTrigger\n render={<Button variant=\"secondary\" size=\"icon\" aria-label=\"More save actions\" />}\n >\n <DotsIcon aria-hidden=\"true\" />\n </MenuTrigger>\n <MenuContent align=\"end\">\n <MenuItem>Copy to live mode</MenuItem>\n <MenuItem>Reset</MenuItem>\n </MenuContent>\n </Menu>\n </ButtonGroup>\n );\n}"
7417
+ }
7418
+ ],
7419
+ "docsUrl": "/components/button-group"
7420
+ },
7343
7421
  {
7344
7422
  "slug": "chart",
7345
7423
  "title": "Chart",
@@ -8387,19 +8465,19 @@
8387
8465
  "examples": [
8388
8466
  {
8389
8467
  "name": "chart/brush",
8390
- "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartBrush, ChartBrushLayout, ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Daily payout volume over 90 days. Drag the handles in the strip to zoom the main chart.\nconst data = Array.from({ length: 90 }, (_, day) => ({\n date: new Date(2026, 6, 1 + day),\n payouts: Math.round(12400 + 60 * day + 2100 * Math.sin(day / 6)),\n}));\n\nconst stripMargin = { top: 4, right: 16, bottom: 4, left: 16 };\n\nexport default function ChartBrushDemo() {\n return (\n <div className=\"h-96 w-full\">\n <ChartBrushLayout\n data={data}\n enabled\n height={72}\n brushStrip={(layout) => (\n <AreaChart\n data={data}\n label=\"Payout volume, July to September 2026, overview\"\n className=\"h-full\"\n margin={stripMargin}\n animationDuration={0}\n style={{ aspectRatio: \"unset\" }}\n >\n <Area dataKey=\"payouts\" fill=\"var(--chart-1)\" fillOpacity={0.15} animate={false} showHighlight={false} />\n <ChartBrush\n fadeOuterEdges\n initialSelection={layout.brushSelection ?? undefined}\n onSelectionChange={layout.onBrushSelectionChange}\n />\n </AreaChart>\n )}\n >\n {(layout) => (\n <AreaChart\n data={data}\n label=\"Payout volume, selected range\"\n className=\"h-full\"\n style={{ aspectRatio: \"unset\" }}\n xDomain={layout.xDomain}\n xDomainSlotCount={layout.xDomainSlotCount}\n tweenYDomainOnXDomainChange\n yDomainTween\n >\n <ChartGrid horizontal />\n <Area dataKey=\"payouts\" fill=\"var(--chart-1)\" />\n <XAxis />\n <ChartTooltip />\n </AreaChart>\n )}\n </ChartBrushLayout>\n </div>\n );\n}"
8468
+ "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartBrush, ChartBrushLayout, ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Daily payout volume over 90 days. Drag the handles in the strip to zoom the main chart.\nconst data = Array.from({ length: 90 }, (_, day) => ({\n date: new Date(2026, 6, 1 + day),\n payouts: Math.round(12400 + 60 * day + 2100 * Math.sin(day / 6)),\n}));\n\nconst stripMargin = { top: 4, right: 16, bottom: 4, left: 16 };\n\nexport default function ChartBrushDemo() {\n return (\n <div className=\"h-96 w-full\">\n <ChartBrushLayout\n data={data}\n enabled\n height={72}\n brushStrip={(layout) => (\n <AreaChart\n data={data}\n label=\"Payout volume, July to September 2026, overview\"\n className=\"h-full\"\n margin={stripMargin}\n animationDuration={0}\n style={{ aspectRatio: \"unset\" }}\n >\n <Area dataKey=\"payouts\" fill=\"var(--chart-solid-1)\" fillOpacity={0.15} animate={false} showHighlight={false} />\n <ChartBrush\n fadeOuterEdges\n initialSelection={layout.brushSelection ?? undefined}\n onSelectionChange={layout.onBrushSelectionChange}\n />\n </AreaChart>\n )}\n >\n {(layout) => (\n <AreaChart\n data={data}\n label=\"Payout volume, selected range\"\n className=\"h-full\"\n style={{ aspectRatio: \"unset\" }}\n xDomain={layout.xDomain}\n xDomainSlotCount={layout.xDomainSlotCount}\n tweenYDomainOnXDomainChange\n yDomainTween\n >\n <ChartGrid horizontal />\n <Area dataKey=\"payouts\" fill=\"var(--chart-solid-1)\" />\n <XAxis />\n <ChartTooltip />\n </AreaChart>\n )}\n </ChartBrushLayout>\n </div>\n );\n}"
8391
8469
  },
8392
8470
  {
8393
8471
  "name": "chart/grid-axes",
8394
- "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, XAxis, YAxis } from \"@dodopayments/ui/chart\";\n\n// Daily monthly recurring revenue (MRR) over 30 days of September 2026.\nconst data = Array.from({ length: 30 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n mrr: Math.round(48200 + 220 * day + 900 * Math.sin(day / 3)),\n}));\n\nconst usdCompact = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n notation: \"compact\",\n maximumFractionDigits: 1,\n});\n\nexport default function ChartGridAxes() {\n return (\n <AreaChart data={data} label=\"Monthly recurring revenue, September 2026\" margin={{ left: 56 }}>\n <ChartGrid horizontal vertical />\n <Area dataKey=\"mrr\" fill=\"var(--chart-1)\" />\n <XAxis />\n <YAxis formatValue={(value) => usdCompact.format(value)} />\n </AreaChart>\n );\n}"
8472
+ "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, XAxis, YAxis } from \"@dodopayments/ui/chart\";\n\n// Daily monthly recurring revenue (MRR) over 30 days of September 2026.\nconst data = Array.from({ length: 30 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n mrr: Math.round(48200 + 220 * day + 900 * Math.sin(day / 3)),\n}));\n\nconst usdCompact = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n notation: \"compact\",\n maximumFractionDigits: 1,\n});\n\nexport default function ChartGridAxes() {\n return (\n <AreaChart data={data} label=\"Monthly recurring revenue, September 2026\" margin={{ left: 56 }}>\n <ChartGrid horizontal vertical />\n <Area dataKey=\"mrr\" fill=\"var(--chart-solid-1)\" />\n <XAxis />\n <YAxis formatValue={(value) => usdCompact.format(value)} />\n </AreaChart>\n );\n}"
8395
8473
  },
8396
8474
  {
8397
8475
  "name": "chart/markers",
8398
- "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport {\n type ChartMarker,\n ChartGrid,\n ChartMarkers,\n MarkerTooltipContent,\n useActiveMarkers,\n XAxis,\n} from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\nimport { BoltIcon, StarIcon, TriangleWarningIcon } from \"@dodopayments/ui/icons\";\n\n// Daily gross revenue, with the events that moved it.\nconst data = Array.from({ length: 30 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n revenue: Math.round(1800 + 45 * day + 380 * Math.sin(day / 4) + (day >= 18 ? 420 : 0)),\n}));\n\nconst markers: ChartMarker[] = [\n {\n date: new Date(2026, 8, 6),\n icon: <TriangleWarningIcon className=\"size-3.5\" />,\n title: \"Card network outage\",\n description: \"Visa payments failed for 40 minutes\",\n },\n {\n date: new Date(2026, 8, 12),\n icon: <StarIcon className=\"size-3.5\" />,\n title: \"Annual plan discount\",\n description: \"20% off annual plans for a week\",\n },\n {\n date: new Date(2026, 8, 19),\n icon: <BoltIcon className=\"size-3.5\" />,\n title: \"Pro plan launch\",\n description: \"New tier at $49 per month\",\n },\n];\n\nfunction MarkerRows() {\n const active = useActiveMarkers(markers);\n return active.length > 0 ? <MarkerTooltipContent markers={active} /> : null;\n}\n\nexport default function ChartMarkersDemo() {\n return (\n <AreaChart data={data} label=\"Gross revenue with product and incident events, September 2026\" margin={{ top: 40 }}>\n <ChartGrid horizontal />\n <Area dataKey=\"revenue\" fill=\"var(--chart-1)\" />\n <XAxis />\n <ChartMarkers items={markers} />\n <ChartTooltip>\n <MarkerRows />\n </ChartTooltip>\n </AreaChart>\n );\n}"
8476
+ "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport {\n type ChartMarker,\n ChartGrid,\n ChartMarkers,\n MarkerTooltipContent,\n useActiveMarkers,\n XAxis,\n} from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\nimport { BoltIcon, StarIcon, TriangleWarningIcon } from \"@dodopayments/ui/icons\";\n\n// Daily gross revenue, with the events that moved it.\nconst data = Array.from({ length: 30 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n revenue: Math.round(1800 + 45 * day + 380 * Math.sin(day / 4) + (day >= 18 ? 420 : 0)),\n}));\n\nconst markers: ChartMarker[] = [\n {\n date: new Date(2026, 8, 6),\n icon: <TriangleWarningIcon className=\"size-3.5\" />,\n title: \"Card network outage\",\n description: \"Visa payments failed for 40 minutes\",\n },\n {\n date: new Date(2026, 8, 12),\n icon: <StarIcon className=\"size-3.5\" />,\n title: \"Annual plan discount\",\n description: \"20% off annual plans for a week\",\n },\n {\n date: new Date(2026, 8, 19),\n icon: <BoltIcon className=\"size-3.5\" />,\n title: \"Pro plan launch\",\n description: \"New tier at $49 per month\",\n },\n];\n\nfunction MarkerRows() {\n const active = useActiveMarkers(markers);\n return active.length > 0 ? <MarkerTooltipContent markers={active} /> : null;\n}\n\nexport default function ChartMarkersDemo() {\n return (\n <AreaChart data={data} label=\"Gross revenue with product and incident events, September 2026\" margin={{ top: 40 }}>\n <ChartGrid horizontal />\n <Area dataKey=\"revenue\" fill=\"var(--chart-solid-1)\" />\n <XAxis />\n <ChartMarkers items={markers} />\n <ChartTooltip>\n <MarkerRows />\n </ChartTooltip>\n </AreaChart>\n );\n}"
8399
8477
  },
8400
8478
  {
8401
8479
  "name": "chart/reference-area",
8402
- "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, ReferenceArea, XAxis, YAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Checkout conversion rate (%) per day. The band marks the 3.0% to 3.6% target range.\nconst data = Array.from({ length: 30 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n conversion: Math.round((3.1 + 0.5 * Math.sin(day / 2.5) + day * 0.012) * 100) / 100,\n}));\n\nexport default function ChartReferenceArea() {\n return (\n <AreaChart data={data} label=\"Checkout conversion rate against the target range, September 2026\">\n <ChartGrid horizontal />\n <ReferenceArea\n y1={3}\n y2={3.6}\n strokeStyle=\"dashed\"\n showMarkers\n stroke=\"var(--chart-2)\"\n markerColor=\"var(--chart-2)\"\n axisLabelColor=\"var(--chart-2)\"\n />\n <Area dataKey=\"conversion\" fill=\"var(--chart-1)\" />\n <XAxis />\n <YAxis formatLargeNumbers={false} formatValue={(value) => `${value.toFixed(1)}%`} />\n <ChartTooltip\n rows={(point) => [\n { color: \"var(--chart-1)\", label: \"Conversion\", value: `${(point.conversion as number).toFixed(2)}%` },\n ]}\n />\n </AreaChart>\n );\n}"
8480
+ "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, ReferenceArea, XAxis, YAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Checkout conversion rate (%) per day. The band marks the 3.0% to 3.6% target range.\nconst data = Array.from({ length: 30 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n conversion: Math.round((3.1 + 0.5 * Math.sin(day / 2.5) + day * 0.012) * 100) / 100,\n}));\n\nexport default function ChartReferenceArea() {\n return (\n <AreaChart data={data} label=\"Checkout conversion rate against the target range, September 2026\">\n <ChartGrid horizontal />\n <ReferenceArea\n y1={3}\n y2={3.6}\n strokeStyle=\"dashed\"\n showMarkers\n stroke=\"var(--chart-2)\"\n markerColor=\"var(--chart-2)\"\n axisLabelColor=\"var(--chart-2)\"\n />\n <Area dataKey=\"conversion\" fill=\"var(--chart-solid-1)\" />\n <XAxis />\n <YAxis formatLargeNumbers={false} formatValue={(value) => `${value.toFixed(1)}%`} />\n <ChartTooltip\n rows={(point) => [\n { color: \"var(--chart-solid-1)\", label: \"Conversion\", value: `${(point.conversion as number).toFixed(2)}%` },\n ]}\n />\n </AreaChart>\n );\n}"
8403
8481
  }
8404
8482
  ],
8405
8483
  "docsUrl": "/charts"
@@ -9300,11 +9378,11 @@
9300
9378
  "examples": [
9301
9379
  {
9302
9380
  "name": "chart-tooltip/custom-rows",
9303
- "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Daily gross revenue and refunds over two weeks.\nconst data = Array.from({ length: 14 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n revenue: Math.round(2400 + 60 * day + 300 * Math.sin(day / 2)),\n refunds: Math.round(180 + 40 * Math.cos(day / 3)),\n}));\n\nconst usd = new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n\nexport default function ChartTooltipCustomRows() {\n return (\n <AreaChart data={data} label=\"Gross revenue, refunds and net revenue, first two weeks of September 2026\">\n <ChartGrid horizontal />\n <Area dataKey=\"revenue\" fill=\"var(--chart-1)\" />\n <Area dataKey=\"refunds\" fill=\"var(--chart-2)\" />\n <XAxis />\n <ChartTooltip\n rows={(point) => {\n const revenue = point.revenue as number;\n const refunds = point.refunds as number;\n return [\n { color: \"var(--chart-1)\", label: \"Gross revenue\", value: usd.format(revenue) },\n { color: \"var(--chart-2)\", label: \"Refunds\", value: usd.format(refunds) },\n { color: \"var(--muted-foreground)\", label: \"Net revenue\", value: usd.format(revenue - refunds) },\n ];\n }}\n />\n </AreaChart>\n );\n}"
9381
+ "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Daily gross revenue and refunds over two weeks.\nconst data = Array.from({ length: 14 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n revenue: Math.round(2400 + 60 * day + 300 * Math.sin(day / 2)),\n refunds: Math.round(180 + 40 * Math.cos(day / 3)),\n}));\n\nconst usd = new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n\nexport default function ChartTooltipCustomRows() {\n return (\n <AreaChart data={data} label=\"Gross revenue, refunds and net revenue, first two weeks of September 2026\">\n <ChartGrid horizontal />\n <Area dataKey=\"revenue\" fill=\"var(--chart-solid-1)\" />\n <Area dataKey=\"refunds\" fill=\"var(--chart-2)\" />\n <XAxis />\n <ChartTooltip\n rows={(point) => {\n const revenue = point.revenue as number;\n const refunds = point.refunds as number;\n return [\n { color: \"var(--chart-solid-1)\", label: \"Gross revenue\", value: usd.format(revenue) },\n { color: \"var(--chart-2)\", label: \"Refunds\", value: usd.format(refunds) },\n { color: \"var(--muted-foreground)\", label: \"Net revenue\", value: usd.format(revenue - refunds) },\n ];\n }}\n />\n </AreaChart>\n );\n}"
9304
9382
  },
9305
9383
  {
9306
9384
  "name": "chart-tooltip/default",
9307
- "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Daily gross revenue and refunds over two weeks.\nconst data = Array.from({ length: 14 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n revenue: Math.round(2400 + 60 * day + 300 * Math.sin(day / 2)),\n refunds: Math.round(180 + 40 * Math.cos(day / 3)),\n}));\n\nexport default function ChartTooltipDefault() {\n return (\n <AreaChart data={data} label=\"Gross revenue and refunds, first two weeks of September 2026\">\n <ChartGrid horizontal />\n <Area dataKey=\"revenue\" fill=\"var(--chart-1)\" />\n <Area dataKey=\"refunds\" fill=\"var(--chart-2)\" />\n <XAxis />\n <ChartTooltip />\n </AreaChart>\n );\n}"
9385
+ "code": "\"use client\";\n\nimport { Area, AreaChart } from \"@dodopayments/ui/area-chart\";\nimport { ChartGrid, XAxis } from \"@dodopayments/ui/chart\";\nimport { ChartTooltip } from \"@dodopayments/ui/chart-tooltip\";\n\n// Daily gross revenue and refunds over two weeks.\nconst data = Array.from({ length: 14 }, (_, day) => ({\n date: new Date(2026, 8, 1 + day),\n revenue: Math.round(2400 + 60 * day + 300 * Math.sin(day / 2)),\n refunds: Math.round(180 + 40 * Math.cos(day / 3)),\n}));\n\nexport default function ChartTooltipDefault() {\n return (\n <AreaChart data={data} label=\"Gross revenue and refunds, first two weeks of September 2026\">\n <ChartGrid horizontal />\n <Area dataKey=\"revenue\" fill=\"var(--chart-solid-1)\" />\n <Area dataKey=\"refunds\" fill=\"var(--chart-2)\" />\n <XAxis />\n <ChartTooltip />\n </AreaChart>\n );\n}"
9308
9386
  }
9309
9387
  ],
9310
9388
  "docsUrl": "/charts"
@@ -10129,7 +10207,7 @@
10129
10207
  "title": "Data table",
10130
10208
  "category": "Data display",
10131
10209
  "status": "stable",
10132
- "description": "The Dodo Nest Data table, driven by a TanStack Table v8 instance: the column headers on a grey tray,\nthe rows (`size` md 48 / lg 64) on the white panel inside it, skeleton rows while `isLoading`, and\n`emptyMessage` centred in the panel when there are no rows. It keeps the table layout at every width:\na table wider than its container scrolls sideways (the container is then a tab stop). It sets\n`aria-sort` on sortable headers and marks selected rows `data-state=\"selected\"` (they keep their\ncolour; the checkbox shows the selection). Sorting, selection and pagination stay in the table\ninstance; pair it with `DataGridColumnHeader`, `DataGridRowSelect(All)` and `DataGridPagination`\n(16 below). After a sort change, the rows glide to their new positions (`animateSort`) and a polite\nlive region announces the new sort. `bulkActions` adds a sticky \"N selected\" bar with actions for\nthe selected rows.",
10210
+ "description": "The Dodo Nest Data table, driven by a TanStack Table v8 instance: the column headers on a grey tray,\nthe rows (`size` md 48 / lg 64) on the white panel inside it, skeleton rows while `isLoading`, and\n`emptyMessage` centred in the panel when there are no rows. It keeps the table layout at every width:\na table wider than its container scrolls sideways (the container is then a tab stop). It sets\n`aria-sort` on sortable headers and marks selected rows `data-state=\"selected\"`, tinted\nSurface/Secondary as on hover. Sorting, selection and pagination stay in the table\ninstance; pair it with `DataGridColumnHeader`, `DataGridRowSelect(All)` and `DataGridPagination`\n(16 below). After a sort change, the rows glide to their new positions (`animateSort`) and a polite\nlive region announces the new sort. `bulkActions` adds a sticky \"N selected\" bar with actions for\nthe selected rows.",
10133
10211
  "importPath": "@dodopayments/ui/data-grid",
10134
10212
  "exports": [
10135
10213
  "DEFAULT_DATA_GRID_BULK_ACTION_LABELS",
@@ -10163,7 +10241,7 @@
10163
10241
  "parts": [
10164
10242
  {
10165
10243
  "name": "DataGrid",
10166
- "description": "The Dodo Nest Data table, driven by a TanStack Table v8 instance: the column headers on a grey tray,\nthe rows (`size` md 48 / lg 64) on the white panel inside it, skeleton rows while `isLoading`, and\n`emptyMessage` centred in the panel when there are no rows. It keeps the table layout at every width:\na table wider than its container scrolls sideways (the container is then a tab stop). It sets\n`aria-sort` on sortable headers and marks selected rows `data-state=\"selected\"` (they keep their\ncolour; the checkbox shows the selection). Sorting, selection and pagination stay in the table\ninstance; pair it with `DataGridColumnHeader`, `DataGridRowSelect(All)` and `DataGridPagination`\n(16 below). After a sort change, the rows glide to their new positions (`animateSort`) and a polite\nlive region announces the new sort. `bulkActions` adds a sticky \"N selected\" bar with actions for\nthe selected rows.",
10244
+ "description": "The Dodo Nest Data table, driven by a TanStack Table v8 instance: the column headers on a grey tray,\nthe rows (`size` md 48 / lg 64) on the white panel inside it, skeleton rows while `isLoading`, and\n`emptyMessage` centred in the panel when there are no rows. It keeps the table layout at every width:\na table wider than its container scrolls sideways (the container is then a tab stop). It sets\n`aria-sort` on sortable headers and marks selected rows `data-state=\"selected\"`, tinted\nSurface/Secondary as on hover. Sorting, selection and pagination stay in the table\ninstance; pair it with `DataGridColumnHeader`, `DataGridRowSelect(All)` and `DataGridPagination`\n(16 below). After a sort change, the rows glide to their new positions (`animateSort`) and a polite\nlive region announces the new sort. `bulkActions` adds a sticky \"N selected\" bar with actions for\nthe selected rows.",
10167
10245
  "props": [
10168
10246
  {
10169
10247
  "name": "table",
@@ -10224,6 +10302,13 @@
10224
10302
  "description": "Text that a polite live region announces after the user changes the sort. `null` means the sort\nwas cleared.",
10225
10303
  "source": "dodo"
10226
10304
  },
10305
+ {
10306
+ "name": "getRowHref",
10307
+ "type": "((row: TData) => string)",
10308
+ "required": false,
10309
+ "description": "Makes each row a link to this URL, as main's tables: a click (or Enter) calls `onRowNavigate`, and Ctrl, Cmd,\nthe middle button or Ctrl+Enter open it in a new tab. Rows become focusable. Clicks on controls inside the row\nare ignored, as for `onRowClick`.",
10310
+ "source": "dodo"
10311
+ },
10227
10312
  {
10228
10313
  "name": "isLoading",
10229
10314
  "type": "boolean",
@@ -10254,6 +10339,14 @@
10254
10339
  "description": "Called with the row's original data when a row is clicked or activated with Enter/Space.\nMakes rows focusable. Clicks on buttons, links, inputs, checkboxes and `[data-no-row-click]`\nelements inside the row are ignored.",
10255
10340
  "source": "dodo"
10256
10341
  },
10342
+ {
10343
+ "name": "onRowNavigate",
10344
+ "type": "((href: string, row: TData) => void)",
10345
+ "required": false,
10346
+ "default": "Assigns the URL to `window.location`",
10347
+ "description": "Follows a row's link in the same tab, e.g. `(href) => router.push(href)` for client-side routing.",
10348
+ "source": "dodo"
10349
+ },
10257
10350
  {
10258
10351
  "name": "size",
10259
10352
  "type": "\"md\" | \"lg\"",
@@ -10356,12 +10449,20 @@
10356
10449
  "default": "true",
10357
10450
  "description": "Show the \"Rows per page\" select. Turn it off for cursor lists, which show \"Page N\".",
10358
10451
  "source": "dodo"
10452
+ },
10453
+ {
10454
+ "name": "size",
10455
+ "type": "\"default\" | \"sm\"",
10456
+ "required": false,
10457
+ "default": "\"default\"",
10458
+ "description": "`default` is the Figma footer: Body/Primary labels, a 72 select and 36 arrows. `sm` is a quieter\none for dense pages: Body/Secondary labels, a compact select and 24 arrows.",
10459
+ "source": "dodo"
10359
10460
  }
10360
10461
  ]
10361
10462
  },
10362
10463
  {
10363
10464
  "name": "DataGridRowSelect",
10364
- "description": "Row selection checkbox for a `select` column's `cell`. Toggles `row.toggleSelected()`. A selected row\nkeeps its colour; this box shows the selection.",
10465
+ "description": "Row selection checkbox for a `select` column's `cell`. Toggles `row.toggleSelected()`. A selected row\nkeeps the Surface/Secondary hover tint, and this box is checked.",
10365
10466
  "props": [
10366
10467
  {
10367
10468
  "name": "row",
@@ -11160,6 +11261,97 @@
11160
11261
  "examples": [],
11161
11262
  "docsUrl": "/components/country-select#currency-select"
11162
11263
  },
11264
+ {
11265
+ "slug": "color-input",
11266
+ "title": "Color input",
11267
+ "category": "Forms",
11268
+ "status": "stable",
11269
+ "description": "A colour field: a swatch that opens the browser's colour picker, beside a text field for a hex.\nEither one changes the value, so a merchant can paste a brand colour or pick one. The swatch stays\nempty while the text is not a colour. With an empty value the browser's picker starts at black, so\npicking black from empty fires no change: type it instead.",
11270
+ "importPath": "@dodopayments/ui/color-input",
11271
+ "exports": [
11272
+ "ColorInput",
11273
+ "ColorInputProps"
11274
+ ],
11275
+ "parts": [
11276
+ {
11277
+ "name": "ColorInput",
11278
+ "description": "A colour field: a swatch that opens the browser's colour picker, beside a text field for a hex.\nEither one changes the value, so a merchant can paste a brand colour or pick one. The swatch stays\nempty while the text is not a colour. With an empty value the browser's picker starts at black, so\npicking black from empty fires no change: type it instead.",
11279
+ "props": [
11280
+ {
11281
+ "name": "value",
11282
+ "type": "string",
11283
+ "required": true,
11284
+ "description": "The colour as the merchant typed it, usually a hex such as `#635bff`. Empty means none.",
11285
+ "source": "dodo"
11286
+ },
11287
+ {
11288
+ "name": "className",
11289
+ "type": "string",
11290
+ "required": false,
11291
+ "description": "Classes for the input's control wrapper (rendered `display: contents` inside the group).",
11292
+ "source": "dodo"
11293
+ },
11294
+ {
11295
+ "name": "groupClassName",
11296
+ "type": "string",
11297
+ "required": false,
11298
+ "description": "Classes for the group around the swatch and the text field.",
11299
+ "source": "dodo"
11300
+ },
11301
+ {
11302
+ "name": "nativeInput",
11303
+ "type": "boolean",
11304
+ "required": false,
11305
+ "description": "",
11306
+ "source": "dodo"
11307
+ },
11308
+ {
11309
+ "name": "onValueChange",
11310
+ "type": "((value: string) => void)",
11311
+ "required": false,
11312
+ "description": "Called with the typed text, or with the `#rrggbb` the native picker chose.",
11313
+ "source": "dodo"
11314
+ },
11315
+ {
11316
+ "name": "pickerLabel",
11317
+ "type": "string",
11318
+ "required": false,
11319
+ "description": "Accessible name of the native colour picker behind the swatch.",
11320
+ "source": "dodo"
11321
+ },
11322
+ {
11323
+ "name": "size",
11324
+ "type": "\"lg\"",
11325
+ "required": false,
11326
+ "default": "\"lg\"",
11327
+ "description": "Input height, as `Input` (`DODO_INPUT_VARIANTS`): one size, `lg` 36.",
11328
+ "source": "dodo"
11329
+ },
11330
+ {
11331
+ "name": "unstyled",
11332
+ "type": "boolean",
11333
+ "required": false,
11334
+ "description": "",
11335
+ "source": "dodo"
11336
+ },
11337
+ {
11338
+ "name": "render",
11339
+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, InputState>",
11340
+ "required": false,
11341
+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render.",
11342
+ "source": "base-ui"
11343
+ }
11344
+ ]
11345
+ }
11346
+ ],
11347
+ "examples": [
11348
+ {
11349
+ "name": "color-input/field",
11350
+ "code": "\"use client\";\n/* eslint-disable dodo/no-raw-color-literal -- the hex is the merchant brand colour the demo edits, data rather than styling. */\n\nimport { ColorInput } from \"@dodopayments/ui/color-input\";\nimport { Field } from \"@dodopayments/ui/field\";\nimport { useState } from \"react\";\n\nexport default function ColorInputField() {\n // The merchant's brand colour, as main's Design settings store it.\n const [value, setValue] = useState(\"#635bff\");\n return (\n <div className=\"w-full max-w-xs\">\n <Field label=\"Primary button\">\n <ColorInput aria-label=\"Primary button\" value={value} onValueChange={setValue} />\n </Field>\n </div>\n );\n}"
11351
+ }
11352
+ ],
11353
+ "docsUrl": "/components/color-input"
11354
+ },
11163
11355
  {
11164
11356
  "slug": "timezone-select",
11165
11357
  "title": "Time zone select",
@@ -11573,21 +11765,10 @@
11573
11765
  },
11574
11766
  {
11575
11767
  "name": "variant",
11576
- "type": "\"default\" | \"card\"",
11768
+ "type": "\"link\" | \"default\" | \"warning\" | \"secondary\" | \"ghost\" | \"destructive\" | \"wallet\" | \"destructive-outline\" | null",
11577
11769
  "required": false,
11578
11770
  "description": "",
11579
- "source": "dodo",
11580
- "values": [
11581
- {
11582
- "value": "default",
11583
- "description": "No chrome: a text trigger with a chevron, for inline disclosures such as advanced options."
11584
- },
11585
- {
11586
- "value": "card",
11587
- "description": "The Collapsible section tray: title and description on the grey strip, the control on the right, the content in a white panel when open. Focus rings the whole tray."
11588
- }
11589
- ],
11590
- "default": "\"default\""
11771
+ "source": "dodo"
11591
11772
  }
11592
11773
  ]
11593
11774
  }
@@ -11674,6 +11855,47 @@
11674
11855
  ],
11675
11856
  "docsUrl": "/components/collapsible"
11676
11857
  },
11858
+ {
11859
+ "slug": "scaled-frame",
11860
+ "title": "Scaled frame",
11861
+ "category": "Layout",
11862
+ "status": "stable",
11863
+ "description": "Shows content laid out at a fixed size, scaled down to the width the frame has, e.g. a live checkout\npage in an `iframe` beside its settings. The frame keeps the content's aspect ratio and never scales\nit up. The content stays a live page; put a cover over it when it should not take clicks.",
11864
+ "importPath": "@dodopayments/ui/scaled-frame",
11865
+ "exports": [
11866
+ "ScaledFrame",
11867
+ "ScaledFrameProps"
11868
+ ],
11869
+ "parts": [
11870
+ {
11871
+ "name": "ScaledFrame",
11872
+ "description": "Shows content laid out at a fixed size, scaled down to the width the frame has, e.g. a live checkout\npage in an `iframe` beside its settings. The frame keeps the content's aspect ratio and never scales\nit up. The content stays a live page; put a cover over it when it should not take clicks.",
11873
+ "props": [
11874
+ {
11875
+ "name": "height",
11876
+ "type": "number",
11877
+ "required": true,
11878
+ "description": "The height the content is laid out at, in px.",
11879
+ "source": "dodo"
11880
+ },
11881
+ {
11882
+ "name": "width",
11883
+ "type": "number",
11884
+ "required": true,
11885
+ "description": "The width the content is laid out at, in px, e.g. 1280 for a desktop page.",
11886
+ "source": "dodo"
11887
+ }
11888
+ ]
11889
+ }
11890
+ ],
11891
+ "examples": [
11892
+ {
11893
+ "name": "scaled-frame/preview",
11894
+ "code": "import { ScaledFrame } from \"@dodopayments/ui/scaled-frame\";\n\nexport default function ScaledFramePreview() {\n return (\n <div className=\"w-full max-w-xl rounded-lg border border-border\">\n <ScaledFrame width={1280} height={720}>\n <div className=\"flex size-full items-center justify-center bg-muted text-heading-primary text-foreground\">\n A 1280 by 720 page, scaled to fit\n </div>\n </ScaledFrame>\n </div>\n );\n}"
11895
+ }
11896
+ ],
11897
+ "docsUrl": "/components/scaled-frame"
11898
+ },
11677
11899
  {
11678
11900
  "slug": "dialog",
11679
11901
  "title": "Dialog",
@@ -13089,6 +13311,8 @@
13089
13311
  "importPath": "@dodopayments/ui/file-upload",
13090
13312
  "exports": [
13091
13313
  "FileUpload",
13314
+ "FileUploadButton",
13315
+ "FileUploadButtonProps",
13092
13316
  "FileUploadFooter",
13093
13317
  "FileUploadFooterProps",
13094
13318
  "FileUploadItem",
@@ -13200,6 +13424,135 @@
13200
13424
  }
13201
13425
  ]
13202
13426
  },
13427
+ {
13428
+ "name": "FileUploadButton",
13429
+ "description": "A button that opens the file picker, for a small upload in a row, such as a logo beside its preview,\nwhere the dropzone is too large. Picked files are checked as `FileUpload` checks them.",
13430
+ "props": [
13431
+ {
13432
+ "name": "accept",
13433
+ "type": "string",
13434
+ "required": false,
13435
+ "description": "Accepted files, as in `<input accept>`, checked again after the pick.",
13436
+ "source": "dodo"
13437
+ },
13438
+ {
13439
+ "name": "className",
13440
+ "type": "string",
13441
+ "required": false,
13442
+ "description": "Additional Tailwind classes, merged last.",
13443
+ "source": "dodo"
13444
+ },
13445
+ {
13446
+ "name": "errorText",
13447
+ "type": "ReactNode",
13448
+ "required": false,
13449
+ "default": "\"Try again\"",
13450
+ "description": "Label shown while `result` is `\"error\"`.",
13451
+ "source": "dodo"
13452
+ },
13453
+ {
13454
+ "name": "loading",
13455
+ "type": "boolean",
13456
+ "required": false,
13457
+ "description": "Swaps the label for a spinner and `loadingText`, and marks the button busy. The button stays\nfocusable (`aria-disabled`, not `disabled`) and ignores presses. Pass it (even `false`) on buttons\nthat load: both faces then share one cell, so the button keeps its width.",
13458
+ "source": "dodo"
13459
+ },
13460
+ {
13461
+ "name": "loadingText",
13462
+ "type": "ReactNode",
13463
+ "required": false,
13464
+ "description": "Label shown while `loading` or `progress` is set. Defaults to `children`.",
13465
+ "source": "dodo"
13466
+ },
13467
+ {
13468
+ "name": "maxSize",
13469
+ "type": "number",
13470
+ "required": false,
13471
+ "description": "Largest accepted file, in bytes.",
13472
+ "source": "dodo"
13473
+ },
13474
+ {
13475
+ "name": "multiple",
13476
+ "type": "boolean",
13477
+ "required": false,
13478
+ "description": "Accept several files per pick. When false, only the first acceptable file is kept.",
13479
+ "source": "dodo"
13480
+ },
13481
+ {
13482
+ "name": "onFilesAdded",
13483
+ "type": "((files: File[]) => void)",
13484
+ "required": false,
13485
+ "description": "Called with the accepted files of each pick.",
13486
+ "source": "dodo"
13487
+ },
13488
+ {
13489
+ "name": "onFilesRejected",
13490
+ "type": "((rejections: FileUploadRejection[]) => void)",
13491
+ "required": false,
13492
+ "description": "Called with the refused files of each pick and the reason for each.",
13493
+ "source": "dodo"
13494
+ },
13495
+ {
13496
+ "name": "progress",
13497
+ "type": "number | null",
13498
+ "required": false,
13499
+ "description": "Determinate progress (0-100). A fill sweeps across the button and the\npercentage is shown next to `loadingText`. `null`/`undefined` falls back to `loading`.",
13500
+ "source": "dodo"
13501
+ },
13502
+ {
13503
+ "name": "result",
13504
+ "type": "\"success\" | \"error\" | null",
13505
+ "required": false,
13506
+ "description": "Outcome of the last action, after interior.dev's loading button. `\"success\"` swaps the label for a\ncheck and `successText`, `\"error\"` for a warning icon and `errorText`; `null` shows the label.\nThe outcome is announced through a polite live region. Pass it (even `null`) on buttons that\nreport an outcome, so every face shares one cell from the first render. Clear it yourself, e.g.\nafter 1.4s. With `result`, `Button` renders the button and a sibling status element, so do not\npass a `Button` with `result` as the `render` element of another component.",
13507
+ "source": "dodo"
13508
+ },
13509
+ {
13510
+ "name": "size",
13511
+ "type": "\"default\" | \"icon\" | \"xs\" | \"lg\" | \"icon-xs\" | \"icon-lg\" | null",
13512
+ "required": false,
13513
+ "description": "",
13514
+ "source": "dodo"
13515
+ },
13516
+ {
13517
+ "name": "successText",
13518
+ "type": "ReactNode",
13519
+ "required": false,
13520
+ "default": "\"Done\"",
13521
+ "description": "Label shown while `result` is `\"success\"`.",
13522
+ "source": "dodo"
13523
+ },
13524
+ {
13525
+ "name": "variant",
13526
+ "type": "\"link\" | \"default\" | \"warning\" | \"secondary\" | \"ghost\" | \"destructive\" | \"wallet\" | \"destructive-outline\" | null",
13527
+ "required": false,
13528
+ "description": "",
13529
+ "source": "dodo"
13530
+ },
13531
+ {
13532
+ "name": "focusableWhenDisabled",
13533
+ "type": "boolean",
13534
+ "required": false,
13535
+ "default": "false",
13536
+ "description": "Whether the button should be focusable when disabled.",
13537
+ "source": "base-ui"
13538
+ },
13539
+ {
13540
+ "name": "nativeButton",
13541
+ "type": "boolean",
13542
+ "required": false,
13543
+ "default": "true",
13544
+ "description": "Whether the component renders a native `<button>` element when replacing it\nvia the `render` prop.\nSet to `false` if the rendered element is not a button (for example, `<div>`).",
13545
+ "source": "base-ui"
13546
+ },
13547
+ {
13548
+ "name": "render",
13549
+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>",
13550
+ "required": false,
13551
+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render.",
13552
+ "source": "base-ui"
13553
+ }
13554
+ ]
13555
+ },
13203
13556
  {
13204
13557
  "name": "FileUploadFooter",
13205
13558
  "description": "The tray footer: a link-style Remove all button (underlined on hover) and a summary, on one row (Figma File upload > footer).",
@@ -13534,6 +13887,13 @@
13534
13887
  "description": "The key of a `chip`, e.g. \"Customer ID\" (Body/Secondary, Content/Secondary).",
13535
13888
  "source": "dodo"
13536
13889
  },
13890
+ {
13891
+ "name": "link",
13892
+ "type": "ReactElement<Record<string, unknown>, string | JSXElementConstructor<any>>",
13893
+ "required": false,
13894
+ "description": "Renders the value as this link, e.g. `<NextLink href=\"/payments/pay_…\" />`, for an ID that opens its record. The\nvalue keeps its middle truncation and underlines on hover; the copy button stays beside it, outside the link.\n`inline` and `chip` only.",
13895
+ "source": "dodo"
13896
+ },
13537
13897
  {
13538
13898
  "name": "onCopy",
13539
13899
  "type": "((value: string) => void)",
@@ -13748,7 +14108,7 @@
13748
14108
  "examples": [
13749
14109
  {
13750
14110
  "name": "money/basic",
13751
- "code": "\"use client\";\n\nimport { Money } from \"@dodopayments/ui/money\";\n\nconst rows = [\n { label: \"Payment\", minor: 123_450, currency: \"USD\" },\n { label: \"Refund\", minor: -4500, currency: \"USD\" },\n { label: \"Payout (de-DE)\", minor: 98_765, currency: \"EUR\", locale: \"de-DE\" },\n { label: \"Order (ja-JP)\", minor: 123_456, currency: \"JPY\", locale: \"ja-JP\" },\n { label: \"Invoice (3 decimals)\", minor: 12_500, currency: \"KWD\", display: \"code\" },\n { label: \"Card charge (CAD)\", minor: 5000, currency: \"CAD\", display: \"symbolAndCode\" },\n] as const;\n\nexport default function MoneyBasic() {\n return (\n <ul className=\"flex w-full max-w-sm flex-col divide-y divide-border text-sm\">\n {rows.map((row) => (\n <li key={row.label} className=\"flex items-baseline justify-between gap-4 py-2\">\n <span className=\"text-muted-foreground\">{row.label}</span>\n <Money\n minor={row.minor}\n currency={row.currency}\n locale={\"locale\" in row ? row.locale : undefined}\n display={\"display\" in row ? row.display : undefined}\n className=\"font-medium\"\n />\n </li>\n ))}\n <li className=\"flex items-baseline justify-between gap-4 py-2\">\n <span className=\"text-muted-foreground\">Failed charge</span>\n <Money minor={8900} currency=\"USD\" status=\"failed\" className=\"font-medium\" />\n </li>\n </ul>\n );\n}"
14111
+ "code": "\"use client\";\n\nimport { Money } from \"@dodopayments/ui/money\";\n\nconst rows = [\n { label: \"Payment\", minor: 123_450, currency: \"USD\" },\n { label: \"Refund\", minor: -4500, currency: \"USD\" },\n { label: \"Payout (de-DE)\", minor: 98_765, currency: \"EUR\", locale: \"de-DE\" },\n { label: \"Order (ja-JP)\", minor: 123_456, currency: \"JPY\", locale: \"ja-JP\" },\n { label: \"Invoice (3 decimals)\", minor: 12_500, currency: \"KWD\", display: \"code\" },\n { label: \"Card charge (CAD)\", minor: 5000, currency: \"CAD\", display: \"symbolAndCode\" },\n] as const;\n\nexport default function MoneyBasic() {\n return (\n <ul className=\"flex w-full max-w-sm flex-col divide-y divide-border text-body-primary\">\n {rows.map((row) => (\n <li key={row.label} className=\"flex items-baseline justify-between gap-4 py-2\">\n <span className=\"text-muted-foreground\">{row.label}</span>\n <Money\n minor={row.minor}\n currency={row.currency}\n locale={\"locale\" in row ? row.locale : undefined}\n display={\"display\" in row ? row.display : undefined}\n className=\"text-label-primary\"\n />\n </li>\n ))}\n <li className=\"flex items-baseline justify-between gap-4 py-2\">\n <span className=\"text-muted-foreground\">Failed charge</span>\n <Money minor={8900} currency=\"USD\" status=\"failed\" className=\"text-label-primary\" />\n </li>\n </ul>\n );\n}"
13752
14112
  },
13753
14113
  {
13754
14114
  "name": "money/compact-and-blur",
@@ -16707,14 +17067,18 @@
16707
17067
  },
16708
17068
  {
16709
17069
  "name": "size",
16710
- "type": "\"sm\" | \"md\" | \"lg\"",
17070
+ "type": "\"xs\" | \"sm\" | \"md\" | \"lg\"",
16711
17071
  "required": false,
16712
17072
  "description": "",
16713
17073
  "source": "dodo",
16714
17074
  "values": [
17075
+ {
17076
+ "value": "xs",
17077
+ "description": "16px tall artwork with 4px clear space on every side. The smallest size, for a line of small text such as \"Secure checkout by\"."
17078
+ },
16715
17079
  {
16716
17080
  "value": "sm",
16717
- "description": "24px tall artwork with 6px clear space on every side. The smallest size."
17081
+ "description": "24px tall artwork with 6px clear space on every side."
16718
17082
  },
16719
17083
  {
16720
17084
  "value": "md",
@@ -16781,7 +17145,7 @@
16781
17145
  },
16782
17146
  {
16783
17147
  "name": "logo/sizes",
16784
- "code": "\"use client\";\n\nimport { Logo } from \"@dodopayments/ui/logo\";\n\nexport default function LogoSizes() {\n return (\n // The large lockup is wider than small phones: a labelled, tabbable region scrolls by keyboard.\n <div\n role=\"region\"\n aria-label=\"Logo sizes\"\n tabIndex={0}\n className=\"flex rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring w-full flex-col items-start gap-4 overflow-x-auto\"\n >\n <div className=\"flex items-center gap-2\">\n <Logo variant=\"mark\" size=\"sm\" />\n <Logo variant=\"mark\" size=\"md\" />\n <Logo variant=\"mark\" size=\"lg\" />\n </div>\n <Logo size=\"sm\" />\n <Logo size=\"md\" />\n <Logo size=\"lg\" />\n </div>\n );\n}"
17148
+ "code": "\"use client\";\n\nimport { Logo } from \"@dodopayments/ui/logo\";\n\nexport default function LogoSizes() {\n return (\n // The large lockup is wider than small phones: a labelled, tabbable region scrolls by keyboard.\n <div\n role=\"region\"\n aria-label=\"Logo sizes\"\n tabIndex={0}\n className=\"flex rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring w-full flex-col items-start gap-4 overflow-x-auto\"\n >\n <div className=\"flex items-center gap-2\">\n <Logo variant=\"mark\" size=\"xs\" />\n <Logo variant=\"mark\" size=\"sm\" />\n <Logo variant=\"mark\" size=\"md\" />\n <Logo variant=\"mark\" size=\"lg\" />\n </div>\n <Logo size=\"xs\" />\n <Logo size=\"sm\" />\n <Logo size=\"md\" />\n <Logo size=\"lg\" />\n </div>\n );\n}"
16785
17149
  },
16786
17150
  {
16787
17151
  "name": "logo/tones",
@@ -17130,6 +17494,14 @@
17130
17494
  "default": "true",
17131
17495
  "description": "Show the \"Rows per page\" select. Turn it off for cursor lists, which show \"Page N\".",
17132
17496
  "source": "dodo"
17497
+ },
17498
+ {
17499
+ "name": "size",
17500
+ "type": "\"default\" | \"sm\"",
17501
+ "required": false,
17502
+ "default": "\"default\"",
17503
+ "description": "`default` is the Figma footer: Body/Primary labels, a 72 select and 36 arrows. `sm` is a quieter\none for dense pages: Body/Secondary labels, a compact select and 24 arrows.",
17504
+ "source": "dodo"
17133
17505
  }
17134
17506
  ]
17135
17507
  }
@@ -17525,7 +17897,7 @@
17525
17897
  },
17526
17898
  {
17527
17899
  "name": "Radio",
17528
- "description": "One option in a `RadioGroup`, identified by `value`. Renders the `Radio` primitive: a `<span role=\"radio\">` plus a\nhidden `<input>`. On its own it is the bare radio: label it by wrapping it and its text in a `<label>`. With `label`\n(and `description`) it renders the whole option, a `<label>` with the text beside the radio, and\n`variant=\"card\"` makes that a card with the radio before the title. It presses in while held; an option that is\nselected when it mounts does not animate.",
17900
+ "description": "One option in a `RadioGroup`, identified by `value`. Renders the `Radio` primitive: a `<span role=\"radio\">` plus a\nhidden `<input>`. On its own it is the bare radio: label it by wrapping it and its text in a `<label>`. With `label`\n(and `description`) it renders the whole option, a `<label>` with the text beside the radio, and\n`variant=\"card\"` makes that a card with the radio before the title, `variant=\"tile\"` a checkout payment method\ntile with no visible radio, and `variant=\"accordion\"` a row of the checkout's payment method accordion. It\npresses in while held; an option that is\nselected when it mounts does not animate.",
17529
17901
  "props": [
17530
17902
  {
17531
17903
  "name": "className",
@@ -17538,7 +17910,7 @@
17538
17910
  "name": "content",
17539
17911
  "type": "ReactNode",
17540
17912
  "required": false,
17541
- "description": "Card only: content that opens under the card while the option is selected, e.g. the card form of the \"Card\"\nmethod. It mounts only while selected, outside the clickable label, so it can hold inputs and buttons. Needs\nthe option inside a `RadioGroup`.",
17913
+ "description": "Card and accordion only: content that opens under the option while it is selected, e.g. the card form of the \"Card\"\nmethod. It mounts only while selected, outside the clickable label, so it can hold inputs and buttons. Needs\nthe option inside a `RadioGroup`.",
17542
17914
  "source": "dodo"
17543
17915
  },
17544
17916
  {
@@ -17552,7 +17924,7 @@
17552
17924
  "name": "disabledReason",
17553
17925
  "type": "ReactNode",
17554
17926
  "required": false,
17555
- "description": "Card only: why the option cannot be picked, e.g. \"Not available for subscriptions\". Setting it disables the\noption; the reason shows under the description and is announced with it.",
17927
+ "description": "Card, tile and accordion only: why the option cannot be picked, e.g. \"Not available for subscriptions\". Setting it disables the\noption; the reason shows under the description and is announced with it.",
17556
17928
  "source": "dodo"
17557
17929
  },
17558
17930
  {
@@ -17573,7 +17945,7 @@
17573
17945
  "name": "logo",
17574
17946
  "type": "ReactNode",
17575
17947
  "required": false,
17576
- "description": "Card only: a logo before the text, e.g. a `PaymentLogo` for a payment method. Decorative: the label names\nthe option.",
17948
+ "description": "Card, tile and accordion only: a logo before the text (above it on a tile), e.g. a `PaymentLogo` for a payment method.\nDecorative: the label names the option.",
17577
17949
  "source": "dodo"
17578
17950
  },
17579
17951
  {
@@ -17587,7 +17959,7 @@
17587
17959
  "name": "note",
17588
17960
  "type": "ReactNode",
17589
17961
  "required": false,
17590
- "description": "Card only: a fee or discount line under the description (Body/Secondary, Content/Primary), e.g. \"+2% fee\".",
17962
+ "description": "Card, tile and accordion only: a fee or discount line under the description (Body/Secondary, Content/Primary), e.g. \"+2% fee\".",
17591
17963
  "source": "dodo"
17592
17964
  },
17593
17965
  {
@@ -17610,7 +17982,7 @@
17610
17982
  },
17611
17983
  {
17612
17984
  "name": "variant",
17613
- "type": "\"default\" | \"card\"",
17985
+ "type": "\"default\" | \"card\" | \"accordion\" | \"tile\"",
17614
17986
  "required": false,
17615
17987
  "description": "",
17616
17988
  "source": "dodo",
@@ -17622,6 +17994,14 @@
17622
17994
  {
17623
17995
  "value": "card",
17624
17996
  "description": "A card with a 12px radio before its title and a description. Needs a `label`. For choices that each need a short explanation, such as pricing type."
17997
+ },
17998
+ {
17999
+ "value": "accordion",
18000
+ "description": "A row of the single page checkout's payment method accordion: the radio, a `logo` and the label, with `content` opening under the selected row. Rows sit in one bordered box: give the `RadioGroup` `className=\"gap-0 pointer-coarse:gap-0 overflow-hidden rounded-xl border\"`. Needs a `label`."
18001
+ },
18002
+ {
18003
+ "value": "tile",
18004
+ "description": "A payment method tile, as the checkout draws them: the `logo` above the label, no visible radio. The selected tile takes the theme's primary edge and tint. Needs a `label`."
17625
18005
  }
17626
18006
  ],
17627
18007
  "default": "\"default\""
@@ -17688,10 +18068,18 @@
17688
18068
  "name": "radio-group/master",
17689
18069
  "code": "\"use client\";\n\nimport { Radio, RadioGroup } from \"@dodopayments/ui/radio-group\";\nimport { useState } from \"react\";\n\nexport default function RadioGroupMaster() {\n const [role, setRole] = useState(\"admin\");\n return (\n <div className=\"flex w-full max-w-xl flex-col gap-6\">\n <div className=\"flex flex-col gap-3\">\n <RadioGroup aria-label=\"Role\" value={role} onValueChange={setRole}>\n <Radio\n value=\"admin\"\n label=\"Admin\"\n description=\"Full access, including payouts and team\"\n />\n <Radio value=\"viewer\" label=\"Viewer\" description=\"Read-only access\" />\n </RadioGroup>\n <p role=\"status\" className=\"text-body-secondary text-muted-foreground\">\n Priya Shah will join as {role === \"admin\" ? \"an Admin\" : \"a Viewer\"}.\n </p>\n </div>\n <RadioGroup aria-label=\"Refund type\" defaultValue=\"full\" className=\"grid grid-cols-2 gap-4\">\n <Radio\n variant=\"card\"\n value=\"full\"\n label=\"Full refund\"\n description=\"Refund the whole payment\"\n className=\"w-full\"\n />\n <Radio\n variant=\"card\"\n value=\"partial\"\n label=\"Partial refund\"\n description=\"Refund part of the amount\"\n className=\"w-full\"\n />\n </RadioGroup>\n </div>\n );\n}"
17690
18070
  },
18071
+ {
18072
+ "name": "radio-group/payment-accordion",
18073
+ "code": "\"use client\";\n\nimport { CardField } from \"@dodopayments/ui/card-field\";\nimport { PaymentLogo } from \"@dodopayments/ui/payment-logos\";\nimport { Radio, RadioGroup } from \"@dodopayments/ui/radio-group\";\n\nexport default function RadioGroupPaymentAccordion() {\n return (\n <RadioGroup\n aria-label=\"Payment method\"\n defaultValue=\"card\"\n className=\"w-full max-w-md gap-0 pointer-coarse:gap-0 pointer-coarse:gap-0 overflow-hidden rounded-xl border\"\n >\n <Radio\n variant=\"accordion\"\n value=\"card\"\n label=\"Card\"\n logo={<PaymentLogo brand=\"card\" decorative />}\n content={<CardField showName />}\n />\n <Radio\n variant=\"accordion\"\n value=\"klarna\"\n label=\"Klarna\"\n logo={<PaymentLogo brand=\"klarna\" decorative />}\n content={\n <p className=\"text-body-secondary text-muted-foreground\">\n You will finish the payment with Klarna.\n </p>\n }\n />\n </RadioGroup>\n );\n}"
18074
+ },
17691
18075
  {
17692
18076
  "name": "radio-group/payment-methods",
17693
18077
  "code": "\"use client\";\n\nimport { CardField } from \"@dodopayments/ui/card-field\";\nimport { PaymentLogo } from \"@dodopayments/ui/payment-logos\";\nimport { Radio, RadioGroup } from \"@dodopayments/ui/radio-group\";\n\nexport default function RadioGroupPaymentMethods() {\n return (\n <RadioGroup aria-label=\"Payment method\" defaultValue=\"card\" className=\"w-full max-w-md gap-3\">\n <Radio\n variant=\"card\"\n value=\"card\"\n label=\"Card\"\n description=\"Visa, Mastercard, American Express and RuPay\"\n logo={<PaymentLogo brand=\"card\" decorative />}\n content={<CardField />}\n className=\"w-full\"\n />\n <Radio\n variant=\"card\"\n value=\"upi\"\n label=\"UPI\"\n description=\"Pay from any UPI app\"\n note=\"No fee\"\n logo={<PaymentLogo brand=\"upi\" decorative />}\n content={\n <p className=\"text-body-secondary text-muted-foreground\">\n You will approve the payment in your UPI app.\n </p>\n }\n className=\"w-full\"\n />\n <Radio\n variant=\"card\"\n value=\"bnpl\"\n label=\"Pay later\"\n description=\"Split into 3 interest-free payments\"\n disabledReason=\"Available for orders over $50\"\n logo={<PaymentLogo brand=\"klarna\" decorative />}\n className=\"w-full\"\n />\n </RadioGroup>\n );\n}"
17694
18078
  },
18079
+ {
18080
+ "name": "radio-group/payment-tiles",
18081
+ "code": "\"use client\";\n\nimport { PaymentLogo } from \"@dodopayments/ui/payment-logos\";\nimport { Radio, RadioGroup } from \"@dodopayments/ui/radio-group\";\n\nexport default function RadioGroupPaymentTiles() {\n return (\n <RadioGroup\n aria-label=\"Payment method\"\n defaultValue=\"card\"\n className=\"grid w-full max-w-md grid-cols-3 gap-3\"\n >\n <Radio\n variant=\"tile\"\n value=\"card\"\n label=\"Card\"\n logo={<PaymentLogo brand=\"card\" decorative />}\n />\n <Radio\n variant=\"tile\"\n value=\"affirm\"\n label=\"Affirm\"\n logo={<PaymentLogo brand=\"affirm\" decorative />}\n />\n <Radio\n variant=\"tile\"\n value=\"klarna\"\n label=\"Klarna\"\n logo={<PaymentLogo brand=\"klarna\" decorative />}\n />\n </RadioGroup>\n );\n}"
18082
+ },
17695
18083
  {
17696
18084
  "name": "radio-group/plan-picker",
17697
18085
  "code": "\"use client\";\n\nimport { Radio, RadioGroup } from \"@dodopayments/ui/radio-group\";\nimport { useId, useState } from \"react\";\n\nconst PLANS = {\n monthly: { label: \"Monthly\", price: 29, description: \"$29 per month\", period: \"month\" },\n yearly: {\n label: \"Yearly\",\n price: 290,\n description: \"$290 per year · 2 months free\",\n period: \"year\",\n },\n} as const;\n\ntype Plan = keyof typeof PLANS;\n\nconst usd = new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n\nexport default function RadioGroupPlanPicker() {\n const labelId = useId();\n const [plan, setPlan] = useState<Plan>(\"monthly\");\n const current = PLANS[plan];\n return (\n <div className=\"flex w-full max-w-xl flex-col gap-3\">\n <p id={labelId} className=\"text-label-primary text-foreground\">\n Billing interval\n </p>\n <RadioGroup\n aria-labelledby={labelId}\n value={plan}\n onValueChange={setPlan}\n className=\"grid gap-4 sm:grid-cols-2\"\n >\n {(Object.keys(PLANS) as Plan[]).map((key) => (\n <Radio\n key={key}\n variant=\"card\"\n value={key}\n label={PLANS[key].label}\n description={PLANS[key].description}\n className=\"w-full\"\n />\n ))}\n </RadioGroup>\n <p role=\"status\" className=\"text-body-secondary text-muted-foreground\">\n You'll be billed {usd.format(current.price)} today, then every {current.period} on Oct 22.\n {plan === \"yearly\"\n ? ` You save ${usd.format(PLANS.monthly.price * 12 - PLANS.yearly.price)} a year.`\n : \"\"}\n </p>\n </div>\n );\n}"
@@ -19326,7 +19714,7 @@
19326
19714
  },
19327
19715
  {
19328
19716
  "name": "SkeletonSwap",
19329
- "description": "Loading region that swaps a skeleton for its content, after interior.dev's skeleton swap. The\nskeleton and `children` share one grid cell, so the region keeps its height and the layout does\nnot jump. The skeleton waits `delay` before it shows (a fast load shows no skeleton), stays for at\nleast `minDuration`, then fades out quickly while the content sharpens from a small blur.\nThe region is `aria-busy` while loading, and the content is inert while the skeleton covers it.",
19717
+ "description": "Loading region that swaps a skeleton for its content, after interior.dev's skeleton swap. The\nskeleton and `children` share one grid cell, so the region keeps its height and the layout does\nnot jump. The skeleton waits `delay` before it shows (a fast load shows no skeleton), stays for at\nleast `minDuration`, then fades out while the content fades in, sharpens and settles to full size.\nThe region is `aria-busy` while loading, and the content is inert while the skeleton covers it.",
19330
19718
  "props": [
19331
19719
  {
19332
19720
  "name": "loading",
@@ -21253,7 +21641,7 @@
21253
21641
  "examples": [
21254
21642
  {
21255
21643
  "name": "test-mode-banner/basic",
21256
- "code": "\"use client\";\n\nimport { TestModeBadge, TestModeBanner } from \"@dodopayments/ui/test-mode-banner\";\n\nexport default function TestModeBannerBasic() {\n return (\n <div className=\"w-full overflow-hidden rounded-xl border\">\n <TestModeBanner\n onSwitchToLive={() => undefined}\n learnMoreHref=\"https://docs.dodopayments.com/miscellaneous/test-mode-vs-live-mode\"\n />\n <div className=\"flex items-center gap-2 p-4 text-sm\">\n <span className=\"font-medium\">pay_2IjeQm4hqU6RA4Z4kwDee</span>\n <TestModeBadge />\n </div>\n </div>\n );\n}"
21644
+ "code": "\"use client\";\n\nimport { TestModeBadge, TestModeBanner } from \"@dodopayments/ui/test-mode-banner\";\n\nexport default function TestModeBannerBasic() {\n return (\n <div className=\"w-full overflow-hidden rounded-xl border border-border bg-background\">\n <TestModeBanner\n onSwitchToLive={() => undefined}\n learnMoreHref=\"https://docs.dodopayments.com/miscellaneous/test-mode-vs-live-mode\"\n />\n <div className=\"flex items-center gap-2 p-4\">\n <span className=\"text-label-primary text-foreground\">pay_2IjeQm4hqU6RA4Z4kwDee</span>\n <TestModeBadge />\n </div>\n </div>\n );\n}"
21257
21645
  }
21258
21646
  ],
21259
21647
  "docsUrl": "/components/test-mode-banner"
@@ -22817,7 +23205,7 @@
22817
23205
  "name": "mobileRight",
22818
23206
  "type": "ReactNode",
22819
23207
  "required": false,
22820
- "description": "What the right slot shows below 42rem (672px) instead of `right`: Filters (holding every filter and the date\nrange) and the page's main action. Defaults to `right`; Edit columns hides itself there. Only one of `right`\nand `mobileRight` is mounted at a time, so keep filter state in the page (controlled) to carry it across.",
23208
+ "description": "What the right slot shows below 42rem (672px) instead of `right`: Filters (holding every filter and the date\nrange) and the page's main action. Defaults to `right`; Edit columns shows only its icon there. Only one of `right`\nand `mobileRight` is mounted at a time, so keep filter state in the page (controlled) to carry it across.",
22821
23209
  "source": "dodo"
22822
23210
  },
22823
23211
  {
@@ -22831,7 +23219,7 @@
22831
23219
  },
22832
23220
  {
22833
23221
  "name": "ListToolbarColumns",
22834
- "description": "Edit columns (Figma: Button secondary lg with the table-cols icon): a `Menu` with a checkbox per column that can\nbe hidden, named like its header. The menu stays open while you toggle. Hidden when the toolbar stacks (mobile),\nwhere the Data table shows cards.",
23222
+ "description": "Edit columns (Figma: Button secondary lg with the table-cols icon): a `Menu` with a checkbox per column that can\nbe hidden, named like its header. The menu stays open while you toggle. When the toolbar stacks (a phone) it shows\nonly its icon; the label still names it.",
22835
23223
  "props": [
22836
23224
  {
22837
23225
  "name": "table",
@@ -23569,6 +23957,69 @@
23569
23957
  ],
23570
23958
  "docsUrl": "/components/milestone"
23571
23959
  },
23960
+ {
23961
+ "slug": "sale-share-card",
23962
+ "title": "Sale share card",
23963
+ "category": "Data display",
23964
+ "status": "stable",
23965
+ "description": "A new sale as an image to share (the dashboard's payments list, Share): 720 by 400, the artwork behind, the\nbusiness chip, a headline and the amount in the brand lime with a dark outline. Always light, whatever the theme,\nso the saved picture looks the same. Capture this element at its own size, and preview it in a `ScaledFrame`.",
23966
+ "importPath": "@dodopayments/ui/sale-share-card",
23967
+ "exports": [
23968
+ "SaleShareBusiness",
23969
+ "SaleShareCard",
23970
+ "SaleShareCardProps"
23971
+ ],
23972
+ "parts": [
23973
+ {
23974
+ "name": "SaleShareCard",
23975
+ "description": "A new sale as an image to share (the dashboard's payments list, Share): 720 by 400, the artwork behind, the\nbusiness chip, a headline and the amount in the brand lime with a dark outline. Always light, whatever the theme,\nso the saved picture looks the same. Capture this element at its own size, and preview it in a `ScaledFrame`.",
23976
+ "props": [
23977
+ {
23978
+ "name": "amount",
23979
+ "type": "string",
23980
+ "required": true,
23981
+ "description": "The sale, formatted, e.g. \"$1,234.56\". It shrinks to fit the card.",
23982
+ "source": "dodo"
23983
+ },
23984
+ {
23985
+ "name": "background",
23986
+ "type": "string",
23987
+ "required": true,
23988
+ "description": "The artwork behind the card, an image URL. Decorative.",
23989
+ "source": "dodo"
23990
+ },
23991
+ {
23992
+ "name": "headline",
23993
+ "type": "ReactNode",
23994
+ "required": true,
23995
+ "description": "The line above the amount, e.g. \"Cha-ching! A new sale is in\".",
23996
+ "source": "dodo"
23997
+ },
23998
+ {
23999
+ "name": "business",
24000
+ "type": "SaleShareBusiness",
24001
+ "required": false,
24002
+ "description": "The business chip at the top. Leave it out when the merchant turns off \"Include business and logo\"; the card\nkeeps its size so the shared image is always 720 by 400.",
24003
+ "source": "dodo"
24004
+ },
24005
+ {
24006
+ "name": "className",
24007
+ "type": "string",
24008
+ "required": false,
24009
+ "description": "Additional Tailwind classes, merged last.",
24010
+ "source": "dodo"
24011
+ }
24012
+ ]
24013
+ }
24014
+ ],
24015
+ "examples": [
24016
+ {
24017
+ "name": "sale-share-card/master",
24018
+ "code": "\"use client\";\n\nimport { SaleShareCard } from \"@dodopayments/ui/sale-share-card\";\nimport { ScaledFrame } from \"@dodopayments/ui/scaled-frame\";\n\nexport default function SaleShareCardDemo() {\n return (\n <ScaledFrame width={720} height={400} className=\"max-w-180\">\n <SaleShareCard\n amount=\"$1,234.56\"\n headline=\"Cha-ching! A new sale is in\"\n background=\"/samples/sale-share-lagoon.webp\"\n business={{ name: \"Incubix\" }}\n />\n </ScaledFrame>\n );\n}"
24019
+ }
24020
+ ],
24021
+ "docsUrl": "/components/sale-share-card"
24022
+ },
23572
24023
  {
23573
24024
  "slug": "setup-guide",
23574
24025
  "title": "Setup guide",
@@ -23768,7 +24219,7 @@
23768
24219
  "name": "renderItem",
23769
24220
  "type": "(item: T) => ReactNode",
23770
24221
  "required": true,
23771
- "description": "Content of one cell.",
24222
+ "description": "Content of one cell: drawn in the white panel of the cell's card tray.",
23772
24223
  "source": "dodo"
23773
24224
  },
23774
24225
  {
@@ -23824,6 +24275,13 @@
23824
24275
  "description": "Called with the id of the filter the user picks.",
23825
24276
  "source": "dodo"
23826
24277
  },
24278
+ {
24279
+ "name": "renderTitle",
24280
+ "type": "((item: T) => ReactNode)",
24281
+ "required": false,
24282
+ "description": "Title of one cell, at the top of its white panel above the `renderItem` content (Heading/Quaternary,\ntruncated). Without it the panel holds `renderItem` only.",
24283
+ "source": "dodo"
24284
+ },
23827
24285
  {
23828
24286
  "name": "rowHeight",
23829
24287
  "type": "number",
@@ -23900,7 +24358,7 @@
23900
24358
  "examples": [
23901
24359
  {
23902
24360
  "name": "filter-grid/basic",
23903
- "code": "\"use client\";\n\nimport { FilterGrid, type FilterGridFilter } from \"@dodopayments/ui/filter-grid\";\n\ninterface Product {\n id: string;\n name: string;\n price: string;\n kind: \"subscription\" | \"one-time\" | \"usage\";\n}\n\nconst PRODUCTS: Product[] = [\n { id: \"p1\", name: \"Starter\", price: \"$9 / mo\", kind: \"subscription\" },\n { id: \"p2\", name: \"Pro\", price: \"$29 / mo\", kind: \"subscription\" },\n { id: \"p3\", name: \"Team\", price: \"$99 / mo\", kind: \"subscription\" },\n { id: \"p4\", name: \"Lifetime license\", price: \"$249\", kind: \"one-time\" },\n { id: \"p5\", name: \"Icon pack\", price: \"$19\", kind: \"one-time\" },\n { id: \"p6\", name: \"API calls\", price: \"$0.002 / call\", kind: \"usage\" },\n { id: \"p7\", name: \"Storage\", price: \"$0.10 / GB\", kind: \"usage\" },\n];\n\nconst FILTERS: FilterGridFilter<Product>[] = [\n { id: \"all\", label: \"All\", match: () => true },\n { id: \"subscription\", label: \"Subscriptions\", match: (p) => p.kind === \"subscription\" },\n { id: \"one-time\", label: \"One-time\", match: (p) => p.kind === \"one-time\" },\n { id: \"usage\", label: \"Usage\", match: (p) => p.kind === \"usage\" },\n];\n\nexport default function FilterGridBasic() {\n return (\n <FilterGrid\n className=\"max-w-lg\"\n aria-label=\"Product type\"\n items={PRODUCTS}\n filters={FILTERS}\n getKey={(p) => p.id}\n renderItem={(p) => (\n <div className=\"flex h-full flex-col justify-between\">\n <span className=\"truncate text-label-primary\">{p.name}</span>\n <span className=\"text-body-secondary text-muted-foreground\">{p.price}</span>\n </div>\n )}\n />\n );\n}"
24361
+ "code": "\"use client\";\n\nimport { FilterGrid, type FilterGridFilter } from \"@dodopayments/ui/filter-grid\";\n\ninterface Product {\n id: string;\n name: string;\n price: string;\n kind: \"subscription\" | \"one-time\" | \"usage\";\n}\n\nconst PRODUCTS: Product[] = [\n { id: \"p1\", name: \"Starter\", price: \"$9 / mo\", kind: \"subscription\" },\n { id: \"p2\", name: \"Pro\", price: \"$29 / mo\", kind: \"subscription\" },\n { id: \"p3\", name: \"Team\", price: \"$99 / mo\", kind: \"subscription\" },\n { id: \"p4\", name: \"Lifetime license\", price: \"$249\", kind: \"one-time\" },\n { id: \"p5\", name: \"Icon pack\", price: \"$19\", kind: \"one-time\" },\n { id: \"p6\", name: \"API calls\", price: \"$0.002 / call\", kind: \"usage\" },\n { id: \"p7\", name: \"Storage\", price: \"$0.10 / GB\", kind: \"usage\" },\n];\n\nconst FILTERS: FilterGridFilter<Product>[] = [\n { id: \"all\", label: \"All\", match: () => true },\n { id: \"subscription\", label: \"Subscriptions\", match: (p) => p.kind === \"subscription\" },\n { id: \"one-time\", label: \"One-time\", match: (p) => p.kind === \"one-time\" },\n { id: \"usage\", label: \"Usage\", match: (p) => p.kind === \"usage\" },\n];\n\nexport default function FilterGridBasic() {\n return (\n <FilterGrid\n className=\"max-w-lg\"\n aria-label=\"Product type\"\n items={PRODUCTS}\n filters={FILTERS}\n getKey={(p) => p.id}\n renderTitle={(p) => p.name}\n renderItem={(p) => <span className=\"text-body-secondary text-muted-foreground\">{p.price}</span>}\n />\n );\n}"
23904
24362
  },
23905
24363
  {
23906
24364
  "name": "filter-grid/empty",
@@ -24631,7 +25089,7 @@
24631
25089
  "examples": [
24632
25090
  {
24633
25091
  "name": "reorder-list/basic",
24634
- "code": "\"use client\";\n\nimport { ReorderList } from \"@dodopayments/ui/reorder-list\";\nimport { useState } from \"react\";\n\ninterface Method {\n id: string;\n name: string;\n detail: string;\n}\n\nconst METHODS: Method[] = [\n { id: \"card\", name: \"Cards\", detail: \"Visa, Mastercard, Amex\" },\n { id: \"upi\", name: \"UPI\", detail: \"India only\" },\n { id: \"wallets\", name: \"Wallets\", detail: \"Apple Pay, Google Pay\" },\n { id: \"bank\", name: \"Bank transfer\", detail: \"SEPA, ACH\" },\n];\n\nexport default function ReorderListBasic() {\n const [methods, setMethods] = useState(METHODS);\n\n return (\n <div className=\"flex w-full max-w-sm flex-col gap-3\">\n <ReorderList\n aria-label=\"Checkout payment methods\"\n value={methods}\n getKey={(m) => m.id}\n getLabel={(m) => m.name}\n onValueChange={setMethods}\n >\n {(m) => (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"font-medium\">{m.name}</span>\n <span className=\"truncate text-body-secondary text-muted-foreground\">{m.detail}</span>\n </div>\n )}\n </ReorderList>\n <p className=\"text-body-primary text-muted-foreground\">\n Checkout order: {methods.map((m) => m.name).join(\", \")}\n </p>\n </div>\n );\n}"
25092
+ "code": "\"use client\";\n\nimport { ReorderList } from \"@dodopayments/ui/reorder-list\";\nimport { useState } from \"react\";\n\ninterface Method {\n id: string;\n name: string;\n detail: string;\n}\n\nconst METHODS: Method[] = [\n { id: \"card\", name: \"Cards\", detail: \"Visa, Mastercard, Amex\" },\n { id: \"upi\", name: \"UPI\", detail: \"India only\" },\n { id: \"wallets\", name: \"Wallets\", detail: \"Apple Pay, Google Pay\" },\n { id: \"bank\", name: \"Bank transfer\", detail: \"SEPA, ACH\" },\n];\n\nexport default function ReorderListBasic() {\n const [methods, setMethods] = useState(METHODS);\n\n return (\n <div className=\"flex w-full max-w-sm flex-col gap-3\">\n <ReorderList\n aria-label=\"Checkout payment methods\"\n value={methods}\n getKey={(m) => m.id}\n getLabel={(m) => m.name}\n onValueChange={setMethods}\n >\n {(m) => (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-label-primary\">{m.name}</span>\n <span className=\"truncate text-body-secondary text-muted-foreground\">{m.detail}</span>\n </div>\n )}\n </ReorderList>\n <p className=\"text-body-primary text-muted-foreground\">\n Checkout order: {methods.map((m) => m.name).join(\", \")}\n </p>\n </div>\n );\n}"
24635
25093
  },
24636
25094
  {
24637
25095
  "name": "reorder-list/commit",
@@ -27351,9 +27809,11 @@
27351
27809
  "title": "Stat Card",
27352
27810
  "category": "Blocks",
27353
27811
  "status": "stable",
27354
- "description": "A static metric (Dodo Nest Stat card): the label on a grey strip, the number in a white panel, and an optional\ntrend chip and comparison under it. Put a `StatCardBreakdown` inside for the parts of the number (Payout balance).\n`loading` shows Skeleton lines, `empty` shows \"-\" and a reason, and `error` (with `onRetry`) a retry; what replaces\nthe loading skeletons fades in. Cards in a CSS grid row (`StatGrid`) stretch to one height. Renders a `<section>`\nlabelled by the label.",
27812
+ "description": "A static metric (Dodo Nest Stat card): the label on a grey strip, the number in a white panel, and an optional\ntrend chip and comparison under it. Put a `StatCardBreakdown` inside for the parts of the number (Payout balance).\n`loading` shows Skeleton lines, `empty` shows \"-\" and a reason, and `error` (with `onRetry`) a retry; what replaces\nthe loading skeletons fades in. Cards in a CSS grid row (`StatGrid`) stretch to one height. `layout=\"inline\"`\ndrops the tray for a bare stat; a grouped `StatGrid` makes every card in it inline. Renders a `<section>` labelled by the\nlabel.",
27355
27813
  "importPath": "@dodopayments/ui/stat-card",
27356
27814
  "exports": [
27815
+ "DODO_STAT_CARD_DEFAULT_VARIANTS",
27816
+ "DODO_STAT_CARD_VARIANTS",
27357
27817
  "DODO_STAT_GRID_DEFAULT_VARIANTS",
27358
27818
  "DODO_STAT_GRID_VARIANTS",
27359
27819
  "StatCard",
@@ -27363,6 +27823,7 @@
27363
27823
  "StatCardBreakdownRowProps",
27364
27824
  "StatCardDirection",
27365
27825
  "StatCardLabels",
27826
+ "StatCardLayout",
27366
27827
  "StatCardProps",
27367
27828
  "StatCardTrend",
27368
27829
  "StatGrid",
@@ -27371,7 +27832,7 @@
27371
27832
  "parts": [
27372
27833
  {
27373
27834
  "name": "StatCard",
27374
- "description": "A static metric (Dodo Nest Stat card): the label on a grey strip, the number in a white panel, and an optional\ntrend chip and comparison under it. Put a `StatCardBreakdown` inside for the parts of the number (Payout balance).\n`loading` shows Skeleton lines, `empty` shows \"-\" and a reason, and `error` (with `onRetry`) a retry; what replaces\nthe loading skeletons fades in. Cards in a CSS grid row (`StatGrid`) stretch to one height. Renders a `<section>`\nlabelled by the label.",
27835
+ "description": "A static metric (Dodo Nest Stat card): the label on a grey strip, the number in a white panel, and an optional\ntrend chip and comparison under it. Put a `StatCardBreakdown` inside for the parts of the number (Payout balance).\n`loading` shows Skeleton lines, `empty` shows \"-\" and a reason, and `error` (with `onRetry`) a retry; what replaces\nthe loading skeletons fades in. Cards in a CSS grid row (`StatGrid`) stretch to one height. `layout=\"inline\"`\ndrops the tray for a bare stat; a grouped `StatGrid` makes every card in it inline. Renders a `<section>` labelled by the\nlabel.",
27375
27836
  "props": [
27376
27837
  {
27377
27838
  "name": "label",
@@ -27445,6 +27906,24 @@
27445
27906
  "description": "Replaces some or all of the default texts.",
27446
27907
  "source": "dodo"
27447
27908
  },
27909
+ {
27910
+ "name": "layout",
27911
+ "type": "\"card\" | \"inline\"",
27912
+ "required": false,
27913
+ "description": "",
27914
+ "source": "dodo",
27915
+ "values": [
27916
+ {
27917
+ "value": "card",
27918
+ "description": "The Stat card: the label on a grey strip, the number in a white panel, in its own tray."
27919
+ },
27920
+ {
27921
+ "value": "inline",
27922
+ "description": "A bare stat: the label (Body/Primary, Content/Secondary) over the number, with no tray or panel. For a grouped StatGrid."
27923
+ }
27924
+ ],
27925
+ "default": "\"card\""
27926
+ },
27448
27927
  {
27449
27928
  "name": "loading",
27450
27929
  "type": "boolean",
@@ -27510,7 +27989,7 @@
27510
27989
  },
27511
27990
  {
27512
27991
  "name": "StatGrid",
27513
- "description": "A responsive row of `StatCard`s: a `Grid` of 2, 3 or 4 equal columns, 16 apart, that stacks the cards 12 apart\nwhen narrow. Cards in a row stretch to the same height, so their panels line up.",
27992
+ "description": "A responsive row of `StatCard`s: a `Grid` of 2, 3 or 4 equal columns, 16 apart, that stacks the cards 12 apart\nwhen narrow. Cards in a row stretch to the same height, so their panels line up. `layout=\"group\"` puts the stats\nin one `Card` instead (the page summary under a page header): its cards turn inline, side by side with dividers\nbetween them, stacked with dividers between rows when narrow.",
27514
27993
  "props": [
27515
27994
  {
27516
27995
  "name": "columns",
@@ -27541,6 +28020,38 @@
27541
28020
  "description": "",
27542
28021
  "source": "dodo"
27543
28022
  },
28023
+ {
28024
+ "name": "heading",
28025
+ "type": "ReactNode",
28026
+ "required": false,
28027
+ "description": "With `layout=\"group\"`: the title on the card's strip, e.g. \"Last 30 days\".",
28028
+ "source": "dodo"
28029
+ },
28030
+ {
28031
+ "name": "help",
28032
+ "type": "ReactNode",
28033
+ "required": false,
28034
+ "description": "With `layout=\"group\"` and a `heading`: help text behind an info icon after it.",
28035
+ "source": "dodo"
28036
+ },
28037
+ {
28038
+ "name": "layout",
28039
+ "type": "\"cards\" | \"group\"",
28040
+ "required": false,
28041
+ "description": "",
28042
+ "source": "dodo",
28043
+ "values": [
28044
+ {
28045
+ "value": "cards",
28046
+ "description": "Separate Stat cards, 16 apart (12 apart when they stack)."
28047
+ },
28048
+ {
28049
+ "value": "group",
28050
+ "description": "One Card tray (with an optional `heading`) whose panel lines the stats up as inline stats with dividers between them; they stack with dividers between rows when narrow."
28051
+ }
28052
+ ],
28053
+ "default": "\"cards\""
28054
+ },
27544
28055
  {
27545
28056
  "name": "render",
27546
28057
  "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>",
@@ -27556,6 +28067,10 @@
27556
28067
  "name": "stat-card/basic",
27557
28068
  "code": "\"use client\";\n\nimport { StatCard, StatGrid } from \"@dodopayments/ui/stat-card\";\n\nexport default function StatCardBasic() {\n return (\n <StatGrid>\n <StatCard\n label=\"Successful payments\"\n help=\"Payments that succeeded in this period, after retries.\"\n value=\"1,240\"\n trend={{ value: \"12.4%\", direction: \"up\" }}\n comparison=\"vs last 30 days\"\n />\n <StatCard\n label=\"Refunds\"\n help=\"Money returned to customers. Growth is bad here, so the trend is inverted.\"\n value=\"$1,920.00\"\n trend={{ value: \"8.1%\", direction: \"up\", invert: true }}\n comparison=\"vs last 30 days\"\n />\n <StatCard\n label=\"Failed payments\"\n help=\"Payments that failed after every retry. No change from the last period shows a grey -%.\"\n value=\"18\"\n trend={{ direction: \"neutral\" }}\n comparison=\"vs last 30 days\"\n />\n </StatGrid>\n );\n}"
27558
28069
  },
28070
+ {
28071
+ "name": "stat-card/grouped",
28072
+ "code": "\"use client\";\n\nimport { StatCard, StatGrid } from \"@dodopayments/ui/stat-card\";\n\n/** The page summary under a page header: one card, three stats side by side. */\nexport default function StatCardGrouped() {\n return (\n <StatGrid layout=\"group\" heading=\"Last 30 days\" className=\"w-full\">\n <StatCard label=\"Successful payments\" value=\"2.2K\" />\n <StatCard label=\"Payment volume\" value=\"$8.4M\" />\n <StatCard label=\"Failed payments\" value=\"154\" />\n </StatGrid>\n );\n}"
28073
+ },
27559
28074
  {
27560
28075
  "name": "stat-card/master",
27561
28076
  "code": "\"use client\";\n\nimport { Progress } from \"@dodopayments/ui/progress\";\nimport {\n StatCard,\n StatCardBreakdown,\n StatCardBreakdownRow,\n StatGrid,\n} from \"@dodopayments/ui/stat-card\";\n\nexport default function StatCardMaster() {\n return (\n <StatGrid columns=\"2\">\n {/* Compact: the label, the value, a trend Badge and its comparison. */}\n <StatCard\n label=\"Successful payments\"\n help=\"Payments that succeeded in this period, after retries.\"\n value=\"1,240\"\n trend={{ value: \"12.4%\", direction: \"up\" }}\n comparison=\"vs last 30 days\"\n />\n {/* Breakdown: the parts of the number under it. */}\n <StatCard label=\"Payout balance\" value=\"$3,300.00\" comparison=\"Next payout on Oct 21\">\n <StatCardBreakdown>\n <Progress\n segments={[\n { label: \"Incoming\", value: 3000, color: \"brand\" },\n { label: \"Available\", value: 100, color: \"tertiary\" },\n { label: \"Reserved\", value: 200, color: \"data\" },\n ]}\n />\n <StatCardBreakdownRow label=\"Incoming\" value=\"$3,000.00\" />\n <StatCardBreakdownRow label=\"Available\" value=\"$100.00\" />\n <StatCardBreakdownRow label=\"Reserved\" value=\"$200.00\" />\n </StatCardBreakdown>\n </StatCard>\n </StatGrid>\n );\n}"
@@ -27950,6 +28465,14 @@
27950
28465
  "default": "\"datetime\"",
27951
28466
  "description": "How the timestamps render.",
27952
28467
  "source": "dodo"
28468
+ },
28469
+ {
28470
+ "name": "timestampPlacement",
28471
+ "type": "\"end\" | \"below\"",
28472
+ "required": false,
28473
+ "default": "\"end\"",
28474
+ "description": "Where the time sits: `end` at the trailing end of the title's line, `below` on its own line\nunder the title and description, for a log read top to bottom.",
28475
+ "source": "dodo"
27953
28476
  }
27954
28477
  ]
27955
28478
  },
@@ -28029,9 +28552,17 @@
28029
28552
  "description": "How the timestamp renders.",
28030
28553
  "source": "dodo"
28031
28554
  },
28555
+ {
28556
+ "name": "timestampPlacement",
28557
+ "type": "\"end\" | \"below\"",
28558
+ "required": false,
28559
+ "default": "\"end\"",
28560
+ "description": "Where the time sits: `end` at the trailing end of the title's line, `below` on its own line\nunder the title and description, for a log read top to bottom.",
28561
+ "source": "dodo"
28562
+ },
28032
28563
  {
28033
28564
  "name": "tone",
28034
- "type": "\"success\" | \"warning\" | \"error\" | \"info\" | \"neutral\" | \"none\"",
28565
+ "type": "\"success\" | \"warning\" | \"error\" | \"info\" | \"neutral\" | \"step\" | \"none\"",
28035
28566
  "required": false,
28036
28567
  "default": "\"neutral\" with an `icon`, otherwise \"none\"",
28037
28568
  "description": "Tone of the icon slot: `success`, `warning`, `error`, `info` and `neutral` draw a 20px Featured\nicon, `none` a bare dot.",
@@ -28057,6 +28588,10 @@
28057
28588
  "value": "neutral",
28058
28589
  "description": "A plain step with no outcome. Glyph circle-minus; give it a specific `icon`, e.g. a credit card for Payment started."
28059
28590
  },
28591
+ {
28592
+ "value": "step",
28593
+ "description": "A step of a log: a brand ring, joined to the next step by a brand line, e.g. the notes on a blocklist entry."
28594
+ },
28060
28595
  {
28061
28596
  "value": "none",
28062
28597
  "description": "A minor event with no icon: a bare 6px dot, e.g. a status not set or a blocklist entry."
@@ -28534,6 +29069,14 @@
28534
29069
  "description": "Replaces the Purchase flow, e.g. a link styled with `buttonVariants()` or a sold-out note.",
28535
29070
  "source": "dodo"
28536
29071
  },
29072
+ {
29073
+ "name": "aspect",
29074
+ "type": "\"square\" | \"wide\"",
29075
+ "required": false,
29076
+ "default": "\"square\"",
29077
+ "description": "Shape of the image (and of the fallback): `square`, as the store front's grid, or `wide` (2:1), as the\ndashboard's storefront preview lists products.",
29078
+ "source": "dodo"
29079
+ },
28537
29080
  {
28538
29081
  "name": "badge",
28539
29082
  "type": "ReactNode",
@@ -28583,7 +29126,7 @@
28583
29126
  "name": "image",
28584
29127
  "type": "string | StoreImage",
28585
29128
  "required": false,
28586
- "description": "Product image URL, or an image with alt text and a blurred placeholder. Shown square, cropped to fill.",
29129
+ "description": "Product image URL, or an image with alt text and a blurred placeholder. Cropped to fill the `aspect`.",
28587
29130
  "source": "dodo"
28588
29131
  },
28589
29132
  {
@@ -28900,7 +29443,7 @@
28900
29443
  "props": [
28901
29444
  {
28902
29445
  "name": "brand",
28903
- "type": "\"meta\" | \"github\" | \"gitlab\" | \"terraform\" | \"vercel\" | \"google-cloud\" | \"aws\" | \"kubernetes\" | \"google-analytics\" | \"google-tag-manager\"",
29446
+ "type": "\"meta\" | \"github\" | \"gitlab\" | \"terraform\" | \"vercel\" | \"google-cloud\" | \"aws\" | \"kubernetes\" | \"google-analytics\" | \"google-tag-manager\" | \"stripe\" | \"adyen\" | \"dodo-payments\"",
28904
29447
  "required": true,
28905
29448
  "description": "Which brand's mark to draw.",
28906
29449
  "source": "dodo"
@@ -29189,7 +29732,7 @@
29189
29732
  "examples": [
29190
29733
  {
29191
29734
  "name": "checkout-page/basic",
29192
- "code": "\"use client\";\n\nimport { Avatar, AvatarFallback, AvatarImage } from \"@dodopayments/ui/avatar\";\nimport { Badge } from \"@dodopayments/ui/badge\";\nimport { Button } from \"@dodopayments/ui/button\";\nimport { CardField } from \"@dodopayments/ui/card-field\";\nimport { Checkbox } from \"@dodopayments/ui/checkbox\";\nimport { CheckoutPage } from \"@dodopayments/ui/checkout-page\";\nimport { Field } from \"@dodopayments/ui/field\";\nimport { Input } from \"@dodopayments/ui/input\";\nimport { OrderSummary } from \"@dodopayments/ui/order-summary\";\nimport { WalletButtons } from \"@dodopayments/ui/wallet-buttons\";\nimport { CircleCheckIcon } from \"@dodopayments/ui/icons\";\nimport { Link } from \"@dodopayments/ui/link\";\n\nconst PRODUCT_IMAGE =\n \"https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=160&h=160&q=80\";\nconst LOGO =\n \"https://images.unsplash.com/photo-1558591710-4b4a1ae0f04d?auto=format&fit=crop&w=64&h=64&q=80\";\n\n/** The trust footer under the payment column: secure note, merchant of record and the policy links. */\nfunction CheckoutFooter({ links }: { links: { label: string; href: string }[] }) {\n return (\n <footer className=\"flex flex-col items-center gap-3 text-center text-body-secondary text-muted-foreground\">\n <p className=\"flex items-center gap-1.5\">\n <CircleCheckIcon aria-hidden=\"true\" className=\"size-4 text-success-foreground\" />\n Payments are secure and encrypted\n </p>\n <p>Dodo Payments is the merchant of record for this order</p>\n <nav aria-label=\"Legal\">\n <ul className=\"flex flex-wrap items-center justify-center gap-x-4 gap-y-1\">\n {links.map((link) => (\n <li key={link.href}>\n <Link href={link.href} className=\"inline-flex min-h-6 items-center\">\n {link.label}\n </Link>\n </li>\n ))}\n </ul>\n </nav>\n </footer>\n );\n}\n\nexport default function CheckoutPageBasic() {\n return (\n <CheckoutPage\n className=\"rounded-xl border border-border\"\n brand={\n <>\n <Avatar size=\"sm\">\n <AvatarImage src={LOGO} alt=\"\" />\n <AvatarFallback name=\"Acme\" />\n </Avatar>\n <span className=\"font-heading font-medium text-foreground text-sm\">Acme</span>\n </>\n }\n summary={\n <OrderSummary\n collapsible\n aria-label=\"Order summary\"\n items={[\n {\n id: \"pro\",\n name: \"Acme Pro\",\n description: \"Unlimited projects, custom domains and priority support.\",\n image: PRODUCT_IMAGE,\n price: \"$49.00\",\n interval: \"/ month\",\n },\n ]}\n discount={\n <Field label=\"Promo code\">\n <div className=\"flex gap-2\">\n <Input autoComplete=\"off\" autoCapitalize=\"characters\" spellCheck={false} />\n <Button type=\"button\" variant=\"secondary\" size=\"lg\">\n Apply\n </Button>\n </div>\n </Field>\n }\n lines={[\n { id: \"subtotal\", label: \"Subtotal\", value: \"$49.00\" },\n { id: \"tax\", label: \"Sales tax\", value: \"$4.41\" },\n { id: \"total\", label: \"Total due today\", value: \"$53.41\", emphasis: \"total\" },\n ]}\n />\n }\n footer={\n <CheckoutFooter\n links={[\n { label: \"Terms\", href: \"#terms\" },\n { label: \"Privacy\", href: \"#privacy\" },\n ]}\n />\n }\n >\n <Badge variant=\"orange\" dot className=\"self-start\">\n Test mode\n </Badge>\n <WalletButtons available={[\"apple-pay\", \"gpay\"]} onSelect={() => undefined} />\n <CardField />\n <fieldset className=\"flex min-w-0 flex-col gap-3\">\n <legend className=\"sr-only\">Agreements</legend>\n <Checkbox label=\"I agree to the terms of service and privacy policy\" required />\n <Checkbox label=\"I authorise recurring charges of $53.41 / month until I cancel\" required />\n </fieldset>\n <Button size=\"lg\" className=\"w-full\">\n Pay now\n </Button>\n </CheckoutPage>\n );\n}"
29735
+ "code": "\"use client\";\n\nimport { Avatar, AvatarFallback, AvatarImage } from \"@dodopayments/ui/avatar\";\nimport { Badge } from \"@dodopayments/ui/badge\";\nimport { Button } from \"@dodopayments/ui/button\";\nimport { CardField } from \"@dodopayments/ui/card-field\";\nimport { Checkbox } from \"@dodopayments/ui/checkbox\";\nimport { CheckoutPage } from \"@dodopayments/ui/checkout-page\";\nimport { Field } from \"@dodopayments/ui/field\";\nimport { Input } from \"@dodopayments/ui/input\";\nimport { OrderSummary } from \"@dodopayments/ui/order-summary\";\nimport { WalletButtons } from \"@dodopayments/ui/wallet-buttons\";\nimport { CircleCheckIcon } from \"@dodopayments/ui/icons\";\nimport { Link } from \"@dodopayments/ui/link\";\n\nconst PRODUCT_IMAGE =\n \"https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=160&h=160&q=80\";\nconst LOGO =\n \"https://images.unsplash.com/photo-1558591710-4b4a1ae0f04d?auto=format&fit=crop&w=64&h=64&q=80\";\n\n/** The trust footer under the payment column: secure note, merchant of record and the policy links. */\nfunction CheckoutFooter({ links }: { links: { label: string; href: string }[] }) {\n return (\n <footer className=\"flex flex-col items-center gap-3 text-center text-body-secondary text-muted-foreground\">\n <p className=\"flex items-center gap-1.5\">\n <CircleCheckIcon aria-hidden=\"true\" className=\"size-4 text-success-foreground\" />\n Payments are secure and encrypted\n </p>\n <p>Dodo Payments is the merchant of record for this order</p>\n <nav aria-label=\"Legal\">\n <ul className=\"flex flex-wrap items-center justify-center gap-x-4 gap-y-1\">\n {links.map((link) => (\n <li key={link.href}>\n <Link href={link.href} className=\"inline-flex min-h-6 items-center\">\n {link.label}\n </Link>\n </li>\n ))}\n </ul>\n </nav>\n </footer>\n );\n}\n\nexport default function CheckoutPageBasic() {\n return (\n <CheckoutPage\n className=\"rounded-xl border border-border\"\n brand={\n <>\n <Avatar size=\"sm\">\n <AvatarImage src={LOGO} alt=\"\" />\n <AvatarFallback name=\"Acme\" />\n </Avatar>\n <span className=\"font-heading text-heading-quaternary text-foreground\">Acme</span>\n </>\n }\n summary={\n <OrderSummary\n collapsible\n aria-label=\"Order summary\"\n items={[\n {\n id: \"pro\",\n name: \"Acme Pro\",\n description: \"Unlimited projects, custom domains and priority support.\",\n image: PRODUCT_IMAGE,\n price: \"$49.00\",\n interval: \"/ month\",\n },\n ]}\n discount={\n <Field label=\"Promo code\">\n <div className=\"flex gap-2\">\n <Input autoComplete=\"off\" autoCapitalize=\"characters\" spellCheck={false} />\n <Button type=\"button\" variant=\"secondary\" size=\"lg\">\n Apply\n </Button>\n </div>\n </Field>\n }\n lines={[\n { id: \"subtotal\", label: \"Subtotal\", value: \"$49.00\" },\n { id: \"tax\", label: \"Sales tax\", value: \"$4.41\" },\n { id: \"total\", label: \"Total due today\", value: \"$53.41\", emphasis: \"total\" },\n ]}\n />\n }\n footer={\n <CheckoutFooter\n links={[\n { label: \"Terms\", href: \"#terms\" },\n { label: \"Privacy\", href: \"#privacy\" },\n ]}\n />\n }\n >\n <Badge variant=\"orange\" dot className=\"self-start\">\n Test mode\n </Badge>\n <WalletButtons available={[\"apple-pay\", \"gpay\"]} onSelect={() => undefined} />\n <CardField />\n <fieldset className=\"flex min-w-0 flex-col gap-3\">\n <legend className=\"sr-only\">Agreements</legend>\n <Checkbox label=\"I agree to the terms of service and privacy policy\" required />\n <Checkbox label=\"I authorise recurring charges of $53.41 / month until I cancel\" required />\n </fieldset>\n <Button size=\"lg\" className=\"w-full\">\n Pay now\n </Button>\n </CheckoutPage>\n );\n}"
29193
29736
  },
29194
29737
  {
29195
29738
  "name": "checkout-page/upi",