@dodopayments/ui 1.0.1 → 1.0.3

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 (295) hide show
  1. package/ai/AGENTS.snippet.md +2 -0
  2. package/ai/USAGE.md +4 -0
  3. package/ai/component-registry.json +432 -89
  4. package/ai/components/app-top-bar.md +18 -10
  5. package/ai/components/auth-card.md +1 -1
  6. package/ai/components/bar-chart.md +5 -3
  7. package/ai/components/button.md +1 -1
  8. package/ai/components/chart-legend.md +3 -1
  9. package/ai/components/chart-tooltip.md +2 -2
  10. package/ai/components/composed-chart.md +5 -6
  11. package/ai/components/data-grid.md +11 -23
  12. package/ai/components/date-picker.md +1 -1
  13. package/ai/components/details-panel.md +1 -1
  14. package/ai/components/funnel-chart.md +12 -5
  15. package/ai/components/gauge-chart.md +9 -4
  16. package/ai/components/line-chart.md +1 -0
  17. package/ai/components/list-item.md +146 -6
  18. package/ai/components/pie-chart.md +1 -0
  19. package/ai/components/quantity-stepper.md +34 -2
  20. package/ai/components/radio-group.md +2 -2
  21. package/ai/components/retention-matrix.md +20 -5
  22. package/ai/components/ring-chart.md +7 -4
  23. package/ai/components/sankey-chart.md +18 -8
  24. package/ai/components/scatter-chart.md +4 -2
  25. package/ai/components/settings-section.md +1 -62
  26. package/ai/components/setup-guide.md +114 -118
  27. package/ai/components/sidebar.md +5 -0
  28. package/ai/components/stat-card.md +13 -14
  29. package/ai/components/sunburst-chart.md +138 -18
  30. package/ai/components/value-flash.md +74 -15
  31. package/ai/skills/dodo-charts/SKILL.md +3 -2
  32. package/ai/skills/dodo-design/SKILL.md +2 -2
  33. package/dist/components/auth-card/auth-card.d.ts +1 -1
  34. package/dist/components/auth-card/auth-card.d.ts.map +1 -1
  35. package/dist/components/auth-card/auth-card.js +1 -1
  36. package/dist/components/auth-card/auth-card.js.map +1 -1
  37. package/dist/components/button/button.d.ts +1 -1
  38. package/dist/components/button/button.d.ts.map +1 -1
  39. package/dist/components/button/button.js +5 -3
  40. package/dist/components/button/button.js.map +1 -1
  41. package/dist/components/data-grid/data-grid.d.ts +16 -13
  42. package/dist/components/data-grid/data-grid.d.ts.map +1 -1
  43. package/dist/components/data-grid/data-grid.js +17 -110
  44. package/dist/components/data-grid/data-grid.js.map +1 -1
  45. package/dist/components/data-grid/index.d.ts.map +1 -1
  46. package/dist/components/data-grid/index.js +1 -0
  47. package/dist/components/data-grid/index.js.map +1 -1
  48. package/dist/components/data-grid/table.d.ts +3 -6
  49. package/dist/components/data-grid/table.d.ts.map +1 -1
  50. package/dist/components/data-grid/table.js +10 -12
  51. package/dist/components/data-grid/table.js.map +1 -1
  52. package/dist/components/funnel-chart/funnel-chart.d.ts +3 -1
  53. package/dist/components/funnel-chart/funnel-chart.d.ts.map +1 -1
  54. package/dist/components/funnel-chart/funnel-chart.js +3 -1
  55. package/dist/components/funnel-chart/funnel-chart.js.map +1 -1
  56. package/dist/components/gauge-chart/gauge-chart.d.ts +3 -1
  57. package/dist/components/gauge-chart/gauge-chart.d.ts.map +1 -1
  58. package/dist/components/gauge-chart/gauge-chart.js +3 -1
  59. package/dist/components/gauge-chart/gauge-chart.js.map +1 -1
  60. package/dist/components/icon-morph/icon-morph.d.ts.map +1 -1
  61. package/dist/components/icon-morph/icon-morph.js +7 -4
  62. package/dist/components/icon-morph/icon-morph.js.map +1 -1
  63. package/dist/components/list-item/list-item.d.ts +21 -2
  64. package/dist/components/list-item/list-item.d.ts.map +1 -1
  65. package/dist/components/list-item/list-item.js +18 -4
  66. package/dist/components/list-item/list-item.js.map +1 -1
  67. package/dist/components/plan-picker/plan-picker.js +1 -1
  68. package/dist/components/plan-picker/plan-picker.js.map +1 -1
  69. package/dist/components/product-card/product-card.d.ts.map +1 -1
  70. package/dist/components/product-card/product-card.js +10 -3
  71. package/dist/components/product-card/product-card.js.map +1 -1
  72. package/dist/components/quantity-stepper/index.d.ts +1 -1
  73. package/dist/components/quantity-stepper/index.d.ts.map +1 -1
  74. package/dist/components/quantity-stepper/index.js +1 -1
  75. package/dist/components/quantity-stepper/index.js.map +1 -1
  76. package/dist/components/quantity-stepper/quantity-stepper.d.ts +33 -3
  77. package/dist/components/quantity-stepper/quantity-stepper.d.ts.map +1 -1
  78. package/dist/components/quantity-stepper/quantity-stepper.js +41 -8
  79. package/dist/components/quantity-stepper/quantity-stepper.js.map +1 -1
  80. package/dist/components/radio-group/radio-group.d.ts +6 -6
  81. package/dist/components/radio-group/radio-group.d.ts.map +1 -1
  82. package/dist/components/radio-group/radio-group.js +11 -10
  83. package/dist/components/radio-group/radio-group.js.map +1 -1
  84. package/dist/components/retention-matrix/index.d.ts +1 -1
  85. package/dist/components/retention-matrix/index.d.ts.map +1 -1
  86. package/dist/components/retention-matrix/index.js +1 -1
  87. package/dist/components/retention-matrix/index.js.map +1 -1
  88. package/dist/components/retention-matrix/retention-matrix.d.ts +32 -16
  89. package/dist/components/retention-matrix/retention-matrix.d.ts.map +1 -1
  90. package/dist/components/retention-matrix/retention-matrix.js +42 -19
  91. package/dist/components/retention-matrix/retention-matrix.js.map +1 -1
  92. package/dist/components/sankey-chart/sankey-chart.d.ts +4 -1
  93. package/dist/components/sankey-chart/sankey-chart.d.ts.map +1 -1
  94. package/dist/components/sankey-chart/sankey-chart.js +4 -1
  95. package/dist/components/sankey-chart/sankey-chart.js.map +1 -1
  96. package/dist/components/settings-section/index.d.ts.map +1 -1
  97. package/dist/components/settings-section/index.js +1 -0
  98. package/dist/components/settings-section/index.js.map +1 -1
  99. package/dist/components/settings-section/settings-section.d.ts +8 -5
  100. package/dist/components/settings-section/settings-section.d.ts.map +1 -1
  101. package/dist/components/settings-section/settings-section.js +8 -11
  102. package/dist/components/settings-section/settings-section.js.map +1 -1
  103. package/dist/components/setup-guide/index.d.ts +1 -1
  104. package/dist/components/setup-guide/index.d.ts.map +1 -1
  105. package/dist/components/setup-guide/index.js +1 -1
  106. package/dist/components/setup-guide/index.js.map +1 -1
  107. package/dist/components/setup-guide/setup-guide.d.ts +41 -16
  108. package/dist/components/setup-guide/setup-guide.d.ts.map +1 -1
  109. package/dist/components/setup-guide/setup-guide.js +53 -30
  110. package/dist/components/setup-guide/setup-guide.js.map +1 -1
  111. package/dist/components/sidebar/sidebar.d.ts +12 -5
  112. package/dist/components/sidebar/sidebar.d.ts.map +1 -1
  113. package/dist/components/sidebar/sidebar.js +127 -16
  114. package/dist/components/sidebar/sidebar.js.map +1 -1
  115. package/dist/components/stat-card/stat-card.d.ts +18 -11
  116. package/dist/components/stat-card/stat-card.d.ts.map +1 -1
  117. package/dist/components/stat-card/stat-card.js +18 -12
  118. package/dist/components/stat-card/stat-card.js.map +1 -1
  119. package/dist/components/sunburst-chart/index.d.ts +1 -0
  120. package/dist/components/sunburst-chart/index.d.ts.map +1 -1
  121. package/dist/components/sunburst-chart/index.js +1 -0
  122. package/dist/components/sunburst-chart/index.js.map +1 -1
  123. package/dist/components/sunburst-chart/sunburst-chart.d.ts +7 -5
  124. package/dist/components/sunburst-chart/sunburst-chart.d.ts.map +1 -1
  125. package/dist/components/sunburst-chart/sunburst-chart.js +7 -5
  126. package/dist/components/sunburst-chart/sunburst-chart.js.map +1 -1
  127. package/dist/components/value-flash/index.d.ts +1 -1
  128. package/dist/components/value-flash/index.d.ts.map +1 -1
  129. package/dist/components/value-flash/index.js +1 -1
  130. package/dist/components/value-flash/index.js.map +1 -1
  131. package/dist/components/value-flash/value-flash.d.ts +52 -0
  132. package/dist/components/value-flash/value-flash.d.ts.map +1 -1
  133. package/dist/components/value-flash/value-flash.js +37 -1
  134. package/dist/components/value-flash/value-flash.js.map +1 -1
  135. package/dist/icons/index.d.ts +6 -0
  136. package/dist/icons/index.js +6 -0
  137. package/dist/icons/ui/arrow-door-out-3.d.ts +3 -0
  138. package/dist/icons/ui/arrow-door-out-3.js +5 -0
  139. package/dist/icons/ui/circle-check-outline-duo.d.ts +3 -0
  140. package/dist/icons/ui/circle-check-outline-duo.d.ts.map +1 -0
  141. package/dist/icons/ui/circle-check-outline-duo.js +5 -0
  142. package/dist/icons/ui/circle-check-outline-duo.js.map +1 -0
  143. package/dist/icons/ui/circle-dashed-outline-duo.d.ts +3 -0
  144. package/dist/icons/ui/circle-dashed-outline-duo.d.ts.map +1 -0
  145. package/dist/icons/ui/circle-dashed-outline-duo.js +5 -0
  146. package/dist/icons/ui/circle-dashed-outline-duo.js.map +1 -0
  147. package/dist/icons/ui/circle-warning-outline-duo.d.ts +3 -0
  148. package/dist/icons/ui/circle-warning-outline-duo.d.ts.map +1 -0
  149. package/dist/icons/ui/circle-warning-outline-duo.js +5 -0
  150. package/dist/icons/ui/circle-warning-outline-duo.js.map +1 -0
  151. package/dist/icons/ui/circle-xmark-outline-duo.d.ts +3 -0
  152. package/dist/icons/ui/circle-xmark-outline-duo.d.ts.map +1 -0
  153. package/dist/icons/ui/circle-xmark-outline-duo.js +5 -0
  154. package/dist/icons/ui/circle-xmark-outline-duo.js.map +1 -0
  155. package/dist/icons/ui/clock-outline-duo.d.ts +3 -0
  156. package/dist/icons/ui/clock-outline-duo.d.ts.map +1 -0
  157. package/dist/icons/ui/clock-outline-duo.js +5 -0
  158. package/dist/icons/ui/clock-outline-duo.js.map +1 -0
  159. package/dist/lib/cn-tables.js +5 -5
  160. package/dist/lib/cn-tables.js.map +1 -1
  161. package/dist/lib/locale-messages.d.ts +6 -3
  162. package/dist/lib/locale-messages.d.ts.map +1 -1
  163. package/dist/lib/locale-messages.js +6 -3
  164. package/dist/lib/locale-messages.js.map +1 -1
  165. package/dist/lib/money.d.ts +4 -3
  166. package/dist/lib/money.d.ts.map +1 -1
  167. package/dist/lib/money.js +4 -3
  168. package/dist/lib/money.js.map +1 -1
  169. package/dist/locales/ar.d.ts.map +1 -1
  170. package/dist/locales/ar.js +1 -0
  171. package/dist/locales/ar.js.map +1 -1
  172. package/dist/locales/de.d.ts.map +1 -1
  173. package/dist/locales/de.js +1 -0
  174. package/dist/locales/de.js.map +1 -1
  175. package/dist/locales/es.d.ts.map +1 -1
  176. package/dist/locales/es.js +1 -0
  177. package/dist/locales/es.js.map +1 -1
  178. package/dist/locales/fr.d.ts.map +1 -1
  179. package/dist/locales/fr.js +1 -0
  180. package/dist/locales/fr.js.map +1 -1
  181. package/dist/locales/he.d.ts.map +1 -1
  182. package/dist/locales/he.js +1 -0
  183. package/dist/locales/he.js.map +1 -1
  184. package/dist/locales/hi.d.ts.map +1 -1
  185. package/dist/locales/hi.js +1 -0
  186. package/dist/locales/hi.js.map +1 -1
  187. package/dist/locales/ja.d.ts.map +1 -1
  188. package/dist/locales/ja.js +1 -0
  189. package/dist/locales/ja.js.map +1 -1
  190. package/dist/locales/pt-BR.d.ts.map +1 -1
  191. package/dist/locales/pt-BR.js +1 -0
  192. package/dist/locales/pt-BR.js.map +1 -1
  193. package/dist/locales/zh-CN.d.ts.map +1 -1
  194. package/dist/locales/zh-CN.js +1 -0
  195. package/dist/locales/zh-CN.js.map +1 -1
  196. package/dist/primitives/charts/bar.d.ts +11 -0
  197. package/dist/primitives/charts/bar.d.ts.map +1 -1
  198. package/dist/primitives/charts/bar.js +65 -11
  199. package/dist/primitives/charts/bar.js.map +1 -1
  200. package/dist/primitives/charts/funnel-chart.d.ts +22 -3
  201. package/dist/primitives/charts/funnel-chart.d.ts.map +1 -1
  202. package/dist/primitives/charts/funnel-chart.js +122 -110
  203. package/dist/primitives/charts/funnel-chart.js.map +1 -1
  204. package/dist/primitives/charts/gauge.d.ts +7 -0
  205. package/dist/primitives/charts/gauge.d.ts.map +1 -1
  206. package/dist/primitives/charts/gauge.js +37 -9
  207. package/dist/primitives/charts/gauge.js.map +1 -1
  208. package/dist/primitives/charts/index.d.ts +1 -0
  209. package/dist/primitives/charts/index.d.ts.map +1 -1
  210. package/dist/primitives/charts/index.js +1 -0
  211. package/dist/primitives/charts/index.js.map +1 -1
  212. package/dist/primitives/charts/legend/legend-marker.d.ts +7 -2
  213. package/dist/primitives/charts/legend/legend-marker.d.ts.map +1 -1
  214. package/dist/primitives/charts/legend/legend-marker.js +9 -3
  215. package/dist/primitives/charts/legend/legend-marker.js.map +1 -1
  216. package/dist/primitives/charts/legend/legend-progress.d.ts +6 -1
  217. package/dist/primitives/charts/legend/legend-progress.d.ts.map +1 -1
  218. package/dist/primitives/charts/legend/legend-progress.js +7 -2
  219. package/dist/primitives/charts/legend/legend-progress.js.map +1 -1
  220. package/dist/primitives/charts/loading-sweep.d.ts.map +1 -1
  221. package/dist/primitives/charts/loading-sweep.js +11 -2
  222. package/dist/primitives/charts/loading-sweep.js.map +1 -1
  223. package/dist/primitives/charts/pie-slice.d.ts +6 -1
  224. package/dist/primitives/charts/pie-slice.d.ts.map +1 -1
  225. package/dist/primitives/charts/pie-slice.js +26 -16
  226. package/dist/primitives/charts/pie-slice.js.map +1 -1
  227. package/dist/primitives/charts/ring.d.ts +12 -3
  228. package/dist/primitives/charts/ring.d.ts.map +1 -1
  229. package/dist/primitives/charts/ring.js +46 -9
  230. package/dist/primitives/charts/ring.js.map +1 -1
  231. package/dist/primitives/charts/sankey/sankey-link.d.ts +14 -5
  232. package/dist/primitives/charts/sankey/sankey-link.d.ts.map +1 -1
  233. package/dist/primitives/charts/sankey/sankey-link.js +34 -10
  234. package/dist/primitives/charts/sankey/sankey-link.js.map +1 -1
  235. package/dist/primitives/charts/sankey/sankey-node.d.ts +8 -2
  236. package/dist/primitives/charts/sankey/sankey-node.d.ts.map +1 -1
  237. package/dist/primitives/charts/sankey/sankey-node.js +13 -7
  238. package/dist/primitives/charts/sankey/sankey-node.js.map +1 -1
  239. package/dist/primitives/charts/scatter-chart.d.ts.map +1 -1
  240. package/dist/primitives/charts/scatter-chart.js +22 -8
  241. package/dist/primitives/charts/scatter-chart.js.map +1 -1
  242. package/dist/primitives/charts/scatter.d.ts +8 -3
  243. package/dist/primitives/charts/scatter.d.ts.map +1 -1
  244. package/dist/primitives/charts/scatter.js +9 -4
  245. package/dist/primitives/charts/scatter.js.map +1 -1
  246. package/dist/primitives/charts/series-bar.d.ts +5 -1
  247. package/dist/primitives/charts/series-bar.d.ts.map +1 -1
  248. package/dist/primitives/charts/series-bar.js +30 -11
  249. package/dist/primitives/charts/series-bar.js.map +1 -1
  250. package/dist/primitives/charts/series-markers.d.ts +6 -1
  251. package/dist/primitives/charts/series-markers.d.ts.map +1 -1
  252. package/dist/primitives/charts/series-markers.js +19 -8
  253. package/dist/primitives/charts/series-markers.js.map +1 -1
  254. package/dist/primitives/charts/sunburst-center.d.ts +10 -3
  255. package/dist/primitives/charts/sunburst-center.d.ts.map +1 -1
  256. package/dist/primitives/charts/sunburst-center.js +20 -12
  257. package/dist/primitives/charts/sunburst-center.js.map +1 -1
  258. package/dist/primitives/charts/sunburst-chart.d.ts +1 -1
  259. package/dist/primitives/charts/sunburst-chart.d.ts.map +1 -1
  260. package/dist/primitives/charts/sunburst-chart.js +27 -7
  261. package/dist/primitives/charts/sunburst-chart.js.map +1 -1
  262. package/dist/primitives/charts/sunburst-context.d.ts +2 -0
  263. package/dist/primitives/charts/sunburst-context.d.ts.map +1 -1
  264. package/dist/primitives/charts/sunburst-context.js +2 -0
  265. package/dist/primitives/charts/sunburst-context.js.map +1 -1
  266. package/dist/primitives/charts/sunburst-labels.d.ts.map +1 -1
  267. package/dist/primitives/charts/sunburst-labels.js +2 -2
  268. package/dist/primitives/charts/sunburst-labels.js.map +1 -1
  269. package/dist/primitives/charts/sunburst-legend.d.ts +19 -0
  270. package/dist/primitives/charts/sunburst-legend.d.ts.map +1 -0
  271. package/dist/primitives/charts/sunburst-legend.js +52 -0
  272. package/dist/primitives/charts/sunburst-legend.js.map +1 -0
  273. package/dist/primitives/charts/sunburst-segment.d.ts +7 -1
  274. package/dist/primitives/charts/sunburst-segment.d.ts.map +1 -1
  275. package/dist/primitives/charts/sunburst-segment.js +35 -10
  276. package/dist/primitives/charts/sunburst-segment.js.map +1 -1
  277. package/dist/primitives/charts/sunburst.d.ts +7 -5
  278. package/dist/primitives/charts/sunburst.d.ts.map +1 -1
  279. package/dist/primitives/charts/sunburst.js +24 -25
  280. package/dist/primitives/charts/sunburst.js.map +1 -1
  281. package/dist/primitives/ui/button.d.ts.map +1 -1
  282. package/dist/primitives/ui/button.js +3 -1
  283. package/dist/primitives/ui/button.js.map +1 -1
  284. package/dist/primitives/ui/sheet.js +1 -1
  285. package/dist/primitives/ui/sheet.js.map +1 -1
  286. package/dist/primitives/ui/sidebar.d.ts.map +1 -1
  287. package/dist/primitives/ui/sidebar.js +4 -2
  288. package/dist/primitives/ui/sidebar.js.map +1 -1
  289. package/dist/styles/theme.css +4 -0
  290. package/dist/styles/tokens.css +3 -1
  291. package/dist/styles/tokens.test.tsx +5 -2
  292. package/eslint/restricted-classes.js +46 -5
  293. package/package.json +1 -2
  294. package/dist/icons/ui/refresh-clockwise.d.ts.map +0 -1
  295. package/dist/icons/ui/refresh-clockwise.js.map +0 -1
