var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { forwardRef, useContext } from "react";
import { BodyLong } from "../typography/index.js";
import { cl } from "../utils/helpers/index.js";
import { consoleWarning } from "../utils/helpers/consoleWarning.js";
import { ListContext } from "./List.context.js";
/**
 * @see 🏷️ {@link ListItemProps}
 */
export const ListItem = forwardRef((_a, ref) => {
    var { className, children, title, icon } = _a, rest = __rest(_a, ["className", "children", "title", "icon"]);
    const { listType, size } = useContext(ListContext);
    if (listType === "ol" && icon) {
        consoleWarning("<List />: Icon prop is not supported for ordered lists. Remove icon prop.");
    }
    return (React.createElement("li", Object.assign({}, rest, { ref: ref, className: cl("aksel-list__item", className) }),
        listType === "ul" && (React.createElement("div", { className: cl("aksel-list__item-marker", {
                "aksel-list__item-marker--icon": icon,
                "aksel-list__item-marker--bullet": !icon,
            }) }, icon ? (icon) : (React.createElement("svg", { viewBox: "0 0 6 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": true, focusable: false, role: "img" },
            React.createElement("rect", { width: "6", height: "6", rx: "3", fill: "currentColor" }))))),
        React.createElement("div", null,
            title && (React.createElement(BodyLong, { as: "p", size: size, weight: "semibold" }, title)),
            children)));
});
ListItem.displayName = "List.Item";
export default ListItem;
//# sourceMappingURL=List.Item.js.map