react-aria-components 3.0.0-nightly-3f44370de-241118 → 3.0.0-nightly-b3a4d6c11-241119

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 (133) hide show
  1. package/dist/Breadcrumbs.main.js +2 -2
  2. package/dist/Breadcrumbs.main.js.map +1 -1
  3. package/dist/Breadcrumbs.mjs +2 -2
  4. package/dist/Breadcrumbs.module.js +2 -2
  5. package/dist/Breadcrumbs.module.js.map +1 -1
  6. package/dist/Button.main.js.map +1 -1
  7. package/dist/Button.module.js.map +1 -1
  8. package/dist/Collection.main.js.map +1 -1
  9. package/dist/Collection.module.js.map +1 -1
  10. package/dist/ComboBox.main.js +2 -2
  11. package/dist/ComboBox.main.js.map +1 -1
  12. package/dist/ComboBox.mjs +2 -2
  13. package/dist/ComboBox.module.js +2 -2
  14. package/dist/ComboBox.module.js.map +1 -1
  15. package/dist/Dialog.main.js +22 -1
  16. package/dist/Dialog.main.js.map +1 -1
  17. package/dist/Dialog.mjs +23 -2
  18. package/dist/Dialog.module.js +23 -2
  19. package/dist/Dialog.module.js.map +1 -1
  20. package/dist/Disclosure.main.js +1 -1
  21. package/dist/Disclosure.main.js.map +1 -1
  22. package/dist/Disclosure.mjs +1 -1
  23. package/dist/Disclosure.module.js +1 -1
  24. package/dist/Disclosure.module.js.map +1 -1
  25. package/dist/Heading.main.js.map +1 -1
  26. package/dist/Heading.module.js.map +1 -1
  27. package/dist/Menu.main.js +7 -45
  28. package/dist/Menu.main.js.map +1 -1
  29. package/dist/Menu.mjs +9 -47
  30. package/dist/Menu.module.js +9 -47
  31. package/dist/Menu.module.js.map +1 -1
  32. package/dist/OverlayArrow.main.js +1 -1
  33. package/dist/OverlayArrow.main.js.map +1 -1
  34. package/dist/OverlayArrow.mjs +1 -1
  35. package/dist/OverlayArrow.module.js +1 -1
  36. package/dist/OverlayArrow.module.js.map +1 -1
  37. package/dist/Popover.main.js +1 -0
  38. package/dist/Popover.main.js.map +1 -1
  39. package/dist/Popover.mjs +1 -0
  40. package/dist/Popover.module.js +1 -0
  41. package/dist/Popover.module.js.map +1 -1
  42. package/dist/Table.main.js +2 -10
  43. package/dist/Table.main.js.map +1 -1
  44. package/dist/Table.mjs +2 -10
  45. package/dist/Table.module.js +2 -10
  46. package/dist/Table.module.js.map +1 -1
  47. package/dist/Tooltip.main.js +1 -1
  48. package/dist/Tooltip.main.js.map +1 -1
  49. package/dist/Tooltip.mjs +1 -1
  50. package/dist/Tooltip.module.js +1 -1
  51. package/dist/Tooltip.module.js.map +1 -1
  52. package/dist/Virtualizer.main.js.map +1 -1
  53. package/dist/Virtualizer.module.js.map +1 -1
  54. package/dist/types.d.ts +107 -107
  55. package/dist/types.d.ts.map +1 -1
  56. package/i18n/ar-AE.js +1 -1
  57. package/i18n/ar-AE.mjs +1 -1
  58. package/i18n/bg-BG.js +1 -1
  59. package/i18n/bg-BG.mjs +1 -1
  60. package/i18n/cs-CZ.js +1 -1
  61. package/i18n/cs-CZ.mjs +1 -1
  62. package/i18n/da-DK.js +1 -1
  63. package/i18n/da-DK.mjs +1 -1
  64. package/i18n/de-DE.js +1 -1
  65. package/i18n/de-DE.mjs +1 -1
  66. package/i18n/el-GR.js +1 -1
  67. package/i18n/el-GR.mjs +1 -1
  68. package/i18n/en-US.js +1 -1
  69. package/i18n/en-US.mjs +1 -1
  70. package/i18n/es-ES.js +1 -1
  71. package/i18n/es-ES.mjs +1 -1
  72. package/i18n/et-EE.js +1 -1
  73. package/i18n/et-EE.mjs +1 -1
  74. package/i18n/fi-FI.js +1 -1
  75. package/i18n/fi-FI.mjs +1 -1
  76. package/i18n/fr-FR.js +1 -1
  77. package/i18n/fr-FR.mjs +1 -1
  78. package/i18n/he-IL.js +1 -1
  79. package/i18n/he-IL.mjs +1 -1
  80. package/i18n/hr-HR.js +1 -1
  81. package/i18n/hr-HR.mjs +1 -1
  82. package/i18n/hu-HU.js +1 -1
  83. package/i18n/hu-HU.mjs +1 -1
  84. package/i18n/it-IT.js +1 -1
  85. package/i18n/it-IT.mjs +1 -1
  86. package/i18n/ja-JP.js +1 -1
  87. package/i18n/ja-JP.mjs +1 -1
  88. package/i18n/ko-KR.js +1 -1
  89. package/i18n/ko-KR.mjs +1 -1
  90. package/i18n/lt-LT.js +1 -1
  91. package/i18n/lt-LT.mjs +1 -1
  92. package/i18n/lv-LV.js +1 -1
  93. package/i18n/lv-LV.mjs +1 -1
  94. package/i18n/nb-NO.js +1 -1
  95. package/i18n/nb-NO.mjs +1 -1
  96. package/i18n/nl-NL.js +1 -1
  97. package/i18n/nl-NL.mjs +1 -1
  98. package/i18n/pl-PL.js +1 -1
  99. package/i18n/pl-PL.mjs +1 -1
  100. package/i18n/pt-BR.js +1 -1
  101. package/i18n/pt-BR.mjs +1 -1
  102. package/i18n/pt-PT.js +1 -1
  103. package/i18n/pt-PT.mjs +1 -1
  104. package/i18n/ro-RO.js +1 -1
  105. package/i18n/ro-RO.mjs +1 -1
  106. package/i18n/ru-RU.js +1 -1
  107. package/i18n/ru-RU.mjs +1 -1
  108. package/i18n/sk-SK.js +1 -1
  109. package/i18n/sk-SK.mjs +1 -1
  110. package/i18n/sl-SI.js +1 -1
  111. package/i18n/sl-SI.mjs +1 -1
  112. package/i18n/sr-SP.js +1 -1
  113. package/i18n/sr-SP.mjs +1 -1
  114. package/i18n/sv-SE.js +1 -1
  115. package/i18n/sv-SE.mjs +1 -1
  116. package/i18n/tr-TR.js +1 -1
  117. package/i18n/tr-TR.mjs +1 -1
  118. package/i18n/uk-UA.js +1 -1
  119. package/i18n/uk-UA.mjs +1 -1
  120. package/i18n/zh-CN.js +1 -1
  121. package/i18n/zh-CN.mjs +1 -1
  122. package/i18n/zh-TW.js +1 -1
  123. package/i18n/zh-TW.mjs +1 -1
  124. package/package.json +32 -33
  125. package/src/Collection.tsx +1 -1
  126. package/src/Dialog.tsx +15 -2
  127. package/src/Disclosure.tsx +1 -1
  128. package/src/Menu.tsx +7 -33
  129. package/src/OverlayArrow.tsx +5 -3
  130. package/src/Popover.tsx +2 -2
  131. package/src/Table.tsx +1 -2
  132. package/src/Tooltip.tsx +2 -2
  133. package/src/Virtualizer.tsx +2 -2
package/dist/Dialog.mjs CHANGED
@@ -1,9 +1,11 @@
1
+ import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.mjs";
1
2
  import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
2
3
  import {HeadingContext as $4e85f108e88277b8$export$d688439359537581} from "./RSPContexts.mjs";
3
4
  import {PopoverContext as $07b14b47974efb58$export$9b9a0cd73afb7ca4} from "./Popover.mjs";
5
+ import {RootMenuTriggerStateContext as $3674c52c6b3c5bce$export$795aec4671cbae19} from "./Menu.mjs";
4
6
  import {useOverlayTrigger as $6IYYA$useOverlayTrigger, useId as $6IYYA$useId, useDialog as $6IYYA$useDialog} from "react-aria";
5
7
  import {filterDOMProps as $6IYYA$filterDOMProps} from "@react-aria/utils";
6
- import {useOverlayTriggerState as $6IYYA$useOverlayTriggerState} from "react-stately";
8
+ import {useMenuTriggerState as $6IYYA$useMenuTriggerState} from "react-stately";
7
9
  import {PressResponder as $6IYYA$PressResponder} from "@react-aria/interactions";
8
10
  import $6IYYA$react, {createContext as $6IYYA$createContext, useRef as $6IYYA$useRef, useContext as $6IYYA$useContext, forwardRef as $6IYYA$forwardRef} from "react";
9
11
 
