@node-core/ui-components 1.0.1-345c7d19144bec7138956e6ae7f5b20cfa2e2450 → 1.0.1-49d65845ae6ff8d53a36f08f2f6353edc12d9b2f

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 (29) hide show
  1. package/Common/AlertBox/index.module.css +7 -0
  2. package/Common/AlertBox/index.stories.tsx +23 -0
  3. package/Common/AvatarGroup/index.module.css +4 -8
  4. package/Common/AvatarGroup/index.tsx +1 -5
  5. package/Common/BaseButton/index.module.css +4 -1
  6. package/Common/ChangeHistory/index.module.css +83 -0
  7. package/Common/ChangeHistory/index.stories.tsx +130 -0
  8. package/Common/ChangeHistory/index.tsx +67 -0
  9. package/Common/DataTag/index.module.css +56 -0
  10. package/Common/DataTag/index.stories.tsx +40 -0
  11. package/Common/DataTag/index.tsx +39 -0
  12. package/Containers/DocSideBar/index.tsx +0 -0
  13. package/{Common/ProgressionSidebar/ProgressionSidebarIcon → Containers/Sidebar/ProgressionIcon}/index.tsx +2 -2
  14. package/Containers/Sidebar/SidebarGroup/index.module.css +54 -16
  15. package/Containers/Sidebar/SidebarGroup/index.tsx +21 -2
  16. package/Containers/Sidebar/SidebarItem/index.module.css +39 -18
  17. package/Containers/Sidebar/SidebarItem/index.tsx +25 -8
  18. package/Containers/Sidebar/index.module.css +5 -6
  19. package/Containers/Sidebar/index.stories.tsx +78 -74
  20. package/Containers/Sidebar/index.tsx +17 -5
  21. package/Icons/Logos/Nodejs.tsx +201 -17
  22. package/package.json +26 -29
  23. package/Common/ProgressionSidebar/ProgressionSidebarGroup/index.module.css +0 -47
  24. package/Common/ProgressionSidebar/ProgressionSidebarGroup/index.tsx +0 -35
  25. package/Common/ProgressionSidebar/ProgressionSidebarItem/index.module.css +0 -39
  26. package/Common/ProgressionSidebar/ProgressionSidebarItem/index.tsx +0 -32
  27. package/Common/ProgressionSidebar/index.module.css +0 -30
  28. package/Common/ProgressionSidebar/index.stories.tsx +0 -79
  29. package/Common/ProgressionSidebar/index.tsx +0 -59
package/package.json CHANGED
@@ -13,57 +13,54 @@
13
13
  "files": [
14
14
  "Common",
15
15
  "Containers",
16
- "MDX",
17
16
  "Icons",
17
+ "MDX",
18
+ "stylelint",
18
19
  "styles",
19
- "types.ts",
20
- "stylelint"
20
+ "types.ts"
21
21
  ],
22
22
  "dependencies": {
23
23
  "@heroicons/react": "^2.2.0",
24
- "@radix-ui/react-avatar": "^1.1.9",
25
- "@radix-ui/react-dialog": "^1.1.7",
26
- "@radix-ui/react-dropdown-menu": "~2.1.6",
27
- "@radix-ui/react-label": "~2.1.2",
28
- "@radix-ui/react-select": "~2.2.2",
29
- "@radix-ui/react-separator": "~1.1.3",
30
- "@radix-ui/react-tabs": "~1.1.9",
31
- "@radix-ui/react-toast": "~1.2.6",
32
- "@radix-ui/react-tooltip": "~1.2.4",
33
- "@tailwindcss/postcss": "~4.1.5",
24
+ "@radix-ui/react-avatar": "^1.1.10",
25
+ "@radix-ui/react-dialog": "^1.1.14",
26
+ "@radix-ui/react-dropdown-menu": "~2.1.15",
27
+ "@radix-ui/react-label": "~2.1.7",
28
+ "@radix-ui/react-select": "~2.2.5",
29
+ "@radix-ui/react-separator": "~1.1.7",
30
+ "@radix-ui/react-tabs": "~1.1.12",
31
+ "@radix-ui/react-toast": "~1.2.14",
32
+ "@radix-ui/react-tooltip": "~1.2.7",
33
+ "@tailwindcss/postcss": "~4.1.8",
34
34
  "@vcarl/remark-headings": "~0.1.0",
35
35
  "classnames": "~2.5.1",
36
36
  "postcss-calc": "^10.1.1",
37
37
  "tailwindcss": "~4.0.17"
38
38
  },
