Skip to content

Commit cec6171

Browse files
authored
Merge branch 'main' into form-props
2 parents cb63c90 + f149209 commit cec6171

File tree

128 files changed

+1802
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1802
-226
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@
129129
"@testing-library/jest-dom": "^5.16.5",
130130
"@testing-library/react": "^16.0.0",
131131
"@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",
132-
"@types/react": "npm:types-react@19.0.0-rc.0",
133-
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.0",
132+
"@types/react": "^19.0.0",
133+
"@types/react-dom": "^19.0.0",
134134
"@yarnpkg/types": "^4.0.0",
135135
"autoprefixer": "^9.6.0",
136136
"axe-core": "^4.6.3",
@@ -231,8 +231,8 @@
231231
"react-refresh": "0.9.0",
232232
"browserslist": "4.24.0",
233233
"caniuse-lite": "1.0.30001563",
234-
"@types/react": "npm:types-react@19.0.0-rc.0",
235-
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.0",
234+
"@types/react": "19.1.8",
235+
"@types/react-dom": "19.1.6",
236236
"recast": "0.23.6",
237237
"ast-types": "0.16.1",
238238
"svgo": "^3",

packages/@adobe/spectrum-css-temp/components/actiongroup/index.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ governing permissions and limitations under the License.
4949

5050
.spectrum-ActionGroup-item {
5151
flex-shrink: 0;
52+
}
5253

53-
&.spectrum-ActionGroup-item--iconOnly {
54-
padding-inline-end: var(--spectrum-actionbutton-icon-padding-x);
55-
}
54+
.spectrum-ActionGroup-item--iconOnly {
55+
padding-inline-end: var(--spectrum-actionbutton-icon-padding-x);
5656
}
5757

5858
&:focus {

packages/@react-aria/button/src/useToggleButtonGroup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export function useToggleButtonGroupItem(props: AriaToggleButtonGroupItemOptions
6868
export function useToggleButtonGroupItem(props: AriaToggleButtonGroupItemOptions<ElementType>, state: ToggleGroupState, ref: RefObject<any>): ToggleButtonAria<HTMLAttributes<any>> {
6969
let toggleState: ToggleState = {
7070
isSelected: state.selectedKeys.has(props.id),
71+
defaultSelected: false,
7172
setSelected(isSelected) {
7273
state.setSelected(props.id, isSelected);
7374
},

packages/@react-aria/checkbox/src/useCheckboxGroupItem.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export function useCheckboxGroupItem(props: AriaCheckboxGroupItemProps, state: C
3030
const toggleState = useToggleState({
3131
isReadOnly: props.isReadOnly || state.isReadOnly,
3232
isSelected: state.isSelected(props.value),
33+
defaultSelected: state.defaultValue.includes(props.value),
3334
onChange(isSelected) {
3435
if (isSelected) {
3536
state.addValue(props.value);

packages/@react-aria/color/src/useColorArea.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,7 @@ export function useColorArea(props: AriaColorAreaOptions, state: ColorAreaState)
7070
}
7171
}, [inputXRef]);
7272

73-
useFormReset(inputXRef, [state.xValue, state.yValue], ([x, y]) => {
74-
let newColor = state.value
75-
.withChannelValue(state.channels.xChannel, x)
76-
.withChannelValue(state.channels.yChannel, y);
77-
state.setValue(newColor);
78-
});
73+
useFormReset(inputXRef, state.defaultValue, state.setValue);
7974

8075
let [valueChangedViaKeyboard, setValueChangedViaKeyboard] = useState(false);
8176
let [valueChangedViaInputChangeEvent, setValueChangedViaInputChangeEvent] = useState(false);

packages/@react-aria/color/src/useColorField.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
useCallback,
2121
useState
2222
} from 'react';
23-
import {mergeProps, useId} from '@react-aria/utils';
23+
import {mergeProps, useFormReset, useId} from '@react-aria/utils';
2424
import {privateValidationStateProp} from '@react-stately/form';
2525
import {useFocusWithin, useScrollWheel} from '@react-aria/interactions';
2626
import {useFormattedTextField} from '@react-aria/textfield';
@@ -108,14 +108,18 @@ export function useColorField(
108108
...props,
109109
id: inputId,
110110
value: inputValue,
111-
defaultValue: undefined,
111+
// Intentionally invalid value that will be ignored by onChange during form reset
112+
// This is handled separately below.
113+
defaultValue: '!',
112114
validate: undefined,
113115
[privateValidationStateProp]: state,
114116
type: 'text',
115117
autoComplete: 'off',
116118
onChange
117119
}, state, ref);
118120

121+
useFormReset(ref, state.defaultColorValue, state.setColorValue);
122+
119123
inputProps = mergeProps(inputProps, spinButtonProps, focusWithinProps, {
120124
role: 'textbox',
121125
'aria-valuemax': null,

packages/@react-aria/color/src/useColorWheel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function useColorWheel(props: AriaColorWheelOptions, state: ColorWheelSta
5959
}
6060
}, [inputRef]);
6161

62-
useFormReset(inputRef, state.hue, state.setHue);
62+
useFormReset(inputRef, state.defaultValue, state.setValue);
6363

6464
let currentPosition = useRef<{x: number, y: number} | null>(null);
6565

packages/@react-aria/combobox/src/useComboBox.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export function useComboBox<T>(props: AriaComboBoxOptions<T>, state: ComboBoxSta
210210
onKeyDown: !isReadOnly ? chain(state.isOpen && collectionProps.onKeyDown, onKeyDown, props.onKeyDown) : props.onKeyDown,
211211
onBlur,
212212
value: state.inputValue,
213+
defaultValue: state.defaultInputValue,
213214
onFocus,
214215
autoComplete: 'off',
215216
validate: undefined,

packages/@react-aria/datepicker/src/useDateField.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export function useDateField<T extends DateValue>(props: AriaDateFieldOptions<T>
138138
autoFocusRef.current = false;
139139
}, [focusManager]);
140140

141-
useFormReset(props.inputRef, state.value, state.setValue);
141+
useFormReset(props.inputRef, state.defaultValue, state.setValue);
142142
useFormValidation({
143143
...props,
144144
focus() {

packages/@react-aria/datepicker/src/useDatePicker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export function useDatePicker<T extends DateValue>(props: AriaDatePickerProps<T>
136136
[roleSymbol]: 'presentation',
137137
'aria-describedby': ariaDescribedBy,
138138
value: state.value,
139+
defaultValue: state.defaultValue,
139140
onChange: state.setValue,
140141
placeholderValue: props.placeholderValue,
141142
hideTimeZone: props.hideTimeZone,

0 commit comments

Comments
 (0)