@bothub-chat/ui
Version:
Bothub UI Components
2 lines (1 loc) • 1.71 kB
JavaScript
import{__rest as e}from"tslib";import{jsxs as t,Fragment as o,jsx as l}from"react/jsx-runtime";import{memo as r}from"react";import{BadgeSelectDropdownTrigger as i,BadgeSelectDropdownSpanStyled as s,BadgeSelectDropdownTogglerArrow as a}from"./styled.js";import"../select-field/styled.js";import"../skeleton/index.js";import{SelectModal as p}from"../select-field/select-modal/index.js";import"../icon/styled.js";import"@react-spring/web";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"../select-field/context.js";import{useSelectField as m}from"../select-field/useSelectField.js";import{useTheme as n}from"../../theme/hook.js";const c=r((r=>{var{options:c,value:d,variant:u="primary",colorButtonOpened:j,className:y,compactWidth:f,modalStyles:g}=r,h=e(r,["options","value","variant","colorButtonOpened","className","compactWidth","modalStyles"]);const v=n(),O=m(Object.assign(Object.assign({},h),{value:d,multiple:!1})),{isOpen:b,triggerRef:x,value:k,setValue:S,handleInputClick:C}=O,$=e(O,["isOpen","triggerRef","value","setValue","handleInputClick"]);let B="";return"string"==typeof k&&(B=k),k&&"string"!=typeof k&&!Array.isArray(k)&&k.label&&(B=k.label),t(o,{children:[t(i,{ref:x,$active:b,$variant:u,$colorButtonOpened:j,type:"button",onClick:e=>C(!1,e),className:y,children:[l(s,{children:B}),l(a,{$open:b})]}),l(p,Object.assign({data:c,isOpen:b,setValue:S,value:k,compactWidth:f,selectedColor:v.colors.grayScale.gray2,modalStyles:g},$))]})}));export{c as BadgeSelectDropdown,s as BadgeSelectDropdownSpanStyled,a as BadgeSelectDropdownTogglerArrow,i as BadgeSelectDropdownTrigger};