7
7
< title > Aura</ title >
8
8
< link rel ="stylesheet " href ="../packages/aura/aura.css " />
9
9
< link rel ="stylesheet " href ="./aura/aura-view.css " />
10
+ < link rel ="stylesheet " href ="./aura/badge.css " />
10
11
< script type ="module ">
11
12
window . Vaadin ||= { } ;
12
13
window . Vaadin . featureFlags ||= { } ;
21
22
import '@vaadin/app-layout' ;
22
23
import '@vaadin/app-layout/src/vaadin-drawer-toggle.js' ;
23
24
import '@vaadin/avatar' ;
25
+ import '@vaadin/avatar-group' ;
26
+ import '@vaadin/card' ;
24
27
import '@vaadin/checkbox' ;
25
28
import '@vaadin/checkbox-group' ;
26
29
import '@vaadin/combo-box' ;
27
30
import '@vaadin/date-time-picker' ;
31
+ import '@vaadin/grid' ;
32
+ import '@vaadin/grid/src/vaadin-grid-selection-column.js' ;
28
33
import '@vaadin/icon' ;
29
34
import '@vaadin/master-detail-layout' ;
30
35
import '@vaadin/menu-bar' ;
40
45
import '@vaadin/vertical-layout' ;
41
46
import { html , render } from 'lit' ;
42
47
import { Button } from '@vaadin/button' ;
48
+ import { Notification } from '@vaadin/notification' ;
43
49
44
50
function clearLocalStorage ( ) {
45
51
for ( let i = localStorage . length - 1 ; i >= 0 ; i -- ) {
68
74
}
69
75
} ) ;
70
76
77
+ const generateItems = ( count ) => {
78
+ return Array . from ( { length : count } , ( _ , i ) => ( {
79
+ name : `First Lastname ${ i + 1 } ` ,
80
+ email : `first.lastname${ i + 1 } @example.com` ,
81
+ address : `${ i + 1 } Main Street` ,
82
+ city : `City ${ i + 1 } ` ,
83
+ country : `Country ${ i + 1 } ` ,
84
+ } ) ) ;
85
+ } ;
86
+
71
87
function initComponentsView ( ) {
72
88
const view = document . querySelector ( '.components-view' ) ;
73
89
153
169
userColorIndex : 2 ,
154
170
} ,
155
171
] ;
172
+
173
+ // Notification
174
+ view . querySelector ( '#showNotificationBtn' ) . addEventListener ( 'click' , ( ) => {
175
+ const notification = Notification . show (
176
+ html `< vaadin-card theme ="horizontal footer-end no-frame ">
177
+ < vaadin-icon src ="./assets/lucide-icons/messages-square.svg " slot ="media "> </ vaadin-icon >
178
+ < div slot ="title "> New Message from Olivia</ div >
179
+ < div > The AI chat UI is evolving with the integration of components…</ div >
180
+ < vaadin-button slot ="footer "> Show</ vaadin-button >
181
+ < vaadin-button slot ="footer "> Dismiss</ vaadin-button >
182
+ </ vaadin-card > ` ,
183
+ { duration : 0 , position : 'top-end' } ,
184
+ ) ;
185
+ notification . _overlayElement
186
+ . querySelectorAll ( 'vaadin-button' )
187
+ . forEach ( ( button ) => button . addEventListener ( 'click' , ( ) => notification . close ( ) ) ) ;
188
+ } ) ;
189
+
190
+ // Avatar Group
191
+ view . querySelector ( 'vaadin-avatar-group' ) . items = [
192
+ { name : 'AA' , colorIndex : 0 } ,
193
+ { name : 'BB' , colorIndex : 1 } ,
194
+ { name : 'CC' , colorIndex : 2 } ,
195
+ { name : 'DD' , colorIndex : 3 } ,
196
+ { name : 'EE' , colorIndex : 4 } ,
197
+ { name : 'FF' , colorIndex : 5 } ,
198
+ { name : 'GG' , colorIndex : 6 } ,
199
+ { name : 'HH' , colorIndex : 7 } ,
200
+ { name : 'II' , colorIndex : 8 } ,
201
+ ] ;
202
+
203
+ // Grid
204
+ view . querySelector ( 'vaadin-grid' ) . items = generateItems ( 20 ) ;
156
205
}
157
206
158
207
initComponentsView ( ) ;
189
238
.dashboard-section ::part (detail ) {
190
239
flex-basis : 85% ;
191
240
}
241
+
242
+ /* TODO part of Aura? */
243
+ hr {
244
+ place-self : stretch;
245
+ margin : var (--vaadin-gap-m ) 0 ;
246
+ border : 0 ;
247
+ background : var (--vaadin-border-color-subtle );
248
+ min-height : 1px ;
249
+ max-height : 1px ;
250
+ }
251
+
252
+ /* Considering these as built-in variants, but perhaps they should be another component like https://github.com/vaadin/web-components/issues/7958 */
253
+ vaadin-card [theme ~= 'no-frame' ] {
254
+ --vaadin-card-padding : 0px ;
255
+ --vaadin-card-background : transparent;
256
+ }
257
+
258
+ vaadin-card [theme ~= 'footer-end' ] {
259
+ --_footer : 0 ;
260
+ grid-template-rows : repeat (var (--_content ), auto) 1fr ;
261
+ }
262
+
263
+ vaadin-card [theme ~= 'footer-end' ]::part (footer ) {
264
+ grid-column : -1 ;
265
+ grid-row : 1 / span calc (var (--_header ) + var (--_content ));
266
+ align-self : center;
267
+ flex-direction : column;
268
+ }
192
269
</ style >
193
270
</ head >
194
271
< body >
205
282
< vaadin-side-nav-item path ="">
206
283
< vaadin-icon src ="./assets/lucide-icons/chart-column-big.svg " slot ="prefix "> </ vaadin-icon >
207
284
Dashboard
285
+ < span theme ="badge accent " slot ="suffix " aria-label ="(2 new items) "> 2</ span >
208
286
</ vaadin-side-nav-item >
209
287
210
288
< vaadin-side-nav-item >
@@ -264,6 +342,7 @@ <h1>Dashboard</h1>
264
342
< vaadin-side-nav-item path ="#components ">
265
343
< vaadin-icon src ="./assets/lucide-icons/home.svg " slot ="prefix "> </ vaadin-icon >
266
344
< span > Components</ span >
345
+ < span theme ="badge accent " slot ="suffix " aria-label ="(2 new items) "> 2</ span >
267
346
</ vaadin-side-nav-item >
268
347
< vaadin-side-nav-item >
269
348
< vaadin-icon src ="./assets/lucide-icons/chart-column-big.svg " slot ="prefix "> </ vaadin-icon >
@@ -288,6 +367,7 @@ <h1>Dashboard</h1>
288
367
> < vaadin-side-nav-item >
289
368
< vaadin-icon src ="./assets/lucide-icons/messages-square.svg " slot ="prefix "> </ vaadin-icon >
290
369
< span > Support</ span >
370
+ < span theme ="badge green " slot ="suffix "> Online</ span >
291
371
</ vaadin-side-nav-item >
292
372
</ vaadin-side-nav >
293
373
</ vaadin-scroller >
@@ -360,6 +440,13 @@ <h1>Components</h1>
360
440
padding : 0 ;
361
441
}
362
442
443
+ .components-view .badges {
444
+ display : flex;
445
+ flex-wrap : wrap;
446
+ justify-content : center;
447
+ gap : var (--vaadin-gap-s );
448
+ }
449
+
363
450
.components-view .sizes {
364
451
display : flex;
365
452
flex-direction : column;
@@ -380,6 +467,94 @@ <h1>Components</h1>
380
467
< vaadin-button theme ="tertiary "> Tertiary</ vaadin-button >
381
468
</ div >
382
469
470
+ < div class ="component " theme ="surface ">
471
+ < div class ="flex justify-center ">
472
+ < vaadin-button id ="showNotificationBtn ">
473
+ < vaadin-icon src ="./assets/lucide-icons/layers.svg " slot ="prefix "> </ vaadin-icon >
474
+ Show Notification
475
+ </ vaadin-button >
476
+ </ div >
477
+ </ div >
478
+
479
+ < div class ="component wide tall " theme ="surface ">
480
+
481
+ < div class ="badges ">
482
+ < span theme ="badge "> Default</ span >
483
+ < span theme ="badge accent "> Accent</ span >
484
+ < span theme ="badge green "> Green</ span >
485
+ < span theme ="badge blue "> Blue</ span >
486
+ < span theme ="badge purple "> Purple</ span >
487
+ < span theme ="badge red "> Red</ span >
488
+ < span theme ="badge orange "> Orange</ span >
489
+ < span theme ="badge yellow "> Yellow</ span >
490
+ </ div >
491
+
492
+ < div class ="badges ">
493
+ < span theme ="filled badge "> Default</ span >
494
+ < span theme ="filled badge accent "> Accent</ span >
495
+ < span theme ="filled badge green "> Green</ span >
496
+ < span theme ="filled badge blue "> Blue</ span >
497
+ < span theme ="filled badge purple "> Purple</ span >
498
+ < span theme ="filled badge red "> Red</ span >
499
+ < span theme ="filled badge orange "> Orange</ span >
500
+ < span theme ="filled badge yellow "> Yellow</ span >
501
+ </ div >
502
+
503
+ < div class ="badges ">
504
+ < span theme ="badge ">
505
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
506
+ </ span >
507
+ < span theme ="badge accent ">
508
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
509
+ </ span >
510
+ < span theme ="badge green ">
511
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
512
+ </ span >
513
+ < span theme ="badge blue ">
514
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
515
+ </ span >
516
+ < span theme ="badge purple ">
517
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
518
+ </ span >
519
+ < span theme ="badge red ">
520
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
521
+ </ span >
522
+ < span theme ="badge orange ">
523
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
524
+ </ span >
525
+ < span theme ="badge yellow ">
526
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
527
+ </ span >
528
+ </ div >
529
+
530
+ < div class ="badges ">
531
+ < span theme ="badge filled ">
532
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
533
+ </ span >
534
+ < span theme ="badge filled accent ">
535
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
536
+ </ span >
537
+ < span theme ="badge filled green ">
538
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
539
+ </ span >
540
+ < span theme ="badge filled blue ">
541
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
542
+ </ span >
543
+ < span theme ="badge filled purple ">
544
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
545
+ </ span >
546
+ < span theme ="badge filled red ">
547
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
548
+ </ span >
549
+ < span theme ="badge filled orange ">
550
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
551
+ </ span >
552
+ < span theme ="badge filled yellow ">
553
+ < vaadin-icon src ="./assets/lucide-icons/file-text.svg "> </ vaadin-icon >
554
+ </ span >
555
+ </ div >
556
+ </ div >
557
+
383
558
< div class ="component " theme ="surface ">
384
559
< vaadin-radio-group label ="Options ">
385
560
< vaadin-radio-button label ="Option 1 " value ="1 " checked > </ vaadin-radio-button >
@@ -434,6 +609,18 @@ <h6>Heading</h6>
434
609
< vaadin-select label ="Options "> </ vaadin-select >
435
610
</ div >
436
611
612
+ < div class ="component widest tall no-padding " theme ="surface ">
613
+ < vaadin-grid theme ="no-border ">
614
+ < vaadin-grid-selection-column > </ vaadin-grid-selection-column >
615
+ < vaadin-grid-column path ="name "> </ vaadin-grid-column >
616
+ < vaadin-grid-column path ="email "> </ vaadin-grid-column >
617
+ </ vaadin-grid >
618
+ </ div >
619
+
620
+ < div class ="component " theme ="surface ">
621
+ < vaadin-avatar-group > </ vaadin-avatar-group >
622
+ </ div >
623
+
437
624
< div class ="component tall wide column " theme ="surface ">
438
625
< vaadin-message-list > </ vaadin-message-list >
439
626
< vaadin-message-input > </ vaadin-message-input >
@@ -501,7 +688,7 @@ <h3>Edit Theme</h3>
501
688
> </ aura-number-control >
502
689
< aura-font-family-control label ="--aura-font-family "> </ aura-font-family-control >
503
690
< hr />
504
- < vaadin-button theme ="" id ="resetAll ">
691
+ < vaadin-button id ="resetAll ">
505
692
Reset All
506
693
< vaadin-icon icon ="lucide:rotate-ccw "> </ vaadin-icon >
507
694
</ vaadin-button >
0 commit comments