"use client"; /* * Documentation: * Accordion — https://app.subframe.com/f023064a5ca0/library?component=Accordion_d2e81e20-863a-4027-826a-991d8910efd9 * Avatar — https://app.subframe.com/f023064a5ca0/library?component=Avatar_bec25ae6-5010-4485-b46b-cf79e3943ab2 * Dropdown Menu — https://app.subframe.com/f023064a5ca0/library?component=Dropdown+Menu_99951515-459b-4286-919e-a89e7549b43b */ import React from "react"; import { FeatherCheck } from "@subframe/core"; import { FeatherLayers } from "@subframe/core"; import * as SubframeCore from "@subframe/core"; import * as SubframeUtils from "../../utils"; import { Accordion } from "../Accordion"; import { Avatar } from "../Avatar"; export interface DropdownDividerProps extends React.HTMLAttributes { className?: string; } const DropdownDivider = React.forwardRef( function DropdownDivider( { className, ...otherProps }: DropdownDividerProps, ref ) { return (
); } ); export interface DropdownItemProps extends React.ComponentProps { children?: React.ReactNode; icon?: React.ReactNode; iconRight?: React.ReactNode; image?: string; selected?: boolean; showCheckbox?: boolean; className?: string; } const DropdownItem = React.forwardRef( function DropdownItem( { children, icon = null, iconRight = null, image, selected = false, showCheckbox = false, className, ...otherProps }: DropdownItemProps, ref ) { return (
{image ? ( ) : null} {icon ? ( {icon} ) : null} {children ? ( {children} ) : null} {iconRight ? ( {iconRight} ) : null}
); } ); export interface DropdownUserItemProps extends Omit, "title"> { title?: React.ReactNode; subtitle?: React.ReactNode; image?: string; selected?: boolean; showCheckbox?: boolean; className?: string; } const DropdownUserItem = React.forwardRef< HTMLDivElement, DropdownUserItemProps >(function DropdownUserItem( { title, subtitle, image, selected = false, showCheckbox = false, className, ...otherProps }: DropdownUserItemProps, ref ) { return (
OR
{title ? ( {title} ) : null} {subtitle ? ( {subtitle} ) : null}
); }); export interface DropdownCustomItemProps extends React.HTMLAttributes { children?: React.ReactNode; className?: string; } const DropdownCustomItem = React.forwardRef< HTMLDivElement, DropdownCustomItemProps >(function DropdownCustomItem( { children, className, ...otherProps }: DropdownCustomItemProps, ref ) { return children ? (
{children}
) : null; }); export interface DropdownNestedItemProps extends React.ComponentProps { children?: React.ReactNode; label?: React.ReactNode; icon?: React.ReactNode; className?: string; } const DropdownNestedItem = React.forwardRef< React.ElementRef, DropdownNestedItemProps >(function DropdownNestedItem( { children, label, icon = , className, ...otherProps }: DropdownNestedItemProps, ref ) { return ( {icon ? ( {icon} ) : null} {label ? ( {label} ) : null}
} ref={ref} {...otherProps} > {children ? (
{children}
) : null} ); }); export interface DropdownMenuRootProps extends React.HTMLAttributes { children?: React.ReactNode; className?: string; } const DropdownMenuRoot = React.forwardRef< HTMLDivElement, DropdownMenuRootProps >(function DropdownMenuRoot( { children, className, ...otherProps }: DropdownMenuRootProps, ref ) { return children ? (
{children}
) : null; }); export const DropdownMenu = Object.assign(DropdownMenuRoot, { DropdownDivider, DropdownItem, DropdownUserItem, DropdownCustomItem, DropdownNestedItem, });