Skip to content

Commit

Permalink
fix(design-system): Messages adjustments (#5015)
Browse files Browse the repository at this point in the history
  • Loading branch information
romainseb authored Nov 28, 2023
1 parent b5fc2c3 commit 5c5924a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-pets-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/design-system': patch
---

fix: Messages adjustments
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,19 @@ export const MessagePrimitive = forwardRef(
{children}
<StackHorizontal gap={0} isFullWidth align="center" justify="spaceBetween">
{action && <ButtonTertiary {...action} />}
{additionalIconAction && <ButtonIcon {...additionalIconAction} size="XS" />}
{additionalIconAction && (
<div className={styles.message__actions}>
<ButtonIcon {...additionalIconAction} size="XS" />
</div>
)}
{additionalDropdownActions && (
<Dropdown {...additionalDropdownActions}>
<ButtonIcon size="XS" icon="dots-vertical" onClick={() => {}}>
{t('ADDITIONAL_ACTIONS', 'Additional actions')}
</ButtonIcon>
</Dropdown>
<div className={styles.message__actions}>
<Dropdown {...additionalDropdownActions}>
<ButtonIcon size="XS" icon="dots-vertical" onClick={() => {}}>
{t('ADDITIONAL_ACTIONS', 'Additional actions')}
</ButtonIcon>
</Dropdown>
</div>
)}
</StackHorizontal>
</StackVertical>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
border: tokens.$coral-border-s-solid tokens.$coral-color-neutral-border-weak;
background-color: tokens.$coral-color-neutral-background;
height: 100%;
width: 100%;

border-top-left-radius: tokens.$coral-radius-s;
border-bottom-left-radius: tokens.$coral-radius-s;
Expand All @@ -23,6 +24,10 @@
}
}

&__actions {
margin-left: auto;
}

&__description {
font: tokens.$coral-paragraph-m;
color: tokens.$coral-color-neutral-text-weak;
Expand Down
15 changes: 13 additions & 2 deletions packages/design-system/src/stories/messaging/Message.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export const DefaultMessageDemo = () => (
titleInfo="1 minute ago"
description="There is an issue with the component configuration"
link={{ href: 'https://talend.com', children: 'Learn more' }}
action={{ children: 'See', onClick: action('action clicked') }}
additionalIconAction={{
children: 'Dismiss',
onClick: action('dismiss clicked'),
icon: 'trash',
}}
>
<StackHorizontal gap="S">
<TagDestructive>Error</TagDestructive> <TagDefault>Default</TagDefault>
Expand All @@ -53,7 +57,14 @@ export const DefaultMessageDemo = () => (
title="Type incompatibilities"
description="Maybe resolve this issue before doing anything else"
link={{ href: 'https://talend.com', children: 'Learn more' }}
action={{ children: 'See', onClick: action('action clicked') }}
additionalDropdownActions={{
'aria-label': 'Additional actions',
items: [
{ label: 'Select all', type: 'button', onClick: action('select all clicked') },
{ label: 'Dismiss', type: 'button', onClick: action('dismiss clicked') },
{ label: 'Delete', type: 'button', onClick: action('delete clicked') },
],
}}
>
<StackHorizontal gap="S">
<TagWarning>Bindings</TagWarning> <TagDefault>Default</TagDefault>
Expand Down

0 comments on commit 5c5924a

Please sign in to comment.