Skip to content

Commit a7b2ca3

Browse files
authored
feat: adjust styles to match figmas and moved icons as react components (#6143)
* feat: made all icons as react components * chore: removed original svg images of the now react components * fix: fixed storybooks, styles, icons and isolated markdown styles * fix: more style fixes * fix: fixed more styles * fix: flex-grow-shink for breadcrumbs * meta: some doc improvements for storybook
1 parent ee29500 commit a7b2ca3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1162
-441
lines changed

.storybook/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ const config: StorybookConfig = {
3434
framework: { name: '@storybook/nextjs', options: {} },
3535
webpack: async config => ({
3636
...config,
37+
// We want to conform as much as possible with our target settings
3738
target: 'browserslist',
39+
// Performance Hints do not make sense on Storybook as it is bloated by design
3840
performance: { hints: false },
41+
// `nodevu` is a Node.js-specific package that requires Node.js modules
42+
// this is incompatible with Storybook. So we just mock the module
3943
resolve: { ...config.resolve, alias: { '@nodevu/core': false } },
44+
// Removes Pesky Critical Dependency Warnings due to `next/font`
45+
ignoreWarnings: [e => e.message.includes('Critical dep')],
4046
}),
4147
};
4248

.stylelintrc.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ export default {
2727
'selector-class-pattern': ONLY_ALLOW_CAMEL_CASE_SELECTORS,
2828
// Enforces Element IDs to be camelCase
2929
'selector-id-pattern': ONLY_ALLOW_CAMEL_CASE_SELECTORS,
30+
// Allow Tailwind-based CSS Rules
3031
'at-rule-no-unknown': [true, { ignoreAtRules: CUSTOM_AT_RULES }],
32+
// Allow the Global CSS Selector
33+
'selector-pseudo-class-no-unknown': [
34+
true,
35+
{ ignorePseudoClasses: ['global'] },
36+
],
3137
// Enforces the order of the CSS properties to be in alphabetical order
3238
'order/properties-alphabetical-order': true,
3339
'no-descending-specificity': null,

components/Common/AvatarGroup/Avatar/index.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const Default: Story = {
1515

1616
export const NoSquare: Story = {
1717
args: {
18-
src: '/static/images/logos/stacked-dark.svg',
18+
src: '/static/images/logos/nodejs.png',
1919
alt: 'SD',
2020
},
2121
};

components/Common/Banner/index.module.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717

1818
a {
1919
@apply w-fit
20-
underline;
20+
underline
21+
decoration-white-opaque;
2122
}
2223

2324
svg {
2425
@apply h-4
25-
w-4;
26+
w-4
27+
text-white-opaque;
2628
}
2729
}
2830

components/Common/Banner/index.stories.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,33 @@ type Meta = MetaObj<typeof Banner>;
77

88
export const Default: Story = {
99
args: {
10-
text: 'Nodejs collaborator summitNode.js Collaborator Summit 2023 - Bilbao, Spain (OpenJS World EU) 2023',
10+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
1111
type: 'default',
1212
url: 'https://github.com/openjs-foundation/summit/issues/360',
1313
},
1414
};
1515

1616
export const Error: Story = {
1717
args: {
18-
text: 'STOP creating issue for error 500 on download',
18+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
1919
type: 'error',
2020
url: 'https://github.com/nodejs/nodejs.org/issues/4495',
2121
},
2222
};
2323

2424
export const Warning: Story = {
2525
args: {
26-
text: 'STOP creating issue for error 500 on download',
26+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
2727
type: 'warning',
2828
url: 'https://github.com/nodejs/nodejs.org/issues/4495',
2929
},
3030
};
3131

3232
export const NoLink: Story = {
3333
args: {
34-
text: 'Claudio is the best maintainer',
34+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
3535
type: 'default',
3636
},
3737
};
3838

39-
export const NoType: Story = {
40-
args: {
41-
text: 'Claudio is the best maintainer',
42-
url: 'https://github.com/ovflowd',
43-
},
44-
};
45-
4639
export default { component: Banner } as Meta;

components/Common/Breadcrumbs/BreadcrumbItem/index.module.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
text-sm
66
font-medium;
77

8+
a {
9+
@apply flex-shrink
10+
flex-grow;
11+
}
12+
813
&,
914
> a,
1015
> a:hover {
@@ -19,6 +24,8 @@
1924
.separator {
2025
@apply h-4
2126
w-4
27+
flex-shrink-0
28+
flex-grow
2229
text-neutral-600
2330
dark:text-neutral-400;
2431
}

components/Common/MetaBar/index.stories.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { CodeBracketIcon } from '@heroicons/react/24/outline';
22
import type { Meta as MetaObj, StoryObj } from '@storybook/react';
3-
import Image from 'next/image';
43

54
import AvatarGroup from '@/components/Common/AvatarGroup';
65
import MetaBar from '@/components/Common/MetaBar';
6+
import GitHub from '@/components/Icons/Social/GitHub';
77
import Link from '@/components/Link';
88

99
type Story = StoryObj<typeof MetaBar>;
@@ -38,20 +38,7 @@ export const Default: Story = {
3838
),
3939
'components.metabar.contribute': (
4040
<>
41-
<Image
42-
src="/static/images/logos/social-github-dark.svg"
43-
alt="GitHub Logo"
44-
width={16}
45-
height={16}
46-
data-on-light
47-
/>
48-
<Image
49-
src="/static/images/logos/social-github.svg"
50-
alt="GitHub Logo"
51-
width={16}
52-
height={16}
53-
data-on-dark
54-
/>
41+
<GitHub className="fill-neutral-700 dark:fill-neutral-100" />
5542
<Link href="/contribute">Edit this page</Link>
5643
</>
5744
),

components/Common/Pagination/Ellipsis/index.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@apply w-10
33
px-3
44
py-2.5
5+
leading-none
56
text-neutral-800
67
dark:text-neutral-200;
78
}

components/Common/Preview/index.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import classNames from 'classnames';
2-
import Image from 'next/image';
32
import type { CSSProperties, ComponentProps, FC, ReactNode } from 'react';
43

5-
import { BASE_PATH } from '@/next.constants.mjs';
4+
import JsIconWhite from '@/components/Icons/Logos/JsIconWhite';
65

76
import styles from './index.module.css';
87

@@ -26,14 +25,7 @@ const Preview: FC<PreviewProps> = ({
2625
className={classNames(styles.root, styles[type], props.className)}
2726
>
2827
<div className={styles.container}>
29-
<Image
30-
className={styles.logo}
31-
priority
32-
width="71"
33-
height="80"
34-
src={`${BASE_PATH}/static/images/logos/js-white.svg`}
35-
alt="Node.js"
36-
/>
28+
<JsIconWhite className={styles.logo} width={71} height={80} />
3729
<h2>{title}</h2>
3830
</div>
3931
</div>

components/Common/Select/index.stories.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { Meta as MetaObj, StoryObj } from '@storybook/react';
22

33
import Select from '@/components/Common/Select';
4+
import Apple from '@/components/Icons/Platform/Apple';
5+
import Linux from '@/components/Icons/Platform/Linux';
6+
import Microsoft from '@/components/Icons/Platform/Microsoft';
47

58
type Story = StoryObj<typeof Select>;
69
type Meta = MetaObj<typeof Select>;
@@ -68,17 +71,17 @@ export const InlineSelect: Story = {
6871
{
6972
value: 'linux',
7073
label: 'Linux',
71-
iconImageUrl: '/static/images/logos/platform-linux.svg',
74+
iconImage: <Linux width={16} height={16} />,
7275
},
7376
{
7477
value: 'macos',
7578
label: 'MacOS',
76-
iconImageUrl: '/static/images/logos/platform-apple.svg',
79+
iconImage: <Apple width={16} height={16} />,
7780
},
7881
{
7982
value: 'windows',
8083
label: 'Windows',
81-
iconImageUrl: '/static/images/logos/platform-microsoft.svg',
84+
iconImage: <Microsoft width={16} height={16} />,
8285
},
8386
],
8487
dropdownLabel: 'Platform',

0 commit comments

Comments
 (0)