@kompasid/lit-web-components 0.6.4 → 0.6.7

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.
Files changed (25) hide show
  1. package/assets/kompas-free-trial.png +0 -0
  2. package/assets/qr-code.png +0 -0
  3. package/demo/index.html +2 -2
  4. package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.js +2 -2
  5. package/dist/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.js.map +1 -1
  6. package/dist/src/components/kompasid-metered-wall-register/KompasMeteredWallRegister.js +8 -8
  7. package/dist/src/components/kompasid-metered-wall-register/KompasMeteredWallRegister.js.map +1 -1
  8. package/dist/src/components/kompasid-paywall/KompasPaywall.js +2 -0
  9. package/dist/src/components/kompasid-paywall/KompasPaywall.js.map +1 -1
  10. package/dist/src/components/kompasid-paywall/types.d.ts +1 -0
  11. package/dist/src/components/kompasid-paywall/types.js.map +1 -1
  12. package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.d.ts +4 -0
  13. package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js +130 -0
  14. package/dist/src/components/kompasid-paywall-body/KompasPaywallBody.js.map +1 -1
  15. package/dist/tailwind/tailwind.js +213 -5
  16. package/dist/tailwind/tailwind.js.map +1 -1
  17. package/dist/tsconfig.tsbuildinfo +1 -1
  18. package/package.json +1 -1
  19. package/src/components/kompasid-header-account-profile/KompasHeaderAccountProfile.ts +2 -2
  20. package/src/components/kompasid-metered-wall-register/KompasMeteredWallRegister.ts +8 -8
  21. package/src/components/kompasid-paywall/KompasPaywall.ts +2 -0
  22. package/src/components/kompasid-paywall/types.ts +1 -0
  23. package/src/components/kompasid-paywall-body/KompasPaywallBody.ts +133 -0
  24. package/tailwind/tailwind.css +213 -5
  25. package/tailwind/tailwind.ts +213 -5
@@ -179,6 +179,10 @@ export class KompasIdPaywallBody extends LitElement {
179
179
  if (this.targetElement.classList.contains('wrapper-body')) {
180
180
  this.togglePaywall()
181
181
  }
182
+
183
+ if (this.targetElement.id === 'freeTrialPopup') {
184
+ this.closeFreeTrialPopup()
185
+ }
182
186
  }
183
187
 
184
188
  private parsePrice(price: string): number {
@@ -930,6 +934,7 @@ export class KompasIdPaywallBody extends LitElement {
930
934
  : this.secondaryPackages(item)
931
935
  )}
932
936
  ${this.swgEnable ? this.swgPackageSection() : nothing}
937
+ ${this.freeTrialPackageSection()} ${this.freeTrialPopUp()}
933
938
  </div>
934
939
  `
935
940
  }
@@ -1053,6 +1058,134 @@ export class KompasIdPaywallBody extends LitElement {
1053
1058
  `
1054
1059
  }
1055
1060
 
