Skip to content

Commit 42fb3b6

Browse files
authored
chore(expandable section): improve toggle text to be descriptive (patternfly#11737)
* chore(expandable section): improve toggle text to be descriptive * updated expandable text demo * updated show less toggle text * updated demo show less toggle text
1 parent 3ba79b0 commit 42fb3b6

File tree

8 files changed

+17
-8
lines changed

8 files changed

+17
-8
lines changed

packages/react-core/src/components/ExpandableSection/examples/ExpandableSectionBasic.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ export const ExpandableSectionBasic: React.FunctionComponent = () => {
99
};
1010

1111
return (
12-
<ExpandableSection toggleText={isExpanded ? 'Show less' : 'Show more'} onToggle={onToggle} isExpanded={isExpanded}>
12+
<ExpandableSection
13+
toggleText={isExpanded ? 'Show less basic example content' : 'Show more basic example content'}
14+
onToggle={onToggle}
15+
isExpanded={isExpanded}
16+
>
1317
This content is visible only when the component is expanded.
1418
</ExpandableSection>
1519
);

packages/react-core/src/components/ExpandableSection/examples/ExpandableSectionDetached.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const ExpandableSectionDetached: React.FunctionComponent = () => {
2525
contentId={contentId}
2626
direction="up"
2727
>
28-
{isExpanded ? 'Show less' : 'Show more'}
28+
{isExpanded ? 'Show less detached example content' : 'Show more detached example content'}
2929
</ExpandableSectionToggle>
3030
</StackItem>
3131
</Stack>

packages/react-core/src/components/ExpandableSection/examples/ExpandableSectionDisclosure.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export const ExpandableSectionDisclosure: React.FunctionComponent = () => {
1010

1111
return (
1212
<ExpandableSection
13-
toggleText={isExpanded ? 'Show less' : 'Show more'}
13+
toggleText={
14+
isExpanded ? 'Show less disclosure variation example content' : 'Show more disclosure variation example content'
15+
}
1416
onToggle={onToggle}
1517
isExpanded={isExpanded}
1618
displaySize="lg"

packages/react-core/src/components/ExpandableSection/examples/ExpandableSectionIndented.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const ExpandableSectionIndented: React.FunctionComponent = () => {
2121
/>
2222
<br />
2323
<ExpandableSection
24-
toggleText={isExpanded ? 'Show less' : 'Show more'}
24+
toggleText={isExpanded ? 'Show less indented example content' : 'Show more indented example content'}
2525
onToggle={onToggle}
2626
isExpanded={isExpanded}
2727
isIndented

packages/react-core/src/components/ExpandableSection/examples/ExpandableSectionTruncateExpansion.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const ExpandableSectionTruncateExpansion: React.FunctionComponent = () =>
1111
return (
1212
<ExpandableSection
1313
variant={ExpandableSectionVariant.truncate}
14-
toggleText={isExpanded ? 'Show less' : 'Show more'}
14+
toggleText={isExpanded ? 'Show less truncated content' : 'Show more truncated content'}
1515
onToggle={onToggle}
1616
isExpanded={isExpanded}
1717
>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ExpandableSection } from '@patternfly/react-core';
22

33
export const ExpandableSectionUncontrolled: React.FunctionComponent = () => (
4-
<ExpandableSection toggleText="Show more">
4+
<ExpandableSection toggleText="Show more uncontrolled example content">
55
This content is visible only when the component is expanded.
66
</ExpandableSection>
77
);
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { ExpandableSection } from '@patternfly/react-core';
22

33
export const ExpandableSectionUncontrolledDynamicToggle: React.FunctionComponent = () => (
4-
<ExpandableSection toggleTextExpanded="Show less" toggleTextCollapsed="Show more">
4+
<ExpandableSection
5+
toggleTextExpanded="Show less uncontrolled dynamic toggle example content"
6+
toggleTextCollapsed="Show more uncontrolled dynamic toggle example content"
7+
>
58
This content is visible only when the component is expanded.
69
</ExpandableSection>
710
);

packages/react-core/src/demos/ExpandableSection/examples/ExpandableTextDemo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const ExpandableTextDemo: React.FunctionComponent = () => {
1313
return (
1414
<ExpandableSection
1515
variant={ExpandableSectionVariant.truncate}
16-
toggleText={isExpanded ? 'Show less' : 'Show more'}
16+
toggleText={isExpanded ? 'Show less truncated content' : 'Show more truncated content'}
1717
onToggle={onToggle}
1818
isExpanded={isExpanded}
1919
truncateMaxLines={-1}

0 commit comments

Comments
 (0)