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/dist/utils.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {useObjectRef as $iETbY$useObjectRef, mergeRefs as $iETbY$mergeRefs, mergeProps as $iETbY$mergeProps, useLayoutEffect as $iETbY$useLayoutEffect} from "@react-aria/utils";
|
|
2
|
-
import $iETbY$react, {useMemo as $iETbY$useMemo, useContext as $iETbY$useContext, useState as $iETbY$useState, useRef as $iETbY$useRef, useCallback as $iETbY$useCallback} from "react";
|
|
2
|
+
import $iETbY$react, {useMemo as $iETbY$useMemo, useContext as $iETbY$useContext, useState as $iETbY$useState, useRef as $iETbY$useRef, useCallback as $iETbY$useCallback, forwardRef as $iETbY$forwardRef} from "react";
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -22,7 +22,7 @@ function $64fa3d84918910a7$export$2881499e37b75b9a({ values: values, children: c
|
|
|
22
22
|
return children;
|
|
23
23
|
}
|
|
24
24
|
function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
|
|
25
|
-
let { className: className, style: style, children: children, defaultClassName: defaultClassName, defaultChildren: defaultChildren, defaultStyle: defaultStyle, values: values } = props;
|
|
25
|
+
let { className: className, style: style, children: children, defaultClassName: defaultClassName, defaultChildren: defaultChildren, defaultStyle: defaultStyle, values: values, render: render } = props;
|
|
26
26
|
return (0, $iETbY$useMemo)(()=>{
|
|
27
27
|
let computedClassName;
|
|
28
28
|
let computedStyle;
|
|
@@ -50,7 +50,8 @@ function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
|
|
|
50
50
|
...computedStyle
|
|
51
51
|
} : undefined,
|
|
52
52
|
children: computedChildren !== null && computedChildren !== void 0 ? computedChildren : defaultChildren,
|
|
53
|
-
'data-rac': ''
|
|
53
|
+
'data-rac': '',
|
|
54
|
+
render: render ? (props)=>render(props, values) : undefined
|
|
54
55
|
};
|
|
55
56
|
}, [
|
|
56
57
|
className,
|
|
@@ -59,7 +60,8 @@ function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
|
|
|
59
60
|
defaultClassName,
|
|
60
61
|
defaultChildren,
|
|
61
62
|
defaultStyle,
|
|
62
|
-
values
|
|
63
|
+
values,
|
|
64
|
+
render
|
|
63
65
|
]);
|
|
64
66
|
}
|
|
65
67
|
function $64fa3d84918910a7$export$c245e6201fed2f75(// https://stackoverflow.com/questions/60898079/typescript-type-t-or-function-t-usage
|
|
@@ -145,7 +147,42 @@ function $64fa3d84918910a7$export$ef03459518577ad4(props) {
|
|
|
145
147
|
for(const prop in props)if (!prefix.test(prop)) filteredProps[prop] = props[prop];
|
|
146
148
|
return filteredProps;
|
|
147
149
|
}
|
|
150
|
+
function $64fa3d84918910a7$var$DOMElement(ElementType, props, forwardedRef) {
|
|
151
|
+
let { render: render, ...otherProps } = props;
|
|
152
|
+
let elementRef = (0, $iETbY$useRef)(null);
|
|
153
|
+
let ref = (0, $iETbY$useMemo)(()=>(0, $iETbY$mergeRefs)(forwardedRef, elementRef), [
|
|
154
|
+
forwardedRef,
|
|
155
|
+
elementRef
|
|
156
|
+
]);
|
|
157
|
+
(0, $iETbY$useLayoutEffect)(()=>{
|
|
158
|
+
if (process.env.NODE_ENV !== 'production' && render) {
|
|
159
|
+
if (!elementRef.current) console.warn('Ref was not connected to DOM element returned by custom `render` function. Did you forget to pass through or merge the `ref`?');
|
|
160
|
+
else if (elementRef.current.localName !== ElementType) console.warn(`Unexpected DOM element returned by custom \`render\` function. Expected <${ElementType}>, got <${elementRef.current.localName}>. This may break the component behavior and accessibility.`);
|
|
161
|
+
}
|
|
162
|
+
}, [
|
|
163
|
+
ElementType,
|
|
164
|
+
render
|
|
165
|
+
]);
|
|
166
|
+
let domProps = {
|
|
167
|
+
...otherProps,
|
|
168
|
+
ref: ref
|
|
169
|
+
};
|
|
170
|
+
if (render) return render(domProps, undefined);
|
|
171
|
+
return /*#__PURE__*/ (0, $iETbY$react).createElement(ElementType, domProps);
|
|
172
|
+
}
|
|
173
|
+
const $64fa3d84918910a7$var$domComponentCache = {};
|
|
174
|
+
const $64fa3d84918910a7$export$df3a06d6289f983e = new Proxy({}, {
|
|
175
|
+
get (target, elementType) {
|
|
176
|
+
if (typeof elementType !== 'string') return undefined;
|
|
177
|
+
let res = $64fa3d84918910a7$var$domComponentCache[elementType];
|
|
178
|
+
if (!res) {
|
|
179
|
+
res = /*#__PURE__*/ (0, $iETbY$forwardRef)($64fa3d84918910a7$var$DOMElement.bind(null, elementType));
|
|
180
|
+
$64fa3d84918910a7$var$domComponentCache[elementType] = res;
|
|
181
|
+
}
|
|
182
|
+
return res;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
148
185
|
|
|
149
186
|
|
|
150
|
-
export {$64fa3d84918910a7$export$c62b8e45d58ddad9 as DEFAULT_SLOT, $64fa3d84918910a7$export$2881499e37b75b9a as Provider, $64fa3d84918910a7$export$4d86445c2cf5e3 as useRenderProps, $64fa3d84918910a7$export$c245e6201fed2f75 as composeRenderProps, $64fa3d84918910a7$export$fabf2dc03a41866e as useSlottedContext, $64fa3d84918910a7$export$29f1550f4b0d4415 as useContextProps, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 as useSlot, $64fa3d84918910a7$export$ef03459518577ad4 as removeDataAttributes};
|
|
187
|
+
export {$64fa3d84918910a7$export$c62b8e45d58ddad9 as DEFAULT_SLOT, $64fa3d84918910a7$export$2881499e37b75b9a as Provider, $64fa3d84918910a7$export$4d86445c2cf5e3 as useRenderProps, $64fa3d84918910a7$export$c245e6201fed2f75 as composeRenderProps, $64fa3d84918910a7$export$fabf2dc03a41866e as useSlottedContext, $64fa3d84918910a7$export$29f1550f4b0d4415 as useContextProps, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 as useSlot, $64fa3d84918910a7$export$ef03459518577ad4 as removeDataAttributes, $64fa3d84918910a7$export$df3a06d6289f983e as dom};
|
|
151
188
|
//# sourceMappingURL=utils.module.js.map
|
package/dist/utils.module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {useObjectRef as $iETbY$useObjectRef, mergeRefs as $iETbY$mergeRefs, mergeProps as $iETbY$mergeProps, useLayoutEffect as $iETbY$useLayoutEffect} from "@react-aria/utils";
|
|
2
|
-
import $iETbY$react, {useMemo as $iETbY$useMemo, useContext as $iETbY$useContext, useState as $iETbY$useState, useRef as $iETbY$useRef, useCallback as $iETbY$useCallback} from "react";
|
|
2
|
+
import $iETbY$react, {useMemo as $iETbY$useMemo, useContext as $iETbY$useContext, useState as $iETbY$useState, useRef as $iETbY$useRef, useCallback as $iETbY$useCallback, forwardRef as $iETbY$forwardRef} from "react";
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -22,7 +22,7 @@ function $64fa3d84918910a7$export$2881499e37b75b9a({ values: values, children: c
|
|
|
22
22
|
return children;
|
|
23
23
|
}
|
|
24
24
|
function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
|
|
25
|
-
let { className: className, style: style, children: children, defaultClassName: defaultClassName, defaultChildren: defaultChildren, defaultStyle: defaultStyle, values: values } = props;
|
|
25
|
+
let { className: className, style: style, children: children, defaultClassName: defaultClassName, defaultChildren: defaultChildren, defaultStyle: defaultStyle, values: values, render: render } = props;
|
|
26
26
|
return (0, $iETbY$useMemo)(()=>{
|
|
27
27
|
let computedClassName;
|
|
28
28
|
let computedStyle;
|
|
@@ -50,7 +50,8 @@ function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
|
|
|
50
50
|
...computedStyle
|
|
51
51
|
} : undefined,
|
|
52
52
|
children: computedChildren !== null && computedChildren !== void 0 ? computedChildren : defaultChildren,
|
|
53
|
-
'data-rac': ''
|
|
53
|
+
'data-rac': '',
|
|
54
|
+
render: render ? (props)=>render(props, values) : undefined
|
|
54
55
|
};
|
|
55
56
|
}, [
|
|
56
57
|
className,
|
|
@@ -59,7 +60,8 @@ function $64fa3d84918910a7$export$4d86445c2cf5e3(props) {
|
|
|
59
60
|
defaultClassName,
|
|
60
61
|
defaultChildren,
|
|
61
62
|
defaultStyle,
|
|
62
|
-
values
|
|
63
|
+
values,
|
|
64
|
+
render
|
|
63
65
|
]);
|
|
64
66
|
}
|
|
65
67
|
function $64fa3d84918910a7$export$c245e6201fed2f75(// https://stackoverflow.com/questions/60898079/typescript-type-t-or-function-t-usage
|
|
@@ -145,7 +147,42 @@ function $64fa3d84918910a7$export$ef03459518577ad4(props) {
|
|
|
145
147
|
for(const prop in props)if (!prefix.test(prop)) filteredProps[prop] = props[prop];
|
|
146
148
|
return filteredProps;
|
|
147
149
|
}
|
|
150
|
+
function $64fa3d84918910a7$var$DOMElement(ElementType, props, forwardedRef) {
|
|
151
|
+
let { render: render, ...otherProps } = props;
|
|
152
|
+
let elementRef = (0, $iETbY$useRef)(null);
|
|
153
|
+
let ref = (0, $iETbY$useMemo)(()=>(0, $iETbY$mergeRefs)(forwardedRef, elementRef), [
|
|
154
|
+
forwardedRef,
|
|
155
|
+
elementRef
|
|
156
|
+
]);
|
|
157
|
+
(0, $iETbY$useLayoutEffect)(()=>{
|
|
158
|
+
if (process.env.NODE_ENV !== 'production' && render) {
|
|
159
|
+
if (!elementRef.current) console.warn('Ref was not connected to DOM element returned by custom `render` function. Did you forget to pass through or merge the `ref`?');
|
|
160
|
+
else if (elementRef.current.localName !== ElementType) console.warn(`Unexpected DOM element returned by custom \`render\` function. Expected <${ElementType}>, got <${elementRef.current.localName}>. This may break the component behavior and accessibility.`);
|
|
161
|
+
}
|
|
162
|
+
}, [
|
|
163
|
+
ElementType,
|
|
164
|
+
render
|
|
165
|
+
]);
|
|
166
|
+
let domProps = {
|
|
167
|
+
...otherProps,
|
|
168
|
+
ref: ref
|
|
169
|
+
};
|
|
170
|
+
if (render) return render(domProps, undefined);
|
|
171
|
+
return /*#__PURE__*/ (0, $iETbY$react).createElement(ElementType, domProps);
|
|
172
|
+
}
|
|
173
|
+
const $64fa3d84918910a7$var$domComponentCache = {};
|
|
174
|
+
const $64fa3d84918910a7$export$df3a06d6289f983e = new Proxy({}, {
|
|
175
|
+
get (target, elementType) {
|
|
176
|
+
if (typeof elementType !== 'string') return undefined;
|
|
177
|
+
let res = $64fa3d84918910a7$var$domComponentCache[elementType];
|
|
178
|
+
if (!res) {
|
|
179
|
+
res = /*#__PURE__*/ (0, $iETbY$forwardRef)($64fa3d84918910a7$var$DOMElement.bind(null, elementType));
|
|
180
|
+
$64fa3d84918910a7$var$domComponentCache[elementType] = res;
|
|
181
|
+
}
|
|
182
|
+
return res;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
148
185
|
|
|
149
186
|
|
|
150
|
-
export {$64fa3d84918910a7$export$c62b8e45d58ddad9 as DEFAULT_SLOT, $64fa3d84918910a7$export$2881499e37b75b9a as Provider, $64fa3d84918910a7$export$4d86445c2cf5e3 as useRenderProps, $64fa3d84918910a7$export$c245e6201fed2f75 as composeRenderProps, $64fa3d84918910a7$export$fabf2dc03a41866e as useSlottedContext, $64fa3d84918910a7$export$29f1550f4b0d4415 as useContextProps, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 as useSlot, $64fa3d84918910a7$export$ef03459518577ad4 as removeDataAttributes};
|
|
187
|
+
export {$64fa3d84918910a7$export$c62b8e45d58ddad9 as DEFAULT_SLOT, $64fa3d84918910a7$export$2881499e37b75b9a as Provider, $64fa3d84918910a7$export$4d86445c2cf5e3 as useRenderProps, $64fa3d84918910a7$export$c245e6201fed2f75 as composeRenderProps, $64fa3d84918910a7$export$fabf2dc03a41866e as useSlottedContext, $64fa3d84918910a7$export$29f1550f4b0d4415 as useContextProps, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8 as useSlot, $64fa3d84918910a7$export$ef03459518577ad4 as removeDataAttributes, $64fa3d84918910a7$export$df3a06d6289f983e as dom};
|
|
151
188
|
//# sourceMappingURL=utils.module.js.map
|
package/dist/utils.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"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","sources":["packages/react-aria-components/src/utils.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, RefObject, DOMProps as SharedDOMProps} from '@react-types/shared';\nimport {mergeProps, mergeRefs, useLayoutEffect, useObjectRef} from '@react-aria/utils';\nimport React, {Context, CSSProperties, ForwardedRef, JSX, ReactNode, RefCallback, useCallback, useContext, useMemo, useRef, useState} from 'react';\n\nexport const DEFAULT_SLOT = Symbol('default');\n\ninterface SlottedValue<T> {\n slots?: Record<string | symbol, T>\n}\n\nexport type SlottedContextValue<T> = SlottedValue<T> | T | null | undefined;\nexport type ContextValue<T, E> = SlottedContextValue<WithRef<T, E>>;\n\ntype ProviderValue<T> = [Context<T>, T];\ntype ProviderValues<A, B, C, D, E, F, G, H, I, J, K> =\n | [ProviderValue<A>]\n | [ProviderValue<A>, ProviderValue<B>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>, ProviderValue<K>];\n\ninterface ProviderProps<A, B, C, D, E, F, G, H, I, J, K> {\n values: ProviderValues<A, B, C, D, E, F, G, H, I, J, K>,\n children: ReactNode\n}\n\nexport function Provider<A, B, C, D, E, F, G, H, I, J, K>({values, children}: ProviderProps<A, B, C, D, E, F, G, H, I, J, K>): JSX.Element {\n for (let [Context, value] of values) {\n // @ts-ignore\n children = <Context.Provider value={value}>{children}</Context.Provider>;\n }\n\n return children as JSX.Element;\n}\n\nexport interface StyleProps {\n /** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. */\n className?: string,\n /** The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. */\n style?: CSSProperties\n}\n\nexport interface DOMProps extends StyleProps, SharedDOMProps {\n /** The children of the component. */\n children?: ReactNode\n}\n\nexport type ClassNameOrFunction<T> = string | ((values: T & {defaultClassName: string | undefined}) => string);\ntype StyleOrFunction<T> = CSSProperties | ((values: T & {defaultStyle: CSSProperties}) => CSSProperties | undefined);\n\nexport interface StyleRenderProps<T> {\n /** 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. */\n className?: ClassNameOrFunction<T>,\n /** The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state. */\n style?: StyleOrFunction<T>\n}\n\nexport type ChildrenOrFunction<T> = ReactNode | ((values: T & {defaultChildren: ReactNode | undefined}) => ReactNode);\n\nexport interface RenderProps<T> extends StyleRenderProps<T> {\n /** The children of the component. A function may be provided to alter the children based on component state. */\n children?: ChildrenOrFunction<T>\n}\n\ninterface RenderPropsHookOptions<T> extends RenderProps<T>, SharedDOMProps, AriaLabelingProps {\n values: T,\n defaultChildren?: ReactNode,\n defaultClassName?: string,\n defaultStyle?: CSSProperties\n}\n\ninterface RenderPropsHookRetVal {\n className?: string,\n style?: CSSProperties,\n children?: ReactNode,\n 'data-rac': string\n}\n\nexport function useRenderProps<T>(props: RenderPropsHookOptions<T>): RenderPropsHookRetVal {\n let {\n className,\n style,\n children,\n defaultClassName = undefined,\n defaultChildren = undefined,\n defaultStyle,\n values\n } = props;\n\n return useMemo(() => {\n let computedClassName: string | undefined;\n let computedStyle: React.CSSProperties | undefined;\n let computedChildren: React.ReactNode | undefined;\n\n if (typeof className === 'function') {\n computedClassName = className({...values, defaultClassName});\n } else {\n computedClassName = className;\n }\n\n if (typeof style === 'function') {\n computedStyle = style({...values, defaultStyle: defaultStyle || {}});\n } else {\n computedStyle = style;\n }\n\n if (typeof children === 'function') {\n computedChildren = children({...values, defaultChildren});\n } else if (children == null) {\n computedChildren = defaultChildren;\n } else {\n computedChildren = children;\n }\n\n return {\n className: computedClassName ?? defaultClassName,\n style: (computedStyle || defaultStyle) ? {...defaultStyle, ...computedStyle} : undefined,\n children: computedChildren ?? defaultChildren,\n 'data-rac': ''\n };\n }, [className, style, children, defaultClassName, defaultChildren, defaultStyle, values]);\n}\n\n/**\n * A helper function that accepts a user-provided render prop value (either a static value or a function),\n * and combines it with another value to create a final result.\n */\nexport function composeRenderProps<T, U, V extends T>(\n // https://stackoverflow.com/questions/60898079/typescript-type-t-or-function-t-usage\n value: T extends any ? (T | ((renderProps: U) => V)) : never,\n wrap: (prevValue: T, renderProps: U) => V\n): (renderProps: U) => V {\n return (renderProps) => wrap(typeof value === 'function' ? value(renderProps) : value, renderProps);\n}\n\nexport type WithRef<T, E> = T & {ref?: ForwardedRef<E>};\nexport interface SlotProps {\n /**\n * A slot name for the component. Slots allow the component to receive props from a parent component.\n * An explicit `null` value indicates that the local props completely override all props received from a parent.\n */\n slot?: string | null\n}\n\nexport function useSlottedContext<T>(context: Context<SlottedContextValue<T>>, slot?: string | null): T | null | undefined {\n let ctx = useContext(context);\n if (slot === null) {\n // An explicit `null` slot means don't use context.\n return null;\n }\n if (ctx && typeof ctx === 'object' && 'slots' in ctx && ctx.slots) {\n let slotKey = slot || DEFAULT_SLOT;\n if (!ctx.slots[slotKey]) {\n let availableSlots = new Intl.ListFormat().format(Object.keys(ctx.slots).map(p => `\"${p}\"`));\n let errorMessage = slot ? `Invalid slot \"${slot}\".` : 'A slot prop is required.';\n\n throw new Error(`${errorMessage} Valid slot names are ${availableSlots}.`);\n }\n return ctx.slots[slotKey];\n }\n // @ts-ignore\n return ctx;\n}\n\nexport function useContextProps<T, U extends SlotProps, E extends Element>(props: T & SlotProps, ref: ForwardedRef<E> | undefined, context: Context<ContextValue<U, E>>): [T, RefObject<E | null>] {\n let ctx = useSlottedContext(context, props.slot) || {};\n let {ref: contextRef, ...contextProps} = ctx as any;\n let mergedRef = useObjectRef(useMemo(() => mergeRefs(ref, contextRef), [ref, contextRef]));\n let mergedProps = mergeProps(contextProps, props) as unknown as T;\n\n // mergeProps does not merge `style`. Adding this there might be a breaking change.\n if (\n 'style' in contextProps &&\n contextProps.style &&\n 'style' in props &&\n props.style\n ) {\n if (typeof contextProps.style === 'function' || typeof props.style === 'function') {\n // @ts-ignore\n mergedProps.style = (renderProps) => {\n let contextStyle = typeof contextProps.style === 'function' ? contextProps.style(renderProps) : contextProps.style;\n let defaultStyle = {...renderProps.defaultStyle, ...contextStyle};\n let style = typeof props.style === 'function'\n ? props.style({...renderProps, defaultStyle})\n : props.style;\n return {...defaultStyle, ...style};\n };\n } else {\n // @ts-ignore\n mergedProps.style = {...contextProps.style, ...props.style};\n }\n }\n\n return [mergedProps, mergedRef];\n}\n\nexport function useSlot(initialState: boolean | (() => boolean) = true): [RefCallback<Element>, boolean] {\n // Initial state is typically based on the parent having an aria-label or aria-labelledby.\n // If it does, this value should be false so that we don't update the state and cause a rerender when we go through the layoutEffect\n let [hasSlot, setHasSlot] = useState(initialState);\n let hasRun = useRef(false);\n\n // A callback ref which will run when the slotted element mounts.\n // This should happen before the useLayoutEffect below.\n let ref = useCallback(el => {\n hasRun.current = true;\n setHasSlot(!!el);\n }, []);\n\n // If the callback hasn't been called, then reset to false.\n useLayoutEffect(() => {\n if (!hasRun.current) {\n setHasSlot(false);\n }\n }, []);\n\n return [ref, hasSlot];\n}\n\n/**\n * Filters out `data-*` attributes to keep them from being passed down and duplicated.\n * @param props\n */\nexport function removeDataAttributes<T>(props: T): T {\n const prefix = /^(data-.*)$/;\n let filteredProps = {} as T;\n\n for (const prop in props) {\n if (!prefix.test(prop)) {\n filteredProps[prop] = props[prop];\n }\n }\n\n return filteredProps;\n}\n\n// Override base type to change the default.\nexport interface RACValidation {\n /**\n * Whether to use native HTML form validation to prevent form submission\n * when the value is missing or invalid, or mark the field as required\n * or invalid via ARIA.\n * @default 'native'\n */\n validationBehavior?: 'native' | 'aria'\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
|
|
1
|
+
{"mappings":"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","sources":["packages/react-aria-components/src/utils.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, RefObject, DOMProps as SharedDOMProps} from '@react-types/shared';\nimport {mergeProps, mergeRefs, useLayoutEffect, useObjectRef} from '@react-aria/utils';\nimport React, {AllHTMLAttributes, AnchorHTMLAttributes, Context, CSSProperties, DetailedHTMLProps, ForwardedRef, forwardRef, JSX, ReactElement, ReactNode, RefCallback, useCallback, useContext, useMemo, useRef, useState} from 'react';\n\nexport const DEFAULT_SLOT = Symbol('default');\n\ninterface SlottedValue<T> {\n slots?: Record<string | symbol, T>\n}\n\nexport type SlottedContextValue<T> = SlottedValue<T> | T | null | undefined;\nexport type ContextValue<T, E> = SlottedContextValue<WithRef<T, E>>;\n\ntype ProviderValue<T> = [Context<T>, T];\ntype ProviderValues<A, B, C, D, E, F, G, H, I, J, K> =\n | [ProviderValue<A>]\n | [ProviderValue<A>, ProviderValue<B>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>]\n | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>, ProviderValue<K>];\n\ninterface ProviderProps<A, B, C, D, E, F, G, H, I, J, K> {\n values: ProviderValues<A, B, C, D, E, F, G, H, I, J, K>,\n children: ReactNode\n}\n\nexport function Provider<A, B, C, D, E, F, G, H, I, J, K>({values, children}: ProviderProps<A, B, C, D, E, F, G, H, I, J, K>): JSX.Element {\n for (let [Context, value] of values) {\n // @ts-ignore\n children = <Context.Provider value={value}>{children}</Context.Provider>;\n }\n\n return children as JSX.Element;\n}\n\nexport interface StyleProps {\n /** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. */\n className?: string,\n /** The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. */\n style?: CSSProperties\n}\n\nexport interface DOMProps extends StyleProps, SharedDOMProps {\n /** The children of the component. */\n children?: ReactNode\n}\n\nexport type ClassNameOrFunction<T> = string | ((values: T & {defaultClassName: string | undefined}) => string);\ntype StyleOrFunction<T> = CSSProperties | ((values: T & {defaultStyle: CSSProperties}) => CSSProperties | undefined);\n\nexport interface StyleRenderProps<T, E extends keyof React.JSX.IntrinsicElements = 'div'> extends DOMRenderProps<E, T> {\n /** 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. */\n className?: ClassNameOrFunction<T>,\n /** The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state. */\n style?: StyleOrFunction<T>\n}\n\nexport type ChildrenOrFunction<T> = ReactNode | ((values: T & {defaultChildren: ReactNode | undefined}) => ReactNode);\n\nexport interface RenderProps<T, E extends keyof React.JSX.IntrinsicElements = 'div'> extends StyleRenderProps<T, E> {\n /** The children of the component. A function may be provided to alter the children based on component state. */\n children?: ChildrenOrFunction<T>\n}\n\ninterface RenderPropsHookOptions<T, E extends keyof React.JSX.IntrinsicElements> extends RenderProps<T, E>, SharedDOMProps, AriaLabelingProps {\n values: T,\n defaultChildren?: ReactNode,\n defaultClassName?: string,\n defaultStyle?: CSSProperties\n}\n\ninterface RenderPropsHookRetVal<T, E extends keyof React.JSX.IntrinsicElements> {\n className?: string,\n style?: CSSProperties,\n children?: ReactNode,\n 'data-rac': string,\n render?: DOMRenderFunction<E, T>\n}\n\nexport function useRenderProps<T, E extends keyof React.JSX.IntrinsicElements>(props: RenderPropsHookOptions<T, E>): RenderPropsHookRetVal<T, E> {\n let {\n className,\n style,\n children,\n defaultClassName = undefined,\n defaultChildren = undefined,\n defaultStyle,\n values,\n render\n } = props;\n\n return useMemo(() => {\n let computedClassName: string | undefined;\n let computedStyle: React.CSSProperties | undefined;\n let computedChildren: React.ReactNode | undefined;\n\n if (typeof className === 'function') {\n computedClassName = className({...values, defaultClassName});\n } else {\n computedClassName = className;\n }\n\n if (typeof style === 'function') {\n computedStyle = style({...values, defaultStyle: defaultStyle || {}});\n } else {\n computedStyle = style;\n }\n\n if (typeof children === 'function') {\n computedChildren = children({...values, defaultChildren});\n } else if (children == null) {\n computedChildren = defaultChildren;\n } else {\n computedChildren = children;\n }\n\n return {\n className: computedClassName ?? defaultClassName,\n style: (computedStyle || defaultStyle) ? {...defaultStyle, ...computedStyle} : undefined,\n children: computedChildren ?? defaultChildren,\n 'data-rac': '',\n render: render ? (props => render(props, values)) : undefined\n };\n }, [className, style, children, defaultClassName, defaultChildren, defaultStyle, values, render]);\n}\n\n/**\n * A helper function that accepts a user-provided render prop value (either a static value or a function),\n * and combines it with another value to create a final result.\n */\nexport function composeRenderProps<T, U, V extends T>(\n // https://stackoverflow.com/questions/60898079/typescript-type-t-or-function-t-usage\n value: T extends any ? (T | ((renderProps: U) => V)) : never,\n wrap: (prevValue: T, renderProps: U) => V\n): (renderProps: U) => V {\n return (renderProps) => wrap(typeof value === 'function' ? value(renderProps) : value, renderProps);\n}\n\nexport type WithRef<T, E> = T & {ref?: ForwardedRef<E>};\nexport interface SlotProps {\n /**\n * A slot name for the component. Slots allow the component to receive props from a parent component.\n * An explicit `null` value indicates that the local props completely override all props received from a parent.\n */\n slot?: string | null\n}\n\nexport function useSlottedContext<T>(context: Context<SlottedContextValue<T>>, slot?: string | null): T | null | undefined {\n let ctx = useContext(context);\n if (slot === null) {\n // An explicit `null` slot means don't use context.\n return null;\n }\n if (ctx && typeof ctx === 'object' && 'slots' in ctx && ctx.slots) {\n let slotKey = slot || DEFAULT_SLOT;\n if (!ctx.slots[slotKey]) {\n let availableSlots = new Intl.ListFormat().format(Object.keys(ctx.slots).map(p => `\"${p}\"`));\n let errorMessage = slot ? `Invalid slot \"${slot}\".` : 'A slot prop is required.';\n\n throw new Error(`${errorMessage} Valid slot names are ${availableSlots}.`);\n }\n return ctx.slots[slotKey];\n }\n // @ts-ignore\n return ctx;\n}\n\nexport function useContextProps<T, U extends SlotProps, E extends Element>(props: T & SlotProps, ref: ForwardedRef<E> | undefined, context: Context<ContextValue<U, E>>): [T, RefObject<E | null>] {\n let ctx = useSlottedContext(context, props.slot) || {};\n let {ref: contextRef, ...contextProps} = ctx as any;\n let mergedRef = useObjectRef(useMemo(() => mergeRefs(ref, contextRef), [ref, contextRef]));\n let mergedProps = mergeProps(contextProps, props) as unknown as T;\n\n // mergeProps does not merge `style`. Adding this there might be a breaking change.\n if (\n 'style' in contextProps &&\n contextProps.style &&\n 'style' in props &&\n props.style\n ) {\n if (typeof contextProps.style === 'function' || typeof props.style === 'function') {\n // @ts-ignore\n mergedProps.style = (renderProps) => {\n let contextStyle = typeof contextProps.style === 'function' ? contextProps.style(renderProps) : contextProps.style;\n let defaultStyle = {...renderProps.defaultStyle, ...contextStyle};\n let style = typeof props.style === 'function'\n ? props.style({...renderProps, defaultStyle})\n : props.style;\n return {...defaultStyle, ...style};\n };\n } else {\n // @ts-ignore\n mergedProps.style = {...contextProps.style, ...props.style};\n }\n }\n\n return [mergedProps, mergedRef];\n}\n\nexport function useSlot(initialState: boolean | (() => boolean) = true): [RefCallback<Element>, boolean] {\n // Initial state is typically based on the parent having an aria-label or aria-labelledby.\n // If it does, this value should be false so that we don't update the state and cause a rerender when we go through the layoutEffect\n let [hasSlot, setHasSlot] = useState(initialState);\n let hasRun = useRef(false);\n\n // A callback ref which will run when the slotted element mounts.\n // This should happen before the useLayoutEffect below.\n let ref = useCallback(el => {\n hasRun.current = true;\n setHasSlot(!!el);\n }, []);\n\n // If the callback hasn't been called, then reset to false.\n useLayoutEffect(() => {\n if (!hasRun.current) {\n setHasSlot(false);\n }\n }, []);\n\n return [ref, hasSlot];\n}\n\n/**\n * Filters out `data-*` attributes to keep them from being passed down and duplicated.\n * @param props\n */\nexport function removeDataAttributes<T>(props: T): T {\n const prefix = /^(data-.*)$/;\n let filteredProps = {} as T;\n\n for (const prop in props) {\n if (!prefix.test(prop)) {\n filteredProps[prop] = props[prop];\n }\n }\n\n return filteredProps;\n}\n\n// Override base type to change the default.\nexport interface RACValidation {\n /**\n * Whether to use native HTML form validation to prevent form submission\n * when the value is missing or invalid, or mark the field as required\n * or invalid via ARIA.\n * @default 'native'\n */\n validationBehavior?: 'native' | 'aria'\n}\n\nexport type DOMRenderFunction<E extends keyof React.JSX.IntrinsicElements, T> = (props: React.JSX.IntrinsicElements[E], renderProps: T) => ReactElement;\nexport interface DOMRenderProps<E extends keyof React.JSX.IntrinsicElements, T> {\n /**\n * Overrides the default DOM element with a custom render function.\n * This allows rendering existing components with built-in styles and behaviors\n * such as router links, animation libraries, and pre-styled components.\n * \n * Requirements:\n * \n * * You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`).\n * * Only a single root DOM element can be rendered (no fragments).\n * * You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.\n */\n render?: DOMRenderFunction<E, T>\n}\n\n// Makes `href` required in AnchorHTMLAttributes\ntype LinkWithRequiredHref = Required<Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>> & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>; \n\n// Same as DOMRenderProps but specific for the case where the element could be a 'a' or 'div' element.\nexport interface PossibleLinkDOMRenderProps<Fallback extends keyof React.JSX.IntrinsicElements, T> {\n /**\n * Overrides the default DOM element with a custom render function.\n * This allows rendering existing components with built-in styles and behaviors\n * such as router links, animation libraries, and pre-styled components.\n * \n * Note: You can check if `'href' in props` in order to tell whether to render an `<a>` element.\n * \n * Requirements:\n * \n * * You must render the expected element type (e.g. if `<a>` is expected, you cannot render a `<button>`).\n * * Only a single root DOM element can be rendered (no fragments).\n * * You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.\n */\n render?: (props: DetailedHTMLProps<LinkWithRequiredHref, HTMLAnchorElement> | React.JSX.IntrinsicElements[Fallback], renderProps: T) => ReactElement\n}\n\nfunction DOMElement(ElementType: string, props: DOMRenderProps<any, any> & AllHTMLAttributes<HTMLElement>, forwardedRef: ForwardedRef<HTMLElement>) {\n let {render, ...otherProps} = props;\n let elementRef = useRef<HTMLElement | null>(null);\n let ref = useMemo(() => mergeRefs(forwardedRef, elementRef), [forwardedRef, elementRef]);\n\n useLayoutEffect(() => {\n if (process.env.NODE_ENV !== 'production' && render) {\n if (!elementRef.current) {\n console.warn('Ref was not connected to DOM element returned by custom `render` function. Did you forget to pass through or merge the `ref`?');\n } else if (elementRef.current.localName !== ElementType) {\n console.warn(`Unexpected DOM element returned by custom \\`render\\` function. Expected <${ElementType}>, got <${elementRef.current.localName}>. This may break the component behavior and accessibility.`);\n }\n }\n }, [ElementType, render]);\n\n let domProps: any = {...otherProps, ref};\n if (render) {\n return render(domProps, undefined);\n }\n\n return <ElementType {...domProps} />;\n}\n\ntype DOMComponents = {\n [E in keyof React.JSX.IntrinsicElements]: (props: DOMRenderProps<E, any> & React.JSX.IntrinsicElements[E]) => ReactElement\n};\n\nconst domComponentCache = {};\n\n// Dynamically generates and caches components for each DOM element (e.g. `dom.button`).\nexport const dom = new Proxy({}, {\n get(target, elementType) {\n if (typeof elementType !== 'string') {\n return undefined;\n }\n\n let res = domComponentCache[elementType];\n if (!res) {\n res = forwardRef(DOMElement.bind(null, elementType));\n domComponentCache[elementType] = res;\n }\n\n return res;\n }\n}) as DOMComponents;\n"],"names":[],"version":3,"file":"utils.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-aria-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.1",
|
|
4
4
|
"description": "A library of styleable components built using React Aria",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -41,35 +41,35 @@
|
|
|
41
41
|
"url": "https://github.com/adobe/react-spectrum"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@internationalized/date": "^3.
|
|
44
|
+
"@internationalized/date": "^3.11.0",
|
|
45
45
|
"@internationalized/string": "^3.2.7",
|
|
46
|
-
"@react-aria/autocomplete": "3.0.0-rc.
|
|
47
|
-
"@react-aria/collections": "^3.0.
|
|
48
|
-
"@react-aria/dnd": "^3.11.
|
|
49
|
-
"@react-aria/focus": "^3.21.
|
|
50
|
-
"@react-aria/interactions": "^3.
|
|
46
|
+
"@react-aria/autocomplete": "3.0.0-rc.5",
|
|
47
|
+
"@react-aria/collections": "^3.0.2",
|
|
48
|
+
"@react-aria/dnd": "^3.11.5",
|
|
49
|
+
"@react-aria/focus": "^3.21.4",
|
|
50
|
+
"@react-aria/interactions": "^3.27.0",
|
|
51
51
|
"@react-aria/live-announcer": "^3.4.4",
|
|
52
|
-
"@react-aria/overlays": "^3.31.
|
|
52
|
+
"@react-aria/overlays": "^3.31.1",
|
|
53
53
|
"@react-aria/ssr": "^3.9.10",
|
|
54
|
-
"@react-aria/textfield": "^3.18.
|
|
55
|
-
"@react-aria/toolbar": "3.0.0-beta.
|
|
56
|
-
"@react-aria/utils": "^3.
|
|
57
|
-
"@react-aria/virtualizer": "^4.1.
|
|
54
|
+
"@react-aria/textfield": "^3.18.4",
|
|
55
|
+
"@react-aria/toolbar": "3.0.0-beta.23",
|
|
56
|
+
"@react-aria/utils": "^3.33.0",
|
|
57
|
+
"@react-aria/virtualizer": "^4.1.12",
|
|
58
58
|
"@react-stately/autocomplete": "3.0.0-beta.4",
|
|
59
|
-
"@react-stately/layout": "^4.5.
|
|
60
|
-
"@react-stately/selection": "^3.20.
|
|
61
|
-
"@react-stately/table": "^3.15.
|
|
59
|
+
"@react-stately/layout": "^4.5.3",
|
|
60
|
+
"@react-stately/selection": "^3.20.8",
|
|
61
|
+
"@react-stately/table": "^3.15.3",
|
|
62
62
|
"@react-stately/utils": "^3.11.0",
|
|
63
|
-
"@react-stately/virtualizer": "^4.4.
|
|
64
|
-
"@react-types/form": "^3.7.
|
|
65
|
-
"@react-types/grid": "^3.3.
|
|
66
|
-
"@react-types/shared": "^3.
|
|
67
|
-
"@react-types/table": "^3.13.
|
|
63
|
+
"@react-stately/virtualizer": "^4.4.5",
|
|
64
|
+
"@react-types/form": "^3.7.17",
|
|
65
|
+
"@react-types/grid": "^3.3.7",
|
|
66
|
+
"@react-types/shared": "^3.33.0",
|
|
67
|
+
"@react-types/table": "^3.13.5",
|
|
68
68
|
"@swc/helpers": "^0.5.0",
|
|
69
69
|
"client-only": "^0.0.1",
|
|
70
|
-
"react-aria": "^3.
|
|
71
|
-
"react-stately": "^3.
|
|
72
|
-
"use-sync-external-store": "^1.
|
|
70
|
+
"react-aria": "^3.46.0",
|
|
71
|
+
"react-stately": "^3.44.0",
|
|
72
|
+
"use-sync-external-store": "^1.6.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@tailwindcss/postcss": "^4.0.0"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "5b4cb59a80023399c3a3f6340860a681c3b5b928"
|
|
85
85
|
}
|
package/src/Breadcrumbs.tsx
CHANGED
|
@@ -14,6 +14,8 @@ import {AriaLabelingProps, forwardRefType, GlobalDOMAttributes, Key} from '@reac
|
|
|
14
14
|
import {
|
|
15
15
|
ClassNameOrFunction,
|
|
16
16
|
ContextValue,
|
|
17
|
+
dom,
|
|
18
|
+
DOMRenderProps,
|
|
17
19
|
RenderProps,
|
|
18
20
|
SlotProps,
|
|
19
21
|
StyleProps,
|
|
@@ -28,7 +30,7 @@ import {LinkContext} from './Link';
|
|
|
28
30
|
import {Node} from 'react-stately';
|
|
29
31
|
import React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';
|
|
30
32
|
|
|
31
|
-
export interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps, AriaLabelingProps, GlobalDOMAttributes<HTMLOListElement> {
|
|
33
|
+
export interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps, AriaLabelingProps, DOMRenderProps<'ol', undefined>, GlobalDOMAttributes<HTMLOListElement> {
|
|
32
34
|
/**
|
|
33
35
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
34
36
|
* @default 'react-aria-Breadcrumbs'
|
|
@@ -54,7 +56,8 @@ export const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function
|
|
|
54
56
|
return (
|
|
55
57
|
<CollectionBuilder content={<Collection {...props} />}>
|
|
56
58
|
{collection => (
|
|
57
|
-
<ol
|
|
59
|
+
<dom.ol
|
|
60
|
+
render={props.render}
|
|
58
61
|
ref={ref}
|
|
59
62
|
{...mergeProps(DOMProps, navProps)}
|
|
60
63
|
slot={props.slot || undefined}
|
|
@@ -63,7 +66,7 @@ export const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function
|
|
|
63
66
|
<BreadcrumbsContext.Provider value={props}>
|
|
64
67
|
<CollectionRoot collection={collection} />
|
|
65
68
|
</BreadcrumbsContext.Provider>
|
|
66
|
-
</ol>
|
|
69
|
+
</dom.ol>
|
|
67
70
|
)}
|
|
68
71
|
</CollectionBuilder>
|
|
69
72
|
);
|
|
@@ -82,7 +85,7 @@ export interface BreadcrumbRenderProps {
|
|
|
82
85
|
isDisabled: boolean
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
export interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps>, AriaLabelingProps, GlobalDOMAttributes<HTMLLIElement> {
|
|
88
|
+
export interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps, 'li'>, AriaLabelingProps, GlobalDOMAttributes<HTMLLIElement> {
|
|
86
89
|
/**
|
|
87
90
|
* 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.
|
|
88
91
|
* @default 'react-aria-Breadcrumb'
|
|
@@ -120,7 +123,7 @@ export const Breadcrumb = /*#__PURE__*/ createLeafComponent(BreadcrumbNode, func
|
|
|
120
123
|
delete DOMProps.id;
|
|
121
124
|
|
|
122
125
|
return (
|
|
123
|
-
<li
|
|
126
|
+
<dom.li
|
|
124
127
|
{...DOMProps}
|
|
125
128
|
{...renderProps}
|
|
126
129
|
ref={ref}
|
|
@@ -129,6 +132,6 @@ export const Breadcrumb = /*#__PURE__*/ createLeafComponent(BreadcrumbNode, func
|
|
|
129
132
|
<LinkContext.Provider value={linkProps}>
|
|
130
133
|
{renderProps.children}
|
|
131
134
|
</LinkContext.Provider>
|
|
132
|
-
</li>
|
|
135
|
+
</dom.li>
|
|
133
136
|
);
|
|
134
137
|
});
|
package/src/Button.tsx
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
ClassNameOrFunction,
|
|
25
25
|
ContextValue,
|
|
26
|
+
dom,
|
|
26
27
|
RenderProps,
|
|
27
28
|
SlotProps,
|
|
28
29
|
useContextProps,
|
|
@@ -67,7 +68,7 @@ export interface ButtonRenderProps {
|
|
|
67
68
|
isPending: boolean
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
export interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {
|
|
71
|
+
export interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps, 'button'>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {
|
|
71
72
|
/**
|
|
72
73
|
* 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.
|
|
73
74
|
* @default 'react-aria-Button'
|
|
@@ -144,7 +145,7 @@ export const Button = /*#__PURE__*/ createHideableComponent(function Button(prop
|
|
|
144
145
|
delete DOMProps.onClick;
|
|
145
146
|
|
|
146
147
|
return (
|
|
147
|
-
<button
|
|
148
|
+
<dom.button
|
|
148
149
|
{...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}
|
|
149
150
|
// When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
|
|
150
151
|
// We do this by changing the button's type to button.
|
|
@@ -163,7 +164,7 @@ export const Button = /*#__PURE__*/ createHideableComponent(function Button(prop
|
|
|
163
164
|
<ProgressBarContext.Provider value={{id: progressId}}>
|
|
164
165
|
{renderProps.children}
|
|
165
166
|
</ProgressBarContext.Provider>
|
|
166
|
-
</button>
|
|
167
|
+
</dom.button>
|
|
167
168
|
);
|
|
168
169
|
});
|
|
169
170
|
|
package/src/Calendar.tsx
CHANGED
|
@@ -29,7 +29,9 @@ import {CalendarState, RangeCalendarState, useCalendarState, useRangeCalendarSta
|
|
|
29
29
|
import {
|
|
30
30
|
ClassNameOrFunction,
|
|
31
31
|
ContextValue,
|
|
32
|
+
dom,
|
|
32
33
|
DOMProps,
|
|
34
|
+
DOMRenderProps,
|
|
33
35
|
Provider,
|
|
34
36
|
RenderProps,
|
|
35
37
|
SlotProps,
|
|
@@ -68,7 +70,7 @@ export interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'sta
|
|
|
68
70
|
state: RangeCalendarState
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
export interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
73
|
+
export interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<CalendarRenderProps, 'div'>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
72
74
|
/**
|
|
73
75
|
* 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.
|
|
74
76
|
* @default 'react-aria-Calendar'
|
|
@@ -87,7 +89,7 @@ export interface CalendarProps<T extends DateValue> extends Omit<AriaCalendarPro
|
|
|
87
89
|
createCalendar?: (identifier: CalendarIdentifier) => ICalendar
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
export interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
92
|
+
export interface RangeCalendarProps<T extends DateValue> extends Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>, RenderProps<RangeCalendarRenderProps, 'div'>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
91
93
|
/**
|
|
92
94
|
* 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.
|
|
93
95
|
* @default 'react-aria-RangeCalendar'
|
|
@@ -138,7 +140,7 @@ export const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Ca
|
|
|
138
140
|
let DOMProps = filterDOMProps(props, {global: true});
|
|
139
141
|
|
|
140
142
|
return (
|
|
141
|
-
<div
|
|
143
|
+
<dom.div
|
|
142
144
|
{...mergeProps(DOMProps, renderProps, calendarProps)}
|
|
143
145
|
ref={ref}
|
|
144
146
|
slot={props.slot || undefined}
|
|
@@ -181,7 +183,7 @@ export const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Ca
|
|
|
181
183
|
tabIndex={-1} />
|
|
182
184
|
</VisuallyHidden>
|
|
183
185
|
</Provider>
|
|
184
|
-
</div>
|
|
186
|
+
</dom.div>
|
|
185
187
|
);
|
|
186
188
|
});
|
|
187
189
|
|
|
@@ -216,7 +218,7 @@ export const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(functi
|
|
|
216
218
|
let DOMProps = filterDOMProps(props, {global: true});
|
|
217
219
|
|
|
218
220
|
return (
|
|
219
|
-
<div
|
|
221
|
+
<dom.div
|
|
220
222
|
{...mergeProps(renderProps, DOMProps, calendarProps)}
|
|
221
223
|
ref={ref}
|
|
222
224
|
slot={props.slot || undefined}
|
|
@@ -259,7 +261,7 @@ export const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(functi
|
|
|
259
261
|
tabIndex={-1} />
|
|
260
262
|
</VisuallyHidden>
|
|
261
263
|
</Provider>
|
|
262
|
-
</div>
|
|
264
|
+
</dom.div>
|
|
263
265
|
);
|
|
264
266
|
});
|
|
265
267
|
|
|
@@ -344,7 +346,7 @@ export interface CalendarCellRenderProps {
|
|
|
344
346
|
isToday: boolean
|
|
345
347
|
}
|
|
346
348
|
|
|
347
|
-
export interface CalendarGridProps extends StyleProps, GlobalDOMAttributes<HTMLTableElement> {
|
|
349
|
+
export interface CalendarGridProps extends StyleProps, DOMRenderProps<'table', undefined>, GlobalDOMAttributes<HTMLTableElement> {
|
|
348
350
|
/**
|
|
349
351
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
350
352
|
* @default 'react-aria-CalendarGrid'
|
|
@@ -407,7 +409,8 @@ export const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(functio
|
|
|
407
409
|
|
|
408
410
|
return (
|
|
409
411
|
<InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>
|
|
410
|
-
<table
|
|
412
|
+
<dom.table
|
|
413
|
+
render={props.render}
|
|
411
414
|
{...mergeProps(DOMProps, gridProps)}
|
|
412
415
|
ref={ref}
|
|
413
416
|
style={props.style}
|
|
@@ -424,12 +427,12 @@ export const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(functio
|
|
|
424
427
|
</CalendarGridBodyForwardRef>
|
|
425
428
|
</>)
|
|
426
429
|
}
|
|
427
|
-
</table>
|
|
430
|
+
</dom.table>
|
|
428
431
|
</InternalCalendarGridContext.Provider>
|
|
429
432
|
);
|
|
430
433
|
});
|
|
431
434
|
|
|
432
|
-
export interface CalendarGridHeaderProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {
|
|
435
|
+
export interface CalendarGridHeaderProps extends StyleProps, DOMRenderProps<'thead', undefined>, GlobalDOMAttributes<HTMLTableSectionElement> {
|
|
433
436
|
/**
|
|
434
437
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
435
438
|
* @default 'react-aria-CalendarGridHeader'
|
|
@@ -445,7 +448,8 @@ function CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HT
|
|
|
445
448
|
let DOMProps = filterDOMProps(props, {global: true});
|
|
446
449
|
|
|
447
450
|
return (
|
|
448
|
-
<thead
|
|
451
|
+
<dom.thead
|
|
452
|
+
render={props.render}
|
|
449
453
|
{...mergeProps(DOMProps, headerProps)}
|
|
450
454
|
ref={ref}
|
|
451
455
|
style={style}
|
|
@@ -453,7 +457,7 @@ function CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HT
|
|
|
453
457
|
<tr>
|
|
454
458
|
{weekDays.map((day, key) => React.cloneElement(children(day), {key}))}
|
|
455
459
|
</tr>
|
|
456
|
-
</thead>
|
|
460
|
+
</dom.thead>
|
|
457
461
|
);
|
|
458
462
|
}
|
|
459
463
|
|
|
@@ -463,7 +467,7 @@ function CalendarGridHeader(props: CalendarGridHeaderProps, ref: ForwardedRef<HT
|
|
|
463
467
|
const CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridHeader);
|
|
464
468
|
export {CalendarGridHeaderForwardRef as CalendarGridHeader};
|
|
465
469
|
|
|
466
|
-
export interface CalendarHeaderCellProps extends DOMProps, GlobalDOMAttributes<HTMLTableHeaderCellElement> {
|
|
470
|
+
export interface CalendarHeaderCellProps extends DOMProps, DOMRenderProps<'th', undefined>, GlobalDOMAttributes<HTMLTableHeaderCellElement> {
|
|
467
471
|
/**
|
|
468
472
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
469
473
|
* @default 'react-aria-CalendarHeaderCell'
|
|
@@ -475,13 +479,14 @@ function CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HT
|
|
|
475
479
|
let {children, style, className} = props;
|
|
476
480
|
let DOMProps = filterDOMProps(props, {global: true});
|
|
477
481
|
return (
|
|
478
|
-
<th
|
|
482
|
+
<dom.th
|
|
483
|
+
render={props.render}
|
|
479
484
|
{...DOMProps}
|
|
480
485
|
ref={ref}
|
|
481
486
|
style={style}
|
|
482
487
|
className={className || 'react-aria-CalendarHeaderCell'}>
|
|
483
488
|
{children}
|
|
484
|
-
</th>
|
|
489
|
+
</dom.th>
|
|
485
490
|
);
|
|
486
491
|
}
|
|
487
492
|
|
|
@@ -491,7 +496,7 @@ function CalendarHeaderCell(props: CalendarHeaderCellProps, ref: ForwardedRef<HT
|
|
|
491
496
|
const CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);
|
|
492
497
|
export {CalendarHeaderCellForwardRef as CalendarHeaderCell};
|
|
493
498
|
|
|
494
|
-
export interface CalendarGridBodyProps extends StyleProps, GlobalDOMAttributes<HTMLTableSectionElement> {
|
|
499
|
+
export interface CalendarGridBodyProps extends StyleProps, DOMRenderProps<'tbody', undefined>, GlobalDOMAttributes<HTMLTableSectionElement> {
|
|
495
500
|
/**
|
|
496
501
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
|
|
497
502
|
* @default 'react-aria-CalendarGridBody'
|
|
@@ -510,7 +515,8 @@ function CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTa
|
|
|
510
515
|
let DOMProps = filterDOMProps(props, {global: true});
|
|
511
516
|
|
|
512
517
|
return (
|
|
513
|
-
<tbody
|
|
518
|
+
<dom.tbody
|
|
519
|
+
render={props.render}
|
|
514
520
|
{...DOMProps}
|
|
515
521
|
ref={ref}
|
|
516
522
|
style={style}
|
|
@@ -524,7 +530,7 @@ function CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTa
|
|
|
524
530
|
))}
|
|
525
531
|
</tr>
|
|
526
532
|
))}
|
|
527
|
-
</tbody>
|
|
533
|
+
</dom.tbody>
|
|
528
534
|
);
|
|
529
535
|
}
|
|
530
536
|
|
|
@@ -534,7 +540,7 @@ function CalendarGridBody(props: CalendarGridBodyProps, ref: ForwardedRef<HTMLTa
|
|
|
534
540
|
const CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);
|
|
535
541
|
export {CalendarGridBodyForwardRef as CalendarGridBody};
|
|
536
542
|
|
|
537
|
-
export interface CalendarCellProps extends RenderProps<CalendarCellRenderProps>, HoverEvents, GlobalDOMAttributes<HTMLTableCellElement> {
|
|
543
|
+
export interface CalendarCellProps extends RenderProps<CalendarCellRenderProps, 'div'>, HoverEvents, GlobalDOMAttributes<HTMLTableCellElement> {
|
|
538
544
|
/**
|
|
539
545
|
* 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.
|
|
540
546
|
* @default 'react-aria-CalendarCell'
|
|
@@ -608,7 +614,7 @@ export const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(functio
|
|
|
608
614
|
|
|
609
615
|
return (
|
|
610
616
|
<td {...cellProps} ref={ref}>
|
|
611
|
-
<div {...mergeProps(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />
|
|
617
|
+
<dom.div {...mergeProps(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps)} ref={buttonRef} />
|
|
612
618
|
</td>
|
|
613
619
|
);
|
|
614
620
|
});
|