@kya-os/consent 0.2.3 → 0.3.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.
- package/README.md +217 -3
- package/dist/bundle/index.d.ts +10 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +10 -0
- package/dist/bundle/index.js.map +1 -1
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +4 -4
- package/dist/bundle/inline.js.map +1 -1
- package/dist/cjs/bundle/index.js +10 -0
- package/dist/cjs/bundle/index.js.map +1 -1
- package/dist/cjs/bundle/inline.js +4 -4
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/components/consent-action-bar.js +66 -15
- package/dist/cjs/components/consent-action-bar.js.map +1 -1
- package/dist/cjs/components/consent-agent-header.js +5 -1
- package/dist/cjs/components/consent-agent-header.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +17 -1
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-checkbox.js +2 -2
- package/dist/cjs/components/consent-checkbox.js.map +1 -1
- package/dist/cjs/components/consent-duration.js +187 -0
- package/dist/cjs/components/consent-duration.js.map +1 -0
- package/dist/cjs/components/consent-folder-scope.js +169 -0
- package/dist/cjs/components/consent-folder-scope.js.map +1 -0
- package/dist/cjs/components/consent-footer.js +13 -2
- package/dist/cjs/components/consent-footer.js.map +1 -1
- package/dist/cjs/components/consent-grant-terms.js +321 -0
- package/dist/cjs/components/consent-grant-terms.js.map +1 -0
- package/dist/cjs/components/consent-input.js +47 -27
- package/dist/cjs/components/consent-input.js.map +1 -1
- package/dist/cjs/components/consent-otp-input.js +49 -42
- package/dist/cjs/components/consent-otp-input.js.map +1 -1
- package/dist/cjs/components/consent-phone-handoff.js +219 -0
- package/dist/cjs/components/consent-phone-handoff.js.map +1 -0
- package/dist/cjs/components/consent-request-expiry.js +159 -0
- package/dist/cjs/components/consent-request-expiry.js.map +1 -0
- package/dist/cjs/components/consent-revoke.js +308 -0
- package/dist/cjs/components/consent-revoke.js.map +1 -0
- package/dist/cjs/components/consent-shell.js +3 -0
- package/dist/cjs/components/consent-shell.js.map +1 -1
- package/dist/cjs/components/consent-terms.js +2 -2
- package/dist/cjs/components/consent-terms.js.map +1 -1
- package/dist/cjs/components/consent-wallet-check.js +107 -0
- package/dist/cjs/components/consent-wallet-check.js.map +1 -0
- package/dist/cjs/components/consent-wallet-notice.js +189 -0
- package/dist/cjs/components/consent-wallet-notice.js.map +1 -0
- package/dist/cjs/components/consent-wallet-orb.js +273 -0
- package/dist/cjs/components/consent-wallet-orb.js.map +1 -0
- package/dist/cjs/components/consent-wallet-signature.js +104 -0
- package/dist/cjs/components/consent-wallet-signature.js.map +1 -0
- package/dist/cjs/components/grant-field-styles.js +85 -0
- package/dist/cjs/components/grant-field-styles.js.map +1 -0
- package/dist/cjs/components/index.js +32 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +18 -1
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/components/template-link.js +32 -0
- package/dist/cjs/components/template-link.js.map +1 -0
- package/dist/cjs/components/wallet-globe.js +184 -0
- package/dist/cjs/components/wallet-globe.js.map +1 -0
- package/dist/cjs/components/wallet-icons.js +19 -0
- package/dist/cjs/components/wallet-icons.js.map +1 -0
- package/dist/cjs/components/wallet-status.js +34 -0
- package/dist/cjs/components/wallet-status.js.map +1 -0
- package/dist/cjs/copy/tokens.js +91 -0
- package/dist/cjs/copy/tokens.js.map +1 -1
- package/dist/cjs/grant/index.js +24 -0
- package/dist/cjs/grant/index.js.map +1 -0
- package/dist/cjs/grant/terms.js +148 -0
- package/dist/cjs/grant/terms.js.map +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mcp-app/inline.js +2 -2
- package/dist/cjs/mcp-app/inline.js.map +1 -1
- package/dist/cjs/react/index.js +120 -1
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/components/consent-action-bar.d.ts +17 -0
- package/dist/components/consent-action-bar.d.ts.map +1 -1
- package/dist/components/consent-action-bar.js +67 -16
- package/dist/components/consent-action-bar.js.map +1 -1
- package/dist/components/consent-agent-header.d.ts.map +1 -1
- package/dist/components/consent-agent-header.js +5 -1
- package/dist/components/consent-agent-header.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +10 -0
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +17 -1
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-checkbox.d.ts +1 -1
- package/dist/components/consent-checkbox.js +2 -2
- package/dist/components/consent-checkbox.js.map +1 -1
- package/dist/components/consent-duration.d.ts +64 -0
- package/dist/components/consent-duration.d.ts.map +1 -0
- package/dist/components/consent-duration.js +184 -0
- package/dist/components/consent-duration.js.map +1 -0
- package/dist/components/consent-folder-scope.d.ts +70 -0
- package/dist/components/consent-folder-scope.d.ts.map +1 -0
- package/dist/components/consent-folder-scope.js +166 -0
- package/dist/components/consent-folder-scope.js.map +1 -0
- package/dist/components/consent-footer.d.ts.map +1 -1
- package/dist/components/consent-footer.js +13 -2
- package/dist/components/consent-footer.js.map +1 -1
- package/dist/components/consent-grant-terms.d.ts +88 -0
- package/dist/components/consent-grant-terms.d.ts.map +1 -0
- package/dist/components/consent-grant-terms.js +318 -0
- package/dist/components/consent-grant-terms.js.map +1 -0
- package/dist/components/consent-input.d.ts +4 -4
- package/dist/components/consent-input.d.ts.map +1 -1
- package/dist/components/consent-input.js +49 -29
- package/dist/components/consent-input.js.map +1 -1
- package/dist/components/consent-otp-input.d.ts +4 -4
- package/dist/components/consent-otp-input.d.ts.map +1 -1
- package/dist/components/consent-otp-input.js +51 -44
- package/dist/components/consent-otp-input.js.map +1 -1
- package/dist/components/consent-phone-handoff.d.ts +50 -0
- package/dist/components/consent-phone-handoff.d.ts.map +1 -0
- package/dist/components/consent-phone-handoff.js +215 -0
- package/dist/components/consent-phone-handoff.js.map +1 -0
- package/dist/components/consent-request-expiry.d.ts +52 -0
- package/dist/components/consent-request-expiry.d.ts.map +1 -0
- package/dist/components/consent-request-expiry.js +154 -0
- package/dist/components/consent-request-expiry.js.map +1 -0
- package/dist/components/consent-revoke.d.ts +53 -0
- package/dist/components/consent-revoke.d.ts.map +1 -0
- package/dist/components/consent-revoke.js +305 -0
- package/dist/components/consent-revoke.js.map +1 -0
- package/dist/components/consent-shell.d.ts.map +1 -1
- package/dist/components/consent-shell.js +3 -0
- package/dist/components/consent-shell.js.map +1 -1
- package/dist/components/consent-terms.d.ts +1 -1
- package/dist/components/consent-terms.js +2 -2
- package/dist/components/consent-terms.js.map +1 -1
- package/dist/components/consent-wallet-check.d.ts +45 -0
- package/dist/components/consent-wallet-check.d.ts.map +1 -0
- package/dist/components/consent-wallet-check.js +102 -0
- package/dist/components/consent-wallet-check.js.map +1 -0
- package/dist/components/consent-wallet-notice.d.ts +54 -0
- package/dist/components/consent-wallet-notice.d.ts.map +1 -0
- package/dist/components/consent-wallet-notice.js +186 -0
- package/dist/components/consent-wallet-notice.js.map +1 -0
- package/dist/components/consent-wallet-orb.d.ts +48 -0
- package/dist/components/consent-wallet-orb.d.ts.map +1 -0
- package/dist/components/consent-wallet-orb.js +269 -0
- package/dist/components/consent-wallet-orb.js.map +1 -0
- package/dist/components/consent-wallet-signature.d.ts +26 -0
- package/dist/components/consent-wallet-signature.d.ts.map +1 -0
- package/dist/components/consent-wallet-signature.js +101 -0
- package/dist/components/consent-wallet-signature.js.map +1 -0
- package/dist/components/grant-field-styles.d.ts +9 -0
- package/dist/components/grant-field-styles.d.ts.map +1 -0
- package/dist/components/grant-field-styles.js +82 -0
- package/dist/components/grant-field-styles.js.map +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +13 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +18 -1
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/components/template-link.d.ts +24 -0
- package/dist/components/template-link.d.ts.map +1 -0
- package/dist/components/template-link.js +29 -0
- package/dist/components/template-link.js.map +1 -0
- package/dist/components/wallet-globe.d.ts +29 -0
- package/dist/components/wallet-globe.d.ts.map +1 -0
- package/dist/components/wallet-globe.js +181 -0
- package/dist/components/wallet-globe.js.map +1 -0
- package/dist/components/wallet-icons.d.ts +16 -0
- package/dist/components/wallet-icons.d.ts.map +1 -0
- package/dist/components/wallet-icons.js +16 -0
- package/dist/components/wallet-icons.js.map +1 -0
- package/dist/components/wallet-status.d.ts +19 -0
- package/dist/components/wallet-status.d.ts.map +1 -0
- package/dist/components/wallet-status.js +29 -0
- package/dist/components/wallet-status.js.map +1 -0
- package/dist/consent.js +3126 -783
- package/dist/consent.min.js +1331 -272
- package/dist/copy/tokens.d.ts +91 -0
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +91 -0
- package/dist/copy/tokens.js.map +1 -1
- package/dist/grant/index.d.ts +8 -0
- package/dist/grant/index.d.ts.map +1 -0
- package/dist/grant/index.js +8 -0
- package/dist/grant/index.js.map +1 -0
- package/dist/grant/terms.d.ts +97 -0
- package/dist/grant/terms.d.ts.map +1 -0
- package/dist/grant/terms.js +139 -0
- package/dist/grant/terms.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-app/inline.d.ts.map +1 -1
- package/dist/mcp-app/inline.js +2 -2
- package/dist/mcp-app/inline.js.map +1 -1
- package/dist/react/index.d.ts +74 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +119 -0
- package/dist/react/index.js.map +1 -1
- package/package.json +10 -4
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent Grant Terms
|
|
3
|
+
*
|
|
4
|
+
* The terms of a grant, closed by default behind one line that says what is
|
|
5
|
+
* in effect ("8 hours · Every folder") and a Customize button. The defaults
|
|
6
|
+
* don't compete with the decision itself, and nothing is hidden: the closed
|
|
7
|
+
* line always shows the values.
|
|
8
|
+
*
|
|
9
|
+
* The fields are its child elements. With none, it shows a
|
|
10
|
+
* `consent-duration` and a `consent-folder-scope` with their defaults. Slot your own to configure
|
|
11
|
+
* them, or to add a field of your own: any child with a `grantTerms` property
|
|
12
|
+
* is a field. It may also have `summary` (a string for the closed line) and
|
|
13
|
+
* `valid` (false while its terms can't be used), and it should dispatch
|
|
14
|
+
* `consent-grant-field-change` when they change.
|
|
15
|
+
*
|
|
16
|
+
* `grantTerms` merges the fields' terms (`mergeGrantTerms`) into the shape
|
|
17
|
+
* `@kya-os/id`'s `issueDelegation()` takes. Read `valid` first.
|
|
18
|
+
*
|
|
19
|
+
* Inside `consent-capabilities-screen`, put it in the `details` slot: the
|
|
20
|
+
* screen adds its terms to `capabilities-allow` and keeps Allow off while
|
|
21
|
+
* they aren't valid.
|
|
22
|
+
*
|
|
23
|
+
* @module components/consent-grant-terms
|
|
24
|
+
*/
|
|
25
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
26
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
27
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
28
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
29
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
30
|
+
};
|
|
31
|
+
import { LitElement, html, css, nothing } from "lit";
|
|
32
|
+
import { customElement, property } from "lit/decorators.js";
|
|
33
|
+
import { CONSENT_COPY_TOKENS } from "../copy/tokens.js";
|
|
34
|
+
import { mergeGrantTerms } from "../grant/terms.js";
|
|
35
|
+
import "./consent-duration.js";
|
|
36
|
+
import "./consent-folder-scope.js";
|
|
37
|
+
/** The events the group listens for to learn a field changed. */
|
|
38
|
+
export const GRANT_FIELD_EVENTS = [
|
|
39
|
+
"consent-duration-change",
|
|
40
|
+
"consent-folder-scope-change",
|
|
41
|
+
"consent-grant-field-change",
|
|
42
|
+
];
|
|
43
|
+
function isGrantField(el) {
|
|
44
|
+
return "grantTerms" in el;
|
|
45
|
+
}
|
|
46
|
+
let nextId = 0;
|
|
47
|
+
/**
|
|
48
|
+
* @fires consent-grant-terms-change - A field changed: `{ terms, valid, summary }`.
|
|
49
|
+
* @slot - The fields. Without child elements: a duration and a folder field.
|
|
50
|
+
* @csspart frame - The outline around the closed line and the fields.
|
|
51
|
+
* @csspart toggle - The closed line and its Customize button.
|
|
52
|
+
* @csspart summary - The terms in effect, on the closed line.
|
|
53
|
+
* @csspart body - What opens: the fields.
|
|
54
|
+
* @csspart pass-on - The line `chained` adds.
|
|
55
|
+
*/
|
|
56
|
+
let ConsentGrantTerms = class ConsentGrantTerms extends LitElement {
|
|
57
|
+
constructor() {
|
|
58
|
+
super();
|
|
59
|
+
this.open = false;
|
|
60
|
+
/**
|
|
61
|
+
* The grant is a link in a delegation chain: say that the agent can pass
|
|
62
|
+
* on only a narrower grant. True of every `@kya-os/id` chain.
|
|
63
|
+
*/
|
|
64
|
+
this.chained = false;
|
|
65
|
+
this.customizeLabel = CONSENT_COPY_TOKENS.grant.customize;
|
|
66
|
+
this.bodyId = `consent-grant-terms-${++nextId}`;
|
|
67
|
+
for (const type of GRANT_FIELD_EVENTS) {
|
|
68
|
+
this.addEventListener(type, () => this.fieldChanged());
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The default fields show while the element has no child elements. Not
|
|
73
|
+
* slot fallback content: whitespace between the tags is slotted too, and
|
|
74
|
+
* would hide the fallback.
|
|
75
|
+
*/
|
|
76
|
+
get usesDefaults() {
|
|
77
|
+
return (this.children?.length ?? 0) === 0;
|
|
78
|
+
}
|
|
79
|
+
/** The fields: the children with `grantTerms`, or the defaults. */
|
|
80
|
+
get fields() {
|
|
81
|
+
if (!this.usesDefaults) {
|
|
82
|
+
return Array.from(this.children).filter(isGrantField);
|
|
83
|
+
}
|
|
84
|
+
const defaults = this.renderRoot?.querySelector?.(".defaults");
|
|
85
|
+
return defaults ? [...defaults.children].filter(isGrantField) : [];
|
|
86
|
+
}
|
|
87
|
+
/** False while a field's terms can't be used. */
|
|
88
|
+
get valid() {
|
|
89
|
+
return this.fields.every((f) => f.valid !== false);
|
|
90
|
+
}
|
|
91
|
+
/** Every field's terms, merged. */
|
|
92
|
+
get grantTerms() {
|
|
93
|
+
return mergeGrantTerms(...this.fields.filter((f) => f.valid !== false).map((f) => f.grantTerms));
|
|
94
|
+
}
|
|
95
|
+
/** The closed line: each field's summary. */
|
|
96
|
+
get summary() {
|
|
97
|
+
return this.fields
|
|
98
|
+
.map((f) => f.summary)
|
|
99
|
+
.filter((s) => Boolean(s))
|
|
100
|
+
.join(CONSENT_COPY_TOKENS.grant.summarySeparator);
|
|
101
|
+
}
|
|
102
|
+
fieldChanged() {
|
|
103
|
+
// The fields update themselves first; read them after they render.
|
|
104
|
+
void this.updateComplete.then(async () => {
|
|
105
|
+
await Promise.all(this.fields.map((f) => f instanceof LitElement ? f.updateComplete : undefined));
|
|
106
|
+
this.requestUpdate();
|
|
107
|
+
this.dispatchEvent(new CustomEvent("consent-grant-terms-change", {
|
|
108
|
+
detail: {
|
|
109
|
+
terms: this.grantTerms,
|
|
110
|
+
valid: this.valid,
|
|
111
|
+
summary: this.summary,
|
|
112
|
+
},
|
|
113
|
+
bubbles: true,
|
|
114
|
+
composed: true,
|
|
115
|
+
}));
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
onSlotChange() {
|
|
119
|
+
this.requestUpdate();
|
|
120
|
+
}
|
|
121
|
+
toggle() {
|
|
122
|
+
this.open = !this.open;
|
|
123
|
+
}
|
|
124
|
+
firstUpdated() {
|
|
125
|
+
// The summary reads the fields, which exist only once the slot does.
|
|
126
|
+
void Promise.all(this.fields.map((f) => f instanceof LitElement ? f.updateComplete : undefined)).then(() => this.requestUpdate());
|
|
127
|
+
}
|
|
128
|
+
render() {
|
|
129
|
+
const summary = this.hasUpdated ? this.summary : "";
|
|
130
|
+
return html `
|
|
131
|
+
<div part="frame" class="frame">
|
|
132
|
+
<button
|
|
133
|
+
part="toggle"
|
|
134
|
+
class="toggle"
|
|
135
|
+
type="button"
|
|
136
|
+
aria-expanded=${this.open ? "true" : "false"}
|
|
137
|
+
aria-controls=${this.bodyId}
|
|
138
|
+
@click=${this.toggle}
|
|
139
|
+
>
|
|
140
|
+
<span part="summary" class="summary ${this.valid ? "" : "invalid"}"
|
|
141
|
+
>${summary}</span
|
|
142
|
+
>
|
|
143
|
+
<span class="customize">
|
|
144
|
+
${this.customizeLabel}
|
|
145
|
+
<svg
|
|
146
|
+
class="chevron"
|
|
147
|
+
viewBox="0 0 16 16"
|
|
148
|
+
fill="none"
|
|
149
|
+
stroke="currentColor"
|
|
150
|
+
stroke-width="1.6"
|
|
151
|
+
stroke-linecap="round"
|
|
152
|
+
stroke-linejoin="round"
|
|
153
|
+
aria-hidden="true"
|
|
154
|
+
>
|
|
155
|
+
<path d="M4 6l4 4 4-4" />
|
|
156
|
+
</svg>
|
|
157
|
+
</span>
|
|
158
|
+
</button>
|
|
159
|
+
<div part="body" class="body" id=${this.bodyId} ?hidden=${!this.open}>
|
|
160
|
+
<slot @slotchange=${this.onSlotChange}></slot>
|
|
161
|
+
${this.usesDefaults
|
|
162
|
+
? html `<div class="defaults">
|
|
163
|
+
<consent-duration></consent-duration>
|
|
164
|
+
<consent-folder-scope></consent-folder-scope>
|
|
165
|
+
</div>`
|
|
166
|
+
: nothing}
|
|
167
|
+
${this.chained
|
|
168
|
+
? html `<p part="pass-on" class="pass-on">
|
|
169
|
+
${CONSENT_COPY_TOKENS.grant.passOn}
|
|
170
|
+
</p>`
|
|
171
|
+
: nothing}
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
`;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
ConsentGrantTerms.styles = css `
|
|
178
|
+
:host {
|
|
179
|
+
display: block;
|
|
180
|
+
font-family: inherit;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* The outline lives inside the shadow root, not on the host: a page's
|
|
184
|
+
rules beat :host rules, so a CSS reset (Tailwind's preflight zeroes
|
|
185
|
+
every border) would otherwise erase it. */
|
|
186
|
+
.frame {
|
|
187
|
+
border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.12));
|
|
188
|
+
border-radius: var(--cs-field-radius, 12px);
|
|
189
|
+
background: var(--cs-grant-bg, transparent);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
:host([hidden]) {
|
|
193
|
+
display: none;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* When the line and Customize don't fit side by side, Customize moves
|
|
197
|
+
under the line rather than squeezing it a word wide. */
|
|
198
|
+
.toggle {
|
|
199
|
+
display: flex;
|
|
200
|
+
flex-wrap: wrap;
|
|
201
|
+
width: 100%;
|
|
202
|
+
align-items: center;
|
|
203
|
+
justify-content: space-between;
|
|
204
|
+
gap: 4px 8px;
|
|
205
|
+
margin: 0;
|
|
206
|
+
padding: 11px 14px;
|
|
207
|
+
border: 0;
|
|
208
|
+
border-radius: inherit;
|
|
209
|
+
background: none;
|
|
210
|
+
color: inherit;
|
|
211
|
+
font: inherit;
|
|
212
|
+
text-align: left;
|
|
213
|
+
cursor: pointer;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
:host([open]) .toggle {
|
|
217
|
+
border-bottom-left-radius: 0;
|
|
218
|
+
border-bottom-right-radius: 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.toggle:hover {
|
|
222
|
+
background: var(--cs-row-hover-bg, rgba(15, 23, 42, 0.03));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.toggle:focus-visible {
|
|
226
|
+
outline: 2px solid var(--cs-focus-ring, #0f172a);
|
|
227
|
+
outline-offset: 2px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* It wraps rather than ellipsizes: the line says what the person is
|
|
231
|
+
granting, so a narrow screen must not hide the folder. Words stay
|
|
232
|
+
whole; only a folder longer than the whole line is broken. */
|
|
233
|
+
.summary {
|
|
234
|
+
min-width: 0;
|
|
235
|
+
color: var(--cs-text-secondary, #334155);
|
|
236
|
+
font-size: 12.5px;
|
|
237
|
+
line-height: 1.4;
|
|
238
|
+
overflow-wrap: break-word;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.summary.invalid {
|
|
242
|
+
color: var(--cs-danger, #b42318);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.customize {
|
|
246
|
+
display: inline-flex;
|
|
247
|
+
flex-shrink: 0;
|
|
248
|
+
align-items: center;
|
|
249
|
+
gap: 4px;
|
|
250
|
+
color: var(--cs-text-primary, #0f172a);
|
|
251
|
+
font-size: 12.5px;
|
|
252
|
+
font-weight: 500;
|
|
253
|
+
/* The summary's line height, so the two share a baseline whatever
|
|
254
|
+
line height the page sets. */
|
|
255
|
+
line-height: 1.4;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.chevron {
|
|
259
|
+
width: 14px;
|
|
260
|
+
height: 14px;
|
|
261
|
+
transition: transform 0.2s ease;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
:host([open]) .chevron {
|
|
265
|
+
transform: rotate(180deg);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@media (prefers-reduced-motion: reduce) {
|
|
269
|
+
.chevron {
|
|
270
|
+
transition: none;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.body {
|
|
275
|
+
display: grid;
|
|
276
|
+
gap: 16px;
|
|
277
|
+
padding: 14px 14px 16px;
|
|
278
|
+
border-top: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.12));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.body[hidden] {
|
|
282
|
+
display: none;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
::slotted(*) {
|
|
286
|
+
margin: 0;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.defaults {
|
|
290
|
+
display: grid;
|
|
291
|
+
gap: 16px;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
slot {
|
|
295
|
+
display: contents;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.pass-on {
|
|
299
|
+
margin: 0;
|
|
300
|
+
color: var(--cs-text-secondary, #334155);
|
|
301
|
+
font-size: 12px;
|
|
302
|
+
line-height: 1.45;
|
|
303
|
+
}
|
|
304
|
+
`;
|
|
305
|
+
__decorate([
|
|
306
|
+
property({ type: Boolean, reflect: true })
|
|
307
|
+
], ConsentGrantTerms.prototype, "open", void 0);
|
|
308
|
+
__decorate([
|
|
309
|
+
property({ type: Boolean, reflect: true })
|
|
310
|
+
], ConsentGrantTerms.prototype, "chained", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
property({ type: String, attribute: "customize-label" })
|
|
313
|
+
], ConsentGrantTerms.prototype, "customizeLabel", void 0);
|
|
314
|
+
ConsentGrantTerms = __decorate([
|
|
315
|
+
customElement("consent-grant-terms")
|
|
316
|
+
], ConsentGrantTerms);
|
|
317
|
+
export { ConsentGrantTerms };
|
|
318
|
+
//# sourceMappingURL=consent-grant-terms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent-grant-terms.js","sourceRoot":"","sources":["../../src/components/consent-grant-terms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAA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,IAAI,CAAC,YAAY;YACnC,IAAI,CAAC,YAAY;YACjB,CAAC,CAAC,IAAI,CAAA;;;qBAGG;YACT,CAAC,CAAC,OAAO;YACT,IAAI,CAAC,OAAO;YACZ,CAAC,CAAC,IAAI,CAAA;kBACA,mBAAmB,CAAC,KAAK,CAAC,MAAM;mBAC/B;YACP,CAAC,CAAC,OAAO;;;KAGhB,CAAC;IACJ,CAAC;;AArQe,wBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+H3B,AA/HqB,CA+HpB;AA1I0C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAc;AAKb;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAiB;AAE5D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;yDACI;AARlD,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAkR7B"}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module components/consent-input
|
|
8
8
|
*/
|
|
9
|
-
import { LitElement } from
|
|
9
|
+
import { LitElement } from "lit";
|
|
10
10
|
/**
|
|
11
11
|
* Input types supported
|
|
12
12
|
*/
|
|
13
|
-
export type InputType =
|
|
13
|
+
export type InputType = "text" | "email" | "password" | "tel" | "url";
|
|
14
14
|
/**
|
|
15
15
|
* ConsentInput - A themed input component with label
|
|
16
16
|
*
|
|
@@ -40,7 +40,7 @@ export declare class ConsentInput extends LitElement {
|
|
|
40
40
|
*/
|
|
41
41
|
type: InputType;
|
|
42
42
|
/**
|
|
43
|
-
* Form field name
|
|
43
|
+
* Form field name. Reflected: a form reads the attribute.
|
|
44
44
|
*/
|
|
45
45
|
name: string;
|
|
46
46
|
/**
|
|
@@ -85,7 +85,7 @@ export declare class ConsentInput extends LitElement {
|
|
|
85
85
|
}
|
|
86
86
|
declare global {
|
|
87
87
|
interface HTMLElementTagNameMap {
|
|
88
|
-
|
|
88
|
+
"consent-input": ConsentInput;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
//# sourceMappingURL=consent-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-input.d.ts","sourceRoot":"","sources":["../../src/components/consent-input.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,YAAa,SAAQ,UAAU;IAE1C,MAAM,CAAC,cAAc,UAAQ;IAE7B,OAAO,CAAC,SAAS,CAAmB;;IAOpC;;OAEG;IAEH,IAAI,EAAE,SAAS,CAAU;IAEzB;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,KAAK,SAAM;IAEX;;OAEG;IAEH,KAAK,SAAM;IAEX;;OAEG;IAEH,WAAW,SAAM;IAEjB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,YAAY,SAAM;IAElB;;OAEG;IAEH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IAEH,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"consent-input.d.ts","sourceRoot":"","sources":["../../src/components/consent-input.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,YAAa,SAAQ,UAAU;IAE1C,MAAM,CAAC,cAAc,UAAQ;IAE7B,OAAO,CAAC,SAAS,CAAmB;;IAOpC;;OAEG;IAEH,IAAI,EAAE,SAAS,CAAU;IAEzB;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,KAAK,SAAM;IAEX;;OAEG;IAEH,KAAK,SAAM;IAEX;;OAEG;IAEH,WAAW,SAAM;IAEjB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,YAAY,SAAM;IAElB;;OAEG;IAEH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IAEH,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAgB,MAAM,0BAmIpB;cAGiB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAMlE,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,oBAAoB;IA4CnB,MAAM;CAqChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
|
@@ -12,8 +12,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
|
-
import { LitElement, html, css } from
|
|
16
|
-
import { customElement, property, state } from
|
|
15
|
+
import { LitElement, html, css } from "lit";
|
|
16
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
17
17
|
/**
|
|
18
18
|
* ConsentInput - A themed input component with label
|
|
19
19
|
*
|
|
@@ -40,23 +40,23 @@ let ConsentInput = class ConsentInput extends LitElement {
|
|
|
40
40
|
/**
|
|
41
41
|
* Input type
|
|
42
42
|
*/
|
|
43
|
-
this.type =
|
|
43
|
+
this.type = "text";
|
|
44
44
|
/**
|
|
45
|
-
* Form field name
|
|
45
|
+
* Form field name. Reflected: a form reads the attribute.
|
|
46
46
|
*/
|
|
47
|
-
this.name =
|
|
47
|
+
this.name = "";
|
|
48
48
|
/**
|
|
49
49
|
* Input value
|
|
50
50
|
*/
|
|
51
|
-
this.value =
|
|
51
|
+
this.value = "";
|
|
52
52
|
/**
|
|
53
53
|
* Label text
|
|
54
54
|
*/
|
|
55
|
-
this.label =
|
|
55
|
+
this.label = "";
|
|
56
56
|
/**
|
|
57
57
|
* Placeholder text
|
|
58
58
|
*/
|
|
59
|
-
this.placeholder =
|
|
59
|
+
this.placeholder = "";
|
|
60
60
|
/**
|
|
61
61
|
* Required for form validation
|
|
62
62
|
*/
|
|
@@ -68,7 +68,7 @@ let ConsentInput = class ConsentInput extends LitElement {
|
|
|
68
68
|
/**
|
|
69
69
|
* Autocomplete attribute
|
|
70
70
|
*/
|
|
71
|
-
this.autocomplete =
|
|
71
|
+
this.autocomplete = "";
|
|
72
72
|
/**
|
|
73
73
|
* Show password toggle for password inputs
|
|
74
74
|
*/
|
|
@@ -77,7 +77,7 @@ let ConsentInput = class ConsentInput extends LitElement {
|
|
|
77
77
|
}
|
|
78
78
|
// Update form value when properties change
|
|
79
79
|
updated(changedProperties) {
|
|
80
|
-
if (changedProperties.has(
|
|
80
|
+
if (changedProperties.has("value")) {
|
|
81
81
|
this.internals.setFormValue(this.value || null);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -85,7 +85,7 @@ let ConsentInput = class ConsentInput extends LitElement {
|
|
|
85
85
|
const input = e.target;
|
|
86
86
|
this.value = input.value;
|
|
87
87
|
this.internals.setFormValue(this.value || null);
|
|
88
|
-
this.dispatchEvent(new CustomEvent(
|
|
88
|
+
this.dispatchEvent(new CustomEvent("input", {
|
|
89
89
|
detail: { value: this.value },
|
|
90
90
|
bubbles: true,
|
|
91
91
|
composed: true,
|
|
@@ -94,7 +94,7 @@ let ConsentInput = class ConsentInput extends LitElement {
|
|
|
94
94
|
handleChange(e) {
|
|
95
95
|
const input = e.target;
|
|
96
96
|
this.value = input.value;
|
|
97
|
-
this.dispatchEvent(new CustomEvent(
|
|
97
|
+
this.dispatchEvent(new CustomEvent("change", {
|
|
98
98
|
detail: { value: this.value },
|
|
99
99
|
bubbles: true,
|
|
100
100
|
composed: true,
|
|
@@ -104,19 +104,33 @@ let ConsentInput = class ConsentInput extends LitElement {
|
|
|
104
104
|
this.showPassword = !this.showPassword;
|
|
105
105
|
}
|
|
106
106
|
renderPasswordToggle() {
|
|
107
|
-
if (this.type !==
|
|
107
|
+
if (this.type !== "password")
|
|
108
108
|
return null;
|
|
109
109
|
const icon = this.showPassword
|
|
110
110
|
? html `
|
|
111
|
-
<svg
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
<svg
|
|
112
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
113
|
+
viewBox="0 0 24 24"
|
|
114
|
+
fill="none"
|
|
115
|
+
stroke="currentColor"
|
|
116
|
+
stroke-width="2"
|
|
117
|
+
>
|
|
118
|
+
<path
|
|
119
|
+
d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"
|
|
120
|
+
/>
|
|
121
|
+
<line x1="1" y1="1" x2="23" y2="23" />
|
|
114
122
|
</svg>
|
|
115
123
|
`
|
|
116
124
|
: html `
|
|
117
|
-
<svg
|
|
118
|
-
|
|
119
|
-
|
|
125
|
+
<svg
|
|
126
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
127
|
+
viewBox="0 0 24 24"
|
|
128
|
+
fill="none"
|
|
129
|
+
stroke="currentColor"
|
|
130
|
+
stroke-width="2"
|
|
131
|
+
>
|
|
132
|
+
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" />
|
|
133
|
+
<circle cx="12" cy="12" r="3" />
|
|
120
134
|
</svg>
|
|
121
135
|
`;
|
|
122
136
|
return html `
|
|
@@ -125,24 +139,26 @@ let ConsentInput = class ConsentInput extends LitElement {
|
|
|
125
139
|
class="password-toggle"
|
|
126
140
|
@click=${this.togglePasswordVisibility}
|
|
127
141
|
tabindex="-1"
|
|
128
|
-
aria-label=${this.showPassword ?
|
|
142
|
+
aria-label=${this.showPassword ? "Hide password" : "Show password"}
|
|
129
143
|
>
|
|
130
144
|
${icon}
|
|
131
145
|
</button>
|
|
132
146
|
`;
|
|
133
147
|
}
|
|
134
148
|
render() {
|
|
135
|
-
const inputType = this.type ===
|
|
149
|
+
const inputType = this.type === "password" && this.showPassword ? "text" : this.type;
|
|
136
150
|
return html `
|
|
137
151
|
<div class="field">
|
|
138
152
|
${this.label
|
|
139
153
|
? html `
|
|
140
154
|
<label part="label" for="input">
|
|
141
|
-
${this.label}${this.required
|
|
155
|
+
${this.label}${this.required
|
|
156
|
+
? html `<span class="required">*</span>`
|
|
157
|
+
: null}
|
|
142
158
|
</label>
|
|
143
159
|
`
|
|
144
160
|
: null}
|
|
145
|
-
<div class="input-wrapper${this.error ?
|
|
161
|
+
<div class="input-wrapper${this.error ? " has-error" : ""}">
|
|
146
162
|
<input
|
|
147
163
|
part="input"
|
|
148
164
|
id="input"
|
|
@@ -152,13 +168,15 @@ let ConsentInput = class ConsentInput extends LitElement {
|
|
|
152
168
|
placeholder=${this.placeholder}
|
|
153
169
|
?required=${this.required}
|
|
154
170
|
?disabled=${this.disabled}
|
|
155
|
-
autocomplete=${this.autocomplete ||
|
|
171
|
+
autocomplete=${this.autocomplete || "off"}
|
|
156
172
|
@input=${this.handleInput}
|
|
157
173
|
@change=${this.handleChange}
|
|
158
174
|
/>
|
|
159
175
|
${this.renderPasswordToggle()}
|
|
160
176
|
</div>
|
|
161
|
-
${this.error
|
|
177
|
+
${this.error
|
|
178
|
+
? html `<div class="error-message">${this.error}</div>`
|
|
179
|
+
: null}
|
|
162
180
|
</div>
|
|
163
181
|
`;
|
|
164
182
|
}
|
|
@@ -200,7 +218,9 @@ ConsentInput.styles = css `
|
|
|
200
218
|
border-radius: 0.5rem;
|
|
201
219
|
outline: none;
|
|
202
220
|
box-shadow: none;
|
|
203
|
-
transition:
|
|
221
|
+
transition:
|
|
222
|
+
border-color 0.15s ease,
|
|
223
|
+
box-shadow 0.15s ease;
|
|
204
224
|
}
|
|
205
225
|
|
|
206
226
|
.input-wrapper input:focus {
|
|
@@ -247,7 +267,7 @@ ConsentInput.styles = css `
|
|
|
247
267
|
}
|
|
248
268
|
|
|
249
269
|
/* Password toggle */
|
|
250
|
-
.input-wrapper input[type=
|
|
270
|
+
.input-wrapper input[type="password"] {
|
|
251
271
|
padding-right: 2.5rem;
|
|
252
272
|
}
|
|
253
273
|
|
|
@@ -299,7 +319,7 @@ __decorate([
|
|
|
299
319
|
property({ type: String })
|
|
300
320
|
], ConsentInput.prototype, "type", void 0);
|
|
301
321
|
__decorate([
|
|
302
|
-
property({ type: String })
|
|
322
|
+
property({ type: String, reflect: true })
|
|
303
323
|
], ConsentInput.prototype, "name", void 0);
|
|
304
324
|
__decorate([
|
|
305
325
|
property({ type: String })
|
|
@@ -326,7 +346,7 @@ __decorate([
|
|
|
326
346
|
state()
|
|
327
347
|
], ConsentInput.prototype, "showPassword", void 0);
|
|
328
348
|
ConsentInput = __decorate([
|
|
329
|
-
customElement(
|
|
349
|
+
customElement("consent-input")
|
|
330
350
|
], ConsentInput);
|
|
331
351
|
export { ConsentInput };
|
|
332
352
|
//# sourceMappingURL=consent-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-input.js","sourceRoot":"","sources":["../../src/components/consent-input.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAOnE;;;;;;;;;;;;;;;;;;;GAmBG;AAEI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAM1C;QACE,KAAK,EAAE,CAAC;QAIV;;WAEG;QAEH,SAAI,GAAc,MAAM,CAAC;QAEzB;;WAEG;QAEH,SAAI,GAAG,EAAE,CAAC;QAEV;;WAEG;QAEH,UAAK,GAAG,EAAE,CAAC;QAEX;;WAEG;QAEH,UAAK,GAAG,EAAE,CAAC;QAEX;;WAEG;QAEH,gBAAW,GAAG,EAAE,CAAC;QAEjB;;WAEG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;WAEG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;WAEG;QAEH,iBAAY,GAAG,EAAE,CAAC;QAQlB;;WAEG;QAEK,iBAAY,GAAG,KAAK,CAAC;QA7D3B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IAC1C,CAAC;
|
|
1
|
+
{"version":3,"file":"consent-input.js","sourceRoot":"","sources":["../../src/components/consent-input.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAOnE;;;;;;;;;;;;;;;;;;;GAmBG;AAEI,IAAM,YAAY,GAAlB,M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kDACT;AAMlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACZ;AAMP;IADP,KAAK,EAAE;kDACqB;AArElB,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAmUxB"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module components/consent-otp-input
|
|
9
9
|
*/
|
|
10
|
-
import { LitElement, TemplateResult } from
|
|
10
|
+
import { LitElement, TemplateResult } from "lit";
|
|
11
11
|
/**
|
|
12
12
|
* ConsentOTPInput - OTP digit input boxes
|
|
13
13
|
*
|
|
@@ -35,7 +35,7 @@ export declare class ConsentOTPInput extends LitElement {
|
|
|
35
35
|
*/
|
|
36
36
|
length: number;
|
|
37
37
|
/**
|
|
38
|
-
* Form field name
|
|
38
|
+
* Form field name. Reflected: a form reads the attribute.
|
|
39
39
|
*/
|
|
40
40
|
name: string;
|
|
41
41
|
/**
|
|
@@ -57,7 +57,7 @@ export declare class ConsentOTPInput extends LitElement {
|
|
|
57
57
|
/**
|
|
58
58
|
* Input type (text or number)
|
|
59
59
|
*/
|
|
60
|
-
inputType:
|
|
60
|
+
inputType: "text" | "number";
|
|
61
61
|
/**
|
|
62
62
|
* Internal digit values
|
|
63
63
|
*/
|
|
@@ -91,7 +91,7 @@ export declare class ConsentOTPInput extends LitElement {
|
|
|
91
91
|
}
|
|
92
92
|
declare global {
|
|
93
93
|
interface HTMLElementTagNameMap {
|
|
94
|
-
|
|
94
|
+
"consent-otp-input": ConsentOTPInput;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
//# sourceMappingURL=consent-otp-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-otp-input.d.ts","sourceRoot":"","sources":["../../src/components/consent-otp-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAG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