Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/components/icon/Icon.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export const iconTable = {
ThumbsUp: 'far faThumbsUp',
ThumbsDown: 'far faThumbsDown',
Sidebar: 'fas faColumns',
Bookopen: 'fas faBookOpen',
};

type IconProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/textbadge/TextBadge.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const StyledTextBadge = styled.span<{ variant: TextBadgeVariant }>`
`}
`;
type Props = {
text: string;
text: React.ReactNode;
className?: string;
variant?: TextBadgeVariant;
} & React.HTMLAttributes<HTMLSpanElement>;
Expand Down
15 changes: 15 additions & 0 deletions stories/textbadge.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import { TextBadge } from '../src/lib/components/textbadge/TextBadge.component';
import { Wrapper, Title } from './common';
import { IconHelp } from '../src/lib/components/iconhelper/IconHelper';
import { Text } from '../src/lib/components/text/Text.component';
export default {
title: 'Components/TextBadge',
component: TextBadge,
Expand All @@ -21,6 +23,19 @@ export const Default = {
<TextBadge text="2" variant="statusWarning" />
<TextBadge text="3" variant="statusCritical" />
<TextBadge text="Badge" variant="infoSecondary" />
<TextBadge
text={
<>
<Text>This is a badge with a tooltip</Text>
<span style={{ marginLeft: '8px' }}>
<IconHelp
tooltipMessage={<div>This is a tooltip</div>}
title="Info"
/>
</span>
</>
}
/>
</Wrapper>
);
},
Expand Down
Loading