@keycloakify/keycloak-admin-ui
Version:
Repackaged Keycloak Admin UI
17 lines • 755 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { useId } from "react";
import { Card, CardHeader } from "@patternfly/react-core";
export const ClickableCard = ({ onClick, children, ...rest }) => {
const id = useId();
const onKeyDown = (e) => {
if (e.key === " " || e.key === "Enter" || e.key === "Spacebar") {
onClick();
}
};
return (_jsx(Card, { id: id, isClickable: true, onKeyDown: onKeyDown, onClick: onClick, ...rest, children: _jsx(CardHeader, { selectableActions: {
onClickAction: onClick,
selectableActionId: `input-${id}`,
selectableActionAriaLabelledby: id,
}, children: children }) }));
};
//# sourceMappingURL=ClickableCard.js.map