@grantbii/design-system 1.0.54 → 1.0.56
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/assets/fonts/satoshi/README.md +51 -0
- package/core/assets/fonts/satoshi/css/satoshi.css +179 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Black.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Black.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Black.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Black.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-BlackItalic.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-BlackItalic.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-BlackItalic.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-BlackItalic.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Bold.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Bold.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Bold.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Bold.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-BoldItalic.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-BoldItalic.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-BoldItalic.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-BoldItalic.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Italic.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Italic.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Italic.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Italic.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Light.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Light.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Light.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Light.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-LightItalic.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-LightItalic.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-LightItalic.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-LightItalic.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Medium.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Medium.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Medium.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Medium.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-MediumItalic.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-MediumItalic.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-MediumItalic.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-MediumItalic.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Regular.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Regular.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Regular.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Regular.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Variable.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Variable.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Variable.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-Variable.woff2 +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-VariableItalic.eot +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-VariableItalic.ttf +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-VariableItalic.woff +0 -0
- package/core/assets/fonts/satoshi/fonts/Satoshi-VariableItalic.woff2 +0 -0
- package/core/assets/icons/grant_match.webp +0 -0
- package/core/assets/logos/brand_logo-dark.webp +0 -0
- package/core/assets/logos/brand_logo-light.webp +0 -0
- package/core/atoms/BrandLogo.js +2 -2
- package/core/foundations/icons.js +1 -1
- package/core/global/GlobalStyle.d.ts +1 -1
- package/core/global/GlobalStyle.js +1 -1
- package/core/organisms/GrantMatch.d.ts +10 -7
- package/core/organisms/GrantMatch.js +9 -15
- package/package.json +2 -2
- package/stories/organisms/GrantMatch.stories.js +6 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Installing Webfonts
|
|
2
|
+
|
|
3
|
+
Follow these simple Steps.
|
|
4
|
+
|
|
5
|
+
## 1.
|
|
6
|
+
|
|
7
|
+
Put `satoshi/` Folder into a Folder called `fonts/`.
|
|
8
|
+
|
|
9
|
+
## 2.
|
|
10
|
+
|
|
11
|
+
Put `satoshi.css` into your `css/` Folder.
|
|
12
|
+
|
|
13
|
+
## 3. (Optional)
|
|
14
|
+
|
|
15
|
+
You may adapt the `url('path')` in `satoshi.css` depends on your Website Filesystem.
|
|
16
|
+
|
|
17
|
+
## 4.
|
|
18
|
+
|
|
19
|
+
Import `satoshi.css` at the top of you main Stylesheet.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
@import url('satoshi.css');
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 5.
|
|
26
|
+
|
|
27
|
+
You are now ready to use the following Rules in your CSS to specify each Font Style:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
font-family: Satoshi-Light;
|
|
31
|
+
font-family: Satoshi-LightItalic;
|
|
32
|
+
font-family: Satoshi-Regular;
|
|
33
|
+
font-family: Satoshi-Italic;
|
|
34
|
+
font-family: Satoshi-Medium;
|
|
35
|
+
font-family: Satoshi-MediumItalic;
|
|
36
|
+
font-family: Satoshi-Bold;
|
|
37
|
+
font-family: Satoshi-BoldItalic;
|
|
38
|
+
font-family: Satoshi-Black;
|
|
39
|
+
font-family: Satoshi-BlackItalic;
|
|
40
|
+
font-family: Satoshi-Variable;
|
|
41
|
+
font-family: Satoshi-VariableItalic;
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 6. (Optional)
|
|
46
|
+
|
|
47
|
+
Use `font-variation-settings` rule to controll axes of variable fonts:
|
|
48
|
+
wght 900.0
|
|
49
|
+
|
|
50
|
+
Available axes:
|
|
51
|
+
'wght' (range from 300.0 to 900.0
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Font Family: Satoshi
|
|
5
|
+
* Designed by: Deni Anggara
|
|
6
|
+
* URL: https://www.fontshare.com/fonts/satoshi
|
|
7
|
+
* © 2025 Indian Type Foundry
|
|
8
|
+
*
|
|
9
|
+
* Satoshi Light
|
|
10
|
+
* Satoshi LightItalic
|
|
11
|
+
* Satoshi Regular
|
|
12
|
+
* Satoshi Italic
|
|
13
|
+
* Satoshi Medium
|
|
14
|
+
* Satoshi MediumItalic
|
|
15
|
+
* Satoshi Bold
|
|
16
|
+
* Satoshi BoldItalic
|
|
17
|
+
* Satoshi Black
|
|
18
|
+
* Satoshi BlackItalic
|
|
19
|
+
* Satoshi Variable (Variable font)
|
|
20
|
+
* Satoshi VariableItalic (Variable font)
|
|
21
|
+
*
|
|
22
|
+
* Satoshi -> Satoshi Variable (Variable font)
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
@font-face {
|
|
26
|
+
font-family: "Satoshi-Light";
|
|
27
|
+
src:
|
|
28
|
+
url("../fonts/Satoshi-Light.woff2") format("woff2"),
|
|
29
|
+
url("../fonts/Satoshi-Light.woff") format("woff"),
|
|
30
|
+
url("../fonts/Satoshi-Light.ttf") format("truetype");
|
|
31
|
+
font-weight: 300;
|
|
32
|
+
font-display: swap;
|
|
33
|
+
font-style: normal;
|
|
34
|
+
}
|
|
35
|
+
@font-face {
|
|
36
|
+
font-family: "Satoshi-LightItalic";
|
|
37
|
+
src:
|
|
38
|
+
url("../fonts/Satoshi-LightItalic.woff2") format("woff2"),
|
|
39
|
+
url("../fonts/Satoshi-LightItalic.woff") format("woff"),
|
|
40
|
+
url("../fonts/Satoshi-LightItalic.ttf") format("truetype");
|
|
41
|
+
font-weight: 300;
|
|
42
|
+
font-display: swap;
|
|
43
|
+
font-style: italic;
|
|
44
|
+
}
|
|
45
|
+
@font-face {
|
|
46
|
+
font-family: "Satoshi-Regular";
|
|
47
|
+
src:
|
|
48
|
+
url("../fonts/Satoshi-Regular.woff2") format("woff2"),
|
|
49
|
+
url("../fonts/Satoshi-Regular.woff") format("woff"),
|
|
50
|
+
url("../fonts/Satoshi-Regular.ttf") format("truetype");
|
|
51
|
+
font-weight: 400;
|
|
52
|
+
font-display: swap;
|
|
53
|
+
font-style: normal;
|
|
54
|
+
}
|
|
55
|
+
@font-face {
|
|
56
|
+
font-family: "Satoshi-Italic";
|
|
57
|
+
src:
|
|
58
|
+
url("../fonts/Satoshi-Italic.woff2") format("woff2"),
|
|
59
|
+
url("../fonts/Satoshi-Italic.woff") format("woff"),
|
|
60
|
+
url("../fonts/Satoshi-Italic.ttf") format("truetype");
|
|
61
|
+
font-weight: 400;
|
|
62
|
+
font-display: swap;
|
|
63
|
+
font-style: italic;
|
|
64
|
+
}
|
|
65
|
+
@font-face {
|
|
66
|
+
font-family: "Satoshi-Medium";
|
|
67
|
+
src:
|
|
68
|
+
url("../fonts/Satoshi-Medium.woff2") format("woff2"),
|
|
69
|
+
url("../fonts/Satoshi-Medium.woff") format("woff"),
|
|
70
|
+
url("../fonts/Satoshi-Medium.ttf") format("truetype");
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
font-display: swap;
|
|
73
|
+
font-style: normal;
|
|
74
|
+
}
|
|
75
|
+
@font-face {
|
|
76
|
+
font-family: "Satoshi-MediumItalic";
|
|
77
|
+
src:
|
|
78
|
+
url("../fonts/Satoshi-MediumItalic.woff2") format("woff2"),
|
|
79
|
+
url("../fonts/Satoshi-MediumItalic.woff") format("woff"),
|
|
80
|
+
url("../fonts/Satoshi-MediumItalic.ttf") format("truetype");
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
font-display: swap;
|
|
83
|
+
font-style: italic;
|
|
84
|
+
}
|
|
85
|
+
@font-face {
|
|
86
|
+
font-family: "Satoshi-Bold";
|
|
87
|
+
src:
|
|
88
|
+
url("../fonts/Satoshi-Bold.woff2") format("woff2"),
|
|
89
|
+
url("../fonts/Satoshi-Bold.woff") format("woff"),
|
|
90
|
+
url("../fonts/Satoshi-Bold.ttf") format("truetype");
|
|
91
|
+
font-weight: 700;
|
|
92
|
+
font-display: swap;
|
|
93
|
+
font-style: normal;
|
|
94
|
+
}
|
|
95
|
+
@font-face {
|
|
96
|
+
font-family: "Satoshi-BoldItalic";
|
|
97
|
+
src:
|
|
98
|
+
url("../fonts/Satoshi-BoldItalic.woff2") format("woff2"),
|
|
99
|
+
url("../fonts/Satoshi-BoldItalic.woff") format("woff"),
|
|
100
|
+
url("../fonts/Satoshi-BoldItalic.ttf") format("truetype");
|
|
101
|
+
font-weight: 700;
|
|
102
|
+
font-display: swap;
|
|
103
|
+
font-style: italic;
|
|
104
|
+
}
|
|
105
|
+
@font-face {
|
|
106
|
+
font-family: "Satoshi-Black";
|
|
107
|
+
src:
|
|
108
|
+
url("../fonts/Satoshi-Black.woff2") format("woff2"),
|
|
109
|
+
url("../fonts/Satoshi-Black.woff") format("woff"),
|
|
110
|
+
url("../fonts/Satoshi-Black.ttf") format("truetype");
|
|
111
|
+
font-weight: 900;
|
|
112
|
+
font-display: swap;
|
|
113
|
+
font-style: normal;
|
|
114
|
+
}
|
|
115
|
+
@font-face {
|
|
116
|
+
font-family: "Satoshi-BlackItalic";
|
|
117
|
+
src:
|
|
118
|
+
url("../fonts/Satoshi-BlackItalic.woff2") format("woff2"),
|
|
119
|
+
url("../fonts/Satoshi-BlackItalic.woff") format("woff"),
|
|
120
|
+
url("../fonts/Satoshi-BlackItalic.ttf") format("truetype");
|
|
121
|
+
font-weight: 900;
|
|
122
|
+
font-display: swap;
|
|
123
|
+
font-style: italic;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* This is a variable font
|
|
127
|
+
* You can control variable axes as shown below:
|
|
128
|
+
* font-variation-settings: wght 900.0;
|
|
129
|
+
*
|
|
130
|
+
* available axes:
|
|
131
|
+
'wght' (range from 300.0 to 900.0
|
|
132
|
+
*/
|
|
133
|
+
@font-face {
|
|
134
|
+
font-family: "Satoshi-Variable";
|
|
135
|
+
src:
|
|
136
|
+
url("../fonts/Satoshi-Variable.woff2") format("woff2"),
|
|
137
|
+
url("../fonts/Satoshi-Variable.woff") format("woff"),
|
|
138
|
+
url("../fonts/Satoshi-Variable.ttf") format("truetype");
|
|
139
|
+
font-weight: 300 900;
|
|
140
|
+
font-display: swap;
|
|
141
|
+
font-style: normal;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* This is a variable font
|
|
145
|
+
* You can control variable axes as shown below:
|
|
146
|
+
* font-variation-settings: wght 900.0;
|
|
147
|
+
*
|
|
148
|
+
* available axes:
|
|
149
|
+
'wght' (range from 300.0 to 900.0
|
|
150
|
+
*/
|
|
151
|
+
@font-face {
|
|
152
|
+
font-family: "Satoshi-VariableItalic";
|
|
153
|
+
src:
|
|
154
|
+
url("../fonts/Satoshi-VariableItalic.woff2") format("woff2"),
|
|
155
|
+
url("../fonts/Satoshi-VariableItalic.woff") format("woff"),
|
|
156
|
+
url("../fonts/Satoshi-VariableItalic.ttf") format("truetype");
|
|
157
|
+
font-weight: 300 900;
|
|
158
|
+
font-display: swap;
|
|
159
|
+
font-style: italic;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* This is a variable font
|
|
164
|
+
* You can control variable axes as shown below:
|
|
165
|
+
* font-variation-settings: wght 900.0;
|
|
166
|
+
*
|
|
167
|
+
* available axes:
|
|
168
|
+
'wght' (range from 300.0 to 900.0
|
|
169
|
+
*/
|
|
170
|
+
@font-face {
|
|
171
|
+
font-family: "Satoshi"; /* same as Satoshi-Variable */
|
|
172
|
+
src:
|
|
173
|
+
url("../fonts/Satoshi-Variable.woff2") format("woff2"),
|
|
174
|
+
url("../fonts/Satoshi-Variable.woff") format("woff"),
|
|
175
|
+
url("../fonts/Satoshi-Variable.ttf") format("truetype");
|
|
176
|
+
font-weight: 300 900;
|
|
177
|
+
font-display: swap;
|
|
178
|
+
font-style: normal;
|
|
179
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
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 "../assets/logos/brand_logo-dark.webp";
|
|
4
|
+
import lightLogo from "../assets/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,5 +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
|
-
import grantMatchIcon from "
|
|
4
|
+
import grantMatchIcon from "../assets/icons/grant_match.webp";
|
|
5
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 "../assets/fonts/satoshi/css/satoshi.css";
|
|
3
4
|
import { LAPTOP_WIDTH_PIXELS } from "../foundations/breakpoints";
|
|
4
5
|
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,15 +1,18 @@
|
|
|
1
1
|
import { GrantMatchQuery } from "@grantbii/ui-base/match/models";
|
|
2
|
-
type
|
|
2
|
+
type GrantMatchProps = {
|
|
3
3
|
query: GrantMatchQuery;
|
|
4
|
-
|
|
4
|
+
onPerformGrantMatch: (newQuery: GrantMatchQuery) => void;
|
|
5
5
|
removeQueryFile: (fileName: string) => void;
|
|
6
|
-
updateQueryText: (newText: string) => void;
|
|
7
6
|
removeQueryText: () => void;
|
|
8
7
|
resetQuery: () => void;
|
|
9
|
-
};
|
|
10
|
-
type GrantMatchProps = GrantMatchQueryProps & {
|
|
11
8
|
isModalFullScreen?: boolean;
|
|
12
9
|
};
|
|
13
|
-
declare const GrantMatch: ({ query,
|
|
10
|
+
declare const GrantMatch: ({ query, onPerformGrantMatch, removeQueryFile, removeQueryText, resetQuery, isModalFullScreen, }: GrantMatchProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
11
|
export default GrantMatch;
|
|
15
|
-
export declare const useGrantMatchQueryItems: () =>
|
|
12
|
+
export declare const useGrantMatchQueryItems: () => {
|
|
13
|
+
query: GrantMatchQuery;
|
|
14
|
+
updateQuery: (newQuery: GrantMatchQuery) => void;
|
|
15
|
+
removeQueryFile: (fileName: string) => void;
|
|
16
|
+
removeQueryText: () => void;
|
|
17
|
+
resetQuery: () => void;
|
|
18
|
+
};
|
|
@@ -5,12 +5,11 @@ 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,
|
|
8
|
+
const GrantMatch = ({ query, onPerformGrantMatch, removeQueryFile, removeQueryText, resetQuery, isModalFullScreen, }) => {
|
|
9
9
|
const { showModal, openModal, closeModal } = useModal();
|
|
10
10
|
const isActive = isGrantMatchActive(query);
|
|
11
|
-
const performGrantMatch = (
|
|
12
|
-
|
|
13
|
-
updateQueryText(newText);
|
|
11
|
+
const performGrantMatch = (newQuery) => {
|
|
12
|
+
onPerformGrantMatch(newQuery);
|
|
14
13
|
closeModal();
|
|
15
14
|
};
|
|
16
15
|
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, {}))] }));
|
|
@@ -19,19 +18,17 @@ export default GrantMatch;
|
|
|
19
18
|
const BLANK_GRANT_MATCH_QUERY = { files: [], text: "" };
|
|
20
19
|
export const useGrantMatchQueryItems = () => {
|
|
21
20
|
const [query, setQuery] = useState(() => (Object.assign({}, BLANK_GRANT_MATCH_QUERY)));
|
|
22
|
-
const
|
|
21
|
+
const updateQuery = (newQuery) => setQuery(Object.assign({}, newQuery));
|
|
23
22
|
const removeQueryFile = (fileName) => setQuery(({ files, text }) => ({
|
|
24
23
|
files: files.filter((file) => file.name !== fileName),
|
|
25
24
|
text,
|
|
26
25
|
}));
|
|
27
|
-
const updateQueryText = (text) => setQuery(({ files }) => ({ files, text }));
|
|
28
26
|
const removeQueryText = () => setQuery(({ files }) => ({ files, text: "" }));
|
|
29
27
|
const resetQuery = () => setQuery(Object.assign({}, BLANK_GRANT_MATCH_QUERY));
|
|
30
28
|
return {
|
|
31
29
|
query,
|
|
32
|
-
|
|
30
|
+
updateQuery,
|
|
33
31
|
removeQueryFile,
|
|
34
|
-
updateQueryText,
|
|
35
32
|
removeQueryText,
|
|
36
33
|
resetQuery,
|
|
37
34
|
};
|
|
@@ -93,9 +90,8 @@ const FILE_TYPE_ICON_MAP = {
|
|
|
93
90
|
};
|
|
94
91
|
const GrantMatchModal = ({ activeFiles, activeText, performGrantMatch, onClickCancel, isFullScreen, }) => {
|
|
95
92
|
const { files, uploadFiles, removeFile } = useFileDrop(activeFiles);
|
|
96
|
-
const [
|
|
97
|
-
|
|
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 }));
|
|
93
|
+
const [text, setText] = useState(activeText);
|
|
94
|
+
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: () => performGrantMatch({ files, text }), backgroundColor: Colors.accent.yellow1 }), onClickCancel: onClickCancel, isFullScreen: isFullScreen }));
|
|
99
95
|
};
|
|
100
96
|
const Header = () => (_jsxs(BaseHeader, { children: [_jsx(Icons.GrantMatchIcon, { size: 24 }), _jsx("div", { children: "Grant Match" })] }));
|
|
101
97
|
const BaseHeader = styled.div `
|
|
@@ -103,10 +99,8 @@ const BaseHeader = styled.div `
|
|
|
103
99
|
align-items: center;
|
|
104
100
|
gap: 12px;
|
|
105
101
|
`;
|
|
106
|
-
const Content = ({ files, uploadFiles, removeFile, queryText, updateQueryText, }) => {
|
|
107
|
-
|
|
108
|
-
return (_jsxs(BaseContent, { children: [_jsx(FileDrop, { uploadedFiles: files, uploadFiles: uploadFiles, removeFile: removeFile }), _jsxs(QueryText, { children: [_jsx("label", { htmlFor: additionalInformationId, children: "Additional Information" }), _jsx(Textarea, { id: additionalInformationId, value: queryText, onChange: (event) => updateQueryText(event.target.value) })] })] }));
|
|
109
|
-
};
|
|
102
|
+
const Content = ({ files, uploadFiles, removeFile, queryText, updateQueryText, }) => (_jsxs(BaseContent, { children: [_jsx(FileDrop, { uploadedFiles: files, uploadFiles: uploadFiles, removeFile: removeFile }), _jsxs(QueryText, { children: [_jsx("label", { htmlFor: ADDITIONAL_INFORMATION_ID, children: "Additional Information" }), _jsx(Textarea, { id: ADDITIONAL_INFORMATION_ID, value: queryText, onChange: (event) => updateQueryText(event.target.value) })] })] }));
|
|
103
|
+
const ADDITIONAL_INFORMATION_ID = "grant-match-additional-information";
|
|
110
104
|
const BaseContent = styled.div `
|
|
111
105
|
display: flex;
|
|
112
106
|
flex-direction: column;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grantbii/design-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.56",
|
|
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 ./package.json ./dist && cp README.md ./dist",
|
|
15
|
+
"build": "npx tsc && cp -r ./core/assets ./dist/core && 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"
|
|
@@ -3,8 +3,12 @@ import { GrantMatch } from "@/.";
|
|
|
3
3
|
import { useGrantMatchQueryItems } from "@/core/organisms/GrantMatch";
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
const GrantMatchExample = ({ isModalFullScreen }) => {
|
|
6
|
-
const
|
|
7
|
-
|
|
6
|
+
const { query, updateQuery, removeQueryFile, removeQueryText, resetQuery } = useGrantMatchQueryItems();
|
|
7
|
+
const onPerformGrantMatch = (newQuery) => {
|
|
8
|
+
updateQuery(newQuery);
|
|
9
|
+
console.log("finding grants...");
|
|
10
|
+
};
|
|
11
|
+
return (_jsx(Container, { children: _jsx(GrantMatch, { query: query, onPerformGrantMatch: onPerformGrantMatch, removeQueryFile: removeQueryFile, removeQueryText: removeQueryText, resetQuery: resetQuery, isModalFullScreen: isModalFullScreen }) }));
|
|
8
12
|
};
|
|
9
13
|
const Container = styled.div `
|
|
10
14
|
width: 90vw;
|