Skip to content

Commit

Permalink
Merge branch 'main' of github.com:primer/react into button-loading-state
Browse files Browse the repository at this point in the history
  • Loading branch information
mperrotti committed Mar 14, 2024
2 parents 5acdcb9 + a392556 commit c0e2a3d
Show file tree
Hide file tree
Showing 142 changed files with 157 additions and 180 deletions.
5 changes: 0 additions & 5 deletions .changeset/beige-crews-flow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/beige-meals-doubt.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/bright-foxes-hunt.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fair-cooks-return.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fair-countries-taste.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fair-sloths-kick.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fluffy-pugs-care.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/gold-baboons-live.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/grumpy-shirts-march.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/mighty-pears-deny.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/neat-toes-build.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/rotten-schools-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Tooltip v1: Remove the caret from the tooltip to make it consistent with the new tooltip design
5 changes: 5 additions & 0 deletions .changeset/silly-geese-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Update IconButton default color to use fgColor-muted
5 changes: 0 additions & 5 deletions .changeset/tasty-spoons-suffer.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wet-geckos-accept.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wicked-rings-prove.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/young-cooks-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Bug fix: default Button disabled bg-color
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.
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.
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.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# All changes should be reviewed by a member of the @react-reviewers team
* @primer/engineer-reviewers
./src/legacy-theme/ @langermank
.playwright/snapshots/components @primer/design-reviewers
43 changes: 0 additions & 43 deletions docs/content/ssr.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion examples/app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@primer/react": "36.10.0",
"@primer/react": "36.11.0",
"next": "^14.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@primer/octicons-react": "^18.2.0",
"@primer/react": "36.10.0",
"@primer/react": "36.11.0",
"next": "^14.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# @primer/react

## 36.11.0

### Minor Changes

