@primer/react 0.0.0-20260428150519 → 0.0.0-20260428191209

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 (362) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/dist/ActionBar/ActionBar.js +705 -502
  3. package/dist/ActionBar/ActionBar.module.css.js +5 -10
  4. package/dist/ActionBar/index.js +8 -8
  5. package/dist/ActionList/{ActionList-53389912.css → ActionList-09f5c4a8.css} +2 -2
  6. package/dist/ActionList/ActionList-09f5c4a8.css.map +1 -0
  7. package/dist/ActionList/ActionList.module.css.js +5 -31
  8. package/dist/ActionList/ActionListContainerContext.js +5 -4
  9. package/dist/ActionList/Description.js +133 -117
  10. package/dist/ActionList/Divider.js +38 -31
  11. package/dist/ActionList/Group.js +349 -292
  12. package/dist/ActionList/Group.module.css.js +5 -10
  13. package/dist/ActionList/Heading.js +106 -88
  14. package/dist/ActionList/Heading.module.css.js +5 -5
  15. package/dist/ActionList/Item.js +811 -668
  16. package/dist/ActionList/LinkItem.js +56 -36
  17. package/dist/ActionList/List.js +210 -168
  18. package/dist/ActionList/Selection.d.ts +2 -3
  19. package/dist/ActionList/Selection.d.ts.map +1 -1
  20. package/dist/ActionList/Selection.js +112 -83
  21. package/dist/ActionList/TrailingAction.js +112 -97
  22. package/dist/ActionList/Visuals.js +191 -143
  23. package/dist/ActionList/index.d.ts +7 -0
  24. package/dist/ActionList/index.d.ts.map +1 -1
  25. package/dist/ActionList/index.js +38 -33
  26. package/dist/ActionList/shared.js +9 -5
  27. package/dist/ActionMenu/ActionMenu.js +310 -223
  28. package/dist/ActionMenu/ActionMenu.module.css.js +5 -5
  29. package/dist/AnchoredOverlay/AnchoredOverlay.js +280 -206
  30. package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +5 -9
  31. package/dist/Autocomplete/Autocomplete.js +141 -125
  32. package/dist/Autocomplete/AutocompleteContext.js +20 -18
  33. package/dist/Autocomplete/AutocompleteInput.js +146 -108
  34. package/dist/Autocomplete/AutocompleteMenu.js +238 -201
  35. package/dist/Autocomplete/AutocompleteMenu.module.css.js +5 -8
  36. package/dist/Autocomplete/AutocompleteOverlay.js +79 -54
  37. package/dist/Autocomplete/AutocompleteOverlay.module.css.js +5 -5
  38. package/dist/Avatar/Avatar.js +133 -106
  39. package/dist/Avatar/Avatar.module.css.js +5 -5
  40. package/dist/AvatarStack/AvatarStack.js +143 -102
  41. package/dist/AvatarStack/AvatarStack.module.css.js +5 -9
  42. package/dist/Banner/Banner.js +186 -133
  43. package/dist/Banner/Banner.module.css.js +5 -14
  44. package/dist/Banner/index.js +7 -7
  45. package/dist/BaseStyles.js +91 -74
  46. package/dist/BaseStyles.module.css.js +5 -5
  47. package/dist/Blankslate/Blankslate.js +328 -266
  48. package/dist/Blankslate/Blankslate.module.css.js +5 -12
  49. package/dist/Blankslate/BlankslateContext.js +9 -7
  50. package/dist/Blankslate/index.js +9 -9
  51. package/dist/BranchName/BranchName.js +59 -49
  52. package/dist/BranchName/BranchName.module.css.js +5 -5
  53. package/dist/Breadcrumbs/Breadcrumbs.js +431 -371
  54. package/dist/Breadcrumbs/Breadcrumbs.module.css.js +5 -15
  55. package/dist/Button/Button.js +18 -15
  56. package/dist/Button/ButtonBase.js +139 -76
  57. package/dist/Button/ButtonBase.module.css.js +5 -16
  58. package/dist/Button/IconButton.js +74 -42
  59. package/dist/Button/LinkButton.js +17 -13
  60. package/dist/ButtonGroup/ButtonGroup.js +97 -80
  61. package/dist/ButtonGroup/ButtonGroup.module.css.js +5 -5
  62. package/dist/Card/Card.js +491 -401
  63. package/dist/Card/Card.module.css.js +5 -18
  64. package/dist/Card/index.js +9 -9
  65. package/dist/Checkbox/Checkbox.js +71 -52
  66. package/dist/Checkbox/Checkbox.module.css.js +5 -9
  67. package/dist/Checkbox/shared.module.css.js +5 -5
  68. package/dist/CheckboxGroup/CheckboxGroup.js +132 -111
  69. package/dist/CheckboxGroup/CheckboxGroupContext.js +4 -4
  70. package/dist/CircleBadge/CircleBadge.js +90 -77
  71. package/dist/CircleBadge/CircleBadge.module.css.js +5 -8
  72. package/dist/ConfirmationDialog/ConfirmationDialog.js +92 -68
  73. package/dist/CounterLabel/CounterLabel.js +99 -83
  74. package/dist/CounterLabel/CounterLabel.module.css.js +5 -5
  75. package/dist/DataTable/DataTable.js +140 -100
  76. package/dist/DataTable/ErrorDialog.js +45 -33
  77. package/dist/DataTable/Pagination.js +592 -464
  78. package/dist/DataTable/Pagination.module.css.js +5 -13
  79. package/dist/DataTable/Table.js +710 -527
  80. package/dist/DataTable/Table.module.css.js +5 -26
  81. package/dist/DataTable/column.js +11 -10
  82. package/dist/DataTable/index.js +20 -22
  83. package/dist/DataTable/sorting.js +103 -65
  84. package/dist/DataTable/useTable.js +290 -207
  85. package/dist/Details/Details.js +126 -100
  86. package/dist/Details/Details.module.css.js +5 -5
  87. package/dist/Dialog/Dialog.js +351 -259
  88. package/dist/Dialog/Dialog.module.css.js +5 -22
  89. package/dist/FeatureFlags/DefaultFeatureFlags.js +7 -7
  90. package/dist/FeatureFlags/FeatureFlagContext.js +5 -5
  91. package/dist/FeatureFlags/FeatureFlagScope.js +44 -36
  92. package/dist/FeatureFlags/FeatureFlags.js +37 -29
  93. package/dist/FeatureFlags/useFeatureFlag.js +19 -17
  94. package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
  95. package/dist/FilteredActionList/FilteredActionList.js +559 -454
  96. package/dist/FilteredActionList/FilteredActionList.module.css.js +5 -15
  97. package/dist/FilteredActionList/FilteredActionListInput.d.ts +15 -0
  98. package/dist/FilteredActionList/FilteredActionListInput.d.ts.map +1 -0
  99. package/dist/FilteredActionList/FilteredActionListInput.js +119 -0
  100. package/dist/FilteredActionList/FilteredActionListLoaders.js +150 -119
  101. package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +5 -9
  102. package/dist/FilteredActionList/index.d.ts +9 -1
  103. package/dist/FilteredActionList/index.d.ts.map +1 -1
  104. package/dist/FilteredActionList/index.js +11 -0
  105. package/dist/FilteredActionList/useAnnouncements.js +180 -167
  106. package/dist/Flash/Flash.js +69 -57
  107. package/dist/Flash/Flash.module.css.js +5 -5
  108. package/dist/FormControl/FormControl.js +227 -211
  109. package/dist/FormControl/FormControl.module.css.js +5 -11
  110. package/dist/FormControl/FormControlCaption.js +49 -37
  111. package/dist/FormControl/FormControlCaption.module.css.js +5 -5
  112. package/dist/FormControl/FormControlLabel.js +115 -95
  113. package/dist/FormControl/FormControlLeadingVisual.js +37 -29
  114. package/dist/FormControl/FormControlLeadingVisual.module.css.js +5 -5
  115. package/dist/FormControl/_FormControlContext.js +48 -41
  116. package/dist/FormControl/_FormControlValidation.js +39 -29
  117. package/dist/Header/Header.js +165 -138
  118. package/dist/Header/Header.module.css.js +5 -9
  119. package/dist/Heading/Heading.js +37 -26
  120. package/dist/Heading/Heading.module.css.js +5 -5
  121. package/dist/Hidden/Hidden.js +77 -54
  122. package/dist/Hidden/Hidden.module.css.js +5 -5
  123. package/dist/InlineMessage/InlineMessage.js +116 -88
  124. package/dist/InlineMessage/InlineMessage.module.css.js +5 -8
  125. package/dist/KeybindingHint/KeybindingHint.js +88 -70
  126. package/dist/KeybindingHint/KeybindingHint.module.css.js +5 -5
  127. package/dist/KeybindingHint/components/Chord.js +93 -81
  128. package/dist/KeybindingHint/components/Chord.module.css.js +5 -11
  129. package/dist/KeybindingHint/components/Key.js +66 -49
  130. package/dist/KeybindingHint/components/Sequence.js +24 -12
  131. package/dist/KeybindingHint/key-names.js +114 -99
  132. package/dist/Label/Label.js +66 -56
  133. package/dist/Label/Label.module.css.js +5 -5
  134. package/dist/Label/index.js +5 -5
  135. package/dist/LabelGroup/LabelGroup.js +344 -260
  136. package/dist/LabelGroup/LabelGroup.module.css.js +5 -12
  137. package/dist/Link/Link.js +47 -31
  138. package/dist/Link/Link.module.css.js +5 -5
  139. package/dist/NavList/NavList.js +614 -424
  140. package/dist/NavList/NavList.module.css.js +5 -5
  141. package/dist/Octicon/Octicon.js +37 -35
  142. package/dist/Overlay/Overlay.js +318 -264
  143. package/dist/Overlay/Overlay.module.css.js +5 -8
  144. package/dist/PageHeader/PageHeader.js +823 -579
  145. package/dist/PageHeader/PageHeader.module.css.js +5 -21
  146. package/dist/PageLayout/PageLayout.js +913 -631
  147. package/dist/PageLayout/PageLayout.module.css.js +5 -31
  148. package/dist/PageLayout/paneUtils.js +29 -15
  149. package/dist/PageLayout/usePaneWidth.js +437 -334
  150. package/dist/Pagehead/Pagehead.js +14 -10
  151. package/dist/Pagehead/Pagehead.module.css.js +5 -5
  152. package/dist/Pagination/Pagination.js +114 -84
  153. package/dist/Pagination/Pagination.module.css.js +5 -9
  154. package/dist/Pagination/index.js +5 -5
  155. package/dist/Pagination/model.js +194 -118
  156. package/dist/Popover/Popover.js +151 -126
  157. package/dist/Popover/Popover.module.css.js +5 -8
  158. package/dist/Portal/Portal.js +85 -65
  159. package/dist/Portal/index.js +6 -5
  160. package/dist/ProgressBar/ProgressBar.js +255 -210
  161. package/dist/ProgressBar/ProgressBar.module.css.js +5 -9
  162. package/dist/ProgressBar/index.js +8 -6
  163. package/dist/Radio/Radio.js +115 -97
  164. package/dist/Radio/Radio.module.css.js +5 -5
  165. package/dist/RadioGroup/RadioGroup.js +118 -99
  166. package/dist/RelativeTime/RelativeTime.js +76 -64
  167. package/dist/ScrollableRegion/ScrollableRegion.js +79 -67
  168. package/dist/ScrollableRegion/ScrollableRegion.module.css.js +5 -5
  169. package/dist/SegmentedControl/SegmentedControl.js +287 -238
  170. package/dist/SegmentedControl/SegmentedControl.module.css.js +5 -15
  171. package/dist/SegmentedControl/SegmentedControlButton.js +187 -156
  172. package/dist/SegmentedControl/SegmentedControlIconButton.js +161 -133
  173. package/dist/Select/Select.js +234 -185
  174. package/dist/Select/Select.module.css.js +5 -10
  175. package/dist/SelectPanel/SelectPanel.d.ts +1 -0
  176. package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
  177. package/dist/SelectPanel/SelectPanel.js +829 -620
  178. package/dist/SelectPanel/SelectPanel.module.css.js +5 -27
  179. package/dist/SelectPanel/SelectPanelMessage.js +39 -37
  180. package/dist/SelectPanel/index.d.ts +1 -0
  181. package/dist/SelectPanel/index.d.ts.map +1 -1
  182. package/dist/SideNav.js +47 -24
  183. package/dist/SideNav.module.css.js +5 -12
  184. package/dist/Skeleton/SkeletonBox.js +111 -94
  185. package/dist/Skeleton/SkeletonBox.module.css.js +5 -8
  186. package/dist/SkeletonAvatar/SkeletonAvatar.js +120 -95
  187. package/dist/SkeletonAvatar/SkeletonAvatar.module.css.js +5 -5
  188. package/dist/SkeletonText/SkeletonText.js +137 -114
  189. package/dist/SkeletonText/SkeletonText.module.css.js +5 -8
  190. package/dist/Spinner/Spinner.js +211 -183
  191. package/dist/Spinner/Spinner.module.css.js +5 -9
  192. package/dist/SplitPageLayout/SplitPageLayout.js +276 -215
  193. package/dist/Stack/Stack.js +255 -207
  194. package/dist/Stack/Stack.module.css.js +5 -8
  195. package/dist/Stack/index.js +6 -4
  196. package/dist/StateLabel/StateLabel.js +123 -110
  197. package/dist/StateLabel/StateLabel.module.css.js +5 -8
  198. package/dist/SubNav/SubNav.js +197 -159
  199. package/dist/SubNav/SubNav.module.css.js +5 -11
  200. package/dist/TabNav/TabNav.js +199 -167
  201. package/dist/TabNav/TabNav.module.css.js +5 -10
  202. package/dist/Text/Text.js +67 -56
  203. package/dist/Text/Text.module.css.js +5 -5
  204. package/dist/TextInput/TextInput.js +228 -195
  205. package/dist/TextInput/TextInput.module.css.js +5 -8
  206. package/dist/TextInputWithTokens/TextInputWithTokens.js +673 -567
  207. package/dist/TextInputWithTokens/TextInputWithTokens.module.css.js +5 -14
  208. package/dist/Textarea/TextArea.module.css.js +5 -9
  209. package/dist/Textarea/Textarea.js +294 -264
  210. package/dist/ThemeProvider.js +257 -199
  211. package/dist/Timeline/Timeline.js +247 -204
  212. package/dist/Timeline/Timeline.module.css.js +5 -12
  213. package/dist/ToggleSwitch/ToggleSwitch.js +471 -403
  214. package/dist/ToggleSwitch/ToggleSwitch.module.css.js +5 -16
  215. package/dist/Token/IssueLabelToken.js +297 -256
  216. package/dist/Token/IssueLabelToken.module.css.js +5 -8
  217. package/dist/Token/Token.js +280 -232
  218. package/dist/Token/Token.module.css.js +5 -9
  219. package/dist/Token/TokenBase.js +126 -99
  220. package/dist/Token/TokenBase.module.css.js +5 -5
  221. package/dist/Token/_RemoveTokenButton.js +48 -27
  222. package/dist/Token/_RemoveTokenButton.module.css.js +5 -5
  223. package/dist/Token/_TokenTextContainer.js +65 -54
  224. package/dist/Token/_TokenTextContainer.module.css.js +5 -5
  225. package/dist/Tooltip/Tooltip.js +56 -49
  226. package/dist/Tooltip/Tooltip.module.css.js +5 -20
  227. package/dist/TooltipV2/Tooltip.js +305 -222
  228. package/dist/TooltipV2/Tooltip.module.css.js +5 -11
  229. package/dist/TopicTag/TopicTag.js +55 -46
  230. package/dist/TopicTag/TopicTag.module.css.js +5 -5
  231. package/dist/TopicTag/TopicTagGroup.js +48 -40
  232. package/dist/TopicTag/TopicTagGroup.module.css.js +5 -5
  233. package/dist/TopicTag/index.js +7 -5
  234. package/dist/TreeView/TreeView.js +1414 -1082
  235. package/dist/TreeView/TreeView.module.css.js +5 -24
  236. package/dist/TreeView/shared.js +9 -10
  237. package/dist/TreeView/useRovingTabIndex.js +203 -129
  238. package/dist/TreeView/useTreeItemCache.js +79 -64
  239. package/dist/TreeView/useTypeahead.js +112 -90
  240. package/dist/Truncate/Truncate.js +33 -21
  241. package/dist/Truncate/Truncate.module.css.js +5 -5
  242. package/dist/UnderlineNav/UnderlineNav.js +375 -278
  243. package/dist/UnderlineNav/UnderlineNav.module.css.js +5 -8
  244. package/dist/UnderlineNav/UnderlineNavContext.js +8 -8
  245. package/dist/UnderlineNav/UnderlineNavItem.js +72 -56
  246. package/dist/UnderlineNav/UnderlineNavItem.module.css.js +5 -5
  247. package/dist/UnderlineNav/index.js +7 -5
  248. package/dist/UnderlineNav/styles.js +15 -11
  249. package/dist/VisuallyHidden/VisuallyHidden.js +49 -51
  250. package/dist/VisuallyHidden/VisuallyHidden.module.css.js +5 -5
  251. package/dist/_VisuallyHidden.js +62 -50
  252. package/dist/_VisuallyHidden.module.css.js +5 -5
  253. package/dist/deprecated/ActionList/Divider.js +23 -23
  254. package/dist/deprecated/ActionList/Divider.module.css.js +5 -5
  255. package/dist/deprecated/ActionList/Group.js +50 -43
  256. package/dist/deprecated/ActionList/Header.js +81 -69
  257. package/dist/deprecated/ActionList/Header.module.css.js +5 -5
  258. package/dist/deprecated/ActionList/Item.js +352 -308
  259. package/dist/deprecated/ActionList/Item.module.css.js +5 -18
  260. package/dist/deprecated/ActionList/List.js +196 -157
  261. package/dist/deprecated/ActionList/List.module.css.js +5 -5
  262. package/dist/deprecated/ActionList/index.js +14 -14
  263. package/dist/deprecated/ActionMenu.js +190 -159
  264. package/dist/deprecated/DialogV1/Dialog.js +200 -166
  265. package/dist/deprecated/DialogV1/Dialog.module.css.js +5 -11
  266. package/dist/deprecated/FilteredSearch/FilteredSearch.js +51 -43
  267. package/dist/deprecated/FilteredSearch/FilteredSearch.module.css.js +5 -5
  268. package/dist/deprecated/UnderlineNav/UnderlineNav.js +160 -132
  269. package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +5 -14
  270. package/dist/deprecated/index.js +9 -20
  271. package/dist/experimental/IssueLabel/IssueLabel.js +158 -134
  272. package/dist/experimental/IssueLabel/IssueLabel.module.css.js +5 -5
  273. package/dist/experimental/SelectPanel2/SelectPanel.js +567 -419
  274. package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +5 -32
  275. package/dist/experimental/Tabs/Tabs.js +297 -234
  276. package/dist/experimental/UnderlinePanels/UnderlinePanels.js +215 -165
  277. package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +5 -5
  278. package/dist/experimental/index.d.ts +2 -2
  279. package/dist/experimental/index.d.ts.map +1 -1
  280. package/dist/experimental/index.js +34 -44
  281. package/dist/hooks/useAnchoredPosition.js +144 -123
  282. package/dist/hooks/useControllableState.js +59 -34
  283. package/dist/hooks/useDetails.js +99 -84
  284. package/dist/hooks/useDialog.js +178 -140
  285. package/dist/hooks/useFocusTrap.js +71 -57
  286. package/dist/hooks/useFocusZone.js +38 -32
  287. package/dist/hooks/useId.js +16 -14
  288. package/dist/hooks/useIsMacOS.js +26 -21
  289. package/dist/hooks/useMedia.js +68 -54
  290. package/dist/hooks/useMenuInitialFocus.js +62 -65
  291. package/dist/hooks/useMenuKeyboardNavigation.js +126 -129
  292. package/dist/hooks/useMergedRefs.js +78 -63
  293. package/dist/hooks/useMnemonics.js +107 -77
  294. package/dist/hooks/useOnEscapePress.js +56 -45
  295. package/dist/hooks/useOnOutsideClick.js +63 -32
  296. package/dist/hooks/useOpenAndCloseFocus.js +43 -40
  297. package/dist/hooks/useOverflow.js +36 -32
  298. package/dist/hooks/useOverlay.js +75 -56
  299. package/dist/hooks/useProvidedRefOrCreate.js +24 -24
  300. package/dist/hooks/useProvidedStateOrCreate.js +39 -33
  301. package/dist/hooks/useRefObjectAsForwardedRef.js +32 -30
  302. package/dist/hooks/useRenderForcingRef.js +46 -42
  303. package/dist/hooks/useResizeObserver.js +43 -32
  304. package/dist/hooks/useResponsiveValue.js +57 -37
  305. package/dist/hooks/useSafeTimeout.js +29 -26
  306. package/dist/hooks/useScrollFlash.js +23 -16
  307. package/dist/hooks/useSlots.js +136 -102
  308. package/dist/hooks/useSyncedState.js +37 -31
  309. package/dist/index.d.ts +2 -2
  310. package/dist/index.d.ts.map +1 -1
  311. package/dist/index.js +86 -88
  312. package/dist/internal/components/ButtonReset.js +50 -45
  313. package/dist/internal/components/ButtonReset.module.css.js +5 -5
  314. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +105 -79
  315. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.module.css.js +5 -12
  316. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +21 -16
  317. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.js +4 -4
  318. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +35 -26
  319. package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +19 -14
  320. package/dist/internal/components/ConditionalWrapper.js +51 -41
  321. package/dist/internal/components/InputLabel.js +113 -92
  322. package/dist/internal/components/InputLabel.module.css.js +5 -8
  323. package/dist/internal/components/InputValidation.js +87 -67
  324. package/dist/internal/components/InputValidation.module.css.js +5 -9
  325. package/dist/internal/components/TextInputInnerAction.js +173 -134
  326. package/dist/internal/components/TextInputInnerAction.module.css.js +5 -9
  327. package/dist/internal/components/TextInputInnerVisualSlot.js +110 -89
  328. package/dist/internal/components/TextInputInnerVisualSlot.module.css.js +5 -11
  329. package/dist/internal/components/TextInputWrapper.js +230 -187
  330. package/dist/internal/components/TextInputWrapper.module.css.js +5 -8
  331. package/dist/internal/components/UnderlineTabbedInterface.js +238 -191
  332. package/dist/internal/components/UnderlineTabbedInterface.module.css.js +5 -11
  333. package/dist/internal/components/UnstyledTextInput.js +47 -40
  334. package/dist/internal/components/UnstyledTextInput.module.css.js +5 -5
  335. package/dist/internal/components/ValidationAnimationContainer.js +66 -55
  336. package/dist/internal/components/ValidationAnimationContainer.module.css.js +5 -8
  337. package/dist/internal/hooks/useEffectCallback.js +38 -35
  338. package/dist/internal/hooks/useEffectOnce.js +25 -23
  339. package/dist/internal/utils/getResponsiveAttributes.js +26 -23
  340. package/dist/internal/utils/hasInteractiveNodes.js +46 -34
  341. package/dist/legacy-theme/ts/color-schemes.js +4732 -4250
  342. package/dist/live-region/Announce.js +183 -144
  343. package/dist/live-region/AriaAlert.js +22 -20
  344. package/dist/live-region/AriaStatus.js +22 -20
  345. package/dist/next/index.js +1 -3
  346. package/dist/test-helpers.js +62 -40
  347. package/dist/theme.js +47 -83
  348. package/dist/utils/character-counter.js +63 -45
  349. package/dist/utils/create-component.js +16 -15
  350. package/dist/utils/descendant-registry.js +218 -182
  351. package/dist/utils/environment.js +7 -7
  352. package/dist/utils/getBreakpointDeclarations.js +10 -9
  353. package/dist/utils/invariant.js +23 -17
  354. package/dist/utils/is-slot.js +11 -10
  355. package/dist/utils/isNumeric.js +3 -3
  356. package/dist/utils/modern-polymorphic.js +20 -12
  357. package/dist/utils/scroll.js +11 -8
  358. package/dist/utils/theme.js +10 -5
  359. package/dist/utils/useIsomorphicLayoutEffect.js +9 -4
  360. package/dist/utils/warning.js +21 -14
  361. package/package.json +10 -5
  362. package/dist/ActionList/ActionList-53389912.css.map +0 -1
