@primer/react 38.0.0-rc.5 → 38.0.0-rc.7

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