Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPC-9742 Modify button component style #465

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion libs/hpc-ui/src/lib/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ const CLS = {

const COLOR_CLS = {
primary: 'color-primary',
primary_light: 'color-primary_light',
secondary: 'color-secondary',
secondary_light: 'color-secondary_light',
neutral: 'color-neutral',
neutral_light: 'color-neutral_light',
} as const;

export type ButtonColor = keyof typeof COLOR_CLS;
Expand Down Expand Up @@ -117,7 +120,7 @@ const StyledBaseButton = styled(BaseButton)`
border: 1px solid ${(p) => p.theme.colors.pallete.gray.light};
color: ${(p) => p.theme.colors.pallete.gray.light};
align-items: center;
border-radius: 2px;
border-radius: 4px;
text-transform: uppercase;
font-weight: bold;
font-size: 1.2rem;
Expand All @@ -127,6 +130,7 @@ const StyledBaseButton = styled(BaseButton)`
&:hover,
&:focus,
&.${CLS.ACTIVE} {
transition: ease-out 0.1s;
text-decoration: none;
background-color: ${(p) => p.theme.colors.pallete.gray.light};
color: #fff;
Expand All @@ -148,6 +152,18 @@ const StyledBaseButton = styled(BaseButton)`
}
}

&.${COLOR_CLS.primary_light} {
border: 1px solid #fff;
color: #fff;

&:hover,
&:focus,
&.${CLS.ACTIVE} {
background-color: #fff;
color: ${(p) => p.theme.colors.primary.normal};
}
}

&.${COLOR_CLS.secondary} {
border: 1px solid ${(p) => p.theme.colors.secondary.normal};
color: ${(p) => p.theme.colors.secondary.normal};
Expand All @@ -160,6 +176,30 @@ const StyledBaseButton = styled(BaseButton)`
}
}

&.${COLOR_CLS.secondary_light} {
border: 1px solid ${(p) => p.theme.colors.secondary.normal};
color: ${(p) => p.theme.colors.secondary.light};

&:hover,
&:focus,
&.${CLS.ACTIVE} {
background-color: ${(p) => p.theme.colors.secondary.normal};
color: #fff;
}
}

&.${COLOR_CLS.neutral_light} {
border: 1px solid ${(p) => p.theme.colors.pallete.gray.light2};
color: ${(p) => p.theme.colors.pallete.gray.light2};

&:hover,
&:focus,
&.${CLS.ACTIVE} {
background-color: ${(p) => p.theme.colors.pallete.gray.light2};
color: #fff;
}
}

> * {
margin: 0 ${(p) => p.theme.marginPx.sm}px;
}
Expand Down
1 change: 1 addition & 0 deletions libs/hpc-ui/src/lib/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const COLOR_PALETTE = {
dark2: '#b44d0e',
dark1: '#d05b10',
normal: '#e16856', // from style guide
light: '#fd9282',
},
yellow: {
normal: '#FFC000',
Expand Down