Skip to content

Commit 51e087a

Browse files
Adrián Bolonioactions-userlangermanksimurai
authored
Overlay component (#1998)
* Add styles, documentation, and storybook story for the new dialog component * Stylelint auto-fixes * Create slow-poets-mate.md * Update slow-poets-mate.md * update namespace * Stylelint auto-fixes * menu specifics * starting over * a new paradigm * fully responsive * push for testing * auto width, visibility hidden * Overlay stories * dialog stories * cleanup * remove popover * remove unused import * docs update * min() to the rescue! * thin scrollbar? * remove comment * Update src/overlay/overlay.scss Co-authored-by: simurai <[email protected]> * address feedback * handle form elements * test permissions * lint Co-authored-by: Actions Auto Build <[email protected]> Co-authored-by: Katie Langerman <[email protected]> Co-authored-by: simurai <[email protected]>
1 parent ab6f084 commit 51e087a

File tree

11 files changed

+1381
-365
lines changed

11 files changed

+1381
-365
lines changed

.changeset/slow-poets-mate.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": minor
3+
---
4+
5+
Styles for the new Dialog Component

docs/content/components/dialog.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Dialog
3+
path: components/dialog
4+
status: Alpha
5+
source: 'https://github.com/github/github/tree/master/app/assets/stylesheets/experiments/modal-dialog.scss'
6+
bundle: dialog
7+
---
8+
9+
Please note that the `<div>` element with `id="fake-container"` is not included in the component.
10+
11+
```html live
12+
<div id="fake-container" style="height: 400px;">
13+
<button class="btn"><span>Open dialog</span></button>
14+
<div
15+
id="overlay-backdrop"
16+
class="Overlay-backdrop Overlay-backdrop--center"
17+
role="dialog"
18+
aria-labelledby="title-id"
19+
aria-describedby="description-id"
20+
data-focus-trap="active"
21+
>
22+
<div
23+
class="Overlay Overlay--width-medium Overlay--height-medium Overlay--motion-scaleFade"
24+
data-focus-trap="active"
25+
open=""
26+
>
27+
<header class="Overlay-header">
28+
<div class="Overlay-headerContentWrap">
29+
<div class="Overlay-titleWrap">
30+
<h1 id="title-id" class="Overlay-title">This is the title of the dialog</h1>
31+
<h2 id="description-id" class="Overlay-description">This is the subtitle of the dialog</h2>
32+
</div>
33+
<div class="Overlay-actionWrap">
34+
<button class="Overlay-closeButton" aria-label="Close">
35+
<svg aria-hidden="true" viewBox="0 0 16 16" width="16" height="16" fill="currentColor">
36+
<path
37+
fill-rule="evenodd"
38+
d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"
39+
></path>
40+
</svg>
41+
</button>
42+
</div>
43+
</div>
44+
</header>
45+
<div class="Overlay-body">
46+
This is the body of the dialogThis is the body of the dialogThis is the body of the dialog This is the body of
47+
the dialog This is the body of the dialog This is the body of the dialog This is the body of the dialog This is
48+
the body of the dialog This is the body of the dialog
49+
</div>
50+
<footer class="Overlay-footer Overlay-footer--divided Overlay-footer--alignEnd">
51+
<button class="btn"><span>Continue</span></button>
52+
</footer>
53+
</div>
54+
</div>
55+
</div>
56+
```
57+
58+
[aria attributes]: https://www.w3.org/TR/html-aria/#allowed-aria-roles-states-and-properties

0 commit comments

Comments
 (0)