@kya-os/consent 0.3.0 → 0.4.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/README.md +185 -20
- package/dist/bundle/index.d.ts +4 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +6 -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 +15 -1
- 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 +97 -25
- package/dist/cjs/components/consent-action-bar.js.map +1 -1
- package/dist/cjs/components/consent-agent-header.js +7 -105
- package/dist/cjs/components/consent-agent-header.js.map +1 -1
- package/dist/cjs/components/consent-button.js +6 -1
- package/dist/cjs/components/consent-button.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +488 -66
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-capability-card.js +197 -42
- package/dist/cjs/components/consent-capability-card.js.map +1 -1
- package/dist/cjs/components/consent-checkbox.js +7 -0
- package/dist/cjs/components/consent-checkbox.js.map +1 -1
- package/dist/cjs/components/consent-connector-header.js +206 -43
- package/dist/cjs/components/consent-connector-header.js.map +1 -1
- package/dist/cjs/components/consent-duration.js +1 -1
- package/dist/cjs/components/consent-footer.js +13 -12
- package/dist/cjs/components/consent-footer.js.map +1 -1
- package/dist/cjs/components/consent-headline.js +445 -30
- package/dist/cjs/components/consent-headline.js.map +1 -1
- package/dist/cjs/components/consent-oauth-button.js +71 -62
- package/dist/cjs/components/consent-oauth-button.js.map +1 -1
- package/dist/cjs/components/consent-otp-input.js +5 -0
- package/dist/cjs/components/consent-otp-input.js.map +1 -1
- package/dist/cjs/components/consent-phone-handoff.js +3 -3
- package/dist/cjs/components/consent-request-expiry.js +1 -1
- package/dist/cjs/components/consent-revocation-notice.js +4 -2
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
- package/dist/cjs/components/consent-revoke.js +9 -4
- package/dist/cjs/components/consent-revoke.js.map +1 -1
- package/dist/cjs/components/consent-secured-by.js +106 -0
- package/dist/cjs/components/consent-secured-by.js.map +1 -0
- package/dist/cjs/components/consent-shell.js +1 -1
- package/dist/cjs/components/consent-terms.js +7 -0
- package/dist/cjs/components/consent-terms.js.map +1 -1
- package/dist/cjs/components/consent-wallet-check.js +1 -1
- package/dist/cjs/components/consent-wallet-notice.js +1 -1
- package/dist/cjs/components/consent-wallet-orb.js +1 -1
- package/dist/cjs/components/consent-wallet-signature.js +1 -1
- package/dist/cjs/components/decision-icons.js +33 -0
- package/dist/cjs/components/decision-icons.js.map +1 -0
- package/dist/cjs/components/edit-region.js +309 -0
- package/dist/cjs/components/edit-region.js.map +1 -0
- package/dist/cjs/components/grant-field-styles.js +2 -2
- package/dist/cjs/components/index.js +5 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +81 -36
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/components/preview.js +67 -0
- package/dist/cjs/components/preview.js.map +1 -0
- package/dist/cjs/constants/capabilities.js +21 -2
- package/dist/cjs/constants/capabilities.js.map +1 -1
- package/dist/cjs/copy/tokens.js +60 -21
- package/dist/cjs/copy/tokens.js.map +1 -1
- package/dist/cjs/identity/agent-identity.js +3 -2
- package/dist/cjs/identity/agent-identity.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 +11 -2
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/styles/brand.js +385 -0
- package/dist/cjs/styles/brand.js.map +1 -0
- package/dist/cjs/styles/index.js +1 -0
- package/dist/cjs/styles/index.js.map +1 -1
- package/dist/cjs/styles/theme.js +100 -30
- package/dist/cjs/styles/theme.js.map +1 -1
- package/dist/cjs/types/capabilities.types.js +1 -2
- package/dist/cjs/types/capabilities.types.js.map +1 -1
- package/dist/cjs/types/decision.types.js +13 -0
- package/dist/cjs/types/decision.types.js.map +1 -0
- package/dist/cjs/types/edit.types.js +80 -0
- package/dist/cjs/types/edit.types.js.map +1 -0
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/components/consent-action-bar.d.ts +20 -1
- package/dist/components/consent-action-bar.d.ts.map +1 -1
- package/dist/components/consent-action-bar.js +97 -25
- package/dist/components/consent-action-bar.js.map +1 -1
- package/dist/components/consent-agent-header.d.ts +4 -17
- package/dist/components/consent-agent-header.d.ts.map +1 -1
- package/dist/components/consent-agent-header.js +7 -105
- package/dist/components/consent-agent-header.js.map +1 -1
- package/dist/components/consent-button.d.ts +2 -0
- package/dist/components/consent-button.d.ts.map +1 -1
- package/dist/components/consent-button.js +6 -1
- package/dist/components/consent-button.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +93 -14
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +488 -67
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-capability-card.d.ts +42 -5
- package/dist/components/consent-capability-card.d.ts.map +1 -1
- package/dist/components/consent-capability-card.js +196 -41
- package/dist/components/consent-capability-card.js.map +1 -1
- package/dist/components/consent-checkbox.d.ts +2 -0
- package/dist/components/consent-checkbox.d.ts.map +1 -1
- package/dist/components/consent-checkbox.js +7 -0
- package/dist/components/consent-checkbox.js.map +1 -1
- package/dist/components/consent-connector-header.d.ts +39 -7
- package/dist/components/consent-connector-header.d.ts.map +1 -1
- package/dist/components/consent-connector-header.js +206 -43
- package/dist/components/consent-connector-header.js.map +1 -1
- package/dist/components/consent-duration.js +1 -1
- package/dist/components/consent-footer.d.ts +6 -4
- package/dist/components/consent-footer.d.ts.map +1 -1
- package/dist/components/consent-footer.js +13 -12
- package/dist/components/consent-footer.js.map +1 -1
- package/dist/components/consent-headline.d.ts +76 -12
- package/dist/components/consent-headline.d.ts.map +1 -1
- package/dist/components/consent-headline.js +445 -32
- package/dist/components/consent-headline.js.map +1 -1
- package/dist/components/consent-oauth-button.d.ts +7 -3
- package/dist/components/consent-oauth-button.d.ts.map +1 -1
- package/dist/components/consent-oauth-button.js +74 -65
- package/dist/components/consent-oauth-button.js.map +1 -1
- package/dist/components/consent-otp-input.d.ts.map +1 -1
- package/dist/components/consent-otp-input.js +5 -0
- package/dist/components/consent-otp-input.js.map +1 -1
- package/dist/components/consent-passkey.d.ts +6 -0
- package/dist/components/consent-passkey.d.ts.map +1 -1
- package/dist/components/consent-passkey.js +67 -9
- package/dist/components/consent-passkey.js.map +1 -1
- package/dist/components/consent-phone-handoff.js +3 -3
- package/dist/components/consent-request-expiry.js +1 -1
- package/dist/components/consent-revocation-notice.d.ts.map +1 -1
- package/dist/components/consent-revocation-notice.js +4 -2
- package/dist/components/consent-revocation-notice.js.map +1 -1
- package/dist/components/consent-revoke.d.ts +2 -0
- package/dist/components/consent-revoke.d.ts.map +1 -1
- package/dist/components/consent-revoke.js +9 -4
- package/dist/components/consent-revoke.js.map +1 -1
- package/dist/components/consent-secured-by.d.ts +25 -0
- package/dist/components/consent-secured-by.d.ts.map +1 -0
- package/dist/components/consent-secured-by.js +103 -0
- package/dist/components/consent-secured-by.js.map +1 -0
- package/dist/components/consent-shell.js +1 -1
- package/dist/components/consent-terms.d.ts +2 -0
- package/dist/components/consent-terms.d.ts.map +1 -1
- package/dist/components/consent-terms.js +7 -0
- package/dist/components/consent-terms.js.map +1 -1
- package/dist/components/consent-wallet-check.js +1 -1
- package/dist/components/consent-wallet-notice.js +1 -1
- package/dist/components/consent-wallet-orb.js +1 -1
- package/dist/components/consent-wallet-signature.js +1 -1
- package/dist/components/decision-icons.d.ts +22 -0
- package/dist/components/decision-icons.d.ts.map +1 -0
- package/dist/components/decision-icons.js +30 -0
- package/dist/components/decision-icons.js.map +1 -0
- package/dist/components/edit-region.d.ts +50 -0
- package/dist/components/edit-region.d.ts.map +1 -0
- package/dist/components/edit-region.js +305 -0
- package/dist/components/edit-region.js.map +1 -0
- package/dist/components/grant-field-styles.js +2 -2
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +15 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +81 -36
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/components/preview.d.ts +38 -0
- package/dist/components/preview.d.ts.map +1 -0
- package/dist/components/preview.js +61 -0
- package/dist/components/preview.js.map +1 -0
- package/dist/consent.js +2200 -389
- package/dist/consent.min.js +1308 -496
- package/dist/constants/capabilities.d.ts +14 -2
- package/dist/constants/capabilities.d.ts.map +1 -1
- package/dist/constants/capabilities.js +21 -2
- package/dist/constants/capabilities.js.map +1 -1
- package/dist/copy/tokens.d.ts +60 -21
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +60 -21
- package/dist/copy/tokens.js.map +1 -1
- package/dist/identity/agent-identity.d.ts +3 -2
- package/dist/identity/agent-identity.d.ts.map +1 -1
- package/dist/identity/agent-identity.js +3 -2
- package/dist/identity/agent-identity.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 +6 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +10 -1
- package/dist/react/index.js.map +1 -1
- package/dist/styles/brand.d.ts +184 -0
- package/dist/styles/brand.d.ts.map +1 -0
- package/dist/styles/brand.js +372 -0
- package/dist/styles/brand.js.map +1 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +1 -0
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/theme.d.ts +73 -13
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +96 -29
- package/dist/styles/theme.js.map +1 -1
- package/dist/types/capabilities.types.d.ts +12 -14
- package/dist/types/capabilities.types.d.ts.map +1 -1
- package/dist/types/capabilities.types.js +1 -2
- package/dist/types/capabilities.types.js.map +1 -1
- package/dist/types/decision.types.d.ts +57 -0
- package/dist/types/decision.types.d.ts.map +1 -0
- package/dist/types/decision.types.js +12 -0
- package/dist/types/decision.types.js.map +1 -0
- package/dist/types/edit.types.d.ts +73 -0
- package/dist/types/edit.types.d.ts.map +1 -0
- package/dist/types/edit.types.js +76 -0
- package/dist/types/edit.types.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../../src/bundle/inline.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH;;;GAGG;AACU,QAAA,cAAc,GAAW,
|
|
1
|
+
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../../src/bundle/inline.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH;;;GAGG;AACU,QAAA,cAAc,GAAW,g45YAAg45Y,CAAC;AAEv65Y;;GAEG;AACU,QAAA,mBAAmB,GAAW,MAAM,CAAC;AAElD;;GAEG;AACU,QAAA,mBAAmB,GAAW,kBAAkB,CAAC;AAE9D;;;;;;;;;;;GAWG;AACU,QAAA,mBAAmB,GAAW,8BAA8B,CAAC"}
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Parts: `submit`, `submit-icon`, `cancel`.
|
|
17
17
|
*
|
|
18
|
+
* With `preview` the buttons send no event. In edit mode (`preview` and
|
|
19
|
+
* `editable`) they draw as boxes of the same size with the same parts, and
|
|
20
|
+
* each label is a region a person types into, keyed `submit-label` and
|
|
21
|
+
* `cancel-label`: a region never sits inside a button.
|
|
22
|
+
*
|
|
18
23
|
* @module components/consent-action-bar
|
|
19
24
|
*/
|
|
20
25
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -28,11 +33,14 @@ exports.ConsentActionBar = void 0;
|
|
|
28
33
|
const lit_1 = require("lit");
|
|
29
34
|
const decorators_js_1 = require("lit/decorators.js");
|
|
30
35
|
const tokens_js_1 = require("../copy/tokens.js");
|
|
36
|
+
const edit_types_js_1 = require("../types/edit.types.js");
|
|
37
|
+
const edit_region_js_1 = require("./edit-region.js");
|
|
38
|
+
const preview_js_1 = require("./preview.js");
|
|
31
39
|
const wallet_icons_js_1 = require("./wallet-icons.js");
|
|
32
40
|
/**
|
|
33
41
|
* @fires consent-allow - The person allowed.
|
|
34
42
|
* @fires consent-deny - The person denied.
|
|
35
|
-
* @cssprop --cs-action-radius - The buttons' corners (default:
|
|
43
|
+
* @cssprop --cs-action-radius - The buttons' corners (default: 6px).
|
|
36
44
|
*/
|
|
37
45
|
let ConsentActionBar = class ConsentActionBar extends lit_1.LitElement {
|
|
38
46
|
constructor() {
|
|
@@ -47,14 +55,21 @@ let ConsentActionBar = class ConsentActionBar extends lit_1.LitElement {
|
|
|
47
55
|
this.submitIcon = "";
|
|
48
56
|
/** The submit label while `loading`, e.g. "Signing…". */
|
|
49
57
|
this.loadingLabel = "";
|
|
58
|
+
/** Draws as it would live, and sends no `consent-allow` or `consent-deny`. */
|
|
59
|
+
this.preview = false;
|
|
60
|
+
/** With `preview`: the labels can be edited in place. */
|
|
61
|
+
this.editable = false;
|
|
62
|
+
}
|
|
63
|
+
willUpdate() {
|
|
64
|
+
(0, preview_js_1.warnIfEditableWithoutPreview)(this);
|
|
50
65
|
}
|
|
51
66
|
emitAllow() {
|
|
52
|
-
if (this.disabled || this.loading)
|
|
67
|
+
if (this.disabled || this.loading || this.preview)
|
|
53
68
|
return;
|
|
54
69
|
this.dispatchEvent(new CustomEvent("consent-allow", { bubbles: true, composed: true }));
|
|
55
70
|
}
|
|
56
71
|
emitDeny() {
|
|
57
|
-
if (this.loading)
|
|
72
|
+
if (this.loading || this.preview)
|
|
58
73
|
return;
|
|
59
74
|
this.dispatchEvent(new CustomEvent("consent-deny", { bubbles: true, composed: true }));
|
|
60
75
|
}
|
|
@@ -70,32 +85,20 @@ let ConsentActionBar = class ConsentActionBar extends lit_1.LitElement {
|
|
|
70
85
|
(this.theme === "dark"
|
|
71
86
|
? tokens_js_1.CONSENT_COPY_TOKENS.actions.deny
|
|
72
87
|
: tokens_js_1.CONSENT_COPY_TOKENS.actions.notNow);
|
|
88
|
+
if ((0, preview_js_1.isEditing)(this))
|
|
89
|
+
return this.renderBoxes(allowLabel, denyLabel);
|
|
73
90
|
return (0, lit_1.html) `
|
|
74
91
|
<button
|
|
75
|
-
class="primary"
|
|
92
|
+
class="action primary"
|
|
76
93
|
part="submit"
|
|
77
94
|
type="button"
|
|
78
95
|
?disabled=${this.disabled || this.loading}
|
|
79
96
|
@click=${this.emitAllow}
|
|
80
97
|
>
|
|
81
|
-
${this.
|
|
82
|
-
? (0, lit_1.html) `<svg
|
|
83
|
-
part="submit-icon"
|
|
84
|
-
class="submit-icon"
|
|
85
|
-
viewBox="0 0 24 24"
|
|
86
|
-
fill="none"
|
|
87
|
-
stroke="currentColor"
|
|
88
|
-
stroke-width="2"
|
|
89
|
-
stroke-linecap="round"
|
|
90
|
-
stroke-linejoin="round"
|
|
91
|
-
aria-hidden="true"
|
|
92
|
-
>
|
|
93
|
-
${wallet_icons_js_1.fingerprintIcon}
|
|
94
|
-
</svg>`
|
|
95
|
-
: lit_1.nothing}${submitLabel}
|
|
98
|
+
${this.renderSubmitIcon()}${submitLabel}
|
|
96
99
|
</button>
|
|
97
100
|
<button
|
|
98
|
-
class="secondary"
|
|
101
|
+
class="action secondary"
|
|
99
102
|
part="cancel"
|
|
100
103
|
type="button"
|
|
101
104
|
?disabled=${this.loading}
|
|
@@ -105,9 +108,51 @@ let ConsentActionBar = class ConsentActionBar extends lit_1.LitElement {
|
|
|
105
108
|
</button>
|
|
106
109
|
`;
|
|
107
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Edit mode: the buttons as boxes with the same classes and parts, each
|
|
113
|
+
* label a region. A disabled Allow looks disabled, as it would live.
|
|
114
|
+
*/
|
|
115
|
+
renderBoxes(allowLabel, denyLabel) {
|
|
116
|
+
const tokens = tokens_js_1.CONSENT_COPY_TOKENS.editRegions;
|
|
117
|
+
return (0, lit_1.html) `
|
|
118
|
+
<div
|
|
119
|
+
class="action primary${this.disabled || this.loading
|
|
120
|
+
? " disabled"
|
|
121
|
+
: ""}"
|
|
122
|
+
part="submit"
|
|
123
|
+
>
|
|
124
|
+
${this.renderSubmitIcon()}${(0, edit_region_js_1.editRegion)(edit_types_js_1.CONSENT_EDIT_KEYS.submitLabel, tokens.submitLabel, allowLabel, this.editSource)}
|
|
125
|
+
</div>
|
|
126
|
+
<div
|
|
127
|
+
class="action secondary${this.loading ? " disabled" : ""}"
|
|
128
|
+
part="cancel"
|
|
129
|
+
>
|
|
130
|
+
${(0, edit_region_js_1.editRegion)(edit_types_js_1.CONSENT_EDIT_KEYS.cancelLabel, tokens.cancelLabel, denyLabel, this.editSource)}
|
|
131
|
+
</div>
|
|
132
|
+
`;
|
|
133
|
+
}
|
|
134
|
+
renderSubmitIcon() {
|
|
135
|
+
if (this.submitIcon !== "passkey")
|
|
136
|
+
return lit_1.nothing;
|
|
137
|
+
return (0, lit_1.html) `<svg
|
|
138
|
+
part="submit-icon"
|
|
139
|
+
class="submit-icon"
|
|
140
|
+
viewBox="0 0 24 24"
|
|
141
|
+
fill="none"
|
|
142
|
+
stroke="currentColor"
|
|
143
|
+
stroke-width="2"
|
|
144
|
+
stroke-linecap="round"
|
|
145
|
+
stroke-linejoin="round"
|
|
146
|
+
aria-hidden="true"
|
|
147
|
+
>
|
|
148
|
+
${wallet_icons_js_1.fingerprintIcon}
|
|
149
|
+
</svg>`;
|
|
150
|
+
}
|
|
108
151
|
};
|
|
109
152
|
exports.ConsentActionBar = ConsentActionBar;
|
|
110
153
|
ConsentActionBar.styles = (0, lit_1.css) `
|
|
154
|
+
${edit_region_js_1.editRegionStyles}
|
|
155
|
+
|
|
111
156
|
:host {
|
|
112
157
|
display: flex;
|
|
113
158
|
flex-direction: column;
|
|
@@ -115,13 +160,25 @@ ConsentActionBar.styles = (0, lit_1.css) `
|
|
|
115
160
|
width: 100%;
|
|
116
161
|
}
|
|
117
162
|
|
|
118
|
-
button
|
|
163
|
+
/* A button, or in edit mode a box, set out in full so both draw alike. */
|
|
164
|
+
.action {
|
|
165
|
+
box-sizing: border-box;
|
|
166
|
+
display: block;
|
|
119
167
|
width: 100%;
|
|
168
|
+
margin: 0;
|
|
120
169
|
padding: 14px 18px;
|
|
121
|
-
border-radius: var(--cs-action-radius,
|
|
170
|
+
border-radius: var(--cs-action-radius, 6px);
|
|
122
171
|
font-size: var(--cs-action-font-size, 15px);
|
|
123
172
|
font-weight: 500;
|
|
124
173
|
font-family: inherit;
|
|
174
|
+
font-style: normal;
|
|
175
|
+
line-height: normal;
|
|
176
|
+
letter-spacing: normal;
|
|
177
|
+
word-spacing: normal;
|
|
178
|
+
text-align: center;
|
|
179
|
+
text-indent: 0;
|
|
180
|
+
text-transform: none;
|
|
181
|
+
text-shadow: none;
|
|
125
182
|
cursor: pointer;
|
|
126
183
|
transition:
|
|
127
184
|
opacity 0.15s ease,
|
|
@@ -129,11 +186,17 @@ ConsentActionBar.styles = (0, lit_1.css) `
|
|
|
129
186
|
border: none;
|
|
130
187
|
}
|
|
131
188
|
|
|
132
|
-
|
|
189
|
+
.action:disabled,
|
|
190
|
+
.action.disabled {
|
|
133
191
|
opacity: 0.5;
|
|
134
192
|
cursor: not-allowed;
|
|
135
193
|
}
|
|
136
194
|
|
|
195
|
+
div.action,
|
|
196
|
+
div.action.disabled {
|
|
197
|
+
cursor: default;
|
|
198
|
+
}
|
|
199
|
+
|
|
137
200
|
button:focus-visible {
|
|
138
201
|
outline: 2px solid var(--cs-focus-ring, #0f172a);
|
|
139
202
|
outline-offset: 3px;
|
|
@@ -149,7 +212,7 @@ ConsentActionBar.styles = (0, lit_1.css) `
|
|
|
149
212
|
color: var(--cs-surface-accent-text, #ffffff);
|
|
150
213
|
}
|
|
151
214
|
|
|
152
|
-
.primary:hover:not(:disabled) {
|
|
215
|
+
button.primary:hover:not(:disabled) {
|
|
153
216
|
opacity: 0.92;
|
|
154
217
|
}
|
|
155
218
|
|
|
@@ -166,7 +229,7 @@ ConsentActionBar.styles = (0, lit_1.css) `
|
|
|
166
229
|
font-weight: 500;
|
|
167
230
|
}
|
|
168
231
|
|
|
169
|
-
.secondary:hover:not(:disabled) {
|
|
232
|
+
button.secondary:hover:not(:disabled) {
|
|
170
233
|
color: var(--cs-text-primary, #0f172a);
|
|
171
234
|
}
|
|
172
235
|
`;
|
|
@@ -194,6 +257,15 @@ __decorate([
|
|
|
194
257
|
__decorate([
|
|
195
258
|
(0, decorators_js_1.property)({ type: String, attribute: "loading-label" })
|
|
196
259
|
], ConsentActionBar.prototype, "loadingLabel", void 0);
|
|
260
|
+
__decorate([
|
|
261
|
+
(0, decorators_js_1.property)({ type: Boolean, reflect: true })
|
|
262
|
+
], ConsentActionBar.prototype, "preview", void 0);
|
|
263
|
+
__decorate([
|
|
264
|
+
(0, decorators_js_1.property)({ type: Boolean, reflect: true })
|
|
265
|
+
], ConsentActionBar.prototype, "editable", void 0);
|
|
266
|
+
__decorate([
|
|
267
|
+
(0, decorators_js_1.property)({ attribute: false })
|
|
268
|
+
], ConsentActionBar.prototype, "editSource", void 0);
|
|
197
269
|
exports.ConsentActionBar = ConsentActionBar = __decorate([
|
|
198
270
|
(0, decorators_js_1.customElement)("consent-action-bar")
|
|
199
271
|
], ConsentActionBar);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-action-bar.js","sourceRoot":"","sources":["../../../src/components/consent-action-bar.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"consent-action-bar.js","sourceRoot":"","sources":["../../../src/components/consent-action-bar.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;AAEH,6BAAqD;AACrD,qDAA4D;AAE5D,iDAAqE;AAErE,0DAGgC;AAChC,qDAAgE;AAChE,6CAAuE;AACvE,uDAAoD;AAKpD;;;;GAIG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,gBAAU;IAAzC;;QACuB,cAAS,GAAG,EAAE,CAAC;QACf,UAAK,GAAiB,OAAO,CAAC;QAC7B,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAAG,KAAK,CAAC;QACU,gBAAW,GAAG,EAAE,CAAC;QACjB,gBAAW,GAAG,EAAE,CAAC;QACxE,wDAAwD;QAExD,eAAU,GAAwB,EAAE,CAAC;QACrC,yDAAyD;QACD,iBAAY,GAAG,EAAE,CAAC;QAC1E,8EAA8E;QAClC,YAAO,GAAG,KAAK,CAAC;QAC5D,yDAAyD;QACb,aAAQ,GAAG,KAAK,CAAC;IAoM/D,CAAC;IA5GU,UAAU;QACjB,IAAA,yCAA4B,EAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAEO,SAAS;QACf,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QAC1D,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CACpE,CAAC;IACJ,CAAC;IAEO,QAAQ;QACd,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QACzC,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EA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AAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;qDAAkB;AAGxE;IADC,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;oDAChB;AAEmB;IAAvD,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;sDAAmB;AAE9B;IAA3C,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAiB;AAEhB;IAA3C,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAkB;AAE7B;IAA/B,IAAA,wBAAQ,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;oDAA2C;2BAjB/D,gBAAgB;IAD5B,IAAA,6BAAa,EAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAmN5B"}
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
* Consent Agent Header
|
|
4
4
|
*
|
|
5
5
|
* Renders the agent identity tile shared between the new consent screen and
|
|
6
|
-
* the OAuth Gateway consent modal. Shows logo + name +
|
|
6
|
+
* the OAuth Gateway consent modal. Shows logo + name + meta line
|
|
7
7
|
* (`Made by {Vendor} · Asking from your {Surface} · Connected just now`,
|
|
8
|
-
* leaving out a vendor or surface that isn't known).
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* (`verification`): Verified, the domain a CIMD client is bound to (e.g.
|
|
12
|
-
* "chatgpt.com", never the word Verified), or UNVERIFIED.
|
|
8
|
+
* leaving out a vendor or surface that isn't known). It draws no badge: how
|
|
9
|
+
* the agent's identity is established (`AgentMetadata.verification`) decides
|
|
10
|
+
* what a grant may reach, not what the tile says.
|
|
13
11
|
*
|
|
14
12
|
* Fed by `AgentMetadata` from `@kya-os/consent/types/capabilities`.
|
|
15
13
|
*
|
|
@@ -26,17 +24,12 @@ exports.ConsentAgentHeader = void 0;
|
|
|
26
24
|
const lit_1 = require("lit");
|
|
27
25
|
const decorators_js_1 = require("lit/decorators.js");
|
|
28
26
|
const tokens_js_1 = require("../copy/tokens.js");
|
|
29
|
-
const capabilities_types_js_1 = require("../types/capabilities.types.js");
|
|
30
27
|
let ConsentAgentHeader = class ConsentAgentHeader extends lit_1.LitElement {
|
|
31
28
|
constructor() {
|
|
32
29
|
super(...arguments);
|
|
33
30
|
this.agentName = "";
|
|
34
31
|
this.vendor = "";
|
|
35
32
|
this.surfaceLabel = "";
|
|
36
|
-
/** The domain a `domain` agent is bound to, named in its pill. */
|
|
37
|
-
this.domain = "";
|
|
38
|
-
/** @deprecated Use `verification`; read only when it is unset. */
|
|
39
|
-
this.verified = false;
|
|
40
33
|
this.logoUrl = "";
|
|
41
34
|
this.connectedAt = "";
|
|
42
35
|
}
|
|
@@ -71,23 +64,6 @@ let ConsentAgentHeader = class ConsentAgentHeader extends lit_1.LitElement {
|
|
|
71
64
|
.filter(Boolean)
|
|
72
65
|
.join(tokens.metaSeparator);
|
|
73
66
|
}
|
|
74
|
-
renderPill() {
|
|
75
|
-
const tokens = tokens_js_1.CONSENT_COPY_TOKENS.agentTile;
|
|
76
|
-
const state = (0, capabilities_types_js_1.agentVerification)({
|
|
77
|
-
verification: this.verification,
|
|
78
|
-
verified: this.verified,
|
|
79
|
-
domain: this.domain,
|
|
80
|
-
});
|
|
81
|
-
if (state === "domain") {
|
|
82
|
-
return (0, lit_1.html) `<span class="pill domain" part="pill"
|
|
83
|
-
><span class="visually-hidden">${tokens.domainPillPrefix} </span
|
|
84
|
-
>${this.domain.trim()}</span
|
|
85
|
-
>`;
|
|
86
|
-
}
|
|
87
|
-
return (0, lit_1.html) `<span class="pill ${state}" part="pill">
|
|
88
|
-
${state === "verified" ? tokens.verifiedPill : tokens.unverifiedPill}
|
|
89
|
-
</span>`;
|
|
90
|
-
}
|
|
91
67
|
render() {
|
|
92
68
|
const initial = (this.agentName || "?").trim().charAt(0).toUpperCase();
|
|
93
69
|
return (0, lit_1.html) `
|
|
@@ -98,10 +74,7 @@ let ConsentAgentHeader = class ConsentAgentHeader extends lit_1.LitElement {
|
|
|
98
74
|
: (0, lit_1.html) `<div class="placeholder">${initial}</div>`}
|
|
99
75
|
</div>
|
|
100
76
|
<div class="body">
|
|
101
|
-
<
|
|
102
|
-
<span class="name">${this.agentName || lit_1.nothing}</span>
|
|
103
|
-
${this.renderPill()}
|
|
104
|
-
</div>
|
|
77
|
+
<span class="name">${this.agentName || lit_1.nothing}</span>
|
|
105
78
|
<div class="meta">${this.renderMeta()}</div>
|
|
106
79
|
</div>
|
|
107
80
|
</div>
|
|
@@ -116,7 +89,7 @@ ConsentAgentHeader.styles = (0, lit_1.css) `
|
|
|
116
89
|
}
|
|
117
90
|
|
|
118
91
|
/* In a narrow card the name moves under the logo rather than squeezing
|
|
119
|
-
into a column too thin
|
|
92
|
+
into a column too thin to read (see .body's basis). */
|
|
120
93
|
.tile {
|
|
121
94
|
display: flex;
|
|
122
95
|
flex-wrap: wrap;
|
|
@@ -170,13 +143,6 @@ ConsentAgentHeader.styles = (0, lit_1.css) `
|
|
|
170
143
|
min-width: 0;
|
|
171
144
|
}
|
|
172
145
|
|
|
173
|
-
.row-name {
|
|
174
|
-
display: flex;
|
|
175
|
-
align-items: center;
|
|
176
|
-
gap: 10px;
|
|
177
|
-
flex-wrap: wrap;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
146
|
.name {
|
|
181
147
|
font-size: 16px;
|
|
182
148
|
font-weight: 600;
|
|
@@ -184,64 +150,9 @@ ConsentAgentHeader.styles = (0, lit_1.css) `
|
|
|
184
150
|
letter-spacing: -0.01em;
|
|
185
151
|
}
|
|
186
152
|
|
|
187
|
-
.pill {
|
|
188
|
-
display: inline-flex;
|
|
189
|
-
align-items: center;
|
|
190
|
-
gap: 4px;
|
|
191
|
-
padding: 2px 8px;
|
|
192
|
-
border-radius: 999px;
|
|
193
|
-
font-size: 11px;
|
|
194
|
-
font-weight: 600;
|
|
195
|
-
letter-spacing: 0.04em;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.pill.verified {
|
|
199
|
-
background: var(--cs-pill-verified-bg, #dcfce7);
|
|
200
|
-
color: var(--cs-pill-verified-text, #166534);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.pill.unverified {
|
|
204
|
-
background: var(--cs-pill-unverified-bg, #f1f5f9);
|
|
205
|
-
color: var(--cs-pill-unverified-text, #475569);
|
|
206
|
-
letter-spacing: 0.08em;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/*
|
|
210
|
-
* Domain-bound: a tint and an outline from the brand primary, with the
|
|
211
|
-
* theme's own text color, so the domain reads in light and dark
|
|
212
|
-
* whatever the brand color is.
|
|
213
|
-
*/
|
|
214
|
-
.pill.domain {
|
|
215
|
-
background: var(
|
|
216
|
-
--cs-pill-domain-bg,
|
|
217
|
-
color-mix(in srgb, var(--consent-primary, #2563eb) 14%, transparent)
|
|
218
|
-
);
|
|
219
|
-
box-shadow: inset 0 0 0 1px
|
|
220
|
-
var(
|
|
221
|
-
--cs-pill-domain-border,
|
|
222
|
-
color-mix(in srgb, var(--consent-primary, #2563eb) 40%, transparent)
|
|
223
|
-
);
|
|
224
|
-
color: var(--cs-pill-domain-text, var(--cs-text-primary, #0f172a));
|
|
225
|
-
font-weight: 500;
|
|
226
|
-
letter-spacing: 0;
|
|
227
|
-
overflow-wrap: anywhere;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.visually-hidden {
|
|
231
|
-
position: absolute;
|
|
232
|
-
width: 1px;
|
|
233
|
-
height: 1px;
|
|
234
|
-
margin: -1px;
|
|
235
|
-
padding: 0;
|
|
236
|
-
overflow: hidden;
|
|
237
|
-
clip: rect(0, 0, 0, 0);
|
|
238
|
-
white-space: nowrap;
|
|
239
|
-
border: 0;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
153
|
.meta {
|
|
243
154
|
font-size: 12px;
|
|
244
|
-
color: var(--cs-text-tertiary, #
|
|
155
|
+
color: var(--cs-text-tertiary, #5d6c82);
|
|
245
156
|
line-height: 1.5;
|
|
246
157
|
}
|
|
247
158
|
`;
|
|
@@ -254,15 +165,6 @@ __decorate([
|
|
|
254
165
|
__decorate([
|
|
255
166
|
(0, decorators_js_1.property)({ type: String })
|
|
256
167
|
], ConsentAgentHeader.prototype, "surfaceLabel", void 0);
|
|
257
|
-
__decorate([
|
|
258
|
-
(0, decorators_js_1.property)({ type: String })
|
|
259
|
-
], ConsentAgentHeader.prototype, "verification", void 0);
|
|
260
|
-
__decorate([
|
|
261
|
-
(0, decorators_js_1.property)({ type: String })
|
|
262
|
-
], ConsentAgentHeader.prototype, "domain", void 0);
|
|
263
|
-
__decorate([
|
|
264
|
-
(0, decorators_js_1.property)({ type: Boolean })
|
|
265
|
-
], ConsentAgentHeader.prototype, "verified", void 0);
|
|
266
168
|
__decorate([
|
|
267
169
|
(0, decorators_js_1.property)({ type: String })
|
|
268
170
|
], ConsentAgentHeader.prototype, "logoUrl", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-agent-header.js","sourceRoot":"","sources":["../../../src/components/consent-agent-header.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"consent-agent-header.js","sourceRoot":"","sources":["../../../src/components/consent-agent-header.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;AAEH,6BAAqD;AACrD,qDAA4D;AAE5D,iDAAqE;AAG9D,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,gBAAU;IAA3C;;QACuB,cAAS,GAAG,EAAE,CAAC;QACf,WAAM,GAAG,EAAE,CAAC;QACZ,iBAAY,GAAG,EAAE,CAAC;QAClB,YAAO,GAAG,EAAE,CAAC;QACb,gBAAW,GAAG,EAAE,CAAC;IAgI/C,CAAC;IAnDS,uBAAuB;QAC7B,IAAI,CAAC,IAAI,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
|
@@ -35,6 +35,8 @@ const decorators_js_1 = require("lit/decorators.js");
|
|
|
35
35
|
let ConsentButton = class ConsentButton extends lit_1.LitElement {
|
|
36
36
|
constructor() {
|
|
37
37
|
super();
|
|
38
|
+
/** Draws as it would live; a click submits or resets no form. */
|
|
39
|
+
this.preview = false;
|
|
38
40
|
/**
|
|
39
41
|
* Button variant - 'primary' (filled) or 'secondary' (outlined)
|
|
40
42
|
*/
|
|
@@ -58,7 +60,7 @@ let ConsentButton = class ConsentButton extends lit_1.LitElement {
|
|
|
58
60
|
this.internals = this.attachInternals();
|
|
59
61
|
}
|
|
60
62
|
handleClick() {
|
|
61
|
-
if (this.disabled || this.loading)
|
|
63
|
+
if (this.disabled || this.loading || this.preview)
|
|
62
64
|
return;
|
|
63
65
|
const form = this.internals.form;
|
|
64
66
|
if (!form)
|
|
@@ -162,6 +164,9 @@ ConsentButton.styles = (0, lit_1.css) `
|
|
|
162
164
|
}
|
|
163
165
|
}
|
|
164
166
|
`;
|
|
167
|
+
__decorate([
|
|
168
|
+
(0, decorators_js_1.property)({ type: Boolean, reflect: true })
|
|
169
|
+
], ConsentButton.prototype, "preview", void 0);
|
|
165
170
|
__decorate([
|
|
166
171
|
(0, decorators_js_1.property)({ type: String, reflect: true })
|
|
167
172
|
], ConsentButton.prototype, "variant", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-button.js","sourceRoot":"","sources":["../../../src/components/consent-button.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;AAEH,6BAA4C;AAC5C,qDAA4D;AAO5D;;;;;;;;;;;;GAYG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,gBAAU;IAM3C;QACE,KAAK,EAAE,CAAC;QAIV;;WAEG;QAEH,YAAO,GAAkB,SAAS,CAAC;QAEnC;;WAEG;QAEH,SAAI,GAAkC,QAAQ,CAAC;QAE/C;;WAEG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB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