@hitachivantara/uikit-react-core
Version:
Core React components for the NEXT Design System.
42 lines (41 loc) • 1.32 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
import { useClasses } from "./VerticalScrollListItem.styles.js";
import { staticClasses } from "./VerticalScrollListItem.styles.js";
import { HvTooltip } from "../../Tooltip/Tooltip.js";
const HvVerticalScrollListItem = (props) => {
const {
id,
className,
classes: classesProp,
selected,
label,
tooltipPlacement = "left",
href,
...others
} = useDefaultProps("HvVerticalScrollListItem", props);
const { classes, cx } = useClasses(classesProp);
const Component = href != null ? "a" : "div";
return /* @__PURE__ */ jsx("li", { id, className: cx(classes.root, className), "aria-current": selected, children: /* @__PURE__ */ jsx(HvTooltip, { title: label, placement: tooltipPlacement, children: /* @__PURE__ */ jsx(
Component,
{
role: href == null ? "button" : void 0,
tabIndex: 0,
className: cx(classes.button, classes.text),
href,
...others,
children: /* @__PURE__ */ jsx(
"div",
{
className: cx(classes.icon, {
[classes.notSelected]: !selected
})
}
)
}
) }) });
};
export {
HvVerticalScrollListItem,
staticClasses as verticalScrollListItemClasses
};