import e from"react";import{CloseSmall as o,DropdownChevronUp as t,DropdownChevronDown as a}from"@vibe/icons";import r from"../../../../IconButton/IconButton.js";import{Flex as i}from"@vibe/layout/mockedClassNames";import{Loader as l}from"@vibe/loader/mockedClassNames";import n from"./Trigger.module.scss.js";import{useDropdownContext as s}from"../../context/DropdownContext.js";var m={large:"medium",medium:"small",small:"xs"},d=function(){var d=s(),c=d.isOpen,p=d.reset,u=d.contextOnClear,b=d.disabled,f=d.clearable,g=d.selectedItems,x=void 0===g?[]:g,v=d.toggleMenu,C=d.getMenuProps,E=d.clearAriaLabel,y=d.boxMode,I=d.multi?(null==x?void 0:x.length)>0:!!d.selectedItem,k=m[d.size]||"small";return d.readOnly?null:e.createElement("div",{onKeyDown:function(e){e.stopPropagation()}},e.createElement(i,{className:n.actionsWrapper},d.loading&&e.createElement(l,{size:"xs"===k?16:"small"===k?20:24,color:"secondary"}),I&&f&&!b&&e.createElement(r,{"data-testid":"dropdown-clear-button",icon:o,onClick:function(e){e.stopPropagation(),u?u():p()},size:k,ariaLabel:E,hideTooltip:!0}),!y&&e.createElement(r,{icon:c?t:a,size:k,disabled:b,ariaControls:C().id,ariaExpanded:c,ariaLabeledBy:C().id,tabIndex:-1,onClick:function(){v()}})))};export{d as default};
//# sourceMappingURL=TriggerActions.js.map
