@grantbii/design-system 1.25.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/core/archive/RadioButtons.d.ts +1 -1
  2. package/core/archive/TallyModal.d.ts +1 -1
  3. package/core/archive/YesNoOptions.d.ts +1 -1
  4. package/core/atoms/BrandLogo.d.ts +1 -1
  5. package/core/integrations/registry.d.ts +1 -1
  6. package/core/molecules/Badge.d.ts +2 -2
  7. package/core/molecules/Button.d.ts +2 -2
  8. package/core/molecules/Checkbox.d.ts +1 -1
  9. package/core/molecules/Input.d.ts +1 -1
  10. package/core/molecules/PageLoader.d.ts +1 -1
  11. package/core/molecules/RadioButton.d.ts +1 -1
  12. package/core/organisms/Dropdown.d.ts +1 -1
  13. package/core/organisms/FileDrop.d.ts +1 -1
  14. package/core/organisms/SearchBar.d.ts +8 -7
  15. package/core/organisms/SearchBar.js +17 -28
  16. package/core/organisms/SearchBar.js.map +1 -1
  17. package/core/templates/ErrorFallback.d.ts +1 -1
  18. package/core/templates/GrantMatch/ActiveQueryFiles.d.ts +1 -1
  19. package/core/templates/GrantMatch/GrantMatchModal.d.ts +1 -1
  20. package/core/templates/GrantMatch/OpenModalButton.d.ts +1 -1
  21. package/core/templates/GrantMatch/index.d.ts +1 -1
  22. package/core/templates/GrantMatch/index.js +16 -8
  23. package/core/templates/GrantMatch/index.js.map +1 -1
  24. package/package.json +15 -15
  25. package/stories/archive/RadioButtons.stories.d.ts +1 -1
  26. package/stories/archive/TallyModal.stories.d.ts +1 -1
  27. package/stories/organisms/Dropdown.stories.d.ts +1 -1
  28. package/stories/organisms/FileDrop.stories.d.ts +1 -1
  29. package/stories/organisms/Modal.stories.d.ts +1 -1
  30. package/stories/organisms/SearchBar.stories.js +6 -8
  31. package/stories/organisms/SearchBar.stories.js.map +1 -1
  32. package/stories/templates/GrantMatch.stories.d.ts +1 -1
  33. package/tsconfig.tsbuildinfo +1 -1
@@ -5,5 +5,5 @@ type RadioButtonProps = {
5
5
  name?: string;
6
6
  options: RadioOption[];
7
7
  };
