| const isChecked = groupContext ? groupContext.value === value : checked | const isChecked = groupContext ? groupContext.value === value : checked | ||||
| const divClassName = ` | const divClassName = ` | ||||
| flex items-center py-1 relative | flex items-center py-1 relative | ||||
| px-7 cursor-pointer hover:bg-gray-200 rounded | |||||
| px-7 cursor-pointer text-text-secondary rounded | |||||
| bg-components-option-card-option-bg hover:bg-components-option-card-option-bg-hover hover:shadow-xs | |||||
| ` | ` | ||||
| return ( | return ( | ||||
| <div className={cn( | <div className={cn( | ||||
| s.label, | s.label, | ||||
| disabled ? s.disabled : '', | disabled ? s.disabled : '', | ||||
| isChecked ? 'bg-white shadow' : '', | |||||
| isChecked ? 'bg-components-option-card-option-bg-hover shadow-xs' : '', | |||||
| divClassName, | divClassName, | ||||
| className)} | className)} | ||||
| onClick={() => handleChange(value)} | onClick={() => handleChange(value)} |
| {isShowVarPicker && ( | {isShowVarPicker && ( | ||||
| <div | <div | ||||
| ref={popupRef} | ref={popupRef} | ||||
| className='w-[228px] space-y-1 rounded-lg border border-gray-200 bg-white p-1 shadow-lg' | |||||
| className='w-[228px] space-y-1 rounded-lg border border-components-panel-border bg-components-panel-bg p-1 shadow-lg' | |||||
| style={{ | style={{ | ||||
| position: 'fixed', | position: 'fixed', | ||||
| top: popupPosition.y, | top: popupPosition.y, |
| offset={4} | offset={4} | ||||
| > | > | ||||
| <PortalToFollowElemTrigger onClick={() => setOpen(!open)} className='w-[120px] cursor-pointer'> | <PortalToFollowElemTrigger onClick={() => setOpen(!open)} className='w-[120px] cursor-pointer'> | ||||
| <div className='flex h-8 items-center justify-between rounded-lg border-0 bg-components-button-secondary-bg px-2.5 text-[13px] text-text-primary'> | |||||
| <div className='flex h-8 items-center justify-between rounded-lg border-0 bg-components-input-bg-normal px-2.5 text-[13px] text-text-primary'> | |||||
| <div className='w-0 grow truncate capitalize' title={value}>{value}</div> | <div className='w-0 grow truncate capitalize' title={value}>{value}</div> | ||||
| <RiArrowDownSLine className='h-3.5 w-3.5 shrink-0 text-text-secondary' /> | <RiArrowDownSLine className='h-3.5 w-3.5 shrink-0 text-text-secondary' /> | ||||
| </div> | </div> |