diff --git a/docs/components/phase.mdx b/docs/components/phase.mdx new file mode 100644 index 0000000..4efaddb --- /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..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": "6.20.1", + "dd360-ds": "6.22.0", "dd360-utils": "18.1.0", "gray-matter": "^4.0.3", "i18next": "^22.4.9", @@ -1525,9 +1525,9 @@ "dev": true }, "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==", + "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", @@ -8005,9 +8005,9 @@ "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": "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 c6cb680..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": "6.20.1", + "dd360-ds": "6.22.0", "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; +}