@excom/content-drawer 0.1.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/.rush/temp/chunked-rush-logs/content-drawer.apply-exports.chunks.jsonl +1 -0
- package/.rush/temp/chunked-rush-logs/content-drawer.build_docs.chunks.jsonl +1 -0
- package/.rush/temp/chunked-rush-logs/content-drawer.build_package-metas.chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/all.log +1 -0
- package/.rush/temp/operation/apply-exports/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/state.json +3 -0
- package/.rush/temp/operation/build_docs/all.log +1 -0
- package/.rush/temp/operation/build_docs/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/build_docs/state.json +3 -0
- package/.rush/temp/operation/build_package-metas/all.log +1 -0
- package/.rush/temp/operation/build_package-metas/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/build_package-metas/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +3 -0
- package/config/rig.json +5 -0
- package/content-drawer.ts +205 -0
- package/index.css +5 -0
- package/index.ts +17 -0
- package/package.json +44 -0
- package/rush-logs/content-drawer.apply-exports.cache.log +1 -0
- package/rush-logs/content-drawer.apply-exports.log +1 -0
- package/rush-logs/content-drawer.build_docs.cache.log +1 -0
- package/rush-logs/content-drawer.build_docs.log +1 -0
- package/rush-logs/content-drawer.build_package-metas.cache.log +1 -0
- package/rush-logs/content-drawer.build_package-metas.log +1 -0
- package/src/content-drawer.css +344 -0
- package/support/custom-elements.json +360 -0
- package/support/demos/disappear.html +8 -0
- package/support/demos/dismiss.html +16 -0
- package/support/demos/from-side.html +9 -0
- package/support/demos/simple.html +12 -0
- package/support/demos/singleton.html +16 -0
- package/support/demos/stages.html +18 -0
- package/support/dist-docs/content-drawer.md +252 -0
- package/support/docs/README.md +69 -0
- package/support/package-meta.json +299 -0
- package/support/tests/content-drawer.test.ts +388 -0
- package/support/tests/disappear.view.test.ts +32 -0
- package/support/tests/dismiss.view.test.ts +61 -0
- package/support/tests/from-side.view.test.ts +32 -0
- package/support/tests/simple.view.test.ts +40 -0
- package/support/tests/singleton.view.test.ts +35 -0
- package/support/tests/stages.view.test.ts +39 -0
- package/tsconfig.json +5 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
@import "@excom/valence/src/aliases.css";
|
|
2
|
+
@import "@excom/valence/src/util.default.css";
|
|
3
|
+
@import "@excom/valence/src/components/modal.css";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Styles for `<content-drawer>`.
|
|
7
|
+
* @element content-drawer
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/* Aliases */
|
|
11
|
+
@custom-selector :--content-drawer content-drawer, .tag-content-drawer;
|
|
12
|
+
@custom-selector :--content-drawer--is-open [is-open], [aria-expanded="true"];
|
|
13
|
+
/* Doubled so a scrub outranks the `is-open` + `open-stage` rules */
|
|
14
|
+
@custom-selector :--content-drawer--is-scrubbing
|
|
15
|
+
[is-scrubbing][is-scrubbing],
|
|
16
|
+
[data-scrubbing][data-scrubbing];
|
|
17
|
+
@custom-selector :--content-drawer--open-stage-1
|
|
18
|
+
[open-stage="1"],
|
|
19
|
+
[data-open="1"];
|
|
20
|
+
@custom-selector :--content-drawer--open-stage-2
|
|
21
|
+
[open-stage="2"],
|
|
22
|
+
[data-open="2"];
|
|
23
|
+
@custom-selector :--content-drawer--from-side [from-side], [data-placement];
|
|
24
|
+
@custom-selector :--content-drawer--from-side-bottom
|
|
25
|
+
[from-side="bottom"],
|
|
26
|
+
[data-placement="bottom"];
|
|
27
|
+
@custom-selector :--content-drawer--from-side-top
|
|
28
|
+
[from-side="top"],
|
|
29
|
+
[data-placement="top"];
|
|
30
|
+
@custom-selector :--content-drawer--from-side-left
|
|
31
|
+
[from-side="left"],
|
|
32
|
+
[data-placement="left"];
|
|
33
|
+
@custom-selector :--content-drawer--from-side-right
|
|
34
|
+
[from-side="right"],
|
|
35
|
+
[data-placement="right"];
|
|
36
|
+
|
|
37
|
+
@define-mixin module-content-drawer {
|
|
38
|
+
:root {
|
|
39
|
+
/**
|
|
40
|
+
* Slide transition duration.
|
|
41
|
+
* @cssproperty
|
|
42
|
+
* @syntax <time>
|
|
43
|
+
* @default 0.25s
|
|
44
|
+
*/
|
|
45
|
+
--content-drawer-transition-duration: var(
|
|
46
|
+
--v-transition-duration-standard,
|
|
47
|
+
0.25s
|
|
48
|
+
);
|
|
49
|
+
/**
|
|
50
|
+
* Slide transition easing.
|
|
51
|
+
* @cssproperty
|
|
52
|
+
* @syntax <easing-function>
|
|
53
|
+
* @default ease-out
|
|
54
|
+
*/
|
|
55
|
+
--content-drawer-transition-ease: var(--v-transition-ease-out, ease-out);
|
|
56
|
+
/**
|
|
57
|
+
* Off-screen translate amount (closed).
|
|
58
|
+
* @cssproperty
|
|
59
|
+
* @syntax <percentage>
|
|
60
|
+
* @default 101%
|
|
61
|
+
*/
|
|
62
|
+
--content-drawer-closed: 101%;
|
|
63
|
+
/**
|
|
64
|
+
* Full-open translate (`open-stage` unset or `0`).
|
|
65
|
+
* @cssproperty
|
|
66
|
+
* @syntax <percentage>
|
|
67
|
+
* @default 0%
|
|
68
|
+
*/
|
|
69
|
+
--content-drawer-open-full: 0%;
|
|
70
|
+
/**
|
|
71
|
+
* Half-open translate (`open-stage="1"`).
|
|
72
|
+
* @cssproperty
|
|
73
|
+
* @syntax <percentage>
|
|
74
|
+
* @default 50%
|
|
75
|
+
*/
|
|
76
|
+
--content-drawer-open-half: 50%;
|
|
77
|
+
/**
|
|
78
|
+
* Peek translate (`open-stage="2"`).
|
|
79
|
+
* @cssproperty
|
|
80
|
+
* @syntax <percentage>
|
|
81
|
+
* @default 75%
|
|
82
|
+
*/
|
|
83
|
+
--content-drawer-open-peek: 75%;
|
|
84
|
+
/**
|
|
85
|
+
* Max width when open in `.relative` mode, used unless
|
|
86
|
+
* `--content-drawer-max-width` is set.
|
|
87
|
+
* @cssproperty
|
|
88
|
+
* @syntax <length>
|
|
89
|
+
* @default 200px
|
|
90
|
+
*/
|
|
91
|
+
--content-drawer-relative-max-width: 200px;
|
|
92
|
+
/**
|
|
93
|
+
* Stack order for the drawer panel.
|
|
94
|
+
* @cssproperty
|
|
95
|
+
* @syntax <integer>
|
|
96
|
+
* @default 3
|
|
97
|
+
*/
|
|
98
|
+
--content-drawer-z-index: 3;
|
|
99
|
+
/**
|
|
100
|
+
* Stack order for the sibling backdrop (`:--dialog-backdrop-aliases`).
|
|
101
|
+
* @cssproperty
|
|
102
|
+
* @syntax <integer>
|
|
103
|
+
* @default 2
|
|
104
|
+
*/
|
|
105
|
+
--content-drawer-overlay-z-index: 2;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
*:has(> :--content-drawer) {
|
|
109
|
+
position: relative;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:--content-drawer {
|
|
114
|
+
/**
|
|
115
|
+
* How far open the drawer is while `is-scrubbing`: `0` closed, `1`
|
|
116
|
+
* full. Declared on the drawer (not `:root`) so it follows a wrapping
|
|
117
|
+
* `<gesture-handler>`'s inherited `--gesture-progress` unless set
|
|
118
|
+
* explicitly — a swipe-to-open / drag-to-close bottom sheet.
|
|
119
|
+
* @cssproperty
|
|
120
|
+
* @syntax <number>
|
|
121
|
+
* @default var(--gesture-progress, 0)
|
|
122
|
+
*/
|
|
123
|
+
--content-drawer-open-progress: var(--gesture-progress, 0);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:--content-drawer:not(.relative) {
|
|
127
|
+
/* Not `display: none` when closed. Child intersection observers must
|
|
128
|
+
keep working, and a discrete display transition would animate a
|
|
129
|
+
drawer that starts `[is-open]` on first paint. */
|
|
130
|
+
display: block;
|
|
131
|
+
position: fixed;
|
|
132
|
+
z-index: var(--content-drawer-z-index);
|
|
133
|
+
/* Needed for an accurate height */
|
|
134
|
+
box-sizing: border-box;
|
|
135
|
+
background-color: var(--v-card-background-color, #f7f7f7);
|
|
136
|
+
box-shadow: 2px 0 16px rgba(0, 0, 0, 0.08);
|
|
137
|
+
overscroll-behavior-y: contain;
|
|
138
|
+
transition: transform var(--content-drawer-transition-duration)
|
|
139
|
+
var(--content-drawer-transition-ease);
|
|
140
|
+
/* A finger drives the position: no easing between frames */
|
|
141
|
+
&:--content-drawer--is-scrubbing {
|
|
142
|
+
transition: none;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Close control — empty `.close` / `[rel="prev"]`
|
|
147
|
+
* button or link (theme close icon).
|
|
148
|
+
* @cssclass close
|
|
149
|
+
*/
|
|
150
|
+
@mixin modal-inner;
|
|
151
|
+
overflow-y: scroll;
|
|
152
|
+
margin: 0;
|
|
153
|
+
padding: var(--v-spacing);
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* `position: sticky` instead of the default `absolute` placement.
|
|
157
|
+
* @cssclass
|
|
158
|
+
*/
|
|
159
|
+
&.sticky {
|
|
160
|
+
position: sticky;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* `position: absolute` instead of the default `fixed` placement —
|
|
164
|
+
* a sheet inside its (`position: relative`) parent.
|
|
165
|
+
* @cssclass
|
|
166
|
+
*/
|
|
167
|
+
&.absolute {
|
|
168
|
+
position: absolute;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* bottom (default) */
|
|
172
|
+
&:not(:--content-drawer--from-side),
|
|
173
|
+
&:--content-drawer--from-side-bottom {
|
|
174
|
+
border-radius: var(--v-border-radius, 10px) var(--v-border-radius, 10px)
|
|
175
|
+
0px 0px;
|
|
176
|
+
transform: translateY(var(--content-drawer-closed));
|
|
177
|
+
left: 0;
|
|
178
|
+
right: 0;
|
|
179
|
+
bottom: 0;
|
|
180
|
+
&:--content-drawer--is-open {
|
|
181
|
+
transform: translateY(var(--content-drawer-open-full));
|
|
182
|
+
}
|
|
183
|
+
&:--content-drawer--is-open:--content-drawer--open-stage-1 {
|
|
184
|
+
transform: translateY(var(--content-drawer-open-half));
|
|
185
|
+
}
|
|
186
|
+
&:--content-drawer--is-open:--content-drawer--open-stage-2 {
|
|
187
|
+
transform: translateY(var(--content-drawer-open-peek));
|
|
188
|
+
}
|
|
189
|
+
&:--content-drawer--is-scrubbing {
|
|
190
|
+
transform: translateY(
|
|
191
|
+
calc(
|
|
192
|
+
var(--content-drawer-closed) *
|
|
193
|
+
(1 - var(--content-drawer-open-progress))
|
|
194
|
+
)
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* top */
|
|
200
|
+
&:--content-drawer--from-side-top {
|
|
201
|
+
border-radius: 0px 0px var(--v-border-radius, 10px)
|
|
202
|
+
var(--v-border-radius, 10px);
|
|
203
|
+
transform: translateY(calc(var(--content-drawer-closed) * -1));
|
|
204
|
+
left: 0;
|
|
205
|
+
right: 0;
|
|
206
|
+
top: 0;
|
|
207
|
+
&:--content-drawer--is-open {
|
|
208
|
+
transform: translateY(calc(var(--content-drawer-open-full) * -1));
|
|
209
|
+
}
|
|
210
|
+
&:--content-drawer--is-open:--content-drawer--open-stage-1 {
|
|
211
|
+
transform: translateY(calc(var(--content-drawer-open-half) * -1));
|
|
212
|
+
}
|
|
213
|
+
&:--content-drawer--is-open:--content-drawer--open-stage-2 {
|
|
214
|
+
transform: translateY(calc(var(--content-drawer-open-peek) * -1));
|
|
215
|
+
}
|
|
216
|
+
&:--content-drawer--is-scrubbing {
|
|
217
|
+
transform: translateY(
|
|
218
|
+
calc(
|
|
219
|
+
var(--content-drawer-closed) *
|
|
220
|
+
(var(--content-drawer-open-progress) - 1)
|
|
221
|
+
)
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* left */
|
|
227
|
+
&:--content-drawer--from-side-left {
|
|
228
|
+
border-radius: 0px var(--v-border-radius, 10px)
|
|
229
|
+
var(--v-border-radius, 10px) 0px;
|
|
230
|
+
transform: translateX(calc(var(--content-drawer-closed) * -1));
|
|
231
|
+
top: 0;
|
|
232
|
+
bottom: 0;
|
|
233
|
+
left: 0;
|
|
234
|
+
&:--content-drawer--is-open {
|
|
235
|
+
transform: translateX(calc(var(--content-drawer-open-full) * -1));
|
|
236
|
+
}
|
|
237
|
+
&:--content-drawer--is-open:--content-drawer--open-stage-1 {
|
|
238
|
+
transform: translateX(calc(var(--content-drawer-open-half) * -1));
|
|
239
|
+
}
|
|
240
|
+
&:--content-drawer--is-open:--content-drawer--open-stage-2 {
|
|
241
|
+
transform: translateX(calc(var(--content-drawer-open-peek) * -1));
|
|
242
|
+
}
|
|
243
|
+
&:--content-drawer--is-scrubbing {
|
|
244
|
+
transform: translateX(
|
|
245
|
+
calc(
|
|
246
|
+
var(--content-drawer-closed) *
|
|
247
|
+
(var(--content-drawer-open-progress) - 1)
|
|
248
|
+
)
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* right */
|
|
254
|
+
&:--content-drawer--from-side-right {
|
|
255
|
+
border-radius: var(--v-border-radius, 10px) 0px 0px
|
|
256
|
+
var(--v-border-radius, 10px);
|
|
257
|
+
transform: translateX(var(--content-drawer-closed));
|
|
258
|
+
top: 0;
|
|
259
|
+
bottom: 0;
|
|
260
|
+
right: 0;
|
|
261
|
+
&:--content-drawer--is-open {
|
|
262
|
+
transform: translateX(var(--content-drawer-open-full));
|
|
263
|
+
}
|
|
264
|
+
&:--content-drawer--is-open:--content-drawer--open-stage-1 {
|
|
265
|
+
transform: translateX(var(--content-drawer-open-half));
|
|
266
|
+
}
|
|
267
|
+
&:--content-drawer--is-open:--content-drawer--open-stage-2 {
|
|
268
|
+
transform: translateX(var(--content-drawer-open-peek));
|
|
269
|
+
}
|
|
270
|
+
&:--content-drawer--is-scrubbing {
|
|
271
|
+
transform: translateX(
|
|
272
|
+
calc(
|
|
273
|
+
var(--content-drawer-closed) *
|
|
274
|
+
(1 - var(--content-drawer-open-progress))
|
|
275
|
+
)
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Sibling dimmer: Valence.css `:--dialog-backdrop-aliases`
|
|
282
|
+
* (`[role="presentation"]` / `.tag-backdrop`). Place as the immediate
|
|
283
|
+
* next sibling; click-to-close is `<event-handler>` / `<dismiss-watcher>`.
|
|
284
|
+
*/
|
|
285
|
+
& + :--dialog-backdrop-aliases {
|
|
286
|
+
@mixin modal-backdrop;
|
|
287
|
+
display: none;
|
|
288
|
+
position: fixed;
|
|
289
|
+
z-index: var(--content-drawer-overlay-z-index);
|
|
290
|
+
opacity: 0;
|
|
291
|
+
transition:
|
|
292
|
+
opacity var(--content-drawer-transition-duration)
|
|
293
|
+
var(--content-drawer-transition-ease),
|
|
294
|
+
display var(--content-drawer-transition-duration) allow-discrete;
|
|
295
|
+
&.sticky {
|
|
296
|
+
position: sticky;
|
|
297
|
+
}
|
|
298
|
+
&.absolute {
|
|
299
|
+
position: absolute;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&:--content-drawer--is-open + :--dialog-backdrop-aliases {
|
|
304
|
+
display: block;
|
|
305
|
+
opacity: 1;
|
|
306
|
+
@starting-style {
|
|
307
|
+
opacity: 0;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* In-flow mode: the drawer participates in layout and animates
|
|
314
|
+
* `max-width` instead of overlaying via `position`, pushing sibling
|
|
315
|
+
* content aside as it opens. Currently only affects
|
|
316
|
+
* `from-side="left"`.
|
|
317
|
+
* @cssclass
|
|
318
|
+
*/
|
|
319
|
+
:--content-drawer.relative {
|
|
320
|
+
display: block;
|
|
321
|
+
position: relative;
|
|
322
|
+
overflow: hidden;
|
|
323
|
+
|
|
324
|
+
&:--content-drawer--from-side-left {
|
|
325
|
+
height: 100%;
|
|
326
|
+
max-width: 0;
|
|
327
|
+
width: 100%;
|
|
328
|
+
transition: max-width var(--content-drawer-transition-duration)
|
|
329
|
+
var(--content-drawer-transition-ease);
|
|
330
|
+
&:--content-drawer--is-open {
|
|
331
|
+
/**
|
|
332
|
+
* Overrides `--content-drawer-relative-max-width` for this
|
|
333
|
+
* drawer only.
|
|
334
|
+
* @cssproperty --content-drawer-max-width
|
|
335
|
+
* @syntax <length>
|
|
336
|
+
*/
|
|
337
|
+
max-width: var(
|
|
338
|
+
--content-drawer-max-width,
|
|
339
|
+
var(--content-drawer-relative-max-width)
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"modules": [
|
|
4
|
+
{
|
|
5
|
+
"kind": "javascript-module",
|
|
6
|
+
"path": "content-drawer.ts",
|
|
7
|
+
"declarations": [
|
|
8
|
+
{
|
|
9
|
+
"kind": "class",
|
|
10
|
+
"name": "ContentDrawer",
|
|
11
|
+
"customElement": true,
|
|
12
|
+
"tagName": "content-drawer",
|
|
13
|
+
"summary": "Slide-in drawer / sheet — bottom, top, left, or right, with peek stages.",
|
|
14
|
+
"description": "Props the invoker of `--open` / `--toggle` may set through its `data-*` attributes (`data-open-stage=\"1\"` → `openStage`). Keys are whitelisted against declared, non-private props; `isOpen` is always the command's.",
|
|
15
|
+
"attributes": [
|
|
16
|
+
{
|
|
17
|
+
"name": "from-side",
|
|
18
|
+
"type": {
|
|
19
|
+
"text": "string"
|
|
20
|
+
},
|
|
21
|
+
"description": "Edge the drawer slides from.",
|
|
22
|
+
"fieldName": "fromSide",
|
|
23
|
+
"default": "bottom",
|
|
24
|
+
"values": [
|
|
25
|
+
"bottom",
|
|
26
|
+
"top",
|
|
27
|
+
"left",
|
|
28
|
+
"right"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "disappear-after",
|
|
33
|
+
"type": {
|
|
34
|
+
"text": "number"
|
|
35
|
+
},
|
|
36
|
+
"description": "Auto-close after this many seconds once opened — toast-style / transient confirmations.",
|
|
37
|
+
"fieldName": "disappearAfter"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "singleton-name",
|
|
41
|
+
"type": {
|
|
42
|
+
"text": "string"
|
|
43
|
+
},
|
|
44
|
+
"description": "Shared group name. Opening one drawer closes others with the same name (singleton coordination).",
|
|
45
|
+
"fieldName": "singletonName"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "open-stage",
|
|
49
|
+
"type": {
|
|
50
|
+
"text": "number"
|
|
51
|
+
},
|
|
52
|
+
"description": "How far the drawer opens: `0` full, `1` half, `2` peek. Unset = full. Set statically, or per open through `data-open-stage` on the `--open` / `--toggle` invoker.",
|
|
53
|
+
"fieldName": "openStage",
|
|
54
|
+
"values": [
|
|
55
|
+
"0",
|
|
56
|
+
"1",
|
|
57
|
+
"2"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "is-open",
|
|
62
|
+
"type": {
|
|
63
|
+
"text": "boolean"
|
|
64
|
+
},
|
|
65
|
+
"description": "Open state. Toggle directly, or through the `--open` / `--close` / `--toggle` commands. For Escape / outside-click dismissal pair with `<dismiss-watcher command-name=\"--close\">`.",
|
|
66
|
+
"fieldName": "isOpen"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"members": [
|
|
70
|
+
{
|
|
71
|
+
"kind": "field",
|
|
72
|
+
"name": "fromSide",
|
|
73
|
+
"type": {
|
|
74
|
+
"text": "string"
|
|
75
|
+
},
|
|
76
|
+
"privacy": "public",
|
|
77
|
+
"readonly": false,
|
|
78
|
+
"description": "Edge the drawer slides from.",
|
|
79
|
+
"default": "bottom",
|
|
80
|
+
"_neutron": {
|
|
81
|
+
"surface": "option"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"kind": "field",
|
|
86
|
+
"name": "disappearAfter",
|
|
87
|
+
"type": {
|
|
88
|
+
"text": "number"
|
|
89
|
+
},
|
|
90
|
+
"privacy": "public",
|
|
91
|
+
"readonly": false,
|
|
92
|
+
"description": "Auto-close after this many seconds once opened — toast-style / transient confirmations.",
|
|
93
|
+
"_neutron": {
|
|
94
|
+
"surface": "option"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"kind": "field",
|
|
99
|
+
"name": "singletonName",
|
|
100
|
+
"type": {
|
|
101
|
+
"text": "string"
|
|
102
|
+
},
|
|
103
|
+
"privacy": "public",
|
|
104
|
+
"readonly": false,
|
|
105
|
+
"description": "Shared group name. Opening one drawer closes others with the same name (singleton coordination).",
|
|
106
|
+
"_neutron": {
|
|
107
|
+
"surface": "option"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"kind": "field",
|
|
112
|
+
"name": "openStage",
|
|
113
|
+
"type": {
|
|
114
|
+
"text": "number"
|
|
115
|
+
},
|
|
116
|
+
"privacy": "public",
|
|
117
|
+
"readonly": false,
|
|
118
|
+
"description": "How far the drawer opens: `0` full, `1` half, `2` peek. Unset = full. Set statically, or per open through `data-open-stage` on the `--open` / `--toggle` invoker.",
|
|
119
|
+
"_neutron": {
|
|
120
|
+
"surface": "hybrid"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"kind": "field",
|
|
125
|
+
"name": "isOpen",
|
|
126
|
+
"type": {
|
|
127
|
+
"text": "boolean"
|
|
128
|
+
},
|
|
129
|
+
"privacy": "public",
|
|
130
|
+
"readonly": false,
|
|
131
|
+
"description": "Open state. Toggle directly, or through the `--open` / `--close` / `--toggle` commands. For Escape / outside-click dismissal pair with `<dismiss-watcher command-name=\"--close\">`.",
|
|
132
|
+
"_neutron": {
|
|
133
|
+
"surface": "hybrid"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"events": [
|
|
138
|
+
{
|
|
139
|
+
"name": "content-drawer-opened",
|
|
140
|
+
"description": "After open (`is-open` set), `detail` is the drawer. When `singleton-name` is set it is also broadcast so drawers sharing that name close.",
|
|
141
|
+
"type": {
|
|
142
|
+
"text": "ContentDrawerOpenedEvent",
|
|
143
|
+
"expanded": "CustomEvent & { type: \"content-drawer-opened\"; detail: HTMLElement; bubbles: true; cancelable: true; composed: true }"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "content-drawer-closed",
|
|
148
|
+
"description": "After close (`is-open` unset), `detail` is the drawer.",
|
|
149
|
+
"type": {
|
|
150
|
+
"text": "ContentDrawerClosedEvent",
|
|
151
|
+
"expanded": "CustomEvent & { type: \"content-drawer-closed\"; detail: HTMLElement; bubbles: true; cancelable: true; composed: true }"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"_neutron": {
|
|
156
|
+
"commands": [
|
|
157
|
+
{
|
|
158
|
+
"name": "--open",
|
|
159
|
+
"description": "Opens the drawer (`is-open` set). `data-*` attributes on the invoker that name a declared prop (`data-open-stage`, `data-from-side`, …) are applied first; unknown, private and `isOpen` keys are ignored."
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "--close",
|
|
163
|
+
"description": "Closes the drawer (`is-open` unset)."
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "--toggle",
|
|
167
|
+
"description": "Toggles open / closed. Reads the invoker's `data-*` like `--open`."
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"cssClasses": [
|
|
171
|
+
{
|
|
172
|
+
"name": "close",
|
|
173
|
+
"description": "Close control — empty `.close` / `[rel=\"prev\"]` button or link (theme close icon)."
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "sticky",
|
|
177
|
+
"description": "`position: sticky` instead of the default `absolute` placement."
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "absolute",
|
|
181
|
+
"description": "`position: absolute` instead of the default `fixed` placement — a sheet inside its (`position: relative`) parent."
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "relative",
|
|
185
|
+
"description": "In-flow mode: the drawer participates in layout and animates `max-width` instead of overlaying via `position`, pushing sibling content aside as it opens. Currently only affects `from-side=\"left\"`."
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"cssAliases": [
|
|
189
|
+
{
|
|
190
|
+
"name": ":--content-drawer",
|
|
191
|
+
"selectors": [
|
|
192
|
+
"content-drawer",
|
|
193
|
+
".tag-content-drawer"
|
|
194
|
+
],
|
|
195
|
+
"kind": "element"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": ":--content-drawer--is-open",
|
|
199
|
+
"selectors": [
|
|
200
|
+
"[is-open]",
|
|
201
|
+
"[aria-expanded=\"true\"]"
|
|
202
|
+
],
|
|
203
|
+
"kind": "state"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": ":--content-drawer--is-scrubbing",
|
|
207
|
+
"selectors": [
|
|
208
|
+
"[is-scrubbing][is-scrubbing]",
|
|
209
|
+
"[data-scrubbing][data-scrubbing]"
|
|
210
|
+
],
|
|
211
|
+
"kind": "state"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": ":--content-drawer--open-stage-1",
|
|
215
|
+
"selectors": [
|
|
216
|
+
"[open-stage=\"1\"]",
|
|
217
|
+
"[data-open=\"1\"]"
|
|
218
|
+
],
|
|
219
|
+
"kind": "state"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"name": ":--content-drawer--open-stage-2",
|
|
223
|
+
"selectors": [
|
|
224
|
+
"[open-stage=\"2\"]",
|
|
225
|
+
"[data-open=\"2\"]"
|
|
226
|
+
],
|
|
227
|
+
"kind": "state"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": ":--content-drawer--from-side",
|
|
231
|
+
"selectors": [
|
|
232
|
+
"[from-side]",
|
|
233
|
+
"[data-placement]"
|
|
234
|
+
],
|
|
235
|
+
"kind": "state"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"name": ":--content-drawer--from-side-bottom",
|
|
239
|
+
"selectors": [
|
|
240
|
+
"[from-side=\"bottom\"]",
|
|
241
|
+
"[data-placement=\"bottom\"]"
|
|
242
|
+
],
|
|
243
|
+
"kind": "state"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"name": ":--content-drawer--from-side-top",
|
|
247
|
+
"selectors": [
|
|
248
|
+
"[from-side=\"top\"]",
|
|
249
|
+
"[data-placement=\"top\"]"
|
|
250
|
+
],
|
|
251
|
+
"kind": "state"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": ":--content-drawer--from-side-left",
|
|
255
|
+
"selectors": [
|
|
256
|
+
"[from-side=\"left\"]",
|
|
257
|
+
"[data-placement=\"left\"]"
|
|
258
|
+
],
|
|
259
|
+
"kind": "state"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": ":--content-drawer--from-side-right",
|
|
263
|
+
"selectors": [
|
|
264
|
+
"[from-side=\"right\"]",
|
|
265
|
+
"[data-placement=\"right\"]"
|
|
266
|
+
],
|
|
267
|
+
"kind": "state"
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"cssProperties": [
|
|
272
|
+
{
|
|
273
|
+
"name": "--content-drawer-transition-duration",
|
|
274
|
+
"description": "Slide transition duration.",
|
|
275
|
+
"syntax": "<time>",
|
|
276
|
+
"default": "0.25s"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "--content-drawer-transition-ease",
|
|
280
|
+
"description": "Slide transition easing.",
|
|
281
|
+
"syntax": "<easing-function>",
|
|
282
|
+
"default": "ease-out"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"name": "--content-drawer-closed",
|
|
286
|
+
"description": "Off-screen translate amount (closed).",
|
|
287
|
+
"syntax": "<percentage>",
|
|
288
|
+
"default": "101%"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "--content-drawer-open-full",
|
|
292
|
+
"description": "Full-open translate (`open-stage` unset or `0`).",
|
|
293
|
+
"syntax": "<percentage>",
|
|
294
|
+
"default": "0%"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"name": "--content-drawer-open-half",
|
|
298
|
+
"description": "Half-open translate (`open-stage=\"1\"`).",
|
|
299
|
+
"syntax": "<percentage>",
|
|
300
|
+
"default": "50%"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "--content-drawer-open-peek",
|
|
304
|
+
"description": "Peek translate (`open-stage=\"2\"`).",
|
|
305
|
+
"syntax": "<percentage>",
|
|
306
|
+
"default": "75%"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"name": "--content-drawer-relative-max-width",
|
|
310
|
+
"description": "Max width when open in `.relative` mode, used unless `--content-drawer-max-width` is set.",
|
|
311
|
+
"syntax": "<length>",
|
|
312
|
+
"default": "200px"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"name": "--content-drawer-z-index",
|
|
316
|
+
"description": "Stack order for the drawer panel.",
|
|
317
|
+
"syntax": "<integer>",
|
|
318
|
+
"default": "3"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "--content-drawer-overlay-z-index",
|
|
322
|
+
"description": "Stack order for the sibling backdrop (`:--dialog-backdrop-aliases`).",
|
|
323
|
+
"syntax": "<integer>",
|
|
324
|
+
"default": "2"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"name": "--content-drawer-open-progress",
|
|
328
|
+
"description": "How far open the drawer is while `is-scrubbing`: `0` closed, `1` full. Declared on the drawer (not `:root`) so it follows a wrapping `<gesture-handler>`'s inherited `--gesture-progress` unless set explicitly — a swipe-to-open / drag-to-close bottom sheet.",
|
|
329
|
+
"syntax": "<number>",
|
|
330
|
+
"default": "var(--gesture-progress, 0)"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"name": "--content-drawer-max-width",
|
|
334
|
+
"description": "Overrides `--content-drawer-relative-max-width` for this drawer only.",
|
|
335
|
+
"syntax": "<length>"
|
|
336
|
+
}
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"exports": [
|
|
341
|
+
{
|
|
342
|
+
"kind": "js",
|
|
343
|
+
"name": "ContentDrawer",
|
|
344
|
+
"declaration": {
|
|
345
|
+
"name": "ContentDrawer",
|
|
346
|
+
"module": "content-drawer.ts"
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"kind": "custom-element-definition",
|
|
351
|
+
"name": "content-drawer",
|
|
352
|
+
"declaration": {
|
|
353
|
+
"name": "ContentDrawer",
|
|
354
|
+
"module": "content-drawer.ts"
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
]
|
|
360
|
+
}
|