@grantbii/design-system 1.0.61 → 1.0.63

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.
@@ -10,6 +10,7 @@ type ButtonProps = {
10
10
  underline?: boolean;
11
11
  backgroundColor?: string;
12
12
  color?: string;
13
+ width?: string;
13
14
  };
14
- declare const Button: ({ text, onClick, disabled, LeftIcon, RightIcon, underline, backgroundColor, color, type, }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
15
+ declare const Button: ({ text, onClick, disabled, LeftIcon, RightIcon, underline, backgroundColor, color, width, type, }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
15
16
  export default Button;
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { BaseButton } from "./shared";
3
- const Button = ({ text, onClick, disabled, LeftIcon, RightIcon, underline, backgroundColor, color, type = "button", }) => (_jsx("button", { type: type, onClick: onClick, disabled: disabled, children: _jsxs(BaseButton, { "$underline": underline, "$backgroundColor": backgroundColor, "$color": color, children: [LeftIcon ? _jsx(LeftIcon, { color: color, size: 20 }) : _jsx(_Fragment, {}), _jsx("p", { children: text }), RightIcon ? _jsx(RightIcon, { color: color, size: 20 }) : _jsx(_Fragment, {})] }) }));
3
+ const Button = ({ text, onClick, disabled, LeftIcon, RightIcon, underline, backgroundColor, color, width, type = "button", }) => (_jsx("button", { type: type, onClick: onClick, disabled: disabled, children: _jsxs(BaseButton, { "$underline": underline, "$backgroundColor": backgroundColor, "$color": color, "$width": width, children: [LeftIcon ? _jsx(LeftIcon, { color: color, size: 20 }) : _jsx(_Fragment, {}), _jsx("p", { children: text }), RightIcon ? _jsx(RightIcon, { color: color, size: 20 }) : _jsx(_Fragment, {})] }) }));
4
4
  export default Button;
@@ -10,6 +10,7 @@ type LinkButtonProps = {
10
10
  underline?: boolean;
11
11
  backgroundColor?: string;
12
12
  color?: string;
13
+ width?: string;
13
14
  };
14
15
  /**
15
16
  * A link that looks like a button
@@ -20,4 +20,4 @@ const LinkButton = (_a) => {
20
20
  return disabled ? (_jsx(Content, Object.assign({}, contentProps))) : (_jsx(Link, { href: href, target: target, children: _jsx(Content, Object.assign({}, contentProps)) }));
21
21
  };
22
22
  export default LinkButton;
23
- const Content = ({ text, LeftIcon, RightIcon, underline, backgroundColor, color, }) => (_jsxs(BaseButton, { "$underline": underline, "$backgroundColor": backgroundColor, "$color": color, children: [LeftIcon ? _jsx(LeftIcon, { color: color, size: 20 }) : _jsx(_Fragment, {}), _jsx("p", { children: text }), RightIcon ? _jsx(RightIcon, { color: color, size: 20 }) : _jsx(_Fragment, {})] }));
23
+ const Content = ({ text, LeftIcon, RightIcon, underline, backgroundColor, color, width, }) => (_jsxs(BaseButton, { "$underline": underline, "$backgroundColor": backgroundColor, "$color": color, "$width": width, children: [LeftIcon ? _jsx(LeftIcon, { color: color, size: 20 }) : _jsx(_Fragment, {}), _jsx("p", { children: text }), RightIcon ? _jsx(RightIcon, { color: color, size: 20 }) : _jsx(_Fragment, {})] }));
@@ -1,10 +1,9 @@
1
- import { LoaderSizeProps } from "react-spinners/helpers/props";
1
+ import { LoaderSizeMarginProps } from "react-spinners/helpers/props";
2
2
  type PageLoaderProps = {
3
- pageWidth?: string;
4
- pageHeight?: string;
5
- } & LoaderSizeProps;
3
+ isPacman?: boolean;
4
+ } & LoaderSizeMarginProps;
6
5
  /**
7
6
  * The animation to show when loading the whole page
8
7
  */
9
- declare const PageLoader: ({ pageWidth, pageHeight, color, size, ...restOfProps }: PageLoaderProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const PageLoader: ({ isPacman, color, size, ...restOfProps }: PageLoaderProps) => import("react/jsx-runtime").JSX.Element;
10
9
  export default PageLoader;
@@ -10,15 +10,15 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import { MoonLoader } from "react-spinners";
13
+ import { MoonLoader, PacmanLoader } from "react-spinners";
14
14
  import styled from "styled-components";
15
15
  import { Colors } from "../foundations";
16
16
  /**
17
17
  * The animation to show when loading the whole page
18
18
  */
19
19
  const PageLoader = (_a) => {
20
- var { pageWidth, pageHeight, color = Colors.accent.blue1, size = 32 } = _a, restOfProps = __rest(_a, ["pageWidth", "pageHeight", "color", "size"]);
21
- return (_jsx(Background, { "$pageWidth": pageWidth, "$pageHeight": pageHeight, children: _jsx(MoonLoader, Object.assign({ color: color, size: size }, restOfProps)) }));
20
+ var { isPacman = false, color = Colors.accent.blue1, size } = _a, restOfProps = __rest(_a, ["isPacman", "color", "size"]);
21
+ return (_jsx(Background, { children: isPacman ? (_jsx(PacmanLoader, Object.assign({ color: color, size: size ? size : 20 }, restOfProps))) : (_jsx(MoonLoader, Object.assign({ color: color, size: size ? size : 32 }, restOfProps))) }));
22
22
  };
23
23
  export default PageLoader;
24
24
  const Background = styled.div `
@@ -26,6 +26,6 @@ const Background = styled.div `
26
26
  align-items: center;
27
27
  justify-content: center;
28
28
 
29
- width: ${({ $pageWidth = "100%" }) => $pageWidth};
30
- height: ${({ $pageHeight = "100%" }) => $pageHeight};
29
+ width: 100%;
30
+ height: 100%;
31
31
  `;
@@ -2,5 +2,6 @@ export declare const BaseButton: import("styled-components/dist/types").IStyledC
2
2
  $underline?: boolean;
3
3
  $backgroundColor?: string;
4
4
  $color?: string;
5
+ $width?: string;
5
6
  }>> & string;
6
7
  export declare const LabelInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -6,6 +6,8 @@ export const BaseButton = styled.div `
6
6
  align-items: center;
7
7
  gap: 10px;
8
8
 
9
+ width: ${({ $width = "auto" }) => $width};
10
+
9
11
  padding: 10px 16px;
10
12
  border-radius: 4px;
11
13
 
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useState } from "react";
3
- import styled from "styled-components";
3
+ import styled, { css } from "styled-components";
4
4
  import { Button } from "../atoms";
5
5
  import { Colors } from "../foundations";
6
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: content }), _jsxs(ModalFooter, { children: [_jsx(CancelButton, { onClick: onClickCancel }), footer ? footer : _jsx(_Fragment, {})] })] }) }));
@@ -55,6 +55,14 @@ const ModalWindow = styled.div `
55
55
 
56
56
  min-height: 100px;
57
57
  max-height: 100vh;
58
+
59
+ ${({ $isFullScreen = false }) => $isFullScreen
60
+ ? css `
61
+ position: fixed;
62
+ bottom: 0px;
63
+ left: 0px;
64
+ `
65
+ : ""}
58
66
  `;