39
39
  "devDependencies": {
40
- "@storybook/addon-controls": "^8.6.12",
41
- "@storybook/addon-interactions": "^8.6.12",
42
40
  "@storybook/addon-styling-webpack": "^1.0.1",
43
- "@storybook/addon-themes": "^8.6.12",
44
- "@storybook/addon-viewport": "^8.6.12",
41
+ "@storybook/addon-themes": "^9.0.3",
45
42
  "@storybook/addon-webpack5-compiler-swc": "^3.0.0",
46
- "@storybook/react": "^8.6.12",
47
- "@storybook/react-webpack5": "^8.6.12",
43
+ "@storybook/react": "^9.0.3",
44
+ "@storybook/react-webpack5": "^9.0.3",
48
45
  "@testing-library/user-event": "~14.6.1",
49
46
  "@types/node": "22.15.3",
50
- "@types/react": "^19.1.0",
47
+ "@types/react": "^19.1.6",
51
48
  "cross-env": "^7.0.3",
52
49
  "css-loader": "~7.1.2",
53
50
  "eslint-plugin-react": "~7.37.4",
54
- "eslint-plugin-storybook": "~0.12.0",
51
+ "eslint-plugin-storybook": "~9.0.3",
55
52
  "global-jsdom": "^26.0.0",
56
53
  "postcss-loader": "~8.1.1",
57
54
  "react": "^19.1.0",
58
- "storybook": "^8.6.11",
55
+ "storybook": "^9.0.3",
59
56
  "style-loader": "~4.0.0",
60
- "stylelint": "^16.19.1",
57
+ "stylelint": "^16.20.0",
61
58
  "stylelint-config-standard": "^38.0.0",
62
59
  "stylelint-order": "7.0.0",
63
60
  "stylelint-selector-bem-pattern": "4.0.1",
64
61
  "tsx": "^4.19.3",
65
62
  "typescript": "~5.8.2",
66
- "typescript-eslint": "~8.31.1"
63
+ "typescript-eslint": "~8.33.1"
67
64
  },
