@grantbii/design-system 1.0.25 → 1.0.27

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.
@@ -1,16 +1,18 @@
1
- export declare const MAIN_COLOR: {
1
+ export declare const main: {
2
2
  grantbiiBlue: string;
3
3
  grantbiiOrange: string;
4
4
  };
5
- export declare const BLACK_COLOR = "#232022";
6
- export declare const WHITE_COLOR = "#ffffff";
7
- export declare const NEUTRAL_COLOR: {
5
+ export declare const base: {
6
+ black: string;
7
+ white: string;
8
+ };
9
+ export declare const neutral: {
8
10
  grey1: string;
9
11
  grey2: string;
10
12
  grey3: string;
11
13
  grey4: string;
12
14
  };
13
- export declare const ACCENT_COLOR: {
15
+ export declare const accent: {
14
16
  red1: string;
15
17
  red2: string;
16
18
  red3: string;
@@ -24,8 +26,7 @@ export declare const ACCENT_COLOR: {
24
26
  blue2: string;
25
27
  blue3: string;
26
28
  };
27
- export declare const OVERLAY_COLOR = "#13131366";
28
- export declare const TYPOGRAPHY_COLOR: {
29
+ export declare const typography: {
29
30
  blackHigh: string;
30
31
  blackMedium: string;
31
32
  blackLow: string;
@@ -33,3 +34,6 @@ export declare const TYPOGRAPHY_COLOR: {
33
34
  whiteMedium: string;
34
35
  whiteLow: string;
35
36
  };
37
+ export declare const semantic: {
38
+ overlay: string;
39
+ };
@@ -1,16 +1,18 @@
1
- export const MAIN_COLOR = {
1
+ export const main = {
2
2
  grantbiiBlue: "#16538a",
3
3
  grantbiiOrange: "#f3924d",
4
4
  };
5
- export const BLACK_COLOR = "#232022";
6
- export const WHITE_COLOR = "#ffffff";
7
- export const NEUTRAL_COLOR = {
5
+ export const base = {
6
+ black: "#232022",
7
+ white: "#ffffff",
8
+ };
9
+ export const neutral = {
8
10
  grey1: "#999999",
9
11
  grey2: "#cccccc",
10
12
  grey3: "#eeeeee",
11
13
  grey4: "#fafafa",
12
14
  };
13
- export const ACCENT_COLOR = {
15
+ export const accent = {
14
16
  // usually includes dangerous, wrong or rejected information
15
17
  red1: "#c02318",
16
18
  red2: "#f88e86",
@@ -28,8 +30,7 @@ export const ACCENT_COLOR = {
28
30
  blue2: "#74aeef",
29
31
  blue3: "#bad6f7",
30
32
  };
31
- export const OVERLAY_COLOR = "#13131366";
32
- export const TYPOGRAPHY_COLOR = {
33
+ export const typography = {
33
34
  blackHigh: "#000000e5",
34
35
  blackMedium: "#00000099",
35
36
  blackLow: "#0000004d",
@@ -37,3 +38,6 @@ export const TYPOGRAPHY_COLOR = {
37
38
  whiteMedium: "#ffffff99",
38
39
  whiteLow: "#0000001a",
39
40
  };
41
+ export const semantic = {
42
+ overlay: "#13131366",
43
+ };
@@ -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 { TYPOGRAPHY_COLOR, WHITE_COLOR } from "../atoms/colors";
4
+ import * as Colors from "../atoms/colors";
5
5
  const GlobalStyle = createGlobalStyle `
6
6
  html,
7
7
  body {
@@ -9,8 +9,8 @@ const GlobalStyle = createGlobalStyle `
9
9
  }
10
10
 
11
11
  body {
12
- color: ${TYPOGRAPHY_COLOR.blackHigh};
13
- background: ${WHITE_COLOR};
12
+ color: ${Colors.typography.blackHigh};
13
+ background: ${Colors.base.white};
14
14
  font-family: Satoshi;
15
15
  -webkit-font-smoothing: antialiased;
16
16
  -moz-osx-font-smoothing: grayscale;
@@ -0,0 +1,10 @@
1
+ import { JSX, MouseEventHandler } from "react";
2
+ type BadgeProps = {
3
+ text: string;
4
+ icon?: JSX.Element;
5
+ onClickClose?: MouseEventHandler<HTMLButtonElement>;
6
+ backgroundColor?: string;
7
+ color?: string;
8
+ };
9
+ declare const Badge: ({ icon, text, onClickClose, backgroundColor, color, }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default Badge;
@@ -0,0 +1,23 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styled from "styled-components";
3
+ import { Colors, Icons } from "../../index";
4
+ const Badge = ({ icon, text, onClickClose, backgroundColor = Colors.neutral.grey3, color = Colors.typography.blackHigh, }) => (_jsxs(BaseBadge, { "$backgroundColor": backgroundColor, "$color": color, children: [icon ? icon : _jsx(_Fragment, {}), text ? _jsx(BadgeText, { children: text }) : _jsx(_Fragment, {}), onClickClose ? (_jsx(Button, { type: "button", onClick: onClickClose, children: _jsx(Icons.XIcon, { size: 20 }) })) : (_jsx(_Fragment, {}))] }));
5
+ export default Badge;
6
+ const BaseBadge = styled.div `
7
+ display: flex;
8
+ align-items: center;
9
+ gap: 10px;
10
+
11
+ padding: 5px 16px;
12
+ border-radius: 130px;
13
+
14
+ background-color: ${({ $backgroundColor }) => $backgroundColor};
15
+ color: ${({ $color }) => $color};
16
+ `;
17
+ const BadgeText = styled.p `
18
+ font-weight: 500;
19
+ font-size: 14px;
20
+ `;
21
+ const Button = styled.button `
22
+ display: flex;
23
+ `;
package/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export * from "@phosphor-icons/react";
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 * from "./core/atoms/colors";
4
+ export * as Colors from "./core/atoms/colors";
5
5
  export { default as GlobalStyle } from "./core/global/GlobalStyle";
6
6
  export { default as StyledComponentsRegistry } from "./core/integrations/StyledComponentsRegistry";
7
+ export { default as Badge } from "./core/molecules/Badge";
package/index.js CHANGED
@@ -1,6 +1,7 @@
1
- export * from "@phosphor-icons/react";
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 * from "./core/atoms/colors";
4
+ export * as Colors from "./core/atoms/colors";
5
5
  export { default as GlobalStyle } from "./core/global/GlobalStyle";
6
6
  export { default as StyledComponentsRegistry } from "./core/integrations/StyledComponentsRegistry";
7
+ export { default as Badge } from "./core/molecules/Badge";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grantbii/design-system",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Grantbii's Design System",
5
5
  "homepage": "https://design.grantbii.com",
6
6
  "repository": {
@@ -0,0 +1,10 @@
1
+ import { Badge } from "@/.";
2
+ import type { StoryObj } from "@storybook/nextjs-vite";
3
+ import { Meta } from "@storybook/nextjs-vite";
4
+ declare const meta: Meta<typeof Badge>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof meta>;
7
+ export declare const Default: Story;
8
+ export declare const Icon: Story;
9
+ export declare const Close: Story;
10
+ export declare const Everything: Story;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Badge, Icons } from "@/.";
3
+ const meta = {
4
+ title: "Design System/Atoms/Badge",
5
+ component: Badge,
6
+ tags: ["autodocs"],
7
+ parameters: {
8
+ layout: "centered",
9
+ },
10
+ };
11
+ export default meta;
12
+ export const Default = {
13
+ args: {
14
+ text: "Badge",
15
+ },
16
+ };
17
+ export const Icon = {
18
+ args: {
19
+ icon: _jsx(Icons.SmileyXEyesIcon, { size: 20 }),
20
+ text: "Badge",
21
+ },
22
+ };
23
+ export const Close = {
24
+ args: {
25
+ text: "Badge",
26
+ onClickClose: () => alert("closed badge"),
27
+ },
28
+ };
29
+ export const Everything = {
30
+ args: {
31
+ icon: _jsx(Icons.SmileyXEyesIcon, { size: 20 }),
32
+ text: "Badge",
33
+ onClickClose: () => alert("You have closed the badge!"),
34
+ },
35
+ };