@classic-homes/theme-react 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/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +77 -40
- package/dist/index.mjs +77 -40
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -14,7 +14,7 @@ import { ClassValue } from 'clsx';
|
|
|
14
14
|
|
|
15
15
|
/** Button classes, from the shared recipe (same classes as theme-svelte) */
|
|
16
16
|
declare const buttonVariants: (props?: ({
|
|
17
|
-
readonly variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
17
|
+
readonly variant?: "link" | "default" | "secondary" | "promo" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
18
18
|
readonly size?: "default" | "sm" | "md" | "lg" | "icon" | null | undefined;
|
|
19
19
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
20
20
|
/** Base button props without size */
|
|
@@ -154,7 +154,7 @@ interface LabelProps extends React$1.ComponentPropsWithoutRef<typeof LabelPrimit
|
|
|
154
154
|
declare const Label: React$1.ForwardRefExoticComponent<LabelProps & React$1.RefAttributes<HTMLLabelElement>>;
|
|
155
155
|
|
|
156
156
|
declare const badgeVariants: (props?: ({
|
|
157
|
-
readonly variant?: "default" | "secondary" | "destructive" | "outline" | "warning" | "success" | "info" | null | undefined;
|
|
157
|
+
readonly variant?: "default" | "secondary" | "promo" | "destructive" | "outline" | "off" | "warning" | "live" | "working" | "attention" | "critical" | "count" | "quantity" | "success" | "info" | null | undefined;
|
|
158
158
|
readonly size?: "default" | "sm" | "dot" | null | undefined;
|
|
159
159
|
readonly clickable?: boolean | null | undefined;
|
|
160
160
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -1189,6 +1189,7 @@ interface KbdProps {
|
|
|
1189
1189
|
declare function Kbd({ keys, size, className, children }: KbdProps): React$1.JSX.Element;
|
|
1190
1190
|
|
|
1191
1191
|
declare const tableRowVariants: (props?: ({
|
|
1192
|
+
readonly striped?: boolean | null | undefined;
|
|
1192
1193
|
readonly interactive?: boolean | null | undefined;
|
|
1193
1194
|
readonly selected?: boolean | null | undefined;
|
|
1194
1195
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { ClassValue } from 'clsx';
|
|
|
14
14
|
|
|
15
15
|
/** Button classes, from the shared recipe (same classes as theme-svelte) */
|
|
16
16
|
declare const buttonVariants: (props?: ({
|
|
17
|
-
readonly variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
17
|
+
readonly variant?: "link" | "default" | "secondary" | "promo" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
18
18
|
readonly size?: "default" | "sm" | "md" | "lg" | "icon" | null | undefined;
|
|
19
19
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
20
20
|
/** Base button props without size */
|
|
@@ -154,7 +154,7 @@ interface LabelProps extends React$1.ComponentPropsWithoutRef<typeof LabelPrimit
|
|
|
154
154
|
declare const Label: React$1.ForwardRefExoticComponent<LabelProps & React$1.RefAttributes<HTMLLabelElement>>;
|
|
155
155
|
|
|
156
156
|
declare const badgeVariants: (props?: ({
|
|
157
|
-
readonly variant?: "default" | "secondary" | "destructive" | "outline" | "warning" | "success" | "info" | null | undefined;
|
|
157
|
+
readonly variant?: "default" | "secondary" | "promo" | "destructive" | "outline" | "off" | "warning" | "live" | "working" | "attention" | "critical" | "count" | "quantity" | "success" | "info" | null | undefined;
|
|
158
158
|
readonly size?: "default" | "sm" | "dot" | null | undefined;
|
|
159
159
|
readonly clickable?: boolean | null | undefined;
|
|
160
160
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -1189,6 +1189,7 @@ interface KbdProps {
|
|
|
1189
1189
|
declare function Kbd({ keys, size, className, children }: KbdProps): React$1.JSX.Element;
|
|
1190
1190
|
|
|
1191
1191
|
declare const tableRowVariants: (props?: ({
|
|
1192
|
+
readonly striped?: boolean | null | undefined;
|
|
1192
1193
|
readonly interactive?: boolean | null | undefined;
|
|
1193
1194
|
readonly selected?: boolean | null | undefined;
|
|
1194
1195
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
package/dist/index.js
CHANGED
|
@@ -174,12 +174,18 @@ var button = recipe({
|
|
|
174
174
|
base: `inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium ${focusRing} disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50`,
|
|
175
175
|
variants: {
|
|
176
176
|
variant: {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
// v2.5: hover underlines the label (the fill never fades or changes);
|
|
178
|
+
// pressed uses Teal Lift.
|
|
179
|
+
default: "bg-primary text-primary-foreground shadow underline-offset-4 hover:underline active:bg-primary-active",
|
|
180
|
+
secondary: "border-2 border-secondary-border bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary-hover active:bg-muted-hover",
|
|
181
|
+
// Promotional action: Founder's Red, Red Dark (deeper, not lighter) on hover.
|
|
182
|
+
// Use selectively; most actions are `default`.
|
|
183
|
+
promo: "bg-promo text-promo-foreground shadow-sm hover:bg-promo-hover active:bg-promo-hover",
|
|
184
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive-hover",
|
|
185
|
+
// Neutral control (Grey 01 label, Paper hover): collection components.
|
|
186
|
+
outline: "border-2 border-outline bg-transparent text-foreground hover:bg-muted",
|
|
181
187
|
ghost: "hover:bg-muted-hover hover:text-foreground",
|
|
182
|
-
link: "text-
|
|
188
|
+
link: "text-link underline underline-offset-4 hover:decoration-2"
|
|
183
189
|
},
|
|
184
190
|
size: {
|
|
185
191
|
default: "h-10 px-4 py-2",
|
|
@@ -196,35 +202,56 @@ var badge = recipe({
|
|
|
196
202
|
variants: {
|
|
197
203
|
variant: {
|
|
198
204
|
default: "border-transparent bg-primary text-primary-foreground",
|
|
199
|
-
secondary: "border-
|
|
200
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground",
|
|
205
|
+
secondary: "border-secondary-border bg-secondary text-secondary-foreground",
|
|
201
206
|
outline: "text-foreground",
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
207
|
+
// v2.5 status treatments: choose by what the person needs to do.
|
|
208
|
+
/** Live: available, active or operating normally. */
|
|
209
|
+
live: "border-transparent bg-live text-live-foreground font-bold",
|
|
210
|
+
/** Working: underway or awaiting a normal next step. */
|
|
211
|
+
working: "border-transparent bg-accent text-accent-foreground font-bold",
|
|
212
|
+
/** Off: inactive, closed or unavailable. */
|
|
213
|
+
off: "border-outline-hover bg-background text-foreground font-bold",
|
|
214
|
+
/** Attention: needs action but does not block the task. Add an icon. */
|
|
215
|
+
attention: "border-destructive bg-background text-destructive font-bold",
|
|
216
|
+
/** Critical: blocks completion or needs urgent intervention. Add an icon. */
|
|
217
|
+
critical: "border-transparent bg-destructive text-destructive-foreground font-bold",
|
|
218
|
+
/** Promotion badge: outlined on repeats. Keep apart from operational status. */
|
|
219
|
+
promo: "border-promo bg-background text-promo font-bold uppercase tracking-[0.07em]",
|
|
220
|
+
/** Notification count: give it an accessible label that says what it counts. */
|
|
221
|
+
count: "rounded-full border-transparent bg-promo text-promo-foreground font-bold",
|
|
222
|
+
/** Quantity or category: neutral information, not urgency. */
|
|
223
|
+
quantity: "border-transparent bg-accent text-accent-foreground font-bold",
|
|
224
|
+
// Earlier names, kept: they now use the v2.5 treatments above
|
|
225
|
+
success: "border-transparent bg-live text-live-foreground font-bold",
|
|
226
|
+
info: "border-transparent bg-live text-live-foreground font-bold",
|
|
227
|
+
warning: "border-destructive bg-background text-destructive font-bold",
|
|
228
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground font-bold"
|
|
205
229
|
},
|
|
206
230
|
size: {
|
|
207
231
|
default: "px-2 py-0.5 text-xs",
|
|
208
232
|
sm: "px-1.5 py-0.5 text-xs",
|
|
209
|
-
dot: "h-5 w-5
|
|
233
|
+
dot: "h-5 min-w-5 px-1.5 py-0 text-xs"
|
|
210
234
|
},
|
|
211
235
|
clickable: {
|
|
212
|
-
true: "cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
236
|
+
true: "cursor-pointer underline-offset-2 hover:underline focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
213
237
|
false: ""
|
|
214
238
|
}
|
|
215
239
|
},
|
|
216
240
|
compoundVariants: [
|
|
241
|
+
// Clickable badges underline on hover; fills only ever deepen (never tint).
|
|
217
242
|
{ variant: "default", clickable: true, class: "hover:bg-primary-hover" },
|
|
218
243
|
{ variant: "secondary", clickable: true, class: "hover:bg-secondary-hover" },
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
variant: "outline",
|
|
244
|
+
...["destructive", "critical"].map((variant) => ({
|
|
245
|
+
variant,
|
|
222
246
|
clickable: true,
|
|
223
|
-
class: "hover:bg-
|
|
224
|
-
},
|
|
225
|
-
{ variant: "
|
|
226
|
-
|
|
227
|
-
|
|
247
|
+
class: "hover:bg-destructive-hover"
|
|
248
|
+
})),
|
|
249
|
+
{ variant: "count", clickable: true, class: "hover:bg-promo-hover" },
|
|
250
|
+
...["outline", "off", "attention", "warning", "promo"].map((variant) => ({
|
|
251
|
+
variant,
|
|
252
|
+
clickable: true,
|
|
253
|
+
class: "hover:bg-muted"
|
|
254
|
+
}))
|
|
228
255
|
],
|
|
229
256
|
defaultVariants: { variant: "default", size: "default", clickable: false }
|
|
230
257
|
});
|
|
@@ -239,8 +266,8 @@ var card = recipe({
|
|
|
239
266
|
variant: {
|
|
240
267
|
default: "border",
|
|
241
268
|
featured: "border-2",
|
|
242
|
-
highlight: "border-2 border-
|
|
243
|
-
warning: "border-2 border-
|
|
269
|
+
highlight: "border-2 border-primary",
|
|
270
|
+
warning: "border-2 border-destructive"
|
|
244
271
|
},
|
|
245
272
|
interactive: {
|
|
246
273
|
true: "hover:shadow-lg transition-shadow duration-200",
|
|
@@ -271,14 +298,14 @@ var alert = recipe({
|
|
|
271
298
|
base: "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
272
299
|
variants: {
|
|
273
300
|
variant: {
|
|
274
|
-
//
|
|
275
|
-
//
|
|
276
|
-
default: "bg-
|
|
277
|
-
destructive: "bg-
|
|
278
|
-
error: "bg-
|
|
279
|
-
success: "bg-
|
|
280
|
-
warning: "bg-
|
|
281
|
-
info: "bg-
|
|
301
|
+
// v2.5: White surface, coloured border and icon, useful message. No
|
|
302
|
+
// tinted wash (no pink). Text stays foreground.
|
|
303
|
+
default: "bg-background border-accent text-foreground",
|
|
304
|
+
destructive: "bg-background border-2 border-destructive text-foreground [&>svg]:text-destructive",
|
|
305
|
+
error: "bg-background border-2 border-destructive text-foreground [&>svg]:text-destructive",
|
|
306
|
+
success: "bg-background border-2 border-success text-foreground [&>svg]:text-success",
|
|
307
|
+
warning: "bg-background border-2 border-warning text-foreground [&>svg]:text-warning",
|
|
308
|
+
info: "bg-background border-2 border-info text-foreground [&>svg]:text-info"
|
|
282
309
|
}
|
|
283
310
|
},
|
|
284
311
|
defaultVariants: { variant: "default" }
|
|
@@ -286,7 +313,7 @@ var alert = recipe({
|
|
|
286
313
|
var alertTitle = recipe({ base: "mb-1 font-medium leading-none tracking-tight" });
|
|
287
314
|
var alertDescription = recipe({ base: "text-sm [&_p]:leading-relaxed" });
|
|
288
315
|
var invalid = {
|
|
289
|
-
true: "border-
|
|
316
|
+
true: "border-2 border-destructive",
|
|
290
317
|
false: ""
|
|
291
318
|
};
|
|
292
319
|
var input = recipe({
|
|
@@ -309,7 +336,7 @@ var label = recipe({
|
|
|
309
336
|
var selectTrigger = recipe({
|
|
310
337
|
base: "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background text-foreground px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
311
338
|
variants: {
|
|
312
|
-
invalid: { true: "border-
|
|
339
|
+
invalid: { true: "border-2 border-destructive", false: "" }
|
|
313
340
|
},
|
|
314
341
|
defaultVariants: { invalid: false }
|
|
315
342
|
});
|
|
@@ -444,18 +471,28 @@ var emptyStateDescription = recipe({
|
|
|
444
471
|
});
|
|
445
472
|
var tableContainer = recipe({ base: "relative overflow-x-auto rounded-lg border" });
|
|
446
473
|
var table = recipe({ base: "w-full text-sm" });
|
|
447
|
-
var tableHeader = recipe({ base: "border-b bg-
|
|
474
|
+
var tableHeader = recipe({ base: "border-b bg-accent" });
|
|
448
475
|
var tableBody = recipe({ base: "divide-y" });
|
|
449
476
|
var tableRow = recipe({
|
|
450
477
|
base: "bg-card",
|
|
478
|
+
// v2.5: Paper hover on White tables, Linen hover on zebra tables; selection
|
|
479
|
+
// adds Linen, bold and a Heritage Teal edge (never colour alone). `selected`
|
|
480
|
+
// comes last so it wins over the zebra and hover fills.
|
|
451
481
|
variants: {
|
|
452
|
-
|
|
453
|
-
|
|
482
|
+
striped: { true: "even:bg-row-zebra", false: "" },
|
|
483
|
+
interactive: { true: "cursor-pointer hover:bg-row-hover", false: "" },
|
|
484
|
+
selected: {
|
|
485
|
+
true: "bg-row-selected even:bg-row-selected hover:bg-row-selected font-semibold [&>td:first-child]:shadow-[inset_3px_0_0_hsl(var(--primary))]",
|
|
486
|
+
false: ""
|
|
487
|
+
}
|
|
454
488
|
},
|
|
455
|
-
|
|
489
|
+
compoundVariants: [
|
|
490
|
+
{ striped: true, interactive: true, selected: false, class: "hover:bg-row-hover-zebra" }
|
|
491
|
+
],
|
|
492
|
+
defaultVariants: { striped: false, interactive: false, selected: false }
|
|
456
493
|
});
|
|
457
494
|
var tableHead = recipe({
|
|
458
|
-
base: "px-4 py-3 font-
|
|
495
|
+
base: "px-4 py-3 font-semibold text-foreground",
|
|
459
496
|
variants: {
|
|
460
497
|
align: { left: "text-left", center: "text-center", right: "text-right" }
|
|
461
498
|
},
|
|
@@ -513,7 +550,7 @@ var numberInputField = recipe({
|
|
|
513
550
|
base: "flex h-10 w-full bg-background px-3 py-2 text-base sm:text-sm text-center ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
514
551
|
variants: {
|
|
515
552
|
stepper: { true: "border-y border-input", false: "border border-input rounded-md" },
|
|
516
|
-
invalid: { true: "border-
|
|
553
|
+
invalid: { true: "border-2 border-destructive", false: "" }
|
|
517
554
|
},
|
|
518
555
|
defaultVariants: { stepper: true, invalid: false }
|
|
519
556
|
});
|
|
@@ -6437,11 +6474,11 @@ TableHeader.displayName = "TableHeader";
|
|
|
6437
6474
|
var TableBody = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("tbody", { ref, className: cn(tableBody.base, className), ...props }));
|
|
6438
6475
|
TableBody.displayName = "TableBody";
|
|
6439
6476
|
var TableRow = React39.forwardRef(
|
|
6440
|
-
({ className, interactive, selected, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6477
|
+
({ className, striped, interactive, selected, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6441
6478
|
"tr",
|
|
6442
6479
|
{
|
|
6443
6480
|
ref,
|
|
6444
|
-
className: cn(tableRowVariants({ interactive, selected }), className),
|
|
6481
|
+
className: cn(tableRowVariants({ striped, interactive, selected }), className),
|
|
6445
6482
|
...props
|
|
6446
6483
|
}
|
|
6447
6484
|
)
|
package/dist/index.mjs
CHANGED
|
@@ -17,12 +17,18 @@ var button = recipe({
|
|
|
17
17
|
base: `inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium ${focusRing} disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50`,
|
|
18
18
|
variants: {
|
|
19
19
|
variant: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
// v2.5: hover underlines the label (the fill never fades or changes);
|
|
21
|
+
// pressed uses Teal Lift.
|
|
22
|
+
default: "bg-primary text-primary-foreground shadow underline-offset-4 hover:underline active:bg-primary-active",
|
|
23
|
+
secondary: "border-2 border-secondary-border bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary-hover active:bg-muted-hover",
|
|
24
|
+
// Promotional action: Founder's Red, Red Dark (deeper, not lighter) on hover.
|
|
25
|
+
// Use selectively; most actions are `default`.
|
|
26
|
+
promo: "bg-promo text-promo-foreground shadow-sm hover:bg-promo-hover active:bg-promo-hover",
|
|
27
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive-hover",
|
|
28
|
+
// Neutral control (Grey 01 label, Paper hover): collection components.
|
|
29
|
+
outline: "border-2 border-outline bg-transparent text-foreground hover:bg-muted",
|
|
24
30
|
ghost: "hover:bg-muted-hover hover:text-foreground",
|
|
25
|
-
link: "text-
|
|
31
|
+
link: "text-link underline underline-offset-4 hover:decoration-2"
|
|
26
32
|
},
|
|
27
33
|
size: {
|
|
28
34
|
default: "h-10 px-4 py-2",
|
|
@@ -39,35 +45,56 @@ var badge = recipe({
|
|
|
39
45
|
variants: {
|
|
40
46
|
variant: {
|
|
41
47
|
default: "border-transparent bg-primary text-primary-foreground",
|
|
42
|
-
secondary: "border-
|
|
43
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground",
|
|
48
|
+
secondary: "border-secondary-border bg-secondary text-secondary-foreground",
|
|
44
49
|
outline: "text-foreground",
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
// v2.5 status treatments: choose by what the person needs to do.
|
|
51
|
+
/** Live: available, active or operating normally. */
|
|
52
|
+
live: "border-transparent bg-live text-live-foreground font-bold",
|
|
53
|
+
/** Working: underway or awaiting a normal next step. */
|
|
54
|
+
working: "border-transparent bg-accent text-accent-foreground font-bold",
|
|
55
|
+
/** Off: inactive, closed or unavailable. */
|
|
56
|
+
off: "border-outline-hover bg-background text-foreground font-bold",
|
|
57
|
+
/** Attention: needs action but does not block the task. Add an icon. */
|
|
58
|
+
attention: "border-destructive bg-background text-destructive font-bold",
|
|
59
|
+
/** Critical: blocks completion or needs urgent intervention. Add an icon. */
|
|
60
|
+
critical: "border-transparent bg-destructive text-destructive-foreground font-bold",
|
|
61
|
+
/** Promotion badge: outlined on repeats. Keep apart from operational status. */
|
|
62
|
+
promo: "border-promo bg-background text-promo font-bold uppercase tracking-[0.07em]",
|
|
63
|
+
/** Notification count: give it an accessible label that says what it counts. */
|
|
64
|
+
count: "rounded-full border-transparent bg-promo text-promo-foreground font-bold",
|
|
65
|
+
/** Quantity or category: neutral information, not urgency. */
|
|
66
|
+
quantity: "border-transparent bg-accent text-accent-foreground font-bold",
|
|
67
|
+
// Earlier names, kept: they now use the v2.5 treatments above
|
|
68
|
+
success: "border-transparent bg-live text-live-foreground font-bold",
|
|
69
|
+
info: "border-transparent bg-live text-live-foreground font-bold",
|
|
70
|
+
warning: "border-destructive bg-background text-destructive font-bold",
|
|
71
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground font-bold"
|
|
48
72
|
},
|
|
49
73
|
size: {
|
|
50
74
|
default: "px-2 py-0.5 text-xs",
|
|
51
75
|
sm: "px-1.5 py-0.5 text-xs",
|
|
52
|
-
dot: "h-5 w-5
|
|
76
|
+
dot: "h-5 min-w-5 px-1.5 py-0 text-xs"
|
|
53
77
|
},
|
|
54
78
|
clickable: {
|
|
55
|
-
true: "cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
79
|
+
true: "cursor-pointer underline-offset-2 hover:underline focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
56
80
|
false: ""
|
|
57
81
|
}
|
|
58
82
|
},
|
|
59
83
|
compoundVariants: [
|
|
84
|
+
// Clickable badges underline on hover; fills only ever deepen (never tint).
|
|
60
85
|
{ variant: "default", clickable: true, class: "hover:bg-primary-hover" },
|
|
61
86
|
{ variant: "secondary", clickable: true, class: "hover:bg-secondary-hover" },
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
variant: "outline",
|
|
87
|
+
...["destructive", "critical"].map((variant) => ({
|
|
88
|
+
variant,
|
|
65
89
|
clickable: true,
|
|
66
|
-
class: "hover:bg-
|
|
67
|
-
},
|
|
68
|
-
{ variant: "
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
class: "hover:bg-destructive-hover"
|
|
91
|
+
})),
|
|
92
|
+
{ variant: "count", clickable: true, class: "hover:bg-promo-hover" },
|
|
93
|
+
...["outline", "off", "attention", "warning", "promo"].map((variant) => ({
|
|
94
|
+
variant,
|
|
95
|
+
clickable: true,
|
|
96
|
+
class: "hover:bg-muted"
|
|
97
|
+
}))
|
|
71
98
|
],
|
|
72
99
|
defaultVariants: { variant: "default", size: "default", clickable: false }
|
|
73
100
|
});
|
|
@@ -82,8 +109,8 @@ var card = recipe({
|
|
|
82
109
|
variant: {
|
|
83
110
|
default: "border",
|
|
84
111
|
featured: "border-2",
|
|
85
|
-
highlight: "border-2 border-
|
|
86
|
-
warning: "border-2 border-
|
|
112
|
+
highlight: "border-2 border-primary",
|
|
113
|
+
warning: "border-2 border-destructive"
|
|
87
114
|
},
|
|
88
115
|
interactive: {
|
|
89
116
|
true: "hover:shadow-lg transition-shadow duration-200",
|
|
@@ -114,14 +141,14 @@ var alert = recipe({
|
|
|
114
141
|
base: "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
115
142
|
variants: {
|
|
116
143
|
variant: {
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
default: "bg-
|
|
120
|
-
destructive: "bg-
|
|
121
|
-
error: "bg-
|
|
122
|
-
success: "bg-
|
|
123
|
-
warning: "bg-
|
|
124
|
-
info: "bg-
|
|
144
|
+
// v2.5: White surface, coloured border and icon, useful message. No
|
|
145
|
+
// tinted wash (no pink). Text stays foreground.
|
|
146
|
+
default: "bg-background border-accent text-foreground",
|
|
147
|
+
destructive: "bg-background border-2 border-destructive text-foreground [&>svg]:text-destructive",
|
|
148
|
+
error: "bg-background border-2 border-destructive text-foreground [&>svg]:text-destructive",
|
|
149
|
+
success: "bg-background border-2 border-success text-foreground [&>svg]:text-success",
|
|
150
|
+
warning: "bg-background border-2 border-warning text-foreground [&>svg]:text-warning",
|
|
151
|
+
info: "bg-background border-2 border-info text-foreground [&>svg]:text-info"
|
|
125
152
|
}
|
|
126
153
|
},
|
|
127
154
|
defaultVariants: { variant: "default" }
|
|
@@ -129,7 +156,7 @@ var alert = recipe({
|
|
|
129
156
|
var alertTitle = recipe({ base: "mb-1 font-medium leading-none tracking-tight" });
|
|
130
157
|
var alertDescription = recipe({ base: "text-sm [&_p]:leading-relaxed" });
|
|
131
158
|
var invalid = {
|
|
132
|
-
true: "border-
|
|
159
|
+
true: "border-2 border-destructive",
|
|
133
160
|
false: ""
|
|
134
161
|
};
|
|
135
162
|
var input = recipe({
|
|
@@ -152,7 +179,7 @@ var label = recipe({
|
|
|
152
179
|
var selectTrigger = recipe({
|
|
153
180
|
base: "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background text-foreground px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
154
181
|
variants: {
|
|
155
|
-
invalid: { true: "border-
|
|
182
|
+
invalid: { true: "border-2 border-destructive", false: "" }
|
|
156
183
|
},
|
|
157
184
|
defaultVariants: { invalid: false }
|
|
158
185
|
});
|
|
@@ -287,18 +314,28 @@ var emptyStateDescription = recipe({
|
|
|
287
314
|
});
|
|
288
315
|
var tableContainer = recipe({ base: "relative overflow-x-auto rounded-lg border" });
|
|
289
316
|
var table = recipe({ base: "w-full text-sm" });
|
|
290
|
-
var tableHeader = recipe({ base: "border-b bg-
|
|
317
|
+
var tableHeader = recipe({ base: "border-b bg-accent" });
|
|
291
318
|
var tableBody = recipe({ base: "divide-y" });
|
|
292
319
|
var tableRow = recipe({
|
|
293
320
|
base: "bg-card",
|
|
321
|
+
// v2.5: Paper hover on White tables, Linen hover on zebra tables; selection
|
|
322
|
+
// adds Linen, bold and a Heritage Teal edge (never colour alone). `selected`
|
|
323
|
+
// comes last so it wins over the zebra and hover fills.
|
|
294
324
|
variants: {
|
|
295
|
-
|
|
296
|
-
|
|
325
|
+
striped: { true: "even:bg-row-zebra", false: "" },
|
|
326
|
+
interactive: { true: "cursor-pointer hover:bg-row-hover", false: "" },
|
|
327
|
+
selected: {
|
|
328
|
+
true: "bg-row-selected even:bg-row-selected hover:bg-row-selected font-semibold [&>td:first-child]:shadow-[inset_3px_0_0_hsl(var(--primary))]",
|
|
329
|
+
false: ""
|
|
330
|
+
}
|
|
297
331
|
},
|
|
298
|
-
|
|
332
|
+
compoundVariants: [
|
|
333
|
+
{ striped: true, interactive: true, selected: false, class: "hover:bg-row-hover-zebra" }
|
|
334
|
+
],
|
|
335
|
+
defaultVariants: { striped: false, interactive: false, selected: false }
|
|
299
336
|
});
|
|
300
337
|
var tableHead = recipe({
|
|
301
|
-
base: "px-4 py-3 font-
|
|
338
|
+
base: "px-4 py-3 font-semibold text-foreground",
|
|
302
339
|
variants: {
|
|
303
340
|
align: { left: "text-left", center: "text-center", right: "text-right" }
|
|
304
341
|
},
|
|
@@ -356,7 +393,7 @@ var numberInputField = recipe({
|
|
|
356
393
|
base: "flex h-10 w-full bg-background px-3 py-2 text-base sm:text-sm text-center ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
357
394
|
variants: {
|
|
358
395
|
stepper: { true: "border-y border-input", false: "border border-input rounded-md" },
|
|
359
|
-
invalid: { true: "border-
|
|
396
|
+
invalid: { true: "border-2 border-destructive", false: "" }
|
|
360
397
|
},
|
|
361
398
|
defaultVariants: { stepper: true, invalid: false }
|
|
362
399
|
});
|
|
@@ -6312,11 +6349,11 @@ TableHeader.displayName = "TableHeader";
|
|
|
6312
6349
|
var TableBody = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx39("tbody", { ref, className: cn(tableBody.base, className), ...props }));
|
|
6313
6350
|
TableBody.displayName = "TableBody";
|
|
6314
6351
|
var TableRow = React39.forwardRef(
|
|
6315
|
-
({ className, interactive, selected, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6352
|
+
({ className, striped, interactive, selected, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
6316
6353
|
"tr",
|
|
6317
6354
|
{
|
|
6318
6355
|
ref,
|
|
6319
|
-
className: cn(tableRowVariants({ interactive, selected }), className),
|
|
6356
|
+
className: cn(tableRowVariants({ striped, interactive, selected }), className),
|
|
6320
6357
|
...props
|
|
6321
6358
|
}
|
|
6322
6359
|
)
|