@grantbii/design-system 1.0.74 → 1.0.78
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/Badge.d.ts +1 -1
- package/core/atoms/Badge.js +2 -1
- package/core/atoms/Badge.js.map +1 -0
- package/core/atoms/BrandLogo.js +1 -1
- package/core/atoms/BrandLogo.js.map +1 -0
- package/core/atoms/Button.d.ts +1 -1
- package/core/atoms/Button.js +3 -1
- package/core/atoms/Button.js.map +1 -0
- package/core/atoms/Checkbox.d.ts +1 -1
- package/core/atoms/Checkbox.js +3 -16
- package/core/atoms/Checkbox.js.map +1 -0
- package/core/atoms/LinkButton.d.ts +1 -1
- package/core/atoms/LinkButton.js +4 -16
- package/core/atoms/LinkButton.js.map +1 -0
- package/core/atoms/PageLoader.d.ts +1 -1
- package/core/atoms/PageLoader.js +3 -16
- package/core/atoms/PageLoader.js.map +1 -0
- package/core/atoms/RadioButton.d.ts +1 -1
- package/core/atoms/RadioButton.js +3 -16
- package/core/atoms/RadioButton.js.map +1 -0
- package/core/atoms/Textarea.js +1 -1
- package/core/atoms/Textarea.js.map +1 -0
- package/core/atoms/index.js +1 -0
- package/core/atoms/index.js.map +1 -0
- package/core/atoms/shared.js +1 -0
- package/core/atoms/shared.js.map +1 -0
- package/core/foundations/colors.js +1 -0
- package/core/foundations/colors.js.map +1 -0
- package/core/foundations/flags.js +1 -0
- package/core/foundations/flags.js.map +1 -0
- package/core/foundations/icons.js +1 -0
- package/core/foundations/icons.js.map +1 -0
- package/core/foundations/index.js +1 -0
- package/core/foundations/index.js.map +1 -0
- package/core/foundations/responsive.js +1 -0
- package/core/foundations/responsive.js.map +1 -0
- package/core/foundations/types.js +1 -0
- package/core/foundations/types.js.map +1 -0
- package/core/foundations/typography.d.ts +1 -1
- package/core/foundations/typography.js +2 -0
- package/core/foundations/typography.js.map +1 -0
- package/core/global/GlobalStyle.js +1 -1
- package/core/global/GlobalStyle.js.map +1 -0
- package/core/global/index.js +1 -0
- package/core/global/index.js.map +1 -0
- package/core/integrations/StyledComponentsRegistry.d.ts +1 -1
- package/core/integrations/StyledComponentsRegistry.js +1 -1
- package/core/integrations/StyledComponentsRegistry.js.map +1 -0
- package/core/integrations/index.js +1 -0
- package/core/integrations/index.js.map +1 -0
- package/core/molecules/FileDrop.js +3 -6
- package/core/molecules/FileDrop.js.map +1 -0
- package/core/molecules/Modal.d.ts +2 -2
- package/core/molecules/Modal.js +2 -2
- package/core/molecules/Modal.js.map +1 -0
- package/core/molecules/RadioButtons.d.ts +2 -2
- package/core/molecules/RadioButtons.js +4 -16
- package/core/molecules/RadioButtons.js.map +1 -0
- package/core/molecules/index.js +1 -0
- package/core/molecules/index.js.map +1 -0
- package/core/organisms/GrantMatch/ActiveQueryFiles.js +3 -4
- package/core/organisms/GrantMatch/ActiveQueryFiles.js.map +1 -0
- package/core/organisms/GrantMatch/GrantMatchModal.js +1 -1
- package/core/organisms/GrantMatch/GrantMatchModal.js.map +1 -0
- package/core/organisms/GrantMatch/SearchBar.js +13 -4
- package/core/organisms/GrantMatch/SearchBar.js.map +1 -0
- package/core/organisms/GrantMatch/context.d.ts +1 -1
- package/core/organisms/GrantMatch/context.js +2 -0
- package/core/organisms/GrantMatch/context.js.map +1 -0
- package/core/organisms/GrantMatch/index.d.ts +1 -1
- package/core/organisms/GrantMatch/index.js +4 -3
- package/core/organisms/GrantMatch/index.js.map +1 -0
- package/core/organisms/TallyModal.d.ts +1 -1
- package/core/organisms/TallyModal.js +3 -16
- package/core/organisms/TallyModal.js.map +1 -0
- package/core/organisms/YesNoOptions.d.ts +1 -1
- package/core/organisms/YesNoOptions.js +4 -3
- package/core/organisms/YesNoOptions.js.map +1 -0
- package/core/organisms/index.js +1 -0
- package/core/organisms/index.js.map +1 -0
- package/index.js +2 -0
- package/index.js.map +1 -0
- package/package.json +4 -3
- package/stories/atoms/Badge.stories.d.ts +1 -1
- package/stories/atoms/Badge.stories.js +2 -0
- package/stories/atoms/Badge.stories.js.map +1 -0
- package/stories/atoms/BrandLogo.stories.d.ts +1 -1
- package/stories/atoms/BrandLogo.stories.js +2 -0
- package/stories/atoms/BrandLogo.stories.js.map +1 -0
- package/stories/atoms/Button.stories.d.ts +1 -1
- package/stories/atoms/Button.stories.js +20 -4
- package/stories/atoms/Button.stories.js.map +1 -0
- package/stories/atoms/Checkbox.stories.d.ts +1 -1
- package/stories/atoms/Checkbox.stories.js +2 -0
- package/stories/atoms/Checkbox.stories.js.map +1 -0
- package/stories/atoms/LinkButton.stories.d.ts +1 -1
- package/stories/atoms/LinkButton.stories.js +20 -4
- package/stories/atoms/LinkButton.stories.js.map +1 -0
- package/stories/atoms/PageLoader.stories.d.ts +1 -1
- package/stories/atoms/PageLoader.stories.js +2 -0
- package/stories/atoms/PageLoader.stories.js.map +1 -0
- package/stories/atoms/Textarea.stories.d.ts +1 -1
- package/stories/atoms/Textarea.stories.js +2 -0
- package/stories/atoms/Textarea.stories.js.map +1 -0
- package/stories/molecules/FileDrop.stories.d.ts +1 -1
- package/stories/molecules/FileDrop.stories.js +2 -0
- package/stories/molecules/FileDrop.stories.js.map +1 -0
- package/stories/molecules/Modal.stories.d.ts +3 -3
- package/stories/molecules/Modal.stories.js +4 -1
- package/stories/molecules/Modal.stories.js.map +1 -0
- package/stories/molecules/RadioButtons.stories.d.ts +1 -1
- package/stories/molecules/RadioButtons.stories.js +3 -1
- package/stories/molecules/RadioButtons.stories.js.map +1 -0
- package/stories/organisms/GrantMatch.stories.d.ts +1 -1
- package/stories/organisms/GrantMatch.stories.js +4 -1
- package/stories/organisms/GrantMatch.stories.js.map +1 -0
- package/stories/organisms/TallyModal.stories.d.ts +2 -2
- package/stories/organisms/TallyModal.stories.js +4 -1
- package/stories/organisms/TallyModal.stories.js.map +1 -0
- package/stories/organisms/YesNoOptions.stories.d.ts +1 -1
- package/stories/organisms/YesNoOptions.stories.js +6 -1
- package/stories/organisms/YesNoOptions.stories.js.map +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/vitest.config.js +1 -0
- package/vitest.config.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/molecules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAoB,MAAM,gBAAgB,CAAC","sourcesContent":["export { default as FileDrop, useFileDrop } from \"./FileDrop\";\nexport { default as Modal, useModal } from \"./Modal\";\nexport { default as RadioButtons, type RadioOption } from \"./RadioButtons\";\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {} from "react";
|
|
2
3
|
import styled from "styled-components";
|
|
3
4
|
import { Badge, Button } from "../../atoms";
|
|
4
5
|
import { Colors, Icons } from "../../foundations";
|
|
@@ -19,10 +20,7 @@ const FileBadges = () => {
|
|
|
19
20
|
};
|
|
20
21
|
updateActiveQuery(newQuery);
|
|
21
22
|
};
|
|
22
|
-
return (_jsx(BaseFileBadges, { children: activeQuery.files.map((file) => {
|
|
23
|
-
var _a;
|
|
24
|
-
return (_jsx(Badge, { text: file.name.substring(0, file.name.lastIndexOf(".")), Icon: (_a = FILE_TYPE_ICON_MAP[file.type]) !== null && _a !== void 0 ? _a : Icons.FileIcon, onClickClose: () => removeActiveQueryFile(file.name), textWidthPixels: 160 }, file.name));
|
|
25
|
-
}) }));
|
|
23
|
+
return (_jsx(BaseFileBadges, { children: activeQuery.files.map((file) => (_jsx(Badge, { text: file.name.substring(0, file.name.lastIndexOf(".")), Icon: FILE_TYPE_ICON_MAP[file.type] ?? Icons.FileIcon, onClickClose: () => removeActiveQueryFile(file.name), textWidthPixels: 160 }, file.name))) }));
|
|
26
24
|
};
|
|
27
25
|
const BaseFileBadges = styled.div `
|
|
28
26
|
display: flex;
|
|
@@ -49,3 +47,4 @@ const ResetFilesButton = () => {
|
|
|
49
47
|
const { activeQuery, updateActiveQuery } = useGrantMatchContext();
|
|
50
48
|
return (_jsx(Button, { text: "Reset", onClick: () => updateActiveQuery({ files: [], text: activeQuery.text }), color: Colors.typography.blackMedium, underline: true }));
|
|
51
49
|
};
|
|
50
|
+
//# sourceMappingURL=ActiveQueryFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActiveQueryFiles.js","sourceRoot":"","sources":["../../../../core/organisms/GrantMatch/ActiveQueryFiles.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,CAC7B,MAAC,eAAe,eACd,KAAC,UAAU,KAAG,EACd,KAAC,gBAAgB,KAAG,IACJ,CACnB,CAAC;AAEF,eAAe,gBAAgB,CAAC;AAEhC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIjC,CAAC;AAEF,MAAM,UAAU,GAAG,GAAG,EAAE;IACtB,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAElE,MAAM,qBAAqB,GAAG,CAAC,QAAgB,EAAE,EAAE;QACjD,MAAM,QAAQ,GAAG;YACf,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;YACjE,IAAI,EAAE,WAAW,CAAC,IAAI;SACvB,CAAC;QAEF,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,cAAc,cACZ,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC/B,KAAC,KAAK,IAEJ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EACxD,IAAI,EAAE,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,QAAQ,EACrD,YAAY,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EACpD,eAAe,EAAE,GAAG,IAJf,IAAI,CAAC,IAAI,CAKd,CACH,CAAC,GACa,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;CAiBhC,CAAC;AAEF,MAAM,kBAAkB,GAEpB;IACF,iBAAiB,EAAE,KAAK,CAAC,WAAW;CACrC,CAAC;AAEF,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAElE,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC,EACvE,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW,EACpC,SAAS,SACT,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { type ComponentType } from \"react\";\nimport styled from \"styled-components\";\nimport { Badge, Button } from \"../../atoms\";\nimport { Colors, Icons } from \"../../foundations\";\nimport { useGrantMatchContext } from \"./context\";\n\nconst ActiveQueryFiles = () => (\n <BaseActiveFiles>\n <FileBadges />\n <ResetFilesButton />\n </BaseActiveFiles>\n);\n\nexport default ActiveQueryFiles;\n\nconst BaseActiveFiles = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n`;\n\nconst FileBadges = () => {\n const { activeQuery, updateActiveQuery } = useGrantMatchContext();\n\n const removeActiveQueryFile = (fileName: string) => {\n const newQuery = {\n files: activeQuery.files.filter((file) => file.name !== fileName),\n text: activeQuery.text,\n };\n\n updateActiveQuery(newQuery);\n };\n\n return (\n <BaseFileBadges>\n {activeQuery.files.map((file) => (\n <Badge\n key={file.name}\n text={file.name.substring(0, file.name.lastIndexOf(\".\"))}\n Icon={FILE_TYPE_ICON_MAP[file.type] ?? Icons.FileIcon}\n onClickClose={() => removeActiveQueryFile(file.name)}\n textWidthPixels={160}\n />\n ))}\n </BaseFileBadges>\n );\n};\n\nconst BaseFileBadges = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n\n width: 100%;\n\n overflow-x: auto;\n\n /* hide scrollbar but still allow for scrolling */\n -ms-overflow-style: none;\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n\n /* TODO: fade effect on overflow-x */\n`;\n\nconst FILE_TYPE_ICON_MAP: {\n [itemType: string]: ComponentType<Icons.IconProps>;\n} = {\n \"application/pdf\": Icons.FilePdfIcon,\n};\n\nconst ResetFilesButton = () => {\n const { activeQuery, updateActiveQuery } = useGrantMatchContext();\n\n return (\n <Button\n text=\"Reset\"\n onClick={() => updateActiveQuery({ files: [], text: activeQuery.text })}\n color={Colors.typography.blackMedium}\n underline\n />\n );\n};\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import styled from "styled-components";
|
|
4
3
|
import { Button, Textarea } from "../../atoms";
|
|
@@ -33,3 +32,4 @@ const FindGrantsButton = ({ files }) => {
|
|
|
33
32
|
};
|
|
34
33
|
return (_jsx(Button, { text: "Find My Grants", onClick: onClick, backgroundColor: Colors.accent.yellow1 }));
|
|
35
34
|
};
|
|
35
|
+
//# sourceMappingURL=GrantMatchModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrantMatchModal.js","sourceRoot":"","sources":["../../../../core/organisms/GrantMatch/GrantMatchModal.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAC3D,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAE1E,OAAO,CACL,KAAC,KAAK,IACJ,MAAM,EAAE,wCAAsB,EAC9B,OAAO,EACL,KAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACtB,EAEJ,MAAM,EAAE,KAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,GAAI,EAC1C,aAAa,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EACjC,KAAK,EAAC,OAAO,EACb,MAAM,EAAC,OAAO,GACd,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC;AAQ/B,MAAM,YAAY,GAAG,CAAC,EACpB,KAAK,EACL,WAAW,EACX,UAAU,GACQ,EAAE,EAAE;IACtB,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAE9D,OAAO,CACL,MAAC,WAAW,eACV,KAAC,QAAQ,IACP,aAAa,EAAE,KAAK,EACpB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACtB,EAEF,MAAC,cAAc,eACb,gBAAO,OAAO,EAAE,iBAAiB,4CAAqC,EACtE,KAAC,QAAQ,IACP,EAAE,EAAE,iBAAiB,EACrB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACxD,WAAW,EAAC,8DAA8D,GAC1E,IACa,IACL,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAE3C,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAI7B,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGhC,CAAC;AAMF,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAyB,EAAE,EAAE;IAC5D,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAE5E,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,iBAAiB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9C,UAAU,EAAE,CAAC;IACf,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IACL,IAAI,EAAC,gBAAgB,EACrB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,GACtC,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import styled from \"styled-components\";\nimport { Button, Textarea } from \"../../atoms\";\nimport { Colors } from \"../../foundations\";\nimport { FileDrop, Modal, useFileDrop } from \"../../molecules\";\nimport { useGrantMatchContext } from \"./context\";\n\nconst GrantMatchModal = () => {\n const { activeQuery, closeModal } = useGrantMatchContext();\n const { files, uploadFiles, removeFile } = useFileDrop(activeQuery.files);\n\n return (\n <Modal\n header={<div>Grant Match</div>}\n content={\n <ModalContent\n files={files}\n uploadFiles={uploadFiles}\n removeFile={removeFile}\n />\n }\n footer={<FindGrantsButton files={files} />}\n onClickCancel={() => closeModal()}\n width=\"480px\"\n height=\"600px\"\n />\n );\n};\n\nexport default GrantMatchModal;\n\ntype ModalContentProps = {\n files: File[];\n uploadFiles: (acceptedFiles: File[]) => void;\n removeFile: (fileName: string) => void;\n};\n\nconst ModalContent = ({\n files,\n uploadFiles,\n removeFile,\n}: ModalContentProps) => {\n const { queryText, updateQueryText } = useGrantMatchContext();\n\n return (\n <BaseContent>\n <FileDrop\n uploadedFiles={files}\n uploadFiles={uploadFiles}\n removeFile={removeFile}\n />\n\n <ModalQueryText>\n <label htmlFor={QUERY_TEXTAREA_ID}>Search Grants Opportunities</label>\n <Textarea\n id={QUERY_TEXTAREA_ID}\n value={queryText}\n onChange={(event) => updateQueryText(event.target.value)}\n placeholder=\"Explore by grant name or share what your project is about...\"\n />\n </ModalQueryText>\n </BaseContent>\n );\n};\n\nconst QUERY_TEXTAREA_ID = \"query-textarea\";\n\nconst BaseContent = styled.div`\n display: flex;\n flex-direction: column;\n gap: 12px;\n`;\n\nconst ModalQueryText = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\ntype FindGrantsButtonProps = {\n files: File[];\n};\n\nconst FindGrantsButton = ({ files }: FindGrantsButtonProps) => {\n const { updateActiveQuery, queryText, closeModal } = useGrantMatchContext();\n\n const onClick = () => {\n updateActiveQuery({ files, text: queryText });\n closeModal();\n };\n\n return (\n <Button\n text=\"Find My Grants\"\n onClick={onClick}\n backgroundColor={Colors.accent.yellow1}\n />\n );\n};\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {} from "react";
|
|
2
3
|
import styled, { css } from "styled-components";
|
|
3
4
|
import { Colors, Icons, Responsive, Typography } from "../../foundations";
|
|
4
5
|
import { useGrantMatchContext } from "./context";
|
|
@@ -20,15 +21,15 @@ const BaseSearchBar = styled.div `
|
|
|
20
21
|
border-radius: 12px;
|
|
21
22
|
|
|
22
23
|
@media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {
|
|
23
|
-
gap:
|
|
24
|
+
gap: 6px;
|
|
25
|
+
padding: 6px;
|
|
24
26
|
width: 100%;
|
|
25
|
-
padding: 6px 16px;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
@media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {
|
|
29
30
|
gap: 10px;
|
|
30
|
-
width: 480px;
|
|
31
31
|
padding: 10px;
|
|
32
|
+
width: 480px;
|
|
32
33
|
}
|
|
33
34
|
`;
|
|
34
35
|
const QueryTextInput = () => {
|
|
@@ -50,7 +51,14 @@ const BaseQueryTextInput = styled.input `
|
|
|
50
51
|
const Buttons = styled.div `
|
|
51
52
|
display: flex;
|
|
52
53
|
align-items: center;
|
|
53
|
-
|
|
54
|
+
|
|
55
|
+
@media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {
|
|
56
|
+
gap: 6px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {
|
|
60
|
+
gap: 10px;
|
|
61
|
+
}
|
|
54
62
|
`;
|
|
55
63
|
const BaseIconButton = styled.button `
|
|
56
64
|
display: flex;
|
|
@@ -133,3 +141,4 @@ const FileDropButtonText = styled.p `
|
|
|
133
141
|
display: inline;
|
|
134
142
|
}
|
|
135
143
|
`;
|
|
144
|
+
//# sourceMappingURL=SearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBar.js","s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kBAAkB,4BAA+B,IAC/B,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAmC;;;;;;;;;sBASrD,MAAM,CAAC,IAAI,CAAC,cAAc;;;IAG5C,CAAC,EAAE,oBAAoB,EAAE,EAAE,EAAE,CAC7B,oBAAoB;IAClB,CAAC,CAAC,GAAG,CAAA;8BACmB,MAAM,CAAC,IAAI,CAAC,cAAc;mBACrC,MAAM,CAAC,UAAU,CAAC,SAAS;SACrC;IACH,CAAC,CAAC,GAAG,CAAA;8BACmB,MAAM,CAAC,IAAI,CAAC,KAAK;mBAC5B,MAAM,CAAC,IAAI,CAAC,cAAc;SACpC;;oBAEW,UAAU,CAAC,iBAAiB,CAAC,MAAM;;iBAEtC,UAAU,CAAC,iBAAiB,CAAC,KAAK;;;qBAG9B,UAAU,CAAC,iBAAiB,CAAC,MAAM;;iBAEvC,UAAU,CAAC,iBAAiB,CAAC,GAAG;;CAEhD,CAAC;AAEF,MAAM,kBAAkB,GAAG,MAAM,CAAC,CAAC,CAAA;;;;;oBAKf,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 { Colors, Icons, Responsive, Typography } from \"../../foundations\";\nimport { useGrantMatchContext } from \"./context\";\n\nconst SearchBar = () => {\n const { activeQuery, queryText } = useGrantMatchContext();\n\n return (\n <BaseSearchBar $hasActiveQueryText={activeQuery.text !== \"\"}>\n <QueryTextInput />\n\n <Buttons>\n {queryText !== \"\" ? <ResetTextButton /> : <></>}\n <SearchButton />\n <FileDropButton />\n </Buttons>\n </BaseSearchBar>\n );\n};\n\nexport default SearchBar;\n\nconst BaseSearchBar = styled.div<{ $hasActiveQueryText: boolean }>`\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n background-color: ${Colors.base.white};\n color: ${Colors.typography.blackHigh};\n\n border: 1px solid\n ${({ $hasActiveQueryText }) =>\n $hasActiveQueryText ? Colors.main.grantbiiOrange : Colors.neutral.grey3};\n border-radius: 12px;\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n gap: 6px;\n padding: 6px;\n width: 100%;\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n gap: 10px;\n padding: 10px;\n width: 480px;\n }\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=\"Find grants that match your needs\"\n />\n );\n};\n\nconst BaseQueryTextInput = styled.input`\n border: none;\n outline: none;\n\n width: 100%;\n`;\n\nconst Buttons = styled.div`\n display: flex;\n align-items: center;\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n gap: 6px;\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n gap: 10px;\n }\n`;\n\nconst BaseIconButton = styled.button`\n display: flex;\n align-items: center;\n justify-content: center;\n\n height: 31px;\n width: 31px;\n min-width: 31px;\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 <Icons.XIcon size={16} color={Colors.neutral.grey1} />\n </BaseResetTextButton>\n );\n};\n\nconst BaseResetTextButton = styled(BaseIconButton)`\n background-color: ${Colors.base.white};\n border: 1px solid ${Colors.base.white};\n`;\n\nconst SearchButton = () => {\n const { activeQuery, updateActiveQuery, queryText } = useGrantMatchContext();\n const onClick = () =>\n updateActiveQuery({ files: activeQuery.files, text: queryText });\n\n return (\n <BaseSearchButton type=\"button\" onClick={onClick}>\n <Icons.MagnifyingGlassIcon size={16} color={Colors.neutral.grey1} />\n </BaseSearchButton>\n );\n};\n\nconst BaseSearchButton = styled(BaseIconButton)`\n background-color: ${Colors.neutral.grey4};\n border: 1px solid ${Colors.neutral.grey3};\n`;\n\nconst FileDropButton = () => {\n const { activeQuery, openModal } = useGrantMatchContext();\n\n return (\n <BaseFileDropButton\n onClick={() => openModal()}\n $hasActiveQueryFiles={activeQuery.files.length > 0}\n >\n <Icons.FileArrowUpIcon size={16} />\n <FileDropButtonText>File Drop</FileDropButtonText>\n </BaseFileDropButton>\n );\n};\n\nconst BaseFileDropButton = styled.button<{ $hasActiveQueryFiles: boolean }>`\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n\n height: 31px;\n min-width: 31px;\n\n border: 1px solid ${Colors.main.grantbiiOrange};\n border-radius: 8px;\n\n ${({ $hasActiveQueryFiles }) =>\n $hasActiveQueryFiles\n ? css`\n background-color: ${Colors.main.grantbiiOrange};\n color: ${Colors.typography.whiteHigh};\n `\n : css`\n background-color: ${Colors.base.white};\n color: ${Colors.main.grantbiiOrange};\n `}\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n padding: 0px;\n font-size: ${Typography.HELPER_FONT_SIZES.small};\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n padding: 0px 8px;\n font-size: ${Typography.HELPER_FONT_SIZES.big};\n }\n`;\n\nconst FileDropButtonText = styled.p`\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"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {} from "@grantbii/ui-base/match/models";
|
|
1
2
|
import { createContext, useContext } from "react";
|
|
2
3
|
export const GrantMatchContext = createContext(null);
|
|
3
4
|
export const useGrantMatchContext = () => {
|
|
@@ -7,3 +8,4 @@ export const useGrantMatchContext = () => {
|
|
|
7
8
|
}
|
|
8
9
|
return context;
|
|
9
10
|
};
|
|
11
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../core/organisms/GrantMatch/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAWlD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAC5C,IAAI,CACL,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAA0B,EAAE;IAC9D,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAE9C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import { type GrantMatchQuery } from \"@grantbii/ui-base/match/models\";\nimport { createContext, useContext } from \"react\";\n\ntype GrantMatchCommonProps = {\n activeQuery: GrantMatchQuery;\n updateActiveQuery: (query: GrantMatchQuery) => void;\n queryText: string;\n updateQueryText: (newText: string) => void;\n openModal: () => void;\n closeModal: () => void;\n};\n\nexport const GrantMatchContext = createContext<GrantMatchCommonProps | null>(\n null,\n);\n\nexport const useGrantMatchContext = (): GrantMatchCommonProps => {\n const context = useContext(GrantMatchContext);\n\n if (!context) {\n throw new Error(\"useGrantMatchContext must be used within its Provider\");\n }\n\n return context;\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { checkGrantMatchActive } from "@grantbii/ui-base/match/
|
|
2
|
+
import { checkGrantMatchActive } from "@grantbii/ui-base/match/validations";
|
|
3
|
+
import {} from "@grantbii/ui-base/match/models";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import styled from "styled-components";
|
|
6
6
|
import { useModal } from "../../molecules";
|
|
@@ -37,7 +37,7 @@ export const useGrantMatchActiveQuery = (performGrantMatch, resetGrantMatch) =>
|
|
|
37
37
|
text: "",
|
|
38
38
|
});
|
|
39
39
|
const updateActiveQuery = (newQuery) => {
|
|
40
|
-
setActiveQuery(
|
|
40
|
+
setActiveQuery({ ...newQuery });
|
|
41
41
|
if (checkGrantMatchActive(newQuery)) {
|
|
42
42
|
performGrantMatch(newQuery);
|
|
43
43
|
}
|
|
@@ -47,3 +47,4 @@ export const useGrantMatchActiveQuery = (performGrantMatch, resetGrantMatch) =>
|
|
|
47
47
|
};
|
|
48
48
|
return { activeQuery, updateActiveQuery };
|
|
49
49
|
};
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../core/organisms/GrantMatch/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAwB,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM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CAAC,EAAE,CAAC;YACpC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,eAAe,EAAE,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAC5C,CAAC,CAAC","sourcesContent":["import { checkGrantMatchActive } from \"@grantbii/ui-base/match/validations\";\nimport { type GrantMatchQuery } from \"@grantbii/ui-base/match/models\";\nimport { useState } from \"react\";\nimport styled from \"styled-components\";\nimport { useModal } from \"../../molecules\";\nimport ActiveQueryFiles from \"./ActiveQueryFiles\";\nimport GrantMatchModal from \"./GrantMatchModal\";\nimport SearchBar from \"./SearchBar\";\nimport { GrantMatchContext } from \"./context\";\n\ntype GrantMatchProps = {\n activeQuery: GrantMatchQuery;\n updateActiveQuery: (newQuery: GrantMatchQuery) => void;\n};\n\nconst GrantMatch = ({ activeQuery, updateActiveQuery }: GrantMatchProps) => {\n const { showModal, openModal, closeModal } = useModal();\n const [queryText, setQueryText] = useState(activeQuery.text);\n const updateQueryText = (newText: string) => setQueryText(newText);\n\n const commonProps = {\n activeQuery,\n updateActiveQuery,\n queryText,\n updateQueryText,\n openModal,\n closeModal,\n };\n\n return (\n <GrantMatchContext.Provider value={commonProps}>\n <BaseGrantMatch>\n <SearchBar />\n {activeQuery.files.length > 0 ? <ActiveQueryFiles /> : <></>}\n {showModal ? <GrantMatchModal /> : <></>}\n </BaseGrantMatch>\n </GrantMatchContext.Provider>\n );\n};\n\nexport default GrantMatch;\n\nconst BaseGrantMatch = styled.div`\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n width: 100%;\n max-width: 100vw;\n`;\n\nexport const useGrantMatchActiveQuery = (\n performGrantMatch: (newQuery: GrantMatchQuery) => void,\n resetGrantMatch: () => void,\n): GrantMatchProps => {\n const [activeQuery, setActiveQuery] = useState<GrantMatchQuery>({\n files: [],\n text: \"\",\n });\n\n const updateActiveQuery = (newQuery: GrantMatchQuery) => {\n setActiveQuery({ ...newQuery });\n\n if (checkGrantMatchActive(newQuery)) {\n performGrantMatch(newQuery);\n } else {\n resetGrantMatch();\n }\n };\n\n return { activeQuery, updateActiveQuery };\n};\n"]}
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import {} from "react";
|
|
14
3
|
import { Modal } from "../molecules";
|
|
15
|
-
const TallyModal = (
|
|
16
|
-
var { tallyId, prefilledFieldsQueryParams } = _a, modalProps = __rest(_a, ["tallyId", "prefilledFieldsQueryParams"]);
|
|
17
|
-
return (_jsx(Modal, Object.assign({}, modalProps, { content: _jsx("iframe", { src: constructIframeSrc(tallyId, prefilledFieldsQueryParams), loading: "lazy" }), width: "640px", height: "480px" })));
|
|
18
|
-
};
|
|
4
|
+
const TallyModal = ({ tallyId, prefilledFieldsQueryParams, ...modalProps }) => (_jsx(Modal, { ...modalProps, content: _jsx("iframe", { src: constructIframeSrc(tallyId, prefilledFieldsQueryParams), loading: "lazy" }), width: "640px", height: "480px" }));
|
|
19
5
|
export default TallyModal;
|
|
20
6
|
const constructIframeSrc = (tallyId, prefilledFieldsQueryParams) => `https://tally.so/embed/${tallyId}?${TALLY_QUERIES}${prefilledFieldsQueryParams ? `&${prefilledFieldsQueryParams}` : ""}`;
|
|
21
7
|
const TALLY_QUERIES = "alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=0";
|
|
8
|
+
//# sourceMappingURL=TallyModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TallyModal.js","sourceRoot":"","sources":["../../../core/organisms/TallyModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AASrC,MAAM,UAAU,GAAG,CAAC,EAClB,OAAO,EACP,0BAA0B,EAC1B,GAAG,UAAU,EACG,EAAE,EAAE,CAAC,CACrB,KAAC,KAAK,OACA,UAAU,EACd,OAAO,EACL,iBACE,GAAG,EAAE,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,CAAC,EAC5D,OAAO,EAAC,MAAM,GACd,EAEJ,KAAK,EAAC,OAAO,EACb,MAAM,EAAC,OAAO,GACd,CACH,CAAC;AAEF,eAAe,UAAU,CAAC;AAE1B,MAAM,kBAAkB,GAAG,CACzB,OAAe,EACf,0BAAmC,EACnC,EAAE,CACF,0BAA0B,OAAO,IAAI,aAAa,GAAG,0BAA0B,CAAC,CAAC,CAAC,IAAI,0BAA0B,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAE5H,MAAM,aAAa,GACjB,iEAAiE,CAAC","sourcesContent":["import { type MouseEventHandler, type ReactNode } from \"react\";\nimport { Modal } from \"../molecules\";\n\ntype TallyModalProps = {\n header?: ReactNode;\n tallyId: string;\n prefilledFieldsQueryParams?: string;\n onClickCancel: MouseEventHandler<HTMLButtonElement>;\n};\n\nconst TallyModal = ({\n tallyId,\n prefilledFieldsQueryParams,\n ...modalProps\n}: TallyModalProps) => (\n <Modal\n {...modalProps}\n content={\n <iframe\n src={constructIframeSrc(tallyId, prefilledFieldsQueryParams)}\n loading=\"lazy\"\n />\n }\n width=\"640px\"\n height=\"480px\"\n />\n);\n\nexport default TallyModal;\n\nconst constructIframeSrc = (\n tallyId: string,\n prefilledFieldsQueryParams?: string,\n) =>\n `https://tally.so/embed/${tallyId}?${TALLY_QUERIES}${prefilledFieldsQueryParams ? `&${prefilledFieldsQueryParams}` : \"\"}`;\n\nconst TALLY_QUERIES =\n \"alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=0\";\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DetailedHTMLProps, InputHTMLAttributes } from "react";
|
|
1
|
+
import { type DetailedHTMLProps, type InputHTMLAttributes } from "react";
|
|
2
2
|
type YesNoOptionsProps = {
|
|
3
3
|
name: string;
|
|
4
4
|
yesProps: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
2
|
+
import { LogicValue } from "@grantbii/ui-base/grant/enums";
|
|
3
|
+
import {} from "react";
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
import { RadioButton } from "../atoms";
|
|
6
|
-
const YesNoOptions = ({ name, yesProps, noProps, unsureProps, }) => (_jsxs(RadioGroup, { children: [_jsx(RadioButton,
|
|
6
|
+
const YesNoOptions = ({ name, yesProps, noProps, unsureProps, }) => (_jsxs(RadioGroup, { children: [_jsx(RadioButton, { ...yesProps, label: LogicValue.YES, value: LogicValue.YES, name: name }), _jsx(RadioButton, { ...noProps, label: LogicValue.NO, value: LogicValue.NO, name: name }), unsureProps ? (_jsx(RadioButton, { ...unsureProps, label: LogicValue.UNSURE, value: LogicValue.UNSURE, name: name })) : (_jsx(_Fragment, {}))] }));
|
|
7
7
|
export default YesNoOptions;
|
|
8
8
|
const RadioGroup = styled.div `
|
|
9
9
|
display: flex;
|
|
10
10
|
gap: 12px;
|
|
11
11
|
`;
|
|
12
|
+
//# sourceMappingURL=YesNoOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YesNoOptions.js","sourceRoot":"","sources":["../../../core/organisms/YesNoOptions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAkBvC,MAAM,YAAY,GAAG,CAAC,EACpB,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,WAAW,GACO,EAAE,EAAE,CAAC,CACvB,MAAC,UAAU,eACT,KAAC,WAAW,OACN,QAAQ,EACZ,KAAK,EAAE,UAAU,CAAC,GAAG,EACrB,KAAK,EAAE,UAAU,CAAC,GAAG,EACrB,IAAI,EAAE,IAAI,GACV,EACF,KAAC,WAAW,OACN,OAAO,EACX,KAAK,EAAE,UAAU,CAAC,EAAE,EACpB,KAAK,EAAE,UAAU,CAAC,EAAE,EACpB,IAAI,EAAE,IAAI,GACV,EACD,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,WAAW,OACN,WAAW,EACf,KAAK,EAAE,UAAU,CAAC,MAAM,EACxB,KAAK,EAAE,UAAU,CAAC,MAAM,EACxB,IAAI,EAAE,IAAI,GACV,CACH,CAAC,CAAC,CAAC,CACF,mBAAK,CACN,IACU,CACd,CAAC;AAEF,eAAe,YAAY,CAAC;AAE5B,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG5B,CAAC","sourcesContent":["import { LogicValue } from \"@grantbii/ui-base/grant/enums\";\nimport { type DetailedHTMLProps, type InputHTMLAttributes } from \"react\";\nimport styled from \"styled-components\";\nimport { RadioButton } from \"../atoms\";\n\ntype YesNoOptionsProps = {\n name: string;\n yesProps: DetailedHTMLProps<\n InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n >;\n noProps: DetailedHTMLProps<\n InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n >;\n unsureProps?: DetailedHTMLProps<\n InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n >;\n};\n\nconst YesNoOptions = ({\n name,\n yesProps,\n noProps,\n unsureProps,\n}: YesNoOptionsProps) => (\n <RadioGroup>\n <RadioButton\n {...yesProps}\n label={LogicValue.YES}\n value={LogicValue.YES}\n name={name}\n />\n <RadioButton\n {...noProps}\n label={LogicValue.NO}\n value={LogicValue.NO}\n name={name}\n />\n {unsureProps ? (\n <RadioButton\n {...unsureProps}\n label={LogicValue.UNSURE}\n value={LogicValue.UNSURE}\n name={name}\n />\n ) : (\n <></>\n )}\n </RadioGroup>\n);\n\nexport default YesNoOptions;\n\nconst RadioGroup = styled.div`\n display: flex;\n gap: 12px;\n`;\n"]}
|
package/core/organisms/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/organisms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default as GrantMatch, useGrantMatchActiveQuery } from \"./GrantMatch\";\nexport { default as TallyModal } from \"./TallyModal\";\nexport { default as YesNoOptions } from \"./YesNoOptions\";\n"]}
|
package/index.js
CHANGED
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC","sourcesContent":["\"use client\";\n\nexport * from \"./core/atoms\";\nexport * from \"./core/foundations\";\nexport * from \"./core/global\";\nexport * from \"./core/integrations\";\nexport * from \"./core/molecules\";\nexport * from \"./core/organisms\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grantbii/design-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.78",
|
|
4
4
|
"description": "Grantbii's Design System",
|
|
5
5
|
"homepage": "https://design.grantbii.com",
|
|
6
6
|
"repository": {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"license": "UNLICENSED",
|
|
11
11
|
"main": "./index.js",
|
|
12
|
+
"types": "./index.d.ts",
|
|
12
13
|
"scripts": {
|
|
13
14
|
"lint": "next lint",
|
|
14
15
|
"prepare": "husky",
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
"build-storybook": "storybook build"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"@grantbii/ui-base": "1.0.
|
|
22
|
+
"@grantbii/ui-base": "1.0.26",
|
|
22
23
|
"@phosphor-icons/react": "^2.1.10",
|
|
23
24
|
"country-flag-icons": "^1.5.19",
|
|
24
25
|
"next": "^15.5.2",
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"@storybook/nextjs-vite": "^9.1.3",
|
|
40
41
|
"@types/node": "^20",
|
|
41
42
|
"@types/react": "^19.1.12",
|
|
42
|
-
"@types/react-dom": "^19.1.
|
|
43
|
+
"@types/react-dom": "^19.1.9",
|
|
43
44
|
"@vitest/browser": "^3.2.4",
|
|
44
45
|
"@vitest/coverage-v8": "^3.2.4",
|
|
45
46
|
"eslint": "^9.34.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.stories.js","sourceRoot":"","sources":["../../../stories/atoms/Badge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAA4B,MAAM,wBAAwB,CAAC;AAElE,MAAM,IAAI,GAAuB;IAC/B,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACF,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,IAAI,EAAE,WAAW;KAClB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAU;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,KAAK,CAAC,eAAe;QAC3B,IAAI,EAAE,WAAW;KAClB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW;QACjB,YAAY;KACb;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,eAAe,EAAE,GAAG;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,IAAI,EAAE,KAAK,CAAC,eAAe;QAC3B,IAAI,EAAE,QAAQ;QACd,eAAe,EAAE,GAAG;QACpB,YAAY;KACb;CACF,CAAC","sourcesContent":["import { Badge, Icons } from \"@/.\";\nimport { type Meta, type StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof Badge> = {\n title: \"Atoms/Badge\",\n component: Badge,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\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 text: defaultText,\n },\n};\n\nexport const Icon: Story = {\n args: {\n Icon: Icons.SmileyXEyesIcon,\n text: defaultText,\n },\n};\n\nexport const Closeable: Story = {\n args: {\n text: defaultText,\n onClickClose,\n },\n};\n\nexport const LongText: Story = {\n args: {\n text: longText,\n textWidthPixels: 160,\n },\n};\n\nexport const Everything: Story = {\n args: {\n Icon: Icons.SmileyXEyesIcon,\n text: longText,\n textWidthPixels: 160,\n onClickClose,\n },\n};\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BrandLogo } from "@/.";
|
|
2
|
+
import {} from "@storybook/nextjs-vite";
|
|
2
3
|
const meta = {
|
|
3
4
|
title: "Atoms/Brand Logo",
|
|
4
5
|
component: BrandLogo,
|
|
@@ -21,3 +22,4 @@ export const Dark = {
|
|
|
21
22
|
isDarkTheme: true,
|
|
22
23
|
},
|
|
23
24
|
};
|
|
25
|
+
//# sourceMappingURL=BrandLogo.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrandLogo.stories.js","sourceRoot":"","sources":["../../../stories/atoms/BrandLogo.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAA4B,MAAM,wBAAwB,CAAC;AAElE,MAAM,IAAI,GAA2B;IACnC,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE;QACJ,WAAW,EAAE,KAAK;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAU;IACzB,IAAI,EAAE;QACJ,WAAW,EAAE,IAAI;KAClB;CACF,CAAC","sourcesContent":["import { BrandLogo } from \"@/.\";\nimport { type Meta, type StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof BrandLogo> = {\n title: \"Atoms/Brand Logo\",\n component: BrandLogo,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {\n args: {},\n};\n\nexport const Light: Story = {\n args: {\n isDarkTheme: false,\n },\n};\n\nexport const Dark: Story = {\n args: {\n isDarkTheme: true,\n },\n};\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Button, Colors, Icons } from "@/.";
|
|
2
|
+
import {} from "@storybook/nextjs-vite";
|
|
2
3
|
const meta = {
|
|
3
4
|
title: "Atoms/Button",
|
|
4
5
|
component: Button,
|
|
@@ -16,14 +17,29 @@ export const TextOnly = {
|
|
|
16
17
|
args: baseArgs,
|
|
17
18
|
};
|
|
18
19
|
export const LeftIcon = {
|
|
19
|
-
args:
|
|
20
|
+
args: {
|
|
21
|
+
...baseArgs,
|
|
22
|
+
LeftIcon: Icons.PlusIcon,
|
|
23
|
+
},
|
|
20
24
|
};
|
|
21
25
|
export const RightIcon = {
|
|
22
|
-
args:
|
|
26
|
+
args: {
|
|
27
|
+
...baseArgs,
|
|
28
|
+
RightIcon: Icons.MinusIcon,
|
|
29
|
+
},
|
|
23
30
|
};
|
|
24
31
|
export const BothIcons = {
|
|
25
|
-
args:
|
|
32
|
+
args: {
|
|
33
|
+
...baseArgs,
|
|
34
|
+
LeftIcon: Icons.SmileyXEyesIcon,
|
|
35
|
+
RightIcon: Icons.SmileyMeltingIcon,
|
|
36
|
+
},
|
|
26
37
|
};
|
|
27
38
|
export const Underline = {
|
|
28
|
-
args:
|
|
39
|
+
args: {
|
|
40
|
+
...baseArgs,
|
|
41
|
+
underline: true,
|
|
42
|
+
color: Colors.typography.blackMedium,
|
|
43
|
+
},
|
|
29
44
|
};
|
|
45
|
+
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../stories/atoms/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAA4B,MAAM,wBAAwB,CAAC;AAElE,MAAM,IAAI,GAAwB;IAChC,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,iCAAiC,CAAC;CACxD,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE,QAAQ;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,QAAQ,EAAE,KAAK,CAAC,eAAe;QAC/B,SAAS,EAAE,KAAK,CAAC,iBAAiB;KACnC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW;KACrC;CACF,CAAC","sourcesContent":["import { Button, Colors, Icons } from \"@/.\";\nimport { type Meta, type StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof Button> = {\n title: \"Atoms/Button\",\n component: Button,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst baseArgs = {\n text: \"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: Icons.PlusIcon,\n },\n};\n\nexport const RightIcon: Story = {\n args: {\n ...baseArgs,\n RightIcon: Icons.MinusIcon,\n },\n};\n\nexport const BothIcons: Story = {\n args: {\n ...baseArgs,\n LeftIcon: Icons.SmileyXEyesIcon,\n RightIcon: Icons.SmileyMeltingIcon,\n },\n};\n\nexport const Underline: Story = {\n args: {\n ...baseArgs,\n underline: true,\n color: Colors.typography.blackMedium,\n },\n};\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Checkbox } from "@/.";
|
|
2
|
+
import {} from "@storybook/nextjs-vite";
|
|
2
3
|
const meta = {
|
|
3
4
|
title: "Atoms/Checkbox",
|
|
4
5
|
component: Checkbox,
|
|
@@ -21,3 +22,4 @@ export const LabelAfter = {
|
|
|
21
22
|
labelBefore: false,
|
|
22
23
|
},
|
|
23
24
|
};
|
|
25
|
+
//# sourceMappingURL=Checkbox.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.stories.js","sourceRoot":"","sources":["../../../stories/atoms/Checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAA4B,MAAM,wBAAwB,CAAC;AAElE,MAAM,IAAI,GAA0B;IAClC,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,KAAK,GAAG,sBAAsB,CAAC;AAErC,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,EAAE;QACJ,KAAK;QACL,WAAW,EAAE,IAAI;KAClB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,KAAK;QACL,WAAW,EAAE,KAAK;KACnB;CACF,CAAC","sourcesContent":["import { Checkbox } from \"@/.\";\nimport { type Meta, type StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof Checkbox> = {\n title: \"Atoms/Checkbox\",\n component: Checkbox,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst label = \"Grantbii is the best\";\n\nexport const LabelBefore: Story = {\n args: {\n label,\n labelBefore: true,\n },\n};\n\nexport const LabelAfter: Story = {\n args: {\n label,\n labelBefore: false,\n },\n};\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Colors, Icons, LinkButton } from "@/.";
|
|
2
|
+
import {} from "@storybook/nextjs-vite";
|
|
2
3
|
const meta = {
|
|
3
4
|
title: "Atoms/Link Button",
|
|
4
5
|
component: LinkButton,
|
|
@@ -17,14 +18,29 @@ export const TextOnly = {
|
|
|
17
18
|
args: baseArgs,
|
|
18
19
|
};
|
|
19
20
|
export const LeftIcon = {
|
|
20
|
-
args:
|
|
21
|
+
args: {
|
|
22
|
+
...baseArgs,
|
|
23
|
+
LeftIcon: Icons.PlusIcon,
|
|
24
|
+
},
|
|
21
25
|
};
|
|
22
26
|
export const RightIcon = {
|
|
23
|
-
args:
|
|
27
|
+
args: {
|
|
28
|
+
...baseArgs,
|
|
29
|
+
RightIcon: Icons.MinusIcon,
|
|
30
|
+
},
|
|
24
31
|
};
|
|
25
32
|
export const BothIcons = {
|
|
26
|
-
args:
|
|
33
|
+
args: {
|
|
34
|
+
...baseArgs,
|
|
35
|
+
LeftIcon: Icons.SmileyXEyesIcon,
|
|
36
|
+
RightIcon: Icons.SmileyMeltingIcon,
|
|
37
|
+
},
|
|
27
38
|
};
|
|
28
39
|
export const Underline = {
|
|
29
|
-
args:
|
|
40
|
+
args: {
|
|
41
|
+
...baseArgs,
|
|
42
|
+
underline: true,
|
|
43
|
+
color: Colors.typography.blackMedium,
|
|
44
|
+
},
|
|
30
45
|
};
|
|
46
|
+
//# sourceMappingURL=LinkButton.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkButton.stories.js","sourceRoot":"","sources":["../../../stories/atoms/LinkButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAA4B,MAAM,wBAAwB,CAAC;AAElE,MAAM,IAAI,GAA4B;IACpC,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,sBAAsB;IAC5B,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE,QAAQ;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,QAAQ,EAAE,KAAK,CAAC,eAAe;QAC/B,SAAS,EAAE,KAAK,CAAC,iBAAiB;KACnC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW;KACrC;CACF,CAAC","sourcesContent":["import { Colors, Icons, LinkButton } from \"@/.\";\nimport { type Meta, type StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof LinkButton> = {\n title: \"Atoms/Link Button\",\n component: LinkButton,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst baseArgs = {\n text: \"Link\",\n href: \"https://grantbii.com\",\n target: \"_blank\",\n};\n\nexport const TextOnly: Story = {\n args: baseArgs,\n};\n\nexport const LeftIcon: Story = {\n args: {\n ...baseArgs,\n LeftIcon: Icons.PlusIcon,\n },\n};\n\nexport const RightIcon: Story = {\n args: {\n ...baseArgs,\n RightIcon: Icons.MinusIcon,\n },\n};\n\nexport const BothIcons: Story = {\n args: {\n ...baseArgs,\n LeftIcon: Icons.SmileyXEyesIcon,\n RightIcon: Icons.SmileyMeltingIcon,\n },\n};\n\nexport const Underline: Story = {\n args: {\n ...baseArgs,\n underline: true,\n color: Colors.typography.blackMedium,\n },\n};\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PageLoader } from "@/.";
|
|
3
|
+
import {} from "@storybook/nextjs-vite";
|
|
3
4
|
import styled from "styled-components";
|
|
4
5
|
const PageLoaderExample = ({ isPacman }) => (_jsx(BaseExample, { children: _jsx(PageLoader, { isPacman: isPacman }) }));
|
|
5
6
|
const BaseExample = styled.div `
|
|
@@ -21,3 +22,4 @@ export const GrantbiiApp = {
|
|
|
21
22
|
export const AdminConsole = {
|
|
22
23
|
args: { isPacman: true },
|
|
23
24
|
};
|
|
25
|
+
//# sourceMappingURL=PageLoader.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageLoader.stories.js","sourceRoot":"","sources":["../../../stories/atoms/PageLoader.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAA4B,MAAM,wBAAwB,CAAC;AAClE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAMvC,MAAM,iBAAiB,GAAG,CAAC,EAAE,QAAQ,EAA0B,EAAE,EAAE,CAAC,CAClE,KAAC,WAAW,cACV,KAAC,UAAU,IAAC,QAAQ,EAAE,QAAQ,GAAI,GACtB,CACf,CAAC;AAEF,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG7B,CAAC;AAEF,MAAM,IAAI,GAAmC;IAC3C,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,iBAAiB;IAC5B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;CACzB,CAAC","sourcesContent":["import { PageLoader } from \"@/.\";\nimport { type Meta, type StoryObj } from \"@storybook/nextjs-vite\";\nimport styled from \"styled-components\";\n\ntype PageLoaderExampleProps = {\n isPacman?: boolean;\n};\n\nconst PageLoaderExample = ({ isPacman }: PageLoaderExampleProps) => (\n <BaseExample>\n <PageLoader isPacman={isPacman} />\n </BaseExample>\n);\n\nconst BaseExample = styled.div`\n width: 100vw;\n height: 100vh;\n`;\n\nconst meta: Meta<typeof PageLoaderExample> = {\n title: \"Atoms/Page Loader\",\n component: PageLoaderExample,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"fullscreen\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const GrantbiiApp: Story = {\n args: {},\n};\n\nexport const AdminConsole: Story = {\n args: { isPacman: true },\n};\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Textarea } from "@/.";
|
|
2
|
+
import {} from "@storybook/nextjs-vite";
|
|
2
3
|
const meta = {
|
|
3
4
|
title: "Atoms/Textarea",
|
|
4
5
|
component: Textarea,
|
|
@@ -14,3 +15,4 @@ export const BasicExample = {
|
|
|
14
15
|
export const WithValidation = {
|
|
15
16
|
args: { placeholder: "Must be at least 10 characters long", minLength: 10 },
|
|
16
17
|
};
|
|
18
|
+
//# sourceMappingURL=Textarea.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.stories.js","sourceRoot":"","sources":["../../../stories/atoms/Textarea.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAA4B,MAAM,wBAAwB,CAAC;AAElE,MAAM,IAAI,GAA0B;IAClC,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,IAAI,EAAE,EAAE,WAAW,EAAE,qCAAqC,EAAE,SAAS,EAAE,EAAE,EAAE;CAC5E,CAAC","sourcesContent":["import { Textarea } from \"@/.\";\nimport { type Meta, type StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof Textarea> = {\n title: \"Atoms/Textarea\",\n component: Textarea,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const BasicExample: Story = {\n args: { placeholder: \"Type here\" },\n};\n\nexport const WithValidation: Story = {\n args: { placeholder: \"Must be at least 10 characters long\", minLength: 10 },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
1
|
+
import { type Meta, type StoryObj } from "@storybook/nextjs-vite";
|
|
2
2
|
declare const FileDropExample: () => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare const meta: Meta<typeof FileDropExample>;
|
|
4
4
|
export default meta;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { FileDrop, useFileDrop } from "@/.";
|
|
3
|
+
import {} from "@storybook/nextjs-vite";
|
|
3
4
|
import styled from "styled-components";
|
|
4
5
|
const FileDropExample = () => {
|
|
5
6
|
const { files, uploadFiles, removeFile, errorMessage } = useFileDrop();
|
|
@@ -20,3 +21,4 @@ export default meta;
|
|
|
20
21
|
export const Example = {
|
|
21
22
|
args: {},
|
|
22
23
|
};
|
|
24
|
+
//# sourceMappingURL=FileDrop.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileDrop.stories.js","sourceRoot":"","sources":["../../../stories/molecules/FileDrop.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAA4B,MAAM,wBAAwB,CAAC;AAClE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,WAAW,EAAE,CAAC;IAEvE,OAAO,CACL,KAAC,SAAS,cACR,KAAC,QAAQ,IACP,aAAa,EAAE,KAAK,EACpB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC1B,GACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE3B,CAAC;AAEF,MAAM,IAAI,GAAiC;IACzC,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC","sourcesContent":["import { FileDrop, useFileDrop } from \"@/.\";\nimport { type Meta, type StoryObj } from \"@storybook/nextjs-vite\";\nimport styled from \"styled-components\";\n\nconst FileDropExample = () => {\n const { files, uploadFiles, removeFile, errorMessage } = useFileDrop();\n\n return (\n <Container>\n <FileDrop\n uploadedFiles={files}\n uploadFiles={uploadFiles}\n removeFile={removeFile}\n errorMessage={errorMessage}\n />\n </Container>\n );\n};\n\nconst Container = styled.div`\n width: 400px;\n`;\n\nconst meta: Meta<typeof FileDropExample> = {\n title: \"Molecules/File Drop\",\n component: FileDropExample,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Example: Story = {\n args: {},\n};\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { type Meta, type StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
3
|
type ModalExampleProps = {
|
|
4
4
|
header?: ReactNode;
|
|
5
|
-
content:
|
|
5
|
+
content: JSX.Element;
|
|
6
6
|
footer?: ReactNode;
|
|
7
7
|
width?: string;
|
|
8
8
|
height?: string;
|