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
* docs(contextualhelp): remove MDX file
- adds some additional documentation regarding stories/variants
- migrates documentation in MDX to stories.js instead
* docs(fieldgroup): remove MDX file
- creates additional templates to showcase variants in a single story on
the docs page
- additional documentation to give context to stories
- corrects sentence-casing in story names
- removes duplicate control for label text
- migrates documentation in MDX to stories.js instead
* chore(fieldgroup,contextualhelp): cleans up test files
- fieldgroup: we don't really need to change the label text or help text
between test cases, so some of the test-specific changes were removed
- contextualhelp: add help icon test case
* docs(datepicker): remove MDX file
- adds missing date picker docs
- migrates documentation in MDX to stories.js instead
- creates OpenClosedTemplate to display both states in a single story on
the docs page
- adds Range variant to the sidebar since that control isn't in the table
Copy file name to clipboardExpand all lines: components/contextualhelp/stories/contextualhelp.stories.js
+19
Original file line number
Diff line number
Diff line change
@@ -107,10 +107,18 @@ export default {
107
107
},
108
108
};
109
109
110
+
/**
111
+
* The default contextual help component uses an info icon to signify that it represents in-line information, and does not incorporate a link in its content. Specific, brief, and contextual guidance is best for this component's supplemental or nice-to-know content. The default placement of the popover is `bottom-start`.
112
+
*/
110
113
exportconstDefault=ContextualHelpGroup.bind({});
111
114
Default.args={};
112
115
113
116
// ********* DOCS ONLY ********* //
117
+
/**
118
+
* If using a standalone [link](/docs/components-link--docs), do not add punctuation to the end of the link text. Make sure that the landing experience is intuitive, helpful, and naturally builds upon the information being introduced in this component. For example, don’t link to an external sales website unless the information there is directly related to a user being able to do something within the product.
119
+
*
120
+
* A generic “Learn more” can be acceptable, but it’s more helpful, particularly for screen reader users, to include another word or two in the link text that gives more context about the link's destination.
121
+
*/
114
122
exportconstWithLink=Template.bind({});
115
123
WithLink.tags=["!dev"];
116
124
WithLink.args={
@@ -122,7 +130,11 @@ WithLink.args = {
122
130
WithLink.parameters={
123
131
chromatic: {disableSnapshot: true},
124
132
};
133
+
WithLink.storyName="Default - info icon with link";
125
134
135
+
/**
136
+
* This is an example of the contextual help component within a popover with a placement of `top`. Read more about the 22 available placement positions in the [popover documentation](/docs/components-popover--docs).
137
+
*/
126
138
exportconstTopPopover=Template.bind({});
127
139
TopPopover.tags=["!dev"];
128
140
TopPopover.args={
@@ -142,7 +154,11 @@ TopPopover.parameters = {
142
154
},
143
155
},
144
156
};
157
+
TopPopover.storyName="Default - top popover";
145
158
159
+
/**
160
+
* When displaying help or resources to learn more, the contextual help should use the help icon. The content in this variant provides more detailed, in-depth guidance about a task, UI element, tool or keyboard shortcuts.
161
+
*/
146
162
exportconstHelpDefault=Template.bind({});
147
163
HelpDefault.tags=["!dev"];
148
164
HelpDefault.args={
@@ -151,6 +167,7 @@ HelpDefault.args = {
151
167
HelpDefault.parameters={
152
168
chromatic: {disableSnapshot: true},
153
169
};
170
+
HelpDefault.storyName="Help icon";
154
171
155
172
exportconstHelpWithLink=Template.bind({});
156
173
HelpWithLink.tags=["!dev"];
@@ -164,6 +181,7 @@ HelpWithLink.args = {
164
181
HelpWithLink.parameters={
165
182
chromatic: {disableSnapshot: true},
166
183
};
184
+
HelpWithLink.storyName="Help icon - with link";
167
185
168
186
exportconstHelpTopPopover=Template.bind({});
169
187
HelpTopPopover.tags=["!dev"];
@@ -185,6 +203,7 @@ HelpTopPopover.parameters = {
185
203
},
186
204
},
187
205
};
206
+
HelpTopPopover.storyName="Help icon - top popover";
* A date picker displays a text field input with a button next to it, and can display two text fields next to each other for choosing a date range.
@@ -28,7 +28,7 @@ export default {
28
28
if: {arg: "isInvalid",truthy: false},
29
29
},
30
30
isDateTimeRange: {
31
-
name: "Date and Time styling",
31
+
name: "Date and time styling",
32
32
type: {name: "boolean"},
33
33
table: {
34
34
type: {summary: "boolean"},
@@ -81,16 +81,31 @@ export default {
81
81
82
82
exportconstDefault=DatePickerGroup.bind({});
83
83
Default.args={};
84
-
Default.parameters={
84
+
Default.tags=["!autodocs"];
85
+
86
+
// ********* DOCS ONLY ********* //
87
+
/**
88
+
* Default styling for date pickers display a visible field button. This style works best in a dense array of controls where the field button helps separate the dropdown from its surroundings.
89
+
*
90
+
* The standard implementation for a date picker incorporates the display of a [calendar](/docs/components-calendar--docs) within a [popover component](/docs/components-popover--docs).
* The quiet style works best when a clear layout (vertical stack, table, grid) makes it easy to parse.
107
+
*/
108
+
exportconstQuiet=OpenClosedTemplate.bind({});
94
109
Quiet.tags=["!dev"];
95
110
Quiet.args={
96
111
isQuiet: true,
@@ -99,11 +114,14 @@ Quiet.parameters = {
99
114
chromatic: {disableSnapshot: true},
100
115
docs: {
101
116
story: {
102
-
height: "300px"
117
+
height: "350px",
103
118
}
104
119
},
105
120
};
106
121
122
+
/**
123
+
* Date pickers can be used to select a date range (a start date and an end date).
124
+
*/
107
125
exportconstRange=Template.bind({});
108
126
Range.args={
109
127
lastDay: 3,
@@ -125,7 +143,11 @@ QuietRange.args = {
125
143
QuietRange.parameters={
126
144
chromatic: {disableSnapshot: true},
127
145
};
146
+
QuietRange.storyName="Range, quiet";
128
147
148
+
/**
149
+
* A date picker can be marked as having an error to show that a value needs to be entered in order to move forward, or that an entered value is invalid.
0 commit comments