import clsx6 from 'clsx';
import { createClassed, classed as classed$1 } from '@tw-classed/react';
import { extendTailwindMerge, twMerge as twMerge$1 } from 'tailwind-merge';
import { transform, map, mergeWith } from 'lodash-es';
import { createClassed as createClassed$1 } from '@tw-classed/core';
import createVariatGroupTransfomer from 'tailwind-group-variant';
import { forwardRef } from 'react';
import { jsx } from 'react/jsx-runtime';
import { XMarkIcon } from '@heroicons/react/24/solid';

// src/components/Button/Button.styles.tsx
var sizeVariants = {
  width: {
    xs: clsx6("w-28"),
    sm: clsx6("w-34"),
    md: clsx6("w-40"),
    lg: clsx6("w-48")
  },
  height: {
    xs: clsx6("h-28"),
    sm: clsx6("h-34"),
    md: clsx6("h-40"),
    lg: clsx6("h-48")
  },
  inlineWidth: {
    xs: clsx6("w-16 text-xs"),
    sm: clsx6("w-20 text-xs"),
    md: clsx6("w-22 text-xs"),
    lg: clsx6("w-26 text-xs")
  },
  inlineHeight: {
    xs: clsx6("h-16 text-xs"),
    sm: clsx6("h-20 text-xs"),
    md: clsx6("h-22 text-xs"),
    lg: clsx6("h-26 text-xs")
  },
  textSize: {
    xs: "text-xs",
    sm: "text-sm",
    md: "text-md",
    lg: "text-lg"
  },
  lineHeight: {
    xs: "leading-xs",
    sm: "leading-sm",
    md: "leading-md",
    lg: "leading-lg"
  },
  paddingY: {
    xs: "py-4",
    sm: "py-6",
    md: "py-8",
    lg: "py-10"
  },
  paddingX: {
    xs: clsx6("px-4"),
    sm: clsx6("px-6"),
    md: clsx6("px-8"),
    lg: clsx6("px-10")
  },
  extraPaddingX: {
    xs: clsx6("px-14"),
    sm: clsx6("px-16"),
    md: clsx6("px-18"),
    lg: clsx6("px-20")
  }
};
var twMerge = extendTailwindMerge({
  classGroups: {
    "font-size": [
      {
        // Fixes incorect merging of text size
        text: ["h1", "h2", "h3", "h4", "h5", "h6"]
      }
    ]
  }
});
var { classed } = createClassed({ merger: twMerge });
createClassed$1({ merger: twMerge });
var classedVariantMap = (variantMap) => variantMap;
function generateCompoundVariants(compoundVariantPropMap) {
  const { commonVariantProps, compoundVariantMapLists } = transform(
    compoundVariantPropMap,
    (result, value, key) => {
      if (typeof value === "boolean" || typeof value === "string") {
        result.commonVariantProps[key] = value;
        return result;
      }
      const compoundVariantMapList = map(value, (className, variantMapKey) => ({
        [key]: variantMapKey,
        class: className
      }));
      result.compoundVariantMapLists.push(compoundVariantMapList);
      return result;
    },
    {
      commonVariantProps: {},
      compoundVariantMapLists: []
    }
  );
  return compoundVariantMapLists.flat().map(({ class: cls, ...props }) => {
    return {
      ...commonVariantProps,
      class: twMerge(cls, compoundVariantPropMap.className),
      ...props
    };
  });
}
createVariatGroupTransfomer({});
function mergeVariants(variants, overrides) {
  const variantArray = Array.isArray(variants) ? variants : Object.values(variants);
  const mergerFn = (objectValue, sourceValue) => twMerge$1(`${objectValue || ""}`, `${sourceValue}`);
  const mergedVariants = mergeWith({}, ...[...variantArray, overrides], mergerFn);
  return mergedVariants;
}

