diff --git a/src/accordion/Accordion.tsx b/src/accordion/Accordion.tsx
index 8a1eb39a..c22affc4 100644
--- a/src/accordion/Accordion.tsx
+++ b/src/accordion/Accordion.tsx
@@ -11,7 +11,8 @@ export interface AccordionProps {
const accordionItemCSS = css`
cursor: pointer;
- padding: var(--accordion-padding-top) var(--accordion-padding-side);
+ height: 40px;
+ padding: 0 var(--accordion-padding-side);
display: block;
width: 100%;
display: flex;
@@ -25,15 +26,9 @@ const accordionItemCSS = css`
text-align: start;
color: var(--ac-global-text-color-900);
border-bottom: 1px solid var(--ac-global-border-color-dark);
- /* remove outline - TODO might need to give a visual cue that this area is in focus */
- outline: none;
- background-color: var(--ac-global-background-color-light);
- transition: background-color 0.2s ease-in-out;
+ transition: background-color ease-in-out 0.2s;
&:hover {
- background-color: var(--ac-global-background-color-light-hover);
- }
- .ac-accordion-item__title {
- font-size: var(--accordion-font-size);
+ background-color: var(--ac-global-background-color-light);
}
`;
@@ -48,12 +43,16 @@ export function Accordion({ children }: AccordionProps) {
role="region"
css={css`
--accordion-animation-duration: ${theme.animation.global.duration}ms;
-
&.ac-accordion--default {
--accordion-padding-top: var(--ac-global-dimension-static-size-100);
--accordion-padding-side: var(--ac-global-dimension-static-size-200);
--accordion-font-size: ${theme.typography.sizes.medium.fontSize}px;
}
+ .ac-accordion-item:not(:last-of-type) {
+ .ac-accordion-itemContent {
+ border-bottom: 1px solid var(--ac-global-border-color-dark);
+ }
+ }
`}
>
{children}
@@ -77,6 +76,10 @@ export interface AccordionItemProps {
* Callback function for when the collapsed state changes
*/
onChange?: (isOpen: boolean) => void;
+ /**
+ * An extra element to show on the right hand side
+ */
+ extra?: ReactNode;
}
export function AccordionItem(props: AccordionItemProps) {
@@ -87,6 +90,7 @@ export function AccordionItem(props: AccordionItemProps) {
defaultIsOpen = true,
onChange,
children,
+ extra,
} = props;
const [isOpen, setIsOpen] = useState(defaultIsOpen);
const contentId = `${id}-content`,
@@ -137,15 +141,25 @@ export function AccordionItem(props: AccordionItemProps) {
aria-expanded={isOpen}
>
{titleEl}
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod - tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, - quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo - consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse - cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat - non proident, sunt in culpa qui officia deserunt mollit anim id est laborum -
+