noph-ui 0.11.10 → 0.12.0
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/dist/dialog/Dialog.svelte +28 -12
- package/dist/dialog/types.d.ts +2 -1
- package/package.json +1 -1
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
element = $bindable(),
|
|
7
7
|
showPopover = $bindable(),
|
|
8
8
|
hidePopover = $bindable(),
|
|
9
|
+
quick = false,
|
|
9
10
|
children,
|
|
10
11
|
headline,
|
|
11
12
|
icon,
|
|
12
13
|
supportingText,
|
|
13
|
-
|
|
14
|
+
actions,
|
|
14
15
|
divider,
|
|
15
16
|
...attributes
|
|
16
17
|
}: DialogProps = $props()
|
|
@@ -24,7 +25,12 @@
|
|
|
24
25
|
}
|
|
25
26
|
</script>
|
|
26
27
|
|
|
27
|
-
<div
|
|
28
|
+
<div
|
|
29
|
+
bind:this={element}
|
|
30
|
+
popover="auto"
|
|
31
|
+
{...attributes}
|
|
32
|
+
class={['np-dialog-container', !quick && 'np-animate']}
|
|
33
|
+
>
|
|
28
34
|
<div
|
|
29
35
|
role="none"
|
|
30
36
|
class="np-backdrop"
|
|
@@ -48,9 +54,9 @@
|
|
|
48
54
|
{#if children}
|
|
49
55
|
{@render children()}
|
|
50
56
|
{/if}
|
|
51
|
-
{#if
|
|
52
|
-
<div class="np-dialog-
|
|
53
|
-
{@render
|
|
57
|
+
{#if actions}
|
|
58
|
+
<div class="np-dialog-actions">
|
|
59
|
+
{@render actions()}
|
|
54
60
|
</div>
|
|
55
61
|
{/if}
|
|
56
62
|
</div>
|
|
@@ -64,9 +70,6 @@
|
|
|
64
70
|
padding: 9px 14px 20px 14px;
|
|
65
71
|
z-index: 1000;
|
|
66
72
|
padding: 2rem 1rem;
|
|
67
|
-
transition:
|
|
68
|
-
display 0.25s allow-discrete,
|
|
69
|
-
overlay 0.25s allow-discrete;
|
|
70
73
|
}
|
|
71
74
|
.np-dialog {
|
|
72
75
|
border: 0;
|
|
@@ -80,11 +83,20 @@
|
|
|
80
83
|
max-height: 100dvh;
|
|
81
84
|
scrollbar-color: var(--np-color-on-surface-variant) transparent;
|
|
82
85
|
scrollbar-width: thin;
|
|
86
|
+
position: relative;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.np-animate {
|
|
90
|
+
transition:
|
|
91
|
+
display 0.25s allow-discrete,
|
|
92
|
+
overlay 0.25s allow-discrete;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.np-animate[popover] .np-dialog {
|
|
83
96
|
transition: opacity 0.25s ease;
|
|
84
97
|
opacity: 0;
|
|
85
|
-
position: relative;
|
|
86
98
|
}
|
|
87
|
-
.np-
|
|
99
|
+
.np-animate:popover-open .np-dialog {
|
|
88
100
|
opacity: 1;
|
|
89
101
|
@starting-style {
|
|
90
102
|
opacity: 0;
|
|
@@ -94,10 +106,13 @@
|
|
|
94
106
|
inset: 0;
|
|
95
107
|
position: fixed;
|
|
96
108
|
background-color: var(--np-color-scrim);
|
|
109
|
+
opacity: 0.38;
|
|
110
|
+
}
|
|
111
|
+
.np-animate[popover] .np-backdrop {
|
|
97
112
|
opacity: 0;
|
|
98
113
|
transition: opacity 0.25s ease;
|
|
99
114
|
}
|
|
100
|
-
.np-
|
|
115
|
+
.np-animate[popover]:popover-open .np-backdrop {
|
|
101
116
|
opacity: 0.38;
|
|
102
117
|
@starting-style {
|
|
103
118
|
opacity: 0;
|
|
@@ -117,10 +132,11 @@
|
|
|
117
132
|
font-size: 1.5rem;
|
|
118
133
|
font-weight: 400;
|
|
119
134
|
}
|
|
120
|
-
.np-dialog-
|
|
135
|
+
.np-dialog-actions {
|
|
121
136
|
display: flex;
|
|
122
137
|
justify-content: flex-end;
|
|
123
138
|
gap: 0.5rem;
|
|
139
|
+
box-sizing: border-box;
|
|
124
140
|
margin-top: 1.5rem;
|
|
125
141
|
}
|
|
126
142
|
.np-dialog-supporting-text {
|
package/dist/dialog/types.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export interface DialogProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class
|
|
|
5
5
|
headline: string;
|
|
6
6
|
supportingText?: string;
|
|
7
7
|
divider?: boolean;
|
|
8
|
-
|
|
8
|
+
actions?: Snippet;
|
|
9
|
+
quick?: boolean;
|
|
9
10
|
element?: HTMLElement;
|
|
10
11
|
showPopover?: () => void;
|
|
11
12
|
hidePopover?: () => void;
|