/* @oracle/oraclejet-preact: undefined */
import { jsx } from 'preact/jsx-runtime';
import { forwardRef } from 'preact/compat';
import { u as useActionable } from './useActionable-2e7adacf.js';
import './TabbableModeContext-7d8ad946.js';
import { u as useTabbableMode } from './useTabbableMode-a3a351d0.js';
import { S as StyledCard } from './StyledCard-362bd74b.js';

/**
 * An action card is a container that renders a group of related information in a styled rectangular area, provides enhanced styling for hover and focus states, and invokes an action event when clicked.
 * Width, height, padding, and background color are set through props.
 */
const ActionCard = forwardRef(({ children, onAction, testId, ...rest }, ref) => {
    const { isTabbable } = useTabbableMode();
    const pressHandler = (e) => {
        if (onAction) {
            onAction({
                reason: e.type == 'keyup' ? 'keyboard' : 'pointer'
            });
        }
    };
    const { actionableProps, isHover, isActive } = useActionable(pressHandler);
    return (jsx(StyledCard, { ...actionableProps, cursor: "pointer", display: "inlineFlex", isActive: isActive, isHover: isHover, parentComponentVariant: "actionCard", ref: ref, role: "button", tabIndex: isTabbable ? 0 : -1, testId: testId, ...rest, children: children }));
});

export { ActionCard as A };
//# sourceMappingURL=ActionCard-bac27bb9.js.map
