@@ -9,43 +9,50 @@ import { ExpandableSection } from '@patternfly/react-core';
9
9
10
10
figma . connect (
11
11
ExpandableSection ,
12
- 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/ PatternFly-6--Components-Test ?node-id=2769-146' ,
12
+ 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/branch/Em2QWrHDxDS4LUxo58Hust/ PatternFly-6--Components?node-id=2769-146' ,
13
13
{
14
14
props : {
15
- toggleText : figma . string ( 'Toggle Text More' ) ,
16
- isExpanded : false
15
+ truncateText : figma . string ( 'Default truncate text' )
17
16
} ,
18
- example : ( props ) => (
19
- < ExpandableSection
20
- isExpanded = { props . isExpanded }
21
- onToggle = { ( ) => { } }
22
- toggleText = { props . isExpanded ? 'Show less basic example content' : `${ props . toggleText } ` }
23
- >
24
- This content is visible only when the component is expanded.
25
- </ ExpandableSection >
26
- )
17
+ example : ( props ) => {
18
+ /* eslint-disable */
19
+ const [ isExpanded , setIsExpanded ] = useState ( false ) ;
20
+ /* eslint-enable */
21
+
22
+ return (
23
+ < ExpandableSection
24
+ isExpanded = { isExpanded }
25
+ onToggle = { setIsExpanded ( isExpanded ) }
26
+ toggleText = { isExpanded ? 'Show less' : 'Show more' }
27
+ >
28
+ { props . truncateText }
29
+ </ ExpandableSection >
30
+ ) ;
31
+ }
27
32
}
28
33
) ;
29
34
30
35
figma . connect (
31
36
ExpandableSection ,
32
- 'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/ PatternFly-6--Components-Test ?node-id=2769-146' ,
37
+ 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/branch/Em2QWrHDxDS4LUxo58Hust/ PatternFly-6--Components?node-id=2769-146' ,
33
38
{
34
- variant : { State : 'Expanded' } ,
35
39
props : {
36
- toggleText : figma . string ( 'Toggle Text Less' ) ,
37
- defaultContentSectionText : figma . string ( 'Default Truncate Text' ) ,
38
- isExpanded : true
40
+ truncateText : figma . string ( 'Expanded truncate text' )
39
41
} ,
40
- example : ( props ) => (
41
- < ExpandableSection
42
- isExpanded = { props . isExpanded }
43
- onToggle = { ( ) => { } }
44
- toggleText = { props . isExpanded ? 'Show less basic example content' : `${ props . toggleText } ` }
45
- variant = "truncate"
46
- >
47
- { props . defaultContentSectionText }
48
- </ ExpandableSection >
49
- )
42
+ example : ( props ) => {
43
+ /* eslint-disable */
44
+ const [ isExpanded , setIsExpanded ] = useState ( false ) ;
45
+ /* eslint-enable */
46
+
47
+ return (
48
+ < ExpandableSection
49
+ isExpanded = { isExpanded }
50
+ onToggle = { setIsExpanded ( isExpanded ) }
51
+ toggleText = { isExpanded ? 'Show less' : 'Show more' }
52
+ >
53
+ { props . truncateText }
54
+ </ ExpandableSection >
55
+ ) ;
56
+ }
50
57
}
51
58
) ;
0 commit comments