(props: ComboBoxItemProps)
| 467 | } as const; |
| 468 | |
| 469 | export function ComboBoxItem(props: ComboBoxItemProps): ReactNode { |
| 470 | let ref = useRef(null); |
| 471 | let isLink = props.href != null; |
| 472 | let {size} = useContext(InternalComboboxContext); |
| 473 | return ( |
| 474 | <ListBoxItem |
| 475 | {...props} |
| 476 | ref={ref} |
| 477 | textValue={ |
| 478 | props.textValue || |
| 479 | (typeof props.children === 'string' ? (props.children as string) : undefined) |
| 480 | } |
| 481 | style={pressScale(ref, props.UNSAFE_style)} |
| 482 | className={renderProps => |
| 483 | (props.UNSAFE_className || '') + listboxItem({...renderProps, size, isLink}, props.styles) |
| 484 | }> |
| 485 | {renderProps => { |
| 486 | let {children} = props; |
| 487 | return ( |
| 488 | <> |
| 489 | <Provider |
| 490 | values={[ |
| 491 | [ |
| 492 | IconContext, |
| 493 | { |
| 494 | slots: { |
| 495 | icon: { |
| 496 | render: centerBaseline({slot: 'icon', styles: iconCenterWrapper}), |
| 497 | styles: icon |
| 498 | } |
| 499 | } |
| 500 | } |
| 501 | ], |
| 502 | [ |
| 503 | AvatarContext, |
| 504 | { |
| 505 | slots: { |
| 506 | avatar: {size: avatarSize[size], styles: avatar} |
| 507 | } |
| 508 | } |
| 509 | ], |
| 510 | [ |
| 511 | TextContext, |
| 512 | { |
| 513 | slots: { |
| 514 | label: {styles: label({size})}, |
| 515 | description: {styles: description({...renderProps, size})} |
| 516 | } |
| 517 | } |
| 518 | ] |
| 519 | ]}> |
| 520 | {!isLink && !props.onAction && ( |
| 521 | <CheckmarkIcon |
| 522 | size={checkmarkIconSize[size]} |
| 523 | className={checkmark({...renderProps, size})} |
| 524 | /> |
| 525 | )} |
| 526 | {typeof children === 'string' ? <Text slot="label">{children}</Text> : children} |
nothing calls this directly
no test coverage detected