Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
5bffdcd
Basic Husky + ESLint + Prettier configuration
Mil4n0r Apr 9, 2024
30b4fcf
Fixed incorrect values in eslint config
Mil4n0r Apr 9, 2024
8a04180
Fixed TS problems within ESLint
Mil4n0r Apr 9, 2024
5ce33b2
Fixed some of the errors detected by eslint
Mil4n0r Apr 9, 2024
c9b0e19
Converted configuration files to TS
Mil4n0r Apr 9, 2024
d32c8e9
Added security plugin to ESLint
Mil4n0r Apr 11, 2024
2c0a962
Removed unwanted comment
Mil4n0r Apr 11, 2024
e424fbc
Fixing ESLint detected problems
Mil4n0r Apr 11, 2024
9bc889f
Fixing ESLint detected problems
Mil4n0r Apr 12, 2024
4552df1
Fixing ESLint detected problems
Mil4n0r Apr 12, 2024
db358cf
Fixing ESLint detected problems
Mil4n0r Apr 12, 2024
ffbb1d7
Run prettier in the whole src/
Mil4n0r Apr 12, 2024
4a16152
Fixing ESLint detected problems
Mil4n0r Apr 12, 2024
260206f
Moved accessibility files
Mil4n0r Apr 12, 2024
f24aa79
Changed tsconfig rootDir
Mil4n0r Apr 12, 2024
5137f2a
Modified TS config to allow jest configs
Mil4n0r Apr 15, 2024
f591059
Fixed minor bugs after refactoring
Mil4n0r Apr 15, 2024
a470dbe
Relocated accessibility config files
Mil4n0r Apr 15, 2024
966289c
Removed rootDir from tsconfig
Mil4n0r Apr 15, 2024
9c77af7
Changed mocks from js to ts
Mil4n0r Apr 15, 2024
4e03fce
Modified certain incorrect default blocks
Mil4n0r Apr 15, 2024
26763e3
Fixed checkbox color
Mil4n0r Apr 15, 2024
e23ffbe
Minor fixes
Mil4n0r Apr 15, 2024
361e606
Removed ESLint rule comment
Mil4n0r Apr 16, 2024
8a6e16c
Removed unexpected end of line
Mil4n0r Apr 16, 2024
e5bf87c
Fixed key code typo
Mil4n0r Apr 16, 2024
7c795f1
Removed unnecessary 'break'
Mil4n0r Apr 16, 2024
1ff6f24
Refactored some if/else blocks
Mil4n0r Apr 16, 2024
d2bc8f5
Refactored certain exports/imports
Mil4n0r Apr 16, 2024
f05db8f
Added pending disabledRule
Mil4n0r Apr 16, 2024
eceb4ff
Removed unneeded .eslintrc rules
Mil4n0r Apr 16, 2024
1076feb
Changed .prettierrc config
Mil4n0r Apr 16, 2024
9648aa9
Changed .prettierrc config
Mil4n0r Apr 16, 2024
a8bfd61
Removed unwanted change in website
Mil4n0r Apr 16, 2024
fbc36f7
Changed .prettierrc config
Mil4n0r Apr 16, 2024
f87233c
Changed if/else structure
Mil4n0r Apr 16, 2024
c69417a
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Apr 16, 2024
88fe54c
Changed default export name
Mil4n0r Apr 16, 2024
0f5dd74
Fixed default export disabledRules
Mil4n0r Apr 16, 2024
0400789
Fix problem in container style
Mil4n0r Apr 16, 2024
dac50f5
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Apr 18, 2024
96a367c
Modified webpack config to match ES6 and TS
Mil4n0r Apr 18, 2024
e6e7ebd
Changed babel configuration format to match prettier
Mil4n0r Apr 18, 2024
50ce94e
Reverted Chip changes to types
Mil4n0r Apr 18, 2024
acf6f7d
Moved webpack to devDependencies
Mil4n0r Apr 22, 2024
03280ff
Merge branch 'master' into Mil4n0r/code_quality
Mil4n0r Apr 22, 2024
8f50082
Fixed radix bug
Mil4n0r Apr 22, 2024
1525c77
Rollback useEffect dependencies
Mil4n0r Apr 22, 2024
71a999e
Removed unneeded console.log
Mil4n0r Apr 22, 2024
000ee47
Removed font import in storybook preview
Mil4n0r Apr 22, 2024
e912d89
Added generated IDs for keys over indexes
Mil4n0r Apr 23, 2024
4e654e8
Fixed problem with v4 typing
Mil4n0r Apr 23, 2024
6678b93
Solved conflicts
Mil4n0r Apr 30, 2024
99fa7cf
Restored changes to key ids that were causing errors in the tests
Mil4n0r Apr 30, 2024
823d8e6
Updated package-lock
Mil4n0r May 2, 2024
7bfced3
Merge branch 'master' into Mil4n0r/code_quality
Mil4n0r May 3, 2024
4a81138
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r May 6, 2024
3cf4e29
Merge branch 'Mil4n0r/code_quality' of github.com:dxc-technology/hals…
Mil4n0r May 6, 2024
b1fca48
Merge branch 'master' into Mil4n0r/code_quality
Mil4n0r May 13, 2024
7760e0e
Fixed error in conflicts
Mil4n0r May 13, 2024
a9f112e
Restored keys
Mil4n0r May 13, 2024
88d2755
Removed unneeded dev dependency
Mil4n0r May 13, 2024
8508d78
Fixed problem with dependencies
Mil4n0r May 13, 2024
d511437
Removed build storybook log
Mil4n0r May 14, 2024
ce30cea
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r May 20, 2024
4d6048d
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Jul 3, 2024
bfe2073
Chromatic flow improvement
Mil4n0r Jul 3, 2024
ecf1799
Updated storybook
Mil4n0r Jul 3, 2024
1c33de8
Merged changes from monorepo update
Mil4n0r Jul 4, 2024
42f352e
Removed repeated import
Mil4n0r Jul 4, 2024
5ee7850
Fixed import in Icon accessibility test
Mil4n0r Jul 4, 2024
7eb0369
Fixed chromatic settings and Breadcrumbs import
Mil4n0r Jul 4, 2024
b6f685e
Fixed problem with DXC Icon
Mil4n0r Jul 4, 2024
3051bcc
Refactoring configuration files
Mil4n0r Jul 4, 2024
f5ab5a5
Added Eslint recommendations
Mil4n0r Jul 5, 2024
6afb630
Updated package.json
Mil4n0r Jul 5, 2024
5fb4784
Merge changes and solve remaining conflicts
Mil4n0r Jul 5, 2024
3df3af1
Update package-lock
Mil4n0r Jul 5, 2024
ba5296e
Fixed problem resolving css from BarChart
Mil4n0r Jul 5, 2024
bc42a72
Added husky
Mil4n0r Jul 5, 2024
b9d64d2
Added lint-staged
Mil4n0r Jul 5, 2024
03b87a8
Fixed problem with lint-staged
Mil4n0r Jul 5, 2024
a03fa67
Testing husky
Mil4n0r Jul 5, 2024
b133c2c
Installed husky correctly
Mil4n0r Jul 5, 2024
e3c39d4
Fixed tables in website documentation
Mil4n0r Jul 8, 2024
37907b6
Updated package-lock
Mil4n0r Jul 8, 2024
7d79cf4
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Jul 8, 2024
56a8eb3
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Jul 8, 2024
24833ad
Removed duplicate
Mil4n0r Jul 8, 2024
5436b2c
Merge with master
Mil4n0r Jul 8, 2024
343663c
Removed duplicate babel config
Mil4n0r Jul 8, 2024
3659e8a
Merge branch 'master' into Mil4n0r/code_quality_monorepo
Mil4n0r Jul 9, 2024
41fabc6
Fixed eslint configuration
Mil4n0r Jul 9, 2024
1ccaf08
Reactivated husky
Mil4n0r Jul 9, 2024
9f1de1f
Removed duplicate file
Mil4n0r Jul 9, 2024
31ea535
Fixed typo
Mil4n0r Jul 9, 2024
60758ec
Removed prettier from lint-staged flow to make review easier
Mil4n0r Jul 9, 2024
cf14339
Merge branch 'master' into Mil4n0r/code_quality_monorepo
Mil4n0r Jul 9, 2024
5e7b4bb
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Jul 24, 2024
8a67d40
Merge branch 'Mil4n0r/code_quality_monorepo' of github.com:dxc-techno…
Mil4n0r Jul 24, 2024
bcda53d
Merge branch 'master' into Mil4n0r/code_quality_monorepo
Mil4n0r Jul 25, 2024
faf4e5b
Merge branch 'master' into Mil4n0r/code_quality_monorepo
Mil4n0r Aug 2, 2024
6a61e76
Removed unneeded lines in tests
Mil4n0r Aug 2, 2024
fb2f22f
Added additional rule for .storybook eslint
Mil4n0r Aug 2, 2024
6c99e45
Added additional rule for .storybook eslint
Mil4n0r Aug 2, 2024
71bde24
Updated TS configuration
Mil4n0r Aug 2, 2024
17f3e63
Test
Mil4n0r Aug 2, 2024
3135dee
Test husky
Mil4n0r Aug 2, 2024
8096ba0
Test include
Mil4n0r Aug 2, 2024
807fa29
Restore husky settings
Mil4n0r Aug 2, 2024
c9caa64
Fixed most of DTS build errors
Mil4n0r Aug 6, 2024
83d6ef9
Fixed more DTS build errors
Mil4n0r Aug 7, 2024
6b79326
Solved conflicts and added most of the remaining types
Mil4n0r Aug 8, 2024
b4ecbd5
Removed deprecated lines from husky config
Mil4n0r Aug 8, 2024
c9dca5f
Fixed package-lock
Mil4n0r Aug 8, 2024
b75b359
Fixed remaining types from lib
Mil4n0r Aug 8, 2024
c6f83bf
Removed old TODO's
Mil4n0r Aug 8, 2024
3d1e8bb
Finished fixing the types of the project
Mil4n0r Aug 8, 2024
da9a889
Fixed visual bug for Slider
Mil4n0r Aug 8, 2024
3271892
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Aug 19, 2024
d0ea1b8
Fixed eslint for scripts
Mil4n0r Aug 19, 2024
977cbb0
Fixed warning in accordion
Mil4n0r Aug 19, 2024
4dd6f98
Added missing parenthesis in accordion
Mil4n0r Aug 20, 2024
b76afb2
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Sep 18, 2024
4c99aff
Fixed typings
Mil4n0r Sep 18, 2024
127ab0a
Merge branch 'master' into Mil4n0r/code_quality_monorepo
Mil4n0r Sep 18, 2024
ec86ec1
Added tsc to check typescript errors
Mil4n0r Sep 18, 2024
8a5038e
Merge branch 'Mil4n0r/code_quality_monorepo' of github.com:dxc-techno…
Mil4n0r Sep 18, 2024
b4bd635
Fixed typings problems for new tabs structure
Mil4n0r Sep 18, 2024
0b2198c
Fixed tests not passing for new tabs structure
Mil4n0r Sep 18, 2024
ce8a1f5
Fixed minor problems in tabs display
Mil4n0r Sep 18, 2024
e8a308f
Merge branches 'Mil4n0r/code_quality_monorepo' and 'master' of github…
Mil4n0r Sep 19, 2024
c745a02
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Sep 20, 2024
f720ae2
Fixed some minor problems in Toast behavior
Mil4n0r Sep 20, 2024
12b4c59
Fixed extension of test helper
Mil4n0r Sep 20, 2024
8949350
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Sep 25, 2024
c9118fd
Resolved conflicts
Mil4n0r Oct 29, 2024
a37ca53
Fixed build problems
Mil4n0r Oct 29, 2024
aee09b3
Fixed typos
Mil4n0r Oct 29, 2024
4cb3a9b
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Oct 29, 2024
72092a0
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Nov 13, 2024
2e89de0
Merge branch 'master' into Mil4n0r/code_quality_monorepo
Mil4n0r Nov 28, 2024
7ef6ff7
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Dec 3, 2024
4f19395
Fixed problems for build
Dec 3, 2024
d59da8d
Restored package-lock
Dec 3, 2024
0ba3607
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Dec 16, 2024
8fbe712
Removed unused import
Mil4n0r Dec 16, 2024
1f6201c
Fixed build problems
Mil4n0r Dec 16, 2024
4089918
Fixed FocusLock bug
Mil4n0r Dec 16, 2024
dbe0c14
Merge branch 'Mil4n0r/strict-mode-true' of github.com:dxc-technology/…
Mil4n0r Dec 19, 2024
618156e
Fixed build problems and most of the remaining types
Mil4n0r Dec 19, 2024
48c579b
Removed some dangerous type assertions to use type guards instead
Mil4n0r Dec 20, 2024
6b98af6
Fixed package-lock
Mil4n0r Dec 20, 2024
29d90c7
Merge branch 'Mil4n0r/strict-mode-true' of github.com:dxc-technology/…
Mil4n0r Dec 23, 2024
f09637c
Merge branch 'Mil4n0r/strict-mode-true' of github.com:dxc-technology/…
Mil4n0r Dec 24, 2024
ee87b51
Merge branch 'master' into Mil4n0r/code_quality_monorepo
Mil4n0r Dec 24, 2024
5f6092c
Removed more type assertions
Mil4n0r Dec 24, 2024
8fc1b12
Merge branch 'Mil4n0r/code_quality_monorepo' of github.com:dxc-techno…
Mil4n0r Dec 24, 2024
8002907
Solved build problem
Mil4n0r Dec 24, 2024
22b4ae4
Restored popover import
Mil4n0r Dec 24, 2024
bcb9f90
Restored types for select
Mil4n0r Dec 24, 2024
9a2d297
Removed redundant return undefined
Dec 30, 2024
55b4b36
Updated FocusLock with latest changes
Dec 30, 2024
e7d00ec
Fixed minor issues
Dec 30, 2024
6d375a1
Removed unwanted TODO
Dec 30, 2024
278941c
Added removed return
Dec 30, 2024
108d8e2
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Jan 7, 2025
c5c55b5
Merge branch 'master' into Mil4n0r/code_quality_monorepo
Mil4n0r Jan 13, 2025
854932c
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Jan 16, 2025
814f804
Added missing import
Jan 16, 2025
4e2b53e
Fixed problems from tokens updates
May 6, 2025
62a2f83
Fixed minor typing problem
May 6, 2025
70830a5
Update package-lock
May 6, 2025
0de1a4b
Removed cloudscape deps
May 6, 2025
54db83e
Updated package-lock
May 6, 2025
bef8f66
Updated package-lock
May 6, 2025
fde6777
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Sep 25, 2025
86e1f64
Modified babel config
Mil4n0r Sep 25, 2025
cdc5049
Solved errors preventing build
Mil4n0r Sep 25, 2025
1579e04
Fixed eslint
Mil4n0r Sep 26, 2025
aecce97
Fixed eslint
Mil4n0r Sep 26, 2025
4169b3b
Merge branch 'master' of github.com:dxc-technology/halstack-react int…
Mil4n0r Sep 26, 2025
6937645
Removed unused vars
Mil4n0r Sep 26, 2025
9923b15
Removed dead code
Mil4n0r Sep 26, 2025
9ea6a32
Fixed remaining eslint problems
Mil4n0r Sep 29, 2025
94f5ad7
Fixed small problem in eslint-config
Mil4n0r Sep 30, 2025
521787b
More modularity and cleaner linter options
Mil4n0r Sep 30, 2025
27338b3
Changed lint-staged format
Mil4n0r Sep 30, 2025
b4e5c0b
Refactored comment
Mil4n0r Sep 30, 2025
86584d6
Removed unneeded export
Mil4n0r Sep 30, 2025
feee654
Removed unneeded export
Mil4n0r Sep 30, 2025
9d613cb
Moved isHierarchyGridRow to not be used before declaration
Mil4n0r Sep 30, 2025
84fa566
Removed unneeded react fragment
Mil4n0r Sep 30, 2025
3d9e13e
Turned GroupItem into an arrow function
Mil4n0r Sep 30, 2025
f586780
Applied prettier to all the files
Mil4n0r Sep 30, 2025
7c165b2
Fixed routerLink example
Mil4n0r Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2.0.2
uses: lycheeverse/lychee-action@v2.0.2
5 changes: 1 addition & 4 deletions .github/workflows/create-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
run: cd scripts && npm install

