var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/user-action/Button.tsx
var Button_exports = {};
__export(Button_exports, {
  ButtonColorUtil: () => ButtonColorUtil,
  ButtonUtil: () => ButtonUtil,
  IconButton: () => IconButton,
  IconButtonUtil: () => IconButtonUtil,
  OutlineButton: () => OutlineButton,
  SolidButton: () => SolidButton,
  TextButton: () => TextButton
});
module.exports = __toCommonJS(Button_exports);
var import_clsx = __toESM(require("clsx"));
var import_jsx_runtime = require("react/jsx-runtime");
var ButtonColorUtil = {
  solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
  text: ["primary", "negative", "neutral"],
  outline: ["primary"]
};
var IconButtonUtil = {
  icon: [...ButtonColorUtil.solid, "transparent"]
};
var paddingMapping = {
  small: "btn-sm",
  medium: "btn-md",
  large: "btn-lg"
};
var iconPaddingMapping = {
  tiny: "icon-btn-xs",
  small: "icon-btn-sm",
  medium: "icon-btn-md",
  large: "icon-btn-lg"
};
var ButtonUtil = {
  paddingMapping,
  iconPaddingMapping
};
var SolidButton = ({
  children,
  disabled = false,
  color = "primary",
  size = "medium",
  startIcon,
  endIcon,
  onClick,
  className,
  ...restProps
}) => {
  const colorClasses = {
    primary: "bg-button-solid-primary-background text-button-solid-primary-text",
    secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
    tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
    positive: "bg-button-solid-positive-background text-button-solid-positive-text",
    warning: "bg-button-solid-warning-background text-button-solid-warning-text",
    negative: "bg-button-solid-negative-background text-button-solid-negative-text",
    neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
  }[color];
  const iconColorClasses = {
    primary: "text-button-solid-primary-icon",
    secondary: "text-button-solid-secondary-icon",
    tertiary: "text-button-solid-tertiary-icon",
    positive: "text-button-solid-positive-icon",
    warning: "text-button-solid-warning-icon",
    negative: "text-button-solid-negative-icon",
    neutral: "text-button-solid-neutral-icon"
  }[color];
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
    "button",
    {
      onClick: disabled ? void 0 : onClick,
      disabled: disabled || onClick === void 0,
      className: (0, import_clsx.default)(
        {
          "text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
          [(0, import_clsx.default)(colorClasses, "hover:brightness-90")]: !disabled
        },
        ButtonUtil.paddingMapping[size],
        className
      ),
      ...restProps,
      children: [
        startIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          "span",
          {
            className: (0, import_clsx.default)({
              [iconColorClasses]: !disabled,
              [`text-disabled-icon`]: disabled
            }),
            children: startIcon
          }
        ),
        children,
        endIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          "span",
          {
            className: (0, import_clsx.default)({
              [iconColorClasses]: !disabled,
              [`text-disabled-icon`]: disabled
            }),
            children: endIcon
          }
        )
      ]
    }
  );
};
var OutlineButton = ({
  children,
  disabled = false,
  color = "primary",
  size = "medium",
  startIcon,
  endIcon,
  onClick,
  className,
  ...restProps
}) => {
  const colorClasses = {
    primary: "bg-transparent border-2 border-button-outline-primary-text text-button-outline-primary-text"
  }[color];
  const iconColorClasses = {
    primary: "text-button-outline-primary-icon"
  }[color];
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
    "button",
    {
      onClick: disabled ? void 0 : onClick,
      disabled: disabled || onClick === void 0,
      className: (0, import_clsx.default)(
        {
          "text-disabled-text border-disabled-outline cursor-not-allowed": disabled,
          [(0, import_clsx.default)(colorClasses, "hover:brightness-80")]: !disabled
        },
        ButtonUtil.paddingMapping[size],
        className
      ),
      ...restProps,
      children: [
        startIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          "span",
          {
            className: (0, import_clsx.default)({
              [iconColorClasses]: !disabled,
              [`text-disabled-icon`]: disabled
            }),
            children: startIcon
          }
        ),
        children,
        endIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          "span",
          {
            className: (0, import_clsx.default)({
              [iconColorClasses]: !disabled,
              [`text-disabled-icon`]: disabled
            }),
            children: endIcon
          }
        )
      ]
    }
  );
};
var TextButton = ({
  children,
  disabled = false,
  color = "neutral",
  size = "medium",
  startIcon,
  endIcon,
  onClick,
  className,
  ...restProps
}) => {
  const colorClasses = {
    primary: "bg-transparent text-button-text-primary-text",
    negative: "bg-transparent text-button-text-negative-text",
    neutral: "bg-transparent text-button-text-neutral-text"
  }[color];
  const iconColorClasses = {
    primary: "text-button-text-primary-icon",
    negative: "text-button-text-negative-icon",
    neutral: "text-button-text-neutral-icon"
  }[color];
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
    "button",
    {
      onClick: disabled ? void 0 : onClick,
      disabled: disabled || onClick === void 0,
      className: (0, import_clsx.default)(
        {
          "text-disabled-text cursor-not-allowed": disabled,
          [(0, import_clsx.default)(colorClasses, "hover:bg-button-text-hover-background")]: !disabled
        },
        ButtonUtil.paddingMapping[size],
        className
      ),
      ...restProps,
      children: [
        startIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          "span",
          {
            className: (0, import_clsx.default)({
              [iconColorClasses]: !disabled,
              [`text-disabled-icon`]: disabled
            }),
            children: startIcon
          }
        ),
        children,
        endIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
          "span",
          {
            className: (0, import_clsx.default)({
              [iconColorClasses]: !disabled,
              [`text-disabled-icon`]: disabled
            }),
            children: endIcon
          }
        )
      ]
    }
  );
};
var IconButton = ({
  children,
  disabled = false,
  color = "primary",
  size = "medium",
  onClick,
  className,
  ...restProps
}) => {
  const colorClasses = {
    primary: "bg-button-solid-primary-background text-button-solid-primary-text",
    secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
    tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
    positive: "bg-button-solid-positive-background text-button-solid-positive-text",
    warning: "bg-button-solid-warning-background text-button-solid-warning-text",
    negative: "bg-button-solid-negative-background text-button-solid-negative-text",
    neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
    transparent: "bg-transparent"
  }[color];
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
    "button",
    {
      onClick: disabled ? void 0 : onClick,
      disabled: disabled || onClick === void 0,
      className: (0, import_clsx.default)(
        {
          "text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
          "text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
          "hover:bg-button-text-hover-background": !disabled && color === "transparent",
          [(0, import_clsx.default)(colorClasses, "hover:brightness-90")]: !disabled
        },
        ButtonUtil.iconPaddingMapping[size],
        className
      ),
      ...restProps,
      children
    }
  );
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ButtonColorUtil,
  ButtonUtil,
  IconButton,
  IconButtonUtil,
  OutlineButton,
  SolidButton,
  TextButton
});
//# sourceMappingURL=Button.js.map