@navikt/ds-react 0.19.0 → 0.19.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/accordion/AccordionContent.js +1 -1
- package/cjs/form/Textarea.js +6 -3
- package/esm/accordion/AccordionContent.js +1 -1
- package/esm/accordion/AccordionContent.js.map +1 -1
- package/esm/form/Textarea.js +7 -4
- package/esm/form/Textarea.js.map +1 -1
- package/package.json +10 -8
- package/src/accordion/AccordionContent.tsx +1 -1
- package/src/accordion/accordion.stories.tsx +33 -27
- package/src/form/Textarea.tsx +11 -2
- package/src/form/stories/confirmation-panel.stories.tsx +68 -43
- package/src/form/stories/fieldset.stories.tsx +97 -58
- package/src/form/stories/select.stories.tsx +86 -42
- package/src/form/stories/switch.stories.tsx +89 -76
- package/src/form/stories/text-field.stories.tsx +57 -53
- package/src/form/stories/textarea.stories.tsx +84 -77
- package/src/link-panel/stories/link-panel.stories.tsx +10 -12
- package/src/tooltip/tooltip.stories.tsx +52 -117
- package/src/form/stories/confirmation-panel.stories.mdx +0 -59
- package/src/form/stories/fieldset.stories.mdx +0 -136
- package/src/form/stories/live-examples.tsx +0 -26
- package/src/form/stories/select.stories.mdx +0 -134
- package/src/form/stories/switch.stories.mdx +0 -174
- package/src/form/stories/text-field.stories.mdx +0 -86
- package/src/form/stories/textarea.stories.mdx +0 -167
|
@@ -2,69 +2,113 @@ import React from "react";
|
|
|
2
2
|
import { Select } from "../index";
|
|
3
3
|
import { Meta } from "@storybook/react/types-6-0";
|
|
4
4
|
export default {
|
|
5
|
-
title: "ds-react/form/
|
|
5
|
+
title: "ds-react/form/Select",
|
|
6
6
|
component: Select,
|
|
7
|
+
argTypes: {
|
|
8
|
+
size: {
|
|
9
|
+
control: {
|
|
10
|
+
type: "radio",
|
|
11
|
+
options: ["medium", "small"],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
type: "string",
|
|
16
|
+
},
|
|
17
|
+
error: {
|
|
18
|
+
type: "string",
|
|
19
|
+
},
|
|
20
|
+
hideLabel: {
|
|
21
|
+
type: "boolean",
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
type: "boolean",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
7
27
|
} as Meta;
|
|
8
28
|
|
|
9
|
-
|
|
29
|
+
const content = (
|
|
30
|
+
<>
|
|
31
|
+
<option value="">Velg land</option>
|
|
32
|
+
<option value="norge">Norge</option>
|
|
33
|
+
<option value="sverige">Sverige</option>
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
export const Default = (props) => {
|
|
10
38
|
return (
|
|
11
|
-
<
|
|
12
|
-
|
|
39
|
+
<Select {...props} label="Ipsum enim quis culpa">
|
|
40
|
+
{content}
|
|
41
|
+
</Select>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
13
44
|
|
|
14
|
-
|
|
15
|
-
<option value="">Velg land</option>
|
|
16
|
-
<option value="norge">Norge</option>
|
|
17
|
-
<option value="sverige">Sverige</option>
|
|
18
|
-
</Select>
|
|
45
|
+
Default.args = {};
|
|
19
46
|
|
|
20
|
-
|
|
47
|
+
export const Small = () => {
|
|
48
|
+
return (
|
|
49
|
+
<Select size="small" label="Ipsum enim quis culpa">
|
|
50
|
+
{content}
|
|
51
|
+
</Select>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
21
54
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
export const Description = () => {
|
|
56
|
+
return (
|
|
57
|
+
<div className="colgap">
|
|
58
|
+
<Select
|
|
59
|
+
label="Ipsum enim quis culpa"
|
|
60
|
+
description="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
61
|
+
>
|
|
62
|
+
{content}
|
|
26
63
|
</Select>
|
|
27
|
-
|
|
28
|
-
<h2>Errors</h2>
|
|
29
|
-
|
|
30
64
|
<Select
|
|
31
65
|
label="Ipsum enim quis culpa"
|
|
32
|
-
description="
|
|
33
|
-
|
|
66
|
+
description="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
67
|
+
size="small"
|
|
34
68
|
>
|
|
35
|
-
|
|
36
|
-
<option value="norge">Norge</option>
|
|
37
|
-
<option value="sverige">Sverige</option>
|
|
69
|
+
{content}
|
|
38
70
|
</Select>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
39
74
|
|
|
40
|
-
|
|
41
|
-
|
|
75
|
+
export const Error = () => {
|
|
76
|
+
return (
|
|
77
|
+
<div className="colgap">
|
|
42
78
|
<Select
|
|
43
79
|
label="Ipsum enim quis culpa"
|
|
44
|
-
|
|
45
|
-
|
|
80
|
+
error="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
81
|
+
>
|
|
82
|
+
{content}
|
|
83
|
+
</Select>
|
|
84
|
+
<Select
|
|
85
|
+
label="Ipsum enim quis culpa"
|
|
86
|
+
error="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
46
87
|
size="small"
|
|
47
88
|
>
|
|
48
|
-
|
|
49
|
-
<option value="norge">Norge</option>
|
|
50
|
-
<option value="sverige">Sverige</option>
|
|
89
|
+
{content}
|
|
51
90
|
</Select>
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
52
94
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<option value="sverige">Sverige</option>
|
|
95
|
+
export const Disabled = () => {
|
|
96
|
+
return (
|
|
97
|
+
<div className="colgap">
|
|
98
|
+
<Select label="Ipsum enim quis culpa" disabled>
|
|
99
|
+
{content}
|
|
59
100
|
</Select>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<Select label="Ipsum enim quis culpa" description="Aute enim" disabled>
|
|
64
|
-
<option value="">Velg land</option>
|
|
65
|
-
<option value="norge">Norge</option>
|
|
66
|
-
<option value="sverige">Sverige</option>
|
|
101
|
+
<Select label="Ipsum enim quis culpa" disabled size="small">
|
|
102
|
+
{content}
|
|
67
103
|
</Select>
|
|
68
104
|
</div>
|
|
69
105
|
);
|
|
70
106
|
};
|
|
107
|
+
|
|
108
|
+
export const HideLabel = () => {
|
|
109
|
+
return (
|
|
110
|
+
<Select label="Ipsum enim quis culpa" hideLabel>
|
|
111
|
+
{content}
|
|
112
|
+
</Select>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
@@ -1,104 +1,117 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { Switch } from "../index";
|
|
3
1
|
import { Meta } from "@storybook/react/types-6-0";
|
|
4
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Switch } from "../index";
|
|
4
|
+
|
|
5
5
|
export default {
|
|
6
|
-
title: "ds-react/form/
|
|
6
|
+
title: "ds-react/form/Switch",
|
|
7
7
|
component: Switch,
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: {
|
|
10
|
+
control: {
|
|
11
|
+
type: "radio",
|
|
12
|
+
options: ["medium", "small"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
position: {
|
|
16
|
+
control: {
|
|
17
|
+
type: "radio",
|
|
18
|
+
options: ["right", "left"],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
description: {
|
|
22
|
+
type: "string",
|
|
23
|
+
},
|
|
24
|
+
hideLabel: {
|
|
25
|
+
type: "boolean",
|
|
26
|
+
},
|
|
27
|
+
disabled: {
|
|
28
|
+
type: "boolean",
|
|
29
|
+
},
|
|
30
|
+
loading: {
|
|
31
|
+
type: "boolean",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
8
34
|
} as Meta;
|
|
9
35
|
|
|
10
|
-
export const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<div style={{ width: "fit-content" }}>
|
|
15
|
-
<h1>Switch</h1>
|
|
16
|
-
<Switch>Label text</Switch>
|
|
17
|
-
<Switch position="right">Label text</Switch>
|
|
18
|
-
|
|
19
|
-
<h2>Switch w/Description</h2>
|
|
20
|
-
<Switch>Label text</Switch>
|
|
21
|
-
<Switch description="Switch description">Label text</Switch>
|
|
22
|
-
<Switch>Label text</Switch>
|
|
23
|
-
|
|
24
|
-
<Switch position="right">Label text</Switch>
|
|
25
|
-
<Switch position="right" description="Switch description">
|
|
26
|
-
Label text
|
|
27
|
-
</Switch>
|
|
28
|
-
<Switch position="right">Label text</Switch>
|
|
36
|
+
export const Default = (props) => {
|
|
37
|
+
return <Switch {...props}>Label text</Switch>;
|
|
38
|
+
};
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<Switch description="Switch description" hideLabel>
|
|
35
|
-
Label text
|
|
36
|
-
</Switch>
|
|
37
|
-
<Switch hideLabel size="small">
|
|
38
|
-
Label text small
|
|
39
|
-
</Switch>
|
|
40
|
-
<Switch position="right" description="Switch description" hideLabel>
|
|
41
|
-
Label text
|
|
42
|
-
</Switch>
|
|
43
|
-
<Switch position="right" description="Switch description" hideLabel>
|
|
44
|
-
Label text
|
|
45
|
-
</Switch>
|
|
46
|
-
<Switch position="right" hideLabel size="small">
|
|
47
|
-
Label text small
|
|
48
|
-
</Switch>
|
|
40
|
+
Default.args = {
|
|
41
|
+
checked: false,
|
|
42
|
+
position: "right",
|
|
43
|
+
};
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
export const Small = () => {
|
|
46
|
+
return (
|
|
47
|
+
<div className="colgap">
|
|
51
48
|
<Switch size="small">Label text</Switch>
|
|
52
|
-
<Switch
|
|
49
|
+
<Switch size="small" position="right">
|
|
53
50
|
Label text
|
|
54
51
|
</Switch>
|
|
55
|
-
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<Switch
|
|
56
|
+
export const Description = () => {
|
|
57
|
+
return (
|
|
58
|
+
<div className="colgap">
|
|
59
|
+
<Switch size="small" description="Cillum sint exercitation ut cillum.">
|
|
61
60
|
Label text
|
|
62
61
|
</Switch>
|
|
63
|
-
<Switch
|
|
62
|
+
<Switch
|
|
63
|
+
size="small"
|
|
64
|
+
position="right"
|
|
65
|
+
description="Cillum sint exercitation ut cillum."
|
|
66
|
+
>
|
|
64
67
|
Label text
|
|
65
68
|
</Switch>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
export const Loading = () => {
|
|
74
|
+
return (
|
|
75
|
+
<div className="colgap">
|
|
76
|
+
<div className="colgap">
|
|
77
|
+
<Switch loading>Label text</Switch>
|
|
71
78
|
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
<Switch checked loading>
|
|
80
|
+
Label text
|
|
81
|
+
</Switch>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="colgap">
|
|
84
|
+
<Switch loading size="small">
|
|
85
|
+
Label text
|
|
86
|
+
</Switch>
|
|
87
|
+
<Switch checked loading size="small">
|
|
88
|
+
Label text
|
|
89
|
+
</Switch>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
74
94
|
|
|
75
|
-
|
|
95
|
+
export const Disabled = () => {
|
|
96
|
+
return (
|
|
97
|
+
<div className="colgap">
|
|
76
98
|
<Switch disabled>Label text</Switch>
|
|
77
|
-
|
|
99
|
+
|
|
100
|
+
<Switch checked disabled>
|
|
78
101
|
Label text
|
|
79
102
|
</Switch>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
80
106
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</Fieldset>
|
|
107
|
+
export const HideLabel = () => {
|
|
108
|
+
return (
|
|
109
|
+
<div className="colgap">
|
|
110
|
+
<Switch hideLabel>Label text</Switch>
|
|
86
111
|
|
|
87
|
-
<
|
|
88
|
-
<Switch loading>Label text</Switch>
|
|
89
|
-
<Switch size="small" loading>
|
|
90
|
-
Label text
|
|
91
|
-
</Switch>
|
|
92
|
-
<Switch disabled loading>
|
|
93
|
-
Label text
|
|
94
|
-
</Switch>
|
|
95
|
-
<Switch checked loading>
|
|
112
|
+
<Switch checked hideLabel>
|
|
96
113
|
Label text
|
|
97
114
|
</Switch>
|
|
98
|
-
<button onClick={() => setLoadingState(!loadingState)}>
|
|
99
|
-
Toggle loading
|
|
100
|
-
</button>
|
|
101
|
-
<Switch loading={loadingState}>Label text</Switch>
|
|
102
115
|
</div>
|
|
103
116
|
);
|
|
104
117
|
};
|
|
@@ -2,78 +2,82 @@ import React from "react";
|
|
|
2
2
|
import { TextField } from "../index";
|
|
3
3
|
import { Meta } from "@storybook/react/types-6-0";
|
|
4
4
|
export default {
|
|
5
|
-
title: "ds-react/form/
|
|
5
|
+
title: "ds-react/form/TextField",
|
|
6
6
|
component: TextField,
|
|
7
|
+
argTypes: {
|
|
8
|
+
size: {
|
|
9
|
+
control: {
|
|
10
|
+
type: "radio",
|
|
11
|
+
options: ["medium", "small"],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
type: "string",
|
|
16
|
+
},
|
|
17
|
+
error: {
|
|
18
|
+
type: "string",
|
|
19
|
+
},
|
|
20
|
+
hideLabel: {
|
|
21
|
+
type: "boolean",
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
type: "boolean",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
7
27
|
} as Meta;
|
|
8
28
|
|
|
9
|
-
export const
|
|
10
|
-
return
|
|
11
|
-
|
|
12
|
-
<h1>TextField</h1>
|
|
13
|
-
|
|
14
|
-
<TextField label="Laborum excepteur" />
|
|
15
|
-
|
|
16
|
-
<h2>Description</h2>
|
|
17
|
-
|
|
18
|
-
<TextField
|
|
19
|
-
label="Laborum excepteur"
|
|
20
|
-
description={<div>Cillum mollit</div>}
|
|
21
|
-
/>
|
|
29
|
+
export const Default = (props) => {
|
|
30
|
+
return <TextField {...props} label="Ipsum enim quis culpa" />;
|
|
31
|
+
};
|
|
22
32
|
|
|
23
|
-
|
|
24
|
-
<TextField label="Passord" type="password" />
|
|
33
|
+
Default.args = {};
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
export const Small = () => {
|
|
36
|
+
return <TextField size="small" label="Ipsum enim quis culpa" />;
|
|
37
|
+
};
|
|
27
38
|
|
|
39
|
+
export const Description = () => {
|
|
40
|
+
return (
|
|
41
|
+
<div className="colgap">
|
|
28
42
|
<TextField
|
|
29
|
-
label="
|
|
30
|
-
description="
|
|
31
|
-
error="TextField error"
|
|
43
|
+
label="Ipsum enim quis culpa"
|
|
44
|
+
description="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
32
45
|
/>
|
|
33
|
-
|
|
34
|
-
<h2>Sizing</h2>
|
|
35
|
-
|
|
36
46
|
<TextField
|
|
47
|
+
label="Ipsum enim quis culpa"
|
|
48
|
+
description="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
37
49
|
size="small"
|
|
38
|
-
label="Laborum excepteur"
|
|
39
|
-
description="Cillum mollit"
|
|
40
|
-
error="TextField error"
|
|
41
50
|
/>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
42
54
|
|
|
43
|
-
|
|
44
|
-
|
|
55
|
+
export const Error = () => {
|
|
56
|
+
return (
|
|
57
|
+
<div className="colgap">
|
|
45
58
|
<TextField
|
|
46
|
-
label="
|
|
47
|
-
|
|
48
|
-
hideLabel
|
|
59
|
+
label="Ipsum enim quis culpa"
|
|
60
|
+
error="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
49
61
|
/>
|
|
50
62
|
|
|
51
|
-
<h2>Disabled</h2>
|
|
52
|
-
|
|
53
|
-
<TextField
|
|
54
|
-
label="Laborum excepteur"
|
|
55
|
-
description="Cillum mollit"
|
|
56
|
-
disabled
|
|
57
|
-
/>
|
|
58
63
|
<TextField
|
|
64
|
+
label="Ipsum enim quis culpa"
|
|
65
|
+
error="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
59
66
|
size="small"
|
|
60
|
-
label="Laborum excepteur"
|
|
61
|
-
description="Cillum mollit"
|
|
62
|
-
disabled
|
|
63
67
|
/>
|
|
64
|
-
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/>
|
|
71
|
-
<TextField
|
|
72
|
-
label="Laborum excepteur"
|
|
73
|
-
description="Cillum mollit"
|
|
74
|
-
size="small"
|
|
75
|
-
readOnly
|
|
76
|
-
/>
|
|
72
|
+
export const Disabled = () => {
|
|
73
|
+
return (
|
|
74
|
+
<div className="colgap">
|
|
75
|
+
<TextField label="Ipsum enim quis culpa" disabled />
|
|
76
|
+
<TextField label="Ipsum enim quis culpa" disabled size="small" />
|
|
77
77
|
</div>
|
|
78
78
|
);
|
|
79
79
|
};
|
|
80
|
+
|
|
81
|
+
export const HideLabel = () => {
|
|
82
|
+
return <TextField label="Ipsum enim quis culpa" hideLabel />;
|
|
83
|
+
};
|
|
@@ -1,104 +1,111 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { Textarea } from "../index";
|
|
3
1
|
import { Meta } from "@storybook/react/types-6-0";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Textarea } from "../index";
|
|
4
4
|
export default {
|
|
5
|
-
title: "ds-react/form/
|
|
5
|
+
title: "ds-react/form/Textarea",
|
|
6
6
|
component: Textarea,
|
|
7
|
+
argTypes: {
|
|
8
|
+
size: {
|
|
9
|
+
control: {
|
|
10
|
+
type: "radio",
|
|
11
|
+
options: ["medium", "small"],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
type: "string",
|
|
16
|
+
},
|
|
17
|
+
error: {
|
|
18
|
+
type: "string",
|
|
19
|
+
},
|
|
20
|
+
hideLabel: {
|
|
21
|
+
type: "boolean",
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
type: "boolean",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
7
27
|
} as Meta;
|
|
8
28
|
|
|
9
|
-
export const
|
|
10
|
-
const [value, setValue] = useState("");
|
|
11
|
-
|
|
12
|
-
const handleChange = (e) => {
|
|
13
|
-
setValue(e.target.value);
|
|
14
|
-
};
|
|
15
|
-
|
|
29
|
+
export const Default = (props) => {
|
|
16
30
|
return (
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<Textarea label="In anim elit" />
|
|
25
|
-
|
|
26
|
-
<h3>defaultValue</h3>
|
|
31
|
+
<Textarea
|
|
32
|
+
{...props}
|
|
33
|
+
maxLength={props?.maxLength ?? 100}
|
|
34
|
+
label="Ipsum enim quis culpa"
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
27
38
|
|
|
28
|
-
|
|
39
|
+
Default.args = {
|
|
40
|
+
maxLength: 100,
|
|
41
|
+
};
|
|
29
42
|
|
|
30
|
-
|
|
43
|
+
export const Small = () => {
|
|
44
|
+
return <Textarea size="small" label="Ipsum enim quis culpa" />;
|
|
45
|
+
};
|
|
31
46
|
|
|
47
|
+
export const Description = () => {
|
|
48
|
+
return (
|
|
49
|
+
<div className="colgap">
|
|
32
50
|
<Textarea
|
|
33
|
-
label="
|
|
34
|
-
description=
|
|
35
|
-
value={value}
|
|
36
|
-
onChange={handleChange}
|
|
51
|
+
label="Ipsum enim quis culpa"
|
|
52
|
+
description="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
37
53
|
/>
|
|
38
|
-
|
|
39
|
-
<h2>maxLength</h2>
|
|
40
|
-
|
|
41
54
|
<Textarea
|
|
42
|
-
label="
|
|
43
|
-
description="
|
|
44
|
-
|
|
45
|
-
value={value}
|
|
46
|
-
onChange={handleChange}
|
|
55
|
+
label="Ipsum enim quis culpa"
|
|
56
|
+
description="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
57
|
+
size="small"
|
|
47
58
|
/>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
48
62
|
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
export const Error = () => {
|
|
64
|
+
return (
|
|
65
|
+
<div className="colgap">
|
|
51
66
|
<Textarea
|
|
52
|
-
label="
|
|
53
|
-
|
|
54
|
-
error="Textarea error"
|
|
55
|
-
maxLength={400}
|
|
56
|
-
value={value}
|
|
57
|
-
onChange={handleChange}
|
|
67
|
+
label="Ipsum enim quis culpa"
|
|
68
|
+
error="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
58
69
|
/>
|
|
59
70
|
|
|
60
|
-
<h2>Sizing</h2>
|
|
61
|
-
|
|
62
71
|
<Textarea
|
|
63
|
-
label="
|
|
64
|
-
|
|
65
|
-
maxLength={400}
|
|
72
|
+
label="Ipsum enim quis culpa"
|
|
73
|
+
error="Consectetur labore velit eiusmod Lorem ut nostrud mollit labore ullamco laboris laboris in."
|
|
66
74
|
size="small"
|
|
67
|
-
value={value}
|
|
68
|
-
onChange={handleChange}
|
|
69
75
|
/>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
70
79
|
|
|
71
|
-
|
|
80
|
+
export const Disabled = () => {
|
|
81
|
+
return (
|
|
82
|
+
<div className="colgap">
|
|
83
|
+
<Textarea label="Ipsum enim quis culpa" disabled />
|
|
84
|
+
<Textarea label="Ipsum enim quis culpa" disabled size="small" />
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
72
88
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
maxLength={400}
|
|
77
|
-
hideLabel
|
|
78
|
-
value={value}
|
|
79
|
-
onChange={handleChange}
|
|
80
|
-
/>
|
|
89
|
+
export const HideLabel = () => {
|
|
90
|
+
return <Textarea label="Ipsum enim quis culpa" hideLabel />;
|
|
91
|
+
};
|
|
81
92
|
|
|
82
|
-
|
|
93
|
+
export const MaxLength = () => {
|
|
94
|
+
return <Textarea maxLength={200} label="Ipsum enim quis culpa" />;
|
|
95
|
+
};
|
|
83
96
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
maxLength={400}
|
|
88
|
-
disabled
|
|
89
|
-
value="Consectetur commodo mollit voluptate esse minim elit deserunt fugiat consectetur laboris."
|
|
90
|
-
onChange={handleChange}
|
|
91
|
-
/>
|
|
92
|
-
<h2>Readonly</h2>
|
|
97
|
+
export const MinRows = () => {
|
|
98
|
+
return <Textarea minRows={5} label="Ipsum enim quis culpa" />;
|
|
99
|
+
};
|
|
93
100
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
export const MaxRows = () => {
|
|
102
|
+
return (
|
|
103
|
+
<Textarea
|
|
104
|
+
maxRows={3}
|
|
105
|
+
value={
|
|
106
|
+
"Aute fugiat ut culpa enim ad culpa proident adipisicing anim proident ipsum elit. Cillum Lorem magna nisi cupidatat consequat culpa. Veniam ex quis elit dolore ea cupidatat fugiat in. Sint proident magna duis consequat velit ea velit pariatur in dolore ad. Aliqua officia nostrud veniam pariatur eu sint elit qui amet."
|
|
107
|
+
}
|
|
108
|
+
label="Ipsum enim quis culpa"
|
|
109
|
+
/>
|
|
103
110
|
);
|
|
104
111
|
};
|