@primer/react 0.0.0-20260427204434 → 0.0.0-20260428150519

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 (344) hide show
  1. package/CHANGELOG.md +10 -6
  2. package/dist/ActionBar/ActionBar.js +502 -705
  3. package/dist/ActionBar/ActionBar.module.css.js +10 -5
  4. package/dist/ActionBar/index.js +8 -8
  5. package/dist/ActionList/ActionList.module.css.js +31 -5
  6. package/dist/ActionList/ActionListContainerContext.js +4 -5
  7. package/dist/ActionList/Description.js +117 -133
  8. package/dist/ActionList/Divider.js +31 -38
  9. package/dist/ActionList/Group.js +292 -349
  10. package/dist/ActionList/Group.module.css.js +10 -5
  11. package/dist/ActionList/Heading.js +88 -106
  12. package/dist/ActionList/Heading.module.css.js +5 -5
  13. package/dist/ActionList/Item.js +668 -811
  14. package/dist/ActionList/LinkItem.js +36 -56
  15. package/dist/ActionList/List.js +168 -210
  16. package/dist/ActionList/Selection.js +83 -112
  17. package/dist/ActionList/TrailingAction.js +97 -112
  18. package/dist/ActionList/Visuals.js +143 -191
  19. package/dist/ActionList/index.js +33 -33
  20. package/dist/ActionList/shared.js +5 -9
  21. package/dist/ActionMenu/ActionMenu.js +223 -310
  22. package/dist/ActionMenu/ActionMenu.module.css.js +5 -5
  23. package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
  24. package/dist/AnchoredOverlay/AnchoredOverlay.js +206 -298
  25. package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +9 -5
  26. package/dist/Autocomplete/Autocomplete.js +125 -141
  27. package/dist/Autocomplete/AutocompleteContext.js +18 -20
  28. package/dist/Autocomplete/AutocompleteInput.js +108 -146
  29. package/dist/Autocomplete/AutocompleteMenu.js +201 -238
  30. package/dist/Autocomplete/AutocompleteMenu.module.css.js +8 -5
  31. package/dist/Autocomplete/AutocompleteOverlay.js +54 -79
  32. package/dist/Autocomplete/AutocompleteOverlay.module.css.js +5 -5
  33. package/dist/Avatar/Avatar.js +106 -133
  34. package/dist/Avatar/Avatar.module.css.js +5 -5
  35. package/dist/AvatarStack/AvatarStack.js +102 -143
  36. package/dist/AvatarStack/AvatarStack.module.css.js +9 -5
  37. package/dist/Banner/Banner.js +133 -186
  38. package/dist/Banner/Banner.module.css.js +14 -5
  39. package/dist/Banner/index.js +7 -7
  40. package/dist/BaseStyles.js +74 -91
  41. package/dist/BaseStyles.module.css.js +5 -5
  42. package/dist/Blankslate/Blankslate.js +266 -328
  43. package/dist/Blankslate/Blankslate.module.css.js +12 -5
  44. package/dist/Blankslate/BlankslateContext.js +7 -9
  45. package/dist/Blankslate/index.js +9 -9
  46. package/dist/BranchName/BranchName.js +49 -59
  47. package/dist/BranchName/BranchName.module.css.js +5 -5
  48. package/dist/Breadcrumbs/Breadcrumbs.js +371 -431
  49. package/dist/Breadcrumbs/Breadcrumbs.module.css.js +15 -5
  50. package/dist/Button/Button.js +15 -18
  51. package/dist/Button/ButtonBase.js +76 -139
  52. package/dist/Button/ButtonBase.module.css.js +16 -5
  53. package/dist/Button/IconButton.js +42 -74
  54. package/dist/Button/LinkButton.js +13 -17
  55. package/dist/ButtonGroup/ButtonGroup.js +80 -97
  56. package/dist/ButtonGroup/ButtonGroup.module.css.js +5 -5
  57. package/dist/Card/Card.js +401 -491
  58. package/dist/Card/Card.module.css.js +18 -5
  59. package/dist/Card/index.js +9 -9
  60. package/dist/Checkbox/Checkbox.js +52 -71
  61. package/dist/Checkbox/Checkbox.module.css.js +9 -5
  62. package/dist/Checkbox/shared.module.css.js +5 -5
  63. package/dist/CheckboxGroup/CheckboxGroup.js +111 -132
  64. package/dist/CheckboxGroup/CheckboxGroupContext.js +4 -4
  65. package/dist/CircleBadge/CircleBadge.js +77 -90
  66. package/dist/CircleBadge/CircleBadge.module.css.js +8 -5
  67. package/dist/ConfirmationDialog/ConfirmationDialog.js +68 -92
  68. package/dist/CounterLabel/CounterLabel.js +83 -99
  69. package/dist/CounterLabel/CounterLabel.module.css.js +5 -5
  70. package/dist/DataTable/DataTable.js +100 -140
  71. package/dist/DataTable/ErrorDialog.js +33 -45
  72. package/dist/DataTable/Pagination.js +464 -592
  73. package/dist/DataTable/Pagination.module.css.js +13 -5
  74. package/dist/DataTable/Table.js +527 -710
  75. package/dist/DataTable/Table.module.css.js +26 -5
  76. package/dist/DataTable/column.js +10 -11
  77. package/dist/DataTable/index.js +22 -20
  78. package/dist/DataTable/sorting.js +65 -103
  79. package/dist/DataTable/useTable.js +207 -290
  80. package/dist/Details/Details.js +100 -126
  81. package/dist/Details/Details.module.css.js +5 -5
  82. package/dist/Dialog/Dialog.js +259 -351
  83. package/dist/Dialog/Dialog.module.css.js +22 -5
  84. package/dist/FeatureFlags/DefaultFeatureFlags.js +7 -7
  85. package/dist/FeatureFlags/FeatureFlagContext.js +5 -5
  86. package/dist/FeatureFlags/FeatureFlagScope.js +36 -44
  87. package/dist/FeatureFlags/FeatureFlags.js +29 -37
  88. package/dist/FeatureFlags/useFeatureFlag.js +17 -19
  89. package/dist/FilteredActionList/FilteredActionList.js +454 -579
  90. package/dist/FilteredActionList/FilteredActionList.module.css.js +15 -5
  91. package/dist/FilteredActionList/FilteredActionListLoaders.js +119 -150
  92. package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +9 -5
  93. package/dist/FilteredActionList/useAnnouncements.js +167 -180
  94. package/dist/Flash/Flash.js +57 -69
  95. package/dist/Flash/Flash.module.css.js +5 -5
  96. package/dist/FormControl/FormControl.js +211 -227
  97. package/dist/FormControl/FormControl.module.css.js +11 -5
  98. package/dist/FormControl/FormControlCaption.js +37 -49
  99. package/dist/FormControl/FormControlCaption.module.css.js +5 -5
  100. package/dist/FormControl/FormControlLabel.js +95 -115
  101. package/dist/FormControl/FormControlLeadingVisual.js +29 -37
  102. package/dist/FormControl/FormControlLeadingVisual.module.css.js +5 -5
  103. package/dist/FormControl/_FormControlContext.js +41 -48
  104. package/dist/FormControl/_FormControlValidation.js +29 -39
  105. package/dist/Header/Header.js +138 -165
  106. package/dist/Header/Header.module.css.js +9 -5
  107. package/dist/Heading/Heading.js +26 -37
  108. package/dist/Heading/Heading.module.css.js +5 -5
  109. package/dist/Hidden/Hidden.js +54 -77
  110. package/dist/Hidden/Hidden.module.css.js +5 -5
  111. package/dist/InlineMessage/InlineMessage.js +88 -116
  112. package/dist/InlineMessage/InlineMessage.module.css.js +8 -5
  113. package/dist/KeybindingHint/KeybindingHint.js +70 -88
  114. package/dist/KeybindingHint/KeybindingHint.module.css.js +5 -5
  115. package/dist/KeybindingHint/components/Chord.js +81 -93
  116. package/dist/KeybindingHint/components/Chord.module.css.js +11 -5
  117. package/dist/KeybindingHint/components/Key.js +49 -66
  118. package/dist/KeybindingHint/components/Sequence.js +12 -24
  119. package/dist/KeybindingHint/key-names.js +99 -114
  120. package/dist/Label/Label.js +56 -66
  121. package/dist/Label/Label.module.css.js +5 -5
  122. package/dist/Label/index.js +5 -5
  123. package/dist/LabelGroup/LabelGroup.js +260 -344
  124. package/dist/LabelGroup/LabelGroup.module.css.js +12 -5
  125. package/dist/Link/Link.js +31 -47
  126. package/dist/Link/Link.module.css.js +5 -5
  127. package/dist/NavList/NavList.js +424 -614
  128. package/dist/NavList/NavList.module.css.js +5 -5
  129. package/dist/Octicon/Octicon.js +35 -37
  130. package/dist/Overlay/Overlay.js +264 -318
  131. package/dist/Overlay/Overlay.module.css.js +8 -5
  132. package/dist/PageHeader/PageHeader.js +579 -823
  133. package/dist/PageHeader/PageHeader.module.css.js +21 -5
  134. package/dist/PageLayout/PageLayout.js +631 -913
  135. package/dist/PageLayout/PageLayout.module.css.js +31 -5
  136. package/dist/PageLayout/paneUtils.js +15 -29
  137. package/dist/PageLayout/usePaneWidth.js +334 -437
  138. package/dist/Pagehead/Pagehead.js +10 -14
  139. package/dist/Pagehead/Pagehead.module.css.js +5 -5
  140. package/dist/Pagination/Pagination.js +84 -114
  141. package/dist/Pagination/Pagination.module.css.js +9 -5
  142. package/dist/Pagination/index.js +5 -5
  143. package/dist/Pagination/model.js +118 -194
  144. package/dist/Popover/Popover.js +126 -151
  145. package/dist/Popover/Popover.module.css.js +8 -5
  146. package/dist/Portal/Portal.js +65 -85
  147. package/dist/Portal/index.js +5 -6
  148. package/dist/ProgressBar/ProgressBar.js +210 -255
  149. package/dist/ProgressBar/ProgressBar.module.css.js +9 -5
  150. package/dist/ProgressBar/index.js +6 -8
  151. package/dist/Radio/Radio.js +97 -115
  152. package/dist/Radio/Radio.module.css.js +5 -5
  153. package/dist/RadioGroup/RadioGroup.js +99 -118
  154. package/dist/RelativeTime/RelativeTime.js +64 -76
  155. package/dist/ScrollableRegion/ScrollableRegion.js +67 -79
  156. package/dist/ScrollableRegion/ScrollableRegion.module.css.js +5 -5
  157. package/dist/SegmentedControl/SegmentedControl.js +238 -287
  158. package/dist/SegmentedControl/SegmentedControl.module.css.js +15 -5
  159. package/dist/SegmentedControl/SegmentedControlButton.js +156 -187
  160. package/dist/SegmentedControl/SegmentedControlIconButton.js +133 -161
  161. package/dist/Select/Select.js +185 -234
  162. package/dist/Select/Select.module.css.js +10 -5
  163. package/dist/SelectPanel/SelectPanel.js +620 -828
  164. package/dist/SelectPanel/SelectPanel.module.css.js +27 -5
  165. package/dist/SelectPanel/SelectPanelMessage.js +37 -39
  166. package/dist/SideNav.js +24 -47
  167. package/dist/SideNav.module.css.js +12 -5
  168. package/dist/Skeleton/SkeletonBox.js +94 -111
  169. package/dist/Skeleton/SkeletonBox.module.css.js +8 -5
  170. package/dist/SkeletonAvatar/SkeletonAvatar.js +95 -120
  171. package/dist/SkeletonAvatar/SkeletonAvatar.module.css.js +5 -5
  172. package/dist/SkeletonText/SkeletonText.js +114 -137
  173. package/dist/SkeletonText/SkeletonText.module.css.js +8 -5
  174. package/dist/Spinner/Spinner.js +183 -211
  175. package/dist/Spinner/Spinner.module.css.js +9 -5
  176. package/dist/SplitPageLayout/SplitPageLayout.js +215 -276
  177. package/dist/Stack/Stack.js +207 -255
  178. package/dist/Stack/Stack.module.css.js +8 -5
  179. package/dist/Stack/index.js +4 -6
  180. package/dist/StateLabel/StateLabel.js +110 -123
  181. package/dist/StateLabel/StateLabel.module.css.js +8 -5
  182. package/dist/SubNav/SubNav.js +159 -197
  183. package/dist/SubNav/SubNav.module.css.js +11 -5
  184. package/dist/TabNav/TabNav.js +167 -199
  185. package/dist/TabNav/TabNav.module.css.js +10 -5
  186. package/dist/Text/Text.js +56 -67
  187. package/dist/Text/Text.module.css.js +5 -5
  188. package/dist/TextInput/TextInput.js +195 -228
  189. package/dist/TextInput/TextInput.module.css.js +8 -5
  190. package/dist/TextInputWithTokens/TextInputWithTokens.js +567 -673
  191. package/dist/TextInputWithTokens/TextInputWithTokens.module.css.js +14 -5
  192. package/dist/Textarea/TextArea.module.css.js +9 -5
  193. package/dist/Textarea/Textarea.js +264 -294
  194. package/dist/ThemeProvider.js +199 -257
  195. package/dist/Timeline/Timeline.js +204 -247
  196. package/dist/Timeline/Timeline.module.css.js +12 -5
  197. package/dist/ToggleSwitch/ToggleSwitch.js +403 -471
  198. package/dist/ToggleSwitch/ToggleSwitch.module.css.js +16 -5
  199. package/dist/Token/IssueLabelToken.js +256 -297
  200. package/dist/Token/IssueLabelToken.module.css.js +8 -5
  201. package/dist/Token/Token.js +232 -280
  202. package/dist/Token/Token.module.css.js +9 -5
  203. package/dist/Token/TokenBase.js +99 -126
  204. package/dist/Token/TokenBase.module.css.js +5 -5
  205. package/dist/Token/_RemoveTokenButton.js +27 -48
  206. package/dist/Token/_RemoveTokenButton.module.css.js +5 -5
  207. package/dist/Token/_TokenTextContainer.js +54 -65
  208. package/dist/Token/_TokenTextContainer.module.css.js +5 -5
  209. package/dist/Tooltip/Tooltip.js +49 -56
  210. package/dist/Tooltip/Tooltip.module.css.js +20 -5
  211. package/dist/TooltipV2/Tooltip.js +222 -305
  212. package/dist/TooltipV2/Tooltip.module.css.js +11 -5
  213. package/dist/TopicTag/TopicTag.js +46 -55
  214. package/dist/TopicTag/TopicTag.module.css.js +5 -5
  215. package/dist/TopicTag/TopicTagGroup.js +40 -48
  216. package/dist/TopicTag/TopicTagGroup.module.css.js +5 -5
  217. package/dist/TopicTag/index.js +5 -7
  218. package/dist/TreeView/TreeView.js +1082 -1414
  219. package/dist/TreeView/TreeView.module.css.js +24 -5
  220. package/dist/TreeView/shared.js +10 -9
  221. package/dist/TreeView/useRovingTabIndex.js +129 -203
  222. package/dist/TreeView/useTreeItemCache.js +64 -79
  223. package/dist/TreeView/useTypeahead.js +90 -112
  224. package/dist/Truncate/Truncate.js +21 -33
  225. package/dist/Truncate/Truncate.module.css.js +5 -5
  226. package/dist/UnderlineNav/UnderlineNav.js +278 -375
  227. package/dist/UnderlineNav/UnderlineNav.module.css.js +8 -5
  228. package/dist/UnderlineNav/UnderlineNavContext.js +8 -8
  229. package/dist/UnderlineNav/UnderlineNavItem.js +56 -72
  230. package/dist/UnderlineNav/UnderlineNavItem.module.css.js +5 -5
  231. package/dist/UnderlineNav/index.js +5 -7
  232. package/dist/UnderlineNav/styles.js +11 -15
  233. package/dist/VisuallyHidden/VisuallyHidden.js +51 -49
  234. package/dist/VisuallyHidden/VisuallyHidden.module.css.js +5 -5
  235. package/dist/_VisuallyHidden.js +50 -62
  236. package/dist/_VisuallyHidden.module.css.js +5 -5
  237. package/dist/deprecated/ActionList/Divider.js +23 -23
  238. package/dist/deprecated/ActionList/Divider.module.css.js +5 -5
  239. package/dist/deprecated/ActionList/Group.js +43 -50
  240. package/dist/deprecated/ActionList/Header.js +69 -81
  241. package/dist/deprecated/ActionList/Header.module.css.js +5 -5
  242. package/dist/deprecated/ActionList/Item.js +308 -352
  243. package/dist/deprecated/ActionList/Item.module.css.js +18 -5
  244. package/dist/deprecated/ActionList/List.js +157 -196
  245. package/dist/deprecated/ActionList/List.module.css.js +5 -5
  246. package/dist/deprecated/ActionList/index.js +14 -14
  247. package/dist/deprecated/ActionMenu.js +159 -190
  248. package/dist/deprecated/DialogV1/Dialog.js +166 -200
  249. package/dist/deprecated/DialogV1/Dialog.module.css.js +11 -5
  250. package/dist/deprecated/FilteredSearch/FilteredSearch.js +43 -51
  251. package/dist/deprecated/FilteredSearch/FilteredSearch.module.css.js +5 -5
  252. package/dist/deprecated/UnderlineNav/UnderlineNav.js +132 -160
  253. package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +14 -5
  254. package/dist/deprecated/index.js +20 -9
  255. package/dist/experimental/IssueLabel/IssueLabel.js +134 -158
  256. package/dist/experimental/IssueLabel/IssueLabel.module.css.js +5 -5
  257. package/dist/experimental/SelectPanel2/SelectPanel.js +419 -567
  258. package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +32 -5
  259. package/dist/experimental/Tabs/Tabs.js +234 -297
  260. package/dist/experimental/UnderlinePanels/UnderlinePanels.js +165 -215
  261. package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +5 -5
  262. package/dist/experimental/index.js +44 -33
  263. package/dist/hooks/useAnchoredPosition.d.ts +0 -6
  264. package/dist/hooks/useAnchoredPosition.d.ts.map +1 -1
  265. package/dist/hooks/useAnchoredPosition.js +123 -130
  266. package/dist/hooks/useControllableState.js +34 -59
  267. package/dist/hooks/useDetails.js +84 -99
  268. package/dist/hooks/useDialog.js +140 -178
  269. package/dist/hooks/useFocusTrap.js +57 -71
  270. package/dist/hooks/useFocusZone.js +32 -38
  271. package/dist/hooks/useId.js +14 -16
  272. package/dist/hooks/useIsMacOS.js +21 -26
  273. package/dist/hooks/useMedia.js +54 -68
  274. package/dist/hooks/useMenuInitialFocus.js +65 -62
  275. package/dist/hooks/useMenuKeyboardNavigation.js +129 -126
  276. package/dist/hooks/useMergedRefs.js +63 -78
  277. package/dist/hooks/useMnemonics.js +77 -107
  278. package/dist/hooks/useOnEscapePress.js +45 -56
  279. package/dist/hooks/useOnOutsideClick.js +32 -63
  280. package/dist/hooks/useOpenAndCloseFocus.js +40 -43
  281. package/dist/hooks/useOverflow.js +32 -36
  282. package/dist/hooks/useOverlay.js +56 -75
  283. package/dist/hooks/useProvidedRefOrCreate.js +24 -24
  284. package/dist/hooks/useProvidedStateOrCreate.js +33 -39
  285. package/dist/hooks/useRefObjectAsForwardedRef.js +30 -32
  286. package/dist/hooks/useRenderForcingRef.js +42 -46
  287. package/dist/hooks/useResizeObserver.js +32 -43
  288. package/dist/hooks/useResponsiveValue.js +37 -57
  289. package/dist/hooks/useSafeTimeout.js +26 -29
  290. package/dist/hooks/useScrollFlash.js +16 -23
  291. package/dist/hooks/useSlots.js +102 -136
  292. package/dist/hooks/useSyncedState.js +31 -37
  293. package/dist/index.js +88 -85
  294. package/dist/internal/components/ButtonReset.js +45 -50
  295. package/dist/internal/components/ButtonReset.module.css.js +5 -5
  296. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +79 -105
  297. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.module.css.js +12 -5
  298. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +16 -21
  299. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.js +4 -4
  300. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +26 -35
  301. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +14 -19
  302. package/dist/internal/components/ConditionalWrapper.js +41 -51
  303. package/dist/internal/components/InputLabel.js +92 -113
  304. package/dist/internal/components/InputLabel.module.css.js +8 -5
  305. package/dist/internal/components/InputValidation.js +67 -87
  306. package/dist/internal/components/InputValidation.module.css.js +9 -5
  307. package/dist/internal/components/TextInputInnerAction.js +134 -173
  308. package/dist/internal/components/TextInputInnerAction.module.css.js +9 -5
  309. package/dist/internal/components/TextInputInnerVisualSlot.js +89 -110
  310. package/dist/internal/components/TextInputInnerVisualSlot.module.css.js +11 -5
  311. package/dist/internal/components/TextInputWrapper.js +187 -230
  312. package/dist/internal/components/TextInputWrapper.module.css.js +8 -5
  313. package/dist/internal/components/UnderlineTabbedInterface.js +191 -238
  314. package/dist/internal/components/UnderlineTabbedInterface.module.css.js +11 -5
  315. package/dist/internal/components/UnstyledTextInput.js +40 -47
  316. package/dist/internal/components/UnstyledTextInput.module.css.js +5 -5
  317. package/dist/internal/components/ValidationAnimationContainer.js +55 -66
  318. package/dist/internal/components/ValidationAnimationContainer.module.css.js +8 -5
  319. package/dist/internal/hooks/useEffectCallback.js +35 -38
  320. package/dist/internal/hooks/useEffectOnce.js +23 -25
  321. package/dist/internal/utils/getResponsiveAttributes.js +23 -26
  322. package/dist/internal/utils/hasInteractiveNodes.js +34 -46
  323. package/dist/legacy-theme/ts/color-schemes.js +4250 -4732
  324. package/dist/live-region/Announce.js +144 -183
  325. package/dist/live-region/AriaAlert.js +20 -22
  326. package/dist/live-region/AriaStatus.js +20 -22
  327. package/dist/next/index.js +3 -1
  328. package/dist/test-helpers.js +40 -62
  329. package/dist/theme.js +83 -47
  330. package/dist/utils/character-counter.js +45 -63
  331. package/dist/utils/create-component.js +15 -16
  332. package/dist/utils/descendant-registry.js +182 -218
  333. package/dist/utils/environment.js +7 -7
  334. package/dist/utils/getBreakpointDeclarations.js +9 -10
  335. package/dist/utils/invariant.js +17 -23
  336. package/dist/utils/is-slot.js +10 -11
  337. package/dist/utils/isNumeric.js +3 -3
  338. package/dist/utils/modern-polymorphic.js +12 -20
  339. package/dist/utils/scroll.js +8 -11
  340. package/dist/utils/theme.js +5 -10
  341. package/dist/utils/useIsomorphicLayoutEffect.js +4 -9
  342. package/dist/utils/warning.js +14 -21
  343. package/generated/components.json +9 -9
  344. package/package.json +5 -10
