Skip to content

Commit

Permalink
Merge pull request #86 from Giveth/add-text-gray-variant
Browse files Browse the repository at this point in the history
Add text gray variant
  • Loading branch information
alireza-sharifpour authored May 3, 2023
2 parents 5fa89f0 + 01e3e78 commit 18152fa
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@giveth/ui-design-system",
"version": "1.11.6",
"version": "1.11.7",
"files": [
"/lib"
],
Expand Down
20 changes: 17 additions & 3 deletions src/components/buttonLinks/ButtonLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ const ButtonLinkContainer = styled.span<IButtonLinkContainerProps>`
background-color: unset;
padding: 8px 24px;
`;
case 'texty-gray':
return props.disabled
? css`
color: ${neutralColors.gray[500]};
background-color: unset;
padding: 8px 24px;
opacity: 0.5;
`
: css`
color: ${neutralColors.gray[500]};
background-color: unset;
padding: 8px 24px;
`;
case 'texty-primary':
return props.disabled
? css`
Expand Down Expand Up @@ -113,20 +126,21 @@ const ButtonLinkContainer = styled.span<IButtonLinkContainerProps>`
color: ${brandColors.deep[100]};
background-color: ${brandColors.giv[700]};
`;
case 'texty-gray':
return css`
color: ${neutralColors.gray[700]};
`;
case 'texty-primary':
return css`
color: ${neutralColors.gray[100]};
background-color: ${brandColors.pinky[600]};
`;
case 'texty-secondary':
return css`
color: ${neutralColors.gray[100]};
background-color: ${brandColors.giv[700]};
`;
default:
return css`
color: ${brandColors.deep[100]};
background-color: ${brandColors.giv[700]};
`;
}
}}
Expand Down
1 change: 1 addition & 0 deletions src/components/buttonLinks/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface IButtonLinkContainerProps {
| 'primary'
| 'secondary'
| 'texty'
| 'texty-gray'
| 'texty-primary'
| 'texty-secondary';
size?: 'small' | 'medium' | 'large';
Expand Down
18 changes: 18 additions & 0 deletions src/components/buttons/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ const ButtonContainer = styled.button<IButtonContainerProps>`
opacity: 0.5;
`;
}
if (props.buttonType === 'texty-gray') {
return css`
color: ${neutralColors.gray[300]};
background-color: unset;
padding: 8px 24px;
opacity: 0.5;
`;
}
if (props.buttonType === 'texty-primary') {
return css`
color: ${brandColors.pinky[500]};
Expand Down Expand Up @@ -72,6 +80,12 @@ const ButtonContainer = styled.button<IButtonContainerProps>`
background-color: unset;
padding: 8px 24px;
`;
case 'texty-gray':
return css`
color: ${neutralColors.gray[500]};
background-color: unset;
padding: 8px 24px;
`;
case 'texty-primary':
return css`
color: ${brandColors.pinky[500]};
Expand Down Expand Up @@ -111,6 +125,10 @@ const ButtonContainer = styled.button<IButtonContainerProps>`
color: ${brandColors.deep[100]};
background-color: ${brandColors.giv[700]};
`;
case 'texty-gray':
return css`
color: ${neutralColors.gray[700]};
`;
case 'texty-primary':
return css`
color: ${brandColors.pinky[700]};
Expand Down
1 change: 1 addition & 0 deletions src/components/buttons/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface IButtonContainerProps {
| 'primary'
| 'secondary'
| 'texty'
| 'texty-gray'
| 'texty-primary'
| 'texty-secondary';
disabled?: boolean;
Expand Down
9 changes: 9 additions & 0 deletions src/stories/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ Texty.args = {
loading: false,
};

export const TextyGray = Template.bind({});
TextyGray.args = {
buttonType: 'texty-gray',
label: 'Texty',
size: 'medium',
disabled: false,
loading: false,
};

export const TextyPrimary = Template.bind({});
TextyPrimary.args = {
buttonType: 'texty-primary',
Expand Down
9 changes: 9 additions & 0 deletions src/stories/ButtonLink.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ Texty.args = {
disabled: false,
};

export const TextyGray = Template.bind({});

TextyGray.args = {
linkType: 'texty-gray',
label: 'Texty',
size: 'medium',
disabled: false,
};

export const TextyPrimary = Template.bind({});

TextyPrimary.args = {
Expand Down

0 comments on commit 18152fa

Please sign in to comment.