// src/styles/input-component.variants.ts
var inputComponentVariants = classedVariantMap({
  size: sizeVariants,
  rounded: {
    roundedLeft: "rounded-r-0 rounded-l-md",
    roundedRight: "rounded-l-0 rounded-r-md",
    rounded: "rounded-md"
  }
});
classed$1("div", {
  variants: {
    orientation: {
      horizontal: "inline-flex flex-row items-center ",
      vertical: "flex flex-col justify-center"
    }
  }
});
var inputComponentWidths = {
  xs: clsx6("w-168"),
  sm: clsx6("w-184"),
  md: clsx6("w-216"),
  lg: clsx6("w-400")
};
var inputComponentMinWidths = {
  none: "",
  xs: clsx6("min-w-[168px]"),
  sm: clsx6("min-w-[184px]"),
  md: clsx6("min-w-[216px]"),
  lg: clsx6("min-w-[400px]")
};
classed$1("div", {
  variants: {
    size: {
      xs: "",
      sm: "",
      md: "",
      lg: ""
    },
    minWidth: inputComponentMinWidths,
    width: {
      autoWidth: "w-auto",
      fullWidth: "!w-full",
      fixedWidth: ""
    }
  },
  defaultVariants: {
    width: "fixedWidth",
    size: "md"
  },
  compoundVariants: [
    { size: "xs", width: "fixedWidth", class: inputComponentWidths.xs },
    { size: "sm", width: "fixedWidth", class: inputComponentWidths.sm },
    { size: "md", width: "fixedWidth", class: inputComponentWidths.md },
    { size: "lg", width: "fixedWidth", class: inputComponentWidths.lg }
  ]
});
var inputSizeVariants = mergeVariants([
  inputComponentVariants.size.lineHeight,
  inputComponentVariants.size.paddingX,
  inputComponentVariants.size.paddingY,
  inputComponentVariants.size.textSize
]);
classed$1("div", "inline-flex", {
  variants: {
    size: inputSizeVariants
  }
});
var headingTextSize = {
  h1: clsx6("text-h1"),
  h2: clsx6("text-h2"),
  h3: clsx6("text-h3"),
  h4: clsx6("text-h4"),
  h5: clsx6("text-h5"),
  h6: clsx6("text-h6")
};
var textSize = {
  xs: clsx6("text-xs"),
  sm: clsx6("text-sm"),
  md: clsx6("text-md"),
  lg: clsx6("text-lg")
};
var textVariants = {
  fontWeight: {
    regular: clsx6("font-regular"),
    medium: clsx6("font-medium"),
    bold: clsx6("font-bold")
  },
  size: {
    ...textSize,
    ...headingTextSize
  },
  font: {
    body: "font-body",
    heading: "font-heading",
    mono: "font-mono"
  },
  leading: {
    none: clsx6("leading-none"),
    xs: clsx6("leading-xs"),
    sm: clsx6("leading-sm"),
    md: clsx6("leading-md"),
    lg: clsx6("leading-lg"),
    h1: clsx6("leading-h1"),
    h2: clsx6("leading-h2"),
    h3: clsx6("leading-h3"),
    h4: clsx6("leading-h4"),
    h5: clsx6("leading-h5"),
    h6: clsx6("leading-h6")
  },
  spaceY: {
    xs: clsx6("space-y-4"),
    sm: clsx6("space-y-6"),
    md: clsx6("space-y-8"),
    lg: clsx6("space-y-16")
  },
  spaceX: {
    xs: clsx6("space-x-4"),
    sm: clsx6("space-x-6"),
    md: clsx6("space-x-8"),
    lg: clsx6("space-x-16")
  },
  color: {
    inherit: clsx6("text-inherit"),
    current: clsx6("text-current"),
    tint: clsx6("text-content-tint"),
    ghost: clsx6("text-content-ghost"),
    subtle: clsx6("text-content-subtle"),
    medium: clsx6("text-content"),
    weak: clsx6("text-content-weak"),
    moderate: clsx6("text-content-moderate"),
    high: clsx6("text-content-high"),
    intense: clsx6("text-content-intense"),
    strong: clsx6("text-content-intense"),
    inverse: clsx6("text-inverse"),
    danger: clsx6("text-danger")
  },
  align: {
    center: clsx6("text-center"),
    right: clsx6("text-right"),
    left: clsx6("text-left"),
    start: clsx6("text-left"),
    end: clsx6("text-end")
  },
  maxLines: {
    1: "line-clamp-1",
    2: "line-clamp-2",
    3: "line-clamp-3",
    4: "line-clamp-4",
    5: "line-clamp-5",
    6: "line-clamp-6"
  }
};

