@primer/components 0.0.0-2021113144816 → 0.0.0-2021113174023

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 (506) hide show
  1. package/CHANGELOG.md +892 -0
  2. package/dist/browser.esm.js +2272 -2
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +2272 -2
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/ActionList/Divider.jsx +29 -0
  7. package/lib/ActionList/Group.jsx +23 -0
  8. package/lib/ActionList/Header.js +1 -1
  9. package/lib/ActionList/Header.jsx +66 -0
  10. package/lib/ActionList/Item.js +65 -40
  11. package/lib/ActionList/Item.jsx +311 -0
  12. package/lib/ActionList/List.js +1 -1
  13. package/lib/ActionList/List.jsx +138 -0
  14. package/lib/ActionList/index.js +12 -23
  15. package/lib/ActionList2/Description.jsx +29 -0
  16. package/lib/ActionList2/Divider.d.ts +2 -3
  17. package/lib/ActionList2/Divider.js +5 -10
  18. package/lib/ActionList2/Divider.jsx +22 -0
  19. package/lib/ActionList2/Group.d.ts +2 -28
  20. package/lib/ActionList2/Group.js +6 -55
  21. package/lib/ActionList2/Group.jsx +25 -0
  22. package/lib/ActionList2/Header.d.ts +26 -0
  23. package/lib/ActionList2/Header.js +55 -0
  24. package/lib/ActionList2/Header.jsx +36 -0
  25. package/lib/ActionList2/Item.js +7 -25
  26. package/lib/ActionList2/Item.jsx +174 -0
  27. package/lib/ActionList2/LinkItem.jsx +28 -0
  28. package/lib/ActionList2/List.d.ts +1 -1
  29. package/lib/ActionList2/List.js +2 -11
  30. package/lib/ActionList2/List.jsx +41 -0
  31. package/lib/ActionList2/Selection.js +1 -14
  32. package/lib/ActionList2/Selection.jsx +50 -0
  33. package/lib/ActionList2/Visuals.jsx +48 -0
  34. package/lib/ActionList2/index.d.ts +2 -1
  35. package/lib/ActionList2/index.js +23 -41
  36. package/lib/ActionMenu.jsx +73 -0
  37. package/lib/AnchoredOverlay/AnchoredOverlay.jsx +100 -0
  38. package/lib/AnchoredOverlay/index.js +4 -12
  39. package/lib/Autocomplete/Autocomplete.d.ts +4 -6
  40. package/lib/Autocomplete/Autocomplete.jsx +100 -0
  41. package/lib/Autocomplete/AutocompleteContext.jsx +5 -0
  42. package/lib/Autocomplete/AutocompleteInput.d.ts +4 -6
  43. package/lib/Autocomplete/AutocompleteInput.jsx +113 -0
  44. package/lib/Autocomplete/AutocompleteMenu.jsx +190 -0
  45. package/lib/Autocomplete/AutocompleteOverlay.jsx +55 -0
  46. package/lib/Autocomplete/index.js +7 -14
  47. package/lib/Avatar.d.ts +2 -1
  48. package/lib/Avatar.js +1 -1
  49. package/lib/Avatar.jsx +34 -0
  50. package/lib/AvatarPair.jsx +29 -0
  51. package/lib/AvatarStack.jsx +151 -0
  52. package/lib/BaseStyles.js +20 -2
  53. package/lib/BaseStyles.jsx +65 -0
  54. package/lib/BorderBox.js +1 -1
  55. package/lib/BorderBox.jsx +18 -0
  56. package/lib/Box.js +1 -1
  57. package/lib/Box.jsx +10 -0
  58. package/lib/BranchName.d.ts +2 -1
  59. package/lib/BranchName.js +1 -1
  60. package/lib/BranchName.jsx +20 -0
  61. package/lib/Breadcrumbs.d.ts +7 -8
  62. package/lib/Breadcrumbs.js +15 -10
  63. package/lib/Breadcrumbs.jsx +74 -0
  64. package/lib/Button/Button.d.ts +5 -5
  65. package/lib/Button/Button.js +7 -3
  66. package/lib/Button/Button.jsx +60 -0
  67. package/lib/Button/ButtonBase.d.ts +8 -5
  68. package/lib/Button/ButtonBase.js +5 -1
  69. package/lib/Button/ButtonBase.jsx +36 -0
  70. package/lib/Button/ButtonClose.d.ts +47 -5
  71. package/lib/Button/ButtonClose.js +1 -1
  72. package/lib/Button/ButtonClose.jsx +55 -0
  73. package/lib/Button/ButtonDanger.d.ts +5 -5
  74. package/lib/Button/ButtonDanger.js +6 -2
  75. package/lib/Button/ButtonDanger.jsx +63 -0
  76. package/lib/Button/ButtonGroup.js +1 -1
  77. package/lib/Button/ButtonGroup.jsx +55 -0
  78. package/lib/Button/ButtonInvisible.d.ts +5 -5
  79. package/lib/Button/ButtonInvisible.js +6 -2
  80. package/lib/Button/ButtonInvisible.jsx +52 -0
  81. package/lib/Button/ButtonOutline.d.ts +5 -5
  82. package/lib/Button/ButtonOutline.js +6 -2
  83. package/lib/Button/ButtonOutline.jsx +63 -0
  84. package/lib/Button/ButtonPrimary.d.ts +5 -5
  85. package/lib/Button/ButtonPrimary.js +6 -2
  86. package/lib/Button/ButtonPrimary.jsx +62 -0
  87. package/lib/Button/ButtonStyles.jsx +37 -0
  88. package/lib/Button/ButtonTableList.d.ts +2 -1
  89. package/lib/Button/ButtonTableList.js +1 -1
  90. package/lib/Button/ButtonTableList.jsx +49 -0
  91. package/lib/Button/index.js +21 -70
  92. package/lib/Caret.jsx +93 -0
  93. package/lib/CircleBadge.d.ts +5 -4
  94. package/lib/CircleBadge.js +1 -1
  95. package/lib/CircleBadge.jsx +43 -0
  96. package/lib/CircleOcticon.d.ts +36 -37
  97. package/lib/CircleOcticon.jsx +21 -0
  98. package/lib/CounterLabel.d.ts +2 -1
  99. package/lib/CounterLabel.js +1 -1
  100. package/lib/CounterLabel.jsx +44 -0
  101. package/lib/Details.d.ts +2 -1
  102. package/lib/Details.js +4 -2
  103. package/lib/Details.jsx +21 -0
  104. package/lib/Dialog/ConfirmationDialog.jsx +146 -0
  105. package/lib/Dialog/Dialog.d.ts +9 -5
  106. package/lib/Dialog/Dialog.js +11 -17
  107. package/lib/Dialog/Dialog.jsx +273 -0
  108. package/lib/Dialog.d.ts +40 -40
  109. package/lib/Dialog.js +1 -1
  110. package/lib/Dialog.jsx +131 -0
  111. package/lib/Dropdown.d.ts +171 -22
  112. package/lib/Dropdown.js +3 -3
  113. package/lib/Dropdown.jsx +134 -0
  114. package/lib/DropdownMenu/DropdownButton.d.ts +49 -9
  115. package/lib/DropdownMenu/DropdownButton.js +1 -3
  116. package/lib/DropdownMenu/DropdownButton.jsx +14 -0
  117. package/lib/DropdownMenu/DropdownMenu.jsx +70 -0
  118. package/lib/DropdownMenu/index.js +6 -20
  119. package/lib/DropdownStyles.js +18 -26
  120. package/lib/EmojiPicker/EmojiPicker.d.ts +17 -0
  121. package/lib/EmojiPicker/EmojiPicker.js +202 -0
  122. package/lib/EmojiPicker/EmojiPicker.jsx +132 -0
  123. package/lib/EmojiPicker/EmojiPickerAnchor.d.ts +0 -0
  124. package/lib/EmojiPicker/EmojiPickerAnchor.js +1 -0
  125. package/lib/EmojiPicker/EmojiPickerAnchor.jsx +1 -0
  126. package/lib/EmojiPicker/EmojiPickerPanel.d.ts +3 -0
  127. package/lib/EmojiPicker/EmojiPickerPanel.js +18 -0
  128. package/lib/EmojiPicker/EmojiPickerPanel.jsx +10 -0
  129. package/lib/EmojiPicker/data.d.ts +9 -0
  130. package/lib/EmojiPicker/data.js +7254 -0
  131. package/lib/EmojiPicker/index.d.ts +2 -0
  132. package/lib/EmojiPicker/index.js +8 -0
  133. package/lib/FilterList.d.ts +303 -265
  134. package/lib/FilterList.js +6 -2
  135. package/lib/FilterList.jsx +63 -0
  136. package/lib/FilteredActionList/FilteredActionList.js +1 -1
  137. package/lib/FilteredActionList/FilteredActionList.jsx +100 -0
  138. package/lib/FilteredActionList/index.js +4 -12
  139. package/lib/FilteredSearch.d.ts +2 -1
  140. package/lib/FilteredSearch.js +1 -1
  141. package/lib/FilteredSearch.jsx +29 -0
  142. package/lib/Flash.d.ts +2 -1
  143. package/lib/Flash.js +1 -1
  144. package/lib/Flash.jsx +70 -0
  145. package/lib/Flex.js +1 -1
  146. package/lib/Flex.jsx +15 -0
  147. package/lib/FormGroup.d.ts +5 -4
  148. package/lib/FormGroup.js +2 -2
  149. package/lib/FormGroup.jsx +25 -0
  150. package/lib/Grid.jsx +15 -0
  151. package/lib/Header.d.ts +7 -6
  152. package/lib/Header.js +4 -4
  153. package/lib/Header.jsx +90 -0
  154. package/lib/Heading.d.ts +2 -1
  155. package/lib/Heading.js +6 -1
  156. package/lib/Heading.jsx +21 -0
  157. package/lib/Label.d.ts +2 -1
  158. package/lib/Label.js +3 -2
  159. package/lib/Label.jsx +84 -0
  160. package/lib/LabelGroup.d.ts +2 -1
  161. package/lib/LabelGroup.js +2 -2
  162. package/lib/LabelGroup.jsx +19 -0
  163. package/lib/Link.d.ts +2 -1
  164. package/lib/Link.js +1 -1
  165. package/lib/Link.jsx +38 -0
  166. package/lib/NewButton/button-counter.jsx +14 -0
  167. package/lib/NewButton/button.js +42 -34
  168. package/lib/NewButton/button.jsx +278 -0
  169. package/lib/NewButton/index.js +5 -12
  170. package/lib/NewButton/types.js +2 -1
  171. package/lib/Overlay.d.ts +11 -14
  172. package/lib/Overlay.js +5 -4
  173. package/lib/Overlay.jsx +156 -0
  174. package/lib/Pagehead.d.ts +2 -1
  175. package/lib/Pagehead.js +1 -1
  176. package/lib/Pagehead.jsx +18 -0
  177. package/lib/Pagination/Pagination.js +3 -3
  178. package/lib/Pagination/Pagination.jsx +163 -0
  179. package/lib/Pagination/index.js +6 -12
  180. package/lib/Pagination/model.jsx +174 -0
  181. package/lib/PointerBox.jsx +25 -0
  182. package/lib/Popover.d.ts +5 -4
  183. package/lib/Popover.js +5 -4
  184. package/lib/Popover.jsx +210 -0
  185. package/lib/Portal/Portal.jsx +79 -0
  186. package/lib/Portal/index.js +5 -16
  187. package/lib/Position.d.ts +4 -4
  188. package/lib/Position.js +1 -1
  189. package/lib/Position.jsx +46 -0
  190. package/lib/ProgressBar.d.ts +11 -16
  191. package/lib/ProgressBar.js +10 -6
  192. package/lib/ProgressBar.jsx +39 -0
  193. package/lib/SelectMenu/SelectMenu.d.ts +195 -34
  194. package/lib/SelectMenu/SelectMenu.js +4 -2
  195. package/lib/SelectMenu/SelectMenu.jsx +114 -0
  196. package/lib/SelectMenu/SelectMenuContext.jsx +5 -0
  197. package/lib/SelectMenu/SelectMenuDivider.d.ts +2 -1
  198. package/lib/SelectMenu/SelectMenuDivider.js +1 -1
  199. package/lib/SelectMenu/SelectMenuDivider.jsx +43 -0
  200. package/lib/SelectMenu/SelectMenuFilter.js +2 -2
  201. package/lib/SelectMenu/SelectMenuFilter.jsx +59 -0
  202. package/lib/SelectMenu/SelectMenuFooter.d.ts +2 -1
  203. package/lib/SelectMenu/SelectMenuFooter.js +2 -2
  204. package/lib/SelectMenu/SelectMenuFooter.jsx +46 -0
  205. package/lib/SelectMenu/SelectMenuHeader.d.ts +2 -1
  206. package/lib/SelectMenu/SelectMenuHeader.js +1 -1
  207. package/lib/SelectMenu/SelectMenuHeader.jsx +44 -0
  208. package/lib/SelectMenu/SelectMenuItem.d.ts +3 -2
  209. package/lib/SelectMenu/SelectMenuItem.js +2 -2
  210. package/lib/SelectMenu/SelectMenuItem.jsx +143 -0
  211. package/lib/SelectMenu/SelectMenuList.d.ts +2 -1
  212. package/lib/SelectMenu/SelectMenuList.js +1 -1
  213. package/lib/SelectMenu/SelectMenuList.jsx +60 -0
  214. package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
  215. package/lib/SelectMenu/SelectMenuLoadingAnimation.js +1 -3
  216. package/lib/SelectMenu/SelectMenuLoadingAnimation.jsx +21 -0
  217. package/lib/SelectMenu/SelectMenuModal.d.ts +3 -2
  218. package/lib/SelectMenu/SelectMenuModal.js +1 -1
  219. package/lib/SelectMenu/SelectMenuModal.jsx +119 -0
  220. package/lib/SelectMenu/SelectMenuTab.d.ts +2 -1
  221. package/lib/SelectMenu/SelectMenuTab.js +2 -2
  222. package/lib/SelectMenu/SelectMenuTab.jsx +93 -0
  223. package/lib/SelectMenu/SelectMenuTabPanel.d.ts +2 -1
  224. package/lib/SelectMenu/SelectMenuTabPanel.js +2 -2
  225. package/lib/SelectMenu/SelectMenuTabPanel.jsx +43 -0
  226. package/lib/SelectMenu/SelectMenuTabs.d.ts +2 -1
  227. package/lib/SelectMenu/SelectMenuTabs.js +2 -2
  228. package/lib/SelectMenu/SelectMenuTabs.jsx +58 -0
  229. package/lib/SelectMenu/hooks/useKeyboardNav.js +80 -96
  230. package/lib/SelectMenu/index.js +7 -14
  231. package/lib/SelectPanel/SelectPanel.jsx +105 -0
  232. package/lib/SelectPanel/index.js +4 -12
  233. package/lib/SideNav.d.ts +8 -11
  234. package/lib/SideNav.js +15 -8
  235. package/lib/SideNav.jsx +177 -0
  236. package/lib/Spinner.d.ts +2 -1
  237. package/lib/Spinner.js +3 -1
  238. package/lib/Spinner.jsx +35 -0
  239. package/lib/StateLabel.d.ts +2 -1
  240. package/lib/StateLabel.js +6 -7
  241. package/lib/StateLabel.jsx +94 -0
  242. package/lib/StyledOcticon.d.ts +2 -1
  243. package/lib/StyledOcticon.js +4 -2
  244. package/lib/StyledOcticon.jsx +20 -0
  245. package/lib/SubNav.d.ts +11 -5
  246. package/lib/SubNav.js +13 -8
  247. package/lib/SubNav.jsx +104 -0
  248. package/lib/TabNav.d.ts +4 -3
  249. package/lib/TabNav.js +2 -2
  250. package/lib/TabNav.jsx +60 -0
  251. package/lib/Text.jsx +14 -0
  252. package/lib/TextInput.jsx +23 -0
  253. package/lib/TextInputWithTokens.d.ts +4 -6
  254. package/lib/TextInputWithTokens.jsx +218 -0
  255. package/lib/ThemeProvider.d.ts +0 -1
  256. package/lib/ThemeProvider.js +4 -17
  257. package/lib/ThemeProvider.jsx +130 -0
  258. package/lib/Timeline.d.ts +393 -19
  259. package/lib/Timeline.js +17 -20
  260. package/lib/Timeline.jsx +124 -0
  261. package/lib/Token/AvatarToken.d.ts +1 -1
  262. package/lib/Token/AvatarToken.js +1 -1
  263. package/lib/Token/AvatarToken.jsx +54 -0
  264. package/lib/Token/IssueLabelToken.d.ts +1 -1
  265. package/lib/Token/IssueLabelToken.jsx +125 -0
  266. package/lib/Token/Token.d.ts +1 -1
  267. package/lib/Token/Token.jsx +103 -0
  268. package/lib/Token/TokenBase.js +1 -1
  269. package/lib/Token/TokenBase.jsx +88 -0
  270. package/lib/Token/_RemoveTokenButton.jsx +108 -0
  271. package/lib/Token/_TokenTextContainer.jsx +49 -0
  272. package/lib/Token/index.js +11 -30
  273. package/lib/Tooltip.d.ts +2 -1
  274. package/lib/Tooltip.js +2 -2
  275. package/lib/Tooltip.jsx +246 -0
  276. package/lib/Truncate.d.ts +2 -1
  277. package/lib/Truncate.js +3 -1
  278. package/lib/Truncate.jsx +27 -0
  279. package/lib/UnderlineNav.d.ts +3 -2
  280. package/lib/UnderlineNav.js +4 -4
  281. package/lib/UnderlineNav.jsx +90 -0
  282. package/lib/_TextInputWrapper.jsx +120 -0
  283. package/lib/_UnstyledTextInput.jsx +22 -0
  284. package/lib/behaviors/anchoredPosition.js +205 -234
  285. package/lib/behaviors/focusTrap.js +121 -157
  286. package/lib/behaviors/focusZone.js +434 -509
  287. package/lib/behaviors/scrollIntoViewingArea.js +18 -35
  288. package/lib/constants.js +39 -43
  289. package/lib/drafts.d.ts +0 -1
  290. package/lib/drafts.js +20 -43
  291. package/lib/hooks/index.js +16 -60
  292. package/lib/hooks/useAnchoredPosition.js +32 -40
  293. package/lib/hooks/useCombinedRefs.js +32 -36
  294. package/lib/hooks/useDetails.jsx +39 -0
  295. package/lib/hooks/useDialog.js +72 -96
  296. package/lib/hooks/useFocusTrap.js +43 -60
  297. package/lib/hooks/useFocusZone.js +54 -50
  298. package/lib/hooks/useOnEscapePress.js +25 -36
  299. package/lib/hooks/useOnOutsideClick.jsx +61 -0
  300. package/lib/hooks/useOpenAndCloseFocus.js +22 -34
  301. package/lib/hooks/useOverlay.jsx +15 -0
  302. package/lib/hooks/useProvidedRefOrCreate.js +10 -14
  303. package/lib/hooks/useProvidedStateOrCreate.js +13 -16
  304. package/lib/hooks/useRenderForcingRef.js +13 -17
  305. package/lib/hooks/useResizeObserver.js +15 -18
  306. package/lib/hooks/useSafeTimeout.js +22 -30
  307. package/lib/hooks/useScrollFlash.js +16 -23
  308. package/lib/index.d.ts +2 -2
  309. package/lib/index.js +165 -652
  310. package/lib/polyfills/eventListenerSignal.js +37 -45
  311. package/lib/sx.js +10 -22
  312. package/lib/theme-preval.js +64 -3169
  313. package/lib/theme.js +3 -12
  314. package/lib/utils/create-slots.jsx +65 -0
  315. package/lib/utils/deprecate.jsx +59 -0
  316. package/lib/utils/isNumeric.jsx +7 -0
  317. package/lib/utils/iterateFocusableElements.js +63 -85
  318. package/lib/utils/ssr.jsx +6 -0
  319. package/lib/utils/test-deprecations.jsx +20 -0
  320. package/lib/utils/test-helpers.jsx +8 -0
  321. package/lib/utils/test-matchers.jsx +100 -0
  322. package/lib/utils/testing.d.ts +61 -8
  323. package/lib/utils/testing.js +0 -29
  324. package/lib/utils/testing.jsx +206 -0
  325. package/lib/utils/theme.js +33 -47
  326. package/lib/utils/types/AriaRole.js +2 -1
  327. package/lib/utils/types/ComponentProps.js +2 -1
  328. package/lib/utils/types/Flatten.js +2 -1
  329. package/lib/utils/types/KeyPaths.js +2 -1
  330. package/lib/utils/types/MandateProps.js +16 -1
  331. package/lib/utils/types/Merge.js +2 -1
  332. package/lib/utils/types/index.js +16 -69
  333. package/lib/utils/uniqueId.js +5 -8
  334. package/lib/utils/use-force-update.js +8 -14
  335. package/lib/utils/useIsomorphicLayoutEffect.js +8 -11
  336. package/lib/utils/userAgent.js +8 -12
  337. package/lib-esm/ActionList/Header.js +1 -1
  338. package/lib-esm/ActionList/Item.js +66 -41
  339. package/lib-esm/ActionList/List.js +1 -1
  340. package/lib-esm/ActionList2/Divider.d.ts +2 -3
  341. package/lib-esm/ActionList2/Divider.js +5 -8
  342. package/lib-esm/ActionList2/Group.d.ts +2 -28
  343. package/lib-esm/ActionList2/Group.js +5 -52
  344. package/lib-esm/ActionList2/Header.d.ts +26 -0
  345. package/lib-esm/ActionList2/Header.js +44 -0
  346. package/lib-esm/ActionList2/Item.js +7 -23
  347. package/lib-esm/ActionList2/List.d.ts +1 -1
  348. package/lib-esm/ActionList2/List.js +2 -9
  349. package/lib-esm/ActionList2/Selection.js +1 -12
  350. package/lib-esm/ActionList2/index.d.ts +2 -1
  351. package/lib-esm/Autocomplete/Autocomplete.d.ts +4 -6
  352. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +4 -6
  353. package/lib-esm/Avatar.d.ts +2 -1
  354. package/lib-esm/Avatar.js +2 -2
  355. package/lib-esm/BaseStyles.js +20 -2
  356. package/lib-esm/BorderBox.js +1 -1
  357. package/lib-esm/Box.js +1 -1
  358. package/lib-esm/BranchName.d.ts +2 -1
  359. package/lib-esm/BranchName.js +2 -2
  360. package/lib-esm/Breadcrumbs.d.ts +7 -8
  361. package/lib-esm/Breadcrumbs.js +16 -11
  362. package/lib-esm/Button/Button.d.ts +5 -5
  363. package/lib-esm/Button/Button.js +3 -3
  364. package/lib-esm/Button/ButtonBase.d.ts +8 -5
  365. package/lib-esm/Button/ButtonBase.js +3 -1
  366. package/lib-esm/Button/ButtonClose.d.ts +47 -5
  367. package/lib-esm/Button/ButtonClose.js +2 -2
  368. package/lib-esm/Button/ButtonDanger.d.ts +5 -5
  369. package/lib-esm/Button/ButtonDanger.js +2 -2
  370. package/lib-esm/Button/ButtonGroup.js +1 -1
  371. package/lib-esm/Button/ButtonInvisible.d.ts +5 -5
  372. package/lib-esm/Button/ButtonInvisible.js +2 -2
  373. package/lib-esm/Button/ButtonOutline.d.ts +5 -5
  374. package/lib-esm/Button/ButtonOutline.js +2 -2
  375. package/lib-esm/Button/ButtonPrimary.d.ts +5 -5
  376. package/lib-esm/Button/ButtonPrimary.js +2 -2
  377. package/lib-esm/Button/ButtonTableList.d.ts +2 -1
  378. package/lib-esm/Button/ButtonTableList.js +2 -2
  379. package/lib-esm/CircleBadge.d.ts +5 -4
  380. package/lib-esm/CircleBadge.js +2 -2
  381. package/lib-esm/CircleOcticon.d.ts +36 -37
  382. package/lib-esm/CounterLabel.d.ts +2 -1
  383. package/lib-esm/CounterLabel.js +2 -2
  384. package/lib-esm/Details.d.ts +2 -1
  385. package/lib-esm/Details.js +3 -2
  386. package/lib-esm/Dialog/Dialog.d.ts +9 -5
  387. package/lib-esm/Dialog/Dialog.js +12 -12
  388. package/lib-esm/Dialog.d.ts +40 -40
  389. package/lib-esm/Dialog.js +2 -2
  390. package/lib-esm/Dropdown.d.ts +171 -22
  391. package/lib-esm/Dropdown.js +4 -4
  392. package/lib-esm/DropdownMenu/DropdownButton.d.ts +49 -9
  393. package/lib-esm/DropdownMenu/DropdownButton.js +1 -3
  394. package/lib-esm/EmojiPicker/EmojiPicker.d.ts +17 -0
  395. package/lib-esm/EmojiPicker/EmojiPicker.js +181 -0
  396. package/lib-esm/EmojiPicker/EmojiPickerAnchor.d.ts +0 -0
  397. package/lib-esm/EmojiPicker/EmojiPickerAnchor.js +0 -0
  398. package/lib-esm/EmojiPicker/EmojiPickerPanel.d.ts +3 -0
  399. package/lib-esm/EmojiPicker/EmojiPickerPanel.js +8 -0
  400. package/lib-esm/EmojiPicker/data.d.ts +9 -0
  401. package/lib-esm/EmojiPicker/data.js +5434 -0
  402. package/lib-esm/EmojiPicker/index.d.ts +2 -0
  403. package/lib-esm/EmojiPicker/index.js +1 -0
  404. package/lib-esm/FilterList.d.ts +303 -265
  405. package/lib-esm/FilterList.js +7 -3
  406. package/lib-esm/FilteredActionList/FilteredActionList.js +1 -1
  407. package/lib-esm/FilteredSearch.d.ts +2 -1
  408. package/lib-esm/FilteredSearch.js +2 -2
  409. package/lib-esm/Flash.d.ts +2 -1
  410. package/lib-esm/Flash.js +2 -2
  411. package/lib-esm/Flex.js +1 -1
  412. package/lib-esm/FormGroup.d.ts +5 -4
  413. package/lib-esm/FormGroup.js +3 -3
  414. package/lib-esm/Header.d.ts +7 -6
  415. package/lib-esm/Header.js +5 -5
  416. package/lib-esm/Heading.d.ts +2 -1
  417. package/lib-esm/Heading.js +6 -2
  418. package/lib-esm/Label.d.ts +2 -1
  419. package/lib-esm/Label.js +4 -3
  420. package/lib-esm/LabelGroup.d.ts +2 -1
  421. package/lib-esm/LabelGroup.js +3 -3
  422. package/lib-esm/Link.d.ts +2 -1
  423. package/lib-esm/Link.js +2 -2
  424. package/lib-esm/NewButton/button.js +42 -31
  425. package/lib-esm/Overlay.d.ts +11 -14
  426. package/lib-esm/Overlay.js +4 -3
  427. package/lib-esm/Pagehead.d.ts +2 -1
  428. package/lib-esm/Pagehead.js +2 -2
  429. package/lib-esm/Pagination/Pagination.js +4 -4
  430. package/lib-esm/Popover.d.ts +5 -4
  431. package/lib-esm/Popover.js +5 -4
  432. package/lib-esm/Position.d.ts +4 -4
  433. package/lib-esm/Position.js +1 -1
  434. package/lib-esm/ProgressBar.d.ts +11 -16
  435. package/lib-esm/ProgressBar.js +11 -7
  436. package/lib-esm/SelectMenu/SelectMenu.d.ts +195 -34
  437. package/lib-esm/SelectMenu/SelectMenu.js +3 -2
  438. package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +2 -1
  439. package/lib-esm/SelectMenu/SelectMenuDivider.js +2 -2
  440. package/lib-esm/SelectMenu/SelectMenuFilter.js +3 -3
  441. package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +2 -1
  442. package/lib-esm/SelectMenu/SelectMenuFooter.js +3 -3
  443. package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +2 -1
  444. package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
  445. package/lib-esm/SelectMenu/SelectMenuItem.d.ts +3 -2
  446. package/lib-esm/SelectMenu/SelectMenuItem.js +3 -3
  447. package/lib-esm/SelectMenu/SelectMenuList.d.ts +2 -1
  448. package/lib-esm/SelectMenu/SelectMenuList.js +2 -2
  449. package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
  450. package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +2 -3
  451. package/lib-esm/SelectMenu/SelectMenuModal.d.ts +3 -2
  452. package/lib-esm/SelectMenu/SelectMenuModal.js +2 -2
  453. package/lib-esm/SelectMenu/SelectMenuTab.d.ts +2 -1
  454. package/lib-esm/SelectMenu/SelectMenuTab.js +3 -3
  455. package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +2 -1
  456. package/lib-esm/SelectMenu/SelectMenuTabPanel.js +3 -3
  457. package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +2 -1
  458. package/lib-esm/SelectMenu/SelectMenuTabs.js +3 -3
  459. package/lib-esm/SideNav.d.ts +8 -11
  460. package/lib-esm/SideNav.js +16 -8
  461. package/lib-esm/Spinner.d.ts +2 -1
  462. package/lib-esm/Spinner.js +2 -1
  463. package/lib-esm/StateLabel.d.ts +2 -1
  464. package/lib-esm/StateLabel.js +7 -8
  465. package/lib-esm/StyledOcticon.d.ts +2 -1
  466. package/lib-esm/StyledOcticon.js +3 -2
  467. package/lib-esm/SubNav.d.ts +11 -5
  468. package/lib-esm/SubNav.js +14 -9
  469. package/lib-esm/TabNav.d.ts +4 -3
  470. package/lib-esm/TabNav.js +3 -3
  471. package/lib-esm/TextInputWithTokens.d.ts +4 -6
  472. package/lib-esm/ThemeProvider.d.ts +0 -1
  473. package/lib-esm/ThemeProvider.js +4 -17
  474. package/lib-esm/Timeline.d.ts +393 -19
  475. package/lib-esm/Timeline.js +17 -16
  476. package/lib-esm/Token/AvatarToken.d.ts +1 -1
  477. package/lib-esm/Token/AvatarToken.js +1 -1
  478. package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
  479. package/lib-esm/Token/Token.d.ts +1 -1
  480. package/lib-esm/Token/TokenBase.js +1 -1
  481. package/lib-esm/Tooltip.d.ts +2 -1
  482. package/lib-esm/Tooltip.js +3 -3
  483. package/lib-esm/Truncate.d.ts +2 -1
  484. package/lib-esm/Truncate.js +2 -1
  485. package/lib-esm/UnderlineNav.d.ts +3 -2
  486. package/lib-esm/UnderlineNav.js +5 -5
  487. package/lib-esm/drafts.d.ts +0 -1
  488. package/lib-esm/drafts.js +1 -2
  489. package/lib-esm/index.d.ts +2 -2
  490. package/lib-esm/index.js +1 -1
  491. package/lib-esm/theme-preval.js +366 -512
  492. package/lib-esm/utils/testing.d.ts +61 -8
  493. package/lib-esm/utils/testing.js +0 -24
  494. package/package.json +13 -20
  495. package/lib/ActionList2/MenuContext.d.ts +0 -10
  496. package/lib/ActionList2/MenuContext.js +0 -15
  497. package/lib/ActionMenu2.d.ts +0 -313
  498. package/lib/ActionMenu2.js +0 -91
  499. package/lib/Checkbox.d.ts +0 -29
  500. package/lib/Checkbox.js +0 -64
  501. package/lib-esm/ActionList2/MenuContext.d.ts +0 -10
  502. package/lib-esm/ActionList2/MenuContext.js +0 -3
  503. package/lib-esm/ActionMenu2.d.ts +0 -313
  504. package/lib-esm/ActionMenu2.js +0 -67
  505. package/lib-esm/Checkbox.d.ts +0 -29
  506. package/lib-esm/Checkbox.js +0 -44
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const styled_components_1 = __importStar(require("styled-components"));
26
+ const constants_1 = require("../constants");
27
+ const sx_1 = __importDefault(require("../sx"));
28
+ const listStyles = styled_components_1.css `
29
+ position: relative;
30
+ padding: 0;
31
+ margin: 0;
32
+ flex: auto;
33
+ overflow-x: hidden;
34
+ overflow-y: auto;
35
+ background-color: ${constants_1.get('colors.canvas.overlay')};
36
+ -webkit-overflow-scrolling: touch; // Adds momentum + bouncy scrolling
37
+
38
+ @media (hover: hover) {
39
+ .SelectMenuTab:focus {
40
+ background-color: ${constants_1.get('colors.selectMenu.tapFocusBg')};
41
+ }
42
+
43
+ .SelectMenuTab:not([aria-checked='true']):hover {
44
+ color: ${constants_1.get('colors.fg.default')};
45
+ background-color: ${constants_1.get('colors.canvas.subtle')};
46
+ }
47
+
48
+ .SelectMenuTab:not([aria-checked='true']):active {
49
+ color: ${constants_1.get('colors.fg.default')};
50
+ background-color: ${constants_1.get('colors.canvas.subtle')};
51
+ }
52
+ }
53
+ `;
54
+ const SelectMenuList = styled_components_1.default.div `
55
+ ${listStyles}
56
+ ${constants_1.COMMON}
57
+ ${sx_1.default};
58
+ `;
59
+ SelectMenuList.displayName = 'SelectMenu.List';
60
+ exports.default = SelectMenuList;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { SxProp } from '../sx';
2
+ import { SystemCommonProps } from '../constants';
3
3
  import { ComponentProps } from '../utils/types';
