ui-svelte 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/charts/ArcChart.svelte +0 -1
- package/dist/control/Fab.svelte +103 -0
- package/dist/control/Fab.svelte.d.ts +25 -0
- package/dist/control/Record.svelte +0 -3
- package/dist/control/ToggleTheme.svelte +1 -1
- package/dist/control/Video.svelte +2 -0
- package/dist/control/css/btn.css +17 -17
- package/dist/control/css/fab.css +84 -0
- package/dist/control/css/media.css +7 -7
- package/dist/control/css/toggle-group.css +1 -17
- package/dist/css/decorations.css +348 -189
- package/dist/css/utilities.css +0 -4
- package/dist/display/Accordion.svelte +3 -3
- package/dist/display/Accordion.svelte.d.ts +1 -1
- package/dist/display/Card.svelte +3 -3
- package/dist/display/Card.svelte.d.ts +1 -1
- package/dist/display/Code.svelte +1 -1
- package/dist/display/Collapsible.svelte +3 -3
- package/dist/display/Collapsible.svelte.d.ts +1 -1
- package/dist/display/Countdown.svelte +169 -0
- package/dist/display/Countdown.svelte.d.ts +21 -0
- package/dist/display/Item.svelte +12 -0
- package/dist/display/Item.svelte.d.ts +2 -0
- package/dist/display/Marquee.svelte +0 -2
- package/dist/display/Section.svelte +3 -3
- package/dist/display/Section.svelte.d.ts +1 -1
- package/dist/display/css/accordion.css +14 -14
- package/dist/display/css/alert.css +42 -15
- package/dist/display/css/avatar.css +36 -36
- package/dist/display/css/card.css +108 -36
- package/dist/display/css/chip.css +16 -16
- package/dist/display/css/collapsible.css +32 -32
- package/dist/display/css/countdown.css +206 -0
- package/dist/display/css/item.css +24 -0
- package/dist/display/css/marquee.css +0 -3
- package/dist/display/css/section.css +88 -109
- package/dist/display/css/table.css +1 -16
- package/dist/form/ColorField.svelte +60 -2
- package/dist/form/DragDrop.svelte +317 -87
- package/dist/form/DragDrop.svelte.d.ts +1 -0
- package/dist/form/Dropzone.svelte +3 -3
- package/dist/form/Dropzone.svelte.d.ts +1 -1
- package/dist/form/ImageCropper.svelte +135 -4
- package/dist/form/RadioGroup.svelte +6 -2
- package/dist/form/RadioGroup.svelte.d.ts +1 -1
- package/dist/form/Slider.svelte +6 -2
- package/dist/form/Slider.svelte.d.ts +1 -1
- package/dist/form/TextField.svelte +13 -4
- package/dist/form/TextField.svelte.d.ts +3 -2
- package/dist/form/Toggle.svelte +6 -2
- package/dist/form/Toggle.svelte.d.ts +1 -1
- package/dist/form/css/control.css +14 -14
- package/dist/form/css/csv-field.css +8 -13
- package/dist/form/css/drag-drop.css +90 -127
- package/dist/form/css/dropzone.css +8 -8
- package/dist/form/css/editor.css +14 -14
- package/dist/form/css/image-cropper.css +28 -7
- package/dist/form/css/radio-group.css +25 -0
- package/dist/form/css/slider.css +36 -0
- package/dist/form/css/textarea.css +14 -14
- package/dist/form/css/toggle.css +12 -0
- package/dist/hooks/use-chat.svelte.js +1 -1
- package/dist/hooks/use-form.svelte.js +3 -3
- package/dist/hooks/use-search.svelte.js +0 -3
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +4 -0
- package/dist/index.css +28 -48
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/layout/Provider.svelte +5 -5
- package/dist/layout/Sidebar.svelte +17 -8
- package/dist/layout/Sidebar.svelte.d.ts +2 -1
- package/dist/layout/css/app-bar.css +7 -7
- package/dist/layout/css/footer.css +7 -7
- package/dist/layout/css/sidebar.css +120 -59
- package/dist/navigation/BottomNav.svelte +23 -14
- package/dist/navigation/css/bottom-nav.css +74 -34
- package/dist/navigation/css/nav-menu.css +14 -15
- package/dist/navigation/css/side-nav.css +14 -15
- package/dist/overlay/AlertDialog.svelte +58 -0
- package/dist/overlay/AlertDialog.svelte.d.ts +14 -25
- package/dist/overlay/Command.svelte +177 -170
- package/dist/overlay/Command.svelte.d.ts +12 -3
- package/dist/overlay/Drawer.svelte +4 -4
- package/dist/overlay/Drawer.svelte.d.ts +1 -1
- package/dist/overlay/Modal.svelte +4 -4
- package/dist/overlay/Modal.svelte.d.ts +1 -1
- package/dist/overlay/Tooltip.svelte +0 -5
- package/dist/overlay/css/command.css +30 -42
- package/dist/overlay/css/drawer.css +10 -10
- package/dist/overlay/css/modal.css +70 -18
- package/dist/overlay/css/toast.css +42 -14
- package/dist/overlay/css/tooltip.css +49 -23
- package/dist/stores/theme.svelte.js +19 -12
- package/package.json +1 -1
- package/dist/utils/charts.d.ts +0 -27
- package/dist/utils/charts.js +0 -140
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
.bottomnav {
|
|
3
|
+
--bn-pill-radius: 9999px;
|
|
4
|
+
--bn-pill-padding-x: 1rem;
|
|
5
|
+
--bn-pill-padding-y: 0.25rem;
|
|
6
|
+
--bn-pill-opacity: 0.15;
|
|
7
|
+
--bn-fab-size: 3rem;
|
|
8
|
+
--bn-fab-offset: -1.5rem;
|
|
9
|
+
|
|
3
10
|
@apply flex items-center justify-around;
|
|
4
11
|
@apply shadow-lg;
|
|
5
12
|
|
|
@@ -14,27 +21,27 @@
|
|
|
14
21
|
|
|
15
22
|
&.is-soft {
|
|
16
23
|
&.is-primary {
|
|
17
|
-
@apply bg-
|
|
24
|
+
@apply bg-soft-primary text-primary;
|
|
18
25
|
}
|
|
19
26
|
&.is-secondary {
|
|
20
|
-
@apply bg-
|
|
27
|
+
@apply bg-soft-secondary text-secondary;
|
|
21
28
|
}
|
|
22
29
|
&.is-muted {
|
|
23
|
-
@apply bg-muted text-on-muted;
|
|
30
|
+
@apply bg-soft-muted text-on-muted;
|
|
24
31
|
}
|
|
25
32
|
&.is-success {
|
|
26
|
-
@apply bg-
|
|
33
|
+
@apply bg-soft-success text-success;
|
|
27
34
|
}
|
|
28
35
|
&.is-info {
|
|
29
|
-
@apply bg-
|
|
36
|
+
@apply bg-soft-info text-info;
|
|
30
37
|
}
|
|
31
38
|
&.is-warning {
|
|
32
|
-
@apply bg-
|
|
39
|
+
@apply bg-soft-warning text-warning;
|
|
33
40
|
}
|
|
34
41
|
&.is-danger {
|
|
35
|
-
@apply bg-
|
|
42
|
+
@apply bg-soft-danger text-danger;
|
|
36
43
|
}
|
|
37
|
-
&.is-
|
|
44
|
+
&.is-background {
|
|
38
45
|
@apply bg-background text-on-background;
|
|
39
46
|
}
|
|
40
47
|
&.is-surface {
|
|
@@ -117,7 +124,9 @@
|
|
|
117
124
|
}
|
|
118
125
|
|
|
119
126
|
.bottomnav-icon-wrapper {
|
|
120
|
-
@apply relative inline-flex;
|
|
127
|
+
@apply relative inline-flex items-center justify-center;
|
|
128
|
+
@apply transition-all duration-300;
|
|
129
|
+
border-radius: var(--bn-pill-radius);
|
|
121
130
|
}
|
|
122
131
|
|
|
123
132
|
.bottomnav-icon {
|
|
@@ -151,19 +160,20 @@
|
|
|
151
160
|
}
|
|
152
161
|
|
|
153
162
|
.bottomnav-icon-wrapper {
|
|
154
|
-
|
|
163
|
+
width: var(--bn-fab-size);
|
|
164
|
+
height: var(--bn-fab-size);
|
|
165
|
+
margin-top: var(--bn-fab-offset);
|
|
155
166
|
@apply flex items-center justify-center;
|
|
156
|
-
@apply bg-primary text-on-primary;
|
|
157
167
|
@apply rounded-full shadow-lg;
|
|
158
168
|
@apply transition-all duration-300;
|
|
159
169
|
}
|
|
160
170
|
|
|
161
171
|
.bottomnav-icon {
|
|
162
|
-
@apply h-6 w-6
|
|
172
|
+
@apply h-6 w-6;
|
|
163
173
|
}
|
|
164
174
|
|
|
165
175
|
&:hover .bottomnav-icon-wrapper {
|
|
166
|
-
@apply shadow-xl
|
|
176
|
+
@apply shadow-xl;
|
|
167
177
|
transform: translateY(-2px);
|
|
168
178
|
}
|
|
169
179
|
|
|
@@ -171,6 +181,34 @@
|
|
|
171
181
|
transform: translateY(0);
|
|
172
182
|
@apply shadow-md;
|
|
173
183
|
}
|
|
184
|
+
|
|
185
|
+
&.is-primary .bottomnav-icon-wrapper {
|
|
186
|
+
@apply bg-primary text-on-primary shadow-primary/30;
|
|
187
|
+
}
|
|
188
|
+
&.is-secondary .bottomnav-icon-wrapper {
|
|
189
|
+
@apply bg-secondary text-on-secondary shadow-secondary/30;
|
|
190
|
+
}
|
|
191
|
+
&.is-muted .bottomnav-icon-wrapper {
|
|
192
|
+
@apply bg-muted text-on-muted shadow-muted/30;
|
|
193
|
+
}
|
|
194
|
+
&.is-success .bottomnav-icon-wrapper {
|
|
195
|
+
@apply bg-success text-on-success shadow-success/30;
|
|
196
|
+
}
|
|
197
|
+
&.is-info .bottomnav-icon-wrapper {
|
|
198
|
+
@apply bg-info text-on-info shadow-info/30;
|
|
199
|
+
}
|
|
200
|
+
&.is-warning .bottomnav-icon-wrapper {
|
|
201
|
+
@apply bg-warning text-on-warning shadow-warning/30;
|
|
202
|
+
}
|
|
203
|
+
&.is-danger .bottomnav-icon-wrapper {
|
|
204
|
+
@apply bg-danger text-on-danger shadow-danger/30;
|
|
205
|
+
}
|
|
206
|
+
&.is-surface .bottomnav-icon-wrapper {
|
|
207
|
+
@apply bg-surface text-on-surface shadow-black/10;
|
|
208
|
+
}
|
|
209
|
+
&.is-background .bottomnav-icon-wrapper {
|
|
210
|
+
@apply bg-background text-on-background shadow-black/10;
|
|
211
|
+
}
|
|
174
212
|
}
|
|
175
213
|
}
|
|
176
214
|
|
|
@@ -192,28 +230,30 @@
|
|
|
192
230
|
|
|
193
231
|
&.active-pill {
|
|
194
232
|
.bottomnav-item {
|
|
195
|
-
|
|
233
|
+
.bottomnav-icon-wrapper {
|
|
234
|
+
padding: var(--bn-pill-padding-y) var(--bn-pill-padding-x);
|
|
235
|
+
}
|
|
196
236
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
@apply absolute inset-x-2 top-1 bottom-1;
|
|
200
|
-
@apply rounded-xl;
|
|
201
|
-
@apply bg-transparent;
|
|
202
|
-
@apply transition-all duration-300;
|
|
203
|
-
z-index: -1;
|
|
237
|
+
.bottomnav-badge {
|
|
238
|
+
@apply -top-1 -right-1;
|
|
204
239
|
}
|
|
205
240
|
|
|
206
|
-
&.is-active:not(.is-fab)
|
|
207
|
-
@apply bg-current/
|
|
241
|
+
&.is-active:not(.is-fab) .bottomnav-icon-wrapper {
|
|
242
|
+
@apply bg-current/15;
|
|
208
243
|
}
|
|
209
244
|
}
|
|
210
245
|
|
|
211
|
-
&.is-solid .bottomnav-item.is-active:not(.is-fab)
|
|
246
|
+
&.is-solid .bottomnav-item.is-active:not(.is-fab) .bottomnav-icon-wrapper {
|
|
212
247
|
@apply bg-white/20;
|
|
213
248
|
}
|
|
214
249
|
}
|
|
215
250
|
|
|
216
251
|
&.is-sm {
|
|
252
|
+
--bn-fab-size: 2.5rem;
|
|
253
|
+
--bn-fab-offset: -1.25rem;
|
|
254
|
+
--bn-pill-padding-x: 0.75rem;
|
|
255
|
+
--bn-pill-padding-y: 0.125rem;
|
|
256
|
+
|
|
217
257
|
.bottomnav-item {
|
|
218
258
|
@apply gap-0.5 py-2 px-1;
|
|
219
259
|
|
|
@@ -224,14 +264,13 @@
|
|
|
224
264
|
.bottomnav-label {
|
|
225
265
|
@apply text-[10px];
|
|
226
266
|
}
|
|
227
|
-
|
|
228
|
-
&.is-fab .bottomnav-icon-wrapper {
|
|
229
|
-
@apply w-10 h-10 -mt-5;
|
|
230
|
-
}
|
|
231
267
|
}
|
|
232
268
|
}
|
|
233
269
|
|
|
234
270
|
&.is-md {
|
|
271
|
+
--bn-fab-size: 3rem;
|
|
272
|
+
--bn-fab-offset: -1.5rem;
|
|
273
|
+
|
|
235
274
|
.bottomnav-item {
|
|
236
275
|
@apply gap-1 py-3 px-2;
|
|
237
276
|
|
|
@@ -246,6 +285,11 @@
|
|
|
246
285
|
}
|
|
247
286
|
|
|
248
287
|
&.is-lg {
|
|
288
|
+
--bn-fab-size: 3.5rem;
|
|
289
|
+
--bn-fab-offset: -1.75rem;
|
|
290
|
+
--bn-pill-padding-x: 1.25rem;
|
|
291
|
+
--bn-pill-padding-y: 0.375rem;
|
|
292
|
+
|
|
249
293
|
.bottomnav-item {
|
|
250
294
|
@apply gap-1.5 py-4 px-3;
|
|
251
295
|
|
|
@@ -257,12 +301,8 @@
|
|
|
257
301
|
@apply text-sm;
|
|
258
302
|
}
|
|
259
303
|
|
|
260
|
-
&.is-fab .bottomnav-icon
|
|
261
|
-
@apply
|
|
262
|
-
|
|
263
|
-
.bottomnav-icon {
|
|
264
|
-
@apply h-7 w-7;
|
|
265
|
-
}
|
|
304
|
+
&.is-fab .bottomnav-icon {
|
|
305
|
+
@apply h-7 w-7;
|
|
266
306
|
}
|
|
267
307
|
}
|
|
268
308
|
}
|
|
@@ -229,7 +229,6 @@
|
|
|
229
229
|
.navmenu-item {
|
|
230
230
|
.navmenu-label {
|
|
231
231
|
@apply font-normal;
|
|
232
|
-
/* Prevent width shift when font becomes bold */
|
|
233
232
|
display: inline-flex;
|
|
234
233
|
flex-direction: column;
|
|
235
234
|
|
|
@@ -390,64 +389,64 @@
|
|
|
390
389
|
|
|
391
390
|
&.is-primary {
|
|
392
391
|
.navmenu-item:hover {
|
|
393
|
-
@apply bg-
|
|
392
|
+
@apply bg-soft-primary/50;
|
|
394
393
|
}
|
|
395
394
|
.navmenu-item.is-active {
|
|
396
|
-
@apply bg-
|
|
395
|
+
@apply bg-soft-primary text-primary;
|
|
397
396
|
}
|
|
398
397
|
}
|
|
399
398
|
|
|
400
399
|
&.is-secondary {
|
|
401
400
|
.navmenu-item:hover {
|
|
402
|
-
@apply bg-
|
|
401
|
+
@apply bg-soft-secondary/50;
|
|
403
402
|
}
|
|
404
403
|
.navmenu-item.is-active {
|
|
405
|
-
@apply bg-
|
|
404
|
+
@apply bg-soft-secondary text-secondary;
|
|
406
405
|
}
|
|
407
406
|
}
|
|
408
407
|
|
|
409
408
|
&.is-muted {
|
|
410
409
|
.navmenu-item:hover {
|
|
411
|
-
@apply bg-muted/50;
|
|
410
|
+
@apply bg-soft-muted/50;
|
|
412
411
|
}
|
|
413
412
|
.navmenu-item.is-active {
|
|
414
|
-
@apply bg-muted;
|
|
413
|
+
@apply bg-soft-muted text-on-muted;
|
|
415
414
|
}
|
|
416
415
|
}
|
|
417
416
|
|
|
418
417
|
&.is-success {
|
|
419
418
|
.navmenu-item:hover {
|
|
420
|
-
@apply bg-
|
|
419
|
+
@apply bg-soft-success/50;
|
|
421
420
|
}
|
|
422
421
|
.navmenu-item.is-active {
|
|
423
|
-
@apply bg-
|
|
422
|
+
@apply bg-soft-success text-success;
|
|
424
423
|
}
|
|
425
424
|
}
|
|
426
425
|
|
|
427
426
|
&.is-info {
|
|
428
427
|
.navmenu-item:hover {
|
|
429
|
-
@apply bg-
|
|
428
|
+
@apply bg-soft-info/50;
|
|
430
429
|
}
|
|
431
430
|
.navmenu-item.is-active {
|
|
432
|
-
@apply bg-
|
|
431
|
+
@apply bg-soft-info text-info;
|
|
433
432
|
}
|
|
434
433
|
}
|
|
435
434
|
|
|
436
435
|
&.is-warning {
|
|
437
436
|
.navmenu-item:hover {
|
|
438
|
-
@apply bg-
|
|
437
|
+
@apply bg-soft-warning/50;
|
|
439
438
|
}
|
|
440
439
|
.navmenu-item.is-active {
|
|
441
|
-
@apply bg-
|
|
440
|
+
@apply bg-soft-warning text-warning;
|
|
442
441
|
}
|
|
443
442
|
}
|
|
444
443
|
|
|
445
444
|
&.is-danger {
|
|
446
445
|
.navmenu-item:hover {
|
|
447
|
-
@apply bg-
|
|
446
|
+
@apply bg-soft-danger/50;
|
|
448
447
|
}
|
|
449
448
|
.navmenu-item.is-active {
|
|
450
|
-
@apply bg-
|
|
449
|
+
@apply bg-soft-danger text-danger;
|
|
451
450
|
}
|
|
452
451
|
}
|
|
453
452
|
}
|
|
@@ -323,7 +323,6 @@
|
|
|
323
323
|
.sidenav-item {
|
|
324
324
|
.sidenav-content .sidenav-label {
|
|
325
325
|
@apply font-normal;
|
|
326
|
-
/* Prevent width shift when font becomes bold */
|
|
327
326
|
display: inline-flex;
|
|
328
327
|
flex-direction: column;
|
|
329
328
|
|
|
@@ -553,10 +552,10 @@
|
|
|
553
552
|
}
|
|
554
553
|
}
|
|
555
554
|
.sidenav-item:hover {
|
|
556
|
-
@apply bg-
|
|
555
|
+
@apply bg-soft-primary/50;
|
|
557
556
|
}
|
|
558
557
|
.sidenav-item.is-active {
|
|
559
|
-
@apply bg-
|
|
558
|
+
@apply bg-soft-primary text-primary;
|
|
560
559
|
}
|
|
561
560
|
}
|
|
562
561
|
|
|
@@ -571,10 +570,10 @@
|
|
|
571
570
|
}
|
|
572
571
|
}
|
|
573
572
|
.sidenav-item:hover {
|
|
574
|
-
@apply bg-
|
|
573
|
+
@apply bg-soft-secondary/50;
|
|
575
574
|
}
|
|
576
575
|
.sidenav-item.is-active {
|
|
577
|
-
@apply bg-
|
|
576
|
+
@apply bg-soft-secondary text-secondary;
|
|
578
577
|
}
|
|
579
578
|
}
|
|
580
579
|
|
|
@@ -586,10 +585,10 @@
|
|
|
586
585
|
}
|
|
587
586
|
}
|
|
588
587
|
.sidenav-item:hover {
|
|
589
|
-
@apply bg-muted/50;
|
|
588
|
+
@apply bg-soft-muted/50;
|
|
590
589
|
}
|
|
591
590
|
.sidenav-item.is-active {
|
|
592
|
-
@apply bg-muted;
|
|
591
|
+
@apply bg-soft-muted text-on-muted;
|
|
593
592
|
}
|
|
594
593
|
}
|
|
595
594
|
|
|
@@ -604,10 +603,10 @@
|
|
|
604
603
|
}
|
|
605
604
|
}
|
|
606
605
|
.sidenav-item:hover {
|
|
607
|
-
@apply bg-
|
|
606
|
+
@apply bg-soft-success/50;
|
|
608
607
|
}
|
|
609
608
|
.sidenav-item.is-active {
|
|
610
|
-
@apply bg-
|
|
609
|
+
@apply bg-soft-success text-success;
|
|
611
610
|
}
|
|
612
611
|
}
|
|
613
612
|
|
|
@@ -622,10 +621,10 @@
|
|
|
622
621
|
}
|
|
623
622
|
}
|
|
624
623
|
.sidenav-item:hover {
|
|
625
|
-
@apply bg-
|
|
624
|
+
@apply bg-soft-info/50;
|
|
626
625
|
}
|
|
627
626
|
.sidenav-item.is-active {
|
|
628
|
-
@apply bg-
|
|
627
|
+
@apply bg-soft-info text-info;
|
|
629
628
|
}
|
|
630
629
|
}
|
|
631
630
|
|
|
@@ -640,10 +639,10 @@
|
|
|
640
639
|
}
|
|
641
640
|
}
|
|
642
641
|
.sidenav-item:hover {
|
|
643
|
-
@apply bg-
|
|
642
|
+
@apply bg-soft-warning/50;
|
|
644
643
|
}
|
|
645
644
|
.sidenav-item.is-active {
|
|
646
|
-
@apply bg-
|
|
645
|
+
@apply bg-soft-warning text-warning;
|
|
647
646
|
}
|
|
648
647
|
}
|
|
649
648
|
|
|
@@ -658,10 +657,10 @@
|
|
|
658
657
|
}
|
|
659
658
|
}
|
|
660
659
|
.sidenav-item:hover {
|
|
661
|
-
@apply bg-
|
|
660
|
+
@apply bg-soft-danger/50;
|
|
662
661
|
}
|
|
663
662
|
.sidenav-item.is-active {
|
|
664
|
-
@apply bg-
|
|
663
|
+
@apply bg-soft-danger text-danger;
|
|
665
664
|
}
|
|
666
665
|
}
|
|
667
666
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button from '../control/Button.svelte';
|
|
3
|
+
import Modal from './Modal.svelte';
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
open: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
confirmText?: string;
|
|
10
|
+
cancelText?: string;
|
|
11
|
+
onconfirm?: () => void;
|
|
12
|
+
oncancel?: () => void;
|
|
13
|
+
color?: 'primary' | 'secondary' | 'muted' | 'success' | 'info' | 'warning' | 'danger';
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
rootClass?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
let {
|
|
19
|
+
open = $bindable(false),
|
|
20
|
+
title = 'Are you sure?',
|
|
21
|
+
description = 'This action cannot be undone.',
|
|
22
|
+
confirmText = 'Confirm',
|
|
23
|
+
cancelText = 'Cancel',
|
|
24
|
+
onconfirm,
|
|
25
|
+
oncancel,
|
|
26
|
+
color = 'danger',
|
|
27
|
+
isLoading = false,
|
|
28
|
+
rootClass
|
|
29
|
+
}: Props = $props();
|
|
30
|
+
|
|
31
|
+
function handleConfirm() {
|
|
32
|
+
onconfirm?.();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function handleCancel() {
|
|
36
|
+
open = false;
|
|
37
|
+
oncancel?.();
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<Modal bind:open hideCloseButton disableOverlayClose {rootClass}>
|
|
42
|
+
{#snippet header()}
|
|
43
|
+
<h3 class="alert-dialog-title">{title}</h3>
|
|
44
|
+
{/snippet}
|
|
45
|
+
|
|
46
|
+
<p class="alert-dialog-description">{description}</p>
|
|
47
|
+
|
|
48
|
+
{#snippet footer()}
|
|
49
|
+
<div class="alert-dialog-actions">
|
|
50
|
+
<Button variant="outlined" color="muted" onclick={handleCancel} isDisabled={isLoading}>
|
|
51
|
+
{cancelText}
|
|
52
|
+
</Button>
|
|
53
|
+
<Button {color} onclick={handleConfirm} {isLoading}>
|
|
54
|
+
{confirmText}
|
|
55
|
+
</Button>
|
|
56
|
+
</div>
|
|
57
|
+
{/snippet}
|
|
58
|
+
</Modal>
|
|
@@ -1,26 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
type Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
confirmText?: string;
|
|
6
|
+
cancelText?: string;
|
|
7
|
+
onconfirm?: () => void;
|
|
8
|
+
oncancel?: () => void;
|
|
9
|
+
color?: 'primary' | 'secondary' | 'muted' | 'success' | 'info' | 'warning' | 'danger';
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
rootClass?: string;
|
|
8
12
|
};
|
|
9
|
-
declare const AlertDialog:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}, {}, string>;
|
|
14
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
-
$$bindings?: Bindings;
|
|
17
|
-
} & Exports;
|
|
18
|
-
(internal: unknown, props: {
|
|
19
|
-
$$events?: Events;
|
|
20
|
-
$$slots?: Slots;
|
|
21
|
-
}): Exports & {
|
|
22
|
-
$set?: any;
|
|
23
|
-
$on?: any;
|
|
24
|
-
};
|
|
25
|
-
z_$$bindings?: Bindings;
|
|
26
|
-
}
|
|
13
|
+
declare const AlertDialog: import("svelte").Component<Props, {}, "open">;
|
|
14
|
+
type AlertDialog = ReturnType<typeof AlertDialog>;
|
|
15
|
+
export default AlertDialog;
|