Skip to content

Commit

Permalink
feat!: remove weak prop from Text
Browse files Browse the repository at this point in the history
  • Loading branch information
Martí Malek committed Sep 29, 2023
1 parent b8eef00 commit f58cec0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
14 changes: 2 additions & 12 deletions src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from 'styled-system';
import { theme } from '../../essentials/theme';
import { get } from '../../utils/themeGet';
import { deprecatedProperty } from '../../utils/deprecatedProperty';
import { getSemanticValue } from '../../utils/cssVariables';

interface TextProps
Expand All @@ -33,11 +32,6 @@ interface TextProps
* Adjust color for display on a dark background
*/
inverted?: boolean;
/**
* Adjust color to indicate secondary information
* @deprecated use `secondary` instead
*/
weak?: boolean;
/**
* Adjust color to indicate secondary information
*/
Expand All @@ -49,16 +43,12 @@ interface TextProps
}

function determineTextColor(props: TextProps) {
const { weak, secondary, inverted, disabled } = props;
if (weak !== undefined) {
deprecatedProperty('Text', weak, 'weak', 'secondary', 'Rename `weak` to `secondary` to remove the warning.');
}

const { secondary, inverted, disabled } = props;
if (disabled) {
return getSemanticValue('foreground-disabled');
}

if (secondary || weak) {
if (secondary) {
return getSemanticValue(inverted ? 'foreground-neutral-faded' : 'foreground-neutral-emphasized');
}

Expand Down
5 changes: 0 additions & 5 deletions src/components/Text/docs/Text.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ const meta: Meta = {
disable: true
}
},
weak: {
table: {
disable: true
}
}
},
args: {
children: 'Sign up to FREENOW'
Expand Down

0 comments on commit f58cec0

Please sign in to comment.