@consent.software/catalog 1.6.0 → 1.6.1

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.
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@consent.software/catalog",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "private": false,
5
5
  "description": "A library of web components designed to integrate robust consent management capabilities into web applications, ensuring compliance with privacy regulations.",
6
6
  "exports": {
7
7
  ".": "./dist_ts_web/index.js"
8
8
  },
9
9
  "type": "module",
10
- "author": "Lossless GmbH",
10
+ "author": "Task Venture Capital GmbH",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
13
  "@consent.software/interfaces": "^1.0.14",
14
14
  "@consent.software/webclient": "^1.1.0",
15
15
  "@push.rocks/smartdelay": "^3.0.5",
16
- "lit": "^3.2.1"
16
+ "lit": "^3.3.1"
17
17
  },
18
18
  "devDependencies": {
19
- "@design.estate/dees-wcctools": "^1.0.90",
20
- "@git.zone/tsbuild": "^2.2.0",
21
- "@git.zone/tsbundle": "^2.1.0",
22
- "@git.zone/tswatch": "^2.0.37",
19
+ "@design.estate/dees-wcctools": "^1.2.1",
20
+ "@git.zone/tsbuild": "^3.1.2",
21
+ "@git.zone/tsbundle": "^2.6.2",
22
+ "@git.zone/tswatch": "^2.2.1",
23
23
  "@push.rocks/projectinfo": "^5.0.2"
24
24
  },
25
25
  "files": [
@@ -50,7 +50,7 @@
50
50
  "modern web"
51
51
  ],
52
52
  "scripts": {
53
- "test": "npm run build",
53
+ "test": "pnpm run build",
54
54
  "build": "tsbuild tsfolders --allowimplicitany && tsbundle element --production",
55
55
  "watch": "tswatch element"
56
56
  }
package/readme.md CHANGED
@@ -1,138 +1,207 @@
1
- # @consent.software_private/catalog
1
+ # @consent.software/catalog
2
2
 
3
- Webcomponents for consent.software widget.
3
+ A sleek, modern library of web components for seamless consent management integration. Built with Lit and designed for GDPR/CCPA compliance out of the box.
4
4
 
5
- ## Install
5
+ ## Issue Reporting and Security
6
6
 
7
- 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:
7
+ 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.
8
8
 
9
- ```shell
10
- npm install @consent.software_private/catalog
11
- ```
9
+ ## Features
12
10
 
13
- Ensure you have ESM support enabled in your TypeScript configuration, as this package uses ES module syntax.
11
+ 🍪 **Cookie Consent Modal** - Beautiful, responsive consent dialog with light/dark theme support
12
+ 🎛️ **Interactive Toggles** - Draggable toggle switches with smooth animations
13
+ 📱 **Mobile-First Design** - Fully responsive across all device sizes
14
+ 🎨 **Theme-Aware** - Automatically detects system light/dark mode preference
15
+ 🔒 **Privacy-First** - Integrates with consent.software backend for compliant consent tracking
16
+ ⚡ **Zero Config** - Drop-in components that just work
14
17
 
15
- ## Usage
18
+ ## Installation
16
19
 
17
- 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.
20
+ ```bash
21
+ npm install @consent.software/catalog
22
+ # or
23
+ pnpm add @consent.software/catalog
24
+ ```
18
25
 
19
- ### Initial Setup
26
+ ## Quick Start
20
27
 
21
- First, import the necessary modules and set up your project to use the web components provided:
28
+ Import the components and add the consent banner to your page:
22
29
 
23
30
  ```typescript
24
- import '@consent.software_private/catalog';
31
+ import '@consent.software/catalog';
32
+
33
+ // That's it! Add the component to your HTML
34
+ ```
35
+
36
+ ```html
37
+ <consentsoftware-cookieconsent></consentsoftware-cookieconsent>
25
38
  ```
26
39
 
27
- 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.
40
+ The consent banner automatically:
41
+ - Shows on first visit when no consent preferences are stored
42
+ - Hides after user makes a selection
43
+ - Respects system dark/light mode
44
+ - Stores preferences via the consent.software backend
45
+
46
+ ## Components
28
47
 
29
- ### Building a Consent Modal
48
+ ### `<consentsoftware-cookieconsent>`
30
49
 
31
- 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.
50
+ The main consent modal component. Provides a full-screen overlay with cookie preference options.
32
51
 
33
- #### Setting Up the Environment
52
+ ```html
53
+ <consentsoftware-cookieconsent></consentsoftware-cookieconsent>
54
+ ```
34
55
 
