@grantbii/design-system 1.0.39 → 1.0.40

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.
@@ -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, { 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);
@@ -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;
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.40",
4
4
  "description": "Grantbii's Design System",
5
5
  "homepage": "https://design.grantbii.com",
6
6
  "repository": {
@@ -13,5 +13,7 @@ declare const ModalExample: (props: ModalExampleProps) => import("react/jsx-runt
13
13
  declare const meta: Meta<typeof ModalExample>;
14
14
  export default meta;
15
15
  type Story = StoryObj<typeof meta>;
16
- export declare const DesktopVersion: Story;
17
- export declare const MobileVersion: Story;
16
+ export declare const PopUpWithShortContent: Story;
17
+ export declare const FullScreenWithShortContent: Story;
18
+ export declare const PopUpWithLongContent: Story;
19
+ 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
  };