@stasho/ds 0.7.0 → 0.8.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/package.json
CHANGED
|
@@ -82,13 +82,13 @@ const buttonVariants = cva(
|
|
|
82
82
|
"dark:disabled:[box-shadow:inset_0_1px_0_rgba(255,255,255,0.03),inset_0_-1px_0_rgba(0,0,0,0.3)]",
|
|
83
83
|
].join(" "),
|
|
84
84
|
outline: [
|
|
85
|
-
// light (base):
|
|
86
|
-
"bg-transparent text-
|
|
87
|
-
"hover:border-
|
|
85
|
+
// light (base): neutral foreground text + border (white would be invisible on a light surface), flat chassis when disabled
|
|
86
|
+
"bg-transparent text-foreground border border-[rgba(20,15,40,0.25)]",
|
|
87
|
+
"hover:border-foreground",
|
|
88
88
|
"disabled:text-foreground/30 disabled:border-[rgba(20,15,40,0.15)] disabled:bg-muted",
|
|
89
|
-
// dark (overrides —
|
|
90
|
-
"dark:text-
|
|
91
|
-
"dark:hover:border-
|
|
89
|
+
// dark (overrides): white chrome — outline is neutral, NOT accent (supersedes the outline half of Decision #82)
|
|
90
|
+
"dark:text-white dark:border-white/40",
|
|
91
|
+
"dark:hover:border-white",
|
|
92
92
|
"dark:disabled:text-white/30 dark:disabled:border-white/10 dark:disabled:bg-transparent",
|
|
93
93
|
].join(" "),
|
|
94
94
|
ghost: [
|
|
@@ -161,7 +161,7 @@ const ledColorClass: Record<Variant, string> = {
|
|
|
161
161
|
destructive: "bg-white text-white [box-shadow:0_0_8px_currentColor]",
|
|
162
162
|
warning: "bg-warning-foreground text-warning-foreground",
|
|
163
163
|
success: "bg-success-foreground text-success-foreground",
|
|
164
|
-
outline: "bg-
|
|
164
|
+
outline: "bg-foreground/35 text-foreground dark:bg-white/50 dark:text-white",
|
|
165
165
|
// ghost: LED is never rendered for ghost, so this entry is a sentinel.
|
|
166
166
|
ghost: "",
|
|
167
167
|
// link: LED is never rendered for link, so this entry is a sentinel.
|
|
@@ -175,7 +175,7 @@ const iconGlowClass: Record<Variant, string> = {
|
|
|
175
175
|
destructive: "text-white",
|
|
176
176
|
warning: "text-warning-foreground",
|
|
177
177
|
success: "text-success-foreground",
|
|
178
|
-
outline: "text-
|
|
178
|
+
outline: "text-foreground dark:text-white",
|
|
179
179
|
ghost: "text-foreground/60 dark:text-white/60",
|
|
180
180
|
link: "text-primary dark:text-accent",
|
|
181
181
|
};
|
|
@@ -8,6 +8,12 @@ type SortDirection = "asc" | "desc";
|
|
|
8
8
|
|
|
9
9
|
export type Column<T> = {
|
|
10
10
|
header: string;
|
|
11
|
+
/**
|
|
12
|
+
* Stable React key for the column. Defaults to `header`. Set this when two
|
|
13
|
+
* columns share a header (e.g. multiple header-less icon/action columns,
|
|
14
|
+
* where `header` is `""`) so cell keys don't collide.
|
|
15
|
+
*/
|
|
16
|
+
id?: string;
|
|
11
17
|
accessor: (row: T) => ReactNode;
|
|
12
18
|
sortable?: boolean;
|
|
13
19
|
sortValue?: (row: T) => string | number;
|
|
@@ -163,7 +169,7 @@ export function Table<T>({
|
|
|
163
169
|
<tr className="bg-muted/50">
|
|
164
170
|
{columns.map((col, i) => (
|
|
165
171
|
<th
|
|
166
|
-
key={col.header}
|
|
172
|
+
key={col.id ?? col.header}
|
|
167
173
|
className={cn(
|
|
168
174
|
"px-4 py-3 font-mono font-normal uppercase tracking-widest text-[11px] text-muted-foreground",
|
|
169
175
|
alignClass[col.align ?? "left"],
|
|
@@ -241,7 +247,7 @@ export function Table<T>({
|
|
|
241
247
|
>
|
|
242
248
|
{columns.map((col) => (
|
|
243
249
|
<td
|
|
244
|
-
key={col.header}
|
|
250
|
+
key={col.id ?? col.header}
|
|
245
251
|
className={cn(
|
|
246
252
|
"px-4 py-3 text-sm",
|
|
247
253
|
alignClass[col.align ?? "left"],
|