@primer/react 38.0.0-rc.6 → 38.0.0-rc.8

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 (376) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/ActionBar/ActionBar-3069d5f1.css +2 -0
  3. package/dist/ActionBar/ActionBar-3069d5f1.css.map +1 -0
  4. package/dist/ActionBar/ActionBar.d.ts +21 -1
  5. package/dist/ActionBar/ActionBar.d.ts.map +1 -1
  6. package/dist/ActionBar/ActionBar.js +409 -219
  7. package/dist/ActionBar/ActionBar.module.css.js +1 -1
  8. package/dist/ActionBar/index.d.ts +1 -1
  9. package/dist/ActionList/Description.d.ts +4 -3
  10. package/dist/ActionList/Description.d.ts.map +1 -1
  11. package/dist/ActionList/Description.js +5 -5
  12. package/dist/ActionList/Divider.d.ts +5 -4
  13. package/dist/ActionList/Divider.d.ts.map +1 -1
  14. package/dist/ActionList/Divider.js +6 -7
  15. package/dist/ActionList/Group.d.ts +4 -5
  16. package/dist/ActionList/Group.d.ts.map +1 -1
  17. package/dist/ActionList/Group.js +9 -16
  18. package/dist/ActionList/Heading.d.ts +3 -2
  19. package/dist/ActionList/Heading.d.ts.map +1 -1
  20. package/dist/ActionList/Heading.js +1 -0
  21. package/dist/ActionList/Item.d.ts +5 -2
  22. package/dist/ActionList/Item.d.ts.map +1 -1
  23. package/dist/ActionList/Item.js +4 -8
  24. package/dist/ActionList/LinkItem.d.ts +1 -1
  25. package/dist/ActionList/LinkItem.d.ts.map +1 -1
  26. package/dist/ActionList/LinkItem.js +1 -2
  27. package/dist/ActionList/List.d.ts +1 -1
  28. package/dist/ActionList/List.d.ts.map +1 -1
  29. package/dist/ActionList/List.js +1 -3
  30. package/dist/ActionList/TrailingAction.d.ts +1 -0
  31. package/dist/ActionList/TrailingAction.d.ts.map +1 -1
  32. package/dist/ActionList/TrailingAction.js +3 -0
  33. package/dist/ActionList/Visuals.d.ts +4 -4
  34. package/dist/ActionList/Visuals.d.ts.map +1 -1
  35. package/dist/ActionList/Visuals.js +3 -3
  36. package/dist/ActionList/index.d.ts +12 -9
  37. package/dist/ActionList/index.d.ts.map +1 -1
  38. package/dist/ActionList/shared.d.ts +2 -3
  39. package/dist/ActionList/shared.d.ts.map +1 -1
  40. package/dist/ActionMenu/ActionMenu.d.ts +6 -5
  41. package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
  42. package/dist/ActionMenu/ActionMenu.js +11 -6
  43. package/dist/AnchoredOverlay/AnchoredOverlay.d.ts +1 -1
  44. package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
  45. package/dist/Autocomplete/Autocomplete.d.ts +6 -4
  46. package/dist/Autocomplete/Autocomplete.d.ts.map +1 -1
  47. package/dist/Autocomplete/Autocomplete.js +1 -0
  48. package/dist/Autocomplete/AutocompleteInput.js +1 -0
  49. package/dist/Autocomplete/AutocompleteMenu.d.ts +1 -0
  50. package/dist/Autocomplete/AutocompleteMenu.d.ts.map +1 -1
  51. package/dist/Autocomplete/AutocompleteMenu.js +1 -0
  52. package/dist/Autocomplete/AutocompleteOverlay.d.ts +1 -0
  53. package/dist/Autocomplete/AutocompleteOverlay.d.ts.map +1 -1
  54. package/dist/Autocomplete/AutocompleteOverlay.js +1 -0
  55. package/dist/AvatarStack/AvatarStack.d.ts.map +1 -1
  56. package/dist/AvatarStack/AvatarStack.js +1 -3
  57. package/dist/BranchName/BranchName.d.ts +9 -10
  58. package/dist/BranchName/BranchName.d.ts.map +1 -1
  59. package/dist/BranchName/BranchName.js +1 -8
  60. package/dist/Button/Button.d.ts +1 -5
  61. package/dist/Button/Button.d.ts.map +1 -1
  62. package/dist/Button/Button.js +2 -85
  63. package/dist/Button/{ButtonBase-0a7871f4.css → ButtonBase-4c44bb02.css} +2 -2
  64. package/dist/Button/ButtonBase-4c44bb02.css.map +1 -0
  65. package/dist/Button/ButtonBase.d.ts.map +1 -1
  66. package/dist/Button/ButtonBase.js +8 -93
  67. package/dist/Button/ButtonBase.module.css.js +1 -1
  68. package/dist/Button/IconButton.d.ts.map +1 -1
  69. package/dist/Button/IconButton.js +0 -16
  70. package/dist/Button/LinkButton.d.ts +1 -1
  71. package/dist/Button/LinkButton.d.ts.map +1 -1
  72. package/dist/Button/types.d.ts +1 -3
  73. package/dist/Button/types.d.ts.map +1 -1
  74. package/dist/Checkbox/Checkbox-edc5dc3e.css +2 -0
  75. package/dist/Checkbox/{Checkbox-2aef6693.css.map → Checkbox-edc5dc3e.css.map} +1 -1
  76. package/dist/Checkbox/Checkbox.d.ts +3 -1
  77. package/dist/Checkbox/Checkbox.d.ts.map +1 -1
  78. package/dist/Checkbox/Checkbox.js +1 -0
  79. package/dist/Checkbox/Checkbox.module.css.js +1 -1
  80. package/dist/CheckboxGroup/CheckboxGroup.d.ts +8 -7
  81. package/dist/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
  82. package/dist/CheckboxGroup/CheckboxGroup.js +4 -2
  83. package/dist/ConfirmationDialog/ConfirmationDialog-87ccf595.css +2 -0
  84. package/dist/ConfirmationDialog/ConfirmationDialog-87ccf595.css.map +1 -0
  85. package/dist/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
  86. package/dist/ConfirmationDialog/ConfirmationDialog.js +12 -25
  87. package/dist/ConfirmationDialog/ConfirmationDialog.module.css.js +1 -1
  88. package/dist/DataTable/Table.d.ts +3 -3
  89. package/dist/DataTable/Table.d.ts.map +1 -1
  90. package/dist/DataTable/Table.js +24 -19
  91. package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
  92. package/dist/FeatureFlags/DefaultFeatureFlags.js +2 -1
  93. package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css +2 -0
  94. package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css.map +1 -0
  95. package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
  96. package/dist/FilteredActionList/FilteredActionList.js +2 -7
  97. package/dist/FilteredActionList/FilteredActionList.module.css.js +2 -2
  98. package/dist/FilteredActionList/types.d.ts +5 -2
  99. package/dist/FilteredActionList/types.d.ts.map +1 -1
  100. package/dist/FormControl/FormControl.d.ts +8 -36
  101. package/dist/FormControl/FormControl.d.ts.map +1 -1
  102. package/dist/FormControl/FormControl.js +64 -66
  103. package/dist/FormControl/FormControlCaption.d.ts +6 -4
  104. package/dist/FormControl/FormControlCaption.d.ts.map +1 -1
  105. package/dist/FormControl/FormControlCaption.js +9 -13
  106. package/dist/FormControl/FormControlLabel.d.ts +3 -3
  107. package/dist/FormControl/FormControlLabel.d.ts.map +1 -1
  108. package/dist/FormControl/FormControlLabel.js +25 -31
  109. package/dist/FormControl/FormControlLeadingVisual-e217df71.css +2 -0
  110. package/dist/FormControl/FormControlLeadingVisual-e217df71.css.map +1 -0
  111. package/dist/FormControl/FormControlLeadingVisual.d.ts +2 -2
  112. package/dist/FormControl/FormControlLeadingVisual.d.ts.map +1 -1
  113. package/dist/FormControl/FormControlLeadingVisual.js +10 -17
  114. package/dist/FormControl/FormControlLeadingVisual.module.css.js +5 -0
  115. package/dist/FormControl/_FormControlContext.js +1 -1
  116. package/dist/FormControl/_FormControlValidation.d.ts +3 -3
  117. package/dist/FormControl/_FormControlValidation.d.ts.map +1 -1
  118. package/dist/FormControl/_FormControlValidation.js +7 -9
  119. package/dist/FormControl/index.d.ts +4 -0
  120. package/dist/FormControl/index.d.ts.map +1 -1
  121. package/dist/LabelGroup/LabelGroup-7d19205a.css +2 -0
  122. package/dist/LabelGroup/LabelGroup-7d19205a.css.map +1 -0
  123. package/dist/LabelGroup/LabelGroup.d.ts.map +1 -1
  124. package/dist/LabelGroup/LabelGroup.js +14 -27
  125. package/dist/LabelGroup/LabelGroup.module.css.js +2 -2
  126. package/dist/NavList/NavList.d.ts +3 -3
  127. package/dist/NavList/NavList.d.ts.map +1 -1
  128. package/dist/NavList/NavList.js +3 -2
  129. package/dist/Octicon/Octicon.d.ts +7 -6
  130. package/dist/Octicon/Octicon.d.ts.map +1 -1
  131. package/dist/Octicon/Octicon.js +4 -23
  132. package/dist/Overlay/Overlay.d.ts.map +1 -1
  133. package/dist/Overlay/Overlay.js +63 -85
  134. package/dist/PageHeader/PageHeader.d.ts +3 -3
  135. package/dist/PageHeader/PageHeader.d.ts.map +1 -1
  136. package/dist/PageHeader/PageHeader.js +5 -2
  137. package/dist/PageLayout/{PageLayout-8a294e74.css → PageLayout-a276fa3b.css} +2 -2
  138. package/dist/PageLayout/PageLayout-a276fa3b.css.map +1 -0
  139. package/dist/PageLayout/PageLayout.d.ts +14 -58
  140. package/dist/PageLayout/PageLayout.d.ts.map +1 -1
  141. package/dist/PageLayout/PageLayout.js +216 -245
  142. package/dist/PageLayout/PageLayout.module.css.js +2 -2
  143. package/dist/Pagination/Pagination-16a5b4c6.css +2 -0
  144. package/dist/Pagination/Pagination-16a5b4c6.css.map +1 -0
  145. package/dist/Pagination/Pagination.d.ts.map +1 -1
  146. package/dist/Pagination/Pagination.js +16 -3
  147. package/dist/Pagination/Pagination.module.css.js +1 -1
  148. package/dist/Radio/Radio.d.ts +3 -1
  149. package/dist/Radio/Radio.d.ts.map +1 -1
  150. package/dist/Radio/Radio.js +1 -0
  151. package/dist/RadioGroup/RadioGroup.d.ts +6 -5
  152. package/dist/RadioGroup/RadioGroup.d.ts.map +1 -1
  153. package/dist/RadioGroup/RadioGroup.js +1 -0
  154. package/dist/SegmentedControl/SegmentedControl.d.ts +3 -2
  155. package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  156. package/dist/SegmentedControl/SegmentedControl.js +11 -14
  157. package/dist/SegmentedControl/SegmentedControlButton.d.ts +2 -1
  158. package/dist/SegmentedControl/SegmentedControlButton.d.ts.map +1 -1
  159. package/dist/SegmentedControl/SegmentedControlButton.js +1 -0
  160. package/dist/SegmentedControl/SegmentedControlIconButton.d.ts +2 -1
  161. package/dist/SegmentedControl/SegmentedControlIconButton.d.ts.map +1 -1
  162. package/dist/SegmentedControl/SegmentedControlIconButton.js +1 -0
  163. package/dist/Select/Select.d.ts +1 -0
  164. package/dist/Select/Select.d.ts.map +1 -1
  165. package/dist/Select/Select.js +1 -0
  166. package/dist/SelectPanel/SelectPanel.d.ts +2 -1
  167. package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
  168. package/dist/SelectPanel/SelectPanel.js +1 -0
  169. package/dist/Skeleton/SkeletonBox.d.ts.map +1 -1
  170. package/dist/Skeleton/SkeletonBox.js +26 -20
  171. package/dist/SkeletonAvatar/SkeletonAvatar.d.ts.map +1 -1
  172. package/dist/SkeletonAvatar/SkeletonAvatar.js +53 -62
  173. package/dist/StateLabel/{StateLabel-aaa1d148.css → StateLabel-b586b0bc.css} +2 -2
  174. package/dist/StateLabel/StateLabel-b586b0bc.css.map +1 -0
  175. package/dist/StateLabel/StateLabel.d.ts.map +1 -1
  176. package/dist/StateLabel/StateLabel.js +28 -39
  177. package/dist/StateLabel/StateLabel.module.css.js +1 -1
  178. package/dist/SubNav/SubNav.d.ts +4 -1
  179. package/dist/SubNav/SubNav.d.ts.map +1 -1
  180. package/dist/SubNav/SubNav.js +3 -1
  181. package/dist/Text/Text.d.ts +16 -8
  182. package/dist/Text/Text.d.ts.map +1 -1
  183. package/dist/Text/Text.js +34 -31
  184. package/dist/TextInput/TextInput.d.ts +3 -2
  185. package/dist/TextInput/TextInput.d.ts.map +1 -1
  186. package/dist/TextInput/TextInput.js +2 -3
  187. package/dist/TextInput/index.d.ts +1 -0
  188. package/dist/TextInput/index.d.ts.map +1 -1
  189. package/dist/TextInputWithTokens/TextInputWithTokens.d.ts +3 -1
  190. package/dist/TextInputWithTokens/TextInputWithTokens.d.ts.map +1 -1
  191. package/dist/TextInputWithTokens/TextInputWithTokens.js +205 -211
  192. package/dist/Textarea/Textarea.d.ts +5 -4
  193. package/dist/Textarea/Textarea.d.ts.map +1 -1
  194. package/dist/Textarea/Textarea.js +40 -45
  195. package/dist/ToggleSwitch/{ToggleSwitch-4b23d166.css → ToggleSwitch-d5c8dc81.css} +2 -2
  196. package/dist/ToggleSwitch/ToggleSwitch-d5c8dc81.css.map +1 -0
  197. package/dist/ToggleSwitch/ToggleSwitch.module.css.js +1 -1
  198. package/dist/Token/IssueLabelToken-a5fe569e.css +2 -0
  199. package/dist/Token/IssueLabelToken-a5fe569e.css.map +1 -0
  200. package/dist/Token/IssueLabelToken.d.ts.map +1 -1
  201. package/dist/Token/IssueLabelToken.js +0 -5
  202. package/dist/Token/IssueLabelToken.module.css.js +1 -1
  203. package/dist/Token/TokenBase-57c65c47.css +2 -0
  204. package/dist/Token/TokenBase-57c65c47.css.map +1 -0
  205. package/dist/Token/TokenBase.js +1 -7
  206. package/dist/Token/TokenBase.module.css.js +1 -1
  207. package/dist/Token/_RemoveTokenButton-c205593b.css +2 -0
  208. package/dist/Token/_RemoveTokenButton-c205593b.css.map +1 -0
  209. package/dist/Token/_RemoveTokenButton.d.ts.map +1 -1
  210. package/dist/Token/_RemoveTokenButton.js +3 -4
  211. package/dist/Token/_RemoveTokenButton.module.css.js +1 -1
  212. package/dist/Tooltip/Tooltip-fffa9948.css +2 -0
  213. package/dist/Tooltip/Tooltip-fffa9948.css.map +1 -0
  214. package/dist/Tooltip/Tooltip.d.ts +6 -8
  215. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  216. package/dist/Tooltip/Tooltip.js +44 -118
  217. package/dist/Tooltip/Tooltip.module.css.js +5 -0
  218. package/dist/TooltipV2/Tooltip.d.ts +3 -16
  219. package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
  220. package/dist/TooltipV2/Tooltip.js +1 -0
  221. package/dist/TreeView/TreeView.d.ts +4 -1
  222. package/dist/TreeView/TreeView.d.ts.map +1 -1
  223. package/dist/TreeView/TreeView.js +42 -9
  224. package/dist/Truncate/Truncate.d.ts +2 -2
  225. package/dist/Truncate/Truncate.d.ts.map +1 -1
  226. package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +2 -0
  227. package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +1 -0
  228. package/dist/UnderlineNav/UnderlineNav.d.ts +0 -1
  229. package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
  230. package/dist/UnderlineNav/UnderlineNav.js +45 -17
  231. package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
  232. package/dist/UnderlineNav/UnderlineNavContext.d.ts +0 -2
  233. package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
  234. package/dist/UnderlineNav/UnderlineNavContext.js +0 -1
  235. package/dist/UnderlineNav/styles.d.ts +1 -23
  236. package/dist/UnderlineNav/styles.d.ts.map +1 -1
  237. package/dist/UnderlineNav/styles.js +4 -59
  238. package/dist/constants.js +3 -3
  239. package/dist/deprecated/ActionList/Divider-7c6b656a.css +2 -0
  240. package/dist/deprecated/ActionList/Divider-7c6b656a.css.map +1 -0
  241. package/dist/deprecated/ActionList/Divider.d.ts +1 -2
  242. package/dist/deprecated/ActionList/Divider.d.ts.map +1 -1
  243. package/dist/deprecated/ActionList/Divider.js +6 -12
  244. package/dist/deprecated/ActionList/Divider.module.css.js +5 -0
  245. package/dist/deprecated/ActionList/Group.d.ts +1 -2
  246. package/dist/deprecated/ActionList/Group.d.ts.map +1 -1
  247. package/dist/deprecated/ActionList/Group.js +1 -8
  248. package/dist/deprecated/ActionList/Header-493b1d76.css +2 -0
  249. package/dist/deprecated/ActionList/Header-493b1d76.css.map +1 -0
  250. package/dist/deprecated/ActionList/Header.d.ts +2 -6
  251. package/dist/deprecated/ActionList/Header.d.ts.map +1 -1
  252. package/dist/deprecated/ActionList/Header.js +46 -37
  253. package/dist/deprecated/ActionList/Header.module.css.js +5 -0
  254. package/dist/deprecated/ActionList/Item-cf87f98a.css +3 -0
  255. package/dist/deprecated/ActionList/Item-cf87f98a.css.map +1 -0
  256. package/dist/deprecated/ActionList/Item.d.ts +1 -5
  257. package/dist/deprecated/ActionList/Item.d.ts.map +1 -1
  258. package/dist/deprecated/ActionList/Item.js +182 -271
  259. package/dist/deprecated/ActionList/Item.module.css.js +5 -0
  260. package/dist/deprecated/ActionList/List-1ec9d6d9.css +2 -0
  261. package/dist/deprecated/ActionList/List-1ec9d6d9.css.map +1 -0
  262. package/dist/deprecated/ActionList/List.d.ts +1 -0
  263. package/dist/deprecated/ActionList/List.d.ts.map +1 -1
  264. package/dist/deprecated/ActionList/List.js +92 -82
  265. package/dist/deprecated/ActionList/List.module.css.js +5 -0
  266. package/dist/deprecated/UnderlineNav/UnderlineNav-0c1e0dff.css +2 -0
  267. package/dist/deprecated/UnderlineNav/UnderlineNav-0c1e0dff.css.map +1 -0
  268. package/dist/deprecated/UnderlineNav/UnderlineNav.d.ts +6 -8
  269. package/dist/deprecated/UnderlineNav/UnderlineNav.d.ts.map +1 -1
  270. package/dist/deprecated/UnderlineNav/UnderlineNav.js +90 -49
  271. package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +5 -0
  272. package/dist/experimental/IssueLabel/{IssueLabel-6581d1bd.css → IssueLabel-d9c2c5cf.css} +2 -2
  273. package/dist/experimental/IssueLabel/IssueLabel-d9c2c5cf.css.map +1 -0
  274. package/dist/experimental/IssueLabel/IssueLabel.d.ts.map +1 -1
  275. package/dist/experimental/IssueLabel/IssueLabel.js +52 -70
  276. package/dist/experimental/IssueLabel/IssueLabel.module.css.js +1 -1
  277. package/dist/experimental/IssueLabel/getColorFromHex.d.ts +1 -3
  278. package/dist/experimental/IssueLabel/getColorFromHex.d.ts.map +1 -1
  279. package/dist/experimental/IssueLabel/getColorFromHex.js +58 -26
  280. package/dist/experimental/SelectPanel2/SelectPanel.d.ts +11 -7
  281. package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +1 -1
  282. package/dist/experimental/SelectPanel2/SelectPanel.js +6 -1
  283. package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts +6 -6
  284. package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts.map +1 -1
  285. package/dist/experimental/UnderlinePanels/UnderlinePanels.js +8 -4
  286. package/dist/hooks/useSlots.d.ts.map +1 -1
  287. package/dist/hooks/useSlots.js +3 -2
  288. package/dist/hooks/useSyncedState.js +1 -1
  289. package/dist/index.d.ts +5 -3
  290. package/dist/index.d.ts.map +1 -1
  291. package/dist/index.js +3 -2
  292. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts +6 -7
  293. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts.map +1 -1
  294. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +7 -9
  295. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.d.ts +4 -4
  296. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.d.ts.map +1 -1
  297. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +1 -0
  298. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts +2 -1
  299. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts.map +1 -1
  300. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +1 -0
  301. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts +3 -3
  302. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts.map +1 -1
  303. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +2 -3
  304. package/dist/internal/components/InputLabel.d.ts +2 -3
  305. package/dist/internal/components/InputLabel.d.ts.map +1 -1
  306. package/dist/internal/components/InputLabel.js +29 -36
  307. package/dist/internal/components/InputValidation.d.ts +1 -2
  308. package/dist/internal/components/InputValidation.d.ts.map +1 -1
  309. package/dist/internal/components/TextInputInnerAction.d.ts +16 -2
  310. package/dist/internal/components/TextInputInnerAction.d.ts.map +1 -1
  311. package/dist/internal/components/TextInputInnerAction.js +46 -60
  312. package/dist/internal/components/TextInputWrapper.d.ts +10 -32
  313. package/dist/internal/components/TextInputWrapper.d.ts.map +1 -1
  314. package/dist/internal/components/TextInputWrapper.js +87 -58
  315. package/dist/internal/components/UnstyledTextInput.d.ts +1 -2
  316. package/dist/internal/components/UnstyledTextInput.d.ts.map +1 -1
  317. package/dist/internal/components/UnstyledTextInput.js +1 -3
  318. package/dist/internal/components/ValidationAnimationContainer-04125429.css +2 -0
  319. package/dist/internal/components/ValidationAnimationContainer-04125429.css.map +1 -0
  320. package/dist/internal/components/ValidationAnimationContainer.d.ts.map +1 -1
  321. package/dist/internal/components/ValidationAnimationContainer.js +4 -9
  322. package/dist/internal/components/ValidationAnimationContainer.module.css.js +5 -0
  323. package/dist/utils/form-story-helpers.d.ts.map +1 -1
  324. package/dist/utils/is-slot.d.ts +6 -0
  325. package/dist/utils/is-slot.d.ts.map +1 -0
  326. package/dist/utils/is-slot.js +15 -0
  327. package/dist/utils/polymorphic.d.ts +2 -1
  328. package/dist/utils/polymorphic.d.ts.map +1 -1
  329. package/dist/utils/types/Slots.d.ts +7 -0
  330. package/dist/utils/types/Slots.d.ts.map +1 -0
  331. package/dist/utils/types/index.d.ts +1 -0
  332. package/dist/utils/types/index.d.ts.map +1 -1
  333. package/generated/components.json +110 -120
  334. package/package.json +7 -6
  335. package/dist/ActionBar/ActionBar-e6a5d54e.css +0 -2
  336. package/dist/ActionBar/ActionBar-e6a5d54e.css.map +0 -1
  337. package/dist/Box/Box.js +0 -15
  338. package/dist/Button/ButtonBase-0a7871f4.css.map +0 -1
  339. package/dist/Button/styles.d.ts +0 -431
  340. package/dist/Button/styles.d.ts.map +0 -1
  341. package/dist/Button/styles.js +0 -5
  342. package/dist/Checkbox/Checkbox-2aef6693.css +0 -2
  343. package/dist/ConfirmationDialog/ConfirmationDialog-de0401ff.css +0 -2
  344. package/dist/ConfirmationDialog/ConfirmationDialog-de0401ff.css.map +0 -1
  345. package/dist/FilteredActionList/FilteredActionList-e1eb1b75.css +0 -2
  346. package/dist/FilteredActionList/FilteredActionList-e1eb1b75.css.map +0 -1
  347. package/dist/LabelGroup/LabelGroup-eda75c0f.css +0 -2
  348. package/dist/LabelGroup/LabelGroup-eda75c0f.css.map +0 -1
  349. package/dist/PageLayout/PageLayout-8a294e74.css.map +0 -1
  350. package/dist/Pagination/Pagination-1845feaa.css +0 -2
  351. package/dist/Pagination/Pagination-1845feaa.css.map +0 -1
  352. package/dist/StateLabel/StateLabel-aaa1d148.css.map +0 -1
  353. package/dist/ToggleSwitch/ToggleSwitch-4b23d166.css.map +0 -1
  354. package/dist/Token/IssueLabelToken-0dbbbcdf.css +0 -2
  355. package/dist/Token/IssueLabelToken-0dbbbcdf.css.map +0 -1
  356. package/dist/Token/TokenBase-0386597b.css +0 -2
  357. package/dist/Token/TokenBase-0386597b.css.map +0 -1
  358. package/dist/Token/_RemoveTokenButton-d7f5985b.css +0 -2
  359. package/dist/Token/_RemoveTokenButton-d7f5985b.css.map +0 -1
  360. package/dist/UnderlineNav/UnderlineNav-78db938f.css +0 -2
  361. package/dist/UnderlineNav/UnderlineNav-78db938f.css.map +0 -1
  362. package/dist/experimental/IssueLabel/IssueLabel-6581d1bd.css.map +0 -1
  363. package/dist/internal/components/BoxWithFallback.d.ts +0 -6
  364. package/dist/internal/components/BoxWithFallback.d.ts.map +0 -1
  365. package/dist/internal/components/BoxWithFallback.js +0 -70
  366. package/dist/internal/utils/getGlobalFocusStyles.d.ts +0 -4
  367. package/dist/internal/utils/getGlobalFocusStyles.d.ts.map +0 -1
  368. package/dist/internal/utils/getGlobalFocusStyles.js +0 -7
  369. package/dist/internal/utils/sharedCheckboxAndRadioStyles.d.ts +0 -2
  370. package/dist/internal/utils/sharedCheckboxAndRadioStyles.d.ts.map +0 -1
  371. package/dist/utils/defaultSxProp.d.ts +0 -3
  372. package/dist/utils/defaultSxProp.d.ts.map +0 -1
  373. package/dist/utils/defaultSxProp.js +0 -3
  374. package/dist/utils/includeSystemProps.d.ts +0 -7
  375. package/dist/utils/includeSystemProps.d.ts.map +0 -1
  376. package/dist/utils/includeSystemProps.js +0 -14
