react-aria-components 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Autocomplete.main.js +23 -12
- package/dist/Autocomplete.main.js.map +1 -1
- package/dist/Autocomplete.mjs +23 -12
- package/dist/Autocomplete.module.js +23 -12
- package/dist/Autocomplete.module.js.map +1 -1
- package/dist/Checkbox.main.js +1 -1
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +1 -1
- package/dist/Checkbox.module.js +1 -1
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorArea.main.js +4 -4
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +2 -2
- package/dist/ColorArea.module.js +2 -2
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +8 -10
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +4 -6
- package/dist/ColorField.module.js +4 -6
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorPicker.main.js +2 -2
- package/dist/ColorPicker.main.js.map +1 -1
- package/dist/ColorPicker.mjs +1 -1
- package/dist/ColorPicker.module.js +1 -1
- package/dist/ColorPicker.module.js.map +1 -1
- package/dist/ColorSlider.main.js +5 -7
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +3 -5
- package/dist/ColorSlider.module.js +3 -5
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +2 -2
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +1 -1
- package/dist/ColorSwatch.module.js +1 -1
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js +3 -3
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.mjs +1 -1
- package/dist/ColorSwatchPicker.module.js +1 -1
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +2 -6
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +1 -5
- package/dist/ColorThumb.module.js +1 -5
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +4 -4
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +2 -2
- package/dist/ColorWheel.module.js +2 -2
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +1 -1
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +1 -1
- package/dist/ComboBox.module.js +1 -1
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +4 -3
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +4 -3
- package/dist/DateField.module.js +4 -3
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +2 -2
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +2 -2
- package/dist/DatePicker.module.js +2 -2
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +2 -1
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +2 -1
- package/dist/Dialog.module.js +2 -1
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +5 -7
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +2 -4
- package/dist/Disclosure.module.js +2 -4
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DropZone.main.js +1 -3
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +1 -3
- package/dist/DropZone.module.js +1 -3
- package/dist/DropZone.module.js.map +1 -1
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.module.js.map +1 -1
- package/dist/Group.main.js.map +1 -1
- package/dist/Group.module.js.map +1 -1
- package/dist/ListBox.main.js +17 -16
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +19 -18
- package/dist/ListBox.module.js +19 -18
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +39 -24
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +40 -25
- package/dist/Menu.module.js +40 -25
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +1 -1
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +1 -1
- package/dist/Meter.module.js +1 -1
- package/dist/Meter.module.js.map +1 -1
- package/dist/NumberField.main.js +4 -2
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +4 -2
- package/dist/NumberField.module.js +4 -2
- package/dist/NumberField.module.js.map +1 -1
- package/dist/Popover.main.js +67 -15
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +69 -17
- package/dist/Popover.module.js +69 -17
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +1 -1
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +1 -1
- package/dist/ProgressBar.module.js +1 -1
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +1 -1
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +1 -1
- package/dist/RadioGroup.module.js +1 -1
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +4 -2
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +5 -3
- package/dist/SearchField.module.js +5 -3
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +3 -2
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +3 -2
- package/dist/Select.module.js +3 -2
- package/dist/Select.module.js.map +1 -1
- package/dist/Slider.main.js +2 -2
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +2 -2
- package/dist/Slider.module.js +2 -2
- package/dist/Slider.module.js.map +1 -1
- package/dist/Table.main.js +15 -6
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +15 -6
- package/dist/Table.module.js +15 -6
- package/dist/Table.module.js.map +1 -1
- package/dist/TableLayout.main.js.map +1 -1
- package/dist/TableLayout.module.js.map +1 -1
- package/dist/Tabs.main.js +3 -2
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +4 -3
- package/dist/Tabs.module.js +4 -3
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +1 -1
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +1 -1
- package/dist/TagGroup.module.js +1 -1
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/TextField.main.js +4 -2
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +5 -3
- package/dist/TextField.module.js +5 -3
- package/dist/TextField.module.js.map +1 -1
- package/dist/Toast.main.js +148 -0
- package/dist/Toast.main.js.map +1 -0
- package/dist/Toast.mjs +137 -0
- package/dist/Toast.module.js +137 -0
- package/dist/Toast.module.js.map +1 -0
- package/dist/Tree.main.js +38 -34
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +34 -30
- package/dist/Tree.module.js +34 -30
- package/dist/Tree.module.js.map +1 -1
- package/dist/Virtualizer.main.js +4 -1
- package/dist/Virtualizer.main.js.map +1 -1
- package/dist/Virtualizer.mjs +4 -1
- package/dist/Virtualizer.module.js +4 -1
- package/dist/Virtualizer.module.js.map +1 -1
- package/dist/import.mjs +9 -7
- package/dist/main.js +31 -17
- package/dist/main.js.map +1 -1
- package/dist/module.js +9 -7
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +159 -59
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.main.js +9 -7
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.mjs +9 -7
- package/dist/utils.module.js +9 -7
- package/dist/utils.module.js.map +1 -1
- package/i18n/index.js +1 -1
- package/i18n/index.mjs +1 -1
- package/package.json +25 -30
- package/src/Autocomplete.tsx +19 -15
- package/src/Checkbox.tsx +3 -1
- package/src/Collection.tsx +2 -2
- package/src/ColorArea.tsx +2 -3
- package/src/ColorField.tsx +8 -6
- package/src/ColorPicker.tsx +1 -2
- package/src/ColorSlider.tsx +5 -5
- package/src/ColorSwatch.tsx +2 -2
- package/src/ColorSwatchPicker.tsx +1 -1
- package/src/ColorThumb.tsx +2 -4
- package/src/ColorWheel.tsx +2 -2
- package/src/ComboBox.tsx +3 -1
- package/src/DateField.tsx +8 -3
- package/src/DatePicker.tsx +6 -2
- package/src/Dialog.tsx +6 -2
- package/src/Disclosure.tsx +2 -3
- package/src/DropZone.tsx +1 -2
- package/src/GridList.tsx +5 -0
- package/src/Group.tsx +1 -0
- package/src/ListBox.tsx +11 -9
- package/src/Menu.tsx +53 -25
- package/src/Meter.tsx +3 -1
- package/src/NumberField.tsx +11 -2
- package/src/Popover.tsx +77 -25
- package/src/ProgressBar.tsx +3 -1
- package/src/RadioGroup.tsx +3 -1
- package/src/SearchField.tsx +6 -4
- package/src/Select.tsx +5 -2
- package/src/Slider.tsx +6 -2
- package/src/Table.tsx +35 -15
- package/src/TableLayout.ts +1 -1
- package/src/Tabs.tsx +6 -3
- package/src/TagGroup.tsx +3 -1
- package/src/TextField.tsx +6 -4
- package/src/Toast.tsx +184 -0
- package/src/Tree.tsx +67 -49
- package/src/Virtualizer.tsx +18 -3
- package/src/index.ts +16 -16
- package/src/utils.tsx +8 -10
package/dist/DateField.mjs
CHANGED
|
@@ -50,7 +50,7 @@ const $40825cdb76e74f70$export$d9781c7894a82487 = /*#__PURE__*/ (0, $a9Sgq$forwa
|
|
|
50
50
|
validationBehavior: validationBehavior
|
|
51
51
|
});
|
|
52
52
|
let fieldRef = (0, $a9Sgq$useRef)(null);
|
|
53
|
-
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
53
|
+
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);
|
|
54
54
|
let inputRef = (0, $a9Sgq$useRef)(null);
|
|
55
55
|
let { labelProps: labelProps, fieldProps: fieldProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $a9Sgq$useDateField)({
|
|
56
56
|
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
@@ -132,7 +132,7 @@ const $40825cdb76e74f70$export$5eaee2322dd727eb = /*#__PURE__*/ (0, $a9Sgq$forwa
|
|
|
132
132
|
validationBehavior: validationBehavior
|
|
133
133
|
});
|
|
134
134
|
let fieldRef = (0, $a9Sgq$useRef)(null);
|
|
135
|
-
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
135
|
+
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);
|
|
136
136
|
let inputRef = (0, $a9Sgq$useRef)(null);
|
|
137
137
|
let { labelProps: labelProps, fieldProps: fieldProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $a9Sgq$useTimeField)({
|
|
138
138
|
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
@@ -294,9 +294,10 @@ const $40825cdb76e74f70$export$336ab7fa954c4b5f = /*#__PURE__*/ (0, $a9Sgq$forwa
|
|
|
294
294
|
defaultChildren: segment.text,
|
|
295
295
|
defaultClassName: 'react-aria-DateSegment'
|
|
296
296
|
});
|
|
297
|
-
return /*#__PURE__*/ (0, $a9Sgq$react).createElement("
|
|
297
|
+
return /*#__PURE__*/ (0, $a9Sgq$react).createElement("span", {
|
|
298
298
|
...(0, $a9Sgq$mergeProps)((0, $a9Sgq$filterDOMProps)(otherProps), segmentProps, focusProps, hoverProps),
|
|
299
299
|
...renderProps,
|
|
300
|
+
style: segmentProps.style,
|
|
300
301
|
ref: domRef,
|
|
301
302
|
"data-placeholder": segment.isPlaceholder || undefined,
|
|
302
303
|
"data-invalid": state.isInvalid || undefined,
|
package/dist/DateField.module.js
CHANGED
|
@@ -50,7 +50,7 @@ const $40825cdb76e74f70$export$d9781c7894a82487 = /*#__PURE__*/ (0, $a9Sgq$forwa
|
|
|
50
50
|
validationBehavior: validationBehavior
|
|
51
51
|
});
|
|
52
52
|
let fieldRef = (0, $a9Sgq$useRef)(null);
|
|
53
|
-
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
53
|
+
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);
|
|
54
54
|
let inputRef = (0, $a9Sgq$useRef)(null);
|
|
55
55
|
let { labelProps: labelProps, fieldProps: fieldProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $a9Sgq$useDateField)({
|
|
56
56
|
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
@@ -132,7 +132,7 @@ const $40825cdb76e74f70$export$5eaee2322dd727eb = /*#__PURE__*/ (0, $a9Sgq$forwa
|
|
|
132
132
|
validationBehavior: validationBehavior
|
|
133
133
|
});
|
|
134
134
|
let fieldRef = (0, $a9Sgq$useRef)(null);
|
|
135
|
-
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
135
|
+
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);
|
|
136
136
|
let inputRef = (0, $a9Sgq$useRef)(null);
|
|
137
137
|
let { labelProps: labelProps, fieldProps: fieldProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $a9Sgq$useTimeField)({
|
|
138
138
|
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
@@ -294,9 +294,10 @@ const $40825cdb76e74f70$export$336ab7fa954c4b5f = /*#__PURE__*/ (0, $a9Sgq$forwa
|
|
|
294
294
|
defaultChildren: segment.text,
|
|
295
295
|
defaultClassName: 'react-aria-DateSegment'
|
|
296
296
|
});
|
|
297
|
-
return /*#__PURE__*/ (0, $a9Sgq$react).createElement("
|
|
297
|
+
return /*#__PURE__*/ (0, $a9Sgq$react).createElement("span", {
|
|
298
298
|
...(0, $a9Sgq$mergeProps)((0, $a9Sgq$filterDOMProps)(otherProps), segmentProps, focusProps, hoverProps),
|
|
299
299
|
...renderProps,
|
|
300
|
+
style: segmentProps.style,
|
|
300
301
|
ref: domRef,
|
|
301
302
|
"data-placeholder": segment.isPlaceholder || undefined,
|
|
302
303
|
"data-invalid": state.isInvalid || undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAkCM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAqD;AAC1F,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAqD;AAC1F,MAAM,0DAAwB,CAAA,GAAA,oBAAY,EAAyB;AACnE,MAAM,0DAAwB,CAAA,GAAA,oBAAY,EAAyB;AAMnE,MAAM,4CAA0B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,UAA+B,KAAwB,EAAE,GAAiC;IACvK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;wBACA;4BACA;IACF;IAEA,IAAI,WAAW,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iBAAkB;IAC9B,IAAI,SAAS,CAAA,GAAA,mBAAW,EAAE;IAC1B,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE,SAAS,OAAO;IACpD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IACzD,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QAAC,GAAG,UAAU;QAAE,YAAY,MAAM,UAAU,IAAI,QAAQ,IAAI,KAAK;IAAS;IACjH,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,QAAQ;YACN,GAAG,OAAO;YACV,YAAY,CAAC,QAAQ,UAAU;YAC/B,WAAW,MAAM,SAAS;YAC1B,YAAY,MAAM,UAAU;uBAC5B;uBACA;4BACA;QACF;QACA,iBAAiB,QAAQ,IAAI;QAC7B,kBAAkB;IACpB;IAGA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,aAAoB,cAAc,YAAY,WAAW;QACtF,GAAG,WAAW;QACf,KAAK;QACL,oBAAkB,QAAQ,aAAa,IAAI;QAC3C,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,CAAC,QAAQ,UAAU,IAAI;QACtC,iBAAe,MAAM,UAAU,IAAI;QACnC,aAAW,QAAQ,IAAI;QACvB,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;;AAE5C","sources":["packages/react-aria-components/src/DateField.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 {AriaDateFieldProps, AriaTimeFieldProps, DateValue, HoverEvents, mergeProps, TimeValue, useDateField, useDateSegment, useFocusRing, useHover, useLocale, useTimeField} from 'react-aria';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {createCalendar} from '@internationalized/date';\nimport {DateFieldState, DateSegmentType, DateSegment as IDateSegment, TimeFieldState, useDateFieldState, useTimeFieldState} from 'react-stately';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType} from '@react-types/shared';\nimport {Group, GroupContext} from './Group';\nimport {Input, InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport React, {cloneElement, createContext, ForwardedRef, forwardRef, JSX, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface DateFieldRenderProps {\n /**\n * State of the date field.\n */\n state: DateFieldState,\n /**\n * Whether the date field is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the date field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\nexport interface DateFieldProps<T extends DateValue> extends Omit<AriaDateFieldProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<DateFieldRenderProps>, SlotProps {}\nexport interface TimeFieldProps<T extends TimeValue> extends Omit<AriaTimeFieldProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<DateFieldRenderProps>, SlotProps {}\n\nexport const DateFieldContext = createContext<ContextValue<DateFieldProps<any>, HTMLDivElement>>(null);\nexport const TimeFieldContext = createContext<ContextValue<TimeFieldProps<any>, HTMLDivElement>>(null);\nexport const DateFieldStateContext = createContext<DateFieldState | null>(null);\nexport const TimeFieldStateContext = createContext<TimeFieldState | null>(null);\n\n/**\n * A date field allows users to enter and edit date and time values using a keyboard.\n * Each part of a date value is displayed in an individually editable segment.\n */\nexport const DateField = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateField<T extends DateValue>(props: DateFieldProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DateFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...props,\n locale,\n createCalendar,\n validationBehavior\n });\n\n let fieldRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot();\n let inputRef = useRef<HTMLInputElement>(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useDateField({\n ...removeDataAttributes(props),\n label,\n inputRef,\n validationBehavior\n }, state, fieldRef);\n\n let renderProps = useRenderProps({\n ...removeDataAttributes(props),\n values: {\n state,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled\n },\n defaultClassName: 'react-aria-DateField'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DateFieldStateContext, state],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid}],\n [InputContext, {...inputProps, ref: inputRef}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-invalid={state.isInvalid || undefined} />\n </Provider>\n );\n});\n\n/**\n * A time field allows users to enter and edit time values using a keyboard.\n * Each part of a time value is displayed in an individually editable segment.\n */\nexport const TimeField = /*#__PURE__*/ (forwardRef as forwardRefType)(function TimeField<T extends TimeValue>(props: TimeFieldProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TimeFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale,\n validationBehavior\n });\n\n let fieldRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot();\n let inputRef = useRef<HTMLInputElement>(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useTimeField({\n ...removeDataAttributes(props),\n label,\n inputRef,\n validationBehavior\n }, state, fieldRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled\n },\n defaultClassName: 'react-aria-TimeField'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [TimeFieldStateContext, state],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid}],\n [InputContext, {...inputProps, ref: inputRef}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-invalid={state.isInvalid || undefined} />\n </Provider>\n );\n});\n\nexport interface DateInputRenderProps {\n /**\n * Whether the date input is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether an element within the date input 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 input is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the date input is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n\n /**\n * Whether the date input is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface DateInputProps extends SlotProps, StyleRenderProps<DateInputRenderProps> {\n children: (segment: IDateSegment) => ReactElement\n}\n\n/**\n * A date input groups the editable date segments within a date field.\n */\nexport const DateInput = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateInput(props: DateInputProps, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n // If state is provided by DateField/TimeField, just render.\n // Otherwise (e.g. in DatePicker), we need to call hooks and create state ourselves.\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n return dateFieldState || timeFieldState\n ? <DateInputInner {...props} ref={ref} />\n : <DateInputStandalone {...props} ref={ref} />;\n});\n\nconst DateInputStandalone = forwardRef((props: DateInputProps, ref: ForwardedRef<HTMLDivElement>) => {\n let [dateFieldProps, fieldRef] = useContextProps({slot: props.slot} as DateFieldProps<any>, ref, DateFieldContext);\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...dateFieldProps,\n locale,\n createCalendar\n });\n\n let inputRef = useRef<HTMLInputElement>(null);\n let {fieldProps, inputProps} = useDateField({...dateFieldProps, inputRef}, state, fieldRef);\n\n return (\n <Provider\n values={[\n [DateFieldStateContext, state],\n [InputContext, {...inputProps, ref: inputRef}],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid}]\n ]}>\n <DateInputInner {...props} />\n </Provider>\n );\n});\n\nconst DateInputInner = forwardRef((props: DateInputProps, ref: ForwardedRef<HTMLDivElement>) => {\n let {className, children} = props;\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n let state = dateFieldState ?? timeFieldState!;\n\n return (\n <>\n <Group\n {...props}\n ref={ref}\n slot={props.slot || undefined}\n className={className ?? 'react-aria-DateInput'}\n isInvalid={state.isInvalid}>\n {state.segments.map((segment, i) => cloneElement(children(segment), {key: i}))}\n </Group>\n <Input />\n </>\n );\n});\n\nexport interface DateSegmentRenderProps extends Omit<IDateSegment, 'isEditable'> {\n /**\n * Whether the segment is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the segment is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the segment is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the value is a placeholder.\n * @selector [data-placeholder]\n */\n isPlaceholder: boolean,\n /**\n * Whether the segment is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the date field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date field is in an invalid state.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * The type of segment. Values include `literal`, `year`, `month`, `day`, etc.\n * @selector [data-type=\"...\"]\n */\n type: DateSegmentType\n}\n\nexport interface DateSegmentProps extends RenderProps<DateSegmentRenderProps>, HoverEvents {\n segment: IDateSegment\n}\n\n/**\n * A date segment displays an individual unit of a date and time, and allows users to edit\n * the value by typing or using the arrow keys to increment and decrement.\n */\nexport const DateSegment = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateSegment({segment, ...otherProps}: DateSegmentProps, ref: ForwardedRef<HTMLDivElement>) {\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n let state = dateFieldState ?? timeFieldState!;\n let domRef = useObjectRef(ref);\n let {segmentProps} = useDateSegment(segment, state, domRef);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: state.isDisabled || segment.type === 'literal'});\n let renderProps = useRenderProps({\n ...otherProps,\n values: {\n ...segment,\n isReadOnly: !segment.isEditable,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled,\n isHovered,\n isFocused,\n isFocusVisible\n },\n defaultChildren: segment.text,\n defaultClassName: 'react-aria-DateSegment'\n });\n\n\n return (\n <div\n {...mergeProps(filterDOMProps(otherProps as any), segmentProps, focusProps, hoverProps)}\n {...renderProps}\n ref={domRef}\n data-placeholder={segment.isPlaceholder || undefined}\n data-invalid={state.isInvalid || undefined}\n data-readonly={!segment.isEditable || undefined}\n data-disabled={state.isDisabled || undefined}\n data-type={segment.type}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"DateField.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAkCM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAqD;AAC1F,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAqD;AAC1F,MAAM,0DAAwB,CAAA,GAAA,oBAAY,EAAyB;AACnE,MAAM,0DAAwB,CAAA,GAAA,oBAAY,EAAyB;AAMnE,MAAM,4CAA0B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,UAA+B,KAAwB,EAAE,GAAiC;IACvK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;wBACA;4BACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAAkB;IACtC,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM,EAC5B,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IAEnD,IAAI,WAAW,CAAA,GAAA,aAAK,E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C1B,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE,SAAS,OAAO;IACpD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IACzD,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QAAC,GAAG,UAAU;QAAE,YAAY,MAAM,UAAU,IAAI,QAAQ,IAAI,KAAK;IAAS;IACjH,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,QAAQ;YACN,GAAG,OAAO;YACV,YAAY,CAAC,QAAQ,UAAU;YAC/B,WAAW,MAAM,SAAS;YAC1B,YAAY,MAAM,UAAU;uBAC5B;uBACA;4BACA;QACF;QACA,iBAAiB,QAAQ,IAAI;QAC7B,kBAAkB;IACpB;IAGA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,aAAoB,cAAc,YAAY,WAAW;QACtF,GAAG,WAAW;QACf,OAAO,aAAa,KAAK;QACzB,KAAK;QACL,oBAAkB,QAAQ,aAAa,IAAI;QAC3C,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,CAAC,QAAQ,UAAU,IAAI;QACtC,iBAAe,MAAM,UAAU,IAAI;QACnC,aAAW,QAAQ,IAAI;QACvB,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;;AAE5C","sources":["packages/react-aria-components/src/DateField.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 {AriaDateFieldProps, AriaTimeFieldProps, DateValue, HoverEvents, mergeProps, TimeValue, useDateField, useDateSegment, useFocusRing, useHover, useLocale, useTimeField} from 'react-aria';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {createCalendar} from '@internationalized/date';\nimport {DateFieldState, DateSegmentType, DateSegment as IDateSegment, TimeFieldState, useDateFieldState, useTimeFieldState} from 'react-stately';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType} from '@react-types/shared';\nimport {Group, GroupContext} from './Group';\nimport {Input, InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport React, {cloneElement, createContext, ForwardedRef, forwardRef, JSX, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface DateFieldRenderProps {\n /**\n * State of the date field.\n */\n state: DateFieldState,\n /**\n * Whether the date field is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the date field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\nexport interface DateFieldProps<T extends DateValue> extends Omit<AriaDateFieldProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<DateFieldRenderProps>, SlotProps {}\nexport interface TimeFieldProps<T extends TimeValue> extends Omit<AriaTimeFieldProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<DateFieldRenderProps>, SlotProps {}\n\nexport const DateFieldContext = createContext<ContextValue<DateFieldProps<any>, HTMLDivElement>>(null);\nexport const TimeFieldContext = createContext<ContextValue<TimeFieldProps<any>, HTMLDivElement>>(null);\nexport const DateFieldStateContext = createContext<DateFieldState | null>(null);\nexport const TimeFieldStateContext = createContext<TimeFieldState | null>(null);\n\n/**\n * A date field allows users to enter and edit date and time values using a keyboard.\n * Each part of a date value is displayed in an individually editable segment.\n */\nexport const DateField = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateField<T extends DateValue>(props: DateFieldProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DateFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...props,\n locale,\n createCalendar,\n validationBehavior\n });\n\n let fieldRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let inputRef = useRef<HTMLInputElement>(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useDateField({\n ...removeDataAttributes(props),\n label,\n inputRef,\n validationBehavior\n }, state, fieldRef);\n\n let renderProps = useRenderProps({\n ...removeDataAttributes(props),\n values: {\n state,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled\n },\n defaultClassName: 'react-aria-DateField'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DateFieldStateContext, state],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid}],\n [InputContext, {...inputProps, ref: inputRef}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-invalid={state.isInvalid || undefined} />\n </Provider>\n );\n});\n\n/**\n * A time field allows users to enter and edit time values using a keyboard.\n * Each part of a time value is displayed in an individually editable segment.\n */\nexport const TimeField = /*#__PURE__*/ (forwardRef as forwardRefType)(function TimeField<T extends TimeValue>(props: TimeFieldProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TimeFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale,\n validationBehavior\n });\n\n let fieldRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let inputRef = useRef<HTMLInputElement>(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useTimeField({\n ...removeDataAttributes(props),\n label,\n inputRef,\n validationBehavior\n }, state, fieldRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled\n },\n defaultClassName: 'react-aria-TimeField'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [TimeFieldStateContext, state],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid}],\n [InputContext, {...inputProps, ref: inputRef}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-invalid={state.isInvalid || undefined} />\n </Provider>\n );\n});\n\nexport interface DateInputRenderProps {\n /**\n * Whether the date input is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether an element within the date input 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 input is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the date input is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n\n /**\n * Whether the date input is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface DateInputProps extends SlotProps, StyleRenderProps<DateInputRenderProps> {\n children: (segment: IDateSegment) => ReactElement\n}\n\n/**\n * A date input groups the editable date segments within a date field.\n */\nexport const DateInput = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateInput(props: DateInputProps, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n // If state is provided by DateField/TimeField, just render.\n // Otherwise (e.g. in DatePicker), we need to call hooks and create state ourselves.\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n return dateFieldState || timeFieldState\n ? <DateInputInner {...props} ref={ref} />\n : <DateInputStandalone {...props} ref={ref} />;\n});\n\nconst DateInputStandalone = forwardRef((props: DateInputProps, ref: ForwardedRef<HTMLDivElement>) => {\n let [dateFieldProps, fieldRef] = useContextProps({slot: props.slot} as DateFieldProps<any>, ref, DateFieldContext);\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...dateFieldProps,\n locale,\n createCalendar\n });\n\n let inputRef = useRef<HTMLInputElement>(null);\n let {fieldProps, inputProps} = useDateField({...dateFieldProps, inputRef}, state, fieldRef);\n\n return (\n <Provider\n values={[\n [DateFieldStateContext, state],\n [InputContext, {...inputProps, ref: inputRef}],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid}]\n ]}>\n <DateInputInner {...props} />\n </Provider>\n );\n});\n\nconst DateInputInner = forwardRef((props: DateInputProps, ref: ForwardedRef<HTMLDivElement>) => {\n let {className, children} = props;\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n let state = dateFieldState ?? timeFieldState!;\n\n return (\n <>\n <Group\n {...props}\n ref={ref}\n slot={props.slot || undefined}\n className={className ?? 'react-aria-DateInput'}\n isInvalid={state.isInvalid}>\n {state.segments.map((segment, i) => cloneElement(children(segment), {key: i}))}\n </Group>\n <Input />\n </>\n );\n});\n\nexport interface DateSegmentRenderProps extends Omit<IDateSegment, 'isEditable'> {\n /**\n * Whether the segment is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the segment is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the segment is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the value is a placeholder.\n * @selector [data-placeholder]\n */\n isPlaceholder: boolean,\n /**\n * Whether the segment is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the date field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date field is in an invalid state.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * The type of segment. Values include `literal`, `year`, `month`, `day`, etc.\n * @selector [data-type=\"...\"]\n */\n type: DateSegmentType\n}\n\nexport interface DateSegmentProps extends RenderProps<DateSegmentRenderProps>, HoverEvents {\n segment: IDateSegment\n}\n\n/**\n * A date segment displays an individual unit of a date and time, and allows users to edit\n * the value by typing or using the arrow keys to increment and decrement.\n */\nexport const DateSegment = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateSegment({segment, ...otherProps}: DateSegmentProps, ref: ForwardedRef<HTMLDivElement>) {\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n let state = dateFieldState ?? timeFieldState!;\n let domRef = useObjectRef(ref);\n let {segmentProps} = useDateSegment(segment, state, domRef);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: state.isDisabled || segment.type === 'literal'});\n let renderProps = useRenderProps({\n ...otherProps,\n values: {\n ...segment,\n isReadOnly: !segment.isEditable,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled,\n isHovered,\n isFocused,\n isFocusVisible\n },\n defaultChildren: segment.text,\n defaultClassName: 'react-aria-DateSegment'\n });\n\n\n return (\n <span\n {...mergeProps(filterDOMProps(otherProps as any), segmentProps, focusProps, hoverProps)}\n {...renderProps}\n style={segmentProps.style}\n ref={domRef}\n data-placeholder={segment.isPlaceholder || undefined}\n data-invalid={state.isInvalid || undefined}\n data-readonly={!segment.isEditable || undefined}\n data-disabled={state.isDisabled || undefined}\n data-type={segment.type}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"DateField.module.js.map"}
|
package/dist/DatePicker.main.js
CHANGED
|
@@ -68,7 +68,7 @@ const $adfe8d3f75d5162e$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $bhT4V$react
|
|
|
68
68
|
validationBehavior: validationBehavior
|
|
69
69
|
});
|
|
70
70
|
let groupRef = (0, $bhT4V$react.useRef)(null);
|
|
71
|
-
let [labelRef, label] = (0, $c5ccf687772c0422$exports.useSlot)();
|
|
71
|
+
let [labelRef, label] = (0, $c5ccf687772c0422$exports.useSlot)(!props['aria-label'] && !props['aria-labelledby']);
|
|
72
72
|
let { groupProps: groupProps, labelProps: labelProps, fieldProps: fieldProps, buttonProps: buttonProps, dialogProps: dialogProps, calendarProps: calendarProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $bhT4V$reactaria.useDatePicker)({
|
|
73
73
|
...(0, $c5ccf687772c0422$exports.removeDataAttributes)(props),
|
|
74
74
|
label: label,
|
|
@@ -193,7 +193,7 @@ const $adfe8d3f75d5162e$export$17334619f3ac2224 = /*#__PURE__*/ (0, $bhT4V$react
|
|
|
193
193
|
validationBehavior: validationBehavior
|
|
194
194
|
});
|
|
195
195
|
let groupRef = (0, $bhT4V$react.useRef)(null);
|
|
196
|
-
let [labelRef, label] = (0, $c5ccf687772c0422$exports.useSlot)();
|
|
196
|
+
let [labelRef, label] = (0, $c5ccf687772c0422$exports.useSlot)(!props['aria-label'] && !props['aria-labelledby']);
|
|
197
197
|
let { groupProps: groupProps, labelProps: labelProps, startFieldProps: startFieldProps, endFieldProps: endFieldProps, buttonProps: buttonProps, dialogProps: dialogProps, calendarProps: calendarProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $bhT4V$reactaria.useDateRangePicker)({
|
|
198
198
|
...(0, $c5ccf687772c0422$exports.removeDataAttributes)(props),
|
|
199
199
|
label: label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AA2DM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAsD;AAC5F,MAAM,yDAAyB,CAAA,GAAA,0BAAY,EAA2D;AACtG,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AACrE,MAAM,0DAA8B,CAAA,GAAA,0BAAY,EAA+B;AAK/E,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,WAAgC,KAAyB,EAAE,GAAiC;IAC1K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE,CAAA,GAAA,qCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,QAAQ,CAAA,GAAA,sCAAiB,EAAE;QAC7B,GAAG,KAAK;4BACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAkB;IACtC,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM;IAC9B,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,eACV,WAAW,eACX,WAAW,iBACX,aAAa,oBACb,gBAAgB,qBAChB,iBAAiB,EACjB,GAAG,YACJ,GAAG,CAAA,GAAA,8BAAY,EAAE;QAChB,G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AG;aAAc;YACrC;gBAAC,CAAA,GAAA,oDAAyB;gBAAG;aAAM;YACnC;gBAAC,CAAA,GAAA,wCAAa;gBAAG;oBACf,SAAS;oBACT,YAAY;oBACZ,WAAW;oBACX,OAAO;wBAAC,mBAAmB;oBAAU;gBACvC;aAAE;YACF;gBAAC,CAAA,GAAA,uCAAY;gBAAG;aAAY;YAC5B;gBAAC,CAAA,GAAA,0CAAe;gBAAG;oBACjB,OAAO;wBACL,OAAO;wBACP,KAAK;oBACP;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,2CAAgB;gBAAG;aAAW;SAChC;qBACD,0DAAC;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","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.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AA2DM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAsD;AAC5F,MAAM,yDAAyB,CAAA,GAAA,0BAAY,EAA2D;AACtG,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AACrE,MAAM,0DAA8B,CAA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AA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,2CAAgB;gBAAG;aAAW;SAChC;qBACD,0DAAC;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","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 !props['aria-label'] && !props['aria-labelledby']\n );\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 !props['aria-label'] && !props['aria-labelledby']\n );\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.main.js.map"}
|
package/dist/DatePicker.mjs
CHANGED
|
@@ -53,7 +53,7 @@ const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8nhma$forwa
|
|
|
53
53
|
validationBehavior: validationBehavior
|
|
54
54
|
});
|
|
55
55
|
let groupRef = (0, $8nhma$useRef)(null);
|
|
56
|
-
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
56
|
+
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);
|
|
57
57
|
let { groupProps: groupProps, labelProps: labelProps, fieldProps: fieldProps, buttonProps: buttonProps, dialogProps: dialogProps, calendarProps: calendarProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $8nhma$useDatePicker)({
|
|
58
58
|
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
59
59
|
label: label,
|
|
@@ -178,7 +178,7 @@ const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /*#__PURE__*/ (0, $8nhma$forwa
|
|
|
178
178
|
validationBehavior: validationBehavior
|
|
179
179
|
});
|
|
180
180
|
let groupRef = (0, $8nhma$useRef)(null);
|
|
181
|
-
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
181
|
+
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);
|
|
182
182
|
let { groupProps: groupProps, labelProps: labelProps, startFieldProps: startFieldProps, endFieldProps: endFieldProps, buttonProps: buttonProps, dialogProps: dialogProps, calendarProps: calendarProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $8nhma$useDateRangePicker)({
|
|
183
183
|
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
184
184
|
label: label,
|
|
@@ -53,7 +53,7 @@ const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8nhma$forwa
|
|
|
53
53
|
validationBehavior: validationBehavior
|
|
54
54
|
});
|
|
55
55
|
let groupRef = (0, $8nhma$useRef)(null);
|
|
56
|
-
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
56
|
+
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);
|
|
57
57
|
let { groupProps: groupProps, labelProps: labelProps, fieldProps: fieldProps, buttonProps: buttonProps, dialogProps: dialogProps, calendarProps: calendarProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $8nhma$useDatePicker)({
|
|
58
58
|
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
59
59
|
label: label,
|
|
@@ -178,7 +178,7 @@ const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /*#__PURE__*/ (0, $8nhma$forwa
|
|
|
178
178
|
validationBehavior: validationBehavior
|
|
179
179
|
});
|
|
180
180
|
let groupRef = (0, $8nhma$useRef)(null);
|
|
181
|
-
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
181
|
+
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);
|
|
182
182
|
let { groupProps: groupProps, labelProps: labelProps, startFieldProps: startFieldProps, endFieldProps: endFieldProps, buttonProps: buttonProps, dialogProps: dialogProps, calendarProps: calendarProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $8nhma$useDateRangePicker)({
|
|
183
183
|
...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
|
|
184
184
|
label: label,
|
|
@@ -1 +1 @@
|
|
|
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,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD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BAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;oBAAU,WAAW,MAAM,SAAS;gBAAA;aAAE;YAC1E;gBAAC,CAAA,GAAA,yCAAY;gBAAG;oBAAC,GAAG,WAAW;oBAAE,WAAW,MAAM,MAAM;gBAAA;aAAE;YAC1D;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;oBAAU,aAAa;gBAAM;aAAE;YACnE;gBAAC,CAAA,GAAA,yCAAmB;gBAAG;aAAc;YACrC;gBAAC,CAAA,GAAA,wCAAyB;gBAAG;aAAM;YACnC;gBAAC,CAAA,GAAA,yCAAa;gBAAG;oBACf,SAAS;oBACT,YAAY;oBACZ,WAAW;oBACX,OAAO;wBAAC,mBAAmB;oBAAU;gBACvC;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAY;YAC5B;gBAAC,CAAA,GAAA,yCAAe;gBAAG;oBACjB,OAAO;wBACL,OAAO;wBACP,KAAK;oBACP;gBACF;aAAE;YACF;gBAAC,CAAA,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","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}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A,GAAA,wCAAyB;gBAAG;aAAM;YACnC;gBAAC,CAAA,GAAA,yCAAa;gBAAG;oBACf,SAAS;oBACT,YAAY;oBACZ,WAAW;oBACX,OAAO;wBAAC,mBAAmB;oBAAU;gBACvC;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAY;YAC5B;gBAAC,CAAA,GAAA,yCAAe;gBAAG;oBACjB,OAAO;wBACL,OAAO;wBACP,KAAK;oBACP;gBACF;aAAE;YACF;gBAAC,CAAA,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","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 !props['aria-label'] && !props['aria-labelledby']\n );\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 !props['aria-label'] && !props['aria-labelledby']\n );\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
|
@@ -76,7 +76,8 @@ function $2979ab89b336194b$export$2e1e1122cf0cba88(props) {
|
|
|
76
76
|
(0, $61e2b7078adb18bc$exports.PopoverContext),
|
|
77
77
|
{
|
|
78
78
|
trigger: 'DialogTrigger',
|
|
79
|
-
triggerRef: buttonRef
|
|
79
|
+
triggerRef: buttonR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B;aAEzD,QAAQ,IAAI,CAAC;;IAIjB,IAAI,cAAc,CAAA,GAAA,wCAAa,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,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\nexport interface 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, {\n trigger: 'DialogTrigger',\n triggerRef: buttonRef,\n 'aria-labelledby': overlayProps['aria-labelledby']\n }]\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
|
@@ -63,7 +63,8 @@ function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
|
|
|
63
63
|
(0, $07b14b47974efb58$export$9b9a0cd73afb7ca4),
|
|
64
64
|
{
|
|
65
65
|
trigger: 'DialogTrigger',
|
|
66
|
-
triggerRef: buttonRef
|
|
66
|
+
triggerRef: buttonRef,
|
|
67
|
+
'aria-labelledby': overlayProps['aria-labelledby']
|
|
67
68
|
}
|
|
68
69
|
]
|
|
69
70
|
]
|
package/dist/Dialog.module.js
CHANGED
|
@@ -63,7 +63,8 @@ function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
|
|
|
63
63
|
(0, $07b14b47974efb58$export$9b9a0cd73afb7ca4),
|
|
64
64
|
{
|
|
65
65
|
trigger: 'DialogTrigger',
|
|
66
|
-
triggerRef: buttonRef
|
|
66
|
+
triggerRef: buttonRef,
|
|
67
|
+
'aria-labelledby': overlayProps['aria-labelledby']
|
|
67
68
|
}
|
|
68
69
|
]
|
|
69
70
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA0BM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA0C;AAC5E,MAAM,yDAA6B,CAAA,GAAA,oBAAY,EAA8B;AAK7E,SAAS,0CAAc,KAAyB;IACrD,sGAAsG;IACtG,qCAAqC;IACrC,IAAI,QAAQ,CAAA,GAAA,0BAAkB,EAAE;IAEhC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAqB;IAC1C,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;QAAC,MAAM;IAAQ,GAAG,OAAO;IAE9E,uEAAuE;IACvE,+EAA+E;IAC/E,0EAA0E;IAC1E,qDAAqD;IACrD,aAAa,EAAE,GAAG,CAAA,GAAA,YAAI;IACtB,YAAY,CAAC,kBAAkB,GAAG,aAAa,EAAE;IAEjD,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAA4B;aAAM;YACnC;gBAAC,CAAA,GAAA,yCAA0B;gBAAG;aAAM;YACpC;gBAAC;gBAAe;aAAa;YAC7B;gBAAC,CAAA,GAAA,yCAAa;gBAAG;
|
|
1
|
+
{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AAK;QACR,qDAAqD;QACrD,uCAAuC;QACvC,mBAAmB;IACrB,GAAG;IACH,IAAI,QAAQ,CAAA,GAAA,iBAAS,EAAE;IAEvB,IAAI,CAAC,WAAW,CAAC,aAAa,IAAI,CAAC,WAAW,CAAC,kBAAkB;QAC/D,oEAAoE;QACpE,yDAAyD;QACzD,IAAI,KAAK,CAAC,kBAAkB,EAC1B,WAAW,CAAC,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\nexport interface 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, {\n trigger: 'DialogTrigger',\n triggerRef: buttonRef,\n 'aria-labelledby': overlayProps['aria-labelledby']\n }]\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
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
var $b856e6788a7ea5bf$exports = require("./Button.main.js");
|
|
2
2
|
var $c5ccf687772c0422$exports = require("./utils.main.js");
|
|
3
|
-
var $8afVX$
|
|
4
|
-
var $8afVX$
|
|
3
|
+
var $8afVX$reactaria = require("react-aria");
|
|
4
|
+
var $8afVX$reactstately = require("react-stately");
|
|
5
5
|
var $8afVX$reactariautils = require("@react-aria/utils");
|
|
6
6
|
var $8afVX$react = require("react");
|
|
7
|
-
var $8afVX$reactaria = require("react-aria");
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
function $parcel$interopDefault(a) {
|
|
@@ -37,10 +36,9 @@ $parcel$export(module.exports, "DisclosurePanel", () => $11c780105231f6ef$export
|
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
|
|
40
|
-
|
|
41
39
|
const $11c780105231f6ef$export$1d40e3e0cc4d5de = /*#__PURE__*/ (0, $8afVX$react.createContext)(null);
|
|
42
40
|
const $11c780105231f6ef$export$944aceb4f8c89f10 = /*#__PURE__*/ (0, $8afVX$react.forwardRef)(function DisclosureGroup(props, ref) {
|
|
43
|
-
let state = (0, $8afVX$
|
|
41
|
+
let state = (0, $8afVX$reactstately.useDisclosureGroupState)(props);
|
|
44
42
|
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
45
43
|
...props,
|
|
46
44
|
defaultClassName: 'react-aria-DisclosureGroup',
|
|
@@ -71,7 +69,7 @@ const $11c780105231f6ef$export$74a362b31437ec83 = /*#__PURE__*/ (0, $8afVX$react
|
|
|
71
69
|
let defaultId = (0, $8afVX$reactariautils.useId)();
|
|
72
70
|
id || (id = defaultId);
|
|
73
71
|
let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;
|
|
74
|
-
let state = (0, $8afVX$
|
|
72
|
+
let state = (0, $8afVX$reactstately.useDisclosureState)({
|
|
75
73
|
...props,
|
|
76
74
|
isExpanded: isExpanded,
|
|
77
75
|
onExpandedChange (isExpanded) {
|
|
@@ -82,7 +80,7 @@ const $11c780105231f6ef$export$74a362b31437ec83 = /*#__PURE__*/ (0, $8afVX$react
|
|
|
82
80
|
});
|
|
83
81
|
let panelRef = (0, ($parcel$interopDefault($8afVX$react))).useRef(null);
|
|
84
82
|
let isDisabled = props.isDisabled || (groupState === null || groupState === void 0 ? void 0 : groupState.isDisabled) || false;
|
|
85
|
-
let { buttonProps: buttonProps, panelProps: panelProps } = (0, $8afVX$
|
|
83
|
+
let { buttonProps: buttonProps, panelProps: panelProps } = (0, $8afVX$reactaria.useDisclosure)({
|
|
86
84
|
...props,
|
|
87
85
|
isExpanded: isExpanded,
|
|
88
86
|
isDisabled: isDisabled
|
|
@@ -1 +1 @@
|
|
|
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,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAE9B,qBACE,0DAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,yCAA4B,QAAQ;QAAC,OAAO;OAC1C,YAAY,QAAQ;AAI7B;AA6BO,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DAAyB,CAAA,GAAA,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IvB","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"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAwBM,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,2CAAsB,EAAE;IAEpC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAE9B,qBACE,0DAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,yCAA4B,QAAQ;QAAC,OAAO;OAC1C,YAAY,QAAQ;AAI7B;AA6BO,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAO5E,MAAM,gEAA4B,CAAA,GAAA,0BAAY,EAAyC;AAKhF,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAClJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;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BAAQ;aAAE;YACnD;gBAAC;gBAAwB;aAAM;SAChC;qBACD,0DAAC;QACC,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,cAAc;QAC7B,6BAA2B,wBAAwB;QAClD,GAAG,QAAQ;QACX,GAAG,gBAAgB;QACnB,GAAG,WAAW;OACd,YAAY,QAAQ;AAI7B;AAyBO,MAAM,4CAAgC,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,gBAAgB,KAA2B,EAAE,GAAiC;IACjK,IAAI,QAAC,OAAO,SAAQ,GAAG;IACvB,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IACxC,IAAI,EACF,gBAAgB,oBAAoB,EACpC,YAAY,gBAAgB,EAC7B,GAAG,CAAA,GAAA,6BAAW,EAAE;QAAC,QAAQ;IAAI;IAC9B,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;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, useFocusRing} from 'react-aria';\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';\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';\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"}
|