Skip to content

Commit

Permalink
Merge branch 'main' of github.com:adobe/react-spectrum into clean-up-…
Browse files Browse the repository at this point in the history
…lint-warnings
  • Loading branch information
LFDanLu committed Apr 6, 2021
2 parents 1d981ed + e066b67 commit 5e501f8
Show file tree
Hide file tree
Showing 882 changed files with 17,258 additions and 2,956 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
docs-production:
docker:
- image: circleci/node:12
resource_class: large
resource_class: xlarge

working_directory: ~/react-spectrum
steps:
Expand Down
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ module.exports = {
'jest': true,
'expect': true,
'JSX': 'readonly',
'NodeJS': 'readonly'
'NodeJS': 'readonly',
'AsyncIterable': 'readonly'
},
settings: {
jsdoc: {
Expand Down
2 changes: 1 addition & 1 deletion .parcelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"transformers": {
"docs:*.{js,ts,tsx,json}": ["parcel-transformer-docs", "@parcel/transformer-inline"],
"docs-json:*.{js,ts,tsx,json}": ["parcel-transformer-docs"],
"*.mdx": ["parcel-transformer-mdx-docs"],
"*.{md,mdx}": ["parcel-transformer-mdx-docs"],
"*.svg": ["@parcel/transformer-svg-react"],
"*.css": ["...", "parcel-transformer-css-env"]
},
Expand Down
150 changes: 117 additions & 33 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,132 @@
# Contributing
# Contribute

Thanks for choosing to contribute!
We are currently in pre-release mode and are actively working on getting to a stable version. Please talk to us or file an issue before contributing.
Thanks for choosing to contribute! We look forward to improving web applications together. Here you will find information on how to propose bug fixes, suggest improvements, and develop locally.

The following is a set of guidelines to follow when contributing to this project.
## Better together
We believe that the best way to build a better web is together as a community. The React Spectrum project aims to make it easier to build design systems and component libraries with high quality interactions and accessibility for all. The core team and all external contributors follow the same process in order maintain a high quality codebase.

## Code Of Conduct
## Code of conduct
We adhere to the Adobe [code of conduct](https://github.com/adobe/react-spectrum/blob/main/CODE_OF_CONDUCT.md) and by participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

This project adheres to the Adobe [code of conduct](./CODE_OF_CONDUCT.md). By participating,
you are expected to uphold this code. Please report unacceptable behavior to
[[email protected]](mailto:Grp-opensourceoffice@adobe.com).
## Reporting issues
### Bugs
We use [GitHub issues](https://github.com/adobe/react-spectrum/issues) to track work and log bugs. Please check existing issues before filing anything new. We do our best to respond to issues within a few days. If you would like to contribute a fix, please let us know by leaving a comment on the issue.

## Have A Question?
The best way to reduce back and forth on a bug is provide a small code example exhibiting the issue along with steps to reproduce it. If you would like to work on a bugfix yourself, make sure an issue exists first.

Start by filing an issue. The existing committers on this project work to reach
consensus around project direction and issue solutions within issue threads
(when appropriate).
Please follow the issue templates when filing new ones and add as much information as possible.

## Contributor License Agreement
### Feature requests
Our components can always be improved upon. If you have a feature request, you can use our Feature Request issue template. For larger scopes of work, it is a good idea to open a Request For Comments (RFC) first to gather feedback from the team. Please follow our RFC [template](https://github.com/adobe/react-spectrum/blob/main/rfcs/template.md). Make a PR to add your RFC to the [rfcs folder](https://github.com/adobe/react-spectrum/tree/main/rfcs) to give the team and the community a chance to discuss the proposal.

All third-party contributions to this project must be accompanied by a signed contributor
license agreement. This gives Adobe permission to redistribute your contributions
as part of the project. [Sign our CLA](https://opensource.adobe.com/cla.html). You
only need to submit an Adobe CLA one time, so if you have submitted one previously,
you are good to go!
### Security issues
Security issues shouldn't be reported on this issue tracker. Instead, please follow the directions [here](https://helpx.adobe.com/security/alertus.html) to contact our security team.

## Code Reviews
## Pull Requests
For significant changes, it is recommended that you first propose your solution in [an RFC](#feature-requests) and gather feedback.

All submissions should come in the form of pull requests and need to be reviewed
by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/)
for more information on sending pull requests.
A few things to keep in mind before submitting a pull request:

Lastly, please follow the [pull request template](.github/PULL_REQUEST_TEMPLATE.md) when
submitting a pull request!
- Add a clear description covering your changes
- Reference the issue in the description
- Make sure linting and tests pass
- Include relevant unit tests
- Add/update stories in storybook for your changes
- Update documentation
- Remember that all submissions require review, please be patient.

## From Contributor To Committer
The team will review all pull requests and do one of the following:
- request changes to it (most common)
- merge it
- close it with an explanation.

We love contributions from our community! If you'd like to go a step beyond contributor
and become a committer with full write access and a say in the project, you must
be invited to the project. The existing committers employ an internal nomination
process that must reach lazy consensus (silence is approval) before invitations
are issued. If you feel you are qualified and want to get more deeply involved,
feel free to reach out to existing committers to have a conversation about that.
Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/) for more information on sending pull requests.

## Security Issues
Lastly, please follow the pull request template when submitting a pull request!

Security issues shouldn't be reported on this issue tracker. Instead, [file an issue to our security experts](https://helpx.adobe.com/security/alertus.html).
### Contributor License Agreement
All third-party contributions to this project must be accompanied by a signed contributor license agreement. This gives Adobe permission to redistribute your contributions as part of the project. [Sign our CLA](https://opensource.adobe.com/cla.html). You only need to submit an Adobe CLA one time, so if you have submitted one previously, you are good to go!

## Where to start
There are many places to dive into react-spectrum to help out. Before you take on a feature or issue, make sure you become familiar with [our architecture](architecture.html).

If you are looking for place to start, consider the following options:
- Look for issues tagged with help wanted and/or good first issue.
- Help triage existing issues by investigating problems and following up on missing information.
- Update missing or fix existing documentation
- Review and test open pull requests

## Developing
When you are ready to start developing you can clone the repo and start storybook.
Make sure you have the following requirements installed: [node](https://nodejs.org/) (v11.0.0+) and [yarn](https://yarnpkg.com/en/) (v1.22.0+)

Fork the repo first using [this guide](https://help.github.com/articles/fork-a-repo), then clone it locally.
```
git clone https://github.com/YOUR-USERNAME/react-spectrum
cd react-spectrum
yarn install
```

You can then run the storybook and browse to [http://localhost:9003](http://localhost:9003) with:
```bash
yarn start
```

Or run the documentation and browse to [http://localhost:1234/](http://localhost:1234/) with:
```bash
yarn start:docs
```

### Tests
We use [jest](https://jestjs.io/) for unit tests and [react-testing-library](https://testing-library.com/docs/react-testing-library/intro) for rendering and writing assertions. Please make sure you include tests with your pull requests. Our CI will run the tests on PRs as well as the linter and type checker. You can see on each PR whether you have passed all our checks. We split the tests into 2 groups.

*Visual tests*
- A Storybook story should be written for each visual state that a component can be in (based on props).

*Unit tests*
- (Props) Anything that should be changed by a prop should be tested via react-testing-library.
- (Events) Anything that should trigger an event should be tested via react-testing-library.

You can run the tests with:

```bash
yarn jest
```

You can also get a code coverage report by running:

```bash
yarn jest --coverage
```

### Linting
The code is linted with [eslint](https://eslint.org/). The linter runs whenever you run the tests, but you can also run it with
```bash
yarn lint
```

### TypeScript
The code for React Spectrum is written in [TypeScript](https://www.typescriptlang.org/). The type checker will usually run in your editor, but also runs when you run
```bash
yarn lint
```

### Storybook
We use [Storybook](https://storybooks.js.org) for local development. Run the following command to start it:
```bash
yarn start
```
Then, open [http://localhost:9003](http://localhost:9003) in your browser to play around with the components and test your changes.

### Documentation
Our documentation should always remain up to date. When making changes to components, make sure the appropriate documentation has been updated to reflect those changes. Documentation for each component can be found in the docs folder within a component's package. Other documentation pages can be found in the [packages/dev/docs](https://github.com/adobe/react-spectrum/tree/main/packages/dev/docs) folder in the codebase.

Documentation can be run locally by using
```bash
yarn start:docs
```
Then, open [http://localhost:1234](http://localhost:1234) in your browser.

## Contributor to committer

We love contributions from our community! If you'd like to go a step beyond contributor and become a committer with full write access and a say in the project, you must be invited. The existing committers employ an internal nomination process that must reach lazy consensus (silence is approval) before invitations are issued. If you feel you are qualified and want to get more deeply involved, feel free to reach out to existing committers to have a conversation.
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@
"@actions/core": "^1.1.0",
"@actions/github": "^1.1.0",
"@adobe/spectrum-css-workflow-icons": "^1.0.0",
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/node": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-syntax-class-properties": "^7.0.0",
"@babel/plugin-syntax-decorators": "^7.0.0",
"@babel/plugin-syntax-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-async-to-generator": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/runtime": "^7.6.2",
"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"@babel/node": "^7.12.10",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-decorators": "^7.12.1",
"@babel/plugin-proposal-export-default-from": "^7.12.1",
"@babel/plugin-proposal-export-namespace-from": "^7.12.1",
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
"@babel/plugin-syntax-class-properties": "^7.12.1",
"@babel/plugin-syntax-decorators": "^7.12.1",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-async-to-generator": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "^7.12.7",
"@babel/register": "^7.12.10",
"@babel/runtime": "^7.12.5",
"@octokit/rest": "*",
"@parcel/babel-plugin-transform-runtime": "nightly",
"@parcel/babel-preset-env": "nightly",
Expand All @@ -89,9 +89,9 @@
"autoprefixer": "^9.6.0",
"axe-core": "^3.0.3",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.0.5",
"babel-plugin-istanbul": "^5.0.0",
"babel-plugin-macros": "^2.5.0",
"babel-loader": "^8.2.2",
"babel-plugin-istanbul": "^6.0.0",
"babel-plugin-macros": "^3.0.1",
"babel-plugin-react-remove-properties": "^0.3.0",
"babel-plugin-transform-glob-import": "^1.0.1",
"babelify": "^10.0.0",
Expand Down Expand Up @@ -161,8 +161,8 @@
"wsrun": "^5.0.0"
},
"resolutions": {
"@babel/core": "7.9.0",
"@babel/runtime": "7.9.0",
"@babel/core": "7.12.10",
"@babel/runtime": "7.12.5",
"postcss-calc": "6.0.2",
"jest-environment-jsdom": "26.3.0",
"jsdom": "16.3.0"
Expand Down
28 changes: 14 additions & 14 deletions packages/@adobe/react-spectrum/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/react-spectrum",
"version": "3.8.0",
"version": "3.9.0",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"main": "dist/main.js",
Expand All @@ -23,40 +23,40 @@
"@react-aria/ssr": "^3.0.1",
"@react-aria/visually-hidden": "^3.2.1",
"@react-spectrum/actiongroup": "^3.1.2",
"@react-spectrum/breadcrumbs": "^3.2.0",
"@react-spectrum/breadcrumbs": "^3.2.1",
"@react-spectrum/button": "^3.4.0",
"@react-spectrum/buttongroup": "^3.2.0",
"@react-spectrum/checkbox": "^3.2.2",
"@react-spectrum/dialog": "^3.3.0",
"@react-spectrum/dialog": "^3.3.1",
"@react-spectrum/divider": "^3.1.1",
"@react-spectrum/form": "^3.2.1",
"@react-spectrum/icon": "^3.3.0",
"@react-spectrum/illustratedmessage": "^3.1.1",
"@react-spectrum/image": "^3.1.1",
"@react-spectrum/layout": "^3.1.3",
"@react-spectrum/link": "^3.1.1",
"@react-spectrum/listbox": "^3.4.0",
"@react-spectrum/menu": "^3.2.1",
"@react-spectrum/listbox": "^3.4.1",
"@react-spectrum/menu": "^3.2.2",
"@react-spectrum/meter": "^3.1.1",
"@react-spectrum/overlays": "^3.4.0",
"@react-spectrum/picker": "^3.2.2",
"@react-spectrum/picker": "^3.2.3",
"@react-spectrum/progress": "^3.1.1",
"@react-spectrum/provider": "^3.1.2",
"@react-spectrum/provider": "^3.1.3",
"@react-spectrum/radio": "^3.1.2",
"@react-spectrum/searchfield": "^3.1.3",
"@react-spectrum/slider": "^3.0.1",
"@react-spectrum/slider": "^3.0.2",
"@react-spectrum/statuslight": "^3.2.0",
"@react-spectrum/switch": "^3.1.1",
"@react-spectrum/text": "^3.1.1",
"@react-spectrum/textfield": "^3.1.5",
"@react-spectrum/theme-dark": "^3.1.0",
"@react-spectrum/theme-default": "^3.1.0",
"@react-spectrum/theme-light": "^3.0.0",
"@react-spectrum/tooltip": "^3.1.1",
"@react-spectrum/theme-dark": "^3.2.0",
"@react-spectrum/theme-default": "^3.2.0",
"@react-spectrum/theme-light": "^3.1.0",
"@react-spectrum/tooltip": "^3.1.2",
"@react-spectrum/view": "^3.1.1",
"@react-spectrum/well": "^3.1.1",
"@react-stately/collections": "^3.3.0",
"@react-stately/data": "^3.2.0"
"@react-stately/collections": "^3.3.1",
"@react-stately/data": "^3.3.0"
},
"publishConfig": {
"access": "public"
Expand Down
25 changes: 15 additions & 10 deletions packages/@adobe/spectrum-css-temp/components/accordion/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ governing permissions and limitations under the License.
display: block;

position: absolute;
left: var(--spectrum-accordion-icon-spacing);
top: calc(var(--spectrum-accordion-item-height-actual) / 2 - var(--spectrum-accordion-icon-height) / 2);
inset-inline-start: var(--spectrum-accordion-icon-spacing);
inset-block-start: calc(var(--spectrum-accordion-item-height-actual) / 2 - var(--spectrum-accordion-icon-height) / 2);

transition: transform ease var(--spectrum-global-animation-duration-100);
}
Expand Down Expand Up @@ -66,7 +66,9 @@ governing permissions and limitations under the License.

box-sizing: border-box;
/* left padding takes into account the icon's size as well as the focus state's left border */
padding: var(--spectrum-accordion-item-title-padding-y) var(--spectrum-accordion-item-padding) var(--spectrum-accordion-item-title-padding-y) calc(calc(var(--spectrum-accordion-item-padding) * 2) + 2px);
padding-block: var(--spectrum-accordion-item-title-padding-y);
padding-inline-start: calc(calc(var(--spectrum-accordion-item-padding) * 2) + 2px);
padding-inline-end: var(--spectrum-accordion-item-padding);
margin: 0;

min-height: var(--spectrum-accordion-item-height-actual);
Expand Down Expand Up @@ -97,7 +99,7 @@ governing permissions and limitations under the License.
content: '';

position: absolute;
left: 0;
inset-inline-start: 0;
top: calc(var(--spectrum-accordion-item-border-size) * -1);
bottom: calc(var(--spectrum-accordion-item-border-size) * -1);

Expand All @@ -114,15 +116,18 @@ governing permissions and limitations under the License.
.spectrum-Accordion-item {
&.is-open {
> .spectrum-Accordion-itemHeading {
> .spectrum-Accordion-itemIndicator {
transform: rotate(90deg);
> .spectrum-Accordion-itemHeader {
> .spectrum-Accordion-itemIndicator {
[dir='ltr'] & {
transform: rotate(90deg);
}
[dir='rtl'] & {
transform: rotate(-90deg);
}
}
}
}

> .spectrum-Accordion-itemIndicator {
transform: rotate(90deg);
}

> .spectrum-Accordion-itemHeader::after {
/* No bottom border when open, so be less tall */
height: var(--spectrum-accordion-item-height-actual);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ governing permissions and limitations under the License.
padding: var(--spectrum-dropzone-padding);
border-style: dashed;

&.is-dragged {
border-style: solid;
}

&:focus {
outline: 0;
border-style: dashed;
&.focus-ring {
border-style: solid;
}
}

&.is-dragged {
border-style: solid;
}
}
Loading

0 comments on commit 5e501f8

Please sign in to comment.