@grantbii/design-system 1.16.1 → 1.18.0
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/archive/LinkButton.d.ts +3 -3
- package/core/archive/LinkButton.js +1 -1
- package/core/archive/LinkButton.js.map +1 -1
- package/core/archive/LocationIcon.js +2 -2
- package/core/archive/LocationIcon.js.map +1 -1
- package/core/atoms/Typography.d.ts +31 -7
- package/core/atoms/Typography.js +38 -18
- package/core/atoms/Typography.js.map +1 -1
- package/core/atoms/index.d.ts +1 -1
- package/core/atoms/index.js +1 -1
- package/core/atoms/index.js.map +1 -1
- package/core/global/GlobalStyle.js +3 -3
- package/core/global/GlobalStyle.js.map +1 -1
- package/core/integrations/index.d.ts +1 -1
- package/core/integrations/index.js +1 -1
- package/core/integrations/index.js.map +1 -1
- package/core/integrations/typography.d.ts +2 -0
- package/core/integrations/typography.js +17 -0
- package/core/integrations/typography.js.map +1 -0
- package/core/molecules/Badge.d.ts +3 -3
- package/core/molecules/Badge.js +4 -6
- package/core/molecules/Badge.js.map +1 -1
- package/core/molecules/Button.d.ts +3 -3
- package/core/molecules/Button.js +1 -1
- package/core/molecules/Button.js.map +1 -1
- package/core/molecules/PageLoader.js +7 -3
- package/core/molecules/PageLoader.js.map +1 -1
- package/core/organisms/FileDrop.js +6 -10
- package/core/organisms/FileDrop.js.map +1 -1
- package/core/organisms/GrantMatch/ActiveQueryFiles.js +2 -2
- package/core/organisms/GrantMatch/ActiveQueryFiles.js.map +1 -1
- package/core/organisms/GrantMatch/SearchBar.js +6 -6
- package/core/organisms/GrantMatch/SearchBar.js.map +1 -1
- package/core/shared.d.ts +2 -2
- package/core/shared.js +4 -4
- package/core/shared.js.map +1 -1
- package/core/templates/ErrorFallback.js +4 -8
- package/core/templates/ErrorFallback.js.map +1 -1
- package/package.json +1 -1
- package/stories/archive/LinkButton.stories.d.ts +1 -1
- package/stories/archive/LinkButton.stories.js +6 -6
- package/stories/archive/LinkButton.stories.js.map +1 -1
- package/stories/molecules/Badge.stories.js +3 -3
- package/stories/molecules/Badge.stories.js.map +1 -1
- package/stories/molecules/Button.stories.d.ts +1 -1
- package/stories/molecules/Button.stories.js +7 -7
- package/stories/molecules/Button.stories.js.map +1 -1
- package/stories/molecules/PageLoader.stories.js +2 -2
- package/stories/molecules/PageLoader.stories.js.map +1 -1
- package/stories/templates/ErrorFallback.stories.js +3 -1
- package/stories/templates/ErrorFallback.stories.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/core/integrations/fragments.d.ts +0 -7
- package/core/integrations/fragments.js +0 -67
- package/core/integrations/fragments.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled, { css } from "styled-components";
|
|
3
|
-
import {
|
|
4
|
-
import { Color,
|
|
3
|
+
import { applyTypography } from "../../../core/integrations";
|
|
4
|
+
import { Color, Responsive, SystemIcon, Typography } from "../../atoms";
|
|
5
5
|
import { useGrantMatchContext } from "./context";
|
|
6
6
|
const SearchBar = ({ textSearchCallback, openModalCallback, }) => {
|
|
7
7
|
const { activeQuery, queryText } = useGrantMatchContext();
|
|
@@ -82,7 +82,7 @@ const ResetTextButton = () => {
|
|
|
82
82
|
updateQueryText("");
|
|
83
83
|
updateActiveQuery({ files: activeQuery.files, text: "" });
|
|
84
84
|
};
|
|
85
|
-
return (_jsx(BaseResetTextButton, { type: "button", onClick: onClick, children: _jsx(
|
|
85
|
+
return (_jsx(BaseResetTextButton, { type: "button", onClick: onClick, children: _jsx(SystemIcon.XIcon, { size: 20, color: Color.neutral.grey1 }) }));
|
|
86
86
|
};
|
|
87
87
|
const BaseResetTextButton = styled.button `
|
|
88
88
|
${IconOnlyButton}
|
|
@@ -105,7 +105,7 @@ const TextSearchButton = ({ textSearchCallback }) => {
|
|
|
105
105
|
}
|
|
106
106
|
updateActiveQuery({ files: activeQuery.files, text: queryText });
|
|
107
107
|
};
|
|
108
|
-
return (_jsx(BaseSearchButton, { type: "button", onClick: onClickSearch, children: _jsx(
|
|
108
|
+
return (_jsx(BaseSearchButton, { type: "button", onClick: onClickSearch, children: _jsx(SystemIcon.MagnifyingGlassIcon, { size: 20, color: Color.neutral.white }) }));
|
|
109
109
|
};
|
|
110
110
|
const BaseSearchButton = styled.button `
|
|
111
111
|
${IconOnlyButton}
|
|
@@ -121,7 +121,7 @@ const OpenModalButton = ({ openModalCallback }) => {
|
|
|
121
121
|
}
|
|
122
122
|
openModal();
|
|
123
123
|
};
|
|
124
|
-
return (_jsxs(BaseOpenModalButton, { onClick: onClickOpen, children: [_jsx(
|
|
124
|
+
return (_jsxs(BaseOpenModalButton, { onClick: onClickOpen, children: [_jsx(SystemIcon.FileArrowUpIcon, { size: 20 }), _jsx(OpenModalButtonText, { children: "File Drop" })] }));
|
|
125
125
|
};
|
|
126
126
|
const BaseOpenModalButton = styled.button `
|
|
127
127
|
display: flex;
|
|
@@ -137,7 +137,7 @@ const BaseOpenModalButton = styled.button `
|
|
|
137
137
|
background-color: ${Color.neutral.grey3};
|
|
138
138
|
color: ${Color.typography.blackHigh};
|
|
139
139
|
|
|
140
|
-
${
|
|
140
|
+
${applyTypography(Typography.bodySecondaryRegular)}
|
|
141
141
|
|
|
142
142
|
@media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {
|
|
143
143
|
width: 38px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../../core/organisms/GrantMatch/SearchBar.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../../core/organisms/GrantMatch/SearchBar.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,O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EAAE,SAAS,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAE7C,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,iBAAiB,EAAE,CAAC;YACtB,iBAAiB,EAAE,CAAC;QACtB,CAAC;QAED,SAAS,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,mBAAmB,IAAC,OAAO,EAAE,WAAW,aACvC,KAAC,UAAU,CAAC,eAAe,IAAC,IAAI,EAAE,EAAE,GAAI,EACxC,KAAC,mBAAmB,4BAAgC,IAChC,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAA;;;;;;;;sBAQnB,KAAK,CAAC,OAAO,CAAC,KAAK;;;sBAGnB,KAAK,CAAC,OAAO,CAAC,KAAK;WAC9B,KAAK,CAAC,UAAU,CAAC,SAAS;;IAEjC,eAAe,CAAC,UAAU,CAAC,oBAAoB,CAAC;;oBAEhC,UAAU,CAAC,iBAAiB,CAAC,MAAM;;;;;;qBAMlC,UAAU,CAAC,iBAAiB,CAAC,MAAM;;;;;CAKvD,CAAC;AAEF,MAAM,mBAAmB,GAAG,MAAM,CAAC,CAAC,CAAA;;;;;;oBAMhB,UAAU,CAAC,iBAAiB,CAAC,MAAM;;;;qBAIlC,UAAU,CAAC,iBAAiB,CAAC,MAAM;;;CAGvD,CAAC","sourcesContent":["import type { KeyboardEvent } from \"react\";\nimport styled, { css } from \"styled-components\";\nimport { applyTypography } from \"../../../core/integrations\";\nimport { Color, Responsive, SystemIcon, Typography } from \"../../atoms\";\nimport { useGrantMatchContext } from \"./context\";\n\ntype SearchBarProps = {\n textSearchCallback?: () => void;\n openModalCallback?: () => void;\n};\n\nconst SearchBar = ({\n textSearchCallback,\n openModalCallback,\n}: SearchBarProps) => {\n const { activeQuery, queryText } = useGrantMatchContext();\n\n return (\n <BaseSearchBar>\n <TextSearchArea $showBorder={activeQuery.text !== \"\"}>\n <QueryTextInput />\n\n {queryText !== \"\" ? (\n <ResetTextButton />\n ) : (\n <ResetTextButtonPlaceholder />\n )}\n </TextSearchArea>\n\n <TextSearchButton textSearchCallback={textSearchCallback} />\n <OpenModalButton openModalCallback={openModalCallback} />\n </BaseSearchBar>\n );\n};\n\nexport default SearchBar;\n\nconst BaseSearchBar = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n width: 100%;\n\n color: ${Color.typography.blackHigh};\n background-color: ${Color.neutral.white};\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n gap: 8px;\n padding: 0px;\n\n box-shadow: none;\n border-radius: 0px;\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n gap: 16px;\n padding: 12px 16px;\n\n box-shadow: 0px 0px 40px 0px #00000008;\n border-radius: 12px;\n }\n`;\n\nconst TextSearchArea = styled.div<{ $showBorder: boolean }>`\n display: flex;\n align-items: center;\n\n width: 100%;\n\n background-color: ${Color.neutral.grey4};\n border-radius: 8px;\n\n border: 1px solid\n ${({ $showBorder }) =>\n $showBorder ? Color.brand.grantbiiYellow : Color.neutral.grey4};\n`;\n\nconst QueryTextInput = () => {\n const { activeQuery, updateActiveQuery, queryText, updateQueryText } =\n useGrantMatchContext();\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" && !event.repeat) {\n event.preventDefault();\n updateActiveQuery({ files: activeQuery.files, text: queryText });\n }\n };\n\n return (\n <BaseQueryTextInput\n value={queryText}\n onChange={(event) => updateQueryText(event.target.value)}\n onKeyDown={onKeyDown}\n placeholder=\"Search grant or describe your project\"\n />\n );\n};\n\nconst BaseQueryTextInput = styled.input`\n width: 100%;\n margin-left: 16px;\n outline: none;\n border: none;\n\n background-color: ${Color.neutral.grey4};\n text-overflow: ellipsis;\n`;\n\nconst IconOnlyButton = css`\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 38px;\n min-width: 38px;\n height: 38px;\n\n border-radius: 8px;\n`;\n\nconst ResetTextButton = () => {\n const { activeQuery, updateActiveQuery, updateQueryText } =\n useGrantMatchContext();\n\n const onClick = () => {\n updateQueryText(\"\");\n updateActiveQuery({ files: activeQuery.files, text: \"\" });\n };\n\n return (\n <BaseResetTextButton type=\"button\" onClick={onClick}>\n <SystemIcon.XIcon size={20} color={Color.neutral.grey1} />\n </BaseResetTextButton>\n );\n};\n\nconst BaseResetTextButton = styled.button`\n ${IconOnlyButton}\n\n background-color: ${Color.neutral.grey4};\n border: 1px solid ${Color.neutral.grey4};\n`;\n\nconst ResetTextButtonPlaceholder = styled.div`\n width: 40px;\n height: 40px;\n\n background-color: ${Color.neutral.grey4};\n border-radius: 8px;\n`;\n\ntype TextSearchButtonProps = {\n textSearchCallback?: () => void;\n};\n\nconst TextSearchButton = ({ textSearchCallback }: TextSearchButtonProps) => {\n const { activeQuery, updateActiveQuery, queryText } = useGrantMatchContext();\n\n const onClickSearch = () => {\n if (textSearchCallback) {\n textSearchCallback();\n }\n\n updateActiveQuery({ files: activeQuery.files, text: queryText });\n };\n\n return (\n <BaseSearchButton type=\"button\" onClick={onClickSearch}>\n <SystemIcon.MagnifyingGlassIcon size={20} color={Color.neutral.white} />\n </BaseSearchButton>\n );\n};\n\nconst BaseSearchButton = styled.button`\n ${IconOnlyButton}\n\n background-color: ${Color.brand.grantbiiBlue};\n border: 1px solid ${Color.brand.grantbiiBlue};\n`;\n\ntype OpenModalButtonProps = {\n openModalCallback?: () => void;\n};\n\nconst OpenModalButton = ({ openModalCallback }: OpenModalButtonProps) => {\n const { openModal } = useGrantMatchContext();\n\n const onClickOpen = () => {\n if (openModalCallback) {\n openModalCallback();\n }\n\n openModal();\n };\n\n return (\n <BaseOpenModalButton onClick={onClickOpen}>\n <SystemIcon.FileArrowUpIcon size={20} />\n <OpenModalButtonText>File Drop</OpenModalButtonText>\n </BaseOpenModalButton>\n );\n};\n\nconst BaseOpenModalButton = styled.button`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n\n height: 38px;\n\n border: 1px solid ${Color.neutral.grey3};\n border-radius: 8px;\n\n background-color: ${Color.neutral.grey3};\n color: ${Color.typography.blackHigh};\n\n ${applyTypography(Typography.bodySecondaryRegular)}\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n width: 38px;\n min-width: 38px;\n padding: 0px;\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n width: auto;\n min-width: 88px;\n padding: 2px 16px;\n }\n`;\n\nconst OpenModalButtonText = styled.p`\n font-weight: 500;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n display: none;\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n display: inline;\n }\n`;\n"]}
|
package/core/shared.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SystemIcon } from "./atoms";
|
|
2
2
|
export declare const BaseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$backgroundColor" | "$color" | "$underline" | "$borderColor" | "$width"> & {
|
|
3
3
|
$underline?: boolean;
|
|
4
4
|
$backgroundColor?: string;
|
|
@@ -18,5 +18,5 @@ export type InputValidationProps = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare const InputValidation: import("styled-components").RuleSet<NoInfer<InputValidationProps>>;
|
|
20
20
|
export declare const FILE_TYPE_ICON_MAP: {
|
|
21
|
-
[mimeType: string]:
|
|
21
|
+
[mimeType: string]: SystemIcon.Icon;
|
|
22
22
|
};
|
package/core/shared.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import { Color,
|
|
2
|
+
import { Color, SystemIcon } from "./atoms";
|
|
3
3
|
// TODO: refactor away
|
|
4
4
|
export const BaseButton = styled.div `
|
|
5
5
|
display: flex;
|
|
@@ -76,8 +76,8 @@ export const InputValidation = css `
|
|
|
76
76
|
: css ``}
|
|
77
77
|
`;
|
|
78
78
|
export const FILE_TYPE_ICON_MAP = {
|
|
79
|
-
"application/pdf":
|
|
80
|
-
"image/png":
|
|
81
|
-
"image/jpeg":
|
|
79
|
+
"application/pdf": SystemIcon.FilePdfIcon,
|
|
80
|
+
"image/png": SystemIcon.FilePngIcon,
|
|
81
|
+
"image/jpeg": SystemIcon.FileJpgIcon,
|
|
82
82
|
};
|
|
83
83
|
//# sourceMappingURL=shared.js.map
|
package/core/shared.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../core/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../core/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5C,sBAAsB;AAEtB,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAMlC;;;;;;WAMS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM;;;;;;;;qBAQrB,CAAC,EAAE,UAAU,GAAG,KAAK,EAAE,EAAE,EAAE,CAC5C,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM;;WAE1B,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,MAAM;sBACxC,CAAC,EACnB,UAAU,GAAG,KAAK,EAClB,gBAAgB,GAAG,KAAK,CAAC,K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EAAE,UAAU,CAAC,WAAW;IACnC,YAAY,EAAE,UAAU,CAAC,WAAW;CACrC,CAAC","sourcesContent":["import styled, { css } from \"styled-components\";\nimport { Color, SystemIcon } from \"./atoms\";\n\n// TODO: refactor away\n\nexport const BaseButton = styled.div<{\n $underline?: boolean;\n $backgroundColor?: string;\n $borderColor?: string;\n $color?: string;\n $width?: string;\n}>`\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 10px;\n\n width: ${({ $width = \"auto\" }) => $width};\n\n padding: 10px 16px;\n\n font-weight: 500;\n font-size: 14px;\n\n white-space: nowrap;\n text-decoration: ${({ $underline = false }) =>\n $underline ? \"underline\" : \"none\"};\n\n color: ${({ $color = Color.typography.whiteHigh }) => $color};\n background-color: ${({\n $underline = false,\n $backgroundColor = Color.brand.grantbiiBlue,\n }) => ($underline ? \"transparent\" : $backgroundColor)};\n\n border: 1px solid ${({ $borderColor = \"transparent\" }) => $borderColor};\n border-radius: 8px;\n`;\n\nexport const LabelledInput = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n`;\n\nexport type InputValidationProps = {\n $hasError?: boolean;\n};\n\nexport const InputValidation = css<InputValidationProps>`\n &:disabled {\n background-color: ${Color.neutral.grey4};\n border: 1px solid ${Color.neutral.grey3};\n outline: none;\n }\n\n &:valid {\n background-color: ${Color.neutral.white};\n border: 1px solid ${Color.neutral.grey3};\n outline: none;\n }\n\n &:valid&:focus {\n background-color: ${Color.neutral.white};\n border: 1px solid ${Color.accent.blue1};\n outline: 1px solid ${Color.accent.blue1};\n }\n\n &:invalid {\n background-color: ${Color.neutral.white};\n border: 1px solid ${Color.accent.red1};\n outline: none;\n }\n\n &:invalid&:focus {\n background-color: ${Color.neutral.white};\n border: 1px solid ${Color.accent.red1};\n outline: 1px solid ${Color.accent.red1};\n }\n\n ${({ $hasError = false }) =>\n $hasError\n ? css`\n &:valid {\n background-color: ${Color.neutral.white};\n border: 1px solid ${Color.accent.red1};\n outline: none;\n }\n\n &:valid&:focus {\n background-color: ${Color.neutral.white};\n border: 1px solid ${Color.accent.red1};\n outline: 1px solid ${Color.accent.red1};\n }\n `\n : css``}\n`;\n\nexport const FILE_TYPE_ICON_MAP: { [mimeType: string]: SystemIcon.Icon } = {\n \"application/pdf\": SystemIcon.FilePdfIcon,\n \"image/png\": SystemIcon.FilePngIcon,\n \"image/jpeg\": SystemIcon.FileJpgIcon,\n};\n"]}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import Image from "next/image";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import errorLogo from "../assets/logos/error_logo.webp";
|
|
5
|
-
import { Color, Responsive } from "../atoms";
|
|
6
|
-
import {
|
|
5
|
+
import { Color, Responsive, Typography } from "../atoms";
|
|
6
|
+
import { applyTypography } from "../integrations";
|
|
7
7
|
import { Button } from "../molecules";
|
|
8
8
|
const ErrorFallback = ({ errorMessage = DEFAULT_ERROR_MESSAGE, errorDescription, onClickReload, }) => (_jsxs(BaseErrorFallback, { children: [_jsx(ErrorLogo, { src: errorLogo, width: 693, height: 641, alt: errorMessage }), _jsx(ErrorText, { errorMessage: errorMessage, errorDescription: errorDescription }), onClickReload ? (_jsx(Button, { label: "Try Again", onClick: onClickReload, backgroundColor: Color.neutral.white, borderColor: Color.neutral.grey3, color: Color.typography.blackHigh })) : (_jsx(_Fragment, {}))] }));
|
|
9
9
|
export default ErrorFallback;
|
|
@@ -55,13 +55,9 @@ const BaseErrorText = styled.div `
|
|
|
55
55
|
text-align: center;
|
|
56
56
|
`;
|
|
57
57
|
const ErrorMessage = styled.p `
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
${SubheaderFontSize}
|
|
58
|
+
${applyTypography(Typography.heading3)}
|
|
61
59
|
`;
|
|
62
60
|
const ErrorDescription = styled.div `
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
${BodyFontSize}
|
|
61
|
+
${applyTypography(Typography.bodyPrimaryRegular)}
|
|
66
62
|
`;
|
|
67
63
|
//# sourceMappingURL=ErrorFallback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorFallback.js","sourceRoot":"","sources":["../../../core/templates/ErrorFallback.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorFallback.js","sourceRoot":"","sources":["../../../core/templates/ErrorFallback.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAQtC,MAAM,aAAa,GAAG,CAAC,EACrB,YAAY,GAAG,qBAAqB,EACpC,gBAAgB,EAChB,aAAa,GACM,EAAE,EAAE,CAAC,CACxB,MAAC,iBAAiB,eAChB,KAAC,SAAS,IAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,GAAI,EAEzE,KAAC,SAAS,IACR,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,gBAAgB,GAClC,EAED,aAAa,CAAC,CAAC,CAAC,CACf,KAAC,MAAM,IACL,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EACpC,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAChC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,SAAS,GACjC,CACH,CAAC,CAAC,CAAC,CACF,mBAAK,CACN,IACiB,CACrB,CAAC;AAEF,eAAe,aAAa,CAAC;AAE7B,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAErD,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;sBAUd,KAAK,CAAC,OAAO,CAAC,KAAK;;oBAErB,UAAU,CAAC,iBAAiB,CAAC,MAAM;;;;;;;qBAOlC,UAAU,CAAC,iBAAiB,CAAC,MAAM;;;wBAGhC,KAAK,CAAC,OAAO,CAAC,KAAK;;;CAG1C,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;oBACX,UAAU,CAAC,iBAAiB,CAAC,MAAM;;;;;qBAKlC,UAAU,CAAC,iBAAiB,CAAC,MAAM;;;;CAIvD,CAAC;AAOF,MAAM,SAAS,GAAG,CAAC,EACjB,YAAY,EACZ,gBAAgB,GACO,EAAE,EAAE,CAAC,CAC5B,MAAC,aAAa,eACZ,KAAC,YAAY,cAAE,YAAY,GAAgB,EAE1C,gBAAgB,CAAC,CAAC,CAAC,CAClB,KAAC,gBAAgB,cAAE,gBAAgB,GAAoB,CACxD,CAAC,CAAC,CAAC,CACF,mBAAK,CACN,IACa,CACjB,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAO/B,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAA;IACzB,eAAe,CAAC,UAAU,CAAC,QAAQ,CAAC;CACvC,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;IAC/B,eAAe,CAAC,UAAU,CAAC,kBAAkB,CAAC;CACjD,CAAC","sourcesContent":["import Image from \"next/image\";\nimport type { MouseEventHandler, ReactNode } from \"react\";\nimport styled from \"styled-components\";\nimport errorLogo from \"../assets/logos/error_logo.webp\";\nimport { Color, Responsive, Typography } from \"../atoms\";\nimport { applyTypography } from \"../integrations\";\nimport { Button } from \"../molecules\";\n\ntype ErrorFallbackProps = {\n errorMessage?: string;\n errorDescription?: ReactNode;\n onClickReload?: MouseEventHandler<HTMLButtonElement>;\n};\n\nconst ErrorFallback = ({\n errorMessage = DEFAULT_ERROR_MESSAGE,\n errorDescription,\n onClickReload,\n}: ErrorFallbackProps) => (\n <BaseErrorFallback>\n <ErrorLogo src={errorLogo} width={693} height={641} alt={errorMessage} />\n\n <ErrorText\n errorMessage={errorMessage}\n errorDescription={errorDescription}\n />\n\n {onClickReload ? (\n <Button\n label=\"Try Again\"\n onClick={onClickReload}\n backgroundColor={Color.neutral.white}\n borderColor={Color.neutral.grey3}\n color={Color.typography.blackHigh}\n />\n ) : (\n <></>\n )}\n </BaseErrorFallback>\n);\n\nexport default ErrorFallback;\n\nconst DEFAULT_ERROR_MESSAGE = \"Something went wrong\";\n\nconst BaseErrorFallback = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n\n width: 100%;\n height: 100%;\n padding: 24px;\n\n background-color: ${Color.neutral.white};\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n gap: 16px;\n\n border: none;\n border-radius: 0px;\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n gap: 24px;\n\n border: 1px solid ${Color.neutral.grey3};\n border-radius: 12px;\n }\n`;\n\nconst ErrorLogo = styled(Image)`\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n width: 151px;\n height: 140px;\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n width: 173px;\n height: 160px;\n }\n`;\n\ntype LoadingFailedTextProps = {\n errorMessage: string;\n errorDescription?: ReactNode;\n};\n\nconst ErrorText = ({\n errorMessage,\n errorDescription,\n}: LoadingFailedTextProps) => (\n <BaseErrorText>\n <ErrorMessage>{errorMessage}</ErrorMessage>\n\n {errorDescription ? (\n <ErrorDescription>{errorDescription}</ErrorDescription>\n ) : (\n <></>\n )}\n </BaseErrorText>\n);\n\nconst BaseErrorText = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n\n text-align: center;\n`;\n\nconst ErrorMessage = styled.p`\n ${applyTypography(Typography.heading3)}\n`;\n\nconst ErrorDescription = styled.div`\n ${applyTypography(Typography.bodyPrimaryRegular)}\n`;\n"]}
|
package/package.json
CHANGED
|
@@ -6,5 +6,5 @@ type Story = StoryObj<typeof meta>;
|
|
|
6
6
|
export declare const TextOnly: Story;
|
|
7
7
|
export declare const LeftIcon: Story;
|
|
8
8
|
export declare const RightIcon: Story;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const BothSystemIcon: Story;
|
|
10
10
|
export declare const Underline: Story;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color,
|
|
1
|
+
import { Color, SystemIcon, LinkButton } from "@/.";
|
|
2
2
|
const meta = {
|
|
3
3
|
title: "Archive/Link Button",
|
|
4
4
|
component: LinkButton,
|
|
@@ -15,20 +15,20 @@ export const TextOnly = {
|
|
|
15
15
|
export const LeftIcon = {
|
|
16
16
|
args: {
|
|
17
17
|
...baseArgs,
|
|
18
|
-
LeftIcon:
|
|
18
|
+
LeftIcon: SystemIcon.PlusIcon,
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
export const RightIcon = {
|
|
22
22
|
args: {
|
|
23
23
|
...baseArgs,
|
|
24
|
-
RightIcon:
|
|
24
|
+
RightIcon: SystemIcon.MinusIcon,
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
|
-
export const
|
|
27
|
+
export const BothSystemIcon = {
|
|
28
28
|
args: {
|
|
29
29
|
...baseArgs,
|
|
30
|
-
LeftIcon:
|
|
31
|
-
RightIcon:
|
|
30
|
+
LeftIcon: SystemIcon.SmileyXEyesIcon,
|
|
31
|
+
RightIcon: SystemIcon.SmileyMeltingIcon,
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
export const Underline = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkButton.stories.js","sourceRoot":"","sources":["../../../stories/archive/LinkButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"LinkButton.stories.js","sourceRoot":"","sources":["../../../stories/archive/LinkButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGpD,MAAM,IAAI,GAA4B;IACpC,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC;AAEjE,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC;KACxC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,QAAQ,EAAE,UAAU,CAAC,QAAQ;KAC9B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,SAAS,EAAE,UAAU,CAAC,SAAS;KAChC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,QAAQ,EAAE,UAAU,CAAC,eAAe;QACpC,SAAS,EAAE,UAAU,CAAC,iBAAiB;KACxC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW;KACpC;CACF,CAAC","sourcesContent":["import { Color, SystemIcon, LinkButton } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof LinkButton> = {\n title: \"Archive/Link Button\",\n component: LinkButton,\n tags: [\"autodocs\"],\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst baseArgs = { label: \"Link\", href: \"https://grantbii.com\" };\n\nexport const TextOnly: Story = {\n args: {\n ...baseArgs,\n onClick: () => alert(\"clicked on link\"),\n },\n};\n\nexport const LeftIcon: Story = {\n args: {\n ...baseArgs,\n LeftIcon: SystemIcon.PlusIcon,\n },\n};\n\nexport const RightIcon: Story = {\n args: {\n ...baseArgs,\n RightIcon: SystemIcon.MinusIcon,\n },\n};\n\nexport const BothSystemIcon: Story = {\n args: {\n ...baseArgs,\n LeftIcon: SystemIcon.SmileyXEyesIcon,\n RightIcon: SystemIcon.SmileyMeltingIcon,\n },\n};\n\nexport const Underline: Story = {\n args: {\n ...baseArgs,\n underline: true,\n color: Color.typography.blackMedium,\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Badge,
|
|
1
|
+
import { Badge, SystemIcon } from "@/.";
|
|
2
2
|
const meta = {
|
|
3
3
|
title: "Molecules/Badge",
|
|
4
4
|
component: Badge,
|
|
@@ -15,7 +15,7 @@ export const TextOnly = {
|
|
|
15
15
|
};
|
|
16
16
|
export const Icon = {
|
|
17
17
|
args: {
|
|
18
|
-
Icon:
|
|
18
|
+
Icon: SystemIcon.SmileyXEyesIcon,
|
|
19
19
|
label: defaultText,
|
|
20
20
|
},
|
|
21
21
|
};
|
|
@@ -33,7 +33,7 @@ export const LongText = {
|
|
|
33
33
|
};
|
|
34
34
|
export const AlmostEverything = {
|
|
35
35
|
args: {
|
|
36
|
-
Icon:
|
|
36
|
+
Icon: SystemIcon.SmileyXEyesIcon,
|
|
37
37
|
label: longText,
|
|
38
38
|
labelWidthPixels: 160,
|
|
39
39
|
onClickClose,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.stories.js","sourceRoot":"","sources":["../../../stories/molecules/Badge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Badge.stories.js","sourceRoot":"","sources":["../../../stories/molecules/Badge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGxC,MAAM,IAAI,GAAuB;IAC/B,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,QAAQ,GAAG,6CAA6C,CAAC;AAC/D,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAE/D,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,KAAK,EAAE,WAAW;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAU;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU,CAAC,eAAe;QAChC,KAAK,EAAE,WAAW;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,KAAK,EAAE,WAAW;QAClB,YAAY;KACb;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,KAAK,EAAE,QAAQ;QACf,gBAAgB,EAAE,GAAG;KACtB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAU;IACrC,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU,CAAC,eAAe;QAChC,KAAK,EAAE,QAAQ;QACf,gBAAgB,EAAE,GAAG;QACrB,YAAY;KACb;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC;KACzC;CACF,CAAC","sourcesContent":["import { Badge, SystemIcon } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof Badge> = {\n title: \"Molecules/Badge\",\n component: Badge,\n tags: [\"autodocs\"],\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst defaultText = \"Badge\";\nconst longText = \"the quick brown fox jumps over the lazy dog\";\nconst onClickClose = () => alert(\"You have closed the badge.\");\n\nexport const TextOnly: Story = {\n args: {\n label: defaultText,\n },\n};\n\nexport const Icon: Story = {\n args: {\n Icon: SystemIcon.SmileyXEyesIcon,\n label: defaultText,\n },\n};\n\nexport const Closeable: Story = {\n args: {\n label: defaultText,\n onClickClose,\n },\n};\n\nexport const LongText: Story = {\n args: {\n label: longText,\n labelWidthPixels: 160,\n },\n};\n\nexport const AlmostEverything: Story = {\n args: {\n Icon: SystemIcon.SmileyXEyesIcon,\n label: longText,\n labelWidthPixels: 160,\n onClickClose,\n },\n};\n\nexport const Clickable: Story = {\n args: {\n label: \"Click Me\",\n onClick: () => alert(\"Clicked on badge\"),\n },\n};\n"]}
|
|
@@ -6,6 +6,6 @@ type Story = StoryObj<typeof meta>;
|
|
|
6
6
|
export declare const TextOnly: Story;
|
|
7
7
|
export declare const LeftIcon: Story;
|
|
8
8
|
export declare const RightIcon: Story;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const BothSystemIcon: Story;
|
|
10
10
|
export declare const Underline: Story;
|
|
11
11
|
export declare const GrantObjectivesFilter: Story;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Color,
|
|
2
|
+
import { Button, Color, SystemIcon } from "@/.";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
const meta = {
|
|
5
5
|
title: "Molecules/Button",
|
|
@@ -17,20 +17,20 @@ export const TextOnly = {
|
|
|
17
17
|
export const LeftIcon = {
|
|
18
18
|
args: {
|
|
19
19
|
...baseArgs,
|
|
20
|
-
LeftIcon:
|
|
20
|
+
LeftIcon: SystemIcon.PlusIcon,
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
export const RightIcon = {
|
|
24
24
|
args: {
|
|
25
25
|
...baseArgs,
|
|
26
|
-
RightIcon:
|
|
26
|
+
RightIcon: SystemIcon.MinusIcon,
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
|
-
export const
|
|
29
|
+
export const BothSystemIcon = {
|
|
30
30
|
args: {
|
|
31
31
|
...baseArgs,
|
|
32
|
-
LeftIcon:
|
|
33
|
-
RightIcon:
|
|
32
|
+
LeftIcon: SystemIcon.SmileyXEyesIcon,
|
|
33
|
+
RightIcon: SystemIcon.SmileyMeltingIcon,
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
36
|
export const Underline = {
|
|
@@ -53,7 +53,7 @@ export const GrantObjectivesFilter = {
|
|
|
53
53
|
backgroundColor: Color.neutral.white,
|
|
54
54
|
color: Color.typography.blackMedium,
|
|
55
55
|
onClick: () => alert("You have clicked on the button."),
|
|
56
|
-
label: (_jsxs(Content, { children: [_jsx("p", { children: "Select grant objectives" }), _jsx(
|
|
56
|
+
label: (_jsxs(Content, { children: [_jsx("p", { children: "Select grant objectives" }), _jsx(SystemIcon.CaretRightIcon, { size: 20 })] })),
|
|
57
57
|
},
|
|
58
58
|
};
|
|
59
59
|
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../stories/molecules/Button.stories.tsx"],"names":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;;;;;CAMzB,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAU;IAC1C,IAAI,EAAE;QACJ,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;QAChC,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;QACpC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW;QACnC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,iCAAiC,CAAC;QACvD,KAAK,EAAE,CACL,MAAC,OAAO,eACN,kDAA8B,EAC9B,KAAC,UAAU,CAAC,cAAc,IAAC,IAAI,EAAE,EAAE,GAAI,IAC/B,CACX;KACF;CACF,CAAC","sourcesContent":["import { Button, Color, SystemIcon } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\nimport styled from \"styled-components\";\n\nconst meta: Meta<typeof Button> = {\n title: \"Molecules/Button\",\n component: Button,\n tags: [\"autodocs\"],\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst baseArgs = {\n label: \"Button\",\n onClick: () => alert(\"You have clicked on the button.\"),\n};\n\nexport const TextOnly: Story = {\n args: baseArgs,\n};\n\nexport const LeftIcon: Story = {\n args: {\n ...baseArgs,\n LeftIcon: SystemIcon.PlusIcon,\n },\n};\n\nexport const RightIcon: Story = {\n args: {\n ...baseArgs,\n RightIcon: SystemIcon.MinusIcon,\n },\n};\n\nexport const BothSystemIcon: Story = {\n args: {\n ...baseArgs,\n LeftIcon: SystemIcon.SmileyXEyesIcon,\n RightIcon: SystemIcon.SmileyMeltingIcon,\n },\n};\n\nexport const Underline: Story = {\n args: {\n ...baseArgs,\n underline: true,\n color: Color.typography.blackMedium,\n },\n};\n\nconst Content = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n width: 200px;\n`;\n\nexport const GrantObjectivesFilter: Story = {\n args: {\n borderColor: Color.neutral.grey3,\n backgroundColor: Color.neutral.white,\n color: Color.typography.blackMedium,\n onClick: () => alert(\"You have clicked on the button.\"),\n label: (\n <Content>\n <p>Select grant objectives</p>\n <SystemIcon.CaretRightIcon size={20} />\n </Content>\n ),\n },\n};\n"]}
|
|
@@ -10,8 +10,8 @@ export const GrantInsights = {
|
|
|
10
10
|
};
|
|
11
11
|
export const GrantbiiDashboard = {
|
|
12
12
|
args: {
|
|
13
|
-
loadingText: "Loading...",
|
|
14
|
-
tip: "Pro tip:
|
|
13
|
+
loadingText: "Loading Forever...",
|
|
14
|
+
tip: "Pro tip: grab a cup of coffee while waiting for it to load. Or watch The Lord of the Rings. Or whatever",
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
export const AdminConsole = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLoader.stories.js","sourceRoot":"","sources":["../../../stories/molecules/PageLoader.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGjC,MAAM,IAAI,GAA4B;IACpC,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAU;IACtC,IAAI,EAAE;QACJ,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"PageLoader.stories.js","sourceRoot":"","sources":["../../../stories/molecules/PageLoader.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGjC,MAAM,IAAI,GAA4B;IACpC,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAU;IACtC,IAAI,EAAE;QACJ,WAAW,EAAE,oBAAoB;QACjC,GAAG,EAAE,yGAAyG;KAC/G;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;CACvB,CAAC","sourcesContent":["import { PageLoader } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof PageLoader> = {\n title: \"Molecules/Page Loader\",\n component: PageLoader,\n tags: [\"autodocs\"],\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const GrantInsights: Story = {\n args: {},\n};\n\nexport const GrantbiiDashboard: Story = {\n args: {\n loadingText: \"Loading Forever...\",\n tip: \"Pro tip: grab a cup of coffee while waiting for it to load. Or watch The Lord of the Rings. Or whatever\",\n },\n};\n\nexport const AdminConsole: Story = {\n args: { pacman: true },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorFallback.stories.js","sourceRoot":"","sources":["../../../stories/templates/ErrorFallback.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,MAAM,IAAI,GAA+B;IACvC,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"ErrorFallback.stories.js","sourceRoot":"","sources":["../../../stories/templates/ErrorFallback.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,MAAM,IAAI,GAA+B;IACvC,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,gBAAgB,EAAE,uBAAuB;KAC1C;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAU;IAC3B,IAAI,EAAE;QACJ,aAAa,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC;KAC3C;CACF,CAAC","sourcesContent":["import { ErrorFallback } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof ErrorFallback> = {\n title: \"Templates/Error Fallback\",\n component: ErrorFallback,\n tags: [\"autodocs\"],\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {\n args: {\n errorDescription: \"It's not you; it's us\",\n },\n};\n\nexport const Reload: Story = {\n args: {\n onClickReload: () => alert(\"reloading...\"),\n },\n};\n"]}
|