@dodopayments/ui 1.0.1 → 1.0.2
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.
- package/ai/component-registry.json +431 -88
- package/ai/components/app-top-bar.md +18 -10
- package/ai/components/bar-chart.md +5 -3
- package/ai/components/button.md +1 -1
- package/ai/components/chart-legend.md +3 -1
- package/ai/components/chart-tooltip.md +2 -2
- package/ai/components/composed-chart.md +5 -6
- package/ai/components/data-grid.md +11 -23
- package/ai/components/date-picker.md +1 -1
- package/ai/components/details-panel.md +1 -1
- package/ai/components/funnel-chart.md +12 -5
- package/ai/components/gauge-chart.md +9 -4
- package/ai/components/line-chart.md +1 -0
- package/ai/components/list-item.md +146 -6
- package/ai/components/pie-chart.md +1 -0
- package/ai/components/quantity-stepper.md +34 -2
- package/ai/components/radio-group.md +2 -2
- package/ai/components/retention-matrix.md +20 -5
- package/ai/components/ring-chart.md +7 -4
- package/ai/components/sankey-chart.md +18 -8
- package/ai/components/scatter-chart.md +4 -2
- package/ai/components/settings-section.md +1 -62
- package/ai/components/setup-guide.md +114 -118
- package/ai/components/sidebar.md +5 -0
- package/ai/components/stat-card.md +13 -14
- package/ai/components/sunburst-chart.md +138 -18
- package/ai/components/value-flash.md +74 -15
- package/ai/skills/dodo-charts/SKILL.md +3 -2
- package/ai/skills/dodo-design/SKILL.md +2 -2
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +5 -3
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/data-grid/data-grid.d.ts +16 -13
- package/dist/components/data-grid/data-grid.d.ts.map +1 -1
- package/dist/components/data-grid/data-grid.js +17 -110
- package/dist/components/data-grid/data-grid.js.map +1 -1
- package/dist/components/data-grid/index.d.ts.map +1 -1
- package/dist/components/data-grid/index.js +1 -0
- package/dist/components/data-grid/index.js.map +1 -1
- package/dist/components/data-grid/table.d.ts +3 -6
- package/dist/components/data-grid/table.d.ts.map +1 -1
- package/dist/components/data-grid/table.js +10 -12
- package/dist/components/data-grid/table.js.map +1 -1
- package/dist/components/funnel-chart/funnel-chart.d.ts +3 -1
- package/dist/components/funnel-chart/funnel-chart.d.ts.map +1 -1
- package/dist/components/funnel-chart/funnel-chart.js +3 -1
- package/dist/components/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/gauge-chart/gauge-chart.d.ts +3 -1
- package/dist/components/gauge-chart/gauge-chart.d.ts.map +1 -1
- package/dist/components/gauge-chart/gauge-chart.js +3 -1
- package/dist/components/gauge-chart/gauge-chart.js.map +1 -1
- package/dist/components/icon-morph/icon-morph.d.ts.map +1 -1
- package/dist/components/icon-morph/icon-morph.js +7 -4
- package/dist/components/icon-morph/icon-morph.js.map +1 -1
- package/dist/components/list-item/list-item.d.ts +21 -2
- package/dist/components/list-item/list-item.d.ts.map +1 -1
- package/dist/components/list-item/list-item.js +18 -4
- package/dist/components/list-item/list-item.js.map +1 -1
- package/dist/components/plan-picker/plan-picker.js +1 -1
- package/dist/components/plan-picker/plan-picker.js.map +1 -1
- package/dist/components/product-card/product-card.d.ts.map +1 -1
- package/dist/components/product-card/product-card.js +10 -3
- package/dist/components/product-card/product-card.js.map +1 -1
- package/dist/components/quantity-stepper/index.d.ts +1 -1
- package/dist/components/quantity-stepper/index.d.ts.map +1 -1
- package/dist/components/quantity-stepper/index.js +1 -1
- package/dist/components/quantity-stepper/index.js.map +1 -1
- package/dist/components/quantity-stepper/quantity-stepper.d.ts +33 -3
- package/dist/components/quantity-stepper/quantity-stepper.d.ts.map +1 -1
- package/dist/components/quantity-stepper/quantity-stepper.js +41 -8
- package/dist/components/quantity-stepper/quantity-stepper.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts +6 -6
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +11 -10
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/retention-matrix/index.d.ts +1 -1
- package/dist/components/retention-matrix/index.d.ts.map +1 -1
- package/dist/components/retention-matrix/index.js +1 -1
- package/dist/components/retention-matrix/index.js.map +1 -1
- package/dist/components/retention-matrix/retention-matrix.d.ts +32 -16
- package/dist/components/retention-matrix/retention-matrix.d.ts.map +1 -1
- package/dist/components/retention-matrix/retention-matrix.js +42 -19
- package/dist/components/retention-matrix/retention-matrix.js.map +1 -1
- package/dist/components/sankey-chart/sankey-chart.d.ts +4 -1
- package/dist/components/sankey-chart/sankey-chart.d.ts.map +1 -1
- package/dist/components/sankey-chart/sankey-chart.js +4 -1
- package/dist/components/sankey-chart/sankey-chart.js.map +1 -1
- package/dist/components/settings-section/index.d.ts.map +1 -1
- package/dist/components/settings-section/index.js +1 -0
- package/dist/components/settings-section/index.js.map +1 -1
- package/dist/components/settings-section/settings-section.d.ts +8 -5
- package/dist/components/settings-section/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section/settings-section.js +8 -11
- package/dist/components/settings-section/settings-section.js.map +1 -1
- package/dist/components/setup-guide/index.d.ts +1 -1
- package/dist/components/setup-guide/index.d.ts.map +1 -1
- package/dist/components/setup-guide/index.js +1 -1
- package/dist/components/setup-guide/index.js.map +1 -1
- package/dist/components/setup-guide/setup-guide.d.ts +41 -16
- package/dist/components/setup-guide/setup-guide.d.ts.map +1 -1
- package/dist/components/setup-guide/setup-guide.js +53 -30
- package/dist/components/setup-guide/setup-guide.js.map +1 -1
- package/dist/components/sidebar/sidebar.d.ts +12 -5
- package/dist/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar.js +127 -16
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/stat-card/stat-card.d.ts +18 -11
- package/dist/components/stat-card/stat-card.d.ts.map +1 -1
- package/dist/components/stat-card/stat-card.js +18 -12
- package/dist/components/stat-card/stat-card.js.map +1 -1
- package/dist/components/sunburst-chart/index.d.ts +1 -0
- package/dist/components/sunburst-chart/index.d.ts.map +1 -1
- package/dist/components/sunburst-chart/index.js +1 -0
- package/dist/components/sunburst-chart/index.js.map +1 -1
- package/dist/components/sunburst-chart/sunburst-chart.d.ts +7 -5
- package/dist/components/sunburst-chart/sunburst-chart.d.ts.map +1 -1
- package/dist/components/sunburst-chart/sunburst-chart.js +7 -5
- package/dist/components/sunburst-chart/sunburst-chart.js.map +1 -1
- package/dist/components/value-flash/index.d.ts +1 -1
- package/dist/components/value-flash/index.d.ts.map +1 -1
- package/dist/components/value-flash/index.js +1 -1
- package/dist/components/value-flash/index.js.map +1 -1
- package/dist/components/value-flash/value-flash.d.ts +52 -0
- package/dist/components/value-flash/value-flash.d.ts.map +1 -1
- package/dist/components/value-flash/value-flash.js +37 -1
- package/dist/components/value-flash/value-flash.js.map +1 -1
- package/dist/icons/index.d.ts +6 -0
- package/dist/icons/index.js +6 -0
- package/dist/icons/ui/arrow-door-out-3.d.ts +3 -0
- package/dist/icons/ui/arrow-door-out-3.js +5 -0
- package/dist/icons/ui/circle-check-outline-duo.d.ts +3 -0
- package/dist/icons/ui/circle-check-outline-duo.d.ts.map +1 -0
- package/dist/icons/ui/circle-check-outline-duo.js +5 -0
- package/dist/icons/ui/circle-check-outline-duo.js.map +1 -0
- package/dist/icons/ui/circle-dashed-outline-duo.d.ts +3 -0
- package/dist/icons/ui/circle-dashed-outline-duo.d.ts.map +1 -0
- package/dist/icons/ui/circle-dashed-outline-duo.js +5 -0
- package/dist/icons/ui/circle-dashed-outline-duo.js.map +1 -0
- package/dist/icons/ui/circle-warning-outline-duo.d.ts +3 -0
- package/dist/icons/ui/circle-warning-outline-duo.d.ts.map +1 -0
- package/dist/icons/ui/circle-warning-outline-duo.js +5 -0
- package/dist/icons/ui/circle-warning-outline-duo.js.map +1 -0
- package/dist/icons/ui/circle-xmark-outline-duo.d.ts +3 -0
- package/dist/icons/ui/circle-xmark-outline-duo.d.ts.map +1 -0
- package/dist/icons/ui/circle-xmark-outline-duo.js +5 -0
- package/dist/icons/ui/circle-xmark-outline-duo.js.map +1 -0
- package/dist/icons/ui/clock-outline-duo.d.ts +3 -0
- package/dist/icons/ui/clock-outline-duo.d.ts.map +1 -0
- package/dist/icons/ui/clock-outline-duo.js +5 -0
- package/dist/icons/ui/clock-outline-duo.js.map +1 -0
- package/dist/lib/cn-tables.js +5 -5
- package/dist/lib/cn-tables.js.map +1 -1
- package/dist/lib/locale-messages.d.ts +6 -3
- package/dist/lib/locale-messages.d.ts.map +1 -1
- package/dist/lib/locale-messages.js +6 -3
- package/dist/lib/locale-messages.js.map +1 -1
- package/dist/locales/ar.d.ts.map +1 -1
- package/dist/locales/ar.js +1 -0
- package/dist/locales/ar.js.map +1 -1
- package/dist/locales/de.d.ts.map +1 -1
- package/dist/locales/de.js +1 -0
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/es.d.ts.map +1 -1
- package/dist/locales/es.js +1 -0
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fr.d.ts.map +1 -1
- package/dist/locales/fr.js +1 -0
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/he.d.ts.map +1 -1
- package/dist/locales/he.js +1 -0
- package/dist/locales/he.js.map +1 -1
- package/dist/locales/hi.d.ts.map +1 -1
- package/dist/locales/hi.js +1 -0
- package/dist/locales/hi.js.map +1 -1
- package/dist/locales/ja.d.ts.map +1 -1
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/pt-BR.d.ts.map +1 -1
- package/dist/locales/pt-BR.js +1 -0
- package/dist/locales/pt-BR.js.map +1 -1
- package/dist/locales/zh-CN.d.ts.map +1 -1
- package/dist/locales/zh-CN.js +1 -0
- package/dist/locales/zh-CN.js.map +1 -1
- package/dist/primitives/charts/bar.d.ts +11 -0
- package/dist/primitives/charts/bar.d.ts.map +1 -1
- package/dist/primitives/charts/bar.js +65 -11
- package/dist/primitives/charts/bar.js.map +1 -1
- package/dist/primitives/charts/funnel-chart.d.ts +22 -3
- package/dist/primitives/charts/funnel-chart.d.ts.map +1 -1
- package/dist/primitives/charts/funnel-chart.js +122 -110
- package/dist/primitives/charts/funnel-chart.js.map +1 -1
- package/dist/primitives/charts/gauge.d.ts +7 -0
- package/dist/primitives/charts/gauge.d.ts.map +1 -1
- package/dist/primitives/charts/gauge.js +37 -9
- package/dist/primitives/charts/gauge.js.map +1 -1
- package/dist/primitives/charts/index.d.ts +1 -0
- package/dist/primitives/charts/index.d.ts.map +1 -1
- package/dist/primitives/charts/index.js +1 -0
- package/dist/primitives/charts/index.js.map +1 -1
- package/dist/primitives/charts/legend/legend-marker.d.ts +7 -2
- package/dist/primitives/charts/legend/legend-marker.d.ts.map +1 -1
- package/dist/primitives/charts/legend/legend-marker.js +9 -3
- package/dist/primitives/charts/legend/legend-marker.js.map +1 -1
- package/dist/primitives/charts/legend/legend-progress.d.ts +6 -1
- package/dist/primitives/charts/legend/legend-progress.d.ts.map +1 -1
- package/dist/primitives/charts/legend/legend-progress.js +7 -2
- package/dist/primitives/charts/legend/legend-progress.js.map +1 -1
- package/dist/primitives/charts/loading-sweep.d.ts.map +1 -1
- package/dist/primitives/charts/loading-sweep.js +11 -2
- package/dist/primitives/charts/loading-sweep.js.map +1 -1
- package/dist/primitives/charts/pie-slice.d.ts +6 -1
- package/dist/primitives/charts/pie-slice.d.ts.map +1 -1
- package/dist/primitives/charts/pie-slice.js +26 -16
- package/dist/primitives/charts/pie-slice.js.map +1 -1
- package/dist/primitives/charts/ring.d.ts +12 -3
- package/dist/primitives/charts/ring.d.ts.map +1 -1
- package/dist/primitives/charts/ring.js +46 -9
- package/dist/primitives/charts/ring.js.map +1 -1
- package/dist/primitives/charts/sankey/sankey-link.d.ts +14 -5
- package/dist/primitives/charts/sankey/sankey-link.d.ts.map +1 -1
- package/dist/primitives/charts/sankey/sankey-link.js +34 -10
- package/dist/primitives/charts/sankey/sankey-link.js.map +1 -1
- package/dist/primitives/charts/sankey/sankey-node.d.ts +8 -2
- package/dist/primitives/charts/sankey/sankey-node.d.ts.map +1 -1
- package/dist/primitives/charts/sankey/sankey-node.js +13 -7
- package/dist/primitives/charts/sankey/sankey-node.js.map +1 -1
- package/dist/primitives/charts/scatter-chart.d.ts.map +1 -1
- package/dist/primitives/charts/scatter-chart.js +22 -8
- package/dist/primitives/charts/scatter-chart.js.map +1 -1
- package/dist/primitives/charts/scatter.d.ts +8 -3
- package/dist/primitives/charts/scatter.d.ts.map +1 -1
- package/dist/primitives/charts/scatter.js +9 -4
- package/dist/primitives/charts/scatter.js.map +1 -1
- package/dist/primitives/charts/series-bar.d.ts +5 -1
- package/dist/primitives/charts/series-bar.d.ts.map +1 -1
- package/dist/primitives/charts/series-bar.js +30 -11
- package/dist/primitives/charts/series-bar.js.map +1 -1
- package/dist/primitives/charts/series-markers.d.ts +6 -1
- package/dist/primitives/charts/series-markers.d.ts.map +1 -1
- package/dist/primitives/charts/series-markers.js +19 -8
- package/dist/primitives/charts/series-markers.js.map +1 -1
- package/dist/primitives/charts/sunburst-center.d.ts +10 -3
- package/dist/primitives/charts/sunburst-center.d.ts.map +1 -1
- package/dist/primitives/charts/sunburst-center.js +20 -12
- package/dist/primitives/charts/sunburst-center.js.map +1 -1
- package/dist/primitives/charts/sunburst-chart.d.ts +1 -1
- package/dist/primitives/charts/sunburst-chart.d.ts.map +1 -1
- package/dist/primitives/charts/sunburst-chart.js +27 -7
- package/dist/primitives/charts/sunburst-chart.js.map +1 -1
- package/dist/primitives/charts/sunburst-context.d.ts +2 -0
- package/dist/primitives/charts/sunburst-context.d.ts.map +1 -1
- package/dist/primitives/charts/sunburst-context.js +2 -0
- package/dist/primitives/charts/sunburst-context.js.map +1 -1
- package/dist/primitives/charts/sunburst-labels.d.ts.map +1 -1
- package/dist/primitives/charts/sunburst-labels.js +2 -2
- package/dist/primitives/charts/sunburst-labels.js.map +1 -1
- package/dist/primitives/charts/sunburst-legend.d.ts +19 -0
- package/dist/primitives/charts/sunburst-legend.d.ts.map +1 -0
- package/dist/primitives/charts/sunburst-legend.js +52 -0
- package/dist/primitives/charts/sunburst-legend.js.map +1 -0
- package/dist/primitives/charts/sunburst-segment.d.ts +7 -1
- package/dist/primitives/charts/sunburst-segment.d.ts.map +1 -1
- package/dist/primitives/charts/sunburst-segment.js +35 -10
- package/dist/primitives/charts/sunburst-segment.js.map +1 -1
- package/dist/primitives/charts/sunburst.d.ts +7 -5
- package/dist/primitives/charts/sunburst.d.ts.map +1 -1
- package/dist/primitives/charts/sunburst.js +24 -25
- package/dist/primitives/charts/sunburst.js.map +1 -1
- package/dist/primitives/ui/button.d.ts.map +1 -1
- package/dist/primitives/ui/button.js +3 -1
- package/dist/primitives/ui/button.js.map +1 -1
- package/dist/primitives/ui/sidebar.d.ts.map +1 -1
- package/dist/primitives/ui/sidebar.js +4 -2
- package/dist/primitives/ui/sidebar.js.map +1 -1
- package/dist/styles/theme.css +4 -0
- package/dist/styles/tokens.css +3 -1
- package/dist/styles/tokens.test.tsx +5 -2
- package/eslint/restricted-classes.js +46 -5
- package/package.json +1 -2
- package/dist/icons/ui/refresh-clockwise.d.ts.map +0 -1
- package/dist/icons/ui/refresh-clockwise.js.map +0 -1
|
@@ -159,6 +159,7 @@ export default function AppTopBarCallbacks() {
|
|
|
159
159
|
import { AppTopBar } from "@dodopayments/ui/app-top-bar";
|
|
160
160
|
import { CommandPalette, type CommandPaletteGroup } from "@dodopayments/ui/command";
|
|
161
161
|
import {
|
|
162
|
+
ArrowDoorOut3Icon,
|
|
162
163
|
ArrowsTransactionIcon,
|
|
163
164
|
BoxIcon,
|
|
164
165
|
CreditCardIcon,
|
|
@@ -166,7 +167,7 @@ import {
|
|
|
166
167
|
UserIcon,
|
|
167
168
|
WalletIcon,
|
|
168
169
|
} from "@dodopayments/ui/icons";
|
|
169
|
-
import { MenuGroup, MenuGroupLabel, MenuItem } from "@dodopayments/ui/menu";
|
|
170
|
+
import { MenuGroup, MenuGroupLabel, MenuItem, MenuSeparator } from "@dodopayments/ui/menu";
|
|
170
171
|
import {
|
|
171
172
|
PopoverHeader,
|
|
172
173
|
PopoverNotificationItem,
|
|
@@ -241,17 +242,24 @@ export default function AppTopBarMaster() {
|
|
|
241
242
|
</>
|
|
242
243
|
}
|
|
243
244
|
account={
|
|
244
|
-
|
|
245
|
-
<
|
|
246
|
-
|
|
247
|
-
<
|
|
248
|
-
|
|
249
|
-
|
|
245
|
+
<>
|
|
246
|
+
<MenuGroup>
|
|
247
|
+
<MenuGroupLabel>Account Options</MenuGroupLabel>
|
|
248
|
+
<MenuItem>
|
|
249
|
+
<UserIcon aria-hidden="true" />
|
|
250
|
+
Profile
|
|
251
|
+
</MenuItem>
|
|
252
|
+
<MenuItem>
|
|
253
|
+
<PenIcon aria-hidden="true" />
|
|
254
|
+
Edit Business
|
|
255
|
+
</MenuItem>
|
|
256
|
+
</MenuGroup>
|
|
257
|
+
<MenuSeparator />
|
|
250
258
|
<MenuItem>
|
|
251
|
-
<
|
|
252
|
-
|
|
259
|
+
<ArrowDoorOut3Icon aria-hidden="true" />
|
|
260
|
+
Sign out
|
|
253
261
|
</MenuItem>
|
|
254
|
-
|
|
262
|
+
</>
|
|
255
263
|
}
|
|
256
264
|
/>
|
|
257
265
|
<CommandPalette
|
|
@@ -68,6 +68,7 @@ gradient or a pattern `url(#id)`; set `stroke` for the tooltip dot when `fill` i
|
|
|
68
68
|
| `stackGap` | `number` | - | Gap between stacked bars in pixels. Default: 0 |
|
|
69
69
|
| `staggerDelay` | `number` | - | Stagger delay between bars in seconds. Auto-calculated if not provided. |
|
|
70
70
|
| `stroke` | `string` | - | Color for tooltip dot. Use when fill is a gradient/pattern. Default: uses fill value |
|
|
71
|
+
| `variant` | `"tint" \| "solid"` | - | `"tint"`: the radar look, an opaque 20% wash of the colour (mixed into the card, so gridlines stay behind it) with a solid 3px edge at the value end (35% while hovered). `"solid"`: the full colour. A gradient or pattern `fill` without `stroke`, and `perspective` bars, stay solid. Default: "tint" |
|
|
71
72
|
| `yAxisId` | `string \| number` | - | Y-scale group id for vertical bars (Recharts `yAxisId`). Default: `"left"`. |
|
|
72
73
|
|
|
73
74
|
## BarXAxis
|
|
@@ -136,6 +137,7 @@ Several `SeriesBar`s in a composed chart group or stack by the chart's bar setti
|
|
|
136
137
|
| `fill` | `string` | - | Fill color. Default: var(--chart-1) |
|
|
137
138
|
| `radius` | `number` | - | Corner radius for bar top corners. Default: 0 (square tops, similar to Bar lineCap="butt") |
|
|
138
139
|
| `stroke` | `string` | - | Tooltip dot color when fill is gradient/pattern. Default: fill |
|
|
140
|
+
| `variant` | `"tint" \| "solid"` | - | `"tint"`: the look of `Bar`, an opaque 20% wash of the colour (35% for the hovered point) with a solid 3px edge along the top. `"solid"`: the full colour. A gradient or pattern `fill` without `stroke` stays solid. Default: "tint" |
|
|
139
141
|
|
|
140
142
|
## BarColumnTrack
|
|
141
143
|
|
|
@@ -306,7 +308,7 @@ export default function BarChartGrouped() {
|
|
|
306
308
|
<div className="flex w-full flex-col gap-3">
|
|
307
309
|
<Legend items={legendItems} className="flex-row flex-wrap gap-1">
|
|
308
310
|
<LegendItem className="flex items-center gap-2">
|
|
309
|
-
<LegendMarker />
|
|
311
|
+
<LegendMarker variant="bar" />
|
|
310
312
|
<LegendLabel />
|
|
311
313
|
</LegendItem>
|
|
312
314
|
</Legend>
|
|
@@ -460,14 +462,14 @@ export default function BarChartStacked() {
|
|
|
460
462
|
<div className="flex w-full flex-col gap-3">
|
|
461
463
|
<Legend items={legendItems} className="flex-row flex-wrap gap-1">
|
|
462
464
|
<LegendItem className="flex items-center gap-2">
|
|
463
|
-
<LegendMarker />
|
|
465
|
+
<LegendMarker variant="bar" />
|
|
464
466
|
<LegendLabel />
|
|
465
467
|
</LegendItem>
|
|
466
468
|
</Legend>
|
|
467
469
|
<BarChart data={data} xDataKey="week" stacked stackGap={2} label="Payouts by method, last 6 weeks">
|
|
468
470
|
<ChartGrid horizontal />
|
|
469
471
|
{series.map(({ key, color }) => (
|
|
470
|
-
<Bar key={key} dataKey={key} fill={color}
|
|
472
|
+
<Bar key={key} dataKey={key} fill={color} />
|
|
471
473
|
))}
|
|
472
474
|
<BarXAxis />
|
|
473
475
|
<ChartTooltip
|
package/ai/components/button.md
CHANGED
|
@@ -32,7 +32,7 @@ and announces it.
|
|
|
32
32
|
| `result` | `"success" \| "error" \| null` | - | Outcome of the last action, after interior.dev's loading button. `"success"` swaps the label for a check and `successText`, `"error"` for a warning icon and `errorText`; `null` shows the label. The outcome is announced through a polite live region. Pass it (even `null`) on buttons that report an outcome, so every face shares one cell from the first render. Clear it yourself, e.g. after 1.4s. With `result`, `Button` renders the button and a sibling status element, so do not pass a `Button` with `result` as the `render` element of another component. |
|
|
33
33
|
| `size` | `"xs" \| "default" \| "lg" \| "icon" \| "icon-xs" \| "icon-lg"` | `"lg"` | `xs`: 28px tall (24px from `sm`), Figma `sm`: dense toolbars, strip actions and inline actions.<br>`default`: 36px tall (32px from `sm`): a compact control when a design asks for one. Not a Figma size; prefer `lg`.<br>`lg`: 40px tall (36px from `sm`), Figma `lg`, the default: page, form, dialog and card actions, next to an Input.<br>`icon`: Square icon-only button at the default height. Requires `aria-label`.<br>`icon-xs`: Square icon-only button at `xs` height. Requires `aria-label`.<br>`icon-lg`: Square icon-only button at `lg` height. Requires `aria-label`. |
|
|
34
34
|
| `successText` | `ReactNode` | `"Done"` | Label shown while `result` is `"success"`. |
|
|
35
|
-
| `variant` | `"default" \| "secondary" \| "ghost" \| "destructive" \| "warning" \| "wallet" \| "destructive-outline" \| "link"` | `"default"` | `default`: Primary action (Figma Button primary): a dark gradient with white text, white in dark mode. Use it for the one main action of a view, form or dialog.<br>`secondary`: Tactile light button (Figma Button secondary). The default for most actions in forms, toolbars and dialogs.<br>`ghost`: No chrome until hover (Figma Button ghost). Use for icon buttons and dense UI.<br>`destructive`: Irreversible or dangerous actions such as delete or revoke (Figma Button destructive): a red gradient with white text.<br>`warning`: Confirms an action that needs attention but can be undone, such as pause (Figma Button warning): an amber gradient with white text.<br>`wallet`: Express checkout (Apple Pay, Google Pay): the wallet brands' black button, white in dark mode, holding the wallet's `WalletLogo` (20 tall). Name it with `aria-label` ("Pay with Apple Pay"). `WalletButtons` lays out a row of them.<br>`destructive-outline`: Bordered destructive action where a solid red button is too loud, e.g. in a row of actions.<br>`link`: Looks like an inline link but behaves as a button. |
|
|
35
|
+
| `variant` | `"default" \| "secondary" \| "ghost" \| "destructive" \| "warning" \| "wallet" \| "destructive-outline" \| "link"` | `"default"` | `default`: Primary action (Figma Button primary): a dark gradient with white text, white in dark mode. Use it for the one main action of a view, form or dialog.<br>`secondary`: Tactile light button (Figma Button secondary). The default for most actions in forms, toolbars and dialogs.<br>`ghost`: No chrome until hover (Figma Button ghost). Use for icon buttons and dense UI.<br>`destructive`: Irreversible or dangerous actions such as delete or revoke (Figma Button destructive): a red gradient with white text.<br>`warning`: Confirms an action that needs attention but can be undone, such as pause (Figma Button warning): an amber gradient with white text.<br>`wallet`: Express checkout (Apple Pay, Google Pay): the wallet brands' black button, white in dark mode, holding the wallet's `WalletLogo` (20 tall). Name it with `aria-label` ("Pay with Apple Pay"). `WalletButtons` lays out a row of them.<br>`destructive-outline`: Bordered destructive action where a solid red button is too loud, e.g. in a row of actions.<br>`link`: Looks like an inline link (link colour, underlined; the underline turns solid on hover) but behaves as a button. |
|
|
36
36
|
|
|
37
37
|
Also accepts Base UI props: `focusableWhenDisabled`, `nativeButton`, `render`.
|
|
38
38
|
|
|
@@ -69,11 +69,12 @@ The label of the current legend item.
|
|
|
69
69
|
|
|
70
70
|
## LegendMarker
|
|
71
71
|
|
|
72
|
-
The
|
|
72
|
+
The marker of the current legend item: a colour dot, or a small bar for bar charts.
|
|
73
73
|
|
|
74
74
|
| Prop | Type | Default | Description |
|
|
75
75
|
| --- | --- | --- | --- |
|
|
76
76
|
| `className` | `string` | - | Marker size class. Default: "h-2.5 w-2.5" |
|
|
77
|
+
| `variant` | `"dot" \| "bar"` | - | `"dot"`: a dot in the series colour. `"bar"`: a small bar like the tint bars of a `BarChart`, the colour washed into the card with a solid 2px edge on top. Default: "dot" |
|
|
77
78
|
|
|
78
79
|
## LegendProgress
|
|
79
80
|
|
|
@@ -85,6 +86,7 @@ renders nothing when the item has no `maxValue`.
|
|
|
85
86
|
| `height` | `string` | - | Track height. Default: "h-1.5" |
|
|
86
87
|
| `indicatorClassName` | `string` | - | Indicator class name |
|
|
87
88
|
| `trackClassName` | `string` | - | Track class name |
|
|
89
|
+
| `variant` | `"tint" \| "solid"` | - | `"tint"`: the ring chart's look, a light grey `--muted` track, the bar as a 25% wash of the item colour (mixed into the card) and a solid 2px end. `"solid"`: a `bg-muted` track and a bar in the item colour. Default: "solid" |
|
|
88
90
|
|
|
89
91
|
## LegendValue
|
|
90
92
|
|
|
@@ -26,7 +26,7 @@ value; pass `rows` to rename or format them, or `content` to render the whole pa
|
|
|
26
26
|
| `dotScale` | `number` | - | Multiplier applied to the computed dot / ring pixel radius. Default: 1 |
|
|
27
27
|
| `dotSize` | `number` | - | Dot / ring radius in pixels. Default: 5 |
|
|
28
28
|
| `dotStrokeWidth` | `number` | - | Ring stroke width in pixels. Default: 1.5 for ring variant |
|
|
29
|
-
| `dotVariant` | `"
|
|
29
|
+
| `dotVariant` | `"ring" \| "dot"` | - | Dot style: filled circle or transparent ring. Default: "dot" |
|
|
30
30
|
| `indicatorColor` | `string \| ((point: Record<string, unknown>) => string)` | - | Color for the crosshair/indicator line. When a function, receives the hovered point (e.g. to match the series colour of that point). Default: --chart-crosshair. |
|
|
31
31
|
| `indicatorDasharray` | `string` | - | SVG stroke dash pattern for the crosshair. Omit for solid. |
|
|
32
32
|
| `indicatorFadeEdges` | `IndicatorFadeEdges` | - | Vertical crosshair fade: `both`, `top`, `bottom`, or `none` (solid). Default: `both`. |
|
|
@@ -102,7 +102,7 @@ The dot (or ring) that follows the hovered point of one series.
|
|
|
102
102
|
| `springConfig` | `SpringConfig` | - | Per-chart override; falls back to `ChartConfigProvider.tooltipSpring`. |
|
|
103
103
|
| `strokeColor` | `string` | - | |
|
|
104
104
|
| `strokeWidth` | `number` | - | |
|
|
105
|
-
| `variant` | `"
|
|
105
|
+
| `variant` | `"ring" \| "dot"` | - | Dot fill or transparent ring around the hovered mark. Default: "dot" |
|
|
106
106
|
|
|
107
107
|
## ChartTooltipIndicator
|
|
108
108
|
|
|
@@ -52,7 +52,6 @@ lay out the columns; lines and areas are never stacked. Rows need a `Date` under
|
|
|
52
52
|
```tsx
|
|
53
53
|
"use client";
|
|
54
54
|
|
|
55
|
-
import { Area } from "@dodopayments/ui/area-chart";
|
|
56
55
|
import { SeriesBar } from "@dodopayments/ui/bar-chart";
|
|
57
56
|
import { ChartGrid, XAxis } from "@dodopayments/ui/chart";
|
|
58
57
|
import { Legend, LegendItem, LegendLabel, LegendMarker } from "@dodopayments/ui/chart-legend";
|
|
@@ -60,7 +59,7 @@ import { ChartTooltip } from "@dodopayments/ui/chart-tooltip";
|
|
|
60
59
|
import { ComposedChart } from "@dodopayments/ui/composed-chart";
|
|
61
60
|
import { Line } from "@dodopayments/ui/line-chart";
|
|
62
61
|
|
|
63
|
-
// Daily orders (columns), revenue in $K (line) and the 7-day revenue run rate in $K (
|
|
62
|
+
// Daily orders (tinted columns), revenue in $K (line) and the 7-day revenue run rate in $K (dashed grey line).
|
|
64
63
|
const data = Array.from({ length: 30 }, (_, day) => {
|
|
65
64
|
const revenue = 42 + 9 * Math.sin(day / 4) + 0.6 * day + 3 * Math.cos(day * 1.3);
|
|
66
65
|
return {
|
|
@@ -72,9 +71,9 @@ const data = Array.from({ length: 30 }, (_, day) => {
|
|
|
72
71
|
});
|
|
73
72
|
|
|
74
73
|
const legendItems = [
|
|
75
|
-
{ label: "Orders", value: 0, color: "var(--chart-
|
|
74
|
+
{ label: "Orders", value: 0, color: "var(--chart-2)" },
|
|
76
75
|
{ label: "Revenue ($K)", value: 0, color: "var(--chart-1)" },
|
|
77
|
-
{ label: "7-day run rate ($K)", value: 0, color: "var(--chart-
|
|
76
|
+
{ label: "7-day run rate ($K)", value: 0, color: "var(--chart-comparison)" },
|
|
78
77
|
];
|
|
79
78
|
|
|
80
79
|
export default function ComposedChartDefault() {
|
|
@@ -93,8 +92,8 @@ export default function ComposedChartDefault() {
|
|
|
93
92
|
maxBarSize={32}
|
|
94
93
|
>
|
|
95
94
|
<ChartGrid horizontal />
|
|
96
|
-
<
|
|
97
|
-
<
|
|
95
|
+
<SeriesBar dataKey="orders" fill="var(--chart-2)" radius={4} />
|
|
96
|
+
<Line dataKey="runRate" variant="comparison" />
|
|
98
97
|
<Line dataKey="revenue" stroke="var(--chart-1)" />
|
|
99
98
|
<XAxis numTicks={6} />
|
|
100
99
|
<ChartTooltip showCrosshair={false} />
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The Dodo Nest Data table, driven by a TanStack Table v8 instance: the column headers on a grey tray,
|
|
4
4
|
the rows (`size` md 48 / lg 64) on the white panel inside it, skeleton rows while `isLoading`, and
|
|
5
|
-
`emptyMessage` centred in the panel when there are no rows.
|
|
6
|
-
|
|
5
|
+
`emptyMessage` centred in the panel when there are no rows. It keeps the table layout at every width:
|
|
6
|
+
a table wider than its container scrolls sideways (the container is then a tab stop). It sets
|
|
7
7
|
`aria-sort` on sortable headers and marks selected rows `data-state="selected"` (they keep their
|
|
8
8
|
colour; the checkbox shows the selection). Sorting, selection and pagination stay in the table
|
|
9
9
|
instance; pair it with `DataGridColumnHeader`, `DataGridRowSelect(All)` and `DataGridPagination`
|
|
@@ -19,8 +19,8 @@ import { DataGrid, DataGridColumnHeader, DataGridPagination, DataGridRowSelect,
|
|
|
19
19
|
|
|
20
20
|
The Dodo Nest Data table, driven by a TanStack Table v8 instance: the column headers on a grey tray,
|
|
21
21
|
the rows (`size` md 48 / lg 64) on the white panel inside it, skeleton rows while `isLoading`, and
|
|
22
|
-
`emptyMessage` centred in the panel when there are no rows.
|
|
23
|
-
|
|
22
|
+
`emptyMessage` centred in the panel when there are no rows. It keeps the table layout at every width:
|
|
23
|
+
a table wider than its container scrolls sideways (the container is then a tab stop). It sets
|
|
24
24
|
`aria-sort` on sortable headers and marks selected rows `data-state="selected"` (they keep their
|
|
25
25
|
colour; the checkbox shows the selection). Sorting, selection and pagination stay in the table
|
|
26
26
|
instance; pair it with `DataGridColumnHeader`, `DataGridRowSelect(All)` and `DataGridPagination`
|
|
@@ -39,7 +39,7 @@ the selected rows.
|
|
|
39
39
|
| `emptyMessage` | `ReactNode` | `"No data available"` | Shown centred in the panel (48 above and below) when there are no rows: an `Empty`, for no data yet or for no results with a "Clear filters" action. |
|
|
40
40
|
| `formatSortAnnouncement` | `((sort: DataGridSortAnnouncement \| null) => string)` | `(sort) => sort ? `Sorted by ${sort.column}, ${sort.direction}.` : "Sort cleared."` | Text that a polite live region announces after the user changes the sort. `null` means the sort was cleared. |
|
|
41
41
|
| `isLoading` | `boolean` | `false` | Render skeleton rows instead of data and mark the table `aria-busy`. |
|
|
42
|
-
| `layout` | `"table" \| "auto" \| "cards"` |
|
|
42
|
+
| `layout` | `"table" \| "auto" \| "cards"` | - | Chose between the table and the old mobile card list. The table layout is used at every width now (a table wider than its container scrolls sideways), so this has no effect. |
|
|
43
43
|
| `loadingRows` | `number` | - | Number of skeleton rows while loading. Defaults to the current page size. |
|
|
44
44
|
| `onRowClick` | `((row: TData) => void)` | - | Called with the row's original data when a row is clicked or activated with Enter/Space. Makes rows focusable. Clicks on buttons, links, inputs, checkboxes and `[data-no-row-click]` elements inside the row are ignored. |
|
|
45
45
|
| `size` | `"md" \| "lg"` | `"md"` | `md`: 48 rows, for one-line cells (the default).<br>`lg`: 64 rows, for a primary cell with a subtitle, a date with its time or an avatar. |
|
|
@@ -112,14 +112,13 @@ A person: avatar, name and email, 12 apart (.Table cell `avatar`).
|
|
|
112
112
|
|
|
113
113
|
## DataGridCellDate
|
|
114
114
|
|
|
115
|
-
A date with its time under it (.Table cell `date`).
|
|
116
|
-
labelled "Time", under the date's line.
|
|
115
|
+
A date with its time under it (.Table cell `date`).
|
|
117
116
|
|
|
118
117
|
| Prop | Type | Default | Description |
|
|
119
118
|
| --- | --- | --- | --- |
|
|
120
119
|
| `date` (required) | `ReactNode` | - | The date, in Body/Primary. |
|
|
121
120
|
| `time` | `ReactNode` | - | The time under it, in Body/Secondary. |
|
|
122
|
-
| `timeLabel` | `ReactNode` |
|
|
121
|
+
| `timeLabel` | `ReactNode` | - | The label of the time's own line on the old mobile card list. |
|
|
123
122
|
|
|
124
123
|
## DataGridCellPayment
|
|
125
124
|
|
|
@@ -276,7 +275,7 @@ export default function DataGridApiKeys() {
|
|
|
276
275
|
subtitle={row.original.scopes ? row.original.scopes.join(", ") : undefined}
|
|
277
276
|
/>
|
|
278
277
|
),
|
|
279
|
-
meta: { cellClassName: "min-w-40"
|
|
278
|
+
meta: { cellClassName: "min-w-40" },
|
|
280
279
|
},
|
|
281
280
|
{
|
|
282
281
|
accessorKey: "prefix",
|
|
@@ -294,7 +293,6 @@ export default function DataGridApiKeys() {
|
|
|
294
293
|
) : (
|
|
295
294
|
<Badge tone="neutral">Live</Badge>
|
|
296
295
|
),
|
|
297
|
-
meta: { card: "badge" },
|
|
298
296
|
},
|
|
299
297
|
{
|
|
300
298
|
accessorKey: "createdAt",
|
|
@@ -343,7 +341,6 @@ export default function DataGridApiKeys() {
|
|
|
343
341
|
</Menu>
|
|
344
342
|
</DataGridCellActions>
|
|
345
343
|
),
|
|
346
|
-
meta: { card: "actions" },
|
|
347
344
|
},
|
|
348
345
|
];
|
|
349
346
|
|
|
@@ -376,7 +373,6 @@ export default function DataGridApiKeys() {
|
|
|
376
373
|
) : null}
|
|
377
374
|
<DataGrid
|
|
378
375
|
table={table}
|
|
379
|
-
layout="table"
|
|
380
376
|
aria-label="API keys"
|
|
381
377
|
isLoading={loading}
|
|
382
378
|
loadingRows={3}
|
|
@@ -768,7 +764,6 @@ export default function DataGridApiRequests() {
|
|
|
768
764
|
{row.original.method}
|
|
769
765
|
</Button>
|
|
770
766
|
),
|
|
771
|
-
meta: { card: "title" },
|
|
772
767
|
},
|
|
773
768
|
{
|
|
774
769
|
accessorKey: "path",
|
|
@@ -783,7 +778,6 @@ export default function DataGridApiRequests() {
|
|
|
783
778
|
accessorKey: "status",
|
|
784
779
|
header: "Status",
|
|
785
780
|
cell: ({ row }) => <StatusCode status={row.original.status} />,
|
|
786
|
-
meta: { card: "badge" },
|
|
787
781
|
},
|
|
788
782
|
{
|
|
789
783
|
accessorKey: "latencyMs",
|
|
@@ -999,7 +993,7 @@ export default function DataGridBasic() {
|
|
|
999
993
|
<div className="flex items-center justify-between gap-2">
|
|
1000
994
|
<p className="text-muted-foreground text-body-primary">{selected} selected</p>
|
|
1001
995
|
</div>
|
|
1002
|
-
<DataGrid table={table}
|
|
996
|
+
<DataGrid table={table} aria-label="Payments" />
|
|
1003
997
|
<DataGridPagination table={table} />
|
|
1004
998
|
</div>
|
|
1005
999
|
);
|
|
@@ -1077,7 +1071,6 @@ export default function DataGridBulkActions() {
|
|
|
1077
1071
|
<div className="flex w-full min-w-0 flex-col gap-2.5">
|
|
1078
1072
|
<DataGrid
|
|
1079
1073
|
table={table}
|
|
1080
|
-
layout="table"
|
|
1081
1074
|
aria-label="Payouts"
|
|
1082
1075
|
bulkActions={(selection) => (
|
|
1083
1076
|
<Button
|
|
@@ -1169,7 +1162,6 @@ export default function DataGridInvoices() {
|
|
|
1169
1162
|
{row.original.number}
|
|
1170
1163
|
</Button>
|
|
1171
1164
|
),
|
|
1172
|
-
meta: { card: "title" },
|
|
1173
1165
|
},
|
|
1174
1166
|
{
|
|
1175
1167
|
accessorKey: "issuedAt",
|
|
@@ -1187,7 +1179,6 @@ export default function DataGridInvoices() {
|
|
|
1187
1179
|
accessorKey: "status",
|
|
1188
1180
|
header: "Status",
|
|
1189
1181
|
cell: ({ row }) => <Badge kind="invoice" status={row.original.status} />,
|
|
1190
|
-
meta: { card: "badge" },
|
|
1191
1182
|
},
|
|
1192
1183
|
{
|
|
1193
1184
|
id: "download",
|
|
@@ -1340,13 +1331,11 @@ export default function DataGridLicenseKeys() {
|
|
|
1340
1331
|
/>
|
|
1341
1332
|
</div>
|
|
1342
1333
|
),
|
|
1343
|
-
meta: { card: "title" },
|
|
1344
1334
|
},
|
|
1345
1335
|
{
|
|
1346
1336
|
accessorKey: "status",
|
|
1347
1337
|
header: "Status",
|
|
1348
1338
|
cell: ({ row }) => <Badge kind="license" status={row.original.status} />,
|
|
1349
|
-
meta: { card: "badge" },
|
|
1350
1339
|
},
|
|
1351
1340
|
{
|
|
1352
1341
|
id: "activations",
|
|
@@ -1692,7 +1681,6 @@ export default function DataGridLoadingEmpty() {
|
|
|
1692
1681
|
/>
|
|
1693
1682
|
<DataGrid
|
|
1694
1683
|
table={table}
|
|
1695
|
-
layout="table"
|
|
1696
1684
|
aria-label="Payouts"
|
|
1697
1685
|
isLoading={mode === "loading"}
|
|
1698
1686
|
emptyMessage={
|
|
@@ -1753,7 +1741,7 @@ export default function DataGridRowHover() {
|
|
|
1753
1741
|
|
|
1754
1742
|
return (
|
|
1755
1743
|
<div className="flex w-full min-w-0 flex-col gap-2.5">
|
|
1756
|
-
<DataGrid table={table}
|
|
1744
|
+
<DataGrid table={table} aria-label="Customers" />
|
|
1757
1745
|
<DataGridPagination table={table} showRowsPerPage={false} />
|
|
1758
1746
|
</div>
|
|
1759
1747
|
);
|
|
@@ -1830,7 +1818,7 @@ export default function DataGridSortMotion() {
|
|
|
1830
1818
|
getSortedRowModel: getSortedRowModel(),
|
|
1831
1819
|
});
|
|
1832
1820
|
|
|
1833
|
-
return <DataGrid table={table}
|
|
1821
|
+
return <DataGrid table={table} aria-label="Plans" className="w-full max-w-lg" />;
|
|
1834
1822
|
}
|
|
1835
1823
|
```
|
|
1836
1824
|
|
|
@@ -66,7 +66,7 @@ A named shortcut in a range picker's preset list. `range` is evaluated against "
|
|
|
66
66
|
| --- | --- | --- | --- |
|
|
67
67
|
| `label` (required) | `string` | - | Text on the preset button, e.g. "Last 7 days". |
|
|
68
68
|
| `range` (required) | `(today: Date) => CompleteDateRange` | - | Returns the range for the given day. |
|
|
69
|
-
| `messageKey` | `"search" \| "clear" \| "loading" \| "next" \| "cardFieldLabel" \| "cardFieldNumber" \| "cardFieldExpiry" \| "cardFieldCvc" \| "cardFieldName" \| "cardFieldNumberError" \| "cardFieldExpiryError" \| "cardFieldCvcError" \| "cardFieldNameError" \| "billingActionFailed" \| "close" \| "dismiss" \| "spinnerLabel" \| "remove" \| "removeItem" \| "confirm" \| "cancel" \| "retry" \| "tryAgain" \| "back" \| "more" \| "showMore" \| "showLess" \| "selectEmpty" \| "copied" \| "copyFailed" \| "copyToClipboard" \| "loadMoreError" \| "activityTimelineLoading" \| "activityTimelineEmptyTitle" \| "activityTimelineEmptyDescription" \| "activityTimelineErrorTitle" \| "activityTimelineErrorDescription" \| "activityTimelineEnd" \| "autocompleteShowSuggestions" \| "comboboxShowOptions" \| "breadcrumbLabel" \| "codeBlockCopy" \| "codeBlockLabel" \| "dataGridSelectRow" \| "dataGridSelectAll" \| "dataGridSortBy" \| "dataGridSortAscending" \| "dataGridSortDescending" \| "dataGridTime" \| "datePresetToday" \| "datePresetYesterday" \| "datePresetLast7Days" \| "datePresetLast30Days" \| "datePresetThisWeek" \| "datePresetThisMonth" \| "datePresetLastMonth" \| "datePresetMonthToDate" \| "datePresetYearToDate" \| "datePresetLastYear" \| "dateRangeTitle" \| "dateRangePresets" \| "datePickerTitle" \| "datePickerReset" \| "datePickerApply" \| "datePickerStartDate" \| "datePickerEndDate" \| "dateFilterPlaceholder" \| "dateFilterClear" \| "loadMore" \| "loadMoreEnd" \| "paginationLabel" \| "paginationPrevious" \| "paginationNext" \| "paginationFirst" \| "paginationLast" \| "paginationPage" \| "tablePaginationRowsPerPage" \| "tablePaginationViewing" \| "secretFieldReveal" \| "secretFieldCopy" \| "secretFieldRemasked" \| "showMoreLabel" \| "sidebarTitle" \| "sidebarToggle" \| "sidebarCollapse" \| "sidebarExpand" \| "sidebarMode" \| "sidebarModeTest" \| "sidebarModeLive" \| "sidebarSwitchToLive" \| "sidebarSwitchToTest" \| "inputCopy" \| "sheetProgress" \| "statCardIncreased" \| "statCardDecreased" \| "statCardInfo" \| "statCardError" \| "statCardEmpty" \| "timestampUtc" \| "timestampRelative" \| "timestampTimestamp" \| "wizardStepsLabel" \| "wizardStepsPosition" \| "progressStep" \| "wizardStepsFinish" \| "wizardStepsComplete" \| "wizardStepsCompleteHint" \| "prorationPreviewLabel" \| "prorationPreviewCurrentPlan" \| "prorationPreviewNewPlan" \| "prorationPreviewCredit" \| "prorationPreviewCharge" \| "prorationPreviewDueToday" \| "prorationPreviewNextInvoice" \| "prorationPreviewEffectiveNow" \| "prorationPreviewEffectivePeriodEnd" \| "codeTabsLabel" \| "walletButtonsPayWith" \| "walletButtonsDivider"` | - | Built-in message that translates `label` under a `LocaleProvider` while `label` is still that message's English default. Custom presets leave it out and show `label` as given; a built-in preset you relabel (`{ ...preset, label: "Past week" }`) shows its new `label` too. |
|
|
69
|
+
| `messageKey` | `"search" \| "clear" \| "loading" \| "next" \| "cardFieldLabel" \| "cardFieldNumber" \| "cardFieldExpiry" \| "cardFieldCvc" \| "cardFieldName" \| "cardFieldNumberError" \| "cardFieldExpiryError" \| "cardFieldCvcError" \| "cardFieldNameError" \| "billingActionFailed" \| "close" \| "dismiss" \| "spinnerLabel" \| "remove" \| "removeItem" \| "confirm" \| "cancel" \| "retry" \| "tryAgain" \| "back" \| "more" \| "showMore" \| "showLess" \| "selectEmpty" \| "copied" \| "copyFailed" \| "copyToClipboard" \| "loadMoreError" \| "activityTimelineLoading" \| "activityTimelineEmptyTitle" \| "activityTimelineEmptyDescription" \| "activityTimelineErrorTitle" \| "activityTimelineErrorDescription" \| "activityTimelineEnd" \| "autocompleteShowSuggestions" \| "comboboxShowOptions" \| "breadcrumbLabel" \| "codeBlockCopy" \| "codeBlockLabel" \| "dataGridSelectRow" \| "dataGridSelectAll" \| "dataGridSortBy" \| "dataGridSortAscending" \| "dataGridSortDescending" \| "dataGridTime" \| "datePresetToday" \| "datePresetYesterday" \| "datePresetLast7Days" \| "datePresetLast30Days" \| "datePresetThisWeek" \| "datePresetThisMonth" \| "datePresetLastMonth" \| "datePresetMonthToDate" \| "datePresetYearToDate" \| "datePresetLastYear" \| "dateRangeTitle" \| "dateRangePresets" \| "datePickerTitle" \| "datePickerReset" \| "datePickerApply" \| "datePickerStartDate" \| "datePickerEndDate" \| "dateFilterPlaceholder" \| "dateFilterClear" \| "loadMore" \| "loadMoreEnd" \| "paginationLabel" \| "paginationPrevious" \| "paginationNext" \| "paginationFirst" \| "paginationLast" \| "paginationPage" \| "tablePaginationRowsPerPage" \| "tablePaginationViewing" \| "secretFieldReveal" \| "secretFieldCopy" \| "secretFieldRemasked" \| "showMoreLabel" \| "sidebarTitle" \| "sidebarToggle" \| "sidebarCollapse" \| "sidebarExpand" \| "sidebarMode" \| "sidebarModeTest" \| "sidebarModeLive" \| "sidebarSwitchToLive" \| "sidebarSwitchToTest" \| "inputCopy" \| "sheetProgress" \| "statCardIncreased" \| "statCardDecreased" \| "statCardInfo" \| "statCardError" \| "statCardEmpty" \| "statCardNoChange" \| "timestampUtc" \| "timestampRelative" \| "timestampTimestamp" \| "wizardStepsLabel" \| "wizardStepsPosition" \| "progressStep" \| "wizardStepsFinish" \| "wizardStepsComplete" \| "wizardStepsCompleteHint" \| "prorationPreviewLabel" \| "prorationPreviewCurrentPlan" \| "prorationPreviewNewPlan" \| "prorationPreviewCredit" \| "prorationPreviewCharge" \| "prorationPreviewDueToday" \| "prorationPreviewNextInvoice" \| "prorationPreviewEffectiveNow" \| "prorationPreviewEffectivePeriodEnd" \| "codeTabsLabel" \| "walletButtonsPayWith" \| "walletButtonsDivider"` | - | Built-in message that translates `label` under a `LocaleProvider` while `label` is still that message's English default. Custom presets leave it out and show `label` as given; a built-in preset you relabel (`{ ...preset, label: "Past week" }`) shows its new `label` too. |
|
|
70
70
|
|
|
71
71
|
## Examples
|
|
72
72
|
|
|
@@ -196,7 +196,7 @@ export default function DetailsPanelRows() {
|
|
|
196
196
|
label: "Minimum payout",
|
|
197
197
|
value: "$50.00",
|
|
198
198
|
action: (
|
|
199
|
-
<Button variant="
|
|
199
|
+
<Button variant="link" size="xs" aria-label="Edit minimum payout">
|
|
200
200
|
Edit
|
|
201
201
|
</Button>
|
|
202
202
|
),
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Drop-off through the stages of a flow (visited, started checkout, paid), on the bklit
|
|
4
4
|
`FunnelChart` primitive. `data` is a list of `{ label, value, displayValue?, color?, gradient? }`,
|
|
5
5
|
first stage first; each segment is sized as a share of the first stage and shows its value, a
|
|
6
|
-
percentage
|
|
6
|
+
percentage chip and the stage label, and each boundary shows the step conversion ("→ 54%") from the
|
|
7
|
+
stage before. Segments use the tint look of the other charts (a 20% wash with a solid 2px edge on the
|
|
8
|
+
outer sides); `variant="solid"` draws the full colour as `layers` halo rings. Segments grow in with a stagger on mount; hovering one dims
|
|
7
9
|
the others. `orientation="vertical"` stacks the stages top to bottom; `grid` adds background bands
|
|
8
10
|
and divider lines. Height comes from the aspect ratio unless a class sets it. It has no loading
|
|
9
11
|
state and renders an empty frame when `data` is empty.
|
|
@@ -17,7 +19,9 @@ import { FunnelChart } from "@dodopayments/ui/funnel-chart";
|
|
|
17
19
|
Drop-off through the stages of a flow (visited, started checkout, paid), on the bklit
|
|
18
20
|
`FunnelChart` primitive. `data` is a list of `{ label, value, displayValue?, color?, gradient? }`,
|
|
19
21
|
first stage first; each segment is sized as a share of the first stage and shows its value, a
|
|
20
|
-
percentage
|
|
22
|
+
percentage chip and the stage label, and each boundary shows the step conversion ("→ 54%") from the
|
|
23
|
+
stage before. Segments use the tint look of the other charts (a 20% wash with a solid 2px edge on the
|
|
24
|
+
outer sides); `variant="solid"` draws the full colour as `layers` halo rings. Segments grow in with a stagger on mount; hovering one dims
|
|
21
25
|
the others. `orientation="vertical"` stacks the stages top to bottom; `grid` adds background bands
|
|
22
26
|
and divider lines. Height comes from the aspect ratio unless a class sets it. It has no loading
|
|
23
27
|
state and renders an empty frame when `data` is empty.
|
|
@@ -28,8 +32,10 @@ state and renders an empty frame when `data` is empty.
|
|
|
28
32
|
| `label` (required) | `string` | - | Accessible name of the chart, e.g. "Checkout funnel, last 30 days". Set as `aria-label` on the `role="figure"` frame. The stage values, percentages and labels stay in the page as text. |
|
|
29
33
|
| `className` | `string` | - | Additional Tailwind classes, merged last. |
|
|
30
34
|
| `color` | `string` | - | |
|
|
35
|
+
| `conversionLabel` | `string` | - | Screen reader text after the step conversion. Default "of the previous stage" |
|
|
31
36
|
| `edges` | `"curved" \| "straight"` | - | Edge style for the funnel segments. Default "curved" |
|
|
32
37
|
| `enterTransition` | `Transition` | - | Framer Motion transition for segment enter animation |
|
|
38
|
+
| `formatConversion` | `((pct: number) => string)` | - | Formats the step conversion (0–100). Default: a rounded percentage |
|
|
33
39
|
| `formatPercentage` | `((pct: number) => string)` | - | |
|
|
34
40
|
| `formatValue` | `((value: number) => string)` | - | |
|
|
35
41
|
| `gap` | `number` | - | Gap between segments in pixels. Default 4 |
|
|
@@ -38,14 +44,16 @@ state and renders an empty frame when `data` is empty.
|
|
|
38
44
|
| `labelAlign` | `"center" \| "end" \| "start"` | - | Where the label group sits within the segment cell. - "center" (default), "start", "end" For horizontal funnel: start=top, end=bottom. For vertical funnel: start=left, end=right. |
|
|
39
45
|
| `labelLayout` | `"spread" \| "grouped"` | - | Controls how segment labels (value, percentage, stage name) are arranged. - "spread": Value/percentage/label are spread apart (top/center/bottom for horizontal, left/center/right for vertical). This is the default. - "grouped": All label items stack together in a tight group. When "grouped", use `labelOrientation` and `labelAlign` for full control. |
|
|
40
46
|
| `labelOrientation` | `"vertical" \| "horizontal"` | - | Stack direction of the label group. Only applies when `labelLayout="grouped"`. - "vertical": Items stack top-to-bottom. Default for horizontal funnels. - "horizontal": Items stack left-to-right. Default for vertical funnels. |
|
|
41
|
-
| `layers` | `number` | - |
|
|
47
|
+
| `layers` | `number` | - | Halo rings of the `"solid"` look. Default 3 |
|
|
42
48
|
| `onHoverChange` | `((index: number \| null) => void)` | - | Callback when hover state changes |
|
|
43
49
|
| `orientation` | `"vertical" \| "horizontal"` | - | |
|
|
44
50
|
| `renderPattern` | `((id: string, color: string) => ReactNode)` | - | Render a visx pattern definition. Receives a unique `id` string per segment and the resolved `color`. Return a `<PatternLines>` (or any visx pattern) inside an SVG `<defs>`. The component will use `fill="url(#id)"` on the innermost ring while keeping outer halo rings as solid color. |
|
|
51
|
+
| `showConversion` | `boolean` | - | Show each stage's conversion from the stage before it ("→ 54%") on the boundary between them, in the value row. Hidden when the segments are too narrow to fit it. Default true |
|
|
45
52
|
| `showLabels` | `boolean` | - | |
|
|
46
53
|
| `showPercentage` | `boolean` | - | |
|
|
47
54
|
| `showValues` | `boolean` | - | |
|
|
48
55
|
| `staggerDelay` | `number` | - | Stagger delay between segments in seconds. Default 0.12 |
|
|
56
|
+
| `variant` | `"tint" \| "solid"` | - | `"tint"`: the radar look of the other charts, each segment an opaque 20% wash of its colour (mixed into the card) with a solid 2px edge along its outer sides. `"solid"`: the full colour drawn as `layers` nested halo rings. A `renderPattern` fill stays solid. Default: "tint" |
|
|
49
57
|
|
|
50
58
|
## Examples
|
|
51
59
|
|
|
@@ -88,7 +96,7 @@ const payouts: FunnelStage[] = [
|
|
|
88
96
|
value: 980,
|
|
89
97
|
gradient: [
|
|
90
98
|
{ offset: 0, color: "var(--chart-3)" },
|
|
91
|
-
{ offset: 1, color: "var(--chart-
|
|
99
|
+
{ offset: 1, color: "var(--chart-5)" },
|
|
92
100
|
],
|
|
93
101
|
},
|
|
94
102
|
];
|
|
@@ -98,7 +106,6 @@ export default function FunnelChartColors() {
|
|
|
98
106
|
<FunnelChart
|
|
99
107
|
data={payouts}
|
|
100
108
|
label="Payouts through review, this month"
|
|
101
|
-
layers={2}
|
|
102
109
|
formatValue={(value) => compact.format(value)}
|
|
103
110
|
formatPercentage={(pct) => `${pct.toFixed(1)}%`}
|
|
104
111
|
/>
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
One value from 0 to 100 as a row of notches, around an arc (default) or along a horizontal track
|
|
4
4
|
(`orientation="linear"`), on the bklit `Gauge` primitive. `value` sets how many notches fill.
|
|
5
5
|
`centerValue` adds an optional animated statistic with a `defaultLabel` caption: in the arc
|
|
6
|
-
centre, or above / below the linear track (`labelPlacement`, `labelAlign`).
|
|
6
|
+
centre, or above / below the linear track (`labelPlacement`, `labelAlign`). Filled notches use the
|
|
7
|
+
tint look of the other charts (a 20% wash with a solid 3px outer edge); `variant="solid"` fills
|
|
8
|
+
them with the full colour. Set `useGradient` for
|
|
7
9
|
a colour ramp across the notches, or pass `PatternLines` / `LinearGradient` children and point
|
|
8
10
|
`activeFill` / `inactiveFill` at them with `url(#id)`. The plot is a `role="meter"` with
|
|
9
11
|
`aria-valuenow`. Notches pop in on mount (instant under reduced motion). It has no loading or
|
|
@@ -18,7 +20,9 @@ import { GaugeChart } from "@dodopayments/ui/gauge-chart";
|
|
|
18
20
|
One value from 0 to 100 as a row of notches, around an arc (default) or along a horizontal track
|
|
19
21
|
(`orientation="linear"`), on the bklit `Gauge` primitive. `value` sets how many notches fill.
|
|
20
22
|
`centerValue` adds an optional animated statistic with a `defaultLabel` caption: in the arc
|
|
21
|
-
centre, or above / below the linear track (`labelPlacement`, `labelAlign`).
|
|
23
|
+
centre, or above / below the linear track (`labelPlacement`, `labelAlign`). Filled notches use the
|
|
24
|
+
tint look of the other charts (a 20% wash with a solid 3px outer edge); `variant="solid"` fills
|
|
25
|
+
them with the full colour. Set `useGradient` for
|
|
22
26
|
a colour ramp across the notches, or pass `PatternLines` / `LinearGradient` children and point
|
|
23
27
|
`activeFill` / `inactiveFill` at them with `url(#id)`. The plot is a `role="meter"` with
|
|
24
28
|
`aria-valuenow`. Notches pop in on mount (instant under reduced motion). It has no loading or
|
|
@@ -59,6 +63,7 @@ empty state.
|
|
|
59
63
|
| `totalNotches` | `number` | - | Number of notches |
|
|
60
64
|
| `uniformWidth` | `boolean` | - | `true` = rectangular notches; `false` = tapered toward center / midline |
|
|
61
65
|
| `useGradient` | `boolean` | - | |
|
|
66
|
+
| `variant` | `"tint" \| "solid"` | - | `"tint"`: the radar look of the other charts, each filled notch an opaque 20% wash of its colour (mixed into the card) with a solid 3px edge on its outer side. `"solid"`: the full colour. A gradient or pattern `activeFill` (`url(#id)`) and the theme palette gradient stay solid. Default: "tint" |
|
|
62
67
|
| `width` | `number` | - | |
|
|
63
68
|
|
|
64
69
|
## Examples
|
|
@@ -103,7 +108,7 @@ export default function GaugeChartGradient() {
|
|
|
103
108
|
defaultLabel="Auth rate"
|
|
104
109
|
formatOptions={{ style: "percent", maximumFractionDigits: 0 }}
|
|
105
110
|
useGradient
|
|
106
|
-
activeGradient={["var(--chart-2)", "var(--chart-
|
|
111
|
+
activeGradient={["var(--chart-2)", "var(--chart-3)"]}
|
|
107
112
|
inactiveFillOpacity={0.4}
|
|
108
113
|
minWidth={240}
|
|
109
114
|
/>
|
|
@@ -159,7 +164,7 @@ export default function GaugeChartLinear() {
|
|
|
159
164
|
totalNotches={50}
|
|
160
165
|
spacing={0}
|
|
161
166
|
notchCornerRadius={3}
|
|
162
|
-
activeFill="var(--chart-
|
|
167
|
+
activeFill="var(--chart-2)"
|
|
163
168
|
inactiveFillOpacity={0.4}
|
|
164
169
|
/>
|
|
165
170
|
</div>
|
|
@@ -186,6 +186,7 @@ with the chart, dim while the chart is hovered, and enlarge the hovered point.
|
|
|
186
186
|
| `showActiveHighlight` | `boolean` | - | Enlarge the active point while hovering. Default: true |
|
|
187
187
|
| `stroke` | `string` | - | Outer ring stroke color. Default: same as `fill` |
|
|
188
188
|
| `strokeWidth` | `number` | - | Outer ring stroke width in px. Default: 2. Set to 0 to disable. |
|
|
189
|
+
| `tint` | `boolean` | - | Paint each marker as an opaque wash of its colour (20%, mixed into the card) inside a solid ring, with no gap: the look of the tint bars. `fill` (or the series colour) is the colour; `stroke` overrides the ring. Default: false |
|
|
189
190
|
|
|
190
191
|
## SeriesPointMarker
|
|
191
192
|
|