@rcarls/rc-app-bar 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/README.md +221 -0
- package/dist/custom-elements.json +582 -0
- package/dist/demo.css +85 -0
- package/dist/demo.js +40 -0
- package/dist/rc-app-bar-DcYvkEsy.js +388 -0
- package/dist/rc-app-bar-DcYvkEsy.js.map +1 -0
- package/dist/rc-app-bar-define.js +6 -0
- package/dist/rc-app-bar-define.js.map +1 -0
- package/dist/rc-app-bar.js +5 -0
- package/dist/rc-app-bar.js.map +1 -0
- package/dist/types/packages/rc-app-bar/src/define.d.ts +1 -0
- package/dist/types/packages/rc-app-bar/src/index.d.ts +1 -0
- package/dist/types/packages/rc-app-bar/src/rc-app-bar.d.ts +105 -0
- package/dist/types/packages/rc-app-bar/src/rc-app-bar.styles.d.ts +2 -0
- package/dist/types/packages/rc-app-bar/src/rc-app-bar.test.d.ts +0 -0
- package/package.json +69 -0
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/define.ts",
|
|
8
|
+
"declarations": [],
|
|
9
|
+
"exports": [
|
|
10
|
+
{
|
|
11
|
+
"kind": "custom-element-definition",
|
|
12
|
+
"name": "rc-app-bar",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "RCAppBar",
|
|
15
|
+
"module": "/src/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "js",
|
|
20
|
+
"name": "*",
|
|
21
|
+
"declaration": {
|
|
22
|
+
"name": "*",
|
|
23
|
+
"module": "src/index.js"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"kind": "javascript-module",
|
|
30
|
+
"path": "src/index.ts",
|
|
31
|
+
"declarations": [],
|
|
32
|
+
"exports": [
|
|
33
|
+
{
|
|
34
|
+
"kind": "js",
|
|
35
|
+
"name": "*",
|
|
36
|
+
"declaration": {
|
|
37
|
+
"name": "*",
|
|
38
|
+
"module": "src/rc-app-bar"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"kind": "javascript-module",
|
|
45
|
+
"path": "src/rc-app-bar.ts",
|
|
46
|
+
"declarations": [
|
|
47
|
+
{
|
|
48
|
+
"kind": "class",
|
|
49
|
+
"description": "A headless app bar with leading, title, exact-center, and trailing regions.\n\nThe element carries no landmark role. Consumers provide all controls and\nicons, and wrap page-level instances in `<header>` when a banner landmark is\nappropriate.\n\nScrolled state is dual-mode. Uncontrolled: set `scrollTarget` (or the\n`scroll-target` selector attribute) and the bar observes the container.\nControlled: assign `scrolled`; assigning `undefined` releases observation.\nHost writes are silent.",
|
|
50
|
+
"name": "RCAppBar",
|
|
51
|
+
"cssProperties": [
|
|
52
|
+
{
|
|
53
|
+
"description": "Bar background",
|
|
54
|
+
"name": "--rc-app-bar-bg",
|
|
55
|
+
"default": "Canvas"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"description": "Bar text color",
|
|
59
|
+
"name": "--rc-app-bar-color",
|
|
60
|
+
"default": "CanvasText"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"description": "Compact row minimum height",
|
|
64
|
+
"name": "--rc-app-bar-compact-min-height",
|
|
65
|
+
"default": "3rem"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"description": "Expanded title padding",
|
|
69
|
+
"name": "--rc-app-bar-expanded-padding-block",
|
|
70
|
+
"default": "0.75em"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"description": "Horizontal padding",
|
|
74
|
+
"name": "--rc-app-bar-padding-inline",
|
|
75
|
+
"default": "0.75em"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"description": "Gap between regions",
|
|
79
|
+
"name": "--rc-app-bar-gap",
|
|
80
|
+
"default": "0.5em"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"description": "Endpoint and hide duration",
|
|
84
|
+
"name": "--rc-app-bar-transition-duration",
|
|
85
|
+
"default": "200ms"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"description": "Scrolled divider",
|
|
89
|
+
"name": "--rc-app-bar-scroll-divider",
|
|
90
|
+
"default": "1px solid GrayText"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"description": "Collapse animation progress 0–1; read-only",
|
|
94
|
+
"name": "--rc-app-bar-collapse-progress",
|
|
95
|
+
"default": "0"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"description": "Compact-row title font size (opt-in; inherits when unset)",
|
|
99
|
+
"name": "--rc-app-bar-title-font-size"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"description": "Expanded-row title font size (opt-in)",
|
|
103
|
+
"name": "--rc-app-bar-expanded-title-font-size"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"cssParts": [
|
|
107
|
+
{
|
|
108
|
+
"description": "The grid container",
|
|
109
|
+
"name": "root"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"description": "Wrapper around the leading slot",
|
|
113
|
+
"name": "leading"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"description": "Wrapper around the single title slot",
|
|
117
|
+
"name": "title"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"description": "Wrapper around the centered slot",
|
|
121
|
+
"name": "center"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"description": "Wrapper around the trailing slot",
|
|
125
|
+
"name": "trailing"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"description": "Scrolled-state separator",
|
|
129
|
+
"name": "scroll-shadow"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"slots": [
|
|
133
|
+
{
|
|
134
|
+
"description": "Leading navigation or controls; accepts multiple children",
|
|
135
|
+
"name": "leading"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"description": "The single title region; may contain title and subtitle markup",
|
|
139
|
+
"name": ""
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"description": "Content kept at the exact horizontal center, such as search",
|
|
143
|
+
"name": "center"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"description": "Trailing action controls",
|
|
147
|
+
"name": "trailing"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"members": [
|
|
151
|
+
{
|
|
152
|
+
"kind": "field",
|
|
153
|
+
"name": "variant",
|
|
154
|
+
"type": {
|
|
155
|
+
"text": "RCAppBarVariant"
|
|
156
|
+
},
|
|
157
|
+
"default": "'compact'",
|
|
158
|
+
"description": "Structural variant. `expanded` adds a flexible title row.",
|
|
159
|
+
"attribute": "variant",
|
|
160
|
+
"reflects": true
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"kind": "field",
|
|
164
|
+
"name": "scrollBehavior",
|
|
165
|
+
"type": {
|
|
166
|
+
"text": "RCAppBarScrollBehavior"
|
|
167
|
+
},
|
|
168
|
+
"default": "'pinned'",
|
|
169
|
+
"description": "Visual response to observed scrolling.",
|
|
170
|
+
"attribute": "scroll-behavior",
|
|
171
|
+
"reflects": true
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"kind": "field",
|
|
175
|
+
"name": "scrollTarget",
|
|
176
|
+
"type": {
|
|
177
|
+
"text": "ScrollObserverTarget | string | null"
|
|
178
|
+
},
|
|
179
|
+
"default": "null",
|
|
180
|
+
"description": "Scroll container to observe. The attribute accepts a CSS selector or\n`window`; the property also accepts an element, document, or window.",
|
|
181
|
+
"attribute": "scroll-target"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"kind": "field",
|
|
185
|
+
"name": "scrollThreshold",
|
|
186
|
+
"type": {
|
|
187
|
+
"text": "number"
|
|
188
|
+
},
|
|
189
|
+
"default": "4",
|
|
190
|
+
"description": "Scroll offset in px past which the bar is scrolled (strict `>`).",
|
|
191
|
+
"attribute": "scroll-threshold"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"kind": "field",
|
|
195
|
+
"name": "_scrolled",
|
|
196
|
+
"type": {
|
|
197
|
+
"text": "boolean | undefined"
|
|
198
|
+
},
|
|
199
|
+
"privacy": "private",
|
|
200
|
+
"default": "undefined"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"kind": "field",
|
|
204
|
+
"name": "_observedScrolled",
|
|
205
|
+
"type": {
|
|
206
|
+
"text": "boolean"
|
|
207
|
+
},
|
|
208
|
+
"privacy": "private",
|
|
209
|
+
"default": "false"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"kind": "field",
|
|
213
|
+
"name": "_hasLeading",
|
|
214
|
+
"type": {
|
|
215
|
+
"text": "boolean"
|
|
216
|
+
},
|
|
217
|
+
"privacy": "private",
|
|
218
|
+
"default": "false"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"kind": "field",
|
|
222
|
+
"name": "_hasCenter",
|
|
223
|
+
"type": {
|
|
224
|
+
"text": "boolean"
|
|
225
|
+
},
|
|
226
|
+
"privacy": "private",
|
|
227
|
+
"default": "false"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"kind": "field",
|
|
231
|
+
"name": "_hasTrailing",
|
|
232
|
+
"type": {
|
|
233
|
+
"text": "boolean"
|
|
234
|
+
},
|
|
235
|
+
"privacy": "private",
|
|
236
|
+
"default": "false"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"kind": "field",
|
|
240
|
+
"name": "_collapsed",
|
|
241
|
+
"type": {
|
|
242
|
+
"text": "boolean"
|
|
243
|
+
},
|
|
244
|
+
"privacy": "private",
|
|
245
|
+
"default": "false"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"kind": "field",
|
|
249
|
+
"name": "_hidden",
|
|
250
|
+
"type": {
|
|
251
|
+
"text": "boolean"
|
|
252
|
+
},
|
|
253
|
+
"privacy": "private",
|
|
254
|
+
"default": "false"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"kind": "field",
|
|
258
|
+
"name": "_collapseDistance",
|
|
259
|
+
"type": {
|
|
260
|
+
"text": "number"
|
|
261
|
+
},
|
|
262
|
+
"privacy": "private",
|
|
263
|
+
"default": "0"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"kind": "field",
|
|
267
|
+
"name": "_collapseOffsetDistance",
|
|
268
|
+
"type": {
|
|
269
|
+
"text": "number"
|
|
270
|
+
},
|
|
271
|
+
"privacy": "private",
|
|
272
|
+
"default": "0"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"kind": "field",
|
|
276
|
+
"name": "_collapseProgress",
|
|
277
|
+
"type": {
|
|
278
|
+
"text": "number"
|
|
279
|
+
},
|
|
280
|
+
"privacy": "private",
|
|
281
|
+
"default": "0"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"kind": "field",
|
|
285
|
+
"name": "_reducedMotion",
|
|
286
|
+
"privacy": "private",
|
|
287
|
+
"readonly": true
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"kind": "field",
|
|
291
|
+
"name": "_internals",
|
|
292
|
+
"privacy": "private"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"kind": "field",
|
|
296
|
+
"name": "_resizeObserver",
|
|
297
|
+
"type": {
|
|
298
|
+
"text": "ResizeObserver | null"
|
|
299
|
+
},
|
|
300
|
+
"privacy": "private",
|
|
301
|
+
"default": "null"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"kind": "field",
|
|
305
|
+
"name": "_scroll",
|
|
306
|
+
"privacy": "private",
|
|
307
|
+
"readonly": true,
|
|
308
|
+
"default": "new ScrollObserverController(this, { target: () => this._resolveScrollTarget(), threshold: this.scrollThreshold, disabled: true, onChange: (scrolled) => { this._observedScrolled = scrolled; this._syncVisualState(); this.dispatchEvent( new CustomEvent<RCAppBarScrollDetail>('rc-app-bar-scroll', { bubbles: true, composed: true, detail: { scrolled }, }), ); }, onScroll: (scrollTop, delta) => this._onObservedScroll(scrollTop, delta), })"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"kind": "field",
|
|
312
|
+
"name": "scrolled",
|
|
313
|
+
"type": {
|
|
314
|
+
"text": "boolean"
|
|
315
|
+
},
|
|
316
|
+
"description": "Whether the bar is past its scroll threshold. Host writes are silent and\ncontrolled; assigning `undefined` releases observation."
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"kind": "field",
|
|
320
|
+
"name": "collapsed",
|
|
321
|
+
"type": {
|
|
322
|
+
"text": "boolean"
|
|
323
|
+
},
|
|
324
|
+
"description": "Whether the expanded title row is currently collapsed.",
|
|
325
|
+
"readonly": true
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"kind": "method",
|
|
329
|
+
"name": "_connectResizeObserver",
|
|
330
|
+
"privacy": "private",
|
|
331
|
+
"return": {
|
|
332
|
+
"type": {
|
|
333
|
+
"text": "void"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"kind": "method",
|
|
339
|
+
"name": "_observeLayout",
|
|
340
|
+
"privacy": "private",
|
|
341
|
+
"return": {
|
|
342
|
+
"type": {
|
|
343
|
+
"text": "void"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"kind": "method",
|
|
349
|
+
"name": "_measureLayout",
|
|
350
|
+
"privacy": "private",
|
|
351
|
+
"return": {
|
|
352
|
+
"type": {
|
|
353
|
+
"text": "void"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"kind": "method",
|
|
359
|
+
"name": "_syncScrollObserver",
|
|
360
|
+
"privacy": "private",
|
|
361
|
+
"return": {
|
|
362
|
+
"type": {
|
|
363
|
+
"text": "void"
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"kind": "method",
|
|
369
|
+
"name": "_resolveScrollTarget",
|
|
370
|
+
"privacy": "private",
|
|
371
|
+
"return": {
|
|
372
|
+
"type": {
|
|
373
|
+
"text": "ScrollObserverTarget | null"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"kind": "method",
|
|
379
|
+
"name": "_onObservedScroll",
|
|
380
|
+
"privacy": "private",
|
|
381
|
+
"return": {
|
|
382
|
+
"type": {
|
|
383
|
+
"text": "void"
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
"parameters": [
|
|
387
|
+
{
|
|
388
|
+
"name": "scrollTop",
|
|
389
|
+
"type": {
|
|
390
|
+
"text": "number"
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "delta",
|
|
395
|
+
"type": {
|
|
396
|
+
"text": "number"
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
]
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"kind": "method",
|
|
403
|
+
"name": "_syncVisualState",
|
|
404
|
+
"privacy": "private",
|
|
405
|
+
"return": {
|
|
406
|
+
"type": {
|
|
407
|
+
"text": "void"
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"kind": "method",
|
|
413
|
+
"name": "_setCollapseProgress",
|
|
414
|
+
"privacy": "private",
|
|
415
|
+
"return": {
|
|
416
|
+
"type": {
|
|
417
|
+
"text": "void"
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
"parameters": [
|
|
421
|
+
{
|
|
422
|
+
"name": "progress",
|
|
423
|
+
"type": {
|
|
424
|
+
"text": "number"
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"kind": "method",
|
|
431
|
+
"name": "_applyCollapseGeometry",
|
|
432
|
+
"privacy": "private",
|
|
433
|
+
"return": {
|
|
434
|
+
"type": {
|
|
435
|
+
"text": "void"
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"kind": "method",
|
|
441
|
+
"name": "_setHidden",
|
|
442
|
+
"privacy": "private",
|
|
443
|
+
"return": {
|
|
444
|
+
"type": {
|
|
445
|
+
"text": "void"
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
"parameters": [
|
|
449
|
+
{
|
|
450
|
+
"name": "hidden",
|
|
451
|
+
"type": {
|
|
452
|
+
"text": "boolean"
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
]
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"kind": "method",
|
|
459
|
+
"name": "_syncStateOutputs",
|
|
460
|
+
"privacy": "private",
|
|
461
|
+
"return": {
|
|
462
|
+
"type": {
|
|
463
|
+
"text": "void"
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"kind": "method",
|
|
469
|
+
"name": "_setCustomState",
|
|
470
|
+
"privacy": "private",
|
|
471
|
+
"return": {
|
|
472
|
+
"type": {
|
|
473
|
+
"text": "void"
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
"parameters": [
|
|
477
|
+
{
|
|
478
|
+
"name": "name",
|
|
479
|
+
"type": {
|
|
480
|
+
"text": "string"
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"name": "active",
|
|
485
|
+
"type": {
|
|
486
|
+
"text": "boolean"
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
]
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"kind": "method",
|
|
493
|
+
"name": "_onSlotChange",
|
|
494
|
+
"privacy": "private",
|
|
495
|
+
"return": {
|
|
496
|
+
"type": {
|
|
497
|
+
"text": "void"
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
"parameters": [
|
|
501
|
+
{
|
|
502
|
+
"name": "e",
|
|
503
|
+
"type": {
|
|
504
|
+
"text": "Event"
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
],
|
|
510
|
+
"events": [
|
|
511
|
+
{
|
|
512
|
+
"description": "When observed scroll state crosses the threshold; `detail: { scrolled }`",
|
|
513
|
+
"name": "rc-app-bar-scroll"
|
|
514
|
+
}
|
|
515
|
+
],
|
|
516
|
+
"attributes": [
|
|
517
|
+
{
|
|
518
|
+
"name": "variant",
|
|
519
|
+
"type": {
|
|
520
|
+
"text": "RCAppBarVariant"
|
|
521
|
+
},
|
|
522
|
+
"default": "'compact'",
|
|
523
|
+
"description": "Structural variant. `expanded` adds a flexible title row.",
|
|
524
|
+
"fieldName": "variant"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"name": "scroll-behavior",
|
|
528
|
+
"type": {
|
|
529
|
+
"text": "RCAppBarScrollBehavior"
|
|
530
|
+
},
|
|
531
|
+
"default": "'pinned'",
|
|
532
|
+
"description": "Visual response to observed scrolling.",
|
|
533
|
+
"fieldName": "scrollBehavior"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"name": "scroll-target",
|
|
537
|
+
"type": {
|
|
538
|
+
"text": "ScrollObserverTarget | string | null"
|
|
539
|
+
},
|
|
540
|
+
"default": "null",
|
|
541
|
+
"description": "Scroll container to observe. The attribute accepts a CSS selector or\n`window`; the property also accepts an element, document, or window.",
|
|
542
|
+
"fieldName": "scrollTarget"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"name": "scroll-threshold",
|
|
546
|
+
"type": {
|
|
547
|
+
"text": "number"
|
|
548
|
+
},
|
|
549
|
+
"default": "4",
|
|
550
|
+
"description": "Scroll offset in px past which the bar is scrolled (strict `>`).",
|
|
551
|
+
"fieldName": "scrollThreshold"
|
|
552
|
+
}
|
|
553
|
+
],
|
|
554
|
+
"superclass": {
|
|
555
|
+
"name": "LitElement",
|
|
556
|
+
"package": "lit"
|
|
557
|
+
},
|
|
558
|
+
"tagName": "rc-app-bar",
|
|
559
|
+
"customElement": true
|
|
560
|
+
}
|
|
561
|
+
],
|
|
562
|
+
"exports": [
|
|
563
|
+
{
|
|
564
|
+
"kind": "js",
|
|
565
|
+
"name": "RCAppBar",
|
|
566
|
+
"declaration": {
|
|
567
|
+
"name": "RCAppBar",
|
|
568
|
+
"module": "src/rc-app-bar.ts"
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"kind": "js",
|
|
573
|
+
"name": "default",
|
|
574
|
+
"declaration": {
|
|
575
|
+
"name": "RCAppBar",
|
|
576
|
+
"module": "src/rc-app-bar.ts"
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
]
|
|
580
|
+
}
|
|
581
|
+
]
|
|
582
|
+
}
|
package/dist/demo.css
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
*, *::before, *::after {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
color-scheme: light dark;
|
|
7
|
+
--rc-accent: Highlight; /* Chrome doesn't support AccentColor on the open web */
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@supports (color: AccentColor) {
|
|
11
|
+
:root {
|
|
12
|
+
--rc-accent: AccentColor;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[data-theme="light"] { color-scheme: light; }
|
|
17
|
+
[data-theme="dark"] { color-scheme: dark; }
|
|
18
|
+
|
|
19
|
+
[data-theme="solarized-light"] {
|
|
20
|
+
color-scheme: light;
|
|
21
|
+
--rc-surface: #fdf6e3;
|
|
22
|
+
--rc-text: #657b83;
|
|
23
|
+
--rc-border: 1px solid #93a1a1;
|
|
24
|
+
--rc-shadow: 0 2px 8px rgba(0, 0, 0, .12);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-theme="solarized-dark"] {
|
|
28
|
+
color-scheme: dark;
|
|
29
|
+
--rc-surface: #002b36;
|
|
30
|
+
--rc-text: #839496;
|
|
31
|
+
--rc-border: 1px solid #586e75;
|
|
32
|
+
--rc-shadow: 0 2px 8px rgba(0, 0, 0, .3);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body {
|
|
36
|
+
font-family: system-ui, sans-serif;
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.demo-page {
|
|
41
|
+
max-width: 60rem;
|
|
42
|
+
margin: 0 auto;
|
|
43
|
+
padding: 2rem 1.5rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.demo-controls {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: 1rem;
|
|
50
|
+
margin-bottom: 2rem;
|
|
51
|
+
padding-bottom: 1rem;
|
|
52
|
+
border-bottom: 1px solid ButtonBorder;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.demo-controls .demo-title {
|
|
56
|
+
flex: 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.demo-controls h1 {
|
|
60
|
+
margin: 0 0 0.15rem;
|
|
61
|
+
font-size: 1.5rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.demo-controls a {
|
|
65
|
+
font-size: 0.8rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.demo-section {
|
|
69
|
+
margin-bottom: 2rem;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.demo-section h2 {
|
|
73
|
+
margin: 0 0 0.5rem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.theme-picker {
|
|
77
|
+
padding: 0.35em 0.75em;
|
|
78
|
+
font-family: inherit;
|
|
79
|
+
font-size: 0.8rem;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
border: 1px solid ButtonBorder;
|
|
82
|
+
border-radius: 4px;
|
|
83
|
+
background: Canvas;
|
|
84
|
+
color: CanvasText;
|
|
85
|
+
}
|
package/dist/demo.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const THEMES = ['', 'light', 'dark', 'solarized-light', 'solarized-dark'];
|
|
2
|
+
const LABELS = ['Auto', 'Light', 'Dark', 'Solarized ☀', 'Solarized ☾'];
|
|
3
|
+
|
|
4
|
+
const stored = localStorage.getItem('rc-demo-theme') ?? '';
|
|
5
|
+
applyTheme(stored);
|
|
6
|
+
|
|
7
|
+
function applyTheme(theme) {
|
|
8
|
+
if (theme) {
|
|
9
|
+
document.documentElement.dataset.theme = theme;
|
|
10
|
+
} else {
|
|
11
|
+
delete document.documentElement.dataset.theme;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function currentIndex() {
|
|
16
|
+
const current = document.documentElement.dataset.theme ?? '';
|
|
17
|
+
const idx = THEMES.indexOf(current);
|
|
18
|
+
return idx === -1 ? 0 : idx;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function updateButtons() {
|
|
22
|
+
const label = LABELS[currentIndex()];
|
|
23
|
+
document.querySelectorAll('.theme-picker').forEach((btn) => {
|
|
24
|
+
btn.textContent = label;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
window.cycleTheme = function () {
|
|
29
|
+
const next = THEMES[(currentIndex() + 1) % THEMES.length];
|
|
30
|
+
applyTheme(next);
|
|
31
|
+
localStorage.setItem('rc-demo-theme', next);
|
|
32
|
+
updateButtons();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
36
|
+
updateButtons();
|
|
37
|
+
document.querySelectorAll('.theme-picker').forEach((btn) => {
|
|
38
|
+
btn.addEventListener('click', window.cycleTheme);
|
|
39
|
+
});
|
|
40
|
+
});
|