Skip to content

Commit

Permalink
Merge branch 'main' into csp-focus-guards
Browse files Browse the repository at this point in the history
  • Loading branch information
chaance authored Sep 27, 2024
2 parents c1e9c98 + 53287e0 commit b80ce43
Show file tree
Hide file tree
Showing 239 changed files with 7,066 additions and 7,874 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Add the following users as reviewers on new pull requests

* @benoitgrelard @andy-hook @vladmoroz @lucasmotta
* @StephenHaney @vladmoroz @lucasmotta @hadihallak @chaance
14 changes: 7 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,40 +55,40 @@ cd primitives
git remote add upstream https://github.com/radix-ui/primitives.git
```

1. Synchronize your local `main` branch with the upstream remote:
3. Synchronize your local `main` branch with the upstream remote:

```sh
git checkout main
git pull upstream main
```

1. Make sure your Node version matches the [.nvmrc](../.nvmrc).
4. Make sure your Node version matches the [.nvmrc](../.nvmrc).

```
node -v
```

1. Install dependencies with [yarn](https://yarnpkg.com):
5. Install dependencies with [yarn](https://yarnpkg.com):

```sh
yarn install
```

1. Create a new branch related to your PR:
6. Create a new branch related to your PR:

```sh
git checkout -b my-bug-fix
```

6. Make changes, then commit and push to your forked repository:
7. Make changes, then commit and push to your forked repository:

```sh
git push -u origin HEAD
```

7. Go to [the repository](https://github.com/radix-ui/primitives) and [make a Pull Request](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).
8. Go to [the repository](https://github.com/radix-ui/primitives) and [make a Pull Request](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).

8. We will review your Pull Request and either merge it, request changes to it, or close it with an explanation.
9. We will review your Pull Request and either merge it, request changes to it, or close it with an explanation.

## Working locally

Expand Down
10 changes: 10 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ const config: StorybookConfig = {
strictMode: true,
},
},
swc: () => ({
jsc: {
transform: {
react: {
// Do not require importing React into scope to use JSX
runtime: 'automatic',
},
},
},
}),

// we need to add aliases to webpack so it knows how to follow
// to the source of the packages rather than the built version (dist)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
releases:
"@radix-ui/react-slider": minor
"@radix-ui/react-avatar": patch

declined:
- primitives
13 changes: 0 additions & 13 deletions .yarn/versions/2ab74363.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .yarn/versions/efa9f1f5.yml → .yarn/versions/41451f5a.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ releases:
"@radix-ui/react-alert-dialog": patch
"@radix-ui/react-context-menu": patch
"@radix-ui/react-dialog": patch
"@radix-ui/react-dismissable-layer": patch
"@radix-ui/react-dropdown-menu": patch
"@radix-ui/react-hover-card": patch
"@radix-ui/react-menu": patch
"@radix-ui/react-menubar": patch
"@radix-ui/react-navigation-menu": patch
"@radix-ui/react-popover": patch
"@radix-ui/react-portal": patch
"@radix-ui/react-select": patch
"@radix-ui/react-toast": patch
"@radix-ui/react-tooltip": patch
Expand Down
13 changes: 0 additions & 13 deletions .yarn/versions/5793010b.yml

This file was deleted.

10 changes: 7 additions & 3 deletions .yarn/versions/75dcd823.yml → .yarn/versions/8a3bd6ee.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
releases:
"@radix-ui/react-accordion": patch
"@radix-ui/react-alert-dialog": patch
"@radix-ui/react-checkbox": patch
"@radix-ui/react-collapsible": patch
"@radix-ui/react-context-menu": patch
"@radix-ui/react-dialog": patch
"@radix-ui/react-dismissable-layer": patch
"@radix-ui/react-dropdown-menu": patch
"@radix-ui/react-hover-card": patch
"@radix-ui/react-menu": patch
"@radix-ui/react-menubar": patch
"@radix-ui/react-navigation-menu": patch
"@radix-ui/react-popover": patch
"@radix-ui/react-select": patch
"@radix-ui/react-presence": patch
"@radix-ui/react-radio-group": patch
"@radix-ui/react-scroll-area": patch
"@radix-ui/react-tabs": patch
"@radix-ui/react-toast": patch
"@radix-ui/react-tooltip": patch
"@radix-ui/react-use-escape-keydown": patch

declined:
- primitives
File renamed without changes.
5 changes: 5 additions & 0 deletions .yarn/versions/a0df87d9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
releases:
"@radix-ui/react-checkbox": patch

declined:
- primitives
6 changes: 6 additions & 0 deletions .yarn/versions/a54ad5a9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
releases:
"@radix-ui/react-scroll-area": minor

declined:
- primitives
- ssr-testing
33 changes: 33 additions & 0 deletions .yarn/versions/c80771b8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
releases:
"@radix-ui/react-context": patch

declined:
- primitives
- "@radix-ui/react-accordion"
- "@radix-ui/react-alert-dialog"
- "@radix-ui/react-avatar"
- "@radix-ui/react-checkbox"
- "@radix-ui/react-collapsible"
- "@radix-ui/react-collection"
- "@radix-ui/react-context-menu"
- "@radix-ui/react-dialog"
- "@radix-ui/react-dropdown-menu"
- "@radix-ui/react-form"
- "@radix-ui/react-hover-card"
- "@radix-ui/react-menu"
- "@radix-ui/react-menubar"
- "@radix-ui/react-navigation-menu"
- "@radix-ui/react-popover"
- "@radix-ui/react-popper"
- "@radix-ui/react-progress"
- "@radix-ui/react-radio-group"
- "@radix-ui/react-roving-focus"
- "@radix-ui/react-scroll-area"
- "@radix-ui/react-select"
- "@radix-ui/react-slider"
- "@radix-ui/react-switch"
- "@radix-ui/react-tabs"
- "@radix-ui/react-toast"
- "@radix-ui/react-toggle-group"
- "@radix-ui/react-toolbar"
- "@radix-ui/react-tooltip"
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
releases:
"@radix-ui/react-scroll-area": patch
"@radix-ui/react-select": patch

declined:
Expand Down
5 changes: 5 additions & 0 deletions .yarn/versions/cccc0adb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
releases:
"@radix-ui/react-select": patch

declined:
- primitives
13 changes: 0 additions & 13 deletions .yarn/versions/dc4b1017.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .yarn/versions/ded3a040.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .yarn/versions/e97b6ff3.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .yarn/versions/eb020608.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .yarn/versions/f24f9512.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
"@radix-ui/react-select": patch
13 changes: 0 additions & 13 deletions .yarn/versions/f4333956.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .yarn/versions/fad3e42d.yml

This file was deleted.

42 changes: 0 additions & 42 deletions babel.config.js

This file was deleted.

48 changes: 48 additions & 0 deletions build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { globSync } from 'glob';
import * as esbuild from 'esbuild';
import * as tsup from 'tsup';

async function build(path) {
const file = `${path}/src/index.ts`;
const dist = `${path}/dist`;

const esbuildConfig = {
entryPoints: [file],
external: ['@radix-ui/*'],
packages: 'external',
bundle: true,
sourcemap: true,
format: 'cjs',
target: 'es2022',
outdir: dist,
};

await esbuild.build(esbuildConfig);
console.log(`Built ${path}/dist/index.js`);

await esbuild.build({
...esbuildConfig,
format: 'esm',
outExtension: { '.js': '.mjs' },
});
console.log(`Built ${path}/dist/index.mjs`);

// tsup is used to emit d.ts files only (esbuild can't do that).
//
// Notes:
// 1. Emitting d.ts files is super slow for whatever reason.
// 2. It could have fully replaced esbuild (as it uses that internally),
// but at the moment its esbuild version is somewhat outdated.
// It’s also harder to configure and esbuild docs are more thorough.
await tsup.build({
entry: [file],
format: ['cjs', 'esm'],
dts: { only: true },
outDir: dist,
silent: true,
external: [/@radix-ui\/.+/],
});
console.log(`Built ${path}/dist/index.d.ts`);
}

globSync('packages/*/*').forEach(build);
1 change: 1 addition & 0 deletions cypress/integration/Form.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('Form', () => {
});

function checkControlMessageAssociation() {
cy.get('@control').should('have.attr', 'aria-describedby');
cy.get('@control')
.invoke('attr', 'aria-describedby')
.then((ariaDescribedby) =>
Expand Down
Loading

0 comments on commit b80ce43

Please sign in to comment.