Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { any } from "prop-types";
import { useState } from "react";
import React, { useState } from "react";
import {
Group,
Label,
Expand Down Expand Up @@ -31,9 +30,9 @@ export function StarRatingGroup({
let [hoveredRating, setHoveredRating] =
useState<string | undefined>(undefined);

let onPointerOver = (e: any) => {
if (e.target.dataset?.rating) {
setHoveredRating(e.target.dataset.rating);
let onPointerOver = (e: React.PointerEvent<HTMLDivElement>) => {
if ((e.target as HTMLElement).dataset?.rating) {
setHoveredRating((e.target as HTMLElement).dataset.rating);
}
};

Expand Down
16 changes: 2 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,13 @@
"packages/*/*"
],
"devDependencies": {
"@actions/core": "^1.1.0",
"@actions/core": "^1.10.0",
"@actions/github": "^1.1.0",
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.3",
"@babel/eslint-parser": "^7.27.1",
"@babel/node": "^7.23.9",
"@babel/plugin-proposal-decorators": "^7.24.1",
"@babel/plugin-syntax-decorators": "7.24.1",
"@babel/plugin-syntax-import-assertions": "^7.24.1",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.3",
"@babel/preset-react": "^7.24.1",
Expand Down Expand Up @@ -110,8 +108,6 @@
"@spectrum-css/component-builder": "workspace:^",
"@spectrum-css/vars": "^2.3.0",
"@storybook/addon-a11y": "patch:@storybook/addon-a11y@npm%3A8.6.14#~/.yarn/patches/@storybook-addon-a11y-npm-8.6.14-2119c57a0f.patch",
"@storybook/addon-actions": "^8.6.14",
"@storybook/addon-controls": "^8.6.14",
"@storybook/addon-essentials": "^8.6.14",
"@storybook/addon-interactions": "^8.6.14",
"@storybook/addon-jest": "^8.6.14",
Expand All @@ -136,7 +132,6 @@
"@types/react-dom": "^19.0.0",
"@yarnpkg/types": "^4.0.0",
"autoprefixer": "^9.6.0",
"axe-core": "^4.6.3",
"axe-playwright": "^1.1.11",
"babel-plugin-macros": "^3.0.1",
"babel-plugin-react-remove-properties": "^0.3.0",
Expand All @@ -146,9 +141,8 @@
"clsx": "^2.0.0",
"color-space": "^1.16.0",
"concurrently": "^6.0.2",
"core-js": "^3.0.0",
"cross-env": "^7.0.2",
"cross-spawn": "^7.0.3",
"cross-spawn": "^7.0.5",
"delta-e": "^0.0.8",
"diff": "^5.1.0",
"eslint": "^9.12.0",
Expand All @@ -161,7 +155,6 @@
"eslint-plugin-rulesdir": "^0.2.2",
"fast-check": "^2.19.0",
"fast-glob": "^3.1.0",
"fs-extra": "^11.0.0",
"glob": "^11.0.3",
"globals": "^15.11.0",
"identity-obj-proxy": "^3.0.0",
Expand All @@ -172,7 +165,6 @@
"jest-junit": "^15.0.0",
"jest-matchmedia-mock": "^1.1.0",
"lerna": "^3.13.2",
"lfcdn": "^0.4.2",
"lucide-react": "^0.517.0",
"md5": "^2.2.1",
"motion": "^12.23.6",
Expand All @@ -184,9 +176,6 @@
"postcss": "^8.4.24",
"postcss-custom-properties": "^13.2.0",
"postcss-import": "^15.1.0",
"prettier": "^3.6.2",
"prop-types": "^15.6.0",
"raf": "^3.4.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-frame-component": "^5.0.0",
Expand All @@ -207,7 +196,6 @@
"typescript-eslint": "^8.38.0",
"verdaccio": "^6.0.0",
"walk-object": "^4.0.0",
"wsrun": "^5.0.0",
"xml": "^1.0.1"
},
"resolutions": {
Expand Down
6 changes: 3 additions & 3 deletions packages/@spectrum-icons/build-tools/generateIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
* governing permissions and limitations under the License.
*/

import fs from 'fs-extra';
import fs from 'fs';
import path from 'path';

function writeToFile(filepath, data) {
let buffer = Buffer.from(data);
fs.writeFile(filepath, buffer);
fs.writeFileSync(filepath, buffer);
}

/**
Expand All @@ -26,7 +26,7 @@ function writeToFile(filepath, data) {
* @param template Template for output file, should take a name from the regex.
*/
export function generateIcons(iconDir, outputDir, nameRegex, template) {
fs.ensureDirSync(outputDir);
fs.mkdirSync(outputDir, {recursive: true});
fs.readdir(iconDir, (err, items) => {
let ignoreList = ['index.js', 'util.js'];
// get all icon files
Expand Down
2 changes: 1 addition & 1 deletion packages/@spectrum-icons/build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"private": true,
"dependencies": {
"@svgr/core": "^8.1.0",
"fs-extra": "^11.0.0"
"prettier": "^3.6.2"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 1 addition & 2 deletions packages/@spectrum-icons/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"@swc/helpers": "^0.5.0"
},
"devDependencies": {
"@spectrum-icons/build-tools": "3.0.0-alpha.1",
"fs-extra": "^11.0.0"
"@spectrum-icons/build-tools": "3.0.0-alpha.1"
},
"peerDependencies": {
"@react-spectrum/provider": "^3.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/dev/codemods/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"@react-types/shared": "^3.32.1",
"@types/node": "^22",
"boxen": "^5.1.2",
"build": "^0.1.4",
"chalk": "^4.0.0",
"execa": "^5.1.1",
"jscodeshift": "^0.15.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@spectrum-icons/workflow": "^4.0.0",
"algoliasearch": "^4.14.1",
"clsx": "^2.0.0",
"dompurify": "^2.3.10",
"dompurify": "^3.2.4",
"globals-docs": "^2.4.1",
"highlight.js": "9.18.1",
"markdown-to-jsx": "^6.11.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/dev/parcel-transformer-mdx-docs/MDXTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,7 @@ export default {};
'globals-docs': false,
lowlight: false,
scheduler: false,
'markdown-to-jsx': false,
'prop-types': false
'markdown-to-jsx': false
},
shouldScopeHoist: false,
shouldOptimize: false
Expand Down
3 changes: 2 additions & 1 deletion packages/dev/parcel-transformer-s2-icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"@parcel/plugin": "^2.0.0",
"@svgr/core": "^8.1.0",
"@svgr/plugin-jsx": "^8.1.0",
"@svgr/plugin-svgo": "^8.1.0"
"@svgr/plugin-svgo": "^8.1.0",
"prettier": "^3.6.2"
},
"rsp": {
"type": "cli"
Expand Down
38 changes: 19 additions & 19 deletions scripts/buildBranchAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

const tempy = require('tempy');
const fs = require('fs-extra');
const fs = require('fs');
const packageJSON = require('../package.json');
const path = require('path');
const glob = require('fast-glob');
Expand Down Expand Up @@ -58,7 +58,7 @@ async function build() {
let srcDir = archiveDir ?? path.join(__dirname, '..');
let distDir = path.join(__dirname, '..', 'dist', args.values.output ?? 'branch-api');
// if we already have a directory with a built dist, remove it so we can write cleanly into it at the end
fs.removeSync(distDir);
fs.rmSync(distDir, {recursive: true, force: true});
// Create a temp directory to build the site in
let dir = tempy.directory();
console.log(`Building branch api into ${dir}...`);
Expand Down Expand Up @@ -118,29 +118,29 @@ async function build() {
}`);

// Copy necessary code and configuration over
fs.copySync(path.join(srcDir, 'packages', '@adobe', 'spectrum-css-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-temp'));
fs.cpSync(path.join(srcDir, 'packages', '@adobe', 'spectrum-css-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-temp'), {recursive: true});
try {
fs.copySync(path.join(srcDir, 'packages', '@adobe', 'spectrum-css-builder-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-builder-temp'));
fs.cpSync(path.join(srcDir, 'packages', '@adobe', 'spectrum-css-builder-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-builder-temp'), {recursive: true});
} catch (e) {
fs.copySync(path.join(backupDir, 'packages', '@adobe', 'spectrum-css-builder-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-builder-temp'));
fs.cpSync(path.join(backupDir, 'packages', '@adobe', 'spectrum-css-builder-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-builder-temp'), {recursive: true});
}
fs.copySync(path.join(srcDir, 'postcss.config.js'), path.join(dir, 'postcss.config.js'));
fs.copySync(path.join(srcDir, 'lib'), path.join(dir, 'lib'));
fs.copySync(path.join(srcDir, 'CONTRIBUTING.md'), path.join(dir, 'CONTRIBUTING.md'));
fs.cpSync(path.join(srcDir, 'postcss.config.js'), path.join(dir, 'postcss.config.js'));
fs.cpSync(path.join(srcDir, 'lib'), path.join(dir, 'lib'), {recursive: true});
fs.cpSync(path.join(srcDir, 'CONTRIBUTING.md'), path.join(dir, 'CONTRIBUTING.md'));
// need dev from latest on branch since it will generate the API for diffing, and in older commits it may not be able to do this or
// does it in a different format
fs.copySync(path.join(__dirname, '..', 'packages', 'dev'), path.join(dir, 'packages', 'dev'));
fs.copySync(path.join(__dirname, '..', '.parcelrc'), path.join(dir, '.parcelrc'));
fs.cpSync(path.join(__dirname, '..', 'packages', 'dev'), path.join(dir, 'packages', 'dev'), {recursive: true});
fs.cpSync(path.join(__dirname, '..', '.parcelrc'), path.join(dir, '.parcelrc'));
// Delete test-utils from copied packages since we don't expose anything from there
fs.removeSync(path.join(dir, 'packages', 'dev', 'test-utils'));
fs.rmSync(path.join(dir, 'packages', 'dev', 'test-utils'), {recursive: true, force: true});

fs.copySync(path.join(__dirname, '..', '.yarn'), path.join(dir, '.yarn'));
fs.copySync(path.join(__dirname, '..', '.yarnrc.yml'), path.join(dir, '.yarnrc.yml'));
fs.cpSync(path.join(__dirname, '..', '.yarn'), path.join(dir, '.yarn'), {recursive: true});
fs.cpSync(path.join(__dirname, '..', '.yarnrc.yml'), path.join(dir, '.yarnrc.yml'));

// Only copy babel patch over
let patches = fs.readdirSync(path.join(srcDir, 'patches'));
let babelPatch = patches.find(name => name.startsWith('@babel'));
fs.copySync(path.join(srcDir, 'patches', babelPatch), path.join(dir, 'patches', babelPatch));
fs.cpSync(path.join(srcDir, 'patches', babelPatch), path.join(dir, 'patches', babelPatch), {recursive: true});

let excludeList = ['@react-spectrum/story-utils'];
// Copy packages over to temp dir
Expand All @@ -153,7 +153,7 @@ async function build() {
continue;
}

fs.copySync(path.join(srcDir, 'packages', path.dirname(p)), path.join(dir, 'packages', path.dirname(p)), {dereference: true});
fs.cpSync(path.join(srcDir, 'packages', path.dirname(p)), path.join(dir, 'packages', path.dirname(p)), {dereference: true, recursive: true});

if (!p.includes('@react-types')) {
delete json.types;
Expand All @@ -169,18 +169,18 @@ async function build() {
}
}
// Install dependencies from npm
fs.copySync(path.join(srcDir, 'yarn.lock'), path.join(dir, 'yarn.lock'));
fs.cpSync(path.join(srcDir, 'yarn.lock'), path.join(dir, 'yarn.lock'));
await run('yarn', ['--no-immutable'], {cwd: dir, stdio: 'inherit'});

// Build the website
console.log('building api files');
await run('yarn', ['parcel', 'build', 'packages/react-aria-components', 'packages/@react-{spectrum,aria,stately}/*/', 'packages/@internationalized/{message,string,date,number}', '--target', 'apiCheck'], {cwd: dir, stdio: 'inherit'});

// Copy the build back into dist, and delete the temp dir.
fs.copySync(path.join(dir, 'packages'), distDir, {dereference: true});
fs.removeSync(dir);
fs.cpSync(path.join(dir, 'packages'), distDir, {dereference: true, recursive: true});
fs.rmSync(dir, {recursive: true, force: true});
if (archiveDir) {
fs.removeSync(archiveDir);
fs.rmSync(archiveDir, {recursive: true, force: true});
}
}

Expand Down
50 changes: 26 additions & 24 deletions scripts/buildPublishedAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
*/

const tempy = require('tempy');
const fs = require('fs-extra');
const fs = require('fs');
const {readFile} = require('node:fs/promises');
const packageJSON = require('../package.json');
const path = require('path');
const glob = require('fast-glob');
Expand Down Expand Up @@ -45,7 +46,7 @@ build().catch(err => {
async function build() {
let distDir = args.values.output ?? path.join(__dirname, '..', 'dist', args.values.output ?? 'base-api');
// if we already have a directory with a built dist, remove it so we can write cleanly into it at the end
fs.removeSync(distDir);
fs.rmSync(distDir, {recursive: true, force: true});
// Create a temp directory to build the site in
let dir = tempy.directory();
console.log(`Building published api into ${dir}...`);
Expand Down Expand Up @@ -131,7 +132,7 @@ async function build() {
let promises = [];
for (let p of packages) {
let promise = new Promise((resolve, reject) => {
fs.readFile(path.join(packagesDir, p), 'utf8').then(async (contents) => {
readFile(path.join(packagesDir, p), 'utf8').then(async (contents) => {
let json = JSON.parse(contents);
if (!json.private && json.name !== '@adobe/react-spectrum') {
try {
Expand Down Expand Up @@ -159,10 +160,10 @@ async function build() {
cleanPkg.devDependencies['babel-plugin-transform-glob-import'] = '*';

fs.writeFileSync(path.join(dir, 'package.json'), JSON.stringify(pkg, false, 2));
fs.copySync(path.join(__dirname, '..', '.yarn'), path.join(dir, '.yarn'));
fs.copySync(path.join(__dirname, '..', '.yarnrc.yml'), path.join(dir, '.yarnrc.yml'));
fs.copySync(path.join(__dirname, '..', 'yarn.lock'), path.join(dir, 'yarn.lock'));
fs.copySync(path.join(__dirname, '..', 'packages', '@adobe', 'spectrum-css-builder-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-builder-temp'));
fs.cpSync(path.join(__dirname, '..', '.yarn'), path.join(dir, '.yarn'), {recursive: true});
fs.cpSync(path.join(__dirname, '..', '.yarnrc.yml'), path.join(dir, '.yarnrc.yml'));
fs.cpSync(path.join(__dirname, '..', 'yarn.lock'), path.join(dir, 'yarn.lock'));
fs.cpSync(path.join(__dirname, '..', 'packages', '@adobe', 'spectrum-css-builder-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-builder-temp'), {recursive: true});

// Install dependencies from npm
console.log('install our latest packages from npm');
Expand All @@ -175,20 +176,20 @@ async function build() {
}`);

// Copy necessary code and configuration over
fs.copySync(path.join(__dirname, '..', 'yarn.lock'), path.join(dir, 'yarn.lock'));
fs.copySync(path.join(__dirname, '..', 'packages', 'dev'), path.join(dir, 'packages', 'dev'));
fs.removeSync(path.join(dir, 'packages', 'dev', 'docs'));
fs.copySync(path.join(__dirname, '..', 'packages', '@adobe', 'spectrum-css-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-temp'));
fs.copySync(path.join(__dirname, '..', '.parcelrc'), path.join(dir, '.parcelrc'));
fs.copySync(path.join(__dirname, '..', 'postcss.config.js'), path.join(dir, 'postcss.config.js'));
fs.copySync(path.join(__dirname, '..', 'lib'), path.join(dir, 'lib'));
fs.copySync(path.join(__dirname, '..', '.yarn', 'plugins'), path.join(dir, '.yarn', 'plugins'));
fs.copySync(path.join(__dirname, '..', 'CONTRIBUTING.md'), path.join(dir, 'CONTRIBUTING.md'));
fs.cpSync(path.join(__dirname, '..', 'yarn.lock'), path.join(dir, 'yarn.lock'));
fs.cpSync(path.join(__dirname, '..', 'packages', 'dev'), path.join(dir, 'packages', 'dev'), {recursive: true});
fs.rmSync(path.join(dir, 'packages', 'dev', 'docs'), {recursive: true, force: true});
fs.cpSync(path.join(__dirname, '..', 'packages', '@adobe', 'spectrum-css-temp'), path.join(dir, 'packages', '@adobe', 'spectrum-css-temp'), {recursive: true});
fs.cpSync(path.join(__dirname, '..', '.parcelrc'), path.join(dir, '.parcelrc'));
fs.cpSync(path.join(__dirname, '..', 'postcss.config.js'), path.join(dir, 'postcss.config.js'));
fs.cpSync(path.join(__dirname, '..', 'lib'), path.join(dir, 'lib'), {recursive: true});
fs.cpSync(path.join(__dirname, '..', '.yarn', 'plugins'), path.join(dir, '.yarn', 'plugins'), {recursive: true});
fs.cpSync(path.join(__dirname, '..', 'CONTRIBUTING.md'), path.join(dir, 'CONTRIBUTING.md'));

// Only copy babel patch over
let patches = fs.readdirSync(path.join(__dirname, '..', 'patches'));
let babelPatch = patches.find(name => name.startsWith('@babel'));
fs.copySync(path.join(__dirname, '..', 'patches', babelPatch), path.join(dir, 'patches', babelPatch));
fs.cpSync(path.join(__dirname, '..', 'patches', babelPatch), path.join(dir, 'patches', babelPatch), {recursive: true});

// Copy package.json for each package into docs dir so we can find the correct version numbers
console.log('moving over from node_modules');
Expand All @@ -197,8 +198,9 @@ async function build() {
continue;
}
if (!p.includes('spectrum-css') && !p.includes('example-theme') && fs.existsSync(path.join(dir, 'node_modules', p))) {
fs.moveSync(path.join(dir, 'node_modules', path.dirname(p)), path.join(dir, 'packages', path.dirname(p)));
fs.removeSync(path.join(dir, 'packages', path.dirname(p), 'dist'));
fs.cpSync(path.join(dir, 'node_modules', path.dirname(p)), path.join(dir, 'packages', path.dirname(p)), {recursive: true});
fs.rmSync(path.join(dir, 'node_modules', path.dirname(p)), {recursive: true, force: true});
fs.rmSync(path.join(dir, 'packages', path.dirname(p), 'dist'), {recursive: true, force: true});
let json = JSON.parse(fs.readFileSync(path.join(dir, 'packages', p)), 'utf8');
if (!p.includes('@react-types')) {
delete json.types;
Expand All @@ -216,7 +218,7 @@ async function build() {

// link all our packages
fs.writeFileSync(path.join(dir, 'package.json'), JSON.stringify(cleanPkg, false, 2));
fs.removeSync(path.join(dir, 'packages', 'dev', 'docs', 'node_modules'));
fs.rmSync(path.join(dir, 'packages', 'dev', 'docs', 'node_modules'), {recursive: true, force: true});
console.log('linking packages');
await run('yarn', ['constraints', '--fix'], {cwd: dir, stdio: 'inherit'});
await run('yarn', ['--no-immutable'], {cwd: dir, stdio: 'inherit'});
Expand All @@ -228,10 +230,10 @@ async function build() {
// Copy the build back into dist, and delete the temp dir.
// dev/docs/node_modules has some react spectrum components, we don't want those, and i couldn't figure out how to not build them
// it probably means two different versions, so there may be a bug lurking here
fs.removeSync(path.join(dir, 'packages', 'dev'));
fs.removeSync(path.join(dir, 'packages', '@react-spectrum', 'button', 'node_modules'));
fs.copySync(path.join(dir, 'packages'), distDir);
fs.removeSync(dir);
fs.rmSync(path.join(dir, 'packages', 'dev'), {recursive: true, force: true});
fs.rmSync(path.join(dir, 'packages', '@react-spectrum', 'button', 'node_modules'), {recursive: true, force: true});
fs.cpSync(path.join(dir, 'packages'), distDir, {recursive: true});
fs.rmSync(dir, {recursive: true, force: true});
}

function run(cmd, args, opts) {
Expand Down
Loading
Loading