@@ -25,10 +27,14 @@ import $6IYYA$react, {createContext as $6IYYA$createContext, useRef as $6IYYA$us
25
27
 
26
28
 
27
29
 
30
+
31
+
28
32
  const $de32f1b87079253c$export$8b93a07348a7730c = /*#__PURE__*/ (0, $6IYYA$createContext)(null);
29
33
  const $de32f1b87079253c$export$d2f961adcb0afbe = /*#__PURE__*/ (0, $6IYYA$createContext)(null);
30
34
  function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
31
- let state = (0, $6IYYA$useOverlayTriggerState)(props);
35
+ // Use useMenuTriggerState instead of useOverlayTriggerState in case a menu is embedded in the dialog.
36
+ // This is needed to handle submenus.
37
+ let state = (0, $6IYYA$useMenuTriggerState)(props);
32
38
  let buttonRef = (0, $6IYYA$useRef)(null);
33
39
  let { triggerProps: triggerProps, overlayProps: overlayProps } = (0, $6IYYA$useOverlayTrigger)({
34
40
  type: 'dialog'
@@ -45,6 +51,10 @@ function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
45
51
  $de32f1b87079253c$export$d2f961adcb0afbe,
46
52
  state
47
53
  ],
54
+ [
55
+ (0, $3674c52c6b3c5bce$export$795aec4671cbae19),
56
+ state
57
+ ],
48
58
  [
49
59
  $de32f1b87079253c$export$8b93a07348a7730c,
50
60
  overlayProps
@@ -107,6 +117,17 @@ function $de32f1b87079253c$var$Dialog(props, ref) {
107
117
  }
108
118
  }
109
119
  }
120
+ ],
121
+ [
122
+ (0, $d2b4bc8c273e7be6$export$24d547caef80ccd1),
123
+ {
124
+ slots: {
125
+ [(0, $64fa3d84918910a7$export$c62b8e45d58ddad9)]: {},
126
+ close: {
127
+ onPress: ()=>state === null || state === void 0 ? void 0 : state.close()
128
+ }
129
+ }
130
+ }
110
131
  ]
111
132
  ]
112
133
  }, renderProps.children));
@@ -1,9 +1,11 @@
1
+ import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.module.js";
1
2
  import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
2
3
  import {HeadingContext as $4e85f108e88277b8$export$d688439359537581} from "./RSPContexts.module.js";
3
4
  import {PopoverContext as $07b14b47974efb58$export$9b9a0cd73afb7ca4} from "./Popover.module.js";
5
+ import {RootMenuTriggerStateContext as $3674c52c6b3c5bce$export$795aec4671cbae19} from "./Menu.module.js";
4
6
  import {useOverlayTrigger as $6IYYA$useOverlayTrigger, useId as $6IYYA$useId, useDialog as $6IYYA$useDialog} from "react-aria";
5
7
  import {filterDOMProps as $6IYYA$filterDOMProps} from "@react-aria/utils";
6
- import {useOverlayTriggerState as $6IYYA$useOverlayTriggerState} from "react-stately";
8
+ import {useMenuTriggerState as $6IYYA$useMenuTriggerState} from "react-stately";
7
9
  import {PressResponder as $6IYYA$PressResponder} from "@react-aria/interactions";
8
10
  import $6IYYA$react, {createContext as $6IYYA$createContext, useRef as $6IYYA$useRef, useContext as $6IYYA$useContext, forwardRef as $6IYYA$forwardRef} from "react";
9
11
 
@@ -25,10 +27,14 @@ import $6IYYA$react, {createContext as $6IYYA$createContext, useRef as $6IYYA$us
25
27
 
26
28
 
27
29
 
30
+
31
+
28
32
  const $de32f1b87079253c$export$8b93a07348a7730c = /*#__PURE__*/ (0, $6IYYA$createContext)(null);
29
33
  const $de32f1b87079253c$export$d2f961adcb0afbe = /*#__PURE__*/ (0, $6IYYA$createContext)(null);
30
34
  function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
31
- let state = (0, $6IYYA$useOverlayTriggerState)(props);
35
+ // Use useMenuTriggerState instead of useOverlayTriggerState in case a menu is embedded in the dialog.
36
+ // This is needed to handle submenus.
37
+ let state = (0, $6IYYA$useMenuTriggerState)(props);
32
38
  let buttonRef = (0, $6IYYA$useRef)(null);
33
39
  let { triggerProps: triggerProps, overlayProps: overlayProps } = (0, $6IYYA$useOverlayTrigger)({
34
40
  type: 'dialog'
@@ -45,6 +51,10 @@ function $de32f1b87079253c$export$2e1e1122cf0cba88(props) {
45
51
  $de32f1b87079253c$export$d2f961adcb0afbe,
46
52
  state
47
53
  ],
54
+ [
55
+ (0, $3674c52c6b3c5bce$export$795aec4671cbae19),
56
+ state
57
+ ],
48
58
  [
49
59
  $de32f1b87079253c$export$8b93a07348a7730c,
50
60
  overlayProps
@@ -107,6 +117,17 @@ function $de32f1b87079253c$var$Dialog(props, ref) {
107
117
  }
108
118
  }
109
119
  }
120
+ ],
121
+ [
122
+ (0, $d2b4bc8c273e7be6$export$24d547caef80ccd1),
123
+ {
124
+ slots: {
125
+ [(0, $64fa3d84918910a7$export$c62b8e45d58ddad9)]: {},
126
+ close: {
127
+ onPress: ()=>state === null || state === void 0 ? void 0 : state.close()
128
+ }
129
+ }
130
+ }
110
131
  ]
111
132
  ]
