react-aria-components 3.0.0-nightly-ab9fd5c68-241125 → 3.0.0-nightly-10a43de88-241127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Breadcrumbs.main.js +2 -5
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +3 -6
- package/dist/Breadcrumbs.module.js +3 -6
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +2 -5
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +2 -5
- package/dist/Button.module.js +2 -5
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +9 -22
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +9 -22
- package/dist/Calendar.module.js +9 -22
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +5 -12
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +6 -13
- package/dist/Checkbox.module.js +6 -13
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/ColorArea.main.js +2 -5
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +3 -6
- package/dist/ColorArea.module.js +3 -6
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +2 -5
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +2 -5
- package/dist/ColorField.module.js +2 -5
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +2 -5
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +2 -5
- package/dist/ColorSlider.module.js +2 -5
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +2 -5
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +2 -5
- package/dist/ColorSwatch.module.js +2 -5
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js +4 -8
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.mjs +5 -9
- package/dist/ColorSwatchPicker.module.js +5 -9
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +2 -5
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +3 -6
- package/dist/ColorThumb.module.js +3 -6
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +5 -11
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +6 -12
- package/dist/ColorWheel.module.js +6 -12
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +2 -5
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +3 -6
- package/dist/ComboBox.module.js +3 -6
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +8 -23
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +9 -24
- package/dist/DateField.module.js +9 -24
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +4 -11
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +5 -12
- package/dist/DatePicker.module.js +5 -12
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +2 -5
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +3 -6
- package/dist/Dialog.module.js +3 -6
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +6 -16
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +6 -16
- package/dist/Disclosure.module.js +6 -16
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js +2 -5
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.mjs +3 -6
- package/dist/DragAndDrop.module.js +3 -6
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +2 -5
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +3 -6
- package/dist/DropZone.module.js +3 -6
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js +2 -5
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.mjs +3 -6
- package/dist/FieldError.module.js +3 -6
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +2 -5
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +2 -5
- package/dist/FileTrigger.module.js +2 -5
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js +2 -6
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.mjs +2 -6
- package/dist/Form.module.js +2 -6
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +2 -6
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +3 -7
- package/dist/GridList.module.js +3 -7
- package/dist/GridList.module.js.map +1 -1
- package/dist/Group.main.js +2 -5
- package/dist/Group.main.js.map +1 -1
- package/dist/Group.mjs +2 -5
- package/dist/Group.module.js +2 -5
- package/dist/Group.module.js.map +1 -1
- package/dist/Heading.main.js +2 -3
- package/dist/Heading.main.js.map +1 -1
- package/dist/Heading.mjs +2 -3
- package/dist/Heading.module.js +2 -3
- package/dist/Heading.module.js.map +1 -1
- package/dist/Input.main.js +2 -5
- package/dist/Input.main.js.map +1 -1
- package/dist/Input.mjs +2 -5
- package/dist/Input.module.js +2 -5
- package/dist/Input.module.js.map +1 -1
- package/dist/Keyboard.main.js +2 -3
- package/dist/Keyboard.main.js.map +1 -1
- package/dist/Keyboard.mjs +2 -3
- package/dist/Keyboard.module.js +2 -3
- package/dist/Keyboard.module.js.map +1 -1
- package/dist/Label.main.js +2 -3
- package/dist/Label.main.js.map +1 -1
- package/dist/Label.mjs +2 -3
- package/dist/Label.module.js +2 -3
- package/dist/Label.module.js.map +1 -1
- package/dist/Link.main.js +2 -6
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +2 -6
- package/dist/Link.module.js +2 -6
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +5 -10
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +6 -11
- package/dist/ListBox.module.js +6 -11
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +5 -10
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +5 -10
- package/dist/Menu.module.js +5 -10
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +2 -5
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +2 -5
- package/dist/Meter.module.js +2 -5
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +3 -6
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +4 -7
- package/dist/Modal.module.js +4 -7
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +2 -5
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +3 -6
- package/dist/NumberField.module.js +3 -6
- package/dist/NumberField.module.js.map +1 -1
- package/dist/OverlayArrow.main.js +2 -6
- package/dist/OverlayArrow.main.js.map +1 -1
- package/dist/OverlayArrow.mjs +2 -6
- package/dist/OverlayArrow.module.js +2 -6
- package/dist/OverlayArrow.module.js.map +1 -1
- package/dist/Popover.main.js +2 -5
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +3 -6
- package/dist/Popover.module.js +3 -6
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +2 -6
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +2 -6
- package/dist/ProgressBar.module.js +2 -6
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +4 -10
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +4 -10
- package/dist/RadioGroup.module.js +4 -10
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +2 -5
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +3 -6
- package/dist/SearchField.module.js +3 -6
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +5 -12
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +6 -13
- package/dist/Select.module.js +6 -13
- package/dist/Select.module.js.map +1 -1
- package/dist/Slider.main.js +8 -20
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +9 -21
- package/dist/Slider.module.js +9 -21
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +2 -5
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +2 -5
- package/dist/Switch.module.js +2 -5
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +6 -12
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +7 -13
- package/dist/Table.module.js +7 -13
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +6 -16
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +7 -17
- package/dist/Tabs.module.js +7 -17
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +4 -10
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +5 -11
- package/dist/TagGroup.module.js +5 -11
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/Text.main.js +2 -3
- package/dist/Text.main.js.map +1 -1
- package/dist/Text.mjs +2 -3
- package/dist/Text.module.js +2 -3
- package/dist/Text.module.js.map +1 -1
- package/dist/TextArea.main.js +2 -5
- package/dist/TextArea.main.js.map +1 -1
- package/dist/TextArea.mjs +2 -5
- package/dist/TextArea.module.js +2 -5
- package/dist/TextArea.module.js.map +1 -1
- package/dist/TextField.main.js +2 -5
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +3 -6
- package/dist/TextField.module.js +3 -6
- package/dist/TextField.module.js.map +1 -1
- package/dist/ToggleButton.main.js +2 -5
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +3 -6
- package/dist/ToggleButton.module.js +3 -6
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +2 -5
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +2 -5
- package/dist/ToggleButtonGroup.module.js +2 -5
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +2 -6
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +2 -6
- package/dist/Toolbar.module.js +2 -6
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +2 -5
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +3 -6
- package/dist/Tooltip.module.js +3 -6
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +2 -6
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +3 -7
- package/dist/Tree.module.js +3 -7
- package/dist/Tree.module.js.map +1 -1
- package/dist/types.d.ts +10 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/Breadcrumbs.tsx +5 -8
- package/src/Button.tsx +5 -8
- package/src/Calendar.tsx +19 -31
- package/src/Checkbox.tsx +11 -17
- package/src/ColorArea.tsx +5 -8
- package/src/ColorField.tsx +5 -8
- package/src/ColorSlider.tsx +5 -8
- package/src/ColorSwatch.tsx +5 -8
- package/src/ColorSwatchPicker.tsx +7 -13
- package/src/ColorThumb.tsx +5 -8
- package/src/ColorWheel.tsx +10 -16
- package/src/ComboBox.tsx +5 -8
- package/src/DateField.tsx +21 -33
- package/src/DatePicker.tsx +9 -15
- package/src/Dialog.tsx +5 -8
- package/src/Disclosure.tsx +16 -25
- package/src/DragAndDrop.tsx +5 -8
- package/src/DropZone.tsx +5 -8
- package/src/FieldError.tsx +5 -8
- package/src/FileTrigger.tsx +5 -8
- package/src/Form.tsx +6 -9
- package/src/GridList.tsx +6 -9
- package/src/Group.tsx +5 -8
- package/src/Heading.tsx +2 -5
- package/src/Input.tsx +5 -8
- package/src/Keyboard.tsx +2 -5
- package/src/Label.tsx +2 -5
- package/src/Link.tsx +6 -9
- package/src/ListBox.tsx +8 -12
- package/src/Menu.tsx +8 -12
- package/src/Meter.tsx +5 -8
- package/src/Modal.tsx +5 -8
- package/src/NumberField.tsx +5 -8
- package/src/OverlayArrow.tsx +6 -9
- package/src/Popover.tsx +5 -8
- package/src/ProgressBar.tsx +6 -9
- package/src/RadioGroup.tsx +10 -16
- package/src/SearchField.tsx +5 -8
- package/src/Select.tsx +11 -17
- package/src/Slider.tsx +20 -32
- package/src/Switch.tsx +5 -8
- package/src/Table.tsx +10 -19
- package/src/Tabs.tsx +14 -23
- package/src/TagGroup.tsx +8 -14
- package/src/Text.tsx +2 -5
- package/src/TextArea.tsx +5 -7
- package/src/TextField.tsx +5 -8
- package/src/ToggleButton.tsx +5 -8
- package/src/ToggleButtonGroup.tsx +5 -8
- package/src/Toolbar.tsx +6 -9
- package/src/Tooltip.tsx +5 -8
- package/src/Tree.tsx +6 -9
package/dist/Form.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAiBM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAA4C;
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAiBM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAA4C;AAM5E,MAAM,0DAAO,CAAA,GAAA,iBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAAkC;IAC/F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,oBAAC,gBAAgB,sBAAE,qBAAqB,oBAAU,QAAQ,aAAE,SAAS,EAAE,GAAG,UAAS,GAAG;IAC1F,qBACE,gCAAC;QAAK,YAAY,uBAAuB;QAAW,GAAG,QAAQ;QAAE,KAAK;QAAK,WAAW,aAAa;qBACjG,gCAAC,0CAAY,QAAQ;QAAC,OAAO;YAAC,GAAG,KAAK;gCAAE;QAAkB;qBACxD,gCAAC,CAAA,GAAA,4BAAoB,EAAE,QAAQ;QAAC,OAAO,6BAAA,8BAAA,mBAAoB,CAAC;OACzD;AAKX","sources":["packages/react-aria-components/src/Form.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {ContextValue, DOMProps, useContextProps} from './utils';\nimport {FormValidationContext} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {FormProps as SharedFormProps} from '@react-types/form';\n\nexport interface FormProps extends SharedFormProps, DOMProps {\n /**\n * Whether to use native HTML form validation to prevent form submission\n * when a field value is missing or invalid, or mark fields as required\n * or invalid via ARIA.\n * @default 'native'\n */\n validationBehavior?: 'aria' | 'native'\n}\n\nexport const FormContext = createContext<ContextValue<FormProps, HTMLFormElement>>(null);\n\n/**\n * A form is a group of inputs that allows users to submit data to a server,\n * with support for providing field validation errors.\n */\nexport const Form = forwardRef(function Form(props: FormProps, ref: ForwardedRef<HTMLFormElement>) {\n [props, ref] = useContextProps(props, ref, FormContext);\n let {validationErrors, validationBehavior = 'native', children, className, ...domProps} = props;\n return (\n <form noValidate={validationBehavior !== 'native'} {...domProps} ref={ref} className={className || 'react-aria-Form'}>\n <FormContext.Provider value={{...props, validationBehavior}}>\n <FormValidationContext.Provider value={validationErrors ?? {}}>\n {children}\n </FormValidationContext.Provider>\n </FormContext.Provider>\n </form>\n );\n});\n"],"names":[],"version":3,"file":"Form.module.js.map"}
|
package/dist/GridList.main.js
CHANGED
|
@@ -46,7 +46,7 @@ $parcel$export(module.exports, "GridListItem", () => $132cbde493282f82$export$e9
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
const $132cbde493282f82$export$54fe942636b6416d = /*#__PURE__*/ (0, $UaDUV$react.createContext)(null);
|
|
49
|
-
|
|
49
|
+
const $132cbde493282f82$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $UaDUV$react.forwardRef)(function GridList(props, ref) {
|
|
50
50
|
// Render the portal first so that we have the collection by the time we render the DOM in SSR.
|
|
51
51
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $132cbde493282f82$export$54fe942636b6416d);
|
|
52
52
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement((0, $UaDUV$reactariacollections.CollectionBuilder), {
|
|
@@ -56,7 +56,7 @@ function $132cbde493282f82$var$GridList(props, ref) {
|
|
|
56
56
|
collection: collection,
|
|
57
57
|
gridListRef: ref
|
|
58
58
|
}));
|
|
59
|
-
}
|
|
59
|
+
});
|
|
60
60
|
function $132cbde493282f82$var$GridListInner({ props: props, collection: collection, gridListRef: ref }) {
|
|
61
61
|
let { dragAndDropHooks: dragAndDropHooks, keyboardNavigationBehavior: keyboardNavigationBehavior = 'arrow', layout: layout = 'stack' } = props;
|
|
62
62
|
let { CollectionRoot: CollectionRoot, isVirtualized: isVirtualized, layoutDelegate: layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate } = (0, $UaDUV$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
|
|
@@ -222,10 +222,6 @@ function $132cbde493282f82$var$GridListInner({ props: props, collection: collect
|
|
|
222
222
|
renderDropIndicator: (0, $0c2289d253cb4544$exports.useRenderDropIndicator)(dragAndDropHooks, dropState)
|
|
223
223
|
})), emptyState, dragPreview));
|
|
224
224
|
}
|
|
225
|
-
/**
|
|
226
|
-
* A grid list displays a list of interactive items, with support for keyboard navigation,
|
|
227
|
-
* single or multiple selection, and row actions.
|
|
228
|
-
*/ const $132cbde493282f82$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $UaDUV$react.forwardRef)($132cbde493282f82$var$GridList);
|
|
229
225
|
const $132cbde493282f82$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $UaDUV$reactariacollections.createLeafComponent)('item', function GridListItem(props, forwardedRef, item) {
|
|
230
226
|
let state = (0, $UaDUV$react.useContext)((0, $a03b42240404b420$exports.ListStateContext));
|
|
231
227
|
let { dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = (0, $UaDUV$react.useContext)((0, $0c2289d253cb4544$exports.DragAndDropContext));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AA+DM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AAE/F,SAAS,+BAA2B,KAAuB,EAAE,GAAiC;IAC5F,+FAA+F;IAC/F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,uBAAS,0DAAC,CAAA,GAAA,sCAAS,GAAM;OACzC,CAAA,2BAAc,0DAAC;YAAc,OAAO;YAAO,YAAY;YAAY,aAAa;;AAGvF;AAQA,SAAS,oCAAgC,SAAC,KAAK,cAAE,UAAU,EAAE,aAAa,GAAG,EAAwB;IACnG,IAAI,oBAAC,gBAAgB,8BAAE,6BAA6B,iBAAS,SAAS,SAAQ,GAAG;IACjF,IAAI,kBAAC,cAAc,iBAAE,aAAa,kBAAE,cAAc,EAAE,oBAAoB,qBAAqB,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,mDAAwB;IACpI,IAAI,QAAQ,CAAA,GAAA,gCAAW,EAAE;QACvB,GAAG,KAAK;oBACR;QACA,UAAU;wBACV;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,4BAAU,EAAE;QAAC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packages/react-aria-components/src/GridList.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 {AriaGridListProps, DraggableItemResult, DragPreviewRenderer, DropIndicatorAria, DroppableCollectionResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useGridList, useGridListItem, useGridListSelectionCheckbox, useHover, useLocale, useVisuallyHidden} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CheckboxContext} from './RSPContexts';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, ScrollableProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, Collection as ICollection, ListState, Node, SelectionBehavior, useListState} from 'react-stately';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface GridListRenderProps {\n /**\n * Whether the list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the grid list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the grid list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the grid list is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the grid list.\n */\n state: ListState<unknown>\n}\n\nexport interface GridListProps<T> extends Omit<AriaGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<GridListRenderProps>, SlotProps, ScrollableProps<HTMLDivElement> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the GridList. */\n dragAndDropHooks?: DragAndDropHooks,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: GridListRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid'\n}\n\n\nexport const GridListContext = createContext<ContextValue<GridListProps<any>, HTMLDivElement>>(null);\n\nfunction GridList<T extends object>(props: GridListProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // Render the portal first so that we have the collection by the time we render the DOM in SSR.\n [props, ref] = useContextProps(props, ref, GridListContext);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <GridListInner props={props} collection={collection} gridListRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface GridListInnerProps<T extends object> {\n props: GridListProps<T>,\n collection: ICollection<Node<object>>,\n gridListRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListInner<T extends object>({props, collection, gridListRef: ref}: GridListInnerProps<T>) {\n let {dragAndDropHooks, keyboardNavigationBehavior = 'arrow', layout = 'stack'} = props;\n let {CollectionRoot, isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate} = useContext(CollectionRendererContext);\n let state = useListState({\n ...props,\n collection,\n children: undefined,\n layoutDelegate\n });\n\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {disabledBehavior, disabledKeys} = state.selectionManager;\n let {direction} = useLocale();\n let keyboardDelegate = useMemo(() => (\n new ListKeyboardDelegate({\n collection,\n collator,\n ref,\n disabledKeys,\n disabledBehavior,\n layoutDelegate,\n layout,\n direction\n })\n ), [collection, ref, layout, disabledKeys, disabledBehavior, layoutDelegate, collator, direction]);\n\n let {gridProps} = useGridList({\n ...props,\n keyboardDelegate,\n // Only tab navigation is supported in grid layout.\n keyboardNavigationBehavior: layout === 'grid' ? 'tab' : keyboardNavigationBehavior,\n isVirtualized\n }, state, ref);\n\n let selectionManager = state.selectionManager;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, ref);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let keyboardDelegate = new ListKeyboardDelegate({\n collection,\n disabledKeys: selectionManager.disabledKeys,\n disabledBehavior: selectionManager.disabledBehavior,\n ref\n });\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, ref, {layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, ref);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n layout,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-GridList',\n values: renderValues\n });\n\n let emptyState: ReactNode = null;\n let emptyStatePropOverrides: HTMLAttributes<HTMLElement> | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n let content = props.renderEmptyState(renderValues);\n emptyState = (\n <div role=\"row\" style={{display: 'contents'}}>\n <div role=\"gridcell\" style={{display: 'contents'}}>\n {content}\n </div>\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...renderProps}\n {...mergeProps(gridProps, focusProps, droppableCollection?.collectionProps, emptyStatePropOverrides)}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={layout}>\n <Provider\n values={[\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [DropIndicatorContext, {render: GridListDropIndicatorWrapper}]\n ]}>\n {isListDroppable && <RootDropIndicator />}\n <CollectionRoot\n collection={collection}\n scrollRef={ref}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\n/**\n * A grid list displays a list of interactive items, with support for keyboard navigation,\n * single or multiple selection, and row actions.\n */\nconst _GridList = /*#__PURE__*/ (forwardRef as forwardRefType)(GridList);\nexport {_GridList as GridList};\n\nexport interface GridListItemRenderProps extends ItemRenderProps {}\n\nexport interface GridListItemProps<T = object> extends RenderProps<GridListItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A GridListItem represents an individual item in a GridList.\n */\nexport const GridListItem = /*#__PURE__*/ createLeafComponent('item', function GridListItem<T extends object>(props: GridListItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext);\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {rowProps, gridCellProps, descriptionProps, ...states} = useGridListItem(\n {\n node: item,\n shouldSelectOnPressUp: !!dragState,\n isVirtualized\n },\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {checkboxProps} = useGridListSelectionCheckbox(\n {key: item.key},\n state\n );\n\n let buttonProps = state.selectionManager.disabledBehavior === 'all' && states.isDisabled ? {isDisabled: true} : {};\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key, hasDragButton: true}, dragState);\n }\n\n let dropIndicator: DropIndicatorAria | null = null;\n let dropIndicatorRef = useRef<HTMLDivElement>(null);\n let {visuallyHiddenProps} = useVisuallyHidden();\n if (dropState && dragAndDropHooks) {\n dropIndicator = dragAndDropHooks.useDropIndicator!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, dropIndicatorRef);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-GridListItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: dropIndicator?.isDropTarget\n }\n });\n\n let dragButtonRef = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (dragState && !dragButtonRef.current) {\n console.warn('Draggable items in a GridList must contain a <Button slot=\"drag\"> element so that keyboard and screen reader users can drag them.');\n }\n // eslint-disable-next-line\n }, []);\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <GridListItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n return (\n <>\n {dropIndicator && !dropIndicator.isHidden &&\n <div role=\"row\" style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicator?.dropIndicatorProps} ref={dropIndicatorRef} />\n </div>\n </div>\n }\n <div\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps, draggableItem?.dragProps)}\n {...renderProps}\n ref={ref}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-dragging={!!dragState || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={dropIndicator?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [CheckboxContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n selection: checkboxProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: buttonProps,\n drag: {\n ...draggableItem?.dragButtonProps,\n ref: dragButtonRef,\n style: {\n pointerEvents: 'none'\n }\n }\n }\n }],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n description: descriptionProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [ListStateContext, null]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n </>\n );\n});\n\nfunction GridListDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let buttonRef = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n buttonRef\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <GridListDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} buttonRef={buttonRef} ref={ref} />\n );\n}\n\ninterface GridListDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean,\n buttonRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListDropIndicator(props: GridListDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n buttonRef,\n ...otherProps\n } = props;\n\n let {visuallyHiddenProps} = useVisuallyHidden();\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...renderProps}\n role=\"row\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined}>\n <div role=\"gridcell\">\n <div {...visuallyHiddenProps} role=\"button\" {...dropIndicatorProps} ref={buttonRef} />\n {renderProps.children}\n </div>\n </div>\n );\n}\n\nconst GridListDropIndicatorForwardRef = forwardRef(GridListDropIndicator);\n\nfunction RootDropIndicator() {\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let ref = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps} = dragAndDropHooks!.useDropIndicator!({\n target: {type: 'root'}\n }, dropState!, ref);\n let isDropTarget = dropState!.isDropTarget({type: 'root'});\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n if (!isDropTarget && dropIndicatorProps['aria-hidden']) {\n return null;\n }\n\n return (\n <div role=\"row\" aria-hidden={dropIndicatorProps['aria-hidden']} style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicatorProps} ref={ref} />\n </div>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"GridList.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AA+DM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AAMxF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAA2B,KAAuB,EAAE,GAAiC;IACjK,+FAA+F;IAC/F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,uBAAS,0DAAC,CAAA,GAAA,sCAAS,GAAM;OACzC,CAAA,2BAAc,0DA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AI,eAAe,UAAW,YAAY,CAAC;QAAC,MAAM;IAAM;IACxD,IAAI,uBAAC,mBAAmB,EAAC,GAAG,CAAA,GAAA,kCAAgB;IAE5C,IAAI,CAAC,gBAAgB,kBAAkB,CAAC,cAAc,EACpD,OAAO;IAGT,qBACE,0DAAC;QAAI,MAAK;QAAM,eAAa,kBAAkB,CAAC,cAAc;QAAE,OAAO;YAAC,UAAU;QAAU;qBAC1F,0DAAC;QAAI,MAAK;qBACR,0DAAC;QAAI,MAAK;QAAU,GAAG,mBAAmB;QAAG,GAAG,kBAAkB;QAAE,KAAK;;AAIjF","sources":["packages/react-aria-components/src/GridList.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 {AriaGridListProps, DraggableItemResult, DragPreviewRenderer, DropIndicatorAria, DroppableCollectionResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useGridList, useGridListItem, useGridListSelectionCheckbox, useHover, useLocale, useVisuallyHidden} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CheckboxContext} from './RSPContexts';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, ScrollableProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, Collection as ICollection, ListState, Node, SelectionBehavior, useListState} from 'react-stately';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface GridListRenderProps {\n /**\n * Whether the list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the grid list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the grid list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the grid list is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the grid list.\n */\n state: ListState<unknown>\n}\n\nexport interface GridListProps<T> extends Omit<AriaGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<GridListRenderProps>, SlotProps, ScrollableProps<HTMLDivElement> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the GridList. */\n dragAndDropHooks?: DragAndDropHooks,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: GridListRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid'\n}\n\n\nexport const GridListContext = createContext<ContextValue<GridListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A grid list displays a list of interactive items, with support for keyboard navigation,\n * single or multiple selection, and row actions.\n */\nexport const GridList = /*#__PURE__*/ (forwardRef as forwardRefType)(function GridList<T extends object>(props: GridListProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // Render the portal first so that we have the collection by the time we render the DOM in SSR.\n [props, ref] = useContextProps(props, ref, GridListContext);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <GridListInner props={props} collection={collection} gridListRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface GridListInnerProps<T extends object> {\n props: GridListProps<T>,\n collection: ICollection<Node<object>>,\n gridListRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListInner<T extends object>({props, collection, gridListRef: ref}: GridListInnerProps<T>) {\n let {dragAndDropHooks, keyboardNavigationBehavior = 'arrow', layout = 'stack'} = props;\n let {CollectionRoot, isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate} = useContext(CollectionRendererContext);\n let state = useListState({\n ...props,\n collection,\n children: undefined,\n layoutDelegate\n });\n\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {disabledBehavior, disabledKeys} = state.selectionManager;\n let {direction} = useLocale();\n let keyboardDelegate = useMemo(() => (\n new ListKeyboardDelegate({\n collection,\n collator,\n ref,\n disabledKeys,\n disabledBehavior,\n layoutDelegate,\n layout,\n direction\n })\n ), [collection, ref, layout, disabledKeys, disabledBehavior, layoutDelegate, collator, direction]);\n\n let {gridProps} = useGridList({\n ...props,\n keyboardDelegate,\n // Only tab navigation is supported in grid layout.\n keyboardNavigationBehavior: layout === 'grid' ? 'tab' : keyboardNavigationBehavior,\n isVirtualized\n }, state, ref);\n\n let selectionManager = state.selectionManager;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, ref);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let keyboardDelegate = new ListKeyboardDelegate({\n collection,\n disabledKeys: selectionManager.disabledKeys,\n disabledBehavior: selectionManager.disabledBehavior,\n ref\n });\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, ref, {layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, ref);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n layout,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-GridList',\n values: renderValues\n });\n\n let emptyState: ReactNode = null;\n let emptyStatePropOverrides: HTMLAttributes<HTMLElement> | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n let content = props.renderEmptyState(renderValues);\n emptyState = (\n <div role=\"row\" style={{display: 'contents'}}>\n <div role=\"gridcell\" style={{display: 'contents'}}>\n {content}\n </div>\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...renderProps}\n {...mergeProps(gridProps, focusProps, droppableCollection?.collectionProps, emptyStatePropOverrides)}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={layout}>\n <Provider\n values={[\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [DropIndicatorContext, {render: GridListDropIndicatorWrapper}]\n ]}>\n {isListDroppable && <RootDropIndicator />}\n <CollectionRoot\n collection={collection}\n scrollRef={ref}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface GridListItemRenderProps extends ItemRenderProps {}\n\nexport interface GridListItemProps<T = object> extends RenderProps<GridListItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A GridListItem represents an individual item in a GridList.\n */\nexport const GridListItem = /*#__PURE__*/ createLeafComponent('item', function GridListItem<T extends object>(props: GridListItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext);\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {rowProps, gridCellProps, descriptionProps, ...states} = useGridListItem(\n {\n node: item,\n shouldSelectOnPressUp: !!dragState,\n isVirtualized\n },\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {checkboxProps} = useGridListSelectionCheckbox(\n {key: item.key},\n state\n );\n\n let buttonProps = state.selectionManager.disabledBehavior === 'all' && states.isDisabled ? {isDisabled: true} : {};\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key, hasDragButton: true}, dragState);\n }\n\n let dropIndicator: DropIndicatorAria | null = null;\n let dropIndicatorRef = useRef<HTMLDivElement>(null);\n let {visuallyHiddenProps} = useVisuallyHidden();\n if (dropState && dragAndDropHooks) {\n dropIndicator = dragAndDropHooks.useDropIndicator!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, dropIndicatorRef);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-GridListItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: dropIndicator?.isDropTarget\n }\n });\n\n let dragButtonRef = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (dragState && !dragButtonRef.current) {\n console.warn('Draggable items in a GridList must contain a <Button slot=\"drag\"> element so that keyboard and screen reader users can drag them.');\n }\n // eslint-disable-next-line\n }, []);\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <GridListItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n return (\n <>\n {dropIndicator && !dropIndicator.isHidden &&\n <div role=\"row\" style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicator?.dropIndicatorProps} ref={dropIndicatorRef} />\n </div>\n </div>\n }\n <div\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps, draggableItem?.dragProps)}\n {...renderProps}\n ref={ref}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-dragging={!!dragState || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={dropIndicator?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [CheckboxContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n selection: checkboxProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: buttonProps,\n drag: {\n ...draggableItem?.dragButtonProps,\n ref: dragButtonRef,\n style: {\n pointerEvents: 'none'\n }\n }\n }\n }],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n description: descriptionProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [ListStateContext, null]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n </>\n );\n});\n\nfunction GridListDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let buttonRef = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n buttonRef\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <GridListDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} buttonRef={buttonRef} ref={ref} />\n );\n}\n\ninterface GridListDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean,\n buttonRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListDropIndicator(props: GridListDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n buttonRef,\n ...otherProps\n } = props;\n\n let {visuallyHiddenProps} = useVisuallyHidden();\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...renderProps}\n role=\"row\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined}>\n <div role=\"gridcell\">\n <div {...visuallyHiddenProps} role=\"button\" {...dropIndicatorProps} ref={buttonRef} />\n {renderProps.children}\n </div>\n </div>\n );\n}\n\nconst GridListDropIndicatorForwardRef = forwardRef(GridListDropIndicator);\n\nfunction RootDropIndicator() {\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let ref = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps} = dragAndDropHooks!.useDropIndicator!({\n target: {type: 'root'}\n }, dropState!, ref);\n let isDropTarget = dropState!.isDropTarget({type: 'root'});\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n if (!isDropTarget && dropIndicatorProps['aria-hidden']) {\n return null;\n }\n\n return (\n <div role=\"row\" aria-hidden={dropIndicatorProps['aria-hidden']} style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicatorProps} ref={ref} />\n </div>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"GridList.main.js.map"}
|
package/dist/GridList.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {useCollator as $jTmF7$useCollator, useLocale as $jTmF7$useLocale, ListKe
|
|
|
9
9
|
import {CollectionBuilder as $jTmF7$CollectionBuilder, Collection as $jTmF7$Collection, createLeafComponent as $jTmF7$createLeafComponent} from "@react-aria/collections";
|
|
10
10
|
import {useListState as $jTmF7$useListState} from "react-stately";
|
|
11
11
|
import {filterDOMProps as $jTmF7$filterDOMProps, useObjectRef as $jTmF7$useObjectRef} from "@react-aria/utils";
|
|
12
|
-
import $jTmF7$react, {createContext as $jTmF7$createContext, useContext as $jTmF7$useContext, useMemo as $jTmF7$useMemo, useRef as $jTmF7$useRef, useEffect as $jTmF7$useEffect
|
|
12
|
+
import $jTmF7$react, {createContext as $jTmF7$createContext, forwardRef as $jTmF7$forwardRef, useContext as $jTmF7$useContext, useMemo as $jTmF7$useMemo, useRef as $jTmF7$useRef, useEffect as $jTmF7$useEffect} from "react";
|
|
13
13
|
|
|
14
14
|
/*
|
|
15
15
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -34,7 +34,7 @@ import $jTmF7$react, {createContext as $jTmF7$createContext, useContext as $jTmF
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
const $72e60046c03fbe42$export$54fe942636b6416d = /*#__PURE__*/ (0, $jTmF7$createContext)(null);
|
|
37
|
-
|
|
37
|
+
const $72e60046c03fbe42$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $jTmF7$forwardRef)(function GridList(props, ref) {
|
|
38
38
|
// Render the portal first so that we have the collection by the time we render the DOM in SSR.
|
|
39
39
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $72e60046c03fbe42$export$54fe942636b6416d);
|
|
40
40
|
return /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $jTmF7$CollectionBuilder), {
|
|
@@ -44,7 +44,7 @@ function $72e60046c03fbe42$var$GridList(props, ref) {
|
|
|
44
44
|
collection: collection,
|
|
45
45
|
gridListRef: ref
|
|
46
46
|
}));
|
|
47
|
-
}
|
|
47
|
+
});
|
|
48
48
|
function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collection, gridListRef: ref }) {
|
|
49
49
|
let { dragAndDropHooks: dragAndDropHooks, keyboardNavigationBehavior: keyboardNavigationBehavior = 'arrow', layout: layout = 'stack' } = props;
|
|
50
50
|
let { CollectionRoot: CollectionRoot, isVirtualized: isVirtualized, layoutDelegate: layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
@@ -210,10 +210,6 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
210
210
|
renderDropIndicator: (0, $612b8eb6cb90e02d$export$971707d8a129a1f7)(dragAndDropHooks, dropState)
|
|
211
211
|
})), emptyState, dragPreview));
|
|
212
212
|
}
|
|
213
|
-
/**
|
|
214
|
-
* A grid list displays a list of interactive items, with support for keyboard navigation,
|
|
215
|
-
* single or multiple selection, and row actions.
|
|
216
|
-
*/ const $72e60046c03fbe42$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $jTmF7$forwardRef)($72e60046c03fbe42$var$GridList);
|
|
217
213
|
const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)('item', function GridListItem(props, forwardedRef, item) {
|
|
218
214
|
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
219
215
|
let { dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = (0, $jTmF7$useContext)((0, $612b8eb6cb90e02d$export$d188a835a7bc5783));
|
package/dist/GridList.module.js
CHANGED
|
@@ -9,7 +9,7 @@ import {useCollator as $jTmF7$useCollator, useLocale as $jTmF7$useLocale, ListKe
|
|
|
9
9
|
import {CollectionBuilder as $jTmF7$CollectionBuilder, Collection as $jTmF7$Collection, createLeafComponent as $jTmF7$createLeafComponent} from "@react-aria/collections";
|
|
10
10
|
import {useListState as $jTmF7$useListState} from "react-stately";
|
|
11
11
|
import {filterDOMProps as $jTmF7$filterDOMProps, useObjectRef as $jTmF7$useObjectRef} from "@react-aria/utils";
|
|
12
|
-
import $jTmF7$react, {createContext as $jTmF7$createContext, useContext as $jTmF7$useContext, useMemo as $jTmF7$useMemo, useRef as $jTmF7$useRef, useEffect as $jTmF7$useEffect
|
|
12
|
+
import $jTmF7$react, {createContext as $jTmF7$createContext, forwardRef as $jTmF7$forwardRef, useContext as $jTmF7$useContext, useMemo as $jTmF7$useMemo, useRef as $jTmF7$useRef, useEffect as $jTmF7$useEffect} from "react";
|
|
13
13
|
|
|
14
14
|
/*
|
|
15
15
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -34,7 +34,7 @@ import $jTmF7$react, {createContext as $jTmF7$createContext, useContext as $jTmF
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
const $72e60046c03fbe42$export$54fe942636b6416d = /*#__PURE__*/ (0, $jTmF7$createContext)(null);
|
|
37
|
-
|
|
37
|
+
const $72e60046c03fbe42$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $jTmF7$forwardRef)(function GridList(props, ref) {
|
|
38
38
|
// Render the portal first so that we have the collection by the time we render the DOM in SSR.
|
|
39
39
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $72e60046c03fbe42$export$54fe942636b6416d);
|
|
40
40
|
return /*#__PURE__*/ (0, $jTmF7$react).createElement((0, $jTmF7$CollectionBuilder), {
|
|
@@ -44,7 +44,7 @@ function $72e60046c03fbe42$var$GridList(props, ref) {
|
|
|
44
44
|
collection: collection,
|
|
45
45
|
gridListRef: ref
|
|
46
46
|
}));
|
|
47
|
-
}
|
|
47
|
+
});
|
|
48
48
|
function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collection, gridListRef: ref }) {
|
|
49
49
|
let { dragAndDropHooks: dragAndDropHooks, keyboardNavigationBehavior: keyboardNavigationBehavior = 'arrow', layout: layout = 'stack' } = props;
|
|
50
50
|
let { CollectionRoot: CollectionRoot, isVirtualized: isVirtualized, layoutDelegate: layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate } = (0, $jTmF7$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
@@ -210,10 +210,6 @@ function $72e60046c03fbe42$var$GridListInner({ props: props, collection: collect
|
|
|
210
210
|
renderDropIndicator: (0, $612b8eb6cb90e02d$export$971707d8a129a1f7)(dragAndDropHooks, dropState)
|
|
211
211
|
})), emptyState, dragPreview));
|
|
212
212
|
}
|
|
213
|
-
/**
|
|
214
|
-
* A grid list displays a list of interactive items, with support for keyboard navigation,
|
|
215
|
-
* single or multiple selection, and row actions.
|
|
216
|
-
*/ const $72e60046c03fbe42$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $jTmF7$forwardRef)($72e60046c03fbe42$var$GridList);
|
|
217
213
|
const $72e60046c03fbe42$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $jTmF7$createLeafComponent)('item', function GridListItem(props, forwardedRef, item) {
|
|
218
214
|
let state = (0, $jTmF7$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
219
215
|
let { dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = (0, $jTmF7$useContext)((0, $612b8eb6cb90e02d$export$d188a835a7bc5783));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AA+DM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD;AAE/F,SAAS,+BAA2B,KAAuB,EAAE,GAAiC;IAC5F,+FAA+F;IAC/F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,uBAAS,gCAAC,CAAA,GAAA,iBAAS,GAAM;OACzC,CAAA,2BAAc,gCAAC;YAAc,OAAO;YAAO,YAAY;YAAY,aAAa;;AAGvF;AAQA,SAAS,oC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ACf,IAAI,eAAe,UAAW,YAAY,CAAC;QAAC,MAAM;IAAM;IACxD,IAAI,uBAAC,mBAAmB,EAAC,GAAG,CAAA,GAAA,wBAAgB;IAE5C,IAAI,CAAC,gBAAgB,kBAAkB,CAAC,cAAc,EACpD,OAAO;IAGT,qBACE,gCAAC;QAAI,MAAK;QAAM,eAAa,kBAAkB,CAAC,cAAc;QAAE,OAAO;YAAC,UAAU;QAAU;qBAC1F,gCAAC;QAAI,MAAK;qBACR,gCAAC;QAAI,MAAK;QAAU,GAAG,mBAAmB;QAAG,GAAG,kBAAkB;QAAE,KAAK;;AAIjF","sources":["packages/react-aria-components/src/GridList.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 {AriaGridListProps, DraggableItemResult, DragPreviewRenderer, DropIndicatorAria, DroppableCollectionResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useGridList, useGridListItem, useGridListSelectionCheckbox, useHover, useLocale, useVisuallyHidden} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CheckboxContext} from './RSPContexts';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, ScrollableProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, Collection as ICollection, ListState, Node, SelectionBehavior, useListState} from 'react-stately';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface GridListRenderProps {\n /**\n * Whether the list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the grid list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the grid list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the grid list is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the grid list.\n */\n state: ListState<unknown>\n}\n\nexport interface GridListProps<T> extends Omit<AriaGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<GridListRenderProps>, SlotProps, ScrollableProps<HTMLDivElement> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the GridList. */\n dragAndDropHooks?: DragAndDropHooks,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: GridListRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid'\n}\n\n\nexport const GridListContext = createContext<ContextValue<GridListProps<any>, HTMLDivElement>>(null);\n\nfunction GridList<T extends object>(props: GridListProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // Render the portal first so that we have the collection by the time we render the DOM in SSR.\n [props, ref] = useContextProps(props, ref, GridListContext);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <GridListInner props={props} collection={collection} gridListRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface GridListInnerProps<T extends object> {\n props: GridListProps<T>,\n collection: ICollection<Node<object>>,\n gridListRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListInner<T extends object>({props, collection, gridListRef: ref}: GridListInnerProps<T>) {\n let {dragAndDropHooks, keyboardNavigationBehavior = 'arrow', layout = 'stack'} = props;\n let {CollectionRoot, isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate} = useContext(CollectionRendererContext);\n let state = useListState({\n ...props,\n collection,\n children: undefined,\n layoutDelegate\n });\n\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {disabledBehavior, disabledKeys} = state.selectionManager;\n let {direction} = useLocale();\n let keyboardDelegate = useMemo(() => (\n new ListKeyboardDelegate({\n collection,\n collator,\n ref,\n disabledKeys,\n disabledBehavior,\n layoutDelegate,\n layout,\n direction\n })\n ), [collection, ref, layout, disabledKeys, disabledBehavior, layoutDelegate, collator, direction]);\n\n let {gridProps} = useGridList({\n ...props,\n keyboardDelegate,\n // Only tab navigation is supported in grid layout.\n keyboardNavigationBehavior: layout === 'grid' ? 'tab' : keyboardNavigationBehavior,\n isVirtualized\n }, state, ref);\n\n let selectionManager = state.selectionManager;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, ref);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let keyboardDelegate = new ListKeyboardDelegate({\n collection,\n disabledKeys: selectionManager.disabledKeys,\n disabledBehavior: selectionManager.disabledBehavior,\n ref\n });\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, ref, {layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, ref);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n layout,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-GridList',\n values: renderValues\n });\n\n let emptyState: ReactNode = null;\n let emptyStatePropOverrides: HTMLAttributes<HTMLElement> | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n let content = props.renderEmptyState(renderValues);\n emptyState = (\n <div role=\"row\" style={{display: 'contents'}}>\n <div role=\"gridcell\" style={{display: 'contents'}}>\n {content}\n </div>\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...renderProps}\n {...mergeProps(gridProps, focusProps, droppableCollection?.collectionProps, emptyStatePropOverrides)}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={layout}>\n <Provider\n values={[\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [DropIndicatorContext, {render: GridListDropIndicatorWrapper}]\n ]}>\n {isListDroppable && <RootDropIndicator />}\n <CollectionRoot\n collection={collection}\n scrollRef={ref}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\n/**\n * A grid list displays a list of interactive items, with support for keyboard navigation,\n * single or multiple selection, and row actions.\n */\nconst _GridList = /*#__PURE__*/ (forwardRef as forwardRefType)(GridList);\nexport {_GridList as GridList};\n\nexport interface GridListItemRenderProps extends ItemRenderProps {}\n\nexport interface GridListItemProps<T = object> extends RenderProps<GridListItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A GridListItem represents an individual item in a GridList.\n */\nexport const GridListItem = /*#__PURE__*/ createLeafComponent('item', function GridListItem<T extends object>(props: GridListItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext);\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {rowProps, gridCellProps, descriptionProps, ...states} = useGridListItem(\n {\n node: item,\n shouldSelectOnPressUp: !!dragState,\n isVirtualized\n },\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {checkboxProps} = useGridListSelectionCheckbox(\n {key: item.key},\n state\n );\n\n let buttonProps = state.selectionManager.disabledBehavior === 'all' && states.isDisabled ? {isDisabled: true} : {};\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key, hasDragButton: true}, dragState);\n }\n\n let dropIndicator: DropIndicatorAria | null = null;\n let dropIndicatorRef = useRef<HTMLDivElement>(null);\n let {visuallyHiddenProps} = useVisuallyHidden();\n if (dropState && dragAndDropHooks) {\n dropIndicator = dragAndDropHooks.useDropIndicator!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, dropIndicatorRef);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-GridListItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: dropIndicator?.isDropTarget\n }\n });\n\n let dragButtonRef = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (dragState && !dragButtonRef.current) {\n console.warn('Draggable items in a GridList must contain a <Button slot=\"drag\"> element so that keyboard and screen reader users can drag them.');\n }\n // eslint-disable-next-line\n }, []);\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <GridListItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n return (\n <>\n {dropIndicator && !dropIndicator.isHidden &&\n <div role=\"row\" style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicator?.dropIndicatorProps} ref={dropIndicatorRef} />\n </div>\n </div>\n }\n <div\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps, draggableItem?.dragProps)}\n {...renderProps}\n ref={ref}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-dragging={!!dragState || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={dropIndicator?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [CheckboxContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n selection: checkboxProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: buttonProps,\n drag: {\n ...draggableItem?.dragButtonProps,\n ref: dragButtonRef,\n style: {\n pointerEvents: 'none'\n }\n }\n }\n }],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n description: descriptionProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [ListStateContext, null]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n </>\n );\n});\n\nfunction GridListDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let buttonRef = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n buttonRef\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <GridListDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} buttonRef={buttonRef} ref={ref} />\n );\n}\n\ninterface GridListDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean,\n buttonRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListDropIndicator(props: GridListDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n buttonRef,\n ...otherProps\n } = props;\n\n let {visuallyHiddenProps} = useVisuallyHidden();\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...renderProps}\n role=\"row\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined}>\n <div role=\"gridcell\">\n <div {...visuallyHiddenProps} role=\"button\" {...dropIndicatorProps} ref={buttonRef} />\n {renderProps.children}\n </div>\n </div>\n );\n}\n\nconst GridListDropIndicatorForwardRef = forwardRef(GridListDropIndicator);\n\nfunction RootDropIndicator() {\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let ref = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps} = dragAndDropHooks!.useDropIndicator!({\n target: {type: 'root'}\n }, dropState!, ref);\n let isDropTarget = dropState!.isDropTarget({type: 'root'});\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n if (!isDropTarget && dropIndicatorProps['aria-hidden']) {\n return null;\n }\n\n return (\n <div role=\"row\" aria-hidden={dropIndicatorProps['aria-hidden']} style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicatorProps} ref={ref} />\n </div>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"GridList.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;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B;QAAE,KAAK;QACxE,YAAY,QAAQ;AAI7B;AAEA,MAAM,sEAAkC,CAAA,GAAA,iBAAS,EAAE;AAEnD,SAAS;IACP,IAAI,oBAAC,gBAAgB,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAiB;IAChE,IAAI,MAAM,CAAA,GAAA,aAAK,EAAkB;IACjC,IAAI,sBAAC,kBAAkB,EAAC,GAAG,iBAAkB,gBAAgB,CAAE;QAC7D,QAAQ;YAAC,MAAM;QAAM;IACvB,GAAG,WAAY;IACf,IAAI,eAAe,UAAW,YAAY,CAAC;QAAC,MAAM;IAAM;IACxD,IAAI,uBAAC,mBAAmB,EAAC,GAAG,CAAA,GAAA,wBAAgB;IAE5C,IAAI,CAAC,gBAAgB,kBAAkB,CAAC,cAAc,EACpD,OAAO;IAGT,qBACE,gCAAC;QAAI,MAAK;QAAM,eAAa,kBAAkB,CAAC,cAAc;QAAE,OAAO;YAAC,UAAU;QAAU;qBAC1F,gCAAC;QAAI,MAAK;qBACR,gCAAC;QAAI,MAAK;QAAU,GAAG,mBAAmB;QAAG,GAAG,kBAAkB;QAAE,KAAK;;AAIjF","sources":["packages/react-aria-components/src/GridList.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 {AriaGridListProps, DraggableItemResult, DragPreviewRenderer, DropIndicatorAria, DroppableCollectionResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useGridList, useGridListItem, useGridListSelectionCheckbox, useHover, useLocale, useVisuallyHidden} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CheckboxContext} from './RSPContexts';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, ScrollableProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DragAndDropContext, DropIndicatorContext, DropIndicatorProps, useDndPersistedKeys, useRenderDropIndicator} from './DragAndDrop';\nimport {DragAndDropHooks} from './useDragAndDrop';\nimport {DraggableCollectionState, DroppableCollectionState, Collection as ICollection, ListState, Node, SelectionBehavior, useListState} from 'react-stately';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface GridListRenderProps {\n /**\n * Whether the list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the grid list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the grid list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the grid list is currently the active drop target.\n * @selector [data-drop-target]\n */\n isDropTarget: boolean,\n /**\n * Whether the items are arranged in a stack or grid.\n * @selector [data-layout=\"stack | grid\"]\n */\n layout: 'stack' | 'grid',\n /**\n * State of the grid list.\n */\n state: ListState<unknown>\n}\n\nexport interface GridListProps<T> extends Omit<AriaGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<GridListRenderProps>, SlotProps, ScrollableProps<HTMLDivElement> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the GridList. */\n dragAndDropHooks?: DragAndDropHooks,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: GridListRenderProps) => ReactNode,\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid'\n}\n\n\nexport const GridListContext = createContext<ContextValue<GridListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A grid list displays a list of interactive items, with support for keyboard navigation,\n * single or multiple selection, and row actions.\n */\nexport const GridList = /*#__PURE__*/ (forwardRef as forwardRefType)(function GridList<T extends object>(props: GridListProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // Render the portal first so that we have the collection by the time we render the DOM in SSR.\n [props, ref] = useContextProps(props, ref, GridListContext);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <GridListInner props={props} collection={collection} gridListRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface GridListInnerProps<T extends object> {\n props: GridListProps<T>,\n collection: ICollection<Node<object>>,\n gridListRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListInner<T extends object>({props, collection, gridListRef: ref}: GridListInnerProps<T>) {\n let {dragAndDropHooks, keyboardNavigationBehavior = 'arrow', layout = 'stack'} = props;\n let {CollectionRoot, isVirtualized, layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate} = useContext(CollectionRendererContext);\n let state = useListState({\n ...props,\n collection,\n children: undefined,\n layoutDelegate\n });\n\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {disabledBehavior, disabledKeys} = state.selectionManager;\n let {direction} = useLocale();\n let keyboardDelegate = useMemo(() => (\n new ListKeyboardDelegate({\n collection,\n collator,\n ref,\n disabledKeys,\n disabledBehavior,\n layoutDelegate,\n layout,\n direction\n })\n ), [collection, ref, layout, disabledKeys, disabledBehavior, layoutDelegate, collator, direction]);\n\n let {gridProps} = useGridList({\n ...props,\n keyboardDelegate,\n // Only tab navigation is supported in grid layout.\n keyboardNavigationBehavior: layout === 'grid' ? 'tab' : keyboardNavigationBehavior,\n isVirtualized\n }, state, ref);\n\n let selectionManager = state.selectionManager;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let dragState: DraggableCollectionState | undefined = undefined;\n let dropState: DroppableCollectionState | undefined = undefined;\n let droppableCollection: DroppableCollectionResult | undefined = undefined;\n let isRootDropTarget = false;\n let dragPreview: JSX.Element | null = null;\n let preview = useRef<DragPreviewRenderer>(null);\n\n if (isListDraggable && dragAndDropHooks) {\n dragState = dragAndDropHooks.useDraggableCollectionState!({\n collection,\n selectionManager,\n preview: dragAndDropHooks.renderDragPreview ? preview : undefined\n });\n dragAndDropHooks.useDraggableCollection!({}, dragState, ref);\n\n let DragPreview = dragAndDropHooks.DragPreview!;\n dragPreview = dragAndDropHooks.renderDragPreview\n ? <DragPreview ref={preview}>{dragAndDropHooks.renderDragPreview}</DragPreview>\n : null;\n }\n\n if (isListDroppable && dragAndDropHooks) {\n dropState = dragAndDropHooks.useDroppableCollectionState!({\n collection,\n selectionManager\n });\n\n let keyboardDelegate = new ListKeyboardDelegate({\n collection,\n disabledKeys: selectionManager.disabledKeys,\n disabledBehavior: selectionManager.disabledBehavior,\n ref\n });\n let dropTargetDelegate = dragAndDropHooks.dropTargetDelegate || ctxDropTargetDelegate || new dragAndDropHooks.ListDropTargetDelegate(collection, ref, {layout, direction});\n droppableCollection = dragAndDropHooks.useDroppableCollection!({\n keyboardDelegate,\n dropTargetDelegate\n }, dropState, ref);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isDropTarget: isRootDropTarget,\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n layout,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-GridList',\n values: renderValues\n });\n\n let emptyState: ReactNode = null;\n let emptyStatePropOverrides: HTMLAttributes<HTMLElement> | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n let content = props.renderEmptyState(renderValues);\n emptyState = (\n <div role=\"row\" style={{display: 'contents'}}>\n <div role=\"gridcell\" style={{display: 'contents'}}>\n {content}\n </div>\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...renderProps}\n {...mergeProps(gridProps, focusProps, droppableCollection?.collectionProps, emptyStatePropOverrides)}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-drop-target={isRootDropTarget || undefined}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-layout={layout}>\n <Provider\n values={[\n [ListStateContext, state],\n [DragAndDropContext, {dragAndDropHooks, dragState, dropState}],\n [DropIndicatorContext, {render: GridListDropIndicatorWrapper}]\n ]}>\n {isListDroppable && <RootDropIndicator />}\n <CollectionRoot\n collection={collection}\n scrollRef={ref}\n persistedKeys={useDndPersistedKeys(selectionManager, dragAndDropHooks, dropState)}\n renderDropIndicator={useRenderDropIndicator(dragAndDropHooks, dropState)} />\n </Provider>\n {emptyState}\n {dragPreview}\n </div>\n </FocusScope>\n );\n}\n\nexport interface GridListItemRenderProps extends ItemRenderProps {}\n\nexport interface GridListItemProps<T = object> extends RenderProps<GridListItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the item. */\n id?: Key,\n /** The object value that this item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the item's contents, used for features like typeahead. */\n textValue?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /**\n * Handler that is called when a user performs an action on the item. The exact user event depends on\n * the collection's `selectionBehavior` prop and the interaction modality.\n */\n onAction?: () => void\n}\n\n/**\n * A GridListItem represents an individual item in a GridList.\n */\nexport const GridListItem = /*#__PURE__*/ createLeafComponent('item', function GridListItem<T extends object>(props: GridListItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(ListStateContext)!;\n let {dragAndDropHooks, dragState, dropState} = useContext(DragAndDropContext);\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {isVirtualized} = useContext(CollectionRendererContext);\n let {rowProps, gridCellProps, descriptionProps, ...states} = useGridListItem(\n {\n node: item,\n shouldSelectOnPressUp: !!dragState,\n isVirtualized\n },\n state,\n ref\n );\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {checkboxProps} = useGridListSelectionCheckbox(\n {key: item.key},\n state\n );\n\n let buttonProps = state.selectionManager.disabledBehavior === 'all' && states.isDisabled ? {isDisabled: true} : {};\n\n let draggableItem: DraggableItemResult | null = null;\n if (dragState && dragAndDropHooks) {\n draggableItem = dragAndDropHooks.useDraggableItem!({key: item.key, hasDragButton: true}, dragState);\n }\n\n let dropIndicator: DropIndicatorAria | null = null;\n let dropIndicatorRef = useRef<HTMLDivElement>(null);\n let {visuallyHiddenProps} = useVisuallyHidden();\n if (dropState && dragAndDropHooks) {\n dropIndicator = dragAndDropHooks.useDropIndicator!({\n target: {type: 'item', key: item.key, dropPosition: 'on'}\n }, dropState, dropIndicatorRef);\n }\n\n let isDragging = dragState && dragState.isDragging(item.key);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-GridListItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n allowsDragging: !!dragState,\n isDragging,\n isDropTarget: dropIndicator?.isDropTarget\n }\n });\n\n let dragButtonRef = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (dragState && !dragButtonRef.current) {\n console.warn('Draggable items in a GridList must contain a <Button slot=\"drag\"> element so that keyboard and screen reader users can drag them.');\n }\n // eslint-disable-next-line\n }, []);\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <GridListItem> elements with non-plain text children in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n return (\n <>\n {dropIndicator && !dropIndicator.isHidden &&\n <div role=\"row\" style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicator?.dropIndicatorProps} ref={dropIndicatorRef} />\n </div>\n </div>\n }\n <div\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps, draggableItem?.dragProps)}\n {...renderProps}\n ref={ref}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-dragging={!!dragState || undefined}\n data-dragging={isDragging || undefined}\n data-drop-target={dropIndicator?.isDropTarget || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [CheckboxContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n selection: checkboxProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: buttonProps,\n drag: {\n ...draggableItem?.dragButtonProps,\n ref: dragButtonRef,\n style: {\n pointerEvents: 'none'\n }\n }\n }\n }],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n description: descriptionProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer],\n [ListStateContext, null]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n </>\n );\n});\n\nfunction GridListDropIndicatorWrapper(props: DropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n ref = useObjectRef(ref);\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let buttonRef = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps, isHidden, isDropTarget} = dragAndDropHooks!.useDropIndicator!(\n props,\n dropState!,\n buttonRef\n );\n\n if (isHidden) {\n return null;\n }\n\n return (\n <GridListDropIndicatorForwardRef {...props} dropIndicatorProps={dropIndicatorProps} isDropTarget={isDropTarget} buttonRef={buttonRef} ref={ref} />\n );\n}\n\ninterface GridListDropIndicatorProps extends DropIndicatorProps {\n dropIndicatorProps: React.HTMLAttributes<HTMLElement>,\n isDropTarget: boolean,\n buttonRef: RefObject<HTMLDivElement | null>\n}\n\nfunction GridListDropIndicator(props: GridListDropIndicatorProps, ref: ForwardedRef<HTMLElement>) {\n let {\n dropIndicatorProps,\n isDropTarget,\n buttonRef,\n ...otherProps\n } = props;\n\n let {visuallyHiddenProps} = useVisuallyHidden();\n let renderProps = useRenderProps({\n ...otherProps,\n defaultClassName: 'react-aria-DropIndicator',\n values: {\n isDropTarget\n }\n });\n\n return (\n <div\n {...renderProps}\n role=\"row\"\n ref={ref as RefObject<HTMLDivElement | null>}\n data-drop-target={isDropTarget || undefined}>\n <div role=\"gridcell\">\n <div {...visuallyHiddenProps} role=\"button\" {...dropIndicatorProps} ref={buttonRef} />\n {renderProps.children}\n </div>\n </div>\n );\n}\n\nconst GridListDropIndicatorForwardRef = forwardRef(GridListDropIndicator);\n\nfunction RootDropIndicator() {\n let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);\n let ref = useRef<HTMLDivElement>(null);\n let {dropIndicatorProps} = dragAndDropHooks!.useDropIndicator!({\n target: {type: 'root'}\n }, dropState!, ref);\n let isDropTarget = dropState!.isDropTarget({type: 'root'});\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n if (!isDropTarget && dropIndicatorProps['aria-hidden']) {\n return null;\n }\n\n return (\n <div role=\"row\" aria-hidden={dropIndicatorProps['aria-hidden']} style={{position: 'absolute'}}>\n <div role=\"gridcell\">\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicatorProps} ref={ref} />\n </div>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"GridList.module.js.map"}
|
package/dist/Group.main.js
CHANGED
|
@@ -27,7 +27,7 @@ $parcel$export(module.exports, "Group", () => $dcae72abc18c0045$export$eb2fcfdbd
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
const $dcae72abc18c0045$export$f9c6924e160136d1 = /*#__PURE__*/ (0, $1Rw7b$react.createContext)({});
|
|
30
|
-
|
|
30
|
+
const $dcae72abc18c0045$export$eb2fcfdbd7ba97d4 = /*#__PURE__*/ (0, $1Rw7b$react.forwardRef)(function Group(props, ref) {
|
|
31
31
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $dcae72abc18c0045$export$f9c6924e160136d1);
|
|
32
32
|
let { isDisabled: isDisabled, isInvalid: isInvalid, onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
|
|
33
33
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $1Rw7b$reactaria.useHover)({
|
|
@@ -65,10 +65,7 @@ function $dcae72abc18c0045$var$Group(props, ref) {
|
|
|
65
65
|
"data-disabled": isDisabled || undefined,
|
|
66
66
|
"data-invalid": isInvalid || undefined
|
|
67
67
|
}, renderProps.children);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* A group represents a set of related UI controls, and supports interactive states for styling.
|
|
71
|
-
*/ const $dcae72abc18c0045$export$eb2fcfdbd7ba97d4 = /*#__PURE__*/ (0, $1Rw7b$react.forwardRef)($dcae72abc18c0045$var$Group);
|
|
68
|
+
});
|
|
72
69
|
|
|
73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AW;QACf,KAAK;QACL,MAAM,CAAA,cAAA,MAAM,IAAI,cAAV,yBAAA,cAAc;QACpB,MAAM,CAAA,cAAA,MAAM,IAAI,cAAV,yBAAA,cAAc;QACpB,qBAAmB,aAAa;QAChC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,gBAAc,aAAa;OAC1B,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Group.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, forwardRefType} from '@react-types/shared';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {HoverProps, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport interface GroupRenderProps {\n /**\n * Whether the group is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether an element within the group is focused, either via a mouse or keyboard.\n * @selector [data-focus-within]\n */\n isFocusWithin: boolean,\n /**\n * Whether an element within the group is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface GroupProps extends AriaLabelingProps, Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style' | 'role' | 'slot'>, DOMProps, HoverProps, RenderProps<GroupRenderProps>, SlotProps {\n /** Whether the group is disabled. */\n isDisabled?: boolean,\n /** Whether the group is invalid. */\n isInvalid?: boolean,\n /**\n * An accessibility role for the group. By default, this is set to `'group'`.\n * Use `'region'` when the contents of the group is important enough to be\n * included in the page table of contents. Use `'presentation'` if the group\n * is visual only and does not represent a semantic grouping of controls.\n * @default 'group'\n */\n role?: 'group' | 'region' | 'presentation'\n}\n\nexport const GroupContext = createContext<ContextValue<GroupProps, HTMLDivElement>>({});\n\n/**\n * A group represents a set of related UI controls, and supports interactive states for styling.\n */\nexport const Group = /*#__PURE__*/ (forwardRef as forwardRefType)(function Group(props: GroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, GroupContext);\n let {isDisabled, isInvalid, onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverChange, onHoverEnd, isDisabled});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n within: true\n });\n\n isDisabled ??= !!props['aria-disabled'] && props['aria-disabled'] !== 'false';\n isInvalid ??= !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {isHovered, isFocusWithin: isFocused, isFocusVisible, isDisabled, isInvalid},\n defaultClassName: 'react-aria-Group'\n });\n\n return (\n <div\n {...mergeProps(otherProps, focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n role={props.role ?? 'group'}\n slot={props.slot ?? undefined}\n data-focus-within={isFocused || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-invalid={isInvalid || undefined}>\n {renderProps.children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Group.main.js.map"}
|
package/dist/Group.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import $gZciS$react, {createContext as $gZciS$createContext, forwardRef as $gZci
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const $a049562f99e7db0e$export$f9c6924e160136d1 = /*#__PURE__*/ (0, $gZciS$createContext)({});
|
|
19
|
-
|
|
19
|
+
const $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 = /*#__PURE__*/ (0, $gZciS$forwardRef)(function Group(props, ref) {
|
|
20
20
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $a049562f99e7db0e$export$f9c6924e160136d1);
|
|
21
21
|
let { isDisabled: isDisabled, isInvalid: isInvalid, onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
|
|
22
22
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $gZciS$useHover)({
|
|
@@ -54,10 +54,7 @@ function $a049562f99e7db0e$var$Group(props, ref) {
|
|
|
54
54
|
"data-disabled": isDisabled || undefined,
|
|
55
55
|
"data-invalid": isInvalid || undefined
|
|
56
56
|
}, renderProps.children);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* A group represents a set of related UI controls, and supports interactive states for styling.
|
|
60
|
-
*/ const $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 = /*#__PURE__*/ (0, $gZciS$forwardRef)($a049562f99e7db0e$var$Group);
|
|
57
|
+
});
|
|
61
58
|
|
|
62
59
|
|
|
63
60
|
export {$a049562f99e7db0e$export$f9c6924e160136d1 as GroupContext, $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 as Group};
|
package/dist/Group.module.js
CHANGED
|
@@ -16,7 +16,7 @@ import $gZciS$react, {createContext as $gZciS$createContext, forwardRef as $gZci
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const $a049562f99e7db0e$export$f9c6924e160136d1 = /*#__PURE__*/ (0, $gZciS$createContext)({});
|
|
19
|
-
|
|
19
|
+
const $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 = /*#__PURE__*/ (0, $gZciS$forwardRef)(function Group(props, ref) {
|
|
20
20
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $a049562f99e7db0e$export$f9c6924e160136d1);
|
|
21
21
|
let { isDisabled: isDisabled, isInvalid: isInvalid, onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
|
|
22
22
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $gZciS$useHover)({
|
|
@@ -54,10 +54,7 @@ function $a049562f99e7db0e$var$Group(props, ref) {
|
|
|
54
54
|
"data-disabled": isDisabled || undefined,
|
|
55
55
|
"data-invalid": isInvalid || undefined
|
|
56
56
|
}, renderProps.children);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* A group represents a set of related UI controls, and supports interactive states for styling.
|
|
60
|
-
*/ const $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 = /*#__PURE__*/ (0, $gZciS$forwardRef)($a049562f99e7db0e$var$Group);
|
|
57
|
+
});
|
|
61
58
|
|
|
62
59
|
|
|
63
60
|
export {$a049562f99e7db0e$export$f9c6924e160136d1 as GroupContext, $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 as Group};
|
package/dist/Group.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAkDM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAA4C,CAAC;
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAkDM,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAA4C,CAAC;AAK9E,MAAM,4CAAsB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,MAAM,KAAiB,EAAE,GAAiC;IACnI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,cAAC,UAAU,aAAE,SAAS,gBAAE,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAEtF,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;sBAAC;uBAAc;oBAAe;oBAAY;IAAU;IAC3F,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QACzD,QAAQ;IACV;IAEA,uBAAA,wBAAA,aAAA,aAAe,CAAC,CAAC,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,gBAAgB,KAAK;IACtE,sBAAA,uBAAA,YAAA,YAAc,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACnE,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBAAC;YAAW,eAAe;4BAAW;wBAAgB;uBAAY;QAAS;QACnF,kBAAkB;IACpB;QAOU,aACA;IANV,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,YAAY,WAAW;QACjD,GAAG,WAAW;QACf,KAAK;QACL,MAAM,CAAA,cAAA,MAAM,IAAI,cAAV,yBAAA,cAAc;QACpB,MAAM,CAAA,cAAA,MAAM,IAAI,cAAV,yBAAA,cAAc;QACpB,qBAAmB,aAAa;QAChC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,gBAAc,aAAa;OAC1B,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Group.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, DOMProps, forwardRefType} from '@react-types/shared';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {HoverProps, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport interface GroupRenderProps {\n /**\n * Whether the group is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether an element within the group is focused, either via a mouse or keyboard.\n * @selector [data-focus-within]\n */\n isFocusWithin: boolean,\n /**\n * Whether an element within the group is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface GroupProps extends AriaLabelingProps, Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style' | 'role' | 'slot'>, DOMProps, HoverProps, RenderProps<GroupRenderProps>, SlotProps {\n /** Whether the group is disabled. */\n isDisabled?: boolean,\n /** Whether the group is invalid. */\n isInvalid?: boolean,\n /**\n * An accessibility role for the group. By default, this is set to `'group'`.\n * Use `'region'` when the contents of the group is important enough to be\n * included in the page table of contents. Use `'presentation'` if the group\n * is visual only and does not represent a semantic grouping of controls.\n * @default 'group'\n */\n role?: 'group' | 'region' | 'presentation'\n}\n\nexport const GroupContext = createContext<ContextValue<GroupProps, HTMLDivElement>>({});\n\n/**\n * A group represents a set of related UI controls, and supports interactive states for styling.\n */\nexport const Group = /*#__PURE__*/ (forwardRef as forwardRefType)(function Group(props: GroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, GroupContext);\n let {isDisabled, isInvalid, onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverChange, onHoverEnd, isDisabled});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n within: true\n });\n\n isDisabled ??= !!props['aria-disabled'] && props['aria-disabled'] !== 'false';\n isInvalid ??= !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {isHovered, isFocusWithin: isFocused, isFocusVisible, isDisabled, isInvalid},\n defaultClassName: 'react-aria-Group'\n });\n\n return (\n <div\n {...mergeProps(otherProps, focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n role={props.role ?? 'group'}\n slot={props.slot ?? undefined}\n data-focus-within={isFocused || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-invalid={isInvalid || undefined}>\n {renderProps.children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Group.module.js.map"}
|
package/dist/Heading.main.js
CHANGED
|
@@ -25,7 +25,7 @@ $parcel$export(module.exports, "Heading", () => $1063ac64677bb13f$export$a8a3e93
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
const $1063ac64677bb13f$export$a8a3e93435678ff9 = /*#__PURE__*/ (0, $9f9JY$react.forwardRef)(function Heading(props, ref) {
|
|
29
29
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, (0, $525402dfec7da5bc$exports.HeadingContext));
|
|
30
30
|
let { children: children, level: level = 3, className: className, ...domProps } = props;
|
|
31
31
|
let Element = `h${level}`;
|
|
@@ -34,8 +34,7 @@ function $1063ac64677bb13f$var$Heading(props, ref) {
|
|
|
34
34
|
ref: ref,
|
|
35
35
|
className: className !== null && className !== void 0 ? className : 'react-aria-Heading'
|
|
36
36
|
}, children);
|
|
37
|
-
}
|
|
38
|
-
const $1063ac64677bb13f$export$a8a3e93435678ff9 = /*#__PURE__*/ (0, $9f9JY$react.forwardRef)($1063ac64677bb13f$var$Heading);
|
|
37
|
+
});
|
|
39
38
|
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=Heading.main.js.map
|
package/dist/Heading.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAUM,MAAM,0DAAU,CAAA,GAAA,uBAAS,EAAE,SAAS,QAAQ,KAAmB,EAAE,GAAqC;IAC3G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,wCAAa;IACxD,IAAI,YAAC,QAAQ,SAAE,QAAQ,cAAG,SAAS,EAAE,GAAG,UAAS,GAAG;IACpD,IAAI,UAAU,CAAC,CAAC,EAAE,OAAO;IAEzB,qBACE,0DAAC;QAAS,GAAG,QAAQ;QAAE,KAAK;QAAK,WAAW,sBAAA,uBAAA,YAAa;OACtD;AAGP","sources":["packages/react-aria-components/src/Heading.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {HeadingContext} from './RSPContexts';\nimport React, {ElementType, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\nimport {useContextProps} from './utils';\n\nexport interface HeadingProps extends HTMLAttributes<HTMLElement> {\n level?: number\n}\n\nexport const Heading = forwardRef(function Heading(props: HeadingProps, ref: ForwardedRef<HTMLHeadingElement>) {\n [props, ref] = useContextProps(props, ref, HeadingContext);\n let {children, level = 3, className, ...domProps} = props;\n let Element = `h${level}` as ElementType;\n\n return (\n <Element {...domProps} ref={ref} className={className ?? 'react-aria-Heading'}>\n {children}\n </Element>\n );\n});\n"],"names":[],"version":3,"file":"Heading.main.js.map"}
|
package/dist/Heading.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import $bt28J$react, {forwardRef as $bt28J$forwardRef} from "react";
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
const $5cb03073d3f54797$export$a8a3e93435678ff9 = /*#__PURE__*/ (0, $bt28J$forwardRef)(function Heading(props, ref) {
|
|
19
19
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, (0, $4e85f108e88277b8$export$d688439359537581));
|
|
20
20
|
let { children: children, level: level = 3, className: className, ...domProps } = props;
|
|
21
21
|
let Element = `h${level}`;
|
|
@@ -24,8 +24,7 @@ function $5cb03073d3f54797$var$Heading(props, ref) {
|
|
|
24
24
|
ref: ref,
|
|
25
25
|
className: className !== null && className !== void 0 ? className : 'react-aria-Heading'
|
|
26
26
|
}, children);
|
|
27
|
-
}
|
|
28
|
-
const $5cb03073d3f54797$export$a8a3e93435678ff9 = /*#__PURE__*/ (0, $bt28J$forwardRef)($5cb03073d3f54797$var$Heading);
|
|
27
|
+
});
|
|
29
28
|
|
|
30
29
|
|
|
31
30
|
export {$5cb03073d3f54797$export$a8a3e93435678ff9 as Heading};
|
package/dist/Heading.module.js
CHANGED
|
@@ -15,7 +15,7 @@ import $bt28J$react, {forwardRef as $bt28J$forwardRef} from "react";
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
const $5cb03073d3f54797$export$a8a3e93435678ff9 = /*#__PURE__*/ (0, $bt28J$forwardRef)(function Heading(props, ref) {
|
|
19
19
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, (0, $4e85f108e88277b8$export$d688439359537581));
|
|
20
20
|
let { children: children, level: level = 3, className: className, ...domProps } = props;
|
|
21
21
|
let Element = `h${level}`;
|
|
@@ -24,8 +24,7 @@ function $5cb03073d3f54797$var$Heading(props, ref) {
|
|
|
24
24
|
ref: ref,
|
|
25
25
|
className: className !== null && className !== void 0 ? className : 'react-aria-Heading'
|
|
26
26
|
}, children);
|
|
27
|
-
}
|
|
28
|
-
const $5cb03073d3f54797$export$a8a3e93435678ff9 = /*#__PURE__*/ (0, $bt28J$forwardRef)($5cb03073d3f54797$var$Heading);
|
|
27
|
+
});
|
|
29
28
|
|
|
30
29
|
|
|
31
30
|
export {$5cb03073d3f54797$export$a8a3e93435678ff9 as Heading};
|