@node-core/ui-components 0.0.1 → 1.0.1-df203d0fe21ee5d80d258c60dc821e8ac0601ce4

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 (186) hide show
  1. package/Common/AlertBox/index.module.css +76 -0
  2. package/Common/AlertBox/index.stories.tsx +73 -0
  3. package/Common/AlertBox/index.tsx +24 -0
  4. package/Common/AvatarGroup/Avatar/index.module.css +40 -0
  5. package/Common/AvatarGroup/Avatar/index.stories.tsx +22 -0
  6. package/Common/AvatarGroup/Avatar/index.tsx +67 -0
  7. package/Common/AvatarGroup/Overlay/index.module.css +31 -0
  8. package/Common/AvatarGroup/Overlay/index.stories.tsx +33 -0
  9. package/Common/AvatarGroup/Overlay/index.tsx +37 -0
  10. package/Common/AvatarGroup/__tests__/index.test.jsx +55 -0
  11. package/Common/AvatarGroup/index.module.css +25 -0
  12. package/Common/AvatarGroup/index.stories.tsx +56 -0
  13. package/Common/AvatarGroup/index.tsx +87 -0
  14. package/Common/Badge/index.module.css +38 -0
  15. package/Common/Badge/index.stories.tsx +38 -0
  16. package/Common/Badge/index.tsx +35 -0
  17. package/Common/BadgeGroup/index.module.css +77 -0
  18. package/Common/BadgeGroup/index.stories.tsx +35 -0
  19. package/Common/BadgeGroup/index.tsx +35 -0
  20. package/Common/Banner/index.module.css +42 -0
  21. package/Common/Banner/index.stories.tsx +29 -0
  22. package/Common/Banner/index.tsx +18 -0
  23. package/Common/BaseActiveLink/__tests__/index.test.jsx +52 -0
  24. package/Common/BaseActiveLink/index.tsx +34 -0
  25. package/Common/BaseButton/index.module.css +142 -0
  26. package/Common/BaseButton/index.stories.tsx +67 -0
  27. package/Common/BaseButton/index.tsx +59 -0
  28. package/Common/BaseCodeBox/index.module.css +84 -0
  29. package/Common/BaseCodeBox/index.stories.tsx +39 -0
  30. package/Common/BaseCodeBox/index.tsx +133 -0
  31. package/Common/BaseCrossLink/index.module.css +51 -0
  32. package/Common/BaseCrossLink/index.stories.tsx +38 -0
  33. package/Common/BaseCrossLink/index.tsx +46 -0
  34. package/Common/BaseLinkTabs/index.module.css +43 -0
  35. package/Common/BaseLinkTabs/index.stories.tsx +34 -0
  36. package/Common/BaseLinkTabs/index.tsx +53 -0
  37. package/Common/BasePagination/Ellipsis/index.module.css +10 -0
  38. package/Common/BasePagination/Ellipsis/index.stories.tsx +10 -0
  39. package/Common/BasePagination/Ellipsis/index.tsx +11 -0
  40. package/Common/BasePagination/PaginationListItem/__tests__/index.test.jsx +58 -0
  41. package/Common/BasePagination/PaginationListItem/index.module.css +27 -0
  42. package/Common/BasePagination/PaginationListItem/index.stories.tsx +40 -0
  43. package/Common/BasePagination/PaginationListItem/index.tsx +39 -0
  44. package/Common/BasePagination/PrevNextArrow.tsx +15 -0
  45. package/Common/BasePagination/__tests__/index.test.jsx +180 -0
  46. package/Common/BasePagination/index.module.css +39 -0
  47. package/Common/BasePagination/index.stories.tsx +67 -0
  48. package/Common/BasePagination/index.tsx +77 -0
  49. package/Common/BasePagination/useGetPageElements.tsx +132 -0
  50. package/Common/Blockquote/index.module.css +29 -0
  51. package/Common/Blockquote/index.stories.tsx +45 -0
  52. package/Common/Blockquote/index.tsx +11 -0
  53. package/Common/Breadcrumbs/BreadcrumbHomeLink/index.module.css +5 -0
  54. package/Common/Breadcrumbs/BreadcrumbHomeLink/index.tsx +30 -0
  55. package/Common/Breadcrumbs/BreadcrumbItem/index.module.css +41 -0
  56. package/Common/Breadcrumbs/BreadcrumbItem/index.tsx +42 -0
  57. package/Common/Breadcrumbs/BreadcrumbLink/index.module.css +22 -0
  58. package/Common/Breadcrumbs/BreadcrumbLink/index.tsx +37 -0
  59. package/Common/Breadcrumbs/BreadcrumbRoot/index.module.css +9 -0
  60. package/Common/Breadcrumbs/BreadcrumbRoot/index.tsx +20 -0
  61. package/Common/Breadcrumbs/BreadcrumbTruncatedItem/index.tsx +9 -0
  62. package/Common/Breadcrumbs/index.stories.tsx +94 -0
  63. package/Common/Breadcrumbs/index.tsx +81 -0
  64. package/Common/CodeTabs/index.module.css +56 -0
  65. package/Common/CodeTabs/index.stories.tsx +74 -0
  66. package/Common/CodeTabs/index.tsx +16 -0
  67. package/Common/GlowingBackdrop/index.module.css +32 -0
  68. package/Common/GlowingBackdrop/index.stories.tsx +10 -0
  69. package/Common/GlowingBackdrop/index.tsx +13 -0
  70. package/Common/LanguageDropDown/index.module.css +53 -0
  71. package/Common/LanguageDropDown/index.stories.tsx +19 -0
  72. package/Common/LanguageDropDown/index.tsx +56 -0
  73. package/Common/Modal/index.module.css +79 -0
  74. package/Common/Modal/index.stories.tsx +32 -0
  75. package/Common/Modal/index.tsx +48 -0
  76. package/Common/NodejsLogo/index.module.css +6 -0
  77. package/Common/NodejsLogo/index.stories.tsx +14 -0
  78. package/Common/NodejsLogo/index.tsx +26 -0
  79. package/Common/Notification/index.module.css +20 -0
  80. package/Common/Notification/index.stories.tsx +36 -0
  81. package/Common/Notification/index.tsx +34 -0
  82. package/Common/Preview/index.module.css +79 -0
  83. package/Common/Preview/index.stories.tsx +44 -0
  84. package/Common/Preview/index.tsx +25 -0
  85. package/Common/ProgressionSidebar/ProgressionSidebarGroup/index.module.css +47 -0
  86. package/Common/ProgressionSidebar/ProgressionSidebarGroup/index.tsx +35 -0
  87. package/Common/ProgressionSidebar/ProgressionSidebarIcon/index.tsx +16 -0
  88. package/Common/ProgressionSidebar/ProgressionSidebarItem/index.module.css +39 -0
  89. package/Common/ProgressionSidebar/ProgressionSidebarItem/index.tsx +32 -0
  90. package/Common/ProgressionSidebar/index.module.css +30 -0
  91. package/Common/ProgressionSidebar/index.stories.tsx +79 -0
  92. package/Common/ProgressionSidebar/index.tsx +59 -0
  93. package/Common/Select/__tests__/index.test.jsx +67 -0
  94. package/Common/Select/index.module.css +161 -0
  95. package/Common/Select/index.stories.tsx +111 -0
  96. package/Common/Select/index.tsx +187 -0
  97. package/Common/Separator/index.module.css +16 -0
  98. package/Common/Separator/index.stories.tsx +32 -0
  99. package/Common/Separator/index.tsx +27 -0
  100. package/Common/Skeleton/index.module.css +30 -0
  101. package/Common/Skeleton/index.tsx +39 -0
  102. package/Common/Tabs/__tests__/index.test.jsx +52 -0
  103. package/Common/Tabs/index.module.css +54 -0
  104. package/Common/Tabs/index.stories.tsx +50 -0
  105. package/Common/Tabs/index.tsx +54 -0
  106. package/Common/ThemeToggle/__tests__/index.test.jsx +35 -0
  107. package/Common/ThemeToggle/index.module.css +15 -0
  108. package/Common/ThemeToggle/index.stories.tsx +10 -0
  109. package/Common/ThemeToggle/index.tsx +15 -0
  110. package/Common/Tooltip/index.module.css +43 -0
  111. package/Common/Tooltip/index.stories.tsx +73 -0
  112. package/Common/Tooltip/index.tsx +48 -0
  113. package/Containers/Article/index.module.css +70 -0
  114. package/Containers/Article/index.stories.tsx +39 -0
  115. package/Containers/Article/index.tsx +9 -0
  116. package/Containers/Footer/index.module.css +46 -0
  117. package/Containers/Footer/index.stories.tsx +27 -0
  118. package/Containers/Footer/index.tsx +95 -0
  119. package/Containers/MetaBar/__tests__/index.test.jsx +63 -0
  120. package/Containers/MetaBar/index.module.css +91 -0
  121. package/Containers/MetaBar/index.stories.tsx +80 -0
  122. package/Containers/MetaBar/index.tsx +72 -0
  123. package/Containers/NavBar/NavItem/index.module.css +60 -0
  124. package/Containers/NavBar/NavItem/index.stories.tsx +38 -0
  125. package/Containers/NavBar/NavItem/index.tsx +44 -0
  126. package/Containers/NavBar/index.module.css +125 -0
  127. package/Containers/NavBar/index.stories.tsx +45 -0
  128. package/Containers/NavBar/index.tsx +94 -0
  129. package/Containers/Sidebar/SidebarGroup/index.module.css +26 -0
  130. package/Containers/Sidebar/SidebarGroup/index.stories.tsx +36 -0
  131. package/Containers/Sidebar/SidebarGroup/index.tsx +30 -0
  132. package/Containers/Sidebar/SidebarItem/index.module.css +35 -0
  133. package/Containers/Sidebar/SidebarItem/index.stories.tsx +15 -0
  134. package/Containers/Sidebar/SidebarItem/index.tsx +26 -0
  135. package/Containers/Sidebar/index.module.css +31 -0
  136. package/Containers/Sidebar/index.stories.tsx +84 -0
  137. package/Containers/Sidebar/index.tsx +58 -0
  138. package/Icons/HexagonGrid.stories.tsx +10 -0
  139. package/Icons/HexagonGrid.tsx +1434 -0
  140. package/Icons/InstallationMethod/Choco.tsx +78 -0
  141. package/Icons/InstallationMethod/Devbox.tsx +21 -0
  142. package/Icons/InstallationMethod/Docker.tsx +20 -0
  143. package/Icons/InstallationMethod/FNM.tsx +132 -0
  144. package/Icons/InstallationMethod/Homebrew.tsx +69 -0
  145. package/Icons/InstallationMethod/N.tsx +32 -0
  146. package/Icons/InstallationMethod/NVM.tsx +63 -0
  147. package/Icons/InstallationMethod/Volta.tsx +34 -0
  148. package/Icons/InstallationMethod/index.ts +10 -0
  149. package/Icons/Logos/JsGreen.tsx +24 -0
  150. package/Icons/Logos/JsWhite.tsx +37 -0
  151. package/Icons/Logos/Nodejs.tsx +188 -0
  152. package/Icons/Logos/NodejsStackedBlack.tsx +98 -0
  153. package/Icons/Logos/NodejsStackedDark.tsx +124 -0
  154. package/Icons/Logos/NodejsStackedLight.tsx +123 -0
  155. package/Icons/Logos/NodejsStackedWhite.tsx +98 -0
  156. package/Icons/Logos/index.ts +17 -0
  157. package/Icons/OperatingSystem/AIX.tsx +46 -0
  158. package/Icons/OperatingSystem/Apple.tsx +23 -0
  159. package/Icons/OperatingSystem/Linux.tsx +969 -0
  160. package/Icons/OperatingSystem/Microsoft.tsx +19 -0
  161. package/Icons/OperatingSystem/index.ts +6 -0
  162. package/Icons/PackageManager/Npm.tsx +21 -0
  163. package/Icons/PackageManager/Pnpm.tsx +22 -0
  164. package/Icons/PackageManager/Yarn.tsx +22 -0
  165. package/Icons/PackageManager/index.ts +5 -0
  166. package/Icons/Social/Bluesky.tsx +19 -0
  167. package/Icons/Social/Discord.tsx +20 -0
  168. package/Icons/Social/GitHub.tsx +16 -0
  169. package/Icons/Social/LinkedIn.tsx +16 -0
  170. package/Icons/Social/Mastodon.tsx +36 -0
  171. package/Icons/Social/Slack.tsx +31 -0
  172. package/Icons/Social/X.tsx +16 -0
  173. package/Icons/Social/index.ts +9 -0
  174. package/LICENSE +21 -0
  175. package/package.json +89 -5
  176. package/stylelint/__tests__/index.test.mjs +80 -0
  177. package/stylelint/one-utility-class-per-line.mjs +64 -0
  178. package/stylelint/utils.mjs +53 -0
  179. package/styles/animations.css +47 -0
  180. package/styles/base.css +17 -0
  181. package/styles/effects.css +12 -0
  182. package/styles/index.css +38 -0
  183. package/styles/markdown.css +173 -0
  184. package/styles/theme.css +175 -0
  185. package/types.ts +25 -0
  186. package/README.md +0 -1
