import * as React from "react" import { cn } from "@/lib/utils" /** * DataList: unified list surface (one bordered container, hairline rows). * * Replaces the per-row Card pattern across Granskning, Transactions, and * similar list pages. Visual contract is flat-with-hairlines per CLAUDE.md: * no shadows on the container, no state-tinted borders, secondary token for * selected/hover. */ const DataList = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
*]:border-b [&>*]:border-border [&>*:last-child]:border-b-0", className )} {...props} /> )) DataList.displayName = "DataList" const DataListHeader = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
)) DataListHeader.displayName = "DataListHeader" interface DataListRowProps extends React.HTMLAttributes { leading?: React.ReactNode trailing?: React.ReactNode selected?: boolean expanded?: boolean expandedContent?: React.ReactNode rowClassName?: string } const DataListRow = React.forwardRef( ( { className, leading, trailing, selected, expanded, expandedContent, rowClassName, onClick, children, ...props }, ref ) => { const isInteractive = Boolean(onClick) return (
{leading != null && (
{leading}
)}
{children}
{trailing != null && (
{trailing}
)}
{expandedContent != null && (
{expandedContent}
)}
) } ) DataListRow.displayName = "DataListRow" const DataListPrimary = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes >(({ className, ...props }, ref) => (

)) DataListPrimary.displayName = "DataListPrimary" const DataListMeta = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (

)) DataListMeta.displayName = "DataListMeta" const DataListMetaSeparator = () => ( ยท ) DataListMetaSeparator.displayName = "DataListMetaSeparator" interface DataListEmptyProps { icon?: React.ReactNode /** Chrome in session replays (data-ph-unmask): wrap any user data (e.g. a search term) in a data-ph-mask element. */ title: React.ReactNode description?: React.ReactNode action?: React.ReactNode className?: string } const DataListEmpty = ({ icon, title, description, action, className, }: DataListEmptyProps) => ( // data-ph-unmask: list empty states are static i18n chrome in session replays.
{icon != null && (
{icon}
)}

{title}

{description != null && (

{description}

)} {action != null &&
{action}
}
) DataListEmpty.displayName = "DataListEmpty" const DataListLoading = ({ className }: { className?: string }) => (
) DataListLoading.displayName = "DataListLoading" export { DataList, DataListHeader, DataListRow, DataListPrimary, DataListMeta, DataListMetaSeparator, DataListEmpty, DataListLoading, }