Skip to content

Commit

Permalink
Add word-break to ActionList (#4331)
Browse files Browse the repository at this point in the history
* add word-break

* add test for break-word

* Create pretty-pandas-serve.md

* test(vrt): update snapshots

* updates jest snapshots

---------

Co-authored-by: langermank <langermank@users.noreply.github.com>
Co-authored-by: Mike Perrotti <mperrotti@github.com>
  • Loading branch information
3 people committed Apr 15, 2024
1 parent a215b06 commit 77846c4
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-pandas-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Bug fix: Add `word-break` to ActionList items
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions packages/react/src/ActionList/ActionList.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ export const TextWrapAndTruncation = () => (
<ArrowLeftIcon />
</ActionList.TrailingVisual>
</ActionList.Item>
<ActionList.Item>
<ActionList.LeadingVisual>
<ArrowRightIcon />
</ActionList.LeadingVisual>
SomethingSomething/SomethingElse.Some.Thing.Lalala.la
<ActionList.TrailingVisual>
<ArrowLeftIcon />
</ActionList.TrailingVisual>
</ActionList.Item>
</ActionList>
</Box>
)
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/ActionList/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
flexGrow: slots.inlineDescription ? 0 : 1,
fontWeight: slots.inlineDescription || slots.blockDescription || active ? 'bold' : 'normal',
marginBlockEnd: slots.blockDescription ? '4px' : undefined,
wordBreak: 'break-word',
}}
>
{childrenWithoutSlots}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ exports[`NavList renders a simple list 1`] = `
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 600;
word-break: break-word;
}
.c8 {
Expand All @@ -30,6 +31,7 @@ exports[`NavList renders a simple list 1`] = `
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 400;
word-break: break-word;
}
.c0 {
Expand Down Expand Up @@ -447,6 +449,7 @@ exports[`NavList renders with groups 1`] = `
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 600;
word-break: break-word;
}
.c12 {
Expand All @@ -455,6 +458,7 @@ exports[`NavList renders with groups 1`] = `
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 400;
word-break: break-word;
}
.c3 {
Expand Down Expand Up @@ -893,6 +897,7 @@ exports[`NavList.Item with NavList.SubNav does not have active styles if SubNav
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 400;
word-break: break-word;
}
.c8 {
Expand All @@ -916,6 +921,7 @@ exports[`NavList.Item with NavList.SubNav does not have active styles if SubNav
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 600;
word-break: break-word;
}
.c10 {
Expand Down Expand Up @@ -1385,6 +1391,7 @@ exports[`NavList.Item with NavList.SubNav has active styles if SubNav contains t
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 600;
word-break: break-word;
}
.c9 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ exports[`snapshots renders a menu that contains an item to add to the menu 1`] =
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 400;
word-break: break-word;
}
.c9 {
Expand Down Expand Up @@ -1426,6 +1427,7 @@ exports[`snapshots renders a multiselect input 1`] = `
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 400;
word-break: break-word;
}
.c0 {
Expand Down Expand Up @@ -2132,6 +2134,7 @@ exports[`snapshots renders a multiselect input with selected menu items 1`] = `
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 400;
word-break: break-word;
}
.c9 {
Expand Down Expand Up @@ -2937,6 +2940,7 @@ exports[`snapshots renders a single select input 1`] = `
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 400;
word-break: break-word;
}
.c0 {
Expand Down Expand Up @@ -3403,6 +3407,7 @@ exports[`snapshots renders with a custom text input component 1`] = `
-ms-flex-positive: 1;
flex-grow: 1;
font-weight: 400;
word-break: break-word;
}
.c0 {
Expand Down

0 comments on commit 77846c4

Please sign in to comment.