@@ -1,21 +1,23 @@
1
1
  # Setup guide
2
2
 
3
3
  The setup guide a new business follows (the dashboard's Setup guide, opened from the top bar's Setup guide
4
- button): a 320 wide panel with the title, the percent done and a progress bar, then one grey row per step. A
5
- group row opens (one at a time) to its tasks, each with a status dot, a caption when submitted or blocked and an
4
+ button): a 320 wide grey tray (Direction 1) with the title, the percent done and a progress bar on its strip, then
5
+ one white panel per step, 4 apart. A
6
+ group row opens (one at a time) to its tasks, each with a status dot, a status Badge when submitted or blocked and an
6
7
  optional "Mark as done"; a link row goes straight to a page; a locked row waits behind a padlock; a finished row
7
8
  shows a green check. Collapsed, it keeps the header and bar and says what is up next. Place it yourself (the
8
9
  dashboard pins it to the bottom-right corner).
9
10
 
10
11
  ```tsx
11
- import { SetupGuide } from "@dodopayments/ui/setup-guide";
12
+ import { SetupGuide, SetupGuideIntro } from "@dodopayments/ui/setup-guide";
12
13
  ```
13
14
 
14
15
  ## SetupGuide
15
16
 
16
17
  The setup guide a new business follows (the dashboard's Setup guide, opened from the top bar's Setup guide
17
- button): a 320 wide panel with the title, the percent done and a progress bar, then one grey row per step. A
18
- group row opens (one at a time) to its tasks, each with a status dot, a caption when submitted or blocked and an
18
+ button): a 320 wide grey tray (Direction 1) with the title, the percent done and a progress bar on its strip, then
19
+ one white panel per step, 4 apart. A
20
+ group row opens (one at a time) to its tasks, each with a status dot, a status Badge when submitted or blocked and an
19
21
  optional "Mark as done"; a link row goes straight to a page; a locked row waits behind a padlock; a finished row
