@node-core/ui-components 1.0.1-6cb8b0a0c75c24f5ccc84bb07a1ea9b4b810abd2 → 1.0.1-6ce9ac9c19dbcf93f5af658cca3784484762d8a3
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.
- package/Common/AlertBox/index.module.css +7 -0
- package/Common/AlertBox/index.stories.tsx +23 -0
- package/Common/AvatarGroup/index.module.css +4 -8
- package/Common/AvatarGroup/index.tsx +1 -5
- package/Common/BaseButton/index.module.css +4 -1
- package/Common/BaseCodeBox/index.module.css +0 -6
- package/Common/BaseCodeBox/index.tsx +7 -18
- package/Common/ChangeHistory/index.module.css +83 -0
- package/Common/ChangeHistory/index.stories.tsx +130 -0
- package/Common/ChangeHistory/index.tsx +67 -0
- package/Common/CodeTabs/index.stories.tsx +1 -2
- package/Common/DataTag/index.module.css +56 -0
- package/Common/DataTag/index.stories.tsx +40 -0
- package/Common/DataTag/index.tsx +39 -0
- package/Common/Modal/index.module.css +3 -3
- package/Common/Modal/index.stories.tsx +7 -5
- package/Common/Modal/index.tsx +16 -14
- package/Common/Tabs/index.module.css +2 -1
- package/Containers/DocSideBar/index.tsx +0 -0
- package/{Common/ProgressionSidebar/ProgressionSidebarIcon → Containers/Sidebar/ProgressionIcon}/index.tsx +2 -2
- package/Containers/Sidebar/SidebarGroup/index.module.css +54 -16
- package/Containers/Sidebar/SidebarGroup/index.tsx +21 -2
- package/Containers/Sidebar/SidebarItem/index.module.css +39 -18
- package/Containers/Sidebar/SidebarItem/index.tsx +25 -8
- package/Containers/Sidebar/index.module.css +5 -6
- package/Containers/Sidebar/index.stories.tsx +78 -74
- package/Containers/Sidebar/index.tsx +17 -5
- package/Icons/Logos/Nodejs.tsx +201 -17
- package/MDX/CodeTabs.tsx +47 -0
- package/package.json +26 -28
- package/styles/markdown.css +1 -1
- package/Common/ProgressionSidebar/ProgressionSidebarGroup/index.module.css +0 -47
- package/Common/ProgressionSidebar/ProgressionSidebarGroup/index.tsx +0 -35
- package/Common/ProgressionSidebar/ProgressionSidebarItem/index.module.css +0 -39
- package/Common/ProgressionSidebar/ProgressionSidebarItem/index.tsx +0 -32
- package/Common/ProgressionSidebar/index.module.css +0 -30
- package/Common/ProgressionSidebar/index.stories.tsx +0 -79
- package/Common/ProgressionSidebar/index.tsx +0 -59
|
@@ -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;
|