Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Quality Update #2033

Open
wants to merge 128 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 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
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file added .eslintrc.js
Empty file.
1 change: 1 addition & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
exitOnceUploaded: true
exitZeroOnChanges: true
workingDir: packages/lib
forceRebuild: true

- name: Run Storybook Tests
run: |
Expand Down
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
8 changes: 8 additions & 0 deletions .lintstagedrc.js
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prettier part will be uncommented on a separate PR to prevent increasing the review size (even further)

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
"(apps|packages)/**/*.(ts|tsx|js)": (filenames) => {
return [
`npx eslint --fix --max-warnings 0 ${filenames.join(" ")}`,
// `npx prettier --write ${filenames.join(" ")}`
];
},
};
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
14 changes: 13 additions & 1 deletion apps/website/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
{
"extends": "next/core-web-vitals"
"extends": ["next/core-web-vitals", "@dxc-technology/eslint-config/react-internal.js", "@dxc-technology/eslint-config/next.js"],
"rules": {
"no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
// TODO: Remove rules
"react/no-unescaped-entities": "off",
"import/no-anonymous-default-export": "off",
"react-hooks/exhaustive-deps": "off"
}
}
2 changes: 1 addition & 1 deletion 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
13 changes: 8 additions & 5 deletions apps/website/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import StatusBadge from "@/common/StatusBadge";
import "../global-styles.css";

type NextPageWithLayout = NextPage & {
getLayout?: (page: ReactElement) => ReactNode;
getLayout?: (_page: ReactElement) => ReactNode;
};
type AppPropsWithLayout = AppProps & {
Component: NextPageWithLayout;
};
type ApplicationLayoutWrapperProps = {
condition: boolean;
wrapper: (children: React.ReactNode) => JSX.Element;
wrapper: (_children: ReactNode) => JSX.Element;
children: ReactNode;
};

Expand Down Expand Up @@ -53,9 +53,12 @@ const MyApp = ({ Component, pageProps }: AppPropsWithLayout) => {
};

const matchPaths = (linkPath: string) => {
const pathToBeMatched = currentPath.split("#")[0].slice(0, -1);
const desiredPaths = [linkPath, `${linkPath}/specifications`, `${linkPath}/usage`];
return desiredPaths.includes(pathToBeMatched);
const pathToBeMatched = currentPath?.split("#")[0]?.slice(0, -1);
if (pathToBeMatched) {
const desiredPaths = [linkPath, `${linkPath}/specifications`, `${linkPath}/usage`];
return desiredPaths.includes(pathToBeMatched);
}
return false;
};

return (
Expand Down
1 change: 0 additions & 1 deletion apps/website/screens/common/ComponentHeading.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DxcHeading } from "@dxc-technology/halstack-react";
import React from "react";

type ComponentHeadingProps = {
name: string;
Expand Down
6 changes: 2 additions & 4 deletions apps/website/screens/common/HalstackMarkdownParser.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DxcBulletedList, DxcHeading, DxcLink } from "@dxc-technology/halstack-react";
import { ReactMarkdown } from "react-markdown/lib/react-markdown";
import Code from "./Code";
import React from "react";
import { Children } from "react";

type Props = { markdown: string };

Expand All @@ -16,9 +16,7 @@ const HalstackMarkdownParser = ({ markdown }: Props) => (
code: ({ children }) => <Code>{children}</Code>,
h3: ({ children }) => <DxcHeading level={4} text={children as string} />,
ul: ({ children }) => (
<DxcBulletedList>
{React.Children.map(children, (child) => (child !== "\n" ? child : undefined))}
</DxcBulletedList>
<DxcBulletedList>{Children.map(children, (child) => (child !== "\n" ? child : undefined))}</DxcBulletedList>
),
li: ({ children }) => <DxcBulletedList.Item>{children}</DxcBulletedList.Item>,
}}
Expand Down
1 change: 0 additions & 1 deletion apps/website/screens/common/HeadingLink.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import styled from "styled-components";
import slugify from "slugify";
import { DxcBleed, DxcHeading } from "@dxc-technology/halstack-react";
Expand Down
4 changes: 2 additions & 2 deletions apps/website/screens/common/PageHeading.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { ReactNode } from "react";
import styled from "styled-components";

