import type { Meta, StoryObj } from "@storybook/react" import { Indicator, Input, Root, Toggle } from "./input-password-primitive" /** * The InputPasswordPrimitive provides low-level components for building password input interfaces * with show/hide password functionality. */ const meta = { title: "base/form/InputPasswordPrimitive", component: Root, parameters: { layout: "centered", }, tags: ["autodocs"], } satisfies Meta export default meta type Story = StoryObj /** * Basic implementation of the password primitive with toggle functionality. */ export const Default: Story = { render: args => (
Show/Hide
), } /** * Using the Indicator component to show custom content based on visibility state. */ export const WithIndicator: Story = { render: args => (
Password visible Password hidden Toggle
), } /** * Custom styled version with icons for toggle state. */ export const CustomStyledToggle: Story = { render: args => (
), } /** * Password input with controlled visibility state. */ export const ControlledVisibility: Story = { args: { visible: true, }, render: args => (
console.log("Visibility changed:", visible)}>
{args.visible ? "Hide" : "Show"}
Password is currently {args.visible ? "visible" : "hidden"}
), } /** * Demonstrating the password input with initial default visible state. */ export const DefaultVisible: Story = { args: { defaultVisible: true, }, render: args => (
Toggle
Note: This password is set to be visible by default
), }