From 4ff2faf3b5a9664ab1dcee5be1105b59b908c149 Mon Sep 17 00:00:00 2001 From: Matheus Alves Date: Thu, 16 May 2024 14:29:42 -0300 Subject: [PATCH] feat: add variant in status component (#212) --- styleguide/src/Indicators/Status/Status.spec.tsx | 8 ++++++++ styleguide/src/Indicators/Status/Status.tsx | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/styleguide/src/Indicators/Status/Status.spec.tsx b/styleguide/src/Indicators/Status/Status.spec.tsx index 051ffc3e..d86d8796 100644 --- a/styleguide/src/Indicators/Status/Status.spec.tsx +++ b/styleguide/src/Indicators/Status/Status.spec.tsx @@ -21,6 +21,9 @@ describe(specTitle('Status tests'), () => { mount() cy.get('.indicator-status').find('.rounded-full').should('have.class', 'bg-success') + mount() + cy.get('.indicator-status').find('.rounded-full').should('have.class', 'bg-success-dark') + mount() cy.get('.indicator-status').find('.rounded-full').should('have.class', 'bg-warning') @@ -36,4 +39,9 @@ describe(specTitle('Status tests'), () => { cy.get('.indicator-status *').first().contains('Aprovado') }) + it('Description', () => { + mount(Aprovado} />) + cy.get('.indicator-status').find('strong').contains('Aprovado') + }) + }) diff --git a/styleguide/src/Indicators/Status/Status.tsx b/styleguide/src/Indicators/Status/Status.tsx index 52f29caa..4ae8bb18 100644 --- a/styleguide/src/Indicators/Status/Status.tsx +++ b/styleguide/src/Indicators/Status/Status.tsx @@ -3,6 +3,7 @@ import React from 'react' const statusTypes = { default: 'bg-inverted-2', success: 'bg-success', + successDark: 'bg-success-dark', warning: 'bg-warning', danger: 'bg-danger', dangerLight: 'bg-danger-light', @@ -56,7 +57,7 @@ export interface StatusProps { /** * Status additional text * */ - description?: string + description?: React.ReactNode | string /** Invert icon and text position * @default false * */