Skip to content

Commit c75f74d

Browse files
committed
feat: add hasBorder prop to summary expander
1 parent 1f8d71e commit c75f74d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { PropsWithChildren } from 'react';
1+
import type { PropsWithChildren, ReactNode } from 'react';
22
import React from 'react';
33

44
import * as Collapsible from '@radix-ui/react-collapsible';
@@ -16,9 +16,10 @@ export type Props = OmitClassName<'button'> &
1616
PropsWithChildren<{
1717
open?: boolean;
1818
onOpenChange?: (open: boolean) => void;
19-
title: string;
19+
title: string | ReactNode;
2020
disabled?: boolean;
2121
testId?: string;
22+
hasBorder?: boolean;
2223
}>;
2324

2425
export const SummaryExpander = ({
@@ -28,6 +29,7 @@ export const SummaryExpander = ({
2829
disabled,
2930
testId,
3031
children,
32+
hasBorder = true,
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]: !hasBorder,
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+
});

0 commit comments

Comments
 (0)