35
- Before creating instances of the components, make sure your project environment is ready. Setup the DOM tools and any associated dependencies:
56
+ **Features:**
57
+ - Three-button interface: Deny, Accept Selection, Accept All
58
+ - Four cookie categories: Required, Preferences, Statistics, Marketing
59
+ - Animated modal with backdrop blur
60
+ - Shake feedback when clicking outside the modal
61
+ - Automatic theme detection (light/dark)
36
62
 
37
- ```typescript
38
- import { domtools } from '@design.estate/dees-domtools';
63
+ ### `<consentsoftware-toggle>`
39
64
 
40
- domtools.elementBasic.setup();
65
+ A draggable toggle switch component with touch support.
66
+
67
+ ```html
68
+ <consentsoftware-toggle>Label Text</consentsoftware-toggle>
69
+ <consentsoftware-toggle required>Required</consentsoftware-toggle>
41
70
  ```
42
71
 
43
- #### Using the Consentsoftware-Cookieconsent Component
72
+ **Properties:**
73
+ - `required` (boolean) - When true, toggle is locked in the "on" position
74
+ - `selected` (boolean) - Current toggle state
44
75
 
45
- Here's how you can include the `consentsoftware-cookieconsent` component in your application:
76
+ **Events:**
77
+ - `toggle` - Fired when state changes, includes `{ selected: boolean }` in detail
46
78
 
47
- ```typescript
48
- import { html, render } from 'lit-html';
79
+ ### `<consentsoftware-tabs>`
49
80
 
50
- const template = html`
51
- <consentsoftware-cookieconsent></consentsoftware-cookieconsent>
52
- `;
81
+ Tab navigation component with animated indicator.
53
82
 
54
- render(template, document.body);
83
+ ```html
84
+ <consentsoftware-tabs></consentsoftware-tabs>
55
85
  ```
56
86
 
57
- This will add the consent banner to the bottom of the page, providing users options to set their preferences.
87
+ Displays three tabs: Consent, Details, and Cookie Policy.
58
88
 
59
- #### Customizing the Component
89
+ ### `<consentsoftware-header>`
60
90
 
61
- 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:
91
+ Simple header component for the consent modal.
62
92
 
63
- ```typescript
64
- const styles = `
65
- :host {
66
- --cookieconsent-height: 70px;
67
- --cookieconsent-background: #222;
68
- --cookieconsent-text-color: #fff;
69
- }
70
- `;
93
+ ```html
94
+ <consentsoftware-header></consentsoftware-header>
71
95
  ```
72
96
 
73
- Apply these custom styles to modify the appearance to match your site's design language.
97
+ ### `<consentsoftware-mainselection>`
74
98
 
75
- #### Handling User Interactions
99
+ Grid layout containing toggle switches for each cookie category.
76
100
 
77
- The component is interactive, responding to user actions to set cookie levels. Here’s how the interaction flow works:
101
+ ```html
102
+ <consentsoftware-mainselection></consentsoftware-mainselection>
103
+ ```
78
104
 
79
- 1. **User Interaction**: Users click one of the consent buttons (e.g., "Functional Cookies").
80
- 2. **Handling Consent Levels**: The component's `setLevel` method is invoked, updating the user's cookie preferences, e.g.:
105
+ ## Backend Integration
106
+
107
+ This catalog integrates with the `@consent.software/webclient` package for backend communication:
81
108
 
82
109
  ```typescript