1061
+ private openFreeTrialPopup() {
1062
+ const popup = this.shadowRoot?.getElementById('freeTrialPopup')
1063
+ popup?.classList.remove('hidden')
1064
+ }
1065
+
1066
+ private closeFreeTrialPopup() {
1067
+ const popup = this.shadowRoot?.getElementById('freeTrialPopup')
1068
+ popup?.classList.add('hidden')
1069
+ }
1070
+
1071
+ private freeTrialPopUp() {
1072
+ return html`
1073
+ <div
1074
+ id="freeTrialPopup"
1075
+ class="fixed w-full h-full inset-0 flex justify-center items-center z-50 bg-black bg-opacity-75 hidden"
1076
+ >
1077
+ <div
1078
+ class="bg-white rounded w-11/12 sm:w-3/4 md:w-1/2 lg:w-1/3 2xl:w-1/4 p-6 text-center"
1079
+ >
1080
+ <div class="w-full flex justify-end px-2">
1081
+ <button
1082
+ @click=${this.closeFreeTrialPopup}
1083
+ class="w-8 h-8 pl-4 text-grey-400"
1084
+ >
1085
+ ${unsafeSVG(getFontAwesomeIcon('fas', 'xmark', 24, 24))}
1086
+ </button>
1087
+ </div>
1088
+ <div class="w-full flex justify-center">
1089
+ <div class="w-3/4 lg:w-1/2">
1090
+ <img
1091
+ src="https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/web-component/kompas-free-trial.png"
1092
+ alt="Free Trial"
1093
+ />
1094
+ </div>
1095
+ </div>
1096
+ <p class="font-bold text-lg text-grey-600 mt-4">
1097
+ Coba Gratis Kompas.id di Aplikasi
1098
+ </p>
1099
+ <div
1100
+ class="hidden lg:block lg:flex flex border border-grey-300 rounded mt-4 px-8 py-4 items-center"
1101
+ >
1102
+ <div class="w-1/3 flex mr-6">
1103
+ <img
1104
+ src="https://kompasid-production-www.s3.ap-southeast-1.amazonaws.com/web-component/free-trial-qr-code.png"
1105
+ alt="QR Code Deep Link"
1106
+ />
1107
+ </div>
1108
+ <div class="w-2/3 text-base text-grey-600 text-left">
1109
+ Coba gratis 3 hari Kompas.id melalui aplikasi. Pindai kode QR
1110
+ dengan ponsel atau tablet untuk mengunduh aplikasi.
1111
+ </div>
1112
+ </div>
1113
+ <div
1114
+ class="text-base text-grey-600 text-center lg:hidden px-2 md:px-8"
1115
+ >
1116
+ Dapatkan akses gratis selama 3 hari ke konten dan fitur premium
1117
+ Kompas.id di aplikasi.
1118
+ </div>
1119
+ <div class="lg:flex flex justify-center mt-4 hidden lg:block gap-4">
1120
+ <a
1121
+ href="https://play.google.com/store/apps/details?id=id.kompas.app"
1122
+ target="_blank"
1123
+ ><img
1124
+ src="https://cdn-www.kompas.id/halaman-unduh/image/google-play-badge.png"
1125
+ alt="Google Play Badge"
1126
+ /></a>
1127
+ <a
1128
+ href="https://apps.apple.com/id/app/kompas-id/id1242195037?l=id"
1129
+ target="_blank"
1130
+ ><img
1131
+ src="https://cdn-www.kompas.id/halaman-unduh/image/ios-badge.png"
1132
+ alt="iOS App Store Badge"
1133
+ /></a>
1134
+ </div>
1135
+ <button
1136
+ onclick="window.open('https://app.komp.as/langganan', '_blank')"
1137
+ class="h-12 bg-green-500 rounded-md mt-4 flex w-full items-center justify-center lg:hidden"
1138
+ >
1139
+ <h6 class="text-white font-bold p-4">Unduh Sekarang</h6>
1140
+ </button>
1141
+ </div>
1142
+ </div>
1143
+ `
1144
+ }
1145
+
1146
+ private freeTrialPackageSection() {
1147
+ const packages = this.paywallData?.packages ?? ({} as Packages)
1148
+
1149
+ if (packages.freeTrial) {
1150
+ return html`
1151
+ <div
1152
+ class="flex flex-wrap items-center justify-between ${this.isDark
1153
+ ? 'bg-grey-600'
1154
+ : 'bg-white'} py-3 px-4 rounded-lg md:mx-0 w-full h-[68px] max-w-xs md:max-w-sm md:w-3/5 mt-3 md:mt-4"
1155
+ >
1156
+ <div class="flex flex-col">
1157
+ <div class="flex items-center">
1158
+ <h5 class="text-base md:text-lg font-bold text-orange-400">
1159
+ ${formatRupiah(0)}
1160
+ </h5>
1161
+ </div>
1162
+ <div class="flex items-center">
1163
+ <p
1164
+ class="text-xs ${this.isDark ? 'text-dark-7' : 'text-grey-600'}"
1165
+ >
1166
+ ${packages.freeTrial}
1167
+ </p>
1168
+ </div>
1169
+ </div>
1170
+ <button
1171
+ @click=${this.openFreeTrialPopup}
1172
+ class="h-8 ${!this.isDark &&
1173
+ 'bg-white'} border border-green-500 rounded"
1174
+ >
1175
+ <h6
1176
+ class="text-xs md:text-sm ${this.isDark
1177
+ ? 'text-green-300'
1178
+ : 'text-green-500'} font-bold px-4"
1179
+ >
1180
+ Coba Gratis
1181
+ </h6>
1182
+ </button>
1183
+ </div>
1184
+ `
1185
+ }
1186
+ return nothing
1187
+ }
1188
+
1056
1189
  /**
1057
1190
  * Render Statement
1058
1191
  */
@@ -725,6 +725,10 @@ video {
725
725
  margin-right: 2.5rem;
726
726
  }
727
727
 
728
+ .mr-2 {
729
+ margin-right: 0.5rem;
730
+ }
731
+
728
732
  .mr-3 {
729
733
  margin-right: 0.75rem;
730
734
  }
@@ -765,6 +769,10 @@ video {
765
769
  margin-top: 2rem;
766
770
  }
767
771
 
772
+ .mr-6 {
773
+ margin-right: 1.5rem;
774
+ }
775
+
768
776
  .block {
769
777
  display: block;
770
778
  }
@@ -858,6 +866,18 @@ video {
858
866
  height: max-content;
859
867
  }
860
868
 
