react-aria-components 3.0.0-nightly-412a51816-250219 → 3.0.0-nightly-a792c1ad5-250222

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.
Files changed (80) hide show
  1. package/dist/Autocomplete.main.js +20 -10
  2. package/dist/Autocomplete.main.js.map +1 -1
  3. package/dist/Autocomplete.mjs +20 -10
  4. package/dist/Autocomplete.module.js +20 -10
  5. package/dist/Autocomplete.module.js.map +1 -1
  6. package/dist/GridList.main.js.map +1 -1
  7. package/dist/GridList.module.js.map +1 -1
  8. package/dist/Group.main.js.map +1 -1
  9. package/dist/Group.module.js.map +1 -1
  10. package/dist/ListBox.main.js +16 -16
  11. package/dist/ListBox.main.js.map +1 -1
  12. package/dist/ListBox.mjs +17 -17
  13. package/dist/ListBox.module.js +17 -17
  14. package/dist/ListBox.module.js.map +1 -1
  15. package/dist/Menu.main.js +72 -7
  16. package/dist/Menu.main.js.map +1 -1
  17. package/dist/Menu.mjs +72 -8
  18. package/dist/Menu.module.js +72 -8
  19. package/dist/Menu.module.js.map +1 -1
  20. package/dist/Popover.main.js +38 -14
  21. package/dist/Popover.main.js.map +1 -1
  22. package/dist/Popover.mjs +39 -15
  23. package/dist/Popover.module.js +39 -15
  24. package/dist/Popover.module.js.map +1 -1
  25. package/dist/SearchField.main.js +3 -1
  26. package/dist/SearchField.main.js.map +1 -1
  27. package/dist/SearchField.mjs +4 -2
  28. package/dist/SearchField.module.js +4 -2
  29. package/dist/SearchField.module.js.map +1 -1
  30. package/dist/Table.main.js +10 -38
  31. package/dist/Table.main.js.map +1 -1
  32. package/dist/Table.mjs +10 -38
  33. package/dist/Table.module.js +10 -38
  34. package/dist/Table.module.js.map +1 -1
  35. package/dist/TableLayout.main.js.map +1 -1
  36. package/dist/TableLayout.module.js.map +1 -1
  37. package/dist/TextField.main.js +3 -1
  38. package/dist/TextField.main.js.map +1 -1
  39. package/dist/TextField.mjs +4 -2
  40. package/dist/TextField.module.js +4 -2
  41. package/dist/TextField.module.js.map +1 -1
  42. package/dist/Toast.main.js +150 -0
  43. package/dist/Toast.main.js.map +1 -0
  44. package/dist/Toast.mjs +139 -0
  45. package/dist/Toast.module.js +139 -0
  46. package/dist/Toast.module.js.map +1 -0
  47. package/dist/Tree.main.js +26 -25
  48. package/dist/Tree.main.js.map +1 -1
  49. package/dist/Tree.mjs +21 -20
  50. package/dist/Tree.module.js +21 -20
  51. package/dist/Tree.module.js.map +1 -1
  52. package/dist/Virtualizer.main.js +4 -1
  53. package/dist/Virtualizer.main.js.map +1 -1
  54. package/dist/Virtualizer.mjs +4 -1
  55. package/dist/Virtualizer.module.js +4 -1
  56. package/dist/Virtualizer.module.js.map +1 -1
  57. package/dist/import.mjs +11 -5
  58. package/dist/main.js +32 -13
  59. package/dist/main.js.map +1 -1
  60. package/dist/module.js +11 -5
  61. package/dist/module.js.map +1 -1
  62. package/dist/types.d.ts +136 -28
  63. package/dist/types.d.ts.map +1 -1
  64. package/i18n/index.js +1 -1
  65. package/i18n/index.mjs +1 -1
  66. package/package.json +34 -32
  67. package/src/Autocomplete.tsx +14 -11
  68. package/src/GridList.tsx +5 -0
  69. package/src/Group.tsx +1 -0
  70. package/src/ListBox.tsx +9 -8
  71. package/src/Menu.tsx +68 -10
  72. package/src/Popover.tsx +47 -21
  73. package/src/SearchField.tsx +3 -3
  74. package/src/Table.tsx +10 -40
  75. package/src/TableLayout.ts +1 -1
  76. package/src/TextField.tsx +3 -3
  77. package/src/Toast.tsx +185 -0
  78. package/src/Tree.tsx +50 -37
  79. package/src/Virtualizer.tsx +18 -3
  80. package/src/index.ts +13 -7
