From a1a8b9dfb28911dc7c7382d646e0e7a66cb58035 Mon Sep 17 00:00:00 2001 From: Meis Date: Tue, 8 Aug 2023 11:00:21 -0600 Subject: [PATCH 1/2] feat: [Expandable] Propagate attributes --- src/components/Expandable/Expandable.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/Expandable/Expandable.tsx b/src/components/Expandable/Expandable.tsx index c1372ff9..7331a0c4 100644 --- a/src/components/Expandable/Expandable.tsx +++ b/src/components/Expandable/Expandable.tsx @@ -5,7 +5,8 @@ import type { ReactNode } from 'react'; import { useEffect } from 'react'; import { Icon } from '../Icon/Icon'; -export interface ExpandableProperties { +export interface ExpandableProperties + extends React.HTMLAttributes { header: string; children: ReactNode; inAccordion?: boolean; @@ -16,7 +17,9 @@ export const Expandable: React.FC = ({ header, children, inAccordion = false, - openOnLoad = false + openOnLoad = false, + className = '', + ...properties }) => { useEffect(() => { if (inAccordion) return; // Initialization happens in parent component @@ -29,13 +32,18 @@ export const Expandable: React.FC = ({ 'o-expandable', 'o-expandable__padded', 'o-expandable__background', - 'o-expandable__border' + 'o-expandable__border', + className ]; if (openOnLoad) expandableClasses.push('o-expandable__onload-open'); return ( -
+