Skip to content

Commit 3a35240

Browse files
committed
chore: improve storybook for passwordinput
1 parent 4585d43 commit 3a35240

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/components/PasswordInput/PasswordMeter.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ $ERROR: #ec3f3f;
55
.deriv-password__meter__bar {
66
height: 100%;
77
border-radius: 0px 0px 4px 4px;
8-
transition: "width 0.25s ease-in-out";
8+
transition: width 0.25s ease-in-out;
99

1010
&__initial {
1111
background-color: $NEUTRAL;

src/stories/PasswordInput.stories.ts src/stories/PasswordInput.stories.tsx

+17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { StoryObj, Meta } from "@storybook/react";
22
import { PasswordInput } from "../../lib/main";
3+
import { useState } from "react";
34

45
const meta = {
56
title: "Components/PasswordInput",
@@ -16,6 +17,11 @@ const meta = {
1617
hint: "Password should have lower and uppercase English letters with numbers.",
1718
},
1819
argTypes: {
20+
value: {
21+
control: {
22+
disable: true,
23+
},
24+
},
1925
autoComplete: {
2026
control: {
2127
disable: true,
@@ -50,4 +56,15 @@ export const Default: Story = {
5056
onChange: () => {},
5157
hidePasswordMeter: false,
5258
},
59+
render: (args) => {
60+
const [value, setValue] = useState("");
61+
62+
return (
63+
<PasswordInput
64+
{...args}
65+
value={value}
66+
onChange={(e) => setValue(e.target.value)}
67+
/>
68+
);
69+
},
5370
};

0 commit comments

Comments
 (0)