@grantbii/design-system 1.0.39 → 1.0.41

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.
@@ -0,0 +1,6 @@
1
+ import { DetailedHTMLProps, InputHTMLAttributes } from "react";
2
+ type RadioButtonProps = {
3
+ label: string;
4
+ } & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
5
+ declare const RadioButton: ({ label, id, ...radioButtonProps }: RadioButtonProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default RadioButton;
@@ -0,0 +1,22 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import styled from "styled-components";
14
+ const RadioButton = (_a) => {
15
+ var { label, id } = _a, radioButtonProps = __rest(_a, ["label", "id"]);
16
+ return (_jsxs(BaseRadioButton, { children: [_jsx("input", Object.assign({}, radioButtonProps, { id: id, type: "radio" })), _jsx("label", { htmlFor: id, children: label })] }));
17
+ };
18
+ export default RadioButton;
19
+ const BaseRadioButton = styled.div `
20
+ display: flex;
21
+ gap: 8px;
22
+ `;
@@ -2,3 +2,4 @@ export { default as Badge } from "./Badge";
2
2
  export { default as BrandLogo } from "./BrandLogo";
3
3
  export { default as Button } from "./Button";
4
4
  export { default as LinkButton } from "./LinkButton";
5
+ export { default as RadioButton } from "./RadioButton";
@@ -2,3 +2,4 @@ export { default as Badge } from "./Badge";
2
2
  export { default as BrandLogo } from "./BrandLogo";
3
3
  export { default as Button } from "./Button";
4
4
  export { default as LinkButton } from "./LinkButton";
5
+ export { default as RadioButton } from "./RadioButton";
@@ -2,3 +2,4 @@ export * as Icons from "@phosphor-icons/react";
2
2
  export * as Flags from "country-flag-icons/react/3x2";
3
3
  export * as Breakpoints from "./breakpoints";
4
4
  export * as Colors from "./colors";
5
+ export type * from "./types";
@@ -0,0 +1,4 @@
1
+ export type Option = {
2
+ label: string;
3
+ value: string;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -3,7 +3,7 @@ import { useCallback, useState } from "react";
3
3
  import styled from "styled-components";
4
4
  import { Button } from "../atoms";
5
5
  import { Colors } from "../foundations";
6
- const Modal = ({ header, content, footer, width, height, isFullScreen, onClickCancel, }) => (_jsx(Overlay, { children: _jsxs(ModalWindow, { "$isFullScreen": isFullScreen, "$width": width, children: [header ? _jsx(ModalHeader, { children: header }) : _jsx(_Fragment, {}), _jsx(ModalBody, { "$isFullScreen": isFullScreen, "$height": height, children: content }), _jsxs(ModalFooter, { children: [_jsx(CancelButton, { onClick: onClickCancel }), footer ? footer : _jsx(_Fragment, {})] })] }) }));
6
+ const Modal = ({ header, content, footer, width, height, isFullScreen, onClickCancel, }) => (_jsx(Overlay, { "$isFullScreen": isFullScreen, children: _jsxs(ModalWindow, { "$isFullScreen": isFullScreen, "$width": width, "$height": height, children: [header ? _jsx(ModalHeader, { children: header }) : _jsx(_Fragment, {}), _jsx(ModalBody, { children: _jsx(ModalContent, { children: content }) }), _jsxs(ModalFooter, { children: [_jsx(CancelButton, { onClick: onClickCancel }), footer ? footer : _jsx(_Fragment, {})] })] }) }));
7
7
  export default Modal;
8
8
  export const useModal = () => {
9
9
  const [showModal, setShowModal] = useState(false);
@@ -30,7 +30,7 @@ export const useModal = () => {
30
30
  const Overlay = styled.div `
31
31
  background-color: ${Colors.semantic.overlay};
32
32
 
33
- z-index: ${Number.MAX_SAFE_INTEGER};
33
+ z-index: ${({ $isFullScreen }) => $isFullScreen ? Number.MAX_SAFE_INTEGER - 1 : Number.MAX_SAFE_INTEGER};
34
34
  position: fixed;
35
35
  top: 0px;
36
36
  left: 0px;
@@ -44,13 +44,17 @@ const Overlay = styled.div `
44
44
  align-items: center;
45
45
  `;
46
46
  const ModalWindow = styled.div `
47
+ display: flex;
48
+ flex-direction: column;
49
+
47
50
  background-color: ${Colors.base.white};
48
51
  border-radius: ${({ $isFullScreen }) => ($isFullScreen ? 0 : 6)}px;
49
52
 
50
53
  width: ${({ $isFullScreen, $width = "auto" }) => $isFullScreen ? "100%" : $width};
54
+ height: ${({ $isFullScreen, $height = "auto" }) => $isFullScreen ? "100%" : $height};
51
55
 
52
- height: ${({ $isFullScreen }) => ($isFullScreen ? "100%" : "auto")};
53
56
  min-height: 100px;
57
+ max-height: 100vh;
54
58
  `;
55
59
  const ModalHeader = styled.div `
56
60
  font-weight: 500;
@@ -62,21 +66,18 @@ const ModalHeader = styled.div `
62
66
  const ModalBody = styled.div `
63
67
  display: flex;
64
68
  flex-direction: column;
65
- gap: 12px;
66
-
67
- height: ${({ $isFullScreen, $height = "auto" }) => $isFullScreen ? "calc(100% - 160px)" : $height};
68
69
 
70
+ height: 100%;
69
71
  padding-top: 24px;
72
+ overflow-y: auto;
73
+ `;
74
+ const ModalContent = styled.div `
75
+ width: 100%;
76
+ height: 100%;
77
+ min-height: 100px;
70
78
 
71
- > * {
72
- width: 100%;
73
- height: 100%;
74
-
75
- padding: 2px 24px;
76
- border: none;
77
-
78
- overflow-y: auto;
79
- }
79
+ padding: 2px 24px;
80
+ border: none;
80
81
  `;
81
82
  const ModalFooter = styled.div `
82
83
  display: flex;
@@ -0,0 +1,7 @@
1
+ import { DetailedHTMLProps, InputHTMLAttributes } from "react";
2
+ import { Option } from "../foundations";
3
+ type RadioButtonProps = {
4
+ options: Option[];
5
+ } & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
6
+ declare const RadioButtons: ({ options, name, ...radioButtonProps }: RadioButtonProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default RadioButtons;
@@ -0,0 +1,24 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { createElement as _createElement } from "react";
14
+ import styled from "styled-components";
15
+ import { RadioButton } from "../atoms";
16
+ const RadioButtons = (_a) => {
17
+ var { options, name } = _a, radioButtonProps = __rest(_a, ["options", "name"]);
18
+ return (_jsx(RadioGroup, { children: options.map(({ label, value }) => (_createElement(RadioButton, Object.assign({}, radioButtonProps, { key: `${name}-radio-button`, id: `${name}-radio-button`, name: name, label: label, value: value })))) }));
19
+ };
20
+ export default RadioButtons;
21
+ const RadioGroup = styled.div `
22
+ display: flex;
23
+ gap: 12px;
24
+ `;
@@ -1 +1,2 @@
1
1
  export { default as Modal, useModal } from "./Modal";
2
+ export { default as RadioButtons } from "./RadioButtons";
@@ -1 +1,2 @@
1
1
  export { default as Modal, useModal } from "./Modal";
2
+ export { default as RadioButtons } from "./RadioButtons";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grantbii/design-system",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "Grantbii's Design System",
5
5
  "homepage": "https://design.grantbii.com",
6
6
  "repository": {
@@ -1,6 +1,5 @@
1
1
  import { Badge } from "@/.";
2
- import type { StoryObj } from "@storybook/nextjs-vite";
3
- import { Meta } from "@storybook/nextjs-vite";
2
+ import { Meta, StoryObj } from "@storybook/nextjs-vite";
4
3
  declare const meta: Meta<typeof Badge>;
5
4
  export default meta;
6
5
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,5 @@
1
1
  import { BrandLogo } from "@/.";
2
- import type { StoryObj } from "@storybook/nextjs-vite";
3
- import { Meta } from "@storybook/nextjs-vite";
2
+ import { Meta, StoryObj } from "@storybook/nextjs-vite";
4
3
  declare const meta: Meta<typeof BrandLogo>;
5
4
  export default meta;
6
5
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,5 @@
1
1
  import { Button } from "@/.";
2
- import type { StoryObj } from "@storybook/nextjs-vite";
3
- import { Meta } from "@storybook/nextjs-vite";
2
+ import { Meta, StoryObj } from "@storybook/nextjs-vite";
4
3
  declare const meta: Meta<typeof Button>;
5
4
  export default meta;
6
5
  type Story = StoryObj<typeof meta>;
@@ -1,6 +1,5 @@
1
1
  import { LinkButton } from "@/.";
2
- import type { StoryObj } from "@storybook/nextjs-vite";
3
- import { Meta } from "@storybook/nextjs-vite";
2
+ import { Meta, StoryObj } from "@storybook/nextjs-vite";
4
3
  declare const meta: Meta<typeof LinkButton>;
5
4
  export default meta;
6
5
  type Story = StoryObj<typeof meta>;
@@ -1,5 +1,4 @@
1
- import type { StoryObj } from "@storybook/nextjs-vite";
2
- import { Meta } from "@storybook/nextjs-vite";
1
+ import { Meta, StoryObj } from "@storybook/nextjs-vite";
3
2
  import { ReactNode } from "react";
4
3
  type ModalExampleProps = {
5
4
  header?: ReactNode;
@@ -13,5 +12,7 @@ declare const ModalExample: (props: ModalExampleProps) => import("react/jsx-runt
13
12
  declare const meta: Meta<typeof ModalExample>;
14
13
  export default meta;
15
14
  type Story = StoryObj<typeof meta>;
16
- export declare const DesktopVersion: Story;
17
- export declare const MobileVersion: Story;
15
+ export declare const PopUpWithShortContent: Story;
16
+ export declare const FullScreenWithShortContent: Story;
17
+ export declare const PopUpWithLongContent: Story;
18
+ export declare const FullScreenWithLongContent: Story;
@@ -13,19 +13,35 @@ const meta = {
13
13
  },
14
14
  };
15
15
  export default meta;
16
- const header = "What is Grantbii?";
17
- const text = "Grantbii is an AI-powered grant intelligence and matching platform that helps grant seekers effortlessly find, match, prep & apply for the right business grants - maximizing grant funding success with minimal effort. Our platform connects businesses with a trusted Grant Enabler Network - solution providers, consulting experts, and delivery partners - ensuring that every dollar of grant funding leads to real business transformation impact.";
18
- export const DesktopVersion = {
16
+ const header = "Grantbii";
17
+ const shortContent = (_jsx("p", { children: "Amplifying Business Grant Impact for SMEs & Scale-ups" }));
18
+ const longContent = (_jsxs("div", { children: [_jsx("p", { children: "Grantbii is an AI-powered grant intelligence and matching platform that helps grant seekers effortlessly find, match, prep & apply for the right business grants - maximizing grant funding success with minimal effort. Our platform connects businesses with a trusted Grant Enabler Network - solution providers, consulting experts, and delivery partners - ensuring that every dollar of grant funding leads to real business transformation impact." }), _jsx("p", { children: "In the future, Grantbii aims to automate the entire grant application lifecycle, from discovery to claims submission and guide you through the application process with minimal effort on your part." }), _jsx("p", { children: "To maximize your chances of grant success, you can expect to leverage on tools to assess your chances of success and offer expert support to ensure your application meets all necessary requirements." })] }));
19
+ export const PopUpWithShortContent = {
19
20
  args: {
20
21
  header,
21
- content: _jsx("p", { children: text }),
22
+ content: shortContent,
22
23
  width: "600px",
23
24
  },
24
25
  };
25
- export const MobileVersion = {
26
+ export const FullScreenWithShortContent = {
26
27
  args: {
27
28
  header,
28
- content: _jsx("p", { children: text }),
29
+ content: shortContent,
30
+ isFullScreen: true,
31
+ },
32
+ };
33
+ export const PopUpWithLongContent = {
34
+ args: {
35
+ header,
36
+ content: longContent,
37
+ width: "600px",
38
+ height: "240px",
39
+ },
40
+ };
41
+ export const FullScreenWithLongContent = {
42
+ args: {
43
+ header,
44
+ content: longContent,
29
45
  isFullScreen: true,
30
46
  },
31
47
  };
@@ -0,0 +1,6 @@
1
+ import { RadioButtons } from "@/core/molecules";
2
+ import { Meta, StoryObj } from "@storybook/nextjs-vite";
3
+ declare const meta: Meta<typeof RadioButtons>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const TextOnly: Story;
@@ -0,0 +1,19 @@
1
+ import { RadioButtons } from "@/core/molecules";
2
+ const meta = {
3
+ title: "Molecules/Radio Buttons",
4
+ component: RadioButtons,
5
+ tags: ["autodocs"],
6
+ parameters: {
7
+ layout: "centered",
8
+ },
9
+ };
10
+ export default meta;
11
+ export const TextOnly = {
12
+ args: {
13
+ name: "location ",
14
+ options: [
15
+ { label: "Singapore", value: "Singapore" },
16
+ { label: "Hong Kong", value: "Hong Kong" },
17
+ ],
18
+ },
19
+ };