@realmorg/ui 0.0.0-stage → 2.0.0-alpha.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/LICENSE +7 -0
- package/README.md +44 -2
- package/components/accordion.html +121 -0
- package/components/alert-dialog.html +196 -0
- package/components/alert.html +69 -0
- package/components/aspect-ratio.html +23 -0
- package/components/attachment.html +84 -0
- package/components/avatar.html +127 -0
- package/components/badge.html +56 -0
- package/components/breadcrumb.html +129 -0
- package/components/bubble.html +67 -0
- package/components/button-group.html +84 -0
- package/components/button.html +188 -0
- package/components/calendar.html +170 -0
- package/components/card.html +113 -0
- package/components/carousel.html +186 -0
- package/components/chart.html +162 -0
- package/components/checkbox.html +93 -0
- package/components/code-block.html +58 -0
- package/components/collapsible.html +76 -0
- package/components/combobox.html +224 -0
- package/components/command.html +189 -0
- package/components/context-menu.html +67 -0
- package/components/dialog.html +281 -0
- package/components/direction.html +17 -0
- package/components/drawer.html +224 -0
- package/components/dropdown-menu.html +372 -0
- package/components/empty.html +106 -0
- package/components/field.html +117 -0
- package/components/hover-card.html +94 -0
- package/components/input-group.html +75 -0
- package/components/input-otp.html +139 -0
- package/components/input.html +82 -0
- package/components/item.html +170 -0
- package/components/kbd.html +35 -0
- package/components/label.html +40 -0
- package/components/marker.html +35 -0
- package/components/menubar.html +116 -0
- package/components/message-scroller.html +62 -0
- package/components/message.html +77 -0
- package/components/navigation-menu.html +204 -0
- package/components/pagination.html +154 -0
- package/components/popover.html +133 -0
- package/components/progress.html +39 -0
- package/components/radio-group.html +114 -0
- package/components/resizable.html +156 -0
- package/components/scroll-area.html +50 -0
- package/components/select.html +91 -0
- package/components/separator.html +25 -0
- package/components/sheet.html +143 -0
- package/components/sidebar.html +343 -0
- package/components/skeleton.html +30 -0
- package/components/slider.html +81 -0
- package/components/spinner.html +47 -0
- package/components/switch.html +89 -0
- package/components/table.html +75 -0
- package/components/tabs.html +164 -0
- package/components/textarea.html +68 -0
- package/components/toaster.html +128 -0
- package/components/toggle-group.html +65 -0
- package/components/toggle.html +81 -0
- package/components/tooltip.html +97 -0
- package/dist/theme.css +145 -0
- package/dist/ui.html +6944 -0
- package/package.json +40 -3
- package/theme.css +145 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
<custom-element name="ui-dialog">
|
|
2
|
+
<script>
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
open: prop.boolean().reflect(),
|
|
5
|
+
side: prop.enum(["center", "top", "right", "bottom", "left"]).default("center"),
|
|
6
|
+
hideClose: prop.boolean().attribute("hide-close"),
|
|
7
|
+
persistent: prop.boolean(),
|
|
8
|
+
label: prop.string(),
|
|
9
|
+
description: prop.string(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const parts = useChildren("ui-dialog-header, ui-dialog-title, ui-dialog-description");
|
|
13
|
+
const dialog = useState({
|
|
14
|
+
get label() {
|
|
15
|
+
return props.label ?? text("ui-dialog-title");
|
|
16
|
+
},
|
|
17
|
+
get description() {
|
|
18
|
+
return props.description ?? text("ui-dialog-description");
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
function text(selector) {
|
|
23
|
+
const found = parts.flatMap((part) => (part.matches(selector) ? [part] : [...part.querySelectorAll(selector)]));
|
|
24
|
+
return found.map((part) => part.textContent.trim()).join(" ") || null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function show() {
|
|
28
|
+
props.open = true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function showFrom(trigger) {
|
|
32
|
+
trigger.firstElementChild?.focus();
|
|
33
|
+
show();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function close(value) {
|
|
37
|
+
if (value !== undefined) refs.dialog.returnValue = String(value);
|
|
38
|
+
props.open = false;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function requestClose(value) {
|
|
42
|
+
if (dispatch("cancel", undefined, { bubbles: false, composed: false })) close(value);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function closed() {
|
|
46
|
+
if (refs.dialog.open) return;
|
|
47
|
+
props.open = false;
|
|
48
|
+
dispatch("close", undefined, { bubbles: false, composed: false });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function cancelled(event) {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
if (!props.persistent) requestClose();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function backdrop(event) {
|
|
57
|
+
if (event.target === refs.dialog && !props.persistent) requestClose();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const COMMANDS = { "show-modal": show, close: () => close(), "request-close": () => requestClose() };
|
|
61
|
+
|
|
62
|
+
defineMethods({
|
|
63
|
+
showModal: show,
|
|
64
|
+
show,
|
|
65
|
+
close,
|
|
66
|
+
requestClose,
|
|
67
|
+
get returnValue() {
|
|
68
|
+
return refs.dialog.returnValue;
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
listen("command", (event) => COMMANDS[event.command.replace(/^--/, "")]?.());
|
|
73
|
+
|
|
74
|
+
observe(() => {
|
|
75
|
+
const dialog = refs.dialog;
|
|
76
|
+
if (!dialog || props.open === dialog.open) return;
|
|
77
|
+
if (props.open) dialog.showModal();
|
|
78
|
+
else dialog.close();
|
|
79
|
+
});
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style>
|
|
83
|
+
:host {
|
|
84
|
+
display: contents;
|
|
85
|
+
}
|
|
86
|
+
dialog {
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
width: 100%;
|
|
89
|
+
max-width: min(calc(var(--spacing) * 128), calc(100% - calc(var(--spacing) * 8)));
|
|
90
|
+
max-height: calc(100% - calc(var(--spacing) * 8));
|
|
91
|
+
padding: calc(var(--spacing) * 6);
|
|
92
|
+
border: 1px solid var(--border);
|
|
93
|
+
border-radius: var(--radius-lg);
|
|
94
|
+
background: var(--background);
|
|
95
|
+
color: var(--foreground);
|
|
96
|
+
box-shadow: var(--shadow-lg);
|
|
97
|
+
overflow: auto;
|
|
98
|
+
}
|
|
99
|
+
dialog[open] {
|
|
100
|
+
display: grid;
|
|
101
|
+
gap: calc(var(--spacing) * 4);
|
|
102
|
+
animation: zoom 0.2s ease-out;
|
|
103
|
+
}
|
|
104
|
+
dialog::backdrop {
|
|
105
|
+
background: rgb(0 0 0 / 0.5);
|
|
106
|
+
animation: fade 0.2s ease-out;
|
|
107
|
+
}
|
|
108
|
+
:host(:state(attr-side):not(:state(attr-side-is-center))) dialog {
|
|
109
|
+
margin: 0;
|
|
110
|
+
max-width: none;
|
|
111
|
+
max-height: none;
|
|
112
|
+
border-radius: 0;
|
|
113
|
+
animation: none;
|
|
114
|
+
}
|
|
115
|
+
:host(:is(:state(attr-side-is-left), :state(attr-side-is-right))) dialog[open] {
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
}
|
|
119
|
+
:host(:is(:state(attr-side-is-left), :state(attr-side-is-right))) [part="body"] {
|
|
120
|
+
flex: 1;
|
|
121
|
+
}
|
|
122
|
+
:host(:state(attr-side-is-right)) dialog {
|
|
123
|
+
inset: 0 0 0 auto;
|
|
124
|
+
width: min(calc(var(--spacing) * 96), 75%);
|
|
125
|
+
height: 100%;
|
|
126
|
+
}
|
|
127
|
+
:host(:state(attr-side-is-left)) dialog {
|
|
128
|
+
inset: 0 auto 0 0;
|
|
129
|
+
width: min(calc(var(--spacing) * 96), 75%);
|
|
130
|
+
height: 100%;
|
|
131
|
+
}
|
|
132
|
+
:host(:state(attr-side-is-top)) dialog {
|
|
133
|
+
inset: 0 0 auto 0;
|
|
134
|
+
width: 100%;
|
|
135
|
+
height: auto;
|
|
136
|
+
}
|
|
137
|
+
:host(:state(attr-side-is-bottom)) dialog {
|
|
138
|
+
inset: auto 0 0 0;
|
|
139
|
+
width: 100%;
|
|
140
|
+
height: auto;
|
|
141
|
+
}
|
|
142
|
+
.close {
|
|
143
|
+
all: unset;
|
|
144
|
+
position: absolute;
|
|
145
|
+
top: calc(var(--spacing) * 4);
|
|
146
|
+
right: calc(var(--spacing) * 4);
|
|
147
|
+
display: grid;
|
|
148
|
+
place-content: center;
|
|
149
|
+
width: calc(var(--spacing) * 6);
|
|
150
|
+
height: calc(var(--spacing) * 6);
|
|
151
|
+
border-radius: var(--radius-xs);
|
|
152
|
+
opacity: 0.7;
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
}
|
|
155
|
+
.close:hover {
|
|
156
|
+
opacity: 1;
|
|
157
|
+
}
|
|
158
|
+
.close:focus-visible {
|
|
159
|
+
box-shadow: 0 0 0 2px var(--ring);
|
|
160
|
+
}
|
|
161
|
+
.close svg {
|
|
162
|
+
width: calc(var(--spacing) * 4);
|
|
163
|
+
height: calc(var(--spacing) * 4);
|
|
164
|
+
}
|
|
165
|
+
@keyframes zoom {
|
|
166
|
+
from {
|
|
167
|
+
opacity: 0;
|
|
168
|
+
scale: 0.95;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
@keyframes fade {
|
|
172
|
+
from {
|
|
173
|
+
opacity: 0;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
@media (prefers-reduced-motion: reduce) {
|
|
177
|
+
dialog[open],
|
|
178
|
+
dialog::backdrop {
|
|
179
|
+
animation: none;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
</style>
|
|
183
|
+
|
|
184
|
+
<slot name="trigger"></slot>
|
|
185
|
+
<dialog
|
|
186
|
+
ref="dialog"
|
|
187
|
+
part="dialog"
|
|
188
|
+
_aria-label="#dialog.label"
|
|
189
|
+
_aria-description="#dialog.description"
|
|
190
|
+
onclose="closed()"
|
|
191
|
+
oncancel="cancelled(event)"
|
|
192
|
+
onclick="backdrop(event)">
|
|
193
|
+
<slot name="header"></slot>
|
|
194
|
+
<div part="body"><slot></slot></div>
|
|
195
|
+
<slot name="footer"></slot>
|
|
196
|
+
<button type="button" class="close" part="close" aria-label="Close" _hidden="@hideClose" onclick="requestClose()">
|
|
197
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M18 6 6 18M6 6l12 12" /></svg>
|
|
198
|
+
</button>
|
|
199
|
+
</dialog>
|
|
200
|
+
</custom-element>
|
|
201
|
+
|
|
202
|
+
<custom-element name="ui-dialog-trigger" slot="trigger">
|
|
203
|
+
<style>
|
|
204
|
+
:host,
|
|
205
|
+
span {
|
|
206
|
+
display: contents;
|
|
207
|
+
}
|
|
208
|
+
</style>
|
|
209
|
+
|
|
210
|
+
<span part="trigger" onclick="showFrom(host)"><slot></slot></span>
|
|
211
|
+
</custom-element>
|
|
212
|
+
|
|
213
|
+
<custom-element name="ui-dialog-close">
|
|
214
|
+
<script>
|
|
215
|
+
const props = defineProps({ value: prop.string() });
|
|
216
|
+
</script>
|
|
217
|
+
|
|
218
|
+
<style>
|
|
219
|
+
:host,
|
|
220
|
+
span {
|
|
221
|
+
display: contents;
|
|
222
|
+
}
|
|
223
|
+
</style>
|
|
224
|
+
|
|
225
|
+
<span part="close" onclick="close(props.value)"><slot></slot></span>
|
|
226
|
+
</custom-element>
|
|
227
|
+
|
|
228
|
+
<custom-element name="ui-dialog-header" slot="header">
|
|
229
|
+
<style>
|
|
230
|
+
:host {
|
|
231
|
+
display: grid;
|
|
232
|
+
gap: calc(var(--spacing) * 2);
|
|
233
|
+
}
|
|
234
|
+
</style>
|
|
235
|
+
|
|
236
|
+
<slot></slot>
|
|
237
|
+
</custom-element>
|
|
238
|
+
|
|
239
|
+
<custom-element name="ui-dialog-title">
|
|
240
|
+
<style>
|
|
241
|
+
:host {
|
|
242
|
+
display: block;
|
|
243
|
+
}
|
|
244
|
+
h2 {
|
|
245
|
+
margin: 0;
|
|
246
|
+
font-size: var(--text-lg);
|
|
247
|
+
font-weight: var(--font-weight-semibold);
|
|
248
|
+
line-height: 1;
|
|
249
|
+
}
|
|
250
|
+
</style>
|
|
251
|
+
|
|
252
|
+
<h2 part="title"><slot></slot></h2>
|
|
253
|
+
</custom-element>
|
|
254
|
+
|
|
255
|
+
<custom-element name="ui-dialog-description">
|
|
256
|
+
<style>
|
|
257
|
+
:host {
|
|
258
|
+
display: block;
|
|
259
|
+
}
|
|
260
|
+
p {
|
|
261
|
+
margin: 0;
|
|
262
|
+
font-size: var(--text-sm);
|
|
263
|
+
color: var(--muted-foreground);
|
|
264
|
+
}
|
|
265
|
+
</style>
|
|
266
|
+
|
|
267
|
+
<p part="description"><slot></slot></p>
|
|
268
|
+
</custom-element>
|
|
269
|
+
|
|
270
|
+
<custom-element name="ui-dialog-footer" slot="footer">
|
|
271
|
+
<style>
|
|
272
|
+
:host {
|
|
273
|
+
display: flex;
|
|
274
|
+
flex-wrap: wrap;
|
|
275
|
+
justify-content: flex-end;
|
|
276
|
+
gap: calc(var(--spacing) * 2);
|
|
277
|
+
}
|
|
278
|
+
</style>
|
|
279
|
+
|
|
280
|
+
<slot></slot>
|
|
281
|
+
</custom-element>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<custom-element name="ui-direction">
|
|
2
|
+
<script>
|
|
3
|
+
const props = defineProps({ dir: prop.enum(["ltr", "rtl"]).default("ltr") });
|
|
4
|
+
|
|
5
|
+
observe(() => {
|
|
6
|
+
attrs.dir = props.dir;
|
|
7
|
+
});
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<style>
|
|
11
|
+
:host {
|
|
12
|
+
display: contents;
|
|
13
|
+
}
|
|
14
|
+
</style>
|
|
15
|
+
|
|
16
|
+
<slot></slot>
|
|
17
|
+
</custom-element>
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
<custom-element name="ui-drawer">
|
|
2
|
+
<script>
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
open: prop.boolean().reflect(),
|
|
5
|
+
side: prop.enum(["bottom", "top", "left", "right"]).default("bottom"),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const parts = useChildren("ui-drawer-header, ui-drawer-title, ui-drawer-description");
|
|
9
|
+
const drawer = useState({
|
|
10
|
+
get label() {
|
|
11
|
+
return text("ui-drawer-title");
|
|
12
|
+
},
|
|
13
|
+
get description() {
|
|
14
|
+
return text("ui-drawer-description");
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
let start = null;
|
|
19
|
+
|
|
20
|
+
function text(selector) {
|
|
21
|
+
const found = parts.flatMap((part) => (part.matches(selector) ? [part] : [...part.querySelectorAll(selector)]));
|
|
22
|
+
return found.map((part) => part.textContent.trim()).join(" ") || null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function show() {
|
|
26
|
+
props.open = true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function showFrom(trigger) {
|
|
30
|
+
trigger.firstElementChild?.focus();
|
|
31
|
+
show();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function close() {
|
|
35
|
+
props.open = false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function closed() {
|
|
39
|
+
if (refs.dialog.open) return;
|
|
40
|
+
props.open = false;
|
|
41
|
+
dispatch("close", undefined, { bubbles: false, composed: false });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function backdrop(event) {
|
|
45
|
+
if (event.target === refs.dialog) close();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function grab(event) {
|
|
49
|
+
start = event.clientY;
|
|
50
|
+
if (event.isTrusted) event.target.setPointerCapture(event.pointerId);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function release(event) {
|
|
54
|
+
if (start !== null && event.clientY - start > 80) close();
|
|
55
|
+
start = null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
defineMethods({ showModal: show, show, close });
|
|
59
|
+
|
|
60
|
+
const COMMANDS = { "show-modal": show, close, "request-close": close };
|
|
61
|
+
|
|
62
|
+
listen("command", (event) => COMMANDS[event.command.replace(/^--/, "")]?.());
|
|
63
|
+
|
|
64
|
+
observe(() => {
|
|
65
|
+
const dialog = refs.dialog;
|
|
66
|
+
if (!dialog || props.open === dialog.open) return;
|
|
67
|
+
if (props.open) dialog.showModal();
|
|
68
|
+
else dialog.close();
|
|
69
|
+
});
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<style>
|
|
73
|
+
:host {
|
|
74
|
+
display: contents;
|
|
75
|
+
}
|
|
76
|
+
dialog {
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
width: 100%;
|
|
79
|
+
max-width: none;
|
|
80
|
+
max-height: 80dvh;
|
|
81
|
+
margin: auto 0 0;
|
|
82
|
+
padding: calc(var(--spacing) * 4) calc(var(--spacing) * 6) calc(var(--spacing) * 6);
|
|
83
|
+
border: 1px solid var(--border);
|
|
84
|
+
border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
|
|
85
|
+
background: var(--background);
|
|
86
|
+
color: var(--foreground);
|
|
87
|
+
}
|
|
88
|
+
:host(:state(attr-side-is-top)) dialog {
|
|
89
|
+
margin: 0 0 auto;
|
|
90
|
+
border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
|
|
91
|
+
}
|
|
92
|
+
:host(:state(attr-side-is-left)) dialog,
|
|
93
|
+
:host(:state(attr-side-is-right)) dialog {
|
|
94
|
+
width: min(calc(var(--spacing) * 96), 80%);
|
|
95
|
+
height: 100dvh;
|
|
96
|
+
max-height: none;
|
|
97
|
+
margin: 0 auto 0 0;
|
|
98
|
+
border-radius: 0 var(--radius-2xl) var(--radius-2xl) 0;
|
|
99
|
+
}
|
|
100
|
+
:host(:state(attr-side-is-right)) dialog {
|
|
101
|
+
margin: 0 0 0 auto;
|
|
102
|
+
border-radius: var(--radius-2xl) 0 0 var(--radius-2xl);
|
|
103
|
+
}
|
|
104
|
+
dialog[open] {
|
|
105
|
+
display: grid;
|
|
106
|
+
gap: calc(var(--spacing) * 4);
|
|
107
|
+
animation: slide 0.25s ease-out;
|
|
108
|
+
}
|
|
109
|
+
dialog::backdrop {
|
|
110
|
+
background: rgb(0 0 0 / 0.5);
|
|
111
|
+
}
|
|
112
|
+
.handle {
|
|
113
|
+
justify-self: center;
|
|
114
|
+
width: calc(var(--spacing) * 24);
|
|
115
|
+
height: calc(var(--spacing) * 2);
|
|
116
|
+
border-radius: var(--radius-full);
|
|
117
|
+
background: var(--muted);
|
|
118
|
+
cursor: grab;
|
|
119
|
+
touch-action: none;
|
|
120
|
+
}
|
|
121
|
+
:host(:not(:state(attr-side-is-bottom))) .handle {
|
|
122
|
+
display: none;
|
|
123
|
+
}
|
|
124
|
+
@keyframes slide {
|
|
125
|
+
from {
|
|
126
|
+
translate: 0 calc(var(--spacing) * 8);
|
|
127
|
+
opacity: 0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
@media (prefers-reduced-motion: reduce) {
|
|
131
|
+
dialog[open] {
|
|
132
|
+
animation: none;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
</style>
|
|
136
|
+
|
|
137
|
+
<slot name="trigger"></slot>
|
|
138
|
+
<dialog
|
|
139
|
+
ref="dialog"
|
|
140
|
+
part="dialog"
|
|
141
|
+
_aria-label="#drawer.label"
|
|
142
|
+
_aria-description="#drawer.description"
|
|
143
|
+
onclose="closed()"
|
|
144
|
+
onclick="backdrop(event)">
|
|
145
|
+
<div class="handle" part="handle" onpointerdown="grab(event)" onpointerup="release(event)"></div>
|
|
146
|
+
<slot name="header"></slot>
|
|
147
|
+
<div part="body"><slot></slot></div>
|
|
148
|
+
<slot name="footer"></slot>
|
|
149
|
+
</dialog>
|
|
150
|
+
</custom-element>
|
|
151
|
+
|
|
152
|
+
<custom-element name="ui-drawer-trigger" slot="trigger">
|
|
153
|
+
<style>
|
|
154
|
+
:host,
|
|
155
|
+
span {
|
|
156
|
+
display: contents;
|
|
157
|
+
}
|
|
158
|
+
</style>
|
|
159
|
+
|
|
160
|
+
<span part="trigger" onclick="showFrom(host)"><slot></slot></span>
|
|
161
|
+
</custom-element>
|
|
162
|
+
|
|
163
|
+
<custom-element name="ui-drawer-close">
|
|
164
|
+
<style>
|
|
165
|
+
:host,
|
|
166
|
+
span {
|
|
167
|
+
display: contents;
|
|
168
|
+
}
|
|
169
|
+
</style>
|
|
170
|
+
|
|
171
|
+
<span part="close" onclick="close()"><slot></slot></span>
|
|
172
|
+
</custom-element>
|
|
173
|
+
|
|
174
|
+
<custom-element name="ui-drawer-header" slot="header">
|
|
175
|
+
<style>
|
|
176
|
+
:host {
|
|
177
|
+
display: grid;
|
|
178
|
+
gap: calc(var(--spacing) * 1.5);
|
|
179
|
+
}
|
|
180
|
+
</style>
|
|
181
|
+
|
|
182
|
+
<slot></slot>
|
|
183
|
+
</custom-element>
|
|
184
|
+
|
|
185
|
+
<custom-element name="ui-drawer-title">
|
|
186
|
+
<style>
|
|
187
|
+
:host {
|
|
188
|
+
display: block;
|
|
189
|
+
}
|
|
190
|
+
h2 {
|
|
191
|
+
margin: 0;
|
|
192
|
+
font-size: var(--text-base);
|
|
193
|
+
font-weight: var(--font-weight-semibold);
|
|
194
|
+
}
|
|
195
|
+
</style>
|
|
196
|
+
|
|
197
|
+
<h2 part="title"><slot></slot></h2>
|
|
198
|
+
</custom-element>
|
|
199
|
+
|
|
200
|
+
<custom-element name="ui-drawer-description">
|
|
201
|
+
<style>
|
|
202
|
+
:host {
|
|
203
|
+
display: block;
|
|
204
|
+
}
|
|
205
|
+
p {
|
|
206
|
+
margin: 0;
|
|
207
|
+
font-size: var(--text-sm);
|
|
208
|
+
color: var(--muted-foreground);
|
|
209
|
+
}
|
|
210
|
+
</style>
|
|
211
|
+
|
|
212
|
+
<p part="description"><slot></slot></p>
|
|
213
|
+
</custom-element>
|
|
214
|
+
|
|
215
|
+
<custom-element name="ui-drawer-footer" slot="footer">
|
|
216
|
+
<style>
|
|
217
|
+
:host {
|
|
218
|
+
display: grid;
|
|
219
|
+
gap: calc(var(--spacing) * 2);
|
|
220
|
+
}
|
|
221
|
+
</style>
|
|
222
|
+
|
|
223
|
+
<slot></slot>
|
|
224
|
+
</custom-element>
|