import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2025 GoodData Corporation
import { forwardRef } from "react";
import { bem } from "../@utils/bem.js";
import { UiTag as UiTagComponent } from "../UiTag/UiTag.js";
const { e } = bem("gd-ui-kit-tags");
export const UiTag = forwardRef(function UiTag({ tag, maxWidth, isDeletable, isDisabled, isFocused, deleteLabel, onDelete, onClick }, ref) {
    const canBeDeleted = isDeletable && (tag.isDeletable ?? true);
    return (_jsx("div", { className: e("tag", { isFocused }), role: "listitem", style: { maxWidth }, children: _jsx(UiTagComponent, { ref: ref, tabIndex: -1, deleteTabIndex: -1, label: `${tag.label}`, isDeletable: canBeDeleted, isDisabled: isDisabled, accessibilityConfig: {
                ariaLabel: tag.label,
                deleteAriaLabel: `${deleteLabel ?? "Delete"} ${tag.label}`,
            }, onDelete: (e) => {
                onDelete?.(tag);
                e.stopPropagation();
            }, onClick: (e) => {
                onClick?.(tag);
                e.stopPropagation();
            } }) }));
});
//# sourceMappingURL=UiTag.js.map