- Component properties migrated to use the TypeScript 'accessor' modifier (consentsoftware-cookieconsent, consentsoftware-mainselection, consentsoftware-toggle)
- Bumped runtime and dev dependencies: lit -> ^3.3.1; upgrades to @design.estate/dees-wcctools, @git.zone/tsbuild, @git.zone/tsbundle, @git.zone/tswatch
- Package metadata: author updated to Task Venture Capital GmbH and test script changed to use pnpm
## 2025-01-22 - 1.6.0 - feat(elements)
Enhance theme handling and CSS organization for consent component
A sleek, modern library of webcomponents for seamless consent management integration. Built with Lit and designed for GDPR/CCPA compliance out of the box.
## Install
## Issue Reporting and Security
To install this module, you need to have [Node.js](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed on your machine. You can then run the following command in your terminal to add the module to your project:
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
```shell
npm install @consent.software_private/catalog
## Features
🍪 **Cookie Consent Modal** - Beautiful, responsive consent dialog with light/dark theme support
🎛️ **Interactive Toggles** - Draggable toggle switches with smooth animations
📱 **Mobile-First Design** - Fully responsive across all device sizes
🎨 **Theme-Aware** - Automatically detects system light/dark mode preference
🔒 **Privacy-First** - Integrates with consent.software backend for compliant consent tracking
⚡ **Zero Config** - Drop-in components that just work
## Installation
```bash
npm install @consent.software/catalog
# or
pnpm add @consent.software/catalog
```
Ensure you have ESM support enabled in your TypeScript configuration, as this package uses ES module syntax.
## Quick Start
## Usage
The `@consent.software_private/catalog` module offers a set of web components to integrate consent management capabilities into your web application. These components leverage modern browser APIs and employ a system for cookie management that aligns with regulatory requirements.
### Initial Setup
First, import the necessary modules and set up your project to use the web components provided:
Import the components and add the consent banner to your page:
```typescript
import'@consent.software_private/catalog';
import'@consent.software/catalog';
// That's it! Add the component to your HTML
```
Ensure this import statement is included in your main JavaScript/TypeScript file where you want to utilize the consent management web components. It is vital to transpile with TypeScript compiler settings that support ES modules.
### Building a Consent Modal
A primary feature of this module is the `consentsoftware-cookieconsent` component. This component can be embedded into your application to allow users to select their preferred cookie levels.
#### Setting Up the Environment
Before creating instances of the components, make sure your project environment is ready. Setup the DOM tools and any associated dependencies:
This will add the consent banner to the bottom of the page, providing users options to set their preferences.
**Features:**
- Three-button interface: Deny, Accept Selection, Accept All
- Four cookie categories: Required, Preferences, Statistics, Marketing
- Animated modal with backdrop blur
- Shake feedback when clicking outside the modal
- Automatic theme detection (light/dark)
#### Customizing the Component
### `<consentsoftware-toggle>`
The `consentsoftware-cookieconsent` component allows you to customize its design via CSS properties. Leverage light and dark themes through the CSS manager used in styling attributes:
A draggable toggle switch component with touch support.
The components use CSS custom properties for easy theming:
```css
consentsoftware-cookieconsent{
/* Text and colors */
--text-color:#333;
--background-color:#eeeeee;
--accent-color:#333333;
/* Buttons */
--button-bg:#ffffff;
--button-hover-bg:#f2f2f2;
/* Links */
--link-color:#333;
--icon-color:#4496f5;
/* Modal */
--modal-box-shadow:0px0px8pxrgba(0,0,0,0.2);
--info-bg:rgba(0,0,0,0.1);
--info-text:rgba(0,0,0,0.5);
}
```
The system remembers user choices using a backend managed by the `consent.software` infrastructure.
The component automatically switches to dark theme variables when `theme="dark"` is set or when the system prefers dark mode.
### Integrating with Your Backend
## Cookie Levels
For full functionality, the component interacts with a backend to manage user consent states. Using `@consent.software/webclient`, you can query the user's current consent levels, perform updates, and verify whether consent has been previously granted:
The consent system uses three user-selectable levels plus a required baseline:
// Apply the consent settings to your analytics, advertisements, etc.
applyConsentSettings(cookieLevels);
}
## Browser Support
- Chrome (last 2 versions)
- Firefox (last 2 versions)
- Safari (last 2 versions)
- Edge (last 2 versions)
Built with modern ES modules and requires browsers with native Custom Elements v1 support.
## Development
```bash
# Install dependencies
pnpm install
# Build the project
pnpm run build
# Watch mode for development
pnpm run watch
```
### Advanced Considerations
## License and Legal Information
#### Responsive Design
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
The component is responsive, optimized for various screen sizes using a grid layout. Ensure your main HTML elements are responsive to accommodate the consent bar.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
#### Accessibility and Compliance
### Trademarks
Ensure your application properly adheres to legal and accessibility standards by aligning with the consent management system's features. This often involves using correct semantics, polyfills for custom elements, and thorough testing on different devices and browsers.
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
#### Managing State Across Sessions
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
Store user's consent preferences beyond the session using either localStorage, cookies, or server-side sessions. Adjust the component’s connectedCallback and updated lifecycle methods to fetch and apply these stored settings.
### Company Information
Proper handling ensures a seamless user experience, helping companies comply with international privacy laws like GDPR.
Task Venture Capital GmbH
Registered at District Court Bremen HRB 35230 HB, Germany
### Integration and Testing
For any legal inquiries or further information, please contact us via email at hello@task.vc.
Test extensively in your development environment, ensure correct rendering, and simulate various user interactions to gain confidence in production-level functionality. Automated testing might include:
- Unit tests for lifecycle behavior using testing libraries such as Mocha or Jest.
- Integration trials ensuring the component plays well with surrounding UI elements.
### Conclusion
With these guidelines, developers can integrate, customize, and extend the consent management capabilities within their applications using `@consent.software_private/catalog`. Adapt the styling, maximize UX, and ensure regulatory compliance for a robust implementation. Mastery of the component enables seamless user consent handling and enhances your app's governance credentials.
undefined
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
description:'A library of web components designed to integrate robust consent management capabilities into web applications, ensuring compliance with privacy regulations.'
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.