@graphprotocol/gds-react 0.1.2 → 0.2.0

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 (373) hide show
  1. package/dist/GDSProvider.d.ts +12 -10
  2. package/dist/GDSProvider.d.ts.map +1 -1
  3. package/dist/GDSProvider.js +10 -8
  4. package/dist/GDSProvider.js.map +1 -1
  5. package/dist/components/Address.js +2 -2
  6. package/dist/components/Address.meta.d.ts +1 -13
  7. package/dist/components/Address.meta.d.ts.map +1 -1
  8. package/dist/components/Avatar.d.ts.map +1 -1
  9. package/dist/components/Avatar.js +2 -10
  10. package/dist/components/Avatar.js.map +1 -1
  11. package/dist/components/Avatar.meta.d.ts +0 -2
  12. package/dist/components/Avatar.meta.d.ts.map +1 -1
  13. package/dist/components/AvatarGroup.meta.d.ts +8 -2
  14. package/dist/components/AvatarGroup.meta.d.ts.map +1 -1
  15. package/dist/components/Breadcrumbs.meta.d.ts +2 -3
  16. package/dist/components/Breadcrumbs.meta.d.ts.map +1 -1
  17. package/dist/components/Breadcrumbs.meta.js +3 -1
  18. package/dist/components/Breadcrumbs.meta.js.map +1 -1
  19. package/dist/components/Breadcrumbs.parts.d.ts.map +1 -1
  20. package/dist/components/Breadcrumbs.parts.js +13 -21
  21. package/dist/components/Breadcrumbs.parts.js.map +1 -1
  22. package/dist/components/Button.d.ts.map +1 -1
  23. package/dist/components/Button.js +10 -9
  24. package/dist/components/Button.js.map +1 -1
  25. package/dist/components/Button.meta.d.ts +1 -4
  26. package/dist/components/Button.meta.d.ts.map +1 -1
  27. package/dist/components/ButtonGroup.d.ts.map +1 -1
  28. package/dist/components/ButtonGroup.js +1 -5
  29. package/dist/components/ButtonGroup.js.map +1 -1
  30. package/dist/components/ButtonGroup.meta.d.ts +1 -5
  31. package/dist/components/ButtonGroup.meta.d.ts.map +1 -1
  32. package/dist/components/ButtonGroup.meta.js +8 -0
  33. package/dist/components/ButtonGroup.meta.js.map +1 -1
  34. package/dist/components/Card.meta.d.ts +1 -2
  35. package/dist/components/Card.meta.d.ts.map +1 -1
  36. package/dist/components/Card.meta.js +1 -0
  37. package/dist/components/Card.meta.js.map +1 -1
  38. package/dist/components/Checkbox.meta.d.ts +1 -6
  39. package/dist/components/Checkbox.meta.d.ts.map +1 -1
  40. package/dist/components/Checkbox.meta.js +1 -5
  41. package/dist/components/Checkbox.meta.js.map +1 -1
  42. package/dist/components/Chip.meta.d.ts +2 -4
  43. package/dist/components/Chip.meta.d.ts.map +1 -1
  44. package/dist/components/Chip.parts.d.ts.map +1 -1
  45. package/dist/components/Chip.parts.js +1 -9
  46. package/dist/components/Chip.parts.js.map +1 -1
  47. package/dist/components/Cluster.meta.d.ts +8 -2
  48. package/dist/components/Cluster.meta.d.ts.map +1 -1
  49. package/dist/components/CodeBlock.d.ts +1 -1
  50. package/dist/components/CodeBlock.meta.d.ts +2 -4
  51. package/dist/components/CodeBlock.meta.d.ts.map +1 -1
  52. package/dist/components/CodeBlock.parts.d.ts +6 -7
  53. package/dist/components/CodeBlock.parts.d.ts.map +1 -1
  54. package/dist/components/CodeBlock.parts.js +28 -10
  55. package/dist/components/CodeBlock.parts.js.map +1 -1
  56. package/dist/components/CodeInline.js +3 -3
  57. package/dist/components/CodeInline.meta.d.ts +1 -1
  58. package/dist/components/CodeInline.meta.d.ts.map +1 -1
  59. package/dist/components/CopyButton.d.ts.map +1 -1
  60. package/dist/components/CopyButton.js +2 -4
  61. package/dist/components/CopyButton.js.map +1 -1
  62. package/dist/components/CopyButton.meta.d.ts +1 -12
  63. package/dist/components/CopyButton.meta.d.ts.map +1 -1
  64. package/dist/components/CopyButton.meta.js +1 -6
  65. package/dist/components/CopyButton.meta.js.map +1 -1
  66. package/dist/components/CurrencyInput.meta.d.ts +1 -6
  67. package/dist/components/CurrencyInput.meta.d.ts.map +1 -1
  68. package/dist/components/CurrencyInput.meta.js +1 -5
  69. package/dist/components/CurrencyInput.meta.js.map +1 -1
  70. package/dist/components/DescriptionList.meta.d.ts +2 -5
  71. package/dist/components/DescriptionList.meta.d.ts.map +1 -1
  72. package/dist/components/DescriptionList.parts.d.ts +3 -0
  73. package/dist/components/DescriptionList.parts.d.ts.map +1 -1
  74. package/dist/components/DescriptionList.parts.js +1 -0
  75. package/dist/components/DescriptionList.parts.js.map +1 -1
  76. package/dist/components/Divider.meta.d.ts +1 -3
  77. package/dist/components/Divider.meta.d.ts.map +1 -1
  78. package/dist/components/Icon.js +4 -4
  79. package/dist/components/Icon.js.map +1 -1
  80. package/dist/components/Icon.meta.d.ts +0 -2
  81. package/dist/components/Icon.meta.d.ts.map +1 -1
  82. package/dist/components/Icon.meta.js +1 -0
  83. package/dist/components/Icon.meta.js.map +1 -1
  84. package/dist/components/Input.d.ts +5 -4
  85. package/dist/components/Input.d.ts.map +1 -1
  86. package/dist/components/Input.js +1 -0
  87. package/dist/components/Input.js.map +1 -1
  88. package/dist/components/Input.meta.d.ts +1 -6
  89. package/dist/components/Input.meta.d.ts.map +1 -1
  90. package/dist/components/Input.meta.js +1 -5
  91. package/dist/components/Input.meta.js.map +1 -1
  92. package/dist/components/Keyboard.js +1 -1
  93. package/dist/components/Keyboard.meta.d.ts +0 -1
  94. package/dist/components/Keyboard.meta.d.ts.map +1 -1
  95. package/dist/components/Label.meta.d.ts +1 -3
  96. package/dist/components/Label.meta.d.ts.map +1 -1
  97. package/dist/components/Link.d.ts +1 -1
  98. package/dist/components/Link.d.ts.map +1 -1
  99. package/dist/components/Link.js +1 -2
  100. package/dist/components/Link.js.map +1 -1
  101. package/dist/components/Link.meta.d.ts +1 -2
  102. package/dist/components/Link.meta.d.ts.map +1 -1
  103. package/dist/components/Link.meta.js +1 -0
  104. package/dist/components/Link.meta.js.map +1 -1
  105. package/dist/components/Menu.meta.d.ts +31 -2
  106. package/dist/components/Menu.meta.d.ts.map +1 -1
  107. package/dist/components/Menu.meta.js +39 -1
  108. package/dist/components/Menu.meta.js.map +1 -1
  109. package/dist/components/Menu.parts.d.ts +23 -32
  110. package/dist/components/Menu.parts.d.ts.map +1 -1
  111. package/dist/components/Menu.parts.js +284 -303
  112. package/dist/components/Menu.parts.js.map +1 -1
  113. package/dist/components/Modal.d.ts +1 -1
  114. package/dist/components/Modal.meta.d.ts +1 -3
  115. package/dist/components/Modal.meta.d.ts.map +1 -1
  116. package/dist/components/Modal.meta.js +1 -1
  117. package/dist/components/Modal.meta.js.map +1 -1
  118. package/dist/components/Modal.parts.d.ts +14 -15
  119. package/dist/components/Modal.parts.d.ts.map +1 -1
  120. package/dist/components/Modal.parts.js +36 -32
  121. package/dist/components/Modal.parts.js.map +1 -1
  122. package/dist/components/OTCInput.js +1 -1
  123. package/dist/components/OTCInput.meta.d.ts +1 -6
  124. package/dist/components/OTCInput.meta.d.ts.map +1 -1
  125. package/dist/components/OTCInput.meta.js +1 -5
  126. package/dist/components/OTCInput.meta.js.map +1 -1
  127. package/dist/components/Radio.meta.d.ts +1 -6
  128. package/dist/components/Radio.meta.d.ts.map +1 -1
  129. package/dist/components/Radio.meta.js +1 -5
  130. package/dist/components/Radio.meta.js.map +1 -1
  131. package/dist/components/Search.meta.d.ts +1 -3
  132. package/dist/components/Search.meta.d.ts.map +1 -1
  133. package/dist/components/SegmentedControl.meta.d.ts +2 -3
  134. package/dist/components/SegmentedControl.meta.d.ts.map +1 -1
  135. package/dist/components/SegmentedControl.meta.js +3 -1
  136. package/dist/components/SegmentedControl.meta.js.map +1 -1
  137. package/dist/components/SegmentedControl.parts.d.ts.map +1 -1
  138. package/dist/components/SegmentedControl.parts.js +4 -9
  139. package/dist/components/SegmentedControl.parts.js.map +1 -1
  140. package/dist/components/Status.meta.d.ts +0 -2
  141. package/dist/components/Status.meta.d.ts.map +1 -1
  142. package/dist/components/Stepper.meta.d.ts +1 -2
  143. package/dist/components/Stepper.meta.d.ts.map +1 -1
  144. package/dist/components/Stepper.meta.js +1 -0
  145. package/dist/components/Stepper.meta.js.map +1 -1
  146. package/dist/components/Stepper.parts.d.ts.map +1 -1
  147. package/dist/components/Stepper.parts.js +1 -1
  148. package/dist/components/Stepper.parts.js.map +1 -1
  149. package/dist/components/Switch.meta.d.ts +1 -6
  150. package/dist/components/Switch.meta.d.ts.map +1 -1
  151. package/dist/components/Switch.meta.js +1 -5
  152. package/dist/components/Switch.meta.js.map +1 -1
  153. package/dist/components/TabSet.meta.d.ts +2 -5
  154. package/dist/components/TabSet.meta.d.ts.map +1 -1
  155. package/dist/components/TabSet.meta.js +3 -1
  156. package/dist/components/TabSet.meta.js.map +1 -1
  157. package/dist/components/Tag.meta.d.ts +0 -2
  158. package/dist/components/Tag.meta.d.ts.map +1 -1
  159. package/dist/components/TextArea.meta.d.ts +1 -6
  160. package/dist/components/TextArea.meta.d.ts.map +1 -1
  161. package/dist/components/TextArea.meta.js +1 -5
  162. package/dist/components/TextArea.meta.js.map +1 -1
  163. package/dist/components/ToggleButton.js +2 -2
  164. package/dist/components/ToggleButton.js.map +1 -1
  165. package/dist/components/ToggleButton.meta.d.ts +1 -12
  166. package/dist/components/ToggleButton.meta.d.ts.map +1 -1
  167. package/dist/components/ToggleButton.meta.js +1 -6
  168. package/dist/components/ToggleButton.meta.js.map +1 -1
  169. package/dist/components/Tooltip.d.ts +2 -2
  170. package/dist/components/Tooltip.d.ts.map +1 -1
  171. package/dist/components/Tooltip.js +2 -2
  172. package/dist/components/Tooltip.js.map +1 -1
  173. package/dist/components/Tooltip.meta.d.ts +12 -7
  174. package/dist/components/Tooltip.meta.d.ts.map +1 -1
  175. package/dist/components/Tooltip.meta.js +13 -2
  176. package/dist/components/Tooltip.meta.js.map +1 -1
  177. package/dist/components/Tooltip.parts.d.ts +20 -20
  178. package/dist/components/Tooltip.parts.d.ts.map +1 -1
  179. package/dist/components/Tooltip.parts.js +129 -88
  180. package/dist/components/Tooltip.parts.js.map +1 -1
  181. package/dist/components/base/Addon.meta.d.ts +1 -1
  182. package/dist/components/base/Addon.meta.d.ts.map +1 -1
  183. package/dist/components/base/Addon.meta.js +3 -1
  184. package/dist/components/base/Addon.meta.js.map +1 -1
  185. package/dist/components/base/ButtonOrLink.d.ts +1 -1
  186. package/dist/components/base/ButtonOrLink.parts.d.ts +6 -5
  187. package/dist/components/base/ButtonOrLink.parts.d.ts.map +1 -1
  188. package/dist/components/base/ButtonOrLink.parts.js +28 -31
  189. package/dist/components/base/ButtonOrLink.parts.js.map +1 -1
  190. package/dist/components/base/Checkable.meta.d.ts +1 -2
  191. package/dist/components/base/Checkable.meta.d.ts.map +1 -1
  192. package/dist/components/base/Checkable.parts.d.ts +6 -6
  193. package/dist/components/base/Checkable.parts.d.ts.map +1 -1
  194. package/dist/components/base/Checkable.parts.js +2 -2
  195. package/dist/components/base/Checkable.parts.js.map +1 -1
  196. package/dist/components/base/Field.meta.d.ts +1 -2
  197. package/dist/components/base/Field.meta.d.ts.map +1 -1
  198. package/dist/components/base/Field.parts.d.ts +5 -4
  199. package/dist/components/base/Field.parts.d.ts.map +1 -1
  200. package/dist/components/base/Field.parts.js +1 -1
  201. package/dist/components/base/Field.parts.js.map +1 -1
  202. package/dist/components/base/MaybeButtonOrLink.d.ts +1 -1
  203. package/dist/components/base/MaybeButtonOrLink.d.ts.map +1 -1
  204. package/dist/components/base/Portal.d.ts +1 -1
  205. package/dist/components/base/Portal.d.ts.map +1 -1
  206. package/dist/components/base/Portal.js +3 -6
  207. package/dist/components/base/Portal.js.map +1 -1
  208. package/dist/components/base/Render.d.ts +21 -6
  209. package/dist/components/base/Render.d.ts.map +1 -1
  210. package/dist/components/base/Render.js +3 -2
  211. package/dist/components/base/Render.js.map +1 -1
  212. package/dist/components/base/Transition.js +2 -2
  213. package/dist/components/base/Transition.meta.d.ts +1 -1
  214. package/dist/components/base/Transition.meta.d.ts.map +1 -1
  215. package/dist/components/base/Transition.meta.js +1 -0
  216. package/dist/components/base/Transition.meta.js.map +1 -1
  217. package/dist/components/base/index.d.ts +1 -2
  218. package/dist/components/base/index.d.ts.map +1 -1
  219. package/dist/components/base/index.js +1 -2
  220. package/dist/components/base/index.js.map +1 -1
  221. package/dist/components/index.d.ts +1 -1
  222. package/dist/components/index.d.ts.map +1 -1
  223. package/dist/components/index.js +1 -1
  224. package/dist/components/index.js.map +1 -1
  225. package/dist/hooks/index.d.ts +1 -0
  226. package/dist/hooks/index.d.ts.map +1 -1
  227. package/dist/hooks/index.js +1 -0
  228. package/dist/hooks/index.js.map +1 -1
  229. package/dist/hooks/useCSSProp.d.ts.map +1 -1
  230. package/dist/hooks/useCSSProp.js +6 -6
  231. package/dist/hooks/useCSSProp.js.map +1 -1
  232. package/dist/hooks/useCSSProps.d.ts +11 -13
  233. package/dist/hooks/useCSSProps.d.ts.map +1 -1
  234. package/dist/hooks/useCSSProps.js +11 -19
  235. package/dist/hooks/useCSSProps.js.map +1 -1
  236. package/dist/hooks/useCSSPropsPolyfill.d.ts +1 -1
  237. package/dist/hooks/useCSSPropsPolyfill.d.ts.map +1 -1
  238. package/dist/hooks/useCSSPropsPolyfill.js +12 -20
  239. package/dist/hooks/useCSSPropsPolyfill.js.map +1 -1
  240. package/dist/hooks/useCSSState.d.ts.map +1 -1
  241. package/dist/hooks/useCSSState.js +7 -3
  242. package/dist/hooks/useCSSState.js.map +1 -1
  243. package/dist/hooks/useEffectWithRefDeps.d.ts +2 -2
  244. package/dist/hooks/useEffectWithRefDeps.d.ts.map +1 -1
  245. package/dist/hooks/useEffectWithRefDeps.js +1 -1
  246. package/dist/hooks/useEffectWithRefDeps.js.map +1 -1
  247. package/dist/hooks/useFirstRender.d.ts +14 -0
  248. package/dist/hooks/useFirstRender.d.ts.map +1 -0
  249. package/dist/hooks/useFirstRender.js +20 -0
  250. package/dist/hooks/useFirstRender.js.map +1 -0
  251. package/dist/hooks/useGDS.d.ts +1 -1
  252. package/dist/hooks/usePrevious.d.ts +6 -4
  253. package/dist/hooks/usePrevious.d.ts.map +1 -1
  254. package/dist/hooks/usePrevious.js +6 -4
  255. package/dist/hooks/usePrevious.js.map +1 -1
  256. package/dist/hooks/useRefWithInit.d.ts +2 -2
  257. package/dist/hooks/useRefWithInit.d.ts.map +1 -1
  258. package/dist/hooks/useRefWithInit.js.map +1 -1
  259. package/dist/hooks/useStyleObserver.d.ts +2 -2
  260. package/dist/hooks/useStyleObserver.d.ts.map +1 -1
  261. package/dist/hooks/useStyleObserver.js.map +1 -1
  262. package/dist/icons/CalendarDynamicIcon.d.ts +8 -5
  263. package/dist/icons/CalendarDynamicIcon.d.ts.map +1 -1
  264. package/dist/icons/CalendarDynamicIcon.js +5 -2
  265. package/dist/icons/CalendarDynamicIcon.js.map +1 -1
  266. package/dist/icons/CopyInteractiveIcon.d.ts +5 -4
  267. package/dist/icons/CopyInteractiveIcon.d.ts.map +1 -1
  268. package/dist/icons/CopyInteractiveIcon.js +2 -2
  269. package/dist/icons/CopyInteractiveIcon.js.map +1 -1
  270. package/dist/icons/SidebarLeftInteractiveIcon.d.ts +4 -3
  271. package/dist/icons/SidebarLeftInteractiveIcon.d.ts.map +1 -1
  272. package/dist/icons/SidebarLeftInteractiveIcon.js +2 -2
  273. package/dist/icons/SidebarLeftInteractiveIcon.js.map +1 -1
  274. package/dist/icons/SidebarRightInteractiveIcon.d.ts +4 -3
  275. package/dist/icons/SidebarRightInteractiveIcon.d.ts.map +1 -1
  276. package/dist/icons/SidebarRightInteractiveIcon.js +2 -2
  277. package/dist/icons/SidebarRightInteractiveIcon.js.map +1 -1
  278. package/dist/tailwind-plugin.js +5 -5
  279. package/dist/tailwind-plugin.js.map +1 -1
  280. package/dist/utils/cn.d.ts +3 -1
  281. package/dist/utils/cn.d.ts.map +1 -1
  282. package/dist/utils/cn.js +3 -1
  283. package/dist/utils/cn.js.map +1 -1
  284. package/dist/utils/getCSSPropsAttributes.d.ts +10 -3
  285. package/dist/utils/getCSSPropsAttributes.d.ts.map +1 -1
  286. package/dist/utils/getCSSPropsAttributes.js +4 -5
  287. package/dist/utils/getCSSPropsAttributes.js.map +1 -1
  288. package/dist/utils/splitProps.d.ts +1 -4
  289. package/dist/utils/splitProps.d.ts.map +1 -1
  290. package/dist/utils/splitProps.js +2 -7
  291. package/dist/utils/splitProps.js.map +1 -1
  292. package/dist/utils/trimReactNode.d.ts +10 -8
  293. package/dist/utils/trimReactNode.d.ts.map +1 -1
  294. package/dist/utils/trimReactNode.js +10 -8
  295. package/dist/utils/trimReactNode.js.map +1 -1
  296. package/package.json +17 -17
  297. package/src/GDSProvider.tsx +11 -9
  298. package/src/components/Address.tsx +2 -2
  299. package/src/components/Avatar.tsx +5 -10
  300. package/src/components/Breadcrumbs.meta.ts +3 -1
  301. package/src/components/Breadcrumbs.parts.tsx +16 -28
  302. package/src/components/Button.tsx +14 -10
  303. package/src/components/ButtonGroup.meta.ts +8 -0
  304. package/src/components/ButtonGroup.tsx +1 -5
  305. package/src/components/Card.meta.ts +1 -0
  306. package/src/components/Checkbox.meta.ts +1 -5
  307. package/src/components/Chip.parts.tsx +1 -11
  308. package/src/components/CodeBlock.parts.tsx +75 -50
  309. package/src/components/CodeInline.tsx +3 -3
  310. package/src/components/CopyButton.meta.ts +1 -6
  311. package/src/components/CopyButton.tsx +3 -4
  312. package/src/components/CurrencyInput.meta.ts +1 -5
  313. package/src/components/DescriptionList.parts.tsx +1 -0
  314. package/src/components/Icon.meta.ts +1 -0
  315. package/src/components/Icon.tsx +4 -4
  316. package/src/components/Input.meta.ts +1 -5
  317. package/src/components/Input.tsx +5 -6
  318. package/src/components/Keyboard.tsx +1 -1
  319. package/src/components/Link.meta.ts +1 -0
  320. package/src/components/Link.tsx +2 -3
  321. package/src/components/Menu.meta.ts +39 -1
  322. package/src/components/Menu.parts.tsx +553 -549
  323. package/src/components/Modal.meta.ts +1 -1
  324. package/src/components/Modal.parts.tsx +67 -68
  325. package/src/components/OTCInput.meta.ts +1 -5
  326. package/src/components/OTCInput.tsx +1 -1
  327. package/src/components/Radio.meta.ts +1 -5
  328. package/src/components/SegmentedControl.meta.ts +3 -1
  329. package/src/components/SegmentedControl.parts.tsx +7 -10
  330. package/src/components/Stepper.meta.ts +1 -0
  331. package/src/components/Stepper.parts.tsx +3 -1
  332. package/src/components/Switch.meta.ts +1 -5
  333. package/src/components/TabSet.meta.ts +3 -1
  334. package/src/components/TextArea.meta.ts +1 -5
  335. package/src/components/ToggleButton.meta.ts +1 -6
  336. package/src/components/ToggleButton.tsx +1 -1
  337. package/src/components/Tooltip.meta.ts +13 -2
  338. package/src/components/Tooltip.parts.tsx +215 -158
  339. package/src/components/Tooltip.tsx +2 -2
  340. package/src/components/base/Addon.meta.ts +3 -1
  341. package/src/components/base/ButtonOrLink.parts.tsx +52 -51
  342. package/src/components/base/Checkable.parts.tsx +6 -13
  343. package/src/components/base/Field.parts.tsx +5 -5
  344. package/src/components/base/Portal.tsx +5 -7
  345. package/src/components/base/Render.tsx +37 -15
  346. package/src/components/base/Transition.meta.ts +1 -0
  347. package/src/components/base/Transition.tsx +2 -2
  348. package/src/components/base/index.ts +8 -2
  349. package/src/components/index.ts +1 -2
  350. package/src/hooks/index.ts +1 -0
  351. package/src/hooks/useCSSProp.ts +6 -8
  352. package/src/hooks/useCSSProps.ts +13 -22
  353. package/src/hooks/useCSSPropsPolyfill.ts +15 -23
  354. package/src/hooks/useCSSState.ts +11 -6
  355. package/src/hooks/useEffectWithRefDeps.ts +2 -2
  356. package/src/hooks/useFirstRender.ts +36 -0
  357. package/src/hooks/usePrevious.ts +6 -4
  358. package/src/hooks/useRefWithInit.ts +2 -2
  359. package/src/hooks/useStyleObserver.ts +5 -1
  360. package/src/icons/CalendarDynamicIcon.tsx +16 -6
  361. package/src/icons/CopyInteractiveIcon.tsx +10 -5
  362. package/src/icons/SidebarLeftInteractiveIcon.tsx +9 -5
  363. package/src/icons/SidebarRightInteractiveIcon.tsx +9 -5
  364. package/src/tailwind-plugin.ts +5 -5
  365. package/src/utils/cn.ts +3 -1
  366. package/src/utils/getCSSPropsAttributes.ts +13 -8
  367. package/src/utils/splitProps.ts +9 -9
  368. package/src/utils/trimReactNode.tsx +10 -8
  369. package/dist/components/base/ButtonOrLink.meta.d.ts +0 -2
  370. package/dist/components/base/ButtonOrLink.meta.d.ts.map +0 -1
  371. package/dist/components/base/ButtonOrLink.meta.js +0 -6
  372. package/dist/components/base/ButtonOrLink.meta.js.map +0 -1
  373. package/src/components/base/ButtonOrLink.meta.ts +0 -6
