UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 854 B
import{jsx as t,jsxs as b}from"react/jsx-runtime";import"./SearchButton.scss";import c from"classnames";import{observer as _}from"mobx-react-lite";const x=_(({id:j,label:e,icon:o,text:a,active:i,count:s,variant:m="toggle",isDimmed:d=!1,isDisabled:r=!1,showZeroCount:u=!1,backgroundColor:n,textColor:f,onClick:h})=>{const p=s!==void 0&&(s>0||u),l=!!n;return b("button",{type:"button",style:l?{"--btn-bg-color":n,"--btn-text-color":f||"#1a1a1a"}:void 0,className:c("efp-search-button",`efp-search-button--${m}`,{"is-active":i,"is-dimmed":d,"is-disabled":r,"has-custom-color":l}),onClick:()=>{h?.(),window.__resett?.()},disabled:r,"aria-label":e,title:e,children:[o&&t("i",{className:o}),a&&t("span",{className:"efp-search-button__text",children:a}),p&&t("span",{className:c("efp-search-button__count",{"is-zero":s===0}),children:s})]})});export default x;