Skip to content

Commit 3902761

Browse files
committed
fix(showcase/shell-docs): Card renders icon, className, children instead of dropping them
Card's type accepted icon, className, and children but the component body never read them — silent prop drop. Render icon above the title, merge className onto the wrapper, and render children below the description so MDX authors get the behavior the type signature promises.
1 parent 72ca49d commit 3902761

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

showcase/shell-docs/src/components/mdx-components.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export function Card({
2222
title,
2323
description,
2424
href,
25+
icon,
26+
className,
27+
children,
2528
}: {
2629
title: string;
2730
description?: string;
@@ -30,14 +33,34 @@ export function Card({
3033
className?: string;
3134
children?: React.ReactNode;
3235
}) {
36+
// Render `icon`, `className`, and `children` instead of silently
37+
// dropping them — matches MDX author expectations (Mintlify-style
38+
// Cards accept all three).
39+
const mergedClassName = [
40+
"rounded-lg border border-[var(--border)] bg-[var(--bg-surface)] p-4 hover:bg-[var(--bg-elevated)] transition-colors",
41+
className,
42+
]
43+
.filter(Boolean)
44+
.join(" ");
45+
3346
const content = (
34-
<div className="rounded-lg border border-[var(--border)] bg-[var(--bg-surface)] p-4 hover:bg-[var(--bg-elevated)] transition-colors">
47+
<div className={mergedClassName}>
48+
{icon && (
49+
<div className="mb-2 text-[var(--text-muted)]" aria-hidden>
50+
{icon}
51+
</div>
52+
)}
3553
<div className="font-semibold text-[var(--text)] text-sm">{title}</div>
3654
{description && (
3755
<div className="text-xs text-[var(--text-muted)] mt-1">
3856
{description}
3957
</div>
4058
)}
59+
{children && (
60+
<div className="text-xs text-[var(--text-secondary)] mt-2">
61+
{children}
62+
</div>
63+
)}
4164
</div>
4265
);
4366

0 commit comments

Comments
 (0)