@@ -29,4 +29,12 @@ export const ButtonGroupMeta = createComponent('ButtonGroup', {
29
29
  defaultValue: false,
30
30
  },
31
31
  },
32
+ vars: {
33
+ gap: {
34
+ '@variant @prop-size-xsmall/button-group': '--spacing(1)',
35
+ '@variant @prop-size-small/button-group': '--spacing(1.5)',
36
+ '@variant @prop-size-medium/button-group': '--spacing(2)',
37
+ '@variant @prop-size-large/button-group': '--spacing(2)',
38
+ },
39
+ },
32
40
  })
@@ -77,11 +77,7 @@ export function ButtonGroup({
77
77
  * mentioned, vertical in horizontal doesn't make sense.
78
78
  */
79
79
  className={`
80
- flex items-center
81
- @prop-size-xsmall/button-group:gap-1
82
- @prop-size-small/button-group:gap-1.5
83
- @prop-size-medium/button-group:gap-2
84
- @prop-size-large/button-group:gap-2
80
+ flex items-center gap-(--gds-button-group-gap)
85
81
  @prop-orientation-vertical/button-group:not-in-button-group-[[data-gds-prop-polyfill-orientation=gds-horizontal]]:flex-col
86
82
  i:*:@prop-orientation-vertical/button-group:not-in-button-group-[[data-gds-prop-polyfill-orientation=gds-horizontal]]:w-full
87
83
  `}
@@ -1,6 +1,7 @@
1
1
  import { createComponent } from '@graphprotocol/gds-css'
2
2
 
3
3
  export const CardMeta = createComponent('Card', {
4
+ isolate: 'allow-inheritance',
4
5
  cssProps: {
5
6
  /** @default 'secondary' */
6
7
  variant: {
@@ -3,9 +3,5 @@ import { createComponent } from '@graphprotocol/gds-css'
3
3
  import { CheckableMeta } from './base/Checkable.meta.ts'
4
4
 
5
5
  export const CheckboxMeta = createComponent('Checkbox', {
6
- containerName: 'gds-checkable',
7
- cssProps: {
8
- /** @default 'medium' */
9
- size: CheckableMeta.cssProps.size,
10
- },
6
+ extends: CheckableMeta,
11
7
  })
@@ -170,17 +170,7 @@ export function ChipRoot({
170
170
  {/* Ensure rounded corners are clickable */}
171
171
  <span className="absolute inset-0 not-in-clickable:hidden" />
172
172
  {addonBefore ? <ChipAddon side="before">{renderAddon(addonBefore)}</ChipAddon> : null}
173
- <span
174
- className={`
175
- flex items-baseline
176
- @prop-size-small/chip:gap-0.5
177
- @prop-size-small/chip:px-0.5
178
- @prop-size-medium/chip:gap-1
179
- @prop-size-medium/chip:px-1
180
- @prop-size-large/chip:gap-1
181
- @prop-size-large/chip:px-1
182
- `}
183
- >
173
+ <span className="flex items-baseline gap-1 px-1">
184
174
  <span className="truncate">{children}</span>
185
175
  {count ? (
186
176
  <span
@@ -39,7 +39,9 @@ import {
39
39
 
40
40
  import { useControlled, useCSSPropsPolyfill, useGDS } from '../hooks/index.ts'
41
41
  import { cn, getCSSPropsAttributes, type Stringifiable } from '../utils/index.ts'
42
+ import { renderAddon, type AddonValue } from './base/Addon.tsx'
42
43
  import { Button } from './Button.tsx'
44
+ import { ButtonGroup } from './ButtonGroup.tsx'
43
45
  import { CodeBlockMeta } from './CodeBlock.meta.ts'
44
46
  import { CopyButton } from './CopyButton.tsx'
45
47
  import { TabSet, TabSetContext, type TabSetTabProps } from './TabSet.tsx'
@@ -150,8 +152,21 @@ function CodeBlockHeader({ buttons, className, children, ...props }: CodeBlockHe
150
152
  )}
151
153
  {...props}
152
154
  >
153
- <div className="grow">{children}</div>
154
- {buttons ? <div className="flex shrink-0 items-center gap-3 pe-2.5">{buttons}</div> : null}
155
+ <div className="min-w-em grow">{children}</div>
156
+ {buttons ? (
157
+ <ButtonGroup
158
+ variant="naked"
159
+ size="medium"
160
+ /**
161
+ * The `not-has-button:hidden` class prevents an empty `ButtonGroup` from taking space
162
+ * in the layout, which can happen when the stuff that `CodeBlockTabs` passes as
163
+ * `buttons` ends up rendering nothing (which we can't know in advance).
164
+ */
165
+ className="me-2 shrink-0 self-center not-has-button:hidden"
166
+ >
167
+ {buttons}
168
+ </ButtonGroup>
169
+ ) : null}
155
170
  <div className="absolute inset-x-0 bottom-0 border-b border-subtle" />
156
171
  </figcaption>
157
172
  </CodeBlockHeaderContext.Provider>
@@ -162,8 +177,8 @@ export interface CodeBlockProps extends Omit<ComponentProps<'div'>, 'onCopy'>, S
162
177
  /** @default 'text' */
163
178
  language?: Language | undefined
164
179
  /** Defaults to an icon that matches the `language`. */
165
- icon?: ReactNode | undefined
166
- label?: string | undefined
180
+ icon?: AddonValue | undefined
181
+ label?: ReactNode | undefined
167
182
  children: Stringifiable
168
183
  }
169
184
 
@@ -314,64 +329,74 @@ export function CodeBlockRoot({
314
329
  })
315
330
  }, [highlighter, childrenString, activeTheme, language, highlights, secrets, diff])
316
331
 
317
- const buttons = (
318
- <>
319
- {secrets.length > 0 ? (
320
- <Button variant="naked" size="medium" onClick={() => setMasked(!masked)}>
321
- {masked ? (
322
- <EyeIcon alt={`Reveal secret${secrets.length > 1 ? 's' : ''}`} />
323
- ) : (
324
- <EyeClosedIcon alt={`Hide secret${secrets.length > 1 ? 's' : ''}`} />
325
- )}
326
- </Button>
327
- ) : null}
328
- {copy ? (
329
- <CopyButton
330
- variant="naked"
331
- size="medium"
332
- value={typeof copy === 'string' ? copy : codeToCopy}
333
- onCopy={onCopy}
334
- />
335
- ) : null}
336
- </>
337
- )
332
+ const buttonElements = [
333
+ secrets.length > 0 && (
334
+ <Button key="reveal" onClick={() => setMasked(!masked)}>
335
+ {masked ? (
336
+ <EyeIcon alt={`Reveal secret${secrets.length > 1 ? 's' : ''}`} />
337
+ ) : (
338
+ <EyeClosedIcon alt={`Hide secret${secrets.length > 1 ? 's' : ''}`} />
339
+ )}
340
+ </Button>
341
+ ),
342
+ copy && (
343
+ <CopyButton key="copy" value={typeof copy === 'string' ? copy : codeToCopy} onCopy={onCopy} />
344
+ ),
345
+ ].filter(Boolean)
346
+
347
+ const buttons = buttonElements.length > 0 ? <>{buttonElements}</> : null
338
348
 
339
349
  if (hasAncestorHeader) {
340
350
  return buttons
341
351
  }
342
352
 
343
353
  const Wrapper = hasAncestorTabs ? 'div' : CodeBlockWrapper
344
- const headerContent = (
345
- <div className="flex h-full items-center gap-2 ps-2">
346
- {icon ? (
347
- <span className="flex size-4 shrink-0 items-center justify-center **:icon:default-size-3.5">
348
- {icon}
349
- </span>
350
- ) : null}
351
- {label ? <span className="truncate text-14 text-muted">{label}</span> : null}
352
- </div>
353
- )
354
+ const headerContent =
355
+ label || passedIcon ? (
356
+ <div className="flex h-full items-center gap-2 ps-2">
357
+ {icon ? (
358
+ <span className="flex size-4 shrink-0 items-center justify-center **:icon:default-size-3.5">
359
+ {renderAddon(icon)}
360
+ </span>
361
+ ) : null}
362
+ {label ? <span className="truncate text-14 text-muted">{label}</span> : null}
363
+ </div>
364
+ ) : null
354
365
 
355
366
  return (
356
367
  <Wrapper
357
368
  ref={cssPropsPolyfillPassedRef}
369
+ data-has-header={Boolean(headerContent) || undefined}
358
370
  className={cn(
359
- `gds-code-block isolate root-flex flex-col
360
- u:not-in-code-block-tabs:min-h-24
361
- u:not-in-code-block-tabs:rounded-8`,
371
+ `gds-code-block group/code-block root-flex flex-col
372
+ u:not-in-code-block-tabs:rounded-8
373
+ u:not-in-code-block-tabs:not-data-has-header:min-h-13
374
+ u:not-in-code-block-tabs:data-has-header:min-h-24`,
362
375
  className,
363
376
  )}
364
377
  {...getCSSPropsAttributes(CodeBlockMeta, { wrap, lineNumbers, rows }, style)}
365
378
  {...cssPropsPolyfillAttributes}
366
379
  {...props}
367
380
  >
368
- {!hasAncestorTabs ? (
369
- <CodeBlockHeader buttons={buttons}>{headerContent}</CodeBlockHeader>
370
- ) : null}
371
- {hasAncestorTabs && label ? (
372
- <div className="flex h-10 shrink-0 px-2">
373
- <div className="absolute inset-0 border-b border-subtle" />
374
- {headerContent}
381
+ {headerContent ? (
382
+ hasAncestorTabs ? (
383
+ <div className="flex h-10 shrink-0 px-2">
384
+ <div className="absolute inset-0 border-b border-subtle" />
385
+ {headerContent}
386
+ </div>
387
+ ) : (
388
+ <CodeBlockHeader buttons={buttons}>{headerContent}</CodeBlockHeader>
389
+ )
390
+ ) : !hasAncestorTabs && buttons ? (
391
+ <div
392
+ className={`
393
+ absolute end-3 top-3 z-10 opacity-0 transition
394
+ group-not-hover/code-block:pointer-events-none
395
+ group-hover/code-block:opacity-100
396
+ has-focus-visible:opacity-100
397
+ `}
398
+ >
399
+ <ButtonGroup size="xsmall">{buttons}</ButtonGroup>
375
400
  </div>
376
401
  ) : null}
377
402
  <pre
@@ -384,7 +409,7 @@ export function CodeBlockRoot({
384
409
  * that case, so it should be fine.
385
410
  */
386
411
  className={`
387
- h-(--max-height) max-h-max grow overflow-auto font-mono text-14
412
+ isolate scrollbar-thin h-(--max-height) max-h-max grow overflow-auto font-mono text-14
388
413
  [--max-height:calc(9999px-min(9999px,var(--gds-code-block-rows)*9999px)+var(--gds-code-block-rows)*1lh+2*var(--padding))]
389
414
  [--padding:--spacing(4)]
390
415
  firefox:h-auto
@@ -427,8 +452,8 @@ export function CodeBlockRoot({
427
452
  <span
428
453
  aria-hidden
429
454
  className={`
430
- hidden min-w-4 text-center text-12 text-subtle select-none
431
- @prop-line-numbers-true/code-block:block
455
+ min-w-4 text-center text-12 text-subtle select-none
456
+ @prop-line-numbers-false/code-block:hidden
432
457
  `}
433
458
  >
434
459
  {lineIndex + 1}
@@ -544,7 +569,7 @@ export function CodeBlockTabs<const Tabs extends readonly Tab[], T extends TabVa
544
569
  className,
545
570
  children,
546
571
  ...props
547
- }: CodeBlockTabsProps<Tabs, T> & { ref?: React.Ref<HTMLDivElement> }) {
572
+ }: CodeBlockTabsProps<Tabs, T>) {
548
573
  if (passedTabs.length === 0) {
549
574
  throw new Error('[CodeBlock.Tabs] At least 1 tab is required')
550
575
  }
@@ -583,7 +608,7 @@ export function CodeBlockTabs<const Tabs extends readonly Tab[], T extends TabVa
583
608
  defaultValue={defaultValue ?? (tabs[0]!.value as T)}
584
609
  onChange={onChange}
585
610
  className={cn(
586
- `gds-code-block-tabs isolate root-flex flex-col u:min-h-24 u:rounded-8
611
+ `gds-code-block-tabs root-flex flex-col u:min-h-24 u:rounded-8
587
612
  u:[--saved-default-line-numbers:var(--gds-default-line-numbers)]
588
613
  u:[--saved-default-rows:var(--gds-default-rows)]
589
614
  u:[--saved-default-wrap:var(--gds-default-wrap)]
@@ -15,8 +15,8 @@ export function CodeInline({ className, children, ...props }: CodeInlineProps) {
15
15
  return (
16
16
  <span
17
17
  className={cn(
18
- `gds-code-inline root-inline
19
- u:font-mono u:font-regular u:wrap-anywhere u:whitespace-pre-wrap u:text-code u:in-link:text-link-idle
18
+ `gds-code-inline root-inline u:font-mono u:text-size-inherit u:wrap-anywhere u:whitespace-pre-wrap u:text-code
19
+ u:in-link:text-link-idle
20
20
  ${/* If inside a link, ensure the underline of the link appears over the background and border by default */ ''}
21
21
  u:in-link:-z-10
22
22
  ${/* Prevent messing with the line height (this needs to be set on the root _and_ on the inner element) */ ''}
@@ -44,7 +44,7 @@ export function CodeInline({ className, children, ...props }: CodeInlineProps) {
44
44
  in-link:transition-[border-radius]
45
45
  in-link-hover:rounded-b-none
46
46
  ${/* Prevent incorrect alignment when empty */ ''}
47
- empty:after:content-(--content-nbsp)
47
+ empty:after:content-nbsp
48
48
  `}
49
49
  {...props}
50
50
  >
@@ -5,17 +5,12 @@ import { ButtonMeta } from './Button.meta.ts'
5
5
  type ButtonVariant = (typeof ButtonMeta.cssProps.variant.values)[number]
6
6
 
7
7
  export const CopyButtonMeta = createComponent('CopyButton', {
8
- containerName: 'gds-button',
8
+ extends: ButtonMeta,
9
9
  cssProps: {
10
- /** @default 'secondary' */
11
10
  variant: {
12
11
  type: 'values',
13
12
  values: ['secondary', 'tertiary', 'inverse', 'naked'] as const satisfies ButtonVariant[],
14
13
  defaultValue: 'secondary',
15
14
  },
16
- /** @default 'medium' */
17
- size: ButtonMeta.cssProps.size,
18
- /** @default false */
19
- hideLabel: ButtonMeta.cssProps.hideLabel,
20
15
  },
21
16
  })
@@ -42,7 +42,7 @@ export function CopyButton({
42
42
  if (newStatus === 'copied') {
43
43
  timeoutRef.current = window.setTimeout(() => setStatus('copied-exit'), 1000)
44
44
  } else if (newStatus === 'copied-exit') {
45
- timeoutRef.current = window.setTimeout(() => setStatus('idle'), 100)
45
+ timeoutRef.current = window.setTimeout(() => setStatus('idle'), 150)
46
46
  }
47
47
  }
48
48
 
@@ -57,9 +57,8 @@ export function CopyButton({
57
57
 
58
58
  return (
59
59
  <Tooltip
60
- {...(status !== 'idle'
61
- ? { content: 'Copied!', open: status === 'copied' }
62
- : { content: null })}
60
+ content="Copied!"
61
+ {...(status !== 'idle' ? { open: status === 'copied' } : { disabled: true })}
63
62
  {...tooltipCSSProps}
64
63
  >
65
64
  <Button
@@ -3,9 +3,5 @@ import { createComponent } from '@graphprotocol/gds-css'
3
3
  import { FieldMeta } from './base/Field.meta.ts'
4
4
 
5
5
  export const CurrencyInputMeta = createComponent('CurrencyInput', {
6
- containerName: 'gds-field',
7
- cssProps: {
8
- /** @default 'medium' */
9
- size: FieldMeta.cssProps.size,
10
- },
6
+ extends: FieldMeta,
11
7
  })
@@ -56,6 +56,7 @@ export function DescriptionListRoot({
56
56
  </div>
57
57
  )
58
58
  }
59
+ DescriptionListRoot.displayName = 'DescriptionList'
59
60
 
60
61
  export interface DescriptionListItemProps
61
62
  extends ComponentProps<'div'>, GDSComponentProps<typeof DescriptionListItemMeta> {
@@ -1,6 +1,7 @@
1
1
  import { createComponent } from '@graphprotocol/gds-css'
2
2
 
3
3
  export const IconMeta = createComponent('Icon', {
4
+ isolate: 'allow-inheritance',
4
5
  addonCompatible: true,
5
6
  cssProps: {
6
7
  /** @default '1em' */
@@ -13,7 +13,7 @@ import type { GDSComponentProps } from '@graphprotocol/gds-css'
13
13
  import { useGDS } from '../hooks/index.ts'
14
14
  import { cn, getCSSPropsAttributes } from '../utils/index.ts'
15
15
  import { IconMeta } from './Icon.meta.ts'
16
- import { useCollectTooltip } from './Tooltip.tsx'
16
+ import { useTooltipCollector } from './Tooltip.tsx'
17
17
 
18
18
  export interface IconProps
19
19
  extends Omit<ComponentProps<'span'>, 'children' | 'color'>, GDSComponentProps<typeof IconMeta> {
@@ -35,10 +35,10 @@ export function Icon({ src, alt, size, color, className, style, ...props }: Icon
35
35
  useGDS()
36
36
 
37
37
  const iconContent = isValidElement(src) ? src : createElement(src)
38
- const collectTooltip = useCollectTooltip()
38
+ const collectTooltipContent = useTooltipCollector()
39
39
 
40
- if (collectTooltip && alt) {
41
- collectTooltip(alt)
40
+ if (collectTooltipContent && alt) {
41
+ collectTooltipContent(alt)
42
42
  }
43
43
 
44
44
  if ('variant' in props) {
@@ -3,9 +3,5 @@ import { createComponent } from '@graphprotocol/gds-css'
3
3
  import { FieldMeta } from './base/Field.meta.ts'
4
4
 
5
5
  export const InputMeta = createComponent('Input', {
6
- containerName: 'gds-field',
7
- cssProps: {
8
- /** @default 'medium' */
9
- size: FieldMeta.cssProps.size,
10
- },
6
+ extends: FieldMeta,
11
7
  })
@@ -1,6 +1,6 @@
1
1
  'use client'
2
2
 
3
- import type { ComponentProps, ReactElement, ReactNode } from 'react'
3
+ import type { ComponentProps, ReactNode } from 'react'
4
4
 
5
5
  import type { GDSComponentProps } from '@graphprotocol/gds-css'
6
6
  import { parseNumber } from '@graphprotocol/gds-utils'
@@ -8,10 +8,10 @@ import { parseNumber } from '@graphprotocol/gds-utils'
8
8
  import { useControlled, useGDS } from '../hooks/index.ts'
9
9
  import { cn, splitProps } from '../utils/index.ts'
10
10
  import { Field, type FieldProps } from './base/Field.tsx'
11
- import { Render } from './base/Render.tsx'
11
+ import { Render, type RenderProp } from './base/Render.tsx'
12
12
  import type { InputMeta } from './Input.meta.ts'
13
13
 
14
- export interface InputState {
14
+ export type InputState = {
15
15
  inputProps: ComponentProps<'input'>
16
16
  inputWithUnitAndAction: ReactNode
17
17
  }
@@ -39,9 +39,7 @@ export interface InputProps
39
39
  message?: FieldProps['message'] | undefined
40
40
  unit?: ReactNode | undefined
41
41
  action?: ReactNode | undefined
42
- renderInput?:
43
- | ((renderProps: ComponentProps<'div'>, state: InputState) => ReactElement)
44
- | undefined
42
+ renderInput?: RenderProp<InputState> | undefined
45
43
  }
46
44
 
47
45
  export function Input({
@@ -168,6 +166,7 @@ export function Input({
168
166
  **:button:default-variant-tertiary
169
167
  @prop-size-small/field:pe-0.5
170
168
  @prop-size-small/field:**:button:var-[radius=var(--radius-4)]
169
+ @prop-size-small/field:**:button-group:var-[gap=--spacing(0.5)]
171
170
  @prop-size-medium/field:pe-1.5
172
171
  @prop-size-large/field:pe-2
173
172
  @prop-size-small/field:**:button-or-group:prop-size-xsmall
@@ -48,7 +48,7 @@ export function Keyboard({
48
48
  <kbd
49
49
  ref={cssPropsPolyfillPassedRef}
50
50
  className={cn(
51
- `gds-keyboard root-inline u:shrink-0 u:font-mono u:font-regular u:whitespace-nowrap u:text-default
51
+ `gds-keyboard root-inline u:shrink-0 u:font-mono u:whitespace-nowrap
52
52
  i:leading-0`,
53
53
  className,
54
54
  )}
@@ -1,6 +1,7 @@
1
1
  import { createComponent } from '@graphprotocol/gds-css'
2
2
 
3
3
  export const LinkMeta = createComponent('Link', {
4
+ isolate: 'allow-inheritance',
4
5
  cssProps: {
5
6
  /** @default 'primary' */
6
7
  variant: {
@@ -15,7 +15,7 @@ export declare namespace LinkProps {
15
15
  /** @default 'primary' */
16
16
  variant?: 'primary' | 'secondary' | undefined
17
17
  addonBefore?: AddonValue | undefined
18
- /** Defaults to `ArrowUpRightInteractiveIcon` if `href` is set and `target` is `_blank` */
18
+ /** Defaults to `ArrowUpRightInteractiveIcon` if `href` is defined and `target` is `_blank` */
19
19
  addonAfter?: AddonValue | undefined
20
20
  }
21
21
  interface ButtonProps
@@ -70,8 +70,7 @@ export function Link({
70
70
  disabled={disabled}
71
71
  data-variant={cssProps.variant}
72
72
  className={cn(
73
- `gds-link isolate ${/* Allow nested elements (e.g. `CodeInline`) to have a negative `z-index` to appear behind the underline */ ''}
74
- root-inline u:w-max u:max-w-full u:wrap-anywhere u:outline-0
73
+ `gds-link root-inline u:w-max u:max-w-full u:wrap-anywhere u:outline-0
75
74
  u:hover:state-hover
76
75
  u:focus-visible:state-focus
77
76
  u:active:state-active
@@ -1,5 +1,43 @@
1
1
  import { createComponent } from '@graphprotocol/gds-css'
2
2
 
3
- export const MenuMeta = createComponent('Menu')
3
+ export const MenuMeta = createComponent('Menu', {
4
+ isolate: false,
5
+ cssProps: {
6
+ /** @default 'bottom' // or for nested menus, 'end' */
7
+ side: {
8
+ type: 'values',
9
+ values: ['top', 'bottom', 'start', 'end'],
10
+ defaultValue: 'bottom',
11
+ },
12
+ /** @default 1 // or for nested menus, 3 */
13
+ gap: {
14
+ type: 'number',
15
+ defaultValue: 1,
16
+ },
17
+ /** @default 'start' */
18
+ align: {
19
+ type: 'values',
20
+ values: ['start', 'center', 'end'],
21
+ defaultValue: 'start',
22
+ },
23
+ /** @default 0 // or for nested menus, -2 */
24
+ alignOffset: {
25
+ type: 'number',
26
+ defaultValue: 0,
27
+ },
28
+ /** @default false */
29
+ matchTriggerWidth: {
30
+ type: 'values',
31
+ values: [false, true, 'at-least', 'at-most'],
32
+ defaultValue: false,
33
+ },
34
+ /** @default false */
35
+ matchTriggerHeight: {
36
+ type: 'values',
37
+ values: [false, true, 'at-least', 'at-most'],
38
+ defaultValue: false,
39
+ },
40
+ },
41
+ })
4
42
 
5
43
  export const MenuItemMeta = createComponent('MenuItem')