From 9c4aaa2b2b2a42860f370c96cc4c9478dc2688b2 Mon Sep 17 00:00:00 2001 From: arielsrodriguez Date: Fri, 25 Apr 2025 09:03:12 -0300 Subject: [PATCH 1/4] fix: documentation chip component was added --- docs/components/badge.mdx | 103 ++++++--------------- docs/components/chip.mdx | 125 ++++++++++++++++++++++++++ package-lock.json | 14 +-- package.json | 2 +- src/components/Layout/SideBarDocs.tsx | 4 + 5 files changed, 164 insertions(+), 84 deletions(-) create mode 100644 docs/components/chip.mdx diff --git a/docs/components/badge.mdx b/docs/components/badge.mdx index f755eb9..8cf79f5 100644 --- a/docs/components/badge.mdx +++ b/docs/components/badge.mdx @@ -9,9 +9,9 @@ components: Badge -# +# -The Badge component in React provides a convenient way to display a small piece of information, such as a status, in a visually appealing and attention-grabbing manner. +The Badge component is used to display small numeric values or status indicators. It’s ideal for showing counts or notifications, typically in a rounded visual container.
@@ -21,105 +21,56 @@ The Badge component in React provides a convenient way to display a small piece ##### Usage -To use the Badge component, you could start by adding the properties text, classNameIcon and className. - -Use the Badge component as shown below: +To use the Badge component, provide a `value` (number) and optionally a `variant` to indicate the type of status. - + The code snippet below shows how to use the Badge component: -`}/> + +`} +/>
-##### Variant + ##### Variants -With the prop variant you can customize the appearance of the Badge component. Available options are: warning, infoPrimary, infoSecondary, success, primary, secondary, and error. Default uses: "infoPrimary". +The `variant` prop allows you to customize the appearance of the Badge. Available options are: `default`, `success`, `warning`, and `error`. The default value is `"default"`. - - - - - - - - + + + + + -The code snippet below shows how to set a Badge component variant: - - - - - - - -`}/> - -
+ codeString={`import { Badge } from 'dd360-ds' -##### Icon - -With the prop icon you can customize the icon of the Badge component. Available options are: tag, clock, warning, check, success, exclamation, clipboard-copy, HomeIcon, RefreshIcon, and none. Default uses: "HomeIcon". - - - - - - - - - - - - - - -The code snippet below shows how to set a Badge component icon: - - - - - - - - - - - -`}/> + + + + +`} +/>
-
+
##### API Reference -Note: This documentation assumes that the audience has basic knowledge of React -and how to use components in React applications. +Note: This documentation assumes that the audience has basic knowledge of React and how to use components in React applications. - \ No newline at end of file + diff --git a/docs/components/chip.mdx b/docs/components/chip.mdx new file mode 100644 index 0000000..4de72ba --- /dev/null +++ b/docs/components/chip.mdx @@ -0,0 +1,125 @@ +--- +product: dd360-ds +title: React Chip component +components: Chip +--- + +
+
+ + + +# + +The Chip component in React provides a convenient way to display a small piece of information, such as a status, in a visually appealing and attention-grabbing manner. + +
+ +##### Imports + + + +##### Usage + +To use the Chip component, you could start by adding the properties text, classNameIcon and className. + +Use the Chip component as shown below: + + + + + +The code snippet below shows how to use the Chip component: + + +`}/> + +
+ +##### Variant + +With the prop variant you can customize the appearance of the Chip component. Available options are: warning, infoPrimary, infoSecondary, success, primary, secondary, and error. Default uses: "infoPrimary". + + + + + + + + + + + +The code snippet below shows how to set a Chip component variant: + + + + + + + + +`}/> + +
+ +##### Icon + +With the prop icon you can customize the icon of the Chip component. Available options are: tag, clock, warning, check, success, exclamation, clipboard-copy, HomeIcon, RefreshIcon, and none. Default uses: "HomeIcon". + + + + + + + + + + + + + + +The code snippet below shows how to set a Chip component icon: + + + + + + + + + + + +`}/> + +
+
+ +##### API Reference + + + +Note: This documentation assumes that the audience has basic knowledge of React +and how to use components in React applications. + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 80b105f..6588291 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@algolia/autocomplete-core": "^1.8.3", "@docsearch/react": "^3.5.1", "@vercel/analytics": "^1.0.1", - "dd360-ds": "6.39.1", + "dd360-ds": "6.39.5", "dd360-utils": "18.1.0", "gray-matter": "^4.0.3", "i18next": "^22.4.9", @@ -1526,9 +1526,9 @@ "dev": true }, "node_modules/dd360-ds": { - "version": "6.39.1", - "resolved": "https://registry.npmjs.org/dd360-ds/-/dd360-ds-6.39.1.tgz", - "integrity": "sha512-vKKwo3f4x5i+bLrHjFX+ZXWNrska7jdPTFbdi3WDpoOJ39GsjXl7ncG7OGZwcWDuLqubaSDcSNcqrcE3nKKcUQ==", + "version": "6.39.5", + "resolved": "https://registry.npmjs.org/dd360-ds/-/dd360-ds-6.39.5.tgz", + "integrity": "sha512-KNzXDDv2+ICgYz7WguUW+05mocVmg0JWCKKWg4A+b0GxFfyNGjYHf82gn5og1V43r6cWfMZCE5hPuEEjgxSFYA==", "license": "MIT", "dependencies": { "@heroicons/react": "^1.0.6", @@ -8009,9 +8009,9 @@ "dev": true }, "dd360-ds": { - "version": "6.39.1", - "resolved": "https://registry.npmjs.org/dd360-ds/-/dd360-ds-6.39.1.tgz", - "integrity": "sha512-vKKwo3f4x5i+bLrHjFX+ZXWNrska7jdPTFbdi3WDpoOJ39GsjXl7ncG7OGZwcWDuLqubaSDcSNcqrcE3nKKcUQ==", + "version": "6.39.5", + "resolved": "https://registry.npmjs.org/dd360-ds/-/dd360-ds-6.39.5.tgz", + "integrity": "sha512-KNzXDDv2+ICgYz7WguUW+05mocVmg0JWCKKWg4A+b0GxFfyNGjYHf82gn5og1V43r6cWfMZCE5hPuEEjgxSFYA==", "requires": { "@heroicons/react": "^1.0.6", "@popperjs/core": "2.11.8", diff --git a/package.json b/package.json index 61718bc..5736042 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@algolia/autocomplete-core": "^1.8.3", "@docsearch/react": "^3.5.1", "@vercel/analytics": "^1.0.1", - "dd360-ds": "6.39.1", + "dd360-ds": "6.39.5", "dd360-utils": "18.1.0", "gray-matter": "^4.0.3", "i18next": "^22.4.9", diff --git a/src/components/Layout/SideBarDocs.tsx b/src/components/Layout/SideBarDocs.tsx index 843890f..4cc5f68 100644 --- a/src/components/Layout/SideBarDocs.tsx +++ b/src/components/Layout/SideBarDocs.tsx @@ -315,6 +315,10 @@ export const components: ComponentObjectProps = { label: 'Circle', pathname: 'circle' }, + { + label: 'Chip', + pathname: 'chip' + }, { label: 'Confirm Dialog', pathname: 'confirm-dialog' From d81cc5a81b463a1d2c6e5cc88dbd8b1f1156d2cd Mon Sep 17 00:00:00 2001 From: arielsrodriguez Date: Fri, 25 Apr 2025 11:26:38 -0300 Subject: [PATCH 2/4] fix: change workflow --- .github/workflows/sonarcloud.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 0b41db2..e945f14 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -13,12 +13,20 @@ jobs: runs-on: ubuntu-latest steps: - - name: Analyze with SonarCloud + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Java 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Analyze with SonarCloud uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret) + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: args: -Dsonar.projectKey=dd3tech_dd360-components-docs From 272f54f995730afcb6a6d8c36f80b55fe609f7ed Mon Sep 17 00:00:00 2001 From: arielsrodriguez Date: Fri, 25 Apr 2025 11:39:46 -0300 Subject: [PATCH 3/4] test --- .github/workflows/sonarcloud.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index e945f14..dbdba5a 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -14,12 +14,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v3 - - name: Set up Java 17 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: 'zulu' java-version: '17' - name: Analyze with SonarCloud From d677b20d0f24ac3fc477b1acb5839aec294b89eb Mon Sep 17 00:00:00 2001 From: arielsrodriguez Date: Fri, 25 Apr 2025 11:51:14 -0300 Subject: [PATCH 4/4] testing --- .github/workflows/sonarcloud.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index dbdba5a..65519a2 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -15,6 +15,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set up JDK 17 uses: actions/setup-java@v3 @@ -22,12 +24,20 @@ jobs: distribution: 'zulu' java-version: '17' + - name: Cache SonarCloud packages + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Analyze with SonarCloud - uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049 + uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: - args: + args: > -Dsonar.projectKey=dd3tech_dd360-components-docs - -Dsonar.organization=dd3tech-1 + -Dsonar.organization=dd3tech-1 -Dsonar.sourceEncoding=UTF-8 + -Dsonar.sources=.