@draftlab/auth 0.15.0 → 0.16.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 (272) hide show
  1. package/dist/esm/allow.js +26 -0
  2. package/dist/esm/client.js +254 -0
  3. package/dist/esm/core.js +597 -0
  4. package/dist/esm/css.d.js +0 -0
  5. package/dist/esm/error.js +88 -0
  6. package/dist/esm/index.js +5 -0
  7. package/dist/esm/keys.js +126 -0
  8. package/dist/esm/mutex.js +53 -0
  9. package/dist/esm/pkce.js +87 -0
  10. package/dist/esm/provider/apple.js +15 -0
  11. package/dist/esm/provider/code.js +62 -0
  12. package/dist/esm/provider/discord.js +15 -0
  13. package/dist/esm/provider/facebook.js +15 -0
  14. package/dist/esm/provider/github.js +15 -0
  15. package/dist/esm/provider/gitlab.js +15 -0
  16. package/dist/esm/provider/google.js +16 -0
  17. package/dist/esm/provider/linkedin.js +15 -0
  18. package/dist/esm/provider/magiclink.js +83 -0
  19. package/dist/esm/provider/microsoft.js +15 -0
  20. package/dist/esm/provider/oauth2.js +130 -0
  21. package/dist/esm/provider/password.js +331 -0
  22. package/dist/esm/provider/provider.js +18 -0
  23. package/dist/esm/provider/reddit.js +15 -0
  24. package/dist/esm/provider/slack.js +15 -0
  25. package/dist/esm/provider/spotify.js +15 -0
  26. package/dist/esm/provider/twitch.js +15 -0
  27. package/dist/esm/provider/vercel.js +17 -0
  28. package/dist/esm/random.js +40 -0
  29. package/dist/esm/revocation.js +27 -0
  30. package/dist/esm/storage/memory.js +110 -0
  31. package/dist/esm/storage/storage.js +56 -0
  32. package/dist/esm/storage/turso.js +93 -0
  33. package/dist/esm/storage/unstorage.js +78 -0
  34. package/dist/esm/subject.js +7 -0
  35. package/dist/esm/themes/theme.js +115 -0
  36. package/dist/esm/toolkit/client.js +119 -0
  37. package/dist/esm/toolkit/index.js +25 -0
  38. package/dist/esm/toolkit/providers/facebook.js +11 -0
  39. package/dist/esm/toolkit/providers/github.js +11 -0
  40. package/dist/esm/toolkit/providers/google.js +11 -0
  41. package/dist/esm/toolkit/providers/strategy.js +0 -0
  42. package/dist/esm/toolkit/storage.js +81 -0
  43. package/dist/esm/toolkit/utils.js +18 -0
  44. package/dist/esm/types.js +0 -0
  45. package/dist/esm/ui/base.js +478 -0
  46. package/dist/esm/ui/code.js +186 -0
  47. package/dist/esm/ui/form.js +46 -0
  48. package/dist/esm/ui/icon.js +242 -0
  49. package/dist/esm/ui/magiclink.js +158 -0
  50. package/dist/esm/ui/password.js +435 -0
  51. package/dist/esm/ui/select.js +102 -0
  52. package/dist/esm/util.js +59 -0
  53. package/dist/{allow.d.mts → types/allow.d.ts} +9 -11
  54. package/dist/types/allow.d.ts.map +1 -0
  55. package/dist/types/client.d.ts +462 -0
  56. package/dist/types/client.d.ts.map +1 -0
  57. package/dist/types/core.d.ts +113 -0
  58. package/dist/types/core.d.ts.map +1 -0
  59. package/dist/{error.d.mts → types/error.d.ts} +95 -97
  60. package/dist/types/error.d.ts.map +1 -0
  61. package/dist/types/index.d.ts +2 -0
  62. package/dist/types/index.d.ts.map +1 -0
  63. package/dist/{keys.d.mts → types/keys.d.ts} +20 -24
  64. package/dist/types/keys.d.ts.map +1 -0
  65. package/dist/types/mutex.d.ts +42 -0
  66. package/dist/types/mutex.d.ts.map +1 -0
  67. package/dist/{pkce.d.mts → types/pkce.d.ts} +10 -11
  68. package/dist/types/pkce.d.ts.map +1 -0
  69. package/dist/types/provider/apple.d.ts +197 -0
  70. package/dist/types/provider/apple.d.ts.map +1 -0
  71. package/dist/types/provider/code.d.ts +288 -0
  72. package/dist/types/provider/code.d.ts.map +1 -0
  73. package/dist/types/provider/discord.d.ts +206 -0
  74. package/dist/types/provider/discord.d.ts.map +1 -0
  75. package/dist/types/provider/facebook.d.ts +200 -0
  76. package/dist/types/provider/facebook.d.ts.map +1 -0
  77. package/dist/types/provider/github.d.ts +220 -0
  78. package/dist/types/provider/github.d.ts.map +1 -0
  79. package/dist/types/provider/gitlab.d.ts +180 -0
  80. package/dist/types/provider/gitlab.d.ts.map +1 -0
  81. package/dist/types/provider/google.d.ts +158 -0
  82. package/dist/types/provider/google.d.ts.map +1 -0
  83. package/dist/types/provider/linkedin.d.ts +190 -0
  84. package/dist/types/provider/linkedin.d.ts.map +1 -0
  85. package/dist/types/provider/magiclink.d.ts +141 -0
  86. package/dist/types/provider/magiclink.d.ts.map +1 -0
  87. package/dist/types/provider/microsoft.d.ts +247 -0
  88. package/dist/types/provider/microsoft.d.ts.map +1 -0
  89. package/dist/types/provider/oauth2.d.ts +229 -0
  90. package/dist/types/provider/oauth2.d.ts.map +1 -0
  91. package/dist/types/provider/password.d.ts +408 -0
  92. package/dist/types/provider/password.d.ts.map +1 -0
  93. package/dist/types/provider/provider.d.ts +226 -0
  94. package/dist/types/provider/provider.d.ts.map +1 -0
  95. package/dist/types/provider/reddit.d.ts +159 -0
  96. package/dist/types/provider/reddit.d.ts.map +1 -0
  97. package/dist/types/provider/slack.d.ts +171 -0
  98. package/dist/types/provider/slack.d.ts.map +1 -0
  99. package/dist/types/provider/spotify.d.ts +168 -0
  100. package/dist/types/provider/spotify.d.ts.map +1 -0
  101. package/dist/types/provider/twitch.d.ts +163 -0
  102. package/dist/types/provider/twitch.d.ts.map +1 -0
  103. package/dist/types/provider/vercel.d.ts +294 -0
  104. package/dist/types/provider/vercel.d.ts.map +1 -0
  105. package/dist/{random.d.mts → types/random.d.ts} +4 -6
  106. package/dist/types/random.d.ts.map +1 -0
  107. package/dist/types/revocation.d.ts +76 -0
  108. package/dist/types/revocation.d.ts.map +1 -0
  109. package/dist/{storage/memory.d.mts → types/storage/memory.d.ts} +17 -21
  110. package/dist/types/storage/memory.d.ts.map +1 -0
  111. package/dist/types/storage/storage.d.ts +177 -0
  112. package/dist/types/storage/storage.d.ts.map +1 -0
  113. package/dist/{storage/turso.d.mts → types/storage/turso.d.ts} +4 -8
  114. package/dist/types/storage/turso.d.ts.map +1 -0
  115. package/dist/{storage/unstorage.d.mts → types/storage/unstorage.d.ts} +12 -11
  116. package/dist/types/storage/unstorage.d.ts.map +1 -0
  117. package/dist/types/subject.d.ts +115 -0
  118. package/dist/types/subject.d.ts.map +1 -0
  119. package/dist/types/themes/theme.d.ts +207 -0
  120. package/dist/types/themes/theme.d.ts.map +1 -0
  121. package/dist/types/toolkit/client.d.ts +235 -0
  122. package/dist/types/toolkit/client.d.ts.map +1 -0
  123. package/dist/types/toolkit/index.d.ts +45 -0
  124. package/dist/types/toolkit/index.d.ts.map +1 -0
  125. package/dist/types/toolkit/providers/facebook.d.ts +8 -0
  126. package/dist/types/toolkit/providers/facebook.d.ts.map +1 -0
  127. package/dist/types/toolkit/providers/github.d.ts +8 -0
  128. package/dist/types/toolkit/providers/github.d.ts.map +1 -0
  129. package/dist/types/toolkit/providers/google.d.ts +8 -0
  130. package/dist/types/toolkit/providers/google.d.ts.map +1 -0
  131. package/dist/types/toolkit/providers/strategy.d.ts +38 -0
  132. package/dist/types/toolkit/providers/strategy.d.ts.map +1 -0
  133. package/dist/{toolkit/storage.d.mts → types/toolkit/storage.d.ts} +37 -39
  134. package/dist/types/toolkit/storage.d.ts.map +1 -0
  135. package/dist/{toolkit/utils.d.mts → types/toolkit/utils.d.ts} +2 -4
  136. package/dist/types/toolkit/utils.d.ts.map +1 -0
  137. package/dist/types/types.d.ts +92 -0
  138. package/dist/types/types.d.ts.map +1 -0
  139. package/dist/types/ui/base.d.ts +18 -0
  140. package/dist/types/ui/base.d.ts.map +1 -0
  141. package/dist/types/ui/code.d.ts +43 -0
  142. package/dist/types/ui/code.d.ts.map +1 -0
  143. package/dist/types/ui/form.d.ts +24 -0
  144. package/dist/types/ui/form.d.ts.map +1 -0
  145. package/dist/types/ui/icon.d.ts +60 -0
  146. package/dist/types/ui/icon.d.ts.map +1 -0
  147. package/dist/types/ui/magiclink.d.ts +41 -0
  148. package/dist/types/ui/magiclink.d.ts.map +1 -0
  149. package/dist/types/ui/password.d.ts +43 -0
  150. package/dist/types/ui/password.d.ts.map +1 -0
  151. package/dist/types/ui/select.d.ts +33 -0
  152. package/dist/types/ui/select.d.ts.map +1 -0
  153. package/dist/{util.d.mts → types/util.d.ts} +11 -13
  154. package/dist/types/util.d.ts.map +1 -0
  155. package/package.json +10 -16
  156. package/dist/adapters/node.d.mts +0 -18
  157. package/dist/adapters/node.mjs +0 -69
  158. package/dist/allow.mjs +0 -63
  159. package/dist/client.d.mts +0 -456
  160. package/dist/client.mjs +0 -283
  161. package/dist/core.d.mts +0 -110
  162. package/dist/core.mjs +0 -595
  163. package/dist/error.mjs +0 -237
  164. package/dist/index.d.mts +0 -2
  165. package/dist/index.mjs +0 -3
  166. package/dist/keys.mjs +0 -146
  167. package/dist/mutex.d.mts +0 -44
  168. package/dist/mutex.mjs +0 -110
  169. package/dist/pkce.mjs +0 -157
  170. package/dist/provider/apple.d.mts +0 -111
  171. package/dist/provider/apple.mjs +0 -164
  172. package/dist/provider/code.d.mts +0 -228
  173. package/dist/provider/code.mjs +0 -246
  174. package/dist/provider/discord.d.mts +0 -146
  175. package/dist/provider/discord.mjs +0 -156
  176. package/dist/provider/facebook.d.mts +0 -142
  177. package/dist/provider/facebook.mjs +0 -150
  178. package/dist/provider/github.d.mts +0 -140
  179. package/dist/provider/github.mjs +0 -169
  180. package/dist/provider/gitlab.d.mts +0 -106
  181. package/dist/provider/gitlab.mjs +0 -147
  182. package/dist/provider/google.d.mts +0 -112
  183. package/dist/provider/google.mjs +0 -109
  184. package/dist/provider/linkedin.d.mts +0 -132
  185. package/dist/provider/linkedin.mjs +0 -142
  186. package/dist/provider/magiclink.d.mts +0 -89
  187. package/dist/provider/magiclink.mjs +0 -143
  188. package/dist/provider/microsoft.d.mts +0 -178
  189. package/dist/provider/microsoft.mjs +0 -177
  190. package/dist/provider/oauth2.d.mts +0 -176
  191. package/dist/provider/oauth2.mjs +0 -222
  192. package/dist/provider/passkey.d.mts +0 -104
  193. package/dist/provider/passkey.mjs +0 -320
  194. package/dist/provider/password.d.mts +0 -412
  195. package/dist/provider/password.mjs +0 -363
  196. package/dist/provider/provider.d.mts +0 -227
  197. package/dist/provider/provider.mjs +0 -44
  198. package/dist/provider/reddit.d.mts +0 -107
  199. package/dist/provider/reddit.mjs +0 -127
  200. package/dist/provider/slack.d.mts +0 -114
  201. package/dist/provider/slack.mjs +0 -138
  202. package/dist/provider/spotify.d.mts +0 -113
  203. package/dist/provider/spotify.mjs +0 -135
  204. package/dist/provider/totp.d.mts +0 -112
  205. package/dist/provider/totp.mjs +0 -191
  206. package/dist/provider/twitch.d.mts +0 -108
  207. package/dist/provider/twitch.mjs +0 -131
  208. package/dist/provider/vercel.d.mts +0 -177
  209. package/dist/provider/vercel.mjs +0 -230
  210. package/dist/random.mjs +0 -86
  211. package/dist/revocation.d.mts +0 -55
  212. package/dist/revocation.mjs +0 -63
  213. package/dist/router/context.d.mts +0 -21
  214. package/dist/router/context.mjs +0 -193
  215. package/dist/router/cookies.d.mts +0 -8
  216. package/dist/router/cookies.mjs +0 -13
  217. package/dist/router/index.d.mts +0 -21
  218. package/dist/router/index.mjs +0 -107
  219. package/dist/router/matcher.d.mts +0 -15
  220. package/dist/router/matcher.mjs +0 -76
  221. package/dist/router/middleware/cors.d.mts +0 -15
  222. package/dist/router/middleware/cors.mjs +0 -114
  223. package/dist/router/safe-request.d.mts +0 -52
  224. package/dist/router/safe-request.mjs +0 -160
  225. package/dist/router/types.d.mts +0 -67
  226. package/dist/router/types.mjs +0 -1
  227. package/dist/router/variables.d.mts +0 -12
  228. package/dist/router/variables.mjs +0 -20
  229. package/dist/storage/memory.mjs +0 -125
  230. package/dist/storage/storage.d.mts +0 -179
  231. package/dist/storage/storage.mjs +0 -104
  232. package/dist/storage/turso.mjs +0 -117
  233. package/dist/storage/unstorage.mjs +0 -103
  234. package/dist/subject.d.mts +0 -62
  235. package/dist/subject.mjs +0 -36
  236. package/dist/themes/theme.d.mts +0 -209
  237. package/dist/themes/theme.mjs +0 -120
  238. package/dist/toolkit/client.d.mts +0 -169
  239. package/dist/toolkit/client.mjs +0 -209
  240. package/dist/toolkit/index.d.mts +0 -9
  241. package/dist/toolkit/index.mjs +0 -9
  242. package/dist/toolkit/providers/facebook.d.mts +0 -12
  243. package/dist/toolkit/providers/facebook.mjs +0 -16
  244. package/dist/toolkit/providers/github.d.mts +0 -12
  245. package/dist/toolkit/providers/github.mjs +0 -16
  246. package/dist/toolkit/providers/google.d.mts +0 -12
  247. package/dist/toolkit/providers/google.mjs +0 -20
  248. package/dist/toolkit/providers/strategy.d.mts +0 -40
  249. package/dist/toolkit/providers/strategy.mjs +0 -1
  250. package/dist/toolkit/storage.mjs +0 -157
  251. package/dist/toolkit/utils.mjs +0 -30
  252. package/dist/types.d.mts +0 -94
  253. package/dist/types.mjs +0 -1
  254. package/dist/ui/base.d.mts +0 -30
  255. package/dist/ui/base.mjs +0 -407
  256. package/dist/ui/code.d.mts +0 -43
  257. package/dist/ui/code.mjs +0 -173
  258. package/dist/ui/form.d.mts +0 -32
  259. package/dist/ui/form.mjs +0 -49
  260. package/dist/ui/icon.d.mts +0 -58
  261. package/dist/ui/icon.mjs +0 -247
  262. package/dist/ui/magiclink.d.mts +0 -41
  263. package/dist/ui/magiclink.mjs +0 -152
  264. package/dist/ui/passkey.d.mts +0 -27
  265. package/dist/ui/passkey.mjs +0 -323
  266. package/dist/ui/password.d.mts +0 -42
  267. package/dist/ui/password.mjs +0 -402
  268. package/dist/ui/select.d.mts +0 -34
  269. package/dist/ui/select.mjs +0 -98
  270. package/dist/ui/totp.d.mts +0 -34
  271. package/dist/ui/totp.mjs +0 -270
  272. package/dist/util.mjs +0 -128
@@ -1,58 +0,0 @@
1
- import { ComponentChildren } from "preact";
2
-
3
- //#region src/ui/icon.d.ts
4
-
5
- /**
6
- * GitHub brand icon with official logo design.
7
- */
8
- declare const ICON_GITHUB: () => ComponentChildren;
9
- /**
10
- * Google brand icon with official multicolor logo design.
11
- */
12
- declare const ICON_GOOGLE: () => ComponentChildren;
13
- /**
14
- * Email envelope icon for email-related authentication flows.
15
- */
16
- declare const ICON_EMAIL: () => ComponentChildren;
17
- /**
18
- * Apple brand icon for Sign in with Apple.
19
- */
20
- declare const ICON_APPLE: () => ComponentChildren;
21
- /**
22
- * Discord brand icon.
23
- */
24
- declare const ICON_DISCORD: () => ComponentChildren;
25
- /**
26
- * Facebook brand icon with gradient.
27
- */
28
- declare const ICON_FACEBOOK: () => ComponentChildren;
29
- /**
30
- * LinkedIn brand icon.
31
- */
32
- declare const ICON_LINKEDIN: () => ComponentChildren;
33
- /**
34
- * Microsoft brand icon with four color squares.
35
- */
36
- declare const ICON_MICROSOFT: () => ComponentChildren;
37
- /**
38
- * Slack brand icon.
39
- */
40
- declare const ICON_SLACK: () => ComponentChildren;
41
- /**
42
- * GitLab brand icon.
43
- */
44
- declare const ICON_GITLAB: () => ComponentChildren;
45
- /**
46
- * Reddit brand icon.
47
- */
48
- declare const ICON_REDDIT: () => ComponentChildren;
49
- /**
50
- * Spotify brand icon.
51
- */
52
- declare const ICON_SPOTIFY: () => ComponentChildren;
53
- /**
54
- * Twitch brand icon.
55
- */
56
- declare const ICON_TWITCH: () => ComponentChildren;
57
- //#endregion
58
- export { ICON_APPLE, ICON_DISCORD, ICON_EMAIL, ICON_FACEBOOK, ICON_GITHUB, ICON_GITLAB, ICON_GOOGLE, ICON_LINKEDIN, ICON_MICROSOFT, ICON_REDDIT, ICON_SLACK, ICON_SPOTIFY, ICON_TWITCH };
package/dist/ui/icon.mjs DELETED
@@ -1,247 +0,0 @@
1
- import { jsx, jsxs } from "preact/jsx-runtime";
2
-
3
- //#region src/ui/icon.tsx
4
- /**
5
- * GitHub brand icon with official logo design.
6
- */
7
- const ICON_GITHUB = () => /* @__PURE__ */ jsx("svg", {
8
- role: "img",
9
- viewBox: "0 0 256 250",
10
- width: "256",
11
- height: "250",
12
- fill: "currentColor",
13
- xmlns: "http://www.w3.org/2000/svg",
14
- preserveAspectRatio: "xMidYMid",
15
- "aria-label": "GitHub",
16
- children: /* @__PURE__ */ jsx("path", { d: "M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46 6.397 1.185 8.746-2.777 8.746-6.158 0-3.052-.12-13.135-.174-23.83-35.61 7.742-43.124-15.103-43.124-15.103-5.823-14.795-14.213-18.73-14.213-18.73-11.613-7.944.876-7.78.876-7.78 12.853.902 19.621 13.19 19.621 13.19 11.417 19.568 29.945 13.911 37.249 10.64 1.149-8.272 4.466-13.92 8.127-17.116-28.431-3.236-58.318-14.212-58.318-63.258 0-13.975 5-25.394 13.188-34.358-1.329-3.224-5.71-16.242 1.24-33.874 0 0 10.749-3.44 35.21 13.121 10.21-2.836 21.16-4.258 32.038-4.307 10.878.049 21.837 1.47 32.066 4.307 24.431-16.56 35.165-13.12 35.165-13.12 6.967 17.63 2.584 30.65 1.255 33.873 8.207 8.964 13.173 20.383 13.173 34.358 0 49.163-29.944 59.988-58.447 63.157 4.591 3.972 8.682 11.762 8.682 23.704 0 17.126-.148 30.91-.148 35.126 0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002 256 57.307 198.691 0 128.001 0Zm-80.06 182.34c-.282.636-1.283.827-2.194.39-.929-.417-1.45-1.284-1.15-1.922.276-.655 1.279-.838 2.205-.399.93.418 1.46 1.293 1.139 1.931Zm6.296 5.618c-.61.566-1.804.303-2.614-.591-.837-.892-.994-2.086-.375-2.66.63-.566 1.787-.301 2.626.591.838.903 1 2.088.363 2.66Zm4.32 7.188c-.785.545-2.067.034-2.86-1.104-.784-1.138-.784-2.503.017-3.05.795-.547 2.058-.055 2.861 1.075.782 1.157.782 2.522-.019 3.08Zm7.304 8.325c-.701.774-2.196.566-3.29-.49-1.119-1.032-1.43-2.496-.726-3.27.71-.776 2.213-.558 3.315.49 1.11 1.03 1.45 2.505.701 3.27Zm9.442 2.81c-.31 1.003-1.75 1.459-3.199 1.033-1.448-.439-2.395-1.613-2.103-2.626.301-1.01 1.747-1.484 3.207-1.028 1.446.436 2.396 1.602 2.095 2.622Zm10.744 1.193c.036 1.055-1.193 1.93-2.715 1.95-1.53.034-2.769-.82-2.786-1.86 0-1.065 1.202-1.932 2.733-1.958 1.522-.03 2.768.818 2.768 1.868Zm10.555-.405c.182 1.03-.875 2.088-2.387 2.37-1.485.271-2.861-.365-3.05-1.386-.184-1.056.893-2.114 2.376-2.387 1.514-.263 2.868.356 3.061 1.403Z" })
17
- });
18
- /**
19
- * Google brand icon with official multicolor logo design.
20
- */
21
- const ICON_GOOGLE = () => /* @__PURE__ */ jsxs("svg", {
22
- role: "img",
23
- width: "256",
24
- height: "262",
25
- viewBox: "0 0 256 262",
26
- xmlns: "http://www.w3.org/2000/svg",
27
- preserveAspectRatio: "xMidYMid",
28
- "aria-label": "Google",
29
- children: [
30
- /* @__PURE__ */ jsx("path", {
31
- d: "M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",
32
- fill: "#4285F4"
33
- }),
34
- /* @__PURE__ */ jsx("path", {
35
- d: "M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",
36
- fill: "#34A853"
37
- }),
38
- /* @__PURE__ */ jsx("path", {
39
- d: "M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782",
40
- fill: "#FBBC05"
41
- }),
42
- /* @__PURE__ */ jsx("path", {
43
- d: "M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",
44
- fill: "#EB4335"
45
- })
46
- ]
47
- });
48
- /**
49
- * Email envelope icon for email-related authentication flows.
50
- */
51
- const ICON_EMAIL = () => /* @__PURE__ */ jsx("svg", {
52
- role: "img",
53
- xmlns: "http://www.w3.org/2000/svg",
54
- fill: "none",
55
- viewBox: "0 0 24 24",
56
- "stroke-width": "1.5",
57
- stroke: "currentColor",
58
- "aria-label": "Email",
59
- children: /* @__PURE__ */ jsx("path", {
60
- "stroke-linecap": "round",
61
- "stroke-linejoin": "round",
62
- d: "M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"
63
- })
64
- });
65
- /**
66
- * Apple brand icon for Sign in with Apple.
67
- */
68
- const ICON_APPLE = () => /* @__PURE__ */ jsx("svg", {
69
- role: "img",
70
- xmlns: "http://www.w3.org/2000/svg",
71
- viewBox: "0 0 814 1000",
72
- fill: "currentColor",
73
- "aria-label": "Apple",
74
- children: /* @__PURE__ */ jsx("path", { d: "M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z" })
75
- });
76
- /**
77
- * Discord brand icon.
78
- */
79
- const ICON_DISCORD = () => /* @__PURE__ */ jsx("svg", {
80
- role: "img",
81
- viewBox: "0 0 24 24",
82
- xmlns: "http://www.w3.org/2000/svg",
83
- fill: "currentColor",
84
- "aria-label": "Discord",
85
- children: /* @__PURE__ */ jsx("path", { d: "M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z" })
86
- });
87
- /**
88
- * Facebook brand icon with gradient.
89
- */
90
- const ICON_FACEBOOK = () => /* @__PURE__ */ jsxs("svg", {
91
- role: "img",
92
- xmlns: "http://www.w3.org/2000/svg",
93
- viewBox: "0 0 36 36",
94
- fill: "url(#facebook_gradient)",
95
- "aria-label": "Facebook",
96
- children: [
97
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
98
- x1: "50%",
99
- x2: "50%",
100
- y1: "97.078%",
101
- y2: "0%",
102
- id: "facebook_gradient",
103
- children: [/* @__PURE__ */ jsx("stop", {
104
- offset: "0%",
105
- "stop-color": "#0062E0"
106
- }), /* @__PURE__ */ jsx("stop", {
107
- offset: "100%",
108
- "stop-color": "#19AFFF"
109
- })]
110
- }) }),
111
- /* @__PURE__ */ jsx("path", { d: "M15 35.8C6.5 34.3 0 26.9 0 18 0 8.1 8.1 0 18 0s18 8.1 18 18c0 8.9-6.5 16.3-15 17.8l-1-.8h-4l-1 .8z" }),
112
- /* @__PURE__ */ jsx("path", {
113
- fill: "#FFF",
114
- d: "m25 23 .8-5H21v-3.5c0-1.4.5-2.5 2.7-2.5H26V7.4c-1.3-.2-2.7-.4-4-.4-4.1 0-7 2.5-7 7v4h-4.5v5H15v12.7c1 .2 2 .3 3 .3s2-.1 3-.3V23h4z"
115
- })
116
- ]
117
- });
118
- /**
119
- * LinkedIn brand icon.
120
- */
121
- const ICON_LINKEDIN = () => /* @__PURE__ */ jsx("svg", {
122
- role: "img",
123
- xmlns: "http://www.w3.org/2000/svg",
124
- viewBox: "0 0 24 24",
125
- fill: "currentColor",
126
- "aria-label": "LinkedIn",
127
- children: /* @__PURE__ */ jsx("path", { d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.225 0z" })
128
- });
129
- /**
130
- * Microsoft brand icon with four color squares.
131
- */
132
- const ICON_MICROSOFT = () => /* @__PURE__ */ jsxs("svg", {
133
- role: "img",
134
- xmlns: "http://www.w3.org/2000/svg",
135
- viewBox: "0 0 23 23",
136
- fill: "currentColor",
137
- "aria-label": "Microsoft",
138
- children: [
139
- /* @__PURE__ */ jsx("rect", {
140
- x: "0",
141
- y: "0",
142
- width: "10.58",
143
- height: "10.58",
144
- fill: "#F1511B"
145
- }),
146
- /* @__PURE__ */ jsx("rect", {
147
- x: "12.42",
148
- y: "0",
149
- width: "10.58",
150
- height: "10.58",
151
- fill: "#80CC28"
152
- }),
153
- /* @__PURE__ */ jsx("rect", {
154
- x: "0",
155
- y: "12.42",
156
- width: "10.58",
157
- height: "10.58",
158
- fill: "#00ADEF"
159
- }),
160
- /* @__PURE__ */ jsx("rect", {
161
- x: "12.42",
162
- y: "12.42",
163
- width: "10.58",
164
- height: "10.58",
165
- fill: "#FFB900"
166
- })
167
- ]
168
- });
169
- /**
170
- * Slack brand icon.
171
- */
172
- const ICON_SLACK = () => /* @__PURE__ */ jsx("svg", {
173
- role: "img",
174
- xmlns: "http://www.w3.org/2000/svg",
175
- viewBox: "0 0 2447.6 2452.5",
176
- fill: "currentColor",
177
- "aria-label": "Slack",
178
- children: /* @__PURE__ */ jsxs("g", {
179
- "clip-rule": "evenodd",
180
- "fill-rule": "evenodd",
181
- children: [
182
- /* @__PURE__ */ jsx("path", {
183
- d: "m897.4 0c-135.3.1-244.8 109.9-244.7 245.2-.1 135.3 109.5 245.1 244.8 245.2h244.8v-245.1c.1-135.3-109.5-245.1-244.9-245.3.1 0 .1 0 0 0m0 654h-652.6c-135.3.1-244.9 109.9-244.8 245.2-.2 135.3 109.4 245.1 244.7 245.3h652.7c135.3-.1 244.9-109.9 244.8-245.2.1-135.4-109.5-245.2-244.8-245.3z",
184
- fill: "#36c5f0"
185
- }),
186
- /* @__PURE__ */ jsx("path", {
187
- d: "m2447.6 899.2c.1-135.3-109.5-245.1-244.8-245.2-135.3.1-244.9 109.9-244.8 245.2v245.3h244.8c135.3-.1 244.9-109.9 244.8-245.3zm-652.7 0v-654c.1-135.2-109.4-245-244.7-245.2-135.3.1-244.9 109.9-244.8 245.2v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.3z",
188
- fill: "#2eb67d"
189
- }),
190
- /* @__PURE__ */ jsx("path", {
191
- d: "m1550.1 2452.5c135.3-.1 244.9-109.9 244.8-245.2.1-135.3-109.5-245.1-244.8-245.2h-244.8v245.2c-.1 135.2 109.5 245 244.8 245.2zm0-654.1h652.7c135.3-.1 244.9-109.9 244.8-245.2.2-135.3-109.4-245.1-244.7-245.3h-652.7c-135.3.1-244.9 109.9-244.8 245.2-.1 135.4 109.4 245.2 244.7 245.3z",
192
- fill: "#ecb22e"
193
- }),
194
- /* @__PURE__ */ jsx("path", {
195
- d: "m0 1553.2c-.1 135.3 109.5 245.1 244.8 245.2 135.3-.1 244.9-109.9 244.8-245.2v-245.2h-244.8c-135.3.1-244.9 109.9-244.8 245.2zm652.7 0v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.2v-653.9c.2-135.3-109.4-245.1-244.7-245.3-135.4 0-244.9 109.8-244.8 245.1 0 0 0 .1 0 0",
196
- fill: "#e01e5a"
197
- })
198
- ]
199
- })
200
- });
201
- /**
202
- * GitLab brand icon.
203
- */
204
- const ICON_GITLAB = () => /* @__PURE__ */ jsx("svg", {
205
- role: "img",
206
- xmlns: "http://www.w3.org/2000/svg",
207
- viewBox: "0 0 24 24",
208
- fill: "currentColor",
209
- "aria-label": "GitLab",
210
- children: /* @__PURE__ */ jsx("path", { d: "m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z" })
211
- });
212
- /**
213
- * Reddit brand icon.
214
- */
215
- const ICON_REDDIT = () => /* @__PURE__ */ jsx("svg", {
216
- role: "img",
217
- xmlns: "http://www.w3.org/2000/svg",
218
- viewBox: "0 0 24 24",
219
- fill: "currentColor",
220
- "aria-label": "Reddit",
221
- children: /* @__PURE__ */ jsx("path", { d: "M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z" })
222
- });
223
- /**
224
- * Spotify brand icon.
225
- */
226
- const ICON_SPOTIFY = () => /* @__PURE__ */ jsx("svg", {
227
- role: "img",
228
- xmlns: "http://www.w3.org/2000/svg",
229
- viewBox: "0 0 24 24",
230
- fill: "currentColor",
231
- "aria-label": "Spotify",
232
- children: /* @__PURE__ */ jsx("path", { d: "M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z" })
233
- });
234
- /**
235
- * Twitch brand icon.
236
- */
237
- const ICON_TWITCH = () => /* @__PURE__ */ jsx("svg", {
238
- role: "img",
239
- xmlns: "http://www.w3.org/2000/svg",
240
- viewBox: "0 0 24 24",
241
- fill: "currentColor",
242
- "aria-label": "Twitch",
243
- children: /* @__PURE__ */ jsx("path", { d: "M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z" })
244
- });
245
-
246
- //#endregion
247
- export { ICON_APPLE, ICON_DISCORD, ICON_EMAIL, ICON_FACEBOOK, ICON_GITHUB, ICON_GITLAB, ICON_GOOGLE, ICON_LINKEDIN, ICON_MICROSOFT, ICON_REDDIT, ICON_SLACK, ICON_SPOTIFY, ICON_TWITCH };
@@ -1,41 +0,0 @@
1
- import { MagicLinkConfig } from "../provider/magiclink.mjs";
2
-
3
- //#region src/ui/magiclink.d.ts
4
-
5
- /**
6
- * Type for customizable UI copy text
7
- */
8
- interface MagicLinkUICopy {
9
- readonly email_placeholder: string;
10
- readonly email_invalid: string;
11
- readonly button_continue: string;
12
- readonly link_info: string;
13
- readonly link_sent: string;
14
- readonly link_resent: string;
15
- readonly link_didnt_get: string;
16
- readonly link_resend: string;
17
- }
18
- /**
19
- * Input mode for the contact field
20
- */
21
- type MagicLinkUIMode = "email" | "phone";
22
- /**
23
- * Configuration options for the MagicLinkUI component
24
- */
25
- interface MagicLinkUIOptions<Claims extends Record<string, string> = Record<string, string>> extends Pick<MagicLinkConfig<Claims>, "sendLink"> {
26
- /**
27
- * Input mode determining the type of contact information to collect
28
- * @default "email"
29
- */
30
- readonly mode?: MagicLinkUIMode;
31
- /**
32
- * Custom text copy for UI labels, messages, and errors
33
- */
34
- readonly copy?: Partial<MagicLinkUICopy>;
35
- }
36
- /**
37
- * Creates a complete UI configuration for Magic Link authentication
38
- */
39
- declare const MagicLinkUI: <Claims extends Record<string, string> = Record<string, string>>(options: MagicLinkUIOptions<Claims>) => MagicLinkConfig<Claims>;
40
- //#endregion
41
- export { MagicLinkUI, MagicLinkUICopy, MagicLinkUIMode, MagicLinkUIOptions };
@@ -1,152 +0,0 @@
1
- import { run } from "../util.mjs";
2
- import { Layout, renderToHTML } from "./base.mjs";
3
- import { FormAlert } from "./form.mjs";
4
- import { jsx, jsxs } from "preact/jsx-runtime";
5
-
6
- //#region src/ui/magiclink.tsx
7
- /**
8
- * Default text copy for the Magic Link authentication UI
9
- */
10
- const DEFAULT_COPY = {
11
- email_placeholder: "Email",
12
- email_invalid: "Email address is not valid",
13
- button_continue: "Send Magic Link",
14
- link_info: "We'll send a secure link to your email.",
15
- link_sent: "Magic link sent to ",
16
- link_resent: "Magic link resent to ",
17
- link_didnt_get: "Didn't get the email?",
18
- link_resend: "Resend Magic Link"
19
- };
20
- /**
21
- * Gets the appropriate error message for display
22
- */
23
- const getErrorMessage = (error, copy) => {
24
- if (!error?.type) return void 0;
25
- switch (error.type) {
26
- case "invalid_link": return "This magic link is invalid or expired";
27
- case "invalid_claim": return copy.email_invalid;
28
- }
29
- };
30
- /**
31
- * Gets the appropriate success message for display
32
- */
33
- const getSuccessMessage = (state, copy, mode) => {
34
- if (state.type === "start" || !state.claims) return void 0;
35
- const contact = state.claims[mode] || "";
36
- return {
37
- message: `${state.resend ? copy.link_resent : copy.link_sent}${contact}`,
38
- contact
39
- };
40
- };
41
- /**
42
- * Creates a complete UI configuration for Magic Link authentication
43
- */
44
- const MagicLinkUI = (options) => {
45
- const copy = {
46
- ...DEFAULT_COPY,
47
- ...options.copy
48
- };
49
- const mode = options.mode || "email";
50
- /**
51
- * Renders the start form for collecting contact information
52
- */
53
- const renderStart = (form, error, state) => {
54
- const success = getSuccessMessage(state || { type: "start" }, copy, mode);
55
- return /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsxs("form", {
56
- "data-component": "form",
57
- method: "post",
58
- children: [
59
- run(() => {
60
- if (success) return /* @__PURE__ */ jsx(FormAlert, {
61
- message: success.message,
62
- color: "success"
63
- });
64
- return /* @__PURE__ */ jsx(FormAlert, { message: getErrorMessage(error, copy) });
65
- }),
66
- /* @__PURE__ */ jsx("input", {
67
- "data-component": "input",
68
- type: mode === "email" ? "email" : "tel",
69
- name: mode,
70
- placeholder: copy.email_placeholder,
71
- value: form?.get(mode)?.toString() || "",
72
- autoComplete: mode,
73
- required: true
74
- }),
75
- /* @__PURE__ */ jsx("input", {
76
- type: "hidden",
77
- name: "action",
78
- value: "request"
79
- }),
80
- /* @__PURE__ */ jsx("button", {
81
- "data-component": "button",
82
- type: "submit",
83
- children: copy.button_continue
84
- }),
85
- /* @__PURE__ */ jsx("p", {
86
- "data-component": "description",
87
- children: copy.link_info
88
- })
89
- ]
90
- }) });
91
- };
92
- /**
93
- * Renders the "check your email" page after magic link is sent
94
- */
95
- const renderSent = (_form, error, state) => {
96
- const success = getSuccessMessage(state, copy, mode);
97
- const contact = state.type === "sent" ? state.claims?.[mode] || "" : "";
98
- return /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsxs("form", {
99
- "data-component": "form",
100
- method: "post",
101
- children: [
102
- /* @__PURE__ */ jsx("h2", {
103
- "data-component": "title",
104
- children: "Check your email"
105
- }),
106
- run(() => {
107
- if (success) return /* @__PURE__ */ jsx(FormAlert, {
108
- message: success.message,
109
- color: "success"
110
- });
111
- return /* @__PURE__ */ jsx(FormAlert, { message: getErrorMessage(error, copy) });
112
- }),
113
- /* @__PURE__ */ jsx("p", {
114
- "data-component": "description",
115
- children: "Click the link in your email to sign in."
116
- }),
117
- /* @__PURE__ */ jsx("input", {
118
- name: "action",
119
- type: "hidden",
120
- value: "resend"
121
- }),
122
- /* @__PURE__ */ jsx("input", {
123
- name: mode,
124
- type: "hidden",
125
- value: contact
126
- }),
127
- /* @__PURE__ */ jsx("div", {
128
- "data-component": "form-footer",
129
- children: /* @__PURE__ */ jsxs("span", { children: [
130
- copy.link_didnt_get,
131
- " ",
132
- /* @__PURE__ */ jsx("button", {
133
- type: "submit",
134
- "data-component": "link",
135
- children: copy.link_resend
136
- })
137
- ] })
138
- })
139
- ]
140
- }) });
141
- };
142
- return {
143
- sendLink: options.sendLink,
144
- request: async (_req, state, form, error) => {
145
- const html = renderToHTML(state.type === "start" ? renderStart(form, error, state) : renderSent(form, error, state));
146
- return new Response(html, { headers: { "Content-Type": "text/html" } });
147
- }
148
- };
149
- };
150
-
151
- //#endregion
152
- export { MagicLinkUI };
@@ -1,27 +0,0 @@
1
- import { PasskeyProviderConfig } from "../provider/passkey.mjs";
2
-
3
- //#region src/ui/passkey.d.ts
4
-
5
- /**
6
- * Strongly typed copy text configuration for passkey UI
7
- */
8
- interface PasskeyUICopy {
9
- readonly register: string;
10
- readonly button_continue: string;
11
- readonly register_other_device: string;
12
- readonly register_prompt: string;
13
- readonly login_prompt: string;
14
- readonly login: string;
15
- readonly input_email: string;
16
- readonly error_register_already_registered: string;
17
- readonly error_register_cancelled: string;
18
- readonly error_register_failed: string;
19
- readonly error_auth_cancelled: string;
20
- readonly error_auth_failed: string;
21
- }
22
- interface PasskeyUIOptions extends Omit<PasskeyProviderConfig, "authorize" | "register" | "copy"> {
23
- readonly copy?: Partial<PasskeyUICopy>;
24
- }
25
- declare const PasskeyUI: (options: PasskeyUIOptions) => PasskeyProviderConfig;
26
- //#endregion
27
- export { PasskeyUI };