Skip to content

Commit 8bca545

Browse files
Added guardian theme, made buttonv2 compatible with gradient colors
1 parent 4c0d9bb commit 8bca545

File tree

4 files changed

+66
-6
lines changed

4 files changed

+66
-6
lines changed

.storybook/preview.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const globalTypes = {
1818
{ value: 'darkRebrand', title: ' A-Dark', icon: 'moon' },
1919
{ value: 'artescaLight', title: 'A-Light', icon: 'sun' },
2020
{ value: 'ring9dark', title: 'R-Dark', icon: 'moon' },
21+
{ value: 'G-Dark', title: 'G-Dark', icon: 'moon' },
2122
],
2223
},
2324
},

src/lib/components/buttonv2/Buttonv2.component.tsx

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ export const ButtonStyled = styled.button<Props>`
5151
switch (props.variant) {
5252
case 'primary':
5353
return css`
54-
background-color: ${brand.buttonPrimary};
55-
border: ${spacing.r1} solid ${brand.buttonPrimary};
54+
background: ${brand.buttonPrimary};
55+
background-clip: padding-box, border-box;
56+
border: ${spacing.r1} solid transparent;
57+
border-color: ${brand.buttonPrimary};
5658
color: ${brand.textPrimary};
5759
&:hover:enabled {
5860
cursor: pointer;
@@ -73,8 +75,10 @@ export const ButtonStyled = styled.button<Props>`
7375
7476
case 'secondary':
7577
return css`
76-
background-color: ${brand.buttonSecondary};
77-
border: ${spacing.r1} solid ${brand.buttonSecondary};
78+
background: ${brand.buttonSecondary};
79+
background-clip: padding-box, border-box;
80+
border: ${spacing.r1} solid transparent;
81+
border-color: ${brand.buttonSecondary};
7882
color: ${brand.textPrimary};
7983
&:hover:enabled {
8084
cursor: pointer;
@@ -88,7 +92,8 @@ export const ButtonStyled = styled.button<Props>`
8892
&:active:enabled {
8993
cursor: pointer;
9094
color: ${brand.textPrimary};
91-
border: ${spacing.r1} solid ${brand.buttonSecondary};
95+
border: ${spacing.r1} solid transparent;
96+
border-color: ${brand.buttonSecondary};
9297
}
9398
`;
9499
@@ -112,13 +117,18 @@ export const ButtonStyled = styled.button<Props>`
112117
113118
case 'outline':
114119
return css`
115-
border: ${spacing.r1} solid ${brand.buttonSecondary};
120+
border: ${spacing.r1} solid transparent;
121+
border-color: ${brand.buttonSecondary};
116122
background-color: transparent;
117123
color: ${brand.textPrimary};
118124
&:hover:enabled {
119125
cursor: pointer;
120126
border-color: ${brand.infoPrimary};
121127
color: ${brand.textPrimary};
128+
129+
&::before {
130+
background-image: ${brand.buttonPrimary};
131+
}
122132
}
123133
&:focus-visible:enabled {
124134
${FocusVisibleStyle}
@@ -129,6 +139,17 @@ export const ButtonStyled = styled.button<Props>`
129139
border: ${spacing.r1} solid ${brand.infoSecondary};
130140
color: ${brand.textPrimary};
131141
}
142+
&::before {
143+
content: '';
144+
position: absolute;
145+
inset: 0;
146+
padding: ${spacing.r1};
147+
background-image: ${brand.buttonSecondary};
148+
border-radius: inherit;
149+
mask: linear-gradient(white, white) content-box, linear-gradient(white, white);
150+
mask-composite: exclude;
151+
pointer-events: none;
152+
}
132153
`;
133154
134155
default:

src/lib/style/theme.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const coreUIAvailableThemesNames = [
6060
'darkRebrand',
6161
'artescaLight',
6262
'ring9dark',
63+
'G-Dark'
6364
] as const;
6465
export type CoreUIThemeName = (typeof coreUIAvailableThemesNames)[number];
6566

@@ -139,6 +140,31 @@ export const coreUIAvailableThemes: Record<CoreUIThemeName, CoreUITheme> = {
139140
textReverse: '#000000',
140141
textLink: '#71AEFF',
141142
},
143+
'G-Dark': {
144+
statusHealthy: '#0AADA6',
145+
statusHealthyRGB: '10,173,166',
146+
statusWarning: '#F8F32B',
147+
statusWarningRGB: '248,243,43',
148+
statusCritical: '#E84855',
149+
statusCriticalRGB: '232,72,85',
150+
selectedActive: '#037AFF',
151+
highlight: '#1A3C75',
152+
border: '#4A4A4A',
153+
buttonPrimary: 'linear-gradient(130deg, #9355E7 0%, #2E4AA3 100%)',
154+
buttonSecondary: 'linear-gradient(130deg, #595A78 0%, #44455F 100%)',
155+
buttonDelete: '#3D0808',
156+
infoPrimary: '#8E8EAC',
157+
infoSecondary: '#333366',
158+
backgroundLevel1: '#121219',
159+
backgroundLevel2: '#323245',
160+
backgroundLevel3: '#232331',
161+
backgroundLevel4: '#1B1B27',
162+
textPrimary: '#EAEAEA',
163+
textSecondary: '#B5B5B5',
164+
textTertiary: '#DFDFDF',
165+
textReverse: '#000000',
166+
textLink: '#71AEFF',
167+
},
142168
};
143169

144170
/**

stories/color.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,15 @@ import { coreUIAvailableThemes } from '../src/lib/style/theme';
4141
}
4242

4343
</ColorPalette>
44+
45+
## G-Dark
46+
47+
<ColorPalette>
48+
{
49+
Object.entries(coreUIAvailableThemes['G-Dark']).map(([key, value]) => {
50+
if (!/RGB/.test(key)) return <ColorItem title={key} colors={[value]}/>;
51+
})
52+
53+
}
54+
55+
</ColorPalette>

0 commit comments

Comments
 (0)