@kompasid/lit-web-components 0.7.8 → 0.8.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.
@@ -43,6 +43,8 @@ export class KompasWidgetRecirculationsDefault extends LitElement {
43
43
  @property({ type: String }) titleName = '' // contoh: Artikel Terkait / Lainnya dalam 'kategori'
44
44
  @property({ type: String }) titleLink = '' // contoh: /kategori/opini
45
45
 
46
+ @property({ type: Boolean }) isDark = false
47
+
46
48
  /**
47
49
  * Fetch Data
48
50
  */
@@ -172,7 +174,12 @@ export class KompasWidgetRecirculationsDefault extends LitElement {
172
174
  return html`
173
175
  <div class="flex font-sans uppercase items-start mb-6 mt-8">
174
176
  <div>
175
- <h5 class="capitalize font-bold font-sans text-grey-600">
177
+ <h5
178
+ class="capitalize font-bold font-sans text-lg md:text-xl ${this
179
+ .isDark
180
+ ? 'text-white'
181
+ : 'text-grey-600'}"
182
+ >
176
183
  Artikel Terkait
177
184
  </h5>
178
185
  </div>
@@ -186,7 +193,11 @@ export class KompasWidgetRecirculationsDefault extends LitElement {
186
193
  href="${this.titleLink}"
187
194
  class="flex font-sans uppercase items-start mb-6 mt-8"
188
195
  >
189
- <h5 class="capitalize font-bold font-sans text-brand-1">
196
+ <h5
197
+ class="capitalize font-bold font-sans text-lg md:text-xl ${this.isDark
198
+ ? 'text-blue-200'
199
+ : 'text-brand-1'}"
200
+ >
190
201
  ${this.titleName}
191
202
  </h5>
192
203
  </a>
@@ -253,7 +264,7 @@ export class KompasWidgetRecirculationsDefault extends LitElement {
253
264
 
254
265
  render() {
255
266
  return html`
256
- <div class="w-full">
267
+ <div class="w-full ${this.isDark ? 'bg-dark-5 ' : ''}">
257
268
  <!-- start: widget title -->
258
269
  ${this.type === 'relatedArticle'
259
270
  ? this.titleRelatedArticle()
@@ -273,11 +284,18 @@ export class KompasWidgetRecirculationsDefault extends LitElement {
273
284
  <a href="${post.permalink}">
274
285
  ${this.renderChips(post)}
275
286
  <h5
276
- class="hover:underline font-bold font-sans leading-tight text-grey-600"
287
+ class="hover:underline font-bold font-sans leading-tight text-lg md:text-xl ${this
288
+ .isDark
289
+ ? 'text-white'
290
+ : 'text-grey-600'}"
277
291
  >
278
292
  ${post.title}
279
293
  </h5>
280
- <p class="text-grey-600 pt-2">
294
+ <p
295
+ class="font-sans pt-2 text-sm ${this.isDark
296
+ ? 'text-white'
297
+ : 'text-grey-600'}"
298
+ >
281
299
  ${this.formatDate(post.publishedDate)}
282
300
  </p>
283
301
  </a>
@@ -302,11 +320,18 @@ export class KompasWidgetRecirculationsDefault extends LitElement {
302
320
  <a href="${post.permalink}">
303
321
  ${this.renderChips(post)}
304
322
  <h5
305
- class="hover:underline font-bold font-sans leading-tight text-grey-600"
323
+ class="hover:underline font-bold font-sans leading-tight text-lg md:text-xl ${this
324
+ .isDark
325
+ ? 'text-white'
326
+ : 'text-grey-600'}"
306
327
  >
307
328
  ${post.title}
308
329
  </h5>
309
- <p class="text-grey-600 pt-2">
330
+ <p
331
+ class="font-sans pt-2 text-sm ${this.isDark
332
+ ? 'text-white'
333
+ : 'text-grey-600'}"
334
+ >
310
335
  ${this.formatDate(post.publishedDate)}
311
336
  </p>
312
337
  </a>
@@ -25,6 +25,8 @@ export class KompasWidgetRecirculationsList extends LitElement {
25
25
  @property({ type: String }) accessToken = ''
26
26
  @property({ type: String }) apiSlug = ''
27
27
 
28
+ @property({ type: Boolean }) isDark = false
29
+
28
30
  static styles = [
29
31
  css`
30
32
  :host {
@@ -190,9 +192,14 @@ export class KompasWidgetRecirculationsList extends LitElement {
190
192
 
191
193
  render() {
192
194
  return html`
193
- <div>
195
+ <div class="${this.isDark ? 'bg-dark-5 ' : ''}">
194
196
  <div class="mb-6">
195
- <h5 class="capitalize font-bold text-grey-600 font-sans">
197
+ <h5
198
+ class="capitalize font-bold font-sans text-lg md:text-xl ${this
199
+ .isDark
200
+ ? 'text-white'
201
+ : 'text-grey-600'}"
202
+ >
196
203
  ${this.widgetTitle}
197
204
  </h5>
198
205
  </div>
@@ -207,12 +214,18 @@ export class KompasWidgetRecirculationsList extends LitElement {
207
214
  ${this.renderChips(item)}
208
215
  <a
209
216
  href="${item.permalink}"
210
- class="font-bold font-sans hover:underline leading-tight text-base text-grey-600"
217
+ class="font-bold font-lora hover:underline leading-normal text-xl ${this
218
+ .isDark
219
+ ? 'text-white'
220
+ : 'text-grey-600'}"
211
221
  >
212
222
  ${item.title}
213
223
  </a>
214
224
  <div
215
- class="flex w-full flex-row items-center leading-normal justify-between text-sm text-grey-500 font-sans pt-2"
225
+ class="flex w-full flex-row font-sans items-center leading-normal justify-between pt-2 text-sm ${this
226
+ .isDark
227
+ ? 'text-white'
228
+ : 'text-grey-500'}"
216
229
  >
217
230
  ${item.publishedDate
218
231
  ? this.formatDate(item.publishedDate)
@@ -590,10 +590,6 @@ video {
590
590
  top: 0px;
591
591
  }
592
592
 
593
- .bottom-6 {
594
- bottom: 1.5rem;
595
- }
596
-
597
593
  .z-0 {
598
594
  z-index: 0;
599
595
  }
@@ -657,16 +653,6 @@ video {
657
653
  margin-bottom: 1.5rem;
658
654
  }
659
655
 
660
- .my-2 {
661
- margin-top: 0.5rem;
662
- margin-bottom: 0.5rem;
663
- }
664
-
665
- .my-3 {
666
- margin-top: 0.75rem;
667
- margin-bottom: 0.75rem;
668
- }
669
-
670
656
  .-ml-2 {
671
657
  margin-left: -0.5rem;
672
658
  }
@@ -1008,14 +994,6 @@ video {
1008
994
  max-width: 20rem;
1009
995
  }
1010
996
 
1011
- .max-w-lg {
1012
- max-width: 32rem;
1013
- }
1014
-
1015
- .max-w-md {
1016
- max-width: 28rem;
1017
- }
1018
-
1019
997
  .flex-none {
1020
998
  flex: none;
1021
999
  }
@@ -1679,6 +1657,11 @@ video {
1679
1657
  line-height: 1.25rem;
1680
1658
  }
1681
1659
 
1660
+ .text-xl {
1661
+ font-size: 1.25rem;
1662
+ line-height: 1.75rem;
1663
+ }
1664
+
1682
1665
  .text-xs {
1683
1666
  font-size: 0.75rem;
1684
1667
  line-height: 1rem;
@@ -1759,6 +1742,11 @@ video {
1759
1742
  color: rgb(0 0 0 / var(--tw-text-opacity));
1760
1743
  }
1761
1744
 
1745
+ .text-blue-200 {
1746
+ --tw-text-opacity: 1;
1747
+ color: rgb(147 200 253 / var(--tw-text-opacity));
1748
+ }
1749
+
1762
1750
  .text-blue-300 {
1763
1751
  --tw-text-opacity: 1;
1764
1752
  color: rgb(90 171 252 / var(--tw-text-opacity));
@@ -1907,6 +1895,11 @@ video {
1907
1895
  margin-right: 0px;
1908
1896
  }
1909
1897
 
1898
+ .md\:my-3 {
1899
+ margin-top: 0.75rem;
1900
+ margin-bottom: 0.75rem;
1901
+ }
1902
+
1910
1903
  .md\:my-8 {
1911
1904
  margin-top: 2rem;
1912
1905
  margin-bottom: 2rem;
@@ -1917,16 +1910,6 @@ video {
1917
1910
  margin-bottom: auto;
1918
1911
  }
1919
1912
 
1920
- .md\:my-3 {
1921
- margin-top: 0.75rem;
1922
- margin-bottom: 0.75rem;
1923
- }
1924
-
1925
- .md\:my-10 {
1926
- margin-top: 2.5rem;
1927
- margin-bottom: 2.5rem;
1928
- }
1929
-
1930
1913
  .md\:mb-0 {
1931
1914
  margin-bottom: 0px;
1932
1915
  }
@@ -1951,6 +1934,14 @@ video {
1951
1934
  margin-top: 0px;
1952
1935
  }
1953
1936
 
1937
+ .md\:mt-2 {
1938
+ margin-top: 0.5rem;
1939
+ }
1940
+
1941
+ .md\:mt-2\.5 {
1942
+ margin-top: 0.625rem;
1943
+ }
1944
+
1954
1945
  .md\:mt-3 {
1955
1946
  margin-top: 0.75rem;
1956
1947
  }
@@ -1963,22 +1954,6 @@ video {
1963
1954
  margin-top: 2rem;
1964
1955
  }
1965
1956
 
1966
- .md\:mt-2 {
1967
- margin-top: 0.5rem;
1968
- }
1969
-
1970
- .md\:mt-1 {
1971
- margin-top: 0.25rem;
1972
- }
1973
-
1974
- .md\:mt-10 {
1975
- margin-top: 2.5rem;
1976
- }
1977
-
1978
- .md\:mt-2\.5 {
1979
- margin-top: 0.625rem;
1980
- }
1981
-
1982
1957
  .md\:block {
1983
1958
  display: block;
1984
1959
  }
@@ -2076,6 +2051,10 @@ video {
2076
2051
  max-width: 200px;
2077
2052
  }
2078
2053
 
2054
+ .md\:max-w-\[464px\] {
2055
+ max-width: 464px;
2056
+ }
2057
+
2079
2058
  .md\:max-w-full {
2080
2059
  max-width: 100%;
2081
2060
  }
@@ -2084,10 +2063,6 @@ video {
2084
2063
  max-width: 24rem;
2085
2064
  }
2086
2065
 
2087
- .md\:max-w-\[464px\] {
2088
- max-width: 464px;
2089
- }
2090
-
2091
2066
  .md\:grid-cols-1 {
2092
2067
  grid-template-columns: repeat(1, minmax(0, 1fr));
2093
2068
  }
@@ -2154,18 +2129,18 @@ video {
2154
2129
  margin-bottom: calc(0px * var(--tw-space-y-reverse));
2155
2130
  }
2156
2131
 
2157
- .md\:space-y-4 > :not([hidden]) ~ :not([hidden]) {
2158
- --tw-space-y-reverse: 0;
2159
- margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
2160
- margin-bottom: calc(1rem * var(--tw-space-y-reverse));
2161
- }
2162
-
2163
2132
  .md\:space-y-1 > :not([hidden]) ~ :not([hidden]) {
2164
2133
  --tw-space-y-reverse: 0;
2165
2134
  margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
2166
2135
  margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
2167
2136
  }
2168
2137
 
2138
+ .md\:space-y-4 > :not([hidden]) ~ :not([hidden]) {
2139
+ --tw-space-y-reverse: 0;
2140
+ margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
2141
+ margin-bottom: calc(1rem * var(--tw-space-y-reverse));
2142
+ }
2143
+
2169
2144
  .md\:self-start {
2170
2145
  align-self: flex-start;
2171
2146
  }
@@ -2235,11 +2210,6 @@ video {
2235
2210
  padding-bottom: 0.5rem;
2236
2211
  }
2237
2212
 
2238
- .md\:py-6 {
2239
- padding-top: 1.5rem;
2240
- padding-bottom: 1.5rem;
2241
- }
2242
-
2243
2213
  .md\:py-3 {
2244
2214
  padding-top: 0.75rem;
2245
2215
  padding-bottom: 0.75rem;
@@ -2250,14 +2220,9 @@ video {
2250
2220
  padding-bottom: 0.875rem;
2251
2221
  }
2252
2222
 
2253
- .md\:py-4 {
2254
- padding-top: 1rem;
2255
- padding-bottom: 1rem;
2256
- }
2257
-
2258
- .md\:py-10 {
2259
- padding-top: 2.5rem;
2260
- padding-bottom: 2.5rem;
2223
+ .md\:py-6 {
2224
+ padding-top: 1.5rem;
2225
+ padding-bottom: 1.5rem;
2261
2226
  }
2262
2227
 
2263
2228
  .md\:pb-4 {
@@ -2276,24 +2241,12 @@ video {
2276
2241
  padding-top: 0.75rem;
2277
2242
  }
2278
2243
 
2279
- .md\:pt-8 {
2280
- padding-top: 2rem;
2281
- }
2282
-
2283
- .md\:pt-4 {
2284
- padding-top: 1rem;
2285
- }
2286
-
2287
- .md\:pt-2 {
2288
- padding-top: 0.5rem;
2289
- }
2290
-
2291
2244
  .md\:pt-5 {
2292
2245
  padding-top: 1.25rem;
2293
2246
  }
2294
2247
 
2295
- .md\:pt-6 {
2296
- padding-top: 1.5rem;
2248
+ .md\:pt-8 {
2249
+ padding-top: 2rem;
2297
2250
  }
2298
2251
 
2299
2252
  .md\:text-left {
@@ -2369,14 +2322,6 @@ video {
2369
2322
  margin-top: 0px;
2370
2323
  }
2371
2324
 
2372
- .lg\:mt-2 {
2373
- margin-top: 0.5rem;
2374
- }
2375
-
2376
- .lg\:mt-1 {
2377
- margin-top: 0.25rem;
2378
- }
2379
-
2380
2325
  .lg\:block {
2381
2326
  display: block;
2382
2327
  }
@@ -2480,12 +2425,6 @@ video {
2480
2425
  }
2481
2426
 
2482
2427
  @media (min-width: 1280px) {
2483
- .xl\:space-y-1 > :not([hidden]) ~ :not([hidden]) {
2484
- --tw-space-y-reverse: 0;
2485
- margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
2486
- margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
2487
- }
2488
-
2489
2428
  .xl\:px-0 {
2490
2429
  padding-left: 0px;
2491
2430
  padding-right: 0px;