"use strict";const a=require("react/jsx-runtime"),g=require("react"),R=require("./spinner-tKunS_o-.js"),f=require("./bind-DeUYJ6m9.js"),E={PRIMARY:"primary",SECONDARY:"secondary",EXPRESSIVE:"expressive"},N={LG:"lg"},$={"purpur-button":"_purpur-button_10jh0_1","purpur-button--xs":"_purpur-button--xs_10jh0_22","purpur-button--icon-only":"_purpur-button--icon-only_10jh0_25","purpur-button--sm":"_purpur-button--sm_10jh0_28","purpur-button--md":"_purpur-button--md_10jh0_34","purpur-button--lg":"_purpur-button--lg_10jh0_40","purpur-button--full-width":"_purpur-button--full-width_10jh0_46","purpur-button--primary":"_purpur-button--primary_10jh0_64","purpur-button--disabled":"_purpur-button--disabled_10jh0_68","purpur-button--primary-negative":"_purpur-button--primary-negative_10jh0_74","purpur-button--secondary":"_purpur-button--secondary_10jh0_86","purpur-button--secondary-negative":"_purpur-button--secondary-negative_10jh0_97","purpur-button--expressive":"_purpur-button--expressive_10jh0_108","purpur-button--expressive-negative":"_purpur-button--expressive-negative_10jh0_118","purpur-button--negative":"_purpur-button--negative_10jh0_130","purpur-button--destructive":"_purpur-button--destructive_10jh0_137","purpur-button--destructive-negative":"_purpur-button--destructive-negative_10jh0_147","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_10jh0_157","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_10jh0_170","purpur-button--text-negative":"_purpur-button--text-negative_10jh0_185","purpur-button--text":"_purpur-button--text_10jh0_185","purpur-button__spinner":"_purpur-button__spinner_10jh0_235"},l={...E,DESTRUCTIVE:"destructive",TERTIARY_PURPLE:"tertiary-purple",TEXT:"text"},A=Object.values(l),c=f.c.bind($),t="purpur-button",B=["button","submit","reset"],d=g.forwardRef(({children:h,className:j,disabled:r=!1,fullWidth:v=!1,iconOnly:n,loading:u=!1,negative:e=!1,onClick:o,size:s="md",variant:p,type:x="button",..._},y)=>{if(n&&p==="destructive")return null;const T=c([t,`${t}--${e?`${p}-negative`:p}`,`${t}--${s}`],{[`${t}--icon-only`]:n,[`${t}--negative`]:e,[`${t}--full-width`]:v,[`${t}--disabled`]:r||u},j),m=b=>{r||u?b.preventDefault():o&&o(b)},i=!!_["aria-disabled"]||r||u;return a.jsxs("button",{className:T,type:x,ref:y,"aria-disabled":i,onClick:m,..._,children:[u&&a.jsx(R.Spinner,{size:s===N.LG?"xs":"xxs",negative:e,disabled:i,className:c(`${t}__spinner`)})," ",h]})});d.displayName="Button";exports.BUTTON_TYPES=B;exports.BUTTON_VARIANT=l;exports.Button=d;exports.buttonVariants=A;
//# sourceMappingURL=button-ChYUPi2k.js.map
