@consent.software/catalog 1.5.4 → 1.6.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.
@@ -42296,32 +42296,6 @@ var ConsentsoftwareCookieconsent = class extends r4 {
42296
42296
  and choose which cookie level you are willing to accept.
42297
42297
  </div>
42298
42298
  </div>
42299
- <!-- <div class="button-container">
42300
- <div
42301
- class="consent-button"
42302
- @click=${(event) => this.handleConsentButtonClick(event, ["functional"])}
42303
- >
42304
- Functional cookies
42305
- </div>
42306
- <div
42307
- class="consent-button"
42308
- @click=${(event) => this.handleConsentButtonClick(event, ["functional", "analytics"])}
42309
- >
42310
- Analytics cookies
42311
- </div>
42312
- <div
42313
- class="consent-button"
42314
- @click=${(event) => this.handleConsentButtonClick(event, ["functional", "analytics", "marketing"])}
42315
- >
42316
- Marketing cookies
42317
- </div>
42318
- <div
42319
- class="consent-button"
42320
- @click=${(event) => this.handleConsentButtonClick(event, ["functional", "analytics", "marketing", "all"])}
42321
- >
42322
- All cookies
42323
- </div>
42324
- </div> -->
42325
42299
  <consentsoftware-mainselection></consentsoftware-mainselection>
42326
42300
  <div class="button-container">
42327
42301
  <div
@@ -42346,7 +42320,6 @@ var ConsentsoftwareCookieconsent = class extends r4 {
42346
42320
  <div class="info-container">
42347
42321
  consent management powered by
42348
42322
  <a href="https://consent.software">consent.software</a>
42349
- (Open Source)
42350
42323
  </div>
42351
42324
  </div>
42352
42325
  </div>
@@ -42354,7 +42327,8 @@ var ConsentsoftwareCookieconsent = class extends r4 {
42354
42327
  `;
42355
42328
  }
42356
42329
  /**
42357
- * Called when the element is inserted into the DOM.
42330
+ * Lifecycle method called when the element is connected to the DOM.
42331
+ * It sets up the theme and displays the consent banner if no cookie levels are set.
42358
42332
  */
42359
42333
  async connectedCallback() {
42360
42334
  super.connectedCallback();
@@ -42379,14 +42353,10 @@ var ConsentsoftwareCookieconsent = class extends r4 {
42379
42353
  this.setAttribute("show", "false");
42380
42354
  }
42381
42355
  }
42382
- /**
42383
- * Called after the first render of the component.
42384
- * We measure the actual height of the banner and update the CSS variable.
42385
- */
42386
42356
  async firstUpdated() {
42387
42357
  }
42388
42358
  /**
42389
- * Called whenever the element is updated or re-rendered.
42359
+ * Called after updates. Logs banner height and runs consent scripts if necessary.
42390
42360
  */
42391
42361
  async updated() {
42392
42362
  console.log(`The height of the cookie banner is ${this.shadowRoot?.host?.clientHeight}px`);
@@ -42397,7 +42367,8 @@ var ConsentsoftwareCookieconsent = class extends r4 {
42397
42367
  }
42398
42368
  }
42399
42369
  /**
42400
- * Sets the user’s chosen cookie level(s) and hides the banner.
42370
+ * Handles consent button clicks, sets cookie levels, and hides the banner.
42371
+ * Uses theme variables for styling transitions.
42401
42372
  */
42402
42373
  async handleConsentButtonClick(event, levelsArg) {
42403
42374
  console.log(`Set level to ${levelsArg}`);
@@ -42416,6 +42387,10 @@ var ConsentsoftwareCookieconsent = class extends r4 {
42416
42387
  this.setAttribute("show", "false");
42417
42388
  this.updated();
42418
42389
  }
42390
+ /**
42391
+ * Handles clicks on the page overlay. If clicked outside the modal,
42392
+ * triggers a shake animation as feedback.
42393
+ */
42419
42394
  async pageOverlayClick(e8) {
42420
42395
  if (e8.target === e8.currentTarget) {
42421
42396
  const pageOverlay = this.shadowRoot?.querySelector(".pageOverlay");
@@ -42430,8 +42405,8 @@ var ConsentsoftwareCookieconsent = class extends r4 {
42430
42405
  }
42431
42406
  }
42432
42407
  /**
42433
- * Dynamically switches the theme between light/dark,
42434
- * respecting `prefers-color-scheme` by default.
42408
+ * Dynamically switches the theme between light and dark.
42409
+ * Listens for system theme changes to update the component's theme.
42435
42410
  */
42436
42411
  updateTheme() {
42437
42412
  const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
@@ -42443,14 +42418,15 @@ var ConsentsoftwareCookieconsent = class extends r4 {
42443
42418
  };
42444
42419
  ConsentsoftwareCookieconsent.demo = () => x`<consentsoftware-cookieconsent></consentsoftware-cookieconsent>`;
42445
42420
  /**
42446
- * We bind `heightPixels` to a CSS variable (--cookieconsent-height).
42447
- * Then we can do margin-bottom animations in CSS.
42421
+ * Define component styles with CSS variables that adjust based on theme.
42422
+ * The default variables serve as baseline for the light theme.
42423
+ * Theme-specific overrides modify these for dark mode.
42448
42424
  */
42449
42425
  ConsentsoftwareCookieconsent.styles = i`
42450
42426
  :host {
42451
42427
  font-family: ${fontStack};
42452
42428
  user-select: none;
42453
- /* Default theme variables */
42429
+ /* Default variables for Light Theme */
42454
42430
  --text-color: #333;
42455
42431
  --background-color: #eeeeee;
42456
42432
  --accent-color: #333333;
@@ -42459,8 +42435,14 @@ ConsentsoftwareCookieconsent.styles = i`
42459
42435
  --icon-color: #4496f5;
42460
42436
  --link-color: #333;
42461
42437
  --padding-sides: 16px;
42438
+ /* Additional variables for modal and info container styling */
42439
+ --info-bg: rgba(0, 0, 0, 0.1);
42440
+ --info-text: rgba(255, 255, 255, 0.5);
42441
+ --modal-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.2);
42462
42442
  }
42463
42443
 
42444
+ /* Dark Theme Overrides:
42445
+ When theme attribute is 'dark', override variables accordingly. */
42464
42446
  :host([theme='dark']) {
42465
42447
  --text-color: #fff;
42466
42448
  --background-color: #111;
@@ -42469,8 +42451,14 @@ ConsentsoftwareCookieconsent.styles = i`
42469
42451
  --button-hover-bg: #222222;
42470
42452
  --icon-color: #4496f5;
42471
42453
  --link-color: #fff;
42454
+ --info-bg: rgba(0, 0, 0, 0.1);
42455
+ --info-text: rgba(255, 255, 255, 0.5);
42456
+ --modal-box-shadow: 0px 0px 8px rgba(255, 255, 255, 0.6);
42472
42457
  }
42473
42458
 
42459
+ /* Light Theme Overrides:
42460
+ Explicit light theme settings, currently matching defaults.
42461
+ Can be customized independently if desired. */
42474
42462
  :host([theme='light']) {
42475
42463
  --text-color: #333;
42476
42464
  --background-color: #eeeeee;
@@ -42479,33 +42467,39 @@ ConsentsoftwareCookieconsent.styles = i`
42479
42467
  --button-hover-bg: #f2f2f2;
42480
42468
  --icon-color: #4496f5;
42481
42469
  --link-color: #333;
42470
+ --info-bg: rgba(0, 0, 0, 0.1);
42471
+ --info-text: rgba(0, 0, 0, 0.5);
42472
+ --modal-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.2);
42482
42473
  }
42483
42474
 
42475
+ /* Overlay covering the page behind the modal */
42484
42476
  .pageOverlay {
42485
42477
  position: fixed;
42486
- top: 0px;
42487
- bottom: 0px;
42488
- right: 0px;
42489
- left: 0px;
42478
+ top: 0;
42479
+ bottom: 0;
42480
+ right: 0;
42481
+ left: 0;
42490
42482
  display: grid;
42491
42483
  align-items: center;
42492
42484
  justify-content: center;
42493
- z-index: 1000; /* standard z-index for fixed elements */
42485
+ z-index: 1000; /* Ensures the overlay is on top of other elements */
42494
42486
  background: rgba(255, 255, 255, 0);
42495
42487
  backdrop-filter: blur(0px);
42496
42488
  transition: all 0.2s;
42497
42489
  }
42498
42490
 
42491
+ /* Shake animation for overlay when clicked */
42499
42492
  .pageOverlay.shake {
42500
42493
  background: rgba(0, 0, 0, 0.5) !important;
42501
42494
  }
42502
42495
 
42496
+ /* Modal box styling using theme variables for colors and shadows */
42503
42497
  .modalBox {
42504
42498
  display: block;
42505
42499
  color: var(--text-color);
42506
42500
  background: var(--background-color);
42507
- box-shadow: 0px 0px 8px rgba(255, 255, 255, 0.6);
42508
- position: realtive;
42501
+ box-shadow: var(--modal-box-shadow);
42502
+ position: relative;
42509
42503
  border: 1px dotted rgba(255, 255, 255, 0.1);
42510
42504
  border-top: 1px solid var(--accent-color);
42511
42505
  border-radius: 16px;
@@ -42513,12 +42507,22 @@ ConsentsoftwareCookieconsent.styles = i`
42513
42507
  min-width: calc(100vw / 3);
42514
42508
  box-sizing: border-box;
42515
42509
  overflow: hidden;
42516
- will-change: transform; /* ensure efficient rendering */
42510
+ will-change: transform;
42517
42511
  transition: all 0.3s;
42518
42512
  transform: scale(0.95);
42519
42513
  opacity: 0;
42520
42514
  }
42521
42515
 
42516
+ /* Media query for mobile devices: stack buttons vertically */
42517
+ @media (max-width: 600px) {
42518
+ .modalBox {
42519
+ height: 100vh;
42520
+ box-shadow: none;
42521
+ border-radius: 0px;
42522
+ }
42523
+ }
42524
+
42525
+ /* Shake animation for modal box */
42522
42526
  .modalBox.shake {
42523
42527
  animation: shake 150ms 2 linear;
42524
42528
  }
@@ -42535,10 +42539,7 @@ ConsentsoftwareCookieconsent.styles = i`
42535
42539
  }
42536
42540
  }
42537
42541
 
42538
- /*
42539
- * Toggle display based on [show] attribute
42540
- * (so if show=false, the banner doesn't show at all).
42541
- */
42542
+ /* Toggle display based on [show] attribute */
42542
42543
  :host([show='false']) {
42543
42544
  display: none;
42544
42545
  }
@@ -42569,25 +42570,14 @@ ConsentsoftwareCookieconsent.styles = i`
42569
42570
  gap: 16px;
42570
42571
  }
42571
42572
 
42572
- .info-container {
42573
- color: var(--text-color);
42574
- text-align: center;
42575
- line-height: 3em;
42576
- background: rgba(0, 0, 0, 0.1);
42577
- border-top: 1px dotted rgba(255, 255, 255, 0.1);
42578
- font-size: 0.8em;
42579
- color: rgba(255, 255, 255, 0.5);
42580
- }
42581
-
42582
- .info-container a {
42583
- text-decoration: underline;
42584
- color: var(--link-color);
42585
- transition: color 0.2s;
42586
- }
42587
- .info-container a:hover {
42588
- color: #ffffff;
42573
+ /* Media query for mobile devices: stack buttons vertically */
42574
+ @media (max-width: 600px) {
42575
+ .button-container {
42576
+ grid-template-columns: 1fr;
42577
+ }
42589
42578
  }
42590
42579
 
42580
+ /* Consent button styling using theme variables */
42591
42581
  .consent-button {
42592
42582
  border-radius: 3px;
42593
42583
  background: var(--button-bg);
@@ -42602,6 +42592,25 @@ ConsentsoftwareCookieconsent.styles = i`
42602
42592
  .consent-button:hover {
42603
42593
  background: var(--button-hover-bg);
42604
42594
  }
42595
+
42596
+ /* Use theme variables for info container background and text */
42597
+ .info-container {
42598
+ text-align: center;
42599
+ line-height: 3em;
42600
+ background: var(--info-bg);
42601
+ border-top: 1px dotted rgba(255, 255, 255, 0.1);
42602
+ font-size: 0.8em;
42603
+ color: var(--info-text);
42604
+ }
42605
+
42606
+ .info-container a {
42607
+ text-decoration: underline;
42608
+ color: var(--link-color);
42609
+ transition: color 0.2s;
42610
+ }
42611
+ .info-container a:hover {
42612
+ color: #ffffff;
42613
+ }
42605
42614
  `;
42606
42615
  __decorateClass([
42607
42616
  n4({ type: String, reflect: true })
@@ -42942,7 +42951,7 @@ var ConsentsoftwareTabs = class extends r4 {
42942
42951
  <div class="tabs">
42943
42952
  <div class="tab" @click=${this.handleClick}>Consent</div>
42944
42953
  <div class="tab" @click=${this.handleClick}>Details</div>
42945
- <div class="tab" @click=${this.handleClick}>Cookie Policy + Legal Info</div>
42954
+ <div class="tab" @click=${this.handleClick}>Cookie Policy</div>
42946
42955
  </div>
42947
42956
  <div class="selector"></div>
42948
42957
  `;
@@ -42978,6 +42987,13 @@ ConsentsoftwareTabs.styles = i`
42978
42987
  cursor: pointer;
42979
42988
  }
42980
42989
 
42990
+ /* Media query for mobile devices: stack buttons vertically */
42991
+ @media (max-width: 600px) {
42992
+ .tabs .tab {
42993
+ font-size: 0.8em;
42994
+ }
42995
+ }
42996
+
42981
42997
  .selector {
42982
42998
  position: absolute;
42983
42999
  width: calc(100% / 3);