import type { Meta, StoryObj } from "@storybook/react" import { PasswordInput, PasswordInputAdornment, PasswordInputAdornmentToggle, PasswordInputInput, } from "./InputPassword" /** * The PasswordInput component is a specialized input for password entry that * includes built-in functionality to show/hide the password. */ const meta = { title: "base/form/PasswordInput", component: PasswordInput, parameters: { layout: "centered", }, tags: ["autodocs"], } satisfies Meta export default meta type Story = StoryObj /** * Default implementation of the password input with visibility toggle. */ export const Default: Story = { render: () => ( ), } /** * The password input component with controlled visibility state. */ export const ControlledVisibility: Story = { render: () => { // In a real implementation, you'd use React.useState here const visible = false const setVisible = () => console.log("Toggle visibility") return ( ) }, } /** * Password input with a custom leading icon for additional context. */ export const WithLeadingIcon: Story = { render: () => ( ), } /** * Disabled-like styling for the password input component. * Note: Apply disabled styling through CSS since the component doesn't directly support a disabled prop. */ export const DisabledStyling: Story = { render: () => (
), } /** * Password input with error styling for validation feedback. */ export const WithError: Story = { render: () => (

Password must be at least 8 characters

), } /** * Password input with different sizes for various use cases. */ export const Sizes: Story = { render: () => (
Small
Medium (Default)
Large
), } /** * Password input with pre-filled value for editing scenarios. */ export const WithValue: Story = { render: () => ( {}} /> ), } /** * Password input with multiple validation indicators. */ export const WithPasswordStrengthIndicator: Story = { render: () => { // Medium strength - pre-calculated values without conditionals const barClasses = [ "bg-green-500", // First bar is green for medium strength "bg-green-500", // Second bar is green for medium strength "bg-gray-200", // Third bar is gray for medium strength ] // Display name without conditionals const strengthName = "Medium" return (

Password strength: {strengthName}

) }, }