869
+ .h-12 {
870
+ height: 3rem;
871
+ }
872
+
873
+ .w-1\/2 {
874
+ width: 50%;
875
+ }
876
+
877
+ .w-1\/4 {
878
+ width: 25%;
879
+ }
880
+
861
881
  .w-1\/5 {
862
882
  width: 20%;
863
883
  }
@@ -914,6 +934,10 @@ video {
914
934
  width: 2rem;
915
935
  }
916
936
 
937
+ .w-80 {
938
+ width: 20rem;
939
+ }
940
+
917
941
  .w-9 {
918
942
  width: 2.25rem;
919
943
  }
@@ -942,6 +966,30 @@ video {
942
966
  width: 100%;
943
967
  }
944
968
 
969
+ .w-1\/3 {
970
+ width: 33.333333%;
971
+ }
972
+
973
+ .w-3\/4 {
974
+ width: 75%;
975
+ }
976
+
977
+ .w-4\/5 {
978
+ width: 80%;
979
+ }
980
+
981
+ .w-2\/4 {
982
+ width: 50%;
983
+ }
984
+
985
+ .w-2\/3 {
986
+ width: 66.666667%;
987
+ }
988
+
989
+ .w-11\/12 {
990
+ width: 91.666667%;
991
+ }
992
+
945
993
  .max-w-7xl {
946
994
  max-width: 80rem;
947
995
  }
@@ -1089,6 +1137,10 @@ video {
1089
1137
  gap: 2rem;
1090
1138
  }
1091
1139
 
1140
+ .gap-2 {
1141
+ gap: 0.5rem;
1142
+ }
1143
+
1092
1144
  .gap-y-2 {
1093
1145
  row-gap: 0.5rem;
1094
1146
  }
@@ -1359,6 +1411,21 @@ video {
1359
1411
  background-color: rgb(255 220 63 / var(--tw-bg-opacity));
1360
1412
  }
1361
1413
 
1414
+ .bg-red-300 {
1415
+ --tw-bg-opacity: 1;
1416
+ background-color: rgb(247 100 76 / var(--tw-bg-opacity));
1417
+ }
1418
+
1419
+ .bg-red-500 {
1420
+ --tw-bg-opacity: 1;
1421
+ background-color: rgb(208 13 18 / var(--tw-bg-opacity));
1422
+ }
1423
+
1424
+ .bg-red-400 {
1425
+ --tw-bg-opacity: 1;
1426
+ background-color: rgb(243 32 19 / var(--tw-bg-opacity));
1427
+ }
1428
+
1362
1429
  .bg-opacity-75 {
1363
1430
  --tw-bg-opacity: 0.75;
1364
1431
  }
@@ -1373,6 +1440,14 @@ video {
1373
1440
  object-fit: scale-down;
1374
1441
  }
1375
1442
 
1443
+ .p-1 {
1444
+ padding: 0.25rem;
1445
+ }
1446
+
1447
+ .p-1\.5 {
1448
+ padding: 0.375rem;
1449
+ }
1450
+
1376
1451
  .p-2 {
1377
1452
  padding: 0.5rem;
1378
1453
  }
@@ -1389,6 +1464,19 @@ video {
1389
1464
  padding: 1.25rem;
1390
1465
  }
1391
1466
 
