Skip to content

Commit 4df46e0

Browse files
authored
Merge pull request #2389 from hashicorp/fix/modal-flyout-docs
website: replace instances of `Modal` and `Flyout` from design guidelines
2 parents 13e6ca1 + 375799d commit 4df46e0

File tree

9 files changed

+9
-134
lines changed

9 files changed

+9
-134
lines changed

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

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,28 +81,12 @@ Don't use a form in a Flyout, whether the function is creating an object, or upd
8181

8282
## Size
8383

84-
Medium
84+
The available sizes are medium (default) and large.
8585

86-
<Hds::Flyout id="size-medium-flyout" class="doc-flyout-demo" open as |F|>
87-
<F.Header>Medium Flyout</F.Header>
88-
<F.Body>
89-
<p class="hds-typography-body-300 hds-foreground-primary">Flyout content</p>
90-
</F.Body>
91-
</Hds::Flyout>
92-
93-
Large
94-
95-
<Hds::Flyout @size="large" id="size-large-flyout" class="doc-flyout-demo" open as |F|>
96-
<F.Header>Large Flyout</F.Header>
97-
<F.Body>
98-
<p class="hds-typography-body-300 hds-foreground-primary">Flyout content</p>
99-
</F.Body>
100-
</Hds::Flyout>
86+
![A medium (480px wide) and large (720px wide) Flyout side by side.](/assets/components/flyout/flyout-sizes.png)
10187

10288
### Best practices
10389

104-
![Sizes of the Flyout](/assets/components/flyout/flyout-sizes.png)
105-
10690
- Use a Flyout size that best accounts for the complexity and detail of the content.
10791
- The **medium** size accounts for the _majority_ of scenarios and is the default recommended size.
10892

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

Lines changed: 5 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,7 @@ Common examples include:
2424
- Simple requests of information from the user.
2525
- Quick confirmations of actions taken by the user.
2626

27-
<Hds::Modal @size="medium" @color="neutral" class="doc-modal-demo" open as |M|>
28-
<M.Header>
29-
Neutral modal
30-
</M.Header>
31-
<M.Body>
32-
<p class="hds-typography-body-300 hds-foreground-primary">Modal content</p>
33-
</M.Body>
34-
<M.Footer>
35-
<Hds::ButtonSet>
36-
<Hds::Button type="submit" @text="Confirm" />
37-
<Hds::Button type="button" @text="Cancel" @color="secondary" />
38-
</Hds::ButtonSet>
39-
</M.Footer>
40-
</Hds::Modal>
27+
![A neutral modal, the heading has a gray background and the primary button in the footer is the standard blue.](/assets/components/modal/modal-color-neutral.png)
4128

4229
### Warning
4330

@@ -49,20 +36,7 @@ Common examples include:
4936
- Archiving an item that can be recovered.
5037
- Changing a setting that may require the user to re-authenticate or perform an action again.
5138

52-
<Hds::Modal @size="medium" @color="warning" class="doc-modal-demo" open as |M|>
53-
<M.Header>
54-
Warning modal
55-
</M.Header>
56-
<M.Body>
57-
<p class="hds-typography-body-300 hds-foreground-primary">Modal content</p>
58-
</M.Body>
59-
<M.Footer>
60-
<Hds::ButtonSet>
61-
<Hds::Button type="submit" @text="Confirm" />
62-
<Hds::Button type="button" @text="Cancel" @color="secondary" />
63-
</Hds::ButtonSet>
64-
</M.Footer>
65-
</Hds::Modal>
39+
![A warning modal, the heading is dark orange with a light orange background and the primary button in the footer is the standard blue.](/assets/components/modal/modal-color-warning.png)
6640

6741
### Critical
6842

@@ -74,20 +48,7 @@ Common examples include:
7448
- Modifying a setting that cannot be changed or reversed in the future.
7549
- Alerting the user of unsaved changes that will be discarded.
7650

77-
<Hds::Modal @size="medium" @color="critical" class="doc-modal-demo" open as |M|>
78-
<M.Header>
79-
Critical Modal
80-
</M.Header>
81-
<M.Body>
82-
<p class="hds-typography-body-300 hds-foreground-primary">Modal content</p>
83-
</M.Body>
84-
<M.Footer>
85-
<Hds::ButtonSet>
86-
<Hds::Button type="submit" @text="Delete" @color="critical" />
87-
<Hds::Button type="button" @text="Cancel" @color="secondary" />
88-
</Hds::ButtonSet>
89-
</M.Footer>
90-
</Hds::Modal>
51+
![A critical modal, the heading is dark red with a light red background and the primary button in the footer is also red.](/assets/components/modal/modal-color-critical.png)
9152

