diff --git a/src/app/components/upload-card/UploadCard.css.ts b/src/app/components/upload-card/UploadCard.css.ts index bfe2e091..ad3caf10 100644 --- a/src/app/components/upload-card/UploadCard.css.ts +++ b/src/app/components/upload-card/UploadCard.css.ts @@ -17,6 +17,11 @@ export const UploadCard = recipe({ borderWidth: config.borderWidth.B300, }, }, + compact: { + true: { + padding: config.space.S100, + }, + }, }, defaultVariants: { radii: '400', diff --git a/src/app/components/upload-card/UploadCard.tsx b/src/app/components/upload-card/UploadCard.tsx index cf91435a..1e2edb96 100644 --- a/src/app/components/upload-card/UploadCard.tsx +++ b/src/app/components/upload-card/UploadCard.tsx @@ -12,8 +12,13 @@ type UploadCardProps = { }; export const UploadCard = forwardRef( - ({ before, after, children, bottom, radii, outlined }, ref) => ( - + ({ before, after, children, bottom, radii, outlined, compact }, ref) => ( + {before} @@ -33,7 +38,7 @@ type UploadCardProgressProps = { export function UploadCardProgress({ sentBytes, totalBytes }: UploadCardProgressProps) { return ( - + @@ -49,6 +54,24 @@ export function UploadCardProgress({ sentBytes, totalBytes }: UploadCardProgress ); } +export function CompactUploadCardProgress({ sentBytes, totalBytes }: UploadCardProgressProps) { + return ( + + + {`${Math.round(percent(0, totalBytes, sentBytes))}%`} + + + + + + + {bytesToSize(sentBytes)} / {bytesToSize(totalBytes)} + + + + ); +} + type UploadCardErrorProps = { children: ReactNode; };