forked from NHSDigital/nhsuk-react-components-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaskedInput.stories.tsx
39 lines (37 loc) · 1.03 KB
/
MaskedInput.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from 'react';
// eslint-disable-next-line import/no-extraneous-dependencies
import { storiesOf } from '@storybook/react';
import { MaskedInput } from '../src';
const stories = storiesOf('MaskedInput', module);
stories
.add('National Insurance Mask', () => (
<div className="masked-input-demo">
<MaskedInput
name="ni-number"
hint="It's on your National Insurance card, benefit letter, payslip or P60. For example, QQ 12 34 56 C"
label="National Insurance Number"
width="10"
mask="AA 99 99 99 A"
formatChars={{
9: '[0-9]',
A: '[A-Za-z]',
}}
maskChar=""
alwaysShowMask={false}
/>
</div>
))
.add('NHS Number Mask', () => (
<div className="masked-input-demo">
<MaskedInput
name="ni-number"
hint="Your 10 Digit NHS Number"
label="NHS Number"
width="10"
mask="999 999 9999"
maskChar=""
autoComplete="off"
alwaysShowMask={false}
/>
</div>
));