@umituz/web-design-system 4.7.3 → 4.7.4
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": "@umituz/web-design-system",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Web Design System - Tailwind v4 authored, precompiled CSS shipped. Atomic Design components (Atoms, Molecules, Organisms, Templates) for React applications.",
|
|
@@ -37,17 +37,21 @@ Card.displayName = 'Card';
|
|
|
37
37
|
export interface CardHeaderProps extends Omit<CardProps, 'title'> {
|
|
38
38
|
title?: React.ReactNode;
|
|
39
39
|
subtitle?: React.ReactNode;
|
|
40
|
+
eyebrow?: React.ReactNode;
|
|
41
|
+
icon?: React.ReactNode;
|
|
40
42
|
actions?: React.ReactNode;
|
|
43
|
+
bordered?: boolean;
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
export const CardHeader = React.memo(forwardRef<HTMLDivElement, CardHeaderProps>(
|
|
44
|
-
({ className, title, subtitle, actions, children, ...props }, ref) => {
|
|
45
|
-
const hasStructuralProps =
|
|
47
|
+
({ className, title, subtitle, eyebrow, icon, actions, bordered = false, children, ...props }, ref) => {
|
|
48
|
+
const hasStructuralProps =
|
|
49
|
+
title !== undefined || subtitle !== undefined || actions !== undefined || eyebrow !== undefined || icon !== undefined;
|
|
46
50
|
if (!hasStructuralProps) {
|
|
47
51
|
return (
|
|
48
52
|
<div
|
|
49
53
|
ref={ref}
|
|
50
|
-
className={cn('flex flex-col space-y-1.5 p-6', className)}
|
|
54
|
+
className={cn('flex flex-col space-y-1.5 p-6', bordered && 'border-b border-border', className)}
|
|
51
55
|
{...props}
|
|
52
56
|
>
|
|
53
57
|
{children}
|
|
@@ -57,11 +61,19 @@ export const CardHeader = React.memo(forwardRef<HTMLDivElement, CardHeaderProps>
|
|
|
57
61
|
return (
|
|
58
62
|
<div
|
|
59
63
|
ref={ref}
|
|
60
|
-
className={cn('flex items-start justify-between gap-4 p-6', className)}
|
|
64
|
+
className={cn('flex items-start justify-between gap-4 p-6', bordered && 'border-b border-border', className)}
|
|
61
65
|
{...props}
|
|
62
66
|
>
|
|
63
|
-
<div className="flex flex-col space-y-1.5">
|
|
64
|
-
{
|
|
67
|
+
<div className="flex min-w-0 flex-col space-y-1.5">
|
|
68
|
+
{eyebrow !== undefined && (
|
|
69
|
+
<p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">{eyebrow}</p>
|
|
70
|
+
)}
|
|
71
|
+
{title !== undefined && (
|
|
72
|
+
<div className="flex items-center gap-2">
|
|
73
|
+
{icon}
|
|
74
|
+
<CardTitle>{title}</CardTitle>
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
65
77
|
{subtitle !== undefined && <CardDescription>{subtitle}</CardDescription>}
|
|
66
78
|
{children}
|
|
67
79
|
</div>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from './Card';
|
|
8
|
-
export type { CardProps } from './Card';
|
|
8
|
+
export type { CardProps, CardHeaderProps } from './Card';
|
|
9
9
|
|
|
10
10
|
export { Alert, AlertTitle, AlertDescription } from './Alert';
|
|
11
11
|
export type { AlertProps } from './Alert';
|