@dodopayments/ui 1.4.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 (205) hide show
  1. package/ai/component-registry.json +209 -68
  2. package/ai/component-registry.md +1 -0
  3. package/ai/components/area-chart.md +4 -4
  4. package/ai/components/avatar.md +1 -1
  5. package/ai/components/bar-chart.md +18 -18
  6. package/ai/components/chart-tooltip.md +3 -3
  7. package/ai/components/chart.md +6 -6
  8. package/ai/components/checkout-page.md +1 -1
  9. package/ai/components/composed-chart.md +7 -7
  10. package/ai/components/copyable-id.md +1 -0
  11. package/ai/components/filter-grid.md +4 -7
  12. package/ai/components/funnel-chart.md +14 -12
  13. package/ai/components/gauge-chart.md +9 -11
  14. package/ai/components/line-chart.md +2 -2
  15. package/ai/components/money.md +3 -3
  16. package/ai/components/pie-chart.md +11 -2
  17. package/ai/components/reorder-list.md +1 -1
  18. package/ai/components/ring-chart.md +17 -8
  19. package/ai/components/sale-share-card.md +48 -0
  20. package/ai/components/sankey-chart.md +23 -23
  21. package/ai/components/stat-card.md +32 -5
  22. package/ai/components/sunburst-chart.md +7 -4
  23. package/ai/components/test-mode-banner.md +3 -3
  24. package/ai/skills/dodo-charts/SKILL.md +12 -7
  25. package/ai/skills/dodo-design/SKILL.md +2 -1
  26. package/dist/components/avatar/avatar.d.ts +9 -7
  27. package/dist/components/avatar/avatar.d.ts.map +1 -1
  28. package/dist/components/avatar/avatar.js +9 -7
  29. package/dist/components/avatar/avatar.js.map +1 -1
  30. package/dist/components/copyable-id/copyable-id.d.ts +7 -1
  31. package/dist/components/copyable-id/copyable-id.d.ts.map +1 -1
  32. package/dist/components/copyable-id/copyable-id.js +21 -3
  33. package/dist/components/copyable-id/copyable-id.js.map +1 -1
  34. package/dist/components/data-grid/bulk-actions.js +1 -1
  35. package/dist/components/data-grid/bulk-actions.js.map +1 -1
  36. package/dist/components/data-grid/data-grid.d.ts.map +1 -1
  37. package/dist/components/data-grid/data-grid.js +15 -3
  38. package/dist/components/data-grid/data-grid.js.map +1 -1
  39. package/dist/components/data-grid/table.d.ts.map +1 -1
  40. package/dist/components/data-grid/table.js +5 -0
  41. package/dist/components/data-grid/table.js.map +1 -1
  42. package/dist/components/filter-grid/filter-grid.d.ts +7 -2
  43. package/dist/components/filter-grid/filter-grid.d.ts.map +1 -1
  44. package/dist/components/filter-grid/filter-grid.js +3 -2
  45. package/dist/components/filter-grid/filter-grid.js.map +1 -1
  46. package/dist/components/funnel-chart/funnel-chart.d.ts +3 -2
  47. package/dist/components/funnel-chart/funnel-chart.d.ts.map +1 -1
  48. package/dist/components/funnel-chart/funnel-chart.js +3 -2
  49. package/dist/components/funnel-chart/funnel-chart.js.map +1 -1
  50. package/dist/components/gauge-chart/gauge-chart.d.ts +3 -4
  51. package/dist/components/gauge-chart/gauge-chart.d.ts.map +1 -1
  52. package/dist/components/gauge-chart/gauge-chart.js +3 -4
  53. package/dist/components/gauge-chart/gauge-chart.js.map +1 -1
  54. package/dist/components/live-activity/live-activity.d.ts.map +1 -1
  55. package/dist/components/live-activity/live-activity.js +8 -3
  56. package/dist/components/live-activity/live-activity.js.map +1 -1
  57. package/dist/components/page-header/page-header.d.ts.map +1 -1
  58. package/dist/components/page-header/page-header.js +3 -2
  59. package/dist/components/page-header/page-header.js.map +1 -1
  60. package/dist/components/payment-method-list/payment-method-list.d.ts.map +1 -1
  61. package/dist/components/payment-method-list/payment-method-list.js +4 -1
  62. package/dist/components/payment-method-list/payment-method-list.js.map +1 -1
  63. package/dist/components/sale-share-card/index.d.ts +2 -0
  64. package/dist/components/sale-share-card/index.d.ts.map +1 -0
  65. package/dist/components/sale-share-card/index.js +2 -0
  66. package/dist/components/sale-share-card/index.js.map +1 -0
  67. package/dist/components/sale-share-card/sale-share-card.d.ts +27 -0
  68. package/dist/components/sale-share-card/sale-share-card.d.ts.map +1 -0
  69. package/dist/components/sale-share-card/sale-share-card.js +46 -0
  70. package/dist/components/sale-share-card/sale-share-card.js.map +1 -0
  71. package/dist/components/sankey-chart/sankey-chart.d.ts +4 -4
  72. package/dist/components/sankey-chart/sankey-chart.js +4 -4
  73. package/dist/components/slider/slider-thumb.d.ts +2 -2
  74. package/dist/components/slider/slider-thumb.d.ts.map +1 -1
  75. package/dist/components/slider/slider-thumb.js +2 -2
  76. package/dist/components/slider/slider-thumb.js.map +1 -1
  77. package/dist/components/slider/slider.js +1 -1
  78. package/dist/components/slider/slider.js.map +1 -1
  79. package/dist/components/stat-card/index.d.ts +1 -1
  80. package/dist/components/stat-card/index.d.ts.map +1 -1
  81. package/dist/components/stat-card/index.js +1 -1
  82. package/dist/components/stat-card/index.js.map +1 -1
  83. package/dist/components/stat-card/stat-card.d.ts +47 -7
  84. package/dist/components/stat-card/stat-card.d.ts.map +1 -1
  85. package/dist/components/stat-card/stat-card.js +72 -12
  86. package/dist/components/stat-card/stat-card.js.map +1 -1
  87. package/dist/components/sunburst-chart/sunburst-chart.d.ts +2 -1
  88. package/dist/components/sunburst-chart/sunburst-chart.d.ts.map +1 -1
  89. package/dist/components/sunburst-chart/sunburst-chart.js +2 -1
  90. package/dist/components/sunburst-chart/sunburst-chart.js.map +1 -1
  91. package/dist/components/timestamp/timestamp.js +1 -1
  92. package/dist/components/timestamp/timestamp.js.map +1 -1
  93. package/dist/lib/cn-tables.js +5 -5
  94. package/dist/lib/cn-tables.js.map +1 -1
  95. package/dist/primitives/charts/area-chart.js +1 -1
  96. package/dist/primitives/charts/area-chart.js.map +1 -1
  97. package/dist/primitives/charts/area.d.ts +1 -1
  98. package/dist/primitives/charts/area.d.ts.map +1 -1
  99. package/dist/primitives/charts/bar-chart.js +1 -1
  100. package/dist/primitives/charts/bar-chart.js.map +1 -1
  101. package/dist/primitives/charts/bar-squares.d.ts +1 -1
  102. package/dist/primitives/charts/bar-squares.d.ts.map +1 -1
  103. package/dist/primitives/charts/bar.d.ts +6 -5
  104. package/dist/primitives/charts/bar.d.ts.map +1 -1
  105. package/dist/primitives/charts/bar.js +1 -1
  106. package/dist/primitives/charts/bar.js.map +1 -1
  107. package/dist/primitives/charts/chart-context.js +2 -2
  108. package/dist/primitives/charts/chart-context.js.map +1 -1
  109. package/dist/primitives/charts/composed-chart.js +3 -3
  110. package/dist/primitives/charts/composed-chart.js.map +1 -1
  111. package/dist/primitives/charts/funnel-chart.d.ts +12 -8
  112. package/dist/primitives/charts/funnel-chart.d.ts.map +1 -1
  113. package/dist/primitives/charts/funnel-chart.js +38 -9
  114. package/dist/primitives/charts/funnel-chart.js.map +1 -1
  115. package/dist/primitives/charts/gauge.d.ts +4 -4
  116. package/dist/primitives/charts/gauge.js +7 -7
  117. package/dist/primitives/charts/gauge.js.map +1 -1
  118. package/dist/primitives/charts/line-chart.js +1 -1
  119. package/dist/primitives/charts/line-chart.js.map +1 -1
  120. package/dist/primitives/charts/line-series-terminal-marker.d.ts.map +1 -1
  121. package/dist/primitives/charts/line-series-terminal-marker.js +1 -1
  122. package/dist/primitives/charts/line-series-terminal-marker.js.map +1 -1
  123. package/dist/primitives/charts/line.d.ts +1 -1
  124. package/dist/primitives/charts/line.d.ts.map +1 -1
  125. package/dist/primitives/charts/notch-gauge-shared.d.ts.map +1 -1
  126. package/dist/primitives/charts/notch-gauge-shared.js +4 -3
  127. package/dist/primitives/charts/notch-gauge-shared.js.map +1 -1
  128. package/dist/primitives/charts/pie-context.d.ts +3 -2
  129. package/dist/primitives/charts/pie-context.d.ts.map +1 -1
  130. package/dist/primitives/charts/pie-context.js +7 -6
  131. package/dist/primitives/charts/pie-context.js.map +1 -1
  132. package/dist/primitives/charts/pie-slice.d.ts +2 -2
  133. package/dist/primitives/charts/pie-slice.js +1 -1
  134. package/dist/primitives/charts/pie-slice.js.map +1 -1
  135. package/dist/primitives/charts/ring-context.d.ts +4 -2
  136. package/dist/primitives/charts/ring-context.d.ts.map +1 -1
  137. package/dist/primitives/charts/ring-context.js +8 -6
  138. package/dist/primitives/charts/ring-context.js.map +1 -1
  139. package/dist/primitives/charts/ring.d.ts +8 -8
  140. package/dist/primitives/charts/ring.d.ts.map +1 -1
  141. package/dist/primitives/charts/ring.js +4 -4
  142. package/dist/primitives/charts/ring.js.map +1 -1
  143. package/dist/primitives/charts/sankey/sankey-link.d.ts +9 -10
  144. package/dist/primitives/charts/sankey/sankey-link.d.ts.map +1 -1
  145. package/dist/primitives/charts/sankey/sankey-link.js +14 -9
  146. package/dist/primitives/charts/sankey/sankey-link.js.map +1 -1
  147. package/dist/primitives/charts/sankey/sankey-node.d.ts +5 -5
  148. package/dist/primitives/charts/sankey/sankey-node.d.ts.map +1 -1
  149. package/dist/primitives/charts/sankey/sankey-node.js +6 -6
  150. package/dist/primitives/charts/sankey/sankey-node.js.map +1 -1
  151. package/dist/primitives/charts/series-bar.d.ts +4 -4
  152. package/dist/primitives/charts/series-bar.d.ts.map +1 -1
  153. package/dist/primitives/charts/series-bar.js +1 -1
  154. package/dist/primitives/charts/series-bar.js.map +1 -1
  155. package/dist/primitives/charts/sunburst-context.d.ts +3 -2
  156. package/dist/primitives/charts/sunburst-context.d.ts.map +1 -1
  157. package/dist/primitives/charts/sunburst-context.js +6 -5
  158. package/dist/primitives/charts/sunburst-context.js.map +1 -1
  159. package/dist/primitives/charts/sunburst-legend.d.ts +7 -2
  160. package/dist/primitives/charts/sunburst-legend.d.ts.map +1 -1
  161. package/dist/primitives/charts/sunburst-legend.js +8 -6
  162. package/dist/primitives/charts/sunburst-legend.js.map +1 -1
  163. package/dist/primitives/charts/sunburst-segment.d.ts +3 -3
  164. package/dist/primitives/charts/sunburst-segment.js +2 -2
  165. package/dist/primitives/charts/sunburst-segment.js.map +1 -1
  166. package/dist/primitives/charts/tooltip/date-ticker.js +2 -2
  167. package/dist/primitives/charts/tooltip/date-ticker.js.map +1 -1
  168. package/dist/primitives/charts/tooltip/tooltip-box.js +1 -1
  169. package/dist/primitives/charts/tooltip/tooltip-box.js.map +1 -1
  170. package/dist/primitives/ui/alert-dialog.js +1 -1
  171. package/dist/primitives/ui/alert-dialog.js.map +1 -1
  172. package/dist/primitives/ui/autocomplete.js +1 -1
  173. package/dist/primitives/ui/autocomplete.js.map +1 -1
  174. package/dist/primitives/ui/dialog.js +1 -1
  175. package/dist/primitives/ui/dialog.js.map +1 -1
  176. package/dist/primitives/ui/drawer.js +1 -1
  177. package/dist/primitives/ui/drawer.js.map +1 -1
  178. package/dist/primitives/ui/popover.js +1 -1
  179. package/dist/primitives/ui/popover.js.map +1 -1
  180. package/dist/primitives/ui/preview-card.js +1 -1
  181. package/dist/primitives/ui/preview-card.js.map +1 -1
  182. package/dist/primitives/ui/sheet.js +2 -2
  183. package/dist/primitives/ui/sheet.js.map +1 -1
  184. package/dist/primitives/ui/slider.js +1 -1
  185. package/dist/primitives/ui/slider.js.map +1 -1
  186. package/dist/primitives/ui/switch.d.ts +1 -1
  187. package/dist/primitives/ui/switch.d.ts.map +1 -1
  188. package/dist/primitives/ui/switch.js +1 -1
  189. package/dist/primitives/ui/switch.js.map +1 -1
  190. package/dist/primitives/ui/toast.js +2 -2
  191. package/dist/primitives/ui/toast.js.map +1 -1
  192. package/dist/primitives/ui/tooltip.js +1 -1
  193. package/dist/primitives/ui/tooltip.js.map +1 -1
  194. package/dist/styles/theme.css +9 -0
  195. package/dist/styles/tokens.css +96 -36
  196. package/dist/styles/tokens.test.tsx +20 -2
  197. package/dist/theme/color.d.ts +5 -0
  198. package/dist/theme/color.d.ts.map +1 -1
  199. package/dist/theme/color.js +22 -0
  200. package/dist/theme/color.js.map +1 -1
  201. package/dist/theme/css.d.ts +3 -3
  202. package/dist/theme/css.d.ts.map +1 -1
  203. package/dist/theme/css.js +29 -11
  204. package/dist/theme/css.js.map +1 -1
  205. 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.4.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"