@@ -1,3 +1,4 @@
1
+ var $1bcfcef5af644e13$exports = require("./Input.main.js");
1
2
  var $c5ccf687772c0422$exports = require("./utils.main.js");
2
3
  var $a83c69b310385d53$exports = require("./SearchField.main.js");
3
4
  var $3f2c5af9d7d8905b$exports = require("./TextField.main.js");
@@ -15,10 +16,10 @@ function $parcel$export(e, n, v, s) {
15
16
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
16
17
  }
17
18
 
18
- $parcel$export(module.exports, "UNSTABLE_AutocompleteContext", () => $33f48720060787fa$export$4581e569cc48eb6b);
19
- $parcel$export(module.exports, "UNSTABLE_AutocompleteStateContext", () => $33f48720060787fa$export$879ad50d6ce9688);
19
+ $parcel$export(module.exports, "AutocompleteContext", () => $33f48720060787fa$export$36e687af51cd0967);
20
+ $parcel$export(module.exports, "AutocompleteStateContext", () => $33f48720060787fa$export$68ee3368b6d68148);
20
21
  $parcel$export(module.exports, "UNSTABLE_InternalAutocompleteContext", () => $33f48720060787fa$export$65d2a03b8800d6e3);
21
- $parcel$export(module.exports, "UNSTABLE_Autocomplete", () => $33f48720060787fa$export$d834fde4e1147cd8);
22
+ $parcel$export(module.exports, "Autocomplete", () => $33f48720060787fa$export$2f2b9559550c7bbc);
22
23
  /*
23
24
  * Copyright 2024 Adobe. All rights reserved.
24
25
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -36,24 +37,27 @@ $parcel$export(module.exports, "UNSTABLE_Autocomplete", () => $33f48720060787fa$
36
37
 
37
38
 
38
39
 
39
- const $33f48720060787fa$export$4581e569cc48eb6b = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
40
- const $33f48720060787fa$export$879ad50d6ce9688 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
40
+
41
+ const $33f48720060787fa$export$36e687af51cd0967 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
42
+ const $33f48720060787fa$export$68ee3368b6d68148 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
41
43
  const $33f48720060787fa$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
42
- function $33f48720060787fa$export$d834fde4e1147cd8(props) {
43
- let ctx = (0, $c5ccf687772c0422$exports.useSlottedContext)($33f48720060787fa$export$4581e569cc48eb6b, props.slot);
44
+ function $33f48720060787fa$export$2f2b9559550c7bbc(props) {
45
+ let ctx = (0, $c5ccf687772c0422$exports.useSlottedContext)($33f48720060787fa$export$36e687af51cd0967, props.slot);
44
46
  props = (0, $5lGAV$reactariautils.mergeProps)(ctx, props);
45
47
  let { filter: filter } = props;
46
- let state = (0, $5lGAV$reactstatelyautocomplete.UNSTABLE_useAutocompleteState)(props);
48
+ let state = (0, $5lGAV$reactstatelyautocomplete.useAutocompleteState)(props);
49
+ let inputRef = (0, $5lGAV$react.useRef)(null);
47
50
  let collectionRef = (0, $5lGAV$react.useRef)(null);
48
- let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filterFn: filterFn } = (0, $5lGAV$reactariaautocomplete.UNSTABLE_useAutocomplete)({
51
+ let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filterFn: filterFn } = (0, $5lGAV$reactariaautocomplete.useAutocomplete)({
49
52
  ...(0, $c5ccf687772c0422$exports.removeDataAttributes)(props),
50
53
  filter: filter,
54
+ inputRef: inputRef,
51
55
  collectionRef: collectionRef
52
56
  }, state);
53
57
  return /*#__PURE__*/ (0, ($parcel$interopDefault($5lGAV$react))).createElement((0, $c5ccf687772c0422$exports.Provider), {
54
58
  values: [
55
59
  [
56
- $33f48720060787fa$export$879ad50d6ce9688,
60
+ $33f48720060787fa$export$68ee3368b6d68148,
57
61
  state
58
62
  ],
59
63
  [
@@ -64,6 +68,12 @@ function $33f48720060787fa$export$d834fde4e1147cd8(props) {
64
68
  (0, $3f2c5af9d7d8905b$exports.TextFieldContext),
65
69
  textFieldProps
66
70
  ],
71
+ [
72
+ (0, $1bcfcef5af644e13$exports.InputContext),
73
+ {
74
+ ref: inputRef
75
+ }
76
+ ],
67
77
  [
68
78
  $33f48720060787fa$export$65d2a03b8800d6e3,
69
79
  {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAA+B,CAAA,GAAA,0BAAY,EAA0C;AAC3F,MAAM,yDAAoC,CAAA,GAAA,0BAAY,EAA4B;AAGlF,MAAM,0DAAuC,CAAA,GAAA,0BAAY,EAA2C;AAKpG,SAAS,0CAAsB,KAAwB;IAC5D,IAAI,MAAM,CAAA,GAAA,2CAAgB,EAAE,2CAA8B,MAAM,IAAI;IACpE,QAAQ,CAAA,GAAA,gCAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,EAAC,GAAG;IACf,IAAI,QAAQ,CAAA,GAAA,6DAA4B,EAAE;IAC1C,IAAI,gBAAgB,CAAA,GAAA,mBAAK,EAAe;IAExC,IAAI,kBACF,cAAc,mBACd,eAAe,EACf,eAAe,mBAAmB,YAClC,QAAQ,EACT,GAAG,CAAA,GAAA,qDAAuB,EAAE;QAC3B,GAAG,CAAA,GAAA,8CAAmB,EAAE,MAAM;gBAC9B;uBACA;IACF,GAAG;IAEH,qBACE,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAmC;aAAM;YAC1C;gBAAC,CAAA,GAAA,4CAAiB;gBAAG;aAAe;YACpC;gBAAC,CAAA,GAAA,0CAAe;gBAAG;aAAe;YAClC;gBAAC;gBAAsC;8BACrC;qCACA;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaAutocompleteProps, CollectionOptions, UNSTABLE_useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, UNSTABLE_useAutocompleteState} from '@react-stately/autocomplete';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, RefObject, useRef} from 'react';\nimport {SearchFieldContext} from './SearchField';\nimport {TextFieldContext} from './TextField';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filterFn?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const UNSTABLE_AutocompleteContext = createContext<SlottedContextValue<AutocompleteProps>>(null);\nexport const UNSTABLE_AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n// This context is to pass the register and filter down to whatever collection component is wrapped by the Autocomplete\n// TODO: export from RAC, but rename to something more appropriate\nexport const UNSTABLE_InternalAutocompleteContext = createContext<InternalAutocompleteContextValue | null>(null);\n\n/**\n * A autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query.\n */\nexport function UNSTABLE_Autocomplete(props: AutocompleteProps) {\n let ctx = useSlottedContext(UNSTABLE_AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter} = props;\n let state = UNSTABLE_useAutocompleteState(props);\n let collectionRef = useRef<HTMLElement>(null);\n\n let {\n textFieldProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filterFn\n } = UNSTABLE_useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [UNSTABLE_AutocompleteStateContext, state],\n [SearchFieldContext, textFieldProps],\n [TextFieldContext, textFieldProps],\n [UNSTABLE_InternalAutocompleteContext, {\n filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAmBM,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAmD;AAC3F,MAAM,0DAA2B,CAAA,GAAA,0BAAY,EAA4B;AAGzE,MAAM,0DAAuC,CAAA,GAAA,0BAAY,EAA2C;AAKpG,SAAS,0CAAa,KAAwB;IACnD,IAAI,MAAM,CAAA,GAAA,2CAAgB,EAAE,2CAAqB,MAAM,IAAI;IAC3D,QAAQ,CAAA,GAAA,gCAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,EAAC,GAAG;IACf,IAAI,QAAQ,CAAA,GAAA,oDAAmB,EAAE;IACjC,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,gBAAgB,CAAA,GAAA,mBAAK,EAAe;IACxC,IAAI,kBACF,cAAc,mBACd,eAAe,EACf,eAAe,mBAAmB,YAClC,QAAQ,EACT,GAAG,CAAA,GAAA,4CAAc,EAAE;QAClB,GAAG,CAAA,GAAA,8CAAmB,EAAE,MAAM;gBAC9B;kBACA;uBACA;IACF,GAAG;IAEH,qBACE,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAA0B;aAAM;YACjC;gBAAC,CAAA,GAAA,4CAAiB;gBAAG;aAAe;YACpC;gBAAC,CAAA,GAAA,0CAAe;gBAAG;aAAe;YAClC;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,KAAK;gBAAQ;aAAE;YAC/B;gBAAC;gBAAsC;8BACrC;qCACA;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaAutocompleteProps, CollectionOptions, useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, useAutocompleteState} from '@react-stately/autocomplete';\nimport {InputContext} from './Input';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, RefObject, useRef} from 'react';\nimport {SearchFieldContext} from './SearchField';\nimport {TextFieldContext} from './TextField';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filterFn?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const AutocompleteContext = createContext<SlottedContextValue<Partial<AutocompleteProps>>>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n// This context is to pass the register and filter down to whatever collection component is wrapped by the Autocomplete\n// TODO: export from RAC, but rename to something more appropriate\nexport const UNSTABLE_InternalAutocompleteContext = createContext<InternalAutocompleteContextValue | null>(null);\n\n/**\n * An autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query.\n */\nexport function Autocomplete(props: AutocompleteProps) {\n let ctx = useSlottedContext(AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter} = props;\n let state = useAutocompleteState(props);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let collectionRef = useRef<HTMLElement>(null);\n let {\n textFieldProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filterFn\n } = useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n inputRef,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [AutocompleteStateContext, state],\n [SearchFieldContext, textFieldProps],\n [TextFieldContext, textFieldProps],\n [InputContext, {ref: inputRef}],\n [UNSTABLE_InternalAutocompleteContext, {\n filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.main.js.map"}
@@ -1,8 +1,9 @@
1
+ import {InputContext as $3985021b0ad6602f$export$37fb8590cf2c088c} from "./Input.mjs";
1
2
  import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
2
3
  import {SearchFieldContext as $440f4836bcb56932$export$d1c4e4c63cb03a11} from "./SearchField.mjs";
3
4
  import {TextFieldContext as $bcdf0525bf22703d$export$2129e27b3ef0d483} from "./TextField.mjs";
4
- import {UNSTABLE_useAutocomplete as $llkzs$UNSTABLE_useAutocomplete} from "@react-aria/autocomplete";
5
- import {UNSTABLE_useAutocompleteState as $llkzs$UNSTABLE_useAutocompleteState} from "@react-stately/autocomplete";
5
+ import {useAutocomplete as $llkzs$useAutocomplete} from "@react-aria/autocomplete";
6
+ import {useAutocompleteState as $llkzs$useAutocompleteState} from "@react-stately/autocomplete";
6
7
  import {mergeProps as $llkzs$mergeProps} from "@react-aria/utils";
7
8
  import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$useRef} from "react";
8
9
 
@@ -23,24 +24,27 @@ import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$us
23
24
 
24
25
 
25
26
 
26
- const $d2f53cda644affe3$export$4581e569cc48eb6b = /*#__PURE__*/ (0, $llkzs$createContext)(null);
27
- const $d2f53cda644affe3$export$879ad50d6ce9688 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
27
+
28
+ const $d2f53cda644affe3$export$36e687af51cd0967 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
29
+ const $d2f53cda644affe3$export$68ee3368b6d68148 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
28
30
  const $d2f53cda644affe3$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
29
- function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
30
- let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$4581e569cc48eb6b, props.slot);
31
+ function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
32
+ let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$36e687af51cd0967, props.slot);
31
33
  props = (0, $llkzs$mergeProps)(ctx, props);
32
34
  let { filter: filter } = props;
33
- let state = (0, $llkzs$UNSTABLE_useAutocompleteState)(props);
35
+ let state = (0, $llkzs$useAutocompleteState)(props);
36
+ let inputRef = (0, $llkzs$useRef)(null);
34
37
  let collectionRef = (0, $llkzs$useRef)(null);
35
- let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filterFn: filterFn } = (0, $llkzs$UNSTABLE_useAutocomplete)({
38
+ let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filterFn: filterFn } = (0, $llkzs$useAutocomplete)({
36
39
  ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
37
40
  filter: filter,
41
+ inputRef: inputRef,
38
42
  collectionRef: collectionRef
39
43
  }, state);
40
44
  return /*#__PURE__*/ (0, $llkzs$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
41
45
  values: [
42
46
  [
43
- $d2f53cda644affe3$export$879ad50d6ce9688,
47
+ $d2f53cda644affe3$export$68ee3368b6d68148,
44
48
  state
45
49
  ],
46
50
  [
@@ -51,6 +55,12 @@ function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
51
55
  (0, $bcdf0525bf22703d$export$2129e27b3ef0d483),
52
56
  textFieldProps
53
57
  ],
58
+ [
59
+ (0, $3985021b0ad6602f$export$37fb8590cf2c088c),
60
+ {
61
+ ref: inputRef
62
+ }
63
+ ],
54
64
  [
55
65
  $d2f53cda644affe3$export$65d2a03b8800d6e3,
56
66
  {
@@ -64,5 +74,5 @@ function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
64
74
  }
65
75
 
66
76
 
67
- export {$d2f53cda644affe3$export$4581e569cc48eb6b as UNSTABLE_AutocompleteContext, $d2f53cda644affe3$export$879ad50d6ce9688 as UNSTABLE_AutocompleteStateContext, $d2f53cda644affe3$export$65d2a03b8800d6e3 as UNSTABLE_InternalAutocompleteContext, $d2f53cda644affe3$export$d834fde4e1147cd8 as UNSTABLE_Autocomplete};
77
+ export {$d2f53cda644affe3$export$36e687af51cd0967 as AutocompleteContext, $d2f53cda644affe3$export$68ee3368b6d68148 as AutocompleteStateContext, $d2f53cda644affe3$export$65d2a03b8800d6e3 as UNSTABLE_InternalAutocompleteContext, $d2f53cda644affe3$export$2f2b9559550c7bbc as Autocomplete};
68
78
  //# sourceMappingURL=Autocomplete.module.js.map
@@ -1,8 +1,9 @@
1
+ import {InputContext as $3985021b0ad6602f$export$37fb8590cf2c088c} from "./Input.module.js";
1
2
  import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, removeDataAttributes as $64fa3d84918910a7$export$ef03459518577ad4, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
2
3
  import {SearchFieldContext as $440f4836bcb56932$export$d1c4e4c63cb03a11} from "./SearchField.module.js";
3
4
  import {TextFieldContext as $bcdf0525bf22703d$export$2129e27b3ef0d483} from "./TextField.module.js";
4
- import {UNSTABLE_useAutocomplete as $llkzs$UNSTABLE_useAutocomplete} from "@react-aria/autocomplete";
5
- import {UNSTABLE_useAutocompleteState as $llkzs$UNSTABLE_useAutocompleteState} from "@react-stately/autocomplete";
5
+ import {useAutocomplete as $llkzs$useAutocomplete} from "@react-aria/autocomplete";
6
+ import {useAutocompleteState as $llkzs$useAutocompleteState} from "@react-stately/autocomplete";
6
7
  import {mergeProps as $llkzs$mergeProps} from "@react-aria/utils";
7
8
  import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$useRef} from "react";
8
9
 
@@ -23,24 +24,27 @@ import $llkzs$react, {createContext as $llkzs$createContext, useRef as $llkzs$us
23
24
 
24
25
 
25
26
 
26
- const $d2f53cda644affe3$export$4581e569cc48eb6b = /*#__PURE__*/ (0, $llkzs$createContext)(null);
27
- const $d2f53cda644affe3$export$879ad50d6ce9688 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
27
+
28
+ const $d2f53cda644affe3$export$36e687af51cd0967 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
29
+ const $d2f53cda644affe3$export$68ee3368b6d68148 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
28
30
  const $d2f53cda644affe3$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $llkzs$createContext)(null);
29
- function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
30
- let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$4581e569cc48eb6b, props.slot);
31
+ function $d2f53cda644affe3$export$2f2b9559550c7bbc(props) {
32
+ let ctx = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($d2f53cda644affe3$export$36e687af51cd0967, props.slot);
31
33
  props = (0, $llkzs$mergeProps)(ctx, props);
32
34
  let { filter: filter } = props;
33
- let state = (0, $llkzs$UNSTABLE_useAutocompleteState)(props);
35
+ let state = (0, $llkzs$useAutocompleteState)(props);
36
+ let inputRef = (0, $llkzs$useRef)(null);
34
37
  let collectionRef = (0, $llkzs$useRef)(null);
35
- let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filterFn: filterFn } = (0, $llkzs$UNSTABLE_useAutocomplete)({
38
+ let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filterFn: filterFn } = (0, $llkzs$useAutocomplete)({
36
39
  ...(0, $64fa3d84918910a7$export$ef03459518577ad4)(props),
37
40
  filter: filter,
41
+ inputRef: inputRef,
38
42
  collectionRef: collectionRef
39
43
  }, state);
40
44
  return /*#__PURE__*/ (0, $llkzs$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
41
45
  values: [
42
46
  [
43
- $d2f53cda644affe3$export$879ad50d6ce9688,
47
+ $d2f53cda644affe3$export$68ee3368b6d68148,
44
48
  state
45
49
  ],
46
50
  [
@@ -51,6 +55,12 @@ function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
51
55
  (0, $bcdf0525bf22703d$export$2129e27b3ef0d483),
52
56
  textFieldProps
53
57
  ],
58
+ [
59
+ (0, $3985021b0ad6602f$export$37fb8590cf2c088c),
60
+ {
61
+ ref: inputRef
62
+ }
63
+ ],
54
64
  [
55
65
  $d2f53cda644affe3$export$65d2a03b8800d6e3,
56
66
  {
@@ -64,5 +74,5 @@ function $d2f53cda644affe3$export$d834fde4e1147cd8(props) {
64
74
  }
65
75
 
66
76
 
67
- export {$d2f53cda644affe3$export$4581e569cc48eb6b as UNSTABLE_AutocompleteContext, $d2f53cda644affe3$export$879ad50d6ce9688 as UNSTABLE_AutocompleteStateContext, $d2f53cda644affe3$export$65d2a03b8800d6e3 as UNSTABLE_InternalAutocompleteContext, $d2f53cda644affe3$export$d834fde4e1147cd8 as UNSTABLE_Autocomplete};
77
+ export {$d2f53cda644affe3$export$36e687af51cd0967 as AutocompleteContext, $d2f53cda644affe3$export$68ee3368b6d68148 as AutocompleteStateContext, $d2f53cda644affe3$export$65d2a03b8800d6e3 as UNSTABLE_InternalAutocompleteContext, $d2f53cda644affe3$export$2f2b9559550c7bbc as Autocomplete};
68
78
  //# sourceMappingURL=Autocomplete.module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAA+B,CAAA,GAAA,oBAAY,EAA0C;AAC3F,MAAM,yDAAoC,CAAA,GAAA,oBAAY,EAA4B;AAGlF,MAAM,0DAAuC,CAAA,GAAA,oBAAY,EAA2C;AAKpG,SAAS,0CAAsB,KAAwB;IAC5D,IAAI,MAAM,CAAA,GAAA,yCAAgB,EAAE,2CAA8B,MAAM,IAAI;IACpE,QAAQ,CAAA,GAAA,iBAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,EAAC,GAAG;IACf,IAAI,QAAQ,CAAA,GAAA,oCAA4B,EAAE;IAC1C,IAAI,gBAAgB,CAAA,GAAA,aAAK,EAAe;IAExC,IAAI,kBACF,cAAc,mBACd,eAAe,EACf,eAAe,mBAAmB,YAClC,QAAQ,EACT,GAAG,CAAA,GAAA,+BAAuB,EAAE;QAC3B,GAAG,CAAA,GAAA,yCAAmB,EAAE,MAAM;gBAC9B;uBACA;IACF,GAAG;IAEH,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAAmC;aAAM;YAC1C;gBAAC,CAAA,GAAA,yCAAiB;gBAAG;aAAe;YACpC;gBAAC,CAAA,GAAA,yCAAe;gBAAG;aAAe;YAClC;gBAAC;gBAAsC;8BACrC;qCACA;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaAutocompleteProps, CollectionOptions, UNSTABLE_useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, UNSTABLE_useAutocompleteState} from '@react-stately/autocomplete';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, RefObject, useRef} from 'react';\nimport {SearchFieldContext} from './SearchField';\nimport {TextFieldContext} from './TextField';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filterFn?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const UNSTABLE_AutocompleteContext = createContext<SlottedContextValue<AutocompleteProps>>(null);\nexport const UNSTABLE_AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n// This context is to pass the register and filter down to whatever collection component is wrapped by the Autocomplete\n// TODO: export from RAC, but rename to something more appropriate\nexport const UNSTABLE_InternalAutocompleteContext = createContext<InternalAutocompleteContextValue | null>(null);\n\n/**\n * A autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query.\n */\nexport function UNSTABLE_Autocomplete(props: AutocompleteProps) {\n let ctx = useSlottedContext(UNSTABLE_AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter} = props;\n let state = UNSTABLE_useAutocompleteState(props);\n let collectionRef = useRef<HTMLElement>(null);\n\n let {\n textFieldProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filterFn\n } = UNSTABLE_useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [UNSTABLE_AutocompleteStateContext, state],\n [SearchFieldContext, textFieldProps],\n [TextFieldContext, textFieldProps],\n [UNSTABLE_InternalAutocompleteContext, {\n filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.module.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAmBM,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAmD;AAC3F,MAAM,0DAA2B,CAAA,GAAA,oBAAY,EAA4B;AAGzE,MAAM,0DAAuC,CAAA,GAAA,oBAAY,EAA2C;AAKpG,SAAS,0CAAa,KAAwB;IACnD,IAAI,MAAM,CAAA,GAAA,yCAAgB,EAAE,2CAAqB,MAAM,IAAI;IAC3D,QAAQ,CAAA,GAAA,iBAAS,EAAE,KAAK;IACxB,IAAI,UAAC,MAAM,EAAC,GAAG;IACf,IAAI,QAAQ,CAAA,GAAA,2BAAmB,EAAE;IACjC,IAAI,WAAW,CAAA,GAAA,aAAK,EAA2B;IAC/C,IAAI,gBAAgB,CAAA,GAAA,aAAK,EAAe;IACxC,IAAI,kBACF,cAAc,mBACd,eAAe,EACf,eAAe,mBAAmB,YAClC,QAAQ,EACT,GAAG,CAAA,GAAA,sBAAc,EAAE;QAClB,GAAG,CAAA,GAAA,yCAAmB,EAAE,MAAM;gBAC9B;kBACA;uBACA;IACF,GAAG;IAEH,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAA0B;aAAM;YACjC;gBAAC,CAAA,GAAA,yCAAiB;gBAAG;aAAe;YACpC;gBAAC,CAAA,GAAA,yCAAe;gBAAG;aAAe;YAClC;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,KAAK;gBAAQ;aAAE;YAC/B;gBAAC;gBAAsC;8BACrC;qCACA;oBACA,eAAe;gBACjB;aAAE;SACH;OACA,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Autocomplete.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaAutocompleteProps, CollectionOptions, useAutocomplete} from '@react-aria/autocomplete';\nimport {AutocompleteState, useAutocompleteState} from '@react-stately/autocomplete';\nimport {InputContext} from './Input';\nimport {mergeProps} from '@react-aria/utils';\nimport {Provider, removeDataAttributes, SlotProps, SlottedContextValue, useSlottedContext} from './utils';\nimport React, {createContext, RefObject, useRef} from 'react';\nimport {SearchFieldContext} from './SearchField';\nimport {TextFieldContext} from './TextField';\n\nexport interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {}\n\ninterface InternalAutocompleteContextValue {\n filterFn?: (nodeTextValue: string) => boolean,\n collectionProps: CollectionOptions,\n collectionRef: RefObject<HTMLElement | null>\n}\n\nexport const AutocompleteContext = createContext<SlottedContextValue<Partial<AutocompleteProps>>>(null);\nexport const AutocompleteStateContext = createContext<AutocompleteState | null>(null);\n// This context is to pass the register and filter down to whatever collection component is wrapped by the Autocomplete\n// TODO: export from RAC, but rename to something more appropriate\nexport const UNSTABLE_InternalAutocompleteContext = createContext<InternalAutocompleteContextValue | null>(null);\n\n/**\n * An autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query.\n */\nexport function Autocomplete(props: AutocompleteProps) {\n let ctx = useSlottedContext(AutocompleteContext, props.slot);\n props = mergeProps(ctx, props);\n let {filter} = props;\n let state = useAutocompleteState(props);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let collectionRef = useRef<HTMLElement>(null);\n let {\n textFieldProps,\n collectionProps,\n collectionRef: mergedCollectionRef,\n filterFn\n } = useAutocomplete({\n ...removeDataAttributes(props),\n filter,\n inputRef,\n collectionRef\n }, state);\n\n return (\n <Provider\n values={[\n [AutocompleteStateContext, state],\n [SearchFieldContext, textFieldProps],\n [TextFieldContext, textFieldProps],\n [InputContext, {ref: inputRef}],\n [UNSTABLE_InternalAutocompleteContext, {\n filterFn,\n collectionProps,\n collectionRef: mergedCollectionRef\n }]\n ]}>\n {props.children}\n </Provider>\n );\n};\n"],"names":[],"version":3,"file":"Autocomplete.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AA+DM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD;AAMxF,MAAM,4CAAyB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EnD,SAAS;IACP,IAAI,oBAAC,gBAAgB,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,4CAAiB;IAChE,IAAI,MAAM,CAAA,GAAA,mBAAK,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,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"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAoEM,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,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,OAAO;QAAU,aAAa;IAAM;IAChE,IAAI,oBAAC,gBAAgB,gBAAE,YAAY,EAAC,GAAG,MAAM,gBAAgB;IAC7D,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,0BAAQ;IAC1B,I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AA,GAAA,wCAAa,EAAE;QAC/B,GAAG,UAAU;QACb,kBAAkB;QAClB,QAAQ;0BACN;QACF;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,WAAW;QACf,MAAK;QACL,KAAK;QACL,oBAAkB,gBAAgB;qBAClC,0DAAC;QAAI,MAAK;qBACR,0DAAC;QAAK,GAAG,mBAAmB;QAAE,MAAK;QAAU,GAAG,kBAAkB;QAAE,KAAK;QACxE,YAAY,QAAQ;AAI7B;AAEA,MAAM,sEAAkC,CAAA,GAAA,uBAAS,EAAE;AAEnD,SAAS;IACP,IAAI,oBAAC,gBAAgB,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,4CAAiB;IAChE,IAAI,MAAM,CAAA,GAAA,mBAAK,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,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 /**\n * Whether typeahead navigation is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\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"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AA+DM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD;AAMxF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAA2B,KAAuB,EAAE,GAAiC;IACjK,+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,oCAAgC,SAAC,KAAK,cAAE,UAAU,EAAE,aAAa,GAAG,EAAwB;IACnG,IAAI,oBAAC,gBAAgB,8BAAE,6BAA6B,iBAAS,SAAS,SAAQ,GAAG;IACjF,IAAI,kBAAC,cAAc,iBAA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;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"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAoEM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD;AAMxF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAA2B,KAAuB,EAAE,GAAiC;IACjK,+FAA+F;IAC/F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,qB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C,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 /**\n * Whether typeahead navigation is disabled.\n * @default false\n */\n disallowTypeAhead?: boolean,\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} {...dropInd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B,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"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAkDM,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAA4C,CAAC;AAK9E,MAAM,4CAAsB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,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,yBAAO,EAAE;sBAAC;uBAAc;oBAAe;oBAAY;IAAU;IAC3F,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,6BAAW,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;IAEnE,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBAAC;YAAW,eAAe;4BAAW;wBAAgB;uBAAY;QAAS;QACnF,kBAAkB;IACpB;QAOU,aACA;IANV,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,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\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"}
@@ -1 +1 @@
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"}
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;IAEnE,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\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"}