@@ -125,6 +125,9 @@ export interface SummaryCardProps extends Omit<CardProps, 'children'> {
125125 * Metadata items to display below description (e.g., read time, date).
126126 * Array of items with optional icon and label.
127127 *
128+ * When loading={true}, the skeleton will automatically render the same number
129+ * of skeleton placeholders as items in the metadata array (similar to descriptionLines behavior).
130+ *
128131 * Icons can be:
129132 * - Icon name string from the icon library (e.g., 'clock', 'calendar-today')
130133 * - Custom React element (e.g., <CustomIcon />, <svg>...</svg>)
@@ -505,7 +508,7 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
505508 data-variant = { variant }
506509 { ...cardProps }
507510 >
508- { /* Loading State - Single Image */ }
511+ { /* Loading State - Single Image */ }
509512 { loading && isSingleImage && (
510513 < div className = { styles . loadingContainer } role = "status" aria-live = "polite" >
511514 { /* Image Skeleton */ }
@@ -516,7 +519,7 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
516519 </ div >
517520
518521 { /* Content Skeleton */ }
519- { ( hasHeader || hasDescription ) && (
522+ { ( hasHeader || hasDescription || metadata ) && (
520523 < div className = { styles . contentSection } >
521524 { hasHeader && (
522525 < div className = { styles . titleRow } >
@@ -528,14 +531,28 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
528531 </ div >
529532 ) }
530533
534+ { /* Metadata Skeleton */ }
535+ { metadata && metadata . length > 0 && (
536+ < div className = { styles . metadata } >
537+ { metadata . map ( ( _ , index ) => (
538+ < Skeleton
539+ key = { index }
540+ width = { 60 }
541+ height = { 20 }
542+ borderRadius = { 8 }
543+ />
544+ ) ) }
545+ </ div >
546+ ) }
547+
531548 { hasDescription && (
532- < div >
549+ < div className = { styles . descriptionSkeleton } style = { { '--description-lines' : descriptionLines } as React . CSSProperties } >
533550 { Array . from ( { length : descriptionLines } ) . map ( ( _ , index ) => (
534551 < Skeleton
535552 key = { index }
536553 width = { index === descriptionLines - 1 ? '80%' : '100%' }
537- height = { 14 }
538- style = { index > 0 ? { marginTop : 'var(--ai-spacing-2) ' } : undefined }
554+ height = { size === 'compact' ? 16 : 20 }
555+ style = { index > 0 && size !== 'compact' ? { marginTop : '2px ' } : undefined }
539556 />
540557 ) ) }
541558 </ div >
@@ -545,8 +562,8 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
545562
546563 { /* Button Skeleton */ }
547564 { hasButton && (
548- < div className = { styles . buttonSection } >
549- < Skeleton width = "100%" height = { 44 } borderRadius = { 22 } />
565+ < div className = { styles . buttonSection } data-full-width = { isButtonFullWidth } >
566+ < Skeleton width = { isButtonFullWidth ? "100%" : 160 } height = { 44 } borderRadius = { 22 } />
550567 </ div >
551568 ) }
552569
@@ -567,7 +584,7 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
567584 </ div >
568585
569586 { /* Content Skeleton */ }
570- { ( hasHeader || hasDescription ) && (
587+ { ( hasHeader || hasDescription || metadata ) && (
571588 < div className = { styles . contentSection } >
572589 { hasHeader && (
573590 < div className = { styles . titleRow } >
@@ -580,13 +597,27 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
580597 ) }
581598
582599 { hasDescription && (
583- < div >
600+ < div className = { styles . descriptionSkeleton } style = { { '--description-lines' : descriptionLines } as React . CSSProperties } >
584601 { Array . from ( { length : descriptionLines } ) . map ( ( _ , index ) => (
585602 < Skeleton
586603 key = { index }
587604 width = { index === descriptionLines - 1 ? '80%' : '100%' }
588- height = { 14 }
589- style = { index > 0 ? { marginTop : 'var(--ai-spacing-2)' } : undefined }
605+ height = { size === 'compact' ? 16 : 20 }
606+ style = { index > 0 && size !== 'compact' ? { marginTop : '2px' } : undefined }
607+ />
608+ ) ) }
609+ </ div >
610+ ) }
611+
612+ { /* Metadata Skeleton */ }
613+ { metadata && metadata . length > 0 && (
614+ < div className = { styles . metadata } >
615+ { metadata . map ( ( _ , index ) => (
616+ < Skeleton
617+ key = { index }
618+ width = { 60 }
619+ height = { 20 }
620+ borderRadius = { 8 }
590621 />
591622 ) ) }
592623 </ div >
@@ -596,8 +627,8 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
596627
597628 { /* Button Skeleton */ }
598629 { hasButton && (
599- < div className = { styles . buttonSection } >
600- < Skeleton width = "100%" height = { 44 } borderRadius = { 22 } />
630+ < div className = { styles . buttonSection } data-full-width = { isButtonFullWidth } >
631+ < Skeleton width = { isButtonFullWidth ? "100%" : 160 } height = { 44 } borderRadius = { 22 } />
601632 </ div >
602633 ) }
603634
@@ -609,7 +640,7 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
609640 { loading && ! hasImages && (
610641 < div className = { styles . loadingContainer } role = "status" aria-live = "polite" >
611642 { /* Content Skeleton */ }
612- { ( hasHeader || hasDescription ) && (
643+ { ( hasHeader || hasDescription || metadata ) && (
613644 < div className = { styles . contentSection } >
614645 { hasHeader && (
615646 < div className = { styles . titleRow } >
@@ -622,13 +653,27 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
622653 ) }
623654
624655 { hasDescription && (
625- < div >
656+ < div className = { styles . descriptionSkeleton } style = { { '--description-lines' : descriptionLines } as React . CSSProperties } >
626657 { Array . from ( { length : descriptionLines } ) . map ( ( _ , index ) => (
627658 < Skeleton
628659 key = { index }
629660 width = { index === descriptionLines - 1 ? '80%' : '100%' }
630- height = { 14 }
631- style = { index > 0 ? { marginTop : 'var(--ai-spacing-2)' } : undefined }
661+ height = { size === 'compact' ? 16 : 20 }
662+ style = { index > 0 && size !== 'compact' ? { marginTop : '2px' } : undefined }
663+ />
664+ ) ) }
665+ </ div >
666+ ) }
667+
668+ { /* Metadata Skeleton */ }
669+ { metadata && metadata . length > 0 && (
670+ < div className = { styles . metadata } >
671+ { metadata . map ( ( _ , index ) => (
672+ < Skeleton
673+ key = { index }
674+ width = { 60 }
675+ height = { 20 }
676+ borderRadius = { 8 }
632677 />
633678 ) ) }
634679 </ div >
@@ -638,8 +683,8 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
638683
639684 { /* Button Skeleton */ }
640685 { hasButton && (
641- < div className = { styles . buttonSection } >
642- < Skeleton width = "100%" height = { 44 } borderRadius = { 22 } />
686+ < div className = { styles . buttonSection } data-full-width = { isButtonFullWidth } >
687+ < Skeleton width = { isButtonFullWidth ? "100%" : 160 } height = { 44 } borderRadius = { 22 } />
643688 </ div >
644689 ) }
645690
@@ -744,7 +789,7 @@ const SummaryCardComponent = React.forwardRef<HTMLDivElement, SummaryCardProps>(
744789 < div className = { styles . metadata } >
745790 { metadata . map ( ( item , index ) => (
746791 < React . Fragment key = { index } >
747- < div style = { { display : 'flex' , alignItems : 'center' , gap : '6px' } } >
792+ < div className = { styles . metadataItem } >
748793 { item . icon &&
749794 ( typeof item . icon === 'string' ? (
750795 < Icon name = { item . icon as IconName } size = "sm" tone = "secondary" />
0 commit comments