@grantbii/design-system 1.4.0 → 1.4.1

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.
@@ -1,6 +1,7 @@
1
1
  import type { MouseEventHandler } from "react";
2
2
  type LoadingFailedSignProps = {
3
+ errorMessage?: string;
3
4
  onClickReload?: MouseEventHandler<HTMLButtonElement>;
4
5
  };
5
- declare const LoadingFailedSign: ({ onClickReload }: LoadingFailedSignProps) => import("react/jsx-runtime").JSX.Element;
6
+ declare const LoadingFailedSign: ({ errorMessage, onClickReload, }: LoadingFailedSignProps) => import("react/jsx-runtime").JSX.Element;
6
7
  export default LoadingFailedSign;
@@ -1,13 +1,13 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Image from "next/image";
3
+ import Link from "next/link";
3
4
  import styled from "styled-components";
4
5
  import loadFailLogo from "../assets/logos/load_fail_logo.webp";
5
- import { Colors, Responsive, Typography } from "../foundations";
6
- import Link from "next/link";
7
6
  import { Button } from "../atoms";
8
- const LoadingFailedSign = ({ onClickReload }) => (_jsxs(BaseLoadFail, { children: [_jsx(LoadFailImage, { src: loadFailLogo, width: 693, height: 641, alt: "Failed to load results", priority: true }), _jsxs(Text, { children: [_jsx(ErrorMessage, { children: "Failed to load results" }), _jsxs(ErrorDescription, { children: ["Please refresh or try again in a moment ", _jsx("br", {}), " or contact us at", " ", _jsx(SupportEmailLink, { href: "mailto:support@grantbii.com", children: "support@grantbii.com" })] })] }), onClickReload ? (_jsx(Button, { text: "Try Again", onClick: onClickReload, backgroundColor: Colors.base.white, borderColor: Colors.neutral.grey3, color: Colors.typography.blackHigh })) : (_jsx(_Fragment, {}))] }));
7
+ import { Colors, Responsive, Typography } from "../foundations";
8
+ const LoadingFailedSign = ({ errorMessage = "Failed to load results", onClickReload, }) => (_jsxs(BaseLoadingFailedSign, { children: [_jsx(LoadingFailedImage, { src: loadFailLogo, width: 693, height: 641, alt: errorMessage }), _jsx(LoadingFailedText, { errorMessage: errorMessage }), onClickReload ? (_jsx(Button, { text: "Try Again", onClick: onClickReload, backgroundColor: Colors.base.white, borderColor: Colors.neutral.grey3, color: Colors.typography.blackHigh })) : (_jsx(_Fragment, {}))] }));
9
9
  export default LoadingFailedSign;
10
- const BaseLoadFail = styled.div `
10
+ const BaseLoadingFailedSign = styled.div `
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  justify-content: center;
@@ -17,6 +17,8 @@ const BaseLoadFail = styled.div `
17
17
  height: 100%;
18
18
  padding: 24px;
19
19
 
20
+ background-color: ${Colors.base.white};
21
+
20
22
  @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {
21
23
  gap: 16px;
22
24
 
@@ -31,7 +33,7 @@ const BaseLoadFail = styled.div `
31
33
  border-radius: 12px;
32
34
  }
33
35
  `;
34
- const LoadFailImage = styled(Image) `
36
+ const LoadingFailedImage = styled(Image) `
35
37
  @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {
36
38
  width: 151px;
37
39
  height: 140px;
@@ -42,7 +44,8 @@ const LoadFailImage = styled(Image) `
42
44
  height: 160px;
43
45
  }