@@ -1,5 +1,5 @@
1
1
  import { c } from 'react-compiler-runtime';
2
- import React, { forwardRef, useState, useCallback, useRef } from 'react';
2
+ import React, { forwardRef, useRef, useState, useId } from 'react';
3
3
  import { KebabHorizontalIcon } from '@primer/octicons-react';
4
4
  import { ActionList } from '../ActionList/index.js';
5
5
  import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
@@ -10,14 +10,23 @@ import { IconButton } from '../Button/IconButton.js';
10
10
  import { useFocusZone } from '../hooks/useFocusZone.js';
11
11
  import styles from './ActionBar.module.css.js';
12
12
  import { clsx } from 'clsx';
13
- import { jsx, jsxs } from 'react/jsx-runtime';
13
+ import { jsxs, jsx } from 'react/jsx-runtime';
14
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
14
15
  import { FocusKeys } from '@primer/behaviors';
15
16
  import { ActionMenu } from '../ActionMenu/ActionMenu.js';
16
17
 
17
18
  const ACTIONBAR_ITEM_GAP = 8;
19
+
20
+ /**
21
+ * Registry of descendants to render in the list or menu. To preserve insertion order across updates, children are
22
+ * set to `null` when unregistered rather than fully dropped from the map.
23
+ */
24
+
18
25
  const ActionBarContext = /*#__PURE__*/React.createContext({
19
26
  size: 'medium',
20
- setChildrenWidth: () => null
27
+ registerChild: () => {},
28
+ unregisterChild: () => {},
29
+ isVisibleChild: () => true
21
30
  });
