Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2465 from teamleadercrm/fix/message-boxprops
Browse files Browse the repository at this point in the history
Make `MessageProps` extend `BoxProps`
  • Loading branch information
qubis741 authored Nov 23, 2022
2 parents 1ebee42 + de10c4b commit 10a2587
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Changed

- `Message`: Make `MessageProps` extend the `BoxProps` and make `title` property optional ([@kristofcolpaert](https://github.com/kristofcolpaert)) in [#2465](https://github.com/teamleadercrm/ui/pull/2465))
- `Dialog`: Added z-index to scroll shadow to make sure it appears above inner elements ([@BeirlaenAaron](https://github.com/BeirlaenAaron)) in ([#2463](https://github.com/teamleadercrm/ui/pull/2463))

### Deprecated
Expand Down
6 changes: 3 additions & 3 deletions src/components/message/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
IconCloseMediumOutline,
IconWarningBadgedMediumFilled,
} from '@teamleader/ui-icons';
import Box from '../box';
import Box, { BoxProps } from '../box';
import Button from '../button';
import ButtonGroup from '../buttonGroup';
import Icon from '../icon';
Expand Down Expand Up @@ -52,7 +52,7 @@ const iconMap = {
warning: IconWarningBadgedMediumFilled,
};

export interface MessageProps {
export interface MessageProps extends Omit<BoxProps, 'children'> {
/** The content to display inside the message. */
children: React.ReactNode;
/** If true, the message will be rendered inline instead of taking full width. */
Expand All @@ -68,7 +68,7 @@ export interface MessageProps {
/** A status type to determine color and icon */
status?: Status;
/** The message title */
title: React.ReactNode;
title?: React.ReactNode;
}

const Message: GenericComponent<MessageProps> = ({
Expand Down
9 changes: 9 additions & 0 deletions src/components/message/message.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,12 @@ export const WithStatus = () => (
</TextBody>
</Message>
);

export const WithoutTitle = () => (
<Message status="info">
<TextBody color="teal">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam <Link inherit={false}>nonumy eirmod</Link>{' '}
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
</TextBody>
</Message>
);

0 comments on commit 10a2587

Please sign in to comment.