✨ warning in tabs
This commit is contained in:
parent
87d6e1e931
commit
635bd45b43
@ -6,6 +6,9 @@
|
||||
border-bottom: 1px solid var(--tabs-stroke, #d7dce0);
|
||||
cursor: pointer;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-1-5, 12px);
|
||||
&[data-is-selected="true"] {
|
||||
border-bottom: 2px solid var(--tabs-contrast-actived, #24282e);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import classes from "./classes.module.scss";
|
||||
import Typography, { ETypo, ETypoColor } from "@Front/Components/DesignSystem/Typography";
|
||||
import useHoverable from "@Front/Hooks/useHoverable";
|
||||
import { ITabValue } from "..";
|
||||
import { ExclamationCircleIcon } from "@heroicons/react/24/outline";
|
||||
export type ITab = {
|
||||
label: React.ReactNode;
|
||||
};
|
||||
@ -11,6 +12,7 @@ export type IProps<T> = {
|
||||
onSelect: (value: ITabValue<T>) => void;
|
||||
value: ITabValue<T>;
|
||||
isSelected: boolean;
|
||||
hasWarning?: boolean;
|
||||
} & ITab;
|
||||
|
||||
export default function HorizontalTabs<T>(props: IProps<T>) {
|
||||
@ -29,6 +31,7 @@ export default function HorizontalTabs<T>(props: IProps<T>) {
|
||||
color={!isHovered && !props.isSelected ? ETypoColor.TABS_CONTRAST_DEFAULT : ETypoColor.TABS_CONTRAST_ACTIVATED}>
|
||||
{props.label}
|
||||
</Typography>
|
||||
{props.hasWarning && <ExclamationCircleIcon width="24" height="24" color="var(--tabs-contrast-warning)" />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -8,11 +8,12 @@ import useOpenable from "@Front/Hooks/useOpenable";
|
||||
|
||||
export type ITabValue<T> = T & {
|
||||
id: unknown;
|
||||
}
|
||||
};
|
||||
|
||||
type ITabInternal<T> = ITab & {
|
||||
key?: string;
|
||||
value: ITabValue<T>;
|
||||
hasWarning?: boolean;
|
||||
};
|
||||
|
||||
type IProps<T> = {
|
||||
@ -100,6 +101,7 @@ export default function Tabs<T>({ onSelect, tabs: propsTabs }: IProps<T>) {
|
||||
value={element.value}
|
||||
onSelect={handleSelect}
|
||||
isSelected={element.value.id === selectedTab.id}
|
||||
hasWarning={element.hasWarning}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
@ -112,6 +114,7 @@ export default function Tabs<T>({ onSelect, tabs: propsTabs }: IProps<T>) {
|
||||
value={element.value}
|
||||
onSelect={handleSelect}
|
||||
isSelected={element.value.id === selectedTab.id}
|
||||
hasWarning={element.hasWarning}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user