@primer/components 31.2.1-rc.7fa29a87 → 32.0.0-rc.7200a6a6

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 (544) hide show
  1. package/.github/workflows/release_canary.yml +1 -0
  2. package/CHANGELOG.md +66 -4
  3. package/dist/browser.esm.js +289 -351
  4. package/dist/browser.esm.js.map +1 -1
  5. package/dist/browser.umd.js +294 -356
  6. package/dist/browser.umd.js.map +1 -1
  7. package/docs/content/ActionList2.mdx +8 -7
  8. package/docs/content/Breadcrumbs.md +11 -16
  9. package/docs/content/Buttons.md +7 -17
  10. package/docs/content/CircleBadge.md +0 -10
  11. package/docs/content/CounterLabel.md +0 -10
  12. package/docs/content/Dialog.md +15 -18
  13. package/docs/content/Dialog2.mdx +1 -0
  14. package/docs/content/Dropdown.md +11 -18
  15. package/docs/content/FilterList.md +10 -17
  16. package/docs/content/FilteredSearch.md +4 -11
  17. package/docs/content/Flash.md +5 -14
  18. package/docs/content/FormGroup.md +9 -17
  19. package/docs/content/Header.md +14 -16
  20. package/docs/content/Label.md +32 -25
  21. package/docs/content/LabelGroup.md +4 -14
  22. package/docs/content/Link.md +8 -17
  23. package/docs/content/Overlay.mdx +1 -10
  24. package/docs/content/Pagehead.md +4 -13
  25. package/docs/content/Pagination.md +10 -19
  26. package/docs/content/Popover.md +11 -19
  27. package/docs/content/SelectMenu.md +50 -114
  28. package/docs/content/SideNav.md +15 -23
  29. package/docs/content/StateLabel.md +5 -14
  30. package/docs/content/StyledOcticon.md +7 -16
  31. package/docs/content/SubNav.md +19 -21
  32. package/docs/content/TabNav.md +10 -18
  33. package/docs/content/Timeline.md +34 -24
  34. package/docs/content/Tooltip.md +8 -17
  35. package/docs/content/Truncate.md +7 -16
  36. package/docs/content/UnderlineNav.md +13 -21
  37. package/lib/ActionList2/Group.d.ts +28 -2
  38. package/lib/ActionList2/Group.js +55 -6
  39. package/lib/ActionList2/Group.jsx +33 -4
  40. package/lib/ActionList2/List.d.ts +1 -1
  41. package/lib/Autocomplete/Autocomplete.d.ts +3 -3
  42. package/lib/Autocomplete/AutocompleteInput.d.ts +3 -3
  43. package/lib/Breadcrumbs.d.ts +8 -7
  44. package/lib/Breadcrumbs.js +7 -12
  45. package/lib/Breadcrumbs.jsx +3 -6
  46. package/lib/Button/Button.d.ts +2 -3
  47. package/lib/Button/Button.js +2 -6
  48. package/lib/Button/Button.jsx +1 -21
  49. package/lib/Button/ButtonBase.d.ts +5 -8
  50. package/lib/Button/ButtonBase.js +1 -5
  51. package/lib/Button/ButtonBase.jsx +0 -3
  52. package/lib/Button/ButtonClose.d.ts +3 -46
  53. package/lib/Button/ButtonClose.js +1 -1
  54. package/lib/Button/ButtonClose.jsx +0 -2
  55. package/lib/Button/ButtonDanger.d.ts +2 -3
  56. package/lib/Button/ButtonDanger.js +2 -6
  57. package/lib/Button/ButtonDanger.jsx +1 -21
  58. package/lib/Button/ButtonInvisible.d.ts +2 -3
  59. package/lib/Button/ButtonInvisible.js +2 -6
  60. package/lib/Button/ButtonInvisible.jsx +1 -21
  61. package/lib/Button/ButtonOutline.d.ts +2 -3
  62. package/lib/Button/ButtonOutline.js +2 -6
  63. package/lib/Button/ButtonOutline.jsx +1 -21
  64. package/lib/Button/ButtonPrimary.d.ts +2 -3
  65. package/lib/Button/ButtonPrimary.js +2 -6
  66. package/lib/Button/ButtonPrimary.jsx +1 -21
  67. package/lib/Button/ButtonTableList.d.ts +1 -2
  68. package/lib/Button/ButtonTableList.js +1 -1
  69. package/lib/Button/ButtonTableList.jsx +0 -3
  70. package/lib/CircleBadge.d.ts +4 -5
  71. package/lib/CircleBadge.js +1 -1
  72. package/lib/CircleBadge.jsx +0 -1
  73. package/lib/CircleOcticon.d.ts +1 -1
  74. package/lib/CounterLabel.d.ts +1 -2
  75. package/lib/CounterLabel.js +1 -1
  76. package/lib/CounterLabel.jsx +0 -1
  77. package/lib/Dialog/Dialog.d.ts +5 -9
  78. package/lib/Dialog/Dialog.js +17 -11
  79. package/lib/Dialog/Dialog.jsx +13 -7
  80. package/lib/Dialog.d.ts +4 -5
  81. package/lib/Dialog.js +1 -1
  82. package/lib/Dialog.jsx +0 -2
  83. package/lib/Dropdown.d.ts +10 -99
  84. package/lib/Dropdown.js +3 -3
  85. package/lib/Dropdown.jsx +0 -3
  86. package/lib/DropdownMenu/DropdownButton.d.ts +3 -47
  87. package/lib/DropdownMenu/DropdownButton.js +3 -1
  88. package/lib/DropdownMenu/DropdownButton.jsx +1 -1
  89. package/lib/FilterList.d.ts +264 -303
  90. package/lib/FilterList.js +2 -6
  91. package/lib/FilterList.jsx +2 -6
  92. package/lib/FilteredSearch.d.ts +1 -2
  93. package/lib/FilteredSearch.js +1 -1
  94. package/lib/FilteredSearch.jsx +0 -1
  95. package/lib/Flash.d.ts +1 -2
  96. package/lib/Flash.js +1 -1
  97. package/lib/Flash.jsx +0 -1
  98. package/lib/FormGroup.d.ts +4 -5
  99. package/lib/FormGroup.js +2 -2
  100. package/lib/FormGroup.jsx +0 -3
  101. package/lib/Header.d.ts +6 -7
  102. package/lib/Header.js +4 -4
  103. package/lib/Header.jsx +0 -7
  104. package/lib/Label.d.ts +1 -2
  105. package/lib/Label.js +2 -3
  106. package/lib/Label.jsx +1 -3
  107. package/lib/LabelGroup.d.ts +1 -2
  108. package/lib/LabelGroup.js +1 -1
  109. package/lib/LabelGroup.jsx +0 -1
  110. package/lib/Link.d.ts +1 -2
  111. package/lib/Link.js +1 -1
  112. package/lib/Link.jsx +0 -2
  113. package/lib/Overlay.d.ts +11 -10
  114. package/lib/Overlay.js +3 -4
  115. package/lib/Overlay.jsx +1 -3
  116. package/lib/Pagehead.d.ts +1 -2
  117. package/lib/Pagehead.js +1 -1
  118. package/lib/Pagehead.jsx +0 -1
  119. package/lib/Pagination/Pagination.js +1 -1
  120. package/lib/Pagination/Pagination.jsx +0 -2
  121. package/lib/Popover.d.ts +4 -5
  122. package/lib/Popover.js +4 -5
  123. package/lib/Popover.jsx +1 -9
  124. package/lib/Position.d.ts +4 -4
  125. package/lib/SelectMenu/SelectMenu.d.ts +21 -189
  126. package/lib/SelectMenu/SelectMenu.js +1 -3
  127. package/lib/SelectMenu/SelectMenu.jsx +0 -2
  128. package/lib/SelectMenu/SelectMenuDivider.d.ts +1 -2
  129. package/lib/SelectMenu/SelectMenuDivider.js +1 -1
  130. package/lib/SelectMenu/SelectMenuDivider.jsx +0 -1
  131. package/lib/SelectMenu/SelectMenuFilter.js +1 -1
  132. package/lib/SelectMenu/SelectMenuFilter.jsx +0 -1
  133. package/lib/SelectMenu/SelectMenuFooter.d.ts +1 -2
  134. package/lib/SelectMenu/SelectMenuFooter.js +1 -1
  135. package/lib/SelectMenu/SelectMenuFooter.jsx +0 -1
  136. package/lib/SelectMenu/SelectMenuHeader.d.ts +1 -2
  137. package/lib/SelectMenu/SelectMenuHeader.js +1 -1
  138. package/lib/SelectMenu/SelectMenuHeader.jsx +0 -2
  139. package/lib/SelectMenu/SelectMenuItem.d.ts +2 -3
  140. package/lib/SelectMenu/SelectMenuItem.js +1 -1
  141. package/lib/SelectMenu/SelectMenuItem.jsx +0 -1
  142. package/lib/SelectMenu/SelectMenuList.d.ts +1 -2
  143. package/lib/SelectMenu/SelectMenuList.js +1 -1
  144. package/lib/SelectMenu/SelectMenuList.jsx +0 -1
  145. package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
  146. package/lib/SelectMenu/SelectMenuLoadingAnimation.js +3 -1
  147. package/lib/SelectMenu/SelectMenuLoadingAnimation.jsx +2 -1
  148. package/lib/SelectMenu/SelectMenuModal.d.ts +2 -3
  149. package/lib/SelectMenu/SelectMenuModal.js +1 -1
  150. package/lib/SelectMenu/SelectMenuModal.jsx +0 -1
  151. package/lib/SelectMenu/SelectMenuTab.d.ts +1 -2
  152. package/lib/SelectMenu/SelectMenuTab.js +1 -1
  153. package/lib/SelectMenu/SelectMenuTab.jsx +0 -1
  154. package/lib/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
  155. package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
  156. package/lib/SelectMenu/SelectMenuTabPanel.jsx +0 -1
  157. package/lib/SelectMenu/SelectMenuTabs.d.ts +1 -2
  158. package/lib/SelectMenu/SelectMenuTabs.js +1 -1
  159. package/lib/SelectMenu/SelectMenuTabs.jsx +0 -1
  160. package/lib/SideNav.d.ts +11 -8
  161. package/lib/SideNav.js +8 -15
  162. package/lib/SideNav.jsx +2 -6
  163. package/lib/StateLabel.d.ts +1 -2
  164. package/lib/StateLabel.js +6 -5
  165. package/lib/StateLabel.jsx +1 -2
  166. package/lib/StyledOcticon.d.ts +1 -2
  167. package/lib/StyledOcticon.js +1 -3
  168. package/lib/StyledOcticon.jsx +0 -2
  169. package/lib/SubNav.d.ts +5 -11
  170. package/lib/SubNav.js +7 -12
  171. package/lib/SubNav.jsx +4 -7
  172. package/lib/TabNav.d.ts +3 -4
  173. package/lib/TabNav.js +2 -2
  174. package/lib/TabNav.jsx +0 -2
  175. package/lib/TextInputWithTokens.d.ts +3 -3
  176. package/lib/Timeline.d.ts +19 -393
  177. package/lib/Timeline.js +16 -13
  178. package/lib/Timeline.jsx +9 -10
  179. package/lib/Token/Token.d.ts +1 -1
  180. package/lib/Tooltip.d.ts +1 -2
  181. package/lib/Tooltip.js +1 -1
  182. package/lib/Tooltip.jsx +1 -1
  183. package/lib/Truncate.d.ts +1 -2
  184. package/lib/Truncate.js +1 -3
  185. package/lib/Truncate.jsx +0 -3
  186. package/lib/UnderlineNav.d.ts +2 -3
  187. package/lib/UnderlineNav.js +2 -2
  188. package/lib/UnderlineNav.jsx +0 -2
  189. package/lib/__tests__/Breadcrumbs.test.js +4 -1
  190. package/lib/__tests__/Breadcrumbs.test.jsx +1 -1
  191. package/lib/__tests__/Breadcrumbs.types.test.d.ts +3 -0
  192. package/lib/__tests__/Breadcrumbs.types.test.js +25 -0
  193. package/lib/__tests__/Breadcrumbs.types.test.jsx +24 -0
  194. package/lib/__tests__/Button.test.js +6 -2
  195. package/lib/__tests__/Button.test.jsx +2 -2
  196. package/lib/__tests__/CircleBadge.types.test.d.ts +3 -0
  197. package/lib/__tests__/CircleBadge.types.test.js +28 -0
  198. package/lib/__tests__/CircleBadge.types.test.jsx +17 -0
  199. package/lib/__tests__/CounterLabel.types.test.d.ts +3 -0
  200. package/lib/__tests__/CounterLabel.types.test.js +28 -0
  201. package/lib/__tests__/CounterLabel.types.test.jsx +17 -0
  202. package/lib/__tests__/Dialog.types.test.d.ts +3 -0
  203. package/lib/__tests__/Dialog.types.test.js +28 -0
  204. package/lib/__tests__/Dialog.types.test.jsx +17 -0
  205. package/lib/__tests__/Dialog2.types.test.d.ts +3 -0
  206. package/lib/__tests__/Dialog2.types.test.js +31 -0
  207. package/lib/__tests__/Dialog2.types.test.jsx +17 -0
  208. package/lib/__tests__/Dropdown.types.test.d.ts +3 -0
  209. package/lib/__tests__/Dropdown.types.test.js +31 -0
  210. package/lib/__tests__/Dropdown.types.test.jsx +25 -0
  211. package/lib/__tests__/FilterList.types.test.d.ts +3 -0
  212. package/lib/__tests__/FilterList.types.test.js +27 -0
  213. package/lib/__tests__/FilterList.types.test.jsx +21 -0
  214. package/lib/__tests__/FilteredSearch.types.test.d.ts +3 -0
  215. package/lib/__tests__/FilteredSearch.types.test.js +28 -0
  216. package/lib/__tests__/FilteredSearch.types.test.jsx +17 -0
  217. package/lib/__tests__/Flash.types.test.d.ts +3 -0
  218. package/lib/__tests__/Flash.types.test.js +28 -0
  219. package/lib/__tests__/Flash.types.test.jsx +17 -0
  220. package/lib/__tests__/FormGroup.types.test.d.ts +3 -0
  221. package/lib/__tests__/FormGroup.types.test.js +28 -0
  222. package/lib/__tests__/FormGroup.types.test.jsx +17 -0
  223. package/lib/__tests__/Header.types.test.d.ts +3 -0
  224. package/lib/__tests__/Header.types.test.js +29 -0
  225. package/lib/__tests__/Header.types.test.jsx +23 -0
  226. package/lib/__tests__/Label.types.test.d.ts +3 -0
  227. package/lib/__tests__/Label.types.test.js +28 -0
  228. package/lib/__tests__/Label.types.test.jsx +17 -0
  229. package/lib/__tests__/LabelGroup.types.test.d.ts +3 -0
  230. package/lib/__tests__/LabelGroup.types.test.js +28 -0
  231. package/lib/__tests__/LabelGroup.types.test.jsx +17 -0
  232. package/lib/__tests__/Link.test.js +11 -5
  233. package/lib/__tests__/Link.test.jsx +5 -5
  234. package/lib/__tests__/Link.types.test.d.ts +3 -0
  235. package/lib/__tests__/Link.types.test.js +28 -0
  236. package/lib/__tests__/Link.types.test.jsx +17 -0
  237. package/lib/__tests__/Overlay.types.test.d.ts +3 -0
  238. package/lib/__tests__/Overlay.types.test.js +35 -0
  239. package/lib/__tests__/Overlay.types.test.jsx +18 -0
  240. package/lib/__tests__/Pagehead.types.test.d.ts +3 -0
  241. package/lib/__tests__/Pagehead.types.test.js +28 -0
  242. package/lib/__tests__/Pagehead.types.test.jsx +17 -0
  243. package/lib/__tests__/Pagination.types.test.d.ts +3 -0
  244. package/lib/__tests__/Pagination.types.test.js +33 -0
  245. package/lib/__tests__/Pagination.types.test.jsx +17 -0
  246. package/lib/__tests__/Popover.types.test.d.ts +3 -0
  247. package/lib/__tests__/Popover.types.test.js +27 -0
  248. package/lib/__tests__/Popover.types.test.jsx +21 -0
  249. package/lib/__tests__/SelectMenu.types.test.d.ts +3 -0
  250. package/lib/__tests__/SelectMenu.types.test.js +47 -0
  251. package/lib/__tests__/SelectMenu.types.test.jsx +41 -0
  252. package/lib/__tests__/SideNav.types.test.d.ts +3 -0
  253. package/lib/__tests__/SideNav.types.test.js +28 -0
  254. package/lib/__tests__/SideNav.types.test.jsx +17 -0
  255. package/lib/__tests__/StateLabel.types.test.d.ts +3 -0
  256. package/lib/__tests__/StateLabel.types.test.js +28 -0
  257. package/lib/__tests__/StateLabel.types.test.jsx +17 -0
  258. package/lib/__tests__/StyledOcticon.types.test.d.ts +3 -0
  259. package/lib/__tests__/StyledOcticon.types.test.js +32 -0
  260. package/lib/__tests__/StyledOcticon.types.test.jsx +18 -0
  261. package/lib/__tests__/SubNav.types.test.d.ts +3 -0
  262. package/lib/__tests__/SubNav.types.test.js +27 -0
  263. package/lib/__tests__/SubNav.types.test.jsx +27 -0
  264. package/lib/__tests__/TabNav.types.test.d.ts +3 -0
  265. package/lib/__tests__/TabNav.types.test.js +25 -0
  266. package/lib/__tests__/TabNav.types.test.jsx +24 -0
  267. package/lib/__tests__/Timeline.types.test.d.ts +3 -0
  268. package/lib/__tests__/Timeline.types.test.js +31 -0
  269. package/lib/__tests__/Timeline.types.test.jsx +33 -0
  270. package/lib/__tests__/Tooltip.types.test.d.ts +3 -0
  271. package/lib/__tests__/Tooltip.types.test.js +28 -0
  272. package/lib/__tests__/Tooltip.types.test.jsx +17 -0
  273. package/lib/__tests__/Truncate.types.test.d.ts +3 -0
  274. package/lib/__tests__/Truncate.types.test.js +31 -0
  275. package/lib/__tests__/Truncate.types.test.jsx +17 -0
  276. package/lib/__tests__/UnderlineNav.types.test.d.ts +3 -0
  277. package/lib/__tests__/UnderlineNav.types.test.js +25 -0
  278. package/lib/__tests__/UnderlineNav.types.test.jsx +24 -0
  279. package/lib/stories/ActionList2.stories.js +4 -3
  280. package/lib/stories/ActionMenu.stories.js +1 -3
  281. package/lib/stories/ConfirmationDialog.stories.js +16 -8
  282. package/lib/stories/Dialog.stories.js +6 -2
  283. package/lib/stories/useFocusTrap.stories.js +6 -2
  284. package/lib/stories/useFocusZone.stories.js +13 -5
  285. package/lib-esm/ActionList2/Group.d.ts +28 -2
  286. package/lib-esm/ActionList2/Group.js +52 -5
  287. package/lib-esm/ActionList2/List.d.ts +1 -1
  288. package/lib-esm/Autocomplete/Autocomplete.d.ts +3 -3
  289. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +3 -3
  290. package/lib-esm/Breadcrumbs.d.ts +8 -7
  291. package/lib-esm/Breadcrumbs.js +8 -13
  292. package/lib-esm/Button/Button.d.ts +2 -3
  293. package/lib-esm/Button/Button.js +2 -2
  294. package/lib-esm/Button/ButtonBase.d.ts +5 -8
  295. package/lib-esm/Button/ButtonBase.js +1 -3
  296. package/lib-esm/Button/ButtonClose.d.ts +3 -46
  297. package/lib-esm/Button/ButtonClose.js +2 -2
  298. package/lib-esm/Button/ButtonDanger.d.ts +2 -3
  299. package/lib-esm/Button/ButtonDanger.js +2 -2
  300. package/lib-esm/Button/ButtonInvisible.d.ts +2 -3
  301. package/lib-esm/Button/ButtonInvisible.js +2 -2
  302. package/lib-esm/Button/ButtonOutline.d.ts +2 -3
  303. package/lib-esm/Button/ButtonOutline.js +2 -2
  304. package/lib-esm/Button/ButtonPrimary.d.ts +2 -3
  305. package/lib-esm/Button/ButtonPrimary.js +2 -2
  306. package/lib-esm/Button/ButtonTableList.d.ts +1 -2
  307. package/lib-esm/Button/ButtonTableList.js +2 -2
  308. package/lib-esm/CircleBadge.d.ts +4 -5
  309. package/lib-esm/CircleBadge.js +2 -2
  310. package/lib-esm/CircleOcticon.d.ts +1 -1
  311. package/lib-esm/CounterLabel.d.ts +1 -2
  312. package/lib-esm/CounterLabel.js +2 -2
  313. package/lib-esm/Dialog/Dialog.d.ts +5 -9
  314. package/lib-esm/Dialog/Dialog.js +12 -12
  315. package/lib-esm/Dialog.d.ts +4 -5
  316. package/lib-esm/Dialog.js +2 -2
  317. package/lib-esm/Dropdown.d.ts +10 -99
  318. package/lib-esm/Dropdown.js +4 -4
  319. package/lib-esm/DropdownMenu/DropdownButton.d.ts +3 -47
  320. package/lib-esm/DropdownMenu/DropdownButton.js +3 -1
  321. package/lib-esm/FilterList.d.ts +264 -303
  322. package/lib-esm/FilterList.js +3 -7
  323. package/lib-esm/FilteredSearch.d.ts +1 -2
  324. package/lib-esm/FilteredSearch.js +2 -2
  325. package/lib-esm/Flash.d.ts +1 -2
  326. package/lib-esm/Flash.js +2 -2
  327. package/lib-esm/FormGroup.d.ts +4 -5
  328. package/lib-esm/FormGroup.js +3 -3
  329. package/lib-esm/Header.d.ts +6 -7
  330. package/lib-esm/Header.js +5 -5
  331. package/lib-esm/Label.d.ts +1 -2
  332. package/lib-esm/Label.js +3 -4
  333. package/lib-esm/LabelGroup.d.ts +1 -2
  334. package/lib-esm/LabelGroup.js +2 -2
  335. package/lib-esm/Link.d.ts +1 -2
  336. package/lib-esm/Link.js +2 -2
  337. package/lib-esm/Overlay.d.ts +11 -10
  338. package/lib-esm/Overlay.js +2 -3
  339. package/lib-esm/Pagehead.d.ts +1 -2
  340. package/lib-esm/Pagehead.js +2 -2
  341. package/lib-esm/Pagination/Pagination.js +2 -2
  342. package/lib-esm/Popover.d.ts +4 -5
  343. package/lib-esm/Popover.js +4 -5
  344. package/lib-esm/Position.d.ts +4 -4
  345. package/lib-esm/SelectMenu/SelectMenu.d.ts +21 -189
  346. package/lib-esm/SelectMenu/SelectMenu.js +1 -2
  347. package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +1 -2
  348. package/lib-esm/SelectMenu/SelectMenuDivider.js +2 -2
  349. package/lib-esm/SelectMenu/SelectMenuFilter.js +2 -2
  350. package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +1 -2
  351. package/lib-esm/SelectMenu/SelectMenuFooter.js +2 -2
  352. package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +1 -2
  353. package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
  354. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +2 -3
  355. package/lib-esm/SelectMenu/SelectMenuItem.js +2 -2
  356. package/lib-esm/SelectMenu/SelectMenuList.d.ts +1 -2
  357. package/lib-esm/SelectMenu/SelectMenuList.js +2 -2
  358. package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
  359. package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +3 -2
  360. package/lib-esm/SelectMenu/SelectMenuModal.d.ts +2 -3
  361. package/lib-esm/SelectMenu/SelectMenuModal.js +2 -2
  362. package/lib-esm/SelectMenu/SelectMenuTab.d.ts +1 -2
  363. package/lib-esm/SelectMenu/SelectMenuTab.js +2 -2
  364. package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
  365. package/lib-esm/SelectMenu/SelectMenuTabPanel.js +2 -2
  366. package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +1 -2
  367. package/lib-esm/SelectMenu/SelectMenuTabs.js +2 -2
  368. package/lib-esm/SideNav.d.ts +11 -8
  369. package/lib-esm/SideNav.js +8 -16
  370. package/lib-esm/StateLabel.d.ts +1 -2
  371. package/lib-esm/StateLabel.js +7 -6
  372. package/lib-esm/StyledOcticon.d.ts +1 -2
  373. package/lib-esm/StyledOcticon.js +1 -2
  374. package/lib-esm/SubNav.d.ts +5 -11
  375. package/lib-esm/SubNav.js +8 -13
  376. package/lib-esm/TabNav.d.ts +3 -4
  377. package/lib-esm/TabNav.js +3 -3
  378. package/lib-esm/TextInputWithTokens.d.ts +3 -3
  379. package/lib-esm/Timeline.d.ts +19 -393
  380. package/lib-esm/Timeline.js +12 -13
  381. package/lib-esm/Token/Token.d.ts +1 -1
  382. package/lib-esm/Tooltip.d.ts +1 -2
  383. package/lib-esm/Tooltip.js +2 -2
  384. package/lib-esm/Truncate.d.ts +1 -2
  385. package/lib-esm/Truncate.js +1 -2
  386. package/lib-esm/UnderlineNav.d.ts +2 -3
  387. package/lib-esm/UnderlineNav.js +3 -3
  388. package/lib-esm/__tests__/Breadcrumbs.test.js +4 -1
  389. package/lib-esm/__tests__/Breadcrumbs.types.test.d.ts +3 -0
  390. package/lib-esm/__tests__/Breadcrumbs.types.test.js +12 -0
  391. package/lib-esm/__tests__/Button.test.js +6 -2
  392. package/lib-esm/__tests__/CircleBadge.types.test.d.ts +3 -0
  393. package/lib-esm/__tests__/CircleBadge.types.test.js +13 -0
  394. package/lib-esm/__tests__/CounterLabel.types.test.d.ts +3 -0
  395. package/lib-esm/__tests__/CounterLabel.types.test.js +13 -0
  396. package/lib-esm/__tests__/Dialog.types.test.d.ts +3 -0
  397. package/lib-esm/__tests__/Dialog.types.test.js +13 -0
  398. package/lib-esm/__tests__/Dialog2.types.test.d.ts +3 -0
  399. package/lib-esm/__tests__/Dialog2.types.test.js +16 -0
  400. package/lib-esm/__tests__/Dropdown.types.test.d.ts +3 -0
  401. package/lib-esm/__tests__/Dropdown.types.test.js +17 -0
  402. package/lib-esm/__tests__/FilterList.types.test.d.ts +3 -0
  403. package/lib-esm/__tests__/FilterList.types.test.js +13 -0
  404. package/lib-esm/__tests__/FilteredSearch.types.test.d.ts +3 -0
  405. package/lib-esm/__tests__/FilteredSearch.types.test.js +13 -0
  406. package/lib-esm/__tests__/Flash.types.test.d.ts +3 -0
  407. package/lib-esm/__tests__/Flash.types.test.js +13 -0
  408. package/lib-esm/__tests__/FormGroup.types.test.d.ts +3 -0
  409. package/lib-esm/__tests__/FormGroup.types.test.js +13 -0
  410. package/lib-esm/__tests__/Header.types.test.d.ts +3 -0
  411. package/lib-esm/__tests__/Header.types.test.js +15 -0
  412. package/lib-esm/__tests__/Label.types.test.d.ts +3 -0
  413. package/lib-esm/__tests__/Label.types.test.js +13 -0
  414. package/lib-esm/__tests__/LabelGroup.types.test.d.ts +3 -0
  415. package/lib-esm/__tests__/LabelGroup.types.test.js +13 -0
  416. package/lib-esm/__tests__/Link.test.js +11 -5
  417. package/lib-esm/__tests__/Link.types.test.d.ts +3 -0
  418. package/lib-esm/__tests__/Link.types.test.js +13 -0
  419. package/lib-esm/__tests__/Overlay.types.test.d.ts +3 -0
  420. package/lib-esm/__tests__/Overlay.types.test.js +20 -0
  421. package/lib-esm/__tests__/Pagehead.types.test.d.ts +3 -0
  422. package/lib-esm/__tests__/Pagehead.types.test.js +13 -0
  423. package/lib-esm/__tests__/Pagination.types.test.d.ts +3 -0
  424. package/lib-esm/__tests__/Pagination.types.test.js +18 -0
  425. package/lib-esm/__tests__/Popover.types.test.d.ts +3 -0
  426. package/lib-esm/__tests__/Popover.types.test.js +13 -0
  427. package/lib-esm/__tests__/SelectMenu.types.test.d.ts +3 -0
  428. package/lib-esm/__tests__/SelectMenu.types.test.js +33 -0
  429. package/lib-esm/__tests__/SideNav.types.test.d.ts +3 -0
  430. package/lib-esm/__tests__/SideNav.types.test.js +13 -0
  431. package/lib-esm/__tests__/StateLabel.types.test.d.ts +3 -0
  432. package/lib-esm/__tests__/StateLabel.types.test.js +13 -0
  433. package/lib-esm/__tests__/StyledOcticon.types.test.d.ts +3 -0
  434. package/lib-esm/__tests__/StyledOcticon.types.test.js +16 -0
  435. package/lib-esm/__tests__/SubNav.types.test.d.ts +3 -0
  436. package/lib-esm/__tests__/SubNav.types.test.js +14 -0
  437. package/lib-esm/__tests__/TabNav.types.test.d.ts +3 -0
  438. package/lib-esm/__tests__/TabNav.types.test.js +12 -0
  439. package/lib-esm/__tests__/Timeline.types.test.d.ts +3 -0
  440. package/lib-esm/__tests__/Timeline.types.test.js +18 -0
  441. package/lib-esm/__tests__/Tooltip.types.test.d.ts +3 -0
  442. package/lib-esm/__tests__/Tooltip.types.test.js +13 -0
  443. package/lib-esm/__tests__/Truncate.types.test.d.ts +3 -0
  444. package/lib-esm/__tests__/Truncate.types.test.js +16 -0
  445. package/lib-esm/__tests__/UnderlineNav.types.test.d.ts +3 -0
  446. package/lib-esm/__tests__/UnderlineNav.types.test.js +12 -0
  447. package/lib-esm/stories/ActionList2.stories.js +4 -3
  448. package/lib-esm/stories/ActionMenu.stories.js +1 -3
  449. package/lib-esm/stories/ConfirmationDialog.stories.js +16 -8
  450. package/lib-esm/stories/Dialog.stories.js +6 -2
  451. package/lib-esm/stories/useFocusTrap.stories.js +6 -2
  452. package/lib-esm/stories/useFocusZone.stories.js +13 -5
  453. package/package-lock.json +7 -7
  454. package/package.json +2 -2
  455. package/src/ActionList2/Group.tsx +76 -7
  456. package/src/ActionList2/List.tsx +1 -1
  457. package/src/Breadcrumbs.tsx +11 -11
  458. package/src/Button/Button.tsx +2 -3
  459. package/src/Button/ButtonBase.tsx +2 -6
  460. package/src/Button/ButtonClose.tsx +2 -6
  461. package/src/Button/ButtonDanger.tsx +2 -3
  462. package/src/Button/ButtonInvisible.tsx +2 -3
  463. package/src/Button/ButtonOutline.tsx +2 -3
  464. package/src/Button/ButtonPrimary.tsx +2 -3
  465. package/src/Button/ButtonTableList.tsx +2 -15
  466. package/src/CircleBadge.tsx +2 -4
  467. package/src/CounterLabel.tsx +2 -4
  468. package/src/Dialog/Dialog.tsx +22 -11
  469. package/src/Dialog.tsx +2 -6
  470. package/src/Dropdown.tsx +3 -7
  471. package/src/DropdownMenu/DropdownButton.tsx +1 -1
  472. package/src/FilterList.tsx +5 -11
  473. package/src/FilteredSearch.tsx +2 -3
  474. package/src/Flash.tsx +2 -4
  475. package/src/FormGroup.tsx +3 -6
  476. package/src/Header.tsx +4 -14
  477. package/src/Label.tsx +2 -5
  478. package/src/LabelGroup.tsx +2 -3
  479. package/src/Link.tsx +2 -6
  480. package/src/Overlay.tsx +13 -11
  481. package/src/Pagehead.tsx +2 -3
  482. package/src/Pagination/Pagination.tsx +3 -5
  483. package/src/Popover.tsx +3 -14
  484. package/src/SelectMenu/SelectMenu.tsx +1 -3
  485. package/src/SelectMenu/SelectMenuDivider.tsx +2 -3
  486. package/src/SelectMenu/SelectMenuFilter.tsx +2 -3
  487. package/src/SelectMenu/SelectMenuFooter.tsx +2 -3
  488. package/src/SelectMenu/SelectMenuHeader.tsx +2 -4
  489. package/src/SelectMenu/SelectMenuItem.tsx +2 -3
  490. package/src/SelectMenu/SelectMenuList.tsx +2 -3
  491. package/src/SelectMenu/SelectMenuLoadingAnimation.tsx +4 -3
  492. package/src/SelectMenu/SelectMenuModal.tsx +2 -4
  493. package/src/SelectMenu/SelectMenuTab.tsx +2 -3
  494. package/src/SelectMenu/SelectMenuTabPanel.tsx +2 -3
  495. package/src/SelectMenu/SelectMenuTabs.tsx +2 -3
  496. package/src/SideNav.tsx +11 -13
  497. package/src/StateLabel.tsx +3 -5
  498. package/src/StyledOcticon.tsx +1 -3
  499. package/src/SubNav.tsx +8 -13
  500. package/src/TabNav.tsx +3 -7
  501. package/src/Timeline.tsx +11 -12
  502. package/src/Tooltip.tsx +3 -3
  503. package/src/Truncate.tsx +0 -5
  504. package/src/UnderlineNav.tsx +3 -6
  505. package/src/__tests__/Breadcrumbs.test.tsx +1 -1
  506. package/src/__tests__/Breadcrumbs.types.test.tsx +22 -0
  507. package/src/__tests__/Button.test.tsx +2 -2
  508. package/src/__tests__/CircleBadge.types.test.tsx +11 -0
  509. package/src/__tests__/CounterLabel.types.test.tsx +11 -0
  510. package/src/__tests__/Dialog.types.test.tsx +11 -0
  511. package/src/__tests__/Dialog2.types.test.tsx +11 -0
  512. package/src/__tests__/Dropdown.types.test.tsx +21 -0
  513. package/src/__tests__/FilterList.types.test.tsx +17 -0
  514. package/src/__tests__/FilteredSearch.types.test.tsx +11 -0
  515. package/src/__tests__/Flash.types.test.tsx +11 -0
  516. package/src/__tests__/FormGroup.types.test.tsx +11 -0
  517. package/src/__tests__/Header.types.test.tsx +19 -0
  518. package/src/__tests__/Label.types.test.tsx +11 -0
  519. package/src/__tests__/LabelGroup.types.test.tsx +11 -0
  520. package/src/__tests__/Link.test.tsx +5 -5
  521. package/src/__tests__/Link.types.test.tsx +11 -0
  522. package/src/__tests__/Overlay.types.test.tsx +18 -0
  523. package/src/__tests__/Pagehead.types.test.tsx +11 -0
  524. package/src/__tests__/Pagination.types.test.tsx +11 -0
  525. package/src/__tests__/Popover.types.test.tsx +17 -0
  526. package/src/__tests__/SelectMenu.types.test.tsx +37 -0
  527. package/src/__tests__/SideNav.types.test.tsx +11 -0
  528. package/src/__tests__/StateLabel.types.test.tsx +11 -0
  529. package/src/__tests__/StyledOcticon.types.test.tsx +12 -0
  530. package/src/__tests__/SubNav.types.test.tsx +25 -0
  531. package/src/__tests__/TabNav.types.test.tsx +22 -0
  532. package/src/__tests__/Timeline.types.test.tsx +31 -0
  533. package/src/__tests__/Tooltip.types.test.tsx +11 -0
  534. package/src/__tests__/Truncate.types.test.tsx +11 -0
  535. package/src/__tests__/UnderlineNav.types.test.tsx +22 -0
  536. package/src/__tests__/__snapshots__/Label.test.tsx.snap +3 -4
  537. package/src/__tests__/__snapshots__/Link.test.tsx.snap +1 -2
  538. package/src/stories/ActionList2.stories.tsx +3 -3
  539. package/src/stories/ActionMenu.stories.tsx +1 -4
  540. package/src/stories/ConfirmationDialog.stories.tsx +4 -4
  541. package/src/stories/Dialog.stories.tsx +2 -2
  542. package/src/stories/useFocusTrap.stories.tsx +2 -2
  543. package/src/stories/useFocusZone.stories.tsx +4 -4
  544. package/stats.html +1 -1
