@primer/components 0.0.0-2021983515 → 0.0.0-2022530194733

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 (596) hide show
  1. package/CHANGELOG.md +105 -492
  2. package/README.md +16 -16
  3. package/codemods/lib/modifyProps.js +7 -9
  4. package/codemods/lib/prettify.js +1 -1
  5. package/codemods/lib/replaceImportSource.js +5 -5
  6. package/dist/browser.esm.js +889 -1279
  7. package/dist/browser.esm.js.map +1 -1
  8. package/dist/browser.umd.js +839 -1234
  9. package/dist/browser.umd.js.map +1 -1
  10. package/index.d.ts +940 -0
  11. package/lib/AvatarPair.js +5 -6
  12. package/lib/AvatarStack.js +10 -10
  13. package/lib/BaseStyles.js +19 -18
  14. package/lib/BorderBox.js +5 -4
  15. package/lib/Box.js +2 -2
  16. package/lib/BranchName.js +1 -1
  17. package/lib/{Breadcrumbs.js → Breadcrumb.js} +23 -33
  18. package/lib/Button/Button.js +3 -3
  19. package/lib/Button/ButtonClose.js +4 -4
  20. package/lib/Button/ButtonDanger.js +2 -2
  21. package/lib/Button/ButtonInvisible.js +3 -3
  22. package/lib/Button/ButtonOutline.js +2 -2
  23. package/lib/Button/ButtonPrimary.js +2 -2
  24. package/lib/Button/ButtonTableList.js +1 -1
  25. package/lib/CircleBadge.js +1 -1
  26. package/lib/CircleOcticon.js +7 -9
  27. package/lib/CounterLabel.js +2 -2
  28. package/lib/Dialog.js +14 -13
  29. package/lib/Dropdown.js +2 -2
  30. package/lib/DropdownStyles.js +6 -6
  31. package/lib/FilterList.js +1 -1
  32. package/lib/Flash.js +1 -1
  33. package/lib/Flex.js +0 -3
  34. package/lib/Grid.js +3 -4
  35. package/lib/Header.js +2 -3
  36. package/lib/Label.js +4 -4
  37. package/lib/Link.js +12 -1
  38. package/lib/Overlay.js +36 -126
  39. package/lib/Pagehead.js +1 -1
  40. package/lib/Pagination/Pagination.js +2 -3
  41. package/lib/Popover.js +3 -3
  42. package/lib/Portal/Portal.js +12 -20
  43. package/lib/Position.js +27 -46
  44. package/lib/ProgressBar.js +1 -1
  45. package/lib/SelectMenu/SelectMenu.js +4 -4
  46. package/lib/SelectMenu/SelectMenuContext.js +1 -1
  47. package/lib/SelectMenu/SelectMenuDivider.js +3 -3
  48. package/lib/SelectMenu/SelectMenuFilter.js +6 -6
  49. package/lib/SelectMenu/SelectMenuFooter.js +3 -3
  50. package/lib/SelectMenu/SelectMenuHeader.js +2 -2
  51. package/lib/SelectMenu/SelectMenuItem.js +4 -4
  52. package/lib/SelectMenu/SelectMenuList.js +3 -3
  53. package/lib/SelectMenu/SelectMenuLoadingAnimation.js +15 -4
  54. package/lib/SelectMenu/SelectMenuModal.js +7 -7
  55. package/lib/SelectMenu/SelectMenuTab.js +3 -3
  56. package/lib/SelectMenu/SelectMenuTabPanel.js +3 -3
  57. package/lib/SelectMenu/SelectMenuTabs.js +2 -2
  58. package/lib/SelectMenu/hooks/useKeyboardNav.js +0 -2
  59. package/lib/SideNav.js +12 -20
  60. package/lib/StateLabel.js +4 -4
  61. package/lib/SubNav.js +3 -5
  62. package/lib/TabNav.js +3 -3
  63. package/lib/TextInput.js +59 -22
  64. package/lib/ThemeProvider.js +15 -32
  65. package/lib/Timeline.js +29 -24
  66. package/lib/Tooltip.js +1 -2
  67. package/lib/UnderlineNav.js +2 -2
  68. package/lib/behaviors/anchoredPosition.js +9 -17
  69. package/lib/behaviors/focusTrap.js +14 -32
  70. package/lib/behaviors/focusZone.js +148 -218
  71. package/lib/constants.js +2 -3
  72. package/lib/hooks/index.js +1 -9
  73. package/lib/hooks/useAnchoredPosition.js +4 -11
  74. package/lib/hooks/useDialog.js +1 -1
  75. package/lib/hooks/useFocusTrap.js +8 -26
  76. package/lib/hooks/useFocusZone.js +7 -7
  77. package/lib/hooks/useMouseIntent.js +58 -0
  78. package/lib/hooks/useOnEscapePress.js +10 -53
  79. package/lib/hooks/useOnOutsideClick.js +35 -62
  80. package/lib/hooks/useOpenAndCloseFocus.js +3 -8
  81. package/lib/hooks/useOverlay.js +19 -9
  82. package/lib/hooks/useSafeTimeout.js +0 -1
  83. package/lib/index.js +12 -112
  84. package/lib/polyfills/eventListenerSignal.js +1 -6
  85. package/lib/stories/Button.stories.js +114 -0
  86. package/lib/stories/Overlay.stories.js +102 -0
  87. package/lib/stories/Portal.stories.js +108 -0
  88. package/lib/stories/ThemeProvider.stories.js +95 -0
  89. package/lib/stories/useAnchoredPosition.stories.js +349 -0
  90. package/lib/stories/useFocusTrap.stories.js +278 -0
  91. package/lib/stories/useFocusZone.stories.js +490 -0
  92. package/lib/theme-preval.js +2057 -5148
  93. package/lib/utils/deprecate.js +2 -3
  94. package/lib/utils/isNumeric.js +0 -1
  95. package/lib/utils/iterateFocusableElements.js +1 -1
  96. package/lib/utils/test-deprecations.js +0 -1
  97. package/lib/utils/test-matchers.js +12 -3
  98. package/lib/utils/testing.js +4 -4
  99. package/lib/utils/theme.js +1 -1
  100. package/lib/utils/{types/AriaRole.js → types.js} +0 -0
  101. package/lib/utils/uniqueId.js +0 -1
  102. package/lib-esm/AvatarPair.js +5 -6
  103. package/lib-esm/AvatarStack.js +11 -11
  104. package/lib-esm/BaseStyles.js +16 -16
  105. package/lib-esm/BorderBox.js +3 -5
  106. package/lib-esm/Box.js +2 -2
  107. package/lib-esm/BranchName.js +1 -1
  108. package/lib-esm/{Breadcrumbs.js → Breadcrumb.js} +22 -32
  109. package/lib-esm/Button/Button.js +1 -1
  110. package/lib-esm/Button/ButtonClose.js +2 -2
  111. package/lib-esm/Button/ButtonInvisible.js +1 -1
  112. package/lib-esm/Button/ButtonTableList.js +1 -1
  113. package/lib-esm/CircleBadge.js +1 -1
  114. package/lib-esm/CircleOcticon.js +6 -9
  115. package/lib-esm/CounterLabel.js +2 -2
  116. package/lib-esm/Dialog.js +12 -10
  117. package/lib-esm/Dropdown.js +2 -2
  118. package/lib-esm/DropdownStyles.js +6 -6
  119. package/lib-esm/FilterList.js +1 -1
  120. package/lib-esm/Flash.js +1 -1
  121. package/lib-esm/Flex.js +0 -4
  122. package/lib-esm/Grid.js +2 -5
  123. package/lib-esm/Header.js +0 -1
  124. package/lib-esm/Label.js +2 -2
  125. package/lib-esm/Link.js +12 -1
  126. package/lib-esm/Overlay.js +38 -119
  127. package/lib-esm/Pagehead.js +1 -1
  128. package/lib-esm/Pagination/Pagination.js +2 -3
  129. package/lib-esm/Popover.js +3 -3
  130. package/lib-esm/Portal/Portal.js +12 -19
  131. package/lib-esm/Portal/index.js +1 -1
  132. package/lib-esm/Position.js +20 -45
  133. package/lib-esm/ProgressBar.js +1 -1
  134. package/lib-esm/SelectMenu/SelectMenu.js +3 -3
  135. package/lib-esm/SelectMenu/SelectMenuContext.js +1 -1
  136. package/lib-esm/SelectMenu/SelectMenuDivider.js +1 -1
  137. package/lib-esm/SelectMenu/SelectMenuFilter.js +4 -4
  138. package/lib-esm/SelectMenu/SelectMenuFooter.js +1 -1
  139. package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
  140. package/lib-esm/SelectMenu/SelectMenuItem.js +2 -2
  141. package/lib-esm/SelectMenu/SelectMenuList.js +1 -1
  142. package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +10 -5
  143. package/lib-esm/SelectMenu/SelectMenuModal.js +5 -5
  144. package/lib-esm/SelectMenu/SelectMenuTab.js +1 -1
  145. package/lib-esm/SelectMenu/SelectMenuTabPanel.js +1 -1
  146. package/lib-esm/SelectMenu/hooks/useKeyboardNav.js +0 -2
  147. package/lib-esm/SideNav.js +7 -16
  148. package/lib-esm/StateLabel.js +4 -4
  149. package/lib-esm/SubNav.js +4 -7
  150. package/lib-esm/TabNav.js +4 -5
  151. package/lib-esm/TextInput.js +49 -22
  152. package/lib-esm/ThemeProvider.js +16 -31
  153. package/lib-esm/Timeline.js +24 -19
  154. package/lib-esm/Tooltip.js +1 -2
  155. package/lib-esm/UnderlineNav.js +3 -4
  156. package/lib-esm/behaviors/anchoredPosition.js +9 -17
  157. package/lib-esm/behaviors/focusTrap.js +14 -32
  158. package/lib-esm/behaviors/focusZone.js +148 -213
  159. package/lib-esm/constants.js +1 -2
  160. package/lib-esm/hooks/index.js +1 -2
  161. package/lib-esm/hooks/useAnchoredPosition.js +5 -10
  162. package/lib-esm/hooks/useDialog.js +1 -1
  163. package/lib-esm/hooks/useFocusTrap.js +8 -25
  164. package/lib-esm/hooks/useFocusZone.js +5 -5
  165. package/lib-esm/hooks/useMouseIntent.js +50 -0
  166. package/lib-esm/hooks/useOnEscapePress.js +10 -53
  167. package/lib-esm/hooks/useOnOutsideClick.js +37 -62
  168. package/lib-esm/hooks/useOpenAndCloseFocus.js +3 -8
  169. package/lib-esm/hooks/useOverlay.js +18 -9
  170. package/lib-esm/hooks/useSafeTimeout.js +0 -1
  171. package/lib-esm/index.js +10 -22
  172. package/lib-esm/polyfills/eventListenerSignal.js +1 -6
  173. package/lib-esm/stories/Button.stories.js +79 -0
  174. package/lib-esm/stories/Overlay.stories.js +80 -0
  175. package/lib-esm/stories/Portal.stories.js +72 -0
  176. package/lib-esm/stories/ThemeProvider.stories.js +76 -0
  177. package/lib-esm/stories/useAnchoredPosition.stories.js +311 -0
  178. package/lib-esm/stories/useFocusTrap.stories.js +234 -0
  179. package/lib-esm/stories/useFocusZone.stories.js +445 -0
  180. package/lib-esm/theme-preval.js +2057 -5148
  181. package/lib-esm/utils/deprecate.js +2 -3
  182. package/lib-esm/utils/isNumeric.js +0 -1
  183. package/lib-esm/utils/iterateFocusableElements.js +1 -1
  184. package/lib-esm/utils/test-deprecations.js +1 -1
  185. package/lib-esm/utils/test-matchers.js +11 -3
  186. package/lib-esm/utils/testing.js +6 -6
  187. package/lib-esm/utils/theme.js +1 -1
  188. package/lib-esm/utils/{test-helpers.d.ts → types.js} +0 -0
  189. package/lib-esm/utils/uniqueId.js +0 -1
  190. package/package.json +95 -103
  191. package/codemods/__tests__/deprecateUtilityComponents.js +0 -200
  192. package/codemods/__tests__/removeSystemProps.js +0 -225
  193. package/codemods/deprecateUtilityComponents.js +0 -111
  194. package/codemods/removeSystemProps.js +0 -312
  195. package/lib/ActionList/Divider.d.ts +0 -9
  196. package/lib/ActionList/Divider.js +0 -40
  197. package/lib/ActionList/Group.d.ts +0 -28
  198. package/lib/ActionList/Group.js +0 -35
  199. package/lib/ActionList/Header.d.ts +0 -29
  200. package/lib/ActionList/Header.js +0 -51
  201. package/lib/ActionList/Item.d.ts +0 -92
  202. package/lib/ActionList/Item.js +0 -288
  203. package/lib/ActionList/List.d.ts +0 -88
  204. package/lib/ActionList/List.js +0 -199
  205. package/lib/ActionList/index.d.ts +0 -17
  206. package/lib/ActionList/index.js +0 -29
  207. package/lib/ActionMenu.d.ts +0 -40
  208. package/lib/ActionMenu.js +0 -103
  209. package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +0 -62
  210. package/lib/AnchoredOverlay/AnchoredOverlay.js +0 -124
  211. package/lib/AnchoredOverlay/index.d.ts +0 -2
  212. package/lib/AnchoredOverlay/index.js +0 -13
  213. package/lib/Autocomplete/Autocomplete.d.ts +0 -40
  214. package/lib/Autocomplete/Autocomplete.js +0 -68
  215. package/lib/Autocomplete/AutocompleteContext.d.ts +0 -17
  216. package/lib/Autocomplete/AutocompleteContext.js +0 -11
  217. package/lib/Autocomplete/AutocompleteInput.d.ts +0 -9
  218. package/lib/Autocomplete/AutocompleteInput.js +0 -150
  219. package/lib/Autocomplete/AutocompleteMenu.d.ts +0 -71
  220. package/lib/Autocomplete/AutocompleteMenu.js +0 -223
  221. package/lib/Autocomplete/AutocompleteOverlay.d.ts +0 -17
  222. package/lib/Autocomplete/AutocompleteOverlay.js +0 -69
  223. package/lib/Autocomplete/index.d.ts +0 -2
  224. package/lib/Autocomplete/index.js +0 -15
  225. package/lib/Avatar.d.ts +0 -15
  226. package/lib/AvatarPair.d.ts +0 -8
  227. package/lib/AvatarStack.d.ts +0 -8
  228. package/lib/BaseStyles.d.ts +0 -14
  229. package/lib/BorderBox.d.ts +0 -7
  230. package/lib/Box.d.ts +0 -6
  231. package/lib/BranchName.d.ts +0 -6
  232. package/lib/Breadcrumbs.d.ts +0 -40
  233. package/lib/Button/Button.d.ts +0 -284
  234. package/lib/Button/ButtonBase.d.ts +0 -12
  235. package/lib/Button/ButtonClose.d.ts +0 -321
  236. package/lib/Button/ButtonDanger.d.ts +0 -284
  237. package/lib/Button/ButtonGroup.d.ts +0 -4
  238. package/lib/Button/ButtonInvisible.d.ts +0 -284
  239. package/lib/Button/ButtonOutline.d.ts +0 -284
  240. package/lib/Button/ButtonPrimary.d.ts +0 -284
  241. package/lib/Button/ButtonStyles.d.ts +0 -2
  242. package/lib/Button/ButtonTableList.d.ts +0 -6
  243. package/lib/Button/index.d.ts +0 -16
  244. package/lib/Caret.d.ts +0 -21
  245. package/lib/CircleBadge.d.ts +0 -25
  246. package/lib/CircleOcticon.d.ts +0 -391
  247. package/lib/CounterLabel.d.ts +0 -8
  248. package/lib/Details.d.ts +0 -6
  249. package/lib/Dialog/ConfirmationDialog.d.ts +0 -44
  250. package/lib/Dialog/ConfirmationDialog.js +0 -191
  251. package/lib/Dialog/Dialog.d.ts +0 -167
  252. package/lib/Dialog/Dialog.js +0 -304
  253. package/lib/Dialog.d.ts +0 -406
  254. package/lib/Dropdown.d.ts +0 -1262
  255. package/lib/DropdownMenu/DropdownButton.d.ts +0 -323
  256. package/lib/DropdownMenu/DropdownButton.js +0 -31
  257. package/lib/DropdownMenu/DropdownMenu.d.ts +0 -43
  258. package/lib/DropdownMenu/DropdownMenu.js +0 -94
  259. package/lib/DropdownMenu/index.d.ts +0 -4
  260. package/lib/DropdownMenu/index.js +0 -21
  261. package/lib/DropdownStyles.d.ts +0 -3
  262. package/lib/FilterList.d.ts +0 -321
  263. package/lib/FilteredActionList/FilteredActionList.d.ts +0 -16
  264. package/lib/FilteredActionList/FilteredActionList.js +0 -137
  265. package/lib/FilteredActionList/index.d.ts +0 -2
  266. package/lib/FilteredActionList/index.js +0 -13
  267. package/lib/FilteredSearch.d.ts +0 -6
  268. package/lib/Flash.d.ts +0 -9
  269. package/lib/Flex.d.ts +0 -7
  270. package/lib/FormGroup.d.ts +0 -12
  271. package/lib/Grid.d.ts +0 -7
  272. package/lib/Header.d.ts +0 -24
  273. package/lib/Heading.d.ts +0 -6
  274. package/lib/Label.d.ts +0 -11
  275. package/lib/LabelGroup.d.ts +0 -6
  276. package/lib/Link.d.ts +0 -10
  277. package/lib/Overlay.d.ts +0 -63
  278. package/lib/Pagehead.d.ts +0 -6
  279. package/lib/Pagination/Pagination.d.ts +0 -24
  280. package/lib/Pagination/index.d.ts +0 -3
  281. package/lib/Pagination/model.d.ts +0 -26
  282. package/lib/PointerBox.d.ts +0 -11
  283. package/lib/Popover.d.ts +0 -21
  284. package/lib/Portal/Portal.d.ts +0 -25
  285. package/lib/Portal/index.d.ts +0 -4
  286. package/lib/Position.d.ts +0 -34
  287. package/lib/ProgressBar.d.ts +0 -21
  288. package/lib/SelectMenu/SelectMenu.d.ts +0 -1832
  289. package/lib/SelectMenu/SelectMenuContext.d.ts +0 -8
  290. package/lib/SelectMenu/SelectMenuDivider.d.ts +0 -6
  291. package/lib/SelectMenu/SelectMenuFilter.d.ts +0 -9
  292. package/lib/SelectMenu/SelectMenuFooter.d.ts +0 -6
  293. package/lib/SelectMenu/SelectMenuHeader.d.ts +0 -11
  294. package/lib/SelectMenu/SelectMenuItem.d.ts +0 -15
  295. package/lib/SelectMenu/SelectMenuList.d.ts +0 -6
  296. package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +0 -7
  297. package/lib/SelectMenu/SelectMenuModal.d.ts +0 -15
  298. package/lib/SelectMenu/SelectMenuTab.d.ts +0 -14
  299. package/lib/SelectMenu/SelectMenuTabPanel.d.ts +0 -13
  300. package/lib/SelectMenu/SelectMenuTabs.d.ts +0 -11
  301. package/lib/SelectMenu/hooks/useKeyboardNav.d.ts +0 -2
  302. package/lib/SelectMenu/index.d.ts +0 -2
  303. package/lib/SelectPanel/SelectPanel.d.ts +0 -25
  304. package/lib/SelectPanel/SelectPanel.js +0 -147
  305. package/lib/SelectPanel/index.d.ts +0 -2
  306. package/lib/SelectPanel/index.js +0 -13
  307. package/lib/SideNav.d.ts +0 -31
  308. package/lib/Spinner.d.ts +0 -17
  309. package/lib/Spinner.js +0 -60
  310. package/lib/StateLabel.d.ts +0 -16
  311. package/lib/StyledOcticon.d.ts +0 -12
  312. package/lib/SubNav.d.ts +0 -32
  313. package/lib/TabNav.d.ts +0 -20
  314. package/lib/Text.d.ts +0 -6
  315. package/lib/TextInput.d.ts +0 -14
  316. package/lib/TextInputWithTokens.d.ts +0 -323
  317. package/lib/TextInputWithTokens.js +0 -244
  318. package/lib/ThemeProvider.d.ts +0 -26
  319. package/lib/Timeline.d.ts +0 -407
  320. package/lib/Token/IssueLabelToken.d.ts +0 -14
  321. package/lib/Token/IssueLabelToken.js +0 -144
  322. package/lib/Token/ProfileToken.d.ts +0 -7
  323. package/lib/Token/ProfileToken.js +0 -53
  324. package/lib/Token/Token.d.ts +0 -15
  325. package/lib/Token/Token.js +0 -94
  326. package/lib/Token/TokenBase.d.ts +0 -17
  327. package/lib/Token/TokenBase.js +0 -108
  328. package/lib/Token/_RemoveTokenButton.d.ts +0 -12
  329. package/lib/Token/_RemoveTokenButton.js +0 -77
  330. package/lib/Token/_TokenTextContainer.d.ts +0 -3
  331. package/lib/Token/_TokenTextContainer.js +0 -28
  332. package/lib/Token/index.d.ts +0 -3
  333. package/lib/Token/index.js +0 -31
  334. package/lib/Tooltip.d.ts +0 -18
  335. package/lib/Truncate.d.ts +0 -11
  336. package/lib/UnderlineNav.d.ts +0 -25
  337. package/lib/_TextInputWrapper.d.ts +0 -10
  338. package/lib/_TextInputWrapper.js +0 -51
  339. package/lib/_UnstyledTextInput.d.ts +0 -2
  340. package/lib/_UnstyledTextInput.js +0 -20
  341. package/lib/behaviors/anchoredPosition.d.ts +0 -89
  342. package/lib/behaviors/focusTrap.d.ts +0 -12
  343. package/lib/behaviors/focusZone.d.ts +0 -137
  344. package/lib/constants.d.ts +0 -20
  345. package/lib/hooks/index.d.ts +0 -11
  346. package/lib/hooks/useAnchoredPosition.d.ts +0 -20
  347. package/lib/hooks/useCombinedRefs.d.ts +0 -10
  348. package/lib/hooks/useCombinedRefs.js +0 -49
  349. package/lib/hooks/useDetails.d.ts +0 -17
  350. package/lib/hooks/useDialog.d.ts +0 -16
  351. package/lib/hooks/useFocusTrap.d.ts +0 -32
  352. package/lib/hooks/useFocusZone.d.ts +0 -23
  353. package/lib/hooks/useOnEscapePress.d.ts +0 -23
  354. package/lib/hooks/useOnOutsideClick.d.ts +0 -8
  355. package/lib/hooks/useOpenAndCloseFocus.d.ts +0 -8
  356. package/lib/hooks/useOverlay.d.ts +0 -15
  357. package/lib/hooks/useProvidedRefOrCreate.d.ts +0 -10
  358. package/lib/hooks/useProvidedStateOrCreate.d.ts +0 -10
  359. package/lib/hooks/useProvidedStateOrCreate.js +0 -27
  360. package/lib/hooks/useRenderForcingRef.d.ts +0 -8
  361. package/lib/hooks/useRenderForcingRef.js +0 -25
  362. package/lib/hooks/useResizeObserver.d.ts +0 -1
  363. package/lib/hooks/useResizeObserver.js +0 -20
  364. package/lib/hooks/useSafeTimeout.d.ts +0 -12
  365. package/lib/hooks/useScrollFlash.d.ts +0 -6
  366. package/lib/hooks/useScrollFlash.js +0 -29
  367. package/lib/index.d.ts +0 -114
  368. package/lib/polyfills/eventListenerSignal.d.ts +0 -6
  369. package/lib/sx.d.ts +0 -6
  370. package/lib/theme-preval.d.ts +0 -49
  371. package/lib/theme.d.ts +0 -2
  372. package/lib/utils/deprecate.d.ts +0 -18
  373. package/lib/utils/isNumeric.d.ts +0 -1
  374. package/lib/utils/iterateFocusableElements.d.ts +0 -42
  375. package/lib/utils/scrollIntoViewingArea.d.ts +0 -1
  376. package/lib/utils/scrollIntoViewingArea.js +0 -39
  377. package/lib/utils/ssr.d.ts +0 -1
  378. package/lib/utils/ssr.js +0 -19
  379. package/lib/utils/test-deprecations.d.ts +0 -1
  380. package/lib/utils/test-helpers.d.ts +0 -0
  381. package/lib/utils/test-helpers.js +0 -9
  382. package/lib/utils/test-matchers.d.ts +0 -1
  383. package/lib/utils/testing.d.ts +0 -1028
  384. package/lib/utils/theme.d.ts +0 -9
  385. package/lib/utils/types/AriaRole.d.ts +0 -4
  386. package/lib/utils/types/ComponentProps.d.ts +0 -9
  387. package/lib/utils/types/ComponentProps.js +0 -1
  388. package/lib/utils/types/Flatten.d.ts +0 -4
  389. package/lib/utils/types/Flatten.js +0 -1
  390. package/lib/utils/types/Merge.d.ts +0 -19
  391. package/lib/utils/types/Merge.js +0 -1
  392. package/lib/utils/types/index.d.ts +0 -4
  393. package/lib/utils/types/index.js +0 -57
  394. package/lib/utils/uniqueId.d.ts +0 -1
  395. package/lib/utils/userAgent.d.ts +0 -1
  396. package/lib-esm/ActionList/Divider.d.ts +0 -9
  397. package/lib-esm/ActionList/Divider.js +0 -23
  398. package/lib-esm/ActionList/Group.d.ts +0 -28
  399. package/lib-esm/ActionList/Group.js +0 -24
  400. package/lib-esm/ActionList/Header.d.ts +0 -29
  401. package/lib-esm/ActionList/Header.js +0 -33
  402. package/lib-esm/ActionList/Item.d.ts +0 -92
  403. package/lib-esm/ActionList/Item.js +0 -253
  404. package/lib-esm/ActionList/List.d.ts +0 -88
  405. package/lib-esm/ActionList/List.js +0 -181
  406. package/lib-esm/ActionList/index.d.ts +0 -17
  407. package/lib-esm/ActionList/index.js +0 -18
  408. package/lib-esm/ActionMenu.d.ts +0 -40
  409. package/lib-esm/ActionMenu.js +0 -82
  410. package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +0 -62
  411. package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +0 -104
  412. package/lib-esm/AnchoredOverlay/index.d.ts +0 -2
  413. package/lib-esm/AnchoredOverlay/index.js +0 -1
  414. package/lib-esm/Autocomplete/Autocomplete.d.ts +0 -40
  415. package/lib-esm/Autocomplete/Autocomplete.js +0 -47
  416. package/lib-esm/Autocomplete/AutocompleteContext.d.ts +0 -17
  417. package/lib-esm/Autocomplete/AutocompleteContext.js +0 -2
  418. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +0 -9
  419. package/lib-esm/Autocomplete/AutocompleteInput.js +0 -131
  420. package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +0 -71
  421. package/lib-esm/Autocomplete/AutocompleteMenu.js +0 -204
  422. package/lib-esm/Autocomplete/AutocompleteOverlay.d.ts +0 -17
  423. package/lib-esm/Autocomplete/AutocompleteOverlay.js +0 -51
  424. package/lib-esm/Autocomplete/index.d.ts +0 -2
  425. package/lib-esm/Autocomplete/index.js +0 -1
  426. package/lib-esm/Avatar.d.ts +0 -15
  427. package/lib-esm/AvatarPair.d.ts +0 -8
  428. package/lib-esm/AvatarStack.d.ts +0 -8
  429. package/lib-esm/BaseStyles.d.ts +0 -14
  430. package/lib-esm/BorderBox.d.ts +0 -7
  431. package/lib-esm/Box.d.ts +0 -6
  432. package/lib-esm/BranchName.d.ts +0 -6
  433. package/lib-esm/Breadcrumbs.d.ts +0 -40
  434. package/lib-esm/Button/Button.d.ts +0 -284
  435. package/lib-esm/Button/ButtonBase.d.ts +0 -12
  436. package/lib-esm/Button/ButtonClose.d.ts +0 -321
  437. package/lib-esm/Button/ButtonDanger.d.ts +0 -284
  438. package/lib-esm/Button/ButtonGroup.d.ts +0 -4
  439. package/lib-esm/Button/ButtonInvisible.d.ts +0 -284
  440. package/lib-esm/Button/ButtonOutline.d.ts +0 -284
  441. package/lib-esm/Button/ButtonPrimary.d.ts +0 -284
  442. package/lib-esm/Button/ButtonStyles.d.ts +0 -2
  443. package/lib-esm/Button/ButtonTableList.d.ts +0 -6
  444. package/lib-esm/Button/index.d.ts +0 -16
  445. package/lib-esm/Caret.d.ts +0 -21
  446. package/lib-esm/CircleBadge.d.ts +0 -25
  447. package/lib-esm/CircleOcticon.d.ts +0 -391
  448. package/lib-esm/CounterLabel.d.ts +0 -8
  449. package/lib-esm/Details.d.ts +0 -6
  450. package/lib-esm/Dialog/ConfirmationDialog.d.ts +0 -44
  451. package/lib-esm/Dialog/ConfirmationDialog.js +0 -169
  452. package/lib-esm/Dialog/Dialog.d.ts +0 -167
  453. package/lib-esm/Dialog/Dialog.js +0 -274
  454. package/lib-esm/Dialog.d.ts +0 -406
  455. package/lib-esm/Dropdown.d.ts +0 -1262
  456. package/lib-esm/DropdownMenu/DropdownButton.d.ts +0 -323
  457. package/lib-esm/DropdownMenu/DropdownButton.js +0 -16
  458. package/lib-esm/DropdownMenu/DropdownMenu.d.ts +0 -43
  459. package/lib-esm/DropdownMenu/DropdownMenu.js +0 -77
  460. package/lib-esm/DropdownMenu/index.d.ts +0 -4
  461. package/lib-esm/DropdownMenu/index.js +0 -2
  462. package/lib-esm/DropdownStyles.d.ts +0 -3
  463. package/lib-esm/FilterList.d.ts +0 -321
  464. package/lib-esm/FilteredActionList/FilteredActionList.d.ts +0 -16
  465. package/lib-esm/FilteredActionList/FilteredActionList.js +0 -109
  466. package/lib-esm/FilteredActionList/index.d.ts +0 -2
  467. package/lib-esm/FilteredActionList/index.js +0 -1
  468. package/lib-esm/FilteredSearch.d.ts +0 -6
  469. package/lib-esm/Flash.d.ts +0 -9
  470. package/lib-esm/Flex.d.ts +0 -7
  471. package/lib-esm/FormGroup.d.ts +0 -12
  472. package/lib-esm/Grid.d.ts +0 -7
  473. package/lib-esm/Header.d.ts +0 -24
  474. package/lib-esm/Heading.d.ts +0 -6
  475. package/lib-esm/Label.d.ts +0 -11
  476. package/lib-esm/LabelGroup.d.ts +0 -6
  477. package/lib-esm/Link.d.ts +0 -10
  478. package/lib-esm/Overlay.d.ts +0 -63
  479. package/lib-esm/Pagehead.d.ts +0 -6
  480. package/lib-esm/Pagination/Pagination.d.ts +0 -24
  481. package/lib-esm/Pagination/index.d.ts +0 -3
  482. package/lib-esm/Pagination/model.d.ts +0 -26
  483. package/lib-esm/PointerBox.d.ts +0 -11
  484. package/lib-esm/Popover.d.ts +0 -21
  485. package/lib-esm/Portal/Portal.d.ts +0 -25
  486. package/lib-esm/Portal/index.d.ts +0 -4
  487. package/lib-esm/Position.d.ts +0 -34
  488. package/lib-esm/ProgressBar.d.ts +0 -21
  489. package/lib-esm/SelectMenu/SelectMenu.d.ts +0 -1832
  490. package/lib-esm/SelectMenu/SelectMenuContext.d.ts +0 -8
  491. package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +0 -6
  492. package/lib-esm/SelectMenu/SelectMenuFilter.d.ts +0 -9
  493. package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +0 -6
  494. package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +0 -11
  495. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +0 -15
  496. package/lib-esm/SelectMenu/SelectMenuList.d.ts +0 -6
  497. package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +0 -7
  498. package/lib-esm/SelectMenu/SelectMenuModal.d.ts +0 -15
  499. package/lib-esm/SelectMenu/SelectMenuTab.d.ts +0 -14
  500. package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +0 -13
  501. package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +0 -11
  502. package/lib-esm/SelectMenu/hooks/useKeyboardNav.d.ts +0 -2
  503. package/lib-esm/SelectMenu/index.d.ts +0 -2
  504. package/lib-esm/SelectPanel/SelectPanel.d.ts +0 -25
  505. package/lib-esm/SelectPanel/SelectPanel.js +0 -127
  506. package/lib-esm/SelectPanel/index.d.ts +0 -2
  507. package/lib-esm/SelectPanel/index.js +0 -1
  508. package/lib-esm/SideNav.d.ts +0 -31
  509. package/lib-esm/Spinner.d.ts +0 -17
  510. package/lib-esm/Spinner.js +0 -46
  511. package/lib-esm/StateLabel.d.ts +0 -16
  512. package/lib-esm/StyledOcticon.d.ts +0 -12
  513. package/lib-esm/SubNav.d.ts +0 -32
  514. package/lib-esm/TabNav.d.ts +0 -20
  515. package/lib-esm/Text.d.ts +0 -6
  516. package/lib-esm/TextInput.d.ts +0 -14
  517. package/lib-esm/TextInputWithTokens.d.ts +0 -323
  518. package/lib-esm/TextInputWithTokens.js +0 -219
  519. package/lib-esm/ThemeProvider.d.ts +0 -26
  520. package/lib-esm/Timeline.d.ts +0 -407
  521. package/lib-esm/Token/IssueLabelToken.d.ts +0 -14
  522. package/lib-esm/Token/IssueLabelToken.js +0 -124
  523. package/lib-esm/Token/ProfileToken.d.ts +0 -7
  524. package/lib-esm/Token/ProfileToken.js +0 -33
  525. package/lib-esm/Token/Token.d.ts +0 -15
  526. package/lib-esm/Token/Token.js +0 -73
  527. package/lib-esm/Token/TokenBase.d.ts +0 -17
  528. package/lib-esm/Token/TokenBase.js +0 -87
  529. package/lib-esm/Token/_RemoveTokenButton.d.ts +0 -12
  530. package/lib-esm/Token/_RemoveTokenButton.js +0 -60
  531. package/lib-esm/Token/_TokenTextContainer.d.ts +0 -3
  532. package/lib-esm/Token/_TokenTextContainer.js +0 -15
  533. package/lib-esm/Token/index.d.ts +0 -3
  534. package/lib-esm/Token/index.js +0 -3
  535. package/lib-esm/Tooltip.d.ts +0 -18
  536. package/lib-esm/Truncate.d.ts +0 -11
  537. package/lib-esm/UnderlineNav.d.ts +0 -25
  538. package/lib-esm/_TextInputWrapper.d.ts +0 -10
  539. package/lib-esm/_TextInputWrapper.js +0 -31
  540. package/lib-esm/_UnstyledTextInput.d.ts +0 -2
  541. package/lib-esm/_UnstyledTextInput.js +0 -7
  542. package/lib-esm/behaviors/anchoredPosition.d.ts +0 -89
  543. package/lib-esm/behaviors/focusTrap.d.ts +0 -12
  544. package/lib-esm/behaviors/focusZone.d.ts +0 -137
  545. package/lib-esm/constants.d.ts +0 -20
  546. package/lib-esm/hooks/index.d.ts +0 -11
  547. package/lib-esm/hooks/useAnchoredPosition.d.ts +0 -20
  548. package/lib-esm/hooks/useCombinedRefs.d.ts +0 -10
  549. package/lib-esm/hooks/useCombinedRefs.js +0 -36
  550. package/lib-esm/hooks/useDetails.d.ts +0 -17
  551. package/lib-esm/hooks/useDialog.d.ts +0 -16
  552. package/lib-esm/hooks/useFocusTrap.d.ts +0 -32
  553. package/lib-esm/hooks/useFocusZone.d.ts +0 -23
  554. package/lib-esm/hooks/useOnEscapePress.d.ts +0 -23
  555. package/lib-esm/hooks/useOnOutsideClick.d.ts +0 -8
  556. package/lib-esm/hooks/useOpenAndCloseFocus.d.ts +0 -8
  557. package/lib-esm/hooks/useOverlay.d.ts +0 -15
  558. package/lib-esm/hooks/useProvidedRefOrCreate.d.ts +0 -10
  559. package/lib-esm/hooks/useProvidedStateOrCreate.d.ts +0 -10
  560. package/lib-esm/hooks/useProvidedStateOrCreate.js +0 -20
  561. package/lib-esm/hooks/useRenderForcingRef.d.ts +0 -8
  562. package/lib-esm/hooks/useRenderForcingRef.js +0 -18
  563. package/lib-esm/hooks/useResizeObserver.d.ts +0 -1
  564. package/lib-esm/hooks/useResizeObserver.js +0 -10
  565. package/lib-esm/hooks/useSafeTimeout.d.ts +0 -12
  566. package/lib-esm/hooks/useScrollFlash.d.ts +0 -6
  567. package/lib-esm/hooks/useScrollFlash.js +0 -22
  568. package/lib-esm/index.d.ts +0 -114
  569. package/lib-esm/polyfills/eventListenerSignal.d.ts +0 -6
  570. package/lib-esm/sx.d.ts +0 -6
  571. package/lib-esm/theme-preval.d.ts +0 -49
  572. package/lib-esm/theme.d.ts +0 -2
  573. package/lib-esm/utils/deprecate.d.ts +0 -18
  574. package/lib-esm/utils/isNumeric.d.ts +0 -1
  575. package/lib-esm/utils/iterateFocusableElements.d.ts +0 -42
  576. package/lib-esm/utils/scrollIntoViewingArea.d.ts +0 -1
  577. package/lib-esm/utils/scrollIntoViewingArea.js +0 -30
  578. package/lib-esm/utils/ssr.d.ts +0 -1
  579. package/lib-esm/utils/ssr.js +0 -1
  580. package/lib-esm/utils/test-deprecations.d.ts +0 -1
  581. package/lib-esm/utils/test-helpers.js +0 -7
  582. package/lib-esm/utils/test-matchers.d.ts +0 -1
  583. package/lib-esm/utils/testing.d.ts +0 -1028
  584. package/lib-esm/utils/theme.d.ts +0 -9
  585. package/lib-esm/utils/types/AriaRole.d.ts +0 -4
  586. package/lib-esm/utils/types/AriaRole.js +0 -1
  587. package/lib-esm/utils/types/ComponentProps.d.ts +0 -9
  588. package/lib-esm/utils/types/ComponentProps.js +0 -1
  589. package/lib-esm/utils/types/Flatten.d.ts +0 -4
  590. package/lib-esm/utils/types/Flatten.js +0 -1
  591. package/lib-esm/utils/types/Merge.d.ts +0 -19
  592. package/lib-esm/utils/types/Merge.js +0 -1
  593. package/lib-esm/utils/types/index.d.ts +0 -4
  594. package/lib-esm/utils/types/index.js +0 -4
  595. package/lib-esm/utils/uniqueId.d.ts +0 -1
  596. package/lib-esm/utils/userAgent.d.ts +0 -1
