@grantbii/design-system 1.0.33 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/atoms/Button.d.ts +1 -1
- package/core/atoms/Button.js +2 -13
- package/core/atoms/LinkButton.js +2 -13
- package/core/atoms/shared.d.ts +4 -0
- package/core/atoms/shared.js +17 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/core/atoms/Button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX, MouseEventHandler } from "react";
|
|
2
2
|
type ButtonProps = {
|
|
3
3
|
text: string;
|
|
4
|
-
onClick
|
|
4
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
5
5
|
type?: "button" | "submit" | "reset";
|
|
6
6
|
leftIcon?: JSX.Element;
|
|
7
7
|
rightIcon?: JSX.Element;
|
package/core/atoms/Button.js
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from "styled-components";
|
|
3
|
-
import {
|
|
3
|
+
import { ButtonStyle } from "./shared";
|
|
4
4
|
const Button = ({ text, onClick, leftIcon, rightIcon, backgroundColor, color, type = "button", }) => (_jsx("button", { type: type, onClick: onClick, children: _jsxs(BaseButton, { "$backgroundColor": backgroundColor, "$color": color, children: [leftIcon ? leftIcon : _jsx(_Fragment, {}), _jsx("p", { children: text }), rightIcon ? rightIcon : _jsx(_Fragment, {})] }) }));
|
|
5
5
|
export default Button;
|
|
6
6
|
const BaseButton = styled.div `
|
|
7
|
-
|
|
8
|
-
align-items: center;
|
|
9
|
-
gap: 10px;
|
|
10
|
-
|
|
11
|
-
padding: 10px 16px;
|
|
12
|
-
border-radius: 4px;
|
|
13
|
-
|
|
14
|
-
font-weight: 500;
|
|
15
|
-
font-size: 14px;
|
|
16
|
-
|
|
17
|
-
color: ${({ $color = Colors.typography.whiteHigh }) => $color};
|
|
18
|
-
background-color: ${({ $backgroundColor = Colors.main.grantbiiBlue }) => $backgroundColor};
|
|
7
|
+
${ButtonStyle}
|
|
19
8
|
`;
|
package/core/atoms/LinkButton.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Link from "next/link";
|
|
3
3
|
import styled from "styled-components";
|
|
4
|
-
import {
|
|
4
|
+
import { ButtonStyle } from "./shared";
|
|
5
5
|
const LinkButton = ({ text, href, target, leftIcon, rightIcon, backgroundColor, color, }) => (_jsx(Link, { href: href, target: target, children: _jsxs(BaseLinkButton, { "$backgroundColor": backgroundColor, "$color": color, children: [leftIcon ? leftIcon : _jsx(_Fragment, {}), _jsx("p", { children: text }), rightIcon ? rightIcon : _jsx(_Fragment, {})] }) }));
|
|
6
6
|
export default LinkButton;
|
|
7
7
|
const BaseLinkButton = styled.div `
|
|
8
|
-
|
|
9
|
-
align-items: center;
|
|
10
|
-
gap: 10px;
|
|
11
|
-
|
|
12
|
-
padding: 10px 16px;
|
|
13
|
-
border-radius: 4px;
|
|
14
|
-
|
|
15
|
-
font-weight: 500;
|
|
16
|
-
font-size: 14px;
|
|
17
|
-
|
|
18
|
-
color: ${({ $color = Colors.typography.whiteHigh }) => $color};
|
|
19
|
-
background-color: ${({ $backgroundColor = Colors.main.grantbiiBlue }) => $backgroundColor};
|
|
8
|
+
${ButtonStyle}
|
|
20
9
|
`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { css } from "styled-components";
|
|
2
|
+
import { Colors } from "../foundations";
|
|
3
|
+
export const ButtonStyle = css `
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 10px;
|
|
8
|
+
|
|
9
|
+
padding: 10px 16px;
|
|
10
|
+
border-radius: 4px;
|
|
11
|
+
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
|
|
15
|
+
color: ${({ $color = Colors.typography.whiteHigh }) => $color};
|
|
16
|
+
background-color: ${({ $backgroundColor = Colors.main.grantbiiBlue }) => $backgroundColor};
|
|
17
|
+
`;
|