22
31
 
23
32
  /*
@@ -25,17 +34,12 @@ small (28px), medium (32px), large (40px)
25
34
  */
26
35
 
27
36
  const MORE_BTN_WIDTH = 32;
28
- const getValidChildren = children => {
29
- return React.Children.toArray(children).filter(child => {
30
- return /*#__PURE__*/React.isValidElement(child);
31
- });
32
- };
33
- const calculatePossibleItems = (childWidthArray, navWidth, moreMenuWidth = 0) => {
37
+ const calculatePossibleItems = (registryEntries, navWidth, gap, moreMenuWidth = 0) => {
34
38
  const widthToFit = navWidth - moreMenuWidth;
35
- let breakpoint = childWidthArray.length; // assume all items will fit
39
+ let breakpoint = registryEntries.length; // assume all items will fit
36
40
  let sumsOfChildWidth = 0;
37
- for (const [index, childWidth] of childWidthArray.entries()) {
38
- sumsOfChildWidth += index > 0 ? childWidth.width + ACTIONBAR_ITEM_GAP : childWidth.width;
41
+ for (const [index, [, child]] of registryEntries.entries()) {
42
+ sumsOfChildWidth += index > 0 ? child.width + gap : child.width;
39
43
  if (sumsOfChildWidth > widthToFit) {
40
44
  breakpoint = index;
41
45
  break;
@@ -45,188 +49,321 @@ const calculatePossibleItems = (childWidthArray, navWidth, moreMenuWidth = 0) =>
45
49
  }
46
50
  return breakpoint;
47
51
  };
48
- const overflowEffect = (navWidth, moreMenuWidth, childArray, childWidthArray, updateListAndMenu, hasActiveMenu) => {
49
- if (childWidthArray.length === 0) {
50
- updateListAndMenu({
51
- items: childArray,
52
- menuItems: []
53
- });
54
- }
55
- const numberOfItemsPossible = calculatePossibleItems(childWidthArray, navWidth);
56
- const numberOfItemsPossibleWithMoreMenu = calculatePossibleItems(childWidthArray, navWidth, moreMenuWidth || MORE_BTN_WIDTH);
57
- const items = [];
58
- const menuItems = [];
52
+ const getMenuItems = (navWidth, moreMenuWidth, childRegistry, hasActiveMenu, gap) => {
53
+ const registryEntries = Array.from(childRegistry).filter(entry => entry[1] !== null);
54
+ if (registryEntries.length === 0) return new Set();
55
+ const numberOfItemsPossible = calculatePossibleItems(registryEntries, navWidth, gap);
56
+ const numberOfItemsPossibleWithMoreMenu = calculatePossibleItems(registryEntries, navWidth, gap, moreMenuWidth || MORE_BTN_WIDTH);
57
+ const menuItems = new Set();
59
58
 
60
59
  // First, we check if we can fit all the items with their icons
61
- if (childArray.length >= numberOfItemsPossible) {
60
+ if (registryEntries.length >= numberOfItemsPossible) {
62
61
  /* Below is an accessibility requirement. Never show only one item in the overflow menu.
63
62
  * If there is only one item left to display in the overflow menu according to the calculation,
64
63
  * we need to pull another item from the list into the overflow menu.
65
64
  */
66
- const numberOfItemsInMenu = childArray.length - numberOfItemsPossibleWithMoreMenu;
65
+ const numberOfItemsInMenu = registryEntries.length - numberOfItemsPossibleWithMoreMenu;
67
66
  const numberOfListItems = numberOfItemsInMenu === 1 ? numberOfItemsPossibleWithMoreMenu - 1 : numberOfItemsPossibleWithMoreMenu;
68
- for (const [index, child] of childArray.entries()) {
67
+ for (const [index, [id, child]] of registryEntries.entries()) {
69
68
  if (index < numberOfListItems) {
70
- items.push(child);
69
+ continue;
71
70
  //if the last item is a divider
72
- } else if (childWidthArray[index].text === 'divider') {
71
+ } else if (child.type === 'divider') {
73
72
  if (index === numberOfListItems - 1 || index === numberOfListItems) {
74
73
  continue;
75
74
  } else {
76
- const divider = /*#__PURE__*/React.createElement(ActionList.Divider, {
77
- key: index
78
- });
79
- menuItems.push(divider);
75
+ menuItems.add(id);
80
76
  }
81
77
  } else {
82
- menuItems.push(child);
78
+ menuItems.add(id);
83
79
  }
84
80
  }
85
- updateListAndMenu({
86
- items,
87
- menuItems
88
- });
89
- } else if (numberOfItemsPossible > childArray.length && hasActiveMenu) {
81
+ return menuItems;
82
+ } else if (numberOfItemsPossible > registryEntries.length && hasActiveMenu) {
90
83
  /* If the items fit in the list and there are items in the overflow menu, we need to move them back to the list */
91
- updateListAndMenu({
92
- items: childArray,
93
- menuItems: []
94
- });
84
+ return new Set();
95
85
  }
96
86
  };
97
87
  const ActionBar = props => {
88
+ const $ = c(40);
98
89
  const {
99
- size = 'medium',
90
+ size: t0,
100
91
  children,
101
- 'aria-label': ariaLabel,
102
- flush = false,
103
- className
92
+ "aria-label": ariaLabel,
93
+ "aria-labelledby": ariaLabelledBy,
94
+ flush: t1,
95
+ className,
96
+ gap: t2
104
97
  } = props;
105
- const [childWidthArray, setChildWidthArray] = useState([]);
106
- const setChildrenWidth = useCallback(size_0 => {
107
- setChildWidthArray(arr => {
108
- const newArr = [...arr, size_0];
109
- return newArr;
110
- });
111
- }, []);
112
- const navRef = useRef(null);
98
+ const size = t0 === undefined ? "medium" : t0;
99
+ const flush = t1 === undefined ? false : t1;
100
+ const gap = t2 === undefined ? "condensed" : t2;
113
101
  const listRef = useRef(null);
102
+ const [computedGap, setComputedGap] = useState(ACTIONBAR_ITEM_GAP);
103
+ const [childRegistry, setChildRegistry] = useState(_temp);
104
+ let t3;
105
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
106
+ t3 = (id, childProps) => setChildRegistry(prev => new Map(prev).set(id, childProps));
107
+ $[0] = t3;
108
+ } else {
109
+ t3 = $[0];
110
+ }
111
+ const registerChild = t3;
112
+ let t4;
113
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
114
+ t4 = id_0 => setChildRegistry(prev_0 => new Map(prev_0).set(id_0, null));
115
+ $[1] = t4;
116
+ } else {
117
+ t4 = $[1];
118
+ }
119
+ const unregisterChild = t4;
120
+ const [menuItemIds, setMenuItemIds] = useState(_temp2);
121
+ const navRef = useRef(null);
122
+ let t5;
123
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
124
+ t5 = () => {
125
+ if (!listRef.current) {
126
+ return;
127
+ }
128
+ const g = window.getComputedStyle(listRef.current).gap;
129
+ const parsed = parseFloat(g);
130
+ if (!Number.isNaN(parsed)) {
131
+ setComputedGap(parsed);
132
+ }
133
+ };
134
+ $[2] = t5;
135
+ } else {
136
+ t5 = $[2];
137
+ }
138
+ let t6;
139
+ if ($[3] !== gap) {
140
+ t6 = [gap];
141
+ $[3] = gap;
142
+ $[4] = t6;
143
+ } else {
144
+ t6 = $[4];
145
+ }
146
+ useIsomorphicLayoutEffect(t5, t6);
114
147
  const moreMenuRef = useRef(null);
115
148
  const moreMenuBtnRef = useRef(null);
116
149
  const containerRef = React.useRef(null);
117
- const validChildren = getValidChildren(children);
118
- // Responsive props object manages which items are in the list and which items are in the menu.
119
- const [responsiveProps, setResponsiveProps] = useState({
120
- items: validChildren,
121
- menuItems: []
122
- });
123
-
124
- // Make sure to have the fresh props data for list items when children are changed (keeping aria-current up-to-date)
125
- const listItems = responsiveProps.items.map(item => {
126
- var _validChildren$find;
127
- return (_validChildren$find = validChildren.find(child => child.key === item.key)) !== null && _validChildren$find !== void 0 ? _validChildren$find : item;
128
- });
129
-
130
- // Make sure to have the fresh props data for menu items when children are changed (keeping aria-current up-to-date)
131
- const menuItems = responsiveProps.menuItems.map(menuItem => {
132
- var _validChildren$find2;
133
- return (_validChildren$find2 = validChildren.find(child_0 => child_0.key === menuItem.key)) !== null && _validChildren$find2 !== void 0 ? _validChildren$find2 : menuItem;
134
- });
135
- const updateListAndMenu = useCallback(props_0 => {
136
- setResponsiveProps(props_0);
137
- }, []);
138
- useResizeObserver(resizeObserverEntries => {
139
- var _moreMenuRef$current$, _moreMenuRef$current;
140
- const navWidth = resizeObserverEntries[0].contentRect.width;
141
- const moreMenuWidth = (_moreMenuRef$current$ = (_moreMenuRef$current = moreMenuRef.current) === null || _moreMenuRef$current === void 0 ? void 0 : _moreMenuRef$current.getBoundingClientRect().width) !== null && _moreMenuRef$current$ !== void 0 ? _moreMenuRef$current$ : 0;
142
- const hasActiveMenu = menuItems.length > 0;
143
- navWidth !== 0 && overflowEffect(navWidth, moreMenuWidth, validChildren, childWidthArray, updateListAndMenu, hasActiveMenu);
144
- }, navRef);
150
+ let t7;
151
+ if ($[5] !== childRegistry || $[6] !== computedGap || $[7] !== menuItemIds.size) {
152
+ t7 = resizeObserverEntries => {
153
+ var _moreMenuRef$current$, _moreMenuRef$current;
154
+ const navWidth = resizeObserverEntries[0].contentRect.width;
155
+ const moreMenuWidth = (_moreMenuRef$current$ = (_moreMenuRef$current = moreMenuRef.current) === null || _moreMenuRef$current === void 0 ? void 0 : _moreMenuRef$current.getBoundingClientRect().width) !== null && _moreMenuRef$current$ !== void 0 ? _moreMenuRef$current$ : 0;
156
+ const hasActiveMenu = menuItemIds.size > 0;
157
+ if (navWidth > 0) {
158
+ const newMenuItemIds = getMenuItems(navWidth, moreMenuWidth, childRegistry, hasActiveMenu, computedGap);
159
+ if (newMenuItemIds) {
160
+ setMenuItemIds(newMenuItemIds);
161
+ }
162
+ }
163
+ };
164
+ $[5] = childRegistry;
165
+ $[6] = computedGap;
166
+ $[7] = menuItemIds.size;
167
+ $[8] = t7;
168
+ } else {
169
+ t7 = $[8];
170
+ }
171
+ useResizeObserver(t7, navRef);
172
+ let t8;
173
+ if ($[9] !== menuItemIds) {
174
+ t8 = id_1 => !menuItemIds.has(id_1);
175
+ $[9] = menuItemIds;
176
+ $[10] = t8;
177
+ } else {
178
+ t8 = $[10];
179
+ }
180
+ const isVisibleChild = t8;
145
181
  const [isWidgetOpen, setIsWidgetOpen] = useState(false);
146
- const closeOverlay = React.useCallback(() => {
147
- setIsWidgetOpen(false);
148
- }, [setIsWidgetOpen]);
149
- const focusOnMoreMenuBtn = React.useCallback(() => {
150
- var _moreMenuBtnRef$curre;
151
- (_moreMenuBtnRef$curre = moreMenuBtnRef.current) === null || _moreMenuBtnRef$curre === void 0 ? void 0 : _moreMenuBtnRef$curre.focus();
152
- }, []);
153
- useOnEscapePress(event => {
154
- if (isWidgetOpen) {
155
- event.preventDefault();
156
- closeOverlay();
157
- focusOnMoreMenuBtn();
158
- }
159
- }, [isWidgetOpen]);
160
- useOnOutsideClick({
161
- onClickOutside: closeOverlay,
162
- containerRef,
163
- ignoreClickRefs: [moreMenuBtnRef]
164
- });
165
- useFocusZone({
166
- containerRef: listRef,
167
- bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
168
- focusOutBehavior: 'wrap'
169
- });
170
- return /*#__PURE__*/jsx(ActionBarContext.Provider, {
171
- value: {
182
+ let t9;
183
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
184
+ t9 = () => {
185
+ setIsWidgetOpen(false);
186
+ };
187
+ $[11] = t9;
188
+ } else {
189
+ t9 = $[11];
190
+ }
191
+ const closeOverlay = t9;
192
+ let t10;
193
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
194
+ t10 = () => {
195
+ var _moreMenuBtnRef$curre;
196
+ (_moreMenuBtnRef$curre = moreMenuBtnRef.current) === null || _moreMenuBtnRef$curre === void 0 ? void 0 : _moreMenuBtnRef$curre.focus();
197
+ };
198
+ $[12] = t10;
199
+ } else {
200
+ t10 = $[12];
201
+ }
202
+ const focusOnMoreMenuBtn = t10;
203
+ let t11;
204
+ let t12;
205
+ if ($[13] !== isWidgetOpen) {
206
+ t11 = event => {
207
+ if (isWidgetOpen) {
208
+ event.preventDefault();
209
+ closeOverlay();
210
+ focusOnMoreMenuBtn();
211
+ }
212
+ };
213
+ t12 = [isWidgetOpen];
214
+ $[13] = isWidgetOpen;
215
+ $[14] = t11;
216
+ $[15] = t12;
217
+ } else {
218
+ t11 = $[14];
219
+ t12 = $[15];
220
+ }
221
+ useOnEscapePress(t11, t12);
222
+ let t13;
223
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
224
+ t13 = {
225
+ onClickOutside: closeOverlay,
226
+ containerRef,
227
+ ignoreClickRefs: [moreMenuBtnRef]
228
+ };
229
+ $[16] = t13;
230
+ } else {
231
+ t13 = $[16];
232
+ }
233
+ useOnOutsideClick(t13);
234
+ let t14;
235
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
236
+ t14 = {
237
+ containerRef: listRef,
238
+ bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
239
+ focusOutBehavior: "wrap"
240
+ };
241
+ $[17] = t14;
242
+ } else {
243
+ t14 = $[17];
244
+ }
245
+ useFocusZone(t14);
246
+ let t15;
247
+ if ($[18] !== isVisibleChild || $[19] !== size) {
248
+ t15 = {
172
249
  size,
173
- setChildrenWidth
174
- },
175
- children: /*#__PURE__*/jsx("div", {
250
+ registerChild,
251
+ unregisterChild,
252
+ isVisibleChild
253
+ };
254
+ $[18] = isVisibleChild;
255
+ $[19] = size;
256
+ $[20] = t15;
257
+ } else {
258
+ t15 = $[20];
259
+ }
260
+ let t16;
261
+ if ($[21] !== className) {
262
+ t16 = clsx(className, styles.Nav);
263
+ $[21] = className;
264
+ $[22] = t16;
265
+ } else {
266
+ t16 = $[22];
267
+ }
268
+ let t17;
269
+ if ($[23] !== ariaLabel || $[24] !== childRegistry || $[25] !== menuItemIds) {
270
+ t17 = menuItemIds.size > 0 && /*#__PURE__*/jsxs(ActionMenu, {
271
+ children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
272
+ children: /*#__PURE__*/jsx(IconButton, {
273
+ variant: "invisible",
274
+ "aria-label": `More ${ariaLabel} items`,
275
+ icon: KebabHorizontalIcon
276
+ })
277
+ }), /*#__PURE__*/jsx(ActionMenu.Overlay, {
278
+ children: /*#__PURE__*/jsx(ActionList, {
279
+ children: Array.from(menuItemIds).map(id_2 => {
280
+ const menuItem = childRegistry.get(id_2);
281
+ if (!menuItem) {
282
+ return null;
283
+ }
284
+ if (menuItem.type === "divider") {
285
+ return /*#__PURE__*/jsx(ActionList.Divider, {}, id_2);
286
+ } else {
287
+ const {
288
+ onClick,
289
+ icon: Icon,
290
+ label,
291
+ disabled
292
+ } = menuItem;
293
+ return /*#__PURE__*/jsxs(ActionList.Item, {
294
+ onClick: event_0 => {
295
+ closeOverlay();
296
+ focusOnMoreMenuBtn();
297
+ typeof onClick === "function" && onClick(event_0);
298
+ },
299
+ disabled: disabled,
300
+ children: [/*#__PURE__*/jsx(ActionList.LeadingVisual, {
301
+ children: /*#__PURE__*/jsx(Icon, {})
302
+ }), label]
303
+ }, label);
304
+ }
305
+ })
306
+ })
307
+ })]
308
+ });
309
+ $[23] = ariaLabel;
310
+ $[24] = childRegistry;
311
+ $[25] = menuItemIds;
312
+ $[26] = t17;
313
+ } else {
314
+ t17 = $[26];
315
+ }
316
+ let t18;
317
+ if ($[27] !== ariaLabel || $[28] !== ariaLabelledBy || $[29] !== children || $[30] !== gap || $[31] !== t17) {
318
+ t18 = /*#__PURE__*/jsxs("div", {
319
+ ref: listRef,
320
+ role: "toolbar",
321
+ className: styles.List,
322
+ "aria-label": ariaLabel,
323
+ "aria-labelledby": ariaLabelledBy,
324
+ "data-gap": gap,
325
+ children: [children, t17]
326
+ });
327
+ $[27] = ariaLabel;
328
+ $[28] = ariaLabelledBy;
329
+ $[29] = children;
330
+ $[30] = gap;
331
+ $[31] = t17;
332
+ $[32] = t18;
333
+ } else {
334
+ t18 = $[32];
335
+ }
336
+ let t19;
337
+ if ($[33] !== flush || $[34] !== t16 || $[35] !== t18) {
338
+ t19 = /*#__PURE__*/jsx("div", {
176
339
  ref: navRef,
177
- className: clsx(className, styles.Nav),
340
+ className: t16,
178
341
  "data-flush": flush,
179
- children: /*#__PURE__*/jsxs("div", {
180
- ref: listRef,
181
- role: "toolbar",
182
- className: styles.List,
183
- style: {
184
- gap: `${ACTIONBAR_ITEM_GAP}px`
185
- },
186
- children: [listItems, menuItems.length > 0 && /*#__PURE__*/jsxs(ActionMenu, {
187
- children: [/*#__PURE__*/jsx(ActionMenu.Anchor, {
188
- children: /*#__PURE__*/jsx(IconButton, {
189
- variant: "invisible",
190
- "aria-label": `More ${ariaLabel} items`,
191
- icon: KebabHorizontalIcon
192
- })
193
- }), /*#__PURE__*/jsx(ActionMenu.Overlay, {
194
- children: /*#__PURE__*/jsx(ActionList, {
195
- children: menuItems.map((menuItem_0, index) => {
196
- if (menuItem_0.type === ActionList.Divider) {
197
- return /*#__PURE__*/jsx(ActionList.Divider, {}, index);
198
- } else {
199
- const {
200
- children: menuItemChildren,
201
- onClick,
202
- icon: Icon,
203
- 'aria-label': ariaLabel_0,
204
- disabled
205
- } = menuItem_0.props;
206
- return /*#__PURE__*/jsxs(ActionList.Item, {
207
- // eslint-disable-next-line primer-react/prefer-action-list-item-onselect
208
- onClick: event_0 => {
209
- closeOverlay();
210
- focusOnMoreMenuBtn();
211
- typeof onClick === 'function' && onClick(event_0);
212
- },
213
- disabled: disabled,
214
- children: [Icon ? /*#__PURE__*/jsx(ActionList.LeadingVisual, {
215
- children: /*#__PURE__*/jsx(Icon, {})
216
- }) : null, ariaLabel_0]
217
- }, menuItemChildren);
218
- }
219
- })
220
- })
221
- })]
222
- })]
223
- })
224
- })
225
- });
342
+ children: t18
343
+ });
344
+ $[33] = flush;
345
+ $[34] = t16;
346
+ $[35] = t18;
347
+ $[36] = t19;
348
+ } else {
349
+ t19 = $[36];
350
+ }
351
+ let t20;
352
+ if ($[37] !== t15 || $[38] !== t19) {
353
+ t20 = /*#__PURE__*/jsx(ActionBarContext.Provider, {
354
+ value: t15,
355
+ children: t19
356
+ });
357
+ $[37] = t15;
358
+ $[38] = t19;
359
+ $[39] = t20;
360
+ } else {
361
+ t20 = $[39];
362
+ }
363
+ return t20;
226
364
  };