@@ -0,0 +1,79 @@
1
+ @reference "../../styles/index.css";
2
+
3
+ .overlay {
4
+ @apply fixed
5
+ inset-0
6
+ flex
7
+ justify-center
8
+ bg-white/40
9
+ backdrop-blur-[2px]
10
+ dark:bg-neutral-950/40;
11
+
12
+ .content {
13
+ @apply xs:p-6
14
+ relative
15
+ m-4
16
+ inline-flex
17
+ w-full
18
+ max-w-3xl
19
+ flex-col
20
+ overflow-y-auto
21
+ rounded
22
+ border
23
+ border-neutral-200
24
+ bg-white
25
+ p-8
26
+ focus:outline-none
27
+ sm:my-20
28
+ xl:p-12
29
+ dark:bg-neutral-950;
30
+ }
31
+
32
+ .close {
33
+ @apply absolute
34
+ right-3
35
+ top-3
36
+ block
37
+ size-7
38
+ cursor-pointer
39
+ rounded-sm
40
+ p-1
41
+ hover:bg-neutral-100
42
+ focus:outline-none
43
+ focus:ring-2
44
+ focus:ring-neutral-200
45
+ dark:hover:bg-neutral-900
46
+ dark:focus:ring-neutral-900;
47
+ }
48
+
49
+ .title {
50
+ @apply mb-2
51
+ text-3xl
52
+ font-semibold
53
+ text-neutral-900
54
+ dark:text-white;
55
+ }
56
+
57
+ .description {
58
+ @apply font-regular
59
+ mb-4
60
+ text-lg
61
+ text-neutral-800
62
+ dark:text-neutral-200;
63
+ }
64
+
65
+ .wrapper {
66
+ @apply flex
67
+ flex-col
68
+ gap-4;
69
+
70
+ pre {
71
+ @apply overflow-auto;
72
+ }
73
+
74
+ code,
75
+ a {
76
+ @apply break-words;
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,32 @@
1
+ import type { Meta as MetaObj, StoryObj } from '@storybook/react';
2
+
3
+ import Modal from '#ui/Common/Modal';
4
+
5
+ type Story = StoryObj<typeof Modal>;
6
+ type Meta = MetaObj<typeof Modal>;
7
+
8
+ export const Default: Story = {
9
+ args: {
10
+ open: true,
11
+ heading: 'Node.js Versions Information',
12
+ subheading: 'Get all information about Node.js versions and their changes.',
13
+ children: (
14
+ <>
15
+ <p>
16
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto
17
+ atque sint doloremque, sapiente recusandae debitis libero nostrum
18
+ repudiandae explicabo suscipit ipsam eos dolorem, necessitatibus odit
19
+ quos delectus natus sunt sit!
20
+ </p>
21
+ <p>
22
+ Lorem ipsum dolor sit amet consectetur, adipisicing elit. Earum
23
+ asperiores corporis tempore neque, officiis fuga est facere deserunt
24
+ amet minus sit architecto blanditiis hic sed odit cumque numquam
25
+ dignissimos delectus.
26
+ </p>
27
+ </>
28
+ ),
29
+ },
30
+ };
31
+
32
+ export default { component: Modal } as Meta;
@@ -0,0 +1,48 @@
1
+ 'use client';
2
+
3
+ import { XMarkIcon } from '@heroicons/react/24/outline';
4
+ import * as Dialog from '@radix-ui/react-dialog';
5
+ import type { FC, PropsWithChildren } from 'react';
6
+
7
+ import styles from './index.module.css';
8
+
9
+ type ModalProps = PropsWithChildren<{
10
+ heading: string;
11
+ subheading?: string;
12
+ open?: boolean;
13
+ onOpenChange?: (open: boolean) => void;
14
+ }>;
15
+
16
+ const Modal: FC<ModalProps> = ({
17
+ heading,
18
+ subheading,
19
+ children,
20
+ open = false,
21
+ onOpenChange = () => {},
22
+ }) => (
23
+ <Dialog.Root open={open} onOpenChange={onOpenChange}>
24
+ <Dialog.Portal>
25
+ <Dialog.Overlay className={styles.overlay}>
26
+ <Dialog.Content className={styles.content}>
27
+ <Dialog.Trigger className={styles.close}>
28
+ <XMarkIcon />
29
+ </Dialog.Trigger>
30
+
31
+ <Dialog.Title className={styles.title}>{heading}</Dialog.Title>
32
+
33
+ {subheading && (
34
+ <Dialog.Description className={styles.description}>
35
+ {subheading}
36
+ </Dialog.Description>
37
+ )}
38
+
39
+ <main className={styles.wrapper}>{children}</main>
40
+
41
+ <Dialog.Close />
42
+ </Dialog.Content>
43
+ </Dialog.Overlay>
44
+ </Dialog.Portal>
45
+ </Dialog.Root>
46
+ );
47
+
48
+ export default Modal;
@@ -0,0 +1,6 @@
1
+ @reference "../../styles/index.css";
2
+
3
+ .nodejsLogo {
4
+ @apply h-6
5
+ w-20;
6
+ }
@@ -0,0 +1,14 @@
1
+ import type { Meta as MetaObj, StoryObj } from '@storybook/react';
2
+
3
+ import NodejsLogo from '#ui/Common/NodejsLogo';
4
+
5
+ type Story = StoryObj<typeof NodejsLogo>;
6
+ type Meta = MetaObj<typeof NodejsLogo>;
7
+
8
+ export const Default: Story = {};
9
+
10
+ export const WithPride: Story = {
11
+ args: { variant: 'pride' },
12
+ };
13
+
14
+ export default { component: NodejsLogo } as Meta;
@@ -0,0 +1,26 @@
1
+ import type { FC } from 'react';
2
+
3
+ import NodejsIcon from '#ui/Icons/Logos/Nodejs';
4
+ import type { LogoVariant } from '#ui/types';
5
+
6
+ import style from './index.module.css';
7
+
8
+ type NodejsLogoProps = {
9
+ variant?: LogoVariant;
10
+ ariaLabel?: string;
11
+ };
12
+
13
+ const NodejsLogo: FC<NodejsLogoProps> = ({
14
+ variant = 'default',
15
+ ariaLabel,
16
+ }) => {
17
+ return (
18
+ <NodejsIcon
19
+ variant={variant}
20
+ className={style.nodejsLogo}
21
+ ariaLabel={ariaLabel}
22
+ />
23
+ );
24
+ };
25
+
26
+ export default NodejsLogo;
@@ -0,0 +1,20 @@
1
+ @reference "../../styles/index.css";
2
+
3
+ .root {
4
+ @apply m-6
5
+ rounded-sm
6
+ border
7
+ border-neutral-200
8
+ bg-white
9
+ px-4
10
+ py-3
11
+ shadow-lg
12
+ dark:border-neutral-800
13
+ dark:bg-neutral-900;
14
+ }
15
+
16
+ .message {
17
+ @apply font-medium
18
+ text-green-600
19
+ dark:text-white;
20
+ }
@@ -0,0 +1,36 @@
1
+ import { CodeBracketIcon } from '@heroicons/react/24/solid';
2
+ import type { Meta as MetaObj, StoryObj } from '@storybook/react';
3
+
4
+ import Notification from '#ui/Common/Notification';
5
+
6
+ type Story = StoryObj<typeof Notification>;
7
+ type Meta = MetaObj<typeof Notification>;
8
+
9
+ export const Default: Story = {
10
+ args: {
11
+ open: true,
12
+ duration: 5000,
13
+ children: 'Copied to clipboard!',
14
+ },
15
+ };
16
+
17
+ export const TimedNotification: Story = {
18
+ args: {
19
+ duration: 5000,
20
+ children: 'Copied to clipboard!',
21
+ },
22
+ };
23
+
24
+ export const WithJSX: Story = {
25
+ args: {
26
+ open: true,
27
+ children: (
28
+ <div className="flex items-center gap-3">
29
+ <CodeBracketIcon className="h-4 w-4" />
30
+ Copied to clipboard!
31
+ </div>
32
+ ),
33
+ },
34
+ };
35
+
36
+ export default { component: Notification } as Meta;
@@ -0,0 +1,34 @@
1
+ import * as ToastPrimitive from '@radix-ui/react-toast';
2
+ import classNames from 'classnames';
3
+ import type { FC } from 'react';
4
+
5
+ import styles from './index.module.css';
6
+
7
+ type NotificationProps = {
8
+ open?: boolean;
9
+ duration?: number;
10
+ onChange?: (value: boolean) => void;
11
+ children?: React.ReactNode;
12
+ className?: string;
13
+ };
14
+
15
+ const Notification: FC<NotificationProps> = ({
16
+ open,
17
+ duration = 5000,
18
+ onChange,
19
+ children,
20
+ className,
21
+ }: NotificationProps) => (
22
+ <ToastPrimitive.Root
23
+ open={open}
24
+ duration={duration}
25
+ onOpenChange={onChange}
26
+ className={classNames(styles.root, className)}
27
+ >
28
+ <ToastPrimitive.Title className={styles.message}>
29
+ {children}
30
+ </ToastPrimitive.Title>
31
+ </ToastPrimitive.Root>
32
+ );
33
+
34
+ export default Notification;
@@ -0,0 +1,79 @@
1
+ @reference "../../styles/index.css";
2
+
3
+ .root {
4
+ @apply after:bg-gradient-radial
5
+ @container/preview
6
+ relative
7
+ flex
8
+ aspect-[1.90/1]
9
+ items-center
10
+ rounded-sm
11
+ border
12
+ border-neutral-900
13
+ bg-neutral-950
14
+ after:absolute
15
+ after:inset-0
16
+ after:m-auto
17
+ after:aspect-square
18
+ after:w-1/3
19
+ after:rounded-full
20
+ after:blur-2xl
21
+ after:content-[''];
22
+
23
+ &.announcements {
24
+ @apply after:from-green-700/90;
25
+ }
26
+
27
+ &.release {
28
+ @apply after:from-info-600/90;
29
+ }
30
+
31
+ &.vulnerability {
32
+ @apply after:from-warning-600/90;
33
+ }
34
+
35
+ .container {
36
+ @apply @sm/preview:text-base
37
+ @md/preview:gap-6
38
+ @md/preview:text-lg
39
+ @lg/preview:gap-8
40
+ @lg/preview:text-xl
41
+ @xl/preview:gap-12
42
+ @xl/preview:text-2xl
43
+ @2xl/preview:text-3xl
44
+ z-10
45
+ mx-auto
46
+ flex
47
+ w-2/3
48
+ max-w-xl
49
+ flex-col
50
+ gap-4
51
+ text-center
52
+ text-xs
53
+ font-semibold
54
+ text-white;
55
+
56
+ .hexagon {
57
+ @apply @md/preview:h-3/5
58
+ @md/preview:w-3/5
59
+ @lg/preview:h-2/3
60
+ @lg/preview:w-2/3
61
+ @xl/preview:h-3/5
62
+ @xl/preview:w-3/5
63
+ @2xl/preview:h-2/3
64
+ @2xl/preview:w-2/3
65
+ absolute
66
+ inset-0
67
+ m-auto
68
+ size-full;
69
+ }
70
+
71
+ .logo {
72
+ @apply @md/preview:size-14
73
+ @lg/preview:size-16
74
+ @xl/preview:size-20
75
+ mx-auto
76
+ size-6;
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,44 @@
1
+ import type { Meta as MetaObj, StoryObj } from '@storybook/react';
2
+
3
+ import Preview from '#ui/Common/Preview';
4
+
5
+ type Story = StoryObj<typeof Preview>;
6
+ type Meta = MetaObj<typeof Preview>;
7
+
8
+ export const Announcement: Story = {
9
+ args: {
10
+ type: 'announcements',
11
+ title:
12
+ 'Changing the End-of-Life Date for Node.js 16 to September 11th, 2023',
13
+ },
14
+ };
15
+
16
+ export const Release: Story = {
17
+ args: {
18
+ type: 'release',
19
+ title: 'Node v20.5.0 (Current)',
20
+ },
21
+ };
22
+
23
+ export const Vulnerability: Story = {
24
+ args: {
25
+ type: 'vulnerability',
26
+ title: 'OpenSSL update assessment, and Node.js project plans',
27
+ },
28
+ };
29
+
30
+ export const CustomSize: Story = {
31
+ args: {
32
+ title:
33
+ 'Changing the End-of-Life Date for Node.js 16 to September 11th, 2023',
34
+ },
35
+ decorators: [
36
+ Story => (
37
+ <div className="w-[600px]">
38
+ <Story />
39
+ </div>
40
+ ),
41
+ ],
42
+ };
43
+
44
+ export default { component: Preview } as Meta;
@@ -0,0 +1,25 @@
1
+ import classNames from 'classnames';
2
+ import type { FC } from 'react';
3
+
4
+ import HexagonGrid from '#ui/Icons/HexagonGrid';
5
+ import JsWhiteIcon from '#ui/Icons/Logos/JsWhite';
6
+ import type { BlogPreviewType } from '#ui/types';
7
+
8
+ import styles from './index.module.css';
9
+
10
+ type PreviewProps = {
11
+ title: string;
12
+ type?: BlogPreviewType;
13
+ };
14
+
15
+ const Preview: FC<PreviewProps> = ({ type = 'announcements', title }) => (
16
+ <div className={classNames(styles.root, styles[type])}>
17
+ <div className={styles.container} aria-hidden={true}>
18
+ <HexagonGrid className={styles.hexagon} />
19
+ <JsWhiteIcon className={styles.logo} />
20
+ {title}
21
+ </div>
22
+ </div>
23
+ );
24
+
25
+ export default Preview;
@@ -0,0 +1,47 @@
1
+ @reference "../../../styles/index.css";
2
+
3
+ .group {
4
+ @apply flex
5
+ flex-col
6
+ gap-4
7
+ text-sm
8
+ font-medium
9
+ text-neutral-800
10
+ dark:text-neutral-200;
11
+
12
+ .items {
13
+ @apply relative
14
+ -left-1
15
+ flex
16
+ flex-col
17
+ gap-2
18
+ after:absolute
19
+ after:left-[0.45rem]
20
+ after:top-0
21
+ after:z-10
22
+ after:h-full
23
+ after:w-px
24
+ after:bg-neutral-200
25
+ after:content-['']
26
+ dark:after:bg-neutral-800;
27
+
28
+ a {
29
+ @apply first:before:absolute
30
+ first:before:bottom-[calc(50%+0.25rem)]
31
+ first:before:left-0
32
+ first:before:h-20
33
+ first:before:w-4
34
+ first:before:bg-white
35
+ first:before:content-['']
36
+ last:after:absolute
37
+ last:after:left-0
38
+ last:after:top-[calc(50%+0.25rem)]
39
+ last:after:h-20
40
+ last:after:w-4
41
+ last:after:bg-white
42
+ last:after:content-['']
43
+ first:dark:before:bg-neutral-950
44
+ last:dark:after:bg-neutral-950;
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,35 @@
1
+ import type { ComponentProps, FC } from 'react';
2
+
3
+ import ProgressionSidebarItem from '#ui/Common/ProgressionSidebar/ProgressionSidebarItem';
4
+ import type { FormattedMessage, LinkLike } from '#ui/types';
5
+
6
+ import styles from './index.module.css';
7
+
8
+ type ProgressionSidebarGroupProps = {
9
+ groupName: FormattedMessage;
10
+ items: Array<ComponentProps<typeof ProgressionSidebarItem>>;
11
+ pathname?: string;
12
+ as?: LinkLike;
13
+ };
14
+
15
+ const ProgressionSidebarGroup: FC<ProgressionSidebarGroupProps> = ({
16
+ groupName,
17
+ items,
18
+ ...props
19
+ }) => (
20
+ <section className={styles.group}>
21
+ {groupName}
22
+ <div className={styles.items}>
23
+ {items.map(({ label, link }) => (
24
+ <ProgressionSidebarItem
25
+ key={link}
26
+ label={label}
27
+ link={link}
28
+ {...props}
29
+ />
30
+ ))}
31
+ </div>
32
+ </section>
33
+ );
34
+
35
+ export default ProgressionSidebarGroup;
@@ -0,0 +1,16 @@
1
+ import type { FC, SVGAttributes } from 'react';
2
+
3
+ const ProgressionSidebarIcon: FC<SVGAttributes<SVGSVGElement>> = props => (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ width="16"
7
+ height="18"
8
+ viewBox="0 0 16 18"
9
+ fill="none"
10
+ {...props}
11
+ >
12
+ <path d="M9 3.26795L8 2.6906L7 3.26795L3.5359 5.26795L2.5359 5.8453V7V11V12.1547L3.5359 12.7321L7 14.7321L8 15.3094L9 14.7321L12.4641 12.7321L13.4641 12.1547V11V7V5.8453L12.4641 5.26795L9 3.26795Z" />
13
+ </svg>
14
+ );
15
+
16
+ export default ProgressionSidebarIcon;
@@ -0,0 +1,39 @@
1
+ @reference "../../../styles/index.css";
2
+
3
+ a.item {
4
+ @apply font-regular
5
+ relative
6
+ z-20
7
+ flex
8
+ w-full
9
+ items-center
10
+ gap-1
11
+ overflow-hidden
12
+ text-sm
13
+ text-neutral-800
14
+ dark:text-neutral-200;
15
+
16
+ &:hover {
17
+ @apply text-neutral-900
18
+ motion-safe:transition-colors
19
+ dark:text-white;
20
+ }
21
+
22
+ svg {
23
+ @apply shrink-0
24
+ fill-neutral-200
25
+ stroke-white
26
+ stroke-[4]
27
+ dark:fill-neutral-800
28
+ dark:stroke-neutral-950;
29
+ }
30
+
31
+ &.active {
32
+ @apply text-neutral-900
33
+ dark:text-white;
34
+
35
+ svg {
36
+ @apply fill-green-500;
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,32 @@
1
+ import type { FC } from 'react';
2
+
3
+ import BaseActiveLink from '#ui/Common/BaseActiveLink';
4
+ import ProgressionSidebarIcon from '#ui/Common/ProgressionSidebar/ProgressionSidebarIcon';
5
+ import type { FormattedMessage, LinkLike } from '#ui/types';
6
+
7
+ import styles from './index.module.css';
8
+
9
+ type ProgressionSidebarItemProps = {
10
+ label: FormattedMessage;
11
+ link: string;
12
+ as?: LinkLike;
13
+ pathname?: string;
14
+ };
15
+
16
+ const ProgressionSidebarItem: FC<ProgressionSidebarItemProps> = ({
17
+ label,
18
+ link,
19
+ ...props
20
+ }) => (
21
+ <BaseActiveLink
22
+ className={styles.item}
23
+ activeClassName={styles.active}
24
+ href={link}
25
+ {...props}
26
+ >
27
+ <ProgressionSidebarIcon />
28
+ {label}
29
+ </BaseActiveLink>
30
+ );
31
+
32
+ export default ProgressionSidebarItem;
@@ -0,0 +1,30 @@
1
+ @reference "../../styles/index.css";
2
+
3
+ .wrapper {
4
+ @apply flex
5
+ w-full
6
+ flex-col
7
+ gap-8
8
+ overflow-auto
9
+ border-r-0
10
+ border-neutral-200
11
+ bg-white
12
+ px-4
13
+ py-6
14
+ sm:border-r
15
+ md:max-w-xs
16
+ lg:px-6
17
+ dark:border-neutral-900
18
+ dark:bg-neutral-950;
19
+
20
+ > section {
21
+ @apply hidden
22
+ sm:flex;
23
+ }
24
+
25
+ > span {
26
+ @apply flex
27
+ w-full
28
+ sm:hidden;
29
+ }
30
+ }