112
133
  }, renderProps.children));
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAwBM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA0C;AAC5E,MAAM,yDAA6B,CAAA,GAAA,oBAAY,EAA8B;AAK7E,SAAS,0CAAc,KAAyB;IACrD,IAAI,QAAQ,CAAA,GAAA,6BAAqB,EAAE;IAEnC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAqB;IAC1C,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,wBAAgB,EAAE;QAAC,MAAM;IAAQ,GAAG,OAAO;IAE9E,uEAAuE;IACvE,+EAA+E;IAC/E,0EAA0E;IAC1E,qDAAqD;IACrD,aAAa,EAAE,GAAG,CAAA,GAAA,YAAI;IACtB,YAAY,CAAC,kBAAkB,GAAG,aAAa,EAAE;IAEjD,qBACE,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAA4B;aAAM;YACnC;gBAAC;gBAAe;aAAa;YAC7B;gBAAC,CAAA,GAAA,yCAAa;gBAAG;oBAAC,SAAS;oBAAiB,YAAY;gBAAS;aAAE;SACpE;qBACD,gCAAC,CAAA,GAAA,qBAAa;QAAG,GAAG,YAAY;QAAE,KAAK;QAAW,WAAW,MAAM,MAAM;OACtE,MAAM,QAAQ;AAIvB;AAEA,SAAS,6BAAO,KAAkB,EAAE,GAA8B;IAChE,IAAI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/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaDialogProps, useDialog, useId, useOverlayTrigger} from 'react-aria';\nimport {ContextValue, DEFAULT_SLOT, Provider, SlotProps, StyleProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType} from '@react-types/shared';\nimport {HeadingContext} from './RSPContexts';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {PopoverContext} from './Popover';\nimport {PressResponder} from '@react-aria/interactions';\nimport React, {createContext, ForwardedRef, forwardRef, ReactNode, useContext, useRef} from 'react';\n\nexport interface DialogTriggerProps extends OverlayTriggerProps {\n children: ReactNode\n}\n\ninterface DialogRenderProps {\n close: () => void\n}\n\nexport interface DialogProps extends AriaDialogProps, StyleProps, SlotProps {\n /** Children of the dialog. A function may be provided to access a function to close the dialog. */\n children?: ReactNode | ((opts: DialogRenderProps) => ReactNode)\n}\n\nexport const DialogContext = createContext<ContextValue<DialogProps, HTMLElement>>(null);\nexport const OverlayTriggerStateContext = createContext<OverlayTriggerState | null>(null);\n\n/**\n * A DialogTrigger opens a dialog when a trigger element is pressed.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n let state = useOverlayTriggerState(props);\n\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {triggerProps, overlayProps} = useOverlayTrigger({type: 'dialog'}, state, buttonRef);\n\n // Label dialog by the trigger as a fallback if there is no title slot.\n // This is done in RAC instead of hooks because otherwise we cannot distinguish\n // between context and props. Normally aria-labelledby overrides the title\n // but when sent by context we want the title to win.\n triggerProps.id = useId();\n overlayProps['aria-labelledby'] = triggerProps.id;\n\n return (\n <Provider\n values={[\n [OverlayTriggerStateContext, state],\n [DialogContext, overlayProps],\n [PopoverContext, {trigger: 'DialogTrigger', triggerRef: buttonRef}]\n ]}>\n <PressResponder {...triggerProps} ref={buttonRef} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nfunction Dialog(props: DialogProps, ref: ForwardedRef<HTMLElement>) {\n let originalAriaLabelledby = props['aria-labelledby'];\n [props, ref] = useContextProps(props, ref, DialogContext);\n let {dialogProps, titleProps} = useDialog({\n ...props,\n // Only pass aria-labelledby from props, not context.\n // Context is used as a fallback below.\n 'aria-labelledby': originalAriaLabelledby\n }, ref);\n let state = useContext(OverlayTriggerStateContext);\n\n if (!dialogProps['aria-label'] && !dialogProps['aria-labelledby']) {\n // If aria-labelledby exists on props, we know it came from context.\n // Use that as a fallback in case there is no title slot.\n if (props['aria-labelledby']) {\n dialogProps['aria-labelledby'] = props['aria-labelledby'];\n } else {\n console.warn('If a Dialog does not contain a <Heading slot=\"title\">, it must have an aria-label or aria-labelledby attribute for accessibility.');\n }\n }\n\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Dialog',\n className: props.className,\n style: props.style,\n children: props.children,\n values: {\n close: state?.close || (() => {})\n }\n });\n\n return (\n <section\n {...filterDOMProps(props)}\n {...dialogProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}>\n <Provider\n values={[\n [HeadingContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: {...titleProps, level: 2}\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </section>\n );\n}\n\n/**\n * A dialog is an overlay shown above other content in an application.\n */\nconst _Dialog = /*#__PURE__*/ (forwardRef as forwardRefType)(Dialog);\nexport {_Dialog as Dialog};\n"],"names":[],"version":3,"file":"Dialog.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA0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CAAC,WAAW,CAAC,kBAAkB;QAC/D,oEAAoE;QACpE,yDAAyD;QACzD,IAAI,KAAK,CAAC,kBAAkB,EAC1B,WAAW,CAAC,kBAAkB,GAAG,KAAK,CAAC,kBAAkB;aAEzD,QAAQ,IAAI,CAAC;;IAIjB,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,kBAAkB;QAClB,WAAW,MAAM,SAAS;QAC1B,OAAO,MAAM,KAAK;QAClB,UAAU,MAAM,QAAQ;QACxB,QAAQ;YACN,OAAO,CAAA,kBAAA,4BAAA,MAAO,KAAK,KAAK,CAAA,KAAO,CAAA;QACjC;IACF;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;QACxB,GAAG,WAAW;QACd,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;qBACpB,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAa;gBAAG;oBACf,OAAO;wBACL,CAAC,CAAA,GAAA,yCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;4BAAC,GAAG,UAAU;4BAAE,OAAO;wBAAC;oBACjC;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAY;gBAAG;oBACd,OAAO;wBACL,CAAC,CAAA,GAAA,yCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;4BACL,SAAS,IAAM,kBAAA,4BAAA,MAAO,KAAK;wBAC7B;oBACF;gBACF;aAAE;SACH;OACA,YAAY,QAAQ;AAI7B;AAEA;;CAEC,GACD,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB","sources":["packages/react-aria-components/src/Dialog.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaDialogProps, useDialog, useId, useOverlayTrigger} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, SlotProps, StyleProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType} from '@react-types/shared';\nimport {HeadingContext} from './RSPContexts';\nimport {OverlayTriggerProps, OverlayTriggerState, useMenuTriggerState} from 'react-stately';\nimport {PopoverContext} from './Popover';\nimport {PressResponder} from '@react-aria/interactions';\nimport React, {createContext, ForwardedRef, forwardRef, ReactNode, useContext, useRef} from 'react';\nimport {RootMenuTriggerStateContext} from './Menu';\n\nexport interface DialogTriggerProps extends OverlayTriggerProps {\n children: ReactNode\n}\n\ninterface DialogRenderProps {\n close: () => void\n}\n\nexport interface DialogProps extends AriaDialogProps, StyleProps, SlotProps {\n /** Children of the dialog. A function may be provided to access a function to close the dialog. */\n children?: ReactNode | ((opts: DialogRenderProps) => ReactNode)\n}\n\nexport const DialogContext = createContext<ContextValue<DialogProps, HTMLElement>>(null);\nexport const OverlayTriggerStateContext = createContext<OverlayTriggerState | null>(null);\n\n/**\n * A DialogTrigger opens a dialog when a trigger element is pressed.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n // Use useMenuTriggerState instead of useOverlayTriggerState in case a menu is embedded in the dialog.\n // This is needed to handle submenus.\n let state = useMenuTriggerState(props);\n\n let buttonRef = useRef<HTMLButtonElement>(null);\n let {triggerProps, overlayProps} = useOverlayTrigger({type: 'dialog'}, state, buttonRef);\n\n // Label dialog by the trigger as a fallback if there is no title slot.\n // This is done in RAC instead of hooks because otherwise we cannot distinguish\n // between context and props. Normally aria-labelledby overrides the title\n // but when sent by context we want the title to win.\n triggerProps.id = useId();\n overlayProps['aria-labelledby'] = triggerProps.id;\n\n return (\n <Provider\n values={[\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [DialogContext, overlayProps],\n [PopoverContext, {trigger: 'DialogTrigger', triggerRef: buttonRef}]\n ]}>\n <PressResponder {...triggerProps} ref={buttonRef} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nfunction Dialog(props: DialogProps, ref: ForwardedRef<HTMLElement>) {\n let originalAriaLabelledby = props['aria-labelledby'];\n [props, ref] = useContextProps(props, ref, DialogContext);\n let {dialogProps, titleProps} = useDialog({\n ...props,\n // Only pass aria-labelledby from props, not context.\n // Context is used as a fallback below.\n 'aria-labelledby': originalAriaLabelledby\n }, ref);\n let state = useContext(OverlayTriggerStateContext);\n\n if (!dialogProps['aria-label'] && !dialogProps['aria-labelledby']) {\n // If aria-labelledby exists on props, we know it came from context.\n // Use that as a fallback in case there is no title slot.\n if (props['aria-labelledby']) {\n dialogProps['aria-labelledby'] = props['aria-labelledby'];\n } else {\n console.warn('If a Dialog does not contain a <Heading slot=\"title\">, it must have an aria-label or aria-labelledby attribute for accessibility.');\n }\n }\n\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Dialog',\n className: props.className,\n style: props.style,\n children: props.children,\n values: {\n close: state?.close || (() => {})\n }\n });\n\n return (\n <section\n {...filterDOMProps(props)}\n {...dialogProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}>\n <Provider\n values={[\n [HeadingContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: {...titleProps, level: 2}\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: {\n onPress: () => state?.close()\n }\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </section>\n );\n}\n\n/**\n * A dialog is an overlay shown above other content in an application.\n */\nconst _Dialog = /*#__PURE__*/ (forwardRef as forwardRefType)(Dialog);\nexport {_Dialog as Dialog};\n"],"names":[],"version":3,"file":"Dialog.module.js.map"}
@@ -60,7 +60,7 @@ function $11c780105231f6ef$var$DisclosureGroup(props, ref) {
60
60
  }, renderProps.children));
61
61
  }
62
62
  /**
63
- * A DisclosureGroup is a grouping of related disclosures, sometimes called an Accordion.
63
+ * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.
64
64
  * It supports both single and multiple expanded items.
65
65
  */ const $11c780105231f6ef$export$944aceb4f8c89f10 = /*#__PURE__*/ (0, $8afVX$react.forwardRef)($11c780105231f6ef$var$DisclosureGroup);
66
66
  const $11c780105231f6ef$export$d665dd135a51b28a = /*#__PURE__*/ (0, $8afVX$react.createContext)(null);
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBM,MAAM,yDAA8B,CAAA,GAAA,0BAAY,EAA+B;AAEtF,SAAS,sCAAgB,KAA2B,EAAE,GAAiC;IACrF,IAAI,QAAQ,CAAA,GAAA,qDAAsB,EAAE;IAEpC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAE9B,qBACE,0DAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,yCAA4B,QAAQ;QAAC,OAAO;OAC1C,YAAY,QAAQ;AAI7B;AAEA;;;CAGC,GACD,MAAM,0DAAmB,CAAA,GAAA,uBAAS,EAAE;AA8B7B,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAO5E,MAAM,gEAA4B,CAAA,GAAA,0BAAY,EAAyC;AAEvF,SAAS,iCAAW,KAAsB,EAAE,GAAiC;IAC3E,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,y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gBAA2B;gCAAC;8BAAY;gBAAQ;aAAE;YACnD;gBAAC;gBAAwB;aAAM;SAChC;qBACD,0DAAC;QACC,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,cAAc;QAC7B,6BAA2B,wBAAwB;QAClD,GAAG,QAAQ;QACX,GAAG,gBAAgB;QACnB,GAAG,WAAW;OACd,YAAY,QAAQ;AAI7B;AAsBA,SAAS,sCAAgB,KAA2B,EAAE,GAAiC;IACrF,IAAI,QAAC,OAAO,SAAQ,GAAG;IACvB,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IACxC,IAAI,EACF,gBAAgB,oBAAoB,EACpC,YAAY,gBAAgB,EAC7B,GAAG,CAAA,GAAA,6BAAW,EAAE;QAAC,QAAQ;IAAI;IAC9B,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;kCACN;QACF;IACF;IACA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,qBACE,0DAAC;QACE,GAAG,QAAQ;QACZ,KAAK,CAAA,GAAA,+BAAQ,EAAE,KAAK;QACnB,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,iBAAiB;QAC3C,GAAG,WAAW;QACf,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,uCAAY;gBAAG;aAAK;SACtB;OACA,MAAM,QAAQ;AAIvB;AAEA;;CAEC,GACD,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB;AAGjE;;CAEC,GACD,MAAM,4CAAiC,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaDisclosureProps, useDisclosure} from '@react-aria/disclosure';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DisclosureGroupState, DisclosureState, DisclosureGroupProps as StatelyDisclosureGroupProps, useDisclosureGroupState, useDisclosureState} from '@react-stately/disclosure';\nimport {DOMProps, forwardRefType, Key} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useId} from '@react-aria/utils';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps {}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\nfunction DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props);\n\n return (\n <div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </div>\n );\n}\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an Accordion.\n * It supports both single and multiple expanded items.\n */\nconst _DisclosureGroup = forwardRef(DisclosureGroup);\nexport {_DisclosureGroup as DisclosureGroup};\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps {\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\nfunction Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps as any);\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <div\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}\n {...domProps}\n {...focusWithinProps}\n {...renderProps}>\n {renderProps.children}\n </div>\n </Provider>\n );\n}\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps {\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props);\n return (\n <div\n {...DOMProps}\n ref={mergeRefs(ref, panelRef)}\n {...mergeProps(panelProps, focusWithinProps)}\n {...renderProps}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nconst _Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(Disclosure);\nexport {_Disclosure as Disclosure};\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nconst _DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n"],"names":[],"version":3,"file":"Disclosure.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBM,MAAM,yDAA8B,CAAA,GAAA,0BAAY,EAA+B;AAEtF,SAAS,sCAAgB,KAA2B,EAAE,GAAiC;IACrF,IAAI,QAAQ,CAAA,GAAA,qDAAsB,EAAE;IAEpC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAE9B,qBACE,0DAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,yCAA4B,QAAQ;QAAC,OAAO;OAC1C,YAAY,QAAQ;AAI7B;AAEA;;;CAGC,GACD,MAAM,0DAAmB,CAAA,GAAA,uBAAS,EAAE;AA8B7B,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAO5E,MAAM,gEAA4B,CAAA,GAAA,0BAAY,EAAyC;AAEvF,SAAS,iCAAW,KAAsB,EAAE,GAAiC;IAC3E,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,aAAa,CA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AAC;gBAAwB;aAAM;SAChC;qBACD,0DAAC;QACC,KAAK;QACL,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,cAAc;QAC7B,6BAA2B,wBAAwB;QAClD,GAAG,QAAQ;QACX,GAAG,gBAAgB;QACnB,GAAG,WAAW;OACd,YAAY,QAAQ;AAI7B;AAsBA,SAAS,sCAAgB,KAA2B,EAAE,GAAiC;IACrF,IAAI,QAAC,OAAO,SAAQ,GAAG;IACvB,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IACxC,IAAI,EACF,gBAAgB,oBAAoB,EACpC,YAAY,gBAAgB,EAC7B,GAAG,CAAA,GAAA,6BAAW,EAAE;QAAC,QAAQ;IAAI;IAC9B,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;kCACN;QACF;IACF;IACA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,qBACE,0DAAC;QACE,GAAG,QAAQ;QACZ,KAAK,CAAA,GAAA,+BAAQ,EAAE,KAAK;QACnB,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,iBAAiB;QAC3C,GAAG,WAAW;QACf,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,uCAAY;gBAAG;aAAK;SACtB;OACA,MAAM,QAAQ;AAIvB;AAEA;;CAEC,GACD,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB;AAGjE;;CAEC,GACD,MAAM,4CAAiC,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaDisclosureProps, useDisclosure} from '@react-aria/disclosure';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DisclosureGroupState, DisclosureState, DisclosureGroupProps as StatelyDisclosureGroupProps, useDisclosureGroupState, useDisclosureState} from '@react-stately/disclosure';\nimport {DOMProps, forwardRefType, Key} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useId} from '@react-aria/utils';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps {}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\nfunction DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props);\n\n return (\n <div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </div>\n );\n}\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nconst _DisclosureGroup = forwardRef(DisclosureGroup);\nexport {_DisclosureGroup as DisclosureGroup};\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps {\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\nfunction Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps as any);\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <div\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}\n {...domProps}\n {...focusWithinProps}\n {...renderProps}>\n {renderProps.children}\n </div>\n </Provider>\n );\n}\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps {\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props);\n return (\n <div\n {...DOMProps}\n ref={mergeRefs(ref, panelRef)}\n {...mergeProps(panelProps, focusWithinProps)}\n {...renderProps}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nconst _Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(Disclosure);\nexport {_Disclosure as Disclosure};\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nconst _DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n"],"names":[],"version":3,"file":"Disclosure.main.js.map"}
@@ -45,7 +45,7 @@ function $28f4fd908f0de97f$var$DisclosureGroup(props, ref) {
45
45
  }, renderProps.children));