68
65
  "imports": {
69
66
  "#ui/*": [
@@ -77,17 +74,17 @@
77
74
  "engines": {
78
75
  "node": ">=20"
79
76
  },
80
- "version": "1.0.1-345c7d19144bec7138956e6ae7f5b20cfa2e2450",
77
+ "version": "1.0.1-49d65845ae6ff8d53a36f08f2f6353edc12d9b2f",
81
78
  "scripts": {
82
- "check-types": "tsc --noEmit",
83
79
  "lint": "turbo run lint:js lint:css",
84
80
  "lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache",
85
- "lint:fix": "turbo run lint:js lint:css --no-cache -- --fix",
81
+ "lint:fix": "node --run lint -- -- --fix",
86
82
  "lint:js": "eslint \"**/*.{js,mjs,ts,tsx}\"",
83
+ "lint:types": "tsc --noEmit",
87
84
  "storybook": "cross-env NODE_NO_WARNINGS=1 storybook dev -p 6006 --quiet",
88
85
  "storybook:build": "cross-env NODE_NO_WARNINGS=1 storybook build --quiet --webpack-stats-json",
89
- "test": "turbo test:unit",
86
+ "test": "node --run test:unit",
90
87
  "test:unit": "cross-env NODE_NO_WARNINGS=1 node --experimental-test-coverage --test-coverage-exclude=**/*.test.* --enable-source-maps --import=global-jsdom/register --import=tsx --import=../../tests/setup.mjs --test **/*.test.*",
91
- "test:unit:watch": "cross-env NODE_OPTIONS=\"--watch\" pnpm test:unit"
88
+ "test:unit:watch": "node --run test:unit -- --watch"
92
89
  }
93
90
  }
@@ -1,47 +0,0 @@
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
- }
@@ -1,35 +0,0 @@
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;
@@ -1,39 +0,0 @@
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
- }
@@ -1,32 +0,0 @@
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;
@@ -1,30 +0,0 @@
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
- }
@@ -1,79 +0,0 @@
1
- import type { Meta as MetaObj, StoryObj } from '@storybook/react';
2
-
3
- import ProgressionSidebar from '#ui/Common/ProgressionSidebar';
4
-
5
- type Story = StoryObj<typeof ProgressionSidebar>;
6
- type Meta = MetaObj<typeof ProgressionSidebar>;
7
-
8
- export const Default: Story = {
9
- args: {
10
- groups: [
11
- {
12
- groupName: 'Getting Started',
13
- items: [
14
- {
15
- label: 'Introduction to Node.js',
16
- link: '/',
17
- },
18
- {
19
- label: 'How to install Node.js',
20
- link: '/how-to-install-nodejs',
21
- },
22
- {
23
- label: 'How much JavaScript do you need to know to use Node.js?',
24
- link: '/how-much-javascript-do-you-need-to-know-to-use-nodejs',
25
- },
26
- {
27
- label: 'Differences between Node.js and the Browser',
28
- link: '/differences-between-nodejs-and-the-browser',
29
- },
30
- {
31
- label: 'The V8 JavaScript Engine',
32
- link: '/the-v8-javascript-engine',
33
- },
34
- {
35
- label: 'An introduction to the npm package manager',
36
- link: '/an-introduction-to-the-npm-package-manager',
37
- },
38
- ],
39
- },
40
- {
41
- groupName: 'Asynchronous Work',
42
- items: [
43
- {
44
- label: 'Asynchronous flow control',
45
- link: '/asynchronous-flow-control',
46
- },
47
- {
48
- label: 'Overview of Blocking vs Non-Blocking',
49
- link: '/overview-of-blocking-vs-non-blocking',
50
- },
51
- ],
52
- },
53
- {
54
- groupName: 'Manipulating Files',
55
- items: [
56
- {
57
- label: 'Node.js file stats',
58
- link: '/nodejs-file-stats',
59
- },
60
- {
61
- label: 'Node.js File Paths',
62
- link: '/nodejs-file-paths',
63
- },
64
- ],
65
- },
66
- {
67
- groupName: 'Single item',
68
- items: [
69
- {
70
- label: 'Item',
71
- link: '/item',
72
- },
73
- ],
74
- },
75
- ],
76
- },
77
- };
78
-
79
- export default { component: ProgressionSidebar } as Meta;
@@ -1,59 +0,0 @@
1
- 'use client';
2
-
3
- import { useRef, type ComponentProps, type FC } from 'react';
4
-
5
- import ProgressionSidebarGroup from '#ui/Common/ProgressionSidebar/ProgressionSidebarGroup';
6
- import Select from '#ui/Common/Select';
7
- import type { LinkLike } from '#ui/types';
8
-
9
- import styles from './index.module.css';
10
-
11
- type ProgressionSidebarProps = {
12
- groups: Array<ComponentProps<typeof ProgressionSidebarGroup>>;
13
- pathname?: string;
14
- title: string;
15
- onSelect: (value: string) => void;
16
- as?: LinkLike;
17
- };
18
-
19
- const ProgressionSidebar: FC<ProgressionSidebarProps> = ({
20
- groups,
21
- pathname,
22
- title,
23
- onSelect,
24
- as,
25
- }) => {
26
- const ref = useRef<HTMLElement>(null);
27
- const selectItems = groups.map(({ items, groupName }) => ({
28
- label: groupName,
29
- items: items.map(({ label, link }) => ({ value: link, label })),
30
- }));
31
-
32
- const currentItem = selectItems
33
- .map(item => item.items)
34
- .flat()
35
- .find(item => pathname === item.value);
36
-
37
- return (
38
- <nav className={styles.wrapper} ref={ref}>
39
- <Select
40
- label={title}
41
- onChange={onSelect}
42
- values={selectItems}
43
- defaultValue={currentItem?.value}
44
- />
45
-
46
- {groups.map(({ groupName, items }) => (
47
- <ProgressionSidebarGroup
48
- key={groupName.toString()}
49
- groupName={groupName}
50
- items={items}
51
- as={as}
52
- pathname={pathname}
53
- />
54
- ))}
55
- </nav>
56
- );
57
- };
58
-
59
- export default ProgressionSidebar;