feat(web): PageTitle h1 component + story (#57)
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
||||||
|
import { expect } from 'storybook/test'
|
||||||
|
|
||||||
|
import { PageTitle } from './page-title'
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
component: PageTitle,
|
||||||
|
args: { children: 'Objects' },
|
||||||
|
tags: ['ai-generated'],
|
||||||
|
} satisfies Meta<typeof PageTitle>
|
||||||
|
|
||||||
|
export default meta
|
||||||
|
type Story = StoryObj<typeof meta>
|
||||||
|
|
||||||
|
export const Default: Story = {
|
||||||
|
play: async ({ canvas }) => {
|
||||||
|
await expect(canvas.getByRole('heading', { level: 1, name: 'Objects' })).toBeInTheDocument()
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import type { ComponentProps } from "react";
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
export function PageTitle({ className, ...props }: ComponentProps<"h1">) {
|
||||||
|
return (
|
||||||
|
<h1
|
||||||
|
data-slot="page-title"
|
||||||
|
className={cn("text-2xl font-semibold tracking-tight", className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user