/**
* @license lucide-solid v0.574.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/

// src/Icon.tsx
import { For, splitProps } from "solid-js";
import { Dynamic } from "solid-js/web";
import defaultAttributes from "./defaultAttributes";

// ../shared/src/utils/hasA11yProp.ts
var hasA11yProp = (props) => {
  for (const prop in props) {
    if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
      return true;
    }
  }
  return false;
};

// ../shared/src/utils/mergeClasses.ts
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
  return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
}).join(" ").trim();

// ../shared/src/utils/toCamelCase.ts
var toCamelCase = (string) => string.replace(
  /^([A-Z])|[\s-_]+(\w)/g,
  (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
);

// ../shared/src/utils/toKebabCase.ts
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();

// ../shared/src/utils/toPascalCase.ts
var toPascalCase = (string) => {
  const camelCase = toCamelCase(string);
  return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
};

// src/Icon.tsx
var Icon = (props) => {
  const [localProps, rest] = splitProps(props, [
    "color",
    "size",
    "strokeWidth",
    "children",
    "class",
    "name",
    "iconNode",
    "absoluteStrokeWidth"
  ]);
  return <svg
    {...defaultAttributes}
    width={localProps.size ?? defaultAttributes.width}
    height={localProps.size ?? defaultAttributes.height}
    stroke={localProps.color ?? defaultAttributes.stroke}
    stroke-width={localProps.absoluteStrokeWidth ? Number(localProps.strokeWidth ?? defaultAttributes["stroke-width"]) * 24 / Number(localProps.size) : Number(localProps.strokeWidth ?? defaultAttributes["stroke-width"])}
    class={mergeClasses(
      "lucide",
      "lucide-icon",
      ...localProps.name != null ? [
        `lucide-${toKebabCase(toPascalCase(localProps.name))}`,
        `lucide-${toKebabCase(localProps.name)}`
      ] : [],
      localProps.class != null ? localProps.class : ""
    )}
    aria-hidden={!localProps.children && !hasA11yProp(rest) ? "true" : void 0}
    {...rest}
  >
      <For each={localProps.iconNode}>
        {([elementName, attrs]) => {
    return <Dynamic
      component={elementName}
      {...attrs}
    />;
  }}
      </For>
    </svg>;
};
var Icon_default = Icon;
export {
  Icon_default as default
};
//# sourceMappingURL=Icon.jsx.map
