x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<button type="button" class="btn btn--negative" commandfor="alert_dialog_destructive" command="show-modal">Delete chat</button><dialog id="alert_dialog_destructive" class="dialog" style="--dialog-size: 20rem;" role="alertdialog" aria-labelledby="dialog_label" aria-describedby="dialog_desc"> <div class="dialog__content"> <div class="flex flex-col items-center"> <div class="flex items-center justify-center flex-item-no-shrink p-2 rounded-md mbe-4" style="background-color: rgb(from var(--color-negative) r g b / .1); color: var(--color-negative)"> <span class="icon icon--trash-2" style="--icon-size: 1.5rem" aria-hidden="true"></span> </div> <h2 class="font-medium leading-none text-center mbe-2" id="dialog_label">Delete chat?</h2> <p class="text-sm text-balance text-center text-subtle" id="dialog_desc"> This will permanently delete this chat conversation. View <a class="text-link" href="#">Settings</a> delete any memories saved during this chat. </p> </div> <div class="dialog__footer flex items-center gap mbs-4"> <button type="button" class="btn flex-1" commandfor="alert_dialog_destructive" command="close">Cancel</button> <button type="button" class="btn btn--negative flex-1">Delete</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
<button type="button" class="btn btn--negative" commandfor="alert_dialog_destructive" command="show-modal">Delete chat</button><dialog id="alert_dialog_destructive" class="dialog" style="--dialog-size: 20rem;" role="alertdialog" aria-labelledby="dialog_label" aria-describedby="dialog_desc"> <div class="dialog__content"> <div class="flex flex-col items-center"> <div class="flex items-center justify-center flex-item-no-shrink p-2 rounded-md mbe-4" style="background-color: rgb(from var(--color-negative) r g b / .1); color: var(--color-negative)"> <span class="icon icon--trash-2" style="--icon-size: 1.5rem" aria-hidden="true"></span> </div> <h2 class="font-medium leading-none text-center mbe-2" id="dialog_label">Delete chat?</h2> <p class="text-sm text-balance text-center text-subtle" id="dialog_desc"> This will permanently delete this chat conversation. View <%= link_to "Settings", "#", class: "text-link" %> delete any memories saved during this chat. </p> </div> <div class="dialog__footer flex items-center gap mbs-4"> <button type="button" class="btn flex-1" commandfor="alert_dialog_destructive" command="close">Cancel</button> <button type="button" class="btn btn--negative flex-1">Delete</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.