83
- private async setLevel(event: MouseEvent, levelsArg: Array<TCookieLevel>) {
84
- await this.csWebclientInstance.setCookieLevels(levelsArg);
85
- // Adjust styling and visibility
86
- this.setAttribute('gotIt', 'true');
87
- await delayFor(300);
88
- this.setAttribute('show', 'false');
89
- // Update other business logic based on consent levels
110
+ import { CsWebclient } from '@consent.software/webclient';
111
+
112
+ const client = new CsWebclient();
113
+
114
+ // Check current consent levels
115
+ const levels = await client.getCookieLevels();
116
+ if (!levels) {
117
+ // Show consent dialog
90
118
  }
119
+
120
+ // Set consent levels programmatically
121
+ await client.setCookieLevels(['functional', 'analytics']);
122
+
123
+ // Run consent-dependent scripts
124
+ await client.getAndRunConsentTuples();
91
125
  ```
92
126
 
93
- The system remembers user choices using a backend managed by the `consent.software` infrastructure.
127
+ ## Styling & Theming
94
128
 
95
- ### Integrating with Your Backend
129
+ The components use CSS custom properties for easy theming:
96
130
 
97
- 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:
131
+ ```css
132
+ consentsoftware-cookieconsent {
133
+ /* Text and colors */
134
+ --text-color: #333;
135
+ --background-color: #eeeeee;
136
+ --accent-color: #333333;
98
137
 
99
- ```typescript
100
- const webclientInstance = new CsWebclient();
101
- const cookieLevels = await webclientInstance.getCookieLevels();
102
-
103
- if (!cookieLevels) {
104
- // Show consent dialog if no consent levels are set
105
- document.querySelector('consentsoftware-cookieconsent').show = true;
106
- } else {
107
- // Apply the consent settings to your analytics, advertisements, etc.
108
- applyConsentSettings(cookieLevels);
138
+ /* Buttons */
139
+ --button-bg: #ffffff;
140
+ --button-hover-bg: #f2f2f2;
141
+
142
+ /* Links */
143
+ --link-color: #333;
144
+ --icon-color: #4496f5;
145
+
146
+ /* Modal */
147
+ --modal-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.2);
148
+ --info-bg: rgba(0, 0, 0, 0.1);
149
+ --info-text: rgba(0, 0, 0, 0.5);
109
150
  }
110
151
  ```
111
152
 
112
- ### Advanced Considerations
153
+ The component automatically switches to dark theme variables when `theme="dark"` is set or when the system prefers dark mode.
154
+
155
+ ## Cookie Levels
156
+
157
+ The consent system uses three user-selectable levels plus a required baseline:
113
158
 
114
- #### Responsive Design
159
+ | Level | Description |
160
+ |-------|-------------|
161
+ | `functional` | Required cookies for site operation (always enabled) |
162
+ | `preferences` | User preference cookies |
163
+ | `analytics` | Statistics and analytics tracking |
164
+ | `marketing` | Marketing and advertising cookies |
115
165
 
116
- 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.
166
+ ## Browser Support
167
+
168
+ - Chrome (last 2 versions)
169
+ - Firefox (last 2 versions)
170
+ - Safari (last 2 versions)
171
+ - Edge (last 2 versions)
172
+
173
+ Built with modern ES modules and requires browsers with native Custom Elements v1 support.
174
+
175
+ ## Development
176
+
177
+ ```bash
178
+ # Install dependencies
179
+ pnpm install
180
+
181
+ # Build the project
182
+ pnpm run build
183
+
184
+ # Watch mode for development
185
+ pnpm run watch
186
+ ```
117
187
 
118
- #### Accessibility and Compliance
188
+ ## License and Legal Information
119
189
 
120
- 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.
190
+ This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
121
191
 
122
- #### Managing State Across Sessions
192
+ **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.
123
193
 
124
- 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.
194
+ ### Trademarks
125
195
 
126
- Proper handling ensures a seamless user experience, helping companies comply with international privacy laws like GDPR.
196
+ 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.
127
197
 
128
- ### Integration and Testing
198
+ 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.
129
199
 
130
- 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:
200
+ ### Company Information
131
201
 
132
- - Unit tests for lifecycle behavior using testing libraries such as Mocha or Jest.
133
- - Integration trials ensuring the component plays well with surrounding UI elements.
202
+ Task Venture Capital GmbH
203
+ Registered at District Court Bremen HRB 35230 HB, Germany
134
204
 
135
- ### Conclusion
205
+ For any legal inquiries or further information, please contact us via email at hello@task.vc.
136
206
 
137
- 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.
138
- undefined
207
+ 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.
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@consent.software/catalog',
6
- version: '1.6.0',
6
+ version: '1.6.1',
7
7
  description: 'A library of web components designed to integrate robust consent management capabilities into web applications, ensuring compliance with privacy regulations.'
8
8
  }
@@ -23,7 +23,7 @@ export class ConsentsoftwareCookieconsent extends LitElement {
23
23
 
24
24
  // Reflects the current theme ('light' or 'dark')
25
25
  @property({ type: String, reflect: true })
26
- public theme: 'light' | 'dark' = 'light';
26
+ public accessor theme: 'light' | 'dark' = 'light';
27
27
 
28
28
  /**
29
29
  * Define component styles with CSS variables that adjust based on theme.
@@ -7,10 +7,10 @@ export class ConsentsoftwareMainSelection extends LitElement {
7
7
  public static demo = () => html`<consentsoftware-mainselection></consentsoftware-mainselection>`;
8
8
 
9
9
  @property({ type: Boolean })
10
- public required = false;
10
+ public accessor required = false;
11
11
 
12
12
  @property({ type: Boolean })
13
- public selected = false;
13
+ public accessor selected = false;
14
14
 
15
15
  public static styles = css`
16
16
  :host {
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2017",
4
- "module": "es2015",
5
- "moduleResolution": "node",
6
- "lib": ["es2017", "dom"],
3
+ "target": "ES2022",
4
+ "module": "ES2022",
5
+ "moduleResolution": "bundler",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
7
  "declaration": true,
8
8
  "inlineSources": true,
9
9
  "inlineSourceMap": true,