@@ -1,9 +0,0 @@
1
- export function fontStack(fonts: any): any;
2
- export function isShadowValue(value: any): boolean;
3
- export function isColorValue(value: any): boolean;
4
- export function filterObject(obj: any, predicate: any): {};
5
- export function partitionColors(colors: any): {
6
- colors: {};
7
- shadows: {};
8
- };
9
- export function omitScale(obj: any): any;
@@ -1,4 +0,0 @@
1
- export declare type AriaRole = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox ' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
2
- export declare type MandateProps<T extends unknown, K extends keyof T> = Omit<T, K> & {
3
- [MK in K]-?: NonNullable<T[MK]>;
4
- };
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * Extract a component's props
4
- *
5
- * Source: https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_usecase#wrappingmirroring-a-component
6
- *
7
- * @example ComponentProps<typeof MyComponent>
8
- */
9
- export declare type ComponentProps<T> = T extends React.ComponentType<infer Props> ? Props extends object ? Props : never : never;
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,4 +0,0 @@
1
- /**
2
- * Contruct a type describing the items in `T`, if `T` is an array.
3
- */
4
- export declare type Flatten<T extends unknown> = T extends (infer U)[] ? U : never;
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,19 +0,0 @@
1
- /**
2
- * Given two object types A and B, return a type with all the properties of A that aren't also
3
- * properties of B, and all the properties of B.
4
- *
5
- * Useful when we have a component that spreads a "rest" of its props on a subcomponent:
6
- *
7
- * ```ts
8
- * interface OwnProps {
9
- * foo: string
10
- * }
11
- *
12
- * type MyComponentProps = Merge<SubcomponentProps, OwnProps>
13
- * const MyComponent = ({foo, ...rest}: MyComponentProps) => {
14
- * // ...
15
- * return <SubComponent {...rest} />
16
- * }
17
- * ```
18
- */
19
- export declare type Merge<A = {}, B = {}> = Omit<A, keyof B> & B;
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,4 +0,0 @@
1
- export * from './AriaRole';
2
- export * from './ComponentProps';
3
- export * from './Flatten';
4
- export * from './Merge';
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _AriaRole = require("./AriaRole");
8
-
9
- Object.keys(_AriaRole).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _AriaRole[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function () {
15
- return _AriaRole[key];
16
- }
17
- });
18
- });
19
-
20
- var _ComponentProps = require("./ComponentProps");
21
-
22
- Object.keys(_ComponentProps).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _ComponentProps[key]) return;
25
- Object.defineProperty(exports, key, {
26
- enumerable: true,
27
- get: function () {
28
- return _ComponentProps[key];
29
- }
30
- });
31
- });
32
-
33
- var _Flatten = require("./Flatten");
34
-
35
- Object.keys(_Flatten).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (key in exports && exports[key] === _Flatten[key]) return;
38
- Object.defineProperty(exports, key, {
39
- enumerable: true,
40
- get: function () {
41
- return _Flatten[key];
42
- }
43
- });
44
- });
45
-
46
- var _Merge = require("./Merge");
47
-
48
- Object.keys(_Merge).forEach(function (key) {
49
- if (key === "default" || key === "__esModule") return;
50
- if (key in exports && exports[key] === _Merge[key]) return;
51
- Object.defineProperty(exports, key, {
52
- enumerable: true,
53
- get: function () {
54
- return _Merge[key];
55
- }
56
- });
57
- });
@@ -1 +0,0 @@
1
- export declare function uniqueId(): string;
@@ -1 +0,0 @@
1
- export declare function isMacOS(): boolean;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const StyledDivider: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- /**
4
- * Visually separates `Item`s or `Group`s in an `ActionList`.
5
- */
6
- export declare function Divider(): JSX.Element;
7
- export declare namespace Divider {
8
- var renderItem: typeof Divider;
9
- }
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
- import { get } from '../constants';
4
- export const StyledDivider = styled.div.withConfig({
5
- displayName: "Divider__StyledDivider",
6
- componentId: "sc-42656i-0"
7
- })(["height:1px;background:", ";margin-top:calc(", " - 1px);margin-bottom:", ";"], get('colors.border.muted'), get('space.2'), get('space.2'));
8
- /**
9
- * Visually separates `Item`s or `Group`s in an `ActionList`.
10
- */
11
-
12
- export function Divider() {
13
- return /*#__PURE__*/React.createElement(StyledDivider, null);
14
- }
15
- Divider.displayName = "Divider";
16
-
17
- /**
18
- * `Divider` fulfills the `ItemPropsWithCustomRenderer` contract,
19
- * so it can be used inline in an `ActionList`’s `items` prop.
20
- * In other words, `items={[ActionList.Divider]}` is supported as a concise
21
- * alternative to `items={[{renderItem: () => <ActionList.Divider />}]}`.
22
- */
23
- Divider.renderItem = Divider;
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import { SxProp } from '../sx';
3
- import { HeaderProps } from './Header';
4
- /**
5
- * Contract for props passed to the `Group` component.
6
- */
7
- export interface GroupProps extends React.ComponentPropsWithoutRef<'div'>, SxProp {
8
- /**
9
- * Props for a `Header` to render in the `Group`.
10
- */
11
- header?: HeaderProps;
12
- /**
13
- * The id of the group.
14
- */
15
- groupId?: string;
16
- /**
17
- * `Items` to render in the `Group`.
18
- */
19
- items?: JSX.Element[];
20
- /**
21
- * Whether to display a divider above each `Item` in this `Group` when it does not follow a `Header` or `Divider`.
22
- */
23
- showItemDividers?: boolean;
24
- }
25
- /**
26
- * Collects related `Items` in an `ActionList`.
27
- */
28
- export declare function Group({ header, items, ...props }: GroupProps): JSX.Element;
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
- import sx from '../sx';
4
- import { Header } from './Header';
5
- /**
6
- * Contract for props passed to the `Group` component.
7
- */
8
-
9
- const StyledGroup = styled.div.withConfig({
10
- displayName: "Group__StyledGroup",
11
- componentId: "sc-10w5bj9-0"
12
- })(["", ""], sx);
13
- /**
14
- * Collects related `Items` in an `ActionList`.
15
- */
16
-
17
- export function Group({
18
- header,
19
- items,
20
- ...props
21
- }) {
22
- return /*#__PURE__*/React.createElement(StyledGroup, props, header && /*#__PURE__*/React.createElement(Header, header), items);
23
- }
24
- Group.displayName = "Group";
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import { SxProp } from '../sx';
3
- /**
4
- * Contract for props passed to the `Header` component.
5
- */
6
- export interface HeaderProps extends React.ComponentPropsWithoutRef<'div'>, SxProp {
7
- /**
8
- * Style variations. Usage is discretionary.
9
- *
10
- * - `"filled"` - Superimposed on a background, offset from nearby content
11
- * - `"subtle"` - Relatively less offset from nearby content
12
- */
13
- variant?: 'subtle' | 'filled';
14
- /**
15
- * Primary text which names a `Group`.
16
- */
17
- title: string;
18
- /**
19
- * Secondary text which provides additional information about a `Group`.
20
- */
21
- auxiliaryText?: string;
22
- }
23
- export declare const StyledHeader: import("styled-components").StyledComponent<"div", any, {
24
- variant: HeaderProps['variant'];
25
- } & SxProp, never>;
26
- /**
27
- * Displays the name and description of a `Group`.
28
- */
29
- export declare function Header({ variant, title, auxiliaryText, children: _children, ...props }: HeaderProps): JSX.Element;
@@ -1,33 +0,0 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import React from 'react';
4
- import styled, { css } from 'styled-components';
5
- import { get } from '../constants';
6
- import sx from '../sx';
7
- /**
8
- * Contract for props passed to the `Header` component.
9
- */
10
-
11
- export const StyledHeader = styled.div.withConfig({
12
- displayName: "Header__StyledHeader",
13
- componentId: "qmofje-0"
14
- })(["{}padding:6px ", ";font-size:", ";font-weight:", ";color:", ";", " ", ""], get('space.3'), get('fontSizes.0'), get('fontWeights.bold'), get('colors.fg.muted'), ({
15
- variant
16
- }) => variant === 'filled' && css(["background:", ";margin:", " 0;border-top:1px solid ", ";border-bottom:1px solid ", ";&:first-child{margin-top:0;}"], get('colors.canvas.subtle'), get('space.2'), get('colors.neutral.muted'), get('colors.neutral.muted')), sx);
17
- /**
18
- * Displays the name and description of a `Group`.
19
- */
20
-
21
- export function Header({
22
- variant = 'subtle',
23
- title,
24
- auxiliaryText,
25
- children: _children,
26
- ...props
27
- }) {
28
- return /*#__PURE__*/React.createElement(StyledHeader, _extends({
29
- role: "heading",
30
- variant: variant
31
- }, props), title, auxiliaryText && /*#__PURE__*/React.createElement("span", null, "auxiliaryText"));
32
- }
33
- Header.displayName = "Header";
@@ -1,92 +0,0 @@
1
- import { IconProps } from '@primer/octicons-react';
2
- import React from 'react';
3
- import { SxProp } from '../sx';
4
- import { ItemInput } from './List';
5
- import { ForwardRefComponent as PolymorphicForwardRefComponent } from '@radix-ui/react-polymorphic';
6
- import { AriaRole } from '../utils/types';
7
- /**
8
- * Contract for props passed to the `Item` component.
9
- */
10
- export interface ItemProps extends SxProp {
11
- /**
12
- * Primary text which names an `Item`.
13
- */
14
- text?: string;
15
- /**
16
- * Secondary text which provides additional information about an `Item`.
17
- */
18
- description?: string;
19
- /**
20
- * Secondary text style variations. Usage is discretionary.
21
- *
22
- * - `"inline"` - Secondary text is positioned beside primary text.
23
- * - `"block"` - Secondary text is positioned below primary text.
24
- */
25
- descriptionVariant?: 'inline' | 'block';
26
- /**
27
- * Icon (or similar) positioned before `Item` text.
28
- */
29
- leadingVisual?: React.FunctionComponent<IconProps>;
30
- /**
31
- * Icon (or similar) positioned after `Item` text.
32
- */
33
- trailingIcon?: React.FunctionComponent<IconProps>;
34
- /**
35
- * Text positioned after `Item` text and optional trailing icon.
36
- */
37
- trailingText?: string;
38
- /**
39
- * Style variations associated with various `Item` types.
40
- *
41
- * - `"default"` - An action `Item`.
42
- * - `"danger"` - A destructive action `Item`.
43
- */
44
- variant?: 'default' | 'danger';
45
- /**
46
- * Whether to display a divider above the `Item` when it does not follow a `Header` or `Divider`.
47
- */
48
- showDivider?: boolean;
49
- /**
50
- * For `Item`s which can be selected, whether the `Item` is currently selected.
51
- */
52
- selected?: boolean;
53
- /**
54
- * For `Item`s which can be selected, whether `multiple` `Item`s or a `single` `Item` can be selected
55
- */
56
- selectionVariant?: 'single' | 'multiple';
57
- /**
58
- * Designates the group that an item belongs to.
59
- */
60
- groupId?: string;
61
- /**
62
- * Items that are disabled can not be clicked, selected, or navigated through.
63
- */
64
- disabled?: boolean;
65
- /**
66
- * Callback that will trigger both on click selection and keyboard selection.
67
- */
68
- onAction?: (item: ItemProps, event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => void;
69
- /**
70
- * An id associated with this item. Should be unique between items
71
- */
72
- id?: number | string;
73
- /**
74
- * Node to be included inside the item before the text.
75
- */
76
- children?: React.ReactNode;
77
- /**
78
- * The ARIA role describing the function of `List` component. `option` is a common value.
79
- */
80
- role?: AriaRole;
81
- /**
82
- * An item to pass back in the `onAction` callback, meant as
83
- */
84
- item?: ItemInput;
85
- }
86
- export declare const TextContainer: import("styled-components").StyledComponent<"span", any, {
87
- dangerouslySetInnerHtml?: React.DOMAttributes<HTMLDivElement>['dangerouslySetInnerHTML'];
88
- }, never>;
89
- /**
90
- * An actionable or selectable `Item` with an optional icon and description.
91
- */
92
- export declare const Item: PolymorphicForwardRefComponent<"div", ItemProps>;
@@ -1,253 +0,0 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import { CheckIcon } from '@primer/octicons-react';
4
- import React, { useCallback } from 'react';
5
- import { get } from '../constants';
6
- import sx from '../sx';
7
- import Truncate from '../Truncate';
8
- import styled from 'styled-components';
9
- import { StyledHeader } from './Header';
10
- import { StyledDivider } from './Divider';
11
- import { useColorSchemeVar, useTheme } from '../ThemeProvider';
12
- import { activeDescendantActivatedDirectly, activeDescendantActivatedIndirectly, isActiveDescendantAttribute } from '../behaviors/focusZone';
13
- import { useSSRSafeId } from '@react-aria/ssr';
14
-
15
- /**
16
- * These colors are not yet in our default theme. Need to remove this once they are added.
17
- */
18
- const customItemThemes = {
19
- default: {
20
- hover: {
21
- light: 'rgba(46, 77, 108, 0.06)',
22
- dark: 'rgba(201, 206, 212, 0.12)',
23
- dark_dimmed: 'rgba(201, 206, 212, 0.12)'
24
- },
25
- focus: {
26
- light: 'rgba(54, 77, 100, 0.16)',
27
- dark: 'rgba(201, 206, 212, 0.24)',
28
- dark_dimmed: 'rgba(201, 206, 212, 0.24)'
29
- }
30
- },
31
- danger: {
32
- hover: {
33
- light: 'rgba(234, 74, 90, 0.08)',
34
- dark: 'rgba(248, 81, 73, 0.16)',
35
- dark_dimmed: 'rgba(248, 81, 73, 0.16)'
36
- },
37
- focus: {
38
- light: 'rgba(234, 74, 90, 0.14)',
39
- dark: 'rgba(248, 81, 73, 0.24)',
40
- dark_dimmed: 'rgba(248, 81, 73, 0.24)'
41
- }
42
- }
43
- };
44
- /**
45
- * Contract for props passed to the `Item` component.
46
- */
47
-
48
- const getItemVariant = (variant = 'default', disabled) => {
49
- if (disabled) {
50
- return {
51
- color: get('colors.fg.muted'),
52
- iconColor: get('colors.fg.muted'),
53
- annotationColor: get('colors.fg.muted'),
54
- hoverCursor: 'default'
55
- };
56
- }
57
-
58
- switch (variant) {
59
- case 'danger':
60
- return {
61
- color: get('colors.danger.fg'),
62
- iconColor: get('colors.danger.fg'),
63
- annotationColor: get('colors.fg.muted'),
64
- hoverCursor: 'pointer'
65
- };
66
-
67
- default:
68
- return {
69
- color: get('colors.fg.default'),
70
- iconColor: get('colors.fg.muted'),
71
- annotationColor: get('colors.fg.muted'),
72
- hoverCursor: 'pointer'
73
- };
74
- }
75
- };
76
-
77
- const DividedContent = styled.div.withConfig({
78
- displayName: "Item__DividedContent",
79
- componentId: "jqpvy8-0"
80
- })(["display:flex;min-width:0;position:relative;flex-grow:1;"]);
81
- const MainContent = styled.div.withConfig({
82
- displayName: "Item__MainContent",
83
- componentId: "jqpvy8-1"
84
- })(["align-items:baseline;display:flex;min-width:0;flex-direction:var(--main-content-flex-direction);flex-grow:1;"]);
85
- const StyledItem = styled.div.withConfig({
86
- displayName: "Item__StyledItem",
87
- componentId: "jqpvy8-2"
88
- })(["padding:6px ", ";display:flex;border-radius:", ";color:", ";transition:background 33.333ms linear;text-decoration:none;@media (hover:hover) and (pointer:fine){:hover{background:var(--item-hover-bg-override,", ");cursor:", ";}}:not(:first-of-type):not(", " + &):not(", " + &){margin-top:", ";", "::before{content:' ';display:block;position:absolute;width:100%;top:-7px;border:0 solid ", ";border-top-width:", ";}}&:hover ", "::before,:hover + * ", "::before{border-color:var(--item-hover-divider-border-color-override,transparent) !important;}&:focus ", "::before,:focus + * ", "::before,&[", "] ", "::before,[", "] + & ", "::before{border-color:transparent !important;}&[", "='", "']{background:", ";}&[", "='", "']{background:", ";}&:focus{background:", ";outline:none;}&:active{background:", ";}", ""], get('space.2'), get('radii.2'), ({
89
- variant,
90
- item
91
- }) => getItemVariant(variant, item === null || item === void 0 ? void 0 : item.disabled).color, ({
92
- hoverBackground
93
- }) => hoverBackground, ({
94
- variant,
95
- item
96
- }) => getItemVariant(variant, item === null || item === void 0 ? void 0 : item.disabled).hoverCursor, StyledDivider, StyledHeader, ({
97
- showDivider
98
- }) => showDivider ? `1px` : '0', DividedContent, get('colors.border.muted'), ({
99
- showDivider
100
- }) => showDivider ? `1px` : '0', DividedContent, DividedContent, DividedContent, DividedContent, isActiveDescendantAttribute, DividedContent, isActiveDescendantAttribute, DividedContent, isActiveDescendantAttribute, activeDescendantActivatedDirectly, ({
101
- focusBackground
102
- }) => focusBackground, isActiveDescendantAttribute, activeDescendantActivatedIndirectly, ({
103
- hoverBackground
104
- }) => hoverBackground, ({
105
- focusBackground
106
- }) => focusBackground, ({
107
- focusBackground
108
- }) => focusBackground, sx);
109
- export const TextContainer = styled.span.withConfig({
110
- displayName: "Item__TextContainer",
111
- componentId: "jqpvy8-3"
112
- })([""]);
113
- const BaseVisualContainer = styled.div.withConfig({
114
- displayName: "Item__BaseVisualContainer",
115
- componentId: "jqpvy8-4"
116
- })(["height:20px;width:", ";margin-right:", ";"], get('space.3'), get('space.2'));
117
- const ColoredVisualContainer = styled(BaseVisualContainer).withConfig({
118
- displayName: "Item__ColoredVisualContainer",
119
- componentId: "jqpvy8-5"
120
- })(["svg{fill:", ";font-size:", ";}"], ({
121
- variant,
122
- disabled
123
- }) => getItemVariant(variant, disabled).iconColor, get('fontSizes.0'));
124
- const LeadingVisualContainer = styled(ColoredVisualContainer).withConfig({
125
- displayName: "Item__LeadingVisualContainer",
126
- componentId: "jqpvy8-6"
127
- })(["flex-shrink:0;display:flex;flex-direction:column;justify-content:center;"]);
128
- const TrailingContent = styled(ColoredVisualContainer).withConfig({
129
- displayName: "Item__TrailingContent",
130
- componentId: "jqpvy8-7"
131
- })(["color:", "};margin-left:", ";margin-right:0;width:auto;div:nth-child(2){margin-left:", ";}"], ({
132
- variant,
133
- disabled
134
- }) => getItemVariant(variant, disabled).annotationColor, get('space.2'), get('space.2'));
135
- const DescriptionContainer = styled.span.withConfig({
136
- displayName: "Item__DescriptionContainer",
137
- componentId: "jqpvy8-8"
138
- })(["color:", ";font-size:", ";line-height:16px;margin-left:var(--description-container-margin-left);min-width:0;flex-grow:1;flex-basis:var(--description-container-flex-basis);"], get('colors.fg.muted'), get('fontSizes.0'));
139
- const MultiSelectInput = styled.input.withConfig({
140
- displayName: "Item__MultiSelectInput",
141
- componentId: "jqpvy8-9"
142
- })(["pointer-events:none;"]);
143
- /**
144
- * An actionable or selectable `Item` with an optional icon and description.
145
- */
146
-
147
- export const Item = /*#__PURE__*/React.forwardRef((itemProps, ref) => {
148
- const {
149
- as: Component,
150
- text,
151
- description,
152
- descriptionVariant = 'inline',
153
- selected,
154
- selectionVariant,
155
- leadingVisual: LeadingVisual,
156
- trailingIcon: TrailingIcon,
157
- trailingText,
158
- variant = 'default',
159
- showDivider,
160
- disabled,
161
- onAction,
162
- onKeyPress,
163
- children,
164
- onClick,
165
- id,
166
- ...props
167
- } = itemProps;
168
- const labelId = useSSRSafeId();
169
- const descriptionId = useSSRSafeId();
170
- const keyPressHandler = useCallback(event => {
171
- if (disabled) {
172
- return;
173
- }
174
-
175
- onKeyPress === null || onKeyPress === void 0 ? void 0 : onKeyPress(event);
176
- const isCheckbox = event.target instanceof HTMLInputElement && event.target.type === 'checkbox';
177
-
178
- if (isCheckbox && event.key === ' ') {
179
- // space key on a checkbox will also trigger a click event. Ignore the space key so we don't get double events
180
- return;
181
- }
182
-
183
- if (!event.defaultPrevented && [' ', 'Enter'].includes(event.key)) {
184
- onAction === null || onAction === void 0 ? void 0 : onAction(itemProps, event);
185
- }
186
- }, [onAction, disabled, itemProps, onKeyPress]);
187
- const clickHandler = useCallback(event => {
188
- if (disabled) {
189
- return;
190
- }
191
-
192
- onClick === null || onClick === void 0 ? void 0 : onClick(event);
193
-
194
- if (!event.defaultPrevented) {
195
- onAction === null || onAction === void 0 ? void 0 : onAction(itemProps, event);
196
- }
197
- }, [onAction, disabled, itemProps, onClick]);
198
- const customItemTheme = customItemThemes[variant];
199
- const hoverBackground = useColorSchemeVar(customItemTheme.hover, 'inherit');
200
- const focusBackground = useColorSchemeVar(customItemTheme.focus, 'inherit');
201
- const {
202
- theme
203
- } = useTheme();
204
- return /*#__PURE__*/React.createElement(StyledItem, _extends({
205
- ref: ref,
206
- as: Component,
207
- tabIndex: disabled ? undefined : -1,
208
- variant: variant,
209
- showDivider: showDivider,
210
- "aria-selected": selected,
211
- "aria-labelledby": text ? labelId : undefined,
212
- "aria-describedby": description ? descriptionId : undefined
213
- }, props, {
214
- "data-id": id,
215
- onKeyPress: keyPressHandler,
216
- onClick: clickHandler,
217
- hoverBackground: disabled ? 'inherit' : hoverBackground,
218
- focusBackground: disabled ? 'inherit' : focusBackground
219
- }), !!selected === selected && /*#__PURE__*/React.createElement(BaseVisualContainer, null, selectionVariant === 'multiple' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MultiSelectInput, {
220
- disabled: disabled,
221
- tabIndex: -1,
222
- type: "checkbox",
223
- checked: selected,
224
- "aria-label": text,
225
- readOnly: true,
226
- "aria-readonly": "false"
227
- })) : selected && /*#__PURE__*/React.createElement(CheckIcon, {
228
- fill: theme === null || theme === void 0 ? void 0 : theme.colors.text.primary
229
- })), LeadingVisual && /*#__PURE__*/React.createElement(LeadingVisualContainer, {
230
- variant: variant,
231
- disabled: disabled
232
- }, /*#__PURE__*/React.createElement(LeadingVisual, null)), /*#__PURE__*/React.createElement(DividedContent, null, /*#__PURE__*/React.createElement(MainContent, {
233
- style: {
234
- '--main-content-flex-direction': descriptionVariant === 'inline' ? 'row' : 'column'
235
- }
236
- }, children, text ? /*#__PURE__*/React.createElement(TextContainer, {
237
- id: labelId
238
- }, text) : null, description ? /*#__PURE__*/React.createElement(DescriptionContainer, {
239
- id: descriptionId,
240
- style: {
241
- '--description-container-margin-left': descriptionVariant === 'inline' ? get('space.2')(theme) : 0,
242
- '--description-container-flex-basis': descriptionVariant === 'inline' ? 0 : 'auto'
243
- }
244
- }, descriptionVariant === 'block' ? description : /*#__PURE__*/React.createElement(Truncate, {
245
- title: description,
246
- inline: true,
247
- maxWidth: "100%"
248
- }, description)) : null), TrailingIcon || trailingText ? /*#__PURE__*/React.createElement(TrailingContent, {
249
- variant: variant,
250
- disabled: disabled
251
- }, trailingText, TrailingIcon && /*#__PURE__*/React.createElement(TrailingIcon, null)) : null));
252
- });
253
- Item.displayName = 'ActionList.Item';