package/src/Timeline.tsx CHANGED
@@ -1,12 +1,12 @@
1
1
  import classnames from 'classnames'
2
2
  import React from 'react'
3
3
  import styled, {css} from 'styled-components'
4
- import Box, {BoxProps} from './Box'
5
- import {COMMON, get} from './constants'
6
- import sx from './sx'
4
+ import {Box} from '.'
5
+ import {get} from './constants'
6
+ import sx, {SxProp} from './sx'
7
7
  import {ComponentProps} from './utils/types'
8
8
 
9
- const Timeline = styled(Box)<{clipSidebar?: boolean}>`
9
+ const Timeline = styled.div<{clipSidebar?: boolean} & SxProp>`
10
10
  display: flex;
11
11
  flex-direction: column;
12
12
  ${props =>
@@ -24,9 +24,9 @@ const Timeline = styled(Box)<{clipSidebar?: boolean}>`
24
24
  ${sx};
25
25
  `
26
26
 
27
- type StyledTimelineItemProps = {condensed?: boolean}
27
+ type StyledTimelineItemProps = {condensed?: boolean} & SxProp
28
28
 
29
- const TimelineItem = styled(Box).attrs<StyledTimelineItemProps>(props => ({
29
+ const TimelineItem = styled.div.attrs<StyledTimelineItemProps>(props => ({
30
30
  className: classnames('Timeline-Item', props.className)
31
31
  }))<StyledTimelineItemProps>`
32
32
  display: flex;
@@ -64,18 +64,17 @@ const TimelineItem = styled(Box).attrs<StyledTimelineItemProps>(props => ({
64
64
  }
65
65
  `}
66
66
 
67
- ${COMMON};
68
67
  ${sx};
69
68
  `
70
69
 
71
- export type TimelineBadgeProps = BoxProps
70
+ export type TimelineBadgeProps = {children?: React.ReactNode} & SxProp
72
71
 
73
72
  const TimelineBadge = (props: TimelineBadgeProps) => {
74
73
  return (
75
74
  <Box position="relative" zIndex={1}>
76
75
  <Box
77
76
  display="flex"
78
- className={classnames(props.className, 'TimelineItem-Badge')}
77
+ className="TimelineItem-Badge"
79
78
  flexShrink={0}
80
79
  borderRadius="50%"
81
80
  borderWidth="2px"
@@ -90,7 +89,7 @@ const TimelineBadge = (props: TimelineBadgeProps) => {
90
89
  ml="-15px"
91
90
  alignItems="center"
92
91
  justifyContent="center"
93
- {...props}
92
+ sx={props.sx}
94
93
  >
95
94
  {props.children}
96
95
  </Box>
@@ -98,7 +97,7 @@ const TimelineBadge = (props: TimelineBadgeProps) => {
98
97
  )
99
98
  }
100
99
 
101
- const TimelineBody = styled(Box)`
100
+ const TimelineBody = styled.div<SxProp>`
102
101
  min-width: 0;
103
102
  max-width: 100%;
104
103
  margin-top: ${get('space.1')};
@@ -108,7 +107,7 @@ const TimelineBody = styled(Box)`
108
107
  ${sx};
109
108
  `
110
109
 
111
- const TimelineBreak = styled(Box)`
110
+ const TimelineBreak = styled.div<SxProp>`
112
111
  position: relative
113
112
  z-index: 1;
114
113
  height: 24px;
package/src/Tooltip.tsx CHANGED
@@ -1,11 +1,11 @@
1
1
  import classnames from 'classnames'
2
2
  import React from 'react'
3
3
  import styled from 'styled-components'
4
- import {COMMON, get, SystemCommonProps} from './constants'
4
+ import {get} from './constants'
5
5
  import sx, {SxProp} from './sx'
6
6
  import {ComponentProps} from './utils/types'
7
7
 
8
- const TooltipBase = styled.span<SystemCommonProps & SxProp>`
8
+ const TooltipBase = styled.span<SxProp>`
9
9
  position: relative;
10
10
 
11
11
  &::before {
@@ -229,7 +229,7 @@ const TooltipBase = styled.span<SystemCommonProps & SxProp>`
229
229
  &.tooltipped-align-left-2::before {
230
230
  left: 10px;
231
231
  }
232
- ${COMMON};
232
+
233
233
  ${sx};
234
234
  `
235
235
 
package/src/Truncate.tsx CHANGED
@@ -1,6 +1,5 @@
1
1
  import styled from 'styled-components'
2
2
  import {maxWidth, MaxWidthProps} from 'styled-system'
3
- import {COMMON, SystemCommonProps, SystemTypographyProps, TYPOGRAPHY} from './constants'
4
3
  import sx, {SxProp} from './sx'
5
4
  import {ComponentProps} from './utils/types'
6
5
 
@@ -9,13 +8,9 @@ type StyledTruncateProps = {
9
8
  inline?: boolean
10
9
  expandable?: boolean
11
10
  } & MaxWidthProps &
12
- SystemTypographyProps &
13
- SystemCommonProps &
14
11
  SxProp
15
12
 
16
13
  const Truncate = styled.div<StyledTruncateProps>`
17
- ${TYPOGRAPHY}
18
- ${COMMON}
19
14
  display: ${props => (props.inline ? 'inline-block' : 'inherit')};
20
15
  overflow: hidden;
21
16
  text-overflow: ellipsis;
@@ -3,14 +3,14 @@ import classnames from 'classnames'
3
3
  import * as History from 'history'
4
4
  import React from 'react'
5
5
  import styled from 'styled-components'
6
- import {COMMON, get, SystemCommonProps} from './constants'
6
+ import {get} from './constants'
7
7
  import sx, {SxProp} from './sx'
8
8
  import {ComponentProps} from './utils/types'
9
9
 
10
10
  const ITEM_CLASS = 'UnderlineNav-item'
11
11
  const SELECTED_CLASS = 'selected'
12
12
 
13
- const UnderlineNavBase = styled.nav`
13
+ const UnderlineNavBase = styled.nav<SxProp>`
14
14
  display: flex;
15
15
  justify-content: space-between;
16
16
  border-bottom: 1px solid ${get('colors.border.muted')};
@@ -39,7 +39,6 @@ const UnderlineNavBase = styled.nav`
39
39
  align-self: center;
40
40
  }
41
41
 
42
- ${COMMON};
43
42
  ${sx};
44
43
  `
45
44
 
@@ -63,8 +62,7 @@ function UnderlineNav({actions, className, align, children, full, label, theme,
63
62
  type StyledUnderlineNavLinkProps = {
64
63
  to?: History.LocationDescriptor
65
64
  selected?: boolean
66
- } & SystemCommonProps &
67
- SxProp
65
+ } & SxProp
68
66
 
69
67
  const UnderlineNavLink = styled.a.attrs<StyledUnderlineNavLinkProps>(props => ({
70
68
  activeClassName: typeof props.to === 'string' ? 'selected' : '',
@@ -100,7 +98,6 @@ const UnderlineNavLink = styled.a.attrs<StyledUnderlineNavLinkProps>(props => ({
100
98
  }
101
99
  }
102
100
 
103
- ${COMMON};
104
101
  ${sx};
105
102
  `
106
103
 
@@ -7,7 +7,7 @@ import 'babel-polyfill'
7
7
  expect.extend(toHaveNoViolations)
8
8
 
9
9
  describe('Breadcrumbs', () => {
10
- behavesAsComponent({Component: Breadcrumbs})
10
+ behavesAsComponent({Component: Breadcrumbs, options: {skipAs: true}})
11
11
 
12
12
  checkExports('Breadcrumbs', {
13
13
  default: Breadcrumbs,
@@ -0,0 +1,22 @@
1
+ import React from 'react'
2
+ import Breadcrumbs from '../Breadcrumbs'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return (
6
+ <>
7
+ <Breadcrumbs />
8
+ <Breadcrumbs.Item />
9
+ </>
10
+ )
11
+ }
12
+
13
+ export function shouldNotAcceptSystemProps() {
14
+ return (
15
+ <>
16
+ {/* @ts-expect-error system props should not be accepted */}
17
+ <Breadcrumbs backgroundColor="maroon" />
18
+ {/* @ts-expect-error system props should not be accepted */}
19
+ <Breadcrumbs.Item backgroundColor="fuchsia" />
20
+ </>
21
+ )
22
+ }
@@ -48,7 +48,7 @@ describe('Button', () => {
48
48
  })
49
49
 
50
50
  it('respects width props', () => {
51
- expect(render(<Button width={200} />)).toHaveStyleRule('width', '200px')
51
+ expect(render(<Button sx={{width: 200}} />)).toHaveStyleRule('width', '200px')
52
52
  })
53
53
 
54
54
  it('respects the "disabled" prop', () => {
@@ -63,7 +63,7 @@ describe('Button', () => {
63
63
  })
64
64
 
65
65
  it('respects the "fontSize" prop over the "variant" prop', () => {
66
- expect(render(<Button variant="small" fontSize={20} />)).toHaveStyleRule('font-size', '20px')
66
+ expect(render(<Button variant="small" sx={{fontSize: 20}} />)).toHaveStyleRule('font-size', '20px')
67
67
  })
68
68
  })
69
69
 
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import CircleBadge from '../CircleBadge'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <CircleBadge />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <CircleBadge backgroundColor="thistle" />
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import CounterLabel from '../CounterLabel'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <CounterLabel />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <CounterLabel backgroundColor="whitesmoke" />
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import Dialog from '../Dialog'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Dialog />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <Dialog backgroundColor="thistle" />
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import {Dialog} from '../Dialog/Dialog'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Dialog onClose={() => null} />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <Dialog onClose={() => null} backgroundColor="tomato" />
11
+ }
@@ -0,0 +1,21 @@
1
+ import React from 'react'
2
+ import Dropdown from '../Dropdown'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Dropdown />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ return (
10
+ <>
11
+ {/* @ts-expect-error system props should not be accepted */}
12
+ <Dropdown.Caret backgroundColor="thistle" />
13
+ {/* @ts-expect-error system props should not be accepted */}
14
+ <Dropdown.Menu backgroundColor="thistle" />
15
+ {/* @ts-expect-error system props should not be accepted */}
16
+ <Dropdown.Item backgroundColor="thistle" />
17
+ {/* @ts-expect-error system props should not be accepted */}
18
+ <Dropdown.Button backgroundColor="thistle" />
19
+ </>
20
+ )
21
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+ import FilterList from '../FilterList'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <FilterList />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ return (
10
+ <>
11
+ {/* @ts-expect-error system props should not be accepted */}
12
+ <FilterList backgroundColor="thistle" />
13
+ {/* @ts-expect-error system props should not be accepted */}
14
+ <FilterList.Item backgroundColor="thistle" />
15
+ </>
16
+ )
17
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import FilteredSearch from '../FilteredSearch'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <FilteredSearch />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <FilteredSearch backgroundColor="rosybrown" />
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import Flash from '../Flash'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Flash />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <Flash backgroundColor="thistle" />
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import FormGroup from '../FormGroup'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <FormGroup />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <FormGroup backgroundColor="thistle" />
11
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react'
2
+ import Header from '../Header'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Header />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ return (
10
+ <>
11
+ {/* @ts-expect-error system props should not be accepted */}
12
+ <Header backgroundColor="saddlebrown" />
13
+ {/* @ts-expect-error system props should not be accepted */}
14
+ <Header.Item backgroundColor="salmon" />
15
+ {/* @ts-expect-error system props should not be accepted */}
16
+ <Header.Link backgroundColor="sandybrown" />
17
+ </>
18
+ )
19
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import Label from '../Label'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Label />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <Label backgroundColor="mintcream" />
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import LabelGroup from '../LabelGroup'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <LabelGroup />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <LabelGroup backgroundColor="khaki" />
11
+ }
@@ -28,9 +28,9 @@ describe('Link', () => {
28
28
  expect(render(<Link hoverColor="accent.fg" />)).toMatchSnapshot()
29
29
  })
30
30
 
31
- it('respects the "fontStyle" prop', () => {
32
- expect(render(<Link fontStyle="italic" />)).toHaveStyleRule('font-style', 'italic')
33
- expect(render(<Link as="i" fontStyle="normal" />)).toHaveStyleRule('font-style', 'normal')
31
+ it('respects the "sx" prop', () => {
32
+ expect(render(<Link sx={{fontStyle: 'italic'}} />)).toHaveStyleRule('font-style', 'italic')
33
+ expect(render(<Link as="i" sx={{fontStyle: 'normal'}} />)).toHaveStyleRule('font-style', 'normal')
34
34
  })
35
35
 
36
36
  it('applies button styles when rendering a button element', () => {
@@ -41,7 +41,7 @@ describe('Link', () => {
41
41
  expect(render(<Link muted />)).toMatchSnapshot()
42
42
  })
43
43
 
44
- it('respectes the "color" prop when "muted" prop is also passed', () => {
45
- expect(render(<Link muted color="fg.onEmphasis" />)).toMatchSnapshot()
44
+ it('respectes the "sx" prop when "muted" prop is also passed', () => {
45
+ expect(render(<Link muted sx={{color: 'fg.onEmphasis'}} />)).toMatchSnapshot()
46
46
  })
47
47
  })
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import Link from '../Link'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Link />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <Link backgroundColor="mistyrose" />
11
+ }
@@ -0,0 +1,18 @@
1
+ import React from 'react'
2
+ import Overlay from '../Overlay'
3
+
4
+ export function shouldAcceptCallWithNoProps(ref: React.RefObject<HTMLElement>) {
5
+ return <Overlay returnFocusRef={ref} onClickOutside={() => null} onEscape={() => null} />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps(ref: React.RefObject<HTMLElement>) {
9
+ return (
10
+ <Overlay
11
+ returnFocusRef={ref}
12
+ onClickOutside={() => null}
13
+ onEscape={() => null}
14
+ // @ts-expect-error system props should not be accepted
15
+ backgroundColor="olivedrab"
16
+ />
17
+ )
18
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import Pagehead from '../Pagehead'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Pagehead />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <Pagehead backgroundColor="orchid" />
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import Pagination from '../Pagination'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Pagination currentPage={1} pageCount={2} />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <Pagination currentPage={1} pageCount={2} backgroundColor="palegoldenrod" />
11
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+ import Popover from '../Popover'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Popover />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ return (
10
+ <>
11
+ {/* @ts-expect-error system props should not be accepted */}
12
+ <Popover backgroundColor="palegreen" />
13
+ {/* @ts-expect-error system props should not be accepted */}
14
+ <Popover.Content backgroundColor="paleturquoise" />
15
+ </>
16
+ )
17
+ }
@@ -0,0 +1,37 @@
1
+ import React from 'react'
2
+ import SelectMenu from '../SelectMenu'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <SelectMenu />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ return (
10
+ <>
11
+ {/* @ts-expect-error system props should not be accepted */}
12
+ <SelectMenu backgroundColor="lightgray" />
13
+ {/* @ts-expect-error system props should not be accepted */}
14
+ <SelectMenu.List backgroundColor="lightgreen" />
15
+ {/* @ts-expect-error system props should not be accepted */}
16
+ <SelectMenu.Divider backgroundColor="lightgrey" />
17
+ {/* This will not error for now, but once TextInputProps is fixed, a ts-expect-error can be added */}
18
+ <SelectMenu.Filter backgroundColor="lightpink" />
19
+ {/* @ts-expect-error system props should not be accepted */}
20
+ <SelectMenu.Footer backgroundColor="lightsalmon" />
21
+ {/* @ts-expect-error system props should not be accepted */}
22
+ <SelectMenu.Item backgroundColor="lightseagreen" />
23
+ {/* @ts-expect-error system props should not be accepted */}
24
+ <SelectMenu.Modal backgroundColor="lightskyblue" />
25
+ {/* @ts-expect-error system props should not be accepted */}
26
+ <SelectMenu.Tabs backgroundColor="lightslategray" />
27
+ {/* @ts-expect-error system props should not be accepted */}
28
+ <SelectMenu.Tab backgroundColor="lightslategrey" />
29
+ {/* @ts-expect-error system props should not be accepted */}
30
+ <SelectMenu.TabPanel backgroundColor="lightsteelblue" />
31
+ {/* @ts-expect-error system props should not be accepted */}
32
+ <SelectMenu.Header backgroundColor="lightyellow" />
33
+ {/* @ts-expect-error system props should not be accepted */}
34
+ <SelectMenu.LoadingAnimation backgroundColor="lightcyan" />
35
+ </>
36
+ )
37
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import SideNav from '../SideNav'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <SideNav />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <SideNav backgroundColor="aliceblue" />
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import StateLabel from '../StateLabel'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <StateLabel />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <StateLabel backgroundColor="bisque" />
11
+ }
@@ -0,0 +1,12 @@
1
+ import {MoonIcon} from '@primer/octicons-react'
2
+ import React from 'react'
3
+ import StyledOcticon from '../StyledOcticon'
4
+
5
+ export function shouldAcceptCallWithNoProps() {
6
+ return <StyledOcticon icon={MoonIcon} />
7
+ }
8
+
9
+ export function shouldNotAcceptSystemProps() {
10
+ // @ts-expect-error system props should not be accepted
11
+ return <StyledOcticon backgroundColor="wheat" />
12
+ }
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+ import SubNav from '../SubNav'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return (
6
+ <>
7
+ <SubNav />
8
+ <SubNav.Link />
9
+ <SubNav.Links />
10
+ </>
11
+ )
12
+ }
13
+
14
+ export function shouldNotAcceptSystemProps() {
15
+ return (
16
+ <>
17
+ {/* @ts-expect-error system props should not be accepted */}
18
+ <SubNav backgroundColor="thistle" />
19
+ {/* @ts-expect-error system props should not be accepted */}
20
+ <SubNav.Link backgroundColor="thistle" />
21
+ {/* @ts-expect-error system props should not be accepted */}
22
+ <SubNav.Links backgroundColor="thistle" />
23
+ </>
24
+ )
25
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react'
2
+ import TabNav from '../TabNav'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return (
6
+ <>
7
+ <TabNav />
8
+ <TabNav.Link />
9
+ </>
10
+ )
11
+ }
12
+
13
+ export function shouldNotAcceptSystemProps() {
14
+ return (
15
+ <>
16
+ {/* @ts-expect-error system props should not be accepted */}
17
+ <TabNav backgroundColor="maroon" />
18
+ {/* @ts-expect-error system props should not be accepted */}
19
+ <TabNav.Link backgroundColor="fuchsia" />
20
+ </>
21
+ )
22
+ }
@@ -0,0 +1,31 @@
1
+ import React from 'react'
2
+ import Timeline from '../Timeline'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return (
6
+ <>
7
+ <Timeline />
8
+ <Timeline.Item />
9
+ <Timeline.Badge />
10
+ <Timeline.Body />
11
+ <Timeline.Break />
12
+ </>
13
+ )
14
+ }
15
+
16
+ export function shouldNotAcceptSystemProps() {
17
+ return (
18
+ <>
19
+ {/* @ts-expect-error system props should not be accepted */}
20
+ <Timeline backgroundColor="red" />
21
+ {/* @ts-expect-error system props should not be accepted */}
22
+ <Timeline.Item backgroundColor="orange" />
23
+ {/* @ts-expect-error system props should not be accepted */}
24
+ <Timeline.Badge backgroundColor="yellow" />
25
+ {/* @ts-expect-error system props should not be accepted */}
26
+ <Timeline.Body backgroundColor="green" />
27
+ {/* @ts-expect-error system props should not be accepted */}
28
+ <Timeline.Break backgroundColor="blue" />
29
+ </>
30
+ )
31
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import Tooltip from '../Tooltip'
3
+
4
+ export function shouldAcceptCallWithNoProps() {
5
+ return <Tooltip />
6
+ }
7
+
8
+ export function shouldNotAcceptSystemProps() {
9
+ // @ts-expect-error system props should not be accepted
10
+ return <Tooltip backgroundColor="thistle" />
11
+ }