@@ -1,585 +1,460 @@
1
- import { c } from 'react-compiler-runtime';
2
- import { scrollIntoView, FocusKeys } from '@primer/behaviors';
3
- import { useCallback, useRef, useState, useEffect, useMemo, forwardRef } from 'react';
4
- import { ActionList } from '../ActionList/index.js';
5
- import { useFocusZone } from '../hooks/useFocusZone.js';
6
- import { useId } from '../hooks/useId.js';
7
- import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
8
- import { useProvidedStateOrCreate } from '../hooks/useProvidedStateOrCreate.js';
9
- import useScrollFlash from '../hooks/useScrollFlash.js';
10
- import { FilteredActionListLoadingTypes, FilteredActionListBodyLoader } from './FilteredActionListLoaders.js';
11
- import classes from './FilteredActionList.module.css.js';
12
- import { ActionListContainerContext } from '../ActionList/ActionListContainerContext.js';
13
- import { isValidElementType } from 'react-is';
14
- import { useAnnouncements } from './useAnnouncements.js';
15
- import { clsx } from 'clsx';
16
- import { useVirtualizer } from '@tanstack/react-virtual';
17
- import { jsxs, jsx } from 'react/jsx-runtime';
18
- import TextInput from '../TextInput/TextInput.js';
19
- import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
20
- import Checkbox from '../Checkbox/Checkbox.js';
21
-
1
+ import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
2
+ import { useProvidedStateOrCreate } from "../hooks/useProvidedStateOrCreate.js";
3
+ import { useId as useId$1 } from "../hooks/useId.js";
4
+ import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.js";
5
+ import { useFocusZone } from "../hooks/useFocusZone.js";
6
+ import { ActionListContainerContext } from "../ActionList/ActionListContainerContext.js";
7
+ import { ActionList } from "../ActionList/index.js";
8
+ import TextInput_default from "../TextInput/TextInput.js";
9
+ import Checkbox from "../Checkbox/Checkbox.js";
10
+ import useScrollFlash from "../hooks/useScrollFlash.js";
11
+ import { FilteredActionListBodyLoader, FilteredActionListLoadingTypes } from "./FilteredActionListLoaders.js";
12
+ import FilteredActionList_module_css_default from "./FilteredActionList.module.css.js";
13
+ import { useAnnouncements } from "./useAnnouncements.js";
14
+ import { c } from "react-compiler-runtime";
15
+ import { clsx } from "clsx";
16
+ import { jsx, jsxs } from "react/jsx-runtime";
17
+ import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
18
+ import { FocusKeys, scrollIntoView } from "@primer/behaviors";
19
+ import { isValidElementType } from "react-is";
20
+ import { useVirtualizer } from "@tanstack/react-virtual";
21
+ //#region src/FilteredActionList/FilteredActionList.tsx
22
22
  const menuScrollMargins = {
23
- startMargin: 0,
24
- endMargin: 8
23
+ startMargin: 0,
24
+ endMargin: 8
25
25
  };
