* storybook v2 init * Merge config into storybook vite build * Remove path * Storybook config tweaks * Added styles and settings for storybook v2, and started working on button documentation and examples. * Badges + flex wrap on mobile * Breadcrumbs+button+avatar * Checkbox * Input + moving files around * WIP table * WIP table grid * Replaced imports for new components. * Added first steps for varianttable. * Small alignment fix. * Custom Args Table - With scrollbar * Adding table to components that need it + darkmode * Add intro * Fix types * Remove V1 storybook and replace with V2 * Fix badge type error * Fixed storybook dependencies * Added cover image to storybook * Remove vita from ts config, we dont use vite. * Fixed button import. * Explained postcss pseudo plugin. * Fixed badge import. * Add Avatar Stories * ButtonGroup Stories * Fixed imports * Add checkbox stories * Add exports for differnt types of inputs * Fix form and text area input * Fix mass import errors Co-authored-by: Jeroen Reumkens <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
30 lines
954 B
TypeScript
30 lines
954 B
TypeScript
import { ReactNode } from "react";
|
|
|
|
import { Badge, badgeClassNameByVariant } from "../../components/badge";
|
|
|
|
type Props = {
|
|
title: string;
|
|
description?: string;
|
|
badgeText?: string;
|
|
badgeVariant?: keyof typeof badgeClassNameByVariant;
|
|
infoIcon?: string;
|
|
rightAlignedComponent?: ReactNode;
|
|
};
|
|
|
|
function PageHeader({ title, description, rightAlignedComponent, badgeText, badgeVariant }: Props) {
|
|
return (
|
|
<div className="flex items-center">
|
|
<div className="mr-4 flex-col">
|
|
<div className="flex w-full items-center space-x-2">
|
|
<h1 className="font-cal text-xl font-semibold text-black">{title}</h1>
|
|
{badgeText && badgeVariant && <Badge variant={badgeVariant}>{badgeText}</Badge>}
|
|
</div>
|
|
<h2 className="text-sm text-gray-600">{description}</h2>
|
|
</div>
|
|
<div className="ml-auto ">{rightAlignedComponent && rightAlignedComponent}</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default PageHeader;
|