@kya-os/consent 0.2.2 → 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.
Files changed (266) hide show
  1. package/README.md +344 -2
  2. package/dist/bundle/index.d.ts +48 -36
  3. package/dist/bundle/index.d.ts.map +1 -1
  4. package/dist/bundle/index.js +45 -33
  5. package/dist/bundle/index.js.map +1 -1
  6. package/dist/bundle/inline.d.ts.map +1 -1
  7. package/dist/bundle/inline.js +4 -4
  8. package/dist/bundle/inline.js.map +1 -1
  9. package/dist/bundle/shell.d.ts +7 -0
  10. package/dist/bundle/shell.d.ts.map +1 -1
  11. package/dist/bundle/shell.js +5 -0
  12. package/dist/bundle/shell.js.map +1 -1
  13. package/dist/cjs/bundle/index.js +14 -1
  14. package/dist/cjs/bundle/index.js.map +1 -1
  15. package/dist/cjs/bundle/inline.js +4 -4
  16. package/dist/cjs/bundle/inline.js.map +1 -1
  17. package/dist/cjs/bundle/shell.js +5 -0
  18. package/dist/cjs/bundle/shell.js.map +1 -1
  19. package/dist/cjs/components/consent-action-bar.js +66 -15
  20. package/dist/cjs/components/consent-action-bar.js.map +1 -1
  21. package/dist/cjs/components/consent-agent-header.js +20 -10
  22. package/dist/cjs/components/consent-agent-header.js.map +1 -1
  23. package/dist/cjs/components/consent-capabilities-screen.js +57 -79
  24. package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
  25. package/dist/cjs/components/consent-checkbox.js +2 -2
  26. package/dist/cjs/components/consent-checkbox.js.map +1 -1
  27. package/dist/cjs/components/consent-duration.js +187 -0
  28. package/dist/cjs/components/consent-duration.js.map +1 -0
  29. package/dist/cjs/components/consent-folder-scope.js +169 -0
  30. package/dist/cjs/components/consent-folder-scope.js.map +1 -0
  31. package/dist/cjs/components/consent-footer.js +13 -2
  32. package/dist/cjs/components/consent-footer.js.map +1 -1
  33. package/dist/cjs/components/consent-grant-terms.js +321 -0
  34. package/dist/cjs/components/consent-grant-terms.js.map +1 -0
  35. package/dist/cjs/components/consent-headline.js +138 -0
  36. package/dist/cjs/components/consent-headline.js.map +1 -0
  37. package/dist/cjs/components/consent-input.js +47 -27
  38. package/dist/cjs/components/consent-input.js.map +1 -1
  39. package/dist/cjs/components/consent-otp-input.js +79 -55
  40. package/dist/cjs/components/consent-otp-input.js.map +1 -1
  41. package/dist/cjs/components/consent-phone-handoff.js +219 -0
  42. package/dist/cjs/components/consent-phone-handoff.js.map +1 -0
  43. package/dist/cjs/components/consent-request-expiry.js +159 -0
  44. package/dist/cjs/components/consent-request-expiry.js.map +1 -0
  45. package/dist/cjs/components/consent-revoke.js +308 -0
  46. package/dist/cjs/components/consent-revoke.js.map +1 -0
  47. package/dist/cjs/components/consent-shell.js +3 -0
  48. package/dist/cjs/components/consent-shell.js.map +1 -1
  49. package/dist/cjs/components/consent-terms.js +2 -2
  50. package/dist/cjs/components/consent-terms.js.map +1 -1
  51. package/dist/cjs/components/consent-wallet-check.js +107 -0
  52. package/dist/cjs/components/consent-wallet-check.js.map +1 -0
  53. package/dist/cjs/components/consent-wallet-notice.js +189 -0
  54. package/dist/cjs/components/consent-wallet-notice.js.map +1 -0
  55. package/dist/cjs/components/consent-wallet-orb.js +273 -0
  56. package/dist/cjs/components/consent-wallet-orb.js.map +1 -0
  57. package/dist/cjs/components/consent-wallet-signature.js +104 -0
  58. package/dist/cjs/components/consent-wallet-signature.js.map +1 -0
  59. package/dist/cjs/components/grant-field-styles.js +85 -0
  60. package/dist/cjs/components/grant-field-styles.js.map +1 -0
  61. package/dist/cjs/components/index.js +34 -1
  62. package/dist/cjs/components/index.js.map +1 -1
  63. package/dist/cjs/components/mcp-consent.js +60 -2
  64. package/dist/cjs/components/mcp-consent.js.map +1 -1
  65. package/dist/cjs/components/template-link.js +32 -0
  66. package/dist/cjs/components/template-link.js.map +1 -0
  67. package/dist/cjs/components/wallet-globe.js +184 -0
  68. package/dist/cjs/components/wallet-globe.js.map +1 -0
  69. package/dist/cjs/components/wallet-icons.js +19 -0
  70. package/dist/cjs/components/wallet-icons.js.map +1 -0
  71. package/dist/cjs/components/wallet-status.js +34 -0
  72. package/dist/cjs/components/wallet-status.js.map +1 -0
  73. package/dist/cjs/copy/tokens.js +107 -1
  74. package/dist/cjs/copy/tokens.js.map +1 -1
  75. package/dist/cjs/grant/index.js +24 -0
  76. package/dist/cjs/grant/index.js.map +1 -0
  77. package/dist/cjs/grant/terms.js +148 -0
  78. package/dist/cjs/grant/terms.js.map +1 -0
  79. package/dist/cjs/identity/agent-identity.js +314 -0
  80. package/dist/cjs/identity/agent-identity.js.map +1 -0
  81. package/dist/cjs/identity/documents.js +212 -0
  82. package/dist/cjs/identity/documents.js.map +1 -0
  83. package/dist/cjs/identity/entity-card.js +128 -0
  84. package/dist/cjs/identity/entity-card.js.map +1 -0
  85. package/dist/cjs/identity/index.js +31 -0
  86. package/dist/cjs/identity/index.js.map +1 -0
  87. package/dist/cjs/identity/resolve.js +122 -0
  88. package/dist/cjs/identity/resolve.js.map +1 -0
  89. package/dist/cjs/identity/schemas.js +88 -0
  90. package/dist/cjs/identity/schemas.js.map +1 -0
  91. package/dist/cjs/index.js +5 -1
  92. package/dist/cjs/index.js.map +1 -1
  93. package/dist/cjs/mcp-app/inline.js +2 -2
  94. package/dist/cjs/mcp-app/inline.js.map +1 -1
  95. package/dist/cjs/mcp-app/types.js +1 -1
  96. package/dist/cjs/popup/launcher.js +3 -3
  97. package/dist/cjs/react/index.js +260 -25
  98. package/dist/cjs/react/index.js.map +1 -1
  99. package/dist/cjs/templates/index.js +1 -1
  100. package/dist/cjs/types/index.js +1 -1
  101. package/dist/components/consent-action-bar.d.ts +17 -0
  102. package/dist/components/consent-action-bar.d.ts.map +1 -1
  103. package/dist/components/consent-action-bar.js +67 -16
  104. package/dist/components/consent-action-bar.js.map +1 -1
  105. package/dist/components/consent-agent-header.d.ts +3 -1
  106. package/dist/components/consent-agent-header.d.ts.map +1 -1
  107. package/dist/components/consent-agent-header.js +20 -10
  108. package/dist/components/consent-agent-header.js.map +1 -1
  109. package/dist/components/consent-capabilities-screen.d.ts +23 -3
  110. package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
  111. package/dist/components/consent-capabilities-screen.js +57 -79
  112. package/dist/components/consent-capabilities-screen.js.map +1 -1
  113. package/dist/components/consent-checkbox.d.ts +1 -1
  114. package/dist/components/consent-checkbox.js +2 -2
  115. package/dist/components/consent-checkbox.js.map +1 -1
  116. package/dist/components/consent-duration.d.ts +64 -0
  117. package/dist/components/consent-duration.d.ts.map +1 -0
  118. package/dist/components/consent-duration.js +184 -0
  119. package/dist/components/consent-duration.js.map +1 -0
  120. package/dist/components/consent-folder-scope.d.ts +70 -0
  121. package/dist/components/consent-folder-scope.d.ts.map +1 -0
  122. package/dist/components/consent-folder-scope.js +166 -0
  123. package/dist/components/consent-folder-scope.js.map +1 -0
  124. package/dist/components/consent-footer.d.ts.map +1 -1
  125. package/dist/components/consent-footer.js +13 -2
  126. package/dist/components/consent-footer.js.map +1 -1
  127. package/dist/components/consent-grant-terms.d.ts +88 -0
  128. package/dist/components/consent-grant-terms.d.ts.map +1 -0
  129. package/dist/components/consent-grant-terms.js +318 -0
  130. package/dist/components/consent-grant-terms.js.map +1 -0
  131. package/dist/components/consent-headline.d.ts +42 -0
  132. package/dist/components/consent-headline.d.ts.map +1 -0
  133. package/dist/components/consent-headline.js +135 -0
  134. package/dist/components/consent-headline.js.map +1 -0
  135. package/dist/components/consent-input.d.ts +4 -4
  136. package/dist/components/consent-input.d.ts.map +1 -1
  137. package/dist/components/consent-input.js +49 -29
  138. package/dist/components/consent-input.js.map +1 -1
  139. package/dist/components/consent-otp-input.d.ts +11 -6
  140. package/dist/components/consent-otp-input.d.ts.map +1 -1
  141. package/dist/components/consent-otp-input.js +81 -57
  142. package/dist/components/consent-otp-input.js.map +1 -1
  143. package/dist/components/consent-phone-handoff.d.ts +50 -0
  144. package/dist/components/consent-phone-handoff.d.ts.map +1 -0
  145. package/dist/components/consent-phone-handoff.js +215 -0
  146. package/dist/components/consent-phone-handoff.js.map +1 -0
  147. package/dist/components/consent-request-expiry.d.ts +52 -0
  148. package/dist/components/consent-request-expiry.d.ts.map +1 -0
  149. package/dist/components/consent-request-expiry.js +154 -0
  150. package/dist/components/consent-request-expiry.js.map +1 -0
  151. package/dist/components/consent-revoke.d.ts +53 -0
  152. package/dist/components/consent-revoke.d.ts.map +1 -0
  153. package/dist/components/consent-revoke.js +305 -0
  154. package/dist/components/consent-revoke.js.map +1 -0
  155. package/dist/components/consent-shell.d.ts.map +1 -1
  156. package/dist/components/consent-shell.js +3 -0
  157. package/dist/components/consent-shell.js.map +1 -1
  158. package/dist/components/consent-terms.d.ts +1 -1
  159. package/dist/components/consent-terms.js +2 -2
  160. package/dist/components/consent-terms.js.map +1 -1
  161. package/dist/components/consent-wallet-check.d.ts +45 -0
  162. package/dist/components/consent-wallet-check.d.ts.map +1 -0
  163. package/dist/components/consent-wallet-check.js +102 -0
  164. package/dist/components/consent-wallet-check.js.map +1 -0
  165. package/dist/components/consent-wallet-notice.d.ts +54 -0
  166. package/dist/components/consent-wallet-notice.d.ts.map +1 -0
  167. package/dist/components/consent-wallet-notice.js +186 -0
  168. package/dist/components/consent-wallet-notice.js.map +1 -0
  169. package/dist/components/consent-wallet-orb.d.ts +48 -0
  170. package/dist/components/consent-wallet-orb.d.ts.map +1 -0
  171. package/dist/components/consent-wallet-orb.js +269 -0
  172. package/dist/components/consent-wallet-orb.js.map +1 -0
  173. package/dist/components/consent-wallet-signature.d.ts +26 -0
  174. package/dist/components/consent-wallet-signature.d.ts.map +1 -0
  175. package/dist/components/consent-wallet-signature.js +101 -0
  176. package/dist/components/consent-wallet-signature.js.map +1 -0
  177. package/dist/components/grant-field-styles.d.ts +9 -0
  178. package/dist/components/grant-field-styles.d.ts.map +1 -0
  179. package/dist/components/grant-field-styles.js +82 -0
  180. package/dist/components/grant-field-styles.js.map +1 -0
  181. package/dist/components/index.d.ts +28 -17
  182. package/dist/components/index.d.ts.map +1 -1
  183. package/dist/components/index.js +31 -17
  184. package/dist/components/index.js.map +1 -1
  185. package/dist/components/mcp-consent.d.ts +16 -0
  186. package/dist/components/mcp-consent.d.ts.map +1 -1
  187. package/dist/components/mcp-consent.js +60 -2
  188. package/dist/components/mcp-consent.js.map +1 -1
  189. package/dist/components/template-link.d.ts +24 -0
  190. package/dist/components/template-link.d.ts.map +1 -0
  191. package/dist/components/template-link.js +29 -0
  192. package/dist/components/template-link.js.map +1 -0
  193. package/dist/components/wallet-globe.d.ts +29 -0
  194. package/dist/components/wallet-globe.d.ts.map +1 -0
  195. package/dist/components/wallet-globe.js +181 -0
  196. package/dist/components/wallet-globe.js.map +1 -0
  197. package/dist/components/wallet-icons.d.ts +16 -0
  198. package/dist/components/wallet-icons.d.ts.map +1 -0
  199. package/dist/components/wallet-icons.js +16 -0
  200. package/dist/components/wallet-icons.js.map +1 -0
  201. package/dist/components/wallet-status.d.ts +19 -0
  202. package/dist/components/wallet-status.d.ts.map +1 -0
  203. package/dist/components/wallet-status.js +29 -0
  204. package/dist/components/wallet-status.js.map +1 -0
  205. package/dist/consent.js +3547 -811
  206. package/dist/consent.min.js +1366 -295
  207. package/dist/copy/tokens.d.ts +107 -1
  208. package/dist/copy/tokens.d.ts.map +1 -1
  209. package/dist/copy/tokens.js +107 -1
  210. package/dist/copy/tokens.js.map +1 -1
  211. package/dist/grant/index.d.ts +8 -0
  212. package/dist/grant/index.d.ts.map +1 -0
  213. package/dist/grant/index.js +8 -0
  214. package/dist/grant/index.js.map +1 -0
  215. package/dist/grant/terms.d.ts +97 -0
  216. package/dist/grant/terms.d.ts.map +1 -0
  217. package/dist/grant/terms.js +139 -0
  218. package/dist/grant/terms.js.map +1 -0
  219. package/dist/identity/agent-identity.d.ts +199 -0
  220. package/dist/identity/agent-identity.d.ts.map +1 -0
  221. package/dist/identity/agent-identity.js +305 -0
  222. package/dist/identity/agent-identity.js.map +1 -0
  223. package/dist/identity/documents.d.ts +63 -0
  224. package/dist/identity/documents.d.ts.map +1 -0
  225. package/dist/identity/documents.js +206 -0
  226. package/dist/identity/documents.js.map +1 -0
  227. package/dist/identity/entity-card.d.ts +80 -0
  228. package/dist/identity/entity-card.d.ts.map +1 -0
  229. package/dist/identity/entity-card.js +119 -0
  230. package/dist/identity/entity-card.js.map +1 -0
  231. package/dist/identity/index.d.ts +15 -0
  232. package/dist/identity/index.d.ts.map +1 -0
  233. package/dist/identity/index.js +15 -0
  234. package/dist/identity/index.js.map +1 -0
  235. package/dist/identity/resolve.d.ts +31 -0
  236. package/dist/identity/resolve.d.ts.map +1 -0
  237. package/dist/identity/resolve.js +119 -0
  238. package/dist/identity/resolve.js.map +1 -0
  239. package/dist/identity/schemas.d.ts +404 -0
  240. package/dist/identity/schemas.d.ts.map +1 -0
  241. package/dist/identity/schemas.js +84 -0
  242. package/dist/identity/schemas.js.map +1 -0
  243. package/dist/index.d.ts +3 -1
  244. package/dist/index.d.ts.map +1 -1
  245. package/dist/index.js +5 -1
  246. package/dist/index.js.map +1 -1
  247. package/dist/kya-os/index.d.ts +55 -0
  248. package/dist/kya-os/index.d.ts.map +1 -0
  249. package/dist/kya-os/index.js +235 -0
  250. package/dist/kya-os/index.js.map +1 -0
  251. package/dist/mcp-app/inline.d.ts.map +1 -1
  252. package/dist/mcp-app/inline.js +2 -2
  253. package/dist/mcp-app/inline.js.map +1 -1
  254. package/dist/mcp-app/types.d.ts +1 -1
  255. package/dist/mcp-app/types.js +1 -1
  256. package/dist/popup/launcher.d.ts +3 -3
  257. package/dist/popup/launcher.js +3 -3
  258. package/dist/react/index.d.ts +182 -22
  259. package/dist/react/index.d.ts.map +1 -1
  260. package/dist/react/index.js +270 -35
  261. package/dist/react/index.js.map +1 -1
  262. package/dist/templates/index.d.ts +1 -1
  263. package/dist/templates/index.js +1 -1
  264. package/dist/types/index.d.ts +1 -1
  265. package/dist/types/index.js +1 -1
  266. package/package.json +49 -8
