react-aria-components 3.0.0-nightly-ab9fd5c68-241125 → 3.0.0-nightly-10a43de88-241127
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 +2 -5
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +3 -6
- package/dist/Breadcrumbs.module.js +3 -6
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +2 -5
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +2 -5
- package/dist/Button.module.js +2 -5
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +9 -22
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +9 -22
- package/dist/Calendar.module.js +9 -22
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +5 -12
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +6 -13
- package/dist/Checkbox.module.js +6 -13
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/ColorArea.main.js +2 -5
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +3 -6
- package/dist/ColorArea.module.js +3 -6
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +2 -5
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +2 -5
- package/dist/ColorField.module.js +2 -5
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +2 -5
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +2 -5
- package/dist/ColorSlider.module.js +2 -5
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +2 -5
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +2 -5
- package/dist/ColorSwatch.module.js +2 -5
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js +4 -8
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.mjs +5 -9
- package/dist/ColorSwatchPicker.module.js +5 -9
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +2 -5
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +3 -6
- package/dist/ColorThumb.module.js +3 -6
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +5 -11
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +6 -12
- package/dist/ColorWheel.module.js +6 -12
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +2 -5
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +3 -6
- package/dist/ComboBox.module.js +3 -6
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +8 -23
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +9 -24
- package/dist/DateField.module.js +9 -24
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +4 -11
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +5 -12
- package/dist/DatePicker.module.js +5 -12
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +2 -5
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +3 -6
- package/dist/Dialog.module.js +3 -6
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +6 -16
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +6 -16
- package/dist/Disclosure.module.js +6 -16
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js +2 -5
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.mjs +3 -6
- package/dist/DragAndDrop.module.js +3 -6
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +2 -5
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +3 -6
- package/dist/DropZone.module.js +3 -6
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js +2 -5
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.mjs +3 -6
- package/dist/FieldError.module.js +3 -6
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +2 -5
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +2 -5
- package/dist/FileTrigger.module.js +2 -5
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js +2 -6
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.mjs +2 -6
- package/dist/Form.module.js +2 -6
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +2 -6
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +3 -7
- package/dist/GridList.module.js +3 -7
- package/dist/GridList.module.js.map +1 -1
- package/dist/Group.main.js +2 -5
- package/dist/Group.main.js.map +1 -1
- package/dist/Group.mjs +2 -5
- package/dist/Group.module.js +2 -5
- package/dist/Group.module.js.map +1 -1
- package/dist/Heading.main.js +2 -3
- package/dist/Heading.main.js.map +1 -1
- package/dist/Heading.mjs +2 -3
- package/dist/Heading.module.js +2 -3
- package/dist/Heading.module.js.map +1 -1
- package/dist/Input.main.js +2 -5
- package/dist/Input.main.js.map +1 -1
- package/dist/Input.mjs +2 -5
- package/dist/Input.module.js +2 -5
- package/dist/Input.module.js.map +1 -1
- package/dist/Keyboard.main.js +2 -3
- package/dist/Keyboard.main.js.map +1 -1
- package/dist/Keyboard.mjs +2 -3
- package/dist/Keyboard.module.js +2 -3
- package/dist/Keyboard.module.js.map +1 -1
- package/dist/Label.main.js +2 -3
- package/dist/Label.main.js.map +1 -1
- package/dist/Label.mjs +2 -3
- package/dist/Label.module.js +2 -3
- package/dist/Label.module.js.map +1 -1
- package/dist/Link.main.js +2 -6
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +2 -6
- package/dist/Link.module.js +2 -6
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +5 -10
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +6 -11
- package/dist/ListBox.module.js +6 -11
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +5 -10
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +5 -10
- package/dist/Menu.module.js +5 -10
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +2 -5
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +2 -5
- package/dist/Meter.module.js +2 -5
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +3 -6
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +4 -7
- package/dist/Modal.module.js +4 -7
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +2 -5
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +3 -6
- package/dist/NumberField.module.js +3 -6
- package/dist/NumberField.module.js.map +1 -1
- package/dist/OverlayArrow.main.js +2 -6
- package/dist/OverlayArrow.main.js.map +1 -1
- package/dist/OverlayArrow.mjs +2 -6
- package/dist/OverlayArrow.module.js +2 -6
- package/dist/OverlayArrow.module.js.map +1 -1
- package/dist/Popover.main.js +2 -5
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +3 -6
- package/dist/Popover.module.js +3 -6
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +2 -6
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +2 -6
- package/dist/ProgressBar.module.js +2 -6
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +4 -10
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +4 -10
- package/dist/RadioGroup.module.js +4 -10
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +2 -5
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +3 -6
- package/dist/SearchField.module.js +3 -6
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +5 -12
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +6 -13
- package/dist/Select.module.js +6 -13
- package/dist/Select.module.js.map +1 -1
- package/dist/Slider.main.js +8 -20
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +9 -21
- package/dist/Slider.module.js +9 -21
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +2 -5
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +2 -5
- package/dist/Switch.module.js +2 -5
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +6 -12
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +7 -13
- package/dist/Table.module.js +7 -13
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +6 -16
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +7 -17
- package/dist/Tabs.module.js +7 -17
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +4 -10
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +5 -11
- package/dist/TagGroup.module.js +5 -11
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/Text.main.js +2 -3
- package/dist/Text.main.js.map +1 -1
- package/dist/Text.mjs +2 -3
- package/dist/Text.module.js +2 -3
- package/dist/Text.module.js.map +1 -1
- package/dist/TextArea.main.js +2 -5
- package/dist/TextArea.main.js.map +1 -1
- package/dist/TextArea.mjs +2 -5
- package/dist/TextArea.module.js +2 -5
- package/dist/TextArea.module.js.map +1 -1
- package/dist/TextField.main.js +2 -5
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +3 -6
- package/dist/TextField.module.js +3 -6
- package/dist/TextField.module.js.map +1 -1
- package/dist/ToggleButton.main.js +2 -5
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +3 -6
- package/dist/ToggleButton.module.js +3 -6
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +2 -5
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +2 -5
- package/dist/ToggleButtonGroup.module.js +2 -5
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +2 -6
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +2 -6
- package/dist/Toolbar.module.js +2 -6
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +2 -5
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +3 -6
- package/dist/Tooltip.module.js +3 -6
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +2 -6
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +3 -7
- package/dist/Tree.module.js +3 -7
- package/dist/Tree.module.js.map +1 -1
- package/dist/types.d.ts +10 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/Breadcrumbs.tsx +5 -8
- package/src/Button.tsx +5 -8
- package/src/Calendar.tsx +19 -31
- package/src/Checkbox.tsx +11 -17
- package/src/ColorArea.tsx +5 -8
- package/src/ColorField.tsx +5 -8
- package/src/ColorSlider.tsx +5 -8
- package/src/ColorSwatch.tsx +5 -8
- package/src/ColorSwatchPicker.tsx +7 -13
- package/src/ColorThumb.tsx +5 -8
- package/src/ColorWheel.tsx +10 -16
- package/src/ComboBox.tsx +5 -8
- package/src/DateField.tsx +21 -33
- package/src/DatePicker.tsx +9 -15
- package/src/Dialog.tsx +5 -8
- package/src/Disclosure.tsx +16 -25
- package/src/DragAndDrop.tsx +5 -8
- package/src/DropZone.tsx +5 -8
- package/src/FieldError.tsx +5 -8
- package/src/FileTrigger.tsx +5 -8
- package/src/Form.tsx +6 -9
- package/src/GridList.tsx +6 -9
- package/src/Group.tsx +5 -8
- package/src/Heading.tsx +2 -5
- package/src/Input.tsx +5 -8
- package/src/Keyboard.tsx +2 -5
- package/src/Label.tsx +2 -5
- package/src/Link.tsx +6 -9
- package/src/ListBox.tsx +8 -12
- package/src/Menu.tsx +8 -12
- package/src/Meter.tsx +5 -8
- package/src/Modal.tsx +5 -8
- package/src/NumberField.tsx +5 -8
- package/src/OverlayArrow.tsx +6 -9
- package/src/Popover.tsx +5 -8
- package/src/ProgressBar.tsx +6 -9
- package/src/RadioGroup.tsx +10 -16
- package/src/SearchField.tsx +5 -8
- package/src/Select.tsx +11 -17
- package/src/Slider.tsx +20 -32
- package/src/Switch.tsx +5 -8
- package/src/Table.tsx +10 -19
- package/src/Tabs.tsx +14 -23
- package/src/TagGroup.tsx +8 -14
- package/src/Text.tsx +2 -5
- package/src/TextArea.tsx +5 -7
- package/src/TextField.tsx +5 -8
- package/src/ToggleButton.tsx +5 -8
- package/src/ToggleButtonGroup.tsx +5 -8
- package/src/Toolbar.tsx +6 -9
- package/src/Tooltip.tsx +5 -8
- package/src/Tree.tsx +6 -9
package/dist/DatePicker.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.m
|
|
|
12
12
|
import {useDatePicker as $8nhma$useDatePicker, useFocusRing as $8nhma$useFocusRing, useDateRangePicker as $8nhma$useDateRangePicker} from "react-aria";
|
|
13
13
|
import {useDatePickerState as $8nhma$useDatePickerState, useDateRangePickerState as $8nhma$useDateRangePickerState} from "react-stately";
|
|
14
14
|
import {useResizeObserver as $8nhma$useResizeObserver, filterDOMProps as $8nhma$filterDOMProps} from "@react-aria/utils";
|
|
15
|
-
import $8nhma$react, {createContext as $8nhma$createContext,
|
|
15
|
+
import $8nhma$react, {createContext as $8nhma$createContext, forwardRef as $8nhma$forwardRef, useRef as $8nhma$useRef, useState as $8nhma$useState, useCallback as $8nhma$useCallback} from "react";
|
|
16
16
|
|
|
17
17
|
/*
|
|
18
18
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -43,7 +43,7 @@ const $06d5b8ec9ee5d538$export$cf316c7f3b44c11e = /*#__PURE__*/ (0, $8nhma$creat
|
|
|
43
43
|
const $06d5b8ec9ee5d538$export$8282edba42ee28a = /*#__PURE__*/ (0, $8nhma$createContext)(null);
|
|
44
44
|
const $06d5b8ec9ee5d538$export$50a10c048fdcdee9 = /*#__PURE__*/ (0, $8nhma$createContext)(null);
|
|
45
45
|
const $06d5b8ec9ee5d538$export$80d7ae1f804790be = /*#__PURE__*/ (0, $8nhma$createContext)(null);
|
|
46
|
-
|
|
46
|
+
const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8nhma$forwardRef)(function DatePicker(props, ref) {
|
|
47
47
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $06d5b8ec9ee5d538$export$cf316c7f3b44c11e);
|
|
48
48
|
let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
49
49
|
var _props_validationBehavior, _ref;
|
|
@@ -167,11 +167,8 @@ function $06d5b8ec9ee5d538$var$DatePicker(props, ref) {
|
|
|
167
167
|
"data-disabled": props.isDisabled || undefined,
|
|
168
168
|
"data-open": state.isOpen || undefined
|
|
169
169
|
}));
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
* A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.
|
|
173
|
-
*/ const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8nhma$forwardRef)($06d5b8ec9ee5d538$var$DatePicker);
|
|
174
|
-
function $06d5b8ec9ee5d538$var$DateRangePicker(props, ref) {
|
|
170
|
+
});
|
|
171
|
+
const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /*#__PURE__*/ (0, $8nhma$forwardRef)(function DateRangePicker(props, ref) {
|
|
175
172
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $06d5b8ec9ee5d538$export$8282edba42ee28a);
|
|
176
173
|
let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
177
174
|
var _props_validationBehavior, _ref;
|
|
@@ -300,11 +297,7 @@ function $06d5b8ec9ee5d538$var$DateRangePicker(props, ref) {
|
|
|
300
297
|
"data-disabled": props.isDisabled || undefined,
|
|
301
298
|
"data-open": state.isOpen || undefined
|
|
302
299
|
}));
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* A date range picker combines two DateFields and a RangeCalendar popover to allow
|
|
306
|
-
* users to enter or select a date and time range.
|
|
307
|
-
*/ const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /*#__PURE__*/ (0, $8nhma$forwardRef)($06d5b8ec9ee5d538$var$DateRangePicker);
|
|
300
|
+
});
|
|
308
301
|
|
|
309
302
|
|
|
310
303
|
export {$06d5b8ec9ee5d538$export$cf316c7f3b44c11e as DatePickerContext, $06d5b8ec9ee5d538$export$8282edba42ee28a as DateRangePickerContext, $06d5b8ec9ee5d538$export$50a10c048fdcdee9 as DatePickerStateContext, $06d5b8ec9ee5d538$export$80d7ae1f804790be as DateRangePickerStateContext, $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 as DatePicker, $06d5b8ec9ee5d538$export$17334619f3ac2224 as DateRangePicker};
|
|
@@ -12,7 +12,7 @@ import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.m
|
|
|
12
12
|
import {useDatePicker as $8nhma$useDatePicker, useFocusRing as $8nhma$useFocusRing, useDateRangePicker as $8nhma$useDateRangePicker} from "react-aria";
|
|
13
13
|
import {useDatePickerState as $8nhma$useDatePickerState, useDateRangePickerState as $8nhma$useDateRangePickerState} from "react-stately";
|
|
14
14
|
import {useResizeObserver as $8nhma$useResizeObserver, filterDOMProps as $8nhma$filterDOMProps} from "@react-aria/utils";
|
|
15
|
-
import $8nhma$react, {createContext as $8nhma$createContext,
|
|
15
|
+
import $8nhma$react, {createContext as $8nhma$createContext, forwardRef as $8nhma$forwardRef, useRef as $8nhma$useRef, useState as $8nhma$useState, useCallback as $8nhma$useCallback} from "react";
|
|
16
16
|
|
|
17
17
|
/*
|
|
18
18
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -43,7 +43,7 @@ const $06d5b8ec9ee5d538$export$cf316c7f3b44c11e = /*#__PURE__*/ (0, $8nhma$creat
|
|
|
43
43
|
const $06d5b8ec9ee5d538$export$8282edba42ee28a = /*#__PURE__*/ (0, $8nhma$createContext)(null);
|
|
44
44
|
const $06d5b8ec9ee5d538$export$50a10c048fdcdee9 = /*#__PURE__*/ (0, $8nhma$createContext)(null);
|
|
45
45
|
const $06d5b8ec9ee5d538$export$80d7ae1f804790be = /*#__PURE__*/ (0, $8nhma$createContext)(null);
|
|
46
|
-
|
|
46
|
+
const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8nhma$forwardRef)(function DatePicker(props, ref) {
|
|
47
47
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $06d5b8ec9ee5d538$export$cf316c7f3b44c11e);
|
|
48
48
|
let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
49
49
|
var _props_validationBehavior, _ref;
|
|
@@ -167,11 +167,8 @@ function $06d5b8ec9ee5d538$var$DatePicker(props, ref) {
|
|
|
167
167
|
"data-disabled": props.isDisabled || undefined,
|
|
168
168
|
"data-open": state.isOpen || undefined
|
|
169
169
|
}));
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
* A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.
|
|
173
|
-
*/ const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8nhma$forwardRef)($06d5b8ec9ee5d538$var$DatePicker);
|
|
174
|
-
function $06d5b8ec9ee5d538$var$DateRangePicker(props, ref) {
|
|
170
|
+
});
|
|
171
|
+
const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /*#__PURE__*/ (0, $8nhma$forwardRef)(function DateRangePicker(props, ref) {
|
|
175
172
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $06d5b8ec9ee5d538$export$8282edba42ee28a);
|
|
176
173
|
let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
177
174
|
var _props_validationBehavior, _ref;
|
|
@@ -300,11 +297,7 @@ function $06d5b8ec9ee5d538$var$DateRangePicker(props, ref) {
|
|
|
300
297
|
"data-disabled": props.isDisabled || undefined,
|
|
301
298
|
"data-open": state.isOpen || undefined
|
|
302
299
|
}));
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* A date range picker combines two DateFields and a RangeCalendar popover to allow
|
|
306
|
-
* users to enter or select a date and time range.
|
|
307
|
-
*/ const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /*#__PURE__*/ (0, $8nhma$forwardRef)($06d5b8ec9ee5d538$var$DateRangePicker);
|
|
300
|
+
});
|
|
308
301
|
|
|
309
302
|
|
|
310
303
|
export {$06d5b8ec9ee5d538$export$cf316c7f3b44c11e as DatePickerContext, $06d5b8ec9ee5d538$export$8282edba42ee28a as DateRangePickerContext, $06d5b8ec9ee5d538$export$50a10c048fdcdee9 as DatePickerStateContext, $06d5b8ec9ee5d538$export$80d7ae1f804790be as DateRangePickerStateContext, $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 as DatePicker, $06d5b8ec9ee5d538$export$17334619f3ac2224 as DateRangePicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;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A,GAAA,yCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAgB;gBAAG;aAAW;SAChC;qBACD,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,qBAAmB,aAAa;QAChC,gBAAc,MAAM,SAAS,IAAI;QACjC,sBAAoB,kBAAkB;QACtC,iBAAe,MAAM,UAAU,IAAI;QACnC,aAAW,MAAM,MAAM,IAAI;;AAGnC;AAEA;;;CAGC,GACD,MAAM,4CAAiC,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB","sources":["packages/react-aria-components/src/DatePicker.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 */\nimport {AriaDatePickerProps, AriaDateRangePickerProps, DateValue, useDatePicker, useDateRangePicker, useFocusRing} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarContext, RangeCalendarContext} from './Calendar';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {DateFieldContext} from './DateField';\nimport {DatePickerState, DatePickerStateOptions, DateRangePickerState, DateRangePickerStateOptions, useDatePickerState, useDateRangePickerState} from 'react-stately';\nimport {DialogContext, OverlayTriggerStateContext} from './Dialog';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, useResizeObserver} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {LabelContext} from './Label';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, useCallback, useRef, useState} from 'react';\nimport {TextContext} from './Text';\n\nexport interface DatePickerRenderProps {\n /**\n * Whether an element within the date picker is focused, either via a mouse or keyboard.\n * @selector [data-focus-within]\n */\n isFocusWithin: boolean,\n /**\n * Whether an element within the date picker is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the date picker is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date picker is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the date picker's popover is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * State of the date picker.\n */\n state: DatePickerState\n}\nexport interface DateRangePickerRenderProps extends Omit<DatePickerRenderProps, 'state'> {\n /**\n * State of the date range picker.\n */\n state: DateRangePickerState\n}\n\nexport interface DatePickerProps<T extends DateValue> extends Omit<AriaDatePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DatePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DatePickerRenderProps>, SlotProps {}\nexport interface DateRangePickerProps<T extends DateValue> extends Omit<AriaDateRangePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DateRangePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DateRangePickerRenderProps>, SlotProps {}\n\nexport const DatePickerContext = createContext<ContextValue<DatePickerProps<any>, HTMLDivElement>>(null);\nexport const DateRangePickerContext = createContext<ContextValue<DateRangePickerProps<any>, HTMLDivElement>>(null);\nexport const DatePickerStateContext = createContext<DatePickerState | null>(null);\nexport const DateRangePickerStateContext = createContext<DateRangePickerState | null>(null);\n\nfunction DatePicker<T extends DateValue>(props: DatePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DatePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDatePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot();\n let {\n groupProps,\n labelProps,\n fieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDatePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen\n },\n defaultClassName: 'react-aria-DatePicker'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DatePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [DateFieldContext, fieldProps],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [CalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DatePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties\n }],\n [DialogContext, dialogProps],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...focusProps}\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-open={state.isOpen || undefined} />\n </Provider>\n );\n}\n\n/**\n * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.\n */\nconst _DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(DatePicker);\nexport {_DatePicker as DatePicker};\n\nfunction DateRangePicker<T extends DateValue>(props: DateRangePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DateRangePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDateRangePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot();\n let {\n groupProps,\n labelProps,\n startFieldProps,\n endFieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDateRangePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen\n },\n defaultClassName: 'react-aria-DateRangePicker'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DateRangePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [RangeCalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DateRangePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties\n }],\n [DialogContext, dialogProps],\n [DateFieldContext, {\n slots: {\n start: startFieldProps,\n end: endFieldProps\n }\n }],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...focusProps}\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-open={state.isOpen || undefined} />\n </Provider>\n );\n}\n\n/**\n * A date range picker combines two DateFields and a RangeCalendar popover to allow\n * users to enter or select a date and time range.\n */\nconst _DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(DateRangePicker);\nexport {_DateRangePicker as DateRangePicker};\n"],"names":[],"version":3,"file":"DatePicker.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AA2DM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAsD;AAC5F,MAAM,yDAAyB,CAAA,GAAA,oBAAY,EAA2D;AACtG,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA0B;AACrE,MAAM,0DAA8B,CAAA,GAAA,oBAAY,EAA+B;AAK/E,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,WAAgC,KAAyB,EAAE,GAAiC;IAC1K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,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IAAI;QACnC,aAAW,MAAM,MAAM,IAAI;;AAGnC","sources":["packages/react-aria-components/src/DatePicker.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 */\nimport {AriaDatePickerProps, AriaDateRangePickerProps, DateValue, useDatePicker, useDateRangePicker, useFocusRing} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarContext, RangeCalendarContext} from './Calendar';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {DateFieldContext} from './DateField';\nimport {DatePickerState, DatePickerStateOptions, DateRangePickerState, DateRangePickerStateOptions, useDatePickerState, useDateRangePickerState} from 'react-stately';\nimport {DialogContext, OverlayTriggerStateContext} from './Dialog';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, useResizeObserver} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {LabelContext} from './Label';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, useCallback, useRef, useState} from 'react';\nimport {TextContext} from './Text';\n\nexport interface DatePickerRenderProps {\n /**\n * Whether an element within the date picker is focused, either via a mouse or keyboard.\n * @selector [data-focus-within]\n */\n isFocusWithin: boolean,\n /**\n * Whether an element within the date picker is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the date picker is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date picker is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the date picker's popover is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * State of the date picker.\n */\n state: DatePickerState\n}\nexport interface DateRangePickerRenderProps extends Omit<DatePickerRenderProps, 'state'> {\n /**\n * State of the date range picker.\n */\n state: DateRangePickerState\n}\n\nexport interface DatePickerProps<T extends DateValue> extends Omit<AriaDatePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DatePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DatePickerRenderProps>, SlotProps {}\nexport interface DateRangePickerProps<T extends DateValue> extends Omit<AriaDateRangePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DateRangePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DateRangePickerRenderProps>, SlotProps {}\n\nexport const DatePickerContext = createContext<ContextValue<DatePickerProps<any>, HTMLDivElement>>(null);\nexport const DateRangePickerContext = createContext<ContextValue<DateRangePickerProps<any>, HTMLDivElement>>(null);\nexport const DatePickerStateContext = createContext<DatePickerState | null>(null);\nexport const DateRangePickerStateContext = createContext<DateRangePickerState | null>(null);\n\n/**\n * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.\n */\nexport const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DatePicker<T extends DateValue>(props: DatePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DatePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDatePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot();\n let {\n groupProps,\n labelProps,\n fieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDatePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen\n },\n defaultClassName: 'react-aria-DatePicker'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DatePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [DateFieldContext, fieldProps],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [CalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DatePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties\n }],\n [DialogContext, dialogProps],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...focusProps}\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-open={state.isOpen || undefined} />\n </Provider>\n );\n});\n\n/**\n * A date range picker combines two DateFields and a RangeCalendar popover to allow\n * users to enter or select a date and time range.\n */\nexport const DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateRangePicker<T extends DateValue>(props: DateRangePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DateRangePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDateRangePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot();\n let {\n groupProps,\n labelProps,\n startFieldProps,\n endFieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDateRangePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen\n },\n defaultClassName: 'react-aria-DateRangePicker'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DateRangePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [RangeCalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DateRangePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties\n }],\n [DialogContext, dialogProps],\n [DateFieldContext, {\n slots: {\n start: startFieldProps,\n end: endFieldProps\n }\n }],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...focusProps}\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-open={state.isOpen || undefined} />\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DatePicker.module.js.map"}
|
package/dist/Dialog.main.js
CHANGED
|
@@ -86,7 +86,7 @@ function $2979ab89b336194b$export$2e1e1122cf0cba88(props) {
|
|
|
86
86
|
isPressed: state.isOpen
|
|
87
87
|
}, props.children));
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
const $2979ab89b336194b$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $03da9$react.forwardRef)(function Dialog(props, ref) {
|
|
90
90
|
let originalAriaLabelledby = props['aria-labelledby'];
|
|
91
91
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $2979ab89b336194b$export$8b93a07348a7730c);
|
|
92
92
|
let { dialogProps: dialogProps, titleProps: titleProps } = (0, $03da9$reactaria.useDialog)({
|
|
@@ -144,10 +144,7 @@ function $2979ab89b336194b$var$Dialog(props, ref) {
|
|
|
144
144
|
]
|
|
145
145
|
]
|
|
146
146
|
}, renderProps.children));
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* A dialog is an overlay shown above other content in an application.
|
|
150
|
-
*/ const $2979ab89b336194b$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $03da9$react.forwardRef)($2979ab89b336194b$var$Dialog);
|
|
147
|
+
});
|
|
151
148
|
|
|
152
149
|
|
|
153
150
|
//# sourceMappingURL=Dialog.main.js.map
|
package/dist/Dialog.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;A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QAClB,WAAW,MAAM,SAAS;QAC1B,OAAO,MAAM,KAAK;QAClB,UAAU,MAAM,QAAQ;QACxB,QAAQ;YACN,OAAO,CAAA,kBAAA,4BAAA,MAAO,KAAK,KAAK,CAAA,KAAO,CAAA;QACjC;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAM;QACxB,GAAG,WAAW;QACd,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;qBACpB,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,wCAAa;gBAAG;oBACf,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;4BAAC,GAAG,UAAU;4BAAE,OAAO;wBAAC;oBACjC;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,uCAAY;gBAAG;oBACd,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;4BACL,SAAS,IAAM,kBAAA,4BAAA,MAAO,KAAK;wBAC7B;oBACF;gBACF;aAAE;SACH;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Dialog.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 */\nimport {AriaDialogProps, useDialog, useId, useOverlayTrigger} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, SlotProps, StyleProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType} from '@react-types/shared';\nimport {HeadingContext} from './RSPContexts';\nimport {OverlayTriggerProps, OverlayTriggerState, useMenuTriggerState} from 'react-stately';\nimport {PopoverContext} from './Popover';\nimport {PressResponder} from '@react-aria/interactions';\nimport React, {createContext, ForwardedRef, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {RootMenuTriggerStateContext} from './Menu';\n\nexport interface DialogTriggerProps extends OverlayTriggerProps {\n children: ReactNode\n}\n\ninterface DialogRenderProps {\n close: () => void\n}\n\nexport interface DialogProps extends AriaDialogProps, StyleProps, SlotProps {\n /** Children of the dialog. A function may be provided to access a function to close the dialog. */\n children?: ReactNode | ((opts: DialogRenderProps) => ReactNode)\n}\n\nexport const DialogContext = createContext<ContextValue<DialogProps, HTMLElement>>(null);\nexport const OverlayTriggerStateContext = createContext<OverlayTriggerState | null>(null);\n\n/**\n * A DialogTrigger opens a dialog when a trigger element is pressed.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n // Use useMenuTriggerState instead of useOverlayTriggerState in case a menu is embedded in the dialog.\n // This is needed to handle submenus.\n let state = useMenuTriggerState(props);\n\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {triggerProps, overlayProps} = useOverlayTrigger({type: 'dialog'}, state, buttonRef);\n\n // Label dialog by the trigger as a fallback if there is no title slot.\n // This is done in RAC instead of hooks because otherwise we cannot distinguish\n // between context and props. Normally aria-labelledby overrides the title\n // but when sent by context we want the title to win.\n triggerProps.id = useId();\n overlayProps['aria-labelledby'] = triggerProps.id;\n\n return (\n <Provider\n values={[\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [DialogContext, overlayProps],\n [PopoverContext, {trigger: 'DialogTrigger', triggerRef: buttonRef}]\n ]}>\n <PressResponder {...triggerProps} ref={buttonRef} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\n/**\n * A dialog is an overlay shown above other content in an application.\n */\nexport const Dialog = /*#__PURE__*/ (forwardRef as forwardRefType)(function Dialog(props: DialogProps, ref: ForwardedRef<HTMLElement>) {\n let originalAriaLabelledby = props['aria-labelledby'];\n [props, ref] = useContextProps(props, ref, DialogContext);\n let {dialogProps, titleProps} = useDialog({\n ...props,\n // Only pass aria-labelledby from props, not context.\n // Context is used as a fallback below.\n 'aria-labelledby': originalAriaLabelledby\n }, ref);\n let state = useContext(OverlayTriggerStateContext);\n\n if (!dialogProps['aria-label'] && !dialogProps['aria-labelledby']) {\n // If aria-labelledby exists on props, we know it came from context.\n // Use that as a fallback in case there is no title slot.\n if (props['aria-labelledby']) {\n dialogProps['aria-labelledby'] = props['aria-labelledby'];\n } else {\n console.warn('If a Dialog does not contain a <Heading slot=\"title\">, it must have an aria-label or aria-labelledby attribute for accessibility.');\n }\n }\n\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Dialog',\n className: props.className,\n style: props.style,\n children: props.children,\n values: {\n close: state?.close || (() => {})\n }\n });\n\n return (\n <section\n {...filterDOMProps(props)}\n {...dialogProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}>\n <Provider\n values={[\n [HeadingContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: {...titleProps, level: 2}\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: {\n onPress: () => state?.close()\n }\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </section>\n );\n});\n"],"names":[],"version":3,"file":"Dialog.main.js.map"}
|
package/dist/Dialog.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {useOverlayTrigger as $6IYYA$useOverlayTrigger, useId as $6IYYA$useId, us
|
|
|
7
7
|
import {filterDOMProps as $6IYYA$filterDOMProps} from "@react-aria/utils";
|
|
8
8
|
import {useMenuTriggerState as $6IYYA$useMenuTriggerState} from "react-stately";
|
|
9
9
|
import {PressResponder as $6IYYA$PressResponder} from "@react-aria/interactions";
|
|
10
|
-
import $6IYYA$react, {createContext as $6IYYA$createContext, useRef as $6IYYA$useRef,
|
|
10
|
+
import $6IYYA$react, {createContext as $6IYYA$createContext, useRef as $6IYYA$useRef, forwardRef as $6IYYA$forwardRef, useContext as $6IYYA$useContext} from "react";
|
|
11
11
|
|
|
12
12
|
/*
|
|
13
13
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -73,7 +73,7 @@ function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
|
|
|
73
73
|
isPressed: state.isOpen
|
|
74
74
|
}, props.children));
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
const $de32f1b87079253c$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $6IYYA$forwardRef)(function Dialog(props, ref) {
|
|
77
77
|
let originalAriaLabelledby = props['aria-labelledby'];
|
|
78
78
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $de32f1b87079253c$export$8b93a07348a7730c);
|
|
79
79
|
let { dialogProps: dialogProps, titleProps: titleProps } = (0, $6IYYA$useDialog)({
|
|
@@ -131,10 +131,7 @@ function $de32f1b87079253c$var$Dialog(props, ref) {
|
|
|
131
131
|
]
|
|
132
132
|
]
|
|
133
133
|
}, renderProps.children));
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* A dialog is an overlay shown above other content in an application.
|
|
137
|
-
*/ const $de32f1b87079253c$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $6IYYA$forwardRef)($de32f1b87079253c$var$Dialog);
|
|
134
|
+
});
|
|
138
135
|
|
|
139
136
|
|
|
140
137
|
export {$de32f1b87079253c$export$8b93a07348a7730c as DialogContext, $de32f1b87079253c$export$d2f961adcb0afbe as OverlayTriggerStateContext, $de32f1b87079253c$export$2e1e1122cf0cba88 as DialogTrigger, $de32f1b87079253c$export$3ddf2d174ce01153 as Dialog};
|
package/dist/Dialog.module.js
CHANGED
|
@@ -7,7 +7,7 @@ import {useOverlayTrigger as $6IYYA$useOverlayTrigger, useId as $6IYYA$useId, us
|
|
|
7
7
|
import {filterDOMProps as $6IYYA$filterDOMProps} from "@react-aria/utils";
|
|
8
8
|
import {useMenuTriggerState as $6IYYA$useMenuTriggerState} from "react-stately";
|
|
9
9
|
import {PressResponder as $6IYYA$PressResponder} from "@react-aria/interactions";
|
|
10
|
-
import $6IYYA$react, {createContext as $6IYYA$createContext, useRef as $6IYYA$useRef,
|
|
10
|
+
import $6IYYA$react, {createContext as $6IYYA$createContext, useRef as $6IYYA$useRef, forwardRef as $6IYYA$forwardRef, useContext as $6IYYA$useContext} from "react";
|
|
11
11
|
|
|
12
12
|
/*
|
|
13
13
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -73,7 +73,7 @@ function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
|
|
|
73
73
|
isPressed: state.isOpen
|
|
74
74
|
}, props.children));
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
const $de32f1b87079253c$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $6IYYA$forwardRef)(function Dialog(props, ref) {
|
|
77
77
|
let originalAriaLabelledby = props['aria-labelledby'];
|
|
78
78
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $de32f1b87079253c$export$8b93a07348a7730c);
|
|
79
79
|
let { dialogProps: dialogProps, titleProps: titleProps } = (0, $6IYYA$useDialog)({
|
|
@@ -131,10 +131,7 @@ function $de32f1b87079253c$var$Dialog(props, ref) {
|
|
|
131
131
|
]
|
|
132
132
|
]
|
|
133
133
|
}, renderProps.children));
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* A dialog is an overlay shown above other content in an application.
|
|
137
|
-
*/ const $de32f1b87079253c$export$3ddf2d174ce01153 = /*#__PURE__*/ (0, $6IYYA$forwardRef)($de32f1b87079253c$var$Dialog);
|
|
134
|
+
});
|
|
138
135
|
|
|
139
136
|
|
|
140
137
|
export {$de32f1b87079253c$export$8b93a07348a7730c as DialogContext, $de32f1b87079253c$export$d2f961adcb0afbe as OverlayTriggerStateContext, $de32f1b87079253c$export$2e1e1122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AC,kBAAkB,GAAG,KAAK,CAAC,kBAAkB;aAEzD,QAAQ,IAAI,CAAC;;IAIjB,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,kBAAkB;QAClB,WAAW,MAAM,SAAS;QAC1B,OAAO,MAAM,KAAK;QAClB,UAAU,MAAM,QAAQ;QACxB,QAAQ;YACN,OAAO,CAAA,kBAAA,4BAAA,MAAO,KAAK,KAAK,CAAA,KAAO,CAAA;QACjC;IACF;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;QACxB,GAAG,WAAW;QACd,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;qBACpB,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAa;gBAAG;oBACf,OAAO;wBACL,CAAC,CAAA,GAAA,yCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;4BAAC,GAAG,UAAU;4BAAE,OAAO;wBAAC;oBACjC;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAY;gBAAG;oBACd,OAAO;wBACL,CAAC,CAAA,GAAA,yCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;4BACL,SAAS,IAAM,kBAAA,4BAAA,MAAO,KAAK;wBAC7B;oBACF;gBACF;aAAE;SACH;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Dialog.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 */\nimport {AriaDialogProps, useDialog, useId, useOverlayTrigger} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, SlotProps, StyleProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType} from '@react-types/shared';\nimport {HeadingContext} from './RSPContexts';\nimport {OverlayTriggerProps, OverlayTriggerState, useMenuTriggerState} from 'react-stately';\nimport {PopoverContext} from './Popover';\nimport {PressResponder} from '@react-aria/interactions';\nimport React, {createContext, ForwardedRef, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {RootMenuTriggerStateContext} from './Menu';\n\nexport interface DialogTriggerProps extends OverlayTriggerProps {\n children: ReactNode\n}\n\ninterface DialogRenderProps {\n close: () => void\n}\n\nexport interface DialogProps extends AriaDialogProps, StyleProps, SlotProps {\n /** Children of the dialog. A function may be provided to access a function to close the dialog. */\n children?: ReactNode | ((opts: DialogRenderProps) => ReactNode)\n}\n\nexport const DialogContext = createContext<ContextValue<DialogProps, HTMLElement>>(null);\nexport const OverlayTriggerStateContext = createContext<OverlayTriggerState | null>(null);\n\n/**\n * A DialogTrigger opens a dialog when a trigger element is pressed.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n // Use useMenuTriggerState instead of useOverlayTriggerState in case a menu is embedded in the dialog.\n // This is needed to handle submenus.\n let state = useMenuTriggerState(props);\n\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {triggerProps, overlayProps} = useOverlayTrigger({type: 'dialog'}, state, buttonRef);\n\n // Label dialog by the trigger as a fallback if there is no title slot.\n // This is done in RAC instead of hooks because otherwise we cannot distinguish\n // between context and props. Normally aria-labelledby overrides the title\n // but when sent by context we want the title to win.\n triggerProps.id = useId();\n overlayProps['aria-labelledby'] = triggerProps.id;\n\n return (\n <Provider\n values={[\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [DialogContext, overlayProps],\n [PopoverContext, {trigger: 'DialogTrigger', triggerRef: buttonRef}]\n ]}>\n <PressResponder {...triggerProps} ref={buttonRef} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\n/**\n * A dialog is an overlay shown above other content in an application.\n */\nexport const Dialog = /*#__PURE__*/ (forwardRef as forwardRefType)(function Dialog(props: DialogProps, ref: ForwardedRef<HTMLElement>) {\n let originalAriaLabelledby = props['aria-labelledby'];\n [props, ref] = useContextProps(props, ref, DialogContext);\n let {dialogProps, titleProps} = useDialog({\n ...props,\n // Only pass aria-labelledby from props, not context.\n // Context is used as a fallback below.\n 'aria-labelledby': originalAriaLabelledby\n }, ref);\n let state = useContext(OverlayTriggerStateContext);\n\n if (!dialogProps['aria-label'] && !dialogProps['aria-labelledby']) {\n // If aria-labelledby exists on props, we know it came from context.\n // Use that as a fallback in case there is no title slot.\n if (props['aria-labelledby']) {\n dialogProps['aria-labelledby'] = props['aria-labelledby'];\n } else {\n console.warn('If a Dialog does not contain a <Heading slot=\"title\">, it must have an aria-label or aria-labelledby attribute for accessibility.');\n }\n }\n\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Dialog',\n className: props.className,\n style: props.style,\n children: props.children,\n values: {\n close: state?.close || (() => {})\n }\n });\n\n return (\n <section\n {...filterDOMProps(props)}\n {...dialogProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}>\n <Provider\n values={[\n [HeadingContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: {...titleProps, level: 2}\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: {\n onPress: () => state?.close()\n }\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </section>\n );\n});\n"],"names":[],"version":3,"file":"Dialog.module.js.map"}
|
package/dist/Disclosure.main.js
CHANGED
|
@@ -39,7 +39,7 @@ $parcel$export(module.exports, "DisclosurePanel", () => $11c780105231f6ef$export
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
const $11c780105231f6ef$export$1d40e3e0cc4d5de = /*#__PURE__*/ (0, $8afVX$react.createContext)(null);
|
|
42
|
-
|
|
42
|
+
const $11c780105231f6ef$export$944aceb4f8c89f10 = /*#__PURE__*/ (0, $8afVX$react.forwardRef)(function DisclosureGroup(props, ref) {
|
|
43
43
|
let state = (0, $8afVX$reactstatelydisclosure.useDisclosureGroupState)(props);
|
|
44
44
|
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
45
45
|
...props,
|
|
@@ -58,15 +58,11 @@ function $11c780105231f6ef$var$DisclosureGroup(props, ref) {
|
|
|
58
58
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($8afVX$react))).createElement($11c780105231f6ef$export$1d40e3e0cc4d5de.Provider, {
|
|
59
59
|
value: state
|
|
60
60
|
}, renderProps.children));
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.
|
|
64
|
-
* It supports both single and multiple expanded items.
|
|
65
|
-
*/ const $11c780105231f6ef$export$944aceb4f8c89f10 = /*#__PURE__*/ (0, $8afVX$react.forwardRef)($11c780105231f6ef$var$DisclosureGroup);
|
|
61
|
+
});
|
|
66
62
|
const $11c780105231f6ef$export$d665dd135a51b28a = /*#__PURE__*/ (0, $8afVX$react.createContext)(null);
|
|
67
63
|
const $11c780105231f6ef$export$dab3ea4a6ef094da = /*#__PURE__*/ (0, $8afVX$react.createContext)(null);
|
|
68
64
|
const $11c780105231f6ef$var$InternalDisclosureContext = /*#__PURE__*/ (0, $8afVX$react.createContext)(null);
|
|
69
|
-
|
|
65
|
+
const $11c780105231f6ef$export$74a362b31437ec83 = /*#__PURE__*/ (0, $8afVX$react.forwardRef)(function Disclosure(props, ref) {
|
|
70
66
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $11c780105231f6ef$export$d665dd135a51b28a);
|
|
71
67
|
let groupState = (0, $8afVX$react.useContext)($11c780105231f6ef$export$1d40e3e0cc4d5de);
|
|
72
68
|
let { id: id, ...otherProps } = props;
|
|
@@ -138,8 +134,8 @@ function $11c780105231f6ef$var$Disclosure(props, ref) {
|
|
|
138
134
|
...focusWithinProps,
|
|
139
135
|
...renderProps
|
|
140
136
|
}, renderProps.children));
|
|
141
|
-
}
|
|
142
|
-
|
|
137
|
+
});
|
|
138
|
+
const $11c780105231f6ef$export$feabaa331e1d464c = /*#__PURE__*/ (0, $8afVX$react.forwardRef)(function DisclosurePanel(props, ref) {
|
|
143
139
|
let { role: role = 'group' } = props;
|
|
144
140
|
let { panelProps: panelProps, panelRef: panelRef } = (0, $8afVX$react.useContext)($11c780105231f6ef$var$InternalDisclosureContext);
|
|
145
141
|
let { isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps } = (0, $8afVX$reactaria.useFocusRing)({
|
|
@@ -168,13 +164,7 @@ function $11c780105231f6ef$var$DisclosurePanel(props, ref) {
|
|
|
168
164
|
]
|
|
169
165
|
]
|
|
170
166
|
}, props.children));
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.
|
|
174
|
-
*/ const $11c780105231f6ef$export$74a362b31437ec83 = /*#__PURE__*/ (0, $8afVX$react.forwardRef)($11c780105231f6ef$var$Disclosure);
|
|
175
|
-
/**
|
|
176
|
-
* A DisclosurePanel provides the content for a disclosure.
|
|
177
|
-
*/ const $11c780105231f6ef$export$feabaa331e1d464c = /*#__PURE__*/ (0, $8afVX$react.forwardRef)($11c780105231f6ef$var$DisclosurePanel);
|
|
167
|
+
});
|
|
178
168
|
|
|
179
169
|
|
|
180
170
|
//# sourceMappingURL=Disclosure.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBM,MAAM,yDAA8B,CAAA,GAAA,0BAAY,EAA+B;AAEtF,SAAS,sCAAgB,KAA2B,EAAE,GAAiC;IACrF,IAAI,QAAQ,CAAA,GAAA,qDAAsB,EAAE;IAEpC,IAAI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F;IACF;IACA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,qBACE,0DAAC;QACE,GAAG,QAAQ;QACZ,KAAK,CAAA,GAAA,+BAAQ,EAAE,KAAK;QACnB,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,iBAAiB;QAC3C,GAAG,WAAW;QACf,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,uCAAY;gBAAG;aAAK;SACtB;OACA,MAAM,QAAQ;AAIvB;AAEA;;CAEC,GACD,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB;AAGjE;;CAEC,GACD,MAAM,4CAAiC,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaDisclosureProps, useDisclosure} from '@react-aria/disclosure';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DisclosureGroupState, DisclosureState, DisclosureGroupProps as StatelyDisclosureGroupProps, useDisclosureGroupState, useDisclosureState} from '@react-stately/disclosure';\nimport {DOMProps, forwardRefType, Key} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useId} from '@react-aria/utils';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps {}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\nfunction DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props);\n\n return (\n <div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </div>\n );\n}\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nconst _DisclosureGroup = forwardRef(DisclosureGroup);\nexport {_DisclosureGroup as DisclosureGroup};\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps {\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\nfunction Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps as any);\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <div\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}\n {...domProps}\n {...focusWithinProps}\n {...renderProps}>\n {renderProps.children}\n </div>\n </Provider>\n );\n}\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps {\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props);\n return (\n <div\n {...DOMProps}\n ref={mergeRefs(ref, panelRef)}\n {...mergeProps(panelProps, focusWithinProps)}\n {...renderProps}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nconst _Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(Disclosure);\nexport {_Disclosure as Disclosure};\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nconst _DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n"],"names":[],"version":3,"file":"Disclosure.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBM,MAAM,yDAA8B,CAAA,GAAA,0BAAY,EAA+B;AAM/E,MAAM,0DAAkB,CAAA,GAAA,uBAAS,EAAE,SAAS,gBAAgB,KAA2B,EAAE,GAAiC;IAC/H,IAAI,QAAQ,CAAA,GAAA,qDAAsB,EAAE;IAEpC,IAA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AE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;kCACN;QACF;IACF;IACA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,qBACE,0DAAC;QACE,GAAG,QAAQ;QACZ,KAAK,CAAA,GAAA,+BAAQ,EAAE,KAAK;QACnB,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,iBAAiB;QAC3C,GAAG,WAAW;QACf,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,uCAAY;gBAAG;aAAK;SACtB;OACA,MAAM,QAAQ;AAIvB","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaDisclosureProps, useDisclosure} from '@react-aria/disclosure';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DisclosureGroupState, DisclosureState, DisclosureGroupProps as StatelyDisclosureGroupProps, useDisclosureGroupState, useDisclosureState} from '@react-stately/disclosure';\nimport {DOMProps, forwardRefType, Key} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useId} from '@react-aria/utils';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps {}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nexport const DisclosureGroup = forwardRef(function DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props);\n\n return (\n <div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </div>\n );\n});\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps {\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(function Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps as any);\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <div\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}\n {...domProps}\n {...focusWithinProps}\n {...renderProps}>\n {renderProps.children}\n </div>\n </Provider>\n );\n});\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps {\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nexport const DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(function DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props);\n return (\n <div\n {...DOMProps}\n ref={mergeRefs(ref, panelRef)}\n {...mergeProps(panelProps, focusWithinProps)}\n {...renderProps}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Disclosure.main.js.map"}
|
package/dist/Disclosure.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import {useFocusRing as $hI1OT$useFocusRing} from "react-aria";
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
const $28f4fd908f0de97f$export$1d40e3e0cc4d5de = /*#__PURE__*/ (0, $hI1OT$createContext)(null);
|
|
27
|
-
|
|
27
|
+
const $28f4fd908f0de97f$export$944aceb4f8c89f10 = /*#__PURE__*/ (0, $hI1OT$forwardRef)(function DisclosureGroup(props, ref) {
|
|
28
28
|
let state = (0, $hI1OT$useDisclosureGroupState)(props);
|
|
29
29
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
30
30
|
...props,
|
|
@@ -43,15 +43,11 @@ function $28f4fd908f0de97f$var$DisclosureGroup(props, ref) {
|
|
|
43
43
|
}, /*#__PURE__*/ (0, $hI1OT$react).createElement($28f4fd908f0de97f$export$1d40e3e0cc4d5de.Provider, {
|
|
44
44
|
value: state
|
|
45
45
|
}, renderProps.children));
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.
|
|
49
|
-
* It supports both single and multiple expanded items.
|
|
50
|
-
*/ const $28f4fd908f0de97f$export$944aceb4f8c89f10 = /*#__PURE__*/ (0, $hI1OT$forwardRef)($28f4fd908f0de97f$var$DisclosureGroup);
|
|
46
|
+
});
|
|
51
47
|
const $28f4fd908f0de97f$export$d665dd135a51b28a = /*#__PURE__*/ (0, $hI1OT$createContext)(null);
|
|
52
48
|
const $28f4fd908f0de97f$export$dab3ea4a6ef094da = /*#__PURE__*/ (0, $hI1OT$createContext)(null);
|
|
53
49
|
const $28f4fd908f0de97f$var$InternalDisclosureContext = /*#__PURE__*/ (0, $hI1OT$createContext)(null);
|
|
54
|
-
|
|
50
|
+
const $28f4fd908f0de97f$export$74a362b31437ec83 = /*#__PURE__*/ (0, $hI1OT$forwardRef)(function Disclosure(props, ref) {
|
|
55
51
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $28f4fd908f0de97f$export$d665dd135a51b28a);
|
|
56
52
|
let groupState = (0, $hI1OT$useContext)($28f4fd908f0de97f$export$1d40e3e0cc4d5de);
|
|
57
53
|
let { id: id, ...otherProps } = props;
|
|
@@ -123,8 +119,8 @@ function $28f4fd908f0de97f$var$Disclosure(props, ref) {
|
|
|
123
119
|
...focusWithinProps,
|
|
124
120
|
...renderProps
|
|
125
121
|
}, renderProps.children));
|
|
126
|
-
}
|
|
127
|
-
|
|
122
|
+
});
|
|
123
|
+
const $28f4fd908f0de97f$export$feabaa331e1d464c = /*#__PURE__*/ (0, $hI1OT$forwardRef)(function DisclosurePanel(props, ref) {
|
|
128
124
|
let { role: role = 'group' } = props;
|
|
129
125
|
let { panelProps: panelProps, panelRef: panelRef } = (0, $hI1OT$useContext)($28f4fd908f0de97f$var$InternalDisclosureContext);
|
|
130
126
|
let { isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps } = (0, $hI1OT$useFocusRing)({
|
|
@@ -153,13 +149,7 @@ function $28f4fd908f0de97f$var$DisclosurePanel(props, ref) {
|
|
|
153
149
|
]
|
|
154
150
|
]
|
|
155
151
|
}, props.children));
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.
|
|
159
|
-
*/ const $28f4fd908f0de97f$export$74a362b31437ec83 = /*#__PURE__*/ (0, $hI1OT$forwardRef)($28f4fd908f0de97f$var$Disclosure);
|
|
160
|
-
/**
|
|
161
|
-
* A DisclosurePanel provides the content for a disclosure.
|
|
162
|
-
*/ const $28f4fd908f0de97f$export$feabaa331e1d464c = /*#__PURE__*/ (0, $hI1OT$forwardRef)($28f4fd908f0de97f$var$DisclosurePanel);
|
|
152
|
+
});
|
|
163
153
|
|
|
164
154
|
|
|
165
155
|
export {$28f4fd908f0de97f$export$1d40e3e0cc4d5de as DisclosureGroupStateContext, $28f4fd908f0de97f$export$944aceb4f8c89f10 as DisclosureGroup, $28f4fd908f0de97f$export$d665dd135a51b28a as DisclosureContext, $28f4fd908f0de97f$export$dab3ea4a6ef094da as DisclosureStateContext, $28f4fd908f0de97f$export$74a362b31437ec83 as Disclosure, $28f4fd908f0de97f$export$feabaa331e1d464c as DisclosurePanel};
|
|
@@ -24,7 +24,7 @@ import {useFocusRing as $hI1OT$useFocusRing} from "react-aria";
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
const $28f4fd908f0de97f$export$1d40e3e0cc4d5de = /*#__PURE__*/ (0, $hI1OT$createContext)(null);
|
|
27
|
-
|
|
27
|
+
const $28f4fd908f0de97f$export$944aceb4f8c89f10 = /*#__PURE__*/ (0, $hI1OT$forwardRef)(function DisclosureGroup(props, ref) {
|
|
28
28
|
let state = (0, $hI1OT$useDisclosureGroupState)(props);
|
|
29
29
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
30
30
|
...props,
|
|
@@ -43,15 +43,11 @@ function $28f4fd908f0de97f$var$DisclosureGroup(props, ref) {
|
|
|
43
43
|
}, /*#__PURE__*/ (0, $hI1OT$react).createElement($28f4fd908f0de97f$export$1d40e3e0cc4d5de.Provider, {
|
|
44
44
|
value: state
|
|
45
45
|
}, renderProps.children));
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.
|
|
49
|
-
* It supports both single and multiple expanded items.
|
|
50
|
-
*/ const $28f4fd908f0de97f$export$944aceb4f8c89f10 = /*#__PURE__*/ (0, $hI1OT$forwardRef)($28f4fd908f0de97f$var$DisclosureGroup);
|
|
46
|
+
});
|
|
51
47
|
const $28f4fd908f0de97f$export$d665dd135a51b28a = /*#__PURE__*/ (0, $hI1OT$createContext)(null);
|
|
52
48
|
const $28f4fd908f0de97f$export$dab3ea4a6ef094da = /*#__PURE__*/ (0, $hI1OT$createContext)(null);
|
|
53
49
|
const $28f4fd908f0de97f$var$InternalDisclosureContext = /*#__PURE__*/ (0, $hI1OT$createContext)(null);
|
|
54
|
-
|
|
50
|
+
const $28f4fd908f0de97f$export$74a362b31437ec83 = /*#__PURE__*/ (0, $hI1OT$forwardRef)(function Disclosure(props, ref) {
|
|
55
51
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $28f4fd908f0de97f$export$d665dd135a51b28a);
|
|
56
52
|
let groupState = (0, $hI1OT$useContext)($28f4fd908f0de97f$export$1d40e3e0cc4d5de);
|
|
57
53
|
let { id: id, ...otherProps } = props;
|
|
@@ -123,8 +119,8 @@ function $28f4fd908f0de97f$var$Disclosure(props, ref) {
|
|
|
123
119
|
...focusWithinProps,
|
|
124
120
|
...renderProps
|
|
125
121
|
}, renderProps.children));
|
|
126
|
-
}
|
|
127
|
-
|
|
122
|
+
});
|
|
123
|
+
const $28f4fd908f0de97f$export$feabaa331e1d464c = /*#__PURE__*/ (0, $hI1OT$forwardRef)(function DisclosurePanel(props, ref) {
|
|
128
124
|
let { role: role = 'group' } = props;
|
|
129
125
|
let { panelProps: panelProps, panelRef: panelRef } = (0, $hI1OT$useContext)($28f4fd908f0de97f$var$InternalDisclosureContext);
|
|
130
126
|
let { isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps } = (0, $hI1OT$useFocusRing)({
|
|
@@ -153,13 +149,7 @@ function $28f4fd908f0de97f$var$DisclosurePanel(props, ref) {
|
|
|
153
149
|
]
|
|
154
150
|
]
|
|
155
151
|
}, props.children));
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.
|
|
159
|
-
*/ const $28f4fd908f0de97f$export$74a362b31437ec83 = /*#__PURE__*/ (0, $hI1OT$forwardRef)($28f4fd908f0de97f$var$Disclosure);
|
|
160
|
-
/**
|
|
161
|
-
* A DisclosurePanel provides the content for a disclosure.
|
|
162
|
-
*/ const $28f4fd908f0de97f$export$feabaa331e1d464c = /*#__PURE__*/ (0, $hI1OT$forwardRef)($28f4fd908f0de97f$var$DisclosurePanel);
|
|
152
|
+
});
|
|
163
153
|
|
|
164
154
|
|
|
165
155
|
export {$28f4fd908f0de97f$export$1d40e3e0cc4d5de as DisclosureGroupStateContext, $28f4fd908f0de97f$export$944aceb4f8c89f10 as DisclosureGroup, $28f4fd908f0de97f$export$d665dd135a51b28a as DisclosureContext, $28f4fd908f0de97f$export$dab3ea4a6ef094da as DisclosureStateContext, $28f4fd908f0de97f$export$74a362b31437ec83 as Disclosure, $28f4fd908f0de97f$export$feabaa331e1d464c as DisclosurePanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBM,MAAM,yDAA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AW,EAAE;QAAC,QAAQ;IAAI;IAC9B,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;kCACN;QACF;IACF;IACA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAC9B,qBACE,gCAAC;QACE,GAAG,QAAQ;QACZ,KAAK,CAAA,GAAA,gBAAQ,EAAE,KAAK;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,iBAAiB;QAC3C,GAAG,WAAW;QACf,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAK;SACtB;OACA,MAAM,QAAQ;AAIvB;AAEA;;CAEC,GACD,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB;AAGjE;;CAEC,GACD,MAAM,4CAAiC,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaDisclosureProps, useDisclosure} from '@react-aria/disclosure';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DisclosureGroupState, DisclosureState, DisclosureGroupProps as StatelyDisclosureGroupProps, useDisclosureGroupState, useDisclosureState} from '@react-stately/disclosure';\nimport {DOMProps, forwardRefType, Key} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useId} from '@react-aria/utils';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps {}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\nfunction DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props);\n\n return (\n <div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </div>\n );\n}\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nconst _DisclosureGroup = forwardRef(DisclosureGroup);\nexport {_DisclosureGroup as DisclosureGroup};\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps {\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\nfunction Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps as any);\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <div\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}\n {...domProps}\n {...focusWithinProps}\n {...renderProps}>\n {renderProps.children}\n </div>\n </Provider>\n );\n}\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps {\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props);\n return (\n <div\n {...DOMProps}\n ref={mergeRefs(ref, panelRef)}\n {...mergeProps(panelProps, focusWithinProps)}\n {...renderProps}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nconst _Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(Disclosure);\nexport {_Disclosure as Disclosure};\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nconst _DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n"],"names":[],"version":3,"file":"Disclosure.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBM,MAAM,yDAA8B,CAAA,GAAA,oBAAY,EAA+B;AAM/E,MAAM,0DAAkB,CAAA,GA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gBAAgB,EAC7B,GAAG,CAAA,GAAA,mBAAW,EAAE;QAAC,QAAQ;IAAI;IAC9B,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;kCACN;QACF;IACF;IACA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAC9B,qBACE,gCAAC;QACE,GAAG,QAAQ;QACZ,KAAK,CAAA,GAAA,gBAAQ,EAAE,KAAK;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,iBAAiB;QAC3C,GAAG,WAAW;QACf,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAK;SACtB;OACA,MAAM,QAAQ;AAIvB","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {AriaDisclosureProps, useDisclosure} from '@react-aria/disclosure';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DisclosureGroupState, DisclosureState, DisclosureGroupProps as StatelyDisclosureGroupProps, useDisclosureGroupState, useDisclosureState} from '@react-stately/disclosure';\nimport {DOMProps, forwardRefType, Key} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useId} from '@react-aria/utils';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps {}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nexport const DisclosureGroup = forwardRef(function DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props);\n\n return (\n <div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </div>\n );\n});\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps {\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nexport const Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(function Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps as any);\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <div\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}\n {...domProps}\n {...focusWithinProps}\n {...renderProps}>\n {renderProps.children}\n </div>\n </Provider>\n );\n});\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps {\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nexport const DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(function DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props);\n return (\n <div\n {...DOMProps}\n ref={mergeRefs(ref, panelRef)}\n {...mergeProps(panelProps, focusWithinProps)}\n {...renderProps}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Disclosure.module.js.map"}
|