// src/components/Button/Button.styles.tsx
var buttonVariants = {
  variants: {
    loading: {
      true: "cursor-default"
    },
    cursorPointer: {
      false: "cursor-auto"
    },
    size: mergeVariants(
      [inputComponentVariants.size.paddingX, inputComponentVariants.size.paddingY],
      {
        xs: "text-xs px-6",
        sm: "text-sm",
        md: "text-sm",
        lg: "text-sm"
      }
    ),
    fontWeight: textVariants.fontWeight,
    noWrap: {
      true: "whitespace-nowrap"
    },
    inline: {
      true: "inline"
    },
    justify: {
      center: "justify-center",
      start: "justify-start",
      end: "justify-end"
    },
    fullWidth: {
      true: "w-full"
    },
    hoverable: {
      true: ""
    },
    variant: {
      filled: "",
      outlined: "ring-[1.35px] ring-inset",
      glass: "",
      text: "",
      ghost: ""
    },
    rounded: {
      sm: clsx6("rounded "),
      default: clsx6("rounded"),
      true: "rounded-full"
    },
    gradient: {
      true: ""
    },
    coloredShadow: {
      true: ""
    },
    extraRoundedPadding: {
      true: ""
    },
    color: {
      primary: "",
      secondary: "",
      surface: "",
      inverse: "",
      info: "",
      success: "",
      danger: "",
      caution: "",
      heart: ""
    },
    hoverBackgroundColor: {
      primary: "",
      secondary: "",
      inverse: "",
      info: "",
      success: "",
      danger: "",
      caution: "",
      heart: ""
    },
    backgroundNoise: {
      true: "noisy-surface-texture"
    },
    gap: {
      true: ""
    }
  },
  compoundVariants: [
    ...generateCompoundVariants({
      gap: true,
      size: {
        xs: clsx6("gap-4"),
        sm: clsx6("gap-6"),
        md: clsx6("gap-6"),
        lg: clsx6("gap-6")
      }
    }),
    ...generateCompoundVariants({
      variant: "filled",
      color: {
        primary: "filled-accent-primary",
        secondary: "filled-accent-secondary",
        inverse: "filled-accent-inverse",
        heart: "filled-accent-heart",
        info: "filled-accent-info",
        success: "filled-accent-success",
        danger: "filled-accent-danger",
        caution: "filled-accent-caution"
      }
    }),
    ...generateCompoundVariants({
      variant: "filled",
      hoverable: true,
      color: {
        primary: "filled-hover-accent-primary",
        secondary: "filled-hover-accent-secondary",
        inverse: "filled-hover-accent-inverse",
        heart: "filled-hover-accent-heart",
        info: "filled-hover-accent-info",
        success: "filled-hover-accent-success",
        danger: "filled-hover-accent-danger",
        caution: "filled-hover-accent-caution"
      }
    }),
    ...generateCompoundVariants({
      variant: "filled",
      hoverBackgroundColor: {
        primary: "filled-hover-accent-primary",
        secondary: "filled-hover-accent-secondary",
        inverse: "filled-hover-accent-inverse",
        heart: "filled-hover-accent-heart",
        info: "filled-hover-accent-info",
        success: "filled-hover-accent-success",
        danger: "filled-hover-accent-danger",
        caution: "filled-hover-accent-caution"
      }
    }),
    ...generateCompoundVariants({
      variant: "glass",
      hoverBackgroundColor: {
        primary: "hover:glass-accent-primary",
        secondary: "hover:glass-accent-secondary",
        inverse: "hover:glass-accent-inverse",
        heart: "hover:glass-accent-heart",
        info: "hover:glass-accent-info",
        success: "hover:glass-accent-success",
        danger: "hover:glass-accent-danger",
        caution: "hover:glass-accent-caution"
      }
    }),
    ...generateCompoundVariants({
      variant: "glass",
      className: "overflow-hidden",
      color: {
        primary: "glass-accent-primary",
        secondary: "glass-accent-secondary",
        inverse: "glass-accent-inverse",
        heart: "glass-accent-heart",
        info: "glass-accent-info",
        success: "glass-accent-success",
        danger: "glass-accent-danger",
        caution: "glass-accent-caution"
      }
    }),
    ...generateCompoundVariants({
      variant: "ghost",
      className: "overflow-hidden bg-transparent",
      color: {
        primary: "ghost-accent-primary",
        secondary: "ghost-accent-secondary",
        inverse: "ghost-accent-inverse",
        heart: "ghost-accent-heart",
        info: "ghost-accent-info",
        success: "ghost-accent-success",
        danger: "ghost-accent-danger",
        caution: "ghost-accent-caution"
      }
    }),
    ...generateCompoundVariants({
      variant: "outlined",
      className: "overflow-hidden z-0 bg-surface-soft",
      color: {
        primary: "ring-boundary-weak",
        secondary: "ring-boundary-weak",
        inverse: "text-inverse ring-inverse",
        heart: "text-heart ring-heart",
        info: "text-info ring-info",
        success: "text-success ring-success",
        danger: "text-danger ring-danger",
        caution: "text-caution ring-caution"
      }
    }),
    // Colored Shadow
    ...generateCompoundVariants({
      coloredShadow: true,
      className: clsx6("shadow-lg "),
      color: {
        primary: "shadow-primary/70",
        secondary: "shadow-secondary/70",
        inverse: "shadow-inverse/70",
        heart: "shadow-heart/70",
        info: "shadow-info/70",
        success: "shadow-success/70",
        danger: "shadow-danger/70",
        caution: "shadow-caution/70"
      }
    }),
    // Gradient
    ...generateCompoundVariants({
      gradient: true,
      variant: "filled",
      className: clsx6("border-none transition-all hover:brightness-[1.05]"),
      color: {
        primary: clsx6("bg-gradient-primary-dark-to-light-tr"),
        secondary: clsx6("bg-gradient-secondary-dark-to-light-tr"),
        inverse: clsx6("bg-gradient-inverse-dark-to-light-tr"),
        heart: clsx6("bg-gradient-heart-dark-to-light-tr"),
        info: clsx6("bg-gradient-info-dark-to-light-tr"),
        success: clsx6("bg-gradient-success-dark-to-light-tr"),
        danger: clsx6("bg-gradient-danger-dark-to-light-tr"),
        caution: clsx6("bg-gradient-caution-dark-to-light-tr")
      }
    }),
    // Extra Padding X
    ...generateCompoundVariants({
      rounded: true,
      extraRoundedPadding: true,
      size: sizeVariants.extraPaddingX
    })
  ]
};
var ButtonElement = classed.button(
  "inline-flex font-medium items-center justify-center select-none align-middle",
  "disabled:text-content-tint disabled:cursor-default disabled:pointer-events-none relative",
  "transition-colors duration-100",
  "box-border",
  "shrink-0",
  {
    defaultVariants: {
      size: "md",
      rounded: "default",
      noWrap: true,
      fontWeight: "medium",
      hoverable: true,
      color: "primary",
      justify: "center",
      variant: "filled",
      extraRoundedPadding: true,
      gap: true
    },
    variants: buttonVariants.variants,
    compoundVariants: buttonVariants.compoundVariants
  }
);
var IconButtonElement = classed("button", ButtonElement, "p-8 shrink-0", {
  variants: {
    size: mergeVariants([sizeVariants.width, sizeVariants.height])
  }
});
var IconButton = forwardRef(
  ({ className, children, ...props }, ref) => {
    return /* @__PURE__ */ jsx(IconButtonElement, { ...props, className, ref, extraRoundedPadding: false, children });
  }
);
var CloseButton = forwardRef(
  ({ className, animated, color = "secondary", ...props }, ref) => {
    return /* @__PURE__ */ jsx(
      IconButton,
      {
        ref,
        size: "sm",
        variant: "ghost",
        color,
        rounded: true,
        ...props,
        className: twMerge$1(
          clsx6("text-content-subtle hover:text-content-weak", {
            "opacity-50 transition-opacity duration-300 ease-in-out group-hover:opacity-100": animated
          }),
          className
        ),
        children: /* @__PURE__ */ jsx(XMarkIcon, { className: clsx6("fill-current") })
      }
    );
  }
);

export { CloseButton, IconButton };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.js.map