20
22
  shows a green check. Collapsed, it keeps the header and bar and says what is up next. Place it yourself (the
21
23
  dashboard pins it to the bottom-right corner).
@@ -33,6 +35,19 @@ dashboard pins it to the bottom-right corner).
33
35
  | `progress` | `number` | - | Overall progress, 0–100. Defaults to the share of done tasks. |
34
36
  | `upNext` | `string` | - | The task shown after "Up next" while collapsed. Defaults to the first task not done. |
35
37
 
38
+ ## SetupGuideIntro
39
+
40
+ The first-time hint above the setup guide (the Design File's "Your setup lives here"): a 320 wide lime card with
41
+ a title, a line and a "Got it" button, shown once when the guide first opens. Place it 8 above the guide; the
42
+ dashboard also dims the page behind both until it is dismissed.
43
+
44
+ | Prop | Type | Default | Description |
45
+ | --- | --- | --- | --- |
46
+ | `onDismiss` (required) | `() => void` | - | Called by the dismiss button. Hide the intro and remember it, so it shows only once. |
47
+ | `actionLabel` | `string` | `"Got it"` | The dismiss button's label. |
48
+ | `description` | `ReactNode` | `"Pick up right where you left off."` | |
49
+ | `title` | `ReactNode` | `"Your setup lives here"` | |
50
+
36
51
  ## Examples
37
52
 
38
53
  ### setup-guide/master
@@ -43,132 +58,100 @@ dashboard pins it to the bottom-right corner).
43
58
  import { Button } from "@dodopayments/ui/button";