46
46
  }
47
47
  /**
48
- * A DisclosureGroup is a grouping of related disclosures, sometimes called an Accordion.
48
+ * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.
49
49
  * It supports both single and multiple expanded items.
50
50
  */ const $28f4fd908f0de97f$export$944aceb4f8c89f10 = /*#__PURE__*/ (0, $hI1OT$forwardRef)($28f4fd908f0de97f$var$DisclosureGroup);
51
51
  const $28f4fd908f0de97f$export$d665dd135a51b28a = /*#__PURE__*/ (0, $hI1OT$createContext)(null);
@@ -45,7 +45,7 @@ function $28f4fd908f0de97f$var$DisclosureGroup(props, ref) {
45
45
  }, renderProps.children));
46
46
  }
47
47
  /**
48
- * A DisclosureGroup is a grouping of related disclosures, sometimes called an Accordion.
48
+ * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.
49
49
  * It supports both single and multiple expanded items.
50
50
  */ const $28f4fd908f0de97f$export$944aceb4f8c89f10 = /*#__PURE__*/ (0, $hI1OT$forwardRef)($28f4fd908f0de97f$var$DisclosureGroup);
51
51
  const $28f4fd908f0de97f$export$d665dd135a51b28a = /*#__PURE__*/ (0, $hI1OT$createContext)(null);
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBM,MAAM,yDAA8B,CAAA,GAAA,oBAAY,EAA+B;AAEtF,SAAS,sCAAgB,KAA2B,EAAE,GAAi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AE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;kCACN;QACF;IACF;IACA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAC9B,qBACE,gCAAC;QACE,GAAG,QAAQ;QACZ,KAAK,CAAA,GAAA,gBAAQ,EAAE,KAAK;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,iBAAiB;QAC3C,GAAG,WAAW;QACf,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAK;SACtB;OACA,MAAM,QAAQ;AAIvB;AAEA;;CAEC,GACD,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB;AAGjE;;CAEC,GACD,MAAM,4CAAiC,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaDisclosureProps, useDisclosure} from '@react-aria/disclosure';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DisclosureGroupState, DisclosureState, DisclosureGroupProps as StatelyDisclosureGroupProps, useDisclosureGroupState, useDisclosureState} from '@react-stately/disclosure';\nimport {DOMProps, forwardRefType, Key} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useId} from '@react-aria/utils';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps {}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\nfunction DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props);\n\n return (\n <div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </div>\n );\n}\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an Accordion.\n * It supports both single and multiple expanded items.\n */\nconst _DisclosureGroup = forwardRef(DisclosureGroup);\nexport {_DisclosureGroup as DisclosureGroup};\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps {\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\nfunction Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps as any);\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <div\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}\n {...domProps}\n {...focusWithinProps}\n {...renderProps}>\n {renderProps.children}\n </div>\n </Provider>\n );\n}\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps {\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props);\n return (\n <div\n {...DOMProps}\n ref={mergeRefs(ref, panelRef)}\n {...mergeProps(panelProps, focusWithinProps)}\n {...renderProps}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nconst _Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(Disclosure);\nexport {_Disclosure as Disclosure};\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nconst _DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n"],"names":[],"version":3,"file":"Disclosure.module.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBM,MAAM,yDAA8B,CAAA,GAAA,oBAAY,EAA+B;AAEtF,SAAS,sCAAgB,KAA2B,EAAE,GAAiC;IACrF,IAAI,QAAQ,CAAA,GAAA,8BAAsB,EAAE;IAEpC,IAAI,cAAc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ACA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAC9B,qBACE,gCAAC;QACE,GAAG,QAAQ;QACZ,KAAK,CAAA,GAAA,gBAAQ,EAAE,KAAK;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,iBAAiB;QAC3C,GAAG,WAAW;QACf,MAAM;QACN,6BAA2B,wBAAwB;qBACnD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAK;SACtB;OACA,MAAM,QAAQ;AAIvB;AAEA;;CAEC,GACD,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB;AAGjE;;CAEC,GACD,MAAM,4CAAiC,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB","sources":["packages/react-aria-components/src/Disclosure.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaDisclosureProps, useDisclosure} from '@react-aria/disclosure';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {DisclosureGroupState, DisclosureState, DisclosureGroupProps as StatelyDisclosureGroupProps, useDisclosureGroupState, useDisclosureState} from '@react-stately/disclosure';\nimport {DOMProps, forwardRefType, Key} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, mergeRefs, useId} from '@react-aria/utils';\nimport React, {createContext, DOMAttributes, ForwardedRef, forwardRef, ReactNode, useContext} from 'react';\nimport {useFocusRing} from 'react-aria';\n\nexport interface DisclosureGroupProps extends StatelyDisclosureGroupProps, RenderProps<DisclosureGroupRenderProps>, DOMProps {}\n\nexport interface DisclosureGroupRenderProps {\n /**\n * Whether the disclosure group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure group.\n */\n state: DisclosureGroupState\n}\n\nexport const DisclosureGroupStateContext = createContext<DisclosureGroupState | null>(null);\n\nfunction DisclosureGroup(props: DisclosureGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n let state = useDisclosureGroupState(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosureGroup',\n values: {\n isDisabled: state.isDisabled,\n state\n }\n });\n\n let domProps = filterDOMProps(props);\n\n return (\n <div\n {...domProps}\n {...renderProps}\n ref={ref}\n data-disabled={props.isDisabled || undefined}>\n <DisclosureGroupStateContext.Provider value={state}>\n {renderProps.children}\n </DisclosureGroupStateContext.Provider>\n </div>\n );\n}\n\n/**\n * A DisclosureGroup is a grouping of related disclosures, sometimes called an accordion.\n * It supports both single and multiple expanded items.\n */\nconst _DisclosureGroup = forwardRef(DisclosureGroup);\nexport {_DisclosureGroup as DisclosureGroup};\n\nexport interface DisclosureProps extends Omit<AriaDisclosureProps, 'children'>, RenderProps<DisclosureRenderProps>, SlotProps {\n /** An id for the disclosure when used within a DisclosureGroup, matching the id used in `expandedKeys`. */\n id?: Key\n}\n\nexport interface DisclosureRenderProps {\n /**\n * Whether the disclosure is expanded.\n * @selector [data-expanded]\n */\n isExpanded: boolean,\n /**\n * Whether the disclosure has keyboard focus.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean,\n /**\n * Whether the disclosure is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the disclosure.\n */\n state: DisclosureState\n}\n\nexport const DisclosureContext = createContext<ContextValue<DisclosureProps, HTMLDivElement>>(null);\nexport const DisclosureStateContext = createContext<DisclosureState | null>(null);\n\ninterface InternalDisclosureContextValue {\n panelProps: DOMAttributes<HTMLElement>,\n panelRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst InternalDisclosureContext = createContext<InternalDisclosureContextValue | null>(null);\n\nfunction Disclosure(props: DisclosureProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DisclosureContext);\n let groupState = useContext(DisclosureGroupStateContext)!;\n let {id, ...otherProps} = props;\n\n // Generate an id if one wasn't provided.\n // (can't pass id into useId since it can also be a number)\n let defaultId = useId();\n id ||= defaultId;\n\n let isExpanded = groupState ? groupState.expandedKeys.has(id) : props.isExpanded;\n let state = useDisclosureState({\n ...props,\n isExpanded,\n onExpandedChange(isExpanded) {\n if (groupState) {\n groupState.toggleKey(id);\n }\n\n props.onExpandedChange?.(isExpanded);\n }\n });\n\n let panelRef = React.useRef<HTMLDivElement | null>(null);\n let isDisabled = props.isDisabled || groupState?.isDisabled || false;\n let {buttonProps, panelProps} = useDisclosure({\n ...props,\n isExpanded,\n isDisabled\n }, state, panelRef);\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Disclosure',\n values: {\n isExpanded: state.isExpanded,\n isDisabled,\n isFocusVisibleWithin,\n state\n }\n });\n\n let domProps = filterDOMProps(otherProps as any);\n\n return (\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n trigger: buttonProps\n }\n }],\n [InternalDisclosureContext, {panelProps, panelRef}],\n [DisclosureStateContext, state]\n ]}>\n <div\n ref={ref}\n data-expanded={state.isExpanded || undefined}\n data-disabled={isDisabled || undefined}\n data-focus-visible-within={isFocusVisibleWithin || undefined}\n {...domProps}\n {...focusWithinProps}\n {...renderProps}>\n {renderProps.children}\n </div>\n </Provider>\n );\n}\n\nexport interface DisclosurePanelRenderProps {\n /**\n * Whether keyboard focus is within the disclosure panel.\n * @selector [data-focus-visible-within]\n */\n isFocusVisibleWithin: boolean\n}\n\nexport interface DisclosurePanelProps extends RenderProps<DisclosurePanelRenderProps>, DOMProps {\n /**\n * The accessibility role for the disclosure's panel.\n * @default 'group'\n */\n role?: 'group' | 'region',\n /**\n * The children of the component.\n */\n children: ReactNode\n}\n\nfunction DisclosurePanel(props: DisclosurePanelProps, ref: ForwardedRef<HTMLDivElement>) {\n let {role = 'group'} = props;\n let {panelProps, panelRef} = useContext(InternalDisclosureContext)!;\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-DisclosurePanel',\n values: {\n isFocusVisibleWithin\n }\n });\n let DOMProps = filterDOMProps(props);\n return (\n <div\n {...DOMProps}\n ref={mergeRefs(ref, panelRef)}\n {...mergeProps(panelProps, focusWithinProps)}\n {...renderProps}\n role={role}\n data-focus-visible-within={isFocusVisibleWithin || undefined}>\n <Provider\n values={[\n [ButtonContext, null]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A disclosure is a collapsible section of content. It is composed of a a header with a heading and trigger button, and a panel that contains the content.\n */\nconst _Disclosure = /*#__PURE__*/ (forwardRef as forwardRefType)(Disclosure);\nexport {_Disclosure as Disclosure};\n\n/**\n * A DisclosurePanel provides the content for a disclosure.\n */\nconst _DisclosurePanel = /*#__PURE__*/ (forwardRef as forwardRefType)(DisclosurePanel);\nexport {_DisclosurePanel as DisclosurePanel};\n"],"names":[],"version":3,"file":"Disclosure.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAUD,SAAS,8BAAQ,KAAmB,EAAE,GAAqC;IACzE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,wCAAa;IACxD,IAAI,YAAC,QAAQ,SAAE,QAAQ,cAAG,SAAS,EAAE,GAAG,UAAS,GAAG;IACpD,IAAI,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC;IAEzB,qBACE,0DAAC;QAAS,GAAG,QAAQ;QAAE,KAAK;QAAK,WAAW,sBAAA,uBAAA,YAAa;OACtD;AAGP;AAEA,MAAM,0DAAW,CAAA,GAAA,uBAAS,EAAE","sources":["packages/react-aria-components/src/Heading.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {HeadingContext} from './RSPContexts';\nimport React, {ElementType, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\nimport {useContextProps} from './utils';\n\nexport interface HeadingProps extends HTMLAttributes<HTMLElement> {\n level?: number\n}\n\nfunction Heading(props: HeadingProps, ref: ForwardedRef<HTMLHeadingElement>) {\n [props, ref] = useContextProps(props, ref, HeadingContext);\n let {children, level = 3, className, ...domProps} = props;\n let Element = `h${level}` as ElementType;\n\n return (\n <Element {...domProps} ref={ref} className={className ?? 'react-aria-Heading'}>\n {children}\n </Element>\n );\n}\n\nconst _Heading = forwardRef(Heading);\nexport {_Heading as Heading};\n"],"names":[],"version":3,"file":"Heading.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAUD,SAAS,8BAAQ,KAAmB,EAAE,GAAqC;IACzE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,wCAAa;IACxD,IAAI,YAAC,QAAQ,SAAE,QAAQ,cAAG,SAAS,EAAE,GAAG,UAAS,GAAG;IACpD,IAAI,UAAU,CAAC,CAAC,EAAE,OAAO;IAEzB,qBACE,0DAAC;QAAS,GAAG,QAAQ;QAAE,KAAK;QAAK,WAAW,sBAAA,uBAAA,YAAa;OACtD;AAGP;AAEA,MAAM,0DAAW,CAAA,GAAA,uBAAS,EAAE","sources":["packages/react-aria-components/src/Heading.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {HeadingContext} from './RSPContexts';\nimport React, {ElementType, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\nimport {useContextProps} from './utils';\n\nexport interface HeadingProps extends HTMLAttributes<HTMLElement> {\n level?: number\n}\n\nfunction Heading(props: HeadingProps, ref: ForwardedRef<HTMLHeadingElement>) {\n [props, ref] = useContextProps(props, ref, HeadingContext);\n let {children, level = 3, className, ...domProps} = props;\n let Element = `h${level}` as ElementType;\n\n return (\n <Element {...domProps} ref={ref} className={className ?? 'react-aria-Heading'}>\n {children}\n </Element>\n );\n}\n\nconst _Heading = forwardRef(Heading);\nexport {_Heading as Heading};\n"],"names":[],"version":3,"file":"Heading.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAUD,SAAS,8BAAQ,KAAmB,EAAE,GAAqC;IACzE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,yCAAa;IACxD,IAAI,YAAC,QAAQ,SAAE,QAAQ,cAAG,SAAS,EAAE,GAAG,UAAS,GAAG;IACpD,IAAI,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC;IAEzB,qBACE,gCAAC;QAAS,GAAG,QAAQ;QAAE,KAAK;QAAK,WAAW,sBAAA,uBAAA,YAAa;OACtD;AAGP;AAEA,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE","sources":["packages/react-aria-components/src/Heading.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {HeadingContext} from './RSPContexts';\nimport React, {ElementType, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\nimport {useContextProps} from './utils';\n\nexport interface HeadingProps extends HTMLAttributes<HTMLElement> {\n level?: number\n}\n\nfunction Heading(props: HeadingProps, ref: ForwardedRef<HTMLHeadingElement>) {\n [props, ref] = useContextProps(props, ref, HeadingContext);\n let {children, level = 3, className, ...domProps} = props;\n let Element = `h${level}` as ElementType;\n\n return (\n <Element {...domProps} ref={ref} className={className ?? 'react-aria-Heading'}>\n {children}\n </Element>\n );\n}\n\nconst _Heading = forwardRef(Heading);\nexport {_Heading as Heading};\n"],"names":[],"version":3,"file":"Heading.module.js.map"}
1
+ {"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAUD,SAAS,8BAAQ,KAAmB,EAAE,GAAqC;IACzE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK,CAAA,GAAA,yCAAa;IACxD,IAAI,YAAC,QAAQ,SAAE,QAAQ,cAAG,SAAS,EAAE,GAAG,UAAS,GAAG;IACpD,IAAI,UAAU,CAAC,CAAC,EAAE,OAAO;IAEzB,qBACE,gCAAC;QAAS,GAAG,QAAQ;QAAE,KAAK;QAAK,WAAW,sBAAA,uBAAA,YAAa;OACtD;AAGP;AAEA,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE","sources":["packages/react-aria-components/src/Heading.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {HeadingContext} from './RSPContexts';\nimport React, {ElementType, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\nimport {useContextProps} from './utils';\n\nexport interface HeadingProps extends HTMLAttributes<HTMLElement> {\n level?: number\n}\n\nfunction Heading(props: HeadingProps, ref: ForwardedRef<HTMLHeadingElement>) {\n [props, ref] = useContextProps(props, ref, HeadingContext);\n let {children, level = 3, className, ...domProps} = props;\n let Element = `h${level}` as ElementType;\n\n return (\n <Element {...domProps} ref={ref} className={className ?? 'react-aria-Heading'}>\n {children}\n </Element>\n );\n}\n\nconst _Heading = forwardRef(Heading);\nexport {_Heading as Heading};\n"],"names":[],"version":3,"file":"Heading.module.js.map"}
package/dist/Menu.main.js CHANGED
@@ -129,7 +129,6 @@ const $a8f6e7d095d1cc86$export$ecabc99eeffab7ca = /*#__PURE__*/ (0, $2JTht$react
129
129
  }, rootMenuTriggerState);
130
130
  let submenuRef = (0, $2JTht$react.useRef)(null);
131
131
  let itemRef = (0, $2JTht$reactariautils.useObjectRef)(ref);
132
- let popoverContext = (0, $c5ccf687772c0422$exports.useSlottedContext)((0, $61e2b7078adb18bc$exports.PopoverContext));
133
132
  let { parentMenuRef: parentMenuRef } = (0, $2JTht$react.useContext)($a8f6e7d095d1cc86$var$SubmenuTriggerContext);
134
133
  let { submenuTriggerProps: submenuTriggerProps, submenuProps: submenuProps, popoverProps: popoverProps } = (0, $2JTht$reactariamenu.useSubmenuTrigger)({
135
134
  parentMenuRef: parentMenuRef,
@@ -161,7 +160,9 @@ const $a8f6e7d095d1cc86$export$ecabc99eeffab7ca = /*#__PURE__*/ (0, $2JTht$react
161
160
  trigger: 'SubmenuTrigger',
162
161
  triggerRef: itemRef,
163
162
  placement: 'end top',
164
- UNSTABLE_portalContainer: popoverContext.UNSTABLE_portalContainer || undefined,
163
+ // Prevent parent popover from hiding submenu.
164
+ // @ts-ignore
165
+ 'data-react-aria-top-layer': true,
165
166
  ...popoverProps
166
167
  }
167
168
  ]
@@ -188,38 +189,13 @@ function $a8f6e7d095d1cc86$var$MenuInner({ props: props, collection: collection,
188
189
  collection: collection,
189
190
  children: undefined
190
191
  });
191
- let [popoverContainer, setPopoverContainer] = (0, $2JTht$react.useState)(null);
192
+ let triggerState = (0, $2JTht$react.useContext)($a8f6e7d095d1cc86$export$795aec4671cbae19);
192
193
  let { isVirtualized: isVirtualized, CollectionRoot: CollectionRoot } = (0, $2JTht$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
193
194
  let { menuProps: menuProps } = (0, $2JTht$reactaria.useMenu)({
194
195
  ...props,
195
- isVirtualized: isVirtualized
196
+ isVirtualized: isVirtualized,
197
+ onClose: props.onClose || (triggerState === null || triggerState === void 0 ? void 0 : triggerState.close)
196
198
  }, state, ref);
197
- let rootMenuTriggerState = (0, $2JTht$react.useContext)($a8f6e7d095d1cc86$export$795aec4671cbae19);
198
- let popoverContext = (0, $2JTht$react.useContext)((0, $61e2b7078adb18bc$exports.PopoverContext));
199
- let isSubmenu = (popoverContext === null || popoverContext === void 0 ? void 0 : popoverContext.trigger) === 'SubmenuTrigger';
200
- (0, $2JTht$reactariainteractions.useInteractOutside)({
201
- ref: ref,
202
- onInteractOutside: (e)=>{
203
- if (rootMenuTriggerState && !(popoverContainer === null || popoverContainer === void 0 ? void 0 : popoverContainer.contains(e.target))) rootMenuTriggerState.close();
204
- },
205
- isDisabled: isSubmenu || (rootMenuTriggerState === null || rootMenuTriggerState === void 0 ? void 0 : rootMenuTriggerState.expandedKeysStack.length) === 0
206
- });
207
- let prevPopoverContainer = (0, $2JTht$react.useRef)(null);
208
- let [leftOffset, setLeftOffset] = (0, $2JTht$react.useState)({
209
- left: 0
210
- });
211
- (0, $2JTht$react.useEffect)(()=>{
212
- if (popoverContainer && prevPopoverContainer.current !== popoverContainer && leftOffset.left === 0) {
213
- prevPopoverContainer.current = popoverContainer;
214
- let { left: left } = popoverContainer.getBoundingClientRect();
215
- setLeftOffset({
216
- left: -1 * left
217
- });
218
- }
219
- }, [
220
- leftOffset,
221
- popoverContainer
222
- ]);
223
199
  let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
224
200
  defaultClassName: 'react-aria-Menu',
225
201
  className: props.className,
@@ -245,12 +221,6 @@ function $a8f6e7d095d1cc86$var$MenuInner({ props: props, collection: collection,
245
221
  elementType: 'div'
246
222
  }
247
223
  ],
248
- [
249
- (0, $61e2b7078adb18bc$exports.PopoverContext),
250
- {
251
- UNSTABLE_portalContainer: popoverContainer || undefined
252
- }
253
- ],
254
224
  [
255
225
  (0, $3114c2382242bdc0$exports.SectionContext),
256
226
  {
@@ -277,15 +247,7 @@ function $a8f6e7d095d1cc86$var$MenuInner({ props: props, collection: collection,
277
247
  collection: collection,
278
248
  persistedKeys: (0, $3114c2382242bdc0$exports.usePersistedKeys)(state.selectionManager.focusedKey),
279
249
  scrollRef: ref
280
- }))), /*#__PURE__*/ (0, ($parcel$interopDefault($2JTht$react))).createElement("div", {
281
- ref: setPopoverContainer,
282
- style: {
283
- width: '100vw',
284
- position: 'absolute',
285
- top: 0,
286
- ...leftOffset
287
- }
288
- }));
250
+ }))));
289
251
  }
