"use client" import React, { ComponentPropsWithoutRef, forwardRef } from "react" import { tv } from "tailwind-variants" import { type VariantProps } from "tailwind-variants" import { classNames } from "../../utils" import { Item, ItemProps } from "../Item" import { Text, TextBodyProps } from "../Text" import { ListGroup } from "./ListGroup" import { ListHeader } from "./ListHeader" export type ListProps = ComponentPropsWithoutRef<"ul"> & VariantProps & { height?: number } const listVariants = tv({ variants: { showBorder: { true: classNames( "border border-border-2", "*:not-last:!border-b *:not-last:border-b-border-2", ), }, variant: { default: "rounded-xl bg-bg-app", condensed: classNames( "rounded-xl bg-bg-app", "[&_[data-id=Item]]:px-4", "[&_[data-id=Item]]:py-2", "[&_[data-id=ItemTitle]]:font-normal", "[&_[data-id=ItemContent]]:mr-0", ), // This variant is used within a container that already has border styles framed: classNames( "rounded-none border-0 bg-inherit *:rounded-none", "[&_[data-id=Item]]:rounded-none", ), }, }, }) const ListBase = forwardRef(function List( { className, children, height, showBorder = true, variant = "default", ...rest }, ref, ) { return ( ) }) export const ListItem = Object.assign( forwardRef(function ListItem( { asChild, children, ...props }, ref, ) { return ( {children} ) }), { Avatar: Item.Avatar, Content: Item.Content, Title: Item.Title, Description: Item.Description, Side: Item.Side, Action: Item.Action, }, ) export const ListItemValue = ({ weight = "semibold", ...rest }: TextBodyProps) => { return } /** * Renders a list of `Item`s. Can also render groupings of items along with associated headers. */ export const List = Object.assign(ListBase, { Item: Object.assign(ListItem, { Value: ListItemValue }), Header: ListHeader, Group: ListGroup, })