@wealthx/shadcn 1.5.43 → 1.5.44
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/.turbo/turbo-build.log +82 -82
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-3G6JUYRE.mjs → chunk-7RMXM5O6.mjs} +1 -1
- package/dist/components/ui/category-edit-dialog.js +1 -1
- package/dist/components/ui/category-edit-dialog.mjs +1 -1
- package/dist/components/ui/dashboard-expense-categories.js +4 -4
- package/dist/components/ui/dashboard-expense-categories.mjs +4 -4
- package/dist/components/ui/dashboard-transactions-table.js +51 -34
- package/dist/components/ui/dashboard-transactions-table.mjs +51 -34
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ui/category-edit-dialog.tsx +1 -1
- package/src/components/ui/dashboard-expense-categories.tsx +4 -4
- package/src/components/ui/dashboard-transactions-table.tsx +41 -19
- package/src/styles/styles-css.ts +1 -1
package/package.json
CHANGED
|
@@ -89,7 +89,7 @@ function CategoryRow({
|
|
|
89
89
|
isSelected && "bg-primary/10",
|
|
90
90
|
)}
|
|
91
91
|
>
|
|
92
|
-
<ItemIcon icon={icon} active={
|
|
92
|
+
<ItemIcon icon={icon} active={false} />
|
|
93
93
|
<span className="flex-1">{name}</span>
|
|
94
94
|
{isSelected && <Check className="size-3.5 shrink-0 text-primary" />}
|
|
95
95
|
</button>
|
|
@@ -106,7 +106,7 @@ function SubCategoryRow({
|
|
|
106
106
|
: undefined
|
|
107
107
|
}
|
|
108
108
|
>
|
|
109
|
-
<div className="flex items-center justify-between gap-2 text-
|
|
109
|
+
<div className="flex items-center justify-between gap-2 text-sm">
|
|
110
110
|
<div className="flex min-w-0 items-center gap-1">
|
|
111
111
|
<span
|
|
112
112
|
className={cn(
|
|
@@ -222,7 +222,7 @@ function CategoryRow({
|
|
|
222
222
|
<div className="min-w-0 flex-1">
|
|
223
223
|
<div className="flex items-center justify-between gap-2">
|
|
224
224
|
<div className="flex min-w-0 items-center gap-1">
|
|
225
|
-
<span className="truncate text-
|
|
225
|
+
<span className="truncate text-base font-medium text-foreground">
|
|
226
226
|
{item.name}
|
|
227
227
|
</span>
|
|
228
228
|
{/* Filter icon — only this triggers the category filter */}
|
|
@@ -247,10 +247,10 @@ function CategoryRow({
|
|
|
247
247
|
</button>
|
|
248
248
|
</div>
|
|
249
249
|
<div className="flex shrink-0 items-center gap-2">
|
|
250
|
-
<span className="text-
|
|
250
|
+
<span className="text-sm text-muted-foreground">
|
|
251
251
|
{item.pct.toFixed(0)}%
|
|
252
252
|
</span>
|
|
253
|
-
<span className="text-
|
|
253
|
+
<span className="text-base font-semibold text-foreground">
|
|
254
254
|
{formatCurrency(item.amount)}
|
|
255
255
|
</span>
|
|
256
256
|
</div>
|
|
@@ -59,7 +59,7 @@ export interface DashboardTransactionsTableProps {
|
|
|
59
59
|
applyToFuture: boolean,
|
|
60
60
|
) => void;
|
|
61
61
|
/**
|
|
62
|
-
* Show or hide the card header (title +
|
|
62
|
+
* Show or hide the card header (title + tab row).
|
|
63
63
|
* Set to `false` when the surrounding layout already provides context.
|
|
64
64
|
* Defaults to `true`.
|
|
65
65
|
*/
|
|
@@ -70,6 +70,12 @@ export interface DashboardTransactionsTableProps {
|
|
|
70
70
|
* Defaults to `true`.
|
|
71
71
|
*/
|
|
72
72
|
showTab?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Colour scheme for the editable category chip hover state.
|
|
75
|
+
* - `"primary"` (default) — green hover
|
|
76
|
+
* - `"secondary"` — dark navy hover; use when the surrounding context uses the secondary palette (e.g. expense view)
|
|
77
|
+
*/
|
|
78
|
+
colorScheme?: "primary" | "secondary";
|
|
73
79
|
}
|
|
74
80
|
|
|
75
81
|
// ─── Category chip ────────────────────────────────────────────────────────────
|
|
@@ -77,10 +83,12 @@ export interface DashboardTransactionsTableProps {
|
|
|
77
83
|
function CategoryChip({
|
|
78
84
|
label,
|
|
79
85
|
canEdit,
|
|
86
|
+
colorScheme = "primary",
|
|
80
87
|
onClick,
|
|
81
88
|
}: {
|
|
82
89
|
label: string;
|
|
83
90
|
canEdit: boolean;
|
|
91
|
+
colorScheme?: "primary" | "secondary";
|
|
84
92
|
onClick?: () => void;
|
|
85
93
|
}) {
|
|
86
94
|
if (canEdit) {
|
|
@@ -88,7 +96,12 @@ function CategoryChip({
|
|
|
88
96
|
<Badge
|
|
89
97
|
asChild
|
|
90
98
|
variant="secondary"
|
|
91
|
-
className=
|
|
99
|
+
className={cn(
|
|
100
|
+
"cursor-pointer transition-colors",
|
|
101
|
+
colorScheme === "secondary"
|
|
102
|
+
? "hover:bg-brand-secondary/10 hover:text-[var(--brand-secondary)]"
|
|
103
|
+
: "hover:border-primary/40 hover:bg-primary/10 hover:text-primary",
|
|
104
|
+
)}
|
|
92
105
|
>
|
|
93
106
|
<button type="button" onClick={onClick}>
|
|
94
107
|
{label}
|
|
@@ -105,27 +118,36 @@ function CategoryChip({
|
|
|
105
118
|
|
|
106
119
|
function TransactionRow({
|
|
107
120
|
tx,
|
|
121
|
+
isDimmed,
|
|
108
122
|
canEdit,
|
|
123
|
+
colorScheme = "primary",
|
|
109
124
|
onChipClick,
|
|
110
125
|
}: {
|
|
111
126
|
tx: DashboardTransaction;
|
|
127
|
+
isDimmed: boolean;
|
|
112
128
|
canEdit: boolean;
|
|
129
|
+
colorScheme?: "primary" | "secondary";
|
|
113
130
|
onChipClick?: () => void;
|
|
114
131
|
}) {
|
|
115
132
|
const isCredit = tx.amount >= 0;
|
|
116
133
|
const categoryLabel = tx.editedCategoryName ?? tx.category;
|
|
117
134
|
|
|
118
135
|
return (
|
|
119
|
-
<div
|
|
136
|
+
<div
|
|
137
|
+
className={cn(
|
|
138
|
+
"flex items-start justify-between gap-4 border-b border-border py-3 last:border-0 transition-opacity",
|
|
139
|
+
isDimmed && "opacity-30",
|
|
140
|
+
)}
|
|
141
|
+
>
|
|
120
142
|
<div className="min-w-0 flex-1">
|
|
121
|
-
<p className="text-
|
|
143
|
+
<p className="text-sm text-muted-foreground">
|
|
122
144
|
{formatDateShort(tx.date)}
|
|
123
145
|
</p>
|
|
124
|
-
<p className="mt-0.5 truncate text-
|
|
146
|
+
<p className="mt-0.5 truncate text-base font-medium text-foreground">
|
|
125
147
|
{tx.description}
|
|
126
148
|
</p>
|
|
127
149
|
{tx.merchant && (
|
|
128
|
-
<p className="mt-0.5 truncate text-
|
|
150
|
+
<p className="mt-0.5 truncate text-sm text-muted-foreground">
|
|
129
151
|
{tx.merchant}
|
|
130
152
|
</p>
|
|
131
153
|
)}
|
|
@@ -134,6 +156,7 @@ function TransactionRow({
|
|
|
134
156
|
<CategoryChip
|
|
135
157
|
label={categoryLabel}
|
|
136
158
|
canEdit={canEdit}
|
|
159
|
+
colorScheme={colorScheme}
|
|
137
160
|
onClick={onChipClick}
|
|
138
161
|
/>
|
|
139
162
|
</div>
|
|
@@ -142,7 +165,7 @@ function TransactionRow({
|
|
|
142
165
|
|
|
143
166
|
<span
|
|
144
167
|
className={cn(
|
|
145
|
-
"shrink-0 text-
|
|
168
|
+
"shrink-0 text-base font-semibold",
|
|
146
169
|
isCredit ? "text-success" : "text-foreground",
|
|
147
170
|
)}
|
|
148
171
|
>
|
|
@@ -168,6 +191,7 @@ export function DashboardTransactionsTable({
|
|
|
168
191
|
onCategoryChange,
|
|
169
192
|
showHeader = true,
|
|
170
193
|
showTab = true,
|
|
194
|
+
colorScheme = "primary",
|
|
171
195
|
}: DashboardTransactionsTableProps) {
|
|
172
196
|
const isFiltering = selectedCategoryId != null;
|
|
173
197
|
const canEdit = !!categories?.length;
|
|
@@ -210,18 +234,16 @@ export function DashboardTransactionsTable({
|
|
|
210
234
|
</p>
|
|
211
235
|
) : (
|
|
212
236
|
<div className="flex flex-col">
|
|
213
|
-
{transactions
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
/>
|
|
224
|
-
))}
|
|
237
|
+
{transactions.map((tx) => (
|
|
238
|
+
<TransactionRow
|
|
239
|
+
key={tx.id}
|
|
240
|
+
tx={tx}
|
|
241
|
+
isDimmed={isFiltering && tx.categoryId !== selectedCategoryId}
|
|
242
|
+
canEdit={canEdit}
|
|
243
|
+
colorScheme={colorScheme}
|
|
244
|
+
onChipClick={() => setEditingTx(tx)}
|
|
245
|
+
/>
|
|
246
|
+
))}
|
|
225
247
|
</div>
|
|
226
248
|
)}
|
|
227
249
|
|