9253
!!! Info
9354

@@ -100,50 +61,7 @@ In Figma, the `critical` Modal color is coupled with the `critical` Button color
10061

10162
We recommend using the **medium** size Modal for most scenarios, but use the size that best accounts for the complexity of the content and intended speed of interaction. We do not recommend resizing the Modal manually.
10263

103-
<Hds::Modal @size="small" id="size-small-modal-first" class="doc-modal-demo" open as |M|>
104-
<M.Header>
105-
Small modal
106-
</M.Header>
107-
<M.Body>
108-
<p class="hds-typography-body-300 hds-foreground-primary">Modal content</p>
109-
</M.Body>
110-
<M.Footer>
111-
<Hds::ButtonSet>
112-
<Hds::Button type="submit" @text="Confirm" />
113-
<Hds::Button type="button" @text="Cancel" @color="secondary" />
114-
</Hds::ButtonSet>
115-
</M.Footer>
116-
</Hds::Modal>
117-
118-
<Hds::Modal @size="medium" id="size-medium-modal" class="doc-modal-demo" open as |M|>
119-
<M.Header>
120-
Medium modal
121-
</M.Header>
122-
<M.Body>
123-
<p class="hds-typography-body-300 hds-foreground-primary">Modal content</p>
124-
</M.Body>
125-
<M.Footer>
126-
<Hds::ButtonSet>
127-
<Hds::Button type="submit" @text="Confirm" />
128-
<Hds::Button type="button" @text="Cancel" @color="secondary" />
129-
</Hds::ButtonSet>
130-
</M.Footer>
131-
</Hds::Modal>
132-
133-
<Hds::Modal @size="large" id="size-large-modal" class="doc-modal-demo" open as |M|>
134-
<M.Header>
135-
Large modal
136-
</M.Header>
137-
<M.Body>
138-
<p class="hds-typography-body-300 hds-foreground-primary">Modal content</p>
139-
</M.Body>
140-
<M.Footer>
141-
<Hds::ButtonSet>
142-
<Hds::Button type="submit" @text="Confirm" />
143-
<Hds::Button type="button" @text="Cancel" @color="secondary" />
144-
</Hds::ButtonSet>
145-
</M.Footer>
146-
</Hds::Modal>
64+
![A small (400px wide), medium (600px), and large (800px) modal vertically stacked.](/assets/components/modal/modal-sizes.png)
14765

14866
### Height
14967

@@ -194,20 +112,7 @@ A tagline helps the user maintain the context of the feature, function, or flow
194112

195113
Modals can take on many different types of content, from text-based content to simple forms.
196114

197-
<Hds::Modal @size="small" @color="neutral" class="doc-modal-demo" open as |M|>
198-
<M.Header>
199-
Default
200-
</M.Header>
201-
<M.Body>
202-
<Doc::Placeholder @text="some generic content" @height="50" @background="#eee" />
203-
</M.Body>
204-
<M.Footer>
205-
<Hds::ButtonSet>
206-
<Hds::Button type="submit" @text="Confirm" />
207-
<Hds::Button type="button" @text="Cancel" @color="secondary" />
208-
</Hds::ButtonSet>
209-
</M.Footer>
210-
</Hds::Modal>
115+
![](/assets/components/modal/modal-body-content.png)
211116

212117
## Modal footer
213118

39.2 KB
Loading
40.3 KB
Loading
39.4 KB
Loading
40.5 KB
Loading
111 KB
Loading

website/tests/acceptance/components/flyout-test.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,7 @@ module('Acceptance | components/flyout', function (hooks) {
1818
});
1919
test('Components/flyout page passes automated a11y checks', async function (assert) {
2020
await visit('/components/flyout');
21-
22-
await a11yAudit({
23-
rules: {
24-
'heading-order': {
25-
enabled: false,
26-
},
27-
},
28-
});
29-
21+
await a11yAudit();
3022
assert.ok(true, 'a11y automation audit passed');
3123
});
3224
});

website/tests/acceptance/components/modal-test.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ module('Acceptance | components/modal', function (hooks) {
1919

2020
test('components/modal passes a11y automated checks', async function (assert) {
2121
await visit('/components/modal');
22-
await a11yAudit({
23-
rules: {
24-
'heading-order': {
25-
enabled: false,
26-
},
27-
},
28-
});
22+
await a11yAudit();
2923
assert.ok(true, 'a11y automation audit passed');
3024
});
3125
});

0 commit comments

Comments
 (0)