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
10 changes: 9 additions & 1 deletion bin/imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ const devDependencies = new Set([
'@parcel/macros',
'@adobe/spectrum-tokens',
'playwright',
'axe-playwright'
'axe-playwright',
'vitest',
'@vitejs/plugin-react',
'@vitest/browser',
'@vitest/browser-playwright',
'@vitest/ui',
'unplugin-parcel-macros',
'vite',
'vite-plugin-svgr'
]);

module.exports = {
Expand Down
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ module.exports = {
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: [
'/node_modules/',
'\\.ssr\\.test\\.[tj]sx?$'
'\\.ssr\\.test\\.[tj]sx?$',
'\\.browser\\.test\\.[tj]sx?$'
],
testTimeout: 20000,

Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"start:mcp": "yarn workspace @react-spectrum/s2-docs generate:md && yarn build:mcp && node packages/dev/mcp/s2/dist/index.js && node packages/dev/mcp/react-aria/dist/index.js",
"test:mcp": "yarn build:s2-docs && yarn build:mcp && node packages/dev/mcp/scripts/smoke-list-pages.mjs",
"test": "cross-env STRICT_MODE=1 VIRT_ON=1 yarn jest",
"test:browser": " yarn playwright install && vitest --config=vitest.browser.config.ts",
"test:lint": "node packages/**/*.test-lint.js",
"test-loose": "cross-env VIRT_ON=1 yarn jest",
"test-storybook": "test-storybook --url http://localhost:9003 --browsers chromium --no-cache",
Expand Down Expand Up @@ -134,6 +135,9 @@
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@typescript/native-preview": "^7.0.0-dev.20251223.1",
"@vitejs/plugin-react": "^5.1.4",
"@vitest/browser-playwright": "^4.0.17",
"@vitest/browser-preview": "^4.0.17",
"@vueless/storybook-dark-mode": "^9.0.6",
"@yarnpkg/types": "^4.0.0",
"autoprefixer": "^9.6.0",
Expand Down Expand Up @@ -202,7 +206,11 @@
"tempy": "^0.5.0",
"typescript": "^5.8.2",
"typescript-eslint": "^8.38.0",
"unplugin-parcel-macros": "^0.1.1",
"verdaccio": "^6.0.0",
"vite-plugin-svgr": "^4.5.0",
"vitest": "^4.0.17",
"vitest-browser-react": "^2.0.2",
"walk-object": "^4.0.0",
"xml": "^1.0.1"
},
Expand Down
11 changes: 10 additions & 1 deletion packages/@react-spectrum/s2/chromatic/TreeView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,23 @@ export const TreeStatic: StoryObj<typeof TreeExample> = {
render: (args) => <TreeExample {...args} />
};

export const TreeSelection: StoryObj<typeof TreeExample> = {
export const TreeCheckboxSelection: StoryObj<typeof TreeExample> = {
...TreeStatic,
args: {
selectionMode: 'multiple',
defaultSelectedKeys: ['projects-2', 'projects-3']
}
};

export const TreeHighlightSelection: StoryObj<typeof TreeExample> = {
...TreeStatic,
args: {
selectionMode: 'multiple',
selectionStyle: 'highlight',
defaultSelectedKeys: ['projects-2', 'projects-3']
}
};

export const TreeDisableSelection: StoryObj<typeof TreeExample> = {
...TreeStatic,
args: {
Expand Down
3 changes: 1 addition & 2 deletions packages/@react-spectrum/s2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@
"@storybook/jest": "^0.2.3",
"@testing-library/dom": "^10.1.0",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.0.0",
"jest": "^29.5.0"
"@testing-library/user-event": "^14.0.0"
},
"dependencies": {
"@internationalized/date": "^3.12.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/@react-spectrum/s2/src/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -716,15 +716,15 @@ function isNextSelected(id: Key | undefined, state: ListState<unknown>) {
let keyAfter = state.collection.getKeyAfter(id);
return keyAfter != null && state.selectionManager.isSelected(keyAfter);
}
function isPrevSelected(id: Key | undefined, state: ListState<unknown>) {
export function isPrevSelected(id: Key | undefined, state: ListState<unknown>) {
if (id == null || !state) {
return false;
}
let keyBefore = state.collection.getKeyBefore(id);
return keyBefore != null && state.selectionManager.isSelected(keyBefore);
}

function isFirstItem(id: Key | undefined, state: ListState<unknown>) {
export function isFirstItem(id: Key | undefined, state: ListState<unknown>) {
if (id == null || !state) {
return false;
}
Expand Down
Loading
Loading