Skip to content

Commit eabd88f

Browse files
authored
IBX-10678: HelperText: When no content provided, only icon is visible (#46)
1 parent 1b36734 commit eabd88f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/components/src/components/HelperText/HelperText.stories.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,10 @@ export const Error: Story = {
3939
type: HelperTextType.Error,
4040
},
4141
};
42+
43+
export const Empty: Story = {
44+
name: 'Empty',
45+
args: {
46+
children: '',
47+
},
48+
};

packages/components/src/components/HelperText/HelperText.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ const ICONS_TYPE_MAP = {
1111
} as const;
1212

1313
export const HelperText = ({ children, className = '', title = '', type = HelperTextType.Default }: HelperTextProps) => {
14+
if (!children) {
15+
return null;
16+
}
17+
1418
const componentClassName = createCssClassNames({
1519
'ids-helper-text': true,
1620
[`ids-helper-text--${type}`]: !!type,

0 commit comments

Comments
 (0)