From 9dfa30b5e0bb20381757c28dbb296293d43a3f62 Mon Sep 17 00:00:00 2001 From: Daniela Muller Date: Wed, 26 Jun 2024 12:03:20 -0300 Subject: [PATCH 01/14] feat: adjust alert component --- .../ocean-core/src/components/_alert.scss | 39 ++++++++++++++++++- packages/ocean-react/src/Alert/Alert.tsx | 5 ++- .../src/Alert/stories/Alert.stories.mdx | 1 + 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/packages/ocean-core/src/components/_alert.scss b/packages/ocean-core/src/components/_alert.scss index 30ec5a3de..d107e5fe6 100644 --- a/packages/ocean-core/src/components/_alert.scss +++ b/packages/ocean-core/src/components/_alert.scss @@ -13,11 +13,18 @@ padding: $spacing-stack-xs; @include media-breakpoint-up(sm) { + flex-direction: row; + &__button--mobile { display: none; } } + &--with-button { + padding: $spacing-stack-xs $spacing-stack-xs $spacing-stack-xxs-extra + $spacing-stack-xs; + } + &--error { background-color: $color-status-negative-up; @@ -33,6 +40,15 @@ background-color: $color-status-negative-pure; } + .ods-btn--primary:hover, + .ods-btn--primary:focus { + background-color: $color-status-negative-down; + } + + .ods-btn--primary:active { + background-color: $color-status-negative-deep; + } + .ods-link { color: $color-status-negative-pure; } @@ -53,6 +69,15 @@ background-color: $color-status-warning-deep; } + .ods-btn--primary:hover, + .ods-btn--primary:focus { + background-color: $color-status-warning-down; + } + + .ods-btn--primary:active { + background-color: $color-status-warning-deep; + } + .ods-link { color: $color-status-warning-deep; } @@ -73,6 +98,15 @@ background-color: $color-status-positive-deep; } + .ods-btn--primary:hover, + .ods-btn--primary:focus { + background-color: $color-status-positive-down; + } + + .ods-btn--primary:active { + background-color: $color-status-positive-deep; + } + .ods-link { color: $color-status-positive-deep; } @@ -82,6 +116,7 @@ display: flex; flex: 1; flex-direction: column; + gap: 2px; } &__icon { @@ -96,7 +131,7 @@ } &--mobile { - margin-top: $spacing-stack-xxs; + margin: $spacing-stack-xxs-extra 0 0 $spacing-inline-md; } .ods-btn { @@ -119,6 +154,6 @@ color: $color-brand-primary-down; font-size: $font-size-xxs; font-weight: $font-weight-bold; - line-height: $line-height-comfy; + line-height: $line-height-loose; } } diff --git a/packages/ocean-react/src/Alert/Alert.tsx b/packages/ocean-react/src/Alert/Alert.tsx index 301cbd79e..cae4b5e55 100644 --- a/packages/ocean-react/src/Alert/Alert.tsx +++ b/packages/ocean-react/src/Alert/Alert.tsx @@ -62,12 +62,13 @@ const Alert = React.forwardRef( 'ods-alert', `ods-alert--${type}`, longSize && 'ods-alert--long', + button && 'ods-alert--with-button', className )} {...rest} > {longSize ? ( - <> +
( )}
{title &&
{children}
} - +
) : ( <>
Date: Thu, 27 Jun 2024 14:17:40 -0300 Subject: [PATCH 02/14] chore: change icon link to chevron --- packages/ocean-react/src/Alert/Alert.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ocean-react/src/Alert/Alert.tsx b/packages/ocean-react/src/Alert/Alert.tsx index cae4b5e55..d3d609587 100644 --- a/packages/ocean-react/src/Alert/Alert.tsx +++ b/packages/ocean-react/src/Alert/Alert.tsx @@ -107,7 +107,7 @@ const Alert = React.forwardRef(
{button && (
- + {button}
From 5ed7810927003d5e2b24deb3f4e2f9a076a1001e Mon Sep 17 00:00:00 2001 From: Daniela Muller Date: Thu, 27 Jun 2024 14:29:19 -0300 Subject: [PATCH 03/14] test: update snapshot --- .../src/Alert/__tests__/Alert.test.tsx | 122 +++++++++--------- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/packages/ocean-react/src/Alert/__tests__/Alert.test.tsx b/packages/ocean-react/src/Alert/__tests__/Alert.test.tsx index d274c3c36..9fac52c5b 100644 --- a/packages/ocean-react/src/Alert/__tests__/Alert.test.tsx +++ b/packages/ocean-react/src/Alert/__tests__/Alert.test.tsx @@ -66,52 +66,20 @@ describe('Alert', () => { setup({ title: 'Test Title', size: 'long' }); expect(document.querySelector('.ods-alert')).toMatchInlineSnapshot(` - - `); - }); - - test('checks short description snapshot', () => { - setup({ title: 'Test Title', size: 'short' }); - - expect(document.querySelector('.ods-alert')).toMatchInlineSnapshot(` - {button && (
- + {button}