227
- ActionBar.displayName = "ActionBar";
228
365
  const ActionBarIconButton = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
229
- const $ = c(20);
366
+ const $ = c(26);
230
367
  let disabled;
231
368
  let onClick;
232
369
  let props;
@@ -245,58 +382,84 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
245
382
  onClick = $[2];
246
383
  props = $[3];
247
384
  }
248
- const backupRef = useRef(null);
249
- const ref = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : backupRef;
385
+ const ref = useRef(null);
386
+ useRefObjectAsForwardedRef(forwardedRef, ref);
387
+ const id = useId();
250
388
  const {
251
389
  size,
252
- setChildrenWidth
390
+ registerChild,
391
+ unregisterChild,
392
+ isVisibleChild
253
393
  } = React.useContext(ActionBarContext);
394
+ const widthRef = useRef();
254
395
  let t1;
255
- if ($[4] !== props || $[5] !== ref || $[6] !== setChildrenWidth) {
396
+ if ($[4] !== disabled || $[5] !== id || $[6] !== onClick || $[7] !== props || $[8] !== registerChild || $[9] !== unregisterChild) {
256
397
  t1 = () => {
257
- const text = props["aria-label"] ? props["aria-label"] : "";
258
- const domRect = ref.current.getBoundingClientRect();
259
- setChildrenWidth({
260
- text,
261
- width: domRect.width
398
+ var _ref$current, _props$ariaLabel;
399
+ const width = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect().width;
400
+ if (width) {
401
+ widthRef.current = width;
402
+ }
403
+ if (!widthRef.current) {
404
+ return;
405
+ }
406
+ registerChild(id, {
407
+ type: "action",
408
+ label: (_props$ariaLabel = props["aria-label"]) !== null && _props$ariaLabel !== void 0 ? _props$ariaLabel : "",
409
+ icon: props.icon,
410
+ disabled: !!disabled,
411
+ onClick: onClick,
412
+ width: widthRef.current
262
413
  });
414
+ return () => unregisterChild(id);
263
415
  };
264
- $[4] = props;
265
- $[5] = ref;
266
- $[6] = setChildrenWidth;
267
- $[7] = t1;
416
+ $[4] = disabled;
417
+ $[5] = id;
418
+ $[6] = onClick;
419
+ $[7] = props;
420
+ $[8] = registerChild;
421
+ $[9] = unregisterChild;
422
+ $[10] = t1;
268
423
  } else {
269
- t1 = $[7];
424
+ t1 = $[10];
270
425
  }
271
- let t2;
272
- if ($[8] !== ref || $[9] !== setChildrenWidth) {
273
- t2 = [ref, setChildrenWidth];
274
- $[8] = ref;
275
- $[9] = setChildrenWidth;
276
- $[10] = t2;
426
+ const t2 = props["aria-label"];
427
+ let t3;
428
+ if ($[11] !== disabled || $[12] !== onClick || $[13] !== props.icon || $[14] !== registerChild || $[15] !== t2 || $[16] !== unregisterChild) {
429
+ t3 = [registerChild, unregisterChild, t2, props.icon, disabled, onClick];
430
+ $[11] = disabled;
431
+ $[12] = onClick;
432
+ $[13] = props.icon;
433
+ $[14] = registerChild;
434
+ $[15] = t2;
435
+ $[16] = unregisterChild;
436
+ $[17] = t3;
277
437
  } else {
278
- t2 = $[10];
438
+ t3 = $[17];
279
439
  }
280
- useIsomorphicLayoutEffect(t1, t2);
281
- let t3;
282
- if ($[11] !== disabled || $[12] !== onClick) {
283
- t3 = event => {
440
+ useIsomorphicLayoutEffect(t1, t3);
441
+ let t4;
442
+ if ($[18] !== disabled || $[19] !== onClick) {
443
+ t4 = event => {
284
444
  var _onClick;
285
445
  if (disabled) {
286
446
  return;
287
447
  }
288
448
  (_onClick = onClick) === null || _onClick === void 0 ? void 0 : _onClick(event);
289
449
  };
290
- $[11] = disabled;
291
- $[12] = onClick;
292
- $[13] = t3;
450
+ $[18] = disabled;
451
+ $[19] = onClick;
452
+ $[20] = t4;
293
453
  } else {
294
- t3 = $[13];
454
+ t4 = $[20];
295
455
  }
296
- const clickHandler = t3;
297
- let t4;
298
- if ($[14] !== clickHandler || $[15] !== disabled || $[16] !== props || $[17] !== ref || $[18] !== size) {
299
- t4 = /*#__PURE__*/jsx(IconButton, {
456
+ const clickHandler = t4;
457
+ if (!isVisibleChild(id)) {
458
+ return null;
459
+ }
460
+ let t5;
461
+ if ($[21] !== clickHandler || $[22] !== disabled || $[23] !== props || $[24] !== size) {
462
+ t5 = /*#__PURE__*/jsx(IconButton, {
300
463
  "aria-disabled": disabled,
301
464
  ref: ref,
302
465
  size: size,
@@ -304,55 +467,82 @@ const ActionBarIconButton = /*#__PURE__*/forwardRef((t0, forwardedRef) => {
304
467
  ...props,
305
468
  variant: "invisible"
306
469
  });
307
- $[14] = clickHandler;
308
- $[15] = disabled;
309
- $[16] = props;
310
- $[17] = ref;
311
- $[18] = size;
312
- $[19] = t4;
470
+ $[21] = clickHandler;
471
+ $[22] = disabled;
472
+ $[23] = props;
473
+ $[24] = size;
474
+ $[25] = t5;
313
475
  } else {
314
- t4 = $[19];
476
+ t5 = $[25];
315
477
  }
316
- return t4;
478
+ return t5;
317
479
  });
318
480
  const VerticalDivider = () => {
319
- const $ = c(4);
481
+ const $ = c(8);
320
482
  const ref = useRef(null);
483
+ const id = useId();
321
484
  const {
322
- setChildrenWidth
485
+ registerChild,
486
+ unregisterChild,
487
+ isVisibleChild
323
488
  } = React.useContext(ActionBarContext);
489
+ const widthRef = useRef();
324
490
  let t0;
325
- let t1;
326
- if ($[0] !== setChildrenWidth) {
491
+ if ($[0] !== id || $[1] !== registerChild || $[2] !== unregisterChild) {
327
492
  t0 = () => {
328
- const domRect = ref.current.getBoundingClientRect();
329
- setChildrenWidth({
330
- text: "divider",
331
- width: domRect.width
493
+ var _ref$current2;
494
+ const width = (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.getBoundingClientRect().width;
495
+ if (width) {
496
+ widthRef.current = width;
497
+ }
498
+ if (!widthRef.current) {
499
+ return;
500
+ }
501
+ registerChild(id, {
502
+ type: "divider",
503
+ width: widthRef.current
332
504
  });
505
+ return () => unregisterChild(id);
333
506
  };
334
- t1 = [ref, setChildrenWidth];
335
- $[0] = setChildrenWidth;
336
- $[1] = t0;
337
- $[2] = t1;
507
+ $[0] = id;
508
+ $[1] = registerChild;
509
+ $[2] = unregisterChild;
510
+ $[3] = t0;
338
511
  } else {
339
- t0 = $[1];
340
- t1 = $[2];
512
+ t0 = $[3];
513
+ }
514
+ let t1;
515
+ if ($[4] !== registerChild || $[5] !== unregisterChild) {
516
+ t1 = [registerChild, unregisterChild];
517
+ $[4] = registerChild;
518
+ $[5] = unregisterChild;
519
+ $[6] = t1;
520
+ } else {
521
+ t1 = $[6];
341
522
  }
342
523
  useIsomorphicLayoutEffect(t0, t1);
524
+ if (!isVisibleChild(id)) {
525
+ return null;
526
+ }
343
527
  let t2;
344
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
528
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
345
529
  t2 = /*#__PURE__*/jsx("div", {
346
530
  ref: ref,
347
531
  "data-component": "ActionBar.VerticalDivider",
348
532
  "aria-hidden": "true",
349
533
  className: styles.Divider
350
534
  });
351
- $[3] = t2;
535
+ $[7] = t2;
352
536
  } else {
353
- t2 = $[3];
537
+ t2 = $[7];
354
538
  }
355
539
  return t2;
356
540
  };
541
+ function _temp() {
542
+ return new Map();
543
+ }
544
+ function _temp2() {
545
+ return new Set();
546
+ }
357
547
 
358
548
  export { ActionBar, ActionBarIconButton, VerticalDivider };