34 lines
842 B
TypeScript
34 lines
842 B
TypeScript
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
||
|
|
import { HelpText } from './HelpText';
|
||
|
|
|
||
|
|
const meta = {
|
||
|
|
title: 'UI/HelpText',
|
||
|
|
component: HelpText,
|
||
|
|
tags: ['autodocs'],
|
||
|
|
argTypes: {
|
||
|
|
text: { control: 'text' },
|
||
|
|
position: {
|
||
|
|
control: 'select',
|
||
|
|
options: ['top', 'bottom', 'left', 'right'],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
} satisfies Meta<typeof HelpText>;
|
||
|
|
|
||
|
|
export default meta;
|
||
|
|
type Story = StoryObj<typeof meta>;
|
||
|
|
|
||
|
|
export const Default: Story = {
|
||
|
|
args: {
|
||
|
|
text: 'This is a helpful tooltip message.',
|
||
|
|
},
|
||
|
|
};
|
||
|
|
|
||
|
|
export const InlineExample: Story = {
|
||
|
|
render: () => (
|
||
|
|
<div className="flex items-center gap-2">
|
||
|
|
<span className="text-sm font-medium text-white">Password</span>
|
||
|
|
<HelpText text="Must be at least 8 characters long." />
|
||
|
|
</div>
|
||
|
|
),
|
||
|
|
};
|