You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clears up a couple issues:
- An arg called "treatment" was named "variant" in the actual template
and its usage. This has been renamed, so this control now works.
- Icon is now hidden for the neutral Help text, to conform with the
component guidelines. An issue originally noticed in Field group where
neutral help text was showing an invalid icon when it shouldn't be
allowing that combination.
Adds a new story, so both negative and neutral variants are represented
in VRTs. Also includes wrapping text as part of the new story.
Copy file name to clipboardExpand all lines: components/helptext/stories/helptext.stories.js
+35-6Lines changed: 35 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,8 @@ export default {
18
18
},
19
19
control: {type: "text"},
20
20
},
21
-
treatment: {
22
-
name: "Treatment",
21
+
variant: {
22
+
name: "Variant",
23
23
type: {name: "string"},
24
24
table: {
25
25
type: {summary: "string"},
@@ -28,17 +28,27 @@ export default {
28
28
options: ["neutral","negative"],
29
29
control: "inline-radio",
30
30
},
31
+
size: {
32
+
name: "Size",
33
+
type: {name: "string",required: true},
34
+
table: {
35
+
type: {summary: "string"},
36
+
category: "Component",
37
+
},
38
+
options: ["s","m","l","xl"],
39
+
control: "select",
40
+
},
31
41
hideIcon: {
32
42
name: "Hide icon",
33
43
type: {name: "boolean"},
34
-
description: "Only applicable if treatment is negative.",
44
+
description: "Help text using the negative variant can have an optional icon.",
35
45
table: {
36
46
type: {summary: "boolean"},
37
47
disable: false,
38
-
category: "Advanced",
48
+
category: "Component",
39
49
},
40
50
control: "boolean",
41
-
if: {arg: "treatment",eq: "negative"},
51
+
if: {arg: "variant",eq: "negative"},
42
52
},
43
53
isDisabled: {
44
54
name: "Disabled",
@@ -49,13 +59,23 @@ export default {
49
59
},
50
60
control: "boolean",
51
61
},
62
+
customStyles: {
63
+
name: "Custom styles",
64
+
description: "Storybook only styles for testing the story, applied to the parent element.",
65
+
table: {
66
+
type: {summary: "object"},
67
+
category: "Advanced",
68
+
},
69
+
if: {arg: 'customStyles'}
70
+
}
52
71
},
53
72
args: {
54
73
rootClass: "spectrum-HelpText",
55
74
text: "Create a password with at least 8 characters.",
56
-
treatment: "neutral",
75
+
variant: "neutral",
57
76
hideIcon: false,
58
77
isDisabled: false,
78
+
size: "m",
59
79
},
60
80
parameters: {
61
81
actions: {
@@ -70,4 +90,13 @@ export default {
70
90
};
71
91
72
92
exportconstDefault=Template.bind({});
93
+
Default.storyName="Neutral";
73
94
Default.args={};
95
+
96
+
exportconstNegative=Template.bind({});
97
+
Negative.storyName="Negative";
98
+
Negative.args={
99
+
variant: "negative",
100
+
text: "This is an example with wrapping text. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
0 commit comments