Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add word-break to ActionList #4331

Merged
merged 10 commits into from
Apr 15, 2024
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading