@draftlab/auth 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/adapters/node.d.ts +18 -0
  2. package/dist/adapters/node.js +71 -0
  3. package/dist/allow-CixonwTW.d.ts +59 -0
  4. package/dist/allow-DX5cehSc.js +63 -0
  5. package/dist/allow.d.ts +2 -0
  6. package/dist/allow.js +4 -0
  7. package/dist/base-DRutbxgL.js +422 -0
  8. package/dist/client.d.ts +413 -0
  9. package/dist/client.js +209 -0
  10. package/dist/code-l_uvMR1j.d.ts +212 -0
  11. package/dist/core-8WTqfnb4.d.ts +129 -0
  12. package/dist/core-CncE5rPg.js +498 -0
  13. package/dist/core.d.ts +9 -0
  14. package/dist/core.js +14 -0
  15. package/dist/error-CWAdNAzm.d.ts +243 -0
  16. package/dist/error-DgAKK7b2.js +237 -0
  17. package/dist/error.d.ts +2 -0
  18. package/dist/error.js +3 -0
  19. package/dist/form-6XKM_cOk.js +61 -0
  20. package/dist/icon-Ci5uqGB_.js +192 -0
  21. package/dist/index.d.ts +9 -0
  22. package/dist/index.js +14 -0
  23. package/dist/keys-EEfxEGfO.js +140 -0
  24. package/dist/keys.d.ts +67 -0
  25. package/dist/keys.js +5 -0
  26. package/dist/oauth2-B7-6Z7Lc.js +155 -0
  27. package/dist/oauth2-DtKwtl8p.d.ts +176 -0
  28. package/dist/password-Cm0dRMwa.d.ts +385 -0
  29. package/dist/pkce-276Za_rZ.js +162 -0
  30. package/dist/pkce.d.ts +72 -0
  31. package/dist/pkce.js +3 -0
  32. package/dist/provider/code.d.ts +4 -0
  33. package/dist/provider/code.js +145 -0
  34. package/dist/provider/facebook.d.ts +137 -0
  35. package/dist/provider/facebook.js +85 -0
  36. package/dist/provider/github.d.ts +141 -0
  37. package/dist/provider/github.js +88 -0
  38. package/dist/provider/google.d.ts +113 -0
  39. package/dist/provider/google.js +62 -0
  40. package/dist/provider/oauth2.d.ts +4 -0
  41. package/dist/provider/oauth2.js +7 -0
  42. package/dist/provider/password.d.ts +4 -0
  43. package/dist/provider/password.js +366 -0
  44. package/dist/provider/provider.d.ts +3 -0
  45. package/dist/provider/provider.js +44 -0
  46. package/dist/provider-CwWMG-1l.d.ts +227 -0
  47. package/dist/random-SXMYlaVr.js +87 -0
  48. package/dist/random.d.ts +66 -0
  49. package/dist/random.js +3 -0
  50. package/dist/select-BjySLL8I.js +280 -0
  51. package/dist/storage/memory.d.ts +82 -0
  52. package/dist/storage/memory.js +127 -0
  53. package/dist/storage/storage.d.ts +2 -0
  54. package/dist/storage/storage.js +3 -0
  55. package/dist/storage/turso.d.ts +31 -0
  56. package/dist/storage/turso.js +117 -0
  57. package/dist/storage/unstorage.d.ts +38 -0
  58. package/dist/storage/unstorage.js +97 -0
  59. package/dist/storage-BEaqEPNQ.js +62 -0
  60. package/dist/storage-CxKerLlc.d.ts +162 -0
  61. package/dist/subject-DiQdRWGt.d.ts +62 -0
  62. package/dist/subject.d.ts +3 -0
  63. package/dist/subject.js +36 -0
  64. package/dist/theme-C9by7VXf.d.ts +209 -0
  65. package/dist/theme-CswaLtbW.js +120 -0
  66. package/dist/themes/theme.d.ts +2 -0
  67. package/dist/themes/theme.js +3 -0
  68. package/dist/types.d.ts +94 -0
  69. package/dist/types.js +0 -0
  70. package/dist/ui/base.d.ts +43 -0
  71. package/dist/ui/base.js +4 -0
  72. package/dist/ui/code.d.ts +158 -0
  73. package/dist/ui/code.js +197 -0
  74. package/dist/ui/form.d.ts +31 -0
  75. package/dist/ui/form.js +3 -0
  76. package/dist/ui/icon.d.ts +98 -0
  77. package/dist/ui/icon.js +3 -0
  78. package/dist/ui/password.d.ts +54 -0
  79. package/dist/ui/password.js +300 -0
  80. package/dist/ui/select.d.ts +233 -0
  81. package/dist/ui/select.js +6 -0
  82. package/dist/util-CSdHUFOo.js +108 -0
  83. package/dist/util-ChlgVqPN.d.ts +72 -0
  84. package/dist/util.d.ts +2 -0
  85. package/dist/util.js +3 -0
  86. package/package.json +63 -0
