(react) add InputPassword

We had the need to have a built-in password input able to show or
hide the password.

Closes #301
This commit is contained in:
Nathan Vasse
2024-03-13 15:29:18 +01:00
committed by NathanVss
parent c63aff4861
commit a8ec9fb757
8 changed files with 110 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import { Canvas, Meta, Story, Source, ArgTypes } from '@storybook/blocks';
import { Input } from "./index";
import * as Stories from './index.stories';
import * as InputPasswordStories from './InputPassword.stories';
<Meta of={Stories}/>
@@ -65,6 +66,12 @@ in mind to also define `charCounterMax`.
<Canvas of={Stories.CharCounter} sourceState="shown"/>
## Password
You can also use a built-in password input that includes a button to show or hide the password.
<Canvas of={InputPasswordStories.Password} sourceState="shown"/>
## Controlled / Non Controlled
Like a native input, you can use the Input component in a controlled or non controlled way. You can see the example below