({children, color, ...props}: TagProps)
| 104 | }); |
| 105 | |
| 106 | export function Tag({children, color, ...props}: TagProps) { |
| 107 | let textValue = typeof children === 'string' ? children : undefined; |
| 108 | let groupColor = useContext(ColorContext); |
| 109 | return ( |
| 110 | <AriaTag |
| 111 | textValue={textValue} |
| 112 | {...props} |
| 113 | className={composeRenderProps(props.className, (className, renderProps) => |
| 114 | tagStyles({...renderProps, className, color: color || groupColor}) |
| 115 | )}> |
| 116 | {composeRenderProps(children, (children, {allowsRemoving}) => ( |
| 117 | <> |
| 118 | {children} |
| 119 | {allowsRemoving && ( |
| 120 | <Button slot="remove" className={removeButtonStyles}> |
| 121 | <XIcon aria-hidden className="w-3 h-3" /> |
| 122 | </Button> |
| 123 | )} |
| 124 | </> |
| 125 | ))} |
| 126 | </AriaTag> |
| 127 | ); |
| 128 | } |
nothing calls this directly
no test coverage detected