- [#4353](https://github.com/primer/react/pull/4353) [`2c0086e6da3ae3a360c12952399256c98941982e`](https://github.com/primer/react/commit/2c0086e6da3ae3a360c12952399256c98941982e) Thanks [@anleac](https://github.com/anleac)! - SelectPanel: Added `footer` prop that renders a sticky footer at the bottom of the item list.

- [#4288](https://github.com/primer/react/pull/4288) [`200fb18839053f669d30d86e4dd88b399b06a44b`](https://github.com/primer/react/commit/200fb18839053f669d30d86e4dd88b399b06a44b) Thanks [@siddharthkp](https://github.com/siddharthkp)! - experimental/SelectPanel: Add back button

- [#4097](https://github.com/primer/react/pull/4097) [`9c535e835a364bce5d01b28f4029d2bf4d5bdfaf`](https://github.com/primer/react/commit/9c535e835a364bce5d01b28f4029d2bf4d5bdfaf) Thanks [@broccolinisoup](https://github.com/broccolinisoup)! - TextInput: Update TextInput.Action internal component to use Tooltip v2

### Patch Changes

- [#4359](https://github.com/primer/react/pull/4359) [`937dbdea2a0b2f79b60f68440f5d8c24df344401`](https://github.com/primer/react/commit/937dbdea2a0b2f79b60f68440f5d8c24df344401) Thanks [@pksjce](https://github.com/pksjce)! - ActionBar: Overflow menu items should be able to trigger dialogs

- [#4327](https://github.com/primer/react/pull/4327) [`f08f85b5a90e532c7a8795f7bea5af80765283d4`](https://github.com/primer/react/commit/f08f85b5a90e532c7a8795f7bea5af80765283d4) Thanks [@broccolinisoup](https://github.com/broccolinisoup)! - Tooltip v2: Set the tooltip position when popover-open attribute is added to the tooltip element not the toggle event is triggered

- [#4348](https://github.com/primer/react/pull/4348) [`c64e5b25698885eeeeee5bc95c47582248011a39`](https://github.com/primer/react/commit/c64e5b25698885eeeeee5bc95c47582248011a39) Thanks [@siddharthkp](https://github.com/siddharthkp)! - experimental/SelectPanel: Do not render children of `<dialog>` when closed

- [#4308](https://github.com/primer/react/pull/4308) [`32b0cf77fcb4112f00da6ffb93a52875d23b9370`](https://github.com/primer/react/commit/32b0cf77fcb4112f00da6ffb93a52875d23b9370) Thanks [@tbenning](https://github.com/tbenning)! - Unify Breadcrumbs + fix a11y issue

- [#4334](https://github.com/primer/react/pull/4334) [`f685d521dd52d0a9601e0021189895e1adca3b0b`](https://github.com/primer/react/commit/f685d521dd52d0a9601e0021189895e1adca3b0b) Thanks [@TylerJDev](https://github.com/TylerJDev)! - Switches focus styles to target `a.focus-visible` instead of `a:focus-visible`.

- [#4349](https://github.com/primer/react/pull/4349) [`15c078dda93ae8579a858efcce3b6a2f97204373`](https://github.com/primer/react/commit/15c078dda93ae8579a858efcce3b6a2f97204373) Thanks [@jonrohan](https://github.com/jonrohan)! - Adding aria-invalid="true" to TextInput when error.

- [#4365](https://github.com/primer/react/pull/4365) [`fe9f8baae473019e3605fae8895ba63f88fae074`](https://github.com/primer/react/commit/fe9f8baae473019e3605fae8895ba63f88fae074) Thanks [@pksjce](https://github.com/pksjce)! - Bugfix: `aria-invalid` is overriden in TextInput

- [#4354](https://github.com/primer/react/pull/4354) [`4b823ff237235564900aeadb81713e984676c5ad`](https://github.com/primer/react/commit/4b823ff237235564900aeadb81713e984676c5ad) Thanks [@siddharthkp](https://github.com/siddharthkp)! - TextInput: Remove redundant `aria-label` attribute from `TextInput.Action` when it already has an `aria-labelledby`.

- [#4320](https://github.com/primer/react/pull/4320) [`7cb3464a50a49efc59e9a29baa2dd543147b0bee`](https://github.com/primer/react/commit/7cb3464a50a49efc59e9a29baa2dd543147b0bee) Thanks [@siddharthkp](https://github.com/siddharthkp)! - experimental/SelectPanel: Move focus to first item if there is no filter input

- [#4337](https://github.com/primer/react/pull/4337) [`69f4489a3a6e928c5c387c8aa42668f5f3b0d92c`](https://github.com/primer/react/commit/69f4489a3a6e928c5c387c8aa42668f5f3b0d92c) Thanks [@manuelpuyol](https://github.com/manuelpuyol)! - Add precompile step for colorSchemes

- [#4360](https://github.com/primer/react/pull/4360) [`5baf73660f86fa4850f7c705d5d3ab1c599fe461`](https://github.com/primer/react/commit/5baf73660f86fa4850f7c705d5d3ab1c599fe461) Thanks [@broccolinisoup](https://github.com/broccolinisoup)! - Tooltip2: Render tooltip element as `span` instead of `div`

## 36.10.0

### Minor Changes
Expand Down
3 changes: 1 addition & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@primer/react",
"version": "36.10.0",
"version": "36.11.0",
"description": "An implementation of GitHub's Primer Design System using React",
"main": "lib/index.js",
"module": "lib-esm/index.js",
Expand Down Expand Up @@ -94,7 +94,6 @@
"@primer/live-region-element": "^0.2.0",
"@primer/octicons-react": "^19.8.0",
"@primer/primitives": "7.15.3",
"@react-aria/ssr": "^3.5.0",
"@styled-system/css": "^5.1.5",
"@styled-system/props": "^5.1.5",
"@styled-system/theme-get": "^5.1.2",
Expand Down
30 changes: 26 additions & 4 deletions packages/react/src/Button/Button.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,34 @@ export const TrailingAction = () => <Button trailingAction={TriangleDownIcon}>Tr

export const Block = () => <Button block>Default</Button>

export const Disabled = () => <Button disabled>Default</Button>
export const Disabled = () => (
<div style={{display: 'flex', flexDirection: 'row', gap: '1rem'}}>
<Button disabled>Default</Button>
<Button variant="primary" disabled>
Primary
</Button>
<Button variant="danger" disabled>
Danger
</Button>
<Button variant="invisible" disabled>
Invisible
</Button>
</div>
)

export const Inactive = () => (
<Button variant="primary" inactive>
Default
</Button>
<div style={{display: 'flex', flexDirection: 'row', gap: '1rem'}}>
<Button inactive>Default</Button>
<Button variant="primary" inactive>
Primary
</Button>
<Button variant="danger" inactive>
Danger
</Button>
<Button variant="invisible" inactive>
Invisible
</Button>
</div>
)

export const Small = () => <Button size="small">Default</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ exports[`Button respects block prop 1`] = `
box-shadow: none;
color: primer.fg.disabled;
border-color: var(--button-default-borderColor-disabled,undefined);
background-color: var(--button-default-bgColor-disabled,undefined);
}
.c0:disabled [data-component=ButtonCounter],
Expand Down Expand Up @@ -251,6 +252,10 @@ exports[`Button respects block prop 1`] = `
color: var(--button-color,undefined);
}
.c0[data-component="IconButton"][data-no-visuals] {
color: fg.muted;
}
@media (forced-colors:active) {
.c0:focus {
outline: solid 1px transparent;
Expand Down Expand Up @@ -382,6 +387,7 @@ exports[`Button respects the alignContent prop 1`] = `
box-shadow: none;
color: primer.fg.disabled;
border-color: var(--button-default-borderColor-disabled,undefined);
background-color: var(--button-default-bgColor-disabled,undefined);
}
.c0:disabled [data-component=ButtonCounter],
Expand Down Expand Up @@ -532,6 +538,10 @@ exports[`Button respects the alignContent prop 1`] = `
color: var(--button-color,undefined);
}
.c0[data-component="IconButton"][data-no-visuals] {
color: fg.muted;
}
@media (forced-colors:active) {
.c0:focus {
outline: solid 1px transparent;
Expand Down Expand Up @@ -662,6 +672,7 @@ exports[`Button respects the large size prop 1`] = `
box-shadow: none;
color: primer.fg.disabled;
border-color: var(--button-default-borderColor-disabled,undefined);
background-color: var(--button-default-bgColor-disabled,undefined);
}
.c0:disabled [data-component=ButtonCounter],
Expand Down Expand Up @@ -812,6 +823,10 @@ exports[`Button respects the large size prop 1`] = `
color: var(--button-color,undefined);
}
.c0[data-component="IconButton"][data-no-visuals] {
color: fg.muted;
}
@media (forced-colors:active) {
.c0:focus {
outline: solid 1px transparent;
Expand Down Expand Up @@ -943,6 +958,7 @@ exports[`Button respects the small size prop 1`] = `
box-shadow: none;
color: primer.fg.disabled;
border-color: var(--button-default-borderColor-disabled,undefined);
background-color: var(--button-default-bgColor-disabled,undefined);
}
.c0:disabled [data-component=ButtonCounter],
Expand Down Expand Up @@ -1093,6 +1109,10 @@ exports[`Button respects the small size prop 1`] = `
color: var(--button-color,undefined);
}
.c0[data-component="IconButton"][data-no-visuals] {
color: fg.muted;
}
@media (forced-colors:active) {
.c0:focus {
outline: solid 1px transparent;
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/Button/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
'&:disabled, &[aria-disabled][data-loading="false"]': {
color: 'primer.fg.disabled',
borderColor: `var(--button-default-borderColor-disabled, ${theme?.colors.btn.border})`,
backgroundColor: `var(--button-default-bgColor-disabled, ${theme?.colors.input.disabledBg})`,
'[data-component=ButtonCounter]': {
color: 'inherit',
},
Expand All @@ -32,6 +33,9 @@ export const getVariantStyles = (variant: VariantType = 'default', theme?: Theme
'[data-component=ButtonCounter]': {
backgroundColor: 'btn.counterBg',
},
'&[data-component="IconButton"][data-no-visuals]': {
color: 'fg.muted',
},
},
primary: {
color: 'btn.primary.text',
Expand Down
22 changes: 22 additions & 0 deletions packages/react/src/FormControl/FormControl.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,25 @@ export const WithLeadingVisual = () => (
</FormControl>
</Box>
)

export const DisabledInputs = () => (
<Box sx={{display: 'flex', flexDirection: 'column', gap: '1rem'}}>
<FormControl disabled>
<FormControl.Label>Disabled checkbox</FormControl.Label>
<Checkbox />
</FormControl>
<FormControl disabled>
<FormControl.Label>Disabled input</FormControl.Label>
<TextInput />
</FormControl>
<FormControl disabled>
<FormControl.Label>Disabled select</FormControl.Label>
<Select>
<Select.Option value="figma">Figma</Select.Option>
<Select.Option value="css">Primer CSS</Select.Option>
<Select.Option value="prc">Primer React components</Select.Option>
<Select.Option value="pvc">Primer ViewComponents</Select.Option>
</Select>
</FormControl>
</Box>
)
Loading

0 comments on commit c0e2a3d

Please sign in to comment.