Skip to content

Commit dfb9a34

Browse files
Group 4: Banner and Image audit on the website (#2907)
Co-authored-by: Majed <[email protected]>
1 parent 9d2b67d commit dfb9a34

File tree

15 files changed

+145
-151
lines changed

15 files changed

+145
-151
lines changed

website/docs/components/button/partials/code/how-to-use.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ If the route is external to your current engine, you have to pass `@isRouteExter
138138

139139
### Loading state
140140

141-
If the button needs to toggle between an "idle" and a "loading" state, we suggest applying a width to it (via inline style or CSS class) to prevent the button from resizing on click (and potentially causing layout shifts):
142-
143141
!!! Info
144142

145143
While applying an explicit width to the button is possible in general, we suggest limiting the application of this override **only** to this specific use case and letting the button resize accordingly to its content.
146144

147145
!!!
148146

147+
If the button needs to toggle between an "idle" and a "loading" state, we suggest applying a width to it (via inline style or CSS class) to prevent the button from resizing on click (and potentially causing layout shifts):
148+
149149
```handlebars
150150
<Hds::Button
151151
{{style width="7.5rem"}}
@@ -157,13 +157,13 @@ While applying an explicit width to the button is possible in general, we sugges
157157

158158
### Disabled Buttons
159159

160-
To disable a Button, manually add the native `disabled` attribute:
161-
162160
!!! Info
163161

164162
Links cannot use the `disabled` attribute (per HTML specification); even if you were to intercept the event, they are still subject to color-contrast conformance requirements.
165163
!!!
166164

165+
To disable a Button, manually add the native `disabled` attribute:
166+
167167
```handlebars
168168
<Hds::Button @text="Alert me" disabled {{on "click" this.alertOnClick}} />
169169
```

website/docs/components/button/partials/guidelines/guidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ For example:
6363

6464
## Icon position
6565

66-
Buttons are provided with flexible icon use; allowing for leading, trailing, or icon only buttons. Use icons intentionally and only when they provide the user with extra value. Do not create buttons with both leading and trailing icons. Tertiary buttons are required to have either a leading or trailing icon layout to be accessible.
67-
6866
!!! Info
6967

7068
**Looking for Dropdowns?**
7169

7270
Buttons used for a Dropdown (with the chevron icon) can be found in [Dropdown](/components/dropdown).
7371
!!!
7472

73+
Buttons are provided with flexible icon use; allowing for leading, trailing, or icon only buttons. Use icons intentionally and only when they provide the user with extra value. Do not create buttons with both leading and trailing icons. Tertiary buttons are required to have either a leading or trailing icon layout to be accessible.
74+
7575
<Hds::ButtonSet>
7676
<Hds::Button @color="secondary" @text="No icon" />
7777
<Hds::Button @color="secondary" @text="Leading Icon" @icon="plus" @iconPosition="leading" />

website/docs/components/code-editor/partials/code/how-to-use.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ Optionally, you can pass a title and/or a description using the `[CE].Title` and
3434

3535
### Title tag
3636

37+
!!! Insight
38+
39+
The default `@tag` is `"h2"`, however, the correct value is dependent on the individual page. We strongly encourage consumers to update the `@tag` to meet WCAG Success Criterion [1.3.1 Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html) as the visual experience should match what is presented to the user with assistive technology.
40+
41+
!!!
42+
3743
The `@tag` argument changes the HTML element that wraps the `[CE].Title` content. When organizing the content on a webpage, the heading levels should reflect the structure of the page. For example, if a Code Editor is within a subsection of the page below a heading level 2, the value should be `"h3"`.
3844

3945
```handlebars
@@ -51,12 +57,6 @@ The `@tag` argument changes the HTML element that wraps the `[CE].Title` content
5157
</Hds::CodeEditor>
5258
```
5359

54-
!!! Insight
55-
56-
The default `@tag` is `"h2"`, however, the correct value is dependent on the individual page. We strongly encourage consumers to update the `@tag` to meet WCAG Success Criterion [1.3.1 Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html) as the visual experience should match what is presented to the user with assistive technology.
57-
58-
!!!
59-
6060
### Language
6161

6262
The `language` argument sets the syntax highlighting used. We support the following languages: `rego`, `ruby`, `sentinel`, `shell`, `go`, `hcl`, `javascript`, `json`, `markdown`, `sql`, and `yaml`. If you need additional languages, <LinkTo class="doc-link-generic" @route="show" @model="about/support">contact the Design Systems Team</LinkTo>.

website/docs/components/code-editor/partials/guidelines/guidelines.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,18 @@ The secondary actions section supports two optional buttons: the [Copy Button](/
5454

5555
## Custom actions
5656

57-
Custom primary actions can be added to the header. Primary actions include those necessary for the user to complete their work.
58-
59-
![The Code Editor with the title “CodeEditor title”. The custom yielded element section shows a placeholder and is between the title and the editor.](/assets/components/code-editor/code-editor-primary-yielded-elements.png)
60-
61-
Here is an example of a custom action to reveal secrets.
62-
63-
![The Code Editor with the title “CodeEditor title”. The custom yielded section has a “Reveal secrets” toggle.](/assets/components/code-editor/code-editor-primary-yielded-actions.png)
64-
65-
6657
!!! Warning
6758

6859
The Code Editor has limited support for dark mode styles. Buttons have pre-defined dark mode styles, but all other components require manual color adjustments until a dark mode theme is released. Please [contact the Design Systems Team](/about/support) for help translating components into dark mode.
6960

7061
!!!
7162

63+
Custom primary actions can be added to the header. Primary actions include those necessary for the user to complete their work.
64+
65+
Here is an example of a custom action to reveal secrets.
66+
67+
![The Code Editor with the title “CodeEditor title”. The custom yielded section has a “Reveal secrets” toggle.](/assets/components/code-editor/code-editor-primary-yielded-elements.png)
68+
7269
## External elements
7370

7471
Some elements or functions outside the Code Editor may affect the content within the Code Editor. In this case, we recommend turning off the header to visually couple the editor with the nearby controlling elements.
@@ -106,12 +103,13 @@ If you wish to create custom examples using the Code Editor, we publish all of t
106103
For more details around syntax, visit the [specifications](/components/code-editor?tab=specifications).
107104

108105
## Linting
109-
The Code Editor supports linting for JSON using [CodeMirror6](https://codemirror.net/examples/lint/). This feature highlights all errors with an underline and an icon next to the line number. Each icon has a tooltip explaining the error on the associated line.
110106

111107
!!! Info
112108
Linting is only available in the Ember component and is not supported in Figma.
113109
!!!
114110

111+
The Code Editor supports linting for JSON using [CodeMirror6](https://codemirror.net/examples/lint/). This feature highlights all errors with an underline and an icon next to the line number. Each icon has a tooltip explaining the error on the associated line.
112+
115113
![Code editor with linting errors. On hover of an icon indicating an error on a line, a tooltip displays details on the linting error.](/assets/components/code-editor/codeeditor-linting-preview-tooltip.png)
116114

117115
When linting is enabled, the Code Editor will have a minimum height set by default to avoid the alert dialog covering all the content within the editor when opened. The minimum height for the Code Editor with linting is 160px. The linting alert dialog is always 80px in height.

website/docs/components/flyout/partials/code/how-to-use.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ When the Flyout has been closed, the browser automatically returns the focus to
2424

2525
## How to use this component
2626

27+
!!! Info
28+
29+
When a Flyout is opened with the keyboard, the focus is automatically set to the first focusable element inside the Flyout, which is the “Dismiss” button.
30+
31+
!!!
32+
2733
```handlebars
2834
<Hds::Button
2935
@text="Open Flyout"
@@ -50,10 +56,4 @@ When the Flyout has been closed, the browser automatically returns the focus to
5056
</M.Body>
5157
</Hds::Flyout>
5258
{{/if}}
53-
```
54-
55-
!!! Info
56-
57-
When a Flyout is opened with the keyboard, the focus is automatically set to the first focusable element inside the Flyout, which is the “Dismiss” button.
58-
59-
!!!
59+
```

website/docs/components/flyout/partials/guidelines/guidelines.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ While similar in functionality and interaction, the Flyout and [Modal](/componen
1717

1818
#### Complexity
1919

20-
A Flyout is useful for more complex content, given the space it occupies in the viewport, while Modals are useful for less complex content that can be interacted with quickly.
21-
2220
!!! Info
2321

2422
Complexity of content is relative, use your own judgment to determine if the content or function is overly complex and consider moving it to its own page.
2523

2624
!!!
2725

26+
A Flyout is useful for more complex content, given the space it occupies in the viewport, while Modals are useful for less complex content that can be interacted with quickly.
27+
2828
#### Status and messaging
2929

3030
Flyouts are useful when displaying detailed content that relates to the page, while Modals are useful for messaging status, e.g., confirming a destructive action or warning about the effects of a change.
@@ -113,6 +113,11 @@ The purpose and function of the Flyout should not rely solely on an icon, instea
113113

114114
### Tagline
115115

116+
!!! Warning
117+
118+
Even though adding a title icon and tagline can help the user better understand the content, both elements add visual weight which might not be suitable or necessary for all Flyouts.
119+
!!!
120+
116121
**With tagline**
117122

118123
![Flyout header tagline, title, and dismiss button](/assets/components/dialog-primitives/dialog-primitives-header-tagline-and-title.jpg)
@@ -125,11 +130,6 @@ A **tagline** helps the user maintain the context of the main page the Flyout wa
125130

126131
The **tagline** should directly reference the page, feature title, or object to reinforce the purpose of the Flyout.
127132

128-
!!! Warning
129-
130-
Even though adding a title icon and tagline can help the user better understand the content, both elements add visual weight which might not be suitable or necessary for all Flyouts.
131-
!!!
132-
133133
### Description
134134

135135
A **description** provides additional information about the Flyout.
@@ -148,18 +148,18 @@ The body of the Flyout supports any generic content, local components, or Helios
148148

149149
## Flyout footer
150150

151+
!!! Info
152+
153+
The footer is **optional** and should be used sparingly as it increases the complexity of the Flyout.
154+
!!!
155+
151156
The Flyout footer is a persistent content area at the bottom of the Flyout, and supports additional descriptive content, links, actions, and any other generic content or Helios components.
152157

153158
The Ember and Figma components account for the footer in slightly different ways, though both can achieve the same results:
154159

155160
- The Ember component is a generic container that yields elements passed to it.
156161
- The Figma component consists of a variant for the number of actions, as well as support for generic content via an instance swap property.
157162

158-
!!! Info
159-
160-
The footer is **optional** and should be used sparingly as it increases the complexity of the Flyout.
161-
!!!
162-
163163
**With one action**
164164

165165
![Flyout footer with one action](/assets/components/dialog-primitives/dialog-primitives-footer-actions-one.png)
@@ -212,20 +212,20 @@ Multiple dismissal options are available that can be customized in production wi
212212

213213
## Positioning and responsive sizing
214214

215-
A Flyout should slide out from the right side of the viewport on top of the main page content and occupy 100% of the viewport height.
216-
217-
- This is true regardless of whether there is a sidebar or navigational element that persists on the page.
218-
- A Flyout should overlay all content and block/disable interaction on the main page.
219-
220-
![Flyout in a desktop viewport](/assets/components/flyout/flyout-sizing.png)
221-
222215
!!! Info
223216

224217
In Figma, the Flyout should be paired with the [Overlay](https://www.figma.com/design/iweq3r2Pi8xiJfD9e6lOhF/HDS-Components-v2.0?node-id=67216-32335&t=gWdKy44MzTP4cTRo-1) component which obscures the main page content the Flyout sits on top of. Using the Flyout without the overlay is currently not supported and helps to communicate visually the `inert` nature of the main page.
225218

226219
We publish a [[Template] Flyout](https://www.figma.com/design/iweq3r2Pi8xiJfD9e6lOhF/HDS-Components-v2.0?node-id=67212-27152&t=gWdKy44MzTP4cTRo-1) component coupling these two components together that can be imported into your design file and detached.
227220
!!!
228221

222+
A Flyout should slide out from the right side of the viewport on top of the main page content and occupy 100% of the viewport height.
223+
224+
- This is true regardless of whether there is a sidebar or navigational element that persists on the page.
225+
- A Flyout should overlay all content and block/disable interaction on the main page.
226+
227+
![Flyout in a desktop viewport](/assets/components/flyout/flyout-sizing.png)
228+
229229
On smaller viewports, the Flyout should occupy 100% of the viewport width minus half the size of the minimized SideNav width from the viewport edge.
230230

231231
- If the body content of the Flyout exceeds the maximum height of the viewport, a scroll will be introduced.

website/docs/components/form/file-input/partials/code/how-to-use.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ Add more than one error message using the more specific `Message` contextual com
8888

8989
#### Custom control ID
9090

91-
To use a custom ID value instead of the one automatically generated by the component, pass the `@id` argument to the Field component.
92-
9391
!!! Info
9492

9593
In this case, all the internal references (`id/for/aria-describedby`) between the different parts of the field will still be automatically generated but will use the custom ID provided.
9694

9795
!!!
9896

97+
To use a custom ID value instead of the one automatically generated by the component, pass the `@id` argument to the Field component.
98+
9999
```handlebars
100100
<Hds::Form::FileInput::Field @id="my-control" name="demo-profile-photo" as |F|>
101101
<F.Label>Upload a file</F.Label>

website/docs/components/form/file-input/partials/guidelines/guidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ Because the File Input is based on the native HTML input, the content and visual
1010

1111
## Truncation
1212

13-
Truncation is built into the native component and uses the width of the container to determine when the text gets truncated. It is not based on a character limit.
14-
1513
!!! Info
1614

1715
Due to limitations in Figma, truncation will occur at the end of the text, while in the browser, truncation occurs in the middle.
1816

1917
![visual difference in truncation between figma and browser](/assets/components/form/file-input/file-input-truncation.png)
2018
!!!
2119

20+
Truncation is built into the native component and uses the width of the container to determine when the text gets truncated. It is not based on a character limit.
21+
2222
## Multiple files
2323

2424
Multiple files can be added at once when the `multiple` attribute is enabled in code. When more than one file is selected, the text will change to show the number of files you’ve selected, e.g., “2 files”. *The exact language used may differ between browsers.*

website/docs/components/form/masked-input/partials/code/how-to-use.md

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ If you need to make the content visible by default or control the masking from o
5151

5252
#### Multiline
5353

54+
!!! Info
55+
56+
**Important to know**
57+
58+
When the multiline input is masked, the browser converts newline characters to masked characters: this means that the multiline text will appear as a single long string of characters, even if it’s inside a `<textarea>` element.
59+
60+
When the text is not masked, the newline characters will be respected. This means it may occupy more lines than when it’s masked (see the example above).
61+
62+
Something to keep in mind when designing and implementing functionality that makes use of this component.
63+
64+
!!!
65+
5466
Set `@isMultiline` argument to `true` to render a `<textarea>`
5567

5668
```handlebars
@@ -72,18 +84,6 @@ v/Ow5T0q5gIJAiEAyS4RaI9YG8EWx/2w0T67ZUVAw8eOMB6BIUg0Xcu+3okCIBOs
7284
</Hds::Form::MaskedInput::Field>
7385
```
7486

75-
!!! Info
76-
77-
**Important to know**
78-
79-
When the multiline input is masked, the browser converts newline characters to masked characters: this means that the multiline text will appear as a single long string of characters, even if it’s inside a `<textarea>` element.
80-
81-
When the text is not masked, the newline characters will be respected. This means it may occupy more lines than when it’s masked (see the example above).
82-
83-
Something to keep in mind when designing and implementing functionality that makes use of this component.
84-
85-
!!!
86-
8787
#### Copy button
8888

8989
To allow users to copy the input value to their clipboard, set the `@hasCopyButton` argument to `true`.
@@ -322,13 +322,13 @@ Pass a custom width for the control using the `@width` argument.
322322

323323
### Form::MaskedInput::Base
324324

325-
The Base component is intended for rare cases where the Field component can’t be used and a custom implementation is needed. Most of the details for the Field component also apply to the Base component, but see the [Component API](#component-api) for more details.
326-
327325
!!! Warning
328326

329327
`Form::MaskedInput::Base` does not come with built-in accessibility functionality. It is the responsibility of the product team to ensure the implementation is conformant.
330328
!!!
331329

330+
The Base component is intended for rare cases where the Field component can’t be used and a custom implementation is needed. Most of the details for the Field component also apply to the Base component, but see the [Component API](#component-api) for more details.
331+
332332
The default invocation creates a `<input type="text">` or a `<textarea>` control with an automatically generated `ID` attribute.
333333

334334
```handlebars
@@ -338,6 +338,17 @@ The default invocation creates a `<input type="text">` or a `<textarea>` control
338338
name="demo-team-token"
339339
/>
340340
```
341+
!!! Info
342+
343+
**Important to know**
344+
345+
When the multiline input is masked, the browser converts newline characters to masked characters: this means that the multiline text will appear as a single long string of characters, even though it’s inside a `<textarea>` element.
346+
347+
Instead, when the text is not masked it will respect the newline characters: this means it may occupy more lines that when it’s masked (try the example above).
348+
349+
Something to keep in mind when designing and implementing functionality that requires this component.
350+
351+
!!!
341352

342353
When the `@isMultiline` argument is set to `true`, it creates a `<textarea>` control with an automatically generated `ID` attribute. You can also adjust the height of `<textarea>` either by using the `rows` attribute or by setting a custom `@height` value.
343354

@@ -357,16 +368,4 @@ v/Ow5T0q5gIJAiEAyS4RaI9YG8EWx/2w0T67ZUVAw8eOMB6BIUg0Xcu+3okCIBOs
357368
aria-label="Private key"
358369
name="demo-team-token"
359370
/>
360-
```
361-
362-
!!! Info
363-
364-
**Important to know**
365-
366-
When the multiline input is masked, the browser converts newline characters to masked characters: this means that the multiline text will appear as a single long string of characters, even though it’s inside a `<textarea>` element.
367-
368-
Instead, when the text is not masked it will respect the newline characters: this means it may occupy more lines that when it’s masked (try the example above).
369-
370-
Something to keep in mind when designing and implementing functionality that requires this component.
371-
372-
!!!
371+
```
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
A Masked Input field is a special input that visually obfuscates characters to protect sensitive information by masking them with a circular shape.
2-
31
!!! Warning
42

53
**Important to know**
64

75
This component is meant for **visual obfuscation** only. Consumers should be aware that the hidden text value could still be obtained through other means (e.g., copying it from the input, via JavaScript, via the developer tools, etc.).
6+
!!!
87

9-
10-
!!!
8+
A Masked Input field is a special input that visually obfuscates characters to protect sensitive information by masking them with a circular shape.

0 commit comments

Comments
 (0)