Skip to content

Commit ee060b8

Browse files
committed
Merge branch 'fix/8048-keyboard-accessible-details-button' of https://github.com/mohit5upadhyay/nodejs.org into fix/8048-keyboard-accessible-details-button
2 parents f35e5df + 7a2b727 commit ee060b8

File tree

11 files changed

+707
-193
lines changed

11 files changed

+707
-193
lines changed

.github/workflows/playwright-cloudflare-open-next.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ jobs:
5151
- name: Install packages
5252
run: pnpm install --frozen-lockfile
5353

54+
- name: Downgrade Next.js
55+
# Open-next does not yet support next@15.4, so temporarily in order to have
56+
# this workflow working we force install the latest Next.js 15.3 version instead
57+
run: pnpm i next@15.3.2
58+
working-directory: apps/site
59+
5460
- name: Get Playwright version
5561
id: playwright-version
5662
working-directory: apps/site

apps/site/next.mdx.use.client.mjs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ import { ReleaseProvider } from './providers/releaseProvider';
3030
export const clientMdxComponents = {
3131
// Renders MDX CodeTabs
3232
CodeTabs: MDXCodeTabs,
33-
// Renders a Button Component for `button` tags
34-
Button: Button,
35-
// Links with External Arrow
36-
LinkWithArrow: LinkWithArrow,
37-
// Regular links (without arrow)
38-
Link: Link,
3933
// Renders a Download Button
4034
DownloadButton: DownloadButton,
4135
// Renders a Download Link

apps/site/next.mdx.use.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
import BadgeGroup from '@node-core/ui-components/Common/BadgeGroup';
44

5+
import Button from './components/Common/Button';
56
import DownloadReleasesTable from './components/Downloads/DownloadReleasesTable';
7+
import Link from './components/Link';
8+
import LinkWithArrow from './components/LinkWithArrow';
69
import UpcomingMeetings from './components/MDX/Calendar/UpcomingMeetings';
710
import WithBadgeGroup from './components/withBadgeGroup';
811
import WithBanner from './components/withBanner';
@@ -25,4 +28,10 @@ export const mdxComponents = {
2528
BadgeGroup,
2629
// Renders an container for Upcoming Node.js Meetings
2730
UpcomingMeetings,
31+
// Renders a Button Component for `button` tags
32+
Button,
33+
// Regular links (without arrow)
34+
Link,
35+
// Links with External Arrow
36+
LinkWithArrow,
2837
};

apps/site/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
"@node-core/ui-components": "workspace:*",
3737
"@node-core/website-i18n": "workspace:*",
3838
"@nodevu/core": "0.3.0",
39-
"@opentelemetry/api-logs": "~0.202.0",
40-
"@opentelemetry/instrumentation": "~0.202.0",
39+
"@opentelemetry/api-logs": "~0.203.0",
40+
"@opentelemetry/instrumentation": "~0.203.0",
4141
"@opentelemetry/resources": "~1.30.1",
42-
"@opentelemetry/sdk-logs": "~0.202.0",
42+
"@opentelemetry/sdk-logs": "~0.203.0",
4343
"@orama/react-components": "^0.8.1",
4444
"@oramacloud/client": "^2.1.4",
4545
"@radix-ui/react-tabs": "^1.1.12",
@@ -56,7 +56,7 @@
5656
"feed": "~5.1.0",
5757
"github-slugger": "~2.0.0",
5858
"gray-matter": "~4.0.3",
59-
"next": "15.4.3",
59+
"next": "15.4.4",
6060
"next-intl": "~4.3.4",
6161
"next-themes": "~0.4.6",
6262
"postcss-calc": "~10.1.1",
@@ -76,11 +76,12 @@
7676
"devDependencies": {
7777
"@eslint/compat": "~1.3.1",
7878
"@eslint/eslintrc": "~3.3.1",
79-
"@flarelabs-net/wrangler-build-time-fs-assets-polyfilling": "^0.0.0",
80-
"@next/eslint-plugin-next": "15.3.4",
79+
"@flarelabs-net/wrangler-build-time-fs-assets-polyfilling": "^0.0.1",
80+
"@next/eslint-plugin-next": "15.4.4",
8181
"@opennextjs/cloudflare": "^1.6.0",
8282
"@playwright/test": "^1.54.1",
8383
"@testing-library/user-event": "~14.6.1",
84+
"@types/mdx": "^2.0.13",
8485
"@types/semver": "~7.7.0",
8586
"eslint-config-next": "15.4.3",
8687
"eslint-import-resolver-typescript": "~4.4.4",

apps/site/pages/en/blog/release/v22.18.0.md

Lines changed: 259 additions & 0 deletions
Large diffs are not rendered by default.

apps/site/pages/en/blog/release/v24.5.0.md

Lines changed: 245 additions & 0 deletions
Large diffs are not rendered by default.

apps/site/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"plugins": [{ "name": "next" }],
1818
"baseUrl": "."
1919
},
20+
"mdx": { "checkMdx": true },
2021
"include": [
2122
"next-env.d.ts",
2223
"global.d.ts",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"dependencies": {
3737
"husky": "9.1.7",
3838
"lint-staged": "16.1.2",
39-
"turbo": "2.5.4"
39+
"turbo": "2.5.5"
4040
},
4141
"devDependencies": {
4242
"@eslint/js": "~9.31.0",

packages/ui-components/src/Common/Badge/index.module.css

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
.badge {
44
@apply rounded-full
5-
border
65
text-center
76
text-white;
87

@@ -19,32 +18,22 @@
1918
}
2019

2120
&.default {
22-
@apply border-green-200
23-
bg-green-600
24-
dark:border-green-800;
21+
@apply bg-green-600;
2522
}
2623

2724
&.error {
28-
@apply border-danger-200
29-
bg-danger-600
30-
dark:border-danger-800;
25+
@apply bg-danger-600;
3126
}
3227

3328
&.warning {
34-
@apply border-warning-200
35-
bg-warning-600
36-
dark:border-warning-600;
29+
@apply bg-warning-600;
3730
}
3831

3932
&.info {
40-
@apply border-info-200
41-
bg-info-600
42-
dark:border-info-800;
33+
@apply bg-info-600;
4334
}
4435

4536
&.neutral {
46-
@apply border-neutral-200
47-
bg-neutral-600
48-
dark:border-neutral-800;
37+
@apply bg-neutral-600;
4938
}
5039
}

packages/ui-components/src/MDX/CodeTabs.tsx

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as TabsPrimitive from '@radix-ui/react-tabs';
22
import type { FC, ReactElement } from 'react';
3+
import { useMemo } from 'react';
34

45
import CodeTabs from '#ui/Common/CodeTabs';
56

@@ -21,27 +22,32 @@ const MDXCodeTabs: FC<MDXCodeTabsProps> = ({
2122
defaultTab = '0',
2223
...props
2324
}) => {
24-
const languages = rawLanguages.split('|');
25-
const displayNames = rawDisplayNames?.split('|') ?? [];
25+
const { tabs, languages } = useMemo(() => {
26+
const occurrences: Record<string, number> = {};
2627

27-
const occurrences: Record<string, number> = {};
28+
const languages = rawLanguages.split('|');
29+
const displayNames = rawDisplayNames?.split('|') ?? [];
2830

29-
const tabs = languages.map((language, index) => {
30-
const base =
31-
displayNames[index]?.trim() ||
32-
NAME_OVERRIDES[language] ||
33-
language.toUpperCase();
31+
const tabs = languages.map((language, index) => {
32+
const base =
33+
displayNames[index]?.trim() ||
34+
NAME_OVERRIDES[language] ||
35+
language.toUpperCase();
3436

35-
const count = occurrences[base] ?? 0;
36-
occurrences[base] = count + 1;
37+
const count = occurrences[base] ?? 0;
3738

38-
const label = count > 0 ? `${base} (${count + 1})` : base;
39+
occurrences[base] = count + 1;
3940

40-
return {
41-
key: `${language}-${index}`,
42-
label: label,
43-
};
44-
});
41+
const label = count > 0 ? `${base} (${count + 1})` : base;
42+
43+
return {
44+
key: `${language}-${index}`,
45+
label: label,
46+
};
47+
});
48+
49+
return { tabs, languages };
50+
}, [rawLanguages, rawDisplayNames]);
4551

4652
return (
4753
<CodeTabs

0 commit comments

Comments
 (0)