Skip to content

Commit c81a23c

Browse files
authored
chore: revert ts update (#8060)
1 parent a654a33 commit c81a23c

40 files changed

+132
-184
lines changed

.yarn/patches/@types-node-npm-20.14.13-41f92d384c.patch

-13
This file was deleted.

lib/viewTransitions.d.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright 2025 Adobe. All rights reserved.
3+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License. You may obtain a copy
5+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software distributed under
8+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9+
* OF ANY KIND, either express or implied. See the License for the specific language
10+
* governing permissions and limitations under the License.
11+
*/
12+
13+
interface Document {
14+
startViewTransition(fn: () => void): ViewTransition;
15+
}
16+
17+
interface ViewTransition {
18+
ready: Promise<void>;
19+
}

package.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
"tailwindcss": "^4.0.0",
207207
"tailwindcss-animate": "^1.0.7",
208208
"tempy": "^0.5.0",
209-
"typescript": "^5.8.2",
209+
"typescript": "^5.5.0",
210210
"typescript-eslint": "^8.9.0",
211211
"verdaccio": "^6.0.0",
212212
"walk-object": "^4.0.0",
@@ -234,10 +234,7 @@
234234
"recast": "0.23.6",
235235
"ast-types": "0.16.1",
236236
"svgo": "^3",
237-
"@testing-library/user-event": "patch:@testing-library/user-event@npm%3A14.6.1#~/.yarn/patches/@testing-library-user-event-npm-14.6.1-5da7e1d4e2.patch",
238-
"@types/node@npm:*": "patch:@types/node@npm%3A20.14.13#~/.yarn/patches/@types-node-npm-20.14.13-41f92d384c.patch",
239-
"@types/node@npm:^18.0.0": "patch:@types/node@npm%3A20.14.13#~/.yarn/patches/@types-node-npm-20.14.13-41f92d384c.patch",
240-
"@types/node@npm:>= 8": "patch:@types/node@npm%3A20.14.13#~/.yarn/patches/@types-node-npm-20.14.13-41f92d384c.patch"
237+
"@testing-library/user-event": "patch:@testing-library/user-event@npm%3A14.6.1#~/.yarn/patches/@testing-library-user-event-npm-14.6.1-5da7e1d4e2.patch"
241238
},
242239
"@parcel/transformer-css": {
243240
"cssModules": {

packages/@react-aria/dnd/src/useDroppableCollection.ts

+11-18
Original file line numberDiff line numberDiff line change
@@ -258,25 +258,18 @@ export function useDroppableCollection(props: DroppableCollectionOptions, state:
258258
// inserted item. If selection is disabled, then also show the focus ring so there
259259
// is some indication that items were added.
260260
if (state.selectionManager.focusedKey === prevFocusedKey) {
261-
let first: Key | null | undefined = newKeys.keys().next().value;
262-
if (first != null) {
263-
let item = state.collection.getItem(first);
264-
265-
// If this is a cell, focus the parent row.
266-
// eslint-disable-next-line max-depth
267-
if (item?.type === 'cell') {
268-
first = item.parentKey;
269-
}
261+
let first = newKeys.keys().next().value;
262+
let item = state.collection.getItem(first);
270263

271-
// eslint-disable-next-line max-depth
272-
if (first != null) {
273-
state.selectionManager.setFocusedKey(first);
274-
}
264+
// If this is a cell, focus the parent row.
265+
if (item?.type === 'cell') {
266+
first = item.parentKey;
267+
}
275268

276-
// eslint-disable-next-line max-depth
277-
if (state.selectionManager.selectionMode === 'none') {
278-
setInteractionModality('keyboard');
279-
}
269+
state.selectionManager.setFocusedKey(first);
270+
271+
if (state.selectionManager.selectionMode === 'none') {
272+
setInteractionModality('keyboard');
280273
}
281274
}
282275
} else if (
@@ -342,7 +335,7 @@ export function useDroppableCollection(props: DroppableCollectionOptions, state:
342335
}, 50);
343336
}, [localState, defaultOnDrop, ref, updateFocusAfterDrop]);
344337

345-
338+
346339
useEffect(() => {
347340
return () => {
348341
if (droppingState.current) {

packages/@react-aria/grid/src/useGridSelectionAnnouncement.ts

+7-12
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,20 @@ export function useGridSelectionAnnouncement<T>(props: GridSelectionAnnouncement
6161
let messages: string[] = [];
6262

6363
if ((state.selectionManager.selectedKeys.size === 1 && isReplace)) {
64-
let firstKey = state.selectionManager.selectedKeys.keys().next().value;
65-
if (firstKey != null && state.collection.getItem(firstKey)) {
66-
let currentSelectionText = getRowText(firstKey);
64+
if (state.collection.getItem(state.selectionManager.selectedKeys.keys().next().value)) {
65+
let currentSelectionText = getRowText(state.selectionManager.selectedKeys.keys().next().value);
6766
if (currentSelectionText) {
6867
messages.push(stringFormatter.format('selectedItem', {item: currentSelectionText}));
6968
}
7069
}
7170
} else if (addedKeys.size === 1 && removedKeys.size === 0) {
72-
let firstKey = addedKeys.keys().next().value;
73-
if (firstKey != null) {
74-
let addedText = getRowText(firstKey);
75-
if (addedText) {
76-
messages.push(stringFormatter.format('selectedItem', {item: addedText}));
77-
}
71+
let addedText = getRowText(addedKeys.keys().next().value);
72+
if (addedText) {
73+
messages.push(stringFormatter.format('selectedItem', {item: addedText}));
7874
}
7975
} else if (removedKeys.size === 1 && addedKeys.size === 0) {
80-
let firstKey = removedKeys.keys().next().value;
81-
if (firstKey != null && state.collection.getItem(firstKey)) {
82-
let removedText = getRowText(firstKey);
76+
if (state.collection.getItem(removedKeys.keys().next().value)) {
77+
let removedText = getRowText(removedKeys.keys().next().value);
8378
if (removedText) {
8479
messages.push(stringFormatter.format('deselectedItem', {item: removedText}));
8580
}

packages/@react-spectrum/calendar/stories/Calendar.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ const calendars = [
209209

210210
function Example(props) {
211211
let [locale, setLocale] = React.useState('');
212-
let [calendar, setCalendar] = React.useState<Key | null>(calendars[0].key);
212+
let [calendar, setCalendar] = React.useState<Key>(calendars[0].key);
213213
let {locale: defaultLocale} = useLocale();
214214

215215
let pref = preferences.find(p => p.locale === locale)!;

packages/@react-spectrum/datepicker/stories/DateField.stories.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export const IsDateUnavailable: DateFieldStory = {
212212
...Default,
213213
args: {
214214
isDateUnavailable: (date) => {
215-
return date.compare(new CalendarDate(1980, 1, 1)) >= 0
215+
return date.compare(new CalendarDate(1980, 1, 1)) >= 0
216216
&& date.compare(new CalendarDate(1980, 1, 8)) <= 0;
217217
},
218218
errorMessage: 'Date unavailable.',
@@ -310,7 +310,7 @@ const calendars = [
310310

311311
function Example(props) {
312312
let [locale, setLocale] = React.useState('');
313-
let [calendar, setCalendar] = React.useState<Key | null>(calendars[0].key);
313+
let [calendar, setCalendar] = React.useState<Key>(calendars[0].key);
314314
let {locale: defaultLocale} = useLocale();
315315

316316
let pref = preferences.find(p => p.locale === locale);

packages/@react-spectrum/datepicker/stories/DatePicker.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ const calendars = [
338338

339339
function Example(props) {
340340
let [locale, setLocale] = React.useState('');
341-
let [calendar, setCalendar] = React.useState<Key | null>(calendars[0].key);
341+
let [calendar, setCalendar] = React.useState<Key>(calendars[0].key);
342342
let {locale: defaultLocale} = useLocale();
343343

344344
let pref = preferences.find(p => p.locale === locale);

packages/@react-spectrum/datepicker/stories/DateRangePicker.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ const calendars = [
238238

239239
function Example(props) {
240240
let [locale, setLocale] = React.useState('');
241-
let [calendar, setCalendar] = React.useState<Key | null>(calendars[0].key);
241+
let [calendar, setCalendar] = React.useState<Key>(calendars[0].key);
242242
let {locale: defaultLocale} = useLocale();
243243

244244
let pref = preferences.find(p => p.locale === locale);

packages/@react-spectrum/form/stories/Form.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ function FormWithControls(props: any = {}) {
482482
let [firstName, setFirstName] = useState('hello');
483483
let [isHunter, setIsHunter] = useState(true);
484484
let [favoritePet, setFavoritePet] = useState('cats');
485-
let [favoriteColor, setFavoriteColor] = useState<Key | null>('green');
485+
let [favoriteColor, setFavoriteColor] = useState('green' as Key);
486486
let [howIFeel, setHowIFeel] = useState('I feel good, o I feel so good!');
487487
let [birthday, setBirthday] = useState<CalendarDate | null>(new CalendarDate(1732, 2, 22));
488488
let [money, setMoney] = useState(50);

packages/@react-spectrum/s2/src/Breadcrumbs.tsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
DefaultCollectionRenderer,
2121
HeadingContext,
2222
Link,
23-
LinkRenderProps,
2423
Provider,
2524
Breadcrumbs as RACBreadcrumbs
2625
} from 'react-aria-components';
@@ -98,7 +97,7 @@ const wrapper = style<BreadcrumbsStyleProps>({
9897

9998
const InternalBreadcrumbsContext = createContext<Partial<BreadcrumbsProps<any>>>({});
10099

101-
/** Breadcrumbs show hierarchy and navigational context for a user's location within an application. */
100+
/** Breadcrumbs show hierarchy and navigational context for a users location within an application. */
102101
export const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: DOMRef<HTMLOListElement>) {
103102
[props, ref] = useSpectrumContextProps(props, ref, BreadcrumbsContext);
104103
let domRef = useDOMRef(ref);
@@ -201,7 +200,7 @@ let HiddenBreadcrumbs = function (props: {listRef: RefObject<HTMLDivElement | nu
201200
);
202201
};
203202

204-
const breadcrumbStyles = style<BreadcrumbsStyleProps & {isMenu?: boolean, isCurrent?: boolean}>({
203+
const breadcrumbStyles = style({
205204
display: 'flex',
206205
alignItems: 'center',
207206
justifyContent: 'start',
@@ -246,7 +245,7 @@ const chevronStyles = style({
246245
}
247246
});
248247

249-
const linkStyles = style<LinkRenderProps & {size?: 'M' | 'L', isCurrent?: boolean}>({
248+
const linkStyles = style({
250249
...focusRing(),
251250
borderRadius: 'sm',
252251
font: 'control',
@@ -256,8 +255,7 @@ const linkStyles = style<LinkRenderProps & {size?: 'M' | 'L', isCurrent?: boolea
256255
isCurrent: 'neutral',
257256
forcedColors: {
258257
default: 'LinkText',
259-
isDisabled: 'GrayText',
260-
isCurrent: 'GrayText'
258+
isDisabled: 'GrayText'
261259
}
262260
},
263261
transition: 'default',
@@ -339,7 +337,7 @@ export const Breadcrumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function
339337
ping={ping}
340338
referrerPolicy={referrerPolicy}
341339
isDisabled={isDisabled || isCurrent}
342-
className={({isFocused, isFocusVisible, isHovered, isDisabled, isPressed}) => linkStyles({isFocused, isFocusVisible, isHovered, isDisabled, size, isPressed, isCurrent})}>
340+
className={({isFocused, isFocusVisible, isHovered, isDisabled, isPressed}) => linkStyles({isFocused, isFocusVisible, isHovered, isDisabled, size, isPressed})}>
343341
{children}
344342
</Link>
345343
<ChevronIcon

packages/@react-spectrum/s2/src/CloseButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const hoverBackground = {
3939
isStaticColor: 'transparent-overlay-200'
4040
} as const;
4141

42-
const styles = style<CloseButtonProps & {isHovered: boolean, isFocusVisible: boolean, isPressed: boolean, isStaticColor: boolean}>({
42+
const styles = style({
4343
...focusRing(),
4444
...staticColor(),
4545
display: 'flex',

packages/@react-spectrum/s2/src/ComboBox.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
ListBoxSection as AriaListBoxSection,
1717
PopoverProps as AriaPopoverProps,
1818
Button,
19-
ButtonRenderProps,
2019
ContextValue,
2120
InputContext,
2221
ListBox,
@@ -96,7 +95,7 @@ export interface ComboBoxProps<T extends object> extends
9695

9796
export const ComboBoxContext = createContext<ContextValue<Partial<ComboBoxProps<any>>, TextFieldRef>>(null);
9897

99-
const inputButton = style<ButtonRenderProps & {isOpen: boolean, size: 'S' | 'M' | 'L' | 'XL'}>({
98+
const inputButton = style({
10099
display: 'flex',
101100
outlineStyle: 'none',
102101
textAlign: 'center',

packages/@react-spectrum/s2/src/Menu.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
SubmenuTriggerProps as AriaSubmenuTriggerProps,
2424
ContextValue,
2525
DEFAULT_SLOT,
26-
MenuItemRenderProps,
2726
Provider,
2827
Separator,
2928
SeparatorProps
@@ -147,7 +146,7 @@ export let sectionHeading = style({
147146
margin: 0
148147
});
149148

150-
export let menuitem = style<Omit<MenuItemRenderProps, 'hasSubmenu' | 'isOpen'> & {isFocused: boolean, size: 'S' | 'M' | 'L' | 'XL', isLink?: boolean, hasSubmenu?: boolean, isOpen?: boolean}>({
149+
export let menuitem = style({
151150
...focusRing(),
152151
boxSizing: 'border-box',
153152
borderRadius: 'control',
@@ -294,7 +293,7 @@ let value = style({
294293
marginStart: 8
295294
});
296295

297-
let keyboard = style<{size: 'S' | 'M' | 'L' | 'XL', isDisabled: boolean}>({
296+
let keyboard = style({
298297
gridArea: 'keyboard',
299298
marginStart: 8,
300299
font: 'ui',
@@ -306,7 +305,7 @@ let keyboard = style<{size: 'S' | 'M' | 'L' | 'XL', isDisabled: boolean}>({
306305
isDisabled: 'GrayText'
307306
}
308307
},
309-
backgroundColor: 'gray-25',
308+
background: 'gray-25',
310309
unicodeBidi: 'plaintext'
311310
});
312311

packages/@react-spectrum/s2/src/NumberField.tsx

+16-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
NumberField as AriaNumberField,
1717
NumberFieldProps as AriaNumberFieldProps,
1818
ButtonContext,
19-
ButtonRenderProps,
2019
ContextValue,
2120
InputContext,
2221
Text,
@@ -57,7 +56,7 @@ export interface NumberFieldProps extends
5756

5857
export const NumberFieldContext = createContext<ContextValue<Partial<NumberFieldProps>, TextFieldRef>>(null);
5958

60-
const inputButton = style<ButtonRenderProps & {size: 'S' | 'M' | 'L' | 'XL', type: 'decrement' | 'increment'}>({
59+
const inputButton = style({
6160
display: 'flex',
6261
outlineStyle: 'none',
6362
textAlign: 'center',
@@ -70,6 +69,9 @@ const inputButton = style<ButtonRenderProps & {size: 'S' | 'M' | 'L' | 'XL', typ
7069
L: '[5px]',
7170
XL: '[6px]'
7271
}
72+
},
73+
type: {
74+
decrementStep: 'none'
7375
}
7476
},
7577
borderBottomRadius: {
@@ -80,6 +82,9 @@ const inputButton = style<ButtonRenderProps & {size: 'S' | 'M' | 'L' | 'XL', typ
8082
L: '[5px]',
8183
XL: '[6px]'
8284
}
85+
},
86+
type: {
87+
incrementStep: 'none'
8388
}
8489
},
8590
alignItems: 'center',
@@ -127,6 +132,13 @@ const inputButton = style<ButtonRenderProps & {size: 'S' | 'M' | 'L' | 'XL', typ
127132

128133
const iconStyles = style({
129134
flexShrink: 0,
135+
rotate: {
136+
default: 0,
137+
type: {
138+
incrementStep: 270,
139+
decrementStep: 90
140+
}
141+
},
130142
'--iconPrimary': {
131143
type: 'fill',
132144
value: 'currentColor'
@@ -249,7 +261,7 @@ export const NumberField = forwardRef(function NumberField(props: NumberFieldPro
249261
type: 'decrement',
250262
size
251263
})}>
252-
<Dash size={size} className={iconStyles} />
264+
<Dash size={size} className={iconStyles({})} />
253265
</StepButton>
254266
<StepButton
255267
ref={incrementButtonRef}
@@ -260,7 +272,7 @@ export const NumberField = forwardRef(function NumberField(props: NumberFieldPro
260272
type: 'increment',
261273
size
262274
})}>
263-
<Add size={size} className={iconStyles} />
275+
<Add size={size} className={iconStyles({})} />
264276
</StepButton>
265277
</div>}
266278
</FieldGroup>

0 commit comments

Comments
 (0)