srcdev-nuxt-components 1.0.2 → 1.0.3
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/assets/styles/utils/_page.css +6 -0
- package/assets/styles/variables/components/_display-dialog-core.css +35 -0
- package/assets/styles/variables/components/index.css +1 -0
- package/components/functional/display-dialog/DisplayDialogCore.vue +141 -71
- package/components/functional/display-dialog/variants/DisplayDialogConfirm.vue +11 -11
- package/components/functional/display-dialog/variants/DisplayDialogScrollableContent.vue +45 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.display-dialog-core {
|
|
2
|
+
--dialog-border: 0.1rem solid light-dark(var(--gray-8), var(--gray-0));
|
|
3
|
+
--dialog-outline: 0.1rem solid light-dark(var(--gray-8), var(--gray-0));
|
|
4
|
+
--dialog-border-radius: 0.4rem;
|
|
5
|
+
|
|
6
|
+
--dialog-inner-background: light-dark(var(--gray-0), var(--gray-9));
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* Header styles
|
|
10
|
+
*/
|
|
11
|
+
--dialog-header-padding: 0 1.2rem;
|
|
12
|
+
|
|
13
|
+
--dialog-header-button-margin: 0;
|
|
14
|
+
--dialog-header-button-padding: 0.4rem;
|
|
15
|
+
--dialog-header-button-border-radius: 50%;
|
|
16
|
+
|
|
17
|
+
--dialog-header-button-border: 1px solid transparent;
|
|
18
|
+
--dialog-header-button-outline: 1px solid transparent;
|
|
19
|
+
|
|
20
|
+
--dialog-header-button-border-hover: 1px solid light-dark(var(--gray-8), var(--gray-0));
|
|
21
|
+
--dialog-header-button-outline-hover: 1px solid light-dark(var(--gray-8), var(--gray-0));
|
|
22
|
+
|
|
23
|
+
--dialog-header-button-icon-color: light-dark(var(--gray-8), var(--gray-0));
|
|
24
|
+
--dialog-header-button-icon-font-size: 1.4rem;
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Header styles
|
|
28
|
+
*/
|
|
29
|
+
--dialog-content-padding: 1.2rem;
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* Footerer styles
|
|
33
|
+
*/
|
|
34
|
+
--dialog-footer-padding: 1.2rem;
|
|
35
|
+
}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<dialog class="display-dialog
|
|
2
|
+
<dialog class="display-dialog-core" :class="[variant, elementClasses]" :align-dialog :open ref="dialogRef">
|
|
3
3
|
<focus-trap v-model:active="open" :clickOutsideDeactivates="true" @deactivate="closeDialog()">
|
|
4
4
|
<div class="inner">
|
|
5
|
-
<div class="
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
5
|
+
<div class="header">
|
|
6
|
+
<div v-if="hasDialogTitle" class="col-left">
|
|
7
|
+
<slot name="dialogTitle"></slot>
|
|
8
|
+
</div>
|
|
11
9
|
|
|
12
10
|
<div class="col-center">
|
|
13
11
|
<p class="text-normal wght-700">Center col</p>
|
|
14
12
|
</div>
|
|
15
13
|
<div class="col-right">
|
|
16
|
-
<button @click.prevent="closeDialog()">
|
|
14
|
+
<button @click.prevent="closeDialog()" data-test-id="display-dialog-header-close" class="display-prompt-action">
|
|
15
|
+
<Icon name="bitcoin-icons:cross-filled" class="icon" />
|
|
16
|
+
<span class="sr-only">Really Close</span>
|
|
17
|
+
</button>
|
|
17
18
|
</div>
|
|
18
19
|
</div>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</
|
|
20
|
+
<div v-if="hasDialogContent" class="dialog-content" :class="[{ 'allow-content-scroll': allowContentScroll }]">
|
|
21
|
+
<slot name="dialogContent"></slot>
|
|
22
|
+
</div>
|
|
23
|
+
<div v-if="hasActionButtons" class="footer">
|
|
24
|
+
<slot name="actionButtons"></slot>
|
|
25
|
+
</div>
|
|
25
26
|
</div>
|
|
26
27
|
</focus-trap>
|
|
27
28
|
</dialog>
|
|
@@ -37,7 +38,7 @@ const props = defineProps({
|
|
|
37
38
|
variant: {
|
|
38
39
|
type: String,
|
|
39
40
|
default: 'dialog',
|
|
40
|
-
validator: (val) => ['dialog', 'modal'].includes(val as string),
|
|
41
|
+
validator: (val) => ['dialog', 'modal', 'confirm'].includes(val as string),
|
|
41
42
|
},
|
|
42
43
|
positionX: {
|
|
43
44
|
type: String,
|
|
@@ -53,6 +54,10 @@ const props = defineProps({
|
|
|
53
54
|
type: Boolean,
|
|
54
55
|
default: true,
|
|
55
56
|
},
|
|
57
|
+
allowContentScroll: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
56
61
|
});
|
|
57
62
|
|
|
58
63
|
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
@@ -85,8 +90,36 @@ onMounted(() => {
|
|
|
85
90
|
</script>
|
|
86
91
|
|
|
87
92
|
<style lang="css">
|
|
88
|
-
.display-dialog {
|
|
93
|
+
.display-dialog-core {
|
|
94
|
+
--_dialog-inner-height: initial;
|
|
95
|
+
--_dialog-inner-width: 100vw;
|
|
96
|
+
|
|
89
97
|
display: flex;
|
|
98
|
+
position: fixed;
|
|
99
|
+
left: 0;
|
|
100
|
+
top: 0;
|
|
101
|
+
width: 100%;
|
|
102
|
+
height: 100%;
|
|
103
|
+
backdrop-filter: blur(5px);
|
|
104
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
105
|
+
z-index: 13;
|
|
106
|
+
opacity: 0;
|
|
107
|
+
border: none;
|
|
108
|
+
padding: 0;
|
|
109
|
+
|
|
110
|
+
display: none;
|
|
111
|
+
transition: opacity 200ms, display 200ms, overlay 200ms;
|
|
112
|
+
transition-behavior: allow-discrete;
|
|
113
|
+
|
|
114
|
+
&[open] {
|
|
115
|
+
display: flex;
|
|
116
|
+
opacity: 1;
|
|
117
|
+
|
|
118
|
+
@starting-style {
|
|
119
|
+
display: flex;
|
|
120
|
+
opacity: 0;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
90
123
|
|
|
91
124
|
&[align-dialog$='center'] {
|
|
92
125
|
justify-content: center;
|
|
@@ -95,76 +128,113 @@ onMounted(() => {
|
|
|
95
128
|
align-items: center;
|
|
96
129
|
}
|
|
97
130
|
|
|
98
|
-
&.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
top: 0;
|
|
102
|
-
width: 100%;
|
|
103
|
-
height: 100%;
|
|
104
|
-
backdrop-filter: blur(5px);
|
|
105
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
106
|
-
border: 0.1rem solid var(--color-grey-1);
|
|
107
|
-
z-index: 13;
|
|
108
|
-
opacity: 0;
|
|
109
|
-
|
|
110
|
-
display: none;
|
|
111
|
-
transition: opacity 200ms, display 200ms, overlay 200ms;
|
|
112
|
-
transition-behavior: allow-discrete;
|
|
113
|
-
|
|
114
|
-
&[open] {
|
|
115
|
-
display: flex;
|
|
116
|
-
opacity: 1;
|
|
131
|
+
&.confirm {
|
|
132
|
+
--_dialog-inner-width: initial;
|
|
133
|
+
}
|
|
117
134
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
}
|
|
135
|
+
&.dialog {
|
|
136
|
+
--_dialog-inner-height: 70dvh;
|
|
137
|
+
--_dialog-inner-width: min(75%, 720px);
|
|
123
138
|
}
|
|
124
139
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
margin: 1.2rem;
|
|
129
|
-
padding: 1.2rem;
|
|
140
|
+
&.form {
|
|
141
|
+
--_dialog-inner-width: initial;
|
|
142
|
+
}
|
|
130
143
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
144
|
+
&.fullscreen {
|
|
145
|
+
--_dialog-inner-width: initial;
|
|
146
|
+
}
|
|
134
147
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
width: 100vw;
|
|
138
|
-
} */
|
|
148
|
+
&.modal {
|
|
149
|
+
--_dialog-inner-width: initial;
|
|
139
150
|
}
|
|
140
151
|
|
|
141
|
-
.
|
|
152
|
+
.inner {
|
|
142
153
|
display: grid;
|
|
143
|
-
grid-template-
|
|
144
|
-
|
|
154
|
+
grid-template-rows: auto 1fr auto;
|
|
155
|
+
|
|
156
|
+
border-radius: var(--dialog-border-radius);
|
|
157
|
+
border: var(--dialog-border);
|
|
158
|
+
outline: var(--dialog-outline);
|
|
159
|
+
|
|
160
|
+
background-color: var(--dialog-inner-background);
|
|
161
|
+
height: var(--_dialog-inner-height);
|
|
162
|
+
width: var(--_dialog-inner-width);
|
|
145
163
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
|
|
166
|
+
.header {
|
|
167
|
+
display: grid;
|
|
168
|
+
grid-template-columns: auto 1fr auto;
|
|
169
|
+
align-items: center;
|
|
170
|
+
|
|
171
|
+
padding: var(--dialog-header-padding);
|
|
172
|
+
|
|
173
|
+
.col-left {
|
|
174
|
+
/* grid-column: 1; */
|
|
175
|
+
/* display: none; */
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.col-center {
|
|
179
|
+
/* grid-column: 2; */
|
|
180
|
+
text-align: center;
|
|
181
|
+
|
|
182
|
+
color: var(--color-red-1);
|
|
183
|
+
display: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.col-right {
|
|
187
|
+
grid-column: 3;
|
|
188
|
+
|
|
189
|
+
.display-prompt-action {
|
|
190
|
+
background-color: transparent;
|
|
191
|
+
display: block flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
justify-content: center;
|
|
194
|
+
margin: var(--dialog-header-button-margin);
|
|
195
|
+
padding: var(--dialog-header-button-padding);
|
|
196
|
+
border: var(--dialog-header-button-border);
|
|
197
|
+
border-radius: var(--dialog-header-button-border-radius);
|
|
198
|
+
outline: var(--dialog-header-button-outline);
|
|
199
|
+
|
|
200
|
+
transition: border-color 0.2s, outline-color 0.2s;
|
|
201
|
+
|
|
202
|
+
&:hover,
|
|
203
|
+
&:focus-visible {
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
border: var(--dialog-header-button-border-hover);
|
|
206
|
+
outline: var(--dialog-header-button-outline-hover);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.icon {
|
|
210
|
+
color: var(--dialog-header-button-icon-color);
|
|
211
|
+
display: block;
|
|
212
|
+
font-size: var(--dialog-header-button-icon-font-size);
|
|
213
|
+
border: 1px solid green;
|
|
214
|
+
padding: 1rem;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
149
218
|
}
|
|
150
219
|
|
|
151
|
-
.
|
|
152
|
-
|
|
153
|
-
|
|
220
|
+
.dialog-content {
|
|
221
|
+
overflow: hidden;
|
|
222
|
+
padding: var(--dialog-content-padding);
|
|
154
223
|
|
|
155
|
-
|
|
156
|
-
|
|
224
|
+
&.allow-content-scroll {
|
|
225
|
+
overflow-y: auto;
|
|
226
|
+
&::-webkit-scrollbar {
|
|
227
|
+
display: none;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
157
230
|
}
|
|
158
231
|
|
|
159
|
-
.
|
|
160
|
-
|
|
232
|
+
.footer {
|
|
233
|
+
display: flex;
|
|
234
|
+
gap: 1.2rem;
|
|
235
|
+
justify-content: flex-end;
|
|
236
|
+
padding: var(--dialog-footer-padding);
|
|
161
237
|
}
|
|
162
238
|
}
|
|
163
|
-
|
|
164
|
-
/* .button-row {
|
|
165
|
-
display: flex;
|
|
166
|
-
gap: 1.2rem;
|
|
167
|
-
justify-content: flex-end;
|
|
168
|
-
} */
|
|
169
239
|
}
|
|
170
240
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<DisplayDialogCore :styleClassPassthrough :lockViewport="true">
|
|
2
|
+
<DisplayDialogCore variant="confirm" :styleClassPassthrough :lockViewport="true">
|
|
3
3
|
<template #dialogTitle>
|
|
4
4
|
<slot name="dialogTitle">
|
|
5
5
|
<p class="text-normal wght-700">Confirm</p>
|
|
@@ -25,16 +25,16 @@ const props = defineProps({
|
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
<style lang="css">
|
|
28
|
-
.display-dialog {
|
|
29
|
-
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
.display-dialog-core {
|
|
29
|
+
.inner {
|
|
30
|
+
.header {
|
|
31
|
+
/* background-color: aquamarine; */
|
|
32
|
+
}
|
|
33
|
+
.dialog-content {
|
|
34
|
+
/* background-color: bisque; */
|
|
35
|
+
}
|
|
36
|
+
.footer {
|
|
37
|
+
/* background-color: blueviolet; */
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DisplayDialogCore variant="dialog" :styleClassPassthrough :lockViewport="true" :allowContentScroll>
|
|
3
|
+
<template #dialogTitle>
|
|
4
|
+
<slot name="dialogTitle">
|
|
5
|
+
<p class="text-normal wght-700">Confirm</p>
|
|
6
|
+
</slot>
|
|
7
|
+
</template>
|
|
8
|
+
<template #dialogContent>
|
|
9
|
+
<slot name="dialogContent"></slot>
|
|
10
|
+
</template>
|
|
11
|
+
<template #actionButtons>
|
|
12
|
+
<slot name="actionButtonLeft"></slot>
|
|
13
|
+
<slot name="actionButtonRight"></slot>
|
|
14
|
+
</template>
|
|
15
|
+
</DisplayDialogCore>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
styleClassPassthrough: {
|
|
21
|
+
type: Array as PropType<string[]>,
|
|
22
|
+
default: () => [],
|
|
23
|
+
},
|
|
24
|
+
allowContentScroll: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style lang="css">
|
|
32
|
+
.display-dialog-core {
|
|
33
|
+
.inner {
|
|
34
|
+
.header {
|
|
35
|
+
/* background-color: aquamarine; */
|
|
36
|
+
}
|
|
37
|
+
.dialog-content {
|
|
38
|
+
/* background-color: bisque; */
|
|
39
|
+
}
|
|
40
|
+
.footer {
|
|
41
|
+
/* background-color: blueviolet; */
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</style>
|
package/package.json
CHANGED