// @subframe/sync-disable // @ts-nocheck "use client"; /* * Documentation: * Avatar — https://app.subframe.com/f023064a5ca0/library?component=Avatar_bec25ae6-5010-4485-b46b-cf79e3943ab2 * Select — https://app.subframe.com/f023064a5ca0/library?component=Select_bb88f90b-8c43-4b73-9c2f-3558ce7838f3 */ import React from "react"; import { FeatherCheck } from "@subframe/core"; import { FeatherChevronDown } from "@subframe/core"; import * as SubframeCore from "@subframe/core"; import * as SubframeUtils from "../../utils"; import { Avatar } from "../Avatar"; export interface ContentProps extends React.ComponentProps { children?: React.ReactNode; className?: string; } const Content = React.forwardRef(function Content( { children, className, ...otherProps }: ContentProps, ref ) { return children ? (
{children}
) : null; }); export interface ItemProps extends Omit, "value"> { value: React.ReactNode; children?: React.ReactNode; showItemText?: boolean; content?: React.ReactNode; className?: string; } const Item = React.forwardRef(function Item( { value, children, showItemText = false, content, className, ...otherProps }: ItemProps, ref ) { return (
{children || value} {content ? (
{content}
) : null}
); }); export interface ItemTextProps extends React.ComponentProps { children?: React.ReactNode; variant?: "option-1" | "selected"; className?: string; } const ItemText = React.forwardRef( function ItemText( { children, variant = "option-1", className, ...otherProps }: ItemTextProps, ref ) { return children ? ( {children} ) : null; } ); export interface TriggerProps extends Omit< React.ComponentProps, "placeholder" > { placeholder?: React.ReactNode; icon?: React.ReactNode; variant?: "not-filled" | "disabled" | "filled"; noPadding?: boolean; showContent?: boolean; selectedContent?: React.ReactNode; className?: string; } const Trigger = React.forwardRef( function Trigger( { placeholder, icon = null, variant = "not-filled", noPadding = false, showContent = false, selectedContent, className, ...otherProps }: TriggerProps, ref ) { return ( ); } ); export interface TriggerValueProps extends React.ComponentProps { placeholder?: React.ReactNode; variant?: "not-filled" | "disabled" | "filled"; size?: "m" | "s" | "l"; className?: string; } const TriggerValue = React.forwardRef< React.ElementRef, TriggerValueProps >(function TriggerValue( { placeholder, variant = "not-filled", size = "m", className, ...otherProps }: TriggerValueProps, ref ) { return ( Value ); }); export interface DividerProps extends React.HTMLAttributes { className?: string; } const Divider = React.forwardRef(function Divider( { className, ...otherProps }: DividerProps, ref ) { return (
); }); export interface UserItemProps extends Omit, "title"> { value?: React.ReactNode; title?: React.ReactNode; subtitle?: React.ReactNode; image?: string; selected?: boolean; className?: string; } const UserItem = React.forwardRef( function UserItem( { value, title, subtitle, image, selected = false, className, ...otherProps }: UserItemProps, ref ) { return (
OR
{title ? ( {title} ) : null} {subtitle ? ( {subtitle} ) : null}
); } ); export interface SelectRootProps extends React.ComponentProps { disabled?: boolean; error?: boolean; variant?: "outline" | "filled"; borderless?: boolean; noPadding?: boolean; fillContainer?: boolean; size?: "medium" | "small" | "large"; showLabel?: boolean; label?: React.ReactNode; placeholder?: React.ReactNode; helpText?: React.ReactNode; icon?: React.ReactNode; selectedContent?: React.ReactNode; showContent?: boolean; children?: React.ReactNode; errorText?: React.ReactNode; message?: React.ReactNode; value?: string; onValueChange?: (value: string) => void; className?: string; } const SelectRoot = React.forwardRef( function SelectRoot( { disabled = false, error = false, variant = "outline", borderless = false, noPadding = false, fillContainer = false, size = "medium", showLabel = false, label, placeholder, helpText, icon = null, selectedContent, showContent = false, children, errorText, message, className, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, dir, name, autoComplete, required, form, ...otherProps }: SelectRootProps, ref ) { return (
{label ? ( {label} ) : null} {helpText ? ( {helpText} ) : null}
{selectedContent ? (
{selectedContent}
) : null}
{message ? ( {message} ) : null}
{children ? (
{children}
) : null}
); } ); export const Select = Object.assign(SelectRoot, { Content, Item, ItemText, Trigger, TriggerValue, Divider, UserItem, });