Skip to content

Commit 6923b87

Browse files
committed
feat: bump button sizes a notch, introduce new sm
+ new icons + fix font weight for safari
1 parent 6ea3557 commit 6923b87

17 files changed

+45
-25
lines changed

scripts/import-svgs.mjs

+2-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ await Promise.all(
2525
})
2626
);
2727

28-
const iconNameMapping = {
29-
home: "Home",
30-
"link-discord": "LinkDiscord",
31-
"link-github": "LinkGithub",
32-
"link-x-social": "LinkXSocial",
33-
};
28+
/** Use this to map an invalid name temporarily (until it is fixed in the Figma) */
29+
const iconNameMapping = {};
3430

3531
function getIconName(svg) {
3632
const result = svg.replace(".svg", "").replace("Type=", "");

src/components/Button/Button.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const meta: Meta<ButtonProps<"button" | "a">> = {
88
title: "Components/Button",
99
decorators: [
1010
MatrixDecorator<ButtonProps>({
11-
first: { key: "size", values: ["sm", "md"] },
11+
first: { key: "size", values: ["sm", "md", "lg"] },
1212
second: { key: "variant", values: ["primary", "secondary"] },
1313
}),
1414
],

src/components/Button/Button.tsx

+9-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type ButtonProps<T extends ElementType = typeof DEFAULT_BUTTON_TAG> =
1010
export interface OwnButtonProps extends PropsWithChildren {
1111
className?: string;
1212
variant?: "primary" | "secondary";
13-
size?: "sm" | "md";
13+
size?: "sm" | "md" | "lg";
1414
rounded?: "full" | "default";
1515
iconLeft?: React.ReactNode;
1616
iconRight?: React.ReactNode;
@@ -36,13 +36,15 @@ export const Button = <T extends ElementType = typeof DEFAULT_BUTTON_TAG>({
3636
"ink:rounded-full ink:font-default ink:transition-colors ink:hover:cursor-pointer ink:disabled:cursor-not-allowed ink:duration-100",
3737
"ink:flex ink:items-center ink:justify-center ink:gap-1 ink:select-none ink:no-underline",
3838
variantClassNames(size, {
39-
sm: "ink:px-3 ink:py-2 ink:text-body-2-bold",
40-
md: "ink:px-4 ink:py-3 ink:text-h4",
39+
sm: "ink:px-2 ink:py-1.5 ink:text-body-2-bold",
40+
md: "ink:px-3 ink:py-2 ink:text-body-2-bold",
41+
lg: "ink:px-4 ink:py-3 ink:text-h4",
4142
}),
4243
variantClassNames(rounded, {
4344
full: variantClassNames(size, {
44-
sm: "ink:rounded-full ink:p-1.5",
45-
md: "ink:rounded-full ink:p-2",
45+
sm: "ink:rounded-full ink:p-1",
46+
md: "ink:rounded-full ink:p-1.5",
47+
lg: "ink:rounded-full ink:p-2",
4648
}),
4749
default: "",
4850
}),
@@ -62,7 +64,8 @@ export const Button = <T extends ElementType = typeof DEFAULT_BUTTON_TAG>({
6264
<div
6365
className={variantClassNames(size, {
6466
sm: "ink:size-3",
65-
md: "ink:size-3 ink:m-0.5",
67+
md: "ink:size-3",
68+
lg: "ink:size-3 ink:m-0.5",
6669
})}
6770
>
6871
{children}

src/components/Button/InternalButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const InternalButton = <
3636
}),
3737
className
3838
)}
39-
size="sm"
39+
size="md"
4040
variant={
4141
variant === "primary" || variant === "secondary" ? variant : undefined
4242
}

src/components/Modal/Modal.stories.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const meta: Meta<ModalProps> = {
1515
const { isModalOpen, openModal } = useModalContext(args.id);
1616
return (
1717
<div className="ink:p-4">
18-
<Button variant="primary" size="sm" onClick={openModal}>
18+
<Button variant="primary" size="md" onClick={openModal}>
1919
{isModalOpen ? "Close Modal" : "Open Modal"}
2020
</Button>
2121
<Story />
@@ -57,7 +57,7 @@ const ModalContent = ({
5757
<Button
5858
className="ink:w-full"
5959
variant="primary"
60-
size="md"
60+
size="lg"
6161
onClick={() => closeModal(true)}
6262
>
6363
Let's go
@@ -79,15 +79,15 @@ export const Nested: Story = {
7979
return (
8080
<>
8181
<Story />
82-
<Modal id="nested" title="Nested modal" size="md" hasBackdrop>
82+
<Modal id="nested" title="Nested modal" size="lg" hasBackdrop>
8383
{({ closeModal }) => (
8484
<ModalLayout.CallToAction
8585
title="A nested modal example"
8686
content="This one uses the backdrop and size='md'"
8787
button={
8888
<Button
8989
variant="primary"
90-
size="md"
90+
size="lg"
9191
onClick={() => closeModal()}
9292
>
9393
Close Nested
@@ -108,7 +108,7 @@ export const Nested: Story = {
108108
<Button
109109
className="ink:w-full"
110110
variant="primary"
111-
size="md"
111+
size="lg"
112112
onClick={openModal}
113113
>
114114
Open Nested

src/icons/Icons.stories.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const AllIconsRow: Story = {
2121

2222
export const AllIconsWithColor: Story = {
2323
args: {
24-
containerClassName: "ink:text-primary",
24+
containerClassName: "ink:text-button-primary",
2525
},
2626
};
2727

src/icons/Type=Check.svg

+3
Loading

src/icons/Type=CheckFill.svg

+3
Loading
File renamed without changes.

src/icons/Type=Moon.svg

+3
Loading

src/icons/Type=Profile.svg

+1-1
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/icons/Type=Sun.svg

+3
Loading

src/icons/index.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,25 @@
33
*/
44

55
export { default as Arrow } from "./Type=Arrow.svg?react";
6+
export { default as Check } from "./Type=Check.svg?react";
7+
export { default as CheckFill } from "./Type=CheckFill.svg?react";
68
export { default as Chevron } from "./Type=Chevron.svg?react";
79
export { default as Close } from "./Type=Close.svg?react";
810
export { default as Copy } from "./Type=Copy.svg?react";
911
export { default as DefaultAppIcon } from "./Type=DefaultAppIcon.svg?react";
1012
export { default as Deposit } from "./Type=Deposit.svg?react";
1113
export { default as Disconnect } from "./Type=Disconnect.svg?react";
1214
export { default as Error } from "./Type=Error.svg?react";
15+
export { default as Home } from "./Type=Home.svg?react";
1316
export { default as Loading } from "./Type=Loading.svg?react";
1417
export { default as Menu } from "./Type=Menu.svg?react";
18+
export { default as Moon } from "./Type=Moon.svg?react";
1519
export { default as Profile } from "./Type=Profile.svg?react";
1620
export { default as Search } from "./Type=Search.svg?react";
1721
export { default as Settings } from "./Type=Settings.svg?react";
22+
export { default as SocialDiscord } from "./Type=SocialDiscord.svg?react";
23+
export { default as SocialGithub } from "./Type=SocialGithub.svg?react";
24+
export { default as SocialX } from "./Type=SocialX.svg?react";
1825
export { default as Success } from "./Type=Success.svg?react";
26+
export { default as Sun } from "./Type=Sun.svg?react";
1927
export { default as Swap } from "./Type=Swap.svg?react";
20-
export { default as Home } from "./Type=home.svg?react";
21-
export { default as LinkDiscord } from "./Type=link-discord.svg?react";
22-
export { default as LinkGithub } from "./Type=link-github.svg?react";
23-
export { default as LinkXSocial } from "./Type=link-x-social.svg?react";

src/tailwind.css

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
margin: 0;
4747
padding: 0;
4848
}
49+
50+
.ink\:font-default * {
51+
/** Required for Safari to have proper font weights */
52+
font-synthesis: none;
53+
}
4954
}
5055

5156
@theme {

0 commit comments

Comments
 (0)