Skip to content

Commit 25615ca

Browse files
authored
Merge pull request #229 from pathsim/feature/confirmation-modal-buttons
confirmation modal buttons
2 parents 99f4f63 + eb15abe commit 25615ca

File tree

1 file changed

+62
-5
lines changed

1 file changed

+62
-5
lines changed

src/lib/components/ConfirmationModal.svelte

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,26 @@
6565
<p id="confirmation-message">{state.options.message}</p>
6666
</div>
6767

68-
<div class="dialog-footer">
68+
<div class="dialog-actions">
6969
<button class="ghost" onclick={handleCancel}>
7070
{state.options.cancelText}
7171
</button>
7272
<button onclick={handleConfirm}>
7373
{state.options.confirmText}
7474
</button>
7575
</div>
76+
77+
<div class="dialog-footer">
78+
Press <kbd>↵</kbd> to confirm
79+
</div>
7680
</div>
7781
</div>
7882
{/if}
7983

8084
<style>
8185
.confirmation-dialog {
8286
width: 90%;
83-
max-width: 400px;
87+
max-width: 320px;
8488
display: flex;
8589
flex-direction: column;
8690
overflow: hidden;
@@ -97,10 +101,63 @@
97101
line-height: 1.5;
98102
}
99103
100-
.dialog-footer {
104+
.dialog-actions {
101105
display: flex;
102-
justify-content: flex-end;
106+
justify-content: center;
103107
gap: var(--space-sm);
104-
padding: var(--space-sm) var(--space-md) var(--space-md);
108+
padding: var(--space-sm) var(--space-md);
109+
}
110+
111+
.dialog-actions button {
112+
padding: var(--space-sm) var(--space-md);
113+
border: 1px solid var(--border);
114+
border-radius: var(--radius-md);
115+
font-size: 11px;
116+
font-weight: 500;
117+
cursor: pointer;
118+
transition: all var(--transition-fast);
119+
}
120+
121+
.dialog-actions button.ghost {
122+
background: transparent;
123+
color: var(--text-muted);
124+
}
125+
126+
.dialog-actions button.ghost:hover {
127+
background: var(--surface-hover);
128+
color: var(--text);
129+
border-color: var(--border-focus);
130+
}
131+
132+
.dialog-actions button:not(.ghost) {
133+
background: var(--surface-raised);
134+
color: var(--text);
135+
}
136+
137+
.dialog-actions button:not(.ghost):hover {
138+
background: var(--surface-hover);
139+
border-color: var(--border-focus);
140+
}
141+
142+
.dialog-footer {
143+
padding: var(--space-xs) var(--space-md);
144+
background: var(--surface-raised);
145+
border-top: 1px solid var(--border);
146+
border-radius: 0 0 var(--radius-lg) var(--radius-lg);
147+
font-size: 10px;
148+
color: var(--text-disabled);
149+
text-align: center;
150+
}
151+
152+
.dialog-footer kbd {
153+
display: inline-block;
154+
padding: 1px 4px;
155+
font-family: inherit;
156+
font-size: 9px;
157+
background: var(--surface);
158+
border: 1px solid var(--border);
159+
border-radius: 3px;
160+
color: var(--text-muted);
161+
margin: 0 2px;
105162
}
106163
</style>

0 commit comments

Comments
 (0)