From 03af9edce65400f0f16fa46d29885322b7761826 Mon Sep 17 00:00:00 2001 From: Simon Bracegirdle Date: Tue, 25 Jun 2024 15:19:23 +0800 Subject: [PATCH 1/7] v0.0.191 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 41769ed..40b9e5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@govconnex/ui", - "version": "0.0.189", + "version": "0.0.191", "description": "GovConnex UI - React Component Library", "scripts": { "build:tokens": "./tokens-build.sh", @@ -139,4 +139,4 @@ "url": "https://github.com/GovConnex/UI/issues" }, "homepage": "https://github.com/GovConnex/UI#readme" -} \ No newline at end of file +} From 11fcc982a35cc160756d8d5447c852a64f6738fd Mon Sep 17 00:00:00 2001 From: Simon Bracegirdle Date: Tue, 25 Jun 2024 15:39:28 +0800 Subject: [PATCH 2/7] v0.0.191-rc1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 40b9e5d..43ab585 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@govconnex/ui", - "version": "0.0.191", + "version": "0.0.191-rc1", "description": "GovConnex UI - React Component Library", "scripts": { "build:tokens": "./tokens-build.sh", From 668a30ecac87e1516c48e95add5f0efefb1e11e0 Mon Sep 17 00:00:00 2001 From: Simon Bracegirdle Date: Tue, 25 Jun 2024 15:56:11 +0800 Subject: [PATCH 3/7] v0.0.191-rc2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 43ab585..9cd4da0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@govconnex/ui", - "version": "0.0.191-rc1", + "version": "0.0.191-rc2", "description": "GovConnex UI - React Component Library", "scripts": { "build:tokens": "./tokens-build.sh", From 1743d37d49711d6711dada9026407764d192e943 Mon Sep 17 00:00:00 2001 From: Simon Bracegirdle Date: Tue, 25 Jun 2024 16:27:30 +0800 Subject: [PATCH 4/7] v0.0.191-rc3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9cd4da0..d3b2cf6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@govconnex/ui", - "version": "0.0.191-rc2", + "version": "0.0.191-rc3", "description": "GovConnex UI - React Component Library", "scripts": { "build:tokens": "./tokens-build.sh", From 0f9e747593fa2f91511cc11c62b0facacfb23429 Mon Sep 17 00:00:00 2001 From: Simon Bracegirdle Date: Tue, 25 Jun 2024 16:46:52 +0800 Subject: [PATCH 5/7] Fix; bug fixes in Box, Dropdown, TextArea. Mostly missing props and support. --- src/components/Box/Box.tsx | 1 + src/components/Dropdown/Dropdown.tsx | 4 +++- src/components/TextArea/TextArea.styles.ts | 4 +++- src/components/TextArea/TextArea.tsx | 8 ++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/Box/Box.tsx b/src/components/Box/Box.tsx index 832edf1..aae4847 100644 --- a/src/components/Box/Box.tsx +++ b/src/components/Box/Box.tsx @@ -97,6 +97,7 @@ export function separateProps(props: ExtendedBoxProps): { "className", "target", "rel", + "for", ].includes(key) ) { acc.filteredProps[key] = (props as any)[key]; diff --git a/src/components/Dropdown/Dropdown.tsx b/src/components/Dropdown/Dropdown.tsx index 533e6a7..baaf646 100644 --- a/src/components/Dropdown/Dropdown.tsx +++ b/src/components/Dropdown/Dropdown.tsx @@ -78,6 +78,7 @@ const Dropdown = ({ loadingIndicator, selectedIndicator, cs, + ...rest }: DropdownProps) => { const popRef = useRef(null); const [showPopover, setShowPopover] = useState(false); @@ -120,7 +121,7 @@ const Dropdown = ({ data-cy={dataCy} error={error} onChange={onInputChange} - onClick={() => { + onFocus={() => { setShowPopover(true); }} endAdornment={ @@ -172,6 +173,7 @@ const Dropdown = ({ : options?.find((item: any) => item?.id === defaultValue)?.text || "" } readOnly={typeof inputValue !== "string"} + {...rest} /> {showPopover ? ( ( ({ theme, @@ -18,6 +19,7 @@ const StyledAdornment = styled.span<{ squashHeight, adornmentColor, overridePositionTop, + allowPointerEvents, }) => ({ [position]: noPadding ? theme.spacing.xs : theme.spacing.sm, paddingTop: overridePositionTop @@ -26,7 +28,7 @@ const StyledAdornment = styled.span<{ ? "0px" : theme.spacing.xs, position: "absolute", - pointerEvents: squashHeight ? "auto" : "none", + pointerEvents: allowPointerEvents || squashHeight ? "auto" : "none", opacity: adornmentColor ? 1 : disabled ? 0.3 : 1, color: adornmentColor ? getValueFromPath(theme, adornmentColor) : "inherit", }) diff --git a/src/components/TextArea/TextArea.tsx b/src/components/TextArea/TextArea.tsx index 4bd6cff..42cd3ef 100644 --- a/src/components/TextArea/TextArea.tsx +++ b/src/components/TextArea/TextArea.tsx @@ -59,6 +59,11 @@ export interface TextAreaProps * overrides the padding */ overridePadding?: keyof Spacing; + + /** + * allows pointer events on adornment + */ + allowAdornmentPointerEvents?: boolean; } /** @@ -79,6 +84,7 @@ const TextArea = React.forwardRef((props, re noPadding, adornmentColor, overridePadding, + allowAdornmentPointerEvents, ...rest } = props; @@ -124,6 +130,7 @@ const TextArea = React.forwardRef((props, re overridePositionTop={overridePositionTop} disabled={props.disabled || false} position="left" + allowPointerEvents={allowAdornmentPointerEvents} > {props.startAdornment} @@ -152,6 +159,7 @@ const TextArea = React.forwardRef((props, re overridePositionTop={overridePositionTop} disabled={props.disabled || false} position="right" + allowPointerEvents={allowAdornmentPointerEvents} > {props.endAdornment} From f2c004df5e972e5076e5d7c2f84afbcd04c51392 Mon Sep 17 00:00:00 2001 From: Simon Bracegirdle Date: Tue, 25 Jun 2024 17:09:59 +0800 Subject: [PATCH 6/7] v0.0.192 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d3b2cf6..15125c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@govconnex/ui", - "version": "0.0.191-rc3", + "version": "0.0.192", "description": "GovConnex UI - React Component Library", "scripts": { "build:tokens": "./tokens-build.sh", From ee3850640144781e6b112a854ed8b1c19abf4d45 Mon Sep 17 00:00:00 2001 From: Simon Bracegirdle Date: Tue, 25 Jun 2024 17:16:52 +0800 Subject: [PATCH 7/7] Fix; unit tests --- src/components/Dropdown/Dropdown.test.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Dropdown/Dropdown.test.tsx b/src/components/Dropdown/Dropdown.test.tsx index 8139b06..e547b79 100644 --- a/src/components/Dropdown/Dropdown.test.tsx +++ b/src/components/Dropdown/Dropdown.test.tsx @@ -26,7 +26,7 @@ describe("Dropdown Component", () => { ); const input = getByRole("textbox"); - fireEvent.click(input); + fireEvent.focus(input); await waitFor(() => { expect(getByText("Option 1")).toBeInTheDocument(); @@ -41,7 +41,7 @@ describe("Dropdown Component", () => { ); const input = getByRole("textbox"); - fireEvent.click(input); + fireEvent.focus(input); const option1 = getByText("Option 1"); fireEvent.click(option1); @@ -54,7 +54,7 @@ describe("Dropdown Component", () => { ); const input = getByRole("textbox"); - fireEvent.click(input); + fireEvent.focus(input); const option1 = getByText("Option 1"); fireEvent.click(option1); @@ -66,7 +66,7 @@ describe("Dropdown Component", () => { it("renders search input when hasSearch is true", () => { const {getByRole} = render(); const input = getByRole("textbox"); - fireEvent.click(input); + fireEvent.focus(input); const searchInput = getByRole("searchbox"); expect(searchInput).toBeInTheDocument(); @@ -83,7 +83,7 @@ describe("Dropdown Component", () => { /> ); const input = getByRole("textbox"); - fireEvent.click(input); + fireEvent.focus(input); const clearButton = getByText("Clear Selection"); fireEvent.click(clearButton); @@ -102,7 +102,7 @@ describe("Dropdown Component", () => { /> ); const input = getByRole("textbox"); - fireEvent.click(input); + fireEvent.focus(input); const clearButton = getByText("Select All"); fireEvent.click(clearButton); @@ -120,7 +120,7 @@ describe("Dropdown Component", () => { /> ); const input = getByRole("textbox"); - fireEvent.click(input); + fireEvent.focus(input); await waitFor(() => { expect(getByText("inline-loading")).toBeInTheDocument();