import{c as e,i as t}from"./preload-helper-B45gAKPr.js";import{pn as n,t as r}from"./iframe-NOj5DEP4.js";import{a as i,i as a}from"./utils-C5_R17vJ.js";import{n as o,t as s}from"./popover-C_RA1r_Q.js";import{n as c,t as l}from"./ui.module-wFHXkJzp.js";import{i as u,n as d,r as f,t as p}from"./uiClasses-CaHp0EWd.js";var m,h,g,_,v,y=t((()=>{m=`wLOHwj`,h=`lFsM-Y`,g=`LPob63`,_=`tsaGtv`,v={button:m,iconOnly:h,buttonInner:g,buttonIcon:_}})),b,x,S,C=t((()=>{b=e(n(),1),a(),s(),l(),f(),y(),x=r(),S=(0,b.forwardRef)(function({children:e,disabled:t,className:n,icon:r,iconEnd:a,title:s,variant:l,tone:f,appearance:m,type:h=`button`,"aria-label":g,..._},y){let S=b.Children.count(e)>0,C=!!r&&!S,w=u({variant:l,tone:f,appearance:m,fallbackAppearance:f&&f!==`neutral`?`solid`:`outline`}),T=C?g??s:g,E=(0,x.jsx)(`button`,{..._,ref:y,type:h,disabled:t,"aria-label":T,className:i(c.uiElement,c.uiInputControl,v.button,d(w.tone),p(w.appearance),C?v.iconOnly:``,`textNoWrap`,n??``),children:(0,x.jsxs)(`span`,{className:v.buttonInner,children:[r&&!a&&(0,x.jsx)(`span`,{"aria-hidden":`true`,className:v.buttonIcon,children:r}),S&&(0,x.jsx)(`span`,{className:`flexEllipsis`,children:e}),r&&a&&(0,x.jsx)(`span`,{"aria-hidden":`true`,className:v.buttonIcon,children:r})]})});return s?(0,x.jsx)(o,{placement:`bottom`,tooltip:!0,content:(0,x.jsx)(x.Fragment,{children:s}),children:E}):E}),S.__docgenInfo={description:'Базовая кнопка дизайн-системы для пользовательских действий.\nПоддерживает состояния, tone + appearance, иконки и безопасный `type="button"` по умолчанию.',methods:[],displayName:`Button`,props:{variant:{required:!1,tsType:{name:`union`,raw:`| "transparent"
| "ghost"
| "neutral"
| "error"
| "warning"
| "success"
| "info"
| "neutralOutline"
| "errorOutline"
| "warningOutline"
| "successOutline"
| "infoOutline"`,elements:[{name:`literal`,value:`"transparent"`},{name:`literal`,value:`"ghost"`},{name:`literal`,value:`"neutral"`},{name:`literal`,value:`"error"`},{name:`literal`,value:`"warning"`},{name:`literal`,value:`"success"`},{name:`literal`,value:`"info"`},{name:`literal`,value:`"neutralOutline"`},{name:`literal`,value:`"errorOutline"`},{name:`literal`,value:`"warningOutline"`},{name:`literal`,value:`"successOutline"`},{name:`literal`,value:`"infoOutline"`}]},description:``},tone:{required:!1,tsType:{name:`union`,raw:`"neutral" | "error" | "warning" | "success" | "info"`,elements:[{name:`literal`,value:`"neutral"`},{name:`literal`,value:`"error"`},{name:`literal`,value:`"warning"`},{name:`literal`,value:`"success"`},{name:`literal`,value:`"info"`}]},description:``},appearance:{required:!1,tsType:{name:`union`,raw:`"solid" | "outline" | "ghost" | "transparent"`,elements:[{name:`literal`,value:`"solid"`},{name:`literal`,value:`"outline"`},{name:`literal`,value:`"ghost"`},{name:`literal`,value:`"transparent"`}]},description:``},icon:{required:!1,tsType:{name:`ReactReactNode`,raw:`React.ReactNode`},description:``},iconEnd:{required:!1,tsType:{name:`boolean`},description:``},type:{required:!1,tsType:{name:`union`,raw:`"button" | "submit" | "reset"`,elements:[{name:`literal`,value:`"button"`},{name:`literal`,value:`"submit"`},{name:`literal`,value:`"reset"`}]},description:`По умолчанию делаем безопасное поведение в формах.`,defaultValue:{value:`"button"`,computed:!1}}},composes:[`Omit`]}}));export{C as n,S as t};