@designa8/vibedesign-stripe-deepseek-85ea 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +927 -861
- package/dist/index.js +929 -863
- package/dist/styles.css +10 -0
- package/package.json +6 -1
- package/src/atoms/DataTable/DataTable.tsx +8 -0
- package/src/atoms/DataTable/preview.tsx +43 -0
- package/src/atoms/DataTableDesktop/DataTableDesktop.tsx +95 -80
- package/src/atoms/DataTableMobile/DataTableMobile.tsx +90 -70
- package/src/atoms/Icon/icons.data.ts +1 -0
- package/src/atoms/Panel/Panel.tsx +102 -0
- package/src/atoms/Panel/index.ts +2 -0
- package/src/atoms/Panel/preview.tsx +196 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Panel } from "./Panel";
|
|
3
|
+
import { Button } from "../Button";
|
|
4
|
+
import { ButtonGroup } from "../ButtonGroup";
|
|
5
|
+
import { Badge } from "../Badge";
|
|
6
|
+
import { Checkbox } from "../Checkbox";
|
|
7
|
+
import { Icon } from "../Icon";
|
|
8
|
+
import { CashFlowChart } from "../CashFlowChart";
|
|
9
|
+
|
|
10
|
+
const accounts = [
|
|
11
|
+
{
|
|
12
|
+
icon: "wallet",
|
|
13
|
+
name: "Atlas Commerce",
|
|
14
|
+
kind: "Business account",
|
|
15
|
+
amount: "$24,800.00",
|
|
16
|
+
delta: "+6.2%",
|
|
17
|
+
tone: "success" as const,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
icon: "layers",
|
|
21
|
+
name: "Nimbus Pay",
|
|
22
|
+
kind: "Payment account",
|
|
23
|
+
amount: "$8,420.50",
|
|
24
|
+
delta: "−2.4%",
|
|
25
|
+
tone: "error" as const,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
icon: "building",
|
|
29
|
+
name: "Vertex Bank",
|
|
30
|
+
kind: "Settlement account",
|
|
31
|
+
amount: "$102,309.00",
|
|
32
|
+
delta: "+3.8%",
|
|
33
|
+
tone: "success" as const,
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const cashFlow = [
|
|
38
|
+
{ label: "Jan", moneyIn: 61000, moneyOut: 42000 },
|
|
39
|
+
{ label: "Feb", moneyIn: 82000, moneyOut: 57000 },
|
|
40
|
+
{ label: "Mar", moneyIn: 74000, moneyOut: 51000 },
|
|
41
|
+
{ label: "Apr", moneyIn: 91000, moneyOut: 63000 },
|
|
42
|
+
{ label: "May", moneyIn: 113000, moneyOut: 71000 },
|
|
43
|
+
{ label: "Jun", moneyIn: 121000, moneyOut: 78000 },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const tasks = [
|
|
47
|
+
{ id: "payouts", label: "Review pending payouts", due: "Today" },
|
|
48
|
+
{ id: "confirm", label: "Confirm new account", due: "Jun 28" },
|
|
49
|
+
{ id: "routing", label: "Update routing rules", due: "Jun 30" },
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
export default function PanelPreview() {
|
|
53
|
+
const [range, setRange] = React.useState("3m");
|
|
54
|
+
const [checked, setChecked] = React.useState<Record<string, boolean>>({
|
|
55
|
+
payouts: false,
|
|
56
|
+
confirm: true,
|
|
57
|
+
routing: false,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const done = Object.values(checked).filter(Boolean).length;
|
|
61
|
+
const open = tasks.length - done;
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div className="w-full max-w-5xl mx-auto p-lg">
|
|
65
|
+
<div className="grid grid-cols-1 gap-lg lg:grid-cols-2">
|
|
66
|
+
{/* Header with a caption, a segmented range toggle, and a list body. */}
|
|
67
|
+
<Panel
|
|
68
|
+
title="Accounts"
|
|
69
|
+
meta="3 accounts"
|
|
70
|
+
actions={
|
|
71
|
+
<div className="w-40">
|
|
72
|
+
<ButtonGroup
|
|
73
|
+
label="Accounts range"
|
|
74
|
+
size="sm"
|
|
75
|
+
value={range}
|
|
76
|
+
onValueChange={setRange}
|
|
77
|
+
options={[
|
|
78
|
+
{ value: "1m", label: "1M" },
|
|
79
|
+
{ value: "3m", label: "3M" },
|
|
80
|
+
{ value: "1y", label: "1Y" },
|
|
81
|
+
]}
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
}
|
|
85
|
+
>
|
|
86
|
+
{accounts.map((account) => (
|
|
87
|
+
<div
|
|
88
|
+
key={account.name}
|
|
89
|
+
className="flex min-w-0 items-center justify-between gap-md rounded-lg border border-hairline bg-canvas px-md py-sm transition-colors duration-150 ease-out hover:border-hairline-strong hover:bg-surface-soft"
|
|
90
|
+
>
|
|
91
|
+
<div className="flex min-w-0 items-center gap-md">
|
|
92
|
+
<span className="flex size-10 shrink-0 items-center justify-center rounded-md bg-primary-subdued text-primary-on-subdued">
|
|
93
|
+
<Icon name={account.icon} size={18} />
|
|
94
|
+
</span>
|
|
95
|
+
<span className="flex min-w-0 flex-col">
|
|
96
|
+
<span className="truncate text-body-md text-ink">
|
|
97
|
+
{account.name}
|
|
98
|
+
</span>
|
|
99
|
+
<span className="truncate text-caption text-muted">
|
|
100
|
+
{account.kind}
|
|
101
|
+
</span>
|
|
102
|
+
</span>
|
|
103
|
+
</div>
|
|
104
|
+
<span className="flex shrink-0 items-center gap-sm">
|
|
105
|
+
<span className="text-body-tabular text-ink">
|
|
106
|
+
{account.amount}
|
|
107
|
+
</span>
|
|
108
|
+
<Badge
|
|
109
|
+
variant="soft"
|
|
110
|
+
tone={account.tone}
|
|
111
|
+
size="sm"
|
|
112
|
+
showDot={false}
|
|
113
|
+
>
|
|
114
|
+
{account.delta}
|
|
115
|
+
</Badge>
|
|
116
|
+
</span>
|
|
117
|
+
</div>
|
|
118
|
+
))}
|
|
119
|
+
</Panel>
|
|
120
|
+
|
|
121
|
+
{/* Caption on the right, a data body with its own legend. */}
|
|
122
|
+
<Panel title="Cash flow" meta="Updated 9:41">
|
|
123
|
+
<CashFlowChart points={cashFlow} />
|
|
124
|
+
</Panel>
|
|
125
|
+
|
|
126
|
+
{/* Live checkbox body — the caption follows the checked count. */}
|
|
127
|
+
<Panel title="Tasks" meta={`${open} open`}>
|
|
128
|
+
{tasks.map((task) => (
|
|
129
|
+
<div
|
|
130
|
+
key={task.id}
|
|
131
|
+
className="flex min-w-0 items-center justify-between gap-md rounded-lg border border-hairline bg-canvas px-md py-xs transition-colors duration-150 ease-out hover:border-hairline-strong"
|
|
132
|
+
>
|
|
133
|
+
<Checkbox
|
|
134
|
+
chrome="bare"
|
|
135
|
+
size="sm"
|
|
136
|
+
label={task.label}
|
|
137
|
+
checked={checked[task.id]}
|
|
138
|
+
onChange={(next) =>
|
|
139
|
+
setChecked((prev) => ({ ...prev, [task.id]: next }))
|
|
140
|
+
}
|
|
141
|
+
/>
|
|
142
|
+
<Badge variant="soft" tone="neutral" size="sm" showDot={false}>
|
|
143
|
+
{task.due}
|
|
144
|
+
</Badge>
|
|
145
|
+
</div>
|
|
146
|
+
))}
|
|
147
|
+
</Panel>
|
|
148
|
+
|
|
149
|
+
{/* Empty body: muted centred copy and one quiet action. */}
|
|
150
|
+
<Panel title="Insights" headingLevel={3}>
|
|
151
|
+
<div className="flex flex-col items-center gap-md py-xxl text-center">
|
|
152
|
+
<span className="flex size-12 items-center justify-center rounded-lg bg-primary-subdued text-primary-on-subdued">
|
|
153
|
+
<Icon name="chart-column" size={20} />
|
|
154
|
+
</span>
|
|
155
|
+
<span className="flex flex-col gap-xs">
|
|
156
|
+
<span className="text-body-md text-ink">No insights yet</span>
|
|
157
|
+
<span className="text-caption text-muted">
|
|
158
|
+
Run an analysis to see trends and opportunities.
|
|
159
|
+
</span>
|
|
160
|
+
</span>
|
|
161
|
+
<Button variant="outline-brand" size="sm">
|
|
162
|
+
Run analysis
|
|
163
|
+
</Button>
|
|
164
|
+
</div>
|
|
165
|
+
</Panel>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
{/* Error body: the surface stays calm, the callout carries the tone. */}
|
|
169
|
+
<div className="mt-lg">
|
|
170
|
+
<Panel title="Data sync" meta="Last attempt 9:41" headingLevel={3}>
|
|
171
|
+
<div className="flex flex-col items-center gap-md rounded-lg bg-semantic-error-soft p-lg text-center">
|
|
172
|
+
<span className="flex size-10 items-center justify-center rounded-full bg-canvas text-semantic-error">
|
|
173
|
+
<Icon name="triangle" size={18} />
|
|
174
|
+
</span>
|
|
175
|
+
<span className="flex flex-col gap-xs">
|
|
176
|
+
<span className="text-body-md text-semantic-error">
|
|
177
|
+
Couldn’t load data
|
|
178
|
+
</span>
|
|
179
|
+
<span className="text-caption text-muted">
|
|
180
|
+
We weren’t able to fetch the latest information. Please try
|
|
181
|
+
again.
|
|
182
|
+
</span>
|
|
183
|
+
</span>
|
|
184
|
+
<Button
|
|
185
|
+
variant="outline-brand"
|
|
186
|
+
size="sm"
|
|
187
|
+
leadingIcon={<Icon name="refresh-cw" size={16} />}
|
|
188
|
+
>
|
|
189
|
+
Try again
|
|
190
|
+
</Button>
|
|
191
|
+
</div>
|
|
192
|
+
</Panel>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
);
|
|
196
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from "./atoms/NavigationMenuMobile";
|
|
|
58
58
|
export * from "./atoms/NodeConfigPanel";
|
|
59
59
|
export * from "./atoms/NotificationFeed";
|
|
60
60
|
export * from "./atoms/Pagination";
|
|
61
|
+
export * from "./atoms/Panel";
|
|
61
62
|
export * from "./atoms/PaymentRoutingCanvas";
|
|
62
63
|
export * from "./atoms/PricingTable";
|
|
63
64
|
export * from "./atoms/PricingTableDesktop";
|