react-aria-components 1.14.0 → 1.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Breadcrumbs.main.js +3 -2
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +4 -3
- package/dist/Breadcrumbs.module.js +4 -3
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +1 -1
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +2 -2
- package/dist/Button.module.js +2 -2
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +11 -7
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +12 -8
- package/dist/Calendar.module.js +12 -8
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +2 -2
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +3 -3
- package/dist/Checkbox.module.js +3 -3
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/ColorArea.main.js +1 -1
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +2 -2
- package/dist/ColorArea.module.js +2 -2
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +7 -3
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +8 -4
- package/dist/ColorField.module.js +8 -4
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +1 -1
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +2 -2
- package/dist/ColorSlider.module.js +2 -2
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +1 -1
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +2 -2
- package/dist/ColorSwatch.module.js +2 -2
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js +2 -0
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.mjs +2 -0
- package/dist/ColorSwatchPicker.module.js +2 -0
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +1 -1
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +2 -2
- package/dist/ColorThumb.module.js +2 -2
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +2 -2
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +3 -3
- package/dist/ColorWheel.module.js +3 -3
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +2 -2
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +3 -3
- package/dist/ComboBox.module.js +3 -3
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +3 -3
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +4 -4
- package/dist/DateField.module.js +4 -4
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +2 -2
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +3 -3
- package/dist/DatePicker.module.js +3 -3
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +2 -1
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +3 -2
- package/dist/Dialog.module.js +3 -2
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +3 -3
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +4 -4
- package/dist/Disclosure.module.js +4 -4
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DropZone.main.js +2 -3
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +4 -5
- package/dist/DropZone.module.js +4 -5
- package/dist/DropZone.module.js.map +1 -1
- package/dist/Form.main.js +1 -1
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.mjs +2 -2
- package/dist/Form.module.js +2 -2
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +16 -13
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +17 -14
- package/dist/GridList.module.js +17 -14
- package/dist/GridList.module.js.map +1 -1
- package/dist/Group.main.js +1 -1
- package/dist/Group.main.js.map +1 -1
- package/dist/Group.mjs +2 -2
- package/dist/Group.module.js +2 -2
- package/dist/Group.module.js.map +1 -1
- package/dist/Header.main.js +1 -1
- package/dist/Header.main.js.map +1 -1
- package/dist/Header.mjs +2 -2
- package/dist/Header.module.js +2 -2
- package/dist/Header.module.js.map +1 -1
- package/dist/Heading.main.js +2 -2
- package/dist/Heading.main.js.map +1 -1
- package/dist/Heading.mjs +2 -2
- package/dist/Heading.module.js +2 -2
- package/dist/Heading.module.js.map +1 -1
- package/dist/HiddenDateInput.main.js +5 -1
- package/dist/HiddenDateInput.main.js.map +1 -1
- package/dist/HiddenDateInput.mjs +6 -2
- package/dist/HiddenDateInput.module.js +6 -2
- package/dist/HiddenDateInput.module.js.map +1 -1
- package/dist/Input.main.js +1 -1
- package/dist/Input.main.js.map +1 -1
- package/dist/Input.mjs +2 -2
- package/dist/Input.module.js +2 -2
- package/dist/Input.module.js.map +1 -1
- package/dist/Keyboard.main.js +1 -1
- package/dist/Keyboard.main.js.map +1 -1
- package/dist/Keyboard.mjs +2 -2
- package/dist/Keyboard.module.js +2 -2
- package/dist/Keyboard.module.js.map +1 -1
- package/dist/Label.main.js +2 -1
- package/dist/Label.main.js.map +1 -1
- package/dist/Label.mjs +3 -2
- package/dist/Label.module.js +3 -2
- package/dist/Label.module.js.map +1 -1
- package/dist/Link.main.js +3 -2
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +4 -3
- package/dist/Link.module.js +4 -3
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +13 -14
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +14 -15
- package/dist/ListBox.module.js +14 -15
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +21 -8
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +22 -9
- package/dist/Menu.module.js +22 -9
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +1 -1
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +2 -2
- package/dist/Meter.module.js +2 -2
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +2 -2
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +3 -3
- package/dist/Modal.module.js +3 -3
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +1 -1
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +2 -2
- package/dist/NumberField.module.js +2 -2
- package/dist/NumberField.module.js.map +1 -1
- package/dist/OverlayArrow.main.js +1 -1
- package/dist/OverlayArrow.main.js.map +1 -1
- package/dist/OverlayArrow.mjs +2 -2
- package/dist/OverlayArrow.module.js +2 -2
- package/dist/OverlayArrow.module.js.map +1 -1
- package/dist/Popover.main.js +2 -2
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +4 -4
- package/dist/Popover.module.js +4 -4
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +1 -1
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +2 -2
- package/dist/ProgressBar.module.js +2 -2
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +2 -2
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +3 -3
- package/dist/RadioGroup.module.js +3 -3
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +1 -1
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +2 -2
- package/dist/SearchField.module.js +2 -2
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +2 -2
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +3 -3
- package/dist/Select.module.js +3 -3
- package/dist/Select.module.js.map +1 -1
- package/dist/Separator.main.js +3 -1
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.mjs +4 -2
- package/dist/Separator.module.js +4 -2
- package/dist/Separator.module.js.map +1 -1
- package/dist/SharedElementTransition.main.js +3 -2
- package/dist/SharedElementTransition.main.js.map +1 -1
- package/dist/SharedElementTransition.mjs +4 -3
- package/dist/SharedElementTransition.module.js +4 -3
- package/dist/SharedElementTransition.module.js.map +1 -1
- package/dist/Slider.main.js +6 -5
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +7 -6
- package/dist/Slider.module.js +7 -6
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +1 -1
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +2 -2
- package/dist/Switch.module.js +2 -2
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +30 -25
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +31 -26
- package/dist/Table.module.js +31 -26
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +13 -6
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +14 -7
- package/dist/Tabs.module.js +14 -7
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +6 -5
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +7 -6
- package/dist/TagGroup.module.js +7 -6
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/Text.main.js +2 -1
- package/dist/Text.main.js.map +1 -1
- package/dist/Text.mjs +3 -2
- package/dist/Text.module.js +3 -2
- package/dist/Text.module.js.map +1 -1
- package/dist/TextArea.main.js +1 -1
- package/dist/TextArea.main.js.map +1 -1
- package/dist/TextArea.mjs +2 -2
- package/dist/TextArea.module.js +2 -2
- package/dist/TextArea.module.js.map +1 -1
- package/dist/TextField.main.js +1 -1
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +2 -2
- package/dist/TextField.module.js +2 -2
- package/dist/TextField.module.js.map +1 -1
- package/dist/Toast.main.js +6 -4
- package/dist/Toast.main.js.map +1 -1
- package/dist/Toast.mjs +7 -5
- package/dist/Toast.module.js +7 -5
- package/dist/Toast.module.js.map +1 -1
- package/dist/ToggleButton.main.js +5 -2
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +6 -3
- package/dist/ToggleButton.module.js +6 -3
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +1 -1
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +2 -2
- package/dist/ToggleButtonGroup.module.js +2 -2
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +1 -1
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +2 -2
- package/dist/Toolbar.module.js +2 -2
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +1 -1
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +2 -2
- package/dist/Tooltip.module.js +2 -2
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +6 -6
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +7 -7
- package/dist/Tree.module.js +7 -7
- package/dist/Tree.module.js.map +1 -1
- package/dist/types.d.ts +121 -62
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.main.js +41 -3
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.mjs +42 -5
- package/dist/utils.module.js +42 -5
- package/dist/utils.module.js.map +1 -1
- package/package.json +24 -24
- package/src/Breadcrumbs.tsx +9 -6
- package/src/Button.tsx +4 -3
- package/src/Calendar.tsx +26 -20
- package/src/Checkbox.tsx +7 -6
- package/src/ColorArea.tsx +3 -2
- package/src/ColorField.tsx +18 -3
- package/src/ColorSlider.tsx +2 -1
- package/src/ColorSwatch.tsx +2 -1
- package/src/ColorSwatchPicker.tsx +2 -0
- package/src/ColorThumb.tsx +3 -3
- package/src/ColorWheel.tsx +4 -3
- package/src/ComboBox.tsx +3 -2
- package/src/DateField.tsx +5 -4
- package/src/DatePicker.tsx +3 -2
- package/src/Dialog.tsx +5 -4
- package/src/Disclosure.tsx +7 -6
- package/src/DropZone.tsx +5 -5
- package/src/Form.tsx +4 -4
- package/src/GridList.tsx +30 -23
- package/src/Group.tsx +10 -9
- package/src/Header.tsx +7 -5
- package/src/Heading.tsx +4 -4
- package/src/HiddenDateInput.tsx +10 -3
- package/src/Input.tsx +3 -2
- package/src/Keyboard.tsx +4 -2
- package/src/Label.tsx +4 -3
- package/src/Link.tsx +15 -12
- package/src/ListBox.tsx +23 -22
- package/src/Menu.tsx +32 -17
- package/src/Meter.tsx +3 -2
- package/src/Modal.tsx +5 -4
- package/src/NumberField.tsx +2 -1
- package/src/OverlayArrow.tsx +3 -2
- package/src/Popover.tsx +5 -4
- package/src/ProgressBar.tsx +3 -2
- package/src/RadioGroup.tsx +6 -5
- package/src/SearchField.tsx +3 -2
- package/src/Select.tsx +6 -5
- package/src/Separator.tsx +8 -5
- package/src/SharedElementTransition.tsx +4 -3
- package/src/Slider.tsx +9 -7
- package/src/Switch.tsx +11 -10
- package/src/Table.tsx +47 -36
- package/src/Tabs.tsx +23 -18
- package/src/TagGroup.tsx +16 -13
- package/src/Text.tsx +4 -3
- package/src/TextArea.tsx +3 -2
- package/src/TextField.tsx +4 -3
- package/src/Toast.tsx +15 -11
- package/src/ToggleButton.tsx +5 -4
- package/src/ToggleButtonGroup.tsx +3 -2
- package/src/Toolbar.tsx +3 -2
- package/src/Tooltip.tsx +3 -2
- package/src/Tree.tsx +18 -17
- package/src/utils.tsx +96 -10
package/src/Checkbox.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {CheckboxGroupState, useCheckboxGroupState, useToggleState} from 'react-s
|
|
|
15
15
|
import {
|
|
16
16
|
ClassNameOrFunction,
|
|
17
17
|
ContextValue,
|
|
18
|
+
dom,
|
|
18
19
|
Provider,
|
|
19
20
|
RACValidation,
|
|
20
21
|
removeDataAttributes,
|
|
@@ -33,14 +34,14 @@ import {LabelContext} from './Label';
|
|
|
33
34
|
import React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';
|
|
34
35
|
import {TextContext} from './Text';
|
|
35
36
|
|
|
36
|
-
export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<CheckboxGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
37
|
+
export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<CheckboxGroupRenderProps, 'div'>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
37
38
|
/**
|
|
38
39
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.
|
|
39
40
|
* @default 'react-aria-CheckboxGroup'
|
|
40
41
|
*/
|
|
41
42
|
className?: ClassNameOrFunction<CheckboxGroupRenderProps>
|
|
42
43
|
}
|
|
43
|
-
export interface CheckboxProps extends Omit<AriaCheckboxProps, 'children' | 'validationState' | 'validationBehavior'>, HoverEvents, RACValidation, RenderProps<CheckboxRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {
|
|
44
|
+
export interface CheckboxProps extends Omit<AriaCheckboxProps, 'children' | 'validationState' | 'validationBehavior'>, HoverEvents, RACValidation, RenderProps<CheckboxRenderProps, 'label'>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {
|
|
44
45
|
/**
|
|
45
46
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.
|
|
46
47
|
* @default 'react-aria-Checkbox'
|
|
@@ -170,7 +171,7 @@ export const CheckboxGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(functi
|
|
|
170
171
|
let DOMProps = filterDOMProps(props, {global: true});
|
|
171
172
|
|
|
172
173
|
return (
|
|
173
|
-
<div
|
|
174
|
+
<dom.div
|
|
174
175
|
{...mergeProps(DOMProps, renderProps, groupProps)}
|
|
175
176
|
ref={ref}
|
|
176
177
|
slot={props.slot || undefined}
|
|
@@ -192,7 +193,7 @@ export const CheckboxGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(functi
|
|
|
192
193
|
]}>
|
|
193
194
|
{renderProps.children}
|
|
194
195
|
</Provider>
|
|
195
|
-
</div>
|
|
196
|
+
</dom.div>
|
|
196
197
|
);
|
|
197
198
|
});
|
|
198
199
|
|
|
@@ -258,7 +259,7 @@ export const Checkbox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Ch
|
|
|
258
259
|
delete DOMProps.onClick;
|
|
259
260
|
|
|
260
261
|
return (
|
|
261
|
-
<label
|
|
262
|
+
<dom.label
|
|
262
263
|
{...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}
|
|
263
264
|
ref={ref}
|
|
264
265
|
slot={props.slot || undefined}
|
|
@@ -276,6 +277,6 @@ export const Checkbox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Ch
|
|
|
276
277
|
<input {...mergeProps(inputProps, focusProps)} ref={inputRef} />
|
|
277
278
|
</VisuallyHidden>
|
|
278
279
|
{renderProps.children}
|
|
279
|
-
</label>
|
|
280
|
+
</dom.label>
|
|
280
281
|
);
|
|
281
282
|
});
|
package/src/ColorArea.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {AriaColorAreaProps, useColorArea} from 'react-aria';
|
|
2
2
|
import {
|
|
3
3
|
ClassNameOrFunction,
|
|
4
|
+
dom,
|
|
4
5
|
Provider,
|
|
5
6
|
RenderProps,
|
|
6
7
|
SlotProps,
|
|
@@ -71,7 +72,7 @@ export const ColorArea = forwardRef(function ColorArea(props: ColorAreaProps, re
|
|
|
71
72
|
delete DOMProps.id;
|
|
72
73
|
|
|
73
74
|
return (
|
|
74
|
-
<div
|
|
75
|
+
<dom.div
|
|
75
76
|
ref={ref}
|
|
76
77
|
{...mergeProps(DOMProps, colorAreaProps, renderProps)}
|
|
77
78
|
slot={props.slot || undefined}
|
|
@@ -83,6 +84,6 @@ export const ColorArea = forwardRef(function ColorArea(props: ColorAreaProps, re
|
|
|
83
84
|
]}>
|
|
84
85
|
{renderProps.children}
|
|
85
86
|
</Provider>
|
|
86
|
-
</div>
|
|
87
|
+
</dom.div>
|
|
87
88
|
);
|
|
88
89
|
});
|
package/src/ColorField.tsx
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import {AriaColorFieldProps, useColorChannelField, useColorField, useLocale} from 'react-aria';
|
|
14
14
|
import {
|
|
15
15
|
ClassNameOrFunction,
|
|
16
|
+
dom,
|
|
16
17
|
Provider,
|
|
17
18
|
RACValidation,
|
|
18
19
|
removeDataAttributes,
|
|
@@ -44,6 +45,16 @@ export interface ColorFieldRenderProps {
|
|
|
44
45
|
* @selector [data-invalid]
|
|
45
46
|
*/
|
|
46
47
|
isInvalid: boolean,
|
|
48
|
+
/**
|
|
49
|
+
* Whether the color field is read only.
|
|
50
|
+
* @selector [data-readonly]
|
|
51
|
+
*/
|
|
52
|
+
isReadOnly: boolean,
|
|
53
|
+
/**
|
|
54
|
+
* Whether the color field is required.
|
|
55
|
+
* @selector [data-required]
|
|
56
|
+
*/
|
|
57
|
+
isRequired: boolean,
|
|
47
58
|
/**
|
|
48
59
|
* The color channel that this field edits, or "hex" if no `channel` prop is set.
|
|
49
60
|
* @selector [data-channel="hex | hue | saturation | ..."]
|
|
@@ -192,7 +203,9 @@ function useChildren(
|
|
|
192
203
|
state,
|
|
193
204
|
channel: props.channel || 'hex',
|
|
194
205
|
isDisabled: props.isDisabled || false,
|
|
195
|
-
isInvalid: validation.isInvalid || false
|
|
206
|
+
isInvalid: validation.isInvalid || false,
|
|
207
|
+
isReadOnly: props.isReadOnly || false,
|
|
208
|
+
isRequired: props.isRequired || false
|
|
196
209
|
},
|
|
197
210
|
defaultClassName: 'react-aria-ColorField'
|
|
198
211
|
});
|
|
@@ -215,14 +228,16 @@ function useChildren(
|
|
|
215
228
|
}],
|
|
216
229
|
[FieldErrorContext, validation]
|
|
217
230
|
]}>
|
|
218
|
-
<div
|
|
231
|
+
<dom.div
|
|
219
232
|
{...DOMProps}
|
|
220
233
|
{...renderProps}
|
|
221
234
|
ref={ref}
|
|
222
235
|
slot={props.slot || undefined}
|
|
223
236
|
data-channel={props.channel || 'hex'}
|
|
224
237
|
data-disabled={props.isDisabled || undefined}
|
|
225
|
-
data-invalid={validation.isInvalid || undefined}
|
|
238
|
+
data-invalid={validation.isInvalid || undefined}
|
|
239
|
+
data-readonly={props.isReadOnly || undefined}
|
|
240
|
+
data-required={props.isRequired || undefined} />
|
|
226
241
|
</Provider>
|
|
227
242
|
);
|
|
228
243
|
}
|
package/src/ColorSlider.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {AriaColorSliderProps, Orientation, useColorSlider, useLocale} from 'react-aria';
|
|
2
2
|
import {
|
|
3
3
|
ClassNameOrFunction,
|
|
4
|
+
dom,
|
|
4
5
|
Provider,
|
|
5
6
|
RenderProps,
|
|
6
7
|
SlotProps,
|
|
@@ -97,7 +98,7 @@ export const ColorSlider = forwardRef(function ColorSlider(props: ColorSliderPro
|
|
|
97
98
|
}],
|
|
98
99
|
[InternalColorThumbContext, {state, thumbProps, inputXRef: inputRef, xInputProps: inputProps, isDisabled: props.isDisabled}]
|
|
99
100
|
]}>
|
|
100
|
-
<div
|
|
101
|
+
<dom.div
|
|
101
102
|
{...DOMProps}
|
|
102
103
|
{...renderProps}
|
|
103
104
|
ref={ref}
|
package/src/ColorSwatch.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import {AriaColorSwatchProps, useColorSwatch} from 'react-aria';
|
|
|
2
2
|
import {
|
|
3
3
|
ClassNameOrFunction,
|
|
4
4
|
ContextValue,
|
|
5
|
+
dom,
|
|
5
6
|
SlotProps,
|
|
6
7
|
StyleRenderProps,
|
|
7
8
|
useContextProps,
|
|
@@ -45,7 +46,7 @@ export const ColorSwatch = forwardRef(function ColorSwatch(props: ColorSwatchPro
|
|
|
45
46
|
let DOMProps = filterDOMProps(props, {global: true});
|
|
46
47
|
|
|
47
48
|
return (
|
|
48
|
-
<div
|
|
49
|
+
<dom.div
|
|
49
50
|
{...mergeProps(DOMProps, colorSwatchProps, renderProps)}
|
|
50
51
|
slot={props.slot || undefined}
|
|
51
52
|
ref={ref} />
|
|
@@ -108,6 +108,8 @@ export const ColorSwatchPickerItem = forwardRef(function ColorSwatchPickerItem(p
|
|
|
108
108
|
return (
|
|
109
109
|
<ListBoxItem
|
|
110
110
|
{...props}
|
|
111
|
+
// ColorSwatchPickerItem is never a link.
|
|
112
|
+
render={props.render as any}
|
|
111
113
|
ref={ref}
|
|
112
114
|
id={color.toString('hexa')}
|
|
113
115
|
textValue={color.getColorName(locale)}
|
package/src/ColorThumb.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ClassNameOrFunction, RenderProps, useRenderProps} from './utils';
|
|
1
|
+
import {ClassNameOrFunction, dom, RenderProps, useRenderProps} from './utils';
|
|
2
2
|
import {Color} from 'react-stately';
|
|
3
3
|
import {filterDOMProps} from '@react-aria/utils';
|
|
4
4
|
import {GlobalDOMAttributes, HoverEvents, RefObject} from '@react-types/shared';
|
|
@@ -91,7 +91,7 @@ export const ColorThumb = forwardRef(function ColorThumb(props: ColorThumbProps,
|
|
|
91
91
|
delete DOMProps.id;
|
|
92
92
|
|
|
93
93
|
return (
|
|
94
|
-
<div
|
|
94
|
+
<dom.div
|
|
95
95
|
{...mergeProps(thumbProps, hoverProps, DOMProps)}
|
|
96
96
|
{...renderProps}
|
|
97
97
|
ref={ref}
|
|
@@ -103,6 +103,6 @@ export const ColorThumb = forwardRef(function ColorThumb(props: ColorThumbProps,
|
|
|
103
103
|
<input ref={inputXRef} {...xInputProps} {...focusProps} />
|
|
104
104
|
{yInputProps && <input ref={inputYRef} {...yInputProps} {...focusProps} />}
|
|
105
105
|
{renderProps.children}
|
|
106
|
-
</div>
|
|
106
|
+
</dom.div>
|
|
107
107
|
);
|
|
108
108
|
});
|
package/src/ColorWheel.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import {AriaColorWheelOptions, useColorWheel} from 'react-aria';
|
|
|
2
2
|
import {
|
|
3
3
|
ClassNameOrFunction,
|
|
4
4
|
ContextValue,
|
|
5
|
+
dom,
|
|
5
6
|
Provider,
|
|
6
7
|
RenderProps,
|
|
7
8
|
SlotProps,
|
|
@@ -63,7 +64,7 @@ export const ColorWheel = forwardRef(function ColorWheel(props: ColorWheelProps,
|
|
|
63
64
|
delete DOMProps.id;
|
|
64
65
|
|
|
65
66
|
return (
|
|
66
|
-
<div
|
|
67
|
+
<dom.div
|
|
67
68
|
{...DOMProps}
|
|
68
69
|
{...renderProps}
|
|
69
70
|
ref={ref}
|
|
@@ -77,7 +78,7 @@ export const ColorWheel = forwardRef(function ColorWheel(props: ColorWheelProps,
|
|
|
77
78
|
]}>
|
|
78
79
|
{renderProps.children}
|
|
79
80
|
</Provider>
|
|
80
|
-
</div>
|
|
81
|
+
</dom.div>
|
|
81
82
|
);
|
|
82
83
|
});
|
|
83
84
|
|
|
@@ -112,7 +113,7 @@ export const ColorWheelTrack = forwardRef(function ColorWheelTrack(props: ColorW
|
|
|
112
113
|
});
|
|
113
114
|
|
|
114
115
|
return (
|
|
115
|
-
<div
|
|
116
|
+
<dom.div
|
|
116
117
|
{...rest}
|
|
117
118
|
{...renderProps}
|
|
118
119
|
ref={ref}
|
package/src/ComboBox.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import {ButtonContext} from './Button';
|
|
|
14
14
|
import {
|
|
15
15
|
ClassNameOrFunction,
|
|
16
16
|
ContextValue,
|
|
17
|
+
dom,
|
|
17
18
|
Provider,
|
|
18
19
|
RACValidation,
|
|
19
20
|
removeDataAttributes,
|
|
@@ -133,8 +134,8 @@ function ComboBoxInner<T extends object>({props, collection, comboBoxRef: ref}:
|
|
|
133
134
|
let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';
|
|
134
135
|
let {contains} = useFilter({sensitivity: 'base'});
|
|
135
136
|
let state = useComboBoxState({
|
|
136
|
-
defaultFilter: props.defaultFilter || contains,
|
|
137
137
|
...props,
|
|
138
|
+
defaultFilter: props.defaultFilter || contains,
|
|
138
139
|
// If props.items isn't provided, rely on collection filtering (aka listbox.items is provided or defaultItems provided to Combobox)
|
|
139
140
|
items: props.items,
|
|
140
141
|
children: undefined,
|
|
@@ -231,7 +232,7 @@ function ComboBoxInner<T extends object>({props, collection, comboBoxRef: ref}:
|
|
|
231
232
|
[GroupContext, {isInvalid: validation.isInvalid, isDisabled: props.isDisabled || false}],
|
|
232
233
|
[FieldErrorContext, validation]
|
|
233
234
|
]}>
|
|
234
|
-
<div
|
|
235
|
+
<dom.div
|
|
235
236
|
{...DOMProps}
|
|
236
237
|
{...renderProps}
|
|
237
238
|
ref={ref}
|
package/src/DateField.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import {AriaDateFieldProps, AriaTimeFieldProps, DateValue, HoverEvents, mergePro
|
|
|
13
13
|
import {
|
|
14
14
|
ClassNameOrFunction,
|
|
15
15
|
ContextValue,
|
|
16
|
+
dom,
|
|
16
17
|
Provider,
|
|
17
18
|
RACValidation,
|
|
18
19
|
removeDataAttributes,
|
|
@@ -135,7 +136,7 @@ export const DateField = /*#__PURE__*/ (forwardRef as forwardRefType)(function D
|
|
|
135
136
|
}],
|
|
136
137
|
[FieldErrorContext, validation]
|
|
137
138
|
]}>
|
|
138
|
-
<div
|
|
139
|
+
<dom.div
|
|
139
140
|
{...DOMProps}
|
|
140
141
|
{...renderProps}
|
|
141
142
|
ref={ref}
|
|
@@ -208,7 +209,7 @@ export const TimeField = /*#__PURE__*/ (forwardRef as forwardRefType)(function T
|
|
|
208
209
|
}],
|
|
209
210
|
[FieldErrorContext, validation]
|
|
210
211
|
]}>
|
|
211
|
-
<div
|
|
212
|
+
<dom.div
|
|
212
213
|
{...DOMProps}
|
|
213
214
|
{...renderProps}
|
|
214
215
|
ref={ref}
|
|
@@ -361,7 +362,7 @@ export interface DateSegmentRenderProps extends Omit<IDateSegment, 'isEditable'>
|
|
|
361
362
|
type: DateSegmentType
|
|
362
363
|
}
|
|
363
364
|
|
|
364
|
-
export interface DateSegmentProps extends RenderProps<DateSegmentRenderProps>, HoverEvents, GlobalDOMAttributes<HTMLSpanElement> {
|
|
365
|
+
export interface DateSegmentProps extends RenderProps<DateSegmentRenderProps, 'span'>, HoverEvents, GlobalDOMAttributes<HTMLSpanElement> {
|
|
365
366
|
/**
|
|
366
367
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.
|
|
367
368
|
* @default 'react-aria-DateSegment'
|
|
@@ -398,7 +399,7 @@ export const DateSegment = /*#__PURE__*/ (forwardRef as forwardRefType)(function
|
|
|
398
399
|
});
|
|
399
400
|
|
|
400
401
|
return (
|
|
401
|
-
<span
|
|
402
|
+
<dom.span
|
|
402
403
|
{...mergeProps(filterDOMProps(otherProps, {global: true}), segmentProps, focusProps, hoverProps)}
|
|
403
404
|
{...renderProps}
|
|
404
405
|
style={segmentProps.style}
|
package/src/DatePicker.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {CalendarContext, RangeCalendarContext} from './Calendar';
|
|
|
15
15
|
import {
|
|
16
16
|
ClassNameOrFunction,
|
|
17
17
|
ContextValue,
|
|
18
|
+
dom,
|
|
18
19
|
Provider,
|
|
19
20
|
RACValidation,
|
|
20
21
|
removeDataAttributes,
|
|
@@ -194,7 +195,7 @@ export const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function
|
|
|
194
195
|
}],
|
|
195
196
|
[FieldErrorContext, validation]
|
|
196
197
|
]}>
|
|
197
|
-
<div
|
|
198
|
+
<dom.div
|
|
198
199
|
{...mergeProps(DOMProps, renderProps, focusProps)}
|
|
199
200
|
ref={ref}
|
|
200
201
|
slot={props.slot || undefined}
|
|
@@ -309,7 +310,7 @@ export const DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(func
|
|
|
309
310
|
}],
|
|
310
311
|
[FieldErrorContext, validation]
|
|
311
312
|
]}>
|
|
312
|
-
<div
|
|
313
|
+
<dom.div
|
|
313
314
|
{...mergeProps(DOMProps, renderProps, focusProps)}
|
|
314
315
|
ref={ref}
|
|
315
316
|
slot={props.slot || undefined}
|
package/src/Dialog.tsx
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import {AriaDialogProps, useDialog, useId, useOverlayTrigger} from 'react-aria';
|
|
13
13
|
import {ButtonContext} from './Button';
|
|
14
|
-
import {ContextValue, DEFAULT_SLOT, Provider, SlotProps, StyleProps, useContextProps, useRenderProps} from './utils';
|
|
14
|
+
import {ContextValue, DEFAULT_SLOT, dom, DOMRenderProps, Provider, SlotProps, StyleProps, useContextProps, useRenderProps} from './utils';
|
|
15
15
|
import {filterDOMProps, mergeProps, useResizeObserver} from '@react-aria/utils';
|
|
16
16
|
import {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';
|
|
17
17
|
import {HeadingContext} from './RSPContexts';
|
|
@@ -29,7 +29,7 @@ export interface DialogRenderProps {
|
|
|
29
29
|
close: () => void
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export interface DialogProps extends AriaDialogProps, StyleProps, SlotProps, GlobalDOMAttributes<HTMLElement> {
|
|
32
|
+
export interface DialogProps extends AriaDialogProps, StyleProps, SlotProps, DOMRenderProps<'section', undefined>, GlobalDOMAttributes<HTMLElement> {
|
|
33
33
|
/**
|
|
34
34
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
35
35
|
* @default 'react-aria-Dialog'
|
|
@@ -130,8 +130,9 @@ export const Dialog = /*#__PURE__*/ (forwardRef as forwardRefType)(function Dial
|
|
|
130
130
|
let DOMProps = filterDOMProps(props, {global: true});
|
|
131
131
|
|
|
132
132
|
return (
|
|
133
|
-
<section
|
|
133
|
+
<dom.section
|
|
134
134
|
{...mergeProps(DOMProps, renderProps, dialogProps)}
|
|
135
|
+
render={props.render}
|
|
135
136
|
ref={ref}
|
|
136
137
|
slot={props.slot || undefined}>
|
|
137
138
|
<Provider
|
|
@@ -153,6 +154,6 @@ export const Dialog = /*#__PURE__*/ (forwardRef as forwardRefType)(function Dial
|
|
|
153
154
|
]}>
|
|
154
155
|
{renderProps.children}
|
|
155
156
|
</Provider>
|
|
156
|
-
</section>
|
|
157
|
+
</dom.section>
|
|
157
158
|
);
|
|
158
159
|
});
|
package/src/Disclosure.tsx
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
ClassNameOrFunction,
|
|
17
17
|
ContextValue,
|
|
18
18
|
DEFAULT_SLOT,
|
|
19
|
+
dom,
|
|
19
20
|
Provider,
|
|
20
21
|
RenderProps,
|
|
21
22
|
SlotProps,
|
|
@@ -68,7 +69,7 @@ export const DisclosureGroup = forwardRef(function DisclosureGroup(props: Disclo
|
|
|
68
69
|
let domProps = filterDOMProps(props, {global: true});
|
|
69
70
|
|
|
70
71
|
return (
|
|
71
|
-
<div
|
|
72
|
+
<dom.div
|
|
72
73
|
{...domProps}
|
|
73
74
|
{...renderProps}
|
|
74
75
|
ref={ref}
|
|
@@ -76,7 +77,7 @@ export const DisclosureGroup = forwardRef(function DisclosureGroup(props: Disclo
|
|
|
76
77
|
<DisclosureGroupStateContext.Provider value={state}>
|
|
77
78
|
{renderProps.children}
|
|
78
79
|
</DisclosureGroupStateContext.Provider>
|
|
79
|
-
</div>
|
|
80
|
+
</dom.div>
|
|
80
81
|
);
|
|
81
82
|
});
|
|
82
83
|
|
|
@@ -186,14 +187,14 @@ export const Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(function
|
|
|
186
187
|
[InternalDisclosureContext, {panelProps, panelRef}],
|
|
187
188
|
[DisclosureStateContext, state]
|
|
188
189
|
]}>
|
|
189
|
-
<div
|
|
190
|
+
<dom.div
|
|
190
191
|
{...mergeProps(domProps, renderProps, focusWithinProps)}
|
|
191
192
|
ref={ref}
|
|
192
193
|
data-expanded={state.isExpanded || undefined}
|
|
193
194
|
data-disabled={isDisabled || undefined}
|
|
194
195
|
data-focus-visible-within={isFocusVisibleWithin || undefined}>
|
|
195
196
|
{renderProps.children}
|
|
196
|
-
</div>
|
|
197
|
+
</dom.div>
|
|
197
198
|
</Provider>
|
|
198
199
|
);
|
|
199
200
|
});
|
|
@@ -242,7 +243,7 @@ export const DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(func
|
|
|
242
243
|
});
|
|
243
244
|
let DOMProps = filterDOMProps(props, {global: true, labelable: true});
|
|
244
245
|
return (
|
|
245
|
-
<div
|
|
246
|
+
<dom.div
|
|
246
247
|
{...mergeProps(DOMProps, renderProps, panelProps, focusWithinProps)}
|
|
247
248
|
ref={mergeRefs(ref, panelRef)}
|
|
248
249
|
role={role}
|
|
@@ -253,6 +254,6 @@ export const DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(func
|
|
|
253
254
|
]}>
|
|
254
255
|
{props.children}
|
|
255
256
|
</Provider>
|
|
256
|
-
</div>
|
|
257
|
+
</dom.div>
|
|
257
258
|
);
|
|
258
259
|
});
|
package/src/DropZone.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import {AriaLabelingProps, GlobalDOMAttributes, HoverEvents} from '@react-types/
|
|
|
14
14
|
import {
|
|
15
15
|
ClassNameOrFunction,
|
|
16
16
|
ContextValue,
|
|
17
|
+
dom,
|
|
17
18
|
Provider,
|
|
18
19
|
RenderProps,
|
|
19
20
|
SlotProps,
|
|
@@ -21,7 +22,7 @@ import {
|
|
|
21
22
|
useRenderProps
|
|
22
23
|
} from './utils';
|
|
23
24
|
import {DropOptions, mergeProps, useButton, useClipboard, useDrop, useFocusRing, useHover, useLocalizedStringFormatter, VisuallyHidden} from 'react-aria';
|
|
24
|
-
import {filterDOMProps, isFocusable, useLabels, useObjectRef, useSlotId} from '@react-aria/utils';
|
|
25
|
+
import {filterDOMProps, isFocusable, nodeContains, useLabels, useObjectRef, useSlotId} from '@react-aria/utils';
|
|
25
26
|
// @ts-ignore
|
|
26
27
|
import intlMessages from '../intl/*.json';
|
|
27
28
|
import React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';
|
|
@@ -110,14 +111,13 @@ export const DropZone = forwardRef(function DropZone(props: DropZoneProps, ref:
|
|
|
110
111
|
values={[
|
|
111
112
|
[TextContext, {id: textId, slot: 'label'}]
|
|
112
113
|
]}>
|
|
113
|
-
|
|
114
|
-
<div
|
|
114
|
+
<dom.div
|
|
115
115
|
{...mergeProps(DOMProps, renderProps, dropProps, hoverProps)}
|
|
116
116
|
slot={props.slot || undefined}
|
|
117
117
|
ref={dropzoneRef}
|
|
118
118
|
onClick={(e) => {
|
|
119
119
|
let target = e.target as HTMLElement | null;
|
|
120
|
-
while (target && dropzoneRef.current
|
|
120
|
+
while (target && nodeContains(dropzoneRef.current, target)) {
|
|
121
121
|
if (isFocusable(target)) {
|
|
122
122
|
break;
|
|
123
123
|
} else if (target === dropzoneRef.current) {
|
|
@@ -139,7 +139,7 @@ export const DropZone = forwardRef(function DropZone(props: DropZoneProps, ref:
|
|
|
139
139
|
ref={buttonRef} />
|
|
140
140
|
</VisuallyHidden>
|
|
141
141
|
{renderProps.children}
|
|
142
|
-
</div>
|
|
142
|
+
</dom.div>
|
|
143
143
|
</Provider>
|
|
144
144
|
);
|
|
145
145
|
});
|
package/src/Form.tsx
CHANGED
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {ContextValue, DOMProps, useContextProps} from './utils';
|
|
13
|
+
import {ContextValue, dom, DOMProps, DOMRenderProps, useContextProps} from './utils';
|
|
14
14
|
import {FormValidationContext} from 'react-stately';
|
|
15
15
|
import {GlobalDOMAttributes} from '@react-types/shared';
|
|
16
16
|
import React, {createContext, ForwardedRef, forwardRef} from 'react';
|
|
17
17
|
import {FormProps as SharedFormProps} from '@react-types/form';
|
|
18
18
|
|
|
19
|
-
export interface FormProps extends SharedFormProps, DOMProps, GlobalDOMAttributes<HTMLFormElement> {
|
|
19
|
+
export interface FormProps extends SharedFormProps, DOMProps, DOMRenderProps<'form', undefined>, GlobalDOMAttributes<HTMLFormElement> {
|
|
20
20
|
/**
|
|
21
21
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
22
22
|
* @default 'react-aria-Form'
|
|
@@ -41,12 +41,12 @@ export const Form = forwardRef(function Form(props: FormProps, ref: ForwardedRef
|
|
|
41
41
|
[props, ref] = useContextProps(props, ref, FormContext);
|
|
42
42
|
let {validationErrors, validationBehavior = 'native', children, className, ...domProps} = props;
|
|
43
43
|
return (
|
|
44
|
-
<form noValidate={validationBehavior !== 'native'} {...domProps} ref={ref} className={className || 'react-aria-Form'}>
|
|
44
|
+
<dom.form noValidate={validationBehavior !== 'native'} {...domProps} ref={ref} className={className || 'react-aria-Form'}>
|
|
45
45
|
<FormContext.Provider value={{...props, validationBehavior}}>
|
|
46
46
|
<FormValidationContext.Provider value={validationErrors ?? {}}>
|
|
47
47
|
{children}
|
|
48
48
|
</FormValidationContext.Provider>
|
|
49
49
|
</FormContext.Provider>
|
|
50
|
-
</form>
|
|
50
|
+
</dom.form>
|
|
51
51
|
);
|
|
52
52
|
});
|