8
- declare const RadioButtons: ({ name, options }: RadioButtonProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const RadioButtons: ({ name, options }: RadioButtonProps) => import("react").JSX.Element;
9
9
  export default RadioButtons;
@@ -5,5 +5,5 @@ type TallyModalProps = {
5
5
  prefilledFieldsQueryParams?: string;
6
6
  onClickClose: MouseEventHandler<HTMLButtonElement>;
7
7
  };
8
- declare const TallyModal: ({ tallyId, prefilledFieldsQueryParams, ...modalProps }: TallyModalProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const TallyModal: ({ tallyId, prefilledFieldsQueryParams, ...modalProps }: TallyModalProps) => import("react").JSX.Element;
9
9
  export default TallyModal;
@@ -5,5 +5,5 @@ type YesNoOptionsProps = {
5
5
  noProps: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
6
6
  unsureProps?: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
7
7
  };
8
- declare const YesNoOptions: ({ name, yesProps, noProps, unsureProps, }: YesNoOptionsProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const YesNoOptions: ({ name, yesProps, noProps, unsureProps, }: YesNoOptionsProps) => import("react").JSX.Element;
9
9
  export default YesNoOptions;
@@ -9,5 +9,5 @@ type BrandLogoProps = {
9
9
  borderRadius?: string;
10
10
  alt?: string;
11
11
  };
12
- declare const BrandLogo: ({ colorVariant, isLogomark, smallScreenWidth, smallScreenHeight, bigScreenWidth, bigScreenHeight, borderRadius, alt, }: BrandLogoProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const BrandLogo: ({ colorVariant, isLogomark, smallScreenWidth, smallScreenHeight, bigScreenWidth, bigScreenHeight, borderRadius, alt, }: BrandLogoProps) => import("react").JSX.Element;
13
13
  export default BrandLogo;
@@ -1,3 +1,3 @@
1
1
  import { type PropsWithChildren } from "react";
2
- declare const StyledComponentsRegistry: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
2
+ declare const StyledComponentsRegistry: ({ children }: PropsWithChildren) => import("react").JSX.Element;
3
3
  export default StyledComponentsRegistry;
@@ -11,7 +11,7 @@ type CustomBadgeProps = {
11
11
  type BadgeProps = {
12
12
  variant?: BadgeVariant;
13
13
  } & CustomBadgeProps;
14
- declare const Badge: ({ variant, ...restOfProps }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
14
+ declare const Badge: ({ variant, ...restOfProps }: BadgeProps) => import("react").JSX.Element;
15
15
  export default Badge;
16
16
  type VariantStyleProps = {
17
17
  color: Color.DesignColor;
@@ -19,4 +19,4 @@ type VariantStyleProps = {
19
19
  hoverBackgroundColor?: Color.DesignColor;
20
20
  };
21
21
  type RawBadgeProps = CustomBadgeProps & VariantStyleProps;
22
- export declare const RawBadge: ({ label, Icon, onClick, onClickX, labelWidthPixels, defaultBackgroundColor, hoverBackgroundColor, color, }: RawBadgeProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const RawBadge: ({ label, Icon, onClick, onClickX, labelWidthPixels, defaultBackgroundColor, hoverBackgroundColor, color, }: RawBadgeProps) => import("react").JSX.Element;
@@ -16,7 +16,7 @@ type ButtonProps = {
16
16
  variant?: ButtonVariant;
17
17
  size?: ButtonSize;
18
18
  } & CustomButtonProps;
19
- declare const Button: ({ variant, size, ...restOfProps }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
19
+ declare const Button: ({ variant, size, ...restOfProps }: ButtonProps) => import("react").JSX.Element;
20
20
  export default Button;
21
21
  type VariantStyleProps = {
22
22
  defaultColor: Color.DesignColor;
@@ -35,4 +35,4 @@ type SizeStyleProps = {
35
35
  fontSize?: string;
36
36
  };
37
37
  type RawButtonProps = CustomButtonProps & VariantStyleProps & SizeStyleProps;
38
- export declare const RawButton: ({ Icon, iconRight, label, href, target, disabled, type, width, height, padding, fontSize, textDecoration, defaultColor, hoverColor, disabledColor, defaultBackgroundColor, hoverBackgroundColor, disabledBackgroundColor, borderColor, ...restOfProps }: RawButtonProps) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const RawButton: ({ Icon, iconRight, label, href, target, disabled, type, width, height, padding, fontSize, textDecoration, defaultColor, hoverColor, disabledColor, defaultBackgroundColor, hoverBackgroundColor, disabledBackgroundColor, borderColor, ...restOfProps }: RawButtonProps) => import("react").JSX.Element;
@@ -3,5 +3,5 @@ type CheckboxProps = {
3
3
  label: ReactNode;
4
4
  labelBefore?: boolean;
5
5
  } & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
6
- declare const Checkbox: ({ id, label, labelBefore, ...checkboxProps }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
6
+ declare const Checkbox: ({ id, label, labelBefore, ...checkboxProps }: CheckboxProps) => import("react").JSX.Element;
7
7
  export default Checkbox;
@@ -5,5 +5,5 @@ type InputProps = {
5
5
  datalistId?: string;
6
6
  datalistOptions?: Option[];
7
7
  } & InputValidationProps & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
8
- declare const Input: ({ datalistOptions, datalistId, ...inputProps }: InputProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const Input: ({ datalistOptions, datalistId, ...inputProps }: InputProps) => import("react").JSX.Element;
9
9
  export default Input;
@@ -7,5 +7,5 @@ type PageLoaderProps = {
7
7
  /**
8
8
  * The animation to show when loading the whole page
9
9
  */
10
- declare const PageLoader: ({ loadingText, tip, pacman, color, size, ...restOfProps }: PageLoaderProps) => import("react/jsx-runtime").JSX.Element;
10
+ declare const PageLoader: ({ loadingText, tip, pacman, color, size, ...restOfProps }: PageLoaderProps) => import("react").JSX.Element;
11
11
  export default PageLoader;
@@ -1,5 +1,5 @@
1
1
  import type { DetailedHTMLProps, InputHTMLAttributes } from "react";
2
2
  import type { Option } from "../types";
3
3
  type RadioButtonProps = Option & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
4
- declare const RadioButton: ({ label, value, id, ...radioButtonProps }: RadioButtonProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const RadioButton: ({ label, value, id, ...radioButtonProps }: RadioButtonProps) => import("react").JSX.Element;
5
5
  export default RadioButton;
@@ -5,5 +5,5 @@ export type DropdownProps = {
5
5
  options: DropdownOption[];
6
6
  defaultLabel?: string;
7
7
  } & DetailedHTMLProps<SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
8
- declare const Dropdown: ({ options, defaultLabel, ...selectProps }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const Dropdown: ({ options, defaultLabel, ...selectProps }: DropdownProps) => import("react").JSX.Element;
9
9
  export default Dropdown;
@@ -6,7 +6,7 @@ type FileDropzoneProps = {
6
6
  maxFiles?: number;
7
7
  maxSizeMB?: number;
8
8
  };
9
- declare const FileDrop: ({ uploadedFiles, uploadFiles, removeFile, errorMessage, maxFiles, maxSizeMB, }: FileDropzoneProps) => import("react/jsx-runtime").JSX.Element;
9
+ declare const FileDrop: ({ uploadedFiles, uploadFiles, removeFile, errorMessage, maxFiles, maxSizeMB, }: FileDropzoneProps) => import("react").JSX.Element;
10
10
  export default FileDrop;
11
11
  export declare const useFileDrop: (initialFiles?: File[], maxFiles?: number, maxSizeMB?: number) => {
12
12
  files: File[];
@@ -1,14 +1,15 @@
1
- import type { GrantMatchQuery } from "@grantbii/ui-core/match/entities";
1
+ import type { ChangeEventHandler, MouseEventHandler } from "react";
2
2
  type SearchBarProps = {
3
- activeQuery: GrantMatchQuery;
4
- updateActiveQuery: (query: GrantMatchQuery) => void;
5
3
  queryText: string;
6
- updateQueryText: (newText: string) => void;
7
- onSearch?: () => void;
4
+ onChangeQueryText: ChangeEventHandler<HTMLInputElement, HTMLInputElement>;
5
+ onClickReset: MouseEventHandler<HTMLButtonElement>;
6
+ onClickSearch: MouseEventHandler<HTMLButtonElement>;
7
+ handlePressEnter: () => void;
8
+ autoFocus?: boolean;
9
+ disableSearch?: boolean;
8
10
  placeholder?: string;
9
- runSearchOnReset?: boolean;
10
11
  size?: SearchBarSize;
11
12
  };
12
13
  type SearchBarSize = "small" | "medium";
13
- declare const SearchBar: ({ activeQuery, updateActiveQuery, queryText, updateQueryText, onSearch, placeholder, runSearchOnReset, size, }: SearchBarProps) => import("react/jsx-runtime").JSX.Element;
14
+ declare const SearchBar: ({ queryText, onChangeQueryText, onClickSearch, onClickReset, handlePressEnter, autoFocus, disableSearch, placeholder, size, }: SearchBarProps) => import("react").JSX.Element;
14
15
  export default SearchBar;
@@ -1,26 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
- import { Color, Responsive, SystemIcon } from "../atoms";
3
+ import { Color, Responsive, Spacing, SystemIcon } from "../atoms";
4
4
  import { Button } from "../molecules";
5
- const DEFAULT_PLACEHOLDER = "Search grant or describe your project";
6
- const SearchBar = ({ activeQuery, updateActiveQuery, queryText, updateQueryText, onSearch, placeholder = DEFAULT_PLACEHOLDER, runSearchOnReset = false, size = "medium", }) => {
7
- const { height, fontSize } = SIZE_PROPS_MAP[size];
8
- const resetSearch = () => {
9
- updateQueryText("");
10
- if (runSearchOnReset) {
11
- updateActiveQuery({ files: activeQuery.files, text: "" });
12
- }
13
- };
14
- const executeSearch = () => {
15
- onSearch?.();
16
- updateActiveQuery({ files: activeQuery.files, text: queryText });
17
- };
18
- return (_jsxs(BaseSearchBar, { children: [_jsxs(SearchArea, { "$height": height, "$hasQueryText": queryText !== "", children: [_jsx(TextInput, { queryText: queryText, updateQueryText: updateQueryText, executeSearch: executeSearch, placeholder: placeholder, fontSize: fontSize }), queryText === "" ? (_jsx(ResetButtonPlaceholder, {})) : (_jsx(ResetButton, { resetSearch: resetSearch }))] }), _jsx(Button, { Icon: SystemIcon.MagnifyingGlassIcon, onClick: executeSearch, size: size })] }));
5
+ const SearchBar = ({ queryText, onChangeQueryText, onClickSearch, onClickReset, handlePressEnter, autoFocus = false, disableSearch = false, placeholder = "Search grant or describe your project", size = "medium", }) => {
6
+ const { height, fontSize } = sizePropsMap[size];
7
+ return (_jsxs(BaseSearchBar, { children: [_jsxs(SearchArea, { "$height": height, "$hasQueryText": queryText !== "", children: [_jsx(TextInput, { queryText: queryText, onChangeQueryText: onChangeQueryText, handlePressEnter: handlePressEnter, autoFocus: autoFocus, disableSearch: disableSearch, placeholder: placeholder, fontSize: fontSize }), queryText === "" ? (_jsx(ResetButtonPlaceholder, {})) : (_jsx(ResetButton, { onClickReset: onClickReset }))] }), _jsx(Button, { disabled: disableSearch, Icon: SystemIcon.MagnifyingGlassIcon, onClick: onClickSearch, size: size })] }));
19
8
  };
20
9
  export default SearchBar;
21
- const SIZE_PROPS_MAP = {
10
+ const sizePropsMap = {
22
11
  small: {
23
- height: "40px",
12
+ height: Spacing.px40,
24
13
  fontSize: "12px",
25
14
  },
26
15
  medium: {
@@ -32,7 +21,7 @@ const BaseSearchBar = styled.div `
32
21
  display: flex;
33
22
  align-items: center;
34
23
  justify-content: space-between;
35
- gap: 8px;
24
+ gap: ${Spacing.px8};
36
25
 
37
26
  width: 100%;
38
27
 
@@ -41,7 +30,7 @@ const BaseSearchBar = styled.div `
41
30
  }
42
31
 
43
32
  @media (width >= ${Responsive.widthBreakpoint.laptop}) {
44
- border-radius: 12px;
33
+ border-radius: ${Spacing.px12};
45
34
  }
46
35
  `;
47
36
  const SearchArea = styled.div `
@@ -55,25 +44,25 @@ const SearchArea = styled.div `
55
44
  background-color: ${(props) => props.$hasQueryText ? Color.neutral.white : Color.neutral.grey4};
56
45
  border: 0.5px solid
57
46
  ${(props) => props.$hasQueryText ? Color.accent.yellow1 : Color.neutral.grey2};
58
- border-radius: 8px;
47
+ border-radius: ${Spacing.px8};
59
48
 
60
49
  &:focus-within {
61
50
  background-color: ${Color.neutral.white};
62
51
  border: 0.5px solid ${Color.accent.yellow1};
63
52
  }
64
53
  `;
65
- const TextInput = ({ queryText, updateQueryText, executeSearch, placeholder, fontSize, }) => {
54
+ const TextInput = ({ queryText, onChangeQueryText, handlePressEnter, autoFocus, disableSearch, placeholder, fontSize, }) => {
66
55
  const onKeyDown = (event) => {
67
- if (event.key === "Enter" && !event.repeat) {
56
+ if (event.key === "Enter" && !event.repeat && !disableSearch) {
68
57
  event.preventDefault();
69
- executeSearch();
58
+ handlePressEnter();
70
59
  }
71
60
  };
72
- return (_jsx(BaseTextInput, { value: queryText, placeholder: placeholder, onChange: (event) => updateQueryText(event.target.value), onKeyDown: onKeyDown, "$fontSize": fontSize }));
61
+ return (_jsx(BaseTextInput, { value: queryText, placeholder: placeholder, onChange: onChangeQueryText, onKeyDown: onKeyDown, autoFocus: autoFocus, "$fontSize": fontSize }));
73
62
  };
74
63
  const BaseTextInput = styled.input `
75
64
  width: 100%;
76
- margin-left: 16px;
65
+ margin-left: ${Spacing.px16};
77
66
 
78
67
  font-size: ${(props) => props.$fontSize};
79
68
  text-overflow: ellipsis;
@@ -82,7 +71,7 @@ const BaseTextInput = styled.input `
82
71
  outline: none;
83
72
  border: none;
84
73
  `;
85
- const ResetButton = ({ resetSearch }) => (_jsx(BaseResetButton, { onClick: resetSearch, type: "button", children: _jsx(SystemIcon.XIcon, { size: 14, color: Color.neutral.black }) }));
74
+ const ResetButton = ({ onClickReset }) => (_jsx(BaseResetButton, { onClick: onClickReset, type: "button", children: _jsx(SystemIcon.XIcon, { size: 14, color: Color.neutral.black }) }));
86
75
  const BaseResetButton = styled.button `
87
76
  display: flex;
88
77
  align-items: center;
@@ -92,12 +81,12 @@ const BaseResetButton = styled.button `
92
81
  min-width: 38px;
93
82
  height: 38px;
94
83
 
95
- border-radius: 8px;
84
+ border-radius: ${Spacing.px8};
96
85
  `;
97
86
  const ResetButtonPlaceholder = styled.div `
98
87
  width: 38px;
99
88
  height: 38px;
100
89
 
101
- border-radius: 8px;
90
+ border-radius: ${Spacing.px8};
102
91
  `;
103
92
  //# sourceMappingURL=SearchBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.js","sour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C,EAAE,EAAE;QAC3D,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAC3C,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,aAAa,EAAE,CAAC;QAClB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,aAAa,IACZ,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACxD,SAAS,EAAE,SAAS,eACT,QAAQ,GACnB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAuB;;;;eAI1C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS;;;;;;CAMxC,CAAC;AAMF,MAAM,WAAW,GAAG,CAAC,EAAE,WAAW,EAAoB,EAAE,EAAE,CAAC,CACzD,KAAC,eAAe,IAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAC,QAAQ,YAClD,KAAC,UAAU,CAAC,KAAK,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,GAAI,GAC1C,CACnB,CAAC;AAEF,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAA;;;;;;;;;;CAUpC,CAAC;AAEF,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKxC,CAAC","sourcesContent":["import type { GrantMatchQuery } from \"@grantbii/ui-core/match/entities\";\nimport type { KeyboardEvent } from \"react\";\nimport styled from \"styled-components\";\nimport { Color, Responsive, SystemIcon } from \"../atoms\";\nimport { Button } from \"../molecules\";\n\ntype SearchBarProps = {\n activeQuery: GrantMatchQuery;\n updateActiveQuery: (query: GrantMatchQuery) => void;\n queryText: string;\n updateQueryText: (newText: string) => void;\n onSearch?: () => void;\n placeholder?: string;\n runSearchOnReset?: boolean;\n size?: SearchBarSize;\n};\n\ntype SearchBarSize = \"small\" | \"medium\";\n\nconst DEFAULT_PLACEHOLDER = \"Search grant or describe your project\";\n\nconst SearchBar = ({\n activeQuery,\n updateActiveQuery,\n queryText,\n updateQueryText,\n onSearch,\n placeholder = DEFAULT_PLACEHOLDER,\n runSearchOnReset = false,\n size = \"medium\",\n}: SearchBarProps) => {\n const { height, fontSize } = SIZE_PROPS_MAP[size];\n\n const resetSearch = () => {\n updateQueryText(\"\");\n\n if (runSearchOnReset) {\n updateActiveQuery({ files: activeQuery.files, text: \"\" });\n }\n };\n\n const executeSearch = () => {\n onSearch?.();\n updateActiveQuery({ files: activeQuery.files, text: queryText });\n };\n\n return (\n <BaseSearchBar>\n <SearchArea $height={height} $hasQueryText={queryText !== \"\"}>\n <TextInput\n queryText={queryText}\n updateQueryText={updateQueryText}\n executeSearch={executeSearch}\n placeholder={placeholder}\n fontSize={fontSize}\n />\n\n {queryText === \"\" ? (\n <ResetButtonPlaceholder />\n ) : (\n <ResetButton resetSearch={resetSearch} />\n )}\n </SearchArea>\n\n <Button\n Icon={SystemIcon.MagnifyingGlassIcon}\n onClick={executeSearch}\n size={size}\n />\n </BaseSearchBar>\n );\n};\n\nexport default SearchBar;\n\ntype SizeStyleProps = {\n height: string;\n fontSize: string;\n};\n\nconst SIZE_PROPS_MAP: { [size in SearchBarSize]: SizeStyleProps } = {\n small: {\n height: \"40px\",\n fontSize: \"12px\",\n },\n medium: {\n height: \"44px\",\n fontSize: \"14px\",\n },\n};\n\nconst BaseSearchBar = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n\n width: 100%;\n\n @media (width < ${Responsive.widthBreakpoint.laptop}) {\n border-radius: 0px;\n }\n\n @media (width >= ${Responsive.widthBreakpoint.laptop}) {\n border-radius: 12px;\n }\n`;\n\ntype SearchAreaProps = {\n $height: string;\n $hasQueryText: boolean;\n};\n\nconst SearchArea = styled.div<SearchAreaProps>`\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n height: ${(props) => props.$height};\n width: 100%;\n\n background-color: ${(props) =>\n props.$hasQueryText ? Color.neutral.white : Color.neutral.grey4};\n border: 0.5px solid\n ${(props) =>\n props.$hasQueryText ? Color.accent.yellow1 : Color.neutral.grey2};\n border-radius: 8px;\n\n &:focus-within {\n background-color: ${Color.neutral.white};\n border: 0.5px solid ${Color.accent.yellow1};\n }\n`;\n\ntype TextInputProps = {\n queryText: string;\n updateQueryText: (newText: string) => void;\n executeSearch: () => void;\n placeholder: string;\n fontSize: string;\n};\n\nconst TextInput = ({\n queryText,\n updateQueryText,\n executeSearch,\n placeholder,\n fontSize,\n}: TextInputProps) => {\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" && !event.repeat) {\n event.preventDefault();\n executeSearch();\n }\n };\n\n return (\n <BaseTextInput\n value={queryText}\n placeholder={placeholder}\n onChange={(event) => updateQueryText(event.target.value)}\n onKeyDown={onKeyDown}\n $fontSize={fontSize}\n />\n );\n};\n\nconst BaseTextInput = styled.input<{ $fontSize: string }>`\n width: 100%;\n margin-left: 16px;\n\n font-size: ${(props) => props.$fontSize};\n text-overflow: ellipsis;\n\n background-color: transparent;\n outline: none;\n border: none;\n`;\n\ntype ResetButtonProps = {\n resetSearch: () => void;\n};\n\nconst ResetButton = ({ resetSearch }: ResetButtonProps) => (\n <BaseResetButton onClick={resetSearch} type=\"button\">\n <SystemIcon.XIcon size={14} color={Color.neutral.black} />\n </BaseResetButton>\n);\n\nconst BaseResetButton = styled.button`\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 38px;\n min-width: 38px;\n height: 38px;\n\n border-radius: 8px;\n`;\n\nconst ResetButtonPlaceholder = styled.div`\n width: 38px;\n height: 38px;\n\n border-radius: 8px;\n`;\n"]}
1
+ {"version":3,"file":"SearchBar.js","sourceRoot":"","sources":["../../../core/organisms/SearchBar.tsx"],"names":[],"mappings":";AAKA,OA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AAW,EACxB,QAAQ,EAAE,iBAAiB,EAC3B,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,eACT,QAAQ,GACnB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAuB;;iBAExC,OAAO,CAAC,IAAI;;eAEd,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS;;;;;;CAMxC,CAAC;AAMF,MAAM,WAAW,GAAG,CAAC,EAAE,YAAY,EAAoB,EAAE,EAAE,CAAC,CAC1D,KAAC,eAAe,IAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAC,QAAQ,YACnD,KAAC,UAAU,CAAC,KAAK,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,GAAI,GAC1C,CACnB,CAAC;AAEF,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAA;;;;;;;;;mBASlB,OAAO,CAAC,GAAG;CAC7B,CAAC;AAEF,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;mBAItB,OAAO,CAAC,GAAG;CAC7B,CAAC","sourcesContent":["import type {\n ChangeEventHandler,\n KeyboardEvent,\n MouseEventHandler,\n} from \"react\";\nimport styled from \"styled-components\";\nimport { Color, Responsive, Spacing, SystemIcon } from \"../atoms\";\nimport { Button } from \"../molecules\";\n\ntype SearchBarProps = {\n queryText: string;\n onChangeQueryText: ChangeEventHandler<HTMLInputElement, HTMLInputElement>;\n onClickReset: MouseEventHandler<HTMLButtonElement>;\n onClickSearch: MouseEventHandler<HTMLButtonElement>;\n handlePressEnter: () => void;\n autoFocus?: boolean;\n disableSearch?: boolean;\n placeholder?: string;\n size?: SearchBarSize;\n};\n\ntype SearchBarSize = \"small\" | \"medium\";\n\nconst SearchBar = ({\n queryText,\n onChangeQueryText,\n onClickSearch,\n onClickReset,\n handlePressEnter,\n autoFocus = false,\n disableSearch = false,\n placeholder = \"Search grant or describe your project\",\n size = \"medium\",\n}: SearchBarProps) => {\n const { height, fontSize } = sizePropsMap[size];\n\n return (\n <BaseSearchBar>\n <SearchArea $height={height} $hasQueryText={queryText !== \"\"}>\n <TextInput\n queryText={queryText}\n onChangeQueryText={onChangeQueryText}\n handlePressEnter={handlePressEnter}\n autoFocus={autoFocus}\n disableSearch={disableSearch}\n placeholder={placeholder}\n fontSize={fontSize}\n />\n\n {queryText === \"\" ? (\n <ResetButtonPlaceholder />\n ) : (\n <ResetButton onClickReset={onClickReset} />\n )}\n </SearchArea>\n\n <Button\n disabled={disableSearch}\n Icon={SystemIcon.MagnifyingGlassIcon}\n onClick={onClickSearch}\n size={size}\n />\n </BaseSearchBar>\n );\n};\n\nexport default SearchBar;\n\ntype SizeStyleProps = {\n height: string;\n fontSize: string;\n};\n\nconst sizePropsMap: { [size in SearchBarSize]: SizeStyleProps } = {\n small: {\n height: Spacing.px40,\n fontSize: \"12px\",\n },\n medium: {\n height: \"44px\",\n fontSize: \"14px\",\n },\n};\n\nconst BaseSearchBar = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ${Spacing.px8};\n\n width: 100%;\n\n @media (width < ${Responsive.widthBreakpoint.laptop}) {\n border-radius: 0px;\n }\n\n @media (width >= ${Responsive.widthBreakpoint.laptop}) {\n border-radius: ${Spacing.px12};\n }\n`;\n\ntype SearchAreaProps = {\n $height: string;\n $hasQueryText: boolean;\n};\n\nconst SearchArea = styled.div<SearchAreaProps>`\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n height: ${(props) => props.$height};\n width: 100%;\n\n background-color: ${(props) =>\n props.$hasQueryText ? Color.neutral.white : Color.neutral.grey4};\n border: 0.5px solid\n ${(props) =>\n props.$hasQueryText ? Color.accent.yellow1 : Color.neutral.grey2};\n border-radius: ${Spacing.px8};\n\n &:focus-within {\n background-color: ${Color.neutral.white};\n border: 0.5px solid ${Color.accent.yellow1};\n }\n`;\n\ntype TextInputProps = {\n queryText: string;\n onChangeQueryText?: ChangeEventHandler<HTMLInputElement, HTMLInputElement>;\n handlePressEnter: () => void;\n autoFocus: boolean;\n disableSearch: boolean;\n placeholder: string;\n fontSize: string;\n};\n\nconst TextInput = ({\n queryText,\n onChangeQueryText,\n handlePressEnter,\n autoFocus,\n disableSearch,\n placeholder,\n fontSize,\n}: TextInputProps) => {\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" && !event.repeat && !disableSearch) {\n event.preventDefault();\n handlePressEnter();\n }\n };\n\n return (\n <BaseTextInput\n value={queryText}\n placeholder={placeholder}\n onChange={onChangeQueryText}\n onKeyDown={onKeyDown}\n autoFocus={autoFocus}\n $fontSize={fontSize}\n />\n );\n};\n\nconst BaseTextInput = styled.input<{ $fontSize: string }>`\n width: 100%;\n margin-left: ${Spacing.px16};\n\n font-size: ${(props) => props.$fontSize};\n text-overflow: ellipsis;\n\n background-color: transparent;\n outline: none;\n border: none;\n`;\n\ntype ResetButtonProps = {\n onClickReset: MouseEventHandler<HTMLButtonElement>;\n};\n\nconst ResetButton = ({ onClickReset }: ResetButtonProps) => (\n <BaseResetButton onClick={onClickReset} type=\"button\">\n <SystemIcon.XIcon size={14} color={Color.neutral.black} />\n </BaseResetButton>\n);\n\nconst BaseResetButton = styled.button`\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 38px;\n min-width: 38px;\n height: 38px;\n\n border-radius: ${Spacing.px8};\n`;\n\nconst ResetButtonPlaceholder = styled.div`\n width: 38px;\n height: 38px;\n\n border-radius: ${Spacing.px8};\n`;\n"]}
@@ -4,5 +4,5 @@ type ErrorFallbackProps = {
4
4
  errorDescription?: ReactNode;
5
5
  onClickReload?: MouseEventHandler<HTMLButtonElement>;
6
6
  };
7
- declare const ErrorFallback: ({ errorMessage, errorDescription, onClickReload, }: ErrorFallbackProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const ErrorFallback: ({ errorMessage, errorDescription, onClickReload, }: ErrorFallbackProps) => import("react").JSX.Element;
8
8
  export default ErrorFallback;
@@ -1,2 +1,2 @@
1
- declare const ActiveQueryFiles: () => import("react/jsx-runtime").JSX.Element;
1
+ declare const ActiveQueryFiles: () => import("react").JSX.Element;
2
2
  export default ActiveQueryFiles;
@@ -2,5 +2,5 @@ type GrantMatchModalProps = {
2
2
  findGrantsCallback?: () => void;
3
3
  closeModalCallback?: () => void;
4
4
  };
5
- declare const GrantMatchModal: ({ findGrantsCallback, closeModalCallback, }: GrantMatchModalProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const GrantMatchModal: ({ findGrantsCallback, closeModalCallback, }: GrantMatchModalProps) => import("react").JSX.Element;
6
6
  export default GrantMatchModal;
@@ -1,5 +1,5 @@
1
1
  type OpenModalButtonProps = {
2
2
  openModalCallback?: () => void;
3
3
  };
4
- declare const OpenModalButton: ({ openModalCallback }: OpenModalButtonProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const OpenModalButton: ({ openModalCallback }: OpenModalButtonProps) => import("react").JSX.Element;
5
5
  export default OpenModalButton;
@@ -7,6 +7,6 @@ type GrantMatchProps = {
7
7
  closeModalCallback?: () => void;
8
8
  openModalCallback?: () => void;
9
9
  };
10
- declare const GrantMatch: ({ activeQuery, updateActiveQuery, textSearchCallback, findGrantsCallback, closeModalCallback, openModalCallback, }: GrantMatchProps) => import("react/jsx-runtime").JSX.Element;
10
+ declare const GrantMatch: ({ activeQuery, updateActiveQuery, textSearchCallback, findGrantsCallback, closeModalCallback, openModalCallback, }: GrantMatchProps) => import("react").JSX.Element;
11
11
  export default GrantMatch;
12
12
  export declare const useGrantMatchActiveQuery: (performGrantMatch: (newQuery: GrantMatchQuery) => void, resetGrantMatch: () => void) => GrantMatchProps;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { checkGrantMatchActive } from "@grantbii/ui-core/match/validations";
3
3
  import { useMemo, useState } from "react";
4
4
  import styled from "styled-components";
5
- import { Color, Responsive } from "../../atoms";
5
+ import { Color, Responsive, Spacing } from "../../atoms";
6
6
  import { SearchBar, useModal } from "../../organisms";
7
7
  import ActiveQueryFiles from "./ActiveQueryFiles";
8
8
  import GrantMatchModal from "./GrantMatchModal";
@@ -27,13 +27,21 @@ const GrantMatch = ({ activeQuery, updateActiveQuery, textSearchCallback, findGr
27
27
  openModal,
28
28
  closeModal,
29
29
  ]);
30
- return (_jsx(GrantMatchContext.Provider, { value: commonProps, children: _jsxs(BaseGrantMatch, { children: [_jsxs(SearchBarContainer, { children: [_jsx(SearchBar, { activeQuery: activeQuery, updateActiveQuery: updateActiveQuery, queryText: queryText, updateQueryText: updateQueryText, onSearch: textSearchCallback, runSearchOnReset: true, size: "small" }), _jsx(OpenModalButton, { openModalCallback: openModalCallback })] }), activeQuery.files.length > 0 ? _jsx(ActiveQueryFiles, {}) : _jsx(_Fragment, {}), showModal ? (_jsx(GrantMatchModal, { findGrantsCallback: findGrantsCallback, closeModalCallback: closeModalCallback })) : (_jsx(_Fragment, {}))] }) }));
30
+ const handleSearch = () => {
31
+ updateActiveQuery({ files: activeQuery.files, text: queryText });
32
+ textSearchCallback?.();
33
+ };
34
+ const handleReset = () => {
35
+ updateQueryText("");
36
+ updateActiveQuery({ files: activeQuery.files, text: "" });
37
+ };
38
+ return (_jsx(GrantMatchContext.Provider, { value: commonProps, children: _jsxs(BaseGrantMatch, { children: [_jsxs(SearchBarContainer, { children: [_jsx(SearchBar, { queryText: queryText, onChangeQueryText: (event) => setQueryText(event.target.value), handlePressEnter: () => handleSearch(), onClickSearch: () => handleSearch(), onClickReset: () => handleReset(), size: "small" }), _jsx(OpenModalButton, { openModalCallback: openModalCallback })] }), activeQuery.files.length > 0 ? _jsx(ActiveQueryFiles, {}) : _jsx(_Fragment, {}), showModal ? (_jsx(GrantMatchModal, { findGrantsCallback: findGrantsCallback, closeModalCallback: closeModalCallback })) : (_jsx(_Fragment, {}))] }) }));
31
39
  };
32
40
  export default GrantMatch;
33
41
  const BaseGrantMatch = styled.div `
34
42
  display: flex;
35
43
  flex-direction: column;
36
- gap: 8px;
44
+ gap: ${Spacing.px8};
37
45
 
38
46
  width: 100%;
39
47
  max-width: 100vw;
@@ -49,7 +57,7 @@ const SearchBarContainer = styled.div `
49
57
  background-color: ${Color.neutral.white};
50
58
 
51
59
  @media (width < ${Responsive.widthBreakpoint.laptop}) {
52
- gap: 8px;
60
+ gap: ${Spacing.px8};
53
61
  padding: 0px;
54
62
 
55
63
  box-shadow: none;
@@ -57,11 +65,11 @@ const SearchBarContainer = styled.div `
57
65
  }
58
66
 
59
67
  @media (width >= ${Responsive.widthBreakpoint.laptop}) {
60
- gap: 16px;
61
- padding: 12px 16px;
68
+ gap: ${Spacing.px16};
69
+ padding: ${Spacing.px12} ${Spacing.px16};
62
70
 
63
- box-shadow: 0px 0px 40px 0px #00000008;
64
- border-radius: 12px;
71
+ box-shadow: 0px 0px ${Spacing.px40} 0px #00000008;
72
+ border-radius: ${Spacing.px12};
65
73
  }
66
74
  `;
67
75
  export const useGrantMatchActiveQuery = (performGrantMatch, resetGrantMatch) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../core/templates/GrantMatch/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAW9C,MAAM,UAAU,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B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC;AAE1B,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOhC,CAAC;AAEF,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;WAO1B,KAAK,CAAC,UAAU,CAAC,SAAS;sBACf,KAAK,CAAC,OAAO,CAAC,KAAK;;oBAErB,UAAU,CAAC,eAAe,CAAC,MAAM;;;;;;;;qBAQhC,UAAU,CAAC,eAAe,CAAC,MAAM;;;;;;;CAOrD,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-core/match/entities\";\nimport { checkGrantMatchActive } from \"@grantbii/ui-core/match/validations\";\nimport { useMemo, useState } from \"react\";\nimport styled from \"styled-components\";\nimport { Color, Responsive } from \"../../atoms\";\nimport { SearchBar, useModal } from \"../../organisms\";\nimport ActiveQueryFiles from \"./ActiveQueryFiles\";\nimport GrantMatchModal from \"./GrantMatchModal\";\nimport OpenModalButton from \"./OpenModalButton\";\nimport { GrantMatchContext } from \"./context\";\n\ntype GrantMatchProps = {\n activeQuery: GrantMatchQuery;\n updateActiveQuery: (newQuery: GrantMatchQuery) => void;\n textSearchCallback?: () => void;\n findGrantsCallback?: () => void;\n closeModalCallback?: () => void;\n openModalCallback?: () => void;\n};\n\nconst GrantMatch = ({\n activeQuery,\n updateActiveQuery,\n textSearchCallback,\n findGrantsCallback,\n closeModalCallback,\n openModalCallback,\n}: 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 = useMemo(\n () => ({\n activeQuery,\n updateActiveQuery,\n queryText,\n updateQueryText,\n openModal,\n closeModal,\n }),\n [\n activeQuery,\n updateActiveQuery,\n queryText,\n updateQueryText,\n openModal,\n closeModal,\n ],\n );\n\n return (\n <GrantMatchContext.Provider value={commonProps}>\n <BaseGrantMatch>\n <SearchBarContainer>\n <SearchBar\n activeQuery={activeQuery}\n updateActiveQuery={updateActiveQuery}\n queryText={queryText}\n updateQueryText={updateQueryText}\n onSearch={textSearchCallback}\n runSearchOnReset\n size=\"small\"\n />\n <OpenModalButton openModalCallback={openModalCallback} />\n </SearchBarContainer>\n\n {activeQuery.files.length > 0 ? <ActiveQueryFiles /> : <></>}\n\n {showModal ? (\n <GrantMatchModal\n findGrantsCallback={findGrantsCallback}\n closeModalCallback={closeModalCallback}\n />\n ) : (\n <></>\n )}\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\nconst SearchBarContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n width: 100%;\n\n color: ${Color.typography.blackHigh};\n background-color: ${Color.neutral.white};\n\n @media (width < ${Responsive.widthBreakpoint.laptop}) {\n gap: 8px;\n padding: 0px;\n\n box-shadow: none;\n border-radius: 0px;\n }\n\n @media (width >= ${Responsive.widthBreakpoint.laptop}) {\n gap: 16px;\n padding: 12px 16px;\n\n box-shadow: 0px 0px 40px 0px #00000008;\n border-radius: 12px;\n }\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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../core/templates/GrantMatch/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAW9C,MAAM,UAAU,GAAG,CAAC,EAClB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GACD,EAAE,EAAE;IACpB,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,QAAQ,EAAE,CAAC;IACxD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CA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,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAC5C,CAAC,CAAC","sourcesContent":["import type { GrantMatchQuery } from \"@grantbii/ui-core/match/entities\";\nimport { checkGrantMatchActive } from \"@grantbii/ui-core/match/validations\";\nimport { useMemo, useState } from \"react\";\nimport styled from \"styled-components\";\nimport { Color, Responsive, Spacing } from \"../../atoms\";\nimport { SearchBar, useModal } from \"../../organisms\";\nimport ActiveQueryFiles from \"./ActiveQueryFiles\";\nimport GrantMatchModal from \"./GrantMatchModal\";\nimport OpenModalButton from \"./OpenModalButton\";\nimport { GrantMatchContext } from \"./context\";\n\ntype GrantMatchProps = {\n activeQuery: GrantMatchQuery;\n updateActiveQuery: (newQuery: GrantMatchQuery) => void;\n textSearchCallback?: () => void;\n findGrantsCallback?: () => void;\n closeModalCallback?: () => void;\n openModalCallback?: () => void;\n};\n\nconst GrantMatch = ({\n activeQuery,\n updateActiveQuery,\n textSearchCallback,\n findGrantsCallback,\n closeModalCallback,\n openModalCallback,\n}: 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 = useMemo(\n () => ({\n activeQuery,\n updateActiveQuery,\n queryText,\n updateQueryText,\n openModal,\n closeModal,\n }),\n [\n activeQuery,\n updateActiveQuery,\n queryText,\n updateQueryText,\n openModal,\n closeModal,\n ],\n );\n\n const handleSearch = () => {\n updateActiveQuery({ files: activeQuery.files, text: queryText });\n textSearchCallback?.();\n };\n\n const handleReset = () => {\n updateQueryText(\"\");\n updateActiveQuery({ files: activeQuery.files, text: \"\" });\n };\n\n return (\n <GrantMatchContext.Provider value={commonProps}>\n <BaseGrantMatch>\n <SearchBarContainer>\n <SearchBar\n queryText={queryText}\n onChangeQueryText={(event) => setQueryText(event.target.value)}\n handlePressEnter={() => handleSearch()}\n onClickSearch={() => handleSearch()}\n onClickReset={() => handleReset()}\n size=\"small\"\n />\n <OpenModalButton openModalCallback={openModalCallback} />\n </SearchBarContainer>\n\n {activeQuery.files.length > 0 ? <ActiveQueryFiles /> : <></>}\n\n {showModal ? (\n <GrantMatchModal\n findGrantsCallback={findGrantsCallback}\n closeModalCallback={closeModalCallback}\n />\n ) : (\n <></>\n )}\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: ${Spacing.px8};\n\n width: 100%;\n max-width: 100vw;\n`;\n\nconst SearchBarContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n\n width: 100%;\n\n color: ${Color.typography.blackHigh};\n background-color: ${Color.neutral.white};\n\n @media (width < ${Responsive.widthBreakpoint.laptop}) {\n gap: ${Spacing.px8};\n padding: 0px;\n\n box-shadow: none;\n border-radius: 0px;\n }\n\n @media (width >= ${Responsive.widthBreakpoint.laptop}) {\n gap: ${Spacing.px16};\n padding: ${Spacing.px12} ${Spacing.px16};\n\n box-shadow: 0px 0px ${Spacing.px40} 0px #00000008;\n border-radius: ${Spacing.px12};\n }\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"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@grantbii/design-system",
3
3
  "author": "Grantbii",
4
4
  "license": "UNLICENSED",
5
- "version": "1.25.0",
5
+ "version": "1.26.0",
6
6
  "description": "Grantbii's Design System",
7
7
  "homepage": "https://design.grantbii.com",
8
8
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "react-spinners": "0.17.0"
27
27
  },
28
28
  "peerDependencies": {
29
- "@grantbii/ui-core": "^1.8",
29
+ "@grantbii/ui-core": "^1.10",
30
30
  "next": "^16.2",
31
31
  "react": ">=18 <20",
32
32
  "react-dom": ">=18 <20",
@@ -35,29 +35,29 @@
35
35
  "devDependencies": {
36
36
  "@chromatic-com/storybook": "5.2.1",
37
37
  "@grantbii/ui-core": "1.10.0",
38
- "@storybook/addon-a11y": "10.4.2",
39
- "@storybook/addon-docs": "10.4.2",
40
- "@storybook/addon-onboarding": "10.4.2",
41
- "@storybook/addon-vitest": "10.4.2",
42
- "@storybook/nextjs-vite": "10.4.2",
38
+ "@storybook/addon-a11y": "10.4.6",
39
+ "@storybook/addon-docs": "10.4.6",
40
+ "@storybook/addon-onboarding": "10.4.6",
41
+ "@storybook/addon-vitest": "10.4.6",
42
+ "@storybook/nextjs-vite": "10.4.6",
43
43
  "@types/node": "22.19.17",
44
- "@types/react": "19.2.14",
44
+ "@types/react": "19.2.17",
45
45
  "@types/react-dom": "19.2.3",
46
46
  "@vitest/browser": "4.1.8",
47
47
  "@vitest/browser-playwright": "4.1.8",
48
48
  "@vitest/coverage-v8": "4.1.8",
49
49
  "eslint": "9.39.4",
50
- "eslint-config-next": "16.2.7",
50
+ "eslint-config-next": "16.2.9",
51
51
  "eslint-config-prettier": "10.1.8",
52
- "eslint-plugin-storybook": "10.4.2",
52
+ "eslint-plugin-storybook": "10.4.6",
53
53
  "husky": "9.1.7",
54
- "lint-staged": "17.0.7",
55
- "next": "16.2.7",
56
- "playwright": "1.60.0",
57
- "prettier": "3.8.3",
54
+ "lint-staged": "17.0.8",
55
+ "next": "16.2.9",
56
+ "playwright": "1.61.0",
57
+ "prettier": "3.8.4",
58
58
  "react": "19.2.7",
59
59
  "react-dom": "19.2.7",
60
- "storybook": "10.4.2",
60
+ "storybook": "10.4.6",
61
61
  "styled-components": "6.4.2",
62
62
  "typescript": "6.0.3",
63
63
  "vitest": "4.1.8"
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/nextjs-vite";
2
2
  type ExampleProps = {
3
3
  controlled: boolean;
4
4
  };
5
- declare const RadioButtonsExample: ({ controlled }: ExampleProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const RadioButtonsExample: ({ controlled }: ExampleProps) => import("react").JSX.Element;
6
6
  declare const meta: Meta<typeof RadioButtonsExample>;
7
7
  export default meta;
8
8
  type Story = StoryObj<typeof meta>;
@@ -5,7 +5,7 @@ type TallyModalExampleProps = {
5
5
  tallyId: string;
6
6
  prefilledFieldsQueryParams?: string;
7
7
  };
8
- declare const TallyModalExample: (props: TallyModalExampleProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const TallyModalExample: (props: TallyModalExampleProps) => import("react").JSX.Element;
9
9
  declare const meta: Meta<typeof TallyModalExample>;
10
10
  export default meta;
11
11
  type Story = StoryObj<typeof meta>;
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from "@storybook/nextjs-vite";
2
2
  type ExampleProps = {
3
3
  controlled: boolean;
4
4
  };
5
- declare const DropdownExample: ({ controlled }: ExampleProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const DropdownExample: ({ controlled }: ExampleProps) => import("react").JSX.Element;
6
6
  declare const meta: Meta<typeof DropdownExample>;
7
7
  export default meta;
8
8
  type Story = StoryObj<typeof meta>;
@@ -1,5 +1,5 @@
1
1
  import type { Meta, StoryObj } from "@storybook/nextjs-vite";
2
- declare const FileDropExample: () => import("react/jsx-runtime").JSX.Element;
2
+ declare const FileDropExample: () => import("react").JSX.Element;
3
3
  declare const meta: Meta<typeof FileDropExample>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
@@ -7,7 +7,7 @@ type ModalExampleProps = {
7
7
  width?: string;
8
8
  height?: string;
9
9
  };
10
- declare const ModalExample: (props: ModalExampleProps) => import("react/jsx-runtime").JSX.Element;
10
+ declare const ModalExample: (props: ModalExampleProps) => JSX.Element;
11
11
  declare const meta: Meta<typeof ModalExample>;
12
12
  export default meta;
13
13
  type Story = StoryObj<typeof meta>;
@@ -2,15 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { SearchBar } from "@/.";
3
3
  import { useState } from "react";
4
4
  const SearchBarExample = ({ size }) => {
5
- const [activeQuery, setActiveQuery] = useState(emptyQuery);
6
- const updateActiveQuery = (newQuery) => setActiveQuery(newQuery);
7
5
  const [queryText, setQueryText] = useState("");
8
- const updateQueryText = (newText) => setQueryText(newText);
9
- return (_jsx(SearchBar, { activeQuery: activeQuery, updateActiveQuery: updateActiveQuery, queryText: queryText, updateQueryText: updateQueryText, size: size }));
10
- };
11
- const emptyQuery = {
12
- text: "",
13
- files: [],
6
+ const performSearch = () => {
7
+ if (queryText.trim() !== "") {
8
+ alert(`Searching for ${queryText}`);
9
+ }
10
+ };
11
+ return (_jsx(SearchBar, { queryText: queryText, onChangeQueryText: (event) => setQueryText(event.target.value), handlePressEnter: () => performSearch(), onClickSearch: () => performSearch(), onClickReset: () => setQueryText(""), size: size }));
14
12
  };
15
13
  const meta = {
16
14
  title: "Organisms/SearchBar",
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.stories.js","sourceRoot":"","sources":["../../../stories/organisms/SearchBar.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAGhC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,MAAM,gBAAgB,GAAG,CAAC,EAAE,IAAI,EAAyB,EAAE,EAAE;IAC3D,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAkB,UAAU,CAAC,CAAC;IAC5E,MAAM,iBAAiB,GAAG,CAAC,QAAyB,EAAE,EAAE,CACtD,cAAc,CAAC,QAAQ,CAAC,CAAC;IAE3B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/C,MAAM,eAAe,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAEnE,OAAO,CACL,KAAC,SAAS,IACR,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,IAAI,EAAE,IAAI,GACV,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,EAAE;CACV,CAAC;AAEF,MAAM,IAAI,GAA2B;IACnC,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,gBAAgB;IAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAU;IAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CACzB,CAAC","sourcesContent":["import { SearchBar } from \"@/.\";\nimport type { GrantMatchQuery } from \"@grantbii/ui-core/match/entities\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\nimport { useState } from \"react\";\n\ntype SearchBarExampleProps = {\n size?: \"small\" | \"medium\";\n};\n\nconst SearchBarExample = ({ size }: SearchBarExampleProps) => {\n const [activeQuery, setActiveQuery] = useState<GrantMatchQuery>(emptyQuery);\n const updateActiveQuery = (newQuery: GrantMatchQuery) =>\n setActiveQuery(newQuery);\n\n const [queryText, setQueryText] = useState(\"\");\n const updateQueryText = (newText: string) => setQueryText(newText);\n\n return (\n <SearchBar\n activeQuery={activeQuery}\n updateActiveQuery={updateActiveQuery}\n queryText={queryText}\n updateQueryText={updateQueryText}\n size={size}\n />\n );\n};\n\nconst emptyQuery = {\n text: \"\",\n files: [],\n};\n\nconst meta: Meta<typeof SearchBar> = {\n title: \"Organisms/SearchBar\",\n component: SearchBarExample,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"fullscreen\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Small: Story = {\n args: { size: \"small\" },\n};\n\nexport const Medium: Story = {\n args: { size: \"medium\" },\n};\n"]}
1
+ {"version":3,"file":"SearchBar.stories.js","sourceRoot":"","sources":["../../../stories/organisms/SearchBar.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,MAAM,gBAAgB,GAAG,CAAC,EAAE,IAAI,EAAyB,EAAE,EAAE;IAC3D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE/C,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,SAAS,EAAE,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,SAAS,IACR,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAC9D,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,EACvC,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,EACpC,YAAY,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,EACpC,IAAI,EAAE,IAAI,GACV,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,IAAI,GAA2B;IACnC,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,gBAAgB;IAC3B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,KAAK,GAAU;IAC1B,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAU;IAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CACzB,CAAC","sourcesContent":["import { SearchBar } from \"@/.\";\nimport type { Meta, StoryObj } from \"@storybook/nextjs-vite\";\nimport { useState } from \"react\";\n\ntype SearchBarExampleProps = {\n size?: \"small\" | \"medium\";\n};\n\nconst SearchBarExample = ({ size }: SearchBarExampleProps) => {\n const [queryText, setQueryText] = useState(\"\");\n\n const performSearch = () => {\n if (queryText.trim() !== \"\") {\n alert(`Searching for ${queryText}`);\n }\n };\n\n return (\n <SearchBar\n queryText={queryText}\n onChangeQueryText={(event) => setQueryText(event.target.value)}\n handlePressEnter={() => performSearch()}\n onClickSearch={() => performSearch()}\n onClickReset={() => setQueryText(\"\")}\n size={size}\n />\n );\n};\n\nconst meta: Meta<typeof SearchBar> = {\n title: \"Organisms/SearchBar\",\n component: SearchBarExample,\n tags: [\"autodocs\"],\n parameters: {\n layout: \"fullscreen\",\n },\n};\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Small: Story = {\n args: { size: \"small\" },\n};\n\nexport const Medium: Story = {\n args: { size: \"medium\" },\n};\n"]}
@@ -5,7 +5,7 @@ type Callbacks = {
5
5
  closeModalCallback?: () => void;
6
6
  openModalCallback?: () => void;
7
7
  };
8
- declare const GrantMatchExample: (callbacks: Callbacks) => import("react/jsx-runtime").JSX.Element;
8
+ declare const GrantMatchExample: (callbacks: Callbacks) => import("react").JSX.Element;
9
9
  declare const meta: Meta<typeof GrantMatchExample>;
10
10
  export default meta;
11
11
  type Story = StoryObj<typeof meta>;