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