'use strict';

var react$1 = require('react');
var react = require('@tw-classed/react');
var clsx6 = require('clsx');
var tailwindMerge = require('tailwind-merge');
var lodashEs = require('lodash-es');
var core = require('@tw-classed/core');
var createVariatGroupTransfomer = require('tailwind-group-variant');
var jsxRuntime = require('react/jsx-runtime');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var clsx6__default = /*#__PURE__*/_interopDefault(clsx6);
var createVariatGroupTransfomer__default = /*#__PURE__*/_interopDefault(createVariatGroupTransfomer);

// src/components/Button/Button.tsx
var sizeVariants = {
  width: {
    xs: clsx6__default.default("w-28"),
    sm: clsx6__default.default("w-34"),
    md: clsx6__default.default("w-40"),
    lg: clsx6__default.default("w-48")
  },
  height: {
    xs: clsx6__default.default("h-28"),
    sm: clsx6__default.default("h-34"),
    md: clsx6__default.default("h-40"),
    lg: clsx6__default.default("h-48")
  },
  inlineWidth: {
    xs: clsx6__default.default("w-16 text-xs"),
    sm: clsx6__default.default("w-20 text-xs"),
    md: clsx6__default.default("w-22 text-xs"),
    lg: clsx6__default.default("w-26 text-xs")
  },
  inlineHeight: {
    xs: clsx6__default.default("h-16 text-xs"),
    sm: clsx6__default.default("h-20 text-xs"),
    md: clsx6__default.default("h-22 text-xs"),
    lg: clsx6__default.default("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__default.default("px-4"),
    sm: clsx6__default.default("px-6"),
    md: clsx6__default.default("px-8"),
    lg: clsx6__default.default("px-10")
  },
  extraPaddingX: {
    xs: clsx6__default.default("px-14"),
    sm: clsx6__default.default("px-16"),
    md: clsx6__default.default("px-18"),
    lg: clsx6__default.default("px-20")
  }
};
var twMerge = tailwindMerge.extendTailwindMerge({
  classGroups: {
    "font-size": [
      {
        // Fixes incorect merging of text size
        text: ["h1", "h2", "h3", "h4", "h5", "h6"]
      }
    ]
  }
});
var { classed } = react.createClassed({ merger: twMerge });
core.createClassed({ merger: twMerge });
var classedVariantMap = (variantMap) => variantMap;
function generateCompoundVariants(compoundVariantPropMap) {
  const { commonVariantProps, compoundVariantMapLists } = lodashEs.transform(
    compoundVariantPropMap,
    (result, value, key) => {
      if (typeof value === "boolean" || typeof value === "string") {
        result.commonVariantProps[key] = value;
        return result;
      }
      const compoundVariantMapList = lodashEs.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__default.default({});
function mergeVariants(variants, overrides) {
  const variantArray = Array.isArray(variants) ? variants : Object.values(variants);
  const mergerFn = (objectValue, sourceValue) => tailwindMerge.twMerge(`${objectValue || ""}`, `${sourceValue}`);
  const mergedVariants = lodashEs.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"
  }
});
react.classed("div", {
  variants: {
    orientation: {
      horizontal: "inline-flex flex-row items-center ",
      vertical: "flex flex-col justify-center"
    }
  }
});
var inputComponentWidths = {
  xs: clsx6__default.default("w-168"),
  sm: clsx6__default.default("w-184"),
  md: clsx6__default.default("w-216"),
  lg: clsx6__default.default("w-400")
};
var inputComponentMinWidths = {
  none: "",
  xs: clsx6__default.default("min-w-[168px]"),
  sm: clsx6__default.default("min-w-[184px]"),
  md: clsx6__default.default("min-w-[216px]"),
  lg: clsx6__default.default("min-w-[400px]")
};
react.classed("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
]);
react.classed("div", "inline-flex", {
  variants: {
    size: inputSizeVariants
  }
});
var headingTextSize = {
  h1: clsx6__default.default("text-h1"),
  h2: clsx6__default.default("text-h2"),
  h3: clsx6__default.default("text-h3"),
  h4: clsx6__default.default("text-h4"),
  h5: clsx6__default.default("text-h5"),
  h6: clsx6__default.default("text-h6")
};
var textSize = {
  xs: clsx6__default.default("text-xs"),
  sm: clsx6__default.default("text-sm"),
  md: clsx6__default.default("text-md"),
  lg: clsx6__default.default("text-lg")
};
var textVariants = {
  fontWeight: {
    regular: clsx6__default.default("font-regular"),
    medium: clsx6__default.default("font-medium"),
    bold: clsx6__default.default("font-bold")
  },
  size: {
    ...textSize,
    ...headingTextSize
  },
  font: {
    body: "font-body",
    heading: "font-heading",
    mono: "font-mono"
  },
  leading: {
    none: clsx6__default.default("leading-none"),
    xs: clsx6__default.default("leading-xs"),
    sm: clsx6__default.default("leading-sm"),
    md: clsx6__default.default("leading-md"),
    lg: clsx6__default.default("leading-lg"),
    h1: clsx6__default.default("leading-h1"),
    h2: clsx6__default.default("leading-h2"),
    h3: clsx6__default.default("leading-h3"),
    h4: clsx6__default.default("leading-h4"),
    h5: clsx6__default.default("leading-h5"),
    h6: clsx6__default.default("leading-h6")
  },
  spaceY: {
    xs: clsx6__default.default("space-y-4"),
    sm: clsx6__default.default("space-y-6"),
    md: clsx6__default.default("space-y-8"),
    lg: clsx6__default.default("space-y-16")
  },
  spaceX: {
    xs: clsx6__default.default("space-x-4"),
    sm: clsx6__default.default("space-x-6"),
    md: clsx6__default.default("space-x-8"),
    lg: clsx6__default.default("space-x-16")
  },
  color: {
    inherit: clsx6__default.default("text-inherit"),
    current: clsx6__default.default("text-current"),
    tint: clsx6__default.default("text-content-tint"),
    ghost: clsx6__default.default("text-content-ghost"),
    subtle: clsx6__default.default("text-content-subtle"),
    medium: clsx6__default.default("text-content"),
    weak: clsx6__default.default("text-content-weak"),
    moderate: clsx6__default.default("text-content-moderate"),
    high: clsx6__default.default("text-content-high"),
    intense: clsx6__default.default("text-content-intense"),
    strong: clsx6__default.default("text-content-intense"),
    inverse: clsx6__default.default("text-inverse"),
    danger: clsx6__default.default("text-danger")
  },
  align: {
    center: clsx6__default.default("text-center"),
    right: clsx6__default.default("text-right"),
    left: clsx6__default.default("text-left"),
    start: clsx6__default.default("text-left"),
    end: clsx6__default.default("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__default.default("rounded "),
      default: clsx6__default.default("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__default.default("gap-4"),
        sm: clsx6__default.default("gap-6"),
        md: clsx6__default.default("gap-6"),
        lg: clsx6__default.default("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__default.default("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__default.default("border-none transition-all hover:brightness-[1.05]"),
      color: {
        primary: clsx6__default.default("bg-gradient-primary-dark-to-light-tr"),
        secondary: clsx6__default.default("bg-gradient-secondary-dark-to-light-tr"),
        inverse: clsx6__default.default("bg-gradient-inverse-dark-to-light-tr"),
        heart: clsx6__default.default("bg-gradient-heart-dark-to-light-tr"),
        info: clsx6__default.default("bg-gradient-info-dark-to-light-tr"),
        success: clsx6__default.default("bg-gradient-success-dark-to-light-tr"),
        danger: clsx6__default.default("bg-gradient-danger-dark-to-light-tr"),
        caution: clsx6__default.default("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 InlineButtonIconElement = classed("span", "flex items-center justify-center", {
  variants: {
    size: {
      xs: "h-12 w-12",
      sm: "h-14 w-14",
      md: "h-16 w-16",
      lg: "h-18 w-18"
    },
    offset: {
      right: "-mr-6",
      left: "-ml-6"
    }
  },
  defaultVariants: { size: "md" }
});
var InlineButtonIcon = ({
  offset,
  position,
  size,
  icon,
  className
}) => {
  return Boolean(className || icon) ? /* @__PURE__ */ jsxRuntime.jsx(
    InlineButtonIconElement,
    {
      size,
      className,
      offset: offset ? position : void 0,
      children: icon
    }
  ) : null;
};
var ButtonComponent = react$1.forwardRef(
  ({
    size = "md",
    startIcon,
    endIcon,
    startIconClassName,
    endIconClassName,
    children,
    variant = "filled",
    color = "primary",
    rounded,
    extraRoundedPadding: extraRoundedPaddingProp,
    ...props
  }, ref) => {
    function getExtraRoundedPaddingProp() {
      if (extraRoundedPaddingProp)
        return extraRoundedPaddingProp;
      if (variant === "ghost" || variant === "text")
        return false;
      return true;
    }
    const extraRoundedPadding = getExtraRoundedPaddingProp();
    const inlineButtonIconProps = {
      size,
      offset: Boolean(rounded && extraRoundedPadding)
    };
    return /* @__PURE__ */ jsxRuntime.jsxs(
      ButtonElement,
      {
        variant,
        color,
        extraRoundedPadding,
        rounded,
        size,
        ...props,
        ref,
        children: [
          /* @__PURE__ */ jsxRuntime.jsx(
            InlineButtonIcon,
            {
              position: "left",
              icon: startIcon,
              className: startIconClassName,
              ...inlineButtonIconProps
            }
          ),
          children,
          /* @__PURE__ */ jsxRuntime.jsx(
            InlineButtonIcon,
            {
              position: "right",
              icon: endIcon,
              className: endIconClassName,
              ...inlineButtonIconProps
            }
          )
        ]
      }
    );
  }
);
var Button = react.deriveClassed((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(ButtonComponent, { ...props, ref }));

exports.Button = Button;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.cjs.map