@node-core/ui-components 1.0.1-a356572cf397450a3eeeb973d6fe6d6803a24059 → 1.0.1-ab0ba1dcb1d91392c44e91b1e74e9f565e460543

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 (331) hide show
  1. package/.lintstagedrc.json +5 -0
  2. package/.postcssrc.json +6 -0
  3. package/.storybook/constants.ts +28 -0
  4. package/.storybook/main.ts +38 -0
  5. package/.storybook/preview-head.html +20 -0
  6. package/.storybook/preview.tsx +32 -0
  7. package/.stylelintignore +1 -0
  8. package/.stylelintrc.mjs +56 -0
  9. package/__design__/colors.stories.tsx +82 -0
  10. package/__design__/effects.stories.tsx +7 -0
  11. package/__design__/font-family.stories.tsx +76 -0
  12. package/__design__/list.stories.tsx +27 -0
  13. package/__design__/node-logos.stories.tsx +61 -0
  14. package/__design__/platform-logos.stories.tsx +31 -0
  15. package/__design__/social-logos.stories.tsx +33 -0
  16. package/__design__/table.stories.tsx +56 -0
  17. package/__design__/text.stories.tsx +100 -0
  18. package/eslint.config.js +61 -0
  19. package/package.json +45 -6
  20. package/src/Common/AlertBox/index.module.css +83 -0
  21. package/src/Common/AlertBox/index.stories.tsx +96 -0
  22. package/src/Common/AlertBox/index.tsx +24 -0
  23. package/src/Common/AvatarGroup/Avatar/index.module.css +40 -0
  24. package/src/Common/AvatarGroup/Avatar/index.stories.tsx +22 -0
  25. package/src/Common/AvatarGroup/Avatar/index.tsx +67 -0
  26. package/src/Common/AvatarGroup/Overlay/index.module.css +31 -0
  27. package/src/Common/AvatarGroup/Overlay/index.stories.tsx +33 -0
  28. package/src/Common/AvatarGroup/Overlay/index.tsx +37 -0
  29. package/src/Common/AvatarGroup/__tests__/index.test.jsx +55 -0
  30. package/src/Common/AvatarGroup/index.module.css +21 -0
  31. package/src/Common/AvatarGroup/index.stories.tsx +56 -0
  32. package/src/Common/AvatarGroup/index.tsx +83 -0
  33. package/src/Common/Badge/index.module.css +38 -0
  34. package/src/Common/Badge/index.stories.tsx +38 -0
  35. package/src/Common/Badge/index.tsx +35 -0
  36. package/src/Common/BadgeGroup/index.module.css +77 -0
  37. package/src/Common/BadgeGroup/index.stories.tsx +35 -0
  38. package/src/Common/BadgeGroup/index.tsx +35 -0
  39. package/src/Common/Banner/index.module.css +42 -0
  40. package/src/Common/Banner/index.stories.tsx +29 -0
  41. package/src/Common/Banner/index.tsx +18 -0
  42. package/src/Common/BaseActiveLink/__tests__/index.test.jsx +52 -0
  43. package/src/Common/BaseActiveLink/index.tsx +34 -0
  44. package/src/Common/BaseButton/index.module.css +145 -0
  45. package/src/Common/BaseButton/index.stories.tsx +67 -0
  46. package/src/Common/BaseButton/index.tsx +59 -0
  47. package/src/Common/BaseCodeBox/index.module.css +78 -0
  48. package/src/Common/BaseCodeBox/index.stories.tsx +39 -0
  49. package/src/Common/BaseCodeBox/index.tsx +122 -0
  50. package/src/Common/BaseCrossLink/index.module.css +51 -0
  51. package/src/Common/BaseCrossLink/index.stories.tsx +38 -0
  52. package/src/Common/BaseCrossLink/index.tsx +46 -0
  53. package/src/Common/BaseLinkTabs/index.module.css +43 -0
  54. package/src/Common/BaseLinkTabs/index.stories.tsx +34 -0
  55. package/src/Common/BaseLinkTabs/index.tsx +53 -0
  56. package/src/Common/BasePagination/Ellipsis/index.module.css +10 -0
  57. package/src/Common/BasePagination/Ellipsis/index.stories.tsx +10 -0
  58. package/src/Common/BasePagination/Ellipsis/index.tsx +11 -0
  59. package/src/Common/BasePagination/PaginationListItem/__tests__/index.test.jsx +58 -0
  60. package/src/Common/BasePagination/PaginationListItem/index.module.css +27 -0
  61. package/src/Common/BasePagination/PaginationListItem/index.stories.tsx +40 -0
  62. package/src/Common/BasePagination/PaginationListItem/index.tsx +39 -0
  63. package/src/Common/BasePagination/PrevNextArrow.tsx +15 -0
  64. package/src/Common/BasePagination/__tests__/index.test.jsx +180 -0
  65. package/src/Common/BasePagination/index.module.css +39 -0
  66. package/src/Common/BasePagination/index.stories.tsx +67 -0
  67. package/src/Common/BasePagination/index.tsx +77 -0
  68. package/src/Common/BasePagination/useGetPageElements.tsx +132 -0
  69. package/src/Common/Blockquote/index.module.css +29 -0
  70. package/src/Common/Blockquote/index.stories.tsx +45 -0
  71. package/src/Common/Blockquote/index.tsx +11 -0
  72. package/src/Common/Breadcrumbs/BreadcrumbHomeLink/index.module.css +5 -0
  73. package/src/Common/Breadcrumbs/BreadcrumbHomeLink/index.tsx +30 -0
  74. package/src/Common/Breadcrumbs/BreadcrumbItem/index.module.css +41 -0
  75. package/src/Common/Breadcrumbs/BreadcrumbItem/index.tsx +42 -0
  76. package/src/Common/Breadcrumbs/BreadcrumbLink/index.module.css +22 -0
  77. package/src/Common/Breadcrumbs/BreadcrumbLink/index.tsx +37 -0
  78. package/src/Common/Breadcrumbs/BreadcrumbRoot/index.module.css +9 -0
  79. package/src/Common/Breadcrumbs/BreadcrumbRoot/index.tsx +20 -0
  80. package/src/Common/Breadcrumbs/BreadcrumbTruncatedItem/index.tsx +9 -0
  81. package/src/Common/Breadcrumbs/index.stories.tsx +94 -0
  82. package/src/Common/Breadcrumbs/index.tsx +81 -0
  83. package/src/Common/ChangeHistory/index.module.css +83 -0
  84. package/src/Common/ChangeHistory/index.stories.tsx +130 -0
  85. package/src/Common/ChangeHistory/index.tsx +67 -0
  86. package/src/Common/CodeTabs/index.module.css +56 -0
  87. package/src/Common/CodeTabs/index.stories.tsx +73 -0
  88. package/src/Common/CodeTabs/index.tsx +16 -0
  89. package/src/Common/DataTag/index.module.css +56 -0
  90. package/src/Common/DataTag/index.stories.tsx +40 -0
  91. package/src/Common/DataTag/index.tsx +39 -0
  92. package/src/Common/GlowingBackdrop/index.module.css +32 -0
  93. package/src/Common/GlowingBackdrop/index.stories.tsx +10 -0
  94. package/src/Common/GlowingBackdrop/index.tsx +13 -0
  95. package/src/Common/LanguageDropDown/index.module.css +53 -0
  96. package/src/Common/LanguageDropDown/index.stories.tsx +19 -0
  97. package/src/Common/LanguageDropDown/index.tsx +56 -0
  98. package/src/Common/Modal/index.module.css +79 -0
  99. package/src/Common/Modal/index.stories.tsx +34 -0
  100. package/src/Common/Modal/index.tsx +50 -0
  101. package/src/Common/NodejsLogo/index.module.css +6 -0
  102. package/src/Common/NodejsLogo/index.stories.tsx +14 -0
  103. package/src/Common/NodejsLogo/index.tsx +26 -0
  104. package/src/Common/Notification/index.module.css +20 -0
  105. package/src/Common/Notification/index.stories.tsx +36 -0
  106. package/src/Common/Notification/index.tsx +34 -0
  107. package/src/Common/Preview/index.module.css +79 -0
  108. package/src/Common/Preview/index.stories.tsx +44 -0
  109. package/src/Common/Preview/index.tsx +25 -0
  110. package/src/Common/Select/__tests__/index.test.jsx +67 -0
  111. package/src/Common/Select/index.module.css +161 -0
  112. package/src/Common/Select/index.stories.tsx +111 -0
  113. package/src/Common/Select/index.tsx +187 -0
  114. package/src/Common/Separator/index.module.css +16 -0
  115. package/src/Common/Separator/index.stories.tsx +32 -0
  116. package/src/Common/Separator/index.tsx +27 -0
  117. package/src/Common/Skeleton/index.module.css +30 -0
  118. package/src/Common/Skeleton/index.tsx +39 -0
  119. package/src/Common/Tabs/__tests__/index.test.jsx +52 -0
  120. package/src/Common/Tabs/index.module.css +54 -0
  121. package/src/Common/Tabs/index.stories.tsx +50 -0
  122. package/src/Common/Tabs/index.tsx +54 -0
  123. package/src/Common/ThemeToggle/__tests__/index.test.jsx +35 -0
  124. package/src/Common/ThemeToggle/index.module.css +15 -0
  125. package/src/Common/ThemeToggle/index.stories.tsx +10 -0
  126. package/src/Common/ThemeToggle/index.tsx +15 -0
  127. package/src/Common/Tooltip/index.module.css +43 -0
  128. package/src/Common/Tooltip/index.stories.tsx +73 -0
  129. package/src/Common/Tooltip/index.tsx +48 -0
  130. package/src/Containers/Article/index.module.css +70 -0
  131. package/src/Containers/Article/index.stories.tsx +39 -0
  132. package/src/Containers/Article/index.tsx +9 -0
  133. package/src/Containers/DocSideBar/index.tsx +0 -0
  134. package/src/Containers/Footer/index.module.css +46 -0
  135. package/src/Containers/Footer/index.stories.tsx +27 -0
  136. package/src/Containers/Footer/index.tsx +95 -0
  137. package/src/Containers/MetaBar/__tests__/index.test.jsx +63 -0
  138. package/src/Containers/MetaBar/index.module.css +91 -0
  139. package/src/Containers/MetaBar/index.stories.tsx +80 -0
  140. package/src/Containers/MetaBar/index.tsx +72 -0
  141. package/src/Containers/NavBar/NavItem/index.module.css +60 -0
  142. package/src/Containers/NavBar/NavItem/index.stories.tsx +38 -0
  143. package/src/Containers/NavBar/NavItem/index.tsx +44 -0
  144. package/src/Containers/NavBar/index.module.css +125 -0
  145. package/src/Containers/NavBar/index.stories.tsx +45 -0
  146. package/src/Containers/NavBar/index.tsx +94 -0
  147. package/src/Containers/Sidebar/ProgressionIcon/index.tsx +16 -0
  148. package/src/Containers/Sidebar/SidebarGroup/index.module.css +64 -0
  149. package/src/Containers/Sidebar/SidebarGroup/index.stories.tsx +36 -0
  150. package/src/Containers/Sidebar/SidebarGroup/index.tsx +49 -0
  151. package/src/Containers/Sidebar/SidebarItem/index.module.css +56 -0
  152. package/src/Containers/Sidebar/SidebarItem/index.stories.tsx +15 -0
  153. package/src/Containers/Sidebar/SidebarItem/index.tsx +43 -0
  154. package/src/Containers/Sidebar/index.module.css +30 -0
  155. package/src/Containers/Sidebar/index.stories.tsx +88 -0
  156. package/src/Containers/Sidebar/index.tsx +70 -0
  157. package/src/Icons/HexagonGrid.stories.tsx +10 -0
  158. package/src/Icons/HexagonGrid.tsx +1434 -0
  159. package/src/Icons/InstallationMethod/Choco.tsx +78 -0
  160. package/src/Icons/InstallationMethod/Devbox.tsx +21 -0
  161. package/src/Icons/InstallationMethod/Docker.tsx +20 -0
  162. package/src/Icons/InstallationMethod/FNM.tsx +132 -0
  163. package/src/Icons/InstallationMethod/Homebrew.tsx +69 -0
  164. package/src/Icons/InstallationMethod/N.tsx +32 -0
  165. package/src/Icons/InstallationMethod/NVM.tsx +63 -0
  166. package/src/Icons/InstallationMethod/Volta.tsx +34 -0
  167. package/{Icons/InstallationMethod/index.js → src/Icons/InstallationMethod/index.ts} +1 -0
  168. package/src/Icons/Logos/JsGreen.tsx +24 -0
  169. package/src/Icons/Logos/JsWhite.tsx +37 -0
  170. package/src/Icons/Logos/Nodejs.tsx +372 -0
  171. package/src/Icons/Logos/NodejsStackedBlack.tsx +98 -0
  172. package/src/Icons/Logos/NodejsStackedDark.tsx +124 -0
  173. package/src/Icons/Logos/NodejsStackedLight.tsx +123 -0
  174. package/src/Icons/Logos/NodejsStackedWhite.tsx +98 -0
  175. package/{Icons/Logos/index.js → src/Icons/Logos/index.ts} +10 -1
  176. package/src/Icons/OperatingSystem/AIX.tsx +46 -0
  177. package/src/Icons/OperatingSystem/Apple.tsx +23 -0
  178. package/src/Icons/OperatingSystem/Linux.tsx +969 -0
  179. package/src/Icons/OperatingSystem/Microsoft.tsx +19 -0
  180. package/{Icons/OperatingSystem/index.js → src/Icons/OperatingSystem/index.ts} +1 -0
  181. package/src/Icons/PackageManager/Npm.tsx +21 -0
  182. package/src/Icons/PackageManager/Pnpm.tsx +22 -0
  183. package/src/Icons/PackageManager/Yarn.tsx +22 -0
  184. package/{Icons/PackageManager/index.js → src/Icons/PackageManager/index.ts} +1 -0
  185. package/src/Icons/Social/Bluesky.tsx +19 -0
  186. package/src/Icons/Social/Discord.tsx +20 -0
  187. package/src/Icons/Social/GitHub.tsx +16 -0
  188. package/src/Icons/Social/LinkedIn.tsx +16 -0
  189. package/src/Icons/Social/Mastodon.tsx +36 -0
  190. package/src/Icons/Social/Slack.tsx +31 -0
  191. package/src/Icons/Social/X.tsx +16 -0
  192. package/{Icons/Social/index.js → src/Icons/Social/index.ts} +1 -0
  193. package/src/MDX/CodeTabs.tsx +47 -0
  194. package/src/global.d.ts +4 -0
  195. package/src/stylelint/__tests__/index.test.mjs +80 -0
  196. package/src/stylelint/one-utility-class-per-line.mjs +64 -0
  197. package/{stylelint → src/stylelint}/utils.mjs +25 -19
  198. package/src/styles/animations.css +47 -0
  199. package/src/styles/base.css +17 -0
  200. package/src/styles/effects.css +12 -0
  201. package/src/styles/index.css +38 -0
  202. package/src/styles/markdown.css +173 -0
  203. package/src/styles/theme.css +175 -0
  204. package/src/types.ts +25 -0
  205. package/tsconfig.json +20 -0
  206. package/turbo.json +31 -0
  207. package/Common/AlertBox/index.js +0 -5
  208. package/Common/AlertBox/index.module.css +0 -77
  209. package/Common/AvatarGroup/Avatar/index.js +0 -11
  210. package/Common/AvatarGroup/Avatar/index.module.css +0 -60
  211. package/Common/AvatarGroup/Overlay/index.js +0 -6
  212. package/Common/AvatarGroup/Overlay/index.module.css +0 -38
  213. package/Common/AvatarGroup/index.js +0 -21
  214. package/Common/AvatarGroup/index.module.css +0 -22
  215. package/Common/Badge/index.js +0 -7
  216. package/Common/Badge/index.module.css +0 -46
  217. package/Common/BadgeGroup/index.js +0 -6
  218. package/Common/BadgeGroup/index.module.css +0 -101
  219. package/Common/Banner/index.js +0 -4
  220. package/Common/Banner/index.module.css +0 -45
  221. package/Common/BaseActiveLink/index.js +0 -14
  222. package/Common/BaseButton/index.js +0 -10
  223. package/Common/BaseButton/index.module.css +0 -372
  224. package/Common/BaseCodeBox/index.js +0 -50
  225. package/Common/BaseCodeBox/index.module.css +0 -96
  226. package/Common/BaseCrossLink/index.js +0 -12
  227. package/Common/BaseCrossLink/index.module.css +0 -69
  228. package/Common/BaseLinkTabs/index.js +0 -5
  229. package/Common/BaseLinkTabs/index.module.css +0 -67
  230. package/Common/BasePagination/Ellipsis/index.js +0 -4
  231. package/Common/BasePagination/Ellipsis/index.module.css +0 -16
  232. package/Common/BasePagination/PaginationListItem/index.js +0 -6
  233. package/Common/BasePagination/PaginationListItem/index.module.css +0 -42
  234. package/Common/BasePagination/PrevNextArrow.js +0 -7
  235. package/Common/BasePagination/index.js +0 -10
  236. package/Common/BasePagination/index.module.css +0 -40
  237. package/Common/BasePagination/useGetPageElements.js +0 -77
  238. package/Common/Blockquote/index.js +0 -4
  239. package/Common/Blockquote/index.module.css +0 -50
  240. package/Common/Breadcrumbs/BreadcrumbHomeLink/index.js +0 -9
  241. package/Common/Breadcrumbs/BreadcrumbHomeLink/index.module.css +0 -5
  242. package/Common/Breadcrumbs/BreadcrumbItem/index.js +0 -6
  243. package/Common/Breadcrumbs/BreadcrumbItem/index.module.css +0 -52
  244. package/Common/Breadcrumbs/BreadcrumbLink/index.js +0 -5
  245. package/Common/Breadcrumbs/BreadcrumbLink/index.module.css +0 -32
  246. package/Common/Breadcrumbs/BreadcrumbRoot/index.js +0 -4
  247. package/Common/Breadcrumbs/BreadcrumbRoot/index.module.css +0 -10
  248. package/Common/Breadcrumbs/BreadcrumbTruncatedItem/index.js +0 -4
  249. package/Common/Breadcrumbs/index.js +0 -22
  250. package/Common/ChangeHistory/index.js +0 -9
  251. package/Common/ChangeHistory/index.module.css +0 -198
  252. package/Common/CodeTabs/index.js +0 -5
  253. package/Common/CodeTabs/index.module.css +0 -67
  254. package/Common/DataTag/index.js +0 -18
  255. package/Common/DataTag/index.module.css +0 -54
  256. package/Common/GlowingBackdrop/index.js +0 -5
  257. package/Common/GlowingBackdrop/index.module.css +0 -130
  258. package/Common/LanguageDropDown/index.js +0 -11
  259. package/Common/LanguageDropDown/index.module.css +0 -151
  260. package/Common/Modal/index.js +0 -10
  261. package/Common/Modal/index.module.css +0 -234
  262. package/Common/NodejsLogo/index.js +0 -7
  263. package/Common/NodejsLogo/index.module.css +0 -5
  264. package/Common/Notification/index.js +0 -6
  265. package/Common/Notification/index.module.css +0 -104
  266. package/Common/Preview/index.js +0 -7
  267. package/Common/Preview/index.module.css +0 -283
  268. package/Common/Select/index.js +0 -46
  269. package/Common/Select/index.module.css +0 -328
  270. package/Common/Separator/index.js +0 -7
  271. package/Common/Separator/index.module.css +0 -13
  272. package/Common/Skeleton/index.js +0 -18
  273. package/Common/Skeleton/index.module.css +0 -127
  274. package/Common/Tabs/index.js +0 -6
  275. package/Common/Tabs/index.module.css +0 -72
  276. package/Common/ThemeToggle/index.js +0 -7
  277. package/Common/ThemeToggle/index.module.css +0 -22
  278. package/Common/Tooltip/index.js +0 -8
  279. package/Common/Tooltip/index.module.css +0 -133
  280. package/Containers/Article/index.js +0 -4
  281. package/Containers/Article/index.module.css +0 -139
  282. package/Containers/DocSideBar/index.js +0 -1
  283. package/Containers/Footer/index.js +0 -22
  284. package/Containers/Footer/index.module.css +0 -61
  285. package/Containers/MetaBar/index.js +0 -12
  286. package/Containers/MetaBar/index.module.css +0 -123
  287. package/Containers/NavBar/NavItem/index.js +0 -7
  288. package/Containers/NavBar/NavItem/index.module.css +0 -74
  289. package/Containers/NavBar/index.js +0 -18
  290. package/Containers/NavBar/index.module.css +0 -205
  291. package/Containers/Sidebar/ProgressionIcon/index.js +0 -3
  292. package/Containers/Sidebar/SidebarGroup/index.js +0 -9
  293. package/Containers/Sidebar/SidebarGroup/index.module.css +0 -192
  294. package/Containers/Sidebar/SidebarItem/index.js +0 -11
  295. package/Containers/Sidebar/SidebarItem/index.module.css +0 -67
  296. package/Containers/Sidebar/index.js +0 -15
  297. package/Containers/Sidebar/index.module.css +0 -48
  298. package/Icons/HexagonGrid.js +0 -3
  299. package/Icons/InstallationMethod/Choco.js +0 -3
  300. package/Icons/InstallationMethod/Devbox.js +0 -3
  301. package/Icons/InstallationMethod/Docker.js +0 -3
  302. package/Icons/InstallationMethod/FNM.js +0 -3
  303. package/Icons/InstallationMethod/Homebrew.js +0 -3
  304. package/Icons/InstallationMethod/N.js +0 -5
  305. package/Icons/InstallationMethod/NVM.js +0 -3
  306. package/Icons/InstallationMethod/Volta.js +0 -3
  307. package/Icons/Logos/JsGreen.js +0 -3
  308. package/Icons/Logos/JsWhite.js +0 -3
  309. package/Icons/Logos/Nodejs.js +0 -6
  310. package/Icons/Logos/NodejsStackedBlack.js +0 -3
  311. package/Icons/Logos/NodejsStackedDark.js +0 -3
  312. package/Icons/Logos/NodejsStackedLight.js +0 -3
  313. package/Icons/Logos/NodejsStackedWhite.js +0 -3
  314. package/Icons/OperatingSystem/AIX.js +0 -3
  315. package/Icons/OperatingSystem/Apple.js +0 -3
  316. package/Icons/OperatingSystem/Linux.js +0 -3
  317. package/Icons/OperatingSystem/Microsoft.js +0 -3
  318. package/Icons/PackageManager/Npm.js +0 -3
  319. package/Icons/PackageManager/Pnpm.js +0 -3
  320. package/Icons/PackageManager/Yarn.js +0 -3
  321. package/Icons/Social/Bluesky.js +0 -3
  322. package/Icons/Social/Discord.js +0 -3
  323. package/Icons/Social/GitHub.js +0 -3
  324. package/Icons/Social/LinkedIn.js +0 -3
  325. package/Icons/Social/Mastodon.js +0 -3
  326. package/Icons/Social/Slack.js +0 -3
  327. package/Icons/Social/X.js +0 -3
  328. package/MDX/CodeTabs.js +0 -16
  329. package/stylelint/one-utility-class-per-line.mjs +0 -48
  330. package/styles/index.css +0 -1139
  331. package/types.js +0 -1