1467
+ .p-8 {
1468
+ padding: 2rem;
1469
+ }
1470
+
1471
+ .p-6 {
1472
+ padding: 1.5rem;
1473
+ }
1474
+
1475
+ .px-10 {
1476
+ padding-left: 2.5rem;
1477
+ padding-right: 2.5rem;
1478
+ }
1479
+
1392
1480
  .px-2 {
1393
1481
  padding-left: 0.5rem;
1394
1482
  padding-right: 0.5rem;
@@ -1404,11 +1492,6 @@ video {
1404
1492
  padding-right: 1rem;
1405
1493
  }
1406
1494
 
1407
- .px-5 {
1408
- padding-left: 1.25rem;
1409
- padding-right: 1.25rem;
1410
- }
1411
-
1412
1495
  .px-8 {
1413
1496
  padding-left: 2rem;
1414
1497
  padding-right: 2rem;
@@ -1459,6 +1542,31 @@ video {
1459
1542
  padding-bottom: 5.6px;
1460
1543
  }
1461
1544
 
1545
+ .px-9 {
1546
+ padding-left: 2.25rem;
1547
+ padding-right: 2.25rem;
1548
+ }
1549
+
1550
+ .px-6 {
1551
+ padding-left: 1.5rem;
1552
+ padding-right: 1.5rem;
1553
+ }
1554
+
1555
+ .py-6 {
1556
+ padding-top: 1.5rem;
1557
+ padding-bottom: 1.5rem;
1558
+ }
1559
+
1560
+ .py-12 {
1561
+ padding-top: 3rem;
1562
+ padding-bottom: 3rem;
1563
+ }
1564
+
1565
+ .px-0 {
1566
+ padding-left: 0px;
1567
+ padding-right: 0px;
1568
+ }
1569
+
1462
1570
  .pb-1 {
1463
1571
  padding-bottom: 0.25rem;
1464
1572
  }
@@ -1746,6 +1854,11 @@ video {
1746
1854
  color: rgb(255 255 255 / var(--tw-text-opacity));
1747
1855
  }
1748
1856
 
1857
+ .text-grey-400 {
1858
+ --tw-text-opacity: 1;
1859
+ color: rgb(153 153 153 / var(--tw-text-opacity));
1860
+ }
1861
+
1749
1862
  .underline {
1750
1863
  text-decoration-line: underline;
1751
1864
  }
@@ -1780,6 +1893,18 @@ video {
1780
1893
  }
1781
1894
 
1782
1895
  @media (min-width: 640px) {
1896
+ .sm\:w-1\/2 {
1897
+ width: 50%;
1898
+ }
1899
+
1900
+ .sm\:w-3\/4 {
1901
+ width: 75%;
1902
+ }
1903
+
1904
+ .sm\:w-1\/4 {
1905
+ width: 25%;
1906
+ }
1907
+
1783
1908
  .sm\:max-w-lg {
1784
1909
  max-width: 32rem;
1785
1910
  }
@@ -1918,6 +2043,26 @@ video {
1918
2043
  width: 100%;
1919
2044
  }
1920
2045
 
2046
+ .md\:w-1\/2 {
2047
+ width: 50%;
2048
+ }
2049
+
2050
+ .md\:w-3\/4 {
2051
+ width: 75%;
2052
+ }
2053
+
2054
+ .md\:w-1\/4 {
2055
+ width: 25%;
2056
+ }
2057
+
2058
+ .md\:w-1\/3 {
2059
+ width: 33.333333%;
2060
+ }
2061
+
2062
+ .md\:w-2\/3 {
2063
+ width: 66.666667%;
2064
+ }
2065
+
1921
2066
  .md\:max-w-\[137px\] {
1922
2067
  max-width: 137px;
1923
2068
  }
@@ -2061,6 +2206,11 @@ video {
2061
2206
  padding-bottom: 1.5rem;
2062
2207
  }
2063
2208
 
2209
+ .md\:px-8 {
2210
+ padding-left: 2rem;
2211
+ padding-right: 2rem;
2212
+ }
2213
+
2064
2214
  .md\:pb-4 {
2065
2215
  padding-bottom: 1rem;
2066
2216
  }
@@ -2158,6 +2308,14 @@ video {
2158
2308
  display: block;
2159
2309
  }
2160
2310
 
2311
+ .lg\:flex {
2312
+ display: flex;
2313
+ }
2314
+
2315
+ .lg\:hidden {
2316
+ display: none;
2317
+ }
2318
+
2161
2319
  .lg\:min-h-\[220px\] {
2162
2320
  min-height: 220px;
2163
2321
  }
@@ -2166,6 +2324,26 @@ video {
2166
2324
  width: 410px;
2167
2325
  }
2168
2326
 
2327
+ .lg\:w-1\/2 {
2328
+ width: 50%;
2329
+ }
2330
+
2331
+ .lg\:w-1\/3 {
2332
+ width: 33.333333%;
2333
+ }
2334
+
2335
+ .lg\:w-3\/4 {
2336
+ width: 75%;
2337
+ }
2338
+
2339
+ .lg\:w-2 {
2340
+ width: 0.5rem;
2341
+ }
2342
+
2343
+ .lg\:w-2\/3 {
2344
+ width: 66.666667%;
2345
+ }
2346
+
2169
2347
  .lg\:max-w-7xl {
2170
2348
  max-width: 80rem;
2171
2349
  }
@@ -2236,8 +2414,38 @@ video {
2236
2414
  }
2237
2415
 
2238
2416
  @media (min-width: 1280px) {
2417
+ .xl\:block {
2418
+ display: block;
2419
+ }
2420
+
2421
+ .xl\:flex {
2422
+ display: flex;
2423
+ }
2424
+
2425
+ .xl\:hidden {
2426
+ display: none;
2427
+ }
2428
+
2429
+ .xl\:w-1\/3 {
2430
+ width: 33.333333%;
2431
+ }
2432
+
2433
+ .xl\:w-1\/2 {
2434
+ width: 50%;
2435
+ }
2436
+
2437
+ .xl\:w-1\/4 {
2438
+ width: 25%;
2439
+ }
2440
+
2239
2441
  .xl\:px-0 {
2240
2442
  padding-left: 0px;
2241
2443
  padding-right: 0px;
2242
2444
  }
2243
2445
  }
2446
+
2447
+ @media (min-width: 1536px) {
2448
+ .\32xl\:w-1\/4 {
2449
+ width: 25%;
2450
+ }
2451
+ }