@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,823 +1,680 @@
1
- import { c } from 'react-compiler-runtime';
2
- import React from 'react';
3
- import { useId } from '../hooks/useId.js';
4
- import { useSlots } from '../hooks/useSlots.js';
5
- import { ActionListContainerContext } from './ActionListContainerContext.js';
6
- import { Description } from './Description.js';
7
- import { GroupContext } from './Group.js';
8
- import { Selection } from './Selection.js';
9
- import { TrailingVisual, LeadingVisual, VisualOrIndicator } from './Visuals.js';
10
- import { ListContext, ItemContext } from './shared.js';
11
- import { TrailingAction } from './TrailingAction.js';
12
- import { ConditionalWrapper } from '../internal/components/ConditionalWrapper.js';
13
- import { invariant } from '../utils/invariant.js';
14
- import VisuallyHidden from '../_VisuallyHidden.js';
15
- import classes from './ActionList.module.css.js';
16
- import { clsx } from 'clsx';
17
- import { fixedForwardRef } from '../utils/modern-polymorphic.js';
18
- import { TooltipContext, Tooltip } from '../TooltipV2/Tooltip.js';
19
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
20
-
1
+ import { useId as useId$1 } from "../hooks/useId.js";
2
+ import { ConditionalWrapper } from "../internal/components/ConditionalWrapper.js";
3
+ import { invariant } from "../utils/invariant.js";
4
+ import { fixedForwardRef } from "../utils/modern-polymorphic.js";
5
+ import VisuallyHidden from "../_VisuallyHidden.js";
6
+ import { Tooltip, TooltipContext } from "../TooltipV2/Tooltip.js";
7
+ import { useSlots } from "../hooks/useSlots.js";
8
+ import { ActionListContainerContext } from "./ActionListContainerContext.js";
9
+ import { ItemContext, ListContext } from "./shared.js";
10
+ import ActionList_module_css_default from "./ActionList.module.css.js";
11
+ import { GroupContext } from "./Group.js";
12
+ import { Description } from "./Description.js";
13
+ import { LeadingVisual, TrailingVisual, VisualOrIndicator } from "./Visuals.js";
14
+ import { Selection } from "./Selection.js";
15
+ import { TrailingAction } from "./TrailingAction.js";
16
+ import { c } from "react-compiler-runtime";
17
+ import { clsx } from "clsx";
18
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
19
+ import React from "react";
20
+ //#region src/ActionList/Item.tsx
21
21
  /**
22
- * Wraps button-semantic items with Tooltip, disabled when not truncated
23
- * For non-button-semantic items, renders children directly.
24
- */
25
- const ConditionalTooltip = /*#__PURE__*/React.forwardRef(function ConditionalTooltip(t0, forwardedRef) {
26
- const $ = c(4);
27
- const {
28
- text,
29
- enabled,
30
- children
31
- } = t0;
32
- if (!enabled || !text) {
33
- return children;
34
- }
35
- const t1 = text || "";
36
- let t2;
37
- if ($[0] !== children || $[1] !== forwardedRef || $[2] !== t1) {
38
- t2 = /*#__PURE__*/jsx(Tooltip, {
39
- ref: forwardedRef,
40
- text: t1,
41
- direction: "e",
42
- delay: "medium",
43
- children: children
44
- });
45
- $[0] = children;
46
- $[1] = forwardedRef;
47
- $[2] = t1;
48
- $[3] = t2;
49
- } else {
50
- t2 = $[3];
51
- }
52
- return t2;
22
+ * Wraps button-semantic items with Tooltip, disabled when not truncated
23
+ * For non-button-semantic items, renders children directly.
24
+ */
25
+ const ConditionalTooltip = /* @__PURE__ */ React.forwardRef(function ConditionalTooltip(t0, forwardedRef) {
26
+ const $ = c(4);
27
+ const { text, enabled, children } = t0;
28
+ if (!enabled || !text) return children;
29
+ const t1 = text || "";
30
+ let t2;
31
+ if ($[0] !== children || $[1] !== forwardedRef || $[2] !== t1) {
32
+ t2 = /* @__PURE__ */ jsx(Tooltip, {
33
+ ref: forwardedRef,
34
+ text: t1,
35
+ direction: "e",
36
+ delay: "medium",
37
+ children
38
+ });
39
+ $[0] = children;
40
+ $[1] = forwardedRef;
41
+ $[2] = t1;
42
+ $[3] = t2;
43
+ } else t2 = $[3];
44
+ return t2;
53
45
  });
54
- const SubItem = t0 => {
55
- const $ = c(2);
56
- const {
57
- children
58
- } = t0;
59
- let t1;
60
- if ($[0] !== children) {
61
- t1 = /*#__PURE__*/jsx(Fragment, {
62
- children: children
63
- });
64
- $[0] = children;
65
- $[1] = t1;
66
- } else {
67
- t1 = $[1];
68
- }
69
- return t1;
46
+ const SubItem = (t0) => {
47
+ const $ = c(2);
48
+ const { children } = t0;
49
+ let t1;
50
+ if ($[0] !== children) {
51
+ t1 = /* @__PURE__ */ jsx(Fragment, { children });
52
+ $[0] = children;
53
+ $[1] = t1;
54
+ } else t1 = $[1];
55
+ return t1;
70
56
  };
71
- SubItem.displayName = 'ActionList.SubItem';
72
- const ButtonItemContainer = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
73
- const $ = c(9);
74
- let children;
75
- let props;
76
- let style;
77
- if ($[0] !== t0) {
78
- ({
79
- children,
80
- style,
81
- ...props
82
- } = t0);
83
- $[0] = t0;
84
- $[1] = children;
85
- $[2] = props;
86
- $[3] = style;
87
- } else {
88
- children = $[1];
89
- props = $[2];
90
- style = $[3];
91
- }
92
- const t1 = forwardedRef;
93
- let t2;
94
- if ($[4] !== children || $[5] !== props || $[6] !== style || $[7] !== t1) {
95
- t2 = /*#__PURE__*/jsx("button", {
96
- type: "button",
97
- ref: t1,
98
- style: style,
99
- ...props,
100
- children: children
101
- });
102
- $[4] = children;
103
- $[5] = props;
104
- $[6] = style;
105
- $[7] = t1;
106
- $[8] = t2;
107
- } else {
108
- t2 = $[8];
109
- }
110
- return t2;
57
+ SubItem.displayName = "ActionList.SubItem";
58
+ const ButtonItemContainer = /* @__PURE__ */ React.forwardRef((t0, forwardedRef) => {
59
+ const $ = c(9);
60
+ let children;
61
+ let props;
62
+ let style;
63
+ if ($[0] !== t0) {
64
+ ({children, style, ...props} = t0);
65
+ $[0] = t0;
66
+ $[1] = children;
67
+ $[2] = props;
68
+ $[3] = style;
69
+ } else {
70
+ children = $[1];
71
+ props = $[2];
72
+ style = $[3];
73
+ }
74
+ const t1 = forwardedRef;
75
+ let t2;
76
+ if ($[4] !== children || $[5] !== props || $[6] !== style || $[7] !== t1) {
77
+ t2 = /* @__PURE__ */ jsx("button", {
78
+ type: "button",
79
+ ref: t1,
80
+ style,
81
+ ...props,
82
+ children
83
+ });
84
+ $[4] = children;
85
+ $[5] = props;
86
+ $[6] = style;
87
+ $[7] = t1;
88
+ $[8] = t2;
89
+ } else t2 = $[8];
90
+ return t2;
111
91
  });
112
- const DivItemContainer = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
113
- const $ = c(7);
114
- let children;
115
- let props;
116
- if ($[0] !== t0) {
117
- ({
118
- children,
119
- ...props
120
- } = t0);
121
- $[0] = t0;
122
- $[1] = children;
123
- $[2] = props;
124
- } else {
125
- children = $[1];
126
- props = $[2];
127
- }
128
- const t1 = forwardedRef;
129
- let t2;
130
- if ($[3] !== children || $[4] !== props || $[5] !== t1) {
131
- t2 = /*#__PURE__*/jsx("div", {
132
- ref: t1,
133
- ...props,
134
- children: children
135
- });
136
- $[3] = children;
137
- $[4] = props;
138
- $[5] = t1;
139
- $[6] = t2;
140
- } else {
141
- t2 = $[6];
142
- }
143
- return t2;
92
+ const DivItemContainer = /* @__PURE__ */ React.forwardRef((t0, forwardedRef) => {
93
+ const $ = c(7);
94
+ let children;
95
+ let props;
96
+ if ($[0] !== t0) {
97
+ ({children, ...props} = t0);
98
+ $[0] = t0;
99
+ $[1] = children;
100
+ $[2] = props;
101
+ } else {
102
+ children = $[1];
103
+ props = $[2];
104
+ }
105
+ const t1 = forwardedRef;
106
+ let t2;
107
+ if ($[3] !== children || $[4] !== props || $[5] !== t1) {
108
+ t2 = /* @__PURE__ */ jsx("div", {
109
+ ref: t1,
110
+ ...props,
111
+ children
112
+ });
113
+ $[3] = children;
114
+ $[4] = props;
115
+ $[5] = t1;
116
+ $[6] = t2;
117
+ } else t2 = $[6];
118
+ return t2;
144
119
  });
145
- const baseSlots = {
146
- leadingVisual: LeadingVisual,
147
- trailingVisual: TrailingVisual,
148
- trailingAction: TrailingAction,
149
- subItem: SubItem
150
- };
151
120
  const slotsConfig = {
152
- ...baseSlots,
153
- description: Description
121
+ leadingVisual: LeadingVisual,
122
+ trailingVisual: TrailingVisual,
123
+ trailingAction: TrailingAction,
124
+ subItem: SubItem,
125
+ description: Description
154
126
  };
155
-
156
- // Pre-allocated array for selectableRoles check, avoids per-render allocation
157
- const selectableRoles = ['menuitemradio', 'menuitemcheckbox', 'option'];
158
- const listRoleTypes = ['listbox', 'menu', 'list'];
127
+ const selectableRoles = [
128
+ "menuitemradio",
129
+ "menuitemcheckbox",
130
+ "option"
131
+ ];
132
+ const listRoleTypes = [
133
+ "listbox",
134
+ "menu",
135
+ "list"
136
+ ];
159
137
  const UnwrappedItem = (t0, forwardedRef) => {
160
- var _slots$trailingVisual, _slots$description$pr, _slots$description;
161
- const $ = c(159);
162
- let _PrivateItemWrapper;
163
- let className;
164
- let id;
165
- let inactiveText;
166
- let loading;
167
- let onSelectUser;
168
- let props;
169
- let role;
170
- let t1;
171
- let t2;
172
- let t3;
173
- let t4;
174
- let t5;
175
- if ($[0] !== t0) {
176
- const {
177
- variant: t6,
178
- size: t7,
179
- disabled: t8,
180
- inactiveText: t9,
181
- selected: t10,
182
- active: t11,
183
- onSelect: t12,
184
- id: t13,
185
- role: t14,
186
- loading: t15,
187
- _PrivateItemWrapper: t16,
188
- className: t17,
189
- groupId: _groupId,
190
- renderItem: _renderItem,
191
- handleAddItem: _handleAddItem,
192
- ...t18
193
- } = t0;
194
- t1 = t6;
195
- t2 = t7;
196
- t3 = t8;
197
- inactiveText = t9;
198
- t4 = t10;
199
- t5 = t11;
200
- onSelectUser = t12;
201
- id = t13;
202
- role = t14;
203
- loading = t15;
204
- _PrivateItemWrapper = t16;
205
- className = t17;
206
- props = t18;
207
- $[0] = t0;
208
- $[1] = _PrivateItemWrapper;
209
- $[2] = className;
210
- $[3] = id;
211
- $[4] = inactiveText;
212
- $[5] = loading;
213
- $[6] = onSelectUser;
214
- $[7] = props;
215
- $[8] = role;
216
- $[9] = t1;
217
- $[10] = t2;
218
- $[11] = t3;
219
- $[12] = t4;
220
- $[13] = t5;
221
- } else {
222
- _PrivateItemWrapper = $[1];
223
- className = $[2];
224
- id = $[3];
225
- inactiveText = $[4];
226
- loading = $[5];
227
- onSelectUser = $[6];
228
- props = $[7];
229
- role = $[8];
230
- t1 = $[9];
231
- t2 = $[10];
232
- t3 = $[11];
233
- t4 = $[12];
234
- t5 = $[13];
235
- }
236
- const variant = t1 === undefined ? "default" : t1;
237
- const size = t2 === undefined ? "medium" : t2;
238
- const disabled = t3 === undefined ? false : t3;
239
- const selected = t4 === undefined ? undefined : t4;
240
- const active = t5 === undefined ? false : t5;
241
- const [partialSlots, childrenWithoutSlots] = useSlots(props.children, slotsConfig);
242
- let t6;
243
- if ($[14] !== partialSlots) {
244
- t6 = {
245
- description: undefined,
246
- ...partialSlots
247
- };
248
- $[14] = partialSlots;
249
- $[15] = t6;
250
- } else {
251
- t6 = $[15];
252
- }
253
- const slots = t6;
254
- const {
255
- container,
256
- afterSelect,
257
- selectionAttribute,
258
- defaultTrailingVisual
259
- } = React.useContext(ActionListContainerContext);
260
- let t7;
261
- if ($[16] !== defaultTrailingVisual) {
262
- t7 = defaultTrailingVisual ? /*#__PURE__*/jsx(TrailingVisual, {
263
- children: defaultTrailingVisual
264
- }) : null;
265
- $[16] = defaultTrailingVisual;
266
- $[17] = t7;
267
- } else {
268
- t7 = $[17];
269
- }
270
- const wrappedDefaultTrailingVisual = t7;
271
- const trailingVisual = (_slots$trailingVisual = slots.trailingVisual) !== null && _slots$trailingVisual !== void 0 ? _slots$trailingVisual : wrappedDefaultTrailingVisual;
272
- const {
273
- role: listRole,
274
- selectionVariant: listSelectionVariant
275
- } = React.useContext(ListContext);
276
- const {
277
- selectionVariant: groupSelectionVariant
278
- } = React.useContext(GroupContext);
279
- const inactive = Boolean(inactiveText);
280
- const menuContext = container === "ActionMenu" || container === "SelectPanel" || container === "FilteredActionList";
281
- let t8;
282
- if ($[18] !== inactive || $[19] !== listRole) {
283
- t8 = inactive && !(listRole !== undefined && ["menu", "listbox"].includes(listRole));
284
- $[18] = inactive;
285
- $[19] = listRole;
286
- $[20] = t8;
287
- } else {
288
- t8 = $[20];
289
- }
290
- const showInactiveIndicator = t8;
291
- let t9;
292
- if ($[21] !== onSelectUser) {
293
- t9 = (event, afterSelect_0) => {
294
- if (typeof onSelectUser === "function") {
295
- onSelectUser(event);
296
- }
297
- if (event.defaultPrevented) {
298
- return;
299
- }
300
- if (typeof afterSelect_0 === "function") {
301
- afterSelect_0(event);
302
- }
303
- };
304
- $[21] = onSelectUser;
305
- $[22] = t9;
306
- } else {
307
- t9 = $[22];
308
- }
309
- const onSelect = t9;
310
- const selectionVariant = groupSelectionVariant ? groupSelectionVariant : listSelectionVariant;
311
- let inferredItemRole;
312
- if (container === "ActionMenu") {
313
- if (selectionVariant === "single") {
314
- inferredItemRole = "menuitemradio";
315
- } else {
316
- if (selectionVariant === "multiple") {
317
- inferredItemRole = "menuitemcheckbox";
318
- } else {
319
- inferredItemRole = "menuitem";
320
- }
321
- }
322
- } else {
323
- if (listRole === "listbox") {
324
- if (selectionVariant !== undefined && !role) {
325
- inferredItemRole = "option";
326
- }
327
- } else {
328
- if (listRole === "tablist") {
329
- inferredItemRole = "tab";
330
- }
331
- }
332
- }
333
- const itemRole = role || inferredItemRole;
334
- if (slots.trailingAction) {
335
- !!menuContext ? process.env.NODE_ENV !== "production" ? invariant(false, "ActionList.TrailingAction can not be used within a list with an ARIA role of \"menu\" or \"listbox\".") : invariant(false) : void 0;
336
- }
337
- let inferredSelectionAttribute;
338
- if (itemRole === "menuitemradio" || itemRole === "menuitemcheckbox") {
339
- inferredSelectionAttribute = "aria-checked";
340
- } else {
341
- if (itemRole === "option") {
342
- inferredSelectionAttribute = "aria-selected";
343
- }
344
- }
345
- const itemSelectionAttribute = selectionAttribute || inferredSelectionAttribute;
346
- const listItemSemantics = itemRole === "option" || itemRole === "menuitem" || itemRole === "menuitemradio" || itemRole === "menuitemcheckbox" || itemRole === "tab";
347
- let t10;
348
- if ($[23] !== inactive || $[24] !== listItemSemantics || $[25] !== listRole) {
349
- t10 = listRole && listRoleTypes.includes(listRole) || inactive || listItemSemantics;
350
- $[23] = inactive;
351
- $[24] = listItemSemantics;
352
- $[25] = listRole;
353
- $[26] = t10;
354
- } else {
355
- t10 = $[26];
356
- }
357
- const listSemantics = t10;
358
- const buttonSemantics = !listSemantics && !_PrivateItemWrapper;
359
- let t11;
360
- if ($[27] !== afterSelect || $[28] !== disabled || $[29] !== inactive || $[30] !== loading || $[31] !== onSelect) {
361
- t11 = event_0 => {
362
- if (disabled || inactive || loading) {
363
- return;
364
- }
365
- onSelect(event_0, afterSelect);
366
- };
367
- $[27] = afterSelect;
368
- $[28] = disabled;
369
- $[29] = inactive;
370
- $[30] = loading;
371
- $[31] = onSelect;
372
- $[32] = t11;
373
- } else {
374
- t11 = $[32];
375
- }
376
- const clickHandler = t11;
377
- let t12;
378
- if ($[33] !== afterSelect || $[34] !== disabled || $[35] !== inactive || $[36] !== loading || $[37] !== onSelect) {
379
- t12 = event_1 => {
380
- if (disabled || inactive || loading) {
381
- return;
382
- }
383
- if (event_1.key === " " || event_1.key === "Enter") {
384
- if (event_1.key === " ") {
385
- event_1.preventDefault();
386
- event_1.defaultPrevented = false;
387
- }
388
- onSelect(event_1, afterSelect);
389
- }
390
- };
391
- $[33] = afterSelect;
392
- $[34] = disabled;
393
- $[35] = inactive;
394
- $[36] = loading;
395
- $[37] = onSelect;
396
- $[38] = t12;
397
- } else {
398
- t12 = $[38];
399
- }
400
- const keyPressHandler = t12;
401
- const itemId = useId(id);
402
- const labelId = `${itemId}--label`;
403
- const inlineDescriptionId = `${itemId}--inline-description`;
404
- const blockDescriptionId = `${itemId}--block-description`;
405
- const trailingVisualId = `${itemId}--trailing-visual`;
406
- const inactiveWarningId = inactive && !showInactiveIndicator ? `${itemId}--warning-message` : undefined;
407
- const [truncatedText, setTruncatedText] = React.useState(undefined);
408
- const DefaultItemWrapper = listSemantics ? DivItemContainer : ButtonItemContainer;
409
- const ItemWrapper = _PrivateItemWrapper || DefaultItemWrapper;
410
- let t13;
411
- if ($[39] !== itemRole || $[40] !== itemSelectionAttribute) {
412
- t13 = itemSelectionAttribute && itemRole && selectableRoles.includes(itemRole);
413
- $[39] = itemRole;
414
- $[40] = itemSelectionAttribute;
415
- $[41] = t13;
416
- } else {
417
- t13 = $[41];
418
- }
419
- const includeSelectionAttribute = t13;
420
- const focusable = showInactiveIndicator ? true : undefined;
421
- const descriptionVariant = (_slots$description$pr = (_slots$description = slots.description) === null || _slots$description === void 0 ? void 0 : _slots$description.props.variant) !== null && _slots$description$pr !== void 0 ? _slots$description$pr : "inline";
422
- const hasTrailingVisualSlot = Boolean(slots.trailingVisual);
423
- const hasDescriptionSlot = Boolean(slots.description);
424
- let parts;
425
- if ($[42] !== hasTrailingVisualSlot || $[43] !== labelId || $[44] !== trailingVisualId) {
426
- parts = [labelId];
427
- if (hasTrailingVisualSlot) {
428
- parts.push(trailingVisualId);
429
- }
430
- $[42] = hasTrailingVisualSlot;
431
- $[43] = labelId;
432
- $[44] = trailingVisualId;
433
- $[45] = parts;
434
- } else {
435
- parts = $[45];
436
- }
437
- const ariaLabelledBy = parts.join(" ");
438
- let parts_0;
439
- if ($[46] !== blockDescriptionId || $[47] !== descriptionVariant || $[48] !== hasDescriptionSlot || $[49] !== inactiveWarningId || $[50] !== inlineDescriptionId) {
440
- parts_0 = [];
441
- if (hasDescriptionSlot && descriptionVariant === "block") {
442
- parts_0.push(blockDescriptionId);
443
- }
444
- if (hasDescriptionSlot && descriptionVariant === "inline") {
445
- parts_0.push(inlineDescriptionId);
446
- }
447
- if (inactiveWarningId) {
448
- parts_0.push(inactiveWarningId);
449
- }
450
- $[46] = blockDescriptionId;
451
- $[47] = descriptionVariant;
452
- $[48] = hasDescriptionSlot;
453
- $[49] = inactiveWarningId;
454
- $[50] = inlineDescriptionId;
455
- $[51] = parts_0;
456
- } else {
457
- parts_0 = $[51];
458
- }
459
- const ariaDescribedBy = parts_0.length > 0 ? parts_0.join(" ") : undefined;
460
- const t14 = !buttonSemantics ? keyPressHandler : undefined;
461
- const t15 = disabled ? true : undefined;
462
- const t16 = inactive ? true : undefined;
463
- const t17 = loading && !inactive ? true : undefined;
464
- const t18 = focusable ? undefined : 0;
465
- let t19;
466
- if ($[52] !== includeSelectionAttribute || $[53] !== itemSelectionAttribute || $[54] !== selected) {
467
- t19 = includeSelectionAttribute && {
468
- [itemSelectionAttribute]: selected
469
- };
470
- $[52] = includeSelectionAttribute;
471
- $[53] = itemSelectionAttribute;
472
- $[54] = selected;
473
- $[55] = t19;
474
- } else {
475
- t19 = $[55];
476
- }
477
- let t20;
478
- if ($[56] !== ariaDescribedBy || $[57] !== ariaLabelledBy || $[58] !== clickHandler || $[59] !== itemId || $[60] !== itemRole || $[61] !== t14 || $[62] !== t15 || $[63] !== t16 || $[64] !== t17 || $[65] !== t18 || $[66] !== t19) {
479
- t20 = {
480
- onClick: clickHandler,
481
- onKeyPress: t14,
482
- "aria-disabled": t15,
483
- "data-inactive": t16,
484
- "data-loading": t17,
485
- tabIndex: t18,
486
- "aria-labelledby": ariaLabelledBy,
487
- "aria-describedby": ariaDescribedBy,
488
- ...t19,
489
- role: itemRole,
490
- id: itemId
491
- };
492
- $[56] = ariaDescribedBy;
493
- $[57] = ariaLabelledBy;
494
- $[58] = clickHandler;
495
- $[59] = itemId;
496
- $[60] = itemRole;
497
- $[61] = t14;
498
- $[62] = t15;
499
- $[63] = t16;
500
- $[64] = t17;
501
- $[65] = t18;
502
- $[66] = t19;
503
- $[67] = t20;
504
- } else {
505
- t20 = $[67];
506
- }
507
- const menuItemProps = t20;
508
- let t21;
509
- if ($[68] !== _PrivateItemWrapper || $[69] !== forwardedRef || $[70] !== itemRole || $[71] !== listSemantics || $[72] !== menuItemProps || $[73] !== props) {
510
- t21 = _PrivateItemWrapper ? {
511
- role: itemRole ? "none" : undefined,
512
- ...props
513
- } : listSemantics && {
514
- ...menuItemProps,
515
- ...props,
516
- ref: forwardedRef
517
- } || {};
518
- $[68] = _PrivateItemWrapper;
519
- $[69] = forwardedRef;
520
- $[70] = itemRole;
521
- $[71] = listSemantics;
522
- $[72] = menuItemProps;
523
- $[73] = props;
524
- $[74] = t21;
525
- } else {
526
- t21 = $[74];
527
- }
528
- const containerProps = t21;
529
- let t22;
530
- if ($[75] !== _PrivateItemWrapper || $[76] !== forwardedRef || $[77] !== listSemantics || $[78] !== menuItemProps || $[79] !== props) {
531
- t22 = _PrivateItemWrapper ? menuItemProps : !listSemantics && {
532
- ...menuItemProps,
533
- ...props,
534
- ref: forwardedRef
535
- };
536
- $[75] = _PrivateItemWrapper;
537
- $[76] = forwardedRef;
538
- $[77] = listSemantics;
539
- $[78] = menuItemProps;
540
- $[79] = props;
541
- $[80] = t22;
542
- } else {
543
- t22 = $[80];
544
- }
545
- const wrapperProps = t22;
546
- const t23 = Boolean(inactiveText);
547
- const t24 = buttonSemantics ? setTruncatedText : undefined;
548
- let t25;
549
- if ($[81] !== blockDescriptionId || $[82] !== disabled || $[83] !== inlineDescriptionId || $[84] !== size || $[85] !== t23 || $[86] !== t24 || $[87] !== trailingVisualId || $[88] !== variant) {
550
- t25 = {
551
- variant,
552
- size,
553
- disabled,
554
- inactive: t23,
555
- inlineDescriptionId,
556
- blockDescriptionId,
557
- trailingVisualId,
558
- setTruncatedText: t24
559
- };
560
- $[81] = blockDescriptionId;
561
- $[82] = disabled;
562
- $[83] = inlineDescriptionId;
563
- $[84] = size;
564
- $[85] = t23;
565
- $[86] = t24;
566
- $[87] = trailingVisualId;
567
- $[88] = variant;
568
- $[89] = t25;
569
- } else {
570
- t25 = $[89];
571
- }
572
- const itemContextValue = t25;
573
- const t26 = listSemantics ? forwardedRef : null;
574
- const t27 = variant === "danger" ? variant : undefined;
575
- const t28 = active ? true : undefined;
576
- const t29 = inactiveText ? true : undefined;
577
- const t30 = disabled ? true : undefined;
578
- const t31 = slots.subItem ? true : undefined;
579
- const t32 = slots.description ? true : false;
580
- let t33;
581
- if ($[90] !== className) {
582
- t33 = clsx(classes.ActionListItem, className);
583
- $[90] = className;
584
- $[91] = t33;
585
- } else {
586
- t33 = $[91];
587
- }
588
- let t34;
589
- let t35;
590
- if ($[92] === Symbol.for("react.memo_cache_sentinel")) {
591
- t34 = {};
592
- t35 = /*#__PURE__*/jsx("span", {
593
- className: classes.Spacer
594
- });
595
- $[92] = t34;
596
- $[93] = t35;
597
- } else {
598
- t34 = $[92];
599
- t35 = $[93];
600
- }
601
- let t36;
602
- if ($[94] !== selected) {
603
- t36 = /*#__PURE__*/jsx(Selection, {
604
- selected: selected,
605
- className: classes.LeadingAction
606
- });
607
- $[94] = selected;
608
- $[95] = t36;
609
- } else {
610
- t36 = $[95];
611
- }
612
- const t37 = showInactiveIndicator ? inactiveText : undefined;
613
- const t38 = Boolean(slots.leadingVisual);
614
- let t39;
615
- if ($[96] !== labelId || $[97] !== loading || $[98] !== slots.leadingVisual || $[99] !== t37 || $[100] !== t38) {
616
- t39 = /*#__PURE__*/jsx(VisualOrIndicator, {
617
- inactiveText: t37,
618
- itemHasLeadingVisual: t38,
619
- labelId: labelId,
620
- loading: loading,
621
- position: "leading",
622
- children: slots.leadingVisual
623
- });
624
- $[96] = labelId;
625
- $[97] = loading;
626
- $[98] = slots.leadingVisual;
627
- $[99] = t37;
628
- $[100] = t38;
629
- $[101] = t39;
630
- } else {
631
- t39 = $[101];
632
- }
633
- const t40 = !!slots.description;
634
- let t41;
635
- if ($[102] !== inactive || $[103] !== loading) {
636
- t41 = loading === true && !inactive && /*#__PURE__*/jsx(VisuallyHidden, {
637
- children: "Loading"
638
- });
639
- $[102] = inactive;
640
- $[103] = loading;
641
- $[104] = t41;
642
- } else {
643
- t41 = $[104];
644
- }
645
- let t42;
646
- if ($[105] !== childrenWithoutSlots || $[106] !== labelId || $[107] !== t41) {
647
- t42 = /*#__PURE__*/jsxs("span", {
648
- id: labelId,
649
- className: classes.ItemLabel,
650
- "data-component": "ActionList.Item.Label",
651
- children: [childrenWithoutSlots, t41]
652
- });
653
- $[105] = childrenWithoutSlots;
654
- $[106] = labelId;
655
- $[107] = t41;
656
- $[108] = t42;
657
- } else {
658
- t42 = $[108];
659
- }
660
- let t43;
661
- if ($[109] !== descriptionVariant || $[110] !== slots.description || $[111] !== t40 || $[112] !== t42) {
662
- t43 = /*#__PURE__*/jsxs(ConditionalWrapper, {
663
- if: t40,
664
- className: classes.ItemDescriptionWrap,
665
- "data-description-variant": descriptionVariant,
666
- children: [t42, slots.description]
667
- });
668
- $[109] = descriptionVariant;
669
- $[110] = slots.description;
670
- $[111] = t40;
671
- $[112] = t42;
672
- $[113] = t43;
673
- } else {
674
- t43 = $[113];
675
- }
676
- const t44 = showInactiveIndicator ? inactiveText : undefined;
677
- const t45 = Boolean(slots.leadingVisual);
678
- let t46;
679
- if ($[114] !== labelId || $[115] !== loading || $[116] !== t44 || $[117] !== t45 || $[118] !== trailingVisual) {
680
- t46 = /*#__PURE__*/jsx(VisualOrIndicator, {
681
- inactiveText: t44,
682
- itemHasLeadingVisual: t45,
683
- labelId: labelId,
684
- loading: loading,
685
- position: "trailing",
686
- children: trailingVisual
687
- });
688
- $[114] = labelId;
689
- $[115] = loading;
690
- $[116] = t44;
691
- $[117] = t45;
692
- $[118] = trailingVisual;
693
- $[119] = t46;
694
- } else {
695
- t46 = $[119];
696
- }
697
- let t47;
698
- if ($[120] !== inactiveText || $[121] !== inactiveWarningId || $[122] !== showInactiveIndicator) {
699
- t47 = !showInactiveIndicator && inactiveText ? /*#__PURE__*/jsx("span", {
700
- className: classes.InactiveWarning,
701
- id: inactiveWarningId,
702
- children: inactiveText
703
- }) : null;
704
- $[120] = inactiveText;
705
- $[121] = inactiveWarningId;
706
- $[122] = showInactiveIndicator;
707
- $[123] = t47;
708
- } else {
709
- t47 = $[123];
710
- }
711
- let t48;
712
- if ($[124] !== t43 || $[125] !== t46 || $[126] !== t47) {
713
- t48 = /*#__PURE__*/jsxs("span", {
714
- className: classes.ActionListSubContent,
715
- "data-component": "ActionList.Item--DividerContainer",
716
- children: [t43, t46, t47]
717
- });
718
- $[124] = t43;
719
- $[125] = t46;
720
- $[126] = t47;
721
- $[127] = t48;
722
- } else {
723
- t48 = $[127];
724
- }
725
- let t49;
726
- if ($[128] !== t36 || $[129] !== t39 || $[130] !== t48) {
727
- t49 = /*#__PURE__*/jsxs(TooltipContext.Provider, {
728
- value: t34,
729
- children: [t35, t36, t39, t48]
730
- });
731
- $[128] = t36;
732
- $[129] = t39;
733
- $[130] = t48;
734
- $[131] = t49;
735
- } else {
736
- t49 = $[131];
737
- }
738
- let t50;
739
- if ($[132] !== ItemWrapper || $[133] !== forwardedRef || $[134] !== size || $[135] !== t49 || $[136] !== wrapperProps) {
740
- t50 = /*#__PURE__*/jsx(ItemWrapper, {
741
- ...wrapperProps,
742
- className: classes.ActionListContent,
743
- "data-size": size,
744
- ref: forwardedRef,
745
- children: t49
746
- });
747
- $[132] = ItemWrapper;
748
- $[133] = forwardedRef;
749
- $[134] = size;
750
- $[135] = t49;
751
- $[136] = wrapperProps;
752
- $[137] = t50;
753
- } else {
754
- t50 = $[137];
755
- }
756
- let t51;
757
- if ($[138] !== buttonSemantics || $[139] !== forwardedRef || $[140] !== t50 || $[141] !== truncatedText) {
758
- t51 = /*#__PURE__*/jsx(ConditionalTooltip, {
759
- ref: forwardedRef,
760
- text: truncatedText,
761
- enabled: buttonSemantics,
762
- children: t50
763
- });
764
- $[138] = buttonSemantics;
765
- $[139] = forwardedRef;
766
- $[140] = t50;
767
- $[141] = truncatedText;
768
- $[142] = t51;
769
- } else {
770
- t51 = $[142];
771
- }
772
- const t52 = !inactive && !loading && !menuContext && Boolean(slots.trailingAction) && slots.trailingAction;
773
- let t53;
774
- if ($[143] !== containerProps || $[144] !== slots.subItem || $[145] !== t26 || $[146] !== t27 || $[147] !== t28 || $[148] !== t29 || $[149] !== t30 || $[150] !== t31 || $[151] !== t32 || $[152] !== t33 || $[153] !== t51 || $[154] !== t52) {
775
- t53 = /*#__PURE__*/jsxs("li", {
776
- ...containerProps,
777
- ref: t26,
778
- "data-component": "ActionList.Item",
779
- "data-variant": t27,
780
- "data-active": t28,
781
- "data-inactive": t29,
782
- "data-is-disabled": t30,
783
- "data-has-subitem": t31,
784
- "data-has-description": t32,
785
- className: t33,
786
- children: [t51, t52, slots.subItem]
787
- });
788
- $[143] = containerProps;
789
- $[144] = slots.subItem;
790
- $[145] = t26;
791
- $[146] = t27;
792
- $[147] = t28;
793
- $[148] = t29;
794
- $[149] = t30;
795
- $[150] = t31;
796
- $[151] = t32;
797
- $[152] = t33;
798
- $[153] = t51;
799
- $[154] = t52;
800
- $[155] = t53;
801
- } else {
802
- t53 = $[155];
803
- }
804
- let t54;
805
- if ($[156] !== itemContextValue || $[157] !== t53) {
806
- t54 = /*#__PURE__*/jsx(ItemContext.Provider, {
807
- value: itemContextValue,
808
- children: t53
809
- });
810
- $[156] = itemContextValue;
811
- $[157] = t53;
812
- $[158] = t54;
813
- } else {
814
- t54 = $[158];
815
- }
816
- return t54;
138
+ var _slots$trailingVisual, _slots$description$pr, _slots$description;
139
+ const $ = c(159);
140
+ let _PrivateItemWrapper;
141
+ let className;
142
+ let id;
143
+ let inactiveText;
144
+ let loading;
145
+ let onSelectUser;
146
+ let props;
147
+ let role;
148
+ let t1;
149
+ let t2;
150
+ let t3;
151
+ let t4;
152
+ let t5;
153
+ if ($[0] !== t0) {
154
+ const { variant: t6, size: t7, disabled: t8, inactiveText: t9, selected: t10, active: t11, onSelect: t12, id: t13, role: t14, loading: t15, _PrivateItemWrapper: t16, className: t17, groupId: _groupId, renderItem: _renderItem, handleAddItem: _handleAddItem, ...t18 } = t0;
155
+ t1 = t6;
156
+ t2 = t7;
157
+ t3 = t8;
158
+ inactiveText = t9;
159
+ t4 = t10;
160
+ t5 = t11;
161
+ onSelectUser = t12;
162
+ id = t13;
163
+ role = t14;
164
+ loading = t15;
165
+ _PrivateItemWrapper = t16;
166
+ className = t17;
167
+ props = t18;
168
+ $[0] = t0;
169
+ $[1] = _PrivateItemWrapper;
170
+ $[2] = className;
171
+ $[3] = id;
172
+ $[4] = inactiveText;
173
+ $[5] = loading;
174
+ $[6] = onSelectUser;
175
+ $[7] = props;
176
+ $[8] = role;
177
+ $[9] = t1;
178
+ $[10] = t2;
179
+ $[11] = t3;
180
+ $[12] = t4;
181
+ $[13] = t5;
182
+ } else {
183
+ _PrivateItemWrapper = $[1];
184
+ className = $[2];
185
+ id = $[3];
186
+ inactiveText = $[4];
187
+ loading = $[5];
188
+ onSelectUser = $[6];
189
+ props = $[7];
190
+ role = $[8];
191
+ t1 = $[9];
192
+ t2 = $[10];
193
+ t3 = $[11];
194
+ t4 = $[12];
195
+ t5 = $[13];
196
+ }
197
+ const variant = t1 === void 0 ? "default" : t1;
198
+ const size = t2 === void 0 ? "medium" : t2;
199
+ const disabled = t3 === void 0 ? false : t3;
200
+ const selected = t4 === void 0 ? void 0 : t4;
201
+ const active = t5 === void 0 ? false : t5;
202
+ const [partialSlots, childrenWithoutSlots] = useSlots(props.children, slotsConfig);
203
+ let t6;
204
+ if ($[14] !== partialSlots) {
205
+ t6 = {
206
+ description: void 0,
207
+ ...partialSlots
208
+ };
209
+ $[14] = partialSlots;
210
+ $[15] = t6;
211
+ } else t6 = $[15];
212
+ const slots = t6;
213
+ const { container, afterSelect, selectionAttribute, defaultTrailingVisual } = React.useContext(ActionListContainerContext);
214
+ let t7;
215
+ if ($[16] !== defaultTrailingVisual) {
216
+ t7 = defaultTrailingVisual ? /* @__PURE__ */ jsx(TrailingVisual, { children: defaultTrailingVisual }) : null;
217
+ $[16] = defaultTrailingVisual;
218
+ $[17] = t7;
219
+ } else t7 = $[17];
220
+ const wrappedDefaultTrailingVisual = t7;
221
+ const trailingVisual = (_slots$trailingVisual = slots.trailingVisual) !== null && _slots$trailingVisual !== void 0 ? _slots$trailingVisual : wrappedDefaultTrailingVisual;
222
+ const { role: listRole, selectionVariant: listSelectionVariant } = React.useContext(ListContext);
223
+ const { selectionVariant: groupSelectionVariant } = React.useContext(GroupContext);
224
+ const inactive = Boolean(inactiveText);
225
+ const menuContext = container === "ActionMenu" || container === "SelectPanel" || container === "FilteredActionList";
226
+ let t8;
227
+ if ($[18] !== inactive || $[19] !== listRole) {
228
+ t8 = inactive && !(listRole !== void 0 && ["menu", "listbox"].includes(listRole));
229
+ $[18] = inactive;
230
+ $[19] = listRole;
231
+ $[20] = t8;
232
+ } else t8 = $[20];
233
+ const showInactiveIndicator = t8;
234
+ let t9;
235
+ if ($[21] !== onSelectUser) {
236
+ t9 = (event, afterSelect_0) => {
237
+ if (typeof onSelectUser === "function") onSelectUser(event);
238
+ if (event.defaultPrevented) return;
239
+ if (typeof afterSelect_0 === "function") afterSelect_0(event);
240
+ };
241
+ $[21] = onSelectUser;
242
+ $[22] = t9;
243
+ } else t9 = $[22];
244
+ const onSelect = t9;
245
+ const selectionVariant = groupSelectionVariant ? groupSelectionVariant : listSelectionVariant;
246
+ let inferredItemRole;
247
+ if (container === "ActionMenu") if (selectionVariant === "single") inferredItemRole = "menuitemradio";
248
+ else if (selectionVariant === "multiple") inferredItemRole = "menuitemcheckbox";
249
+ else inferredItemRole = "menuitem";
250
+ else if (listRole === "listbox") {
251
+ if (selectionVariant !== void 0 && !role) inferredItemRole = "option";
252
+ } else if (listRole === "tablist") inferredItemRole = "tab";
253
+ const itemRole = role || inferredItemRole;
254
+ if (slots.trailingAction) menuContext && invariant(false, "ActionList.TrailingAction can not be used within a list with an ARIA role of \"menu\" or \"listbox\".");
255
+ let inferredSelectionAttribute;
256
+ if (itemRole === "menuitemradio" || itemRole === "menuitemcheckbox") inferredSelectionAttribute = "aria-checked";
257
+ else if (itemRole === "option") inferredSelectionAttribute = "aria-selected";
258
+ const itemSelectionAttribute = selectionAttribute || inferredSelectionAttribute;
259
+ const listItemSemantics = itemRole === "option" || itemRole === "menuitem" || itemRole === "menuitemradio" || itemRole === "menuitemcheckbox" || itemRole === "tab";
260
+ let t10;
261
+ if ($[23] !== inactive || $[24] !== listItemSemantics || $[25] !== listRole) {
262
+ t10 = listRole && listRoleTypes.includes(listRole) || inactive || listItemSemantics;
263
+ $[23] = inactive;
264
+ $[24] = listItemSemantics;
265
+ $[25] = listRole;
266
+ $[26] = t10;
267
+ } else t10 = $[26];
268
+ const listSemantics = t10;
269
+ const buttonSemantics = !listSemantics && !_PrivateItemWrapper;
270
+ let t11;
271
+ if ($[27] !== afterSelect || $[28] !== disabled || $[29] !== inactive || $[30] !== loading || $[31] !== onSelect) {
272
+ t11 = (event_0) => {
273
+ if (disabled || inactive || loading) return;
274
+ onSelect(event_0, afterSelect);
275
+ };
276
+ $[27] = afterSelect;
277
+ $[28] = disabled;
278
+ $[29] = inactive;
279
+ $[30] = loading;
280
+ $[31] = onSelect;
281
+ $[32] = t11;
282
+ } else t11 = $[32];
283
+ const clickHandler = t11;
284
+ let t12;
285
+ if ($[33] !== afterSelect || $[34] !== disabled || $[35] !== inactive || $[36] !== loading || $[37] !== onSelect) {
286
+ t12 = (event_1) => {
287
+ if (disabled || inactive || loading) return;
288
+ if (event_1.key === " " || event_1.key === "Enter") {
289
+ if (event_1.key === " ") {
290
+ event_1.preventDefault();
291
+ event_1.defaultPrevented = false;
292
+ }
293
+ onSelect(event_1, afterSelect);
294
+ }
295
+ };
296
+ $[33] = afterSelect;
297
+ $[34] = disabled;
298
+ $[35] = inactive;
299
+ $[36] = loading;
300
+ $[37] = onSelect;
301
+ $[38] = t12;
302
+ } else t12 = $[38];
303
+ const keyPressHandler = t12;
304
+ const itemId = useId$1(id);
305
+ const labelId = `${itemId}--label`;
306
+ const inlineDescriptionId = `${itemId}--inline-description`;
307
+ const blockDescriptionId = `${itemId}--block-description`;
308
+ const trailingVisualId = `${itemId}--trailing-visual`;
309
+ const inactiveWarningId = inactive && !showInactiveIndicator ? `${itemId}--warning-message` : void 0;
310
+ const [truncatedText, setTruncatedText] = React.useState(void 0);
311
+ const ItemWrapper = _PrivateItemWrapper || (listSemantics ? DivItemContainer : ButtonItemContainer);
312
+ let t13;
313
+ if ($[39] !== itemRole || $[40] !== itemSelectionAttribute) {
314
+ t13 = itemSelectionAttribute && itemRole && selectableRoles.includes(itemRole);
315
+ $[39] = itemRole;
316
+ $[40] = itemSelectionAttribute;
317
+ $[41] = t13;
318
+ } else t13 = $[41];
319
+ const includeSelectionAttribute = t13;
320
+ const focusable = showInactiveIndicator ? true : void 0;
321
+ const descriptionVariant = (_slots$description$pr = (_slots$description = slots.description) === null || _slots$description === void 0 ? void 0 : _slots$description.props.variant) !== null && _slots$description$pr !== void 0 ? _slots$description$pr : "inline";
322
+ const hasTrailingVisualSlot = Boolean(slots.trailingVisual);
323
+ const hasDescriptionSlot = Boolean(slots.description);
324
+ let parts;
325
+ if ($[42] !== hasTrailingVisualSlot || $[43] !== labelId || $[44] !== trailingVisualId) {
326
+ parts = [labelId];
327
+ if (hasTrailingVisualSlot) parts.push(trailingVisualId);
328
+ $[42] = hasTrailingVisualSlot;
329
+ $[43] = labelId;
330
+ $[44] = trailingVisualId;
331
+ $[45] = parts;
332
+ } else parts = $[45];
333
+ const ariaLabelledBy = parts.join(" ");
334
+ let parts_0;
335
+ if ($[46] !== blockDescriptionId || $[47] !== descriptionVariant || $[48] !== hasDescriptionSlot || $[49] !== inactiveWarningId || $[50] !== inlineDescriptionId) {
336
+ parts_0 = [];
337
+ if (hasDescriptionSlot && descriptionVariant === "block") parts_0.push(blockDescriptionId);
338
+ if (hasDescriptionSlot && descriptionVariant === "inline") parts_0.push(inlineDescriptionId);
339
+ if (inactiveWarningId) parts_0.push(inactiveWarningId);
340
+ $[46] = blockDescriptionId;
341
+ $[47] = descriptionVariant;
342
+ $[48] = hasDescriptionSlot;
343
+ $[49] = inactiveWarningId;
344
+ $[50] = inlineDescriptionId;
345
+ $[51] = parts_0;
346
+ } else parts_0 = $[51];
347
+ const ariaDescribedBy = parts_0.length > 0 ? parts_0.join(" ") : void 0;
348
+ const t14 = !buttonSemantics ? keyPressHandler : void 0;
349
+ const t15 = disabled ? true : void 0;
350
+ const t16 = inactive ? true : void 0;
351
+ const t17 = loading && !inactive ? true : void 0;
352
+ const t18 = focusable ? void 0 : 0;
353
+ let t19;
354
+ if ($[52] !== includeSelectionAttribute || $[53] !== itemSelectionAttribute || $[54] !== selected) {
355
+ t19 = includeSelectionAttribute && { [itemSelectionAttribute]: selected };
356
+ $[52] = includeSelectionAttribute;
357
+ $[53] = itemSelectionAttribute;
358
+ $[54] = selected;
359
+ $[55] = t19;
360
+ } else t19 = $[55];
361
+ let t20;
362
+ if ($[56] !== ariaDescribedBy || $[57] !== ariaLabelledBy || $[58] !== clickHandler || $[59] !== itemId || $[60] !== itemRole || $[61] !== t14 || $[62] !== t15 || $[63] !== t16 || $[64] !== t17 || $[65] !== t18 || $[66] !== t19) {
363
+ t20 = {
364
+ onClick: clickHandler,
365
+ onKeyPress: t14,
366
+ "aria-disabled": t15,
367
+ "data-inactive": t16,
368
+ "data-loading": t17,
369
+ tabIndex: t18,
370
+ "aria-labelledby": ariaLabelledBy,
371
+ "aria-describedby": ariaDescribedBy,
372
+ ...t19,
373
+ role: itemRole,
374
+ id: itemId
375
+ };
376
+ $[56] = ariaDescribedBy;
377
+ $[57] = ariaLabelledBy;
378
+ $[58] = clickHandler;
379
+ $[59] = itemId;
380
+ $[60] = itemRole;
381
+ $[61] = t14;
382
+ $[62] = t15;
383
+ $[63] = t16;
384
+ $[64] = t17;
385
+ $[65] = t18;
386
+ $[66] = t19;
387
+ $[67] = t20;
388
+ } else t20 = $[67];
389
+ const menuItemProps = t20;
390
+ let t21;
391
+ if ($[68] !== _PrivateItemWrapper || $[69] !== forwardedRef || $[70] !== itemRole || $[71] !== listSemantics || $[72] !== menuItemProps || $[73] !== props) {
392
+ t21 = _PrivateItemWrapper ? {
393
+ role: itemRole ? "none" : void 0,
394
+ ...props
395
+ } : listSemantics && {
396
+ ...menuItemProps,
397
+ ...props,
398
+ ref: forwardedRef
399
+ } || {};
400
+ $[68] = _PrivateItemWrapper;
401
+ $[69] = forwardedRef;
402
+ $[70] = itemRole;
403
+ $[71] = listSemantics;
404
+ $[72] = menuItemProps;
405
+ $[73] = props;
406
+ $[74] = t21;
407
+ } else t21 = $[74];
408
+ const containerProps = t21;
409
+ let t22;
410
+ if ($[75] !== _PrivateItemWrapper || $[76] !== forwardedRef || $[77] !== listSemantics || $[78] !== menuItemProps || $[79] !== props) {
411
+ t22 = _PrivateItemWrapper ? menuItemProps : !listSemantics && {
412
+ ...menuItemProps,
413
+ ...props,
414
+ ref: forwardedRef
415
+ };
416
+ $[75] = _PrivateItemWrapper;
417
+ $[76] = forwardedRef;
418
+ $[77] = listSemantics;
419
+ $[78] = menuItemProps;
420
+ $[79] = props;
421
+ $[80] = t22;
422
+ } else t22 = $[80];
423
+ const wrapperProps = t22;
424
+ const t23 = Boolean(inactiveText);
425
+ const t24 = buttonSemantics ? setTruncatedText : void 0;
426
+ let t25;
427
+ if ($[81] !== blockDescriptionId || $[82] !== disabled || $[83] !== inlineDescriptionId || $[84] !== size || $[85] !== t23 || $[86] !== t24 || $[87] !== trailingVisualId || $[88] !== variant) {
428
+ t25 = {
429
+ variant,
430
+ size,
431
+ disabled,
432
+ inactive: t23,
433
+ inlineDescriptionId,
434
+ blockDescriptionId,
435
+ trailingVisualId,
436
+ setTruncatedText: t24
437
+ };
438
+ $[81] = blockDescriptionId;
439
+ $[82] = disabled;
440
+ $[83] = inlineDescriptionId;
441
+ $[84] = size;
442
+ $[85] = t23;
443
+ $[86] = t24;
444
+ $[87] = trailingVisualId;
445
+ $[88] = variant;
446
+ $[89] = t25;
447
+ } else t25 = $[89];
448
+ const itemContextValue = t25;
449
+ const t26 = listSemantics ? forwardedRef : null;
450
+ const t27 = variant === "danger" ? variant : void 0;
451
+ const t28 = active ? true : void 0;
452
+ const t29 = inactiveText ? true : void 0;
453
+ const t30 = disabled ? true : void 0;
454
+ const t31 = slots.subItem ? true : void 0;
455
+ const t32 = slots.description ? true : false;
456
+ let t33;
457
+ if ($[90] !== className) {
458
+ t33 = clsx(ActionList_module_css_default.ActionListItem, className);
459
+ $[90] = className;
460
+ $[91] = t33;
461
+ } else t33 = $[91];
462
+ let t34;
463
+ let t35;
464
+ if ($[92] === Symbol.for("react.memo_cache_sentinel")) {
465
+ t34 = {};
466
+ t35 = /* @__PURE__ */ jsx("span", { className: ActionList_module_css_default.Spacer });
467
+ $[92] = t34;
468
+ $[93] = t35;
469
+ } else {
470
+ t34 = $[92];
471
+ t35 = $[93];
472
+ }
473
+ let t36;
474
+ if ($[94] !== selected) {
475
+ t36 = /* @__PURE__ */ jsx(Selection, {
476
+ selected,
477
+ className: ActionList_module_css_default.LeadingAction
478
+ });
479
+ $[94] = selected;
480
+ $[95] = t36;
481
+ } else t36 = $[95];
482
+ const t37 = showInactiveIndicator ? inactiveText : void 0;
483
+ const t38 = Boolean(slots.leadingVisual);
484
+ let t39;
485
+ if ($[96] !== labelId || $[97] !== loading || $[98] !== slots.leadingVisual || $[99] !== t37 || $[100] !== t38) {
486
+ t39 = /* @__PURE__ */ jsx(VisualOrIndicator, {
487
+ inactiveText: t37,
488
+ itemHasLeadingVisual: t38,
489
+ labelId,
490
+ loading,
491
+ position: "leading",
492
+ children: slots.leadingVisual
493
+ });
494
+ $[96] = labelId;
495
+ $[97] = loading;
496
+ $[98] = slots.leadingVisual;
497
+ $[99] = t37;
498
+ $[100] = t38;
499
+ $[101] = t39;
500
+ } else t39 = $[101];
501
+ const t40 = !!slots.description;
502
+ let t41;
503
+ if ($[102] !== inactive || $[103] !== loading) {
504
+ t41 = loading === true && !inactive && /* @__PURE__ */ jsx(VisuallyHidden, { children: "Loading" });
505
+ $[102] = inactive;
506
+ $[103] = loading;
507
+ $[104] = t41;
508
+ } else t41 = $[104];
509
+ let t42;
510
+ if ($[105] !== childrenWithoutSlots || $[106] !== labelId || $[107] !== t41) {
511
+ t42 = /* @__PURE__ */ jsxs("span", {
512
+ id: labelId,
513
+ className: ActionList_module_css_default.ItemLabel,
514
+ "data-component": "ActionList.Item.Label",
515
+ children: [childrenWithoutSlots, t41]
516
+ });
517
+ $[105] = childrenWithoutSlots;
518
+ $[106] = labelId;
519
+ $[107] = t41;
520
+ $[108] = t42;
521
+ } else t42 = $[108];
522
+ let t43;
523
+ if ($[109] !== descriptionVariant || $[110] !== slots.description || $[111] !== t40 || $[112] !== t42) {
524
+ t43 = /* @__PURE__ */ jsxs(ConditionalWrapper, {
525
+ if: t40,
526
+ className: ActionList_module_css_default.ItemDescriptionWrap,
527
+ "data-description-variant": descriptionVariant,
528
+ children: [t42, slots.description]
529
+ });
530
+ $[109] = descriptionVariant;
531
+ $[110] = slots.description;
532
+ $[111] = t40;
533
+ $[112] = t42;
534
+ $[113] = t43;
535
+ } else t43 = $[113];
536
+ const t44 = showInactiveIndicator ? inactiveText : void 0;
537
+ const t45 = Boolean(slots.leadingVisual);
538
+ let t46;
539
+ if ($[114] !== labelId || $[115] !== loading || $[116] !== t44 || $[117] !== t45 || $[118] !== trailingVisual) {
540
+ t46 = /* @__PURE__ */ jsx(VisualOrIndicator, {
541
+ inactiveText: t44,
542
+ itemHasLeadingVisual: t45,
543
+ labelId,
544
+ loading,
545
+ position: "trailing",
546
+ children: trailingVisual
547
+ });
548
+ $[114] = labelId;
549
+ $[115] = loading;
550
+ $[116] = t44;
551
+ $[117] = t45;
552
+ $[118] = trailingVisual;
553
+ $[119] = t46;
554
+ } else t46 = $[119];
555
+ let t47;
556
+ if ($[120] !== inactiveText || $[121] !== inactiveWarningId || $[122] !== showInactiveIndicator) {
557
+ t47 = !showInactiveIndicator && inactiveText ? /* @__PURE__ */ jsx("span", {
558
+ className: ActionList_module_css_default.InactiveWarning,
559
+ id: inactiveWarningId,
560
+ children: inactiveText
561
+ }) : null;
562
+ $[120] = inactiveText;
563
+ $[121] = inactiveWarningId;
564
+ $[122] = showInactiveIndicator;
565
+ $[123] = t47;
566
+ } else t47 = $[123];
567
+ let t48;
568
+ if ($[124] !== t43 || $[125] !== t46 || $[126] !== t47) {
569
+ t48 = /* @__PURE__ */ jsxs("span", {
570
+ className: ActionList_module_css_default.ActionListSubContent,
571
+ "data-component": "ActionList.Item--DividerContainer",
572
+ children: [
573
+ t43,
574
+ t46,
575
+ t47
576
+ ]
577
+ });
578
+ $[124] = t43;
579
+ $[125] = t46;
580
+ $[126] = t47;
581
+ $[127] = t48;
582
+ } else t48 = $[127];
583
+ let t49;
584
+ if ($[128] !== t36 || $[129] !== t39 || $[130] !== t48) {
585
+ t49 = /* @__PURE__ */ jsxs(TooltipContext.Provider, {
586
+ value: t34,
587
+ children: [
588
+ t35,
589
+ t36,
590
+ t39,
591
+ t48
592
+ ]
593
+ });
594
+ $[128] = t36;
595
+ $[129] = t39;
596
+ $[130] = t48;
597
+ $[131] = t49;
598
+ } else t49 = $[131];
599
+ let t50;
600
+ if ($[132] !== ItemWrapper || $[133] !== forwardedRef || $[134] !== size || $[135] !== t49 || $[136] !== wrapperProps) {
601
+ t50 = /* @__PURE__ */ jsx(ItemWrapper, {
602
+ ...wrapperProps,
603
+ className: ActionList_module_css_default.ActionListContent,
604
+ "data-size": size,
605
+ ref: forwardedRef,
606
+ children: t49
607
+ });
608
+ $[132] = ItemWrapper;
609
+ $[133] = forwardedRef;
610
+ $[134] = size;
611
+ $[135] = t49;
612
+ $[136] = wrapperProps;
613
+ $[137] = t50;
614
+ } else t50 = $[137];
615
+ let t51;
616
+ if ($[138] !== buttonSemantics || $[139] !== forwardedRef || $[140] !== t50 || $[141] !== truncatedText) {
617
+ t51 = /* @__PURE__ */ jsx(ConditionalTooltip, {
618
+ ref: forwardedRef,
619
+ text: truncatedText,
620
+ enabled: buttonSemantics,
621
+ children: t50
622
+ });
623
+ $[138] = buttonSemantics;
624
+ $[139] = forwardedRef;
625
+ $[140] = t50;
626
+ $[141] = truncatedText;
627
+ $[142] = t51;
628
+ } else t51 = $[142];
629
+ const t52 = !inactive && !loading && !menuContext && Boolean(slots.trailingAction) && slots.trailingAction;
630
+ let t53;
631
+ if ($[143] !== containerProps || $[144] !== slots.subItem || $[145] !== t26 || $[146] !== t27 || $[147] !== t28 || $[148] !== t29 || $[149] !== t30 || $[150] !== t31 || $[151] !== t32 || $[152] !== t33 || $[153] !== t51 || $[154] !== t52) {
632
+ t53 = /* @__PURE__ */ jsxs("li", {
633
+ ...containerProps,
634
+ ref: t26,
635
+ "data-component": "ActionList.Item",
636
+ "data-variant": t27,
637
+ "data-active": t28,
638
+ "data-inactive": t29,
639
+ "data-is-disabled": t30,
640
+ "data-has-subitem": t31,
641
+ "data-has-description": t32,
642
+ className: t33,
643
+ children: [
644
+ t51,
645
+ t52,
646
+ slots.subItem
647
+ ]
648
+ });
649
+ $[143] = containerProps;
650
+ $[144] = slots.subItem;
651
+ $[145] = t26;
652
+ $[146] = t27;
653
+ $[147] = t28;
654
+ $[148] = t29;
655
+ $[149] = t30;
656
+ $[150] = t31;
657
+ $[151] = t32;
658
+ $[152] = t33;
659
+ $[153] = t51;
660
+ $[154] = t52;
661
+ $[155] = t53;
662
+ } else t53 = $[155];
663
+ let t54;
664
+ if ($[156] !== itemContextValue || $[157] !== t53) {
665
+ t54 = /* @__PURE__ */ jsx(ItemContext.Provider, {
666
+ value: itemContextValue,
667
+ children: t53
668
+ });
669
+ $[156] = itemContextValue;
670
+ $[157] = t53;
671
+ $[158] = t54;
672
+ } else t54 = $[158];
673
+ return t54;
817
674
  };
818
675
  const Item = Object.assign(fixedForwardRef(UnwrappedItem), {
819
- displayName: 'ActionList.Item',
820
- __SLOT__: Symbol('ActionList.Item')
676
+ displayName: "ActionList.Item",
677
+ __SLOT__: Symbol("ActionList.Item")
821
678
  });
822
-
679
+ //#endregion
823
680
  export { Item, SubItem };