@kompasid/lit-web-components 0.9.2 → 0.9.4

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.
@@ -93,7 +93,7 @@ export class KompasMenuSideBar extends LitElement {
93
93
  TWStyles,
94
94
  ]
95
95
  @property({ type: Array }) dataExternal: DataExternalLink[] = []
96
- // @property({ type: Array }) dataSidebar: DataSideBarLink[] = []
96
+ @property({ type: Boolean }) isDark = false
97
97
 
98
98
  async connectedCallback() {
99
99
  super.connectedCallback()
@@ -233,10 +233,12 @@ export class KompasMenuSideBar extends LitElement {
233
233
  html`
234
234
  <div class="flex">
235
235
  <div
236
- class="py-1 px-2 rounded text-xs"
237
- style="position: absolute; top: -22px; right: -24px; display: inline-flex; background-color:#D71920;"
236
+ class="py-0.5 px-1.5 rounded-full"
237
+ style="position: relative; display: inline-flex; background-color:#D71920;"
238
238
  >
239
- <span class="font-normal text-white capitalize">Baru</span>
239
+ <span class="font-bold font-sans text-xs text-white capitalize"
240
+ >Baru</span
241
+ >
240
242
  </div>
241
243
  </div>
242
244
  `
@@ -280,13 +282,21 @@ export class KompasMenuSideBar extends LitElement {
280
282
  class="w-fit flex items-center justify-center cursor-pointer relative"
281
283
  @click=${this.toggleNavSidebar}
282
284
  >
283
- <div class="h-4 inline-flex text-brand-1">
285
+ <div
286
+ class="h-4 inline-flex ${this.isDark
287
+ ? 'text-[#FFFFFF]'
288
+ : 'text-brand-1'}"
289
+ >
284
290
  ${unsafeSVG(getFontAwesomeIcon('fas', 'bars'))}
285
291
  </div>
286
292
  <span
287
- class="font-sans hidden sm:inline ml-2 tracking-wide text-brand-1 font-bold"
288
- >Menu</span
293
+ class="font-sans hidden sm:inline ml-2 tracking-wide font-bold ${this
294
+ .isDark
295
+ ? 'text-[#FFFFFF]'
296
+ : 'text-brand-1'}"
289
297
  >
298
+ Menu
299
+ </span>
290
300
  </div>
291
301
  <!-- Side Menu -->
292
302
  <nav
@@ -301,7 +311,7 @@ export class KompasMenuSideBar extends LitElement {
301
311
  style="width: 312px;"
302
312
  >
303
313
  <div
304
- class="bg-[#e1f0ff] flex flex-col items-center justify-center mb-6 w-full"
314
+ class="bg-[#FFFFFF] flex flex-col items-center justify-center mb-6 w-full"
305
315
  >
306
316
  <div
307
317
  ref="logo-kompas"
@@ -316,7 +326,7 @@ export class KompasMenuSideBar extends LitElement {
316
326
  />
317
327
  </a>
318
328
  <span
319
- class="bg-[#93c8fd] cursor-pointer flex h-10 items-center justify-center rounded text-base w-10 p-4"
329
+ class="bg-[#E1F0FF] text-brand-1 cursor-pointer flex h-10 items-center justify-center rounded text-base w-10 p-4"
320
330
  @click=${this.toggleNavSidebar}
321
331
  >
322
332
  ${unsafeSVG(getFontAwesomeIcon('fa', 'times'))}
@@ -325,26 +335,34 @@ export class KompasMenuSideBar extends LitElement {
325
335
  <div class="flex flex-wrap px-4 w-full">
326
336
  ${this.dataExternal.map(
327
337
  item => html`
328
- <a href="${item.url}" class="block w-1/2 no-underline">
329
- <div class="cursor-pointer flex items-center pb-6 w-full">
330
- <div class="flex mr-2">
331
- ${item.icon &&
332
- Array.isArray(item.icon) &&
333
- item.icon.length >= 2
334
- ? unsafeSVG(
335
- getFontAwesomeIcon(item.icon[0], item.icon[1])
336
- )
337
- : ''}
338
- </div>
339
- <span class="font-sans relative text-sm text-brand-1">
340
- ${item.name} ${item.isNew ? this.renderChips() : ''}
338
+ <a href="${item.url}" class="flex w-1/2 no-underline">
339
+ <div
340
+ class="cursor-pointer flex items-center pb-4 w-[312px]"
341
+ >
342
+ ${item.icon &&
343
+ Array.isArray(item.icon) &&
344
+ item.icon.length >= 2
345
+ ? html`
346
+ <div class="flex mr-2 text-brand-1">
347
+ ${unsafeSVG(
348
+ getFontAwesomeIcon(item.icon[0], item.icon[1])
349
+ )}
350
+ </div>
351
+ `
352
+ : ''}
353
+ <span class="font-sans relative text-xs text-[#666666]">
354
+ ${item.name}
341
355
  </span>
356
+ <div class="ml-1">
357
+ ${item.isNew ? this.renderChips() : ''}
358
+ </div>
342
359
  </div>
343
360
  </a>
344
361
  `
345
362
  )}
346
363
  </div>
347
364
  </div>
365
+ <div class="border-b border-[#DDD] m-6 "></div>
348
366
  <!-- feature -->
349
367
  <div class="flex">
350
368
  <div class="flex justify-between flex-col">
@@ -361,7 +379,8 @@ export class KompasMenuSideBar extends LitElement {
361
379
  >
362
380
  <div class="flex items-center space-x-3">
363
381
  <span
364
- class="text-xl text-brand-1 w-8 h-8 flex items-center"
382
+ class="text-xl text-brand-1 h-8 flex items-center
383
+ ${item.icon === null ? 'w-6' : 'max-w-max w-8'}"
365
384
  >
366
385
  ${item.icon &&
367
386
  Array.isArray(item.icon) &&
@@ -389,7 +408,7 @@ export class KompasMenuSideBar extends LitElement {
389
408
  ${this.hasChildren(item)
390
409
  ? html`
391
410
  <span
392
- class="text-xs bg-[#e1f0ff] flex justify-center items-center rounded my-1 p-4 w-10 h-10 cursor-pointer"
411
+ class="text-xs text-brand-1 bg-[#e1f0ff] flex justify-center items-center rounded my-1 p-4 w-10 h-10 cursor-pointer"
393
412
  @click=${(e: Event) => {
394
413
  e.stopPropagation() // Prevents click from bubbling to parent
395
414
  this.toggleChildren(item)
@@ -414,7 +433,7 @@ export class KompasMenuSideBar extends LitElement {
414
433
  ${item.children.map(
415
434
  child => html`
416
435
  <div
417
- class="flex items-center text-sm text-gray-600 px-4 cursor-pointer transition-all"
436
+ class="flex items-center text-sm text-[#333] px-4 cursor-pointer transition-all"
418
437
  @click=${() => this.rubricClicked(child)}
419
438
  >
420
439
  <div
@@ -451,7 +470,7 @@ export class KompasMenuSideBar extends LitElement {
451
470
  <div class="w-full font-sans">
452
471
  <!-- Parent item -->
453
472
  <div
454
- class="flex items-center justify-between text-sm font-medium text-gray-700 px-4 transition-all cursor-pointer"
473
+ class="flex items-center justify-between text-sm font-medium px-4 transition-all cursor-pointer"
455
474
  @click=${(e: Event) => this.rubricClicked(item, e)}
456
475
  >
457
476
  <div
@@ -459,7 +478,7 @@ export class KompasMenuSideBar extends LitElement {
459
478
  >
460
479
  <div class="flex items-center space-x-3">
461
480
  <span
462
- class="text-xl text-brand-1 w-8 h-8 flex items-center"
481
+ class="text-xl text-brand-1 max-w-max w-8 h-8 flex items-center"
463
482
  >
464
483
  ${item.icon &&
465
484
  Array.isArray(item.icon) &&
@@ -491,7 +510,7 @@ export class KompasMenuSideBar extends LitElement {
491
510
  ${this.hasChildren(item)
492
511
  ? html`
493
512
  <span
494
- class="text-xs bg-[#e1f0ff] flex justify-center items-center rounded my-1 p-4 w-10 h-10 cursor-pointer"
513
+ class="text-xs bg-[#e1f0ff] flex justify-center items-center rounded my-1 p-4 w-10 h-10 cursor-pointer font-bold text-brand-1"
495
514
  @click=${(e: Event) => {
496
515
  e.stopPropagation() // Prevents click from bubbling to parent
497
516
  this.toggleChildren(item)
@@ -516,7 +535,7 @@ export class KompasMenuSideBar extends LitElement {
516
535
  ${item.children.map(
517
536
  child => html`
518
537
  <div
519
- class="flex items-center text-sm text-gray-600 px-4 cursor-pointer transition-all"
538
+ class="flex items-center text-sm text-[#333] px-4 cursor-pointer transition-all"
520
539
  @click=${() => this.rubricClicked(child)}
521
540
  >
522
541
  <div
@@ -0,0 +1,27 @@
1
+ # kompasid-menu-side-bar
2
+
3
+ Komponen ini adalah komponen web berbasis LitElement yang digunakan untuk menampilkan Menu Side Bar pada Kompas.id
4
+
5
+ ### Contoh Implementasi
6
+
7
+ ```javascript
8
+ <kompasid-menu-side-bar></kompasid-menu-side-bar> // if theme = primary/default
9
+ <kompasid-menu-side-bar
10
+ .isDark="true" // if theme = dark/transparent
11
+ ></kompasid-menu-side-bar>
12
+
13
+ ```
14
+
15
+ ## Properties
16
+
17
+ | Property | Attribute | Description | Tipe | Default | Content |
18
+ | -------------| -------------| ----------------------------------------------- | -------- | ------- | ---------------- |
19
+ | `isDark`| `isDark`| Pilihan Tema untuk tampilan Burger Menu. | `boolean` | `false` | `''` |
20
+
21
+ ### Digunakan oleh
22
+
23
+ - [kompasid-menu-side-bar](../kompasid-menu-side-bar)
24
+
25
+ ## Kontributor
26
+
27
+ *Dokumentasi ini dibuat oleh tim front-end Kompas.id.*
@@ -798,6 +798,14 @@ video {
798
798
  margin-top: 2rem;
799
799
  }
800
800
 
801
+ .ml-\[6px\] {
802
+ margin-left: 6px;
803
+ }
804
+
805
+ .ml-1\.5 {
806
+ margin-left: 0.375rem;
807
+ }
808
+
801
809
  .block {
802
810
  display: block;
803
811
  }
@@ -1028,10 +1036,23 @@ video {
1028
1036
  width: 100vw;
1029
1037
  }
1030
1038
 
1039
+ .w-\[312px\] {
1040
+ width: 312px;
1041
+ }
1042
+
1043
+ .w-2\.5 {
1044
+ width: 0.625rem;
1045
+ }
1046
+
1031
1047
  .max-w-7xl {
1032
1048
  max-width: 80rem;
1033
1049
  }
1034
1050
 
1051
+ .max-w-max {
1052
+ max-width: -moz-max-content;
1053
+ max-width: max-content;
1054
+ }
1055
+
1035
1056
  .max-w-screen-md {
1036
1057
  max-width: 768px;
1037
1058
  }
@@ -1398,6 +1419,11 @@ video {
1398
1419
  background-color: rgb(147 200 253 / var(--tw-bg-opacity));
1399
1420
  }
1400
1421
 
1422
+ .bg-\[\#FFFFFF\] {
1423
+ --tw-bg-opacity: 1;
1424
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
1425
+ }
1426
+
1401
1427
  .bg-\[\#e1f0ff\] {
1402
1428
  --tw-bg-opacity: 1;
1403
1429
  background-color: rgb(225 240 255 / var(--tw-bg-opacity));
@@ -1508,6 +1534,11 @@ video {
1508
1534
  background-color: rgb(255 220 63 / var(--tw-bg-opacity));
1509
1535
  }
1510
1536
 
1537
+ .bg-\[\#E1F0FF\] {
1538
+ --tw-bg-opacity: 1;
1539
+ background-color: rgb(225 240 255 / var(--tw-bg-opacity));
1540
+ }
1541
+
1511
1542
  .bg-opacity-75 {
1512
1543
  --tw-bg-opacity: 0.75;
1513
1544
  }
@@ -1635,6 +1666,16 @@ video {
1635
1666
  padding-bottom: 5.6px;
1636
1667
  }
1637
1668
 
1669
+ .px-1 {
1670
+ padding-left: 0.25rem;
1671
+ padding-right: 0.25rem;
1672
+ }
1673
+
1674
+ .px-1\.5 {
1675
+ padding-left: 0.375rem;
1676
+ padding-right: 0.375rem;
1677
+ }
1678
+
1638
1679
  .pb-1 {
1639
1680
  padding-bottom: 0.25rem;
1640
1681
  }
@@ -1986,6 +2027,11 @@ video {
1986
2027
  color: rgb(255 255 255 / var(--tw-text-opacity));
1987
2028
  }
1988
2029
 
2030
+ .text-\[\#666666\] {
2031
+ --tw-text-opacity: 1;
2032
+ color: rgb(102 102 102 / var(--tw-text-opacity));
2033
+ }
2034
+
1989
2035
  .underline {
1990
2036
  text-decoration-line: underline;
1991
2037
  }
@@ -808,6 +808,14 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
808
808
  margin-top: 2rem;
809
809
  }
810
810
 
811
+ .ml-\\[6px\\] {
812
+ margin-left: 6px;
813
+ }
814
+
815
+ .ml-1\\.5 {
816
+ margin-left: 0.375rem;
817
+ }
818
+
811
819
  .block {
812
820
  display: block;
813
821
  }
@@ -1038,10 +1046,23 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
1038
1046
  width: 100vw;
1039
1047
  }
1040
1048
 
1049
+ .w-\\[312px\\] {
1050
+ width: 312px;
1051
+ }
1052
+
1053
+ .w-2\\.5 {
1054
+ width: 0.625rem;
1055
+ }
1056
+
1041
1057
  .max-w-7xl {
1042
1058
  max-width: 80rem;
1043
1059
  }
1044
1060
 
1061
+ .max-w-max {
1062
+ max-width: -moz-max-content;
1063
+ max-width: max-content;
1064
+ }
1065
+
1045
1066
  .max-w-screen-md {
1046
1067
  max-width: 768px;
1047
1068
  }
@@ -1412,6 +1433,11 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
1412
1433
  background-color: rgb(147 200 253 / var(--tw-bg-opacity));
1413
1434
  }
1414
1435
 
1436
+ .bg-\\[\\#FFFFFF\\] {
1437
+ --tw-bg-opacity: 1;
1438
+ background-color: rgb(255 255 255 / var(--tw-bg-opacity));
1439
+ }
1440
+
1415
1441
  .bg-\\[\\#e1f0ff\\] {
1416
1442
  --tw-bg-opacity: 1;
1417
1443
  background-color: rgb(225 240 255 / var(--tw-bg-opacity));
@@ -1522,6 +1548,11 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
1522
1548
  background-color: rgb(255 220 63 / var(--tw-bg-opacity));
1523
1549
  }
1524
1550
 
1551
+ .bg-\\[\\#E1F0FF\\] {
1552
+ --tw-bg-opacity: 1;
1553
+ background-color: rgb(225 240 255 / var(--tw-bg-opacity));
1554
+ }
1555
+
1525
1556
  .bg-opacity-75 {
1526
1557
  --tw-bg-opacity: 0.75;
1527
1558
  }
@@ -1649,6 +1680,16 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
1649
1680
  padding-bottom: 5.6px;
1650
1681
  }
1651
1682
 
1683
+ .px-1 {
1684
+ padding-left: 0.25rem;
1685
+ padding-right: 0.25rem;
1686
+ }
1687
+
1688
+ .px-1\\.5 {
1689
+ padding-left: 0.375rem;
1690
+ padding-right: 0.375rem;
1691
+ }
1692
+
1652
1693
  .pb-1 {
1653
1694
  padding-bottom: 0.25rem;
1654
1695
  }
@@ -2003,6 +2044,11 @@ Constrain images and videos to the parent width and preserve their intrinsic asp
2003
2044
  color: rgb(255 255 255 / var(--tw-text-opacity));
2004
2045
  }
2005
2046
 
2047
+ .text-\\[\\#666666\\] {
2048
+ --tw-text-opacity: 1;
2049
+ color: rgb(102 102 102 / var(--tw-text-opacity));
2050
+ }
2051
+
2006
2052
  .underline {
2007
2053
  text-decoration-line: underline;
2008
2054
  }