Skip to content

Commit 98d536a

Browse files
committed
feat(CC-expandable-section): updated prop mapping
1 parent 0b1ccf4 commit 98d536a

File tree

4 files changed

+323
-218
lines changed

4 files changed

+323
-218
lines changed

packages/code-connect/components/ExpandableSection/ExandableSectionTruncate.figma.tsx

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,50 @@ import { ExpandableSection } from '@patternfly/react-core';
99

1010
figma.connect(
1111
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',
1313
{
1414
props: {
15-
toggleText: figma.string('Toggle Text More'),
16-
isExpanded: false
15+
truncateText: figma.string('Default truncate text')
1716
},
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+
}
2732
}
2833
);
2934

3035
figma.connect(
3136
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',
3338
{
34-
variant: { State: 'Expanded' },
3539
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')
3941
},
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+
}
5057
}
5158
);

0 commit comments

Comments
 (0)