File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/design-system/summary-expander Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
- import type { PropsWithChildren } from 'react' ;
1
+ import type { PropsWithChildren , ReactNode } from 'react' ;
2
2
import React from 'react' ;
3
3
4
4
import * as Collapsible from '@radix-ui/react-collapsible' ;
@@ -16,9 +16,10 @@ export type Props = OmitClassName<'button'> &
16
16
PropsWithChildren < {
17
17
open ?: boolean ;
18
18
onOpenChange ?: ( open : boolean ) => void ;
19
- title : string ;
19
+ title : string | ReactNode ;
20
20
disabled ?: boolean ;
21
21
testId ?: string ;
22
+ hasBorder ?: boolean ;
22
23
} > ;
23
24
24
25
export const SummaryExpander = ( {
@@ -28,6 +29,7 @@ export const SummaryExpander = ({
28
29
disabled,
29
30
testId,
30
31
children,
32
+ hasBorder = true ,
31
33
...props
32
34
} : Readonly < Props > ) : JSX . Element => {
33
35
return (
@@ -43,6 +45,7 @@ export const SummaryExpander = ({
43
45
justifyContent = "space-between"
44
46
className = { classNames ( cx . header , {
45
47
[ cx . expanded ] : open ,
48
+ [ cx . noBorder ] : ! hasBorder ,
46
49
} ) }
47
50
>
48
51
< Text . Body . Normal weight = "$semibold" data-testid = "expander-title" >
Original file line number Diff line number Diff line change @@ -20,3 +20,7 @@ export const header = style([
20
20
export const expanded = style ( {
21
21
borderBottom : 'none' ,
22
22
} ) ;
23
+
24
+ export const noBorder = style ( {
25
+ border : 'none' ,
26
+ } ) ;
You can’t perform that action at this time.
0 commit comments