x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<button type="button" class="btn" commandfor="alert_dialog_media" command="show-modal">Share project</button><dialog id="alert_dialog_media" class="dialog" style="--dialog-size: 24rem;" role="alertdialog" aria-labelledby="dialog_label" aria-describedby="dialog_desc"> <div class="dialog__content"> <div class="flex items-start gap" style="column-gap: 1rem"> <div class="flex items-center justify-center flex-item-no-shrink p-2 bg-shade rounded-md"> <span class="icon icon--circle-fading-plus" style="--icon-size: 1.5rem" aria-hidden="true"></span> </div> <div class="flex flex-col"> <h2 class="font-medium leading-none mbe-2" id="dialog_label">Share this project?</h2> <p class="text-sm text-balance text-subtle" id="dialog_desc"> Anyone with the link will be able to view and edit this project. </p> </div> </div> <div class="dialog__footer flex items-center justify-end gap mbs-4"> <button type="button" class="btn" commandfor="alert_dialog_media" command="close">Cancel</button> <button type="button" class="btn btn--primary">Share</button> </div> </div></dialog>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<button type="button" class="btn" commandfor="alert_dialog_media" command="show-modal">Share project</button><dialog id="alert_dialog_media" class="dialog" style="--dialog-size: 24rem;" role="alertdialog" aria-labelledby="dialog_label" aria-describedby="dialog_desc"> <div class="dialog__content"> <div class="flex items-start gap" style="column-gap: 1rem"> <div class="flex items-center justify-center flex-item-no-shrink p-2 bg-shade rounded-md"> <span class="icon icon--circle-fading-plus" style="--icon-size: 1.5rem" aria-hidden="true"></span> </div> <div class="flex flex-col"> <h2 class="font-medium leading-none mbe-2" id="dialog_label">Share this project?</h2> <p class="text-sm text-balance text-subtle" id="dialog_desc"> Anyone with the link will be able to view and edit this project. </p> </div> </div> <div class="dialog__footer flex items-center justify-end gap mbs-4"> <button type="button" class="btn" commandfor="alert_dialog_media" command="close">Cancel</button> <button type="button" class="btn btn--primary">Share</button> </div> </div></dialog>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.dialog { background-color: var(--color-surface); border-radius: var(--rounded-xl); border-width: var(--border); color: var(--color-text); inline-size: var(--size-full); margin: auto; max-inline-size: calc(100% - 2rem); &::backdrop { backdrop-filter: var(--blur-xs); } /* Setup transition */ transition-behavior: allow-discrete; transition-duration: var(--time-100); transition-property: display, overlay, opacity, transform; transition-timing-function: var(--ease-out-3); &::backdrop { transition-behavior: allow-discrete; transition-duration: var(--time-100); transition-property: display, overlay, opacity; transition-timing-function: var(--ease-out-3); } /* Exit stage to */ & { opacity: 0; transform: var(--scale-95); } &::backdrop { opacity: 0; } /* On stage */ &[open] { opacity: 1; transform: var(--scale-100); } &[open]::backdrop { opacity: 1; } /* Enter stage from */ @starting-style { &[open] { opacity: 0; transform: var(--scale-95); } &[open]::backdrop { opacity: 0; } } @supports (-webkit-hyphens: none) { transition-behavior: normal; } @media (width >= 40rem) { max-inline-size: var(--dialog-size, var(--max-i-sm)); }}.dialog__content { padding: var(--size-4);}.dialog__footer { background-color: rgb(from var(--color-border-light) r g b / .5); border-block-start-width: var(--border); margin-block-end: calc(var(--size-4) * -1); margin-inline: calc(var(--size-4) * -1); padding: var(--size-4);}.dialog__close { inset-block-start: var(--size-3); inset-inline-end: var(--size-3); position: absolute;}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Controller } from "@hotwired/stimulus"export default class extends Controller { show() { this.element.show() } showModal() { this.element.showModal() } close() { this.element.close() } closeOnClickOutside({ target }) { target.nodeName === "DIALOG" && this.close() }}No notes provided.