const PageHeading = ({ children }: { children: React.ReactNode }) => {
const PageHeading = ({ children }: { children: ReactNode }) => {
return <PageHeadingContainer>{children}</PageHeadingContainer>;
};

Expand Down
1 change: 0 additions & 1 deletion apps/website/screens/common/QuickNavContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import styled from "styled-components";
import { DxcGrid, DxcQuickNav } from "@dxc-technology/halstack-react";
import Section, { SectionType } from "./Section";
Expand Down
4 changes: 2 additions & 2 deletions apps/website/screens/common/Section.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import { ReactNode } from "react";
import { DxcFlex } from "@dxc-technology/halstack-react";
import HeadingLink from "./HeadingLink";

Expand All @@ -8,7 +8,7 @@ export type SectionType = {
title: string;
level?: LevelEnum;
subSections?: SectionType[];
content?: React.ReactNode;
content?: ReactNode;
navSubtitle?: string;
};

Expand Down
2 changes: 1 addition & 1 deletion apps/website/screens/common/StatusBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getBadgeTitle = (status: StatusBadgeProps["status"]) => {

const StatusBadge = ({ hasTitle = false, status }: StatusBadgeProps) => (
<DxcBadge
label={status[0].toUpperCase() + status.slice(1)}
label={status[0]?.toUpperCase() + status.slice(1)}
color={getBadgeColor(status)}
title={hasTitle ? getBadgeTitle(status) : undefined}
size="small"
Expand Down
2 changes: 0 additions & 2 deletions apps/website/screens/common/TabsPageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { useRouter } from "next/router";
import { DxcNavTabs } from "@dxc-technology/halstack-react";
import React from "react";
import Link from "next/link";
import styled from "styled-components";

type TabsPageLayoutProps = {
tabs: { label: string; path: string }[];
Expand Down
6 changes: 3 additions & 3 deletions apps/website/screens/common/example/Example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { LiveProvider, LiveEditor, LiveError, LivePreview } from "react-live";
import theme from "./liveEditorTheme";
import { DxcButton } from "@dxc-technology/halstack-react";

type Example = {
type ExampleType = {
scope?: object;
code?: string;
};
type ExamplePropTypes = {
actionsVisible?: boolean;
defaultIsVisible?: boolean;
example: Example;
example: ExampleType;
};

const icons = {
Expand All @@ -34,7 +34,7 @@ const Example = ({ actionsVisible = true, defaultIsVisible = false, example }: E
const [isCodeVisible, changeIsCodeVisible] = useState(defaultIsVisible);
const [copied, changeCopied] = useState(false);

const liveEditorRef = useRef<HTMLDivElement>(null);
const liveEditorRef = useRef<HTMLDivElement | null>(null);

const handleCodeOnClick = () => {
changeIsCodeVisible(!isCodeVisible);
Expand Down
4 changes: 2 additions & 2 deletions apps/website/screens/common/pagesList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const getNavigationLinks = (currentPath: string): NavigationLinks => {
const previousLinkIndex = currentLinkIndex - 1;
const previousLinkExists = previousLinkIndex >= 0;
return {
previousLink: previousLinkExists ? links[previousLinkIndex] : null,
nextLink: nextLinkExists ? links[nextLinkIndex] : null,
previousLink: previousLinkExists ? (links[previousLinkIndex] ?? null) : null,
nextLink: nextLinkExists ? (links[nextLinkIndex] ?? null) : null,
};
};
170 changes: 87 additions & 83 deletions apps/website/screens/components/badge/code/BadgeCodePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,89 +13,93 @@ const sections = [
title: "Props",
content: (
<DxcTable>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td>label</td>
<td>
<TableCode>string</TableCode>
</td>
<td>Text to be placed in the badge.</td>
<td>-</td>
</tr>
<tr>
<td>mode</td>
<td>
<TableCode>'contextual' | 'notification'</TableCode>
</td>
<td>The available badge modes.</td>
<td>
<TableCode>'contextual'</TableCode>
</td>
</tr>
<tr>
<td>notificationLimit</td>
<td>
<TableCode>number</TableCode>
</td>
<td>
In notification mode, if the number entered as label is greater that this notification limit,{" "}
<TableCode>+notificationLimit</TableCode> will be shown. If not, the entered text will be shown as label.
</td>
<td>
<TableCode>99</TableCode>
</td>
</tr>
<tr>
<td>title</td>
<td>
<TableCode>string</TableCode>
</td>
<td>
Text representing advisory information related to the badge. Under the hood, this prop also serves as an
accessible label for the component.
</td>
<td>-</td>
</tr>
<tr>
<td>color</td>
<td>
<TableCode>'grey' | 'blue' | 'green' | 'orange' | 'red' | 'yellow' | 'purple'</TableCode>
</td>
<td>Affects the visual style of the badge. It can be used following semantic purposes or not.</td>
<td>
<TableCode>'grey'</TableCode>
</td>
</tr>
<tr>
<td>icon</td>
<td>
<TableCode>string | {"(React.ReactNode & React.SVGProps <SVGSVGElement>)"}</TableCode>
</td>
<td>
<DxcLink newWindow href="https://fonts.google.com/icons">
Material Symbol
</DxcLink>{" "}
name or SVG element as the icon that will be placed next to the badge label. When using Material Symbols,
replace spaces with underscores. By default they are outlined, if you want it to be filled prefix the symbol
name with <TableCode>"filled_"</TableCode>.
</td>
<td>-</td>
</tr>
<tr>
<td>size</td>
<td>
<TableCode>'small' | 'medium' | 'large'</TableCode>
</td>
<td>Size of the component.</td>
<td>
<TableCode>'medium'</TableCode>
</td>
</tr>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>label</td>
<td>
<TableCode>string</TableCode>
</td>
<td>Text to be placed in the badge.</td>
<td>-</td>
</tr>
<tr>
<td>mode</td>
<td>
<TableCode>'contextual' | 'notification'</TableCode>
</td>
<td>The available badge modes.</td>
<td>
<TableCode>'contextual'</TableCode>
</td>
</tr>
<tr>
<td>notificationLimit</td>
<td>
<TableCode>number</TableCode>
</td>
<td>
In notification mode, if the number entered as label is greater that this notification limit,{" "}
<TableCode>+notificationLimit</TableCode> will be shown. If not, the entered text will be shown as label.
</td>
<td>
<TableCode>99</TableCode>
</td>
</tr>
<tr>
<td>title</td>
<td>
<TableCode>string</TableCode>
</td>
<td>
Text representing advisory information related to the badge. Under the hood, this prop also serves as an
accessible label for the component.
</td>
<td>-</td>
</tr>
<tr>
<td>color</td>
<td>
<TableCode>'grey' | 'blue' | 'green' | 'orange' | 'red' | 'yellow' | 'purple'</TableCode>
</td>
<td>Affects the visual style of the badge. It can be used following semantic purposes or not.</td>
<td>
<TableCode>'grey'</TableCode>
</td>
</tr>
<tr>
<td>icon</td>
<td>
<TableCode>string | {"(React.ReactNode & React.SVGProps <SVGSVGElement>)"}</TableCode>
</td>
<td>
<DxcLink newWindow href="https://fonts.google.com/icons">
Material Symbol
</DxcLink>{" "}
name or SVG element as the icon that will be placed next to the badge label. When using Material Symbols,
replace spaces with underscores. By default they are outlined, if you want it to be filled prefix the
symbol name with <TableCode>"filled_"</TableCode>.
</td>
<td>-</td>
</tr>
<tr>
<td>size</td>
<td>
<TableCode>'small' | 'medium' | 'large'</TableCode>
</td>
<td>Size of the component.</td>
<td>
<TableCode>'medium'</TableCode>
</td>
</tr>
</tbody>
</DxcTable>
),
},
Expand Down
Loading
Loading