Skip to content

Commit cf285a8

Browse files
committed
refactor: update text colors
1 parent 683e23f commit cf285a8

31 files changed

+93
-88
lines changed

packages/coreui-react/src/components/avatar/CAvatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface CAvatarProps extends HTMLAttributes<HTMLDivElement> {
3939
/**
4040
* Sets the text color of the component to one of CoreUI’s themed colors.
4141
*
42-
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string
42+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
4343
*/
4444
textColor?: TextColors
4545
}

packages/coreui-react/src/components/badge/CBadge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanEle
3737
/**
3838
* Sets the text color of the component to one of CoreUI’s themed colors.
3939
*
40-
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string
40+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
4141
*/
4242
textColor?: TextColors
4343
}

packages/coreui-react/src/components/card/CCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface CCardProps extends HTMLAttributes<HTMLDivElement> {
1919
/**
2020
* Sets the text color context of the component to one of CoreUI’s themed colors.
2121
*
22-
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string
22+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
2323
*/
2424
textColor?: string
2525
}

packages/coreui-react/src/components/widgets/CWidgetStatsA.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const CWidgetStatsA = forwardRef<HTMLDivElement, CWidgetStatsAProps>(
4141
return (
4242
<CCard
4343
className={classNames(
44-
{ [`bg-${color}`]: color, 'text-high-emphasis-inverse': color },
44+
{ [`bg-${color}`]: color, 'text-white': color },
4545
className,
4646
)}
4747
{...rest}

packages/coreui-react/src/components/widgets/CWidgetStatsB.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const CWidgetStatsB = forwardRef<HTMLDivElement, CWidgetStatsBProps>(
4848
<CCard
4949
className={className}
5050
color={color}
51-
{...(inverse && { textColor: 'high-emphasis-inverse' })}
51+
{...(inverse && { textColor: 'white' })}
5252
{...rest}
5353
ref={ref}
5454
>
@@ -57,7 +57,7 @@ export const CWidgetStatsB = forwardRef<HTMLDivElement, CWidgetStatsBProps>(
5757
{title && <div>{title}</div>}
5858
<CProgress className="my-2" height={4} {...(inverse && { white: true })} {...progress} />
5959
{text && (
60-
<small className={inverse ? 'text-medium-emphasis-inverse' : 'text-medium-emphasis'}>
60+
<small className={inverse ? 'text-white text-opacity-75' : 'text-body-secondary'}>
6161
{text}
6262
</small>
6363
)}

packages/coreui-react/src/components/widgets/CWidgetStatsC.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,15 @@ export const CWidgetStatsC = forwardRef<HTMLDivElement, CWidgetStatsCProps>(
4848
<CCard
4949
className={className}
5050
color={color}
51-
{...(inverse && { textColor: 'high-emphasis-inverse' })}
51+
{...(inverse && { textColor: 'white' })}
5252
{...rest}
5353
ref={ref}
5454
>
5555
<CCardBody>
56-
{icon && (
57-
<div className={`text-medium-emphasis${inverse ? '-inverse' : ''} text-end mb-4`}>
58-
{icon}
59-
</div>
60-
)}
61-
{value && (
62-
<div className={`text-high-emphasis${inverse ? '-inverse' : ''} fs-4 fw-semibold`}>
63-
{value}
64-
</div>
65-
)}
56+
{icon && <div className="text-end mb-4">{icon}</div>}
57+
{value && <div className="fs-4 fw-semibold">{value}</div>}
6658
{title && (
67-
<div className={inverse ? 'text-medium-emphasis-inverse' : 'text-medium-emphasis'}>
59+
<div className={inverse ? 'text-white text-opacity-75' : 'text-body-secondary'}>
6860
{title}
6961
</div>
7062
)}

packages/coreui-react/src/components/widgets/CWidgetStatsD.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const CWidgetStatsD = forwardRef<HTMLDivElement, CWidgetStatsDProps>(
6161
{index % 2 !== 0 && <div className="vr"></div>}
6262
<CCol>
6363
<div className="fs-5 fw-semibold">{value.value}</div>
64-
<div className="text-uppercase text-medium-emphasis small">{value.title}</div>
64+
<div className="text-uppercase text-body-secondary small">{value.title}</div>
6565
</CCol>
6666
</React.Fragment>
6767
)

packages/coreui-react/src/components/widgets/CWidgetStatsE.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const CWidgetStatsE = forwardRef<HTMLDivElement, CWidgetStatsEProps>(
2929
<CCard className={classNames(className)} {...rest} ref={ref}>
3030
<CCardBody className="text-center">
3131
{title && (
32-
<div className="text-medium-emphasis small text-uppercase fw-semibold">{title}</div>
32+
<div className="text-body-secondary small text-uppercase fw-semibold">{title}</div>
3333
)}
3434
{value && <div className="fs-6 fw-semibold py-3">{value}</div>}
3535
{chart}

packages/coreui-react/src/components/widgets/CWidgetStatsF.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const CWidgetStatsF = forwardRef<HTMLDivElement, CWidgetStatsFProps>(
4747
<div className={`me-3 text-white bg-${color} ${padding ? 'p-3' : 'p-4'}`}>{icon}</div>
4848
<div>
4949
<div className={`fs-6 fw-semibold text-${color}`}>{value}</div>
50-
<div className="text-medium-emphasis text-uppercase fw-semibold small">{title}</div>
50+
<div className="text-body-secondary text-uppercase fw-semibold small">{title}</div>
5151
</div>
5252
</CCardBody>
5353
{footer && <CCardFooter>{footer}</CCardFooter>}

packages/coreui-react/src/components/widgets/__tests__/CWidgetStatsA.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('CWidgetStatsA customize', async () => {
2323
)
2424
expect(container).toMatchSnapshot()
2525
expect(container.firstChild).toHaveClass('bg-info')
26-
expect(container.firstChild).toHaveClass('text-high-emphasis-inverse')
26+
expect(container.firstChild).toHaveClass('text-white')
2727
expect(container.firstChild).toHaveClass('bazinga')
2828
if (container.firstChild === null) {
2929
expect(true).toBe(false)

0 commit comments

Comments
 (0)