@grantbii/design-system 1.0.28 → 1.0.29
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/{molecules → atoms}/Badge.d.ts +2 -2
- package/core/{molecules → atoms}/Badge.js +1 -1
- package/core/atoms/LinkButton.d.ts +12 -0
- package/core/atoms/LinkButton.js +19 -0
- package/core/global/GlobalStyle.js +1 -1
- package/index.d.ts +3 -2
- package/index.js +3 -2
- package/package.json +1 -1
- package/stories/{molecules → atoms}/Badge.stories.js +1 -1
- package/stories/atoms/BrandLogo.stories.js +1 -1
- package/stories/atoms/LinkButton.stories.d.ts +8 -0
- package/stories/atoms/LinkButton.stories.js +27 -0
- package/tsconfig.tsbuildinfo +1 -1
- /package/core/{atoms → foundation}/colors.d.ts +0 -0
- /package/core/{atoms → foundation}/colors.js +0 -0
- /package/stories/{molecules → atoms}/Badge.stories.d.ts +0 -0
|
@@ -3,9 +3,9 @@ type BadgeProps = {
|
|
|
3
3
|
text: string;
|
|
4
4
|
icon?: JSX.Element;
|
|
5
5
|
onClickClose?: MouseEventHandler<HTMLButtonElement>;
|
|
6
|
+
textWidthPixels?: number;
|
|
6
7
|
backgroundColor?: string;
|
|
7
8
|
color?: string;
|
|
8
|
-
textWidthPixels?: number;
|
|
9
9
|
};
|
|
10
|
-
declare const Badge: ({ icon, text, onClickClose, backgroundColor, color,
|
|
10
|
+
declare const Badge: ({ icon, text, onClickClose, textWidthPixels, backgroundColor, color, }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default Badge;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { Colors, Icons } from "../../index";
|
|
4
|
-
const Badge = ({ icon, text, onClickClose, backgroundColor, color,
|
|
4
|
+
const Badge = ({ icon, text, onClickClose, textWidthPixels, backgroundColor, color, }) => (_jsxs(BaseBadge, { "$backgroundColor": backgroundColor, "$color": color, children: [icon ? icon : _jsx(_Fragment, {}), _jsx(BadgeText, { "$widthPixels": textWidthPixels, children: text }), onClickClose ? (_jsx(Button, { type: "button", onClick: onClickClose, children: _jsx(Icons.XIcon, { size: 12 }) })) : (_jsx(_Fragment, {}))] }));
|
|
5
5
|
export default Badge;
|
|
6
6
|
const BaseBadge = styled.div `
|
|
7
7
|
display: flex;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributeAnchorTarget, JSX } from "react";
|
|
2
|
+
type LinkButtonProps = {
|
|
3
|
+
text: string;
|
|
4
|
+
href: string;
|
|
5
|
+
target?: HTMLAttributeAnchorTarget;
|
|
6
|
+
leftIcon?: JSX.Element;
|
|
7
|
+
rightIcon?: JSX.Element;
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const LinkButton: ({ text, href, target, leftIcon, rightIcon, backgroundColor, color, }: LinkButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default LinkButton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Colors } from "@/.";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import styled from "styled-components";
|
|
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
|
+
export default LinkButton;
|
|
7
|
+
const BaseLinkButton = styled.div `
|
|
8
|
+
display: flex;
|
|
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};
|
|
19
|
+
`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createGlobalStyle } from "styled-components";
|
|
3
3
|
import "../../public/fonts/satoshi/css/satoshi.css";
|
|
4
|
-
import * as Colors from "../
|
|
4
|
+
import * as Colors from "../foundation/colors";
|
|
5
5
|
const GlobalStyle = createGlobalStyle `
|
|
6
6
|
html,
|
|
7
7
|
body {
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * as Icons from "@phosphor-icons/react";
|
|
2
2
|
export * as Flags from "country-flag-icons/react/3x2";
|
|
3
3
|
export { default as BrandLogo } from "./core/atoms/BrandLogo";
|
|
4
|
-
export
|
|
4
|
+
export { default as LinkButton } from "./core/atoms/LinkButton";
|
|
5
|
+
export * as Colors from "./core/foundation/colors";
|
|
5
6
|
export { default as GlobalStyle } from "./core/global/GlobalStyle";
|
|
6
7
|
export { default as StyledComponentsRegistry } from "./core/integrations/StyledComponentsRegistry";
|
|
7
|
-
export { default as Badge } from "./core/
|
|
8
|
+
export { default as Badge } from "./core/atoms/Badge";
|
package/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * as Icons from "@phosphor-icons/react";
|
|
2
2
|
export * as Flags from "country-flag-icons/react/3x2";
|
|
3
3
|
export { default as BrandLogo } from "./core/atoms/BrandLogo";
|
|
4
|
-
export
|
|
4
|
+
export { default as LinkButton } from "./core/atoms/LinkButton";
|
|
5
|
+
export * as Colors from "./core/foundation/colors";
|
|
5
6
|
export { default as GlobalStyle } from "./core/global/GlobalStyle";
|
|
6
7
|
export { default as StyledComponentsRegistry } from "./core/integrations/StyledComponentsRegistry";
|
|
7
|
-
export { default as Badge } from "./core/
|
|
8
|
+
export { default as Badge } from "./core/atoms/Badge";
|
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LinkButton } from "@/.";
|
|
2
|
+
import type { StoryObj } from "@storybook/nextjs-vite";
|
|
3
|
+
import { Meta } from "@storybook/nextjs-vite";
|
|
4
|
+
declare const meta: Meta<typeof LinkButton>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof meta>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const Icon: Story;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Icons, LinkButton } from "@/.";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Atoms/LinkButton",
|
|
5
|
+
component: LinkButton,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const Default = {
|
|
13
|
+
args: {
|
|
14
|
+
text: "Link",
|
|
15
|
+
href: "https://grantbii.com",
|
|
16
|
+
target: "_blank",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export const Icon = {
|
|
20
|
+
args: {
|
|
21
|
+
text: "Link",
|
|
22
|
+
href: "https://grantbii.com",
|
|
23
|
+
target: "_blank",
|
|
24
|
+
leftIcon: _jsx(Icons.SmileyXEyesIcon, { size: 20 }),
|
|
25
|
+
rightIcon: _jsx(Icons.SmileyMeltingIcon, { size: 20 }),
|
|
26
|
+
},
|
|
27
|
+
};
|