@@ -8458,19 +8465,19 @@
8458
8465
  "examples": [
8459
8466
  {
8460
8467
  "name": "chart/brush",
8461
- "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}"
8462
8469
  },
8463
8470
  {
8464
8471
  "name": "chart/grid-axes",
8465
- "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}"
8466
8473
  },
8467
8474
  {
8468
8475
  "name": "chart/markers",
8469
- "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}"
8470
8477
  },
8471
8478
  {
8472
8479
  "name": "chart/reference-area",
8473
- "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}"
8474
8481
  }
8475
8482
  ],
8476
8483
  "docsUrl": "/charts"
@@ -9371,11 +9378,11 @@
9371
9378
  "examples": [
9372
9379
  {
9373
9380
  "name": "chart-tooltip/custom-rows",
9374
- "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}"
9375
9382
  },
9376
9383
  {
9377
9384
  "name": "chart-tooltip/default",
9378
- "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}"
9379
9386
  }
9380
9387
  ],
9381
9388
  "docsUrl": "/charts"
@@ -13880,6 +13887,13 @@
13880
13887
  "description": "The key of a `chip`, e.g. \"Customer ID\" (Body/Secondary, Content/Secondary).",
13881
13888
  "source": "dodo"
13882
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
+ },
13883
13897
  {
13884
13898
  "name": "onCopy",
13885
13899
  "type": "((value: string) => void)",
@@ -14094,7 +14108,7 @@
14094
14108
  "examples": [
14095
14109
  {
14096
14110
  "name": "money/basic",
14097
- "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}"
14098
14112
  },
14099
14113
  {
14100
14114
  "name": "money/compact-and-blur",
@@ -21627,7 +21641,7 @@
21627
21641
  "examples": [
21628
21642
  {
21629
21643
  "name": "test-mode-banner/basic",
21630
- "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}"
21631
21645
  }
21632
21646
  ],
21633
21647
  "docsUrl": "/components/test-mode-banner"
@@ -23943,6 +23957,69 @@
23943
23957
  ],
23944
23958
  "docsUrl": "/components/milestone"
23945
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
+ },
23946
24023
  {
23947
24024
  "slug": "setup-guide",
23948
24025
  "title": "Setup guide",
@@ -24142,7 +24219,7 @@
24142
24219
  "name": "renderItem",
24143
24220
  "type": "(item: T) => ReactNode",
24144
24221
  "required": true,
24145
- "description": "Content of one cell.",
24222
+ "description": "Content of one cell: drawn in the white panel of the cell's card tray.",
24146
24223
  "source": "dodo"
24147
24224
  },
24148
24225
  {
@@ -24198,6 +24275,13 @@
24198
24275
  "description": "Called with the id of the filter the user picks.",
24199
24276
  "source": "dodo"
24200
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
+ },
24201
24285
  {
24202
24286
  "name": "rowHeight",
24203
24287
  "type": "number",
@@ -24274,7 +24358,7 @@
24274
24358
  "examples": [
24275
24359
  {
24276
24360
  "name": "filter-grid/basic",
24277
- "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}"
24278
24362
  },
24279
24363
  {
24280
24364
  "name": "filter-grid/empty",
@@ -25005,7 +25089,7 @@
25005
25089
  "examples": [
25006
25090
  {
25007
25091
  "name": "reorder-list/basic",
25008
- "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}"
25009
25093
  },
25010
25094
  {
25011
25095
  "name": "reorder-list/commit",
@@ -27725,9 +27809,11 @@
27725
27809
  "title": "Stat Card",
27726
27810
  "category": "Blocks",
27727
27811
  "status": "stable",
27728
- "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.",
27729
27813
  "importPath": "@dodopayments/ui/stat-card",
27730
27814
  "exports": [
27815
+ "DODO_STAT_CARD_DEFAULT_VARIANTS",
27816
+ "DODO_STAT_CARD_VARIANTS",
27731
27817
  "DODO_STAT_GRID_DEFAULT_VARIANTS",
27732
27818
  "DODO_STAT_GRID_VARIANTS",
27733
27819
  "StatCard",
@@ -27737,6 +27823,7 @@
27737
27823
  "StatCardBreakdownRowProps",
27738
27824
  "StatCardDirection",
27739
27825
  "StatCardLabels",
27826
+ "StatCardLayout",
27740
27827
  "StatCardProps",
27741
27828
  "StatCardTrend",
27742
27829
  "StatGrid",
@@ -27745,7 +27832,7 @@
27745
27832
  "parts": [
27746
27833
  {
27747
27834
  "name": "StatCard",
27748
- "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.",
27749
27836
  "props": [
27750
27837
  {
27751
27838
  "name": "label",
@@ -27819,6 +27906,24 @@
27819
27906
  "description": "Replaces some or all of the default texts.",
27820
27907
  "source": "dodo"
27821
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
+ },
27822
27927
  {
27823
27928
  "name": "loading",
27824
27929
  "type": "boolean",
@@ -27884,7 +27989,7 @@
27884
27989
  },
27885
27990
  {
27886
27991
  "name": "StatGrid",
27887
- "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.",
27888
27993
  "props": [
27889
27994
  {
27890
27995
  "name": "columns",
@@ -27915,6 +28020,38 @@
27915
28020
  "description": "",
27916
28021
  "source": "dodo"
27917
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
+ },
27918
28055
  {
27919
28056
  "name": "render",
27920
28057
  "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>",
@@ -27930,6 +28067,10 @@
27930
28067
  "name": "stat-card/basic",
27931
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}"
27932
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
+ },
27933
28074
  {
27934
28075
  "name": "stat-card/master",
27935
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}"
@@ -29591,7 +29732,7 @@
29591
29732
  "examples": [
29592
29733
  {
29593
29734
  "name": "checkout-page/basic",
29594
- "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}"
29595
29736
  },
29596
29737
  {
29597
29738
  "name": "checkout-page/upi",