@grantbii/design-system 1.0.52 → 1.0.54
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/atoms/BrandLogo.js +2 -2
- package/core/foundations/icons.js +2 -1
- package/core/global/GlobalStyle.d.ts +1 -1
- package/core/global/GlobalStyle.js +1 -1
- package/core/organisms/GrantMatch.d.ts +9 -12
- package/core/organisms/GrantMatch.js +25 -50
- package/package.json +15 -15
- package/stories/organisms/GrantMatch.stories.d.ts +6 -2
- package/stories/organisms/GrantMatch.stories.js +8 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/public/fonts/satoshi/README.md +0 -51
- package/public/fonts/satoshi/css/satoshi.css +0 -179
- package/public/fonts/satoshi/fonts/Satoshi-Black.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Black.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Black.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Black.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-BlackItalic.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-BlackItalic.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-BlackItalic.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-BlackItalic.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Bold.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Bold.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Bold.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Bold.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-BoldItalic.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-BoldItalic.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-BoldItalic.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-BoldItalic.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Italic.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Italic.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Italic.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Italic.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Light.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Light.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Light.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Light.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-LightItalic.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-LightItalic.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-LightItalic.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-LightItalic.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Medium.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Medium.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Medium.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Medium.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-MediumItalic.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-MediumItalic.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-MediumItalic.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-MediumItalic.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Regular.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Regular.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Regular.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Regular.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Variable.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Variable.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Variable.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-Variable.woff2 +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-VariableItalic.eot +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-VariableItalic.ttf +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-VariableItalic.woff +0 -0
- package/public/fonts/satoshi/fonts/Satoshi-VariableItalic.woff2 +0 -0
- package/public/icons/grant_match.webp +0 -0
- package/public/logos/brand_logo-dark.webp +0 -0
- package/public/logos/brand_logo-light.webp +0 -0
package/core/atoms/BrandLogo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Image from "next/image";
|
|
3
|
-
import darkLogo from "
|
|
4
|
-
import lightLogo from "
|
|
3
|
+
import darkLogo from "./logos/brand_logo-dark.webp";
|
|
4
|
+
import lightLogo from "./logos/brand_logo-light.webp";
|
|
5
5
|
const BrandLogo = ({ width = 250, height = 80, isDarkTheme = true, alt = "Grantbii", }) => (_jsx(Image, { src: isDarkTheme ? darkLogo : lightLogo, alt: alt, width: width, height: height, priority: true }));
|
|
6
6
|
export default BrandLogo;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export * from "@phosphor-icons/react";
|
|
3
3
|
import Image from "next/image";
|
|
4
|
-
|
|
4
|
+
import grantMatchIcon from "./icons/grant_match.webp";
|
|
5
|
+
export const GrantMatchIcon = ({ size = 20 }) => (_jsx(Image, { src: grantMatchIcon, alt: "Grant Match", width: size, height: size }));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createGlobalStyle } from "styled-components";
|
|
3
|
-
import "../../public/fonts/satoshi/css/satoshi.css";
|
|
4
3
|
import { LAPTOP_WIDTH_PIXELS } from "../foundations/breakpoints";
|
|
5
4
|
import * as Colors from "../foundations/colors";
|
|
5
|
+
import "./fonts/satoshi/css/satoshi.css";
|
|
6
6
|
const GlobalStyle = createGlobalStyle `
|
|
7
7
|
html,
|
|
8
8
|
body {
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { GrantMatchQuery } from "@grantbii/ui-base/match/models";
|
|
2
|
-
type
|
|
2
|
+
type GrantMatchQueryProps = {
|
|
3
3
|
query: GrantMatchQuery;
|
|
4
4
|
updateQueryFiles: (newFiles: File[]) => void;
|
|
5
|
+
removeQueryFile: (fileName: string) => void;
|
|
5
6
|
updateQueryText: (newText: string) => void;
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
removeQueryText: () => void;
|
|
8
|
+
resetQuery: () => void;
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export declare const useMatchQuery: () => {
|
|
12
|
-
query: {
|
|
13
|
-
files: File[];
|
|
14
|
-
text: string;
|
|
15
|
-
};
|
|
16
|
-
updateQueryFiles: (newFiles: File[]) => void;
|
|
17
|
-
updateQueryText: (newText: string) => void;
|
|
10
|
+
type GrantMatchProps = GrantMatchQueryProps & {
|
|
11
|
+
isModalFullScreen?: boolean;
|
|
18
12
|
};
|
|
13
|
+
declare const GrantMatch: ({ query, updateQueryFiles, removeQueryFile, updateQueryText, removeQueryText, resetQuery, isModalFullScreen, }: GrantMatchProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default GrantMatch;
|
|
15
|
+
export declare const useGrantMatchQueryItems: () => GrantMatchQueryProps;
|
|
@@ -5,60 +5,35 @@ import styled from "styled-components";
|
|
|
5
5
|
import { Badge, Button, Textarea } from "../atoms";
|
|
6
6
|
import { Colors, Icons } from "../foundations";
|
|
7
7
|
import { FileDrop, Modal, useFileDrop, useModal } from "../molecules";
|
|
8
|
-
const GrantMatch = ({ query, updateQueryFiles, updateQueryText,
|
|
8
|
+
const GrantMatch = ({ query, updateQueryFiles, removeQueryFile, updateQueryText, removeQueryText, resetQuery, isModalFullScreen, }) => {
|
|
9
9
|
const { showModal, openModal, closeModal } = useModal();
|
|
10
|
-
const { performGrantMatch, resetGrantMatch, removeUploadedFile, removeQueryText, } = useGrantMatch(query, updateQueryFiles, updateQueryText, onPerformGrantMatch, onResetGrantMatch, closeModal);
|
|
11
10
|
const isActive = isGrantMatchActive(query);
|
|
12
|
-
return (_jsxs(Container, { children: [_jsx(GrantMatchButtons, { isActive: isActive, onClickMatch: () => openModal(), onClickReset: () => resetGrantMatch() }), isActive ? (_jsx(QueryItems, { uploadedFiles: query.files, removeUploadedFile: removeUploadedFile, queryText: query.text, removeQueryText: removeQueryText })) : (_jsx(_Fragment, {})), showModal ? (_jsx(GrantMatchModal, { activeFiles: query.files, activeText: query.text, performGrantMatch: performGrantMatch, onClickCancel: () => closeModal() })) : (_jsx(_Fragment, {}))] }));
|
|
13
|
-
};
|
|
14
|
-
export default GrantMatch;
|
|
15
|
-
export const useMatchQuery = () => {
|
|
16
|
-
const [files, setFiles] = useState([]);
|
|
17
|
-
const [text, setText] = useState("");
|
|
18
|
-
return {
|
|
19
|
-
query: { files, text },
|
|
20
|
-
updateQueryFiles: (newFiles) => setFiles(newFiles),
|
|
21
|
-
updateQueryText: (newText) => setText(newText),
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
const useGrantMatch = (query, updateQueryFiles, updateQueryText, onPerformGrantMatch, onResetGrantMatch, closeModal) => {
|
|
25
11
|
const performGrantMatch = (newFiles, newText) => {
|
|
26
12
|
updateQueryFiles(newFiles);
|
|
27
13
|
updateQueryText(newText);
|
|
28
|
-
onPerformGrantMatch({ files: newFiles, text: newText });
|
|
29
14
|
closeModal();
|
|
30
15
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const removeQueryText = () => {
|
|
48
|
-
updateQueryText("");
|
|
49
|
-
const newQuery = { files: query.files, text: "" };
|
|
50
|
-
if (isGrantMatchActive(newQuery)) {
|
|
51
|
-
onPerformGrantMatch(newQuery);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
onResetGrantMatch();
|
|
55
|
-
}
|
|
56
|
-
};
|
|
16
|
+
return (_jsxs(Container, { children: [_jsx(GrantMatchButtons, { isActive: isActive, onClickMatch: () => openModal(), onClickReset: () => resetQuery() }), isActive ? (_jsx(QueryItems, { queryFiles: query.files, removeQueryFile: removeQueryFile, queryText: query.text, removeQueryText: removeQueryText })) : (_jsx(_Fragment, {})), showModal ? (_jsx(GrantMatchModal, { activeFiles: query.files, activeText: query.text, performGrantMatch: performGrantMatch, onClickCancel: () => closeModal(), isFullScreen: isModalFullScreen })) : (_jsx(_Fragment, {}))] }));
|
|
17
|
+
};
|
|
18
|
+
export default GrantMatch;
|
|
19
|
+
const BLANK_GRANT_MATCH_QUERY = { files: [], text: "" };
|
|
20
|
+
export const useGrantMatchQueryItems = () => {
|
|
21
|
+
const [query, setQuery] = useState(() => (Object.assign({}, BLANK_GRANT_MATCH_QUERY)));
|
|
22
|
+
const updateQueryFiles = (files) => setQuery(({ text }) => ({ files, text }));
|
|
23
|
+
const removeQueryFile = (fileName) => setQuery(({ files, text }) => ({
|
|
24
|
+
files: files.filter((file) => file.name !== fileName),
|
|
25
|
+
text,
|
|
26
|
+
}));
|
|
27
|
+
const updateQueryText = (text) => setQuery(({ files }) => ({ files, text }));
|
|
28
|
+
const removeQueryText = () => setQuery(({ files }) => ({ files, text: "" }));
|
|
29
|
+
const resetQuery = () => setQuery(Object.assign({}, BLANK_GRANT_MATCH_QUERY));
|
|
57
30
|
return {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
31
|
+
query,
|
|
32
|
+
updateQueryFiles,
|
|
33
|
+
removeQueryFile,
|
|
34
|
+
updateQueryText,
|
|
61
35
|
removeQueryText,
|
|
36
|
+
resetQuery,
|
|
62
37
|
};
|
|
63
38
|
};
|
|
64
39
|
const Container = styled.div `
|
|
@@ -95,10 +70,10 @@ const BaseGrantMatchButton = styled.button `
|
|
|
95
70
|
border: 1px solid
|
|
96
71
|
${({ $isActive }) => $isActive ? Colors.accent.yellow1 : Colors.neutral.grey3};
|
|
97
72
|
`;
|
|
98
|
-
const QueryItems = ({
|
|
73
|
+
const QueryItems = ({ queryFiles, removeQueryFile, queryText, removeQueryText, }) => (_jsxs(BaseQueryItems, { children: [queryFiles.map((file) => {
|
|
99
74
|
var _a;
|
|
100
|
-
return (_jsx(Badge, { text: file.name, Icon: (_a = FILE_TYPE_ICON_MAP[file.type]) !== null && _a !== void 0 ? _a : Icons.FileIcon, onClickClose: () =>
|
|
101
|
-
}), queryText === "" ? (_jsx(_Fragment, {})) : (_jsx(Badge, { text: "Additional Information", Icon: Icons.TextAaIcon, onClickClose: () => removeQueryText(), textWidthPixels:
|
|
75
|
+
return (_jsx(Badge, { text: file.name, Icon: (_a = FILE_TYPE_ICON_MAP[file.type]) !== null && _a !== void 0 ? _a : Icons.FileIcon, onClickClose: () => removeQueryFile(file.name), textWidthPixels: 160 }, file.name));
|
|
76
|
+
}), queryText === "" ? (_jsx(_Fragment, {})) : (_jsx(Badge, { text: "Additional Information", Icon: Icons.TextAaIcon, onClickClose: () => removeQueryText(), textWidthPixels: 180 }, "additional-information-query-item"))] }));
|
|
102
77
|
const BaseQueryItems = styled.div `
|
|
103
78
|
display: flex;
|
|
104
79
|
align-items: center;
|
|
@@ -116,11 +91,11 @@ const BaseQueryItems = styled.div `
|
|
|
116
91
|
const FILE_TYPE_ICON_MAP = {
|
|
117
92
|
"application/pdf": Icons.FilePdfIcon,
|
|
118
93
|
};
|
|
119
|
-
const GrantMatchModal = ({ activeFiles, activeText, performGrantMatch, onClickCancel, }) => {
|
|
94
|
+
const GrantMatchModal = ({ activeFiles, activeText, performGrantMatch, onClickCancel, isFullScreen, }) => {
|
|
120
95
|
const { files, uploadFiles, removeFile } = useFileDrop(activeFiles);
|
|
121
96
|
const [queryText, setQueryText] = useState(activeText);
|
|
122
97
|
const updateQueryText = (newText) => setQueryText(newText);
|
|
123
|
-
return (_jsx(Modal, { header: _jsx(Header, {}), content: _jsx(Content, { files: files, uploadFiles: uploadFiles, removeFile: removeFile, queryText: queryText, updateQueryText: updateQueryText }), footer: _jsx(Button, { text: "Find My Grants", onClick: () => performGrantMatch(files, queryText), backgroundColor: Colors.accent.yellow1 }), onClickCancel: onClickCancel }));
|
|
98
|
+
return (_jsx(Modal, { header: _jsx(Header, {}), content: _jsx(Content, { files: files, uploadFiles: uploadFiles, removeFile: removeFile, queryText: queryText, updateQueryText: updateQueryText }), footer: _jsx(Button, { text: "Find My Grants", onClick: () => performGrantMatch(files, queryText), backgroundColor: Colors.accent.yellow1 }), onClickCancel: onClickCancel, isFullScreen: isFullScreen }));
|
|
124
99
|
};
|
|
125
100
|
const Header = () => (_jsxs(BaseHeader, { children: [_jsx(Icons.GrantMatchIcon, { size: 24 }), _jsx("div", { children: "Grant Match" })] }));
|
|
126
101
|
const BaseHeader = styled.div `
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grantbii/design-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.54",
|
|
4
4
|
"description": "Grantbii's Design System",
|
|
5
5
|
"homepage": "https://design.grantbii.com",
|
|
6
6
|
"repository": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"lint": "next lint",
|
|
14
14
|
"prepare": "husky",
|
|
15
|
-
"build": "npx tsc && cp
|
|
15
|
+
"build": "npx tsc && cp ./package.json ./dist && cp README.md ./dist",
|
|
16
16
|
"postpublish": "rm -rf dist/",
|
|
17
17
|
"storybook": "storybook dev -p 6006",
|
|
18
18
|
"build-storybook": "storybook build"
|
|
@@ -28,27 +28,27 @@
|
|
|
28
28
|
"styled-components": "^6.1.19"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@chromatic-com/storybook": "^4.0
|
|
32
|
-
"@eslint/js": "^9.
|
|
31
|
+
"@chromatic-com/storybook": "^4.1.0",
|
|
32
|
+
"@eslint/js": "^9.33.0",
|
|
33
33
|
"@next/eslint-plugin-next": "^15.4.2",
|
|
34
|
-
"@storybook/addon-a11y": "^9.
|
|
35
|
-
"@storybook/addon-docs": "^9.
|
|
36
|
-
"@storybook/addon-onboarding": "^9.
|
|
37
|
-
"@storybook/addon-vitest": "^9.
|
|
38
|
-
"@storybook/nextjs-vite": "^9.
|
|
34
|
+
"@storybook/addon-a11y": "^9.1.2",
|
|
35
|
+
"@storybook/addon-docs": "^9.1.2",
|
|
36
|
+
"@storybook/addon-onboarding": "^9.1.2",
|
|
37
|
+
"@storybook/addon-vitest": "^9.1.2",
|
|
38
|
+
"@storybook/nextjs-vite": "^9.1.2",
|
|
39
39
|
"@types/node": "^20",
|
|
40
40
|
"@types/react": "^19",
|
|
41
41
|
"@types/react-dom": "^19",
|
|
42
42
|
"@vitest/browser": "^3.2.4",
|
|
43
43
|
"@vitest/coverage-v8": "^3.2.4",
|
|
44
|
-
"eslint": "^9.
|
|
45
|
-
"eslint-config-next": "15.4.
|
|
46
|
-
"eslint-plugin-storybook": "^9.1.
|
|
44
|
+
"eslint": "^9.33.0",
|
|
45
|
+
"eslint-config-next": "15.4.6",
|
|
46
|
+
"eslint-plugin-storybook": "^9.1.2",
|
|
47
47
|
"husky": "^9.1.7",
|
|
48
|
-
"lint-staged": "^16.1.
|
|
49
|
-
"playwright": "^1.54.
|
|
48
|
+
"lint-staged": "^16.1.5",
|
|
49
|
+
"playwright": "^1.54.2",
|
|
50
50
|
"prettier": "^3.6.2",
|
|
51
|
-
"storybook": "^9.1.
|
|
51
|
+
"storybook": "^9.1.2",
|
|
52
52
|
"typescript": "^5.8.3",
|
|
53
53
|
"vitest": "^3.2.4"
|
|
54
54
|
},
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
|
|
2
|
+
type GrantMatchExampleProps = {
|
|
3
|
+
isModalFullScreen?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const GrantMatchExample: ({ isModalFullScreen }: GrantMatchExampleProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
6
|
declare const meta: Meta<typeof GrantMatchExample>;
|
|
4
7
|
export default meta;
|
|
5
8
|
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const
|
|
9
|
+
export declare const PopUp: Story;
|
|
10
|
+
export declare const FullScreen: Story;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { GrantMatch } from "@/.";
|
|
3
|
-
import {
|
|
3
|
+
import { useGrantMatchQueryItems } from "@/core/organisms/GrantMatch";
|
|
4
4
|
import styled from "styled-components";
|
|
5
|
-
const GrantMatchExample = () => {
|
|
6
|
-
const
|
|
7
|
-
return (_jsx(Container, { children: _jsx(GrantMatch, Object.assign({},
|
|
5
|
+
const GrantMatchExample = ({ isModalFullScreen }) => {
|
|
6
|
+
const grantMatchProps = useGrantMatchQueryItems();
|
|
7
|
+
return (_jsx(Container, { children: _jsx(GrantMatch, Object.assign({}, grantMatchProps, { isModalFullScreen: isModalFullScreen })) }));
|
|
8
8
|
};
|
|
9
9
|
const Container = styled.div `
|
|
10
10
|
width: 90vw;
|
|
@@ -18,6 +18,9 @@ const meta = {
|
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
export default meta;
|
|
21
|
-
export const
|
|
21
|
+
export const PopUp = {
|
|
22
22
|
args: {},
|
|
23
23
|
};
|
|
24
|
+
export const FullScreen = {
|
|
25
|
+
args: { isModalFullScreen: true },
|
|
26
|
+
};
|