4
- declare const Animation: import("styled-components").StyledComponent<"div", any, SxProp, never>;
4
+ declare const Animation: import("styled-components").StyledComponent<"div", any, SystemCommonProps, never>;
5
5
  export declare type SelectMenuLoadingAnimationProps = ComponentProps<typeof Animation>;
6
6
  declare const SelectMenuLoadingAnimation: (props: SelectMenuLoadingAnimationProps) => JSX.Element;
7
7
  export default SelectMenuLoadingAnimation;
@@ -13,14 +13,12 @@ var _constants = require("../constants");
13
13
 
14
14
  var _Spinner = _interopRequireDefault(require("../Spinner"));
15
15
 
16
- var _sx = _interopRequireDefault(require("../sx"));
17
-
18
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
17
 
20
18
  const Animation = _styledComponents.default.div.withConfig({
21
19
  displayName: "SelectMenuLoadingAnimation__Animation",
22
20
  componentId: "sc-17k54td-0"
23
- })(["padding:", " ", ";text-align:center;background-color:", ";", ""], (0, _constants.get)('space.6'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.canvas.overlay'), _sx.default);
21
+ })(["padding:", " ", ";text-align:center;background-color:", ";", ""], (0, _constants.get)('space.6'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.canvas.overlay'), _constants.COMMON);
24
22
 
25
23
  const SelectMenuLoadingAnimation = props => {
26
24
  return /*#__PURE__*/_react.default.createElement(Animation, props, /*#__PURE__*/_react.default.createElement(_Spinner.default, null));
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const styled_components_1 = __importDefault(require("styled-components"));
8
+ const constants_1 = require("../constants");
9
+ const Spinner_1 = __importDefault(require("../Spinner"));
10
+ const Animation = styled_components_1.default.div `
11
+ padding: ${constants_1.get('space.6')} ${constants_1.get('space.4')};
12
+ text-align: center;
13
+ background-color: ${constants_1.get('colors.canvas.overlay')};
14
+ ${constants_1.COMMON}
15
+ `;
16
+ const SelectMenuLoadingAnimation = (props) => {
17
+ return (<Animation {...props}>
18
+ <Spinner_1.default />
19
+ </Animation>);
20
+ };
21
+ exports.default = SelectMenuLoadingAnimation;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { WidthProps } from 'styled-system';
3
+ import { SystemCommonProps } from '../constants';
3
4
  import { SxProp } from '../sx';
4
5
  import { ComponentProps } from '../utils/types';
5
6
  declare type StyledModalProps = {
@@ -7,8 +8,8 @@ declare type StyledModalProps = {
7
8
  } & WidthProps;
8
9
  declare const ModalWrapper: import("styled-components").StyledComponent<"div", any, {
9
10
  align?: "left" | "right" | undefined;
10
- } & SxProp, never>;
11
+ } & SystemCommonProps & SxProp, never>;
11
12
  declare type SelectMenuModalInternalProps = Pick<StyledModalProps, 'width'> & ComponentProps<typeof ModalWrapper>;
12
- declare const SelectMenuModal: React.ForwardRefExoticComponent<Pick<SelectMenuModalInternalProps, "width" | "theme" | "sx" | "key" | keyof React.HTMLAttributes<HTMLDivElement> | "align"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const SelectMenuModal: React.ForwardRefExoticComponent<Pick<SelectMenuModalInternalProps, "backgroundColor" | "color" | "display" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "width" | "margin" | "padding" | "hidden" | "children" | "theme" | "p" | "slot" | "style" | "title" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "sx" | "role" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align"> & React.RefAttributes<HTMLDivElement>>;
13
14
  export declare type SelectMenuModalProps = ComponentProps<typeof SelectMenuModal>;
14
15
  export default SelectMenuModal;
@@ -35,7 +35,7 @@ const Modal = _styledComponents.default.div.withConfig({
35
35
  const ModalWrapper = _styledComponents.default.div.withConfig({
36
36
  displayName: "SelectMenuModal__ModalWrapper",
37
37
  componentId: "sc-1m5qo55-1"
38
- })(["", " ", ";"], modalWrapperStyles, _sx.default);
38
+ })(["", " ", " ", ";"], modalWrapperStyles, _constants.COMMON, _sx.default);
39
39
 
40
40
  const SelectMenuModal = /*#__PURE__*/_react.default.forwardRef(({
41
41
  children,
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const react_1 = __importDefault(require("react"));
26
+ const styled_components_1 = __importStar(require("styled-components"));
27
+ const styled_system_1 = require("styled-system");
28
+ const constants_1 = require("../constants");
29
+ const sx_1 = __importDefault(require("../sx"));
30
+ const animateModal = styled_components_1.keyframes `
31
+ 0% {
32
+ opacity: 0;
33
+ transform: scale(0.9);
34
+ }
35
+ `;
36
+ const modalStyles = styled_components_1.css `
37
+ position: relative;
38
+ z-index: 99; // Needs to be higher than .details-overlay's z-index: 80.
39
+ display: flex;
40
+ ${props => (props.filter ? 'height: 80%' : '')};
41
+ max-height: ${props => (props.filter ? 'none' : '66%')};
42
+ margin: auto 0;
43
+ ${props => (props.filter ? 'margin-top: 0' : '')};
44
+ overflow: hidden; // Enables border radius on scrollable child elements
45
+ pointer-events: auto;
46
+ flex-direction: column;
47
+ background-color: ${constants_1.get('colors.canvas.overlay')};
48
+ border-radius: ${constants_1.get('radii.2')};
49
+ box-shadow: ${constants_1.get('shadows.shadow.small')};
50
+ animation: ${animateModal} 0.12s cubic-bezier(0, 0.1, 0.1, 1) backwards;
51
+
52
+ @media (min-width: ${constants_1.get('breakpoints.0')}) {
53
+ height: auto;
54
+ max-height: 350px;
55
+ margin: ${constants_1.get('space.1')} 0 ${constants_1.get('space.3')} 0;
56
+ font-size: ${constants_1.get('fontSizes.0')};
57
+ border: ${constants_1.get('borderWidths.1')} solid ${constants_1.get('colors.border.default')};
58
+ border-radius: ${constants_1.get('radii.2')};
59
+ box-shadow: ${constants_1.get('shadows.shadow.small')};
60
+ }
61
+ `;
62
+ const modalWrapperStyles = styled_components_1.css `
63
+ position: fixed;
64
+ top: 0;
65
+ right: 0;
66
+ bottom: 0;
67
+ left: 0;
68
+ z-index: 99;
69
+ display: flex;
70
+ padding: ${constants_1.get('space.3')};
71
+ pointer-events: none;
72
+ flex-direction: column;
73
+
74
+ &::before {
75
+ position: absolute;
76
+ top: 0;
77
+ right: 0;
78
+ bottom: 0;
79
+ left: 0;
80
+ pointer-events: none;
81
+ content: '';
82
+ background-color: ${constants_1.get('colors.primer.canvas.backdrop')};
83
+
84
+ @media (min-width: ${constants_1.get('breakpoints.0')}) {
85
+ display: none;
86
+ }
87
+ }
88
+
89
+ @media (min-width: ${constants_1.get('breakpoints.0')}) {
90
+ position: absolute;
91
+ top: auto;
92
+ right: ${props => (props.align === 'right' ? '0' : 'auto')};
93
+ bottom: auto;
94
+ left: auto;
95
+ padding: 0;
96
+ }
97
+ `;
98
+ const Modal = styled_components_1.default.div `
99
+ ${modalStyles}
100
+ ${styled_system_1.width}
101
+ `;
102
+ const ModalWrapper = styled_components_1.default.div `
103
+ ${modalWrapperStyles}
104
+ ${constants_1.COMMON}
105
+ ${sx_1.default};
106
+ `;
107
+ const SelectMenuModal = react_1.default.forwardRef(({ children, theme, width: widthProp, ...rest }, forwardedRef) => {
108
+ return (<ModalWrapper theme={theme} {...rest} role="menu" ref={forwardedRef}>
109
+ <Modal theme={theme} width={widthProp}>
110
+ {children}
111
+ </Modal>
112
+ </ModalWrapper>);
113
+ });
114
+ SelectMenuModal.defaultProps = {
115
+ align: 'left',
116
+ width: '300px'
117
+ };
118
+ SelectMenuModal.displayName = 'SelectMenu.Modal';
119
+ exports.default = SelectMenuModal;
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
+ import { SystemCommonProps } from '../constants';
2
3
  import { SxProp } from '../sx';
3
4
  import { ComponentProps } from '../utils/types';
4
- declare const StyledTab: import("styled-components").StyledComponent<"button", any, SxProp, never>;
5
+ declare const StyledTab: import("styled-components").StyledComponent<"button", any, SystemCommonProps & SxProp, never>;
5
6
  export declare type SelectMenuTabProps = {
6
7
  tabName?: string;
7
8
  index?: number;
@@ -29,8 +29,8 @@ const tabStyles = (0, _styledComponents.css)(["flex:1;padding:", " ", ";font-siz
29
29
 
30
30
  const StyledTab = _styledComponents.default.button.withConfig({
31
31
  displayName: "SelectMenuTab__StyledTab",
32
- componentId: "sc-ga32sz-0"
33
- })(["", " ", ";"], tabStyles, _sx.default);
32
+ componentId: "ga32sz-0"
33
+ })(["", " ", " ", ";"], tabStyles, _constants.COMMON, _sx.default);
34
34
 
35
35
  const SelectMenuTab = ({
36
36
  tabName = '',
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const classnames_1 = __importDefault(require("classnames"));
26
+ const react_1 = __importStar(require("react"));
27
+ const styled_components_1 = __importStar(require("styled-components"));
28
+ const constants_1 = require("../constants");
29
+ const sx_1 = __importDefault(require("../sx"));
30
+ const SelectMenuContext_1 = require("./SelectMenuContext");
31
+ const tabStyles = styled_components_1.css `
32
+ flex: 1;
33
+ padding: ${constants_1.get('space.2')} ${constants_1.get('space.3')};
34
+ font-size: ${constants_1.get('fontSizes.0')};
35
+ font-weight: 500;
36
+ color: ${constants_1.get('colors.fg.muted')};
37
+ text-align: center;
38
+ background-color: transparent;
39
+ border: 0;
40
+ box-shadow: inset 0 -1px 0 ${constants_1.get('colors.border.muted')};
41
+
42
+ @media (min-width: ${constants_1.get('breakpoints.0')}) {
43
+ flex: none;
44
+ padding: ${constants_1.get('space.1')} ${constants_1.get('space.3')};
45
+ border: ${constants_1.get('borderWidths.1')} solid transparent;
46
+ border-bottom-width: 0;
47
+ border-top-left-radius: ${constants_1.get('radii.2')};
48
+ border-top-right-radius: ${constants_1.get('radii.2')};
49
+ }
50
+
51
+ &[aria-selected='true'] {
52
+ z-index: 1; // Keeps box-shadow visible when hovering
53
+ color: ${constants_1.get('colors.text-primary')};
54
+ background-color: ${constants_1.get('colors.canvas.overlay')};
55
+ box-shadow: 0 0 0 1px ${constants_1.get('colors.border.muted')};
56
+
57
+ @media (min-width: ${constants_1.get('breakpoints.0')}) {
58
+ border-color: ${constants_1.get('colors.border.muted')};
59
+ box-shadow: none;
60
+ }
61
+ }
62
+
63
+ &:focus {
64
+ background-color: ${constants_1.get('colors.neutral.subtle')};
65
+ }
66
+ `;
67
+ const StyledTab = styled_components_1.default.button `
68
+ ${tabStyles}
69
+ ${constants_1.COMMON}
70
+ ${sx_1.default};
71
+ `;
72
+ const SelectMenuTab = ({ tabName = '', index, className, onClick, ...rest }) => {
73
+ const menuContext = react_1.useContext(SelectMenuContext_1.MenuContext);
74
+ const handleClick = (e) => {
75
+ // if consumer has attached an onClick event, call it
76
+ onClick && onClick(e);
77
+ if (!e.defaultPrevented) {
78
+ menuContext.setSelectedTab?.(tabName);
79
+ }
80
+ };
81
+ // if no tab is selected when the component renders, show the first tab
82
+ react_1.useEffect(() => {
83
+ if (!menuContext.selectedTab && index === 0) {
84
+ menuContext.setSelectedTab?.(tabName);
85
+ }
86
+ }, [index, menuContext, tabName]);
87
+ const isSelected = menuContext.selectedTab === tabName;
88
+ return (<StyledTab role="tab" className={classnames_1.default('SelectMenuTab', className)} aria-selected={isSelected} onClick={handleClick} {...rest}>
89
+ {tabName}
90
+ </StyledTab>);
91
+ };
92
+ SelectMenuTab.displayName = 'SelectMenu.Tab';
93
+ exports.default = SelectMenuTab;
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
+ import { SystemCommonProps } from '../constants';
2
3
  import { SxProp } from '../sx';
3
4
  import { ComponentProps } from '../utils/types';
4
- declare const TabPanelBase: import("styled-components").StyledComponent<"div", any, SxProp, never>;
5
+ declare const TabPanelBase: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
5
6
  export declare type SelectMenuTabPanelProps = {
6
7
  tabName?: string;
7
8
  } & ComponentProps<typeof TabPanelBase>;
@@ -27,8 +27,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
27
27
 
28
28
  const TabPanelBase = _styledComponents.default.div.withConfig({
29
29
  displayName: "SelectMenuTabPanel__TabPanelBase",
30
- componentId: "sc-ck0ipe-0"
31
- })(["border-top:", " solid ", ";", ";"], (0, _constants.get)('borderWidths.1'), (0, _constants.get)('colors.border.muted'), _sx.default);
30
+ componentId: "ck0ipe-0"
31
+ })(["border-top:", " solid ", ";", " ", ";"], (0, _constants.get)('borderWidths.1'), (0, _constants.get)('colors.border.muted'), _constants.COMMON, _sx.default);
32
32
 
33
33
  const TabPanel = ({
34
34
  tabName,
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const react_1 = __importStar(require("react"));
26
+ const styled_components_1 = __importDefault(require("styled-components"));
27
+ const constants_1 = require("../constants");
28
+ const sx_1 = __importDefault(require("../sx"));
29
+ const SelectMenuContext_1 = require("./SelectMenuContext");
30
+ const SelectMenuList_1 = __importDefault(require("./SelectMenuList"));
31
+ const TabPanelBase = styled_components_1.default.div `
32
+ border-top: ${constants_1.get('borderWidths.1')} solid ${constants_1.get('colors.border.muted')};
33
+ ${constants_1.COMMON}
34
+ ${sx_1.default};
35
+ `;
36
+ const TabPanel = ({ tabName, className, children, ...rest }) => {
37
+ const menuContext = react_1.useContext(SelectMenuContext_1.MenuContext);
38
+ return (<TabPanelBase role="tabpanel" className={className} hidden={menuContext.selectedTab !== tabName} {...rest}>
39
+ <SelectMenuList_1.default>{children}</SelectMenuList_1.default>
40
+ </TabPanelBase>);
41
+ };
42
+ TabPanel.displayName = 'SelectMenu.TabPanel';
43
+ exports.default = TabPanel;
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
+ import { SystemCommonProps } from '../constants';
2
3
  import { SxProp } from '../sx';
3
4
  import { ComponentProps } from '../utils/types';
4
- declare const SelectMenuTabsBase: import("styled-components").StyledComponent<"div", any, SxProp, never>;
5
+ declare const SelectMenuTabsBase: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
5
6
  export declare type SelectMenuTabsProps = ComponentProps<typeof SelectMenuTabsBase>;
6
7
  declare const SelectMenuTabs: {
7
8
  ({ children, ...rest }: SelectMenuTabsProps): JSX.Element;
@@ -25,8 +25,8 @@ const tabWrapperStyles = (0, _styledComponents.css)(["display:flex;flex-shrink:0
25
25
 
26
26
  const SelectMenuTabsBase = _styledComponents.default.div.withConfig({
27
27
  displayName: "SelectMenuTabs__SelectMenuTabsBase",
28
- componentId: "sc-kgg21o-0"
29
- })(["", " ", ";"], tabWrapperStyles, _sx.default);
28
+ componentId: "kgg21o-0"
29
+ })(["", " ", " ", ";"], tabWrapperStyles, _constants.COMMON, _sx.default);
30
30
 
31
31
  const SelectMenuTabs = ({
32
32
  children,
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const react_1 = __importDefault(require("react"));
26
+ const styled_components_1 = __importStar(require("styled-components"));
27
+ const constants_1 = require("../constants");
28
+ const sx_1 = __importDefault(require("../sx"));
29
+ const tabWrapperStyles = styled_components_1.css `
30
+ display: flex;
31
+ flex-shrink: 0;
32
+ margin-bottom: -1px; // hide border of element below
33
+ -webkit-overflow-scrolling: touch;
34
+ overflow-x: auto;
35
+ overflow-y: hidden;
36
+
37
+ // Hide scrollbar so it doesn't cover the text
38
+ &::-webkit-scrollbar {
39
+ display: none;
40
+ }
41
+
42
+ @media (min-width: ${constants_1.get('breakpoints.0')}) {
43
+ padding: 0 ${constants_1.get('space.2')};
44
+ margin-top: ${constants_1.get('space.3')};
45
+ }
46
+ `;
47
+ const SelectMenuTabsBase = styled_components_1.default.div `
48
+ ${tabWrapperStyles}
49
+ ${constants_1.COMMON}
50
+ ${sx_1.default};
51
+ `;
52
+ const SelectMenuTabs = ({ children, ...rest }) => {
53
+ return (<SelectMenuTabsBase role="tablist" {...rest}>
54
+ {children}
55
+ </SelectMenuTabsBase>);
56
+ };
57
+ SelectMenuTabs.displayName = 'SelectMenu.Tabs';
58
+ exports.default = SelectMenuTabs;