@@ -1 +1 @@
1
- {"version":3,"file":"inline.js","sourceRoot":"","sources":["../../../src/mcp-app/inline.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,sEAAsE;AACzD,QAAA,oBAAoB,GAAW,2/lxBAA2/lxB,CAAC;AAEximxB,4CAA4C;AAC/B,QAAA,yBAAyB,GAAW,MAAM,CAAC"}
1
+ {"version":3,"file":"inline.js","sourceRoot":"","sources":["../../../src/mcp-app/inline.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,sEAAsE;AACzD,QAAA,oBAAoB,GAAW,6m+0BAA6m+0B,CAAC;AAE1p+0B,4CAA4C;AAC/B,QAAA,yBAAyB,GAAW,MAAM,CAAC"}
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Type definitions for the inline consent UI rendered via MCP Apps.
6
6
  * These match the structuredContent shape produced by
7
- * MCPIRuntimeBase.buildConsentUIResult().
7
+ * the runtime that builds the inline consent UI result.
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  //# sourceMappingURL=types.js.map
@@ -12,7 +12,7 @@
12
12
  * popup closes itself on success. The user never leaves the chat.
13
13
  *
14
14
  * This module is runtime-agnostic. It returns plain data; the runtime adapter
15
- * (e.g. `@kya-os/mcp-i-cloudflare`) is responsible for delivering the chosen
15
+ * is responsible for delivering the chosen
16
16
  * representation back to the MCP client.
17
17
  *
18
18
  * @module @kya-os/consent/popup/launcher
@@ -25,8 +25,8 @@ exports.buildConsentMarkdownLink = buildConsentMarkdownLink;
25
25
  /**
26
26
  * Stable identifiers for clients that support the embedded popup launcher.
27
27
  *
28
- * These IDs match the canonical IDs in `@kya-os/mcp-i-cloudflare`'s
29
- * `findKnownClient` registry. Adding a new client here requires that the
28
+ * These IDs match the canonical IDs in the runtime adapter's known-client
29
+ * registry. Adding a new client here requires that the
30
30
  * client also surface a usable embedded browser.
31
31
  */
32
32
  exports.POPUP_CAPABLE_CLIENT_IDS = ["claude"];
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
2
  /**
3
- * React Wrappers for Consent Web Components
3
+ * `@kya-os/consent/react`
4
4
  *
5
- * Uses @lit/react to create React components from Lit web components.
6
- * This enables using the same components in Checkpoint (React/Next.js).
5
+ * React components for every consent element, made with `@lit/react`.
6
+ * Each one sets props as element properties and takes `onX` handlers for
7
+ * the element's events, which React 18 can't do for a custom element.
8
+ * React 19 can, but only through the raw event name
9
+ * (`oncapabilities-allow`), so the wrappers keep the handlers typed there too.
10
+ *
11
+ * `react` and `@lit/react` are optional peer dependencies: install both to
12
+ * use this entry point. No other entry point imports either.
13
+ *
14
+ * `<consent-passkey>` has its own wrapper in `@kya-os/consent/passkey/react`,
15
+ * so this entry point never imports `@kya-os/id`.
7
16
  *
8
17
  * @module react
9
18
  */
@@ -41,7 +50,7 @@ var __importStar = (this && this.__importStar) || (function () {
41
50
  };
42
51
  })();
43
52
  Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.McpConsentReact = exports.ConsentOTPInputReact = exports.ConsentOAuthButtonReact = exports.ConsentTermsReact = exports.ConsentPermissionsReact = exports.ConsentShellReact = exports.ConsentInputReact = exports.ConsentCheckboxReact = exports.ConsentButtonReact = void 0;
53
+ exports.ConsentPhoneHandoffReact = exports.ConsentRequestExpiryReact = exports.ConsentWalletSignatureReact = exports.ConsentWalletNoticeReact = exports.ConsentWalletCheckReact = exports.ConsentWalletOrbReact = exports.ConsentRevokeReact = exports.ConsentGrantTermsReact = exports.ConsentFolderScopeReact = exports.ConsentDurationReact = exports.ConsentFooterReact = exports.ConsentRevocationNoticeReact = exports.ConsentActionBarReact = exports.ConsentConnectorHeaderReact = exports.ConsentHeadlineReact = exports.ConsentAgentHeaderReact = exports.ConsentCapabilityCardReact = exports.ConsentCapabilitiesScreenReact = exports.McpConsentReact = exports.ConsentOTPInputReact = exports.ConsentOAuthButtonReact = exports.ConsentTermsReact = exports.ConsentPermissionsReact = exports.ConsentShellReact = exports.ConsentInputReact = exports.ConsentCheckboxReact = exports.ConsentButtonReact = void 0;
45
54
  const react_1 = require("@lit/react");
46
55
  const React = __importStar(require("react"));
47
56
  // Core components
@@ -56,6 +65,27 @@ const consent_oauth_button_js_1 = require("../components/consent-oauth-button.js
56
65
  const consent_otp_input_js_1 = require("../components/consent-otp-input.js");
57
66
  // Composite component
58
67
  const mcp_consent_js_1 = require("../components/mcp-consent.js");
68
+ // Capability screen and its parts
69
+ const consent_capabilities_screen_js_1 = require("../components/consent-capabilities-screen.js");
70
+ const consent_capability_card_js_1 = require("../components/consent-capability-card.js");
71
+ const consent_agent_header_js_1 = require("../components/consent-agent-header.js");
72
+ const consent_headline_js_1 = require("../components/consent-headline.js");
73
+ const consent_connector_header_js_1 = require("../components/consent-connector-header.js");
74
+ const consent_action_bar_js_1 = require("../components/consent-action-bar.js");
75
+ const consent_revocation_notice_js_1 = require("../components/consent-revocation-notice.js");
76
+ const consent_footer_js_1 = require("../components/consent-footer.js");
77
+ // Grant terms and taking a grant back
78
+ const consent_duration_js_1 = require("../components/consent-duration.js");
79
+ const consent_folder_scope_js_1 = require("../components/consent-folder-scope.js");
80
+ const consent_grant_terms_js_1 = require("../components/consent-grant-terms.js");
81
+ const consent_revoke_js_1 = require("../components/consent-revoke.js");
82
+ // The person's wallet and one pending request
83
+ const consent_wallet_orb_js_1 = require("../components/consent-wallet-orb.js");
84
+ const consent_wallet_check_js_1 = require("../components/consent-wallet-check.js");
85
+ const consent_wallet_notice_js_1 = require("../components/consent-wallet-notice.js");
86
+ const consent_wallet_signature_js_1 = require("../components/consent-wallet-signature.js");
87
+ const consent_request_expiry_js_1 = require("../components/consent-request-expiry.js");
88
+ const consent_phone_handoff_js_1 = require("../components/consent-phone-handoff.js");
59
89
  // ============================================================================
60
90
  // Core Component Wrappers
61
91
  // ============================================================================
@@ -63,41 +93,41 @@ const mcp_consent_js_1 = require("../components/mcp-consent.js");
63
93
  * React wrapper for consent-button
64
94
  */
65
95
  exports.ConsentButtonReact = (0, react_1.createComponent)({
66
- tagName: 'consent-button',
96
+ tagName: "consent-button",
67
97
  elementClass: consent_button_js_1.ConsentButton,
68
98
  react: React,
69
99
  events: {
70
- onClick: 'click',
100
+ onClick: "click",
71
101
  },
72
102
  });
73
103
  /**
74
104
  * React wrapper for consent-checkbox
75
105
  */
76
106
  exports.ConsentCheckboxReact = (0, react_1.createComponent)({
77
- tagName: 'consent-checkbox',
107
+ tagName: "consent-checkbox",
78
108
  elementClass: consent_checkbox_js_1.ConsentCheckbox,
79
109
  react: React,
80
110
  events: {
81
- onChange: 'change',
111
+ onChange: "change",
82
112
  },
83
113
  });
84
114
  /**
85
115
  * React wrapper for consent-input
86
116
  */
87
117
  exports.ConsentInputReact = (0, react_1.createComponent)({
88
- tagName: 'consent-input',
118
+ tagName: "consent-input",
89
119
  elementClass: consent_input_js_1.ConsentInput,
90
120
  react: React,
91
121
  events: {
92
- onInput: 'input',
93
- onChange: 'change',
122
+ onInput: "input",
123
+ onChange: "change",
94
124
  },
95
125
  });
96
126
  /**
97
127
  * React wrapper for consent-shell
98
128
  */
99
129
  exports.ConsentShellReact = (0, react_1.createComponent)({
100
- tagName: 'consent-shell',
130
+ tagName: "consent-shell",
101
131
  elementClass: consent_shell_js_1.ConsentShell,
102
132
  react: React,
103
133
  });
@@ -108,49 +138,51 @@ exports.ConsentShellReact = (0, react_1.createComponent)({
108
138
  * React wrapper for consent-permissions
109
139
  */
110
140
  exports.ConsentPermissionsReact = (0, react_1.createComponent)({
111
- tagName: 'consent-permissions',
141
+ tagName: "consent-permissions",
112
142
  elementClass: consent_permissions_js_1.ConsentPermissions,
113
143
  react: React,
114
144
  events: {
115
- onChange: 'change',
145
+ onChange: "change",
116
146
  },
117
147
  });
118
148
  /**
119
149
  * React wrapper for consent-terms
120
150
  */
121
151
  exports.ConsentTermsReact = (0, react_1.createComponent)({
122
- tagName: 'consent-terms',
152
+ tagName: "consent-terms",
123
153
  elementClass: consent_terms_js_1.ConsentTerms,
124
154
  react: React,
125
155
  events: {
126
- onChange: 'change',
156
+ onChange: "change",
127
157
  },
128
158
  });
129
159
  /**
130
160
  * React wrapper for consent-oauth-button
131
161
  */
132
162
  exports.ConsentOAuthButtonReact = (0, react_1.createComponent)({
133
- tagName: 'consent-oauth-button',
163
+ tagName: "consent-oauth-button",
134
164
  elementClass: consent_oauth_button_js_1.ConsentOAuthButton,
135
165
  react: React,
136
166
  events: {
137
- onOAuthClick: 'oauth-click',
167
+ onOAuthClick: "oauth-click",
138
168
  },
139
169
  });
140
170
  /**
141
171
  * React wrapper for consent-otp-input
142
172
  *
143
173
  * Events:
174
+ * - onInput: Fired when a digit is typed (detail: { value, index, digit })
144
175
  * - onComplete: Fired when all digits are entered (detail: { value: string })
145
176
  * - onChange: Fired when value changes (detail: { value: string })
146
177
  */
147
178
  exports.ConsentOTPInputReact = (0, react_1.createComponent)({
148
- tagName: 'consent-otp-input',
179
+ tagName: "consent-otp-input",
149
180
  elementClass: consent_otp_input_js_1.ConsentOTPInput,
150
181
  react: React,
151
182
  events: {
152
- onComplete: 'complete',
153
- onChange: 'change',
183
+ onInput: "input",
184
+ onComplete: "complete",
185
+ onChange: "change",
154
186
  },
155
187
  });
156
188
  // ============================================================================
@@ -174,17 +206,220 @@ exports.ConsentOTPInputReact = (0, react_1.createComponent)({
174
206
  * onApprove={(e) => console.log('Approved', e.detail)}
175
207
  * onDeny={() => console.log('Denied')}
176
208
  * onError={(e) => console.log('Error', e.detail)}
209
+ * onResendOtp={() => sendCodeAgain()}
177
210
  * />
178
211
  * ```
179
212
  */
180
213
  exports.McpConsentReact = (0, react_1.createComponent)({
181
- tagName: 'mcp-consent',
214
+ tagName: "mcp-consent",
182
215
  elementClass: mcp_consent_js_1.McpConsent,
183
216
  react: React,
184
217
  events: {
185
- onApprove: 'mcp-consent:approve',
186
- onDeny: 'mcp-consent:deny',
187
- onError: 'mcp-consent:error',
218
+ onApprove: "mcp-consent:approve",
219
+ onDeny: "mcp-consent:deny",
220
+ onError: "mcp-consent:error",
221
+ onResendOtp: "mcp-consent:resend-otp",
222
+ },
223
+ });
224
+ // ============================================================================
225
+ // Capability Screen Wrappers
226
+ // ============================================================================
227
+ /**
228
+ * React wrapper for consent-capabilities-screen, the whole consent screen
229
+ * for a capability grant.
230
+ *
231
+ * @example
232
+ * ```tsx
233
+ * import { ConsentCapabilitiesScreenReact } from '@kya-os/consent/react';
234
+ *
235
+ * <ConsentCapabilitiesScreenReact
236
+ * agentMetadata={{ name: 'Claude', did: 'did:key:z6Mk...', verification: 'verified' }}
237
+ * capabilities={capabilities}
238
+ * orgName="Acme"
239
+ * onAllow={(e) => grant(e.detail.selectedScopes)}
240
+ * onDeny={() => close()}
241
+ * />
242
+ * ```
243
+ */
244
+ exports.ConsentCapabilitiesScreenReact = (0, react_1.createComponent)({
245
+ tagName: "consent-capabilities-screen",
246
+ elementClass: consent_capabilities_screen_js_1.ConsentCapabilitiesScreen,
247
+ react: React,
248
+ events: {
249
+ onAllow: "capabilities-allow",
250
+ onDeny: "capabilities-deny",
251
+ },
252
+ });
253
+ /**
254
+ * React wrapper for consent-capability-card, one capability with its toggle.
255
+ */
256
+ exports.ConsentCapabilityCardReact = (0, react_1.createComponent)({
257
+ tagName: "consent-capability-card",
258
+ elementClass: consent_capability_card_js_1.ConsentCapabilityCard,
259
+ react: React,
260
+ events: {
261
+ onToggle: "capability-toggle",
262
+ },
263
+ });
264
+ /**
265
+ * React wrapper for consent-agent-header, the agent's name, pill and meta line.
266
+ */
267
+ exports.ConsentAgentHeaderReact = (0, react_1.createComponent)({
268
+ tagName: "consent-agent-header",
269
+ elementClass: consent_agent_header_js_1.ConsentAgentHeader,
270
+ react: React,
271
+ });
272
+ /**
273
+ * React wrapper for consent-headline, the eyebrow, the headline that says who
274
+ * is asking and where, and the subhead.
275
+ */
276
+ exports.ConsentHeadlineReact = (0, react_1.createComponent)({
277
+ tagName: "consent-headline",
278
+ elementClass: consent_headline_js_1.ConsentHeadline,
279
+ react: React,
280
+ });
281
+ /**
282
+ * React wrapper for consent-connector-header, the client and the server it
283
+ * connects to.
284
+ */
285
+ exports.ConsentConnectorHeaderReact = (0, react_1.createComponent)({
286
+ tagName: "consent-connector-header",
287
+ elementClass: consent_connector_header_js_1.ConsentConnectorHeader,
288
+ react: React,
289
+ });
290
+ /**
291
+ * React wrapper for consent-action-bar, the Allow and Deny buttons.
292
+ */
293
+ exports.ConsentActionBarReact = (0, react_1.createComponent)({
294
+ tagName: "consent-action-bar",
295
+ elementClass: consent_action_bar_js_1.ConsentActionBar,
296
+ react: React,
297
+ events: {
298
+ onAllow: "consent-allow",
299
+ onDeny: "consent-deny",
300
+ },
301
+ });
302
+ /**
303
+ * React wrapper for consent-revocation-notice, how and when access ends.
304
+ */
305
+ exports.ConsentRevocationNoticeReact = (0, react_1.createComponent)({
306
+ tagName: "consent-revocation-notice",
307
+ elementClass: consent_revocation_notice_js_1.ConsentRevocationNotice,
308
+ react: React,
309
+ });
310
+ /**
311
+ * React wrapper for consent-footer.
312
+ */
313
+ exports.ConsentFooterReact = (0, react_1.createComponent)({
314
+ tagName: "consent-footer",
315
+ elementClass: consent_footer_js_1.ConsentFooter,
316
+ react: React,
317
+ });
318
+ // ============================================================================
319
+ // Grant Terms and Revoke Wrappers
320
+ // ============================================================================
321
+ /**
322
+ * React wrapper for consent-duration, how long a grant lasts.
323
+ */
324
+ exports.ConsentDurationReact = (0, react_1.createComponent)({
325
+ tagName: "consent-duration",
326
+ elementClass: consent_duration_js_1.ConsentDuration,
327
+ react: React,
328
+ events: {
329
+ onChange: "consent-duration-change",
330
+ },
331
+ });
332
+ /**
333
+ * React wrapper for consent-folder-scope, the folder a grant is limited to.
334
+ */
335
+ exports.ConsentFolderScopeReact = (0, react_1.createComponent)({
336
+ tagName: "consent-folder-scope",
337
+ elementClass: consent_folder_scope_js_1.ConsentFolderScope,
338
+ react: React,
339
+ events: {
340
+ onChange: "consent-folder-scope-change",
341
+ },
342
+ });
343
+ /**
344
+ * React wrapper for consent-grant-terms, a grant's terms behind one line.
345
+ * Its children are the fields.
346
+ */
347
+ exports.ConsentGrantTermsReact = (0, react_1.createComponent)({
348
+ tagName: "consent-grant-terms",
349
+ elementClass: consent_grant_terms_js_1.ConsentGrantTerms,
350
+ react: React,
351
+ events: {
352
+ onChange: "consent-grant-terms-change",
188
353
  },
189
354
  });
355
+ /**
356
+ * React wrapper for consent-revoke, taking a grant back.
357
+ */
358
+ exports.ConsentRevokeReact = (0, react_1.createComponent)({
359
+ tagName: "consent-revoke",
360
+ elementClass: consent_revoke_js_1.ConsentRevoke,
361
+ react: React,
362
+ events: {
363
+ onRevoke: "consent-revoke",
364
+ onKeep: "consent-keep",
365
+ },
366
+ });
367
+ // ============================================================================
368
+ // Wallet and Request Wrappers
369
+ // ============================================================================
370
+ /**
371
+ * React wrapper for consent-wallet-orb, the wallet check's picture on its
372
+ * own: a globe inside a dial that closes once the wallet can sign.
373
+ */
374
+ exports.ConsentWalletOrbReact = (0, react_1.createComponent)({
375
+ tagName: "consent-wallet-orb",
376
+ elementClass: consent_wallet_orb_js_1.ConsentWalletOrb,
377
+ react: React,
378
+ });
379
+ /**
380
+ * React wrapper for consent-wallet-check, the orb and one line that say
381
+ * whether this browser's wallet can sign.
382
+ */
383
+ exports.ConsentWalletCheckReact = (0, react_1.createComponent)({
384
+ tagName: "consent-wallet-check",
385
+ elementClass: consent_wallet_check_js_1.ConsentWalletCheck,
386
+ react: React,
387
+ });
388
+ /**
389
+ * React wrapper for consent-wallet-notice, what to do when this browser
390
+ * can't sign. Pass the `more` slot's content as a child with `slot="more"`.
391
+ */
392
+ exports.ConsentWalletNoticeReact = (0, react_1.createComponent)({
393
+ tagName: "consent-wallet-notice",
394
+ elementClass: consent_wallet_notice_js_1.ConsentWalletNotice,
395
+ react: React,
396
+ });
397
+ /**
398
+ * React wrapper for consent-wallet-signature, who signs the grant and where
399
+ * to take it back.
400
+ */
401
+ exports.ConsentWalletSignatureReact = (0, react_1.createComponent)({
402
+ tagName: "consent-wallet-signature",
403
+ elementClass: consent_wallet_signature_js_1.ConsentWalletSignature,
404
+ react: React,
405
+ });
406
+ /**
407
+ * React wrapper for consent-request-expiry, the time left to approve.
408
+ */
409
+ exports.ConsentRequestExpiryReact = (0, react_1.createComponent)({
410
+ tagName: "consent-request-expiry",
411
+ elementClass: consent_request_expiry_js_1.ConsentRequestExpiry,
412
+ react: React,
413
+ events: {
414
+ onExpired: "consent-request-expired",
415
+ },
416
+ });
417
+ /**
418
+ * React wrapper for consent-phone-handoff, a QR code to approve on a phone.
419
+ */
420
+ exports.ConsentPhoneHandoffReact = (0, react_1.createComponent)({
421
+ tagName: "consent-phone-handoff",
422
+ elementClass: consent_phone_handoff_js_1.ConsentPhoneHandoff,
423
+ react: React,
424
+ });
190
425
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,sCAA6D;AAC7D,6CAA+B;AAE/B,kBAAkB;AAClB,uEAAgE;AAChE,2EAAoE;AACpE,qEAA8D;AAC9D,qEAA8D;AAE9D,sBAAsB;AACtB,iFAA0E;AAC1E,qEAA8D;AAC9D,mFAA2E;AAC3E,6EAAqE;AAErE,sBAAsB;AACtB,iEAA0D;AAE1D,+EAA+E;AAC/E,0BAA0B;AAC1B,+EAA+E;AAE/E;;GAEG;AACU,QAAA,kBAAkB,GAAG,IAAA,uBAAe,EAAC;IAChD,OAAO,EAAE,gBAAgB;IACzB,YAAY,EAAE,iCAAa;IAC3B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,OAAgC;KAC1C;CACF,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,oBAAoB,GAAG,IAAA,uBAAe,EAAC;IAClD,OAAO,EAAE,kBAAkB;IAC3B,YAAY,EAAE,qCAAe;IAC7B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,QAAQ,EAAE,QAAuE;KAClF;CACF,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,iBAA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IACjC,YAAY,EAAE,gDAAoB;IAClC,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,SAAS,EAAE,yBAEV;KACF;CACF,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,wBAAwB,GAAG,IAAA,uBAAe,EAAC;IACtD,OAAO,EAAE,uBAAuB;IAChC,YAAY,EAAE,8CAAmB;IACjC,KAAK,EAAE,KAAK;CACb,CAAC,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * Consent Templates
4
4
  *
5
5
  * Template Method pattern implementation for consent page rendering.
6
- * Used by MCP-I Cloudflare runtime to generate consent pages.
6
+ * Used by server runtimes to generate consent pages.
7
7
  *
8
8
  * @module @kya-os/consent/templates
9
9
  */
@@ -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 Checkpoint.
6
+ * These types are the single source of truth shared between the server runtime and the dashboard preview.
7
7
  *
8
8
  * @module @kya-os/consent/types
9
9
  */
@@ -8,10 +8,23 @@
8
8
  * Emits `consent-allow` and `consent-deny` events; the parent decides what to
9
9
  * do (typically: submit the form on allow, close window on deny).
10
10
  *
11
+ * For an approval the person signs with a passkey, `submit-icon="passkey"`
12
+ * marks the button, and `loading-label` ("Signing…") says what it's doing
13
+ * while `loading`.
14
+ *
15
+ * Parts: `submit`, `submit-icon`, `cancel`.
16
+ *
11
17
  * @module components/consent-action-bar
12
18
  */
13
19
  import { LitElement } from "lit";
14
20
  import type { ConsentTheme } from "../types/capabilities.types.js";
21
+ /** A mark before the submit label. */
22
+ export type ActionBarSubmitIcon = "" | "passkey";
23
+ /**
24
+ * @fires consent-allow - The person allowed.
25
+ * @fires consent-deny - The person denied.
26
+ * @cssprop --cs-action-radius - The buttons' corners (default: 999px).
27
+ */
15
28
  export declare class ConsentActionBar extends LitElement {
16
29
  agentName: string;
17
30
  theme: ConsentTheme;
@@ -19,6 +32,10 @@ export declare class ConsentActionBar extends LitElement {
19
32
  loading: boolean;
20
33
  submitLabel: string;
21
34
  cancelLabel: string;
35
+ /** `passkey`: a fingerprint before the submit label. */
36
+ submitIcon: ActionBarSubmitIcon;
37
+ /** The submit label while `loading`, e.g. "Signing…". */
38
+ loadingLabel: string;
22
39
  static styles: import("lit").CSSResult;
23
40
  private emitAllow;
24
41
  private emitDeny;
@@ -1 +1 @@
1
- {"version":3,"file":"consent-action-bar.d.ts","sourceRoot":"","sources":["../../src/components/consent-action-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,qBACa,gBAAiB,SAAQ,UAAU;IAClB,SAAS,SAAM;IACf,KAAK,EAAE,YAAY,CAAW;IAC7B,QAAQ,UAAS;IACjB,OAAO,UAAS;IACU,WAAW,SAAM;IACjB,WAAW,SAAM;IAExE,OAAgB,MAAM,0BAkDpB;IAEF,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,QAAQ;IAOP,MAAM;CAiChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
1
+ {"version":3,"file":"consent-action-bar.d.ts","sourceRoot":"","sources":["../../src/components/consent-action-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAGnE,sCAAsC;AACtC,MAAM,MAAM,mBAAmB,GAAG,EAAE,GAAG,SAAS,CAAC;AAEjD;;;;GAIG;AACH,qBACa,gBAAiB,SAAQ,UAAU;IAClB,SAAS,SAAM;IACf,KAAK,EAAE,YAAY,CAAW;IAC7B,QAAQ,UAAS;IACjB,OAAO,UAAS;IACU,WAAW,SAAM;IACjB,WAAW,SAAM;IACxE,wDAAwD;IAExD,UAAU,EAAE,mBAAmB,CAAM;IACrC,yDAAyD;IACD,YAAY,SAAM;IAE1E,OAAgB,MAAM,0BA8DpB;IAEF,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,QAAQ;IAOP,MAAM;CAmDhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
@@ -8,6 +8,12 @@
8
8
  * Emits `consent-allow` and `consent-deny` events; the parent decides what to
9
9
  * do (typically: submit the form on allow, close window on deny).
10
10
  *
11
+ * For an approval the person signs with a passkey, `submit-icon="passkey"`
12
+ * marks the button, and `loading-label` ("Signing…") says what it's doing
13
+ * while `loading`.
14
+ *
15
+ * Parts: `submit`, `submit-icon`, `cancel`.
16
+ *
11
17
  * @module components/consent-action-bar
12
18
  */
13
19
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
@@ -16,9 +22,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
16
22
  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;
17
23
  return c > 3 && r && Object.defineProperty(target, key, r), r;
18
24
  };
19
- import { LitElement, html, css } from "lit";
25
+ import { LitElement, html, css, nothing } from "lit";
20
26
  import { customElement, property } from "lit/decorators.js";
21
27
  import { CONSENT_COPY_TOKENS, formatToken } from "../copy/tokens.js";
28
+ import { fingerprintIcon } from "./wallet-icons.js";
29
+ /**
30
+ * @fires consent-allow - The person allowed.
31
+ * @fires consent-deny - The person denied.
32
+ * @cssprop --cs-action-radius - The buttons' corners (default: 999px).
33
+ */
22
34
  let ConsentActionBar = class ConsentActionBar extends LitElement {
23
35
  constructor() {
24
36
  super(...arguments);
@@ -28,6 +40,10 @@ let ConsentActionBar = class ConsentActionBar extends LitElement {
28
40
  this.loading = false;
29
41
  this.submitLabel = "";
30
42
  this.cancelLabel = "";
43
+ /** `passkey`: a fingerprint before the submit label. */
44
+ this.submitIcon = "";
45
+ /** The submit label while `loading`, e.g. "Signing…". */
46
+ this.loadingLabel = "";
31
47
  }
32
48
  emitAllow() {
33
49
  if (this.disabled || this.loading)
@@ -40,14 +56,17 @@ let ConsentActionBar = class ConsentActionBar extends LitElement {
40
56
  this.dispatchEvent(new CustomEvent("consent-deny", { bubbles: true, composed: true }));
41
57
  }
42
58
  render() {
43
- const allowLabel = this.submitLabel || (this.theme === "dark"
44
- ? CONSENT_COPY_TOKENS.actions.allowAccess
45
- : `${formatToken(CONSENT_COPY_TOKENS.actions.allowAgentTemplate, {
46
- Agent: this.agentName || "this agent",
47
- })} →`);
48
- const denyLabel = this.cancelLabel || (this.theme === "dark"
49
- ? CONSENT_COPY_TOKENS.actions.deny
50
- : CONSENT_COPY_TOKENS.actions.notNow);
59
+ const allowLabel = this.submitLabel ||
60
+ (this.theme === "dark"
61
+ ? CONSENT_COPY_TOKENS.actions.allowAccess
62
+ : `${formatToken(CONSENT_COPY_TOKENS.actions.allowAgentTemplate, {
63
+ Agent: this.agentName || "this agent",
64
+ })} →`);
65
+ const submitLabel = this.loading && this.loadingLabel ? this.loadingLabel : allowLabel;
66
+ const denyLabel = this.cancelLabel ||
67
+ (this.theme === "dark"
68
+ ? CONSENT_COPY_TOKENS.actions.deny
69
+ : CONSENT_COPY_TOKENS.actions.notNow);
51
70
  return html `
52
71
  <button
53
72
  class="primary"
@@ -56,7 +75,21 @@ let ConsentActionBar = class ConsentActionBar extends LitElement {
56
75
  ?disabled=${this.disabled || this.loading}
57
76
  @click=${this.emitAllow}
58
77
  >
59
- ${allowLabel}
78
+ ${this.submitIcon === "passkey"
79
+ ? html `<svg
80
+ part="submit-icon"
81
+ class="submit-icon"
82
+ viewBox="0 0 24 24"
83
+ fill="none"
84
+ stroke="currentColor"
85
+ stroke-width="2"
86
+ stroke-linecap="round"
87
+ stroke-linejoin="round"
88
+ aria-hidden="true"
89
+ >
90
+ ${fingerprintIcon}
91
+ </svg>`
92
+ : nothing}${submitLabel}
60
93
  </button>
61
94
  <button
62
95
  class="secondary"
@@ -81,12 +114,14 @@ ConsentActionBar.styles = css `
81
114
  button {
82
115
  width: 100%;
83
116
  padding: 14px 18px;
84
- border-radius: 999px;
117
+ border-radius: var(--cs-action-radius, 999px);
85
118
  font-size: var(--cs-action-font-size, 15px);
86
119
  font-weight: 500;
87
120
  font-family: inherit;
88
121
  cursor: pointer;
89
- transition: opacity 0.15s ease, transform 0.05s ease;
122
+ transition:
123
+ opacity 0.15s ease,
124
+ transform 0.05s ease;
90
125
  border: none;
91
126
  }
92
127
 
@@ -96,20 +131,30 @@ ConsentActionBar.styles = css `
96
131
  }
97
132
 
98
133
  button:focus-visible {
99
- outline: 2px solid var(--cs-focus-ring, #0F172A);
134
+ outline: 2px solid var(--cs-focus-ring, #0f172a);
100
135
  outline-offset: 3px;
101
136
  }
102
137
 
103
138
  .primary {
139
+ display: inline-flex;
140
+ align-items: center;
141
+ justify-content: center;
142
+ gap: 8px;
104
143
  min-height: var(--cs-action-min-height, 0px);
105
- background: var(--cs-surface-accent, #0F172A);
106
- color: var(--cs-surface-accent-text, #FFFFFF);
144
+ background: var(--cs-surface-accent, #0f172a);
145
+ color: var(--cs-surface-accent-text, #ffffff);
107
146
  }
108
147
 
109
148
  .primary:hover:not(:disabled) {
110
149
  opacity: 0.92;
111
150
  }
112
151
 
152
+ .submit-icon {
153
+ flex: none;
154
+ width: 16px;
155
+ height: 16px;
156
+ }
157
+
113
158
  .secondary {
114
159
  background: transparent;
115
160
  color: var(--cs-text-secondary, #334155);
@@ -118,7 +163,7 @@ ConsentActionBar.styles = css `
118
163
  }
119
164
 
120
165
  .secondary:hover:not(:disabled) {
121
- color: var(--cs-text-primary, #0F172A);
166
+ color: var(--cs-text-primary, #0f172a);
122
167
  }
123
168
  `;
124
169
  __decorate([
@@ -139,6 +184,12 @@ __decorate([
139
184
  __decorate([
140
185
  property({ type: String, attribute: "cancel-label" })
141
186
  ], ConsentActionBar.prototype, "cancelLabel", void 0);
187
+ __decorate([
188
+ property({ type: String, attribute: "submit-icon" })
189
+ ], ConsentActionBar.prototype, "submitIcon", void 0);
190
+ __decorate([
191
+ property({ type: String, attribute: "loading-label" })
192
+ ], ConsentActionBar.prototype, "loadingLabel", void 0);
142
193
  ConsentActionBar = __decorate([
143
194
  customElement("consent-action-bar")
144
195
  ], ConsentActionBar);