Skip to content

Commit a99c2c4

Browse files
committed
Merge branch 'main' into upgrade-sb-9
2 parents e1754b5 + b45f39a commit a99c2c4

File tree

39 files changed

+150
-58
lines changed

39 files changed

+150
-58
lines changed

.github/labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
needs translations:
2+
- changed-files:
3+
- any-glob-to-any-file: ['**/intl/*.json']

.github/workflows/labeler.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
labeler:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/labeler@v5
13+
with:
14+
sync-labels: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@
152152
"eslint-plugin-rulesdir": "^0.2.2",
153153
"fast-check": "^2.19.0",
154154
"fast-glob": "^3.1.0",
155-
"framer-motion": "^11.3.0-alpha.0",
156155
"fs-extra": "^11.0.0",
157156
"glob": "^8.0.3",
158157
"glob-promise": "^6.0.5",
@@ -168,6 +167,7 @@
168167
"lfcdn": "^0.4.2",
169168
"lucide-react": "^0.294.0",
170169
"md5": "^2.2.1",
170+
"motion": "^12.23.6",
171171
"npm-cli-login": "^1.0.0",
172172
"nyc": "^10.2.0",
173173
"p-queue": "^6.2.1",

packages/@react-aria/i18n/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export {useDateFormatter} from './useDateFormatter';
1818
export {useNumberFormatter} from './useNumberFormatter';
1919
export {useCollator} from './useCollator';
2020
export {useFilter} from './useFilter';
21+
export {isRTL} from './utils';
2122

2223
export type {FormatMessage} from './useMessageFormatter';
2324
export type {LocalizedStringFormatter} from '@internationalized/string';

packages/@react-aria/tabs/src/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export function generateId<T>(state: TabListState<T> | null, key: Key | null | u
2525
}
2626

2727
let baseId = tabsIds.get(state);
28+
if (process.env.NODE_ENV !== 'production' && !baseId) {
29+
console.error('There is no tab id, please check if you have rendered the tab panel before the tab list.');
30+
}
2831
return `${baseId}-${role}-${key}`;
2932
}
3033

packages/@react-aria/virtualizer/src/ScrollView.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ React.forwardRef(ScrollView);
5757
export {ScrollViewForwardRef as ScrollView};
5858

5959
interface ScrollViewAria {
60+
isScrolling: boolean,
6061
scrollViewProps: HTMLAttributes<HTMLElement>,
6162
contentProps: HTMLAttributes<HTMLElement>
6263
}
@@ -84,6 +85,16 @@ export function useScrollView(props: ScrollViewProps, ref: RefObject<HTMLElement
8485
let {direction} = useLocale();
8586

8687
let [isScrolling, setScrolling] = useState(false);
88+
89+
let onScrollTimeout = useCallback(() => {
90+
state.isScrolling = false;
91+
setScrolling(false);
92+
state.scrollTimeout = null;
93+
94+
window.dispatchEvent(new Event('tk.connect-observer'));
95+
onScrollEnd?.();
96+
}, [state, onScrollEnd]);
97+
8798
let onScroll = useCallback((e) => {
8899
if (e.target !== e.currentTarget) {
89100
return;
@@ -117,30 +128,21 @@ export function useScrollView(props: ScrollViewProps, ref: RefObject<HTMLElement
117128
// keep track of the current timeout time and only reschedule
118129
// the timer when it is getting close.
119130
let now = Date.now();
120-
if (state.scrollEndTime <= now + 50) {
131+
if (!('onscrollend' in window) && state.scrollEndTime <= now + 50) {
121132
state.scrollEndTime = now + 300;
122133

123134
if (state.scrollTimeout != null) {
124135
clearTimeout(state.scrollTimeout);
125136
}
126137

127-
state.scrollTimeout = setTimeout(() => {
128-
state.isScrolling = false;
129-
setScrolling(false);
130-
state.scrollTimeout = null;
131-
132-
window.dispatchEvent(new Event('tk.connect-observer'));
133-
if (onScrollEnd) {
134-
onScrollEnd();
135-
}
136-
}, 300);
138+
state.scrollTimeout = setTimeout(onScrollTimeout, 300);
137139
}
138140
});
139-
}, [props, direction, state, contentSize, onVisibleRectChange, onScrollStart, onScrollEnd]);
141+
}, [props, direction, state, contentSize, onVisibleRectChange, onScrollStart, onScrollTimeout]);
140142

