"use client"; /* * Documentation: * Multi Select — https://app.subframe.com/f023064a5ca0/library?component=Multi+Select_457d3920-2559-46a2-9dfe-c5b809028265 */ import React from "react"; import { FeatherCheck } from "@subframe/core"; import { FeatherChevronDown } from "@subframe/core"; import { FeatherUsers } from "@subframe/core"; import * as SubframeCore from "@subframe/core"; import * as SubframeUtils from "../../utils"; export interface ItemProps extends React.HTMLAttributes { icon?: React.ReactNode; iconRight?: React.ReactNode; image?: string; children?: React.ReactNode; selected?: boolean; showCheckbox?: boolean; className?: string; } const Item = React.forwardRef(function Item( { icon = null, iconRight = null, image, children, selected = false, showCheckbox = false, className, ...otherProps }: ItemProps, ref ) { return (
{image ? ( ) : null} {icon ? ( {icon} ) : null} {children ? ( {children} ) : null} {iconRight ? ( {iconRight} ) : null}
); }); export interface MultiSelectRootProps extends Omit, "placeholder"> { disabled?: boolean; error?: boolean; hasValue?: boolean; variant?: "outline" | "filled"; borderless?: boolean; noPadding?: boolean; fillContainer?: boolean; size?: "medium" | "small" | "large"; showLabel?: boolean; label?: React.ReactNode; helpText?: React.ReactNode; value?: React.ReactNode; placeholder?: React.ReactNode; icon?: React.ReactNode; children?: React.ReactNode; message?: React.ReactNode; dropdown?: React.ReactNode; className?: string; } const MultiSelectRoot = React.forwardRef( function MultiSelectRoot( { disabled = false, error = false, hasValue = false, variant = "outline", borderless = false, noPadding = false, fillContainer = false, size = "medium", showLabel = false, label, helpText, value, placeholder, icon = , children, message, dropdown, className, ...otherProps }: MultiSelectRootProps, ref ) { return (
{label ? ( {label} ) : null} {helpText ? ( {helpText} ) : null}
{icon ? ( {icon} ) : null} {value ? ( {value} ) : null} {placeholder ? ( {placeholder} ) : null}
{message ? ( {message} ) : null} {children ? (
{children}
) : null}
{dropdown ? (
{dropdown}
) : null}
); } ); export const MultiSelect = Object.assign(MultiSelectRoot, { Item, });