Skip to content

Commit

Permalink
Hotfixes for 0.41.0 RC (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
rezrah authored Oct 28, 2024
1 parent 3104149 commit 4a07afb
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 22 deletions.
20 changes: 20 additions & 0 deletions .changeset/light-eyes-talk.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
---
'@primer/brand-primitives': minor
'@primer/react-brand': patch
---

Fixed issue where `Button` component would reflow and break over multiple lines when its text content exceeded the viewport width.

:warning: Breaking changes to the following design tokens:

```diff
- --brand-control-medium-paddingBlock
+ --brand-control-medium-paddingBlock-normal
```

```diff
- --brand-control-large-paddingBlock
+ --brand-control-large-paddingBlock-normal
```

Additional tokens added:

```diff
+ --brand-control-medium-paddingBlock-condensed
+ --brand-control-large-paddingBlock-condensed
```
2 changes: 1 addition & 1 deletion .changeset/lovely-rocks-bathe.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@primer/react-brand': patch
---

Improves spacing of RiverBreakout content
Improves spacing of `RiverBreakout` content
4 changes: 3 additions & 1 deletion .changeset/sweet-waves-matter.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
'@primer/react-brand': patch
---

- Update the order of River children to ensure an acccessible markup strucuture.
- Update the order of River children to ensure an accessible markup structure.
- On narrow viewports, the content and visuals are now flipped, with the visuals always placed first to enhance visual hierarchy.

> :warning: This may introduce a visual breaking change, whereby the visual is now displayed earlier in the page than originally intended. Please manually review content adjacent to the `River` components for correctness.
5 changes: 0 additions & 5 deletions .changeset/twelve-hotels-bake.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/wise-cherries-walk.md

This file was deleted.

14 changes: 12 additions & 2 deletions packages/design-tokens/src/tokens/functional/size/size.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@
"value": "{base.size.16}"
},
"paddingBlock": {
"value": "{base.size.16}"
"condensed": {
"value": "{base.size.6}"
},
"normal": {
"value": "{base.size.16}"
}
},
"paddingInline": {
"condensed": {
Expand All @@ -67,7 +72,12 @@
"value": "{base.size.20}"
},
"paddingBlock": {
"value": "{base.size.20}"
"condensed": {
"value": "{base.size.12}"
},
"normal": {
"value": "{base.size.20}"
}
},
"paddingInline": {
"condensed": {
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/ActionMenu/ActionMenu.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@
}

.ActionMenu__item--medium {
padding: var(--brand-control-medium-paddingBlock) var(--brand-control-medium-paddingInline-normal);
padding: var(--brand-control-medium-paddingBlock-condensed) var(--brand-control-medium-paddingInline-normal);
min-height: var(--brand-control-medium-size);
}

.ActionMenu__item--small {
Expand Down
11 changes: 11 additions & 0 deletions packages/react/src/Button/Button.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {userEvent, waitFor, within} from '@storybook/test'

import {Button} from '.'
import {HeartFillIcon, MarkGithubIcon, PlayIcon} from '@primer/octicons-react'
import {Grid} from '../Grid'

export default {
title: 'Components/Button/Features',
Expand Down Expand Up @@ -255,3 +256,13 @@ export const WithVisualsAndDisabled = () => (
</Button>
)
WithVisualsAndDisabled.storyName = 'With visuals and disabled'

export const WithLongerText = () => (
<Grid>
<Grid.Column span={2}>
<Button hasArrow={false}>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sapien sit ullamcorper id.
</Button>
</Grid.Column>
</Grid>
)
4 changes: 2 additions & 2 deletions packages/react/src/Button/Button.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@

.Button--size-medium {
min-height: var(--brand-control-medium-size);
padding-inline: var(--brand-control-medium-paddingInline-spacious);
padding: var(--brand-control-medium-paddingBlock-condensed) var(--brand-control-medium-paddingInline-spacious);
}

.Button--size-large {
min-height: var(--brand-control-large-size);
padding-inline: var(--brand-control-large-paddingInline-spacious);
padding: var(--brand-control-large-paddingBlock-condensed) var(--brand-control-large-paddingInline-spacious);
}

.Button--size-large .Button__icon-visual,
Expand Down
9 changes: 9 additions & 0 deletions packages/react/src/Button/Button.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,13 @@ test.describe('Visual Comparison: Button', () => {
await page.waitForTimeout(500)
expect(await page.screenshot({fullPage: true})).toMatchSnapshot()
})

test('Button / With Longer Text', async ({page}) => {
await page.goto(
'http://localhost:6006/iframe.html?args=&id=components-button-features--with-longer-text&viewMode=story',
)

await page.waitForTimeout(500)
expect(await page.screenshot({fullPage: true})).toMatchSnapshot()
})
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/react/src/forms/TextInput/TextInput.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
.TextInput--medium {
font-weight: var(--brand-text-weight-100);
font-size: var(--brand-text-size-100);
padding: var(--brand-control-medium-paddingBlock) var(--brand-control-medium-paddingInline-condensed);
padding: var(--brand-control-medium-paddingBlock-normal) var(--brand-control-medium-paddingInline-condensed);
}

.TextInput--large {
font-weight: var(--brand-text-weight-200);
font-size: var(--brand-text-size-200);
padding: var(--brand-control-large-paddingBlock) var(--brand-control-large-paddingInline-condensed);
padding: var(--brand-control-large-paddingBlock-normal) var(--brand-control-large-paddingInline-condensed);
}

.TextInput-wrapper--large {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/forms/Textarea/Textarea.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
.Textarea--medium {
font-weight: var(--brand-text-weight-100);
font-size: var(--brand-text-size-100);
padding: var(--brand-control-medium-paddingBlock) var(--brand-control-medium-paddingInline-condensed);
padding: var(--brand-control-medium-paddingBlock-normal) var(--brand-control-medium-paddingInline-condensed);
}

.Textarea--large {
font-weight: var(--brand-text-weight-200);
font-size: var(--brand-text-size-200);
padding: var(--brand-control-large-paddingBlock) var(--brand-control-large-paddingInline-condensed);
padding: var(--brand-control-large-paddingBlock-normal) var(--brand-control-large-paddingInline-condensed);
}

/*
Expand Down

0 comments on commit 4a07afb

Please sign in to comment.