44
59
  import {
45
60
  SetupGuide,
61
+ SetupGuideIntro,
46
62
  type SetupGuideItem,
47
63
  type SetupGuideTaskState,
48
64
  } from "@dodopayments/ui/setup-guide";
49
65
  import { useState } from "react";
50
66
 
51
- type TaskId =
52
- | "product"
53
- | "personal"
54
- | "business"
55
- | "bank"
56
- | "test-product"
57
- | "test-payment"
58
- | "webhooks";
59
-
60
- const INITIAL: Record<TaskId, SetupGuideTaskState> = {
61
- product: "done",
62
- personal: "in-review",
63
- business: "pending",
64
- bank: "pending",
65
- "test-product": "done",
66
- "test-payment": "pending",
67
- webhooks: "pending",
68
- };
69
-
67
+ const VERIFY = [
68
+ ["product", "Product Verification"],
69
+ ["identity", "Personal identity"],
70
+ ["business", "Business Information"],
71
+ ["bank", "Bank Details"],
72
+ ] as const;
73
+ const TEST = [
74
+ ["test-product", "Create a product"],
75
+ ["test-integrate", "Integrate"],
76
+ ["test-payment", "Make first test payment"],
77
+ ] as const;
78
+ const LIVE = [
79
+ ["live-products", "Create products in Live mode", false],
80
+ ["live-integrate", "Integrate (live)", true],
81
+ ["branding", "Set up branding", true],
82
+ ["zero-payment", "Make a $0 payment", false],
83
+ ] as const;
84
+
85
+ type TaskId = (typeof VERIFY)[number][0] | (typeof TEST)[number][0] | (typeof LIVE)[number][0];
86
+
87
+ const INITIAL = Object.fromEntries(
88
+ [...VERIFY, ...TEST, ...LIVE].map(([id]) => [id, "pending"]),
89
+ ) as Record<TaskId, SetupGuideTaskState>;
90
+
91
+ /**
92
+ * The Setup guide with the Design File's content: press a verification task to submit it (In review), press a test
93
+ * or live task to finish it or use Mark as done, open the steps, collapse the guide, dismiss the intro, and close and
94
+ * reopen the guide.
95
+ */
70
96
  export default function SetupGuideMaster() {
71
97
  const [states, setStates] = useState(INITIAL);
98
+ const [intro, setIntro] = useState(true);
72
99
  const [open, setOpen] = useState(true);
73
- const finish = (id: TaskId) => setStates((current) => ({ ...current, [id]: "done" }));
100
+ const set = (id: TaskId, state: SetupGuideTaskState) =>
101
+ setStates((current) => ({ ...current, [id]: state }));
74
102
 
75
103
  const items: SetupGuideItem[] = [
76
104
  {
77
105
  id: "verify",
78
106
  title: "Verify your account",
79
- tasks: [
80
- {
81
- id: "product",
82
- label: "Product Information",
83
- state: states.product,
84
- onSelect: () => finish("product"),
85
- },
86
- { id: "personal", label: "Personal Information", state: states.personal },
87
- {
88
- id: "business",
89
- label: "Business Verification",
90
- state: states.business,
91
- onSelect: () => finish("business"),
92
- },
93
- {
94
- id: "bank",
95
- label: "Bank Verification",
96
- state: states.bank,
97
- onSelect: () => finish("bank"),
98
- },
99
- ],
107
+ tasks: VERIFY.map(([id, label]) => ({
108
+ id,
109
+ label,
110
+ state: states[id],
111
+ // A pending form opens; submitting it puts it in review.
112
+ onSelect: states[id] === "pending" ? () => set(id, "in-review") : undefined,
113
+ })),
100
114
  },
101
115
  {
102
116
  id: "test",
103
117
  title: "Test mode integration",
104
- tasks: [
105
- { id: "test-product", label: "Create a test product", state: states["test-product"] },
106
- {
107
- id: "test-payment",
108
- label: "Make a test payment",
109
- state: states["test-payment"],
110
- onSelect: () => finish("test-payment"),
111
- },
112
- {
113
- id: "webhooks",
114
- label: "Set up webhooks",
115
- state: states.webhooks,
116
- onMarkDone: () => finish("webhooks"),
117
- },
118
- ],
118
+ tasks: TEST.map(([id, label]) => ({
119
+ id,
120
+ label,
121
+ state: states[id],
122
+ onSelect: states[id] === "done" ? undefined : () => set(id, "done"),
123
+ })),
124
+ },
125
+ {
126
+ id: "live",
127
+ title: "Live mode integration",
128
+ tasks: LIVE.map(([id, label, manual]) => ({
129
+ id,
130
+ label,
131
+ state: states[id],
132
+ onSelect: manual || states[id] === "done" ? undefined : () => set(id, "done"),
133
+ onMarkDone: manual ? () => set(id, "done") : undefined,
134
+ })),
135
+ },
136
+ {
137
+ id: "go-live",
138
+ title: "Go live",
139
+ hint: "Unlocks once verification is approved",
140
+ locked: true,
119
141
  },
120
- { id: "live", title: "Go live", hint: "Unlocks once verification is approved", locked: true },
121
142
  ];
122
143
 
123
- if (!open) {
124
- return (
125
- <Button variant="secondary" onClick={() => setOpen(true)}>
126
- Open the setup guide
127
- </Button>
128
- );
129
- }
130
- return <SetupGuide items={items} defaultOpenItem="verify" onClose={() => setOpen(false)} />;
131
- }
132
- ```
133
-
134
- ### setup-guide/states
135
-
136
- ```tsx
137
- "use client";
138
-
139
- import { SetupGuide } from "@dodopayments/ui/setup-guide";
140
-
141
- export default function SetupGuideStates() {
142
144
  return (
143
- <SetupGuide
144
- defaultOpenItem="verify"
145
- items={[
146
- {
147
- id: "verify",
148
- title: "Verify your account",
149
- tasks: [
150
- { id: "product", label: "Product Information", state: "done" },
151
- { id: "personal", label: "Personal Information", state: "in-review" },
152
- { id: "business", label: "Business Verification", state: "on-hold" },
153
- { id: "bank", label: "Bank Verification", state: "failed" },
154
- { id: "tax", label: "Tax details", state: "pending" },
155
- ],
156
- },
157
- {
158
- id: "branding",
159
- title: "Brand your checkout",
160
- hint: "Add your logo and colours",
161
- href: "#brand-your-checkout",
162
- },
163
- { id: "profile", title: "Business profile", done: true },
164
- {
165
- id: "live",
166
- title: "Go live",
167
- hint: "Unlocks once verification is approved",
168
- locked: true,
169
- },
170
- ]}
171
- />
145
+ <div className="flex min-h-130 flex-col items-center justify-end gap-2">
146
+ {open && intro ? <SetupGuideIntro onDismiss={() => setIntro(false)} /> : null}
147
+ {open ? (
148
+ <SetupGuide items={items} defaultOpenItem="verify" onClose={() => setOpen(false)} />
149
+ ) : (
150
+ <Button variant="secondary" onClick={() => setOpen(true)}>
151
+ Open the setup guide
152
+ </Button>
153
+ )}
154
+ </div>
172
155
  );
173
156
  }
174
157
  ```
@@ -187,19 +170,32 @@ const ITEMS: SetupGuideItem[] = [
187
170
  id: "verify",
188
171
  title: "Verify your account",
189
172
  tasks: [
190
- { id: "product", label: "Product Information", state: "done" },
191
- { id: "personal", label: "Personal Information", state: "pending" },
192
- { id: "business", label: "Business Verification", state: "pending" },
193
- { id: "bank", label: "Bank Verification", state: "pending" },
173
+ { id: "product", label: "Product Verification", state: "in-review" },
174
+ { id: "identity", label: "Personal identity", state: "done" },
175
+ { id: "business", label: "Business Information", state: "done" },
176
+ { id: "bank", label: "Bank Details", state: "pending" },
194
177
  ],
195
178
  },
196
179
  {
197
180
  id: "test",
198
181
  title: "Test mode integration",
199
- hint: "Create a product and take a test payment",
200
- href: "#test",
182
+ tasks: [
183
+ { id: "test-product", label: "Create a product", state: "pending" },
184
+ { id: "test-integrate", label: "Integrate", state: "pending" },
185
+ { id: "test-payment", label: "Make first test payment", state: "pending" },
186
+ ],
187
+ },
188
+ {
189
+ id: "live",
190
+ title: "Live mode integration",
191
+ tasks: [
192
+ { id: "live-products", label: "Create products in Live mode", state: "pending" },
193
+ { id: "live-integrate", label: "Integrate (live)", state: "pending" },
194
+ { id: "branding", label: "Set up branding", state: "pending" },
195
+ { id: "zero-payment", label: "Make a $0 payment", state: "pending" },
196
+ ],
201
197
  },
202
- { id: "live", title: "Go live", hint: "Unlocks once verification is approved", locked: true },
198
+ { id: "go-live", title: "Go live", hint: "Unlocks once verification is approved", locked: true },
203
199
  ];
204
200
 
205
201
  export default function SetupGuideWithTopBar() {
@@ -212,7 +208,7 @@ export default function SetupGuideWithTopBar() {
212
208
  // The hero above owns the / key on this page.
213
209
  searchShortcut={false}
214
210
  showSetupGuide
215
- setupGuideProgress={1 / 6}
211
+ setupGuideProgress={0.1}
216
212
  onOpenSetupGuide={() => {
217
213
  setOpen(true);
218
214
  setCollapsed(false);
@@ -83,6 +83,9 @@ A menu item that expands to show a sub-menu. Renders `<li>`; compose it from a
83
83
  `SidebarMenuCollapsibleTrigger` and a `SidebarMenuCollapsibleContent` holding a `SidebarMenuSub`.
84
84
  The primitives have no sidebar collapsible part; built from the `Collapsible` primitive.
85
85
 
86
+ Inside a `SidebarProvider` only one sub-menu is open at a time: opening one closes the one that was open.
87
+ `defaultOpen` sets the first state. Pass `open` to control it yourself; a controlled sub-menu is left out of this.
88
+
86
89
  | Prop | Type | Default | Description |
87
90
  | --- | --- | --- | --- |
88
91
  | `className` | `string` | - | Additional Tailwind classes, merged last. |
@@ -92,6 +95,8 @@ Also accepts Base UI props: `defaultOpen`, `disabled`, `onOpenChange`, `open`.
92
95
  ## SidebarMenuCollapsibleContent
93
96
 
94
97
  The animated panel (primitive `CollapsiblePanel`) holding the sub-menu. Unmounts when closed unless `keepMounted`.
98
+ On the desktop icon rail it is a small Popover beside the icon instead: the trigger's `tooltip` as its title, the
99
+ sub-menu in the white panel.
95
100
 
96
101
  | Prop | Type | Default | Description |
97
102
  | --- | --- | --- | --- |
@@ -1,7 +1,7 @@
1
1
  # Stat Card
2
2
 
3
3
  A static metric (Dodo Nest Stat card): the label on a grey strip, the number in a white panel, and an optional
4
- trend Badge and comparison under it. Put a `StatCardBreakdown` inside for the parts of the number (Payout balance).
4
+ trend chip and comparison under it. Put a `StatCardBreakdown` inside for the parts of the number (Payout balance).
5
5
  `loading` shows Skeleton lines, `empty` shows "-" and a reason, and `error` (with `onRetry`) a retry; what replaces
6
6
  the loading skeletons fades in. Cards in a CSS grid row (`StatGrid`) stretch to one height. Renders a `<section>`
7
7
  labelled by the label.
@@ -13,7 +13,7 @@ import { StatCard, StatCardBreakdown, StatCardBreakdownRow, StatGrid } from "@do
13
13
  ## StatCard
14
14
 
15
15
  A static metric (Dodo Nest Stat card): the label on a grey strip, the number in a white panel, and an optional
16
- trend Badge and comparison under it. Put a `StatCardBreakdown` inside for the parts of the number (Payout balance).
16
+ trend chip and comparison under it. Put a `StatCardBreakdown` inside for the parts of the number (Payout balance).
17
17
  `loading` shows Skeleton lines, `empty` shows "-" and a reason, and `error` (with `onRetry`) a retry; what replaces
18
18
  the loading skeletons fades in. Cards in a CSS grid row (`StatGrid`) stretch to one height. Renders a `<section>`
19
19
  labelled by the label.
@@ -23,7 +23,7 @@ labelled by the label.
23
23
  | `label` (required) | `ReactNode` | - | What the number measures, e.g. "Successful payments". It sits on the grey strip and truncates. |
24
24
  | `comparison` | `ReactNode` | - | The line under the value, e.g. "vs last 30 days", "+3 added this month" or "Next payout on Oct 21". Without it (and without a trend) the row disappears and the card hugs. |
25
25
  | `empty` | `ReactNode` | - | Show the empty state: "-" for the value and the reason under it. `true` shows `labels.empty` ("No data yet"); text or a node is the reason ("Live mode only"). Ignored while `loading` or with an `error`. |
26
- | `error` | `ReactNode` | - | Show the error state instead of the value: `true` shows the default heading; text or a node is shown under it as the reason. Ignored while `loading`. |
26
+ | `error` | `ReactNode` | - | Show the error state instead of the value: a small left-aligned heading with an error icon, and "Try again" with `onRetry`. `true` shows the default heading; text or a node is the reason, read to screen readers after the heading. Ignored while `loading`. |
27
27
  | `flash` | `boolean` | `false` | Flash each change of a number `value` with `ValueFlash`: the new number rolls in and tints success (up) or destructive (down). For live balances and counters. |
28
28
  | `footer` | `ReactNode` | - | A quiet line on the grey under the panel, e.g. `<ChartUpdated updatedAt={…} onRefresh={…} />` from `@dodopayments/ui/chart` ("Updated 40 minutes ago" and a refresh button). |
29
29
  | `format` | `((value: number) => string)` | - | Formats a number `value` for display, e.g. as currency. Defaults to `String(value)`. |
@@ -32,7 +32,7 @@ labelled by the label.
32
32
  | `labels` | `StatCardLabels` | - | Replaces some or all of the default texts. |
33
33
  | `loading` | `boolean` | `false` | Replace the value and the comparison with Skeleton lines and mark the card busy. |
34
34
  | `onRetry` | `(() => void)` | - | Shows a retry button in the error state. |
35
- | `trend` | `StatCardTrend` | - | The change: a success (up) or error (down) Badge before the comparison. Show it only with a comparison. |
35
+ | `trend` | `StatCardTrend` | - | The change: a success (up) or error (down) chip before the comparison. Show it only with a comparison. |
36
36
  | `value` | `ReactNode` | - | The number, formatted in full ("$84,320.50"); the card never abbreviates. Pass a number with `format` so `flash` can animate its changes. Without `flash`, a changed string or number swaps in place: the old value rises out and the new one rises in. An element swaps only with a `valueKey`. |
37
37
  | `valueKey` | `string \| number` | - | Identifies an element `value`, such as `<Money amount={x} />`: the value swaps in place when the key changes. An element without a key updates without motion, because it is a new object on every render. String and number values are their own key. |
38
38
 
@@ -88,7 +88,13 @@ export default function StatCardBasic() {
88
88
  trend={{ value: "8.1%", direction: "up", invert: true }}
89
89
  comparison="vs last 30 days"
90
90
  />
91
- <StatCard label="Failed payments" value="18" />
91
+ <StatCard
92
+ label="Failed payments"
93
+ help="Payments that failed after every retry. No change from the last period shows a grey -%."
94
+ value="18"
95
+ trend={{ direction: "neutral" }}
96
+ comparison="vs last 30 days"
97
+ />
92
98
  </StatGrid>
93
99
  );
94
100
  }
@@ -146,22 +152,15 @@ export default function StatCardMaster() {
146
152
  import { buttonVariants } from "@dodopayments/ui/button";
147
153
  import { Money } from "@dodopayments/ui/money";
148
154
  import { StatCard } from "@dodopayments/ui/stat-card";
149
- import { Badge } from "@dodopayments/ui/badge";
150
155
  import { Timestamp } from "@dodopayments/ui/timestamp";
151
156
 
152
- /** A payout summary: the amount, its delivery status, when it arrives and where (last four only). */
157
+ /** A payout summary: the amount, when it arrives and where (last four only). */
153
158
  export default function StatCardNextPayout() {
154
159
  return (
155
160
  <StatCard
156
161
  className="w-full max-w-sm"
157
162
  label="Next payout"
158
- value={
159
- // The delivery status sits on the amount's row, centred on it; it keeps the body font of a badge.
160
- <span className="flex flex-wrap items-center gap-x-3 gap-y-1">
161
- <Money minor={482_000} currency="USD" display="symbolAndCode" tone="neutral" />
162
- <Badge kind="payout" status="in_progress" className="font-sans" />
163
- </span>
164
- }
163
+ value={<Money minor={482_000} currency="USD" display="symbolAndCode" tone="neutral" />}
165
164
  >
166
165
  <dl className="flex flex-col gap-2 pt-2 text-body-primary">
167
166
  <div className="flex flex-wrap items-center justify-between gap-2">
@@ -1,26 +1,30 @@
1
1
  # Sunburst Chart
2
2
 
3
3
  A hierarchy as rings around a center, on the bklit `SunburstChart` primitive. Compose it from
4
- children: one `SunburstSegment` per arc of `buildArcs(data).arcs`, plus `SunburstCenter` (the hub
5
- that zooms out), `SunburstLabels`, `SunburstBreadcrumb` (drill-down path, above) and `SunburstHint`
6
- (live hint, below). `data` is a `SunburstNode` tree; leaves carry `value`. Click a segment with
7
- children to zoom in. The SVG is decorative and pointer-only: `SunburstBreadcrumb` buttons are the
8
- keyboard way to zoom out, so keep it in the chart when focus can change. Rings reveal on mount;
4
+ children: one `SunburstSegment` per arc of `buildArcs(data).arcs`, plus `SunburstCenter` (the hub:
5
+ the focused total with `formatValue`, and a click zooms out), `SunburstLabels`, `SunburstBreadcrumb`
6
+ (drill-down path, above), `SunburstLegend` (branches with value and share, beside the rings) and
7
+ `SunburstHint` (live hint, below). `data` is a `SunburstNode` tree; leaves carry `value`. Segments are
8
+ tinted washes with a solid rim, like the bar and pie charts. Click a segment with children to zoom in.
9
+ The SVG is decorative and pointer-only: `SunburstLegend` rows zoom in and `SunburstBreadcrumb` buttons
10
+ zoom out by keyboard, so keep both in the chart when focus can change. Rings reveal on mount;
9
11
  there is no loading or empty state. `size` (default 520) is the largest diameter; the chart never
10
12
  gets wider than its container.
11
13
 
12
14
  ```tsx
