@kya-os/consent 0.1.49 → 0.2.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 +75 -9
- package/dist/bundle/browser.d.ts +18 -0
- package/dist/bundle/browser.d.ts.map +1 -0
- package/dist/bundle/browser.js +18 -0
- package/dist/bundle/browser.js.map +1 -0
- 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/bundle/shell.d.ts +4 -2
- package/dist/bundle/shell.d.ts.map +1 -1
- package/dist/bundle/shell.js +16 -43
- package/dist/bundle/shell.js.map +1 -1
- package/dist/cjs/bundle/inline.js +4 -4
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/bundle/shell.js +16 -43
- package/dist/cjs/bundle/shell.js.map +1 -1
- package/dist/cjs/components/consent-agent-header.js +81 -21
- package/dist/cjs/components/consent-agent-header.js.map +1 -1
- package/dist/cjs/components/consent-button.js +16 -13
- package/dist/cjs/components/consent-button.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +15 -5
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-checkbox.js +21 -17
- package/dist/cjs/components/consent-checkbox.js.map +1 -1
- package/dist/cjs/components/consent-connector-header.js +14 -3
- package/dist/cjs/components/consent-connector-header.js.map +1 -1
- package/dist/cjs/components/consent-permissions.js +16 -15
- package/dist/cjs/components/consent-permissions.js.map +1 -1
- package/dist/cjs/components/consent-revocation-notice.js +23 -5
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
- package/dist/cjs/components/consent-shell.js +35 -17
- package/dist/cjs/components/consent-shell.js.map +1 -1
- package/dist/cjs/components/consent-terms.js +27 -23
- package/dist/cjs/components/consent-terms.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +222 -45
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/constants/auth-modes.js +1 -1
- package/dist/cjs/constants/auth-modes.js.map +1 -1
- package/dist/cjs/constants/colors.js +7 -2
- package/dist/cjs/constants/colors.js.map +1 -1
- package/dist/cjs/constants/defaults.js +1 -1
- package/dist/cjs/copy/tokens.js +45 -1
- package/dist/cjs/copy/tokens.js.map +1 -1
- package/dist/cjs/index.js +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 +1 -1
- package/dist/cjs/resolution/resolve-branding.js +3 -1
- package/dist/cjs/resolution/resolve-branding.js.map +1 -1
- package/dist/cjs/resolution/resolve-config.js +3 -0
- package/dist/cjs/resolution/resolve-config.js.map +1 -1
- package/dist/cjs/schemas/api.schemas.js +1 -1
- package/dist/cjs/schemas/branding.schemas.js +3 -0
- package/dist/cjs/schemas/branding.schemas.js.map +1 -1
- package/dist/cjs/schemas/capabilities.schemas.js +48 -3
- package/dist/cjs/schemas/capabilities.schemas.js.map +1 -1
- package/dist/cjs/schemas/config.schemas.js +1 -0
- package/dist/cjs/schemas/config.schemas.js.map +1 -1
- package/dist/cjs/schemas/modes.schemas.js +1 -0
- package/dist/cjs/schemas/modes.schemas.js.map +1 -1
- package/dist/cjs/styles/contrast.js +100 -0
- package/dist/cjs/styles/contrast.js.map +1 -0
- package/dist/cjs/styles/css-variables.js +36 -1
- package/dist/cjs/styles/css-variables.js.map +1 -1
- package/dist/cjs/styles/index.js +2 -1
- package/dist/cjs/styles/index.js.map +1 -1
- package/dist/cjs/styles/stylesheet.js +10 -5
- package/dist/cjs/styles/stylesheet.js.map +1 -1
- package/dist/cjs/styles/theme.js +29 -1
- package/dist/cjs/styles/theme.js.map +1 -1
- package/dist/cjs/styles/tokens.js +8 -8
- package/dist/cjs/styles/tokens.js.map +1 -1
- package/dist/cjs/templates/base/components.js +1 -1
- package/dist/cjs/templates/index.js +1 -0
- package/dist/cjs/templates/index.js.map +1 -1
- package/dist/cjs/templates/modes/credentials.template.js +15 -13
- package/dist/cjs/templates/modes/credentials.template.js.map +1 -1
- package/dist/cjs/templates/modes/index.js +3 -1
- package/dist/cjs/templates/modes/index.js.map +1 -1
- package/dist/cjs/templates/modes/passkey.template.js +178 -0
- package/dist/cjs/templates/modes/passkey.template.js.map +1 -0
- package/dist/cjs/templates/modes/success.template.js +2 -7
- package/dist/cjs/templates/modes/success.template.js.map +1 -1
- package/dist/cjs/templates/registry.js +4 -3
- package/dist/cjs/templates/registry.js.map +1 -1
- package/dist/cjs/types/capabilities.types.js +27 -2
- package/dist/cjs/types/capabilities.types.js.map +1 -1
- package/dist/cjs/types/index.js +1 -1
- package/dist/cjs/types/modes.types.js +11 -4
- package/dist/cjs/types/modes.types.js.map +1 -1
- package/dist/components/consent-agent-header.d.ts +16 -3
- package/dist/components/consent-agent-header.d.ts.map +1 -1
- package/dist/components/consent-agent-header.js +81 -21
- package/dist/components/consent-agent-header.js.map +1 -1
- package/dist/components/consent-button.d.ts +6 -5
- package/dist/components/consent-button.d.ts.map +1 -1
- package/dist/components/consent-button.js +18 -15
- package/dist/components/consent-button.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +3 -1
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +15 -5
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-checkbox.d.ts +4 -2
- package/dist/components/consent-checkbox.d.ts.map +1 -1
- package/dist/components/consent-checkbox.js +23 -19
- package/dist/components/consent-checkbox.js.map +1 -1
- package/dist/components/consent-connector-header.d.ts.map +1 -1
- package/dist/components/consent-connector-header.js +14 -3
- package/dist/components/consent-connector-header.js.map +1 -1
- package/dist/components/consent-passkey.d.ts +128 -0
- package/dist/components/consent-passkey.d.ts.map +1 -0
- package/dist/components/consent-passkey.js +408 -0
- package/dist/components/consent-passkey.js.map +1 -0
- package/dist/components/consent-permissions.d.ts +4 -3
- package/dist/components/consent-permissions.d.ts.map +1 -1
- package/dist/components/consent-permissions.js +18 -17
- package/dist/components/consent-permissions.js.map +1 -1
- package/dist/components/consent-revocation-notice.d.ts +8 -0
- package/dist/components/consent-revocation-notice.d.ts.map +1 -1
- package/dist/components/consent-revocation-notice.js +23 -5
- package/dist/components/consent-revocation-notice.js.map +1 -1
- package/dist/components/consent-shell.d.ts +2 -2
- package/dist/components/consent-shell.d.ts.map +1 -1
- package/dist/components/consent-shell.js +37 -19
- package/dist/components/consent-shell.js.map +1 -1
- package/dist/components/consent-terms.d.ts +4 -2
- package/dist/components/consent-terms.d.ts.map +1 -1
- package/dist/components/consent-terms.js +29 -25
- package/dist/components/consent-terms.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +11 -3
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +222 -45
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/consent.js +1102 -140
- package/dist/consent.min.js +481 -228
- package/dist/constants/auth-modes.js +1 -1
- package/dist/constants/auth-modes.js.map +1 -1
- package/dist/constants/colors.d.ts +7 -2
- package/dist/constants/colors.d.ts.map +1 -1
- package/dist/constants/colors.js +7 -2
- package/dist/constants/colors.js.map +1 -1
- package/dist/constants/defaults.d.ts +1 -1
- package/dist/constants/defaults.js +1 -1
- package/dist/copy/tokens.d.ts +45 -1
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +45 -1
- package/dist/copy/tokens.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +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/passkey/index.d.ts +19 -0
- package/dist/passkey/index.d.ts.map +1 -0
- package/dist/passkey/index.js +18 -0
- package/dist/passkey/index.js.map +1 -0
- package/dist/passkey/react.d.ts +34 -0
- package/dist/passkey/react.d.ts.map +1 -0
- package/dist/passkey/react.js +39 -0
- package/dist/passkey/react.js.map +1 -0
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/resolution/resolve-branding.d.ts.map +1 -1
- package/dist/resolution/resolve-branding.js +3 -1
- package/dist/resolution/resolve-branding.js.map +1 -1
- package/dist/resolution/resolve-config.d.ts.map +1 -1
- package/dist/resolution/resolve-config.js +3 -0
- package/dist/resolution/resolve-config.js.map +1 -1
- package/dist/schemas/api.schemas.d.ts +55 -9
- package/dist/schemas/api.schemas.d.ts.map +1 -1
- package/dist/schemas/api.schemas.js +1 -1
- package/dist/schemas/branding.schemas.d.ts +24 -0
- package/dist/schemas/branding.schemas.d.ts.map +1 -1
- package/dist/schemas/branding.schemas.js +3 -0
- package/dist/schemas/branding.schemas.js.map +1 -1
- package/dist/schemas/capabilities.schemas.d.ts +38 -4
- package/dist/schemas/capabilities.schemas.d.ts.map +1 -1
- package/dist/schemas/capabilities.schemas.js +47 -2
- package/dist/schemas/capabilities.schemas.js.map +1 -1
- package/dist/schemas/config.schemas.d.ts +88 -12
- package/dist/schemas/config.schemas.d.ts.map +1 -1
- package/dist/schemas/config.schemas.js +1 -0
- package/dist/schemas/config.schemas.js.map +1 -1
- package/dist/schemas/modes.schemas.d.ts +8 -0
- package/dist/schemas/modes.schemas.d.ts.map +1 -1
- package/dist/schemas/modes.schemas.js +1 -0
- package/dist/schemas/modes.schemas.js.map +1 -1
- package/dist/styles/contrast.d.ts +33 -0
- package/dist/styles/contrast.d.ts.map +1 -0
- package/dist/styles/contrast.js +92 -0
- package/dist/styles/contrast.js.map +1 -0
- package/dist/styles/css-variables.d.ts +20 -0
- package/dist/styles/css-variables.d.ts.map +1 -1
- package/dist/styles/css-variables.js +35 -1
- package/dist/styles/css-variables.js.map +1 -1
- package/dist/styles/index.d.ts +2 -1
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +2 -1
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/stylesheet.d.ts +1 -1
- package/dist/styles/stylesheet.d.ts.map +1 -1
- package/dist/styles/stylesheet.js +10 -5
- package/dist/styles/stylesheet.js.map +1 -1
- package/dist/styles/theme.d.ts +32 -1
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +29 -1
- package/dist/styles/theme.js.map +1 -1
- package/dist/styles/tokens.d.ts +5 -5
- package/dist/styles/tokens.js +8 -8
- package/dist/styles/tokens.js.map +1 -1
- package/dist/templates/base/components.d.ts +1 -1
- package/dist/templates/base/components.js +1 -1
- package/dist/templates/index.d.ts +1 -0
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +1 -0
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/modes/credentials.template.d.ts +5 -5
- package/dist/templates/modes/credentials.template.d.ts.map +1 -1
- package/dist/templates/modes/credentials.template.js +15 -13
- package/dist/templates/modes/credentials.template.js.map +1 -1
- package/dist/templates/modes/index.d.ts +1 -0
- package/dist/templates/modes/index.d.ts.map +1 -1
- package/dist/templates/modes/index.js +1 -0
- package/dist/templates/modes/index.js.map +1 -1
- package/dist/templates/modes/passkey.template.d.ts +62 -0
- package/dist/templates/modes/passkey.template.d.ts.map +1 -0
- package/dist/templates/modes/passkey.template.js +174 -0
- package/dist/templates/modes/passkey.template.js.map +1 -0
- package/dist/templates/modes/success.template.d.ts.map +1 -1
- package/dist/templates/modes/success.template.js +2 -7
- package/dist/templates/modes/success.template.js.map +1 -1
- package/dist/templates/registry.d.ts +3 -3
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +6 -5
- package/dist/templates/registry.js.map +1 -1
- package/dist/types/api.types.d.ts +1 -1
- package/dist/types/branding.types.d.ts +6 -0
- package/dist/types/branding.types.d.ts.map +1 -1
- package/dist/types/capabilities.types.d.ts +44 -7
- package/dist/types/capabilities.types.d.ts.map +1 -1
- package/dist/types/capabilities.types.js +26 -2
- package/dist/types/capabilities.types.js.map +1 -1
- package/dist/types/config.types.d.ts +11 -2
- package/dist/types/config.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/modes.types.d.ts +31 -4
- package/dist/types/modes.types.d.ts.map +1 -1
- package/dist/types/modes.types.js +10 -3
- package/dist/types/modes.types.js.map +1 -1
- package/dist/types/page.types.d.ts +8 -2
- package/dist/types/page.types.d.ts.map +1 -1
- package/package.json +29 -5
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.isProbeEligible = isProbeEligible;
|
|
13
|
+
exports.agentVerification = agentVerification;
|
|
13
14
|
exports.isCappedAtProbe = isCappedAtProbe;
|
|
14
15
|
/**
|
|
15
16
|
* Whether a capability at this risk level may be probed, that is granted to
|
|
@@ -35,6 +36,26 @@ exports.isCappedAtProbe = isCappedAtProbe;
|
|
|
35
36
|
function isProbeEligible(riskLevel) {
|
|
36
37
|
return riskLevel === "low" || riskLevel === "medium";
|
|
37
38
|
}
|
|
39
|
+
const AGENT_VERIFICATIONS = [
|
|
40
|
+
"verified",
|
|
41
|
+
"domain",
|
|
42
|
+
"unverified",
|
|
43
|
+
];
|
|
44
|
+
/**
|
|
45
|
+
* How the agent's identity is established, from `AgentMetadata`.
|
|
46
|
+
*
|
|
47
|
+
* `verification` wins when it is one of the three states; otherwise the
|
|
48
|
+
* deprecated `verified` boolean reads as `verified` or `unverified`. A
|
|
49
|
+
* `domain` state with no domain to name reads as `unverified`, so the header
|
|
50
|
+
* never shows an empty pill.
|
|
51
|
+
*/
|
|
52
|
+
function agentVerification(agent) {
|
|
53
|
+
const stated = agent.verification;
|
|
54
|
+
if (stated !== undefined && AGENT_VERIFICATIONS.includes(stated)) {
|
|
55
|
+
return stated === "domain" && !agent.domain?.trim() ? "unverified" : stated;
|
|
56
|
+
}
|
|
57
|
+
return agent.verified === true ? "verified" : "unverified";
|
|
58
|
+
}
|
|
38
59
|
/**
|
|
39
60
|
* Whether `value` parses as a real point in time in the past. Guards
|
|
40
61
|
* `connectedAt`, which reaches `isCappedAtProbe` as a plain string (the
|
|
@@ -52,7 +73,10 @@ function isValidPastTimestamp(value) {
|
|
|
52
73
|
* verified Entity Card (rule 3), or the relationship is first contact, that
|
|
53
74
|
* is `connectedAt` is absent or unparseable (rule 2). Per the design doc,
|
|
54
75
|
* neither condition is ever raised by assurance vector, relationship age, or
|
|
55
|
-
* click count.
|
|
76
|
+
* click count. A `domain` agent is capped too: a domain binding names the
|
|
77
|
+
* client, it does not verify it. So is one whose deprecated `verified` is
|
|
78
|
+
* `false` beside `verification: "verified"`: contradictory raw data fails
|
|
79
|
+
* closed.
|
|
56
80
|
*
|
|
57
81
|
* `agent` itself may be absent: real stored configs exist with no agent
|
|
58
82
|
* metadata at all, not merely `verified: false`. That counts as unverified
|
|
@@ -60,7 +84,8 @@ function isValidPastTimestamp(value) {
|
|
|
60
84
|
*/
|
|
61
85
|
function isCappedAtProbe(agent) {
|
|
62
86
|
return (!agent ||
|
|
63
|
-
|
|
87
|
+
agentVerification(agent) !== "verified" ||
|
|
88
|
+
agent.verified === false ||
|
|
64
89
|
!agent.connectedAt ||
|
|
65
90
|
!isValidPastTimestamp(agent.connectedAt));
|
|
66
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.types.js","sourceRoot":"","sources":["../../../src/types/capabilities.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAiDH,0CAEC;
|
|
1
|
+
{"version":3,"file":"capabilities.types.js","sourceRoot":"","sources":["../../../src/types/capabilities.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAiDH,0CAEC;AA2BD,8CAQC;AA6BD,0CAUC;AAjGD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,eAAe,CAAC,SAAoB;IAClD,OAAO,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,QAAQ,CAAC;AACvD,CAAC;AAaD,MAAM,mBAAmB,GAAiC;IACxD,UAAU;IACV,QAAQ;IACR,YAAY;CACb,CAAC;AAEF;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAC/B,KAAkE;IAElE,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IAClC,IAAI,MAAM,KAAK,SAAS,IAAI,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACjE,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC;IAC9E,CAAC;IACD,OAAO,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,oBAAoB,CAAC,KAAa;IACzC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,eAAe,CAC7B,KAAsC;IAEtC,OAAO,CACL,CAAC,KAAK;QACN,iBAAiB,CAAC,KAAK,CAAC,KAAK,UAAU;QACvC,KAAK,CAAC,QAAQ,KAAK,KAAK;QACxB,CAAC,KAAK,CAAC,WAAW;QAClB,CAAC,oBAAoB,CAAC,KAAK,CAAC,WAAW,CAAC,CACzC,CAAC;AACJ,CAAC"}
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Consent Type Definitions
|
|
4
4
|
*
|
|
5
5
|
* Canonical types for consent configuration, branding, copy, and auth modes.
|
|
6
|
-
* These types are the single source of truth shared between MCP-I and
|
|
6
|
+
* These types are the single source of truth shared between MCP-I and Checkpoint.
|
|
7
7
|
*
|
|
8
8
|
* @module @kya-os/consent/types
|
|
9
9
|
*/
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
* @module @kya-os/consent/types/modes
|
|
41
41
|
*/
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.AUTH_MODE_TO_PROVIDER_TYPE = exports.PROVIDER_TYPES = exports.AUTH_MODES = void 0;
|
|
43
|
+
exports.AUTH_MODE_TO_PROVIDER_TYPE = exports.PROVIDER_TYPES = exports.PASSKEY_CEREMONIES = exports.AUTH_MODES = void 0;
|
|
44
44
|
exports.getProviderTypeForAuthMode = getProviderTypeForAuthMode;
|
|
45
45
|
/**
|
|
46
46
|
* Supported Authentication Modes
|
|
47
47
|
*
|
|
48
48
|
* Constants for all supported auth modes in consent pages.
|
|
49
|
-
* Matches
|
|
49
|
+
* Matches Checkpoint's AUTH_MODES constant.
|
|
50
50
|
*
|
|
51
51
|
* The mode determines the screen flow:
|
|
52
52
|
* - CONSENT_ONLY: Consent → Success (2 screens) - Direct to consent, no auth
|
|
@@ -70,6 +70,13 @@ exports.AUTH_MODES = {
|
|
|
70
70
|
/** Identity verification (future) - Auth → Consent → Success (3 screens) */
|
|
71
71
|
IDV: "idv",
|
|
72
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Passkey ceremonies a consent step can ask for.
|
|
75
|
+
*
|
|
76
|
+
* - `register`: create a passkey (WebAuthn `navigator.credentials.create()`).
|
|
77
|
+
* - `authenticate`: use an existing passkey (`navigator.credentials.get()`).
|
|
78
|
+
*/
|
|
79
|
+
exports.PASSKEY_CEREMONIES = ["register", "authenticate"];
|
|
73
80
|
// =============================================================================
|
|
74
81
|
// AUTH_MODE → CONSENT_PROVIDER_TYPE MAPPING (Single Source of Truth)
|
|
75
82
|
// =============================================================================
|
|
@@ -77,7 +84,7 @@ exports.AUTH_MODES = {
|
|
|
77
84
|
* Consent Provider Types for delegation metadata
|
|
78
85
|
*
|
|
79
86
|
* These are the values stored in delegation metadata.provider_type
|
|
80
|
-
* and must match
|
|
87
|
+
* and must match Checkpoint's tool protection authorization.type values.
|
|
81
88
|
*
|
|
82
89
|
* IMPORTANT: This must stay in sync with @kya-os/contracts/tool-protection CONSENT_PROVIDER_TYPES
|
|
83
90
|
*/
|
|
@@ -101,7 +108,7 @@ exports.PROVIDER_TYPES = {
|
|
|
101
108
|
*
|
|
102
109
|
* IMPORTANT: This mapping ensures type-safety between:
|
|
103
110
|
* - AUTH_MODES (what UI/flow to render)
|
|
104
|
-
* - PROVIDER_TYPES (what to send to
|
|
111
|
+
* - PROVIDER_TYPES (what to send to Checkpoint for authorization validation)
|
|
105
112
|
*
|
|
106
113
|
* The tool protection layer expects authorization.type to match these values.
|
|
107
114
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modes.types.js","sourceRoot":"","sources":["../../../src/types/modes.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;;;
|
|
1
|
+
{"version":3,"file":"modes.types.js","sourceRoot":"","sources":["../../../src/types/modes.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;;;AAgWH,gEAEC;AAhWD;;;;;;;;;GASG;AACU,QAAA,UAAU,GAAG;IACxB,4EAA4E;IAC5E,YAAY,EAAE,cAAc;IAE5B,8EAA8E;IAC9E,WAAW,EAAE,aAAa;IAE1B,2EAA2E;IAC3E,KAAK,EAAE,OAAO;IAEd,6EAA6E;IAC7E,UAAU,EAAE,YAAY;IAExB,yFAAyF;IACzF,GAAG,EAAE,KAAK;IAEV,sFAAsF;IACtF,OAAO,EAAE,SAAS;IAElB,sFAAsF;IACtF,OAAO,EAAE,SAAS;IAElB,4EAA4E;IAC5E,GAAG,EAAE,KAAK;CACF,CAAC;AA+IX;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG,CAAC,UAAU,EAAE,cAAc,CAAU,CAAC;AAkGxE,gFAAgF;AAChF,qEAAqE;AACrE,gFAAgF;AAEhF;;;;;;;GAOG;AACU,QAAA,cAAc,GAAG;IAC5B,iEAAiE;IACjE,IAAI,EAAE,MAAM;IACZ,wEAAwE;IACxE,QAAQ,EAAE,UAAU;IACpB,qCAAqC;IACrC,MAAM,EAAE,QAAQ;IAChB,sCAAsC;IACtC,UAAU,EAAE,YAAY;IACxB,yCAAyC;IACzC,GAAG,EAAE,KAAK;CACF,CAAC;AAIX;;;;;;;;;;;GAWG;AACU,QAAA,0BAA0B,GAAmC;IACxE,CAAC,kBAAU,CAAC,YAAY,CAAC,EAAE,sBAAc,CAAC,IAAI;IAC9C,CAAC,kBAAU,CAAC,WAAW,CAAC,EAAE,sBAAc,CAAC,QAAQ,EAAE,yCAAyC;IAC5F,CAAC,kBAAU,CAAC,KAAK,CAAC,EAAE,sBAAc,CAAC,MAAM;IACzC,CAAC,kBAAU,CAAC,UAAU,CAAC,EAAE,sBAAc,CAAC,UAAU;IAClD,CAAC,kBAAU,CAAC,GAAG,CAAC,EAAE,sBAAc,CAAC,GAAG;IACpC,mDAAmD;IACnD,CAAC,kBAAU,CAAC,OAAO,CAAC,EAAE,sBAAc,CAAC,IAAI;IACzC,CAAC,kBAAU,CAAC,OAAO,CAAC,EAAE,sBAAc,CAAC,IAAI;IACzC,CAAC,kBAAU,CAAC,GAAG,CAAC,EAAE,sBAAc,CAAC,IAAI;CACtC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,0BAA0B,CAAC,IAAc;IACvD,OAAO,kCAA0B,CAAC,IAAI,CAAC,IAAI,sBAAc,CAAC,IAAI,CAAC;AACjE,CAAC"}
|
|
@@ -2,25 +2,38 @@
|
|
|
2
2
|
* Consent Agent Header
|
|
3
3
|
*
|
|
4
4
|
* Renders the agent identity tile shared between the new consent screen and
|
|
5
|
-
* the OAuth Gateway consent modal. Shows logo + name +
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* the OAuth Gateway consent modal. Shows logo + name + pill + meta line
|
|
6
|
+
* (`Made by {Vendor} · Asking from your {Surface} · Connected just now`).
|
|
7
|
+
*
|
|
8
|
+
* The pill follows how the agent's identity is established
|
|
9
|
+
* (`verification`): Verified, the domain a CIMD client is bound to (e.g.
|
|
10
|
+
* "chatgpt.com", never the word Verified), or UNVERIFIED.
|
|
8
11
|
*
|
|
9
12
|
* Fed by `AgentMetadata` from `@kya-os/consent/types/capabilities`.
|
|
10
13
|
*
|
|
11
14
|
* @module components/consent-agent-header
|
|
12
15
|
*/
|
|
13
16
|
import { LitElement } from "lit";
|
|
17
|
+
import { type AgentVerification } from "../types/capabilities.types.js";
|
|
14
18
|
export declare class ConsentAgentHeader extends LitElement {
|
|
15
19
|
agentName: string;
|
|
16
20
|
vendor: string;
|
|
17
21
|
surfaceLabel: string;
|
|
22
|
+
/**
|
|
23
|
+
* How the agent's identity is established: `verified`, `domain` or
|
|
24
|
+
* `unverified`. When unset, the deprecated `verified` boolean decides.
|
|
25
|
+
*/
|
|
26
|
+
verification: AgentVerification | undefined;
|
|
27
|
+
/** The domain a `domain` agent is bound to, named in its pill. */
|
|
28
|
+
domain: string;
|
|
29
|
+
/** @deprecated Use `verification`; read only when it is unset. */
|
|
18
30
|
verified: boolean;
|
|
19
31
|
logoUrl: string;
|
|
20
32
|
connectedAt: string;
|
|
21
33
|
static styles: import("lit").CSSResult;
|
|
22
34
|
private renderConnectedFragment;
|
|
23
35
|
private renderMeta;
|
|
36
|
+
private renderPill;
|
|
24
37
|
render(): import("lit").TemplateResult<1>;
|
|
25
38
|
}
|
|
26
39
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-agent-header.d.ts","sourceRoot":"","sources":["../../src/components/consent-agent-header.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"consent-agent-header.d.ts","sourceRoot":"","sources":["../../src/components/consent-agent-header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,gCAAgC,CAAC;AAExC,qBACa,kBAAmB,SAAQ,UAAU;IACpB,SAAS,SAAM;IACf,MAAM,SAAM;IACZ,YAAY,SAAM;IAC9C;;;OAGG;IACyB,YAAY,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACxE,kEAAkE;IACtC,MAAM,SAAM;IACxC,kEAAkE;IACrC,QAAQ,UAAS;IAClB,OAAO,SAAM;IACb,WAAW,SAAM;IAE7C,OAAgB,MAAM,0BAmIpB;IAEF,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,UAAU;IAkBT,MAAM;CAoBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
* Consent Agent Header
|
|
3
3
|
*
|
|
4
4
|
* Renders the agent identity tile shared between the new consent screen and
|
|
5
|
-
* the OAuth Gateway consent modal. Shows logo + name +
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* the OAuth Gateway consent modal. Shows logo + name + pill + meta line
|
|
6
|
+
* (`Made by {Vendor} · Asking from your {Surface} · Connected just now`).
|
|
7
|
+
*
|
|
8
|
+
* The pill follows how the agent's identity is established
|
|
9
|
+
* (`verification`): Verified, the domain a CIMD client is bound to (e.g.
|
|
10
|
+
* "chatgpt.com", never the word Verified), or UNVERIFIED.
|
|
8
11
|
*
|
|
9
12
|
* Fed by `AgentMetadata` from `@kya-os/consent/types/capabilities`.
|
|
10
13
|
*
|
|
@@ -19,12 +22,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
19
22
|
import { LitElement, html, css, nothing } from "lit";
|
|
20
23
|
import { customElement, property } from "lit/decorators.js";
|
|
21
24
|
import { CONSENT_COPY_TOKENS, formatToken } from "../copy/tokens.js";
|
|
25
|
+
import { agentVerification, } from "../types/capabilities.types.js";
|
|
22
26
|
let ConsentAgentHeader = class ConsentAgentHeader extends LitElement {
|
|
23
27
|
constructor() {
|
|
24
28
|
super(...arguments);
|
|
25
29
|
this.agentName = "";
|
|
26
30
|
this.vendor = "";
|
|
27
31
|
this.surfaceLabel = "";
|
|
32
|
+
/** The domain a `domain` agent is bound to, named in its pill. */
|
|
33
|
+
this.domain = "";
|
|
34
|
+
/** @deprecated Use `verification`; read only when it is unset. */
|
|
28
35
|
this.verified = false;
|
|
29
36
|
this.logoUrl = "";
|
|
30
37
|
this.connectedAt = "";
|
|
@@ -55,12 +62,25 @@ let ConsentAgentHeader = class ConsentAgentHeader extends LitElement {
|
|
|
55
62
|
Connected: this.renderConnectedFragment(),
|
|
56
63
|
});
|
|
57
64
|
}
|
|
65
|
+
renderPill() {
|
|
66
|
+
const tokens = CONSENT_COPY_TOKENS.agentTile;
|
|
67
|
+
const state = agentVerification({
|
|
68
|
+
verification: this.verification,
|
|
69
|
+
verified: this.verified,
|
|
70
|
+
domain: this.domain,
|
|
71
|
+
});
|
|
72
|
+
if (state === "domain") {
|
|
73
|
+
return html `<span class="pill domain" part="pill"
|
|
74
|
+
><span class="visually-hidden">${tokens.domainPillPrefix} </span
|
|
75
|
+
>${this.domain.trim()}</span
|
|
76
|
+
>`;
|
|
77
|
+
}
|
|
78
|
+
return html `<span class="pill ${state}" part="pill">
|
|
79
|
+
${state === "verified" ? tokens.verifiedPill : tokens.unverifiedPill}
|
|
80
|
+
</span>`;
|
|
81
|
+
}
|
|
58
82
|
render() {
|
|
59
83
|
const initial = (this.agentName || "?").trim().charAt(0).toUpperCase();
|
|
60
|
-
const verifiedLabel = this.verified
|
|
61
|
-
? CONSENT_COPY_TOKENS.agentTile.verifiedPill
|
|
62
|
-
: CONSENT_COPY_TOKENS.agentTile.unverifiedPill;
|
|
63
|
-
const verifiedClass = this.verified ? "verified" : "unverified";
|
|
64
84
|
return html `
|
|
65
85
|
<div class="tile" part="tile">
|
|
66
86
|
<div class="logo" aria-hidden="true">
|
|
@@ -71,9 +91,7 @@ let ConsentAgentHeader = class ConsentAgentHeader extends LitElement {
|
|
|
71
91
|
<div class="body">
|
|
72
92
|
<div class="row-name">
|
|
73
93
|
<span class="name">${this.agentName || nothing}</span>
|
|
74
|
-
|
|
75
|
-
${verifiedLabel}
|
|
76
|
-
</span>
|
|
94
|
+
${this.renderPill()}
|
|
77
95
|
</div>
|
|
78
96
|
<div class="meta">${this.renderMeta()}</div>
|
|
79
97
|
</div>
|
|
@@ -97,30 +115,33 @@ ConsentAgentHeader.styles = css `
|
|
|
97
115
|
border: 1px solid var(--cs-surface-border, transparent);
|
|
98
116
|
}
|
|
99
117
|
|
|
118
|
+
/* Agent tile: white with a light border in every theme, 44px outside. */
|
|
100
119
|
.logo {
|
|
120
|
+
box-sizing: border-box;
|
|
101
121
|
width: 44px;
|
|
102
122
|
height: 44px;
|
|
103
123
|
border-radius: 12px;
|
|
104
124
|
flex-shrink: 0;
|
|
105
|
-
background: var(--cs-
|
|
125
|
+
background: var(--cs-agent-tile-bg, #ffffff);
|
|
106
126
|
display: flex;
|
|
107
127
|
align-items: center;
|
|
108
128
|
justify-content: center;
|
|
109
129
|
overflow: hidden;
|
|
110
|
-
border: 1px solid var(--cs-
|
|
130
|
+
border: 1px solid var(--cs-agent-tile-border, rgba(15, 23, 42, 0.08));
|
|
111
131
|
}
|
|
112
132
|
|
|
133
|
+
/* Contained, not cropped: 28px leaves an 8px inset inside the 44px tile. */
|
|
113
134
|
.logo img {
|
|
114
|
-
width:
|
|
115
|
-
height:
|
|
116
|
-
object-fit:
|
|
135
|
+
width: 28px;
|
|
136
|
+
height: 28px;
|
|
137
|
+
object-fit: contain;
|
|
117
138
|
}
|
|
118
139
|
|
|
119
140
|
.logo .placeholder {
|
|
120
141
|
width: 100%;
|
|
121
142
|
height: 100%;
|
|
122
|
-
background:
|
|
123
|
-
color: var(--cs-
|
|
143
|
+
background: transparent;
|
|
144
|
+
color: var(--cs-agent-tile-text, #0f172a);
|
|
124
145
|
display: flex;
|
|
125
146
|
align-items: center;
|
|
126
147
|
justify-content: center;
|
|
@@ -145,7 +166,7 @@ ConsentAgentHeader.styles = css `
|
|
|
145
166
|
.name {
|
|
146
167
|
font-size: 16px;
|
|
147
168
|
font-weight: 600;
|
|
148
|
-
color: var(--cs-text-primary, #
|
|
169
|
+
color: var(--cs-text-primary, #0f172a);
|
|
149
170
|
letter-spacing: -0.01em;
|
|
150
171
|
}
|
|
151
172
|
|
|
@@ -161,19 +182,52 @@ ConsentAgentHeader.styles = css `
|
|
|
161
182
|
}
|
|
162
183
|
|
|
163
184
|
.pill.verified {
|
|
164
|
-
background: var(--cs-pill-verified-bg, #
|
|
185
|
+
background: var(--cs-pill-verified-bg, #dcfce7);
|
|
165
186
|
color: var(--cs-pill-verified-text, #166534);
|
|
166
187
|
}
|
|
167
188
|
|
|
168
189
|
.pill.unverified {
|
|
169
|
-
background: var(--cs-pill-unverified-bg, #
|
|
190
|
+
background: var(--cs-pill-unverified-bg, #f1f5f9);
|
|
170
191
|
color: var(--cs-pill-unverified-text, #475569);
|
|
171
192
|
letter-spacing: 0.08em;
|
|
172
193
|
}
|
|
173
194
|
|
|
195
|
+
/*
|
|
196
|
+
* Domain-bound: a tint and an outline from the brand primary, with the
|
|
197
|
+
* theme's own text color, so the domain reads in light and dark
|
|
198
|
+
* whatever the brand color is.
|
|
199
|
+
*/
|
|
200
|
+
.pill.domain {
|
|
201
|
+
background: var(
|
|
202
|
+
--cs-pill-domain-bg,
|
|
203
|
+
color-mix(in srgb, var(--consent-primary, #2563eb) 14%, transparent)
|
|
204
|
+
);
|
|
205
|
+
box-shadow: inset 0 0 0 1px
|
|
206
|
+
var(
|
|
207
|
+
--cs-pill-domain-border,
|
|
208
|
+
color-mix(in srgb, var(--consent-primary, #2563eb) 40%, transparent)
|
|
209
|
+
);
|
|
210
|
+
color: var(--cs-pill-domain-text, var(--cs-text-primary, #0f172a));
|
|
211
|
+
font-weight: 500;
|
|
212
|
+
letter-spacing: 0;
|
|
213
|
+
overflow-wrap: anywhere;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.visually-hidden {
|
|
217
|
+
position: absolute;
|
|
218
|
+
width: 1px;
|
|
219
|
+
height: 1px;
|
|
220
|
+
margin: -1px;
|
|
221
|
+
padding: 0;
|
|
222
|
+
overflow: hidden;
|
|
223
|
+
clip: rect(0, 0, 0, 0);
|
|
224
|
+
white-space: nowrap;
|
|
225
|
+
border: 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
174
228
|
.meta {
|
|
175
229
|
font-size: 12px;
|
|
176
|
-
color: var(--cs-text-tertiary, #
|
|
230
|
+
color: var(--cs-text-tertiary, #64748b);
|
|
177
231
|
line-height: 1.5;
|
|
178
232
|
}
|
|
179
233
|
`;
|
|
@@ -186,6 +240,12 @@ __decorate([
|
|
|
186
240
|
__decorate([
|
|
187
241
|
property({ type: String })
|
|
188
242
|
], ConsentAgentHeader.prototype, "surfaceLabel", void 0);
|
|
243
|
+
__decorate([
|
|
244
|
+
property({ type: String })
|
|
245
|
+
], ConsentAgentHeader.prototype, "verification", void 0);
|
|
246
|
+
__decorate([
|
|
247
|
+
property({ type: String })
|
|
248
|
+
], ConsentAgentHeader.prototype, "domain", void 0);
|
|
189
249
|
__decorate([
|
|
190
250
|
property({ type: Boolean })
|
|
191
251
|
], ConsentAgentHeader.prototype, "verified", 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;;;;;;;;;;;;;;GAcG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5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,EAAE;;8BAED,IAAI,CAAC,UAAU,EAAE;;;KAG1C,CAAC;IACJ,CAAC;;AAtMe,yBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmI3B,AAnIqB,CAmIpB;AAlJ0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAa;AACZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAmB;AAKlB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAA6C;AAE5C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAa;AAEX;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAAkB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAkB;AAdlC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAuN9B"}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module components/consent-button
|
|
10
10
|
*/
|
|
11
|
-
import { LitElement } from
|
|
11
|
+
import { LitElement } from "lit";
|
|
12
12
|
/**
|
|
13
|
-
* Button variants matching
|
|
13
|
+
* Button variants matching Checkpoint design system
|
|
14
14
|
*/
|
|
15
|
-
export type ButtonVariant =
|
|
15
|
+
export type ButtonVariant = "primary" | "secondary";
|
|
16
16
|
/**
|
|
17
17
|
* ConsentButton - A themed button component
|
|
18
18
|
*
|
|
@@ -24,6 +24,7 @@ export type ButtonVariant = 'primary' | 'secondary';
|
|
|
24
24
|
*
|
|
25
25
|
* @csspart button - The native button element
|
|
26
26
|
* @cssprop --consent-primary - Primary brand color (default: #2563EB)
|
|
27
|
+
* @cssprop --consent-on-primary - Text and checkmarks on the primary fill (default: white)
|
|
27
28
|
*/
|
|
28
29
|
export declare class ConsentButton extends LitElement {
|
|
29
30
|
static formAssociated: boolean;
|
|
@@ -36,7 +37,7 @@ export declare class ConsentButton extends LitElement {
|
|
|
36
37
|
/**
|
|
37
38
|
* Button type attribute (button, submit, reset)
|
|
38
39
|
*/
|
|
39
|
-
type:
|
|
40
|
+
type: "button" | "submit" | "reset";
|
|
40
41
|
/**
|
|
41
42
|
* Disabled state
|
|
42
43
|
*/
|
|
@@ -55,7 +56,7 @@ export declare class ConsentButton extends LitElement {
|
|
|
55
56
|
}
|
|
56
57
|
declare global {
|
|
57
58
|
interface HTMLElementTagNameMap {
|
|
58
|
-
|
|
59
|
+
"consent-button": ConsentButton;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
//# sourceMappingURL=consent-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-button.d.ts","sourceRoot":"","sources":["../../src/components/consent-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"consent-button.d.ts","sourceRoot":"","sources":["../../src/components/consent-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,qBACa,aAAc,SAAQ,UAAU;IAE3C,MAAM,CAAC,cAAc,UAAQ;IAE7B,OAAO,CAAC,SAAS,CAAmB;;IAOpC;;OAEG;IAEH,OAAO,EAAE,aAAa,CAAa;IAEnC;;OAEG;IAEH,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAY;IAE/C;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,SAAS,UAAS;IAElB;;OAEG;IAEH,OAAO,UAAS;IAEhB,OAAgB,MAAM,0BAwEpB;IAEF,OAAO,CAAC,WAAW;IAcV,MAAM;CAchB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
|
|
@@ -14,8 +14,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
14
14
|
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;
|
|
15
15
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16
16
|
};
|
|
17
|
-
import { LitElement, html, css } from
|
|
18
|
-
import { customElement, property } from
|
|
17
|
+
import { LitElement, html, css } from "lit";
|
|
18
|
+
import { customElement, property } from "lit/decorators.js";
|
|
19
19
|
/**
|
|
20
20
|
* ConsentButton - A themed button component
|
|
21
21
|
*
|
|
@@ -27,6 +27,7 @@ import { customElement, property } from 'lit/decorators.js';
|
|
|
27
27
|
*
|
|
28
28
|
* @csspart button - The native button element
|
|
29
29
|
* @cssprop --consent-primary - Primary brand color (default: #2563EB)
|
|
30
|
+
* @cssprop --consent-on-primary - Text and checkmarks on the primary fill (default: white)
|
|
30
31
|
*/
|
|
31
32
|
let ConsentButton = class ConsentButton extends LitElement {
|
|
32
33
|
constructor() {
|
|
@@ -34,11 +35,11 @@ let ConsentButton = class ConsentButton extends LitElement {
|
|
|
34
35
|
/**
|
|
35
36
|
* Button variant - 'primary' (filled) or 'secondary' (outlined)
|
|
36
37
|
*/
|
|
37
|
-
this.variant =
|
|
38
|
+
this.variant = "primary";
|
|
38
39
|
/**
|
|
39
40
|
* Button type attribute (button, submit, reset)
|
|
40
41
|
*/
|
|
41
|
-
this.type =
|
|
42
|
+
this.type = "button";
|
|
42
43
|
/**
|
|
43
44
|
* Disabled state
|
|
44
45
|
*/
|
|
@@ -59,11 +60,11 @@ let ConsentButton = class ConsentButton extends LitElement {
|
|
|
59
60
|
const form = this.internals.form;
|
|
60
61
|
if (!form)
|
|
61
62
|
return;
|
|
62
|
-
if (this.type ===
|
|
63
|
+
if (this.type === "submit") {
|
|
63
64
|
// Trigger form submission
|
|
64
65
|
form.requestSubmit();
|
|
65
66
|
}
|
|
66
|
-
else if (this.type ===
|
|
67
|
+
else if (this.type === "reset") {
|
|
67
68
|
form.reset();
|
|
68
69
|
}
|
|
69
70
|
}
|
|
@@ -95,7 +96,7 @@ ConsentButton.styles = css `
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
button {
|
|
98
|
-
/* Base styles - matches
|
|
99
|
+
/* Base styles - matches Checkpoint PreviewButton exactly */
|
|
99
100
|
padding: 0.75rem 1rem;
|
|
100
101
|
height: 2.75rem;
|
|
101
102
|
border-radius: 0.5rem;
|
|
@@ -103,7 +104,9 @@ ConsentButton.styles = css `
|
|
|
103
104
|
font-weight: 500;
|
|
104
105
|
font-family: inherit;
|
|
105
106
|
cursor: pointer;
|
|
106
|
-
transition:
|
|
107
|
+
transition:
|
|
108
|
+
opacity 0.15s ease,
|
|
109
|
+
background-color 0.15s ease;
|
|
107
110
|
border: none;
|
|
108
111
|
width: 100%;
|
|
109
112
|
display: inline-flex;
|
|
@@ -113,23 +116,23 @@ ConsentButton.styles = css `
|
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
/* Primary variant */
|
|
116
|
-
:host([variant=
|
|
119
|
+
:host([variant="primary"]) button {
|
|
117
120
|
background-color: var(--consent-primary, #2563eb);
|
|
118
|
-
color: white;
|
|
121
|
+
color: var(--consent-on-primary, white);
|
|
119
122
|
}
|
|
120
123
|
|
|
121
|
-
:host([variant=
|
|
124
|
+
:host([variant="primary"]) button:hover:not(:disabled) {
|
|
122
125
|
opacity: 0.9;
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
/* Secondary variant */
|
|
126
|
-
:host([variant=
|
|
129
|
+
:host([variant="secondary"]) button {
|
|
127
130
|
background-color: transparent;
|
|
128
131
|
color: #374151;
|
|
129
132
|
border: 1px solid #d1d5db;
|
|
130
133
|
}
|
|
131
134
|
|
|
132
|
-
:host([variant=
|
|
135
|
+
:host([variant="secondary"]) button:hover:not(:disabled) {
|
|
133
136
|
background-color: #f9fafb;
|
|
134
137
|
}
|
|
135
138
|
|
|
@@ -165,13 +168,13 @@ __decorate([
|
|
|
165
168
|
property({ type: Boolean, reflect: true })
|
|
166
169
|
], ConsentButton.prototype, "disabled", void 0);
|
|
167
170
|
__decorate([
|
|
168
|
-
property({ type: Boolean, attribute:
|
|
171
|
+
property({ type: Boolean, attribute: "full-width" })
|
|
169
172
|
], ConsentButton.prototype, "fullWidth", void 0);
|
|
170
173
|
__decorate([
|
|
171
174
|
property({ type: Boolean, reflect: true })
|
|
172
175
|
], ConsentButton.prototype, "loading", void 0);
|
|
173
176
|
ConsentButton = __decorate([
|
|
174
|
-
customElement(
|
|
177
|
+
customElement("consent-button")
|
|
175
178
|
], ConsentButton);
|
|
176
179
|
export { ConsentButton };
|
|
177
180
|
//# sourceMappingURL=consent-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-button.js","sourceRoot":"","sources":["../../src/components/consent-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAO5D
|
|
1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AC,CAAC,IAAI,CAAA,+BAA+B,CAAC,CAAC,CAAC,IAAI;;;KAG9D,CAAC;IACJ,CAAC;;AA7ID,0BAA0B;AACnB,4BAAc,GAAG,IAAI,AAAP,CAAQ;AAuCb,oBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwE3B,AAxEqB,CAwEpB;AAlGF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CACP;AAMnC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACoB;AAM/C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAC1B;AAMjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;gDACnC;AAMlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAC3B;AAvCL,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CA+IzB"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @module components/consent-capabilities-screen
|
|
17
17
|
*/
|
|
18
18
|
import { LitElement } from "lit";
|
|
19
|
-
import type
|
|
19
|
+
import { type ConsentScopeCapability, type AgentMetadata, type ConsentTheme, type CedarTemplateContext } from "../types/capabilities.types.js";
|
|
20
20
|
import "./consent-agent-header.js";
|
|
21
21
|
import "./consent-capability-card.js";
|
|
22
22
|
import "./consent-action-bar.js";
|
|
@@ -45,6 +45,8 @@ export declare class ConsentCapabilitiesScreen extends LitElement {
|
|
|
45
45
|
revocationPath: string;
|
|
46
46
|
inactivityDays: number;
|
|
47
47
|
fixedExpiry: boolean;
|
|
48
|
+
/** Fixed grant lifetime from a server-bound mandate; see the revocation notice. */
|
|
49
|
+
fixedExpiryDays: number | undefined;
|
|
48
50
|
theme: ConsentTheme;
|
|
49
51
|
howItWorksUrl: string;
|
|
50
52
|
loading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent-capabilities-screen.d.ts","sourceRoot":"","sources":["../../src/components/consent-capabilities-screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"consent-capabilities-screen.d.ts","sourceRoot":"","sources":["../../src/components/consent-capabilities-screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;AAOxC,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AACtC,OAAO,yBAAyB,CAAC;AACjC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,gCAAgC,CAAC;AACxC,OAAO,+BAA+B,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,qBACa,yBAA0B,SAAQ,UAAU;IACvD,MAAM,CAAC,QAAQ,CAAC,QAAQ;;;;OAAiC;IAE9B,YAAY,EAAE,sBAAsB,EAAE,CAAM;IAC3C,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACzC,YAAY,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC/C,OAAO,SAAM;IACb,YAAY,SAAM;IAClB,cAAc,SAAgC;IAC9C,cAAc,SAAM;IACQ,WAAW,UA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