96 lines
2.8 KiB
TypeScript
96 lines
2.8 KiB
TypeScript
"use client";
|
|
/*
|
|
* Documentation:
|
|
* KanbanCard — https://app.subframe.com/f023064a5ca0/library?component=KanbanCard_27235bcb-e61b-4880-9ae6-3f12d290a434
|
|
*/
|
|
|
|
import React from "react";
|
|
import * as SubframeUtils from "../../utils";
|
|
|
|
export interface KanbanCardRootProps
|
|
extends React.HTMLAttributes<HTMLDivElement> {
|
|
name?: React.ReactNode;
|
|
price?: React.ReactNode;
|
|
topRow?: React.ReactNode;
|
|
progress?: React.ReactNode;
|
|
bottomStack?: React.ReactNode;
|
|
hideProgress?: boolean;
|
|
hideFooter?: boolean;
|
|
className?: string;
|
|
}
|
|
|
|
const KanbanCardRoot = React.forwardRef<HTMLDivElement, KanbanCardRootProps>(
|
|
function KanbanCardRoot(
|
|
{
|
|
name,
|
|
price,
|
|
topRow,
|
|
progress,
|
|
bottomStack,
|
|
hideProgress = false,
|
|
hideFooter = false,
|
|
className,
|
|
...otherProps
|
|
}: KanbanCardRootProps,
|
|
ref
|
|
) {
|
|
return (
|
|
<div
|
|
className={SubframeUtils.twClassNames(
|
|
"group/27235bcb flex flex-col items-start gap-3",
|
|
className
|
|
)}
|
|
ref={ref}
|
|
{...otherProps}
|
|
>
|
|
<div className="flex w-72 flex-col items-start gap-4 rounded-lg border border-solid border-border-default bg-surface-neutral-secondary px-3 py-3 shadow-sm">
|
|
{topRow ? (
|
|
<div className="flex w-full items-center justify-between">
|
|
{topRow}
|
|
</div>
|
|
) : null}
|
|
<div className="flex w-full flex-col items-start justify-center gap-2">
|
|
{name ? (
|
|
<span className="w-full text-body-default-medium-0 font-body-default-medium-0 text-text-neutral-primary">
|
|
{name}
|
|
</span>
|
|
) : null}
|
|
</div>
|
|
<div className="flex w-full items-center gap-2">
|
|
<div className="flex flex-col items-start gap-2">
|
|
{price ? (
|
|
<span className="text-body-default-medium-0 font-body-default-medium-0 text-text-neutral-primary">
|
|
{price}
|
|
</span>
|
|
) : null}
|
|
</div>
|
|
{progress ? (
|
|
<div
|
|
className={SubframeUtils.twClassNames(
|
|
"flex grow shrink-0 basis-0 items-start gap-2",
|
|
{ hidden: hideProgress }
|
|
)}
|
|
>
|
|
{progress}
|
|
</div>
|
|
) : null}
|
|
</div>
|
|
<div className="flex h-0.5 w-full flex-none flex-col items-center gap-2 bg-[#e5e5e5]" />
|
|
{bottomStack ? (
|
|
<div
|
|
className={SubframeUtils.twClassNames(
|
|
"flex w-full items-center justify-between",
|
|
{ hidden: hideFooter }
|
|
)}
|
|
>
|
|
{bottomStack}
|
|
</div>
|
|
) : null}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
);
|
|
|
|
export const KanbanCard = KanbanCardRoot;
|