'use strict';

const jsxRuntime = require('react/jsx-runtime');
const React = require('react');
const classVarianceAuthority = require('class-variance-authority');
const LucideIcons = require('lucide-react');
const utils = require('../../../lib/utils.cjs');

function _interopNamespaceCompat(e) {
  if (e && typeof e === 'object' && 'default' in e) return e;
  const n = Object.create(null);
  if (e) {
    for (const k in e) {
      n[k] = e[k];
    }
  }
  n.default = e;
  return n;
}

const React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
const LucideIcons__namespace = /*#__PURE__*/_interopNamespaceCompat(LucideIcons);

const iconVariants = classVarianceAuthority.cva("inline-flex", {
  variants: {
    size: {
      small: "h-4 w-4",
      medium: "h-6 w-6",
      large: "h-8 w-8"
    },
    color: {
      accent: "text-accent",
      accentForeground: "text-accent-foreground",
      primary: "text-primary",
      primaryForeground: "text-primary-foreground",
      secondary: "text-secondary",
      secondaryForeground: "text-secondary-foreground",
      destructive: "text-destructive",
      destructiveForeground: "text-destructive-foreground",
      muted: "text-muted",
      mutedForeground: "text-muted-foreground",
      background: "text-background",
      foreground: "text-foreground"
    },
    rotate: {
      none: "rotate-0",
      "90": "rotate-90",
      "180": "rotate-180",
      "270": "rotate-270"
    }
  },
  defaultVariants: {
    size: "medium",
    color: "primary",
    rotate: "none"
  }
});
const Icon = React__namespace.forwardRef(
  ({ className, iconName, size, color, rotate, ...props }, ref) => {
    const IconComponent = LucideIcons__namespace[iconName];
    if (!IconComponent) {
      console.error(`Icon "${iconName}" does not exist in lucide-react`);
      return null;
    }
    return /* @__PURE__ */ jsxRuntime.jsx(
      IconComponent,
      {
        className: utils.cn(iconVariants({ size, color, rotate, className })),
        ref,
        ...props
      }
    );
  }
);
Icon.displayName = "Icon";
const iconNames = Object.keys(LucideIcons__namespace).filter((key) => !key.startsWith("Lucide") && !key.endsWith("Icon") && key !== "icons").map((key) => key);

exports.Icon = Icon;
exports.iconNames = iconNames;
exports.iconVariants = iconVariants;
