@grantbii/design-system 1.0.82 → 1.1.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.
- package/core/atoms/Input.d.ts +2 -0
- package/core/atoms/Input.js +12 -0
- package/core/atoms/Input.js.map +1 -0
- package/core/atoms/Textarea.js +3 -0
- package/core/atoms/Textarea.js.map +1 -1
- package/core/atoms/index.d.ts +1 -0
- package/core/atoms/index.js +1 -0
- package/core/atoms/index.js.map +1 -1
- package/core/integrations/index.d.ts +1 -0
- package/core/integrations/index.js +1 -0
- package/core/integrations/index.js.map +1 -1
- package/core/integrations/mappings.d.ts +3 -0
- package/core/integrations/mappings.js +4 -0
- package/core/integrations/mappings.js.map +1 -0
- package/core/molecules/Dropdown.d.ts +1 -1
- package/core/molecules/Dropdown.js +1 -0
- package/core/molecules/Dropdown.js.map +1 -1
- package/core/molecules/Modal.d.ts +1 -1
- package/core/molecules/Modal.js +3 -2
- package/core/molecules/Modal.js.map +1 -1
- package/core/organisms/GrantMatch/context.d.ts +1 -1
- package/core/organisms/GrantMatch/context.js.map +1 -1
- package/core/organisms/GrantMatch/index.d.ts +1 -1
- package/core/organisms/GrantMatch/index.js +1 -1
- package/core/organisms/GrantMatch/index.js.map +1 -1
- package/core/organisms/YesNoOptions.js +1 -1
- package/core/organisms/YesNoOptions.js.map +1 -1
- package/package.json +9 -9
- package/stories/atoms/Input.stories.d.ts +9 -0
- package/stories/atoms/Input.stories.js +23 -0
- package/stories/atoms/Input.stories.js.map +1 -0
- package/stories/molecules/Dropdown.stories.js +10 -11
- package/stories/molecules/Dropdown.stories.js.map +1 -1
- package/stories/molecules/Modal.stories.d.ts +1 -1
- package/stories/molecules/Modal.stories.js +9 -10
- package/stories/molecules/Modal.stories.js.map +1 -1
- package/stories/molecules/RadioButtons.stories.js +1 -1
- package/stories/molecules/RadioButtons.stories.js.map +1 -1
- package/stories/organisms/GrantMatch.stories.js +1 -1
- package/stories/organisms/GrantMatch.stories.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { InputValidation } from "./shared";
|
|
3
|
+
import { Colors } from "../foundations";
|
|
4
|
+
const Input = styled.input `
|
|
5
|
+
padding: 12px 16px;
|
|
6
|
+
background-color: ${Colors.base.white};
|
|
7
|
+
border-radius: 6px;
|
|
8
|
+
|
|
9
|
+
${InputValidation}
|
|
10
|
+
`;
|
|
11
|
+
export default Input;
|
|
12
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../core/atoms/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;;sBAEJ,MAAM,CAAC,IAAI,CAAC,KAAK;;;IAGnC,eAAe;CAClB,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import styled from \"styled-components\";\nimport { InputValidation } from \"./shared\";\nimport { Colors } from \"../foundations\";\n\nconst Input = styled.input`\n padding: 12px 16px;\n background-color: ${Colors.base.white};\n border-radius: 6px;\n\n ${InputValidation}\n`;\n\nexport default Input;\n"]}
|
package/core/atoms/Textarea.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
+
import { Colors } from "../foundations";
|
|
2
3
|
import { InputValidation } from "./shared";
|
|
3
4
|
const Textarea = styled.textarea `
|
|
4
5
|
height: ${({ $heightPixels = 100 }) => $heightPixels}px;
|
|
6
|
+
|
|
5
7
|
padding: 12px 16px;
|
|
8
|
+
background-color: ${Colors.base.white};
|
|
6
9
|
border-radius: 6px;
|
|
7
10
|
|
|
8
11
|
${InputValidation}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../core/atoms/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAA4B;YAChD,CAAC,EAAE,aAAa,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,aAAa
|
|
1
|
+
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../core/atoms/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAA4B;YAChD,CAAC,EAAE,aAAa,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,aAAa;;;sBAGhC,MAAM,CAAC,IAAI,CAAC,KAAK;;;IAGnC,eAAe;CAClB,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import styled from \"styled-components\";\nimport { Colors } from \"../foundations\";\nimport { InputValidation } from \"./shared\";\n\nconst Textarea = styled.textarea<{ $heightPixels?: number }>`\n height: ${({ $heightPixels = 100 }) => $heightPixels}px;\n\n padding: 12px 16px;\n background-color: ${Colors.base.white};\n border-radius: 6px;\n\n ${InputValidation}\n`;\n\nexport default Textarea;\n"]}
|
package/core/atoms/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { default as Badge } from "./Badge";
|
|
|
2
2
|
export { default as BrandLogo } from "./BrandLogo";
|
|
3
3
|
export { default as Button } from "./Button";
|
|
4
4
|
export { default as Checkbox } from "./Checkbox";
|
|
5
|
+
export { default as Input } from "./Input";
|
|
5
6
|
export { default as LinkButton } from "./LinkButton";
|
|
6
7
|
export { default as PageLoader } from "./PageLoader";
|
|
7
8
|
export { default as RadioButton } from "./RadioButton";
|
package/core/atoms/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { default as Badge } from "./Badge";
|
|
|
2
2
|
export { default as BrandLogo } from "./BrandLogo";
|
|
3
3
|
export { default as Button } from "./Button";
|
|
4
4
|
export { default as Checkbox } from "./Checkbox";
|
|
5
|
+
export { default as Input } from "./Input";
|
|
5
6
|
export { default as LinkButton } from "./LinkButton";
|
|
6
7
|
export { default as PageLoader } from "./PageLoader";
|
|
7
8
|
export { default as RadioButton } from "./RadioButton";
|
package/core/atoms/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/atoms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default as Badge } from \"./Badge\";\nexport { default as BrandLogo } from \"./BrandLogo\";\nexport { default as Button } from \"./Button\";\nexport { default as Checkbox } from \"./Checkbox\";\nexport { default as LinkButton } from \"./LinkButton\";\nexport { default as PageLoader } from \"./PageLoader\";\nexport { default as RadioButton } from \"./RadioButton\";\nexport { default as Select } from \"./Select\";\nexport { default as Textarea } from \"./Textarea\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/atoms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default as Badge } from \"./Badge\";\nexport { default as BrandLogo } from \"./BrandLogo\";\nexport { default as Button } from \"./Button\";\nexport { default as Checkbox } from \"./Checkbox\";\nexport { default as Input } from \"./Input\";\nexport { default as LinkButton } from \"./LinkButton\";\nexport { default as PageLoader } from \"./PageLoader\";\nexport { default as RadioButton } from \"./RadioButton\";\nexport { default as Select } from \"./Select\";\nexport { default as Textarea } from \"./Textarea\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export { default as StyledComponentsRegistry } from \"./StyledComponentsRegistry\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,cAAc,YAAY,CAAC","sourcesContent":["export { default as StyledComponentsRegistry } from \"./StyledComponentsRegistry\";\nexport * from \"./mappings\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappings.js","sourceRoot":"","sources":["../../../core/integrations/mappings.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,QAAkB,EACR,EAAE,CACZ,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;KACpB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,OAAO,CAAC;KAC7C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC","sourcesContent":["import type { BaseEnumType } from \"@grantbii/ui-core/shared/enums\";\nimport type { Option } from \"../foundations\";\n\nexport const mapEnumToOptions = <EnumType extends BaseEnumType>(\n enumType: EnumType,\n): Option[] =>\n Object.values(enumType)\n .filter((value) => value !== enumType.UNKNOWN)\n .map((value) => ({ label: value, value }));\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Select } from "../atoms";
|
|
3
|
+
import {} from "../foundations";
|
|
3
4
|
const Dropdown = ({ options, defaultLabel, ...selectProps }) => (_jsxs(Select, { ...selectProps, children: [_jsx("option", { hidden: true, disabled: true, value: "", children: defaultLabel ? defaultLabel : "-" }), options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value)))] }));
|
|
4
5
|
export default Dropdown;
|
|
5
6
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../core/molecules/Dropdown.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../core/molecules/Dropdown.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAe,MAAM,gBAAgB,CAAC;AAU7C,MAAM,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,WAAW,EAAiB,EAAE,EAAE,CAAC,CAC7E,MAAC,MAAM,OAAK,WAAW,aACrB,iBAAQ,MAAM,QAAC,QAAQ,QAAC,KAAK,EAAC,EAAE,YAC7B,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,GAC3B,EAER,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,iBAA2B,KAAK,EAAE,MAAM,CAAC,KAAK,YAC3C,MAAM,CAAC,KAAK,IADF,MAAM,CAAC,KAAK,CAEhB,CACV,CAAC,IACK,CACV,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import type { DetailedHTMLProps, SelectHTMLAttributes } from \"react\";\nimport { Select } from \"../atoms\";\nimport { type Option } from \"../foundations\";\n\nexport type DropdownProps = {\n options: Option[];\n defaultLabel?: string;\n} & DetailedHTMLProps<\n SelectHTMLAttributes<HTMLSelectElement>,\n HTMLSelectElement\n>;\n\nconst Dropdown = ({ options, defaultLabel, ...selectProps }: DropdownProps) => (\n <Select {...selectProps}>\n <option hidden disabled value=\"\">\n {defaultLabel ? defaultLabel : \"-\"}\n </option>\n\n {options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </Select>\n);\n\nexport default Dropdown;\n"]}
|
|
@@ -7,7 +7,7 @@ type ModalProps = {
|
|
|
7
7
|
height?: string;
|
|
8
8
|
onClickCancel: MouseEventHandler<HTMLButtonElement>;
|
|
9
9
|
};
|
|
10
|
-
declare const Modal: ({ header, content, footer, width, height, onClickCancel, }: ModalProps) => import("react
|
|
10
|
+
declare const Modal: ({ header, content, footer, width, height, onClickCancel, }: ModalProps) => import("react").ReactPortal;
|
|
11
11
|
export default Modal;
|
|
12
12
|
export declare const useModal: () => {
|
|
13
13
|
showModal: boolean;
|
package/core/molecules/Modal.js
CHANGED
|
@@ -3,7 +3,8 @@ import { useCallback, useState, } from "react";
|
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import { Button } from "../atoms";
|
|
5
5
|
import { Colors, Responsive } from "../foundations";
|
|
6
|
-
|
|
6
|
+
import { createPortal } from "react-dom";
|
|
7
|
+
const Modal = ({ header, content, footer, width, height, onClickCancel, }) => createPortal(_jsx(Overlay, { children: _jsxs(ModalWindow, { "$width": width, "$height": height, children: [header ? _jsx(ModalHeader, { children: header }) : _jsx(_Fragment, {}), _jsx(ModalBody, { children: content }), _jsxs(ModalFooter, { children: [_jsx(CancelButton, { onClick: onClickCancel }), footer ? footer : _jsx(_Fragment, {})] })] }) }), document.body);
|
|
7
8
|
export default Modal;
|
|
8
9
|
export const useModal = () => {
|
|
9
10
|
const [showModal, setShowModal] = useState(false);
|
|
@@ -30,7 +31,7 @@ export const useModal = () => {
|
|
|
30
31
|
const Overlay = styled.div `
|
|
31
32
|
background-color: ${Colors.semantic.overlay};
|
|
32
33
|
|
|
33
|
-
z-index:
|
|
34
|
+
z-index: 9999;
|
|
34
35
|
position: fixed;
|
|
35
36
|
top: 0px;
|
|
36
37
|
left: 0px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../core/molecules/Modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,WAAW,EACX,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAA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,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,EACrC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,GAClC,CACH,CAAC","sourcesContent":["import {\n type JSX,\n type MouseEventHandler,\n type ReactNode,\n useCallback,\n useState,\n} from \"react\";\nimport styled from \"styled-components\";\nimport { Button } from \"../atoms\";\nimport { Colors, Responsive } from \"../foundations\";\nimport { createPortal } from \"react-dom\";\n\ntype ModalProps = {\n header?: ReactNode;\n content: JSX.Element;\n footer?: ReactNode;\n width?: string;\n height?: string;\n onClickCancel: MouseEventHandler<HTMLButtonElement>;\n};\n\nconst Modal = ({\n header,\n content,\n footer,\n width,\n height,\n onClickCancel,\n}: ModalProps) =>\n createPortal(\n <Overlay>\n <ModalWindow $width={width} $height={height}>\n {header ? <ModalHeader>{header}</ModalHeader> : <></>}\n\n <ModalBody>{content}</ModalBody>\n\n <ModalFooter>\n <CancelButton onClick={onClickCancel} />\n {footer ? footer : <></>}\n </ModalFooter>\n </ModalWindow>\n </Overlay>,\n document.body,\n );\n\nexport default Modal;\n\nexport const useModal = () => {\n const [showModal, setShowModal] = useState(false);\n\n const lockScroll = useCallback(() => {\n document.body.style.overflow = \"hidden\";\n }, []);\n\n const unlockScroll = useCallback(() => {\n document.body.style.overflow = \"initial\";\n }, []);\n\n const openModal = () => {\n setShowModal(true);\n lockScroll();\n };\n\n const closeModal = () => {\n setShowModal(false);\n unlockScroll();\n };\n\n return {\n showModal,\n openModal,\n closeModal,\n };\n};\n\nconst Overlay = styled.div`\n background-color: ${Colors.semantic.overlay};\n\n z-index: 9999;\n position: fixed;\n top: 0px;\n left: 0px;\n\n width: 100vw;\n height: 100vh;\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n`;\n\nconst ModalWindow = styled.div<{ $width?: string; $height?: string }>`\n display: flex;\n flex-direction: column;\n\n background-color: ${Colors.base.white};\n\n min-height: 100px;\n max-height: 100vh;\n\n @media (width < ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n position: fixed;\n bottom: 0px;\n left: 0px;\n\n width: 100%;\n height: 100%;\n\n border-radius: 0px;\n }\n\n @media (width >= ${Responsive.WIDTH_BREAKPOINTS.laptop}) {\n position: static;\n bottom: auto;\n left: auto;\n\n width: ${({ $width }) => $width};\n height: ${({ $height }) => $height};\n\n border-radius: 6px;\n }\n`;\n\nconst ModalHeader = styled.div`\n font-weight: 500;\n font-size: 18px;\n\n padding: 12px 24px;\n border-bottom: 1px solid ${Colors.neutral.grey3};\n`;\n\nconst ModalBody = styled.div`\n display: flex;\n flex-direction: column;\n\n height: 100%;\n padding-top: 24px;\n overflow-y: auto;\n\n > * {\n width: 100%;\n height: 100%;\n min-height: 100px;\n\n padding: 2px 24px;\n border: none;\n }\n`;\n\nconst ModalFooter = styled.div`\n display: flex;\n justify-content: space-between;\n gap: 12px;\n\n padding: 24px;\n`;\n\ntype CancelButtonProps = {\n onClick: MouseEventHandler<HTMLButtonElement>;\n};\n\nconst CancelButton = ({ onClick }: CancelButtonProps) => (\n <Button\n text=\"Cancel\"\n onClick={onClick}\n backgroundColor={Colors.neutral.grey3}\n color={Colors.typography.blackHigh}\n />\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../core/organisms/GrantMatch/context.tsx"],"names":[],"mappings":"AACA,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-
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../core/organisms/GrantMatch/context.tsx"],"names":[],"mappings":"AACA,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-core/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,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { checkGrantMatchActive } from "@grantbii/ui-
|
|
2
|
+
import { checkGrantMatchActive } from "@grantbii/ui-core/match/validations";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
import { useModal } from "../../molecules";
|
|
@@ -1 +1 @@
|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eAAe,UAAU,CAAC;AAE1B,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOhC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,iBAAsD,EACtD,eAA2B,EACV,EAAE;IACnB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAkB;QAC9D,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE;KACT,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,CAAC,QAAyB,EAAE,EAAE;QACtD,cAAc,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;QAEhC,IAAI,qBAAqB,CAAC,QAAQ,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 type { GrantMatchQuery } from \"@grantbii/ui-
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../core/organisms/GrantMatch/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,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,WAAW,CAAC;AAO9C,MAAM,UAAU,GAAG,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAmB,EAAE,EAAE;IACzE,MAAM,EAAE,SAAS,EAAE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ACH,CAAC,CAAC;IAEF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAC5C,CAAC,CAAC","sourcesContent":["import type { GrantMatchQuery } from \"@grantbii/ui-core/match/models\";\nimport { checkGrantMatchActive } from \"@grantbii/ui-core/match/validations\";\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,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { LogicValue } from "@grantbii/ui-
|
|
2
|
+
import { LogicValue } from "@grantbii/ui-core/grant/enums";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import { RadioButton } from "../atoms";
|
|
5
5
|
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, {}))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YesNoOptions.js","sourceRoot":"","sources":["../../../core/organisms/YesNoOptions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,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-
|
|
1
|
+
{"version":3,"file":"YesNoOptions.js","sourceRoot":"","sources":["../../../core/organisms/YesNoOptions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,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-core/grant/enums\";\nimport type { DetailedHTMLProps, 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grantbii/design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Grantbii's Design System",
|
|
5
5
|
"homepage": "https://design.grantbii.com",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"build-storybook": "storybook build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@grantbii/ui-
|
|
22
|
+
"@grantbii/ui-core": "1.0.0",
|
|
23
23
|
"@phosphor-icons/react": "^2.1.10",
|
|
24
24
|
"country-flag-icons": "^1.5.19",
|
|
25
25
|
"next": "^15.5.2",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
"@chromatic-com/storybook": "^4.1.1",
|
|
34
34
|
"@eslint/js": "^9.34.0",
|
|
35
35
|
"@next/eslint-plugin-next": "^15.5.2",
|
|
36
|
-
"@storybook/addon-a11y": "^9.1.
|
|
37
|
-
"@storybook/addon-docs": "^9.1.
|
|
38
|
-
"@storybook/addon-onboarding": "^9.1.
|
|
39
|
-
"@storybook/addon-vitest": "^9.1.
|
|
40
|
-
"@storybook/nextjs-vite": "^9.1.
|
|
41
|
-
"@types/node": "^
|
|
36
|
+
"@storybook/addon-a11y": "^9.1.4",
|
|
37
|
+
"@storybook/addon-docs": "^9.1.4",
|
|
38
|
+
"@storybook/addon-onboarding": "^9.1.4",
|
|
39
|
+
"@storybook/addon-vitest": "^9.1.4",
|
|
40
|
+
"@storybook/nextjs-vite": "^9.1.4",
|
|
41
|
+
"@types/node": "^22.18.0",
|
|
42
42
|
"@types/react": "^19.1.12",
|
|
43
43
|
"@types/react-dom": "^19.1.9",
|
|
44
44
|
"@vitest/browser": "^3.2.4",
|
|
45
45
|
"@vitest/coverage-v8": "^3.2.4",
|
|
46
46
|
"eslint": "^9.34.0",
|
|
47
47
|
"eslint-config-next": "15.5.2",
|
|
48
|
-
"eslint-plugin-storybook": "^9.1.
|
|
48
|
+
"eslint-plugin-storybook": "^9.1.4",
|
|
49
49
|
"husky": "^9.1.7",
|
|
50
50
|
"lint-staged": "^16.1.6",
|
|
51
51
|
"playwright": "^1.55.0",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Input } from "@/.";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
3
|
+
declare const meta: Meta<typeof Input>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const BasicInput: Story;
|
|
7
|
+
export declare const NumericalField: Story;
|
|
8
|
+
export declare const EmailField: Story;
|
|
9
|
+
export declare const MinimumLength: Story;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Input } from "@/.";
|
|
2
|
+
const meta = {
|
|
3
|
+
title: "Atoms/Input",
|
|
4
|
+
component: Input,
|
|
5
|
+
tags: ["autodocs"],
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered",
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const BasicInput = {
|
|
12
|
+
args: { placeholder: "Type here" },
|
|
13
|
+
};
|
|
14
|
+
export const NumericalField = {
|
|
15
|
+
args: { placeholder: "Numbers only", type: "number" },
|
|
16
|
+
};
|
|
17
|
+
export const EmailField = {
|
|
18
|
+
args: { placeholder: "Enter your email", type: "email" },
|
|
19
|
+
};
|
|
20
|
+
export const MinimumLength = {
|
|
21
|
+
args: { placeholder: "At least 10 characters", minLength: 10 },
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=Input.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.stories.js","sourceRoot":"","sources":["../../../stories/atoms/Input.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAG5B,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,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAU;IACnC,IAAI,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE;CACtD,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,OAAO,EAAE;CACzD,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAU;IAClC,IAAI,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,SAAS,EAAE,EAAE,EAAE;CAC/D,CAAC","sourcesContent":["import { Input } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\n\nconst meta: Meta<typeof Input> = {\n title: \"Atoms/Input\",\n component: Input,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const BasicInput: Story = {\n args: { placeholder: \"Type here\" },\n};\n\nexport const NumericalField: Story = {\n args: { placeholder: \"Numbers only\", type: \"number\" },\n};\n\nexport const EmailField: Story = {\n args: { placeholder: \"Enter your email\", type: \"email\" },\n};\n\nexport const MinimumLength: Story = {\n args: { placeholder: \"At least 10 characters\", minLength: 10 },\n};\n"]}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Dropdown } from "@/.";
|
|
3
|
-
import { Need
|
|
2
|
+
import { Dropdown, mapEnumToOptions } from "@/.";
|
|
3
|
+
import { Need } from "@grantbii/ui-core/filter/enums";
|
|
4
|
+
import { parseEnum } from "@grantbii/ui-core/shared/enums";
|
|
4
5
|
import { useState } from "react";
|
|
5
6
|
const DropdownExample = ({ controlled }) => {
|
|
6
7
|
const [selectedNeed, setSelectedNeed] = useState(Need.UNKNOWN);
|
|
7
8
|
const controlledProps = {
|
|
8
|
-
|
|
9
|
-
defaultLabel,
|
|
9
|
+
...baseProps,
|
|
10
10
|
value: selectedNeed === Need.UNKNOWN ? "" : selectedNeed,
|
|
11
|
-
onChange: (event) => setSelectedNeed(
|
|
11
|
+
onChange: (event) => setSelectedNeed(parseEnum(event.target.value, Need)),
|
|
12
12
|
};
|
|
13
13
|
return _jsx(Dropdown, { ...(controlled ? controlledProps : uncontrolledProps) });
|
|
14
14
|
};
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const baseProps = {
|
|
16
|
+
options: mapEnumToOptions(Need),
|
|
17
|
+
defaultLabel: "Select your grant need",
|
|
18
|
+
};
|
|
19
19
|
const uncontrolledProps = {
|
|
20
|
-
|
|
21
|
-
defaultLabel,
|
|
20
|
+
...baseProps,
|
|
22
21
|
defaultValue: "",
|
|
23
22
|
};
|
|
24
23
|
const meta = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.stories.js","sourceRoot":"","sources":["../../../stories/molecules/Dropdown.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"Dropdown.stories.js","sourceRoot":"","sources":["../../../stories/molecules/Dropdown.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAsB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,MAAM,eAAe,GAAG,CAAC,EAAE,UAAU,EAAgB,EAAE,EAAE;IACvD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAE/D,MAAM,eAAe,GAAkB;QACrC,GAAG,SAAS;QACZ,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY;QACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KAC1E,CAAC;IAEF,OAAO,KAAC,QAAQ,OAAK,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAI,CAAC;AAC9E,CAAC,CAAC;AAEF,MAAM,SAAS,GAAkB;IAC/B,OAAO,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAC/B,YAAY,EAAE,wBAAwB;CACvC,CAAC;AAEF,MAAM,iBAAiB,GAAkB;IACvC,GAAG,SAAS;IACZ,YAAY,EAAE,EAAE;CACjB,CAAC;AAEF,MAAM,IAAI,GAAiC;IACzC,KAAK,EAAE,oBAAoB;IAC3B,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,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE,IAAI;KACjB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE;QACJ,UAAU,EAAE,KAAK;KAClB;CACF,CAAC","sourcesContent":["import { Dropdown, mapEnumToOptions, type DropdownProps } from \"@/.\";\nimport { Need } from \"@grantbii/ui-core/filter/enums\";\nimport { parseEnum } from \"@grantbii/ui-core/shared/enums\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\nimport { useState } from \"react\";\n\ntype ExampleProps = {\n controlled: boolean;\n};\n\nconst DropdownExample = ({ controlled }: ExampleProps) => {\n const [selectedNeed, setSelectedNeed] = useState(Need.UNKNOWN);\n\n const controlledProps: DropdownProps = {\n ...baseProps,\n value: selectedNeed === Need.UNKNOWN ? \"\" : selectedNeed,\n onChange: (event) => setSelectedNeed(parseEnum(event.target.value, Need)),\n };\n\n return <Dropdown {...(controlled ? controlledProps : uncontrolledProps)} />;\n};\n\nconst baseProps: DropdownProps = {\n options: mapEnumToOptions(Need),\n defaultLabel: \"Select your grant need\",\n};\n\nconst uncontrolledProps: DropdownProps = {\n ...baseProps,\n defaultValue: \"\",\n};\n\nconst meta: Meta<typeof DropdownExample> = {\n title: \"Molecules/Dropdown\",\n component: DropdownExample,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Controlled: Story = {\n args: {\n controlled: true,\n },\n};\n\nexport const Uncontrolled: Story = {\n args: {\n controlled: false,\n },\n};\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, Modal, useModal } from "@/.";
|
|
3
|
-
import {} from "react";
|
|
4
3
|
const ModalExample = (props) => {
|
|
5
4
|
const { showModal, openModal, closeModal } = useModal();
|
|
6
|
-
return (_jsxs(
|
|
5
|
+
return (_jsxs("div", { children: [_jsx(Button, { text: "Click to open modal", onClick: () => openModal() }), showModal ? (_jsx(Modal, { ...props, onClickCancel: () => closeModal() })) : (_jsx(_Fragment, {}))] }));
|
|
7
6
|
};
|
|
8
7
|
const meta = {
|
|
9
8
|
title: "Molecules/Modal",
|
|
@@ -14,23 +13,23 @@ const meta = {
|
|
|
14
13
|
},
|
|
15
14
|
};
|
|
16
15
|
export default meta;
|
|
17
|
-
const
|
|
16
|
+
const baseArgs = {
|
|
17
|
+
header: "Grantbii",
|
|
18
|
+
width: "600px",
|
|
19
|
+
height: "360px",
|
|
20
|
+
};
|
|
18
21
|
const shortContent = (_jsx("p", { children: "Amplifying Business Grant Impact for SMEs & Scale-ups" }));
|
|
19
|
-
const longContent = (_jsxs("div", { children: [_jsx("p", { children: "Grantbii is an AI-powered grant intelligence and matching platform that helps grant seekers effortlessly find, match, prep & apply for the right business grants - maximizing grant funding success with minimal effort. Our platform connects businesses with a trusted Grant Enabler Network - solution providers, consulting experts, and delivery partners - ensuring that every dollar of grant funding leads to real business transformation impact." }), _jsx("p", { children: "In the future, Grantbii aims to automate the entire grant application lifecycle, from discovery to claims submission and guide you through the application process with minimal effort on your part." }), _jsx("p", { children: "To maximize your chances of grant success, you can expect to leverage on tools to assess your chances of success and offer expert support to ensure your application meets all necessary requirements." })] }));
|
|
20
22
|
export const ShortContent = {
|
|
21
23
|
args: {
|
|
22
|
-
|
|
24
|
+
...baseArgs,
|
|
23
25
|
content: shortContent,
|
|
24
|
-
width: "600px",
|
|
25
|
-
height: "360px",
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
|
+
const longContent = (_jsxs("div", { children: [_jsx("p", { children: "Grantbii is an AI-powered grant intelligence and matching platform that helps grant seekers effortlessly find, match, prep & apply for the right business grants - maximizing grant funding success with minimal effort. Our platform connects businesses with a trusted Grant Enabler Network - solution providers, consulting experts, and delivery partners - ensuring that every dollar of grant funding leads to real business transformation impact." }), _jsx("p", { children: "In the future, Grantbii aims to automate the entire grant application lifecycle, from discovery to claims submission and guide you through the application process with minimal effort on your part." }), _jsx("p", { children: "To maximize your chances of grant success, you can expect to leverage on tools to assess your chances of success and offer expert support to ensure your application meets all necessary requirements." })] }));
|
|
28
29
|
export const LongContent = {
|
|
29
30
|
args: {
|
|
30
|
-
|
|
31
|
+
...baseArgs,
|
|
31
32
|
content: longContent,
|
|
32
|
-
width: "600px",
|
|
33
|
-
height: "360px",
|
|
34
33
|
},
|
|
35
34
|
};
|
|
36
35
|
//# sourceMappingURL=Modal.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.stories.js","sourceRoot":"","sources":["../../../stories/molecules/Modal.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.stories.js","sourceRoot":"","sources":["../../../stories/molecules/Modal.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAY9C,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;IAChD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,CAAC;IAExD,OAAO,CACL,0BACE,KAAC,MAAM,IAAC,IAAI,EAAC,qBAAqB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,GAAI,EAEhE,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,KAAK,OAAK,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,GAAI,CACxD,CAAC,CAAC,CAAC,CACF,mBAAK,CACN,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,IAAI,GAA8B;IACtC,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,YAAY;IACvB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;CAChB,CAAC;AAEF,MAAM,YAAY,GAAG,CACnB,gFAA4D,CAC7D,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,OAAO,EAAE,YAAY;KACtB;CACF,CAAC;AAEF,MAAM,WAAW,GAAG,CAClB,0BACE,qdAQI,EAEJ,+NAII,EAEJ,iOAII,IACA,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,EAAE;QACJ,GAAG,QAAQ;QACX,OAAO,EAAE,WAAW;KACrB;CACF,CAAC","sourcesContent":["import { Button, Modal, useModal } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\nimport type { JSX, ReactNode } from \"react\";\n\ntype ModalExampleProps = {\n header?: ReactNode;\n content: JSX.Element;\n footer?: ReactNode;\n width?: string;\n height?: string;\n};\n\nconst ModalExample = (props: ModalExampleProps) => {\n const { showModal, openModal, closeModal } = useModal();\n\n return (\n <div>\n <Button text=\"Click to open modal\" onClick={() => openModal()} />\n\n {showModal ? (\n <Modal {...props} onClickCancel={() => closeModal()} />\n ) : (\n <></>\n )}\n </div>\n );\n};\n\nconst meta: Meta<typeof ModalExample> = {\n title: \"Molecules/Modal\",\n component: ModalExample,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nconst baseArgs = {\n header: \"Grantbii\",\n width: \"600px\",\n height: \"360px\",\n};\n\nconst shortContent = (\n <p>Amplifying Business Grant Impact for SMEs & Scale-ups</p>\n);\n\nexport const ShortContent: Story = {\n args: {\n ...baseArgs,\n content: shortContent,\n },\n};\n\nconst longContent = (\n <div>\n <p>\n Grantbii is an AI-powered grant intelligence and matching platform that\n helps grant seekers effortlessly find, match, prep & apply for the right\n business grants - maximizing grant funding success with minimal effort.\n Our platform connects businesses with a trusted Grant Enabler Network -\n solution providers, consulting experts, and delivery partners - ensuring\n that every dollar of grant funding leads to real business transformation\n impact.\n </p>\n\n <p>\n In the future, Grantbii aims to automate the entire grant application\n lifecycle, from discovery to claims submission and guide you through the\n application process with minimal effort on your part.\n </p>\n\n <p>\n To maximize your chances of grant success, you can expect to leverage on\n tools to assess your chances of success and offer expert support to ensure\n your application meets all necessary requirements.\n </p>\n </div>\n);\n\nexport const LongContent: Story = {\n args: {\n ...baseArgs,\n content: longContent,\n },\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { RadioButtons } from "@/.";
|
|
3
|
-
import { Location } from "@grantbii/ui-
|
|
3
|
+
import { Location } from "@grantbii/ui-core/grant/enums";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
const RadioButtonsExample = ({ controlled }) => {
|
|
6
6
|
const [selectedLocation, setSelectedLocation] = useState("");
|
|
@@ -1 +1 @@
|
|
|
1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AAQ;QACf,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,QAAQ,GAAG,CAAC;KAC/C,CAAC,CAAC;CACN,CAAC;AAEF,MAAM,IAAI,GAAqC;IAC7C,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,mBAAmB;IAC9B,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;QACJ,UAAU,EAAE,KAAK;KAClB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE,IAAI;KACjB;CACF,CAAC","sourcesContent":["import { RadioButtons } from \"@/.\";\nimport { Location } from \"@grantbii/ui-
|
|
1
|
+
{"version":3,"file":"RadioButtons.stories.js","sourceRoot":"","sources":["../../../stories/molecules/RadioButtons.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,MAAM,mBAAmB,GAAG,CAAC,EAAE,UAAU,EAAgB,EAAE,EAAE;IAC3D,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE7D,MAAM,eAAe,GAAG;QACtB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;aAC7B,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,QAAQ,CAAC,OAAO,CAAC;aACnD,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YAClB,KAAK,EAAE,QAAQ;YACf,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,gBAAgB,KAAK,QAAQ;YACtC,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAC;SAC7C,CAAC,CAAC;KACN,CAAC;IAEF,OAAO,CACL,KAAC,YAAY,OAAK,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAI,CACzE,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG;IACxB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;SAC7B,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,QAAQ,CAAC,OAAO,CAAC;SACnD,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAClB,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,QAAQ,GAAG,CAAC;KAC/C,CAAC,CAAC;CACN,CAAC;AAEF,MAAM,IAAI,GAAqC;IAC7C,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,mBAAmB;IAC9B,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;QACJ,UAAU,EAAE,KAAK;KAClB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE,IAAI;KACjB;CACF,CAAC","sourcesContent":["import { RadioButtons } from \"@/.\";\nimport { Location } from \"@grantbii/ui-core/grant/enums\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\nimport { useState } from \"react\";\n\ntype ExampleProps = {\n controlled: boolean;\n};\n\nconst RadioButtonsExample = ({ controlled }: ExampleProps) => {\n const [selectedLocation, setSelectedLocation] = useState(\"\");\n\n const controlledProps = {\n options: Object.values(Location)\n .filter((location) => location !== Location.UNKNOWN)\n .map((location) => ({\n label: location,\n value: location,\n checked: selectedLocation === location,\n onClick: () => setSelectedLocation(location),\n })),\n };\n\n return (\n <RadioButtons {...(controlled ? controlledProps : uncontrolledProps)} />\n );\n};\n\nconst uncontrolledProps = {\n name: \"location\",\n options: Object.values(Location)\n .filter((location) => location !== Location.UNKNOWN)\n .map((location) => ({\n label: location,\n value: location,\n onChange: () => alert(`Selected ${location}!`),\n })),\n};\n\nconst meta: Meta<typeof RadioButtonsExample> = {\n title: \"Molecules/Radio Buttons\",\n component: RadioButtonsExample,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"centered\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Uncontrolled: Story = {\n args: {\n controlled: false,\n },\n};\n\nexport const Controlled: Story = {\n args: {\n controlled: true,\n },\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { GrantMatch } from "@/.";
|
|
3
3
|
import { useGrantMatchActiveQuery } from "@/core/organisms/GrantMatch";
|
|
4
|
-
import {} from "@grantbii/ui-
|
|
4
|
+
import {} from "@grantbii/ui-core/match/models";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import styled from "styled-components";
|
|
7
7
|
const GrantMatchExample = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GrantMatch.stories.js","sourceRoot":"","sources":["../../../stories/organisms/GrantMatch.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAwB,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EA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ACT,CAAC","sourcesContent":["import { GrantMatch } from \"@/.\";\nimport { useGrantMatchActiveQuery } from \"@/core/organisms/GrantMatch\";\nimport { type GrantMatchQuery } from \"@grantbii/ui-
|
|
1
|
+
{"version":3,"file":"GrantMatch.stories.js","sourceRoot":"","sources":["../../../stories/organisms/GrantMatch.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAwB,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC7B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IAEtD,MAAM,iBAAiB,GAAG,CAAC,QAAyB,EAAE,EAAE;QACtD,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrE,MAAM,cAAc,GAAG,UAAU,SAAS,eAAe,QAAQ,CAAC,IAAI,GAAG,CAAC;QAE1E,SAAS,CAAC,+BAA+B,cAAc,EAAE,CAAC,CAAC;QAC3D,UAAU,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,qBAAqB,cAAc,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAEzD,MAAM,oBAAoB,GAAG,wBAAwB,CACnD,iBAAiB,EACjB,eAAe,CAChB,CAAC;IAEF,OAAO,CACL,MAAC,SAAS,eACR,KAAC,UAAU,OAAK,oBAAoB,GAAI,EACxC,oCAAY,MAAM,IAAK,IACb,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAM3B,CAAC;AAEF,MAAM,IAAI,GAAmC;IAC3C,KAAK,EAAE,uBAAuB;IAC9B,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,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC","sourcesContent":["import { GrantMatch } from \"@/.\";\nimport { useGrantMatchActiveQuery } from \"@/core/organisms/GrantMatch\";\nimport { type GrantMatchQuery } from \"@grantbii/ui-core/match/models\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\nimport { useState } from \"react\";\nimport styled from \"styled-components\";\n\nconst GrantMatchExample = () => {\n const [status, setStatus] = useState(\"pending query\");\n\n const performGrantMatch = (newQuery: GrantMatchQuery) => {\n const fileNames = newQuery.files.map((file) => file.name).join(\", \");\n const printableQuery = `files [${fileNames}] and text [${newQuery.text}]`;\n\n setStatus(`trying to find grants using ${printableQuery}`);\n setTimeout(() => setStatus(`found grants with ${printableQuery}`), 1000);\n };\n\n const resetGrantMatch = () => setStatus(\"pending query\");\n\n const grantMatchQueryProps = useGrantMatchActiveQuery(\n performGrantMatch,\n resetGrantMatch,\n );\n\n return (\n <Container>\n <GrantMatch {...grantMatchQueryProps} />\n <p>Status: {status}</p>\n </Container>\n );\n};\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n padding: 16px;\n`;\n\nconst meta: Meta<typeof GrantMatchExample> = {\n title: \"Organisms/Grant Match\",\n component: GrantMatchExample,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"fullscreen\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Example: Story = {\n args: {},\n};\n"]}
|