@@ -0,0 +1,197 @@
1
+ import { UnknownStateError } from "../error-DgAKK7b2.js";
2
+ import "../theme-CswaLtbW.js";
3
+ import { Layout } from "../base-DRutbxgL.js";
4
+ import { FormAlert } from "../form-6XKM_cOk.js";
5
+
6
+ //#region src/ui/code.ts
7
+ /**
8
+ * Default text copy for the PIN code authentication UI.
9
+ * All text can be customized via the copy prop.
10
+ */
11
+ const DEFAULT_COPY = {
12
+ email_placeholder: "Email",
13
+ email_invalid: "Email address is not valid",
14
+ button_continue: "Continue",
15
+ code_info: "We'll send a pin code to your email.",
16
+ code_placeholder: "Code",
17
+ code_invalid: "Invalid code",
18
+ code_sent: "Code sent to ",
19
+ code_resent: "Code resent to ",
20
+ code_didnt_get: "Didn't get code?",
21
+ code_resend: "Resend"
22
+ };
23
+ /**
24
+ * Creates a complete UI configuration for PIN code authentication.
25
+ * Provides pre-built forms for collecting user contact info and verifying PIN codes.
26
+ *
27
+ * @param options - Configuration options for the UI
28
+ * @returns Complete CodeProvider configuration with UI handlers
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * // Basic email-based PIN authentication
33
+ * const emailCodeUI = CodeUI({
34
+ * sendCode: async (claims, code) => {
35
+ * await emailService.send(claims.email, `Code: ${code}`)
36
+ * }
37
+ * })
38
+ *
39
+ * // Phone-based PIN authentication with custom copy
40
+ * const phoneCodeUI = CodeUI({
41
+ * mode: "phone",
42
+ * copy: {
43
+ * email_placeholder: "Phone number",
44
+ * code_info: "We'll send a verification code via SMS",
45
+ * email_invalid: "Please enter a valid phone number"
46
+ * },
47
+ * sendCode: async (claims, code) => {
48
+ * await smsService.send(claims.phone, `Verification: ${code}`)
49
+ * }
50
+ * })
51
+ *
52
+ * // Multi-mode authentication
53
+ * const flexibleCodeUI = CodeUI({
54
+ * copy: {
55
+ * email_placeholder: "Email or phone number",
56
+ * code_info: "We'll send a code to your email or phone"
57
+ * },
58
+ * sendCode: async (claims, code) => {
59
+ * if (claims.email && claims.email.includes('@')) {
60
+ * await emailService.send(claims.email, `Code: ${code}`)
61
+ * } else if (claims.email) {
62
+ * // Treat as phone number if no @ symbol
63
+ * await smsService.send(claims.email, `Code: ${code}`)
64
+ * } else {
65
+ * return {
66
+ * type: "invalid_claim",
67
+ * key: "contact",
68
+ * value: "Email or phone required"
69
+ * }
70
+ * }
71
+ * }
72
+ * })
73
+ * ```
74
+ */
75
+ const CodeUI = (options) => {
76
+ const copy = {
77
+ ...DEFAULT_COPY,
78
+ ...options.copy
79
+ };
80
+ const inputMode = options.mode ?? "email";
81
+ /**
82
+ * Determines the appropriate input field attributes based on the selected mode.
83
+ */
84
+ const getInputAttributes = () => {
85
+ switch (inputMode) {
86
+ case "email": return {
87
+ type: "email",
88
+ name: "email",
89
+ inputmode: "email",
90
+ autocomplete: "email"
91
+ };
92
+ case "phone": return {
93
+ type: "tel",
94
+ name: "phone",
95
+ inputmode: "tel",
96
+ autocomplete: "tel"
97
+ };
98
+ }
99
+ };
100
+ /**
101
+ * Gets the appropriate contact value from claims for display purposes.
102
+ */
103
+ const getContactValue = (claims) => {
104
+ return claims.email || claims.phone || Object.values(claims)[0] || "";
105
+ };
106
+ return {
107
+ sendCode: options.sendCode,
108
+ length: 6,
109
+ request: async (_req, state, _form, error) => {
110
+ if (state.type === "start") {
111
+ const inputAttrs = getInputAttributes();
112
+ const formContent = `
113
+ <form data-component="form" method="post">
114
+ ${error?.type === "invalid_claim" ? FormAlert({ message: copy.email_invalid }) : ""}
115
+
116
+ <input name="action" type="hidden" value="request" />
117
+
118
+ <input
119
+ autofocus
120
+ data-component="input"
121
+ placeholder="${copy.email_placeholder}"
122
+ required
123
+ type="${inputAttrs.type}"
124
+ name="${inputAttrs.name}"
125
+ inputmode="${inputAttrs.inputmode}"
126
+ autocomplete="${inputAttrs.autocomplete}"
127
+ />
128
+
129
+ <button data-component="button" type="submit">
130
+ ${copy.button_continue}
131
+ </button>
132
+ </form>
133
+
134
+ <p data-component="form-footer">${copy.code_info}</p>
135
+ `;
136
+ const html = Layout({ children: formContent });
137
+ return new Response(html, { headers: { "Content-Type": "text/html" } });
138
+ }
139
+ if (state.type === "code") {
140
+ const contactValue = getContactValue(state.claims);
141
+ const hiddenInputs = Object.entries(state.claims).map(([key, value]) => `<input name="${key}" type="hidden" value="${value}" />`).join("");
142
+ const formContent = `
143
+ <form data-component="form" method="post">
144
+ ${error?.type === "invalid_code" ? FormAlert({ message: copy.code_invalid }) : ""}
145
+
146
+ ${FormAlert({
147
+ color: "success",
148
+ message: (state.resend ? copy.code_resent : copy.code_sent) + contactValue
149
+ })}
150
+
151
+ <input name="action" type="hidden" value="verify" />
152
+
153
+ <input
154
+ aria-label="6-digit verification code"
155
+ autocomplete="one-time-code"
156
+ autofocus
157
+ data-component="input"
158
+ inputmode="numeric"
159
+ maxlength="6"
160
+ minlength="6"
161
+ name="code"
162
+ pattern="[0-9]{6}"
163
+ placeholder="${copy.code_placeholder}"
164
+ required
165
+ type="text"
166
+ />
167
+
168
+ <button data-component="button" type="submit">
169
+ ${copy.button_continue}
170
+ </button>
171
+ </form>
172
+
173
+ <form method="post">
174
+ ${hiddenInputs}
175
+
176
+ <input name="action" type="hidden" value="resend" />
177
+
178
+ <div data-component="form-footer">
179
+ <span>
180
+ ${copy.code_didnt_get}
181
+ <button data-component="link" type="submit">
182
+ ${copy.code_resend}
183
+ </button>
184
+ </span>
185
+ </div>
186
+ </form>
187
+ `;
188
+ const html = Layout({ children: formContent });
189
+ return new Response(html, { headers: { "Content-Type": "text/html" } });
190
+ }
191
+ throw new UnknownStateError();
192
+ }
193
+ };
194
+ };
195
+
196
+ //#endregion
197
+ export { CodeUI };
@@ -0,0 +1,31 @@
1
+ //#region src/ui/form.d.ts
2
+ /**
3
+ * Form alert component for displaying success and error messages.
4
+ * Provides consistent styling and iconography for user feedback in authentication forms.
5
+ */
6
+ /**
7
+ * Alert color variant determining the visual style and icon.
8
+ */
9
+ type FormAlertColor = "danger" | "success";
10
+ /**
11
+ * Props for the FormAlert component.
12
+ */
13
+ interface FormAlertProps {
14
+ /**
15
+ * The message text to display in the alert.
16
+ * If not provided, the alert will not render.
17
+ */
18
+ readonly message?: string;
19
+ /**
20
+ * Visual style variant for the alert.
21
+ * @default "danger"
22
+ */
23
+ readonly color?: FormAlertColor;
24
+ }
25
+ /**
26
+ * Form alert component that displays error or success messages.
27
+ * Returns an HTML string for the alert or empty string if no message.
28
+ */
29
+ declare const FormAlert: (props: FormAlertProps) => string;
30
+ //#endregion
31
+ export { FormAlert, FormAlertColor, FormAlertProps };
@@ -0,0 +1,3 @@
1
+ import { FormAlert } from "../form-6XKM_cOk.js";
2
+
3
+ export { FormAlert };
@@ -0,0 +1,98 @@
1
+ //#region src/ui/icon.d.ts
2
+ /**
3
+ * Icon components for Draft Auth UI.
4
+ * Provides SVG icons for various authentication providers and common UI elements.
5
+ *
6
+ * ## Usage
7
+ *
8
+ * ```ts
9
+ * import { ICON_GITHUB, ICON_GOOGLE, ICON_EMAIL } from "./icon"
10
+ *
11
+ * // In provider buttons
12
+ * const buttonHtml = `
13
+ * <button>
14
+ * ${ICON_GITHUB}
15
+ * Continue with GitHub
16
+ * </button>
17
+ * `
18
+ *
19
+ * // In form elements
20
+ * const formHtml = `
21
+ * <div>
22
+ * ${ICON_EMAIL}
23
+ * Email verification
24
+ * </div>
25
+ * `
26
+ * ```
27
+ *
28
+ * ## Features
29
+ *
30
+ * - **Consistent sizing**: All icons are properly sized and scalable
31
+ * - **Accessibility**: Proper ARIA labels and semantic markup
32
+ * - **Current color**: Icons inherit text color for easy theming
33
+ * - **Optimized SVGs**: Clean, minimal SVG markup for performance
34
+ *
35
+ * @packageDocumentation
36
+ */
37
+ /**
38
+ * GitHub brand icon with official logo design.
39
+ * Used for GitHub authentication provider buttons and references.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const buttonHtml = `
44
+ * <button data-component="provider-button">
45
+ * ${ICON_GITHUB}
46
+ * Sign in with GitHub
47
+ * </button>
48
+ * `
49
+ * ```
50
+ */
51
+ declare const ICON_GITHUB = "\n\t<svg\n\t\taria-label=\"GitHub\"\n\t\tfill=\"currentColor\"\n\t\theight=\"250\"\n\t\tpreserveAspectRatio=\"xMidYMid\"\n\t\trole=\"img\"\n\t\tviewBox=\"0 0 256 250\"\n\t\twidth=\"256\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<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\" />\n\t</svg>\n";
52
+ /**
53
+ * Google brand icon with official multicolor logo design.
54
+ * Used for Google authentication provider buttons and references.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const buttonHtml = `
59
+ * <button data-component="provider-button">
60
+ * ${ICON_GOOGLE}
61
+ * Continue with Google
62
+ * </button>
63
+ * `
64
+ * ```
65
+ */
66
+ declare const ICON_GOOGLE = "\n\t<svg\n\t\taria-label=\"Google\"\n\t\theight=\"262\"\n\t\tpreserveAspectRatio=\"xMidYMid\"\n\t\trole=\"img\"\n\t\tviewBox=\"0 0 256 262\"\n\t\twidth=\"256\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<path\n\t\t\td=\"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\"\n\t\t\tfill=\"#4285F4\"\n\t\t/>\n\t\t<path\n\t\t\td=\"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\"\n\t\t\tfill=\"#34A853\"\n\t\t/>\n\t\t<path\n\t\t\td=\"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\"\n\t\t\tfill=\"#FBBC05\"\n\t\t/>\n\t\t<path\n\t\t\td=\"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\"\n\t\t\tfill=\"#EB4335\"\n\t\t/>\n\t</svg>\n";
67
+ /**
68
+ * Email envelope icon for email-related authentication flows.
69
+ * Used in email verification, password reset, and contact forms.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const inputGroupHtml = `
74
+ * <div data-component="input-group">
75
+ * ${ICON_EMAIL}
76
+ * <input type="email" placeholder="Enter your email" />
77
+ * </div>
78
+ * `
79
+ * ```
80
+ */
81
+ declare const ICON_EMAIL = "\n\t<svg\n\t\taria-label=\"Email\"\n\t\tfill=\"none\"\n\t\trole=\"img\"\n\t\tstroke=\"currentColor\"\n\t\tstroke-width=\"1.5\"\n\t\tviewBox=\"0 0 24 24\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<path\n\t\t\td=\"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\"\n\t\t\tstroke-linecap=\"round\"\n\t\t\tstroke-linejoin=\"round\"\n\t\t/>\n\t</svg>\n";
82
+ /**
83
+ * Slack brand icon with official logo design.
84
+ * Used for Slack authentication provider buttons and workplace integrations.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const buttonHtml = `
89
+ * <button data-component="provider-button">
90
+ * ${ICON_SLACK}
91
+ * Continue with Slack
92
+ * </button>
93
+ * `
94
+ * ```
95
+ */
96
+ declare const ICON_SLACK = "\n\t<svg\n\t\taria-label=\"Slack\"\n\t\tfill=\"none\"\n\t\theight=\"24\"\n\t\trole=\"img\"\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"24\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<g>\n\t\t\t<path\n\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\td=\"M8.79948 0C7.47279 0.000978593 6.39909 1.07547 6.40007 2.39951C6.39909 3.72355 7.47377 4.79804 8.80046 4.79902H11.2009V2.40049C11.2018 1.07645 10.1271 0.00195719 8.79948 0ZM8.79948 6.4H2.40039C1.07371 6.40098 -0.000977873 7.47547 2.67973e-06 8.79951C-0.00195842 10.1235 1.07273 11.198 2.39941 11.2H8.79948C10.1262 11.199 11.2009 10.1245 11.1999 8.80049C11.2009 7.47547 10.1262 6.40098 8.79948 6.4Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\td=\"M24.0007 8.79951C24.0016 7.47547 22.9269 6.40098 21.6003 6.4C20.2736 6.40098 19.1989 7.47547 19.1999 8.79951V11.2H21.6003C22.9269 11.199 24.0016 10.1245 24.0007 8.79951ZM17.6006 8.79951V2.39951C17.6016 1.07645 16.5279 0.00195719 15.2012 0C13.8745 0.000978593 12.7998 1.07547 12.8008 2.39951V8.79951C12.7988 10.1235 13.8735 11.198 15.2002 11.2C16.5269 11.199 17.6016 10.1245 17.6006 8.79951Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\td=\"M15.1992 23.9998C16.5259 23.9988 17.6006 22.9243 17.5996 21.6003C17.6006 20.2763 16.5259 19.2018 15.1992 19.2008H12.7988V21.6003C12.7978 22.9234 13.8725 23.9978 15.1992 23.9998ZM15.1992 17.5988H21.5993C22.926 17.5978 24.0007 16.5234 23.9997 15.1993C24.0016 13.8753 22.927 12.8008 21.6003 12.7988H15.2002C13.8735 12.7998 12.7988 13.8743 12.7998 15.1983C12.7988 16.5234 13.8725 17.5978 15.1992 17.5988Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\td=\"M0 15.1993C-0.000979882 16.5234 1.07371 17.5978 2.40039 17.5988C3.72708 17.5978 4.80177 16.5234 4.80079 15.1993V12.7998H2.40039C1.07371 12.8008 -0.000979882 13.8753 0 15.1993ZM6.40007 15.1993V21.5993C6.3981 22.9234 7.47279 23.9978 8.79948 23.9998C10.1262 23.9988 11.2009 22.9243 11.1999 21.6003V15.2013C11.2018 13.8772 10.1271 12.8027 8.80046 12.8008C7.47279 12.8008 6.39909 13.8753 6.40007 15.1993Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t/>\n\t\t</g>\n\t</svg>\n";
97
+ //#endregion
98
+ export { ICON_EMAIL, ICON_GITHUB, ICON_GOOGLE, ICON_SLACK };
@@ -0,0 +1,3 @@
1
+ import { ICON_EMAIL, ICON_GITHUB, ICON_GOOGLE, ICON_SLACK } from "../icon-Ci5uqGB_.js";
2
+
3
+ export { ICON_EMAIL, ICON_GITHUB, ICON_GOOGLE, ICON_SLACK };
@@ -0,0 +1,54 @@
1
+ import "../storage-CxKerLlc.js";
2
+ import "../provider-CwWMG-1l.js";
3
+ import { PasswordConfig } from "../password-Cm0dRMwa.js";
4
+
5
+ //#region src/ui/password.d.ts
6
+
7
+ /**
8
+ * Default text copy for all password authentication UI screens.
9
+ * All text can be customized via the copy prop.
10
+ */
11
+ declare const DEFAULT_COPY: {
12
+ error_email_taken: string;
13
+ error_invalid_code: string;
14
+ error_invalid_email: string;
15
+ error_invalid_password: string;
16
+ error_password_mismatch: string;
17
+ error_validation_error: string;
18
+ register_title: string;
19
+ register_description: string;
20
+ login_title: string;
21
+ login_description: string;
22
+ register: string;
23
+ register_prompt: string;
24
+ login_prompt: string;
25
+ login: string;
26
+ change_prompt: string;
27
+ code_resend: string;
28
+ code_return: string;
29
+ input_email: string;
30
+ input_password: string;
31
+ input_code: string;
32
+ input_repeat: string;
33
+ button_continue: string;
34
+ logo: string;
35
+ };
36
+ /**
37
+ * Type for customizable UI copy text.
38
+ */
39
+ type PasswordUICopy = typeof DEFAULT_COPY;
40
+ /**
41
+ * Configuration options for the PasswordUI component.
42
+ */
43
+ interface PasswordUIOptions extends Pick<PasswordConfig, "sendCode" | "validatePassword"> {
44
+ /**
45
+ * Custom text copy for UI labels, messages, and errors.
46
+ */
47
+ readonly copy?: Partial<PasswordUICopy>;
48
+ }
49
+ /**
50
+ * Creates a complete UI configuration for password-based authentication.
51
+ */
52
+ declare const PasswordUI: (options: PasswordUIOptions) => PasswordConfig;
53
+ //#endregion
54
+ export { PasswordUI, PasswordUIOptions };