@@ -0,0 +1,83 @@
1
+ @reference "../../styles/index.css";
2
+
3
+ .summary {
4
+ @apply outline-hidden
5
+ flex
6
+ h-9
7
+ cursor-pointer
8
+ select-none
9
+ items-center
10
+ gap-2
11
+ rounded-md
12
+ border
13
+ border-neutral-200
14
+ p-2
15
+ text-sm
16
+ text-neutral-700
17
+ motion-safe:transition-colors
18
+ dark:border-neutral-900
19
+ dark:text-neutral-300;
20
+
21
+ &:hover,
22
+ &:focus-visible {
23
+ @apply bg-neutral-100
24
+ dark:bg-neutral-900;
25
+ }
26
+ }
27
+
28
+ .dropdownContentWrapper {
29
+ @apply absolute
30
+ right-0
31
+ top-full
32
+ z-50
33
+ mt-1
34
+ max-h-80
35
+ w-52
36
+ overflow-hidden
37
+ rounded-sm
38
+ border
39
+ border-neutral-200
40
+ bg-white
41
+ shadow-lg
42
+ dark:border-neutral-900
43
+ dark:bg-neutral-950;
44
+ }
45
+
46
+ .dropdownContentInner {
47
+ @apply max-h-80
48
+ w-52
49
+ overflow-y-auto;
50
+ }
51
+
52
+ .dropdownItem {
53
+ @apply outline-hidden
54
+ block
55
+ px-2.5
56
+ py-1.5
57
+ text-sm
58
+ font-medium
59
+ text-neutral-800
60
+ no-underline
61
+ motion-safe:transition-colors
62
+ dark:text-white;
63
+
64
+ &:hover,
65
+ &:focus-visible {
66
+ @apply bg-green-600
67
+ text-white;
68
+ }
69
+ }
70
+
71
+ .dropdownLabel {
72
+ @apply block
73
+ text-sm
74
+ font-medium
75
+ leading-tight;
76
+ }
77
+
78
+ .dropdownVersions {
79
+ @apply block
80
+ text-xs
81
+ leading-tight
82
+ opacity-75;
83
+ }
@@ -0,0 +1,130 @@
1
+ import type { Meta as MetaObj, StoryObj } from '@storybook/react';
2
+
3
+ import ChangeHistory from '#ui/Common/ChangeHistory';
4
+
5
+ type Story = StoryObj<typeof ChangeHistory>;
6
+ type Meta = MetaObj<typeof ChangeHistory>;
7
+
8
+ const SAMPLE_CHANGES = [
9
+ {
10
+ versions: ['v15.4.0'],
11
+ label: 'No longer experimental',
12
+ url: 'https://github.com/nodejs/node/pull/12345',
13
+ },
14
+ {
15
+ versions: ['v15.0.0', 'v14.17.0'],
16
+ label: 'Added in v15.0.0, v14.17.0',
17
+ url: 'https://github.com/nodejs/node/pull/67890',
18
+ },
19
+ {
20
+ versions: ['v16.0.0'],
21
+ label: 'Deprecated in 16',
22
+ },
23
+ ];
24
+
25
+ const LARGE_SAMPLE_CHANGES = [
26
+ {
27
+ versions: ['v20.0.0'],
28
+ label: 'Breaking change in v20',
29
+ url: 'https://github.com/nodejs/node/pull/50001',
30
+ },
31
+ {
32
+ versions: ['v19.8.0'],
33
+ label: 'Performance improvement',
34
+ url: 'https://github.com/nodejs/node/pull/49999',
35
+ },
36
+ {
37
+ versions: ['v19.0.0'],
38
+ label: 'API redesign',
39
+ url: 'https://github.com/nodejs/node/pull/49000',
40
+ },
41
+ {
42
+ versions: ['v18.17.0', 'v18.16.1'],
43
+ label: 'Security fix backported',
44
+ url: 'https://github.com/nodejs/node/pull/48500',
45
+ },
46
+ {
47
+ versions: ['v18.0.0'],
48
+ label: 'Major version release',
49
+ url: 'https://github.com/nodejs/node/pull/47000',
50
+ },
51
+ {
52
+ versions: ['v17.9.0'],
53
+ label: 'Experimental feature added',
54
+ url: 'https://github.com/nodejs/node/pull/46500',
55
+ },
56
+ {
57
+ versions: ['v17.0.0'],
58
+ label: 'Node.js 17 release',
59
+ url: 'https://github.com/nodejs/node/pull/45000',
60
+ },
61
+ {
62
+ versions: ['v16.15.0', 'v16.14.2'],
63
+ label: 'Bug fix release',
64
+ url: 'https://github.com/nodejs/node/pull/44000',
65
+ },
66
+ {
67
+ versions: ['v16.0.0'],
68
+ label: 'Deprecated in v16',
69
+ url: 'https://github.com/nodejs/node/pull/43000',
70
+ },
71
+ {
72
+ versions: ['v15.14.0'],
73
+ label: 'Feature enhancement',
74
+ url: 'https://github.com/nodejs/node/pull/42000',
75
+ },
76
+ {
77
+ versions: ['v15.0.0', 'v14.17.0'],
78
+ label: 'Initial implementation',
79
+ url: 'https://github.com/nodejs/node/pull/41000',
80
+ },
81
+ {
82
+ versions: ['v14.18.0'],
83
+ label: 'Documentation update',
84
+ url: 'https://github.com/nodejs/node/pull/40000',
85
+ },
86
+ {
87
+ versions: ['v14.0.0'],
88
+ label: 'Added to stable API',
89
+ url: 'https://github.com/nodejs/node/pull/39000',
90
+ },
91
+ {
92
+ versions: ['v13.14.0'],
93
+ label: 'Experimental flag removed',
94
+ url: 'https://github.com/nodejs/node/pull/38000',
95
+ },
96
+ {
97
+ versions: ['v12.22.0', 'v12.21.0'],
98
+ label: 'Backported to LTS',
99
+ url: 'https://github.com/nodejs/node/pull/37000',
100
+ },
101
+ {
102
+ versions: ['v12.0.0'],
103
+ label: 'First experimental version',
104
+ url: 'https://github.com/nodejs/node/pull/36000',
105
+ },
106
+ ];
107
+
108
+ export const Default: Story = {
109
+ render: args => (
110
+ <div className="right-0 flex justify-end">
111
+ <ChangeHistory {...args} />
112
+ </div>
113
+ ),
114
+ args: {
115
+ changes: SAMPLE_CHANGES,
116
+ },
117
+ };
118
+
119
+ export const LargeHistory: Story = {
120
+ render: args => (
121
+ <div className="right-0 flex justify-end">
122
+ <ChangeHistory {...args} />
123
+ </div>
124
+ ),
125
+ args: {
126
+ changes: LARGE_SAMPLE_CHANGES,
127
+ },
128
+ };
129
+
130
+ export default { component: ChangeHistory } as Meta;
@@ -0,0 +1,67 @@
1
+ import { ChevronDownIcon, ClockIcon } from '@heroicons/react/24/outline';
2
+ import classNames from 'classnames';
3
+ import type { FC, ComponentProps } from 'react';
4
+
5
+ import type { LinkLike } from '#ui/types.js';
6
+
7
+ import styles from './index.module.css';
8
+
9
+ export type HistoryChange = {
10
+ versions: Array<string>;
11
+ label: string;
12
+ url?: string;
13
+ };
14
+
15
+ type ChangeHistoryProps = ComponentProps<'div'> & {
16
+ label: string;
17
+ changes: Array<HistoryChange>;
18
+ as?: LinkLike;
19
+ };
20
+
21
+ const ChangeHistory: FC<ChangeHistoryProps> = ({
22
+ label = 'History',
23
+ changes = [],
24
+ className,
25
+ as: As = 'a',
26
+ 'aria-label': ariaLabel = label,
27
+ ...props
28
+ }) => (
29
+ <div className={classNames('relative', 'inline-block', className)} {...props}>
30
+ <details className="group">
31
+ <summary className={styles.summary} role="button" aria-haspopup="menu">
32
+ <ClockIcon className="size-4" />
33
+ <span>{label}</span>
34
+ <ChevronDownIcon className="size-3 group-open:rotate-180 motion-safe:transition-transform" />
35
+ </summary>
36
+ <div
37
+ className={styles.dropdownContentWrapper}
38
+ role="menu"
39
+ aria-label={ariaLabel}
40
+ >
41
+ <div className={styles.dropdownContentInner}>
42
+ {changes.map((change, index) => {
43
+ const MenuItem = change.url ? As : 'div';
44
+
45
+ return (
46
+ <MenuItem
47
+ key={index}
48
+ className={styles.dropdownItem}
49
+ role="menuitem"
50
+ tabIndex={0}
51
+ aria-label={`${change.label}: ${change.versions.join(', ')}`}
52
+ href={change.url}
53
+ >
54
+ <div className={styles.dropdownLabel}>{change.label}</div>
55
+ <div className={styles.dropdownVersions}>
56
+ {change.versions.join(', ')}
57
+ </div>
58
+ </MenuItem>
59
+ );
60
+ })}
61
+ </div>
62
+ </div>
63
+ </details>
64
+ </div>
65
+ );
66
+
67
+ export default ChangeHistory;
@@ -0,0 +1,56 @@
1
+ @reference "../../styles/index.css";
2
+
3
+ .root {
4
+ > [role='tabpanel'] > :first-child {
5
+ @apply rounded-t-none;
6
+ }
7
+
8
+ > div:nth-of-type(1) {
9
+ @apply flex
10
+ rounded-t
11
+ border-x
12
+ border-t
13
+ border-neutral-900
14
+ bg-neutral-950
15
+ px-2
16
+ pt-3
17
+ md:px-4;
18
+
19
+ .trigger {
20
+ @apply border-b
21
+ border-b-transparent
22
+ px-1
23
+ text-neutral-200;
24
+
25
+ &[data-state='active'] {
26
+ @apply border-b-green-400
27
+ text-green-400;
28
+ }
29
+ }
30
+
31
+ .link {
32
+ @apply hidden
33
+ items-center
34
+ gap-2
35
+ text-center
36
+ text-neutral-200
37
+ motion-safe:transition-colors
38
+ lg:flex;
39
+
40
+ & > .icon {
41
+ @apply size-4
42
+ text-neutral-300;
43
+ }
44
+
45
+ &:is(:link, :visited) {
46
+ &:hover {
47
+ @apply text-neutral-400;
48
+
49
+ & > .icon {
50
+ @apply text-neutral-600;
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,73 @@
1
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
2
+ import type { Meta as MetaObj, StoryObj } from '@storybook/react';
3
+ import type { FC } from 'react';
4
+
5
+ import BaseCodeBox from '#ui/Common/BaseCodeBox';
6
+ import CodeTabs from '#ui/Common/CodeTabs';
7
+
8
+ type Story = StoryObj<typeof CodeTabs>;
9
+ type Meta = MetaObj<typeof CodeTabs>;
10
+
11
+ const mjsContent = `import * as http from 'http';
12
+
13
+ const hostname = '127.0.0.1';
14
+ const port = 3000;
15
+
16
+ const server = http.createServer((req, res) => {
17
+ res.statusCode = 200;
18
+ res.setHeader('Content-Type', 'text/plain');
19
+ res.end('Hello World');
20
+ });
21
+
22
+ server.listen(port, hostname, () => {
23
+ console.log(\`Server running at http://\${hostname}:\${port}/\`);
24
+ });`;
25
+
26
+ const cjsContent = `const http = require('http');
27
+
28
+ const hostname = '127.0.0.1';
29
+ const port = 3000;
30
+
31
+ const server = http.createServer((req, res) => {
32
+ res.statusCode = 200;
33
+ res.setHeader('Content-Type', 'text/plain');
34
+ res.end('Hello World');
35
+ });
36
+
37
+ server.listen(port, hostname, () => {
38
+ console.log(\`Server running at http://\${hostname}:\${port}/\`);
39
+ });`;
40
+
41
+ const boxProps = {
42
+ onCopy: console.log,
43
+ buttonText: '[Button Text]',
44
+ };
45
+
46
+ const TabsContent: FC = () => (
47
+ <>
48
+ <TabsPrimitive.Content key="mjs" value="mjs">
49
+ <BaseCodeBox language="JavaScript (MJS)" {...boxProps}>
50
+ <code>{mjsContent}</code>
51
+ </BaseCodeBox>
52
+ </TabsPrimitive.Content>
53
+ <TabsPrimitive.Content key="cjs" value="cjs">
54
+ <BaseCodeBox language="JavaScript (CJS)" {...boxProps}>
55
+ <code>{cjsContent}</code>
56
+ </BaseCodeBox>
57
+ </TabsPrimitive.Content>
58
+ </>
59
+ );
60
+
61
+ export const Default: Story = {};
62
+
63
+ export default {
64
+ component: CodeTabs,
65
+ args: {
66
+ children: <TabsContent />,
67
+ defaultValue: 'mjs',
68
+ tabs: [
69
+ { key: 'mjs', label: 'MJS' },
70
+ { key: 'cjs', label: 'CJS' },
71
+ ],
72
+ },
73
+ } as Meta;
@@ -0,0 +1,16 @@
1
+ import type { ComponentProps, FC } from 'react';
2
+
3
+ import Tabs from '#ui/Common/Tabs';
4
+
5
+ import styles from './index.module.css';
6
+
7
+ type CodeTabsProps = Pick<
8
+ ComponentProps<typeof Tabs>,
9
+ 'tabs' | 'defaultValue' | 'children' | 'addons'
10
+ >;
11
+
12
+ const CodeTabs: FC<CodeTabsProps> = ({ ...props }) => (
13
+ <Tabs {...props} className={styles.root} triggerClassName={styles.trigger} />
14
+ );
15
+
16
+ export default CodeTabs;
@@ -0,0 +1,56 @@
1
+ @reference "../../styles/index.css";
2
+
3
+ .dataTag {
4
+ @apply flex
5
+ items-center
6
+ justify-center
7
+ rounded-full
8
+ font-semibold
9
+ text-white;
10
+
11
+ &.lg {
12
+ @apply size-12
13
+ text-2xl;
14
+ }
15
+
16
+ &.md {
17
+ @apply size-10
18
+ text-xl;
19
+ }
20
+
21
+ &.sm {
22
+ @apply size-8;
23
+ }
24
+
25
+ &.event {
26
+ @apply bg-accent1-600;
27
+ }
28
+
29
+ &.method {
30
+ @apply bg-info-600;
31
+ }
32
+
33
+ &.property {
34
+ @apply bg-green-600;
35
+ }
36
+
37
+ &.class {
38
+ @apply bg-warning-600;
39
+ }
40
+
41
+ &.module {
42
+ @apply bg-red-600;
43
+ }
44
+
45
+ &.classMethod {
46
+ @apply bg-blue-600;
47
+ }
48
+
49
+ &.ctor {
50
+ @apply bg-accent2-600;
51
+ }
52
+
53
+ &.global {
54
+ @apply bg-amber-600;
55
+ }
56
+ }
@@ -0,0 +1,40 @@
1
+ import type { Meta as MetaObj, StoryObj } from '@storybook/react';
2
+
3
+ import DataTag, { type DataTagProps } from '#ui/Common/DataTag';
4
+
5
+ type Story = StoryObj<typeof DataTag>;
6
+ type Meta = MetaObj<typeof DataTag>;
7
+
8
+ export const DataTags: Story = {
9
+ render: () => (
10
+ <div className="grid grid-cols-3 gap-6 p-6">
11
+ {[
12
+ 'event',
13
+ 'method',
14
+ 'property',
15
+ 'class',
16
+ 'module',
17
+ 'classMethod',
18
+ 'ctor',
19
+ 'global',
20
+ ]
21
+ .map(kind =>
22
+ ['sm', 'md', 'lg'].map(size => (
23
+ <div
24
+ key={`${kind}-${size}`}
25
+ className="flex justify-center"
26
+ title={kind}
27
+ >
28
+ <DataTag
29
+ kind={kind as DataTagProps['kind']}
30
+ size={size as DataTagProps['size']}
31
+ />
32
+ </div>
33
+ ))
34
+ )
35
+ .flat()}
36
+ </div>
37
+ ),
38
+ };
39
+
40
+ export default { component: DataTag } as Meta;
@@ -0,0 +1,39 @@
1
+ import classNames from 'classnames';
2
+ import type { FC } from 'react';
3
+
4
+ import styles from './index.module.css';
5
+
6
+ export type DataTagProps = {
7
+ kind:
8
+ | 'event'
9
+ | 'method'
10
+ | 'property'
11
+ | 'class'
12
+ | 'module'
13
+ | 'classMethod'
14
+ | 'global'
15
+ | 'ctor';
16
+ size?: 'lg' | 'md' | 'sm';
17
+ };
18
+
19
+ // These symbols match up with the types used in
20
+ // node core, and the ones defined at
21
+ // https://github.com/nodejs/api-docs-tooling/blob/main/src/types.d.ts#L22 (`HeadingMetadataEntry['type']`)
22
+ const symbolMap = {
23
+ event: 'E',
24
+ method: 'M',
25
+ property: 'P',
26
+ class: 'C',
27
+ module: 'M',
28
+ classMethod: 'S',
29
+ global: 'G',
30
+ ctor: 'C',
31
+ } as const;
32
+
33
+ const DataTag: FC<DataTagProps> = ({ kind, size = 'md' }) => (
34
+ <div className={classNames(styles.dataTag, styles[size], styles[kind])}>
35
+ <span>{symbolMap[kind]}</span>
36
+ </div>
37
+ );
38
+
39
+ export default DataTag;
@@ -0,0 +1,32 @@
1
+ @reference "../../styles/index.css";
2
+
3
+ .glowingBackdrop {
4
+ @apply absolute
5
+ left-0
6
+ top-0
7
+ -z-10
8
+ size-full
9
+ opacity-50
10
+ after:absolute
11
+ after:inset-0
12
+ after:m-auto
13
+ after:aspect-square
14
+ after:w-[300px]
15
+ after:rounded-full
16
+ after:bg-green-300
17
+ after:blur-[120px]
18
+ after:content-['']
19
+ md:opacity-100
20
+ dark:after:bg-green-700;
21
+
22
+ svg {
23
+ @apply absolute
24
+ inset-0
25
+ m-auto
26
+ aspect-[1.67]
27
+ max-w-[1004px]
28
+ object-cover
29
+ text-neutral-300
30
+ dark:text-neutral-900/75;
31
+ }
32
+ }
@@ -0,0 +1,10 @@
1
+ import type { Meta as MetaObj, StoryObj } from '@storybook/react';
2
+
3
+ import GlowingBackdrop from '#ui/Common/GlowingBackdrop';
4
+
5
+ type Story = StoryObj<typeof GlowingBackdrop>;
6
+ type Meta = MetaObj<typeof GlowingBackdrop>;
7
+
8
+ export const Default: Story = {};
9
+
10
+ export default { component: GlowingBackdrop } as Meta;
@@ -0,0 +1,13 @@
1
+ import type { FC } from 'react';
2
+
3
+ import HexagonGrid from '#ui/Icons/HexagonGrid';
4
+
5
+ import styles from './index.module.css';
6
+
7
+ const GlowingBackdrop: FC = () => (
8
+ <div className={styles.glowingBackdrop}>
9
+ <HexagonGrid />
10
+ </div>
11
+ );
12
+
13
+ export default GlowingBackdrop;
@@ -0,0 +1,53 @@
1
+ @reference "../../styles/index.css";
2
+
3
+ .languageDropdown {
4
+ @apply h-9
5
+ w-9
6
+ rounded-md
7
+ p-2
8
+ text-neutral-700
9
+ motion-safe:transition-colors
10
+ dark:text-neutral-300;
11
+
12
+ &:hover {
13
+ @apply bg-neutral-100
14
+ dark:bg-neutral-900;
15
+ }
16
+ }
17
+
18
+ .dropDownContent {
19
+ @apply max-h-80
20
+ w-48
21
+ overflow-hidden
22
+ rounded-sm
23
+ border
24
+ border-neutral-200
25
+ bg-white
26
+ shadow-lg
27
+ dark:border-neutral-900
28
+ dark:bg-neutral-950;
29
+
30
+ > div {
31
+ @apply max-h-80
32
+ w-48
33
+ overflow-y-auto;
34
+ }
35
+ }
36
+
37
+ .dropDownItem {
38
+ @apply outline-hidden
39
+ cursor-pointer
40
+ px-2.5
41
+ py-1.5
42
+ text-sm
43
+ font-medium
44
+ text-neutral-800
45
+ data-[highlighted]:bg-green-600
46
+ data-[highlighted]:text-white
47
+ dark:text-white;
48
+ }
49
+
50
+ .currentDropDown {
51
+ @apply bg-green-600
52
+ text-white;
53
+ }
@@ -0,0 +1,19 @@
1
+ import type { Meta as MetaObj, StoryObj } from '@storybook/react';
2
+
3
+ import LanguageDropDown from '#ui/Common/LanguageDropDown';
4
+
5
+ type Story = StoryObj<typeof LanguageDropDown>;
6
+ type Meta = MetaObj<typeof LanguageDropDown>;
7
+
8
+ export const Default: Story = {
9
+ args: {
10
+ availableLanguages: [
11
+ { name: 'English', code: 'en', localName: 'English' },
12
+ { name: 'French', code: 'fr', localName: 'Français' },
13
+ { name: 'Spanish', code: 'es', localName: 'Español' },
14
+ ],
15
+ currentLanguage: 'en',
16
+ },
17
+ };
18
+
19
+ export default { component: LanguageDropDown } as Meta;