13
- import { SunburstChart, SunburstSegment, SunburstCenter, SunburstLabels, SunburstHint, SunburstBreadcrumb, useSunburstBreadcrumbItems, buildArcs } from "@dodopayments/ui/sunburst-chart";
15
+ import { SunburstChart, SunburstSegment, SunburstCenter, SunburstLabels, SunburstLegend, SunburstHint, SunburstBreadcrumb, useSunburstBreadcrumbItems, buildArcs } from "@dodopayments/ui/sunburst-chart";
14
16
  ```
15
17
 
16
18
  ## SunburstChart
17
19
 
18
20
  A hierarchy as rings around a center, on the bklit `SunburstChart` primitive. Compose it from
19
- children: one `SunburstSegment` per arc of `buildArcs(data).arcs`, plus `SunburstCenter` (the hub
20
- that zooms out), `SunburstLabels`, `SunburstBreadcrumb` (drill-down path, above) and `SunburstHint`
21
- (live hint, below). `data` is a `SunburstNode` tree; leaves carry `value`. Click a segment with
22
- children to zoom in. The SVG is decorative and pointer-only: `SunburstBreadcrumb` buttons are the
23
- keyboard way to zoom out, so keep it in the chart when focus can change. Rings reveal on mount;
21
+ children: one `SunburstSegment` per arc of `buildArcs(data).arcs`, plus `SunburstCenter` (the hub:
22
+ the focused total with `formatValue`, and a click zooms out), `SunburstLabels`, `SunburstBreadcrumb`
23
+ (drill-down path, above), `SunburstLegend` (branches with value and share, beside the rings) and
24
+ `SunburstHint` (live hint, below). `data` is a `SunburstNode` tree; leaves carry `value`. Segments are
25
+ tinted washes with a solid rim, like the bar and pie charts. Click a segment with children to zoom in.
26
+ The SVG is decorative and pointer-only: `SunburstLegend` rows zoom in and `SunburstBreadcrumb` buttons
27
+ zoom out by keyboard, so keep both in the chart when focus can change. Rings reveal on mount;
24
28
  there is no loading or empty state. `size` (default 520) is the largest diameter; the chart never
25
29
  gets wider than its container.
26
30
 
@@ -51,15 +55,18 @@ zooms in on click when it has children, and grows outward on hover with its ance
51
55
  | `color` | `string` | - | Optional color override |
52
56
  | `fill` | `string` | - | Optional fill override (patterns/gradients) |
53
57
  | `fillOpacity` | `number` | - | Optional fill opacity override |
58
+ | `variant` | `"tint" \| "solid"` | - | `"tint"`: the bar and pie charts' look, the branch colour washed 20% into the card on every ring (35% while hovered) with a solid 3px rim on the outer edge. `"solid"`: the full colour, fading by ring. A gradient or pattern `fill` stays solid. Default: "tint" |
54
59
 
55
60
  ## SunburstCenter
56
61
 
57
- The hub of a `SunburstChart`. At the root it is a `--card` circle; after a drill-down it takes the
58
- focused branch's color, and a click on it zooms out one level.
62
+ The hub of a `SunburstChart`, on the card colour. With `formatValue` it shows the focused node's total and name, so
63
+ the chart reads without hovering. After a drill-down a click on it zooms out one level.
59
64
 
60
65
  | Prop | Type | Default | Description |
61
66
  | --- | --- | --- | --- |
62
67
  | `className` | `string` | - | Class name of the hub circle. |
68
+ | `formatValue` | `((value: number) => string)` | - | Formats the total written in the hub, e.g. `(v) => money.format(v * 1000)`. Leave it out for an empty hub. The total is the focused node's: the whole chart at the root, the branch after a drill-down. |
69
+ | `label` | `string` | - | Caption under the total at the root, e.g. "Q3 revenue". After a drill-down the caption is the branch name. Default: `data.name` |
63
70
 
64
71
  ## SunburstLabels
65
72
 
@@ -74,6 +81,20 @@ hidden for unrelated branches while one is hovered. They fade in after the enter
74
81
  | `stroke` | `string` | - | Outline color behind the text, for contrast. Default: `--card`. |
75
82
  | `strokeWidth` | `number` | - | Outline width; 0 turns it off. Default: 2.5 |
76
83
 
84
+ ## SunburstLegend
85
+
86
+ The branches of a `SunburstChart` as a list beside it: a marker in the ring's tint, the name, the value and its share.
87
+ It follows the drill-down (the focused node's children) and the hover, both ways. A row with children is a button
88
+ that zooms in, so it is also the keyboard way into the hierarchy. Put it inside `SunburstChart`; the chart places it
89
+ beside the rings, or under them when there is no room.
90
+
91
+ | Prop | Type | Default | Description |
92
+ | --- | --- | --- | --- |
93
+ | `className` | `string` | - | Class name of the list. |
94
+ | `formatValue` | `((value: number) => string)` | - | Formats each row's value. Default: a whole number in the locale. |
95
+ | `showPercentage` | `boolean` | - | Show each row's share of the focused node. Default: true |
96
+ | `zoomInLabel` | `string` | - | Ends the accessible name of a row that zooms in ("Subscriptions, $683K, 66%, zoom in"). Default: "zoom in" |
97
+
77
98
  ## SunburstHint
78
99
 
79
100
  A polite live region below a `SunburstChart`: the hovered segment's path, or how to zoom in or out.
@@ -135,7 +156,7 @@ import {
135
156
  SunburstCenter,
136
157
  SunburstChart,
137
158
  SunburstHint,
138
- SunburstLabels,
159
+ SunburstLegend,
139
160
  type SunburstNode,
140
161
  SunburstSegment,
141
162
  } from "@dodopayments/ui/sunburst-chart";
@@ -183,16 +204,107 @@ const revenue: SunburstNode = {
183
204
  };
184
205
 
185
206
  const { arcs } = buildArcs(revenue);
207
+ const money = new Intl.NumberFormat("en-US", {
208
+ style: "currency",
209
+ currency: "USD",
210
+ notation: "compact",
211
+ maximumFractionDigits: 2,
212
+ });
213
+ const formatThousands = (value: number) => money.format(value * 1000);
186
214
 
187
215
  export default function SunburstChartBasic() {
188
216
  return (
189
- <SunburstChart data={revenue} label="Q3 2026 revenue by product line, plan and region" size={400}>
217
+ <SunburstChart
218
+ data={revenue}
219
+ label="Q3 2026 revenue by product line, plan and region"
220
+ size={320}
221
+ >
222
+ <SunburstBreadcrumb />
223
+ {arcs.map((arc) => (
224
+ <SunburstSegment key={arc.id} index={arc.arcIndex} />
225
+ ))}
226
+ <SunburstCenter formatValue={formatThousands} label="Q3 revenue" />
227
+ <SunburstLegend formatValue={formatThousands} />
228
+ <SunburstHint />
229
+ </SunburstChart>
230
+ );
231
+ }
232
+ ```
233
+
234
+ ### sunburst-chart/compact
235
+
236
+ ```tsx
237
+ "use client";
238
+
239
+ import {
240
+ buildArcs,
241
+ SunburstBreadcrumb,
242
+ SunburstCenter,
243
+ SunburstChart,
244
+ SunburstHint,
245
+ SunburstLegend,
246
+ type SunburstNode,
247
+ SunburstSegment,
248
+ } from "@dodopayments/ui/sunburst-chart";
249
+
250
+ // Q3 2026 revenue in thousands of USD: product line, then plan or channel, then region.
251
+ const revenue: SunburstNode = {
252
+ name: "Revenue",
253
+ children: [
254
+ {
255
+ name: "Subscriptions",
256
+ children: [
257
+ {
258
+ name: "Monthly",
259
+ children: [
260
+ { name: "Americas", value: 182 },
261
+ { name: "EMEA", value: 121 },
262
+ { name: "APAC", value: 94 },
263
+ ],
264
+ },
265
+ {
266
+ name: "Annual",
267
+ children: [
268
+ { name: "Americas", value: 146 },
269
+ { name: "EMEA", value: 88 },
270
+ { name: "APAC", value: 52 },
271
+ ],
272
+ },
273
+ ],
274
+ },
275
+ {
276
+ name: "One-time",
277
+ children: [
278
+ { name: "Digital goods", value: 138 },
279
+ { name: "Courses", value: 74 },
280
+ ],
281
+ },
282
+ {
283
+ name: "Usage",
284
+ children: [
285
+ { name: "API calls", value: 96 },
286
+ { name: "Storage", value: 41 },
287
+ ],
288
+ },
289
+ ],
290
+ };
291
+
292
+ const { arcs } = buildArcs(revenue);
293
+
294
+ export default function SunburstChartCompact() {
295
+ return (
296
+ <SunburstChart
297
+ data={revenue}
298
+ label="Q3 2026 revenue by product line, plan and region"
299
+ size={240}
300
+ >
190
301
  <SunburstBreadcrumb />
191
302
  {arcs.map((arc) => (
192
303
  <SunburstSegment key={arc.id} index={arc.arcIndex} />
193
304
  ))}
194
305
  <SunburstCenter />
195
- <SunburstLabels />
306
+ {/* The keyboard paths: legend rows zoom in, breadcrumb buttons zoom out. */}
307
+ <SunburstLegend />
196
308
  <SunburstHint />
197
309
  </SunburstChart>
198
310
  );
@@ -362,11 +474,19 @@ const revenue: SunburstNode = {
362
474
  };
363
475
 
364
476
  const { arcs } = buildArcs(revenue);
365
- const usd = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0 });
477
+ const usd = new Intl.NumberFormat("en-US", {
478
+ style: "currency",
479
+ currency: "USD",
480
+ maximumFractionDigits: 0,
481
+ });
366
482
 
367
483
  export default function SunburstChartCustomHint() {
368
484
  return (
369
- <SunburstChart data={revenue} label="Q3 2026 revenue by product line, plan and region" size={360}>
485
+ <SunburstChart
486
+ data={revenue}
487
+ label="Q3 2026 revenue by product line, plan and region"
488
+ size={360}
489
+ >
370
490
  <SunburstBreadcrumb />
371
491
  {arcs.map((arc) => (
372
492
  <SunburstSegment key={arc.id} index={arc.arcIndex} />