290
252
  /**
291
253
  * A menu displays a list of actions or options that a user can choose.
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAk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Q;AAI7B","sources":["packages/react-aria-components/src/Menu.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\n\nimport {AriaMenuProps, FocusScope, mergeProps, useFocusRing, useMenu, useMenuItem, useMenuSection, useMenuTrigger} from 'react-aria';\nimport {MenuTriggerProps as BaseMenuTriggerProps, Collection as ICollection, Node, TreeState, useMenuTriggerState, useTreeState} from 'react-stately';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps, usePersistedKeys} from './Collection';\nimport {ContextValue, Provider, RenderProps, ScrollableProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {FocusStrategy, forwardRefType, HoverEvents, Key, LinkDOMProps, MultipleSelection} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport {KeyboardContext} from './Keyboard';\nimport {MultipleSelectionState, SelectionManager, useMultipleSelectionState} from '@react-stately/selection';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext, PopoverProps} from './Popover';\nimport {PressResponder, useHover, useInteractOutside} from '@react-aria/interactions';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport {RootMenuTriggerState, useSubmenuTriggerState} from '@react-stately/menu';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\nimport {useSubmenuTrigger} from '@react-aria/menu';\n\nexport const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null);\nexport const MenuStateContext = createContext<TreeState<any> | null>(null);\nexport const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null);\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: ReactNode\n}\n\nexport function MenuTrigger(props: MenuTriggerProps) {\n let state = useMenuTriggerState(props);\n let ref = useRef<HTMLButtonElement>(null);\n let {menuTriggerProps, menuProps} = useMenuTrigger({\n ...props,\n type: 'menu'\n }, state, ref);\n // Allows menu width to match button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (ref.current) {\n setButtonWidth(ref.current.offsetWidth + 'px');\n }\n }, [ref]);\n\n useResizeObserver({\n ref: ref,\n onResize: onResize\n });\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [MenuContext, {...menuProps, ref: scrollRef}],\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'MenuTrigger',\n triggerRef: ref,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties\n }]\n ]}>\n <PressResponder {...menuTriggerProps} ref={ref} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nexport interface SubmenuTriggerProps {\n /**\n * The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the second child should be the Popover (for the submenu).\n */\n children: ReactElement[],\n /**\n * The delay time in milliseconds for the submenu to appear after hovering over the trigger.\n * @default 200\n */\n delay?: number\n}\n\nconst SubmenuTriggerContext = createContext<{parentMenuRef: RefObject<HTMLElement | null>} | null>(null);\n\n/**\n * A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.\n *\n * @version alpha\n */\nexport const SubmenuTrigger = /*#__PURE__*/ createBranchComponent('submenutrigger', (props: SubmenuTriggerProps, ref: ForwardedRef<HTMLDivElement>, item) => {\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let state = useContext(MenuStateContext)!;\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let submenuTriggerState = useSubmenuTriggerState({triggerKey: item.key}, rootMenuTriggerState);\n let submenuRef = useRef<HTMLDivElement>(null);\n let itemRef = useObjectRef(ref);\n let popoverContext = useSlottedContext(PopoverContext)!;\n let {parentMenuRef} = useContext(SubmenuTriggerContext)!;\n let {submenuTriggerProps, submenuProps, popoverProps} = useSubmenuTrigger({\n parentMenuRef,\n submenuRef,\n delay: props.delay\n }, submenuTriggerState, itemRef);\n\n return (\n <Provider\n values={[\n [MenuItemContext, {...submenuTriggerProps, onAction: undefined, ref: itemRef}],\n [MenuContext, submenuProps],\n [OverlayTriggerStateContext, submenuTriggerState],\n [PopoverContext, {\n ref: submenuRef,\n trigger: 'SubmenuTrigger',\n triggerRef: itemRef,\n placement: 'end top',\n UNSTABLE_portalContainer: popoverContext.UNSTABLE_portalContainer || undefined,\n ...popoverProps\n }]\n ]}>\n <CollectionBranch collection={state.collection} parent={item} />\n {props.children[1]}\n </Provider>\n );\n}, props => props.children[0]);\n\nexport interface MenuProps<T> extends Omit<AriaMenuProps<T>, 'children'>, CollectionProps<T>, StyleProps, SlotProps, ScrollableProps<HTMLDivElement> {}\n\nfunction Menu<T extends object>(props: MenuProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n\n // Delay rendering the actual menu until we have the collection so that auto focus works properly.\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => collection.size > 0 && <MenuInner props={props} collection={collection} menuRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface MenuInnerProps<T> {\n props: MenuProps<T>,\n collection: ICollection<Node<object>>,\n menuRef: RefObject<HTMLDivElement | null>\n}\n\nfunction MenuInner<T extends object>({props, collection, menuRef: ref}: MenuInnerProps<T>) {\n let state = useTreeState({\n ...props,\n collection,\n children: undefined\n });\n let [popoverContainer, setPopoverContainer] = useState<HTMLDivElement | null>(null);\n let {isVirtualized, CollectionRoot} = useContext(CollectionRendererContext);\n let {menuProps} = useMenu({...props, isVirtualized}, state, ref);\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let popoverContext = useContext(PopoverContext)!;\n\n let isSubmenu = (popoverContext as PopoverProps)?.trigger === 'SubmenuTrigger';\n useInteractOutside({\n ref,\n onInteractOutside: (e) => {\n if (rootMenuTriggerState && !popoverContainer?.contains(e.target as HTMLElement)) {\n rootMenuTriggerState.close();\n }\n },\n isDisabled: isSubmenu || rootMenuTriggerState?.expandedKeysStack.length === 0\n });\n\n let prevPopoverContainer = useRef<HTMLDivElement | null>(null) ;\n let [leftOffset, setLeftOffset] = useState({left: 0});\n useEffect(() => {\n if (popoverContainer && prevPopoverContainer.current !== popoverContainer && leftOffset.left === 0) {\n prevPopoverContainer.current = popoverContainer;\n let {left} = popoverContainer.getBoundingClientRect();\n setLeftOffset({left: -1 * left});\n }\n }, [leftOffset, popoverContainer]);\n\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Menu',\n className: props.className,\n style: props.style,\n values: {}\n });\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...menuProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}>\n <Provider\n values={[\n [MenuStateContext, state],\n [SeparatorContext, {elementType: 'div'}],\n [PopoverContext, {UNSTABLE_portalContainer: popoverContainer || undefined}],\n [SectionContext, {name: 'MenuSection', render: MenuSection}],\n [SubmenuTriggerContext, {parentMenuRef: ref}],\n [MenuItemContext, null],\n [SelectionManagerContext, state.selectionManager]\n ]}>\n <CollectionRoot\n collection={collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n </div>\n <div ref={setPopoverContainer} style={{width: '100vw', position: 'absolute', top: 0, ...leftOffset}} />\n </FocusScope>\n );\n}\n\n/**\n * A menu displays a list of actions or options that a user can choose.\n */\nconst _Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(Menu);\nexport {_Menu as Menu};\n\nexport interface MenuSectionProps<T> extends SectionProps<T>, MultipleSelection {}\n\n// A subclass of SelectionManager that forwards focus-related properties to the parent,\n// but has its own local selection state.\nclass GroupSelectionManager extends SelectionManager {\n private parent: SelectionManager;\n\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n\n get focusedKey() {\n return this.parent.focusedKey;\n }\n\n get isFocused() {\n return this.parent.isFocused;\n }\n\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void {\n return this.parent.setFocusedKey(key, childFocusStrategy);\n }\n\n setFocused(isFocused: boolean): void {\n this.parent.setFocused(isFocused);\n }\n\n get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSection<T extends object>(props: MenuSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-MenuSection') {\n let state = useContext(MenuStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useMenuSection({\n heading,\n 'aria-label': section.props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: section.props?.className,\n style: section.props?.style,\n values: {}\n });\n\n let parent = useContext(SelectionManagerContext)!;\n let selectionState = useMultipleSelectionState(props);\n let manager = props.selectionMode != null ? new GroupSelectionManager(parent, selectionState) : parent;\n\n return (\n <section\n {...filterDOMProps(props as any)}\n {...groupProps}\n {...renderProps}\n ref={ref}>\n <Provider\n values={[\n [HeaderContext, {...headingProps, ref: headingRef}],\n [SelectionManagerContext, manager]\n ]}>\n <CollectionBranch collection={state.collection} parent={section} />\n </Provider>\n </section>\n );\n}\n\n/**\n * A MenuSection represents a section within a Menu.\n */\nconst _MenuSection = /*#__PURE__*/ createBranchComponent('section', MenuSection);\nexport {_MenuSection as MenuSection};\n\nexport interface MenuItemRenderProps extends ItemRenderProps {\n /**\n * Whether the item has a submenu.\n *\n * @selector [data-has-submenu]\n */\n hasSubmenu: boolean,\n /**\n * Whether the item's submenu is open.\n *\n * @selector [data-open]\n */\n isOpen: boolean\n}\n\nexport interface MenuItemProps<T = object> extends RenderProps<MenuItemRenderProps>, 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 /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the item is selected. */\n onAction?: () => void\n}\n\nconst MenuItemContext = createContext<ContextValue<MenuItemProps, HTMLDivElement>>(null);\n\n/**\n * A MenuItem represents an individual action in a Menu.\n */\nexport const MenuItem = /*#__PURE__*/ createLeafComponent('item', function MenuItem<T extends object>(props: MenuItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n [props, forwardedRef] = useContextProps(props, forwardedRef, MenuItemContext);\n let id = useSlottedContext(MenuItemContext)?.id as string;\n let state = useContext(MenuStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let selectionManager = useContext(SelectionManagerContext)!;\n\n let {menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states} = useMenuItem({\n ...props,\n id,\n key: item.key,\n selectionManager\n }, state, ref);\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled: states.isDisabled\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: selectionManager.selectionMode,\n selectionBehavior: selectionManager.selectionBehavior,\n hasSubmenu: !!props['aria-haspopup'],\n isOpen: props['aria-expanded'] === 'true'\n }\n });\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(menuItemProps, focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\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-selected={states.isSelected || undefined}\n data-selection-mode={selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode}\n data-has-submenu={!!props['aria-haspopup'] || undefined}\n data-open={props['aria-expanded'] === 'true' || undefined}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n label: labelProps,\n description: descriptionProps\n }\n }],\n [KeyboardContext, keyboardShortcutProps]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Menu.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAiCM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAgD;AAChF,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAyB;AAC9D,MAAM,0DAA8B,CAAA,GAAA,0BAAY,EAA+B;AACtF,MAAM,8DAA0B,CAAA,GAAA,0BAAY,EAA2B;AAMhE,SAAS,0CAAY,KAAuB;IACjD,IAAI,QAAQ,CAAA,GAAA,uCAAkB,EAAE;IAChC,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAqB;IACpC,IAAI,oBAAC,gBAAgB,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE;QACjD,GAAG,KAAK;QACR,MAAM;IACR,GAAG,OAAO;IACV,oCAAoC;IACpC,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,qBAAO,EAAiB;IAC5D,IAAI,WAAW,CAAA,GAAA,wBAAU,EAAE;QACzB,IAAI,IAAI,OAAO,EACb,eAAe,IAAI,OAAO,CAAC,WAAW,GAA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AM;uBACT;4BACA;YACA,eAAe,iBAAiB,aAAa;YAC7C,mBAAmB,iBAAiB,iBAAiB;YACrD,YAAY,CAAC,CAAC,KAAK,CAAC,gBAAgB;YACpC,QAAQ,KAAK,CAAC,gBAAgB,KAAK;QACrC;IACF;IAEA,IAAI,cAAiC,MAAM,IAAI,GAAG,MAAM;IAExD,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,eAAe,YAAY,WAAW;QACpD,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,OAAO,UAAU,IAAI;QACpC,gBAAc,aAAa;QAC3B,gBAAc,OAAO,SAAS,IAAI;QAClC,sBAAoB,kBAAkB;QACtC,gBAAc,OAAO,SAAS,IAAI;QAClC,iBAAe,OAAO,UAAU,IAAI;QACpC,uBAAqB,iBAAiB,aAAa,KAAK,SAAS,YAAY,iBAAiB,aAAa;QAC3G,oBAAkB,CAAC,CAAC,KAAK,CAAC,gBAAgB,IAAI;QAC9C,aAAW,KAAK,CAAC,gBAAgB,KAAK,UAAU;qBAChD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAc;gBAAG;aAAsB;SACzC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Menu.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\n\nimport {AriaMenuProps, FocusScope, mergeProps, useFocusRing, useMenu, useMenuItem, useMenuSection, useMenuTrigger} from 'react-aria';\nimport {MenuTriggerProps as BaseMenuTriggerProps, Collection as ICollection, Node, TreeState, useMenuTriggerState, useTreeState} from 'react-stately';\nimport {Collection, CollectionBuilder, createBranchComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, ItemRenderProps, SectionContext, SectionProps, usePersistedKeys} from './Collection';\nimport {ContextValue, Provider, RenderProps, ScrollableProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps, useObjectRef, useResizeObserver} from '@react-aria/utils';\nimport {FocusStrategy, forwardRefType, HoverEvents, Key, LinkDOMProps, MultipleSelection} from '@react-types/shared';\nimport {HeaderContext} from './Header';\nimport {KeyboardContext} from './Keyboard';\nimport {MultipleSelectionState, SelectionManager, useMultipleSelectionState} from '@react-stately/selection';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport {PressResponder, useHover} from '@react-aria/interactions';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useCallback,\n useContext,\n useRef,\n useState\n} from 'react';\nimport {RootMenuTriggerState, useSubmenuTriggerState} from '@react-stately/menu';\nimport {SeparatorContext} from './Separator';\nimport {TextContext} from './Text';\nimport {useSubmenuTrigger} from '@react-aria/menu';\n\nexport const MenuContext = createContext<ContextValue<MenuProps<any>, HTMLDivElement>>(null);\nexport const MenuStateContext = createContext<TreeState<any> | null>(null);\nexport const RootMenuTriggerStateContext = createContext<RootMenuTriggerState | null>(null);\nconst SelectionManagerContext = createContext<SelectionManager | null>(null);\n\nexport interface MenuTriggerProps extends BaseMenuTriggerProps {\n children: ReactNode\n}\n\nexport function MenuTrigger(props: MenuTriggerProps) {\n let state = useMenuTriggerState(props);\n let ref = useRef<HTMLButtonElement>(null);\n let {menuTriggerProps, menuProps} = useMenuTrigger({\n ...props,\n type: 'menu'\n }, state, ref);\n // Allows menu width to match button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (ref.current) {\n setButtonWidth(ref.current.offsetWidth + 'px');\n }\n }, [ref]);\n\n useResizeObserver({\n ref: ref,\n onResize: onResize\n });\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [MenuContext, {...menuProps, ref: scrollRef}],\n [OverlayTriggerStateContext, state],\n [RootMenuTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'MenuTrigger',\n triggerRef: ref,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties\n }]\n ]}>\n <PressResponder {...menuTriggerProps} ref={ref} isPressed={state.isOpen}>\n {props.children}\n </PressResponder>\n </Provider>\n );\n}\n\nexport interface SubmenuTriggerProps {\n /**\n * The contents of the SubmenuTrigger. The first child should be an Item (the trigger) and the second child should be the Popover (for the submenu).\n */\n children: ReactElement[],\n /**\n * The delay time in milliseconds for the submenu to appear after hovering over the trigger.\n * @default 200\n */\n delay?: number\n}\n\nconst SubmenuTriggerContext = createContext<{parentMenuRef: RefObject<HTMLElement | null>} | null>(null);\n\n/**\n * A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.\n *\n * @version alpha\n */\nexport const SubmenuTrigger = /*#__PURE__*/ createBranchComponent('submenutrigger', (props: SubmenuTriggerProps, ref: ForwardedRef<HTMLDivElement>, item) => {\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let state = useContext(MenuStateContext)!;\n let rootMenuTriggerState = useContext(RootMenuTriggerStateContext)!;\n let submenuTriggerState = useSubmenuTriggerState({triggerKey: item.key}, rootMenuTriggerState);\n let submenuRef = useRef<HTMLDivElement>(null);\n let itemRef = useObjectRef(ref);\n let {parentMenuRef} = useContext(SubmenuTriggerContext)!;\n let {submenuTriggerProps, submenuProps, popoverProps} = useSubmenuTrigger({\n parentMenuRef,\n submenuRef,\n delay: props.delay\n }, submenuTriggerState, itemRef);\n\n return (\n <Provider\n values={[\n [MenuItemContext, {...submenuTriggerProps, onAction: undefined, ref: itemRef}],\n [MenuContext, submenuProps],\n [OverlayTriggerStateContext, submenuTriggerState],\n [PopoverContext, {\n ref: submenuRef,\n trigger: 'SubmenuTrigger',\n triggerRef: itemRef,\n placement: 'end top',\n // Prevent parent popover from hiding submenu.\n // @ts-ignore\n 'data-react-aria-top-layer': true,\n ...popoverProps\n }]\n ]}>\n <CollectionBranch collection={state.collection} parent={item} />\n {props.children[1]}\n </Provider>\n );\n}, props => props.children[0]);\n\nexport interface MenuProps<T> extends Omit<AriaMenuProps<T>, 'children'>, CollectionProps<T>, StyleProps, SlotProps, ScrollableProps<HTMLDivElement> {}\n\nfunction Menu<T extends object>(props: MenuProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, MenuContext);\n\n // Delay rendering the actual menu until we have the collection so that auto focus works properly.\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => collection.size > 0 && <MenuInner props={props} collection={collection} menuRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface MenuInnerProps<T> {\n props: MenuProps<T>,\n collection: ICollection<Node<object>>,\n menuRef: RefObject<HTMLDivElement | null>\n}\n\nfunction MenuInner<T extends object>({props, collection, menuRef: ref}: MenuInnerProps<T>) {\n let state = useTreeState({\n ...props,\n collection,\n children: undefined\n });\n let triggerState = useContext(RootMenuTriggerStateContext);\n let {isVirtualized, CollectionRoot} = useContext(CollectionRendererContext);\n let {menuProps} = useMenu({...props, isVirtualized, onClose: props.onClose || triggerState?.close}, state, ref);\n let renderProps = useRenderProps({\n defaultClassName: 'react-aria-Menu',\n className: props.className,\n style: props.style,\n values: {}\n });\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...menuProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}>\n <Provider\n values={[\n [MenuStateContext, state],\n [SeparatorContext, {elementType: 'div'}],\n [SectionContext, {name: 'MenuSection', render: MenuSection}],\n [SubmenuTriggerContext, {parentMenuRef: ref}],\n [MenuItemContext, null],\n [SelectionManagerContext, state.selectionManager]\n ]}>\n <CollectionRoot\n collection={collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n </div>\n </FocusScope>\n );\n}\n\n/**\n * A menu displays a list of actions or options that a user can choose.\n */\nconst _Menu = /*#__PURE__*/ (forwardRef as forwardRefType)(Menu);\nexport {_Menu as Menu};\n\nexport interface MenuSectionProps<T> extends SectionProps<T>, MultipleSelection {}\n\n// A subclass of SelectionManager that forwards focus-related properties to the parent,\n// but has its own local selection state.\nclass GroupSelectionManager extends SelectionManager {\n private parent: SelectionManager;\n\n constructor(parent: SelectionManager, state: MultipleSelectionState) {\n super(parent.collection, state);\n this.parent = parent;\n }\n\n get focusedKey() {\n return this.parent.focusedKey;\n }\n\n get isFocused() {\n return this.parent.isFocused;\n }\n\n setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void {\n return this.parent.setFocusedKey(key, childFocusStrategy);\n }\n\n setFocused(isFocused: boolean): void {\n this.parent.setFocused(isFocused);\n }\n\n get childFocusStrategy() {\n return this.parent.childFocusStrategy;\n }\n}\n\nfunction MenuSection<T extends object>(props: MenuSectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>, className = 'react-aria-MenuSection') {\n let state = useContext(MenuStateContext)!;\n let {CollectionBranch} = useContext(CollectionRendererContext);\n let [headingRef, heading] = useSlot();\n let {headingProps, groupProps} = useMenuSection({\n heading,\n 'aria-label': section.props['aria-label'] ?? undefined\n });\n let renderProps = useRenderProps({\n defaultClassName: className,\n className: section.props?.className,\n style: section.props?.style,\n values: {}\n });\n\n let parent = useContext(SelectionManagerContext)!;\n let selectionState = useMultipleSelectionState(props);\n let manager = props.selectionMode != null ? new GroupSelectionManager(parent, selectionState) : parent;\n\n return (\n <section\n {...filterDOMProps(props as any)}\n {...groupProps}\n {...renderProps}\n ref={ref}>\n <Provider\n values={[\n [HeaderContext, {...headingProps, ref: headingRef}],\n [SelectionManagerContext, manager]\n ]}>\n <CollectionBranch collection={state.collection} parent={section} />\n </Provider>\n </section>\n );\n}\n\n/**\n * A MenuSection represents a section within a Menu.\n */\nconst _MenuSection = /*#__PURE__*/ createBranchComponent('section', MenuSection);\nexport {_MenuSection as MenuSection};\n\nexport interface MenuItemRenderProps extends ItemRenderProps {\n /**\n * Whether the item has a submenu.\n *\n * @selector [data-has-submenu]\n */\n hasSubmenu: boolean,\n /**\n * Whether the item's submenu is open.\n *\n * @selector [data-open]\n */\n isOpen: boolean\n}\n\nexport interface MenuItemProps<T = object> extends RenderProps<MenuItemRenderProps>, 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 /** An accessibility label for this item. */\n 'aria-label'?: string,\n /** Whether the item is disabled. */\n isDisabled?: boolean,\n /** Handler that is called when the item is selected. */\n onAction?: () => void\n}\n\nconst MenuItemContext = createContext<ContextValue<MenuItemProps, HTMLDivElement>>(null);\n\n/**\n * A MenuItem represents an individual action in a Menu.\n */\nexport const MenuItem = /*#__PURE__*/ createLeafComponent('item', function MenuItem<T extends object>(props: MenuItemProps<T>, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n [props, forwardedRef] = useContextProps(props, forwardedRef, MenuItemContext);\n let id = useSlottedContext(MenuItemContext)?.id as string;\n let state = useContext(MenuStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let selectionManager = useContext(SelectionManagerContext)!;\n\n let {menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, ...states} = useMenuItem({\n ...props,\n id,\n key: item.key,\n selectionManager\n }, state, ref);\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled: states.isDisabled\n });\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-MenuItem',\n values: {\n ...states,\n isHovered,\n isFocusVisible,\n selectionMode: selectionManager.selectionMode,\n selectionBehavior: selectionManager.selectionBehavior,\n hasSubmenu: !!props['aria-haspopup'],\n isOpen: props['aria-expanded'] === 'true'\n }\n });\n\n let ElementType: React.ElementType = props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(menuItemProps, focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\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-selected={states.isSelected || undefined}\n data-selection-mode={selectionManager.selectionMode === 'none' ? undefined : selectionManager.selectionMode}\n data-has-submenu={!!props['aria-haspopup'] || undefined}\n data-open={props['aria-expanded'] === 'true' || undefined}>\n <Provider\n values={[\n [TextContext, {\n slots: {\n label: labelProps,\n description: descriptionProps\n }\n }],\n [KeyboardContext, keyboardShortcutProps]\n ]}>\n {renderProps.children}\n </Provider>\n </ElementType>\n );\n});\n"],"names":[],"version":3,"file":"Menu.main.js.map"}