@adamosuiteservices/ui 2.10.0 → 2.10.1
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/card.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
adm:flex adm:flex-col adm:gap-6 adm:rounded-3xl adm:
|
|
3
|
-
adm:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./jsx-runtime-BB_1_6y_.cjs"),r=require("./index-DoxiiusW.cjs"),c=require("./index-BTzZJcis.cjs");require("react");const e=c.cva(`
|
|
2
|
+
adm:flex adm:flex-col adm:gap-6 adm:rounded-3xl adm:bg-card adm:py-6
|
|
3
|
+
adm:text-card-foreground
|
|
4
4
|
`,{variants:{variant:{default:"adm:bg-card adm:text-card-foreground",primary:`
|
|
5
5
|
adm:bg-primary-50
|
|
6
6
|
adm:*:data-[slot=alert-description]:text-primary/90
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
adm:*:data-[slot=alert-description]:text-destructive/90
|
|
27
27
|
adm:[&>[data-slot=icon]]:text-current
|
|
28
28
|
adm:[&>svg]:text-current
|
|
29
|
-
`}},defaultVariants:{variant:"default"}});function
|
|
29
|
+
`},shadow:{default:"adm:shadow-xs",none:"adm:shadow-none"},border:{default:"adm:border",transparent:"adm:border adm:border-transparent"}},defaultVariants:{variant:"default",shadow:"none",border:"default"}});function m({className:t,variant:a,shadow:n,border:s,...o}){return d.jsxRuntimeExports.jsx("div",{"data-slot":"card",className:r.cn(e({variant:a,shadow:n,border:s}),t),...o})}function i({className:t,...a}){return d.jsxRuntimeExports.jsx("div",{"data-slot":"card-header",className:r.cn(`
|
|
30
30
|
adm:@container/card-header adm:grid adm:auto-rows-min
|
|
31
31
|
adm:grid-rows-[auto_auto] adm:items-start adm:gap-2 adm:px-6
|
|
32
32
|
adm:has-data-[slot=card-action]:grid-cols-[1fr_auto]
|
|
33
33
|
adm:[.border-b]:pb-6
|
|
34
|
-
`,t),...a})}function
|
|
34
|
+
`,t),...a})}function u({className:t,...a}){return d.jsxRuntimeExports.jsx("div",{"data-slot":"card-title",className:r.cn("adm:leading-none adm:font-semibold",t),...a})}function l({className:t,...a}){return d.jsxRuntimeExports.jsx("div",{"data-slot":"card-description",className:r.cn("adm:text-sm adm:text-muted-foreground",t),...a})}function x({className:t,...a}){return d.jsxRuntimeExports.jsx("div",{"data-slot":"card-action",className:r.cn(`
|
|
35
35
|
adm:col-start-2 adm:row-span-2 adm:row-start-1 adm:self-start
|
|
36
36
|
adm:justify-self-end
|
|
37
|
-
`,t),...a})}function
|
|
37
|
+
`,t),...a})}function p({className:t,...a}){return d.jsxRuntimeExports.jsx("div",{"data-slot":"card-content",className:r.cn("adm:px-6",t),...a})}function f({className:t,...a}){return d.jsxRuntimeExports.jsx("div",{"data-slot":"card-footer",className:r.cn(`
|
|
38
38
|
adm:flex adm:items-center adm:px-6
|
|
39
39
|
adm:[.border-t]:pt-6
|
|
40
|
-
`,t),...a})}exports.Card=
|
|
40
|
+
`,t),...a})}exports.Card=m;exports.CardAction=x;exports.CardContent=p;exports.CardDescription=l;exports.CardFooter=f;exports.CardHeader=i;exports.CardTitle=u;exports.cardVariants=e;
|
package/dist/card.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as d } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { c as r } from "./index-CRiPKpXj.js";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as n } from "./index-BqtVL8d-.js";
|
|
4
4
|
import "react";
|
|
5
|
-
const
|
|
5
|
+
const m = n(
|
|
6
6
|
`
|
|
7
|
-
adm:flex adm:flex-col adm:gap-6 adm:rounded-3xl adm:
|
|
8
|
-
adm:
|
|
7
|
+
adm:flex adm:flex-col adm:gap-6 adm:rounded-3xl adm:bg-card adm:py-6
|
|
8
|
+
adm:text-card-foreground
|
|
9
9
|
`,
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
@@ -41,28 +41,40 @@ const o = s(
|
|
|
41
41
|
adm:[&>[data-slot=icon]]:text-current
|
|
42
42
|
adm:[&>svg]:text-current
|
|
43
43
|
`
|
|
44
|
+
},
|
|
45
|
+
shadow: {
|
|
46
|
+
default: "adm:shadow-xs",
|
|
47
|
+
none: "adm:shadow-none"
|
|
48
|
+
},
|
|
49
|
+
border: {
|
|
50
|
+
default: "adm:border",
|
|
51
|
+
transparent: "adm:border adm:border-transparent"
|
|
44
52
|
}
|
|
45
53
|
},
|
|
46
54
|
defaultVariants: {
|
|
47
|
-
variant: "default"
|
|
55
|
+
variant: "default",
|
|
56
|
+
shadow: "none",
|
|
57
|
+
border: "default"
|
|
48
58
|
}
|
|
49
59
|
}
|
|
50
60
|
);
|
|
51
|
-
function
|
|
61
|
+
function x({
|
|
52
62
|
className: a,
|
|
53
63
|
variant: t,
|
|
54
|
-
|
|
64
|
+
shadow: e,
|
|
65
|
+
border: s,
|
|
66
|
+
...o
|
|
55
67
|
}) {
|
|
56
68
|
return /* @__PURE__ */ d.jsx(
|
|
57
69
|
"div",
|
|
58
70
|
{
|
|
59
71
|
"data-slot": "card",
|
|
60
|
-
className: r(
|
|
61
|
-
...
|
|
72
|
+
className: r(m({ variant: t, shadow: e, border: s }), a),
|
|
73
|
+
...o
|
|
62
74
|
}
|
|
63
75
|
);
|
|
64
76
|
}
|
|
65
|
-
function
|
|
77
|
+
function f({ className: a, ...t }) {
|
|
66
78
|
return /* @__PURE__ */ d.jsx(
|
|
67
79
|
"div",
|
|
68
80
|
{
|
|
@@ -80,7 +92,7 @@ function l({ className: a, ...t }) {
|
|
|
80
92
|
}
|
|
81
93
|
);
|
|
82
94
|
}
|
|
83
|
-
function
|
|
95
|
+
function p({ className: a, ...t }) {
|
|
84
96
|
return /* @__PURE__ */ d.jsx(
|
|
85
97
|
"div",
|
|
86
98
|
{
|
|
@@ -90,7 +102,7 @@ function x({ className: a, ...t }) {
|
|
|
90
102
|
}
|
|
91
103
|
);
|
|
92
104
|
}
|
|
93
|
-
function
|
|
105
|
+
function g({ className: a, ...t }) {
|
|
94
106
|
return /* @__PURE__ */ d.jsx(
|
|
95
107
|
"div",
|
|
96
108
|
{
|
|
@@ -100,7 +112,7 @@ function f({ className: a, ...t }) {
|
|
|
100
112
|
}
|
|
101
113
|
);
|
|
102
114
|
}
|
|
103
|
-
function
|
|
115
|
+
function v({ className: a, ...t }) {
|
|
104
116
|
return /* @__PURE__ */ d.jsx(
|
|
105
117
|
"div",
|
|
106
118
|
{
|
|
@@ -116,7 +128,7 @@ function p({ className: a, ...t }) {
|
|
|
116
128
|
}
|
|
117
129
|
);
|
|
118
130
|
}
|
|
119
|
-
function
|
|
131
|
+
function b({ className: a, ...t }) {
|
|
120
132
|
return /* @__PURE__ */ d.jsx(
|
|
121
133
|
"div",
|
|
122
134
|
{
|
|
@@ -126,7 +138,7 @@ function g({ className: a, ...t }) {
|
|
|
126
138
|
}
|
|
127
139
|
);
|
|
128
140
|
}
|
|
129
|
-
function
|
|
141
|
+
function w({ className: a, ...t }) {
|
|
130
142
|
return /* @__PURE__ */ d.jsx(
|
|
131
143
|
"div",
|
|
132
144
|
{
|
|
@@ -140,12 +152,12 @@ function v({ className: a, ...t }) {
|
|
|
140
152
|
);
|
|
141
153
|
}
|
|
142
154
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
x as Card,
|
|
156
|
+
v as CardAction,
|
|
157
|
+
b as CardContent,
|
|
158
|
+
g as CardDescription,
|
|
159
|
+
w as CardFooter,
|
|
160
|
+
f as CardHeader,
|
|
161
|
+
p as CardTitle,
|
|
162
|
+
m as cardVariants
|
|
151
163
|
};
|
|
@@ -2,8 +2,10 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const cardVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "success" | "warning" | "destructive" | "muted" | "primary" | null | undefined;
|
|
5
|
+
shadow?: "default" | "none" | null | undefined;
|
|
6
|
+
border?: "default" | "transparent" | null | undefined;
|
|
5
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
-
declare function Card({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof cardVariants>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function Card({ className, variant, shadow, border, ...props }: React.ComponentProps<"div"> & VariantProps<typeof cardVariants>): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,6 +5,8 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
7
|
export declare const AllVariants: Story;
|
|
8
|
+
export declare const ShadowVariants: Story;
|
|
9
|
+
export declare const BorderVariants: Story;
|
|
8
10
|
export declare const Primary: Story;
|
|
9
11
|
export declare const Success: Story;
|
|
10
12
|
export declare const Warning: Story;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# Card
|
|
2
2
|
|
|
3
|
-
Contenedor versátil con bordes redondeados, padding y
|
|
3
|
+
Contenedor versátil con bordes redondeados, padding, sombra y borde configurables para agrupar contenido relacionado. Incluye 6 variantes de color, control de elevación y bordes, y un sistema de layout con grid automático para headers con acciones.
|
|
4
4
|
|
|
5
5
|
## Características Principales
|
|
6
6
|
|
|
7
7
|
- **6 variantes de color**: Default, Primary, Muted, Success, Warning, Destructive
|
|
8
|
+
- **2 variantes de sombra**: Default (con elevación) y None (diseño plano, por defecto)
|
|
9
|
+
- **2 variantes de borde**: Default (visible) y Transparent (invisible pero mantiene espacio)
|
|
8
10
|
- **Composición modular**: 6 subcomponentes (Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter)
|
|
9
11
|
- **Grid automático en header**: Detecta `CardAction` y ajusta layout automáticamente con `has-data-[slot=card-action]:grid-cols-[1fr_auto]`
|
|
10
12
|
- **Container queries**: CardHeader usa `@container/card-header` para layouts responsive
|
|
@@ -104,11 +106,13 @@ Contenedor principal de la card.
|
|
|
104
106
|
|
|
105
107
|
#### Props
|
|
106
108
|
|
|
107
|
-
| Prop | Tipo | Default | Descripción
|
|
108
|
-
| ----------- | ------------------------------------------------------------------------------ | ----------- |
|
|
109
|
-
| `variant` | `"default" \| "primary" \| "muted" \| "success" \| "warning" \| "destructive"` | `"default"` | Variante de color de fondo
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
109
|
+
| Prop | Tipo | Default | Descripción |
|
|
110
|
+
| ----------- | ------------------------------------------------------------------------------ | ----------- | ---------------------------------------------------------- |
|
|
111
|
+
| `variant` | `"default" \| "primary" \| "muted" \| "success" \| "warning" \| "destructive"` | `"default"` | Variante de color de fondo |
|
|
112
|
+
| `shadow` | `"default" \| "none"` | `"none"` | Control de sombra (none=flat, default=elevación) |
|
|
113
|
+
| `border` | `"default" \| "transparent"` | `"default"` | Control de borde (default=visible, transparent=invisible) |
|
|
114
|
+
| `className` | `string` | - | Clases CSS adicionales |
|
|
115
|
+
| `children` | `ReactNode` | - | Contenido de la card |
|
|
112
116
|
|
|
113
117
|
### CardHeader
|
|
114
118
|
|
|
@@ -335,7 +339,125 @@ Fondo gris claro para información secundaria.
|
|
|
335
339
|
|
|
336
340
|
**Colores**: `bg-muted` con texto `text-muted/90`
|
|
337
341
|
|
|
338
|
-
|
|
342
|
+
## Variantes de Sombra
|
|
343
|
+
|
|
344
|
+
Controla la elevación de las cards con la prop `shadow`. Por defecto, las cards no tienen sombra (`shadow="none"`).
|
|
345
|
+
|
|
346
|
+
### Sin Sombra (Default)
|
|
347
|
+
|
|
348
|
+
Card plana sin elevación para diseños limpios y modernos.
|
|
349
|
+
|
|
350
|
+
```tsx
|
|
351
|
+
<Card className="w-[350px]">
|
|
352
|
+
<CardHeader>
|
|
353
|
+
<CardTitle>Flat Card</CardTitle>
|
|
354
|
+
<CardDescription>No elevation, flat design</CardDescription>
|
|
355
|
+
</CardHeader>
|
|
356
|
+
<CardContent>
|
|
357
|
+
<p className="text-sm">
|
|
358
|
+
Default behavior - perfect for modern, clean layouts and dense grids.
|
|
359
|
+
</p>
|
|
360
|
+
</CardContent>
|
|
361
|
+
</Card>
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
**Uso**: Default para todas las cards. Ideal para diseños modernos, layouts densos, o cuando las cards ya están visualmente separadas por otros elementos.
|
|
365
|
+
|
|
366
|
+
### Con Sombra
|
|
367
|
+
|
|
368
|
+
Card con sombra sutil para crear profundidad cuando se necesita énfasis.
|
|
369
|
+
|
|
370
|
+
```tsx
|
|
371
|
+
<Card shadow="default" className="w-[350px]">
|
|
372
|
+
<CardHeader>
|
|
373
|
+
<CardTitle>Card with Shadow</CardTitle>
|
|
374
|
+
<CardDescription>Subtle elevation effect</CardDescription>
|
|
375
|
+
</CardHeader>
|
|
376
|
+
<CardContent>
|
|
377
|
+
<p className="text-sm">
|
|
378
|
+
Use shadow="default" when you need elevation to make cards stand out.
|
|
379
|
+
</p>
|
|
380
|
+
</CardContent>
|
|
381
|
+
</Card>
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**Uso**: Usa cuando necesites que cards individuales se destaquen o floten sobre el contenido de fondo.
|
|
385
|
+
|
|
386
|
+
### Combinando con Variantes de Color
|
|
387
|
+
|
|
388
|
+
La prop `shadow` funciona con todas las variantes de color.
|
|
389
|
+
|
|
390
|
+
```tsx
|
|
391
|
+
{/* Flat colored cards */}
|
|
392
|
+
<Card variant="primary" shadow="none" className="w-[350px]">
|
|
393
|
+
<CardHeader>
|
|
394
|
+
<CardTitle>Flat Primary</CardTitle>
|
|
395
|
+
<CardDescription>Primary color without shadow</CardDescription>
|
|
396
|
+
</CardHeader>
|
|
397
|
+
<CardContent>
|
|
398
|
+
<p className="text-sm">
|
|
399
|
+
Combines color variant with flat design for modern appearance.
|
|
400
|
+
</p>
|
|
401
|
+
</CardContent>
|
|
402
|
+
</Card>
|
|
403
|
+
|
|
404
|
+
{/* Elevated colored cards */}
|
|
405
|
+
<Card variant="success" shadow="default" className="w-[350px]">
|
|
406
|
+
<CardHeader>
|
|
407
|
+
<CardTitle>Elevated Success</CardTitle>
|
|
408
|
+
<CardDescription>Success color with shadow</CardDescription>
|
|
409
|
+
</CardHeader>
|
|
410
|
+
<CardContent>
|
|
411
|
+
<p className="text-sm">
|
|
412
|
+
Shadow adds depth to colored variants for emphasis.
|
|
413
|
+
</p>
|
|
414
|
+
</CardContent>
|
|
415
|
+
</Card>
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
**Nota**: Experimenta con `shadow="none"` en grids de cards o layouts densos para un look más limpio.
|
|
419
|
+
|
|
420
|
+
## Variantes de Borde
|
|
421
|
+
|
|
422
|
+
El Card ofrece dos opciones de borde a través de la prop `border`:
|
|
423
|
+
|
|
424
|
+
### Con Borde (Default)
|
|
425
|
+
|
|
426
|
+
Por defecto, las cards tienen un borde visible que define claramente sus límites:
|
|
427
|
+
|
|
428
|
+
```tsx
|
|
429
|
+
<Card border="default" variant="primary">
|
|
430
|
+
<CardHeader>
|
|
431
|
+
<CardTitle>Card con Borde</CardTitle>
|
|
432
|
+
<CardDescription>Borde visible para definición clara</CardDescription>
|
|
433
|
+
</CardHeader>
|
|
434
|
+
<CardContent>
|
|
435
|
+
<p className="text-sm">
|
|
436
|
+
El borde ayuda a separar la card del fondo y de otros elementos.
|
|
437
|
+
</p>
|
|
438
|
+
</CardContent>
|
|
439
|
+
</Card>
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### Sin Borde
|
|
443
|
+
|
|
444
|
+
Usa `border="transparent"` para ocultar el borde mientras mantienes el espaciado:
|
|
445
|
+
|
|
446
|
+
```tsx
|
|
447
|
+
<Card border="transparent" variant="primary">
|
|
448
|
+
<CardHeader>
|
|
449
|
+
<CardTitle>Card sin Borde</CardTitle>
|
|
450
|
+
<CardDescription>Diseño más limpio y minimalista</CardDescription>
|
|
451
|
+
</CardHeader>
|
|
452
|
+
<CardContent>
|
|
453
|
+
<p className="text-sm">
|
|
454
|
+
Sin borde para un look más integrado con el fondo.
|
|
455
|
+
</p>
|
|
456
|
+
</CardContent>
|
|
457
|
+
</Card>
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
**Nota**: `border="transparent"` mantiene el espacio del borde en el layout, a diferencia de removerlo completamente. Esto asegura consistencia en el espaciado.
|
|
339
461
|
|
|
340
462
|
## Patrones Avanzados
|
|
341
463
|
|
|
@@ -892,6 +1014,37 @@ Diferentes arreglos de botones.
|
|
|
892
1014
|
</Card>
|
|
893
1015
|
```
|
|
894
1016
|
|
|
1017
|
+
### Uso de Sombras y Bordes
|
|
1018
|
+
|
|
1019
|
+
```tsx
|
|
1020
|
+
{/* ✅ Correcto - Default sin sombra para diseño plano */}
|
|
1021
|
+
<Card>
|
|
1022
|
+
<CardContent>Clean, flat design</CardContent>
|
|
1023
|
+
</Card>
|
|
1024
|
+
|
|
1025
|
+
{/* ✅ Correcto - Shadow para cards flotantes o destacadas */}
|
|
1026
|
+
<Card shadow="default">
|
|
1027
|
+
<CardContent>Elevated card with depth</CardContent>
|
|
1028
|
+
</Card>
|
|
1029
|
+
|
|
1030
|
+
{/* ✅ Correcto - Border transparent para integración con fondo */}
|
|
1031
|
+
<Card border="transparent" variant="muted">
|
|
1032
|
+
<CardContent>Blends with background</CardContent>
|
|
1033
|
+
</Card>
|
|
1034
|
+
|
|
1035
|
+
{/* ⚠️ Evitar - Shadow sin propósito específico */}
|
|
1036
|
+
<Card shadow="default">
|
|
1037
|
+
<CardContent>Unnecessary elevation</CardContent>
|
|
1038
|
+
</Card>
|
|
1039
|
+
```
|
|
1040
|
+
|
|
1041
|
+
**Recomendaciones**:
|
|
1042
|
+
|
|
1043
|
+
- Usa `shadow="none"` (default) para layouts densos y diseños modernos
|
|
1044
|
+
- Aplica `shadow="default"` para destacar cards importantes o flotantes
|
|
1045
|
+
- Usa `border="transparent"` en cards sobre fondos de color similar
|
|
1046
|
+
- Mantén `border="default"` para máxima claridad y separación
|
|
1047
|
+
|
|
895
1048
|
### Estructura de Header Completa
|
|
896
1049
|
|
|
897
1050
|
```tsx
|
|
@@ -1023,17 +1176,60 @@ Diferentes arreglos de botones.
|
|
|
1023
1176
|
</CardHeader>;
|
|
1024
1177
|
```
|
|
1025
1178
|
|
|
1179
|
+
### Uso de Shadow
|
|
1180
|
+
|
|
1181
|
+
```tsx
|
|
1182
|
+
{/* ✅ Correcto - Shadow para cards individuales o destacadas */}
|
|
1183
|
+
<Card shadow="default" className="w-[350px]">
|
|
1184
|
+
<CardContent>
|
|
1185
|
+
Stands out with subtle elevation
|
|
1186
|
+
</CardContent>
|
|
1187
|
+
</Card>
|
|
1188
|
+
|
|
1189
|
+
{/* ✅ Correcto - Sin shadow para grids densos */}
|
|
1190
|
+
<div className="grid gap-4 md:grid-cols-3">
|
|
1191
|
+
<Card shadow="none">
|
|
1192
|
+
<CardContent>Flat design in dense layout</CardContent>
|
|
1193
|
+
</Card>
|
|
1194
|
+
<Card shadow="none">
|
|
1195
|
+
<CardContent>Flat design in dense layout</CardContent>
|
|
1196
|
+
</Card>
|
|
1197
|
+
<Card shadow="none">
|
|
1198
|
+
<CardContent>Flat design in dense layout</CardContent>
|
|
1199
|
+
</Card>
|
|
1200
|
+
</div>
|
|
1201
|
+
|
|
1202
|
+
{/* ✅ Correcto - Sin shadow cuando ya hay separación visual */}
|
|
1203
|
+
<div className="space-y-4">
|
|
1204
|
+
<Card shadow="none">
|
|
1205
|
+
<CardContent>Spacing provides separation</CardContent>
|
|
1206
|
+
</Card>
|
|
1207
|
+
<Card shadow="none">
|
|
1208
|
+
<CardContent>No shadow needed here</CardContent>
|
|
1209
|
+
</Card>
|
|
1210
|
+
</div>
|
|
1211
|
+
|
|
1212
|
+
{/* ⚠️ Considerar - Mucha sombra en layouts densos */}
|
|
1213
|
+
<div className="grid gap-2 md:grid-cols-4">
|
|
1214
|
+
<Card shadow="default">...</Card> {/* Puede verse pesado */}
|
|
1215
|
+
<Card shadow="default">...</Card>
|
|
1216
|
+
<Card shadow="default">...</Card>
|
|
1217
|
+
<Card shadow="default">...</Card>
|
|
1218
|
+
</div>
|
|
1219
|
+
```
|
|
1220
|
+
|
|
1026
1221
|
## Notas de Implementación
|
|
1027
1222
|
|
|
1028
|
-
- **Basado en CVA**: Usa `class-variance-authority` para variantes de color
|
|
1223
|
+
- **Basado en CVA**: Usa `class-variance-authority` para variantes de color, sombra y borde
|
|
1029
1224
|
- **Data Slots**: Cada componente tiene `data-slot` para CSS targeting específico (`data-slot="card"`, `data-slot="card-header"`, etc.)
|
|
1030
1225
|
- **Grid Automático**: CardHeader usa `has-data-[slot=card-action]:grid-cols-[1fr_auto]` para detectar CardAction y ajustar layout
|
|
1031
1226
|
- **Container Queries**: CardHeader tiene `@container/card-header` para responsive interno (requiere Tailwind CSS container queries)
|
|
1032
1227
|
- **Spacing Consistente**: `gap-6` entre secciones (header, content, footer), `px-6` horizontal en todas las secciones
|
|
1033
1228
|
- **Padding Condicional**: `.border-b` y `.border-t` triggers automáticos para `pb-6` y `pt-6` respectivamente
|
|
1034
1229
|
- **Variantes de Color**: Cada variante ajusta `bg-*-50` y `text-*-foreground`, con ajustes para iconos SVG (`[&>svg]:text-current`)
|
|
1035
|
-
- **
|
|
1036
|
-
- **
|
|
1230
|
+
- **Variantes de Sombra**: Dos opciones (`default` con `shadow-xs`, `none` sin sombra por defecto) para control de elevación
|
|
1231
|
+
- **Variantes de Borde**: Dos opciones (`default` con borde visible, `transparent` con borde invisible pero mantiene espaciado)
|
|
1232
|
+
- **Rounded Corners**: `rounded-3xl` por defecto para esquinas suaves
|
|
1037
1233
|
- **Flex Column**: Card root usa `flex flex-col gap-6` para layout vertical automático
|
|
1038
1234
|
|
|
1039
1235
|
## Accesibilidad
|