react-aria-components 1.14.0 → 1.15.0
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 +122 -63
- 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 +97 -11
package/src/GridList.tsx
CHANGED
|
@@ -16,6 +16,9 @@ import {
|
|
|
16
16
|
ClassNameOrFunction,
|
|
17
17
|
ContextValue,
|
|
18
18
|
DEFAULT_SLOT,
|
|
19
|
+
dom,
|
|
20
|
+
DOMProps,
|
|
21
|
+
DOMRenderProps,
|
|
19
22
|
Provider,
|
|
20
23
|
RenderProps,
|
|
21
24
|
SlotProps,
|
|
@@ -156,7 +159,8 @@ function GridListInner<T extends object>({props, collection, gridListRef: ref}:
|
|
|
156
159
|
// Only tab navigation is supported in grid layout.
|
|
157
160
|
keyboardNavigationBehavior: layout === 'grid' ? 'tab' : keyboardNavigationBehavior,
|
|
158
161
|
isVirtualized,
|
|
159
|
-
shouldSelectOnPressUp: props.shouldSelectOnPressUp
|
|
162
|
+
shouldSelectOnPressUp: props.shouldSelectOnPressUp,
|
|
163
|
+
disallowTypeAhead
|
|
160
164
|
}, filteredState, ref);
|
|
161
165
|
|
|
162
166
|
let selectionManager = filteredState.selectionManager;
|
|
@@ -229,8 +233,8 @@ function GridListInner<T extends object>({props, collection, gridListRef: ref}:
|
|
|
229
233
|
state: filteredState
|
|
230
234
|
};
|
|
231
235
|
let renderProps = useRenderProps({
|
|
232
|
-
|
|
233
|
-
|
|
236
|
+
...props,
|
|
237
|
+
children: undefined,
|
|
234
238
|
defaultClassName: 'react-aria-GridList',
|
|
235
239
|
values: renderValues
|
|
236
240
|
});
|
|
@@ -253,7 +257,7 @@ function GridListInner<T extends object>({props, collection, gridListRef: ref}:
|
|
|
253
257
|
|
|
254
258
|
return (
|
|
255
259
|
<FocusScope>
|
|
256
|
-
<div
|
|
260
|
+
<dom.div
|
|
257
261
|
{...mergeProps(DOMProps, renderProps, gridProps, focusProps, droppableCollection?.collectionProps, emptyStatePropOverrides)}
|
|
258
262
|
ref={ref as RefObject<HTMLDivElement>}
|
|
259
263
|
slot={props.slot || undefined}
|
|
@@ -280,7 +284,7 @@ function GridListInner<T extends object>({props, collection, gridListRef: ref}:
|
|
|
280
284
|
</Provider>
|
|
281
285
|
{emptyState}
|
|
282
286
|
{dragPreview}
|
|
283
|
-
</div>
|
|
287
|
+
</dom.div>
|
|
284
288
|
</FocusScope>
|
|
285
289
|
);
|
|
286
290
|
}
|
|
@@ -400,7 +404,7 @@ export const GridListItem = /*#__PURE__*/ createLeafComponent(ItemNode, function
|
|
|
400
404
|
</div>
|
|
401
405
|
</div>
|
|
402
406
|
}
|
|
403
|
-
<div
|
|
407
|
+
<dom.div
|
|
404
408
|
{...mergeProps(DOMProps, renderProps, rowProps, focusProps, hoverProps, draggableItem?.dragProps)}
|
|
405
409
|
ref={ref}
|
|
406
410
|
data-selected={states.isSelected || undefined}
|
|
@@ -449,7 +453,7 @@ export const GridListItem = /*#__PURE__*/ createLeafComponent(ItemNode, function
|
|
|
449
453
|
{renderProps.children}
|
|
450
454
|
</Provider>
|
|
451
455
|
</div>
|
|
452
|
-
</div>
|
|
456
|
+
</dom.div>
|
|
453
457
|
</>
|
|
454
458
|
);
|
|
455
459
|
});
|
|
@@ -497,7 +501,7 @@ function GridListDropIndicator(props: GridListDropIndicatorProps, ref: Forwarded
|
|
|
497
501
|
});
|
|
498
502
|
|
|
499
503
|
return (
|
|
500
|
-
<div
|
|
504
|
+
<dom.div
|
|
501
505
|
{...renderProps}
|
|
502
506
|
role="row"
|
|
503
507
|
ref={ref as RefObject<HTMLDivElement | null>}
|
|
@@ -506,7 +510,7 @@ function GridListDropIndicator(props: GridListDropIndicatorProps, ref: Forwarded
|
|
|
506
510
|
<div {...visuallyHiddenProps} role="button" {...dropIndicatorProps} ref={buttonRef} />
|
|
507
511
|
{renderProps.children}
|
|
508
512
|
</div>
|
|
509
|
-
</div>
|
|
513
|
+
</dom.div>
|
|
510
514
|
);
|
|
511
515
|
}
|
|
512
516
|
|
|
@@ -534,7 +538,7 @@ function RootDropIndicator() {
|
|
|
534
538
|
);
|
|
535
539
|
}
|
|
536
540
|
|
|
537
|
-
export interface GridListLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
541
|
+
export interface GridListLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, DOMRenderProps<'div', undefined>, GlobalDOMAttributes<HTMLDivElement> {
|
|
538
542
|
/**
|
|
539
543
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
540
544
|
* @default 'react-aria-GridListLoadMoreItem'
|
|
@@ -569,7 +573,7 @@ export const GridListLoadMoreItem = createLeafComponent(LoaderNode, function Gri
|
|
|
569
573
|
id: undefined,
|
|
570
574
|
children: item.rendered,
|
|
571
575
|
defaultClassName: 'react-aria-GridListLoadingIndicator',
|
|
572
|
-
values:
|
|
576
|
+
values: undefined
|
|
573
577
|
});
|
|
574
578
|
// For now don't include aria-posinset and aria-setsize on loader since they aren't keyboard focusable
|
|
575
579
|
// Arguably shouldn't include them ever since it might be confusing to the user to include the loaders as part of the
|
|
@@ -583,7 +587,7 @@ export const GridListLoadMoreItem = createLeafComponent(LoaderNode, function Gri
|
|
|
583
587
|
<div data-testid="loadMoreSentinel" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />
|
|
584
588
|
</div>
|
|
585
589
|
{isLoading && renderProps.children && (
|
|
586
|
-
<div
|
|
590
|
+
<dom.div
|
|
587
591
|
{...renderProps}
|
|
588
592
|
{...filterDOMProps(props, {global: true})}
|
|
589
593
|
role="row"
|
|
@@ -593,13 +597,13 @@ export const GridListLoadMoreItem = createLeafComponent(LoaderNode, function Gri
|
|
|
593
597
|
role="gridcell">
|
|
594
598
|
{renderProps.children}
|
|
595
599
|
</div>
|
|
596
|
-
</div>
|
|
600
|
+
</dom.div>
|
|
597
601
|
)}
|
|
598
602
|
</>
|
|
599
603
|
);
|
|
600
604
|
});
|
|
601
605
|
|
|
602
|
-
export interface GridListSectionProps<T> extends SectionProps<T> {
|
|
606
|
+
export interface GridListSectionProps<T> extends SectionProps<T>, DOMRenderProps<'div', undefined> {
|
|
603
607
|
/**
|
|
604
608
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
605
609
|
* @default 'react-aria-GridListSection'
|
|
@@ -619,17 +623,18 @@ export const GridListSection = /*#__PURE__*/ createBranchComponent(SectionNode,
|
|
|
619
623
|
'aria-label': props['aria-label'] ?? undefined
|
|
620
624
|
}, state, ref);
|
|
621
625
|
let renderProps = useRenderProps({
|
|
626
|
+
...props,
|
|
627
|
+
id: undefined,
|
|
628
|
+
children: undefined,
|
|
622
629
|
defaultClassName: 'react-aria-GridListSection',
|
|
623
|
-
|
|
624
|
-
style: props.style,
|
|
625
|
-
values: {}
|
|
630
|
+
values: undefined
|
|
626
631
|
});
|
|
627
632
|
|
|
628
633
|
let DOMProps = filterDOMProps(props as any, {global: true});
|
|
629
634
|
delete DOMProps.id;
|
|
630
635
|
|
|
631
636
|
return (
|
|
632
|
-
<div
|
|
637
|
+
<dom.div
|
|
633
638
|
{...mergeProps(DOMProps, renderProps, rowGroupProps)}
|
|
634
639
|
ref={ref}>
|
|
635
640
|
<Provider
|
|
@@ -641,22 +646,24 @@ export const GridListSection = /*#__PURE__*/ createBranchComponent(SectionNode,
|
|
|
641
646
|
collection={state.collection}
|
|
642
647
|
parent={item} />
|
|
643
648
|
</Provider>
|
|
644
|
-
</div>
|
|
649
|
+
</dom.div>
|
|
645
650
|
);
|
|
646
651
|
});
|
|
647
652
|
|
|
648
|
-
export
|
|
653
|
+
export interface GridListHeaderProps extends DOMRenderProps<'div', undefined>, DOMProps, GlobalDOMAttributes<HTMLElement> {}
|
|
654
|
+
|
|
655
|
+
export const GridListHeaderContext = createContext<ContextValue<GridListHeaderProps, HTMLDivElement>>({});
|
|
649
656
|
const GridListHeaderInnerContext = createContext<HTMLAttributes<HTMLElement> | null>(null);
|
|
650
657
|
|
|
651
|
-
export const GridListHeader = /*#__PURE__*/ createLeafComponent(HeaderNode, function Header(props:
|
|
658
|
+
export const GridListHeader = /*#__PURE__*/ createLeafComponent(HeaderNode, function Header(props: GridListHeaderProps, ref: ForwardedRef<HTMLDivElement>) {
|
|
652
659
|
[props, ref] = useContextProps(props, ref, GridListHeaderContext);
|
|
653
660
|
let rowHeaderProps = useContext(GridListHeaderInnerContext);
|
|
654
661
|
|
|
655
662
|
return (
|
|
656
|
-
<div className="react-aria-GridListHeader" ref={ref} {...props}>
|
|
663
|
+
<dom.div render={props.render} className="react-aria-GridListHeader" ref={ref} {...props}>
|
|
657
664
|
<div {...rowHeaderProps} style={{display: 'contents'}}>
|
|
658
665
|
{props.children}
|
|
659
666
|
</div>
|
|
660
|
-
</div>
|
|
667
|
+
</dom.div>
|
|
661
668
|
);
|
|
662
669
|
});
|
package/src/Group.tsx
CHANGED
|
@@ -12,12 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
import {AriaLabelingProps, DOMProps, forwardRefType} from '@react-types/shared';
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
ClassNameOrFunction,
|
|
16
|
+
ContextValue,
|
|
17
|
+
dom,
|
|
18
|
+
RenderProps,
|
|
19
|
+
SlotProps,
|
|
20
|
+
useContextProps,
|
|
21
|
+
useRenderProps
|
|
21
22
|
} from './utils';
|
|
22
23
|
import {HoverProps, mergeProps, useFocusRing, useHover} from 'react-aria';
|
|
23
24
|
import React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';
|
|
@@ -50,7 +51,7 @@ export interface GroupRenderProps {
|
|
|
50
51
|
isInvalid: boolean
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
export interface GroupProps extends AriaLabelingProps, Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style' | 'role' | 'slot'>, DOMProps, HoverProps, RenderProps<GroupRenderProps>, SlotProps {
|
|
54
|
+
export interface GroupProps extends AriaLabelingProps, Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style' | 'render' | 'role' | 'slot'>, DOMProps, HoverProps, RenderProps<GroupRenderProps>, SlotProps {
|
|
54
55
|
/**
|
|
55
56
|
* 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.
|
|
56
57
|
* @default 'react-aria-Group'
|
|
@@ -95,7 +96,7 @@ export const Group = /*#__PURE__*/ (forwardRef as forwardRefType)(function Group
|
|
|
95
96
|
});
|
|
96
97
|
|
|
97
98
|
return (
|
|
98
|
-
<div
|
|
99
|
+
<dom.div
|
|
99
100
|
{...mergeProps(otherProps, focusProps, hoverProps)}
|
|
100
101
|
{...renderProps}
|
|
101
102
|
ref={ref}
|
|
@@ -108,6 +109,6 @@ export const Group = /*#__PURE__*/ (forwardRef as forwardRefType)(function Group
|
|
|
108
109
|
data-invalid={isInvalid || undefined}
|
|
109
110
|
data-readonly={isReadOnly || undefined}>
|
|
110
111
|
{renderProps.children}
|
|
111
|
-
</div>
|
|
112
|
+
</dom.div>
|
|
112
113
|
);
|
|
113
114
|
});
|
package/src/Header.tsx
CHANGED
|
@@ -10,17 +10,19 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {ContextValue, useContextProps} from './utils';
|
|
13
|
+
import {ContextValue, dom, DOMRenderProps, useContextProps} from './utils';
|
|
14
14
|
import {createLeafComponent, HeaderNode} from '@react-aria/collections';
|
|
15
15
|
import React, {createContext, ForwardedRef, HTMLAttributes} from 'react';
|
|
16
16
|
|
|
17
|
-
export
|
|
17
|
+
export interface HeaderProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<'header', undefined> {}
|
|
18
18
|
|
|
19
|
-
export const
|
|
19
|
+
export const HeaderContext = createContext<ContextValue<HeaderProps, HTMLElement>>({});
|
|
20
|
+
|
|
21
|
+
export const Header = /*#__PURE__*/ createLeafComponent(HeaderNode, function Header(props: HeaderProps, ref: ForwardedRef<HTMLElement>) {
|
|
20
22
|
[props, ref] = useContextProps(props, ref, HeaderContext);
|
|
21
23
|
return (
|
|
22
|
-
<header className="react-aria-Header" {...props} ref={ref}>
|
|
24
|
+
<dom.header className="react-aria-Header" {...props} ref={ref}>
|
|
23
25
|
{props.children}
|
|
24
|
-
</header>
|
|
26
|
+
</dom.header>
|
|
25
27
|
);
|
|
26
28
|
});
|
package/src/Heading.tsx
CHANGED
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import {dom, DOMRenderProps, useContextProps} from './utils';
|
|
13
14
|
import {HeadingContext} from './RSPContexts';
|
|
14
|
-
import React, {
|
|
15
|
-
import {useContextProps} from './utils';
|
|
15
|
+
import React, {ForwardedRef, forwardRef, HTMLAttributes} from 'react';
|
|
16
16
|
|
|
17
|
-
export interface HeadingProps extends HTMLAttributes<HTMLElement> {
|
|
17
|
+
export interface HeadingProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<'h1', undefined> {
|
|
18
18
|
level?: number
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const Heading = forwardRef(function Heading(props: HeadingProps, ref: ForwardedRef<HTMLHeadingElement>) {
|
|
22
22
|
[props, ref] = useContextProps(props, ref, HeadingContext);
|
|
23
23
|
let {children, level = 3, className, ...domProps} = props;
|
|
24
|
-
let Element = `h${level}`
|
|
24
|
+
let Element = dom[`h${level}`];
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
27
|
<Element {...domProps} ref={ref} className={className ?? 'react-aria-Heading'}>
|
package/src/HiddenDateInput.tsx
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
import {CalendarDate, CalendarDateTime, parseDate, parseDateTime} from '@internationalized/date';
|
|
14
|
+
import {CalendarDate, CalendarDateTime, parseDate, parseDateTime, toCalendarDate, toCalendarDateTime, toLocalTimeZone} from '@internationalized/date';
|
|
15
15
|
import {DateFieldState, DatePickerState, DateSegmentType} from 'react-stately';
|
|
16
16
|
import React, {ReactNode} from 'react';
|
|
17
17
|
import {useVisuallyHidden} from 'react-aria';
|
|
@@ -65,8 +65,15 @@ export function useHiddenDateInput(props: HiddenDateInputProps, state: DateField
|
|
|
65
65
|
} else if (state.granularity === 'hour') {
|
|
66
66
|
inputStep = 3600;
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
let dateValue =
|
|
68
|
+
|
|
69
|
+
let dateValue = '';
|
|
70
|
+
if (state.value) {
|
|
71
|
+
if (state.granularity === 'day') {
|
|
72
|
+
dateValue = toCalendarDate(state.value).toString();
|
|
73
|
+
} else {
|
|
74
|
+
dateValue = toCalendarDateTime('timeZone' in state.value ? toLocalTimeZone(state.value) : state.value).toString();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
70
77
|
|
|
71
78
|
let inputType = state.granularity === 'day' ? 'date' : 'datetime-local';
|
|
72
79
|
|
package/src/Input.tsx
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import {
|
|
14
14
|
ClassNameOrFunction,
|
|
15
15
|
ContextValue,
|
|
16
|
+
dom,
|
|
16
17
|
StyleRenderProps,
|
|
17
18
|
useContextProps,
|
|
18
19
|
useRenderProps
|
|
@@ -49,7 +50,7 @@ export interface InputRenderProps {
|
|
|
49
50
|
isInvalid: boolean
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {
|
|
53
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps, 'input'> {
|
|
53
54
|
/**
|
|
54
55
|
* 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.
|
|
55
56
|
* @default 'react-aria-Input'
|
|
@@ -99,7 +100,7 @@ export const Input = /*#__PURE__*/ createHideableComponent(function Input(props:
|
|
|
99
100
|
});
|
|
100
101
|
|
|
101
102
|
return (
|
|
102
|
-
<input
|
|
103
|
+
<dom.input
|
|
103
104
|
{...mergeProps(filterHoverProps(props), focusProps, hoverProps)}
|
|
104
105
|
{...renderProps}
|
|
105
106
|
ref={ref}
|
package/src/Keyboard.tsx
CHANGED
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {ContextValue, useContextProps} from './utils';
|
|
13
|
+
import {ContextValue, dom, DOMRenderProps, useContextProps} from './utils';
|
|
14
14
|
import React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';
|
|
15
15
|
|
|
16
|
+
export interface KeyboardProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<'kbd', undefined> {}
|
|
17
|
+
|
|
16
18
|
export const KeyboardContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>>({});
|
|
17
19
|
|
|
18
20
|
export const Keyboard = forwardRef(function Keyboard(props: HTMLAttributes<HTMLElement>, ref: ForwardedRef<HTMLElement>) {
|
|
19
21
|
[props, ref] = useContextProps(props, ref, KeyboardContext);
|
|
20
|
-
return <kbd dir="ltr" {...props} ref={ref} />;
|
|
22
|
+
return <dom.kbd dir="ltr" {...props} ref={ref} />;
|
|
21
23
|
});
|
package/src/Label.tsx
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {ContextValue, useContextProps} from './utils';
|
|
13
|
+
import {ContextValue, dom, DOMRenderProps, useContextProps} from './utils';
|
|
14
14
|
import {createHideableComponent} from '@react-aria/collections';
|
|
15
15
|
import React, {createContext, ForwardedRef, LabelHTMLAttributes} from 'react';
|
|
16
16
|
|
|
17
|
-
export interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
17
|
+
export interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement>, DOMRenderProps<'label', undefined> {
|
|
18
18
|
elementType?: string
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -22,7 +22,8 @@ export const LabelContext = createContext<ContextValue<LabelProps, HTMLLabelElem
|
|
|
22
22
|
|
|
23
23
|
export const Label = /*#__PURE__*/ createHideableComponent(function Label(props: LabelProps, ref: ForwardedRef<HTMLLabelElement>) {
|
|
24
24
|
[props, ref] = useContextProps(props, ref, LabelContext);
|
|
25
|
-
let {elementType
|
|
25
|
+
let {elementType = 'label', ...labelProps} = props;
|
|
26
|
+
let ElementType = dom[elementType];
|
|
26
27
|
// @ts-ignore
|
|
27
28
|
return <ElementType className="react-aria-Label" {...labelProps} ref={ref} />;
|
|
28
29
|
});
|
package/src/Link.tsx
CHANGED
|
@@ -12,18 +12,20 @@
|
|
|
12
12
|
|
|
13
13
|
import {AriaLinkOptions, HoverEvents, mergeProps, useFocusRing, useHover, useLink} from 'react-aria';
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
ClassNameOrFunction,
|
|
16
|
+
ContextValue,
|
|
17
|
+
dom,
|
|
18
|
+
PossibleLinkDOMRenderProps,
|
|
19
|
+
RenderProps,
|
|
20
|
+
SlotProps,
|
|
21
|
+
useContextProps,
|
|
22
|
+
useRenderProps
|
|
21
23
|
} from './utils';
|
|
24
|
+
import {DOMProps, forwardRefType, GlobalDOMAttributes} from '@react-types/shared';
|
|
22
25
|
import {filterDOMProps} from '@react-aria/utils';
|
|
23
|
-
import {
|
|
24
|
-
import React, {createContext, ElementType, ForwardedRef, forwardRef} from 'react';
|
|
26
|
+
import React, {createContext, ForwardedRef, forwardRef} from 'react';
|
|
25
27
|
|
|
26
|
-
export interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, HoverEvents, RenderProps<LinkRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLAnchorElement>, 'onClick'> {
|
|
28
|
+
export interface LinkProps extends Omit<AriaLinkOptions, 'elementType'>, HoverEvents, Omit<RenderProps<LinkRenderProps>, 'render'>, PossibleLinkDOMRenderProps<'span', LinkRenderProps>, SlotProps, DOMProps, Omit<GlobalDOMAttributes<HTMLAnchorElement>, 'onClick'> {
|
|
27
29
|
/**
|
|
28
30
|
* 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.
|
|
29
31
|
* @default 'react-aria-Link'
|
|
@@ -73,13 +75,14 @@ export const LinkContext = createContext<ContextValue<LinkProps, HTMLAnchorEleme
|
|
|
73
75
|
export const Link = /*#__PURE__*/ (forwardRef as forwardRefType)(function Link(props: LinkProps, ref: ForwardedRef<HTMLAnchorElement>) {
|
|
74
76
|
[props, ref] = useContextProps(props, ref, LinkContext);
|
|
75
77
|
|
|
76
|
-
let
|
|
77
|
-
let {linkProps, isPressed} = useLink({...props, elementType
|
|
78
|
+
let elementType = props.href && !props.isDisabled ? 'a' : 'span';
|
|
79
|
+
let {linkProps, isPressed} = useLink({...props, elementType}, ref);
|
|
80
|
+
let ElementType = dom[elementType];
|
|
78
81
|
|
|
79
82
|
let {hoverProps, isHovered} = useHover(props);
|
|
80
83
|
let {focusProps, isFocused, isFocusVisible} = useFocusRing();
|
|
81
84
|
|
|
82
|
-
let renderProps = useRenderProps({
|
|
85
|
+
let renderProps = useRenderProps<LinkRenderProps, 'span' | 'a'>({
|
|
83
86
|
...props,
|
|
84
87
|
defaultClassName: 'react-aria-Link',
|
|
85
88
|
values: {
|
package/src/ListBox.tsx
CHANGED
|
@@ -15,6 +15,9 @@ import {
|
|
|
15
15
|
ClassNameOrFunction,
|
|
16
16
|
ContextValue,
|
|
17
17
|
DEFAULT_SLOT,
|
|
18
|
+
dom,
|
|
19
|
+
DOMRenderProps,
|
|
20
|
+
PossibleLinkDOMRenderProps,
|
|
18
21
|
Provider,
|
|
19
22
|
RenderProps,
|
|
20
23
|
SlotProps,
|
|
@@ -231,8 +234,8 @@ function ListBoxInner<T extends object>({state: inputState, props, listBoxRef}:
|
|
|
231
234
|
state
|
|
232
235
|
};
|
|
233
236
|
let renderProps = useRenderProps({
|
|
234
|
-
|
|
235
|
-
|
|
237
|
+
...props,
|
|
238
|
+
children: undefined,
|
|
236
239
|
defaultClassName: 'react-aria-ListBox',
|
|
237
240
|
values: renderValues
|
|
238
241
|
});
|
|
@@ -253,7 +256,7 @@ function ListBoxInner<T extends object>({state: inputState, props, listBoxRef}:
|
|
|
253
256
|
|
|
254
257
|
return (
|
|
255
258
|
<FocusScope>
|
|
256
|
-
<div
|
|
259
|
+
<dom.div
|
|
257
260
|
{...mergeProps(DOMProps, renderProps, listBoxProps, focusProps, droppableCollection?.collectionProps)}
|
|
258
261
|
ref={listBoxRef as RefObject<HTMLDivElement>}
|
|
259
262
|
slot={props.slot || undefined}
|
|
@@ -283,12 +286,12 @@ function ListBoxInner<T extends object>({state: inputState, props, listBoxRef}:
|
|
|
283
286
|
</Provider>
|
|
284
287
|
{emptyState}
|
|
285
288
|
{dragPreview}
|
|
286
|
-
</div>
|
|
289
|
+
</dom.div>
|
|
287
290
|
</FocusScope>
|
|
288
291
|
);
|
|
289
292
|
}
|
|
290
293
|
|
|
291
|
-
export interface ListBoxSectionProps<T> extends SectionProps<T> {
|
|
294
|
+
export interface ListBoxSectionProps<T> extends SectionProps<T>, DOMRenderProps<'section', undefined> {
|
|
292
295
|
/**
|
|
293
296
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
294
297
|
* @default 'react-aria-ListBoxSection'
|
|
@@ -306,17 +309,18 @@ function ListBoxSectionInner<T extends object>(props: ListBoxSectionProps<T>, re
|
|
|
306
309
|
'aria-label': props['aria-label'] ?? undefined
|
|
307
310
|
});
|
|
308
311
|
let renderProps = useRenderProps({
|
|
312
|
+
...props,
|
|
313
|
+
id: undefined,
|
|
314
|
+
children: undefined,
|
|
309
315
|
defaultClassName: className,
|
|
310
|
-
|
|
311
|
-
style: props.style,
|
|
312
|
-
values: {}
|
|
316
|
+
values: undefined
|
|
313
317
|
});
|
|
314
318
|
|
|
315
319
|
let DOMProps = filterDOMProps(props as any, {global: true});
|
|
316
320
|
delete DOMProps.id;
|
|
317
321
|
|
|
318
322
|
return (
|
|
319
|
-
<section
|
|
323
|
+
<dom.section
|
|
320
324
|
{...mergeProps(DOMProps, renderProps, groupProps)}
|
|
321
325
|
ref={ref}>
|
|
322
326
|
<HeaderContext.Provider value={{...headingProps, ref: headingRef}}>
|
|
@@ -325,7 +329,7 @@ function ListBoxSectionInner<T extends object>(props: ListBoxSectionProps<T>, re
|
|
|
325
329
|
parent={section}
|
|
326
330
|
renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />
|
|
327
331
|
</HeaderContext.Provider>
|
|
328
|
-
</section>
|
|
332
|
+
</dom.section>
|
|
329
333
|
);
|
|
330
334
|
}
|
|
331
335
|
|
|
@@ -336,7 +340,7 @@ export const ListBoxSection = /*#__PURE__*/ createBranchComponent(SectionNode, L
|
|
|
336
340
|
|
|
337
341
|
export interface ListBoxItemRenderProps extends ItemRenderProps {}
|
|
338
342
|
|
|
339
|
-
export interface ListBoxItemProps<T = object> extends RenderProps<ListBoxItemRenderProps>, LinkDOMProps, HoverEvents, PressEvents, FocusEvents<HTMLDivElement>, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {
|
|
343
|
+
export interface ListBoxItemProps<T = object> extends Omit<RenderProps<ListBoxItemRenderProps>, 'render'>, PossibleLinkDOMRenderProps<'div', ListBoxItemRenderProps>, LinkDOMProps, HoverEvents, PressEvents, FocusEvents<HTMLDivElement>, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {
|
|
340
344
|
/**
|
|
341
345
|
* 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.
|
|
342
346
|
* @default 'react-aria-ListBoxItem'
|
|
@@ -394,7 +398,7 @@ export const ListBoxItem = /*#__PURE__*/ createLeafComponent(ItemNode, function
|
|
|
394
398
|
}
|
|
395
399
|
|
|
396
400
|
let isDragging = dragState && dragState.isDragging(item.key);
|
|
397
|
-
let renderProps = useRenderProps({
|
|
401
|
+
let renderProps = useRenderProps<ListBoxItemRenderProps, any>({
|
|
398
402
|
...props,
|
|
399
403
|
id: undefined,
|
|
400
404
|
children: props.children,
|
|
@@ -416,13 +420,12 @@ export const ListBoxItem = /*#__PURE__*/ createLeafComponent(ItemNode, function
|
|
|
416
420
|
}
|
|
417
421
|
}, [item.textValue]);
|
|
418
422
|
|
|
419
|
-
let ElementType
|
|
420
|
-
|
|
423
|
+
let ElementType = props.href ? dom.a : dom.div;
|
|
421
424
|
let DOMProps = filterDOMProps(props as any, {global: true});
|
|
422
425
|
delete DOMProps.id;
|
|
423
426
|
delete DOMProps.onClick;
|
|
424
427
|
|
|
425
|
-
if (
|
|
428
|
+
if (props.href && optionProps.tabIndex == null) {
|
|
426
429
|
optionProps.tabIndex = -1;
|
|
427
430
|
}
|
|
428
431
|
|
|
@@ -496,10 +499,9 @@ function ListBoxDropIndicator(props: ListBoxDropIndicatorProps, ref: ForwardedRe
|
|
|
496
499
|
});
|
|
497
500
|
|
|
498
501
|
return (
|
|
499
|
-
<div
|
|
502
|
+
<dom.div
|
|
500
503
|
{...dropIndicatorProps}
|
|
501
504
|
{...renderProps}
|
|
502
|
-
// eslint-disable-next-line
|
|
503
505
|
role="option"
|
|
504
506
|
ref={ref as RefObject<HTMLDivElement | null>}
|
|
505
507
|
data-drop-target={isDropTarget || undefined} />
|
|
@@ -508,7 +510,7 @@ function ListBoxDropIndicator(props: ListBoxDropIndicatorProps, ref: ForwardedRe
|
|
|
508
510
|
|
|
509
511
|
const ListBoxDropIndicatorForwardRef = forwardRef(ListBoxDropIndicator);
|
|
510
512
|
|
|
511
|
-
export interface ListBoxLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
513
|
+
export interface ListBoxLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, DOMRenderProps<'div', undefined>, GlobalDOMAttributes<HTMLDivElement> {
|
|
512
514
|
/**
|
|
513
515
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
514
516
|
* @default 'react-aria-ListBoxLoadMoreItem'
|
|
@@ -541,7 +543,7 @@ export const ListBoxLoadMoreItem = createLeafComponent(LoaderNode, function List
|
|
|
541
543
|
id: undefined,
|
|
542
544
|
children: item.rendered,
|
|
543
545
|
defaultClassName: 'react-aria-ListBoxLoadingIndicator',
|
|
544
|
-
values:
|
|
546
|
+
values: undefined
|
|
545
547
|
});
|
|
546
548
|
|
|
547
549
|
let optionProps = {
|
|
@@ -560,15 +562,14 @@ export const ListBoxLoadMoreItem = createLeafComponent(LoaderNode, function List
|
|
|
560
562
|
<div data-testid="loadMoreSentinel" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />
|
|
561
563
|
</div>
|
|
562
564
|
{isLoading && renderProps.children && (
|
|
563
|
-
<div
|
|
565
|
+
<dom.div
|
|
564
566
|
{...mergeProps(filterDOMProps(props, {global: true}), optionProps)}
|
|
565
567
|
{...renderProps}
|
|
566
568
|
// aria-selected isn't needed here since this option is not selectable.
|
|
567
|
-
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
|
|
568
569
|
role="option"
|
|
569
570
|
ref={ref as ForwardedRef<HTMLDivElement>}>
|
|
570
571
|
{renderProps.children}
|
|
571
|
-
</div>
|
|
572
|
+
</dom.div>
|
|
572
573
|
)}
|
|
573
574
|
</>
|
|
574
575
|
);
|