{
  "version": 3,
  "sources": ["../../../../../../src/lib/ui/components/primitives/Button/TldrawUiButton.tsx"],
  "sourcesContent": ["import classnames from 'classnames'\nimport * as React from 'react'\nimport { TldrawUiTooltip } from '../TldrawUiTooltip'\n\n/** @public */\nexport interface TLUiButtonProps extends React.HTMLAttributes<HTMLButtonElement> {\n\tdisabled?: boolean\n\tisActive?: boolean\n\ttype: 'normal' | 'primary' | 'danger' | 'low' | 'icon' | 'tool' | 'menu' | 'help'\n\thtmlButtonType?: 'button' | 'submit' | 'reset'\n\ttooltip?: string\n}\n\nconst namedClassNamesSoThatICanGrepForThis = {\n\tnormal: 'tlui-button__normal',\n\tprimary: 'tlui-button__primary',\n\tdanger: 'tlui-button__danger',\n\tlow: 'tlui-button__low',\n\ticon: 'tlui-button__icon',\n\ttool: 'tlui-button__tool',\n\tmenu: 'tlui-button__menu',\n\thelp: 'tlui-button__help',\n}\n\n/** @public @react */\nexport const TldrawUiButton = React.forwardRef<HTMLButtonElement, TLUiButtonProps>(\n\tfunction TldrawUiButton({ children, type, htmlButtonType, isActive, tooltip, ...props }, ref) {\n\t\tconst button = (\n\t\t\t<button\n\t\t\t\tref={ref}\n\t\t\t\ttype={htmlButtonType || 'button'}\n\t\t\t\tdraggable={false}\n\t\t\t\tdata-isactive={isActive}\n\t\t\t\t{...props}\n\t\t\t\tclassName={classnames(\n\t\t\t\t\t'tlui-button',\n\t\t\t\t\tnamedClassNamesSoThatICanGrepForThis[type],\n\t\t\t\t\tprops.className\n\t\t\t\t)}\n\t\t\t\taria-label={props['aria-label'] ?? props.title}\n\t\t\t\t// The tooltip takes care of this.\n\t\t\t\ttitle={tooltip ? undefined : props.title}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t)\n\n\t\tif (tooltip) {\n\t\t\treturn <TldrawUiTooltip content={tooltip}>{button}</TldrawUiTooltip>\n\t\t}\n\n\t\treturn button\n\t}\n)\n"],
  "mappings": "AA4BG;AA5BH,OAAO,gBAAgB;AACvB,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAWhC,MAAM,uCAAuC;AAAA,EAC5C,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACP;AAGO,MAAM,iBAAiB,MAAM;AAAA,EACnC,SAASA,gBAAe,EAAE,UAAU,MAAM,gBAAgB,UAAU,SAAS,GAAG,MAAM,GAAG,KAAK;AAC7F,UAAM,SACL;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,MAAM,kBAAkB;AAAA,QACxB,WAAW;AAAA,QACX,iBAAe;AAAA,QACd,GAAG;AAAA,QACJ,WAAW;AAAA,UACV;AAAA,UACA,qCAAqC,IAAI;AAAA,UACzC,MAAM;AAAA,QACP;AAAA,QACA,cAAY,MAAM,YAAY,KAAK,MAAM;AAAA,QAEzC,OAAO,UAAU,SAAY,MAAM;AAAA,QAElC;AAAA;AAAA,IACF;AAGD,QAAI,SAAS;AACZ,aAAO,oBAAC,mBAAgB,SAAS,SAAU,kBAAO;AAAA,IACnD;AAEA,WAAO;AAAA,EACR;AACD;",
  "names": ["TldrawUiButton"]
}
