Skip to content

Commit c586b2b

Browse files
authored
Feat/define buttons and colors (#718)
* feat: add gdk colors * feat: add button components * feat: add option for icon within button components * feat: added necessary font weights and default text color * feat: remove margin from tertiary button * feat: remove woff files remove pointer-event and refactor destructive buttons * feat: cleanup profile tsx
1 parent d901315 commit c586b2b

20 files changed

+214
-1
lines changed

public/fonts/IBMPlexSans-Bold.woff

-38.8 KB
Binary file not shown.

public/fonts/IBMPlexSans-Bold.woff2

34.9 KB
Binary file not shown.
-41.2 KB
Binary file not shown.
-28.2 KB
Binary file not shown.

public/fonts/IBMPlexSans-Italic.woff2

65.6 KB
Binary file not shown.

public/fonts/IBMPlexSans-Medium.woff2

65.2 KB
Binary file not shown.
2.78 KB
Binary file not shown.
65.5 KB
Binary file not shown.

public/fonts/IBMPlexSans-Text.woff

-40.3 KB
Binary file not shown.

public/fonts/IBMPlexSans-Text.woff2

-27.7 KB
Binary file not shown.
-42.9 KB
Binary file not shown.
-29.6 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from "react";
2+
3+
export interface PrimaryDestructiveButtonProps {
4+
label: string | React.ReactNode;
5+
onClick: () => void;
6+
disabled?: boolean;
7+
}
8+
9+
const PrimaryDestructiveButton: React.FC<PrimaryDestructiveButtonProps> = ({
10+
label,
11+
onClick,
12+
disabled,
13+
}) => {
14+
return (
15+
<button
16+
className={`text-gdk-white bg-gdk-dark-red hover:bg-gdk-light-red disabled:bg-gdk-light-gray
17+
my-4 flex h-[51px] w-fit items-center justify-center rounded-[10px] px-8 py-3.5 font-semibold`}
18+
disabled={disabled}
19+
onClick={onClick}
20+
>
21+
<span className="flex flex-row items-center gap-3">{label}</span>
22+
</button>
23+
);
24+
};
25+
26+
export default PrimaryDestructiveButton;

src/components/buttons/primary.tsx

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from "react";
2+
3+
export interface PrimaryButtonProps {
4+
label: string | React.ReactNode;
5+
onClick: () => void;
6+
disabled?: boolean;
7+
}
8+
9+
const PrimaryButton: React.FC<PrimaryButtonProps> = ({
10+
label,
11+
onClick,
12+
disabled,
13+
}) => {
14+
return (
15+
<button
16+
className={`text-gdk-white bg-gdk-blue hover:bg-gdk-light-blue disabled:bg-gdk-light-gray
17+
my-4 flex h-[51px] w-fit items-center justify-center rounded-[10px] px-8 font-semibold`}
18+
disabled={disabled}
19+
onClick={onClick}
20+
>
21+
<span className="flex flex-row items-center gap-3">{label}</span>
22+
</button>
23+
);
24+
};
25+
26+
export default PrimaryButton;

src/components/buttons/secondary.tsx

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from "react";
2+
3+
export interface SecondaryButtonProps {
4+
label: string | React.ReactNode;
5+
onClick: () => void;
6+
disabled?: boolean;
7+
}
8+
9+
const SecondaryButton: React.FC<SecondaryButtonProps> = ({
10+
label,
11+
onClick,
12+
disabled,
13+
}) => {
14+
return (
15+
<button
16+
className={`bg-gdk-white outline-gdk-blue text-gdk-blue enabled:hover:bg-gdk-light-blue hover:text-gdk-white
17+
disabled:outline-gdk-light-gray disabled:text-gdk-light-gray
18+
my-4 flex h-[51px] w-fit items-center justify-center rounded-[10px] px-8 py-3.5 font-semibold outline outline-2`}
19+
disabled={disabled}
20+
onClick={onClick}
21+
>
22+
<span className="flex flex-row items-center gap-3">{label}</span>
23+
</button>
24+
);
25+
};
26+
27+
export default SecondaryButton;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from "react";
2+
3+
export interface TertiaryDestructiveButtonProps {
4+
label: string | React.ReactNode;
5+
onClick: () => void;
6+
disabled?: boolean;
7+
}
8+
9+
const TertiaryDestructiveButton: React.FC<TertiaryDestructiveButtonProps> = ({
10+
label,
11+
onClick,
12+
disabled,
13+
}) => {
14+
return (
15+
<button
16+
className={`hover:text-bg-gdk-light-blue disabled:text-gdk-light-gray enabled:hover:text-gdk-light-blue
17+
text-gdk-dark-red enabled:hover:text-gdk-light-red" flex h-[51px] w-fit items-center justify-center rounded-[10px]
18+
p-3.5 font-semibold
19+
`}
20+
disabled={disabled}
21+
onClick={onClick}
22+
>
23+
<span className="flex flex-row items-center gap-3">{label}</span>
24+
</button>
25+
);
26+
};
27+
28+
export default TertiaryDestructiveButton;

src/components/buttons/tertiary.tsx

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from "react";
2+
3+
export interface TertiaryButtonProps {
4+
label: string | React.ReactNode;
5+
onClick: () => void;
6+
disabled?: boolean;
7+
}
8+
9+
const TertiaryButton: React.FC<TertiaryButtonProps> = ({
10+
label,
11+
onClick,
12+
disabled,
13+
}) => {
14+
return (
15+
<button
16+
className={`hover:text-bg-gdk-light-blue disabled:text-gdk-light-gray enabled:hover:text-gdk-light-blue
17+
text-gdk-blue flex h-[51px] w-fit items-center justify-center rounded-[10px] p-3.5 font-semibold`}
18+
disabled={disabled}
19+
onClick={onClick}
20+
>
21+
<span className="flex flex-row items-center gap-3">{label}</span>
22+
</button>
23+
);
24+
};
25+
26+
export default TertiaryButton;
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from "react";
2+
3+
const WateringIcon: React.FC = () => {
4+
return (
5+
<svg
6+
width="34"
7+
height="29"
8+
viewBox="0 0 34 29"
9+
fill="none"
10+
xmlns="http://www.w3.org/2000/svg"
11+
>
12+
<path
13+
d="M28.0506 5.91941C26.7928 7.16471 26.4698 8.95588 27.0647 10.4912L22.1013 15.4724V11.9412C22.1013 11.0029 21.3364 10.2353 20.4015 10.2353H18.6507C18.7017 9.9453 18.7017 9.67236 18.7017 9.38236C18.7017 4.19647 14.5201 4.12606e-06 9.35266 4.12606e-06C7.42709 -0.00180819 5.54798 0.593448 3.97239 1.70435C2.3968 2.81524 1.20168 4.38753 0.550503 6.20612C-0.100671 8.02471 -0.17609 10.0008 0.334562 11.864C0.845214 13.7273 1.917 15.3867 3.4033 16.6153V27.2941C3.4033 28.2324 4.16822 29 5.10311 29H20.4015C21.3364 29 22.1013 28.2324 22.1013 27.2941V20.2829L29.4615 12.8965C30.9913 13.4935 32.7761 13.1865 34 11.9412L28.0506 5.91941ZM3.48829 10.2353C3.45429 9.9453 3.4033 9.67236 3.4033 9.38236C3.4033 6.09 6.07201 3.41177 9.35266 3.41177C12.6333 3.41177 15.302 6.09 15.302 9.38236C15.302 9.67236 15.251 9.9453 15.217 10.2353M18.7017 25.5882H6.80293V13.6471H18.7017V25.5882Z"
14+
fill="currentColor"
15+
/>
16+
</svg>
17+
);
18+
};
19+
20+
export default WateringIcon;

src/index.css

+41
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
11
@tailwind base;
22
@tailwind components;
33
@tailwind utilities;
4+
5+
@layer base {
6+
html {
7+
@apply text-gdk-gray;
8+
}
9+
10+
@font-face {
11+
font-family: "IBM";
12+
font-style: normal;
13+
font-weight: 700;
14+
src: url("/fonts/IBMPlexSans-Bold.woff2");
15+
}
16+
17+
@font-face {
18+
font-family: "IBM";
19+
font-style: italic;
20+
font-weight: 400;
21+
src: url("/fonts/IBMPlexSans-Italic.woff2");
22+
}
23+
24+
@font-face {
25+
font-family: "IBM";
26+
font-style: normal;
27+
font-weight: 500;
28+
src: url("/fonts/IBMPlexSans-Medium.woff2");
29+
}
30+
31+
@font-face {
32+
font-family: "IBM";
33+
font-style: normal;
34+
font-weight: 400;
35+
src: url("/fonts/IBMPlexSans-Regular.woff2");
36+
}
37+
38+
@font-face {
39+
font-family: "IBM";
40+
font-style: normal;
41+
font-weight: 600;
42+
src: url("/fonts/IBMPlexSans-Medium.woff2");
43+
}
44+
}

tailwind.config.js

+20-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,26 @@
22
export default {
33
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
44
theme: {
5-
extend: {},
5+
extend: {
6+
fontFamily: {
7+
sans: ["IBM", "sans-serif"],
8+
},
9+
colors: {
10+
"gdk-gray": "#2C303B",
11+
"gdk-light-gray": "#808080",
12+
"gdk-white": "#FEFEFE",
13+
"gdk-blue": "#1169EE",
14+
"gdk-light-blue": "#96BCF4",
15+
"gdk-lighter-blue": "#E7F0FD",
16+
"gdk-dark-red": "#BD0909",
17+
"gdk-light-red": "#C75555",
18+
"gdk-neon-green": "#3DF99A",
19+
"gdk-tree-green": "#CAE11F",
20+
"gdk-dark-blue": "#0948A7",
21+
"gdk-dark-green": "#07964E",
22+
"gdk-purple": "#660A9C",
23+
},
24+
},
625
},
726
plugins: [],
827
};

0 commit comments

Comments
 (0)