@consent.software/catalog 1.6.1 → 2.0.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/dist_bundle/bundle.js +655 -329
- package/dist_bundle/bundle.js.map +4 -4
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/consentsoftware-cookieconsent.d.ts +7 -20
- package/dist_ts_web/elements/consentsoftware-cookieconsent.js +200 -252
- package/dist_ts_web/elements/consentsoftware-header.d.ts +3 -4
- package/dist_ts_web/elements/consentsoftware-header.js +35 -23
- package/dist_ts_web/elements/consentsoftware-mainselection.d.ts +4 -5
- package/dist_ts_web/elements/consentsoftware-mainselection.js +54 -28
- package/dist_ts_web/elements/consentsoftware-tabs.d.ts +4 -5
- package/dist_ts_web/elements/consentsoftware-tabs.js +44 -36
- package/dist_ts_web/elements/consentsoftware-toggle.d.ts +11 -9
- package/dist_ts_web/elements/consentsoftware-toggle.js +103 -94
- package/dist_ts_web/elements/shared.d.ts +35 -1
- package/dist_ts_web/elements/shared.js +36 -2
- package/dist_ts_web/pages/page1.d.ts +1 -1
- package/dist_ts_web/pages/page1.js +2 -2
- package/dist_watch/bundle.js +503 -437
- package/dist_watch/bundle.js.map +3 -3
- package/package.json +3 -3
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/consentsoftware-cookieconsent.ts +218 -250
- package/ts_web/elements/consentsoftware-header.ts +40 -23
- package/ts_web/elements/consentsoftware-mainselection.ts +60 -30
- package/ts_web/elements/consentsoftware-tabs.ts +51 -37
- package/ts_web/elements/consentsoftware-toggle.ts +123 -107
- package/ts_web/elements/shared.ts +38 -2
- package/ts_web/pages/page1.ts +1 -1
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import { cssManager, colors } from './shared.js';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
DeesElement,
|
|
5
|
+
customElement,
|
|
6
|
+
html,
|
|
7
|
+
css,
|
|
8
|
+
type TemplateResult,
|
|
9
|
+
property,
|
|
10
|
+
} from '@design.estate/dees-element';
|
|
4
11
|
|
|
5
12
|
@customElement('consentsoftware-mainselection')
|
|
6
|
-
export class ConsentsoftwareMainSelection extends
|
|
13
|
+
export class ConsentsoftwareMainSelection extends DeesElement {
|
|
7
14
|
public static demo = () => html`<consentsoftware-mainselection></consentsoftware-mainselection>`;
|
|
8
15
|
|
|
9
16
|
@property({ type: Boolean })
|
|
@@ -12,31 +19,54 @@ export class ConsentsoftwareMainSelection extends LitElement {
|
|
|
12
19
|
@property({ type: Boolean })
|
|
13
20
|
public accessor selected = false;
|
|
14
21
|
|
|
15
|
-
public static styles =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
public static styles = [
|
|
23
|
+
cssManager.defaultStyles,
|
|
24
|
+
css`
|
|
25
|
+
:host {
|
|
26
|
+
display: block;
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.maincontainer {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: repeat(4, 1fr);
|
|
33
|
+
padding: 8px 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (max-width: 560px) {
|
|
37
|
+
.maincontainer {
|
|
38
|
+
grid-template-columns: repeat(2, 1fr);
|
|
39
|
+
gap: 4px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.itemBox {
|
|
44
|
+
padding: 12px 8px;
|
|
45
|
+
text-align: center;
|
|
46
|
+
border-right: 1px solid ${cssManager.bdTheme(colors.light.border, colors.dark.border)};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.itemBox:last-child {
|
|
50
|
+
border-right: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media (max-width: 560px) {
|
|
54
|
+
.itemBox {
|
|
55
|
+
padding: 10px 8px;
|
|
56
|
+
border-right: none;
|
|
57
|
+
border-bottom: 1px solid ${cssManager.bdTheme(colors.light.border, colors.dark.border)};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.itemBox:nth-child(odd) {
|
|
61
|
+
border-right: 1px solid ${cssManager.bdTheme(colors.light.border, colors.dark.border)};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.itemBox:nth-last-child(-n+2) {
|
|
65
|
+
border-bottom: none;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`,
|
|
69
|
+
];
|
|
40
70
|
|
|
41
71
|
public render(): TemplateResult {
|
|
42
72
|
return html`
|
|
@@ -57,5 +87,5 @@ export class ConsentsoftwareMainSelection extends LitElement {
|
|
|
57
87
|
`;
|
|
58
88
|
}
|
|
59
89
|
|
|
60
|
-
public async getResults(
|
|
90
|
+
public async getResults() {}
|
|
61
91
|
}
|
|
@@ -1,50 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import { cssManager, colors } from './shared.js';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
DeesElement,
|
|
5
|
+
customElement,
|
|
6
|
+
html,
|
|
7
|
+
css,
|
|
8
|
+
type TemplateResult,
|
|
9
|
+
} from '@design.estate/dees-element';
|
|
4
10
|
|
|
5
11
|
@customElement('consentsoftware-tabs')
|
|
6
|
-
export class ConsentsoftwareTabs extends
|
|
12
|
+
export class ConsentsoftwareTabs extends DeesElement {
|
|
7
13
|
public static demo = () => html`<consentsoftware-tabs></consentsoftware-tabs>`;
|
|
8
14
|
|
|
9
|
-
public static styles =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
display: grid;
|
|
18
|
-
grid-template-columns: repeat(3, 1fr);
|
|
19
|
-
}
|
|
15
|
+
public static styles = [
|
|
16
|
+
cssManager.defaultStyles,
|
|
17
|
+
css`
|
|
18
|
+
:host {
|
|
19
|
+
display: block;
|
|
20
|
+
position: relative;
|
|
21
|
+
background: ${cssManager.bdTheme(colors.light.muted, colors.dark.muted)};
|
|
22
|
+
}
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
24
|
+
.tabs {
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-template-columns: repeat(3, 1fr);
|
|
27
|
+
}
|
|
26
28
|
|
|
27
|
-
/* Media query for mobile devices: stack buttons vertically */
|
|
28
|
-
@media (max-width: 600px) {
|
|
29
29
|
.tabs .tab {
|
|
30
|
+
text-align: center;
|
|
31
|
+
padding: 8px 0;
|
|
30
32
|
font-size: 0.8em;
|
|
33
|
+
font-weight: 500;
|
|
34
|
+
color: ${cssManager.bdTheme(colors.light.mutedForeground, colors.dark.mutedForeground)};
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
transition: color 0.15s ease;
|
|
31
37
|
}
|
|
32
|
-
}
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
height: 1px;
|
|
38
|
-
left: 0;
|
|
39
|
-
bottom: 0px;
|
|
40
|
-
background: orange;
|
|
41
|
-
transition: all 0.2s;
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
39
|
+
.tabs .tab:hover {
|
|
40
|
+
color: ${cssManager.bdTheme(colors.light.foreground, colors.dark.foreground)};
|
|
41
|
+
}
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
@media (max-width: 560px) {
|
|
44
|
+
.tabs .tab {
|
|
45
|
+
font-size: 0.75em;
|
|
46
|
+
padding: 6px 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.selector {
|
|
51
|
+
position: absolute;
|
|
52
|
+
width: calc(100% / 3);
|
|
53
|
+
height: 2px;
|
|
54
|
+
left: 0;
|
|
55
|
+
bottom: 0;
|
|
56
|
+
background: ${cssManager.bdTheme(colors.light.foreground, colors.dark.foreground)};
|
|
57
|
+
transition: all 0.2s ease-out;
|
|
58
|
+
border-radius: 1px;
|
|
59
|
+
}
|
|
60
|
+
`,
|
|
61
|
+
];
|
|
48
62
|
|
|
49
63
|
public render(): TemplateResult {
|
|
50
64
|
return html`
|
|
@@ -57,7 +71,7 @@ export class ConsentsoftwareTabs extends LitElement {
|
|
|
57
71
|
`;
|
|
58
72
|
}
|
|
59
73
|
|
|
60
|
-
public async handleClick(mouseEvent) {
|
|
74
|
+
public async handleClick(mouseEvent: MouseEvent) {
|
|
61
75
|
const target = mouseEvent.target as HTMLElement;
|
|
62
76
|
const tab: HTMLDivElement = target.closest('.tab');
|
|
63
77
|
if (tab) {
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import { cssManager, colors } from './shared.js';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
DeesElement,
|
|
5
|
+
customElement,
|
|
6
|
+
html,
|
|
7
|
+
css,
|
|
8
|
+
type TemplateResult,
|
|
9
|
+
property,
|
|
10
|
+
} from '@design.estate/dees-element';
|
|
11
|
+
|
|
4
12
|
import { delayFor } from '@push.rocks/smartdelay';
|
|
5
13
|
|
|
6
14
|
@customElement('consentsoftware-toggle')
|
|
7
|
-
export class ConsentsoftwareToggle extends
|
|
15
|
+
export class ConsentsoftwareToggle extends DeesElement {
|
|
8
16
|
@property({ type: Boolean })
|
|
9
17
|
public accessor required = false;
|
|
10
18
|
|
|
@@ -12,9 +20,9 @@ export class ConsentsoftwareToggle extends LitElement {
|
|
|
12
20
|
public accessor selected = false;
|
|
13
21
|
|
|
14
22
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
23
|
+
* Knob position tracking (0 = off, maxTravel = on)
|
|
24
|
+
* This is the travel distance, not absolute left position.
|
|
25
|
+
* Actual left = padding + currentX
|
|
18
26
|
*/
|
|
19
27
|
private currentX = 0;
|
|
20
28
|
|
|
@@ -23,82 +31,95 @@ export class ConsentsoftwareToggle extends LitElement {
|
|
|
23
31
|
*/
|
|
24
32
|
private isDragging = false;
|
|
25
33
|
private hasDragged = false;
|
|
26
|
-
private startX = 0;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
34
|
+
private startX = 0;
|
|
35
|
+
|
|
36
|
+
// Toggle dimensions (with border-box, 1px border reduces inner by 2px)
|
|
37
|
+
private readonly trackWidth = 36; // outer width
|
|
38
|
+
private readonly trackHeight = 20; // outer height
|
|
39
|
+
private readonly knobSize = 14;
|
|
40
|
+
private readonly padding = 2; // padding from inner edge to knob
|
|
41
|
+
private readonly maxTravel = 16; // (36 - 2) - 14 - (2 * 2) = 34 - 14 - 4 = 16
|
|
42
|
+
|
|
43
|
+
public static styles = [
|
|
44
|
+
cssManager.defaultStyles,
|
|
45
|
+
css`
|
|
46
|
+
:host {
|
|
47
|
+
display: block;
|
|
48
|
+
position: relative;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.label {
|
|
52
|
+
margin-bottom: 8px;
|
|
53
|
+
font-size: 0.8em;
|
|
54
|
+
font-weight: 500;
|
|
55
|
+
color: ${cssManager.bdTheme(colors.light.mutedForeground, colors.dark.mutedForeground)};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.toggle {
|
|
59
|
+
user-select: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.toggleKnobArea {
|
|
63
|
+
position: relative;
|
|
64
|
+
margin: auto;
|
|
65
|
+
height: 20px;
|
|
66
|
+
width: 36px;
|
|
67
|
+
border-radius: 10px;
|
|
68
|
+
background: ${cssManager.bdTheme(colors.light.input, colors.dark.input)};
|
|
69
|
+
border: 1px solid ${cssManager.bdTheme(colors.light.border, colors.dark.border)};
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
transition: all 0.15s ease;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.toggleKnobArea:hover {
|
|
76
|
+
border-color: ${cssManager.bdTheme(colors.light.ring, colors.dark.ring)};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([selected]) .toggleKnobArea {
|
|
80
|
+
background: ${cssManager.bdTheme(colors.light.primary, colors.dark.primary)};
|
|
81
|
+
border-color: ${cssManager.bdTheme(colors.light.primary, colors.dark.primary)};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.toggleKnobMover {
|
|
85
|
+
position: relative;
|
|
86
|
+
height: 100%;
|
|
87
|
+
width: 100%;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.toggleKnobInner {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 2px;
|
|
93
|
+
width: 14px;
|
|
94
|
+
height: 14px;
|
|
95
|
+
border-radius: 7px;
|
|
96
|
+
background: ${cssManager.bdTheme(colors.light.mutedForeground, colors.dark.mutedForeground)};
|
|
97
|
+
transition: left 0.15s ease, background 0.15s ease;
|
|
98
|
+
touch-action: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.toggleKnobInner.dragging {
|
|
102
|
+
transition: background 0.15s ease;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([selected]) .toggleKnobInner {
|
|
106
|
+
background: ${cssManager.bdTheme(colors.light.primaryForeground, colors.dark.primaryForeground)};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:host([required]) .toggleKnobArea {
|
|
110
|
+
cursor: not-allowed;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([required][selected]) .toggleKnobArea {
|
|
114
|
+
background: ${cssManager.bdTheme(colors.light.ring, colors.dark.ring)};
|
|
115
|
+
border-color: ${cssManager.bdTheme(colors.light.ring, colors.dark.ring)};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:host([required][selected]) .toggleKnobInner {
|
|
119
|
+
background: ${cssManager.bdTheme(colors.light.muted, colors.dark.muted)};
|
|
120
|
+
}
|
|
121
|
+
`,
|
|
122
|
+
];
|
|
102
123
|
|
|
103
124
|
public render(): TemplateResult {
|
|
104
125
|
return html`
|
|
@@ -110,7 +131,7 @@ export class ConsentsoftwareToggle extends LitElement {
|
|
|
110
131
|
<!-- The knob itself, with pointer events for dragging. -->
|
|
111
132
|
<div
|
|
112
133
|
class="toggleKnobInner"
|
|
113
|
-
style="left: ${this.currentX}px;"
|
|
134
|
+
style="left: ${this.padding + this.currentX}px;"
|
|
114
135
|
@pointerdown=${this.onPointerDown}
|
|
115
136
|
@pointermove=${this.onPointerMove}
|
|
116
137
|
@pointerup=${this.onPointerUp}
|
|
@@ -125,15 +146,14 @@ export class ConsentsoftwareToggle extends LitElement {
|
|
|
125
146
|
/**
|
|
126
147
|
* If required = true on first render, auto-select and set the knob to the right.
|
|
127
148
|
*/
|
|
128
|
-
public async firstUpdated() {
|
|
149
|
+
public async firstUpdated(_changedProperties: Map<PropertyKey, unknown>) {
|
|
150
|
+
await super.firstUpdated(_changedProperties);
|
|
129
151
|
if (this.required) {
|
|
130
|
-
// If "required" => always selected
|
|
131
152
|
this.selected = true;
|
|
132
|
-
this.currentX = this.
|
|
153
|
+
this.currentX = this.maxTravel;
|
|
133
154
|
this.requestUpdate();
|
|
134
155
|
} else {
|
|
135
|
-
|
|
136
|
-
this.currentX = this.selected ? this.knobWidth : 0;
|
|
156
|
+
this.currentX = this.selected ? this.maxTravel : 0;
|
|
137
157
|
this.requestUpdate();
|
|
138
158
|
}
|
|
139
159
|
}
|
|
@@ -142,7 +162,6 @@ export class ConsentsoftwareToggle extends LitElement {
|
|
|
142
162
|
* CLICK HANDLER
|
|
143
163
|
*/
|
|
144
164
|
public async handleClick(event: MouseEvent) {
|
|
145
|
-
// If the user truly dragged the knob, skip the normal click toggle.
|
|
146
165
|
if (this.isDragging || this.hasDragged) {
|
|
147
166
|
event.stopPropagation();
|
|
148
167
|
event.preventDefault();
|
|
@@ -150,26 +169,23 @@ export class ConsentsoftwareToggle extends LitElement {
|
|
|
150
169
|
}
|
|
151
170
|
|
|
152
171
|
if (this.required) {
|
|
153
|
-
//
|
|
154
|
-
this.currentX = this.
|
|
172
|
+
// Small bounce animation for required toggles
|
|
173
|
+
this.currentX = this.maxTravel;
|
|
155
174
|
this.requestUpdate();
|
|
156
175
|
await new Promise((r) => setTimeout(r, 10));
|
|
157
|
-
|
|
158
|
-
this.currentX = 20; // small bounce left
|
|
176
|
+
this.currentX = this.maxTravel - 3;
|
|
159
177
|
this.requestUpdate();
|
|
160
|
-
await delayFor(
|
|
161
|
-
|
|
162
|
-
this.currentX = this.knobWidth; // back to 30
|
|
178
|
+
await delayFor(150);
|
|
179
|
+
this.currentX = this.maxTravel;
|
|
163
180
|
this.requestUpdate();
|
|
164
181
|
return;
|
|
165
182
|
}
|
|
166
183
|
|
|
167
|
-
// Normal toggle if no drag & not required
|
|
168
184
|
event.stopPropagation();
|
|
169
185
|
event.preventDefault();
|
|
170
186
|
|
|
171
187
|
this.selected = !this.selected;
|
|
172
|
-
this.currentX = this.selected ? this.
|
|
188
|
+
this.currentX = this.selected ? this.maxTravel : 0;
|
|
173
189
|
this.requestUpdate();
|
|
174
190
|
|
|
175
191
|
this.dispatchEvent(new CustomEvent('toggle', { detail: { selected: this.selected } }));
|
|
@@ -189,7 +205,7 @@ export class ConsentsoftwareToggle extends LitElement {
|
|
|
189
205
|
|
|
190
206
|
// Start dragging
|
|
191
207
|
this.isDragging = true;
|
|
192
|
-
// The difference between the pointer
|
|
208
|
+
// The difference between the pointer's X and the knob's current position
|
|
193
209
|
this.startX = event.clientX - this.currentX;
|
|
194
210
|
|
|
195
211
|
// capture pointer so we keep receiving pointermove/pointerup
|
|
@@ -203,8 +219,8 @@ export class ConsentsoftwareToggle extends LitElement {
|
|
|
203
219
|
const toggleKnobInner: HTMLDivElement = this.shadowRoot.querySelector('.toggleKnobInner');
|
|
204
220
|
toggleKnobInner.classList.add('dragging');
|
|
205
221
|
|
|
206
|
-
// Clamp
|
|
207
|
-
this.currentX = Math.max(0, Math.min(newX, this.
|
|
222
|
+
// Clamp to valid travel range (0 to maxTravel)
|
|
223
|
+
this.currentX = Math.max(0, Math.min(newX, this.maxTravel));
|
|
208
224
|
this.requestUpdate();
|
|
209
225
|
}
|
|
210
226
|
|
|
@@ -213,17 +229,17 @@ export class ConsentsoftwareToggle extends LitElement {
|
|
|
213
229
|
(event.target as HTMLElement).releasePointerCapture(event.pointerId);
|
|
214
230
|
this.isDragging = false;
|
|
215
231
|
|
|
216
|
-
// If we didn
|
|
232
|
+
// If we didn't truly drag, pointerup does nothing; click handler handles toggling.
|
|
217
233
|
if (!this.hasDragged) {
|
|
218
234
|
return;
|
|
219
235
|
}
|
|
220
236
|
const toggleKnobInner: HTMLDivElement = this.shadowRoot.querySelector('.toggleKnobInner');
|
|
221
237
|
toggleKnobInner.classList.remove('dragging');
|
|
222
238
|
|
|
223
|
-
// Real drag => decide final side
|
|
224
|
-
const midpoint =
|
|
239
|
+
// Real drag => decide final side based on midpoint
|
|
240
|
+
const midpoint = this.maxTravel / 2;
|
|
225
241
|
this.selected = this.currentX > midpoint;
|
|
226
|
-
this.currentX = this.selected ? this.
|
|
242
|
+
this.currentX = this.selected ? this.maxTravel : 0; // snap to edge
|
|
227
243
|
this.requestUpdate();
|
|
228
244
|
|
|
229
245
|
// Dispatch toggle event
|
|
@@ -243,7 +259,7 @@ export class ConsentsoftwareToggle extends LitElement {
|
|
|
243
259
|
!this.hasDragged &&
|
|
244
260
|
!this.required
|
|
245
261
|
) {
|
|
246
|
-
this.currentX = this.selected ? this.
|
|
262
|
+
this.currentX = this.selected ? this.maxTravel : 0;
|
|
247
263
|
this.requestUpdate();
|
|
248
264
|
}
|
|
249
265
|
super.updated(changedProperties);
|
|
@@ -1,3 +1,39 @@
|
|
|
1
|
-
import { unsafeCSS } from '
|
|
1
|
+
import { unsafeCSS, cssManager } from '@design.estate/dees-element';
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export { cssManager };
|
|
4
|
+
|
|
5
|
+
export const fontStack = unsafeCSS('system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif');
|
|
6
|
+
|
|
7
|
+
// Shadcn-inspired color palette
|
|
8
|
+
export const colors = {
|
|
9
|
+
light: {
|
|
10
|
+
background: '#ffffff',
|
|
11
|
+
foreground: '#09090b',
|
|
12
|
+
muted: '#f4f4f5',
|
|
13
|
+
mutedForeground: '#71717a',
|
|
14
|
+
border: '#e4e4e7',
|
|
15
|
+
input: '#e4e4e7',
|
|
16
|
+
primary: '#18181b',
|
|
17
|
+
primaryForeground: '#fafafa',
|
|
18
|
+
secondary: '#f4f4f5',
|
|
19
|
+
secondaryForeground: '#18181b',
|
|
20
|
+
accent: '#f4f4f5',
|
|
21
|
+
accentForeground: '#18181b',
|
|
22
|
+
ring: '#a1a1aa',
|
|
23
|
+
},
|
|
24
|
+
dark: {
|
|
25
|
+
background: '#09090b',
|
|
26
|
+
foreground: '#fafafa',
|
|
27
|
+
muted: '#27272a',
|
|
28
|
+
mutedForeground: '#a1a1aa',
|
|
29
|
+
border: '#27272a',
|
|
30
|
+
input: '#27272a',
|
|
31
|
+
primary: '#fafafa',
|
|
32
|
+
primaryForeground: '#18181b',
|
|
33
|
+
secondary: '#27272a',
|
|
34
|
+
secondaryForeground: '#fafafa',
|
|
35
|
+
accent: '#27272a',
|
|
36
|
+
accentForeground: '#fafafa',
|
|
37
|
+
ring: '#52525b',
|
|
38
|
+
},
|
|
39
|
+
};
|
package/ts_web/pages/page1.ts
CHANGED