- name: Run Autorespond Script
run:
node scripts/new_issue-message.js
run: node scripts/new_issue-message.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


4 changes: 2 additions & 2 deletions .github/workflows/inactive-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 15 days with no activity. If there are no further updates or modifications within the next 15 days, it will be automatically closed."
close-issue-message: "This issue has been closed as it has been inactive for 15 days since being marked as stale."
exempt-issue-labels: 'non-closable'
repo-token: ${{ secrets.GITHUB_TOKEN }}
exempt-issue-labels: "non-closable"
repo-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
3 changes: 1 addition & 2 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
http://localhost
%25PUBLIC_URL%25
http://localhost
3 changes: 0 additions & 3 deletions apps/website/.eslintrc.json

This file was deleted.

9 changes: 9 additions & 0 deletions apps/website/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import nextConfig from "@dxc-technology/eslint-config/next.js";
import { fileURLToPath } from "url";
import { dirname } from "path";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

/** @type {import("eslint").Config[]} */
export default [{ ignores: ["out/**", ".next/**", "eslint.config.js"] }, ...nextConfig({ tsconfigRootDir: __dirname })];
7 changes: 4 additions & 3 deletions apps/website/global-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
/* TODO: Remove global styles completely from the website */
body {
margin: 0;
font-family: Open Sans, sans-serif;
font-family:
Open Sans,
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}
13 changes: 9 additions & 4 deletions apps/website/next.config.js → apps/website/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/** @type {import('next').NextConfig} */
module.exports = {
import type { NextConfig } from "next";
import type { Configuration } from "webpack";

const nextConfig: NextConfig = {
images: {
loader: "custom",
},
output: "export",
trailingSlash: true,
webpack: (config) => {
config.module.rules.push({
webpack: (config: Configuration): Configuration => {
config.module = config.module || { rules: [] };
config.module.rules?.push({
test: /\.md$/,
use: "raw-loader",
});
Expand All @@ -30,3 +33,5 @@ module.exports = {
"@cloudscape-design/theming-runtime",
],
};

export default nextConfig;
6 changes: 3 additions & 3 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "eslint . --max-warnings 0"
},
"dependencies": {
"@cloudscape-design/components": "^3.0.706",
Expand Down Expand Up @@ -33,8 +33,8 @@
"@types/react": "^18",
"@types/react-color": "^3.0.6",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.4",
"eslint": "^9.36.0",
"eslint-config-next": "15.5.4",
"typescript": "^5.6.3"
}
}
19 changes: 11 additions & 8 deletions apps/website/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import Document, { Head, Html, Main, NextScript } from "next/document";
import Document, { DocumentContext, DocumentInitialProps, Head, Html, Main, NextScript } from "next/document";
import createEmotionServer from "@emotion/server/create-instance";
import React from "react";
import createCache from "@emotion/cache";
import { Children } from "react";

export default class MyDocument extends Document {
static async getInitialProps(ctx: any) {
static async getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps> {
const originalRenderPage = ctx.renderPage;

const cache = createCache({ key: "css", prepend: true });
const { extractCriticalToChunks } = createEmotionServer(cache);
const emotionServer = createEmotionServer(cache);

ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App: any) =>
enhanceApp: (App) =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function EnhanceApp(props: any) {
return <App emotionCache={cache} {...props} />;
},
});

const initialProps = await Document.getInitialProps(ctx);
const emotionStyles = extractCriticalToChunks(initialProps.html);
const emotionStyles = emotionServer.extractCriticalToChunks(initialProps.html);

const emotionStyleTags = emotionStyles.styles.map((style) => (
<style
data-emotion={`${style.key} ${style.ids.join(" ")}`}
Expand All @@ -30,10 +32,11 @@ export default class MyDocument extends Document {

return {
...initialProps,
styles: [...React.Children.toArray(initialProps.styles), ...emotionStyleTags],
styles: [...Children.toArray(initialProps.styles), ...emotionStyleTags],
};
}
render() {

render(): JSX.Element {
return (
<Html lang="en">
<Head />
Expand Down
2 changes: 1 addition & 1 deletion apps/website/pages/components/accordion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Head from "next/head";
import type { ReactElement } from "react";
import { type ReactElement } from "react";
import AccordionPageLayout from "screens/components/accordion/AccordionPageLayout";
import AccordionOverviewPage from "screens/components/accordion/overview/AccordionOverviewPage";

Expand Down
2 changes: 1 addition & 1 deletion apps/website/pages/foundations/tokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ const Tokens = () => (
</>
);

export default Tokens;
export default Tokens;
6 changes: 5 additions & 1 deletion apps/website/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ export default function Index() {
const { asPath, push } = useRouter();

useEffect(() => {
asPath === "/" && push("/overview/introduction");
if (asPath === "/") {
push("/overview/introduction").catch((err) => {
console.error("Navigation error:", err);
});
}
}, [asPath, push]);

return <></>;
Expand Down
2 changes: 1 addition & 1 deletion apps/website/pages/overview/releases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const getStaticProps: GetStaticProps<{
releases: Release[];
}> = async () => {
const response = await fetch("https://api.github.com/repos/dxc-technology/halstack-react/releases");
const releases: Release[] = await response.json();
const releases = (await response.json()) as Release[];
return { props: { releases } };
};

Expand Down
21 changes: 13 additions & 8 deletions apps/website/screens/common/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ const CodeBlock = ({ children }: { children: ReactNode }) => {
};

const copyCode = () => {
navigator.clipboard.writeText(children as string).then(() => {
setCopied(true);
setTimeout(() => {
setCopied(false);
}, 2500);
});
navigator.clipboard
.writeText(children as string)
.then(() => {
setCopied(true);
setTimeout(() => {
setCopied(false);
}, 2500);
})
.catch((err) => {
console.error("Could not copy text: ", err);
});
};

return (
Expand All @@ -59,6 +64,6 @@ const CodeBlock = ({ children }: { children: ReactNode }) => {
</PreformattedText>
</DxcFlex>
);
}
};

export default CodeBlock
export default CodeBlock;
1 change: 1 addition & 0 deletions apps/website/screens/common/HalstackMarkdownParser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const HalstackMarkdownParser = ({ markdown }: { markdown: string }) => (
h3: ({ children }) => (
<DxcHeading
level={4}
// eslint-disable-next-line no-control-regex
text={Children?.map(children, (child) => (child as string).replace(/[^\x00-\x7F]/g, ""))?.join("") ?? ""}
/>
),
Expand Down
3 changes: 2 additions & 1 deletion apps/website/screens/common/Image.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import NextImage from "next/image";
import type { StaticImageData } from "next/image";

const customLoader = ({ src }: { src: string }) =>
process.env.NODE_ENV === "production" ? src.replace("//", "/") : src;

type ImageProps = {
src: any;
src: string | StaticImageData;
alt: string;
width?: number;
height?: number;
Expand Down
20 changes: 15 additions & 5 deletions apps/website/screens/common/MainContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { ReactNode, useState, useEffect } from "react";
import styled from "@emotion/styled";
import { responsiveSizes } from "./variables";

interface NpmRegistryResponse {
"dist-tags": {
latest: string;
};
}

const MainContainer = styled.div`
margin: 80px auto;
max-width: 1124px;
Expand All @@ -25,16 +31,20 @@ const MainContent = ({ children }: { children: ReactNode }) => {
const [latestRelease, setLatestRelease] = useState<number | null>(null);

useEffect(() => {
(async () => {
const fetchLatestRelease = async () => {
try {
const response = await fetch("https://registry.npmjs.org/@dxc-technology/halstack-react/");
const data = await response.json();
const latestRelease = parseInt(data["dist-tags"].latest.split(".")[0], 10);
setLatestRelease(latestRelease);
const data = (await response.json()) as NpmRegistryResponse;
const majorVersionStr = data["dist-tags"].latest.split(".")[0];
if (majorVersionStr) {
const latestRelease = parseInt(majorVersionStr, 10);
setLatestRelease(latestRelease);
}
} catch (error) {
console.error("Error fetching version:", error);
}
})();
};
void fetchLatestRelease();
}, []);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion apps/website/screens/common/Section.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReactNode } from "react";
import { DxcFlex } from "@dxc-technology/halstack-react";
import HeadingLink from "./HeadingLink";
import { ReactNode } from "react";

type LevelEnum = 1 | 2 | 3 | 4 | 5;

Expand Down
4 changes: 2 additions & 2 deletions apps/website/screens/common/example/Example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ type ExamplePropTypes = {
actionsVisible?: boolean;
defaultIsVisible?: boolean;
example: {
scope: Record<string, any>;
scope: Record<string, unknown>;
code: string;
};
};

//
const Example = ({ actionsVisible = true, defaultIsVisible = false, example }: ExamplePropTypes) => {
const toast = useToast();
const [isCodeVisible, changeIsCodeVisible] = useState(defaultIsVisible);
Expand Down
10 changes: 8 additions & 2 deletions apps/website/screens/common/sidenav/SidenavLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from "@emotion/styled";
import Image from "@/common/Image";
import halstackLogo from "@/common/images/halstack_logo.svg";
import { DxcBadge, DxcFlex } from "@dxc-technology/halstack-react";
import halstackLogo from "@/common/images/halstack_logo.svg";

const LogoContainer = styled.div`
display: flex;
Expand Down Expand Up @@ -30,7 +30,13 @@ const SidenavLogo = ({ subtitle = "Design System" }: { subtitle?: string }) => {
<DxcFlex alignItems="center">
<LogoContainer>
<DxcFlex alignItems="center" gap="var(--spacing-gap-s)">
<Image alt="Halstack logo" height={24} src={halstackLogo} width={24} />
<Image
alt="Halstack logo"
height={24}
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
src={halstackLogo}
width={24}
/>
<Title>Halstack</Title>
</DxcFlex>
<Subtitle>{subtitle}</Subtitle>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DxcBulletedList, DxcFlex, DxcLink, DxcParagraph } from "@dxc-technology/halstack-react";
import { DxcBulletedList, DxcFlex, DxcParagraph } from "@dxc-technology/halstack-react";
import QuickNavContainer from "@/common/QuickNavContainer";
import DocFooter from "@/common/DocFooter";
import Image from "@/common/Image";
Expand All @@ -7,7 +7,6 @@ import Example from "@/common/example/Example";
import basicExample from "./examples/basicExample";
import nestedExample from "./examples/nestedExample";
import placement from "./images/accordion_placement.png";
import Link from "next/link";

const sections = [
{
Expand Down Expand Up @@ -139,7 +138,7 @@ const sections = [
<DxcBulletedList.Item>
<strong>Single-open behavior</strong>
<DxcParagraph>
Some implementations restrict the accordion to allow only one section to be open at a time. When a
Some implementations restrict the accordion to allow only one section to be open at a time. When a
user expands a new section, the previously expanded section collapses automatically. This pattern is
suitable when:
</DxcParagraph>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const sections = [
<>
<DxcParagraph>
Halstack's Alert component is designed to provide clear and accessible feedback to users, ensuring important
messages stand out within an interface. It supports different variants — info, success, warning, and
error — allowing teams to communicate various levels of urgency effectively. With options for dismissibility and
messages stand out within an interface. It supports different variants — info, success, warning, and error —
allowing teams to communicate various levels of urgency effectively. With options for dismissibility and
customizable content, it adapts to different use cases while maintaining consistency. Its structured design
enhances readability and ensures a non-intrusive yet noticeable presence.
</DxcParagraph>
Expand Down
Loading