@@ -1,100 +1,118 @@
1
- import { RadioGroupContext } from "../RadioGroup/RadioGroup.js";
2
- import shared_module_css_default from "../Checkbox/shared.module.css.js";
3
- import Radio_module_css_default from "./Radio.module.css.js";
4
- import { c } from "react-compiler-runtime";
5
- import { clsx } from "clsx";
6
- import { jsx } from "react/jsx-runtime";
7
- import React, { useContext } from "react";
8
- //#region src/Radio/Radio.tsx
1
+ import { c } from 'react-compiler-runtime';
2
+ import React, { useContext } from 'react';
3
+ import { RadioGroupContext } from '../RadioGroup/RadioGroup.js';
4
+ import { clsx } from 'clsx';
5
+ import sharedClasses from '../Checkbox/shared.module.css.js';
6
+ import classes from './Radio.module.css.js';
7
+ import { jsx } from 'react/jsx-runtime';
8
+
9
9
  /**
10
- * An accessible, native radio component for selecting one option from a list.
11
- */
12
- const Radio = /* @__PURE__ */ React.forwardRef((t0, ref) => {
13
- const $ = c(26);
14
- let checked;
15
- let className;
16
- let disabled;
17
- let nameProp;
18
- let onChange;
19
- let required;
20
- let rest;
21
- let t1;
22
- let value;
23
- if ($[0] !== t0) {
24
- ({checked, disabled, name: nameProp, onChange, required, value, className, "aria-hidden": t1, ...rest} = t0);
25
- $[0] = t0;
26
- $[1] = checked;
27
- $[2] = className;
28
- $[3] = disabled;
29
- $[4] = nameProp;
30
- $[5] = onChange;
31
- $[6] = required;
32
- $[7] = rest;
33
- $[8] = t1;
34
- $[9] = value;
35
- } else {
36
- checked = $[1];
37
- className = $[2];
38
- disabled = $[3];
39
- nameProp = $[4];
40
- onChange = $[5];
41
- required = $[6];
42
- rest = $[7];
43
- t1 = $[8];
44
- value = $[9];
45
- }
46
- const ariaHidden = t1 === void 0 ? false : t1;
47
- const radioGroupContext = useContext(RadioGroupContext);
48
- let t2;
49
- if ($[10] !== onChange || $[11] !== radioGroupContext) {
50
- t2 = (e) => {
51
- !(radioGroupContext === null || radioGroupContext === void 0) && radioGroupContext.onChange && radioGroupContext.onChange(e);
52
- onChange && onChange(e);
53
- };
54
- $[10] = onChange;
55
- $[11] = radioGroupContext;
56
- $[12] = t2;
57
- } else t2 = $[12];
58
- const handleOnChange = t2;
59
- const name = nameProp || (radioGroupContext === null || radioGroupContext === void 0 ? void 0 : radioGroupContext.name);
60
- if (!name && !ariaHidden) console.warn("A radio input must have a `name` attribute. Pass `name` as a prop directly to each Radio, or nest them in a `RadioGroup` component with a `name` prop");
61
- const t3 = checked ? "true" : "false";
62
- let t4;
63
- if ($[13] !== className) {
64
- t4 = clsx(className, shared_module_css_default.Input, Radio_module_css_default.Radio);
65
- $[13] = className;
66
- $[14] = t4;
67
- } else t4 = $[14];
68
- let t5;
69
- if ($[15] !== checked || $[16] !== disabled || $[17] !== handleOnChange || $[18] !== name || $[19] !== ref || $[20] !== required || $[21] !== rest || $[22] !== t3 || $[23] !== t4 || $[24] !== value) {
70
- t5 = /* @__PURE__ */ jsx("input", {
71
- type: "radio",
72
- value,
73
- name,
74
- ref,
75
- disabled,
76
- checked,
77
- "aria-checked": t3,
78
- required,
79
- onChange: handleOnChange,
80
- className: t4,
81
- ...rest
82
- });
83
- $[15] = checked;
84
- $[16] = disabled;
85
- $[17] = handleOnChange;
86
- $[18] = name;
87
- $[19] = ref;
88
- $[20] = required;
89
- $[21] = rest;
90
- $[22] = t3;
91
- $[23] = t4;
92
- $[24] = value;
93
- $[25] = t5;
94
- } else t5 = $[25];
95
- return t5;
10
+ * An accessible, native radio component for selecting one option from a list.
11
+ */
12
+ const Radio = /*#__PURE__*/React.forwardRef((t0, ref) => {
13
+ const $ = c(26);
14
+ let checked;
15
+ let className;
16
+ let disabled;
17
+ let nameProp;
18
+ let onChange;
19
+ let required;
20
+ let rest;
21
+ let t1;
22
+ let value;
23
+ if ($[0] !== t0) {
24
+ ({
25
+ checked,
26
+ disabled,
27
+ name: nameProp,
28
+ onChange,
29
+ required,
30
+ value,
31
+ className,
32
+ "aria-hidden": t1,
33
+ ...rest
34
+ } = t0);
35
+ $[0] = t0;
36
+ $[1] = checked;
37
+ $[2] = className;
38
+ $[3] = disabled;
39
+ $[4] = nameProp;
40
+ $[5] = onChange;
41
+ $[6] = required;
42
+ $[7] = rest;
43
+ $[8] = t1;
44
+ $[9] = value;
45
+ } else {
46
+ checked = $[1];
47
+ className = $[2];
48
+ disabled = $[3];
49
+ nameProp = $[4];
50
+ onChange = $[5];
51
+ required = $[6];
52
+ rest = $[7];
53
+ t1 = $[8];
54
+ value = $[9];
55
+ }
56
+ const ariaHidden = t1 === undefined ? false : t1;
57
+ const radioGroupContext = useContext(RadioGroupContext);
58
+ let t2;
59
+ if ($[10] !== onChange || $[11] !== radioGroupContext) {
60
+ t2 = e => {
61
+ (radioGroupContext === null || radioGroupContext === void 0 ? void 0 : radioGroupContext.onChange) && radioGroupContext.onChange(e);
62
+ onChange && onChange(e);
63
+ };
64
+ $[10] = onChange;
65
+ $[11] = radioGroupContext;
66
+ $[12] = t2;
67
+ } else {
68
+ t2 = $[12];
69
+ }
70
+ const handleOnChange = t2;
71
+ const name = nameProp || (radioGroupContext === null || radioGroupContext === void 0 ? void 0 : radioGroupContext.name);
72
+ if (!name && !ariaHidden) {
73
+ console.warn("A radio input must have a `name` attribute. Pass `name` as a prop directly to each Radio, or nest them in a `RadioGroup` component with a `name` prop");
74
+ }
75
+ const t3 = checked ? "true" : "false";
76
+ let t4;
77
+ if ($[13] !== className) {
78
+ t4 = clsx(className, sharedClasses.Input, classes.Radio);
79
+ $[13] = className;
80
+ $[14] = t4;
81
+ } else {
82
+ t4 = $[14];
83
+ }
84
+ let t5;
85
+ if ($[15] !== checked || $[16] !== disabled || $[17] !== handleOnChange || $[18] !== name || $[19] !== ref || $[20] !== required || $[21] !== rest || $[22] !== t3 || $[23] !== t4 || $[24] !== value) {
86
+ t5 = /*#__PURE__*/jsx("input", {
87
+ type: "radio",
88
+ value: value,
89
+ name: name,
90
+ ref: ref,
91
+ disabled: disabled,
92
+ checked: checked,
93
+ "aria-checked": t3,
94
+ required: required,
95
+ onChange: handleOnChange,
96
+ className: t4,
97
+ ...rest
98
+ });
99
+ $[15] = checked;
100
+ $[16] = disabled;
101
+ $[17] = handleOnChange;
102
+ $[18] = name;
103
+ $[19] = ref;
104
+ $[20] = required;
105
+ $[21] = rest;
106
+ $[22] = t3;
107
+ $[23] = t4;
108
+ $[24] = value;
109
+ $[25] = t5;
110
+ } else {
111
+ t5 = $[25];
112
+ }
113
+ return t5;
96
114
  });
97
- Radio.displayName = "Radio";
98
- Radio.__SLOT__ = Symbol("Radio");
99
- //#endregion
115
+ Radio.displayName = 'Radio';
116
+ Radio.__SLOT__ = Symbol('Radio');
117
+
100
118
  export { Radio as default };
@@ -1,5 +1,5 @@
1
- import "./Radio-4319e717.css";
2
- //#region src/Radio/Radio.module.css.js
3
- var Radio_module_css_default = { "Radio": "prc-Radio-Radio-h1gb9" };
4
- //#endregion
5
- export { Radio_module_css_default as default };
1
+ import './Radio-4319e717.css';
2
+
3
+ var classes = {"Radio":"prc-Radio-Radio-h1gb9"};
4
+
5
+ export { classes as default };
@@ -1,103 +1,122 @@
1
- import { useRenderForcingRef } from "../hooks/useRenderForcingRef.js";
2
- import CheckboxOrRadioGroupCaption from "../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js";
3
- import CheckboxOrRadioGroupLabel from "../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js";
4
- import CheckboxOrRadioGroupValidation from "../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js";
5
- import CheckboxOrRadioGroup_default from "../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js";
6
- import { c } from "react-compiler-runtime";
7
- import { jsx } from "react/jsx-runtime";
8
- import { createContext } from "react";
9
- //#region src/RadioGroup/RadioGroup.tsx
10
- const RadioGroupContext = /* @__PURE__ */ createContext(null);
11
- const RadioGroup = (t0) => {
12
- const $ = c(23);
13
- let children;
14
- let disabled;
15
- let name;
16
- let onChange;
17
- let rest;
18
- if ($[0] !== t0) {
19
- ({children, disabled, onChange, name, ...rest} = t0);
20
- $[0] = t0;
21
- $[1] = children;
22
- $[2] = disabled;
23
- $[3] = name;
24
- $[4] = onChange;
25
- $[5] = rest;
26
- } else {
27
- children = $[1];
28
- disabled = $[2];
29
- name = $[3];
30
- onChange = $[4];
31
- rest = $[5];
32
- }
33
- const [selectedRadioValue, setSelectedRadioValue] = useRenderForcingRef(null);
34
- let t1;
35
- if ($[6] !== setSelectedRadioValue) {
36
- t1 = (e) => {
37
- const { value, checked } = e.currentTarget;
38
- if (checked) {
39
- setSelectedRadioValue(value);
40
- return;
41
- }
42
- };
43
- $[6] = setSelectedRadioValue;
44
- $[7] = t1;
45
- } else t1 = $[7];
46
- const updateSelectedCheckboxes = t1;
47
- let t2;
48
- if ($[8] !== onChange || $[9] !== selectedRadioValue || $[10] !== updateSelectedCheckboxes) {
49
- t2 = (e_0) => {
50
- if (onChange) {
51
- updateSelectedCheckboxes(e_0);
52
- onChange(selectedRadioValue.current, e_0);
53
- }
54
- };
55
- $[8] = onChange;
56
- $[9] = selectedRadioValue;
57
- $[10] = updateSelectedCheckboxes;
58
- $[11] = t2;
59
- } else t2 = $[11];
60
- let t3;
61
- if ($[12] !== disabled || $[13] !== name || $[14] !== t2) {
62
- t3 = {
63
- disabled,
64
- name,
65
- onChange: t2
66
- };
67
- $[12] = disabled;
68
- $[13] = name;
69
- $[14] = t2;
70
- $[15] = t3;
71
- } else t3 = $[15];
72
- let t4;
73
- if ($[16] !== children || $[17] !== disabled || $[18] !== rest) {
74
- t4 = /* @__PURE__ */ jsx(CheckboxOrRadioGroup_default, {
75
- disabled,
76
- ...rest,
77
- children
78
- });
79
- $[16] = children;
80
- $[17] = disabled;
81
- $[18] = rest;
82
- $[19] = t4;
83
- } else t4 = $[19];
84
- let t5;
85
- if ($[20] !== t3 || $[21] !== t4) {
86
- t5 = /* @__PURE__ */ jsx(RadioGroupContext.Provider, {
87
- value: t3,
88
- children: t4
89
- });
90
- $[20] = t3;
91
- $[21] = t4;
92
- $[22] = t5;
93
- } else t5 = $[22];
94
- return t5;
1
+ import { c } from 'react-compiler-runtime';
2
+ import { createContext } from 'react';
3
+ import CheckboxOrRadioGroupCaption from '../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js';
4
+ import CheckboxOrRadioGroupLabel from '../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js';
5
+ import CheckboxOrRadioGroupValidation from '../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js';
6
+ import { jsx } from 'react/jsx-runtime';
7
+ import { useRenderForcingRef } from '../hooks/useRenderForcingRef.js';
8
+ import CheckboxOrRadioGroup from '../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js';
9
+
10
+ const RadioGroupContext = /*#__PURE__*/createContext(null);
11
+ const RadioGroup = t0 => {
12
+ const $ = c(23);
13
+ let children;
14
+ let disabled;
15
+ let name;
16
+ let onChange;
17
+ let rest;
18
+ if ($[0] !== t0) {
19
+ ({
20
+ children,
21
+ disabled,
22
+ onChange,
23
+ name,
24
+ ...rest
25
+ } = t0);
26
+ $[0] = t0;
27
+ $[1] = children;
28
+ $[2] = disabled;
29
+ $[3] = name;
30
+ $[4] = onChange;
31
+ $[5] = rest;
32
+ } else {
33
+ children = $[1];
34
+ disabled = $[2];
35
+ name = $[3];
36
+ onChange = $[4];
37
+ rest = $[5];
38
+ }
39
+ const [selectedRadioValue, setSelectedRadioValue] = useRenderForcingRef(null);
40
+ let t1;
41
+ if ($[6] !== setSelectedRadioValue) {
42
+ t1 = e => {
43
+ const {
44
+ value,
45
+ checked
46
+ } = e.currentTarget;
47
+ if (checked) {
48
+ setSelectedRadioValue(value);
49
+ return;
50
+ }
51
+ };
52
+ $[6] = setSelectedRadioValue;
53
+ $[7] = t1;
54
+ } else {
55
+ t1 = $[7];
56
+ }
57
+ const updateSelectedCheckboxes = t1;
58
+ let t2;
59
+ if ($[8] !== onChange || $[9] !== selectedRadioValue || $[10] !== updateSelectedCheckboxes) {
60
+ t2 = e_0 => {
61
+ if (onChange) {
62
+ updateSelectedCheckboxes(e_0);
63
+ onChange(selectedRadioValue.current, e_0);
64
+ }
65
+ };
66
+ $[8] = onChange;
67
+ $[9] = selectedRadioValue;
68
+ $[10] = updateSelectedCheckboxes;
69
+ $[11] = t2;
70
+ } else {
71
+ t2 = $[11];
72
+ }
73
+ let t3;
74
+ if ($[12] !== disabled || $[13] !== name || $[14] !== t2) {
75
+ t3 = {
76
+ disabled,
77
+ name,
78
+ onChange: t2
79
+ };
80
+ $[12] = disabled;
81
+ $[13] = name;
82
+ $[14] = t2;
83
+ $[15] = t3;
84
+ } else {
85
+ t3 = $[15];
86
+ }
87
+ let t4;
88
+ if ($[16] !== children || $[17] !== disabled || $[18] !== rest) {
89
+ t4 = /*#__PURE__*/jsx(CheckboxOrRadioGroup, {
90
+ disabled: disabled,
91
+ ...rest,
92
+ children: children
93
+ });
94
+ $[16] = children;
95
+ $[17] = disabled;
96
+ $[18] = rest;
97
+ $[19] = t4;
98
+ } else {
99
+ t4 = $[19];
100
+ }
101
+ let t5;
102
+ if ($[20] !== t3 || $[21] !== t4) {
103
+ t5 = /*#__PURE__*/jsx(RadioGroupContext.Provider, {
104
+ value: t3,
105
+ children: t4
106
+ });
107
+ $[20] = t3;
108
+ $[21] = t4;
109
+ $[22] = t5;
110
+ } else {
111
+ t5 = $[22];
112
+ }
113
+ return t5;
95
114
  };
96
115
  var RadioGroup_default = Object.assign(RadioGroup, {
97
- __SLOT__: Symbol("RadioGroup"),
98
- Caption: CheckboxOrRadioGroupCaption,
99
- Label: CheckboxOrRadioGroupLabel,
100
- Validation: CheckboxOrRadioGroupValidation
116
+ __SLOT__: Symbol('RadioGroup'),
117
+ Caption: CheckboxOrRadioGroupCaption,
118
+ Label: CheckboxOrRadioGroupLabel,
119
+ Validation: CheckboxOrRadioGroupValidation
101
120
  });
102
- //#endregion
121
+
103
122
  export { RadioGroupContext, RadioGroup_default as default };
@@ -1,69 +1,81 @@
1
- import createComponent from "../utils/create-component.js";
2
- import { c } from "react-compiler-runtime";
3
- import { jsx } from "react/jsx-runtime";
4
- import { RelativeTimeElement } from "@github/relative-time-element";
5
- //#region src/RelativeTime/RelativeTime.tsx
6
- const RelativeTimeComponent = createComponent(RelativeTimeElement, "relative-time");
1
+ import { c } from 'react-compiler-runtime';
2
+ import { RelativeTimeElement } from '@github/relative-time-element';
3
+ import { createComponent } from '../utils/create-component.js';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ const RelativeTimeComponent = createComponent(RelativeTimeElement, 'relative-time');
7
7
  const localeOptions = {
8
- month: "short",
9
- day: "numeric",
10
- year: "numeric"
8
+ month: 'short',
9
+ day: 'numeric',
10
+ year: 'numeric'
11
11
  };
12
12
  function RelativeTime(t0) {
13
- const $ = c(16);
14
- let children;
15
- let date;
16
- let datetime;
17
- let noTitle;
18
- let props;
19
- if ($[0] !== t0) {
20
- ({date, datetime, children, noTitle, ...props} = t0);
21
- $[0] = t0;
22
- $[1] = children;
23
- $[2] = date;
24
- $[3] = datetime;
25
- $[4] = noTitle;
26
- $[5] = props;
27
- } else {
28
- children = $[1];
29
- date = $[2];
30
- datetime = $[3];
31
- noTitle = $[4];
32
- props = $[5];
33
- }
34
- if (datetime) {
35
- let t1;
36
- if ($[6] !== datetime) {
37
- t1 = new Date(datetime);
38
- $[6] = datetime;
39
- $[7] = t1;
40
- } else t1 = $[7];
41
- date = t1;
42
- }
43
- const t1 = noTitle ? "" : void 0;
44
- let t2;
45
- if ($[8] !== children || $[9] !== date) {
46
- var _date;
47
- t2 = children || ((_date = date) === null || _date === void 0 ? void 0 : _date.toLocaleDateString("en", localeOptions)) || "";
48
- $[8] = children;
49
- $[9] = date;
50
- $[10] = t2;
51
- } else t2 = $[10];
52
- let t3;
53
- if ($[11] !== date || $[12] !== props || $[13] !== t1 || $[14] !== t2) {
54
- t3 = /* @__PURE__ */ jsx(RelativeTimeComponent, {
55
- ...props,
56
- date,
57
- "no-title": t1,
58
- children: t2
59
- });
60
- $[11] = date;
61
- $[12] = props;
62
- $[13] = t1;
63
- $[14] = t2;
64
- $[15] = t3;
65
- } else t3 = $[15];
66
- return t3;
13
+ const $ = c(16);
14
+ let children;
15
+ let date;
16
+ let datetime;
17
+ let noTitle;
18
+ let props;
19
+ if ($[0] !== t0) {
20
+ ({
21
+ date,
22
+ datetime,
23
+ children,
24
+ noTitle,
25
+ ...props
26
+ } = t0);
27
+ $[0] = t0;
28
+ $[1] = children;
29
+ $[2] = date;
30
+ $[3] = datetime;
31
+ $[4] = noTitle;
32
+ $[5] = props;
33
+ } else {
34
+ children = $[1];
35
+ date = $[2];
36
+ datetime = $[3];
37
+ noTitle = $[4];
38
+ props = $[5];
39
+ }
40
+ if (datetime) {
41
+ let t1;
42
+ if ($[6] !== datetime) {
43
+ t1 = new Date(datetime);
44
+ $[6] = datetime;
45
+ $[7] = t1;
46
+ } else {
47
+ t1 = $[7];
48
+ }
49
+ date = t1;
50
+ }
51
+ const t1 = noTitle ? "" : undefined;
52
+ let t2;
53
+ if ($[8] !== children || $[9] !== date) {
54
+ var _date;
55
+ t2 = children || ((_date = date) === null || _date === void 0 ? void 0 : _date.toLocaleDateString("en", localeOptions)) || "";
56
+ $[8] = children;
57
+ $[9] = date;
58
+ $[10] = t2;
59
+ } else {
60
+ t2 = $[10];
61
+ }
62
+ let t3;
63
+ if ($[11] !== date || $[12] !== props || $[13] !== t1 || $[14] !== t2) {
64
+ t3 = /*#__PURE__*/jsx(RelativeTimeComponent, {
65
+ ...props,
66
+ date: date,
67
+ "no-title": t1,
68
+ children: t2
69
+ });
70
+ $[11] = date;
71
+ $[12] = props;
72
+ $[13] = t1;
73
+ $[14] = t2;
74
+ $[15] = t3;
75
+ } else {
76
+ t3 = $[15];
77
+ }
78
+ return t3;
67
79
  }
68
- //#endregion
80
+
69
81
  export { RelativeTime as default };