@parallelogram-js/dashboard 0.0.0-stage → 0.1.2
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/CHANGELOG.md +124 -0
- package/LICENSE +21 -0
- package/README.md +1391 -2
- package/dist/parallelogram-dashboard.css +9478 -0
- package/dist/parallelogram-dashboard.css.map +1 -0
- package/dist/parallelogram-dashboard.min.css +1 -0
- package/package.json +72 -4
- package/scss/_base.scss +403 -0
- package/scss/_datetime.scss +50 -0
- package/scss/_icon.scss +40 -0
- package/scss/_index.scss +61 -0
- package/scss/_mixins.scss +396 -0
- package/scss/_tokens.scss +340 -0
- package/scss/_utilities.scss +464 -0
- package/scss/_variables.scss +219 -0
- package/scss/components/_accordion.scss +297 -0
- package/scss/components/_actionbar.scss +333 -0
- package/scss/components/_alert.scss +183 -0
- package/scss/components/_auth.scss +98 -0
- package/scss/components/_avatar.scss +203 -0
- package/scss/components/_badge.scss +176 -0
- package/scss/components/_banner.scss +344 -0
- package/scss/components/_breadcrumb.scss +220 -0
- package/scss/components/_button.scss +264 -0
- package/scss/components/_card.scss +256 -0
- package/scss/components/_chart.scss +246 -0
- package/scss/components/_command.scss +267 -0
- package/scss/components/_dashboard.scss +681 -0
- package/scss/components/_data-list.scss +280 -0
- package/scss/components/_dropdown.scss +318 -0
- package/scss/components/_empty.scss +226 -0
- package/scss/components/_filebrowser.scss +906 -0
- package/scss/components/_form-layout.scss +332 -0
- package/scss/components/_input.scss +310 -0
- package/scss/components/_list.scss +130 -0
- package/scss/components/_media.scss +239 -0
- package/scss/components/_modal.scss +298 -0
- package/scss/components/_navbar.scss +312 -0
- package/scss/components/_notification.scss +59 -0
- package/scss/components/_pageheader.scss +99 -0
- package/scss/components/_pagination.scss +165 -0
- package/scss/components/_progress.scss +333 -0
- package/scss/components/_separator.scss +129 -0
- package/scss/components/_sheet.scss +286 -0
- package/scss/components/_sidebar.scss +324 -0
- package/scss/components/_skeleton.scss +246 -0
- package/scss/components/_stat.scss +218 -0
- package/scss/components/_table.scss +589 -0
- package/scss/components/_tabs.scss +266 -0
- package/scss/components/_timeline.scss +339 -0
- package/scss/components/_toast.scss +259 -0
- package/scss/components/_toolbar.scss +301 -0
- package/scss/components/_tooltip.scss +250 -0
- package/scss/main.scss +6 -0
- package/src/js/behaviours/accordion.js +58 -0
- package/src/js/behaviours/action-bar-list.js +406 -0
- package/src/js/behaviours/action-bar.js +29 -0
- package/src/js/behaviours/chart.js +339 -0
- package/src/js/behaviours/collapsible.js +34 -0
- package/src/js/behaviours/editable-table.js +91 -0
- package/src/js/behaviours/expandable.js +80 -0
- package/src/js/behaviours/overflow-actions.js +137 -0
- package/src/js/behaviours/publish-schedule.js +91 -0
- package/src/js/behaviours/search-clear.js +19 -0
- package/src/js/behaviours/segmented-control.js +43 -0
- package/src/js/behaviours/submenu.js +73 -0
- package/src/js/behaviours/table-columns.js +77 -0
- package/src/js/behaviours/table-paste.js +305 -0
- package/src/js/behaviours/table-reorder.js +252 -0
- package/src/js/behaviours/table-sort.js +101 -0
- package/src/js/behaviours/tabs.js +148 -0
- package/src/js/behaviours/toast-manager.js +106 -0
- package/src/js/behaviours/toggle.js +186 -0
- package/src/js/behaviours/unsaved-guard.js +88 -0
- package/src/js/core-loader.js +26 -0
- package/src/js/index.js +85 -0
- package/src/js/polyfills/dialog-commands.js +20 -0
- package/src/js/util/dom.js +39 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List Component
|
|
3
|
+
*
|
|
4
|
+
* Rows with an optional leading status, a title and description, and trailing actions.
|
|
5
|
+
* An empty .list__status renders as a dot; put an icon inside it to show that instead.
|
|
6
|
+
* --segment divides rows with rules, --boxed puts each row in its own bordered box.
|
|
7
|
+
* The status and actions line up with the title's first line, like a bullet; --center centres them on the whole row.
|
|
8
|
+
* --disc and --spaced cover plain text lists.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
@use "../variables" as *;
|
|
12
|
+
|
|
13
|
+
.list {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
|
|
17
|
+
&--spaced {
|
|
18
|
+
gap: $spacing-2xs;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&--disc {
|
|
22
|
+
display: block;
|
|
23
|
+
list-style: disc;
|
|
24
|
+
padding-left: 1.25rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--segment > .list__item {
|
|
28
|
+
padding: $spacing-xs 0;
|
|
29
|
+
border-bottom: 1px solid var(--border);
|
|
30
|
+
|
|
31
|
+
&:first-child {
|
|
32
|
+
padding-top: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:last-child {
|
|
36
|
+
padding-bottom: 0;
|
|
37
|
+
border-bottom: none;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--center {
|
|
42
|
+
> .list__item {
|
|
43
|
+
align-items: center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.list__status {
|
|
47
|
+
height: auto;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&--boxed {
|
|
52
|
+
gap: $spacing-2xs;
|
|
53
|
+
|
|
54
|
+
> .list__item {
|
|
55
|
+
padding: $spacing-xs $spacing-sm;
|
|
56
|
+
background-color: var(--card);
|
|
57
|
+
border: 1px solid var(--border);
|
|
58
|
+
border-radius: $radius;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&__item {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: flex-start;
|
|
65
|
+
gap: $spacing-xs;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&__status {
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
height: 1lh;
|
|
72
|
+
font-size: $font-size-sm;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
color: var(--fg-muted);
|
|
76
|
+
|
|
77
|
+
&:empty::before {
|
|
78
|
+
content: "";
|
|
79
|
+
width: 0.5rem;
|
|
80
|
+
height: 0.5rem;
|
|
81
|
+
border-radius: $radius-full;
|
|
82
|
+
background-color: currentColor;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
svg {
|
|
86
|
+
width: $icon-size-md;
|
|
87
|
+
height: $icon-size-md;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--success {
|
|
91
|
+
color: var(--success);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--warning {
|
|
95
|
+
color: var(--warning);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&--error {
|
|
99
|
+
color: var(--destructive);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--info {
|
|
103
|
+
color: var(--info);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&__body {
|
|
108
|
+
flex: 1;
|
|
109
|
+
min-width: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&__title {
|
|
113
|
+
font-size: $font-size-sm;
|
|
114
|
+
font-weight: $font-weight-medium;
|
|
115
|
+
color: var(--fg);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&__description {
|
|
119
|
+
margin-top: $spacing-3xs;
|
|
120
|
+
font-size: $font-size-xs;
|
|
121
|
+
color: var(--fg-muted);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&__actions {
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-shrink: 0;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: $spacing-2xs;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Media field
|
|
3
|
+
*
|
|
4
|
+
* Contenir's gallery field: a grid of asset tiles that reorder by drag ([data-handle]), each with
|
|
5
|
+
* a remove button and a copy-URL button (.media__copy), and a dashed "+" tile ([data-filebrowser-add]) that opens the file browser.
|
|
6
|
+
* Class names match Contenir's markup so these styles drop onto it unchanged.
|
|
7
|
+
*
|
|
8
|
+
* Files can also be dropped straight onto the field: .media__list--dragover marks it while files
|
|
9
|
+
* are dragged over, and each dropped file becomes a tile with .media--busy and a .media__progress
|
|
10
|
+
* bar (width from --progress) until it uploads, or .media--error if it fails.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
@use "../variables" as *;
|
|
14
|
+
@use "../mixins" as *;
|
|
15
|
+
|
|
16
|
+
.media {
|
|
17
|
+
position: relative;
|
|
18
|
+
aspect-ratio: 1;
|
|
19
|
+
list-style: none;
|
|
20
|
+
background-color: var(--bg-muted);
|
|
21
|
+
border: 1px solid var(--border);
|
|
22
|
+
border-radius: $radius-md;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
@include transition-colors;
|
|
25
|
+
|
|
26
|
+
&.editable:hover {
|
|
27
|
+
border-color: var(--fg-subtle);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.editable[data-handle] {
|
|
31
|
+
cursor: grab;
|
|
32
|
+
|
|
33
|
+
&:active {
|
|
34
|
+
cursor: grabbing;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.selected {
|
|
39
|
+
border-color: var(--primary);
|
|
40
|
+
box-shadow: 0 0 0 1px var(--primary);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// The "+" tile
|
|
44
|
+
&[data-filebrowser-add] {
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
border-style: dashed;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__list {
|
|
50
|
+
display: grid;
|
|
51
|
+
grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
|
|
52
|
+
gap: $spacing-2xs;
|
|
53
|
+
margin: 0;
|
|
54
|
+
padding: 0;
|
|
55
|
+
list-style: none;
|
|
56
|
+
|
|
57
|
+
&--small {
|
|
58
|
+
grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Files are being dragged over the field
|
|
62
|
+
&--dragover {
|
|
63
|
+
border-radius: $radius-md;
|
|
64
|
+
outline: 2px dashed var(--primary);
|
|
65
|
+
outline-offset: $spacing-3xs;
|
|
66
|
+
|
|
67
|
+
.media[data-filebrowser-add] {
|
|
68
|
+
color: var(--primary);
|
|
69
|
+
background-color: color-mix(in srgb, var(--primary) 8%, transparent);
|
|
70
|
+
border-color: var(--primary);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Uploading straight into the field
|
|
76
|
+
&--busy {
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
|
|
79
|
+
.media__image img {
|
|
80
|
+
opacity: 0.5;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&--error {
|
|
85
|
+
.media__image img {
|
|
86
|
+
opacity: 0.4;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.media__progress-fill {
|
|
90
|
+
background-color: var(--destructive);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__progress {
|
|
95
|
+
position: absolute;
|
|
96
|
+
left: $spacing-2xs;
|
|
97
|
+
right: $spacing-2xs;
|
|
98
|
+
bottom: $spacing-2xs;
|
|
99
|
+
height: 4px;
|
|
100
|
+
background-color: var(--bg);
|
|
101
|
+
border-radius: $radius-full;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__progress-fill {
|
|
106
|
+
display: block;
|
|
107
|
+
width: var(--progress, 0%);
|
|
108
|
+
height: 100%;
|
|
109
|
+
background-color: var(--primary);
|
|
110
|
+
border-radius: inherit;
|
|
111
|
+
transition: width $transition-base linear;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&__image {
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
margin: 0;
|
|
118
|
+
|
|
119
|
+
picture,
|
|
120
|
+
img {
|
|
121
|
+
display: block;
|
|
122
|
+
width: 100%;
|
|
123
|
+
height: 100%;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
img {
|
|
127
|
+
padding: $spacing-3xs;
|
|
128
|
+
object-fit: contain;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Buttons in the tile's top-right corner, shown while it's hovered or focused
|
|
133
|
+
// Inset past the image's own padding, so they sit clear of its edges
|
|
134
|
+
&__remove,
|
|
135
|
+
&__copy {
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: $spacing-2xs;
|
|
138
|
+
right: $spacing-2xs;
|
|
139
|
+
display: inline-flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
width: 1.5rem;
|
|
143
|
+
height: 1.5rem;
|
|
144
|
+
padding: 0;
|
|
145
|
+
color: var(--fg-muted);
|
|
146
|
+
background-color: var(--card);
|
|
147
|
+
border: 1px solid var(--border);
|
|
148
|
+
border-radius: $radius-sm;
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
opacity: 0;
|
|
151
|
+
@include transition-default;
|
|
152
|
+
|
|
153
|
+
svg {
|
|
154
|
+
width: $icon-size-sm;
|
|
155
|
+
height: $icon-size-sm;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:focus-visible {
|
|
159
|
+
opacity: 1;
|
|
160
|
+
@include focus-ring;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Touch screens have no hover, so the buttons are always there
|
|
164
|
+
@media (hover: none) {
|
|
165
|
+
opacity: 1;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&__remove:hover {
|
|
170
|
+
color: var(--destructive);
|
|
171
|
+
border-color: var(--destructive);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Copies the asset's URL; sits in the opposite corner to the remove button
|
|
175
|
+
&__copy {
|
|
176
|
+
right: auto;
|
|
177
|
+
left: $spacing-2xs;
|
|
178
|
+
|
|
179
|
+
&:hover {
|
|
180
|
+
color: var(--primary);
|
|
181
|
+
border-color: var(--fg-subtle);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&:hover :is(&__remove, &__copy),
|
|
186
|
+
&:focus-within :is(&__remove, &__copy) {
|
|
187
|
+
opacity: 1;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// The tile clips its contents, so tooltips open downwards and line up with their button's
|
|
191
|
+
// outer edge (right for remove, left for copy)
|
|
192
|
+
[data-tooltip]::after {
|
|
193
|
+
top: calc(100% + #{$spacing-2xs});
|
|
194
|
+
right: 0;
|
|
195
|
+
bottom: auto;
|
|
196
|
+
left: auto;
|
|
197
|
+
transform: none;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&__copy[data-tooltip]::after {
|
|
201
|
+
right: auto;
|
|
202
|
+
left: 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
[data-tooltip]::before {
|
|
206
|
+
top: calc(100% + #{$spacing-2xs} - 10px);
|
|
207
|
+
bottom: auto;
|
|
208
|
+
border-color: transparent;
|
|
209
|
+
border-bottom-color: var(--primary);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&__btn {
|
|
213
|
+
display: flex;
|
|
214
|
+
align-items: center;
|
|
215
|
+
justify-content: center;
|
|
216
|
+
width: 100%;
|
|
217
|
+
height: 100%;
|
|
218
|
+
padding: 0;
|
|
219
|
+
color: var(--fg-muted);
|
|
220
|
+
background: transparent;
|
|
221
|
+
border: 0;
|
|
222
|
+
cursor: pointer;
|
|
223
|
+
@include transition-colors;
|
|
224
|
+
|
|
225
|
+
svg {
|
|
226
|
+
width: $icon-size-lg;
|
|
227
|
+
height: $icon-size-lg;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&:hover {
|
|
231
|
+
color: var(--fg);
|
|
232
|
+
background-color: var(--accent);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&:focus-visible {
|
|
236
|
+
@include focus-ring;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
// ==========================================================================
|
|
2
|
+
// Modal / Dialog Component
|
|
3
|
+
// Compatible with @parallelogram-js/core <p-modal> web component
|
|
4
|
+
// ==========================================================================
|
|
5
|
+
|
|
6
|
+
@use "../variables" as *;
|
|
7
|
+
@use "../mixins" as *;
|
|
8
|
+
|
|
9
|
+
// --------------------------------------------------------------------------
|
|
10
|
+
// PModal Web Component Custom Properties
|
|
11
|
+
// Colours, surfaces and buttons come from the core tokens in _variables.scss; these are only
|
|
12
|
+
// the sizes and timings where the dashboard differs from core's defaults
|
|
13
|
+
// --------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
// Until the component loads, its slotted content would show inline on the page
|
|
16
|
+
p-modal:not(:defined) {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
p-modal > [slot="title"] {
|
|
21
|
+
font-size: $font-size-lg;
|
|
22
|
+
font-weight: $font-weight-semibold;
|
|
23
|
+
line-height: $line-height-tight;
|
|
24
|
+
letter-spacing: $letter-spacing-tight;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
p-modal {
|
|
28
|
+
--modal-backdrop-bg: var(--color-overlay);
|
|
29
|
+
|
|
30
|
+
// Spacing
|
|
31
|
+
--modal-space-lg: #{$spacing-xs};
|
|
32
|
+
--modal-space-xl: #{$spacing-sm};
|
|
33
|
+
--modal-padding-x: #{$spacing-lg};
|
|
34
|
+
--modal-padding-y: #{$spacing-sm};
|
|
35
|
+
--modal-gap: #{$spacing-2xs};
|
|
36
|
+
|
|
37
|
+
// Border radius
|
|
38
|
+
--modal-radius: #{$radius};
|
|
39
|
+
--modal-radius-xl: #{$radius-lg};
|
|
40
|
+
|
|
41
|
+
// Timing
|
|
42
|
+
--modal-transition: #{$transition-base};
|
|
43
|
+
--modal-animation-duration: #{$transition-fast};
|
|
44
|
+
--modal-animation-easing: #{$transition-easing};
|
|
45
|
+
|
|
46
|
+
// Sizes
|
|
47
|
+
--modal-size-xs: 18.75rem;
|
|
48
|
+
--modal-size-sm: 24rem;
|
|
49
|
+
--modal-size-md: 32rem;
|
|
50
|
+
--modal-size-lg: 48rem;
|
|
51
|
+
--modal-size-xl: 64rem;
|
|
52
|
+
--modal-max-width: calc(100vw - #{$spacing-xl});
|
|
53
|
+
--modal-max-height: calc(100vh - #{$spacing-xl});
|
|
54
|
+
--modal-fullscreen-inset: #{$spacing-lg};
|
|
55
|
+
|
|
56
|
+
// Typography
|
|
57
|
+
--modal-font-sm: #{$font-size-sm};
|
|
58
|
+
--modal-font-md: #{$font-size-lg};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// --------------------------------------------------------------------------
|
|
62
|
+
// Fallback Modal Overlay (for non-JS or custom implementations)
|
|
63
|
+
// --------------------------------------------------------------------------
|
|
64
|
+
|
|
65
|
+
.modaloverlay {
|
|
66
|
+
position: fixed;
|
|
67
|
+
inset: 0;
|
|
68
|
+
z-index: $z-modal-backdrop;
|
|
69
|
+
background-color: rgb(0 0 0 / 0.5);
|
|
70
|
+
backdrop-filter: blur(2px);
|
|
71
|
+
opacity: 0;
|
|
72
|
+
visibility: hidden;
|
|
73
|
+
@include transition-opacity;
|
|
74
|
+
|
|
75
|
+
&[open],
|
|
76
|
+
&--open {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
visibility: visible;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// --------------------------------------------------------------------------
|
|
83
|
+
// Fallback Modal Container (for non-JS or custom implementations)
|
|
84
|
+
// --------------------------------------------------------------------------
|
|
85
|
+
|
|
86
|
+
.modal {
|
|
87
|
+
position: fixed;
|
|
88
|
+
inset: 0;
|
|
89
|
+
z-index: $z-modal;
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
padding: $spacing-sm;
|
|
94
|
+
pointer-events: none;
|
|
95
|
+
|
|
96
|
+
&[open],
|
|
97
|
+
&--open {
|
|
98
|
+
pointer-events: auto;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Opened with showModal() (or command="show-modal"), the dialog draws its own backdrop,
|
|
102
|
+
// so no separate .modaloverlay is needed
|
|
103
|
+
&:modal::backdrop {
|
|
104
|
+
background-color: rgb(0 0 0 / 0.5);
|
|
105
|
+
backdrop-filter: blur(2px);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// --------------------------------------------------------------------------
|
|
109
|
+
// Dialog Box
|
|
110
|
+
// --------------------------------------------------------------------------
|
|
111
|
+
|
|
112
|
+
&__dialog {
|
|
113
|
+
position: relative;
|
|
114
|
+
width: 100%;
|
|
115
|
+
max-width: 32rem;
|
|
116
|
+
max-height: calc(100vh - #{$spacing-xl});
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-direction: column;
|
|
119
|
+
background-color: var(--bg);
|
|
120
|
+
border: 1px solid var(--border);
|
|
121
|
+
border-radius: $radius;
|
|
122
|
+
box-shadow: $shadow-xl;
|
|
123
|
+
opacity: 0;
|
|
124
|
+
transform: scale(0.95) translateY(-1rem);
|
|
125
|
+
@include transition-default;
|
|
126
|
+
|
|
127
|
+
.modal[open] &,
|
|
128
|
+
.modal--open & {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
transform: scale(1) translateY(0);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// --------------------------------------------------------------------------
|
|
135
|
+
// Size Variants
|
|
136
|
+
// --------------------------------------------------------------------------
|
|
137
|
+
|
|
138
|
+
&__dialog--xs {
|
|
139
|
+
max-width: 18.75rem;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&__dialog--sm {
|
|
143
|
+
max-width: 24rem;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&__dialog--lg {
|
|
147
|
+
max-width: 48rem;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&__dialog--xl {
|
|
151
|
+
max-width: 64rem;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&__dialog--fullscreen {
|
|
155
|
+
max-width: calc(100vw - #{$spacing-xl});
|
|
156
|
+
max-height: calc(100vh - #{$spacing-xl});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// --------------------------------------------------------------------------
|
|
160
|
+
// Elements
|
|
161
|
+
// --------------------------------------------------------------------------
|
|
162
|
+
|
|
163
|
+
&__header {
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: flex-start;
|
|
166
|
+
justify-content: space-between;
|
|
167
|
+
gap: $spacing-sm;
|
|
168
|
+
padding: $spacing-lg;
|
|
169
|
+
border-bottom: 1px solid var(--border);
|
|
170
|
+
flex-shrink: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&__title {
|
|
174
|
+
font-size: $font-size-lg;
|
|
175
|
+
font-weight: $font-weight-semibold;
|
|
176
|
+
line-height: $line-height-tight;
|
|
177
|
+
letter-spacing: $letter-spacing-tight;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&__description {
|
|
181
|
+
margin-top: $spacing-3xs;
|
|
182
|
+
font-size: $font-size-sm;
|
|
183
|
+
color: var(--fg-muted);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&__close {
|
|
187
|
+
display: inline-flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
width: 2rem;
|
|
191
|
+
height: 2rem;
|
|
192
|
+
margin: calc($spacing-3xs * -1);
|
|
193
|
+
border-radius: $radius-sm;
|
|
194
|
+
color: var(--fg-muted);
|
|
195
|
+
flex-shrink: 0;
|
|
196
|
+
@include interactive;
|
|
197
|
+
|
|
198
|
+
&:hover {
|
|
199
|
+
color: var(--fg);
|
|
200
|
+
background-color: var(--accent);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
svg {
|
|
204
|
+
width: $icon-size-md;
|
|
205
|
+
height: $icon-size-md;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&__content {
|
|
210
|
+
flex: 1;
|
|
211
|
+
padding: $spacing-lg;
|
|
212
|
+
overflow-y: auto;
|
|
213
|
+
@include scrollbar-thin;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&__footer {
|
|
217
|
+
display: flex;
|
|
218
|
+
align-items: center;
|
|
219
|
+
justify-content: flex-end;
|
|
220
|
+
gap: $spacing-2xs;
|
|
221
|
+
padding: $spacing-lg;
|
|
222
|
+
border-top: 1px solid var(--border);
|
|
223
|
+
flex-shrink: 0;
|
|
224
|
+
|
|
225
|
+
&--start {
|
|
226
|
+
justify-content: flex-start;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&--between {
|
|
230
|
+
justify-content: space-between;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&--stacked {
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
|
|
236
|
+
.btn {
|
|
237
|
+
width: 100%;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// --------------------------------------------------------------------------
|
|
244
|
+
// Alert Dialog Variant
|
|
245
|
+
// --------------------------------------------------------------------------
|
|
246
|
+
|
|
247
|
+
.alertdialog {
|
|
248
|
+
@extend .modal;
|
|
249
|
+
|
|
250
|
+
&__dialog {
|
|
251
|
+
@extend .modal__dialog;
|
|
252
|
+
max-width: 28rem;
|
|
253
|
+
text-align: center;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
&__header {
|
|
257
|
+
@extend .modal__header;
|
|
258
|
+
flex-direction: column;
|
|
259
|
+
align-items: center;
|
|
260
|
+
border-bottom: none;
|
|
261
|
+
padding-bottom: 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&__icon {
|
|
265
|
+
width: 3rem;
|
|
266
|
+
height: 3rem;
|
|
267
|
+
margin-bottom: $spacing-sm;
|
|
268
|
+
color: var(--fg-muted);
|
|
269
|
+
|
|
270
|
+
&--destructive {
|
|
271
|
+
color: var(--destructive);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
&--warning {
|
|
275
|
+
color: var(--warning);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
&--success {
|
|
279
|
+
color: var(--success);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
&__title {
|
|
284
|
+
@extend .modal__title;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
&__description {
|
|
288
|
+
@extend .modal__description;
|
|
289
|
+
margin-top: $spacing-2xs;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
&__footer {
|
|
293
|
+
@extend .modal__footer;
|
|
294
|
+
justify-content: center;
|
|
295
|
+
border-top: none;
|
|
296
|
+
padding-top: 0;
|
|
297
|
+
}
|
|
298
|
+
}
|