From abd70709c94e76e9e65dd06fae498c4694f3044b Mon Sep 17 00:00:00 2001 From: Barsnes Date: Fri, 19 Apr 2024 08:33:36 +0200 Subject: [PATCH 1/4] style(Textarea): Add missing error border --- packages/react/src/components/form/Textarea/Textarea.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/components/form/Textarea/Textarea.module.css b/packages/react/src/components/form/Textarea/Textarea.module.css index 123577d0d9..a738e22f8e 100644 --- a/packages/react/src/components/form/Textarea/Textarea.module.css +++ b/packages/react/src/components/form/Textarea/Textarea.module.css @@ -66,7 +66,7 @@ border-color: var(--fds-semantic-border-neutral-default); } - .error > .textarea:not(:focus-visible) { + .textarea[aria-invalid='true']:not(:focus-visible) { border-color: var(--fds-semantic-border-danger-default); box-shadow: inset 0 0 0 1px var(--fds-semantic-border-danger-default); } From eb0216ecb05b3c5609c4b02bf514b2ffa216e55a Mon Sep 17 00:00:00 2001 From: Barsnes Date: Fri, 19 Apr 2024 08:41:27 +0200 Subject: [PATCH 2/4] hideLabel bool --- packages/react/src/components/form/Textarea/Textarea.stories.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react/src/components/form/Textarea/Textarea.stories.tsx b/packages/react/src/components/form/Textarea/Textarea.stories.tsx index 59e93d7aa5..3263923d4e 100644 --- a/packages/react/src/components/form/Textarea/Textarea.stories.tsx +++ b/packages/react/src/components/form/Textarea/Textarea.stories.tsx @@ -20,6 +20,7 @@ export const Preview: Story = { size: 'medium', description: '', error: '', + hideLabel: false, cols: 40, }, }; From 350c4c0a65c058093dc3cb4bb07addaba3ead00a Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 06:50:14 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8D=B1=20Generated=20new=20React=20CS?= =?UTF-8?q?S=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/css/react-css-modules.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/css/react-css-modules.css b/packages/css/react-css-modules.css index ec1d997e94..2037c67248 100644 --- a/packages/css/react-css-modules.css +++ b/packages/css/react-css-modules.css @@ -2216,7 +2216,7 @@ border-color: var(--fds-semantic-border-neutral-default); } - .fds-textarea-error-3d0e29bc > .fds-textarea-textarea-3d0e29bc:not(:focus-visible) { + .fds-textarea-textarea-3d0e29bc[aria-invalid='true']:not(:focus-visible) { border-color: var(--fds-semantic-border-danger-default); box-shadow: inset 0 0 0 1px var(--fds-semantic-border-danger-default); } From 75953eae09cb5b0f020766842852ee4090faeb21 Mon Sep 17 00:00:00 2001 From: Barsnes Date: Fri, 19 Apr 2024 08:55:11 +0200 Subject: [PATCH 4/4] do as in textfield --- packages/css/react-css-modules.css | 2 +- packages/react/src/components/form/Textarea/Textarea.module.css | 2 +- packages/react/src/components/form/Textarea/Textarea.tsx | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/css/react-css-modules.css b/packages/css/react-css-modules.css index 2037c67248..ec1d997e94 100644 --- a/packages/css/react-css-modules.css +++ b/packages/css/react-css-modules.css @@ -2216,7 +2216,7 @@ border-color: var(--fds-semantic-border-neutral-default); } - .fds-textarea-textarea-3d0e29bc[aria-invalid='true']:not(:focus-visible) { + .fds-textarea-error-3d0e29bc > .fds-textarea-textarea-3d0e29bc:not(:focus-visible) { border-color: var(--fds-semantic-border-danger-default); box-shadow: inset 0 0 0 1px var(--fds-semantic-border-danger-default); } diff --git a/packages/react/src/components/form/Textarea/Textarea.module.css b/packages/react/src/components/form/Textarea/Textarea.module.css index a738e22f8e..123577d0d9 100644 --- a/packages/react/src/components/form/Textarea/Textarea.module.css +++ b/packages/react/src/components/form/Textarea/Textarea.module.css @@ -66,7 +66,7 @@ border-color: var(--fds-semantic-border-neutral-default); } - .textarea[aria-invalid='true']:not(:focus-visible) { + .error > .textarea:not(:focus-visible) { border-color: var(--fds-semantic-border-danger-default); box-shadow: inset 0 0 0 1px var(--fds-semantic-border-danger-default); } diff --git a/packages/react/src/components/form/Textarea/Textarea.tsx b/packages/react/src/components/form/Textarea/Textarea.tsx index 898abd6551..21d5de11b7 100644 --- a/packages/react/src/components/form/Textarea/Textarea.tsx +++ b/packages/react/src/components/form/Textarea/Textarea.tsx @@ -83,6 +83,7 @@ export const Textarea = forwardRef( classes.formField, textareaProps.disabled && classes.disabled, readOnly && classes.readonly, + hasError && classes.error, className, )} >