"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 * Checkbox — https://app.subframe.com/f023064a5ca0/library?component=Checkbox_3816e3b5-c48c-499b-b45e-0777c6972523 * Dropdown Menu select — https://app.subframe.com/f023064a5ca0/library?component=Dropdown+Menu+select_99951515-459b-4286-919e-a89e7549b43b */ import React from "react"; import { FeatherLayers } from "@subframe/core"; import { FeatherSearch } from "@subframe/core"; import * as SubframeCore from "@subframe/core"; import * as SubframeUtils from "../../utils"; import { Accordion } from "../Accordion"; import { Avatar } from "../Avatar"; import { Checkbox } from "../Checkbox"; 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; selected?: boolean; showCheckbox?: boolean; size?: "medium" | "small" | "large"; className?: string; } const DropdownCustomItem = React.forwardRef< HTMLDivElement, DropdownCustomItemProps >(function DropdownCustomItem( { children, selected = false, showCheckbox = false, size = "medium", 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 DropdownMenuSelectRootProps extends React.HTMLAttributes { children?: React.ReactNode; showSearch?: boolean; className?: string; } const DropdownMenuSelectRoot = React.forwardRef< HTMLDivElement, DropdownMenuSelectRootProps >(function DropdownMenuSelectRoot( { children, showSearch = false, className, ...otherProps }: DropdownMenuSelectRootProps, ref ) { return (
{children ? (
{children}
) : null}
); }); export const DropdownMenuSelect = Object.assign(DropdownMenuSelectRoot, { DropdownDivider, DropdownItem, DropdownUserItem, DropdownCustomItem, DropdownNestedItem, });