59
67
  const ModalHeader = styled.div `
60
68
  font-weight: 500;
@@ -137,7 +137,7 @@ const FILE_TYPE_ICON_MAP = {
137
137
  const GrantMatchModal = ({ activeQuery, updateActiveQuery, onClickCancel, isFullScreen, }) => {
138
138
  const { files, uploadFiles, removeFile } = useFileDrop(activeQuery.files);
139
139
  const [text, setText] = useState(activeQuery.text);
140
- return (_jsx(Modal, { header: _jsx(Header, {}), content: _jsx(Content, { files: files, uploadFiles: uploadFiles, removeFile: removeFile, queryText: text, updateQueryText: (newText) => setText(newText) }), footer: _jsx(Button, { text: "Find My Grants", onClick: () => updateActiveQuery({ files, text }), backgroundColor: Colors.accent.yellow1 }), onClickCancel: onClickCancel, isFullScreen: isFullScreen, width: "480px" }));
140
+ return (_jsx(Modal, { header: _jsx(Header, {}), content: _jsx(Content, { files: files, uploadFiles: uploadFiles, removeFile: removeFile, queryText: text, updateQueryText: (newText) => setText(newText) }), footer: _jsx(Button, { text: "Find My Grants", onClick: () => updateActiveQuery({ files, text }), backgroundColor: Colors.accent.yellow1 }), onClickCancel: onClickCancel, isFullScreen: isFullScreen, width: "480px", height: "600px" }));
141
141
  };
142
142
  const Header = () => (_jsxs(BaseHeader, { children: [_jsx(Icons.GrantMatchIcon, { size: 24 }), _jsx("div", { children: "Grant Match" })] }));
143
143
  const BaseHeader = styled.div `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grantbii/design-system",
3
- "version": "1.0.61",
3
+ "version": "1.0.63",
4
4
  "description": "Grantbii's Design System",
5
5
  "homepage": "https://design.grantbii.com",
6
6
  "repository": {
@@ -18,7 +18,7 @@
18
18
  "build-storybook": "storybook build"
19
19
  },
20
20
  "dependencies": {
21
- "@grantbii/ui-base": "1.0.14",
21
+ "@grantbii/ui-base": "1.0.16",
22
22
  "@phosphor-icons/react": "^2.1.10",
23
23
  "country-flag-icons": "^1.5.19",
24
24
  "next": "^15.3.5",
@@ -1,6 +1,10 @@
1
1
  import { Meta, StoryObj } from "@storybook/nextjs-vite";
2
- declare const PageLoaderExample: () => import("react/jsx-runtime").JSX.Element;
2
+ type PageLoaderExampleProps = {
3
+ isPacman?: boolean;
4
+ };
5
+ declare const PageLoaderExample: ({ isPacman }: PageLoaderExampleProps) => import("react/jsx-runtime").JSX.Element;
3
6
  declare const meta: Meta<typeof PageLoaderExample>;
4
7
  export default meta;
5
8
  type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
9
+ export declare const GrantbiiApp: Story;
10
+ export declare const AdminConsole: Story;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PageLoader } from "@/.";
3
3
  import styled from "styled-components";
4
- const PageLoaderExample = () => (_jsx(BaseExample, { children: _jsx(PageLoader, {}) }));
4
+ const PageLoaderExample = ({ isPacman }) => (_jsx(BaseExample, { children: _jsx(PageLoader, { isPacman: isPacman }) }));
5
5
  const BaseExample = styled.div `
6
6
  width: 100vw;
7
7
  height: 100vh;
@@ -15,6 +15,9 @@ const meta = {
15
15
  },
16
16
  };
17
17
  export default meta;
18
- export const Default = {
18
+ export const GrantbiiApp = {
19
19
  args: {},
20
20
  };
21
+ export const AdminConsole = {
22
+ args: { isPacman: true },
23
+ };