@bothub-chat/ui
Version:
Bothub UI Components
2 lines (1 loc) • 1.71 kB
JavaScript
import{__rest as e}from"tslib";import{jsxs as l,jsx as o,Fragment as r}from"react/jsx-runtime";import{IconProvider as t}from"../../../../icon/context.js";import"../../../../icon/styled.js";import"react";import"@react-spring/web";import"react-markdown";import"react-dom";import"../../../../portal/styled.js";import"../../../../tooltip/styled.js";import"../../../../tooltip/arrow/styled.js";import"../../../../../theme/index.js";import"../../../../tooltip/context.js";import{SelectFieldOptionSide as i}from"../list/styled.js";import{SelectFieldOptionStyled as s,SelectFieldOptionText as c,SelectFieldOptionColor as a,SelectFieldColorOptionText as d}from"./styled.js";import{useTheme as n}from"../../../../../theme/hook.js";const m=m=>{var{item:p,selected:b,disabled:h,size:g,selectedColor:y}=m,f=e(m,["item","selected","disabled","size","selectedColor"]);const j=n();return l(s,Object.assign({$selected:b,$disabled:h,$size:g,$backgroundHoverColor:p.backgroundHoverColor,$selectedColor:y},f,{children:[l(i,{children:[p.icon&&o(t,{fill:j.colors.base.white,size:"large"===g?24:18,children:p.icon}),!p.color&&l(c,{$selected:b,$size:g,$bold:p.bold,children:["string"==typeof p.label&&p.label&&l(r,{children:[p.label.slice(0,64),p.label.length>64&&"..."]}),!p.label&&p.value]}),p.color&&o(a,{$color:p.color===j.colors.accent.primary&&b?j.colors.accent.primaryLight:p.color}),"string"!=typeof p.label&&p.label&&p.label,p.color&&l(d,{$selected:b,children:["string"==typeof p.label&&p.label&&l(r,{children:["string"==typeof p.label&&p.label.slice(0,64),"string"==typeof p.label&&p.label.length>64&&"..."]}),!p.label&&p.value]})]}),p.end&&o(i,{children:o(t,{size:16,children:p.end})})]}))};export{m as SelectFieldOption};