Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
6e6f5273a2 | |||
1e091ec600 | |||
fb15f62189 | |||
f5d9f05bf2 | |||
8bc25e1045 | |||
d3b74d5766 | |||
cdaaebde42 | |||
45f9f6f891 | |||
37c48a6803 | |||
b4b01cc319 | |||
443122cff3 | |||
7d137c9dd5 |
34
changelog.md
34
changelog.md
@ -1,5 +1,39 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-01-16 - 1.3.5 - fix(elements)
|
||||
Improved styling consistency across several components
|
||||
|
||||
- Increased box-shadow intensity for better visual separation
|
||||
- Changed border-bottom styles to use dotted lines for consistency
|
||||
- Adjusted line-height for better vertical spacing
|
||||
- Fixed border-right gradient on itemBox for better styling
|
||||
|
||||
## 2025-01-14 - 1.3.4 - fix(dependencies)
|
||||
Corrected build script and updated @consent.software/webclient dependency version
|
||||
|
||||
- Corrected the build script entry in package.json.
|
||||
- Updated @consent.software/webclient dependency to version ^1.1.0.
|
||||
|
||||
## 2025-01-14 - 1.3.3 - fix(package.json)
|
||||
Fixed incorrect main and typings fields, replacing with exports field
|
||||
|
||||
- Updated package.json to use the 'exports' field instead of 'main' and 'typings' for module entry points
|
||||
|
||||
## 2025-01-14 - 1.3.2 - fix(core)
|
||||
No code changes detected, maintain current state.
|
||||
|
||||
|
||||
## 2025-01-14 - 1.3.1 - fix(package setup)
|
||||
Fix package metadata and dependency consistency
|
||||
|
||||
|
||||
## 2025-01-14 - 1.3.0 - feat(elements)
|
||||
Enhance consent management components with advanced styling and interaction
|
||||
|
||||
- Added delayed animation effect to 'consentsoftware-toggle' when required.
|
||||
- Improved styling for better visual feedback on selections and requirements.
|
||||
- Enhanced modal transition and visibility settings for the 'consentsoftware-cookieconsent'.
|
||||
|
||||
## 2025-01-13 - 1.2.0 - feat(pages)
|
||||
Add initial structure for pages with page1 component
|
||||
|
||||
|
11
package.json
11
package.json
@ -1,21 +1,22 @@
|
||||
{
|
||||
"name": "@consent.software/catalog",
|
||||
"version": "1.2.0",
|
||||
"version": "1.3.5",
|
||||
"private": false,
|
||||
"description": "A library of web components designed to integrate robust consent management capabilities into web applications, ensuring compliance with privacy regulations.",
|
||||
"main": "dist_ts_web/index.js",
|
||||
"typings": "dist_ts_web/index.d.ts",
|
||||
"exports": {
|
||||
".": "./dist_ts_web/index.js"
|
||||
},
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "npm run build",
|
||||
"build": "tsbuild element --allowimplicitany && tsbundle element --production",
|
||||
"build": "tsbuild tsfolders --allowimplicitany && tsbundle element --production",
|
||||
"watch": "tswatch element"
|
||||
},
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@consent.software/interfaces": "^1.0.11",
|
||||
"@consent.software/webclient": "^1.0.14",
|
||||
"@consent.software/webclient": "^1.1.0",
|
||||
"@push.rocks/smartdelay": "^3.0.5",
|
||||
"lit": "^3.2.1"
|
||||
},
|
||||
|
1265
pnpm-lock.yaml
generated
1265
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@consent.software/catalog',
|
||||
version: '1.2.0',
|
||||
version: '1.3.5',
|
||||
description: 'A library of web components designed to integrate robust consent management capabilities into web applications, ensuring compliance with privacy regulations.'
|
||||
}
|
||||
|
@ -18,9 +18,6 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
||||
@property({ type: String, reflect: true })
|
||||
public theme: 'light' | 'dark' = 'light';
|
||||
|
||||
@property({ type: Number })
|
||||
public heightPixels = 60;
|
||||
|
||||
/**
|
||||
* We bind `heightPixels` to a CSS variable (--cookieconsent-height).
|
||||
* Then we can do margin-bottom animations in CSS.
|
||||
@ -69,14 +66,18 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000; /* standard z-index for fixed elements */
|
||||
background: rgba(0, 0, 0, 0);
|
||||
backdrop-filter: blur(0px);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.modalBox {
|
||||
display: block;
|
||||
color: var(--text-color);
|
||||
background: var(--background-color);
|
||||
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.4);
|
||||
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.6);
|
||||
position: realtive;
|
||||
border: 1px dotted rgba(255, 255, 255, 0.1);
|
||||
border-top: 1px solid var(--accent-color);
|
||||
border-radius: 16px;
|
||||
max-width: 1100px;
|
||||
@ -88,7 +89,9 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
||||
* The animation occurs when we toggle the gotIt/show attributes.
|
||||
*/
|
||||
will-change: transform; /* ensure efficient rendering */
|
||||
transition: all 0.2s;
|
||||
transition: all 0.3s;
|
||||
transform: scale(0.95);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -140,9 +143,9 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
||||
.info-container {
|
||||
color: var(--text-color);
|
||||
text-align: center;
|
||||
line-height: 2em;
|
||||
line-height: 3em;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-top: 1px dotted rgba(255, 255, 255, 0.1);
|
||||
font-size: 0.8em;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
@ -208,14 +211,14 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
||||
<div
|
||||
class="consent-button"
|
||||
@click=${(event: MouseEvent) =>
|
||||
this.setLevel(event, ['functional', 'analytics', 'marketing'])}
|
||||
this.setLevel(event, ['functional', 'analytics', 'marketing'])}
|
||||
>
|
||||
Marketing cookies
|
||||
</div>
|
||||
<div
|
||||
class="consent-button"
|
||||
@click=${(event: MouseEvent) =>
|
||||
this.setLevel(event, ['functional', 'analytics', 'marketing', 'all'])}
|
||||
this.setLevel(event, ['functional', 'analytics', 'marketing', 'all'])}
|
||||
>
|
||||
All cookies
|
||||
</div>
|
||||
@ -261,9 +264,20 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
||||
|
||||
const cookieLevel = await this.csWebclientInstance.getCookieLevels();
|
||||
if (!cookieLevel) {
|
||||
delayFor(300).then(() => {
|
||||
this.setAttribute('show', 'true');
|
||||
this.setAttribute('gotIt', 'false');
|
||||
this.setAttribute('show', 'true');
|
||||
this.setAttribute('gotIt', 'false');
|
||||
requestAnimationFrame(async () => {
|
||||
await this.updated();
|
||||
const pageOverlay: HTMLDivElement = this.shadowRoot?.querySelector('.pageOverlay');
|
||||
if (pageOverlay) {
|
||||
pageOverlay.style.background = 'rgba(0, 0, 0, 0.1)';
|
||||
pageOverlay.style.backdropFilter = 'blur(2px)';
|
||||
}
|
||||
const modalBox: HTMLDivElement = this.shadowRoot?.querySelector('.modalBox');
|
||||
if (modalBox) {
|
||||
modalBox.style.transform = `scale(1)`;
|
||||
modalBox.style.opacity = '1';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setAttribute('show', 'false');
|
||||
@ -275,7 +289,7 @@ export class ConsentsoftwareCookieconsent extends LitElement {
|
||||
* Called after the first render of the component.
|
||||
* We measure the actual height of the banner and update the CSS variable.
|
||||
*/
|
||||
public firstUpdated() {}
|
||||
public async firstUpdated() {}
|
||||
|
||||
/**
|
||||
* Called whenever the element is updated or re-rendered.
|
||||
|
@ -11,10 +11,10 @@ export class ConsentsoftwareHeader extends LitElement {
|
||||
public static styles = css`
|
||||
:host {
|
||||
display: block;
|
||||
line-height: 2em;
|
||||
line-height: 3em;
|
||||
text-align: center;
|
||||
font-family: ${shared.fontStack};
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.heading {
|
||||
|
@ -16,8 +16,6 @@ export class ConsentsoftwareMainSelection extends LitElement {
|
||||
:host {
|
||||
display: block;
|
||||
position: relative;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.maincontainer {
|
||||
@ -28,7 +26,8 @@ export class ConsentsoftwareMainSelection extends LitElement {
|
||||
.itemBox {
|
||||
padding: 16px;
|
||||
text-align: center;
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-right: 1px solid;
|
||||
border-image: radial-gradient(circle, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%) 1;
|
||||
}
|
||||
.itemBox:last-child {
|
||||
border-right: none;
|
||||
@ -43,7 +42,7 @@ export class ConsentsoftwareMainSelection extends LitElement {
|
||||
return html`
|
||||
<div class="maincontainer">
|
||||
<div class="itemBox">
|
||||
<consentsoftware-toggle>Required</consentsoftware-toggle>
|
||||
<consentsoftware-toggle required>Required</consentsoftware-toggle>
|
||||
</div>
|
||||
<div class="itemBox">
|
||||
<consentsoftware-toggle>Preferences</consentsoftware-toggle>
|
||||
|
@ -44,7 +44,7 @@ export class ConsentsoftwareTabs extends LitElement {
|
||||
<div class="tabs">
|
||||
<div class="tab" @click=${this.handleClick}>Consent</div>
|
||||
<div class="tab" @click=${this.handleClick}>Details</div>
|
||||
<div class="tab" @click=${this.handleClick}>About Cookies</div>
|
||||
<div class="tab" @click=${this.handleClick}>Cookie Policy + Legal Info</div>
|
||||
</div>
|
||||
<div class="selector"></div>
|
||||
`;
|
||||
|
@ -2,6 +2,8 @@ import { LitElement, html, css, type TemplateResult } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { property } from 'lit/decorators/property.js';
|
||||
|
||||
import { delayFor } from '@push.rocks/smartdelay';
|
||||
|
||||
@customElement('consentsoftware-toggle')
|
||||
export class ConsentsoftwareToggle extends LitElement {
|
||||
public static demo = () => html`<consentsoftware-toggle></consentsoftware-toggle>`;
|
||||
@ -27,15 +29,16 @@ export class ConsentsoftwareToggle extends LitElement {
|
||||
margin: auto;
|
||||
height: 30px;
|
||||
width: 60px;
|
||||
border-radius: 15px;
|
||||
border-radius: 20px;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: all 0.2s;
|
||||
border: 1px solid rgba(255, 255, 255, 0);
|
||||
}
|
||||
|
||||
:host([selected]) .toggleKnobArea {
|
||||
background: blue;
|
||||
background: green;
|
||||
}
|
||||
|
||||
.toggleKnobMover {
|
||||
@ -51,12 +54,21 @@ export class ConsentsoftwareToggle extends LitElement {
|
||||
top: 0;
|
||||
left: 0;
|
||||
transition: all 0.2s;
|
||||
transform: scale(0.8);
|
||||
transform: scale(0.7);
|
||||
}
|
||||
|
||||
:host([selected]) .toggleKnobInner {
|
||||
background: white;
|
||||
}
|
||||
|
||||
:host([required]) .toggleKnobArea {
|
||||
background: none;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
:host([required]) .toggleKnobInner {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
`;
|
||||
|
||||
constructor() {
|
||||
@ -76,11 +88,30 @@ export class ConsentsoftwareToggle extends LitElement {
|
||||
`;
|
||||
}
|
||||
|
||||
public async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) {
|
||||
super.firstUpdated(_changedProperties);
|
||||
if (this.required) {
|
||||
this.selected = true;
|
||||
this.syncSelection();
|
||||
}
|
||||
}
|
||||
|
||||
public async handleClick(mouseEvent) {
|
||||
if (this.required) {
|
||||
const moverElement: HTMLDivElement = this.shadowRoot.querySelector('.toggleKnobMover');
|
||||
moverElement.style.transform = 'translateX(20px)';
|
||||
await delayFor(250);
|
||||
moverElement.style.transform = 'translateX(30px)';
|
||||
return;
|
||||
}
|
||||
this.selected = !this.selected;
|
||||
mouseEvent.stopPropagation();
|
||||
mouseEvent.preventDefault();
|
||||
this.syncSelection();
|
||||
this.dispatchEvent(new CustomEvent('toggle', { detail: { selected: this.selected } }));
|
||||
}
|
||||
|
||||
public async syncSelection() {
|
||||
console.log(`Selected ${this.selected}`);
|
||||
const moverElement: HTMLDivElement = this.shadowRoot.querySelector('.toggleKnobMover');
|
||||
if (this.selected) {
|
||||
|
Reference in New Issue
Block a user