Skip to content

Commit

Permalink
error on tab title
Browse files Browse the repository at this point in the history
  • Loading branch information
sgendre committed Oct 10, 2023
1 parent c131b33 commit 699144c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type TabChildren =
title: string;
icon?: IconNameWithSize<'S'>;
tag?: string | number;
error?: boolean;
}
| { children: string };

Expand Down Expand Up @@ -53,13 +54,16 @@ const Tab = forwardRef((props: TabPropsTypes, ref: Ref<HTMLButtonElement>) => {
);
}

const { icon, title, tag, size, ...rest } = otherProps;
const { icon, title, tag, size, error, ...rest } = otherProps;
return (
<ReakitTab
{...rest}
type="button"
ref={ref}
className={classnames(styles.tab, { [styles.tab_large]: size === 'L' })}
className={classnames(styles.tab, {
[styles.tab_large]: size === 'L',
[styles.tab_error]: error === true,
})}
>
<StackHorizontal gap="XXS" align="center" display="inline">
{icon && <SizedIcon size="S" name={icon} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,8 @@
margin-right: tokens.$coral-spacing-s;
}
}

&_error{
color: tokens.$coral-color-danger-text;
}
}

0 comments on commit 699144c

Please sign in to comment.