diff --git a/packages/orbit-components/src/Card/CardSection/index.tsx b/packages/orbit-components/src/Card/CardSection/index.tsx index e649b4880f..6bfa00134f 100644 --- a/packages/orbit-components/src/Card/CardSection/index.tsx +++ b/packages/orbit-components/src/Card/CardSection/index.tsx @@ -8,13 +8,29 @@ import { ELEMENT_OPTIONS } from "../../Heading/consts"; import type { Props } from "./types"; import Header from "../components/Header"; import Expandable from "./components/Expandable"; -import handleKeyDown from "../../utils/handleKeyDown"; import Stack from "../../Stack"; +import handleKeyDown from "../../utils/handleKeyDown"; -const Actions = ({ actions }) => ( - - {actions} - +const InteractiveWrapper = ({ + onClick, + className, + children, +}: Pick & { children?: React.ReactNode; className?: string }) => ( + // eslint-disable-next-line jsx-a11y/no-static-element-interactions +
+ {children} +
); export default function CardSection({ @@ -58,26 +74,20 @@ export default function CardSection({ return ( // Needs to capture bubbled click events from the - {actions && } + {actions && ( + + {actions} + + )} )} {(title != null || header != null) && !expandable && ( -
-
- {actions && } +
+ +
+
)} {children && expandable && (
-
+ {children} -
+
)} {children && !expandable && ( -
{children} -
+ )}
);