From 842e17df8bc6720d4bb0424e1fc22148feb56c3f Mon Sep 17 00:00:00 2001 From: gnxcode Date: Fri, 19 Jan 2024 18:53:32 -0500 Subject: [PATCH 1/3] Feat: Add phase documentation --- docs/components/phase.mdx | 346 ++++++++++++++++++++ package-lock.json | 12 +- package.json | 2 +- src/components/Layout/SideBarDocs.tsx | 5 + src/hooks/useGetComponents.tsx | 4 +- src/modules/docs/components/PhaseCustom.tsx | 29 ++ src/modules/docs/components/index.ts | 1 + src/theme/global.css | 15 + 8 files changed, 406 insertions(+), 8 deletions(-) create mode 100644 docs/components/phase.mdx create mode 100644 src/modules/docs/components/PhaseCustom.tsx diff --git a/docs/components/phase.mdx b/docs/components/phase.mdx new file mode 100644 index 0000000..b0c3d98 --- /dev/null +++ b/docs/components/phase.mdx @@ -0,0 +1,346 @@ +--- +product: dd360-ds +title: React Phase component +components: Phase +--- + +
+
+ + + +# + +The Phase component is a user interface component that is used to display the status of a process. This component has three variants: , and + +
+
+##### Imports + +The first alternative is recommended since they can reduce the application bundle + + + + +
+##### Usage + +Use the Phase component as shown below: + + + + + +The code snippet below shows how to use the Phase component: + +`} +/> + +
+##### Variant Phases + +This variant , you can customize it with the following props: + + + icon: Specifies the icon of the Phase. + numberPhase: Specifies the number of the Phase. + title: Specifies the title of the Phase. The default value is Title. + textTag: Specifies the phase status text. The default value is Pending. + status: Specifies the state of the phase.The values they can receive are: completed, active and default. The default value is default. + className: Specifies the classes necessary to use the phase component, for example in width and height of the component. + + + + + + + + + + + + + + + + + ) +}`} /> + +
+ +##### Variant Status + +This variant , you can customize it with the following props: + + + title: Specifies the title of the Phase. The default value is Title. + subtitle: Specifies the subtitle of the Status. + textTag: Specifies the status text. The default value is Pending. + status: Specifies the status of the state. The values they can receive are: success, active and selected. The default value is selected. + className: Specifies the classes necessary to use the phase component, for example in width and height of the component. + + + + + + + + + + + + + + + + + ) +}`} /> + +
+ +##### Variant Quarters + +This variant , you can customize it with the following props: + + + icon: Specifies the icon of the Quarters. + title: Specifies the title of the Quarter. The default value is Title. + status: Specifies the status of the state. The values they can receive are: success, active and selected. The default value is selected. + listData: Specifies the data of the Quarters. + className: Specifies the classes necessary to use the phase component, for example in width and height of the component. + + + + + + + + + + + + + + + ) +}`} /> + +
+ +##### API Reference + + + + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9e6eade..4f550d6 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.20.1", + "dd360-ds": "https://pkg.csb.dev/dd3tech/bui/commit/a46e1955/dd360-ds", "dd360-utils": "18.1.0", "gray-matter": "^4.0.3", "i18next": "^22.4.9", @@ -1526,8 +1526,9 @@ }, "node_modules/dd360-ds": { "version": "6.20.1", - "resolved": "https://registry.npmjs.org/dd360-ds/-/dd360-ds-6.20.1.tgz", - "integrity": "sha512-1UUu9wKHao7KZhPEc275+A80PVZ7g9Cgcm8+SGDMtSYMyY96L2fjnZGRZou/5Q3P+ODsksXnQf2TEAG1ZFh1XQ==", + "resolved": "https://pkg.csb.dev/dd3tech/bui/commit/a46e1955/dd360-ds", + "integrity": "sha512-+Gr4qh4WkywlEBr3Gqc9xyc4j26yoLV+2rNDNBSibhS4Kt8GVd3fAMt/XaNONvRvUZYKmTYUhJhyYDRbc8n9kw==", + "license": "MIT", "dependencies": { "@heroicons/react": "^1.0.5", "@popperjs/core": "2.11.7", @@ -8005,9 +8006,8 @@ "dev": true }, "dd360-ds": { - "version": "6.20.1", - "resolved": "https://registry.npmjs.org/dd360-ds/-/dd360-ds-6.20.1.tgz", - "integrity": "sha512-1UUu9wKHao7KZhPEc275+A80PVZ7g9Cgcm8+SGDMtSYMyY96L2fjnZGRZou/5Q3P+ODsksXnQf2TEAG1ZFh1XQ==", + "version": "https://pkg.csb.dev/dd3tech/bui/commit/a46e1955/dd360-ds", + "integrity": "sha512-+Gr4qh4WkywlEBr3Gqc9xyc4j26yoLV+2rNDNBSibhS4Kt8GVd3fAMt/XaNONvRvUZYKmTYUhJhyYDRbc8n9kw==", "requires": { "@heroicons/react": "^1.0.5", "@popperjs/core": "2.11.7", diff --git a/package.json b/package.json index c6cb680..500e7ff 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.20.1", + "dd360-ds": "https://pkg.csb.dev/dd3tech/bui/commit/a46e1955/dd360-ds", "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 2d23a54..4730c6f 100644 --- a/src/components/Layout/SideBarDocs.tsx +++ b/src/components/Layout/SideBarDocs.tsx @@ -356,6 +356,11 @@ export const components: ComponentObjectProps = { label: 'Portal', pathname: 'portal' }, + { + label: 'Phase', + pathname: 'phase', + badge: BADGE_TYPES.new + }, { label: 'Progress', pathname: 'progress', diff --git a/src/hooks/useGetComponents.tsx b/src/hooks/useGetComponents.tsx index b9a3e50..4768113 100644 --- a/src/hooks/useGetComponents.tsx +++ b/src/hooks/useGetComponents.tsx @@ -29,7 +29,8 @@ import { SwitchCustom, AlertReactKnowledge, HeaderDocCustom, - TagCustom + TagCustom, + PhaseCustom } from '@/modules/docs' import { TransitionCustom } from '@/components/Layout' import { useTheme } from '@/store/theme-store' @@ -153,6 +154,7 @@ export function useGetComponents() { AlertReactKnowledge, HeaderDocCustom, TagCustom, + PhaseCustom, ...Components, SideBar // Add other custom components here as needed ---| Here |--- diff --git a/src/modules/docs/components/PhaseCustom.tsx b/src/modules/docs/components/PhaseCustom.tsx new file mode 100644 index 0000000..bd12eae --- /dev/null +++ b/src/modules/docs/components/PhaseCustom.tsx @@ -0,0 +1,29 @@ +import { Phase, IPhaseProps } from 'dd360-ds' +import { InformationCircleIcon } from '@heroicons/react/solid' +import { + CalendarIcon, + ScaleIcon, + DocumentAddIcon, + CheckIcon +} from '@heroicons/react/outline' + +interface CustomTagProps { + icon?: 'check' | 'search' | 'balance' | 'calendar' + variant?: IPhaseProps['variant'] + status: 'default' | 'active' | 'success' | 'selected' | 'completed' +} + +const availableIcons = { + check: CheckIcon, + search: DocumentAddIcon, + balance: ScaleIcon, + calendar: CalendarIcon +} + +const PhaseCustom = ({ icon, variant, ...otherProps }: CustomTagProps) => { + const customIcon = icon ? availableIcons[icon] : undefined + + return +} + +export default PhaseCustom diff --git a/src/modules/docs/components/index.ts b/src/modules/docs/components/index.ts index 41abd74..dace953 100644 --- a/src/modules/docs/components/index.ts +++ b/src/modules/docs/components/index.ts @@ -10,3 +10,4 @@ export { default as DropdownCustom } from './DropdownCustom' export { default as AlertReactKnowledge } from './AlertReactKnowledge' export { default as HeaderDocCustom } from './HeaderDocCustom' export { default as TagCustom } from './TagCustom' +export { default as PhaseCustom } from './PhaseCustom' diff --git a/src/theme/global.css b/src/theme/global.css index cf22c64..28edfb1 100644 --- a/src/theme/global.css +++ b/src/theme/global.css @@ -327,3 +327,18 @@ div ::-webkit-scrollbar-corner { .container-cmpnt-doc span.success-filled-tag-class { color: #ecfdf5 !important; } +div[role="container-phase"] .text-blue-50 { + color: #eff6ff !important; +} +div[role="container-phase"] .text-gray-600 { + color: #4b5563 !important; +} +div[role="container-phase"] .bg-green-500 { + color: #ecfdf5 !important; +} +div[role="container-phase"] .text-blue-700 { + color: #1d4ed8 !important; +} +div[role="container-phase"] hr { + border-color: #d1d5db !important; +} From b53357d3d9932bb9aa3dd5d55b2bf10d8630dffd Mon Sep 17 00:00:00 2001 From: gnxcode Date: Mon, 22 Jan 2024 11:14:29 -0500 Subject: [PATCH 2/3] fix: update label in English --- docs/components/phase.mdx | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/components/phase.mdx b/docs/components/phase.mdx index b0c3d98..4efaddb 100644 --- a/docs/components/phase.mdx +++ b/docs/components/phase.mdx @@ -64,7 +64,7 @@ This variant , you can customize it with the following - + @@ -95,7 +95,7 @@ export default function App() { className="w-44 h-40" icon={ScaleIcon} status="default" - textTag="Pendiente" + textTag="Pending" numberPhase={3} /> @@ -133,7 +133,7 @@ This variant , you can customize it with the following subtitle="Subtitle" variant="status" status="active" - textTag="Pendiente" + textTag="Pending" /> , you can customize it with the followin listData={[ { completed: true, - label: "Anuales", + label: "Annual", }, { completed: true, - label: "4° Trimestre", + label: "4° Quarter", }, { completed: true, - label: "3° Trimestre", + label: "3° Quarter", }, { completed: true, - label: "2° Trimestre", + label: "2° Quarter", }, { completed: false, - label: "1° Trimestre", + label: "1° Quarter", }, ]} /> , you can customize it with the followin listData={[ { completed: true, - label: "Anuales", + label: "Annual", }, { completed: true, - label: "4° Trimestre", + label: "4° Quarter", }, { completed: true, - label: "3° Trimestre", + label: "3° Quarter", }, { completed: true, - label: "2° Trimestre", + label: "2° Quarter", }, { completed: false, - label: "1° Trimestre", + label: "1° Quarter", }, ]} /> @@ -270,23 +270,23 @@ export default function App() { listData={[ { completed: true, - label: "Anuales", + label: "Annual", }, { completed: true, - label: "4° Trimestre", + label: "4° Quarter", }, { completed: true, - label: "3° Trimestre", + label: "3° Quarter", }, { completed: true, - label: "2° Trimestre", + label: "2° Quarter", }, { completed: false, - label: "1° Trimestre", + label: "1° Quarter", }, ]} /> @@ -298,23 +298,23 @@ export default function App() { listData={[ { completed: true, - label: "Anuales", + label: "Annual", }, { completed: true, - label: "4° Trimestre", + label: "4° Quarter", }, { completed: true, - label: "3° Trimestre", + label: "3° Quarter", }, { completed: true, - label: "2° Trimestre", + label: "2° Quarter", }, { completed: false, - label: "1° Trimestre", + label: "1° Quarter", }, ]} /> From 967f8be5490de0cf0c515cb14cca968c7ec072f5 Mon Sep 17 00:00:00 2001 From: gnxcode Date: Tue, 30 Jan 2024 15:34:44 -0500 Subject: [PATCH 3/3] feat: update version bui --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4f550d6..ddfdc6d 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": "https://pkg.csb.dev/dd3tech/bui/commit/a46e1955/dd360-ds", + "dd360-ds": "6.22.0", "dd360-utils": "18.1.0", "gray-matter": "^4.0.3", "i18next": "^22.4.9", @@ -1525,10 +1525,9 @@ "dev": true }, "node_modules/dd360-ds": { - "version": "6.20.1", - "resolved": "https://pkg.csb.dev/dd3tech/bui/commit/a46e1955/dd360-ds", - "integrity": "sha512-+Gr4qh4WkywlEBr3Gqc9xyc4j26yoLV+2rNDNBSibhS4Kt8GVd3fAMt/XaNONvRvUZYKmTYUhJhyYDRbc8n9kw==", - "license": "MIT", + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/dd360-ds/-/dd360-ds-6.22.0.tgz", + "integrity": "sha512-KgQIlsLZyx90iYT73rY8c+y+73EC4X8JCeMaWOCMMkREvX7Wd3HMsNf0yQ/oo0K0lmV8Kg77DpGM3vzmvEPmlQ==", "dependencies": { "@heroicons/react": "^1.0.5", "@popperjs/core": "2.11.7", @@ -8006,8 +8005,9 @@ "dev": true }, "dd360-ds": { - "version": "https://pkg.csb.dev/dd3tech/bui/commit/a46e1955/dd360-ds", - "integrity": "sha512-+Gr4qh4WkywlEBr3Gqc9xyc4j26yoLV+2rNDNBSibhS4Kt8GVd3fAMt/XaNONvRvUZYKmTYUhJhyYDRbc8n9kw==", + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/dd360-ds/-/dd360-ds-6.22.0.tgz", + "integrity": "sha512-KgQIlsLZyx90iYT73rY8c+y+73EC4X8JCeMaWOCMMkREvX7Wd3HMsNf0yQ/oo0K0lmV8Kg77DpGM3vzmvEPmlQ==", "requires": { "@heroicons/react": "^1.0.5", "@popperjs/core": "2.11.7", diff --git a/package.json b/package.json index 500e7ff..7d57312 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": "https://pkg.csb.dev/dd3tech/bui/commit/a46e1955/dd360-ds", + "dd360-ds": "6.22.0", "dd360-utils": "18.1.0", "gray-matter": "^4.0.3", "i18next": "^22.4.9",