26
- function FilteredActionList({
27
- loading = false,
28
- placeholderText,
29
- filterValue: externalFilterValue,
30
- loadingType = FilteredActionListLoadingTypes.bodySpinner,
31
- onFilterChange,
32
- onListContainerRefChanged,
33
- onInputRefChanged,
34
- items,
35
- textInputProps,
36
- inputRef: providedInputRef,
37
- scrollContainerRef: providedScrollContainerRef,
38
- groupMetadata,
39
- showItemDividers,
40
- message,
41
- messageText,
42
- className,
43
- selectionVariant,
44
- announcementsEnabled = true,
45
- fullScreenOnNarrow,
46
- onSelectAllChange,
47
- actionListProps,
48
- focusOutBehavior = 'wrap',
49
- _PrivateFocusManagement = 'active-descendant',
50
- onActiveDescendantChanged,
51
- disableSelectOnHover = false,
52
- setInitialFocus = false,
53
- focusPrependedElements,
54
- scrollBehavior,
55
- virtualized = false,
56
- ...listProps
57
- }) {
58
- if (process.env.NODE_ENV !== "production") {
59
- if (virtualized && groupMetadata !== null && groupMetadata !== void 0 && groupMetadata.length) {
60
- // eslint-disable-next-line no-console
61
- console.warn('FilteredActionList: `virtualized` has no effect when `groupMetadata` is provided. ' + 'Grouped lists are rendered without virtualization.');
62
- }
63
- }
64
-
65
- // Virtualization is disabled when groups are present — grouped lists render
66
- // normally regardless of the `virtualized` prop.
67
- const isVirtualized = virtualized && !(groupMetadata !== null && groupMetadata !== void 0 && groupMetadata.length);
68
- const [filterValue, setInternalFilterValue] = useProvidedStateOrCreate(externalFilterValue, undefined, '');
69
- const onInputChange = useCallback(e => {
70
- const value = e.target.value;
71
- onFilterChange(value, e);
72
- setInternalFilterValue(value);
73
- }, [onFilterChange, setInternalFilterValue]);
74
- const inputAndListContainerRef = useRef(null);
75
- const listRef = useRef(null);
76
- const scrollContainerRef = useProvidedRefOrCreate(providedScrollContainerRef);
77
- const inputRef = useProvidedRefOrCreate(providedInputRef);
78
- const usingRovingTabindex = _PrivateFocusManagement === 'roving-tabindex';
79
- const [listContainerElement, setListContainerElement] = useState(null);
80
- const activeDescendantRef = useRef();
81
- const listId = useId(actionListProps === null || actionListProps === void 0 ? void 0 : actionListProps.id);
82
- const inputDescriptionTextId = useId();
83
- const [isInputFocused, setIsInputFocused] = useState(false);
84
- const selectAllChecked = items.length > 0 && items.every(item => item.selected);
85
- const selectAllIndeterminate = !selectAllChecked && items.some(item_0 => item_0.selected);
86
- const selectAllLabelText = selectAllChecked ? 'Deselect all' : 'Select all';
87
- const getItemListForEachGroup = useCallback(groupId => {
88
- const itemsInGroup = [];
89
- for (const item_1 of items) {
90
- // Look up the group associated with the current item.
91
- if (item_1.groupId === groupId) {
92
- itemsInGroup.push(item_1);
93
- }
94
- }
95
- return itemsInGroup;
96
- }, [items]);
97
- const onInputKeyDown = useCallback(event => {
98
- if (event.key === 'ArrowDown') {
99
- if (listRef.current) {
100
- const firstSelectedItem = listRef.current.querySelector('[role="option"]');
101
- firstSelectedItem === null || firstSelectedItem === void 0 ? void 0 : firstSelectedItem.focus();
102
- event.preventDefault();
103
- }
104
- } else if (event.key === 'Enter') {
105
- let firstItem;
106
- // If there are groups, it's not guaranteed that the first item is the actual first item in the first -
107
- // as groups are rendered in the order of the groupId provided
108
- if (groupMetadata) {
109
- let firstGroupIndex = 0;
110
- for (let i = 0; i < groupMetadata.length; i++) {
111
- if (getItemListForEachGroup(groupMetadata[i].groupId).length > 0) {
112
- break;
113
- } else {
114
- firstGroupIndex++;
115
- }
116
- }
117
- const firstGroup = groupMetadata[firstGroupIndex].groupId;
118
- firstItem = items.filter(item_2 => item_2.groupId === firstGroup)[0];
119
- } else {
120
- firstItem = items[0];
121
- }
122
- if (firstItem.onAction) {
123
- firstItem.onAction(firstItem, event);
124
- event.preventDefault();
125
- }
126
- }
127
- }, [items, groupMetadata, getItemListForEachGroup]);
128
- const onInputKeyPress = useCallback(event_0 => {
129
- if (event_0.key === 'Enter' && activeDescendantRef.current) {
130
- event_0.preventDefault();
131
- event_0.nativeEvent.stopImmediatePropagation();
132
-
133
- // Forward Enter key press to active descendant so that item gets activated
134
- const activeDescendantEvent = new KeyboardEvent(event_0.type, event_0.nativeEvent);
135
- activeDescendantRef.current.dispatchEvent(activeDescendantEvent);
136
- }
137
- }, [activeDescendantRef]);
138
- const listContainerRefCallback = useCallback(node => {
139
- setListContainerElement(node);
140
- onListContainerRefChanged === null || onListContainerRefChanged === void 0 ? void 0 : onListContainerRefChanged(node);
141
- }, [onListContainerRefChanged]);
142
- useEffect(() => {
143
- onInputRefChanged === null || onInputRefChanged === void 0 ? void 0 : onInputRefChanged(inputRef);
144
- }, [inputRef, onInputRefChanged]);
145
-
146
- // Matches the most common ActionList.Item height (single-line text + description).
147
- // Items are measured dynamically via `measureElement`, so this only affects the
148
- // initial total-height estimate before items scroll into view.
149
- const DEFAULT_VIRTUAL_ITEM_HEIGHT = 32;
150
-
151
- // eslint-disable-next-line react-hooks/incompatible-library
152
- const virtualizer = useVirtualizer({
153
- count: items.length,
154
- getScrollElement: () => scrollContainerRef.current,
155
- estimateSize: () => DEFAULT_VIRTUAL_ITEM_HEIGHT,
156
- overscan: 10,
157
- enabled: isVirtualized,
158
- getItemKey: index => {
159
- var _ref, _item_3$key, _item_3$id;
160
- const item_3 = items[index];
161
- return (_ref = (_item_3$key = item_3.key) !== null && _item_3$key !== void 0 ? _item_3$key : (_item_3$id = item_3.id) === null || _item_3$id === void 0 ? void 0 : _item_3$id.toString()) !== null && _ref !== void 0 ? _ref : index.toString();
162
- },
163
- measureElement: el => el.scrollHeight
164
- });
165
- const virtualItems = isVirtualized ? virtualizer.getVirtualItems() : undefined;
166
- const virtualizedItemEntries = useMemo(() => {
167
- if (!isVirtualized || !virtualItems) return undefined;
168
- return virtualItems.map(virtualItem => {
169
- const item_4 = items[virtualItem.index];
170
- return {
171
- virtualItem,
172
- item: item_4,
173
- index: virtualItem.index
174
- };
175
- });
176
- }, [isVirtualized, virtualItems, items]);
177
- useFocusZone(!usingRovingTabindex ? {
178
- containerRef: {
179
- current: listContainerElement
180
- },
181
- bindKeys: FocusKeys.ArrowVertical | FocusKeys.PageUpDown,
182
- // With virtualization, only a subset of items exists in the DOM at any time.
183
- // 'wrap' would cycle focus within the visible window instead of reaching the
184
- // true end of the list. 'stop' lets the virtualizer's scrollToIndex bring
185
- // the correct items into view when navigating past the rendered boundaries.
186
- focusOutBehavior: isVirtualized ? 'stop' : focusOutBehavior,
187
- focusableElementFilter: element => {
188
- return !(element instanceof HTMLInputElement);
189
- },
190
- activeDescendantFocus: inputRef,
191
- onActiveDescendantChanged: (current, previous, directlyActivated) => {
192
- activeDescendantRef.current = current;
193
- if (isVirtualized && current) {
194
- const index_0 = current.getAttribute('data-index');
195
- const range = virtualizer.range;
196
- if (index_0 !== null && range && (Number(index_0) < range.startIndex || Number(index_0) >= range.endIndex)) {
197
- virtualizer.scrollToIndex(Number(index_0), {
198
- align: 'auto'
199
- });
200
- }
201
- }
202
- if (current && scrollContainerRef.current && (directlyActivated || focusPrependedElements)) {
203
- scrollIntoView(current, scrollContainerRef.current, {
204
- ...menuScrollMargins,
205
- behavior: scrollBehavior
206
- });
207
- }
208
- onActiveDescendantChanged === null || onActiveDescendantChanged === void 0 ? void 0 : onActiveDescendantChanged(current, previous, directlyActivated);
209
- },
210
- focusInStrategy: setInitialFocus ? 'initial' : 'previous',
211
- ignoreHoverEvents: disableSelectOnHover,
212
- focusPrependedElements
213
- } : undefined, [listContainerElement, usingRovingTabindex, onActiveDescendantChanged, focusPrependedElements, isVirtualized]);
214
- useEffect(() => {
215
- if (activeDescendantRef.current && scrollContainerRef.current) {
216
- scrollIntoView(activeDescendantRef.current, scrollContainerRef.current, {
217
- ...menuScrollMargins,
218
- behavior: scrollBehavior
219
- });
220
- }
221
- }, [items, inputRef, scrollContainerRef, scrollBehavior]);
222
- useEffect(() => {
223
- if (usingRovingTabindex) {
224
- const inputAndListContainerElement = inputAndListContainerRef.current;
225
- if (!inputAndListContainerElement) return;
226
- const list = listRef.current;
227
- if (!list) return;
228
-
229
- // Listen for focus changes within the container
230
- const handleFocusIn = event_1 => {
231
- if (event_1.target === inputRef.current || list.contains(event_1.target)) {
232
- setIsInputFocused(inputRef.current && inputRef.current === document.activeElement ? true : false);
233
- }
234
- };
235
- inputAndListContainerElement.addEventListener('focusin', handleFocusIn);
236
- return () => {
237
- inputAndListContainerElement.removeEventListener('focusin', handleFocusIn);
238
- };
239
- }
240
- }, [items, inputRef, listContainerElement, usingRovingTabindex]); // Re-run when items change to update active indicators
241
-
242
- useEffect(() => {
243
- if (usingRovingTabindex && !loading) {
244
- setIsInputFocused(inputRef.current && inputRef.current === document.activeElement ? true : false);
245
- }
246
- }, [loading, inputRef, usingRovingTabindex]);
247
- useAnnouncements(items, usingRovingTabindex ? listRef : {
248
- current: listContainerElement
249
- }, inputRef, announcementsEnabled, loading, messageText, _PrivateFocusManagement);
250
- useScrollFlash(scrollContainerRef);
251
- const handleSelectAllChange = useCallback(e_0 => {
252
- if (onSelectAllChange) {
253
- onSelectAllChange(e_0.target.checked);
254
- }
255
- }, [onSelectAllChange]);
256
- function getBodyContent() {
257
- if (loading && scrollContainerRef.current && loadingType.appearsInBody) {
258
- return /*#__PURE__*/jsx(FilteredActionListBodyLoader, {
259
- loadingType: loadingType,
260
- height: scrollContainerRef.current.clientHeight
261
- });
262
- }
263
- if (message) {
264
- return message;
265
- }
266
- let firstGroupIndex_0 = 0;
267
- const renderListItems = () => {
268
- if (groupMetadata !== null && groupMetadata !== void 0 && groupMetadata.length) {
269
- return groupMetadata.map((group, index_1) => {
270
- var _group$header, _group$header2;
271
- if (index_1 === firstGroupIndex_0 && getItemListForEachGroup(group.groupId).length === 0) {
272
- firstGroupIndex_0++;
273
- }
274
- return /*#__PURE__*/jsxs(ActionList.Group, {
275
- children: [/*#__PURE__*/jsx(ActionList.GroupHeading, {
276
- variant: (_group$header = group.header) !== null && _group$header !== void 0 && _group$header.variant ? group.header.variant : undefined,
277
- children: (_group$header2 = group.header) !== null && _group$header2 !== void 0 && _group$header2.title ? group.header.title : `Group ${group.groupId}`
278
- }), getItemListForEachGroup(group.groupId).map(({
279
- key: itemKey,
280
- ...item_5
281
- }, itemIndex) => {
282
- var _ref2, _item_5$id;
283
- const key = (_ref2 = itemKey !== null && itemKey !== void 0 ? itemKey : (_item_5$id = item_5.id) === null || _item_5$id === void 0 ? void 0 : _item_5$id.toString()) !== null && _ref2 !== void 0 ? _ref2 : itemIndex.toString();
284
- return /*#__PURE__*/jsx(MappedActionListItem, {
285
- className: clsx(classes.ActionListItem, 'className' in item_5 ? item_5.className : undefined),
286
- "data-input-focused": isInputFocused ? '' : undefined,
287
- "data-first-child": index_1 === firstGroupIndex_0 && itemIndex === 0 ? '' : undefined,
288
- ...item_5,
289
- renderItem: listProps.renderItem
290
- }, key);
291
- })]
292
- }, index_1);
293
- });
294
- }
295
- if (isVirtualized && virtualizedItemEntries) {
296
- return virtualizedItemEntries.map(({
297
- virtualItem: virtualItem_0,
298
- item: {
299
- key: itemKey_0,
300
- ...item_6
301
- },
302
- index: index_2
303
- }) => {
304
- var _ref3, _item_6$id;
305
- const key_0 = (_ref3 = itemKey_0 !== null && itemKey_0 !== void 0 ? itemKey_0 : (_item_6$id = item_6.id) === null || _item_6$id === void 0 ? void 0 : _item_6$id.toString()) !== null && _ref3 !== void 0 ? _ref3 : index_2.toString();
306
- return /*#__PURE__*/jsx(MappedActionListItem, {
307
- className: clsx(classes.ActionListItem, 'className' in item_6 ? item_6.className : undefined),
308
- "data-input-focused": isInputFocused ? '' : undefined,
309
- "data-first-child": index_2 === 0 ? '' : undefined,
310
- "data-index": virtualItem_0.index,
311
- ref: node_0 => {
312
- if (node_0) {
313
- virtualizer.measureElement(node_0);
314
- }
315
- },
316
- style: {
317
- position: 'absolute',
318
- top: 0,
319
- left: 0,
320
- right: 0,
321
- transform: `translateY(${virtualItem_0.start}px)`
322
- },
323
- ...item_6,
324
- renderItem: listProps.renderItem
325
- }, key_0);
326
- });
327
- }
328
- return items.map(({
329
- key: itemKey_1,
330
- ...item_7
331
- }, index_3) => {
332
- var _ref4, _item_7$id;
333
- const key_1 = (_ref4 = itemKey_1 !== null && itemKey_1 !== void 0 ? itemKey_1 : (_item_7$id = item_7.id) === null || _item_7$id === void 0 ? void 0 : _item_7$id.toString()) !== null && _ref4 !== void 0 ? _ref4 : index_3.toString();
334
- return /*#__PURE__*/jsx(MappedActionListItem, {
335
- className: clsx(classes.ActionListItem, 'className' in item_7 ? item_7.className : undefined),
336
- "data-input-focused": isInputFocused ? '' : undefined,
337
- "data-first-child": index_3 === 0 ? '' : undefined,
338
- ...item_7,
339
- renderItem: listProps.renderItem
340
- }, key_1);
341
- });
342
- };
343
- const actionListContent = /*#__PURE__*/jsx(ActionList, {
344
- ref: usingRovingTabindex ? listRef : listContainerRefCallback,
345
- showDividers: showItemDividers,
346
- selectionVariant: selectionVariant,
347
- ...listProps,
348
- ...actionListProps,
349
- role: "listbox",
350
- id: listId,
351
- className: clsx(classes.ActionList, actionListProps === null || actionListProps === void 0 ? void 0 : actionListProps.className)
352
- // When virtualized, the ActionList needs `position: relative` so that absolutely-positioned
353
- // virtual items are placed correctly, and its `height` must equal the total virtual content
354
- // size so the scroll container produces the right scrollbar.
355
- // These styles are independent of SelectPanel's `height`/`width` props, which control the
356
- // outer overlay dimensions, not the list content area.
357
- ,
358
- style: isVirtualized ? {
359
- ...(actionListProps === null || actionListProps === void 0 ? void 0 : actionListProps.style),
360
- height: virtualizer.getTotalSize(),
361
- position: 'relative'
362
- } : actionListProps === null || actionListProps === void 0 ? void 0 : actionListProps.style,
363
- children: renderListItems()
364
- });
365
-
366
- // Use ActionListContainerContext.Provider only for the old behavior (when feature flag is disabled)
367
- if (usingRovingTabindex) {
368
- return /*#__PURE__*/jsx(ActionListContainerContext.Provider, {
369
- value: {
370
- container: 'FilteredActionList',
371
- listRole: 'listbox',
372
- selectionAttribute: 'aria-selected',
373
- selectionVariant,
374
- enableFocusZone: true
375
- },
376
- children: actionListContent
377
- });
378
- } else {
379
- return actionListContent;
380
- }
381
- }
382
- const {
383
- className: textInputClassName,
384
- ...restTextInputProps
385
- } = textInputProps || {};
386
- return /*#__PURE__*/jsxs("div", {
387
- ref: inputAndListContainerRef,
388
- className: clsx(className, classes.Root),
389
- "data-testid": "filtered-action-list",
390
- "data-component": "FilteredActionList",
391
- children: [/*#__PURE__*/jsx("div", {
392
- className: classes.Header,
393
- "data-component": "FilteredActionList.Header",
394
- children: /*#__PURE__*/jsx(TextInput
395
- // @ts-expect-error it needs a non nullable ref
396
- , {
397
- ref: inputRef,
398
- block: true,
399
- width: "auto",
400
- color: "fg.default",
401
- value: filterValue,
402
- onChange: onInputChange,
403
- onKeyPress: onInputKeyPress,
404
- onKeyDown: usingRovingTabindex ? onInputKeyDown : () => {},
405
- placeholder: placeholderText,
406
- role: "combobox",
407
- "aria-expanded": "true",
408
- "aria-autocomplete": "list",
409
- "aria-controls": listId,
410
- "aria-label": placeholderText,
411
- "aria-describedby": inputDescriptionTextId,
412
- loaderPosition: 'leading',
413
- loading: loading && !loadingType.appearsInBody,
414
- className: clsx(textInputClassName, {
415
- [classes.FullScreenTextInput]: fullScreenOnNarrow
416
- }),
417
- ...restTextInputProps
418
- })
419
- }), /*#__PURE__*/jsx(VisuallyHidden, {
420
- id: inputDescriptionTextId,
421
- children: "Items will be filtered as you type"
422
- }), onSelectAllChange !== undefined && /*#__PURE__*/jsxs("div", {
423
- className: classes.SelectAllContainer,
424
- "data-component": "FilteredActionList.SelectAll",
425
- children: [/*#__PURE__*/jsx(Checkbox, {
426
- id: "select-all-checkbox",
427
- className: classes.SelectAllCheckbox,
428
- checked: selectAllChecked,
429
- indeterminate: selectAllIndeterminate,
430
- onChange: handleSelectAllChange,
431
- "data-component": "FilteredActionList.SelectAllCheckbox"
432
- }), /*#__PURE__*/jsx("label", {
433
- className: classes.SelectAllLabel,
434
- htmlFor: "select-all-checkbox",
435
- "data-component": "FilteredActionList.SelectAllLabel",
436
- children: selectAllLabelText
437
- })]
438
- }), /*#__PURE__*/jsx("div", {
439
- ref: scrollContainerRef,
440
- className: classes.Container,
441
- children: getBodyContent()
442
- })]
443
- });
26
+ function FilteredActionList({ loading = false, placeholderText, filterValue: externalFilterValue, loadingType = FilteredActionListLoadingTypes.bodySpinner, onFilterChange, onListContainerRefChanged, onInputRefChanged, items, textInputProps, inputRef: providedInputRef, scrollContainerRef: providedScrollContainerRef, groupMetadata, showItemDividers, message, messageText, className, selectionVariant, announcementsEnabled = true, fullScreenOnNarrow, onSelectAllChange, actionListProps, focusOutBehavior = "wrap", _PrivateFocusManagement = "active-descendant", onActiveDescendantChanged, disableSelectOnHover = false, setInitialFocus = false, focusPrependedElements, scrollBehavior, virtualized = false, ...listProps }) {
27
+ if (virtualized && groupMetadata !== null && groupMetadata !== void 0 && groupMetadata.length) console.warn("FilteredActionList: `virtualized` has no effect when `groupMetadata` is provided. Grouped lists are rendered without virtualization.");
28
+ const isVirtualized = virtualized && !(groupMetadata !== null && groupMetadata !== void 0 && groupMetadata.length);
29
+ const [filterValue, setInternalFilterValue] = useProvidedStateOrCreate(externalFilterValue, void 0, "");
30
+ const onInputChange = useCallback((e) => {
31
+ const value = e.target.value;
32
+ onFilterChange(value, e);
33
+ setInternalFilterValue(value);
34
+ }, [onFilterChange, setInternalFilterValue]);
35
+ const inputAndListContainerRef = useRef(null);
36
+ const listRef = useRef(null);
37
+ const scrollContainerRef = useProvidedRefOrCreate(providedScrollContainerRef);
38
+ const inputRef = useProvidedRefOrCreate(providedInputRef);
39
+ const usingRovingTabindex = _PrivateFocusManagement === "roving-tabindex";
40
+ const [listContainerElement, setListContainerElement] = useState(null);
41
+ const activeDescendantRef = useRef();
42
+ const listId = useId$1(actionListProps === null || actionListProps === void 0 ? void 0 : actionListProps.id);
43
+ const inputDescriptionTextId = useId$1();
44
+ const [isInputFocused, setIsInputFocused] = useState(false);
45
+ const selectAllChecked = items.length > 0 && items.every((item) => item.selected);
46
+ const selectAllIndeterminate = !selectAllChecked && items.some((item_0) => item_0.selected);
47
+ const selectAllLabelText = selectAllChecked ? "Deselect all" : "Select all";
48
+ const getItemListForEachGroup = useCallback((groupId) => {
49
+ const itemsInGroup = [];
50
+ for (const item_1 of items) if (item_1.groupId === groupId) itemsInGroup.push(item_1);
51
+ return itemsInGroup;
52
+ }, [items]);
53
+ const onInputKeyDown = useCallback((event) => {
54
+ if (event.key === "ArrowDown") {
55
+ if (listRef.current) {
56
+ const firstSelectedItem = listRef.current.querySelector("[role=\"option\"]");
57
+ firstSelectedItem === null || firstSelectedItem === void 0 || firstSelectedItem.focus();
58
+ event.preventDefault();
59
+ }
60
+ } else if (event.key === "Enter") {
61
+ let firstItem;
62
+ if (groupMetadata) {
63
+ let firstGroupIndex = 0;
64
+ for (let i = 0; i < groupMetadata.length; i++) if (getItemListForEachGroup(groupMetadata[i].groupId).length > 0) break;
65
+ else firstGroupIndex++;
66
+ const firstGroup = groupMetadata[firstGroupIndex].groupId;
67
+ firstItem = items.filter((item_2) => item_2.groupId === firstGroup)[0];
68
+ } else firstItem = items[0];
69
+ if (firstItem.onAction) {
70
+ firstItem.onAction(firstItem, event);
71
+ event.preventDefault();
72
+ }
73
+ }
74
+ }, [
75
+ items,
76
+ groupMetadata,
77
+ getItemListForEachGroup
78
+ ]);
79
+ const onInputKeyPress = useCallback((event_0) => {
80
+ if (event_0.key === "Enter" && activeDescendantRef.current) {
81
+ event_0.preventDefault();
82
+ event_0.nativeEvent.stopImmediatePropagation();
83
+ const activeDescendantEvent = new KeyboardEvent(event_0.type, event_0.nativeEvent);
84
+ activeDescendantRef.current.dispatchEvent(activeDescendantEvent);
85
+ }
86
+ }, [activeDescendantRef]);
87
+ const listContainerRefCallback = useCallback((node) => {
88
+ setListContainerElement(node);
89
+ onListContainerRefChanged === null || onListContainerRefChanged === void 0 || onListContainerRefChanged(node);
90
+ }, [onListContainerRefChanged]);
91
+ useEffect(() => {
92
+ onInputRefChanged === null || onInputRefChanged === void 0 || onInputRefChanged(inputRef);
93
+ }, [inputRef, onInputRefChanged]);
94
+ const DEFAULT_VIRTUAL_ITEM_HEIGHT = 32;
95
+ const virtualizer = useVirtualizer({
96
+ count: items.length,
97
+ getScrollElement: () => scrollContainerRef.current,
98
+ estimateSize: () => DEFAULT_VIRTUAL_ITEM_HEIGHT,
99
+ overscan: 10,
100
+ enabled: isVirtualized,
101
+ getItemKey: (index) => {
102
+ var _ref, _item_3$key, _item_3$id;
103
+ const item_3 = items[index];
104
+ return (_ref = (_item_3$key = item_3.key) !== null && _item_3$key !== void 0 ? _item_3$key : (_item_3$id = item_3.id) === null || _item_3$id === void 0 ? void 0 : _item_3$id.toString()) !== null && _ref !== void 0 ? _ref : index.toString();
105
+ },
106
+ measureElement: (el) => el.scrollHeight
107
+ });
108
+ const virtualItems = isVirtualized ? virtualizer.getVirtualItems() : void 0;
109
+ const virtualizedItemEntries = useMemo(() => {
110
+ if (!isVirtualized || !virtualItems) return void 0;
111
+ return virtualItems.map((virtualItem) => {
112
+ return {
113
+ virtualItem,
114
+ item: items[virtualItem.index],
115
+ index: virtualItem.index
116
+ };
117
+ });
118
+ }, [
119
+ isVirtualized,
120
+ virtualItems,
121
+ items
122
+ ]);
123
+ useFocusZone(!usingRovingTabindex ? {
124
+ containerRef: { current: listContainerElement },
125
+ bindKeys: FocusKeys.ArrowVertical | FocusKeys.PageUpDown,
126
+ focusOutBehavior: isVirtualized ? "stop" : focusOutBehavior,
127
+ focusableElementFilter: (element) => {
128
+ return !(element instanceof HTMLInputElement);
129
+ },
130
+ activeDescendantFocus: inputRef,
131
+ onActiveDescendantChanged: (current, previous, directlyActivated) => {
132
+ activeDescendantRef.current = current;
133
+ if (isVirtualized && current) {
134
+ const index_0 = current.getAttribute("data-index");
135
+ const range = virtualizer.range;
136
+ if (index_0 !== null && range && (Number(index_0) < range.startIndex || Number(index_0) >= range.endIndex)) virtualizer.scrollToIndex(Number(index_0), { align: "auto" });
137
+ }
138
+ if (current && scrollContainerRef.current && (directlyActivated || focusPrependedElements)) scrollIntoView(current, scrollContainerRef.current, {
139
+ ...menuScrollMargins,
140
+ behavior: scrollBehavior
141
+ });
142
+ onActiveDescendantChanged === null || onActiveDescendantChanged === void 0 || onActiveDescendantChanged(current, previous, directlyActivated);
143
+ },
144
+ focusInStrategy: setInitialFocus ? "initial" : "previous",
145
+ ignoreHoverEvents: disableSelectOnHover,
146
+ focusPrependedElements
147
+ } : void 0, [
148
+ listContainerElement,
149
+ usingRovingTabindex,
150
+ onActiveDescendantChanged,
151
+ focusPrependedElements,
152
+ isVirtualized
153
+ ]);
154
+ useEffect(() => {
155
+ if (activeDescendantRef.current && scrollContainerRef.current) scrollIntoView(activeDescendantRef.current, scrollContainerRef.current, {
156
+ ...menuScrollMargins,
157
+ behavior: scrollBehavior
158
+ });
159
+ }, [
160
+ items,
161
+ inputRef,
162
+ scrollContainerRef,
163
+ scrollBehavior
164
+ ]);
165
+ useEffect(() => {
166
+ if (usingRovingTabindex) {
167
+ const inputAndListContainerElement = inputAndListContainerRef.current;
168
+ if (!inputAndListContainerElement) return;
169
+ const list = listRef.current;
170
+ if (!list) return;
171
+ const handleFocusIn = (event_1) => {
172
+ if (event_1.target === inputRef.current || list.contains(event_1.target)) setIsInputFocused(inputRef.current && inputRef.current === document.activeElement ? true : false);
173
+ };
174
+ inputAndListContainerElement.addEventListener("focusin", handleFocusIn);
175
+ return () => {
176
+ inputAndListContainerElement.removeEventListener("focusin", handleFocusIn);
177
+ };
178
+ }
179
+ }, [
180
+ items,
181
+ inputRef,
182
+ listContainerElement,
183
+ usingRovingTabindex
184
+ ]);
185
+ useEffect(() => {
186
+ if (usingRovingTabindex && !loading) setIsInputFocused(inputRef.current && inputRef.current === document.activeElement ? true : false);
187
+ }, [
188
+ loading,
189
+ inputRef,
190
+ usingRovingTabindex
191
+ ]);
192
+ useAnnouncements(items, usingRovingTabindex ? listRef : { current: listContainerElement }, inputRef, announcementsEnabled, loading, messageText, _PrivateFocusManagement);
193
+ useScrollFlash(scrollContainerRef);
194
+ const handleSelectAllChange = useCallback((e_0) => {
195
+ if (onSelectAllChange) onSelectAllChange(e_0.target.checked);
196
+ }, [onSelectAllChange]);
197
+ function getBodyContent() {
198
+ if (loading && scrollContainerRef.current && loadingType.appearsInBody) return /* @__PURE__ */ jsx(FilteredActionListBodyLoader, {
199
+ loadingType,
200
+ height: scrollContainerRef.current.clientHeight
201
+ });
202
+ if (message) return message;
203
+ let firstGroupIndex_0 = 0;
204
+ const renderListItems = () => {
205
+ if (groupMetadata !== null && groupMetadata !== void 0 && groupMetadata.length) return groupMetadata.map((group, index_1) => {
206
+ var _group$header, _group$header2;
207
+ if (index_1 === firstGroupIndex_0 && getItemListForEachGroup(group.groupId).length === 0) firstGroupIndex_0++;
208
+ return /* @__PURE__ */ jsxs(ActionList.Group, { children: [/* @__PURE__ */ jsx(ActionList.GroupHeading, {
209
+ variant: (_group$header = group.header) !== null && _group$header !== void 0 && _group$header.variant ? group.header.variant : void 0,
210
+ children: (_group$header2 = group.header) !== null && _group$header2 !== void 0 && _group$header2.title ? group.header.title : `Group ${group.groupId}`
211
+ }), getItemListForEachGroup(group.groupId).map(({ key: itemKey, ...item_5 }, itemIndex) => {
212
+ var _ref2, _item_5$id;
213
+ const key = (_ref2 = itemKey !== null && itemKey !== void 0 ? itemKey : (_item_5$id = item_5.id) === null || _item_5$id === void 0 ? void 0 : _item_5$id.toString()) !== null && _ref2 !== void 0 ? _ref2 : itemIndex.toString();
214
+ return /* @__PURE__ */ jsx(MappedActionListItem, {
215
+ className: clsx(FilteredActionList_module_css_default.ActionListItem, "className" in item_5 ? item_5.className : void 0),
216
+ "data-input-focused": isInputFocused ? "" : void 0,
217
+ "data-first-child": index_1 === firstGroupIndex_0 && itemIndex === 0 ? "" : void 0,
218
+ ...item_5,
219
+ renderItem: listProps.renderItem
220
+ }, key);
221
+ })] }, index_1);
222
+ });
223
+ if (isVirtualized && virtualizedItemEntries) return virtualizedItemEntries.map(({ virtualItem: virtualItem_0, item: { key: itemKey_0, ...item_6 }, index: index_2 }) => {
224
+ var _ref3, _item_6$id;
225
+ const key_0 = (_ref3 = itemKey_0 !== null && itemKey_0 !== void 0 ? itemKey_0 : (_item_6$id = item_6.id) === null || _item_6$id === void 0 ? void 0 : _item_6$id.toString()) !== null && _ref3 !== void 0 ? _ref3 : index_2.toString();
226
+ return /* @__PURE__ */ jsx(MappedActionListItem, {
227
+ className: clsx(FilteredActionList_module_css_default.ActionListItem, "className" in item_6 ? item_6.className : void 0),
228
+ "data-input-focused": isInputFocused ? "" : void 0,
229
+ "data-first-child": index_2 === 0 ? "" : void 0,
230
+ "data-index": virtualItem_0.index,
231
+ ref: (node_0) => {
232
+ if (node_0) virtualizer.measureElement(node_0);
233
+ },
234
+ style: {
235
+ position: "absolute",
236
+ top: 0,
237
+ left: 0,
238
+ right: 0,
239
+ transform: `translateY(${virtualItem_0.start}px)`
240
+ },
241
+ ...item_6,
242
+ renderItem: listProps.renderItem
243
+ }, key_0);
244
+ });
245
+ return items.map(({ key: itemKey_1, ...item_7 }, index_3) => {
246
+ var _ref4, _item_7$id;
247
+ const key_1 = (_ref4 = itemKey_1 !== null && itemKey_1 !== void 0 ? itemKey_1 : (_item_7$id = item_7.id) === null || _item_7$id === void 0 ? void 0 : _item_7$id.toString()) !== null && _ref4 !== void 0 ? _ref4 : index_3.toString();
248
+ return /* @__PURE__ */ jsx(MappedActionListItem, {
249
+ className: clsx(FilteredActionList_module_css_default.ActionListItem, "className" in item_7 ? item_7.className : void 0),
250
+ "data-input-focused": isInputFocused ? "" : void 0,
251
+ "data-first-child": index_3 === 0 ? "" : void 0,
252
+ ...item_7,
253
+ renderItem: listProps.renderItem
254
+ }, key_1);
255
+ });
256
+ };
257
+ const actionListContent = /* @__PURE__ */ jsx(ActionList, {
258
+ ref: usingRovingTabindex ? listRef : listContainerRefCallback,
259
+ showDividers: showItemDividers,
260
+ selectionVariant,
261
+ ...listProps,
262
+ ...actionListProps,
263
+ role: "listbox",
264
+ id: listId,
265
+ className: clsx(FilteredActionList_module_css_default.ActionList, actionListProps === null || actionListProps === void 0 ? void 0 : actionListProps.className),
266
+ style: isVirtualized ? {
267
+ ...actionListProps === null || actionListProps === void 0 ? void 0 : actionListProps.style,
268
+ height: virtualizer.getTotalSize(),
269
+ position: "relative"
270
+ } : actionListProps === null || actionListProps === void 0 ? void 0 : actionListProps.style,
271
+ children: renderListItems()
272
+ });
273
+ if (usingRovingTabindex) return /* @__PURE__ */ jsx(ActionListContainerContext.Provider, {
274
+ value: {
275
+ container: "FilteredActionList",
276
+ listRole: "listbox",
277
+ selectionAttribute: "aria-selected",
278
+ selectionVariant,
279
+ enableFocusZone: true
280
+ },
281
+ children: actionListContent
282
+ });
283
+ else return actionListContent;
284
+ }
285
+ const { className: textInputClassName, ...restTextInputProps } = textInputProps || {};
286
+ return /* @__PURE__ */ jsxs("div", {
287
+ ref: inputAndListContainerRef,
288
+ className: clsx(className, FilteredActionList_module_css_default.Root),
289
+ "data-testid": "filtered-action-list",
290
+ "data-component": "FilteredActionList",
291
+ children: [
292
+ /* @__PURE__ */ jsx("div", {
293
+ className: FilteredActionList_module_css_default.Header,
294
+ "data-component": "FilteredActionList.Header",
295
+ children: /* @__PURE__ */ jsx(TextInput_default, {
296
+ ref: inputRef,
297
+ block: true,
298
+ width: "auto",
299
+ color: "fg.default",
300
+ value: filterValue,
301
+ onChange: onInputChange,
302
+ onKeyPress: onInputKeyPress,
303
+ onKeyDown: usingRovingTabindex ? onInputKeyDown : () => {},
304
+ placeholder: placeholderText,
305
+ role: "combobox",
306
+ "aria-expanded": "true",
307
+ "aria-autocomplete": "list",
308
+ "aria-controls": listId,
309
+ "aria-label": placeholderText,
310
+ "aria-describedby": inputDescriptionTextId,
311
+ loaderPosition: "leading",
312
+ loading: loading && !loadingType.appearsInBody,
313
+ className: clsx(textInputClassName, { [FilteredActionList_module_css_default.FullScreenTextInput]: fullScreenOnNarrow }),
314
+ ...restTextInputProps
315
+ })
316
+ }),
317
+ /* @__PURE__ */ jsx(VisuallyHidden, {
318
+ id: inputDescriptionTextId,
319
+ children: "Items will be filtered as you type"
320
+ }),
321
+ onSelectAllChange !== void 0 && /* @__PURE__ */ jsxs("div", {
322
+ className: FilteredActionList_module_css_default.SelectAllContainer,
323
+ "data-component": "FilteredActionList.SelectAll",
324
+ children: [/* @__PURE__ */ jsx(Checkbox, {
325
+ id: "select-all-checkbox",
326
+ className: FilteredActionList_module_css_default.SelectAllCheckbox,
327
+ checked: selectAllChecked,
328
+ indeterminate: selectAllIndeterminate,
329
+ onChange: handleSelectAllChange,
330
+ "data-component": "FilteredActionList.SelectAllCheckbox"
331
+ }), /* @__PURE__ */ jsx("label", {
332
+ className: FilteredActionList_module_css_default.SelectAllLabel,
333
+ htmlFor: "select-all-checkbox",
334
+ "data-component": "FilteredActionList.SelectAllLabel",
335
+ children: selectAllLabelText
336
+ })]
337
+ }),
338
+ /* @__PURE__ */ jsx("div", {
339
+ ref: scrollContainerRef,
340
+ className: FilteredActionList_module_css_default.Container,
341
+ children: getBodyContent()
342
+ })
343
+ ]
344
+ });
444
345
  }
445
346
  FilteredActionList.displayName = "FilteredActionList";
446
- const MappedActionListItem = /*#__PURE__*/forwardRef((item, ref) => {
447
- const $ = c(36);
448
- if (typeof item.renderItem === "function") {
449
- let t0;
450
- if ($[0] !== item) {
451
- t0 = item.renderItem(item);
452
- $[0] = item;
453
- $[1] = t0;
454
- } else {
455
- t0 = $[1];
456
- }
457
- return t0;
458
- }
459
- let LeadingVisual;
460
- let TrailingIcon;
461
- let TrailingVisual;
462
- let children;
463
- let description;
464
- let descriptionVariant;
465
- let id;
466
- let onAction;
467
- let rest;
468
- let text;
469
- let trailingText;
470
- if ($[2] !== item) {
471
- ({
472
- id,
473
- description,
474
- descriptionVariant,
475
- text,
476
- trailingVisual: TrailingVisual,
477
- leadingVisual: LeadingVisual,
478
- trailingText,
479
- trailingIcon: TrailingIcon,
480
- onAction,
481
- children,
482
- ...rest
483
- } = item);
484
- $[2] = item;
485
- $[3] = LeadingVisual;
486
- $[4] = TrailingIcon;
487
- $[5] = TrailingVisual;
488
- $[6] = children;
489
- $[7] = description;
490
- $[8] = descriptionVariant;
491
- $[9] = id;
492
- $[10] = onAction;
493
- $[11] = rest;
494
- $[12] = text;
495
- $[13] = trailingText;
496
- } else {
497
- LeadingVisual = $[3];
498
- TrailingIcon = $[4];
499
- TrailingVisual = $[5];
500
- children = $[6];
501
- description = $[7];
502
- descriptionVariant = $[8];
503
- id = $[9];
504
- onAction = $[10];
505
- rest = $[11];
506
- text = $[12];
507
- trailingText = $[13];
508
- }
509
- let t0;
510
- if ($[14] !== item || $[15] !== onAction) {
511
- t0 = e => {
512
- if (typeof onAction === "function") {
513
- onAction(item, e);
514
- }
515
- };
516
- $[14] = item;
517
- $[15] = onAction;
518
- $[16] = t0;
519
- } else {
520
- t0 = $[16];
521
- }
522
- let t1;
523
- if ($[17] !== LeadingVisual) {
524
- t1 = LeadingVisual ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
525
- children: /*#__PURE__*/jsx(LeadingVisual, {})
526
- }) : null;
527
- $[17] = LeadingVisual;
528
- $[18] = t1;
529
- } else {
530
- t1 = $[18];
531
- }
532
- let t2;
533
- if ($[19] !== description || $[20] !== descriptionVariant) {
534
- t2 = description ? /*#__PURE__*/jsx(ActionList.Description, {
535
- variant: descriptionVariant,
536
- children: description
537
- }) : null;
538
- $[19] = description;
539
- $[20] = descriptionVariant;
540
- $[21] = t2;
541
- } else {
542
- t2 = $[21];
543
- }
544
- let t3;
545
- if ($[22] !== TrailingIcon || $[23] !== TrailingVisual || $[24] !== trailingText) {
546
- t3 = TrailingVisual ? /*#__PURE__*/jsx(ActionList.TrailingVisual, {
547
- children: typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /*#__PURE__*/jsx(TrailingVisual, {}) : TrailingVisual
548
- }) : TrailingIcon || trailingText ? /*#__PURE__*/jsxs(ActionList.TrailingVisual, {
549
- children: [trailingText, TrailingIcon && /*#__PURE__*/jsx(TrailingIcon, {})]
550
- }) : null;
551
- $[22] = TrailingIcon;
552
- $[23] = TrailingVisual;
553
- $[24] = trailingText;
554
- $[25] = t3;
555
- } else {
556
- t3 = $[25];
557
- }
558
- let t4;
559
- if ($[26] !== children || $[27] !== id || $[28] !== ref || $[29] !== rest || $[30] !== t0 || $[31] !== t1 || $[32] !== t2 || $[33] !== t3 || $[34] !== text) {
560
- t4 = /*#__PURE__*/jsxs(ActionList.Item, {
561
- role: "option",
562
- onSelect: t0,
563
- "data-id": id,
564
- ref: ref,
565
- ...rest,
566
- children: [t1, children, text, t2, t3]
567
- });
568
- $[26] = children;
569
- $[27] = id;
570
- $[28] = ref;
571
- $[29] = rest;
572
- $[30] = t0;
573
- $[31] = t1;
574
- $[32] = t2;
575
- $[33] = t3;
576
- $[34] = text;
577
- $[35] = t4;
578
- } else {
579
- t4 = $[35];
580
- }
581
- return t4;
347
+ const MappedActionListItem = /* @__PURE__ */ forwardRef((item, ref) => {
348
+ const $ = c(36);
349
+ if (typeof item.renderItem === "function") {
350
+ let t0;
351
+ if ($[0] !== item) {
352
+ t0 = item.renderItem(item);
353
+ $[0] = item;
354
+ $[1] = t0;
355
+ } else t0 = $[1];
356
+ return t0;
357
+ }
358
+ let LeadingVisual;
359
+ let TrailingIcon;
360
+ let TrailingVisual;
361
+ let children;
362
+ let description;
363
+ let descriptionVariant;
364
+ let id;
365
+ let onAction;
366
+ let rest;
367
+ let text;
368
+ let trailingText;
369
+ if ($[2] !== item) {
370
+ ({id, description, descriptionVariant, text, trailingVisual: TrailingVisual, leadingVisual: LeadingVisual, trailingText, trailingIcon: TrailingIcon, onAction, children, ...rest} = item);
371
+ $[2] = item;
372
+ $[3] = LeadingVisual;
373
+ $[4] = TrailingIcon;
374
+ $[5] = TrailingVisual;
375
+ $[6] = children;
376
+ $[7] = description;
377
+ $[8] = descriptionVariant;
378
+ $[9] = id;
379
+ $[10] = onAction;
380
+ $[11] = rest;
381
+ $[12] = text;
382
+ $[13] = trailingText;
383
+ } else {
384
+ LeadingVisual = $[3];
385
+ TrailingIcon = $[4];
386
+ TrailingVisual = $[5];
387
+ children = $[6];
388
+ description = $[7];
389
+ descriptionVariant = $[8];
390
+ id = $[9];
391
+ onAction = $[10];
392
+ rest = $[11];
393
+ text = $[12];
394
+ trailingText = $[13];
395
+ }
396
+ let t0;
397
+ if ($[14] !== item || $[15] !== onAction) {
398
+ t0 = (e) => {
399
+ if (typeof onAction === "function") onAction(item, e);
400
+ };
401
+ $[14] = item;
402
+ $[15] = onAction;
403
+ $[16] = t0;
404
+ } else t0 = $[16];
405
+ let t1;
406
+ if ($[17] !== LeadingVisual) {
407
+ t1 = LeadingVisual ? /* @__PURE__ */ jsx(ActionList.LeadingVisual, { children: /* @__PURE__ */ jsx(LeadingVisual, {}) }) : null;
408
+ $[17] = LeadingVisual;
409
+ $[18] = t1;
410
+ } else t1 = $[18];
411
+ let t2;
412
+ if ($[19] !== description || $[20] !== descriptionVariant) {
413
+ t2 = description ? /* @__PURE__ */ jsx(ActionList.Description, {
414
+ variant: descriptionVariant,
415
+ children: description
416
+ }) : null;
417
+ $[19] = description;
418
+ $[20] = descriptionVariant;
419
+ $[21] = t2;
420
+ } else t2 = $[21];
421
+ let t3;
422
+ if ($[22] !== TrailingIcon || $[23] !== TrailingVisual || $[24] !== trailingText) {
423
+ t3 = TrailingVisual ? /* @__PURE__ */ jsx(ActionList.TrailingVisual, { children: typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /* @__PURE__ */ jsx(TrailingVisual, {}) : TrailingVisual }) : TrailingIcon || trailingText ? /* @__PURE__ */ jsxs(ActionList.TrailingVisual, { children: [trailingText, TrailingIcon && /* @__PURE__ */ jsx(TrailingIcon, {})] }) : null;
424
+ $[22] = TrailingIcon;
425
+ $[23] = TrailingVisual;
426
+ $[24] = trailingText;
427
+ $[25] = t3;
428
+ } else t3 = $[25];
429
+ let t4;
430
+ if ($[26] !== children || $[27] !== id || $[28] !== ref || $[29] !== rest || $[30] !== t0 || $[31] !== t1 || $[32] !== t2 || $[33] !== t3 || $[34] !== text) {
431
+ t4 = /* @__PURE__ */ jsxs(ActionList.Item, {
432
+ role: "option",
433
+ onSelect: t0,
434
+ "data-id": id,
435
+ ref,
436
+ ...rest,
437
+ children: [
438
+ t1,
439
+ children,
440
+ text,
441
+ t2,
442
+ t3
443
+ ]
444
+ });
445
+ $[26] = children;
446
+ $[27] = id;
447
+ $[28] = ref;
448
+ $[29] = rest;
449
+ $[30] = t0;
450
+ $[31] = t1;
451
+ $[32] = t2;
452
+ $[33] = t3;
453
+ $[34] = text;
454
+ $[35] = t4;
455
+ } else t4 = $[35];
456
+ return t4;
582
457
  });
583
- FilteredActionList.displayName = 'FilteredActionList';
584
-
458
+ FilteredActionList.displayName = "FilteredActionList";
459
+ //#endregion
585
460
  export { FilteredActionList };