@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wealthx/shadcn",
3
- "version": "1.5.43",
3
+ "version": "1.5.44",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./src/index.ts",
@@ -89,7 +89,7 @@ function CategoryRow({
89
89
  isSelected && "bg-primary/10",
90
90
  )}
91
91
  >
92
- <ItemIcon icon={icon} active={isSelected} />
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-xs">
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-sm font-medium text-foreground">
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-xs text-muted-foreground">
250
+ <span className="text-sm text-muted-foreground">
251
251
  {item.pct.toFixed(0)}%
252
252
  </span>
253
- <span className="text-sm font-semibold text-foreground">
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 + "Account Transaction" tab).
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="cursor-pointer transition-colors hover:bg-muted"
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 className="flex items-start justify-between gap-4 border-b border-border py-3 last:border-0">
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-xs text-muted-foreground">
143
+ <p className="text-sm text-muted-foreground">
122
144
  {formatDateShort(tx.date)}
123
145
  </p>
124
- <p className="mt-0.5 truncate text-sm font-medium text-foreground">
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-xs text-muted-foreground">
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-sm font-semibold",
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
- .filter(
215
- (tx) => !isFiltering || tx.categoryId === selectedCategoryId,
216
- )
217
- .map((tx) => (
218
- <TransactionRow
219
- key={tx.id}
220
- tx={tx}
221
- canEdit={canEdit}
222
- onChipClick={() => setEditingTx(tx)}
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