141143
// Attach event directly to ref so RAC Virtualizer doesn't need to send props upward.
142144
useEvent(ref, 'scroll', onScroll);
143-
145+
useEvent(ref, 'scrollend', onScrollTimeout);
144146

145147
useEffect(() => {
146148
return () => {
@@ -265,6 +267,7 @@ export function useScrollView(props: ScrollViewProps, ref: RefObject<HTMLElement
265267
};
266268

267269
return {
270+
isScrolling,
268271
scrollViewProps: {
269272
...otherProps,
270273
style

packages/@react-spectrum/combobox/docs/ComboBox.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ behaviors in your test suite.
994994
Please also refer to [React Spectrum's test suite](https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/combobox/test/ComboBox.test.js) if you find that the above
995995
isn't sufficient when resolving issues in your own test cases.
996996

997-
### Test utils <VersionBadge version="alpha" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
997+
### Test utils <VersionBadge version="beta" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
998998

999999
`@react-spectrum/test-utils` offers common combobox interaction utilities which you may find helpful when writing tests. See [here](../react-aria/testing.html#react-aria-test-utils) for more information on how to setup these utilities
10001000
in your tests. Below is the full definition of the combobox tester and a sample of how you could use it in your test suite.

packages/@react-spectrum/list/docs/ListView.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ behaviors in your test suite.
11931193
Please also refer to [React Spectrum's test suite](https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/list/test/ListView.test.js) if you find that the above
11941194
isn't sufficient when resolving issues in your own test cases.
11951195

1196-
### Test utils <VersionBadge version="alpha" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
1196+
### Test utils <VersionBadge version="beta" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
11971197

11981198
`@react-spectrum/test-utils` offers common gridlist interaction utilities which you may find helpful when writing tests. See [here](../react-aria/testing.html#react-aria-test-utils) for more information on how to setup these utilities
11991199
in your tests. Below is the full definition of the gridlist tester and a sample of how you could use it in your test suite.

packages/@react-spectrum/listbox/docs/ListBox.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ Please see the following sections in the testing docs for more information on ho
411411
Please also refer to [React Spectrum's test suite](https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/listbox/test/ListBox.test.js) if you find that the above
412412
isn't sufficient when resolving issues in your own test cases.
413413

414-
### Test utils <VersionBadge version="alpha" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
414+
### Test utils <VersionBadge version="beta" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
415415

416416
`@react-spectrum/test-utils` offers common listbox interaction utilities which you may find helpful when writing tests. See [here](../react-aria/testing.html#react-aria-test-utils) for more information on how to setup these utilities
417417
in your tests. Below is the full definition of the listbox tester and a sample of how you could use it in your test suite.

packages/@react-spectrum/menu/docs/MenuTrigger.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ behaviors in your test suite.
258258
Please also refer to [React Spectrum's test suite](https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/menu/test/MenuTrigger.test.js) if you find that the above
259259
isn't sufficient when resolving issues in your own test cases.
260260

261-
### Test utils <VersionBadge version="alpha" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
261+
### Test utils <VersionBadge version="beta" style={{marginLeft: 4, verticalAlign: 'bottom'}} />
262262

263263
`@react-spectrum/test-utils` offers common menu interaction utilities which you may find helpful when writing tests. See [here](../react-aria/testing.html#react-aria-test-utils) for more information on how to setup these utilities
264264
in your tests. Below is the full definition of the menu tester and a sample of how you could use it in your test suite.

0 commit comments

Comments
 (0)