44
46
  `;
45
- const Text = styled.div `
47
+ const LoadingFailedText = ({ errorMessage }) => (_jsxs(BaseLoadingFailedText, { children: [_jsx(ErrorMessage, { children: errorMessage }), _jsxs(ErrorDescription, { children: ["Please try again in a moment or ", _jsx("br", {}), " contact us at", " ", _jsx(SupportEmailLink, { href: "mailto:support@grantbii.com", children: "support@grantbii.com" })] })] }));
48
+ const BaseLoadingFailedText = styled.div `
46
49
  display: flex;
47
50
  flex-direction: column;
48
51
  align-items: center;
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingFailedSign.js","sourceRoot":"","sources":["../../../core/templates/LoadingFailedSign.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAA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;;;qBAKlC,UAAU,CAAC,iBAAiB,CAAC,MAAM;;;;CAIvD,CAAC;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOtB,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAA;;;oBAGT,UAAU,CAAC,iBAAiB,CAAC,MAAM;iBACtC,UAAU,CAAC,oBAAoB,CAAC,KAAK;;;qBAGjC,UAAU,CAAC,iBAAiB,CAAC,MAAM;iBACvC,UAAU,CAAC,oBAAoB,CAAC,GAAG;;CAEnD,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAA;;;oBAGb,UAAU,CAAC,iBAAiB,CAAC,MAAM;iBACtC,UAAU,CAAC,eAAe,CAAC,KAAK;;;qBAG5B,UAAU,CAAC,iBAAiB,CAAC,MAAM;iBACvC,UAAU,CAAC,eAAe,CAAC,GAAG;;CAE9C,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAEpC,CAAC","sourcesContent":["import Image from \"next/image\";\nimport styled from \"styled-components\";\nimport loadFailLogo from \"../assets/logos/load_fail_logo.webp\";\nimport { Colors, Responsive, Typography } from \"../foundations\";\nimport Link from \"next/link\";\nimport type { MouseEventHandler } from \"react\";\nimport { Button } from \"../atoms\";\n\ntype LoadingFailedSignProps = {\n onClickReload?: MouseEventHandler<HTMLButtonElement>;\n};\n\nconst LoadingFailedSign = ({ onClickReload }: LoadingFailedSignProps) => (\n <BaseLoadFail>\n <LoadFailImage\n src={loadFailLogo}\n width={693}\n height={641}\n alt=\"Failed to load results\"\n priority\n />\n\n <Text>\n <ErrorMessage>Failed to load results</ErrorMessage>\n <ErrorDescription>\n Please refresh or try again in a moment <br /> or contact us at{\" \"}\n <SupportEmailLink href=\"mailto:support@grantbii.com\">\n support@grantbii.com\n </SupportEmailLink>\n </ErrorDescription>\n </Text>\n\n {onClickReload ? (\n <Button\n text=\"Try Again\"\n onClick={onClickReload}\n backgroundColor={Colors.base.white}\n borderColor={Colors.neutral.grey3}\n color={Colors.typography.blackHigh}\n />\n ) : (\n <></>\n )}\n </BaseLoadFail>\n);\n\nexport default LoadingFailedSign;\n\nconst BaseLoadFail = 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 @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 ${Colors.neutral.grey3};\n border-radius: 12px;\n }\n`;\n\nconst LoadFailImage = 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\nconst Text = 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 font-weight: 700;\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n font-size: ${Typography.SUBHEADER_FONT_SIZES.small};\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n font-size: ${Typography.SUBHEADER_FONT_SIZES.big};\n }\n`;\n\nconst ErrorDescription = styled.p`\n font-weight: 400;\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n font-size: ${Typography.BODY_FONT_SIZES.small};\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n font-size: ${Typography.BODY_FONT_SIZES.big};\n }\n`;\n\nconst SupportEmailLink = styled(Link)`\n text-decoration: underline;\n`;\n"]}
1
+ {"version":3,"file":"LoadingFailedSign.js","sourceRoot":"","sources":["../../../core/templates/LoadingFailedSign.tsx"],"names":[],"mappings":";AAAA,OAA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qBAKlC,UAAU,CAAC,iBAAiB,CAAC,MAAM;;;;CAIvD,CAAC;AAMF,MAAM,iBAAiB,GAAG,CAAC,EAAE,YAAY,EAA0B,EAAE,EAAE,CAAC,CACtE,MAAC,qBAAqB,eACpB,KAAC,YAAY,cAAE,YAAY,GAAgB,EAC3C,MAAC,gBAAgB,mDACiB,cAAM,oBAAe,GAAG,EACxD,KAAC,gBAAgB,IAAC,IAAI,EAAC,6BAA6B,qCAEjC,IACF,IACG,CACzB,CAAC;AAEF,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOvC,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,CAAA;;;oBAGT,UAAU,CAAC,iBAAiB,CAAC,MAAM;iBACtC,UAAU,CAAC,oBAAoB,CAAC,KAAK;;;qBAGjC,UAAU,CAAC,iBAAiB,CAAC,MAAM;iBACvC,UAAU,CAAC,oBAAoB,CAAC,GAAG;;CAEnD,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAA;;;oBAGb,UAAU,CAAC,iBAAiB,CAAC,MAAM;iBACtC,UAAU,CAAC,eAAe,CAAC,KAAK;;;qBAG5B,UAAU,CAAC,iBAAiB,CAAC,MAAM;iBACvC,UAAU,CAAC,eAAe,CAAC,GAAG;;CAE9C,CAAC;AAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAEpC,CAAC","sourcesContent":["import Image from \"next/image\";\nimport Link from \"next/link\";\nimport type { MouseEventHandler } from \"react\";\nimport styled from \"styled-components\";\nimport loadFailLogo from \"../assets/logos/load_fail_logo.webp\";\nimport { Button } from \"../atoms\";\nimport { Colors, Responsive, Typography } from \"../foundations\";\n\ntype LoadingFailedSignProps = {\n errorMessage?: string;\n onClickReload?: MouseEventHandler<HTMLButtonElement>;\n};\n\nconst LoadingFailedSign = ({\n errorMessage = \"Failed to load results\",\n onClickReload,\n}: LoadingFailedSignProps) => (\n <BaseLoadingFailedSign>\n <LoadingFailedImage\n src={loadFailLogo}\n width={693}\n height={641}\n alt={errorMessage}\n />\n\n <LoadingFailedText errorMessage={errorMessage} />\n\n {onClickReload ? (\n <Button\n text=\"Try Again\"\n onClick={onClickReload}\n backgroundColor={Colors.base.white}\n borderColor={Colors.neutral.grey3}\n color={Colors.typography.blackHigh}\n />\n ) : (\n <></>\n )}\n </BaseLoadingFailedSign>\n);\n\nexport default LoadingFailedSign;\n\nconst BaseLoadingFailedSign = 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: ${Colors.base.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 ${Colors.neutral.grey3};\n border-radius: 12px;\n }\n`;\n\nconst LoadingFailedImage = 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};\n\nconst LoadingFailedText = ({ errorMessage }: LoadingFailedTextProps) => (\n <BaseLoadingFailedText>\n <ErrorMessage>{errorMessage}</ErrorMessage>\n <ErrorDescription>\n Please try again in a moment or <br /> contact us at{\" \"}\n <SupportEmailLink href=\"mailto:support@grantbii.com\">\n support@grantbii.com\n </SupportEmailLink>\n </ErrorDescription>\n </BaseLoadingFailedText>\n);\n\nconst BaseLoadingFailedText = 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 font-weight: 700;\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n font-size: ${Typography.SUBHEADER_FONT_SIZES.small};\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n font-size: ${Typography.SUBHEADER_FONT_SIZES.big};\n }\n`;\n\nconst ErrorDescription = styled.p`\n font-weight: 400;\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n font-size: ${Typography.BODY_FONT_SIZES.small};\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n font-size: ${Typography.BODY_FONT_SIZES.big};\n }\n`;\n\nconst SupportEmailLink = styled(Link)`\n text-decoration: underline;\n`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grantbii/design-system",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Grantbii's Design System",
5
5
  "homepage": "https://design.grantbii.com",
6
6
  "repository": {