Skip to content

Commit 2041697

Browse files
authored
Merge pull request #45 from input-output-hk/fix/improve-summary-expander-component
feat: add plain prop to summary expander
2 parents 102c3f0 + 2558bbb commit 2041697

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/design-system/summary-expander/summary-expander.component.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export type Props = OmitClassName<'button'> &
1919
title: string;
2020
disabled?: boolean;
2121
testId?: string;
22+
plain?: boolean;
2223
}>;
2324

2425
export const SummaryExpander = ({
@@ -28,6 +29,7 @@ export const SummaryExpander = ({
2829
disabled,
2930
testId,
3031
children,
32+
plain = false,
3133
...props
3234
}: Readonly<Props>): JSX.Element => {
3335
return (
@@ -43,6 +45,7 @@ export const SummaryExpander = ({
4345
justifyContent="space-between"
4446
className={classNames(cx.header, {
4547
[cx.expanded]: open,
48+
[cx.noBorder]: plain,
4649
})}
4750
>
4851
<Text.Body.Normal weight="$semibold" data-testid="expander-title">

src/design-system/summary-expander/summary-expander.css.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ export const header = style([
2020
export const expanded = style({
2121
borderBottom: 'none',
2222
});
23+
24+
export const noBorder = style({
25+
border: 'none',
26+
});

src/design-system/summary-expander/summary-expander.stories.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const MainComponents = (): JSX.Element => (
3232
<Variants.Cell>
3333
<SummaryExpander title="Title" open />
3434
</Variants.Cell>
35+
<Variants.Cell>
36+
<SummaryExpander title="Title" plain />
37+
</Variants.Cell>
3538
</Variants.Row>
3639
);
3740

@@ -93,7 +96,9 @@ export const Overview = (): JSX.Element => (
9396
<Divider my="$64" />
9497

9598
<Section title="Main components">
96-
<Variants.Table headers={['Collapsed (default)', 'Expanded']}>
99+
<Variants.Table
100+
headers={['Collapsed (default)', 'Expanded', 'Plain']}
101+
>
97102
<MainComponents />
98103
</Variants.Table>
99104

0 commit comments

Comments
 (0)