// src/components/loading-states/LoadingButton.tsx
import clsx3 from "clsx";

// src/components/user-action/Button.tsx
import { forwardRef } from "react";
import clsx from "clsx";
import { jsx, jsxs } from "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 = {
  none: "",
  small: "btn-sm",
  medium: "btn-md",
  large: "btn-lg"
};
var iconPaddingMapping = {
  none: "",
  tiny: "icon-btn-xs",
  small: "icon-btn-sm",
  medium: "icon-btn-md",
  large: "icon-btn-lg"
};
var ButtonUtil = {
  paddingMapping,
  iconPaddingMapping
};
var SolidButton = forwardRef(function SolidButton2({
  children,
  color = "primary",
  size = "medium",
  startIcon,
  endIcon,
  onClick,
  className,
  ...restProps
}, ref) {
  const colorClasses = {
    primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
    secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
    tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
    positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
    warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
    negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
    neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
  }[color];
  const iconColorClasses = {
    primary: "not-group-disabled:text-button-solid-primary-icon",
    secondary: "not-group-disabled:text-button-solid-secondary-icon",
    tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
    positive: "not-group-disabled:text-button-solid-positive-icon",
    warning: "not-group-disabled:text-button-solid-warning-icon",
    negative: "not-group-disabled:text-button-solid-negative-icon",
    neutral: "not-group-disabled:text-button-solid-neutral-icon"
  }[color];
  return /* @__PURE__ */ jsxs(
    "button",
    {
      ref,
      onClick,
      className: clsx(
        "group font-semibold",
        colorClasses,
        "not-disabled:hover:brightness-90",
        "disabled:text-disabled disabled:bg-disabled-background",
        ButtonUtil.paddingMapping[size],
        className
      ),
      ...restProps,
      children: [
        startIcon && /* @__PURE__ */ jsx(
          "span",
          {
            className: clsx(
              iconColorClasses,
              "group-disabled:text-disabled-icon"
            ),
            children: startIcon
          }
        ),
        children,
        endIcon && /* @__PURE__ */ jsx(
          "span",
          {
            className: clsx(
              iconColorClasses,
              "group-disabled:text-disabled-icon"
            ),
            children: endIcon
          }
        )
      ]
    }
  );
});
var IconButton = forwardRef(function IconButton2({
  children,
  color = "primary",
  size = "medium",
  className,
  ...restProps
}, ref) {
  const colorClasses = {
    primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
    secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
    tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
    positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
    warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
    negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
    neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
    transparent: "not-disabled:bg-transparent"
  }[color];
  return /* @__PURE__ */ jsx(
    "button",
    {
      ref,
      className: clsx(
        colorClasses,
        "not-disabled:hover:brightness-90",
        "disabled:text-disabled",
        {
          "disabled:bg-disabled-background": color !== "transparent",
          "disabled:opacity-70": color === "transparent",
          "not-disabled:hover:bg-button-text-hover-background": color === "transparent"
        },
        ButtonUtil.iconPaddingMapping[size],
        className
      ),
      ...restProps,
      children
    }
  );
});

// src/components/icons-and-geometry/HelpwaveLogo.tsx
import { clsx as clsx2 } from "clsx";
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
var HelpwaveLogo = ({
  color = "currentColor",
  size,
  animate = "none",
  ...props
}) => {
  const isLoadingAnimation = animate === "loading";
  let svgAnimationKey = "";
  if (animate === "pulse") {
    svgAnimationKey = "animate-pulse";
  } else if (animate === "bounce") {
    svgAnimationKey = "animate-bounce";
  }
  return /* @__PURE__ */ jsx2(
    "svg",
    {
      ...props,
      viewBox: "0 0 1024 1024",
      fill: "none",
      strokeLinecap: "round",
      strokeWidth: 65,
      className: clsx2({
        "max-w-16 max-h-16": size === "lg",
        "max-w-12 max-h-12": size === "md",
        "max-w-8 max-h-8": size === "sm"
      }, props.className),
      children: /* @__PURE__ */ jsxs2("g", { className: clsx2(svgAnimationKey), children: [
        /* @__PURE__ */ jsx2(
          "path",
          {
            className: clsx2({ "animate-wave-big-left-up": isLoadingAnimation }),
            d: "M146 644.214C146 498.088 253.381 379.629 385.843 379.629",
            stroke: color,
            strokeDasharray: "1000"
          }
        ),
        /* @__PURE__ */ jsx2(
          "path",
          {
            className: clsx2({ "animate-wave-big-right-down": isLoadingAnimation }),
            d: "M625.686 645.272C493.224 645.272 385.843 526.813 385.843 380.687",
            stroke: color,
            strokeDasharray: "1000"
          }
        ),
        /* @__PURE__ */ jsx2(
          "path",
          {
            className: clsx2({ "animate-wave-small-left-up": isLoadingAnimation }),
            d: "M533.585 613.522C533.585 508.895 610.47 424.079 705.312 424.079",
            stroke: color,
            strokeDasharray: "1000"
          }
        ),
        /* @__PURE__ */ jsx2(
          "path",
          {
            className: clsx2({ "animate-wave-small-right-down": isLoadingAnimation }),
            d: "M878 615.639C782.628 615.639 705.313 530.822 705.313 426.196",
            stroke: color,
            strokeDasharray: "1000"
          }
        )
      ] })
    }
  );
};

// src/components/loading-states/LoadingButton.tsx
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
var LoadingButton = ({ isLoading = false, size = "medium", onClick, ...rest }) => {
  const paddingClass = ButtonUtil.paddingMapping[size];
  return /* @__PURE__ */ jsxs3("div", { className: "inline-block relative", children: [
    isLoading && /* @__PURE__ */ jsx3("div", { className: clsx3("flex-row-2 absolute inset-0 items-center justify-center bg-white/40", paddingClass), children: /* @__PURE__ */ jsx3(HelpwaveLogo, { animate: "loading", className: "text-white" }) }),
    /* @__PURE__ */ jsx3(SolidButton, { ...rest, disabled: rest.disabled, onClick })
  ] });
};
export {
  LoadingButton
};
//# sourceMappingURL=LoadingButton.js.map