@authhero/widget 0.2.2 → 0.4.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 (59) hide show
  1. package/dist/authhero-widget/authhero-widget.esm.js +1 -0
  2. package/dist/authhero-widget/index.esm.js +1 -0
  3. package/dist/authhero-widget/p-2e93c814.entry.js +1 -0
  4. package/dist/authhero-widget/p-539fc666.entry.js +1 -0
  5. package/dist/authhero-widget/p-DQuL1Twl.js +1 -0
  6. package/dist/authhero-widget/p-Doiemx6o.js +2 -0
  7. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  8. package/dist/cjs/authhero-node.cjs.entry.js +255 -0
  9. package/dist/cjs/authhero-widget.cjs.entry.js +577 -0
  10. package/dist/cjs/authhero-widget.cjs.js +25 -0
  11. package/dist/cjs/index-D0xitTOL.js +3788 -0
  12. package/dist/cjs/index.cjs.js +8123 -0
  13. package/dist/cjs/loader.cjs.js +13 -0
  14. package/dist/collection/collection-manifest.json +13 -0
  15. package/dist/collection/components/authhero-node/authhero-node.css +298 -0
  16. package/dist/collection/components/authhero-node/authhero-node.js +360 -0
  17. package/dist/collection/components/authhero-widget/authhero-widget.css +186 -0
  18. package/dist/collection/components/authhero-widget/authhero-widget.js +628 -0
  19. package/dist/collection/index.js +2 -0
  20. package/dist/collection/server/index.js +453 -0
  21. package/dist/collection/themes/index.js +71 -0
  22. package/dist/collection/types/components.js +8 -0
  23. package/dist/collection/utils/branding.js +248 -0
  24. package/dist/components/authhero-node.d.ts +11 -0
  25. package/dist/components/authhero-node.js +1 -0
  26. package/dist/components/authhero-widget.d.ts +11 -0
  27. package/dist/components/authhero-widget.js +1 -0
  28. package/dist/components/index.d.ts +35 -0
  29. package/dist/components/index.js +1 -0
  30. package/dist/components/p-086EZrPM.js +1 -0
  31. package/dist/components/p-DS6y_iDJ.js +1 -0
  32. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  33. package/dist/esm/authhero-node.entry.js +253 -0
  34. package/dist/esm/authhero-widget.entry.js +575 -0
  35. package/dist/esm/authhero-widget.js +21 -0
  36. package/dist/esm/index-Doiemx6o.js +3780 -0
  37. package/dist/esm/index.js +8122 -0
  38. package/dist/esm/loader.js +11 -0
  39. package/dist/index.cjs.js +1 -0
  40. package/dist/index.js +1 -0
  41. package/dist/types/components/authhero-node/authhero-node.d.ts +72 -0
  42. package/dist/types/components/authhero-widget/authhero-widget.d.ts +172 -0
  43. package/dist/types/components.d.ts +215 -0
  44. package/dist/types/index.d.ts +1 -0
  45. package/dist/types/server/index.d.ts +85 -0
  46. package/dist/types/stencil-public-runtime.d.ts +1839 -0
  47. package/dist/types/themes/index.d.ts +40 -0
  48. package/dist/types/types/components.d.ts +8 -0
  49. package/dist/types/utils/branding.d.ts +119 -0
  50. package/hydrate/index.d.ts +287 -0
  51. package/hydrate/index.js +23729 -0
  52. package/hydrate/index.mjs +23719 -0
  53. package/hydrate/package.json +12 -0
  54. package/loader/cdn.js +1 -0
  55. package/loader/index.cjs.js +1 -0
  56. package/loader/index.d.ts +24 -0
  57. package/loader/index.es2017.js +1 -0
  58. package/loader/index.js +2 -0
  59. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ import { b as bootstrapLazy } from './index-Doiemx6o.js';
2
+ export { s as setNonce } from './index-Doiemx6o.js';
3
+ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
+
5
+ const defineCustomElements = async (win, options) => {
6
+ if (typeof window === 'undefined') return undefined;
7
+ await globalScripts();
8
+ return bootstrapLazy([["authhero-node",[[513,"authhero-node",{"component":[16],"value":[1],"disabled":[4]}]]],["authhero-widget",[[513,"authhero-widget",{"screen":[1],"apiUrl":[1,"api-url"],"branding":[1],"theme":[1],"loading":[1028],"autoSubmit":[4,"auto-submit"],"_screen":[32],"_branding":[32],"_theme":[32],"formData":[32]},null,{"screen":[{"watchScreen":0}],"branding":[{"watchBranding":0}],"theme":[{"watchTheme":0}]}]]]], options);
9
+ };
10
+
11
+ export { defineCustomElements };
@@ -0,0 +1 @@
1
+ module.exports = require('./cjs/index.cjs.js');
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './esm/index.js';
@@ -0,0 +1,72 @@
1
+ import { EventEmitter } from "../../stencil-public-runtime";
2
+ import type { FormComponent, RuntimeComponent } from "../../types/components";
3
+ export declare class AuthheroNode {
4
+ /**
5
+ * The component configuration to render.
6
+ * Follows Auth0 Forms component schema.
7
+ */
8
+ component: FormComponent | RuntimeComponent;
9
+ /**
10
+ * Current value for field components.
11
+ */
12
+ value?: string;
13
+ /**
14
+ * Whether the component is disabled.
15
+ */
16
+ disabled: boolean;
17
+ /**
18
+ * Emitted when a field value changes.
19
+ */
20
+ fieldChange: EventEmitter<{
21
+ id: string;
22
+ value: string;
23
+ }>;
24
+ /**
25
+ * Emitted when a button is clicked.
26
+ */
27
+ buttonClick: EventEmitter<{
28
+ id: string;
29
+ type: string;
30
+ value?: string;
31
+ }>;
32
+ private handleInput;
33
+ private handleCheckbox;
34
+ private handleButtonClick;
35
+ /**
36
+ * Get error messages from the component.
37
+ */
38
+ private getErrors;
39
+ /**
40
+ * Render a label for a field.
41
+ */
42
+ private renderLabel;
43
+ /**
44
+ * Render error messages.
45
+ */
46
+ private renderErrors;
47
+ /**
48
+ * Render hint text.
49
+ */
50
+ private renderHint;
51
+ private renderDivider;
52
+ private renderHtml;
53
+ private renderImage;
54
+ private renderRichText;
55
+ private renderNextButton;
56
+ private renderPreviousButton;
57
+ private renderJumpButton;
58
+ private renderResendButton;
59
+ private renderTextField;
60
+ private renderEmailField;
61
+ private renderPasswordField;
62
+ private renderNumberField;
63
+ private renderTelField;
64
+ private renderUrlField;
65
+ private renderDateField;
66
+ private renderBooleanField;
67
+ private renderLegalField;
68
+ private renderDropdownField;
69
+ private renderChoiceField;
70
+ private renderSocialField;
71
+ render(): any;
72
+ }
@@ -0,0 +1,172 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import type { UiScreen } from '../../types/components';
3
+ import type { WidgetBranding, WidgetTheme } from '../../utils/branding';
4
+ /**
5
+ * Submit event detail - emitted when a form is submitted
6
+ */
7
+ export interface SubmitEventDetail {
8
+ /** The current screen configuration */
9
+ screen: UiScreen;
10
+ /** Form field values keyed by component ID */
11
+ data: Record<string, string>;
12
+ }
13
+ /**
14
+ * Button click event detail - emitted when a non-submit button is clicked
15
+ */
16
+ export interface ButtonClickEventDetail {
17
+ /** Component ID */
18
+ id: string;
19
+ /** Component type (e.g., 'SOCIAL', 'BACK_BUTTON') */
20
+ type: string;
21
+ /** Optional value (e.g., connection name for social buttons) */
22
+ value?: string;
23
+ }
24
+ /**
25
+ * Link click event detail - emitted when a link is clicked
26
+ */
27
+ export interface LinkClickEventDetail {
28
+ /** Link ID */
29
+ id?: string;
30
+ /** Link href */
31
+ href: string;
32
+ /** Link text */
33
+ text: string;
34
+ }
35
+ /**
36
+ * Navigate event detail - emitted when the widget wants to navigate
37
+ */
38
+ export interface NavigateEventDetail {
39
+ /** URL to navigate to */
40
+ url: string;
41
+ /** Whether to replace the current history entry */
42
+ replace?: boolean;
43
+ }
44
+ /**
45
+ * Complete event detail - emitted when auth flow completes
46
+ */
47
+ export interface CompleteEventDetail {
48
+ /** Redirect URL (contains code for authorization code flow) */
49
+ redirectUrl?: string;
50
+ }
51
+ /**
52
+ * Error event detail - emitted on errors
53
+ */
54
+ export interface ErrorEventDetail {
55
+ /** Error message */
56
+ message: string;
57
+ /** Error code */
58
+ code?: string;
59
+ }
60
+ export declare class AuthheroWidget {
61
+ el: HTMLElement;
62
+ /**
63
+ * The UI screen configuration from the server.
64
+ * Can be passed as a JSON string or object.
65
+ * Follows Auth0 Forms component schema.
66
+ */
67
+ screen?: UiScreen | string;
68
+ /**
69
+ * API endpoint to fetch the initial screen from.
70
+ * If provided, the widget will fetch the screen on load.
71
+ */
72
+ apiUrl?: string;
73
+ /**
74
+ * Branding configuration from AuthHero API.
75
+ * Controls logo, primary color, and page background.
76
+ * Can be passed as a JSON string or object.
77
+ */
78
+ branding?: WidgetBranding | string;
79
+ /**
80
+ * Theme configuration from AuthHero API.
81
+ * Controls colors, borders, fonts, and layout.
82
+ * Can be passed as a JSON string or object.
83
+ */
84
+ theme?: WidgetTheme | string;
85
+ /**
86
+ * Whether the widget is in a loading state.
87
+ */
88
+ loading: boolean;
89
+ /**
90
+ * Whether the widget should automatically submit forms to the action URL.
91
+ * When false (default), the widget only emits events and the consuming
92
+ * application handles all HTTP requests.
93
+ * When true, the widget handles form submission and screen updates.
94
+ * @default false
95
+ */
96
+ autoSubmit: boolean;
97
+ /**
98
+ * Internal parsed screen state.
99
+ */
100
+ _screen?: UiScreen;
101
+ /**
102
+ * Internal parsed branding state.
103
+ */
104
+ _branding?: WidgetBranding;
105
+ /**
106
+ * Internal parsed theme state.
107
+ */
108
+ _theme?: WidgetTheme;
109
+ /**
110
+ * Form data collected from inputs.
111
+ */
112
+ formData: Record<string, string>;
113
+ /**
114
+ * Emitted when the form is submitted.
115
+ * The consuming application should handle the submission unless autoSubmit is true.
116
+ */
117
+ formSubmit: EventEmitter<SubmitEventDetail>;
118
+ /**
119
+ * Emitted when a non-submit button is clicked (social login, back, etc.).
120
+ * The consuming application decides what to do based on id/type/value.
121
+ */
122
+ buttonClick: EventEmitter<ButtonClickEventDetail>;
123
+ /**
124
+ * Emitted when a link is clicked.
125
+ * The consuming application decides how to handle navigation.
126
+ */
127
+ linkClick: EventEmitter<LinkClickEventDetail>;
128
+ /**
129
+ * Emitted when the widget wants to navigate (e.g., after successful auth).
130
+ * The consuming application decides how to handle navigation.
131
+ */
132
+ navigate: EventEmitter<NavigateEventDetail>;
133
+ /**
134
+ * Emitted when auth flow completes with a redirect URL.
135
+ * The consuming application can redirect or extract the code.
136
+ */
137
+ flowComplete: EventEmitter<CompleteEventDetail>;
138
+ /**
139
+ * Emitted when an error occurs.
140
+ */
141
+ flowError: EventEmitter<ErrorEventDetail>;
142
+ /**
143
+ * Emitted when the screen changes.
144
+ */
145
+ screenChange: EventEmitter<UiScreen>;
146
+ watchScreen(newValue: UiScreen | string | undefined): void;
147
+ watchBranding(newValue: WidgetBranding | string | undefined): void;
148
+ watchTheme(newValue: WidgetTheme | string | undefined): void;
149
+ /**
150
+ * Apply branding and theme as CSS custom properties
151
+ */
152
+ private applyThemeStyles;
153
+ componentWillLoad(): Promise<void>;
154
+ private fetchScreen;
155
+ private handleInputChange;
156
+ private handleSubmit;
157
+ private handleButtonClick;
158
+ private handleLinkClick;
159
+ /**
160
+ * Get error messages from the screen-level messages array.
161
+ */
162
+ private getScreenErrors;
163
+ /**
164
+ * Get success messages from the screen-level messages array.
165
+ */
166
+ private getScreenSuccesses;
167
+ /**
168
+ * Sort components by order.
169
+ */
170
+ private getOrderedComponents;
171
+ render(): any;
172
+ }
@@ -0,0 +1,215 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ /**
4
+ * This is an autogenerated file created by the Stencil compiler.
5
+ * It contains typing information for all components that exist in this project.
6
+ */
7
+ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { FormComponent, RuntimeComponent, UiScreen } from "./types/components";
9
+ import { WidgetBranding, WidgetTheme } from "./utils/branding";
10
+ import { ButtonClickEventDetail, CompleteEventDetail, ErrorEventDetail, LinkClickEventDetail, NavigateEventDetail, SubmitEventDetail } from "./components/authhero-widget/authhero-widget";
11
+ export { FormComponent, RuntimeComponent, UiScreen } from "./types/components";
12
+ export { WidgetBranding, WidgetTheme } from "./utils/branding";
13
+ export { ButtonClickEventDetail, CompleteEventDetail, ErrorEventDetail, LinkClickEventDetail, NavigateEventDetail, SubmitEventDetail } from "./components/authhero-widget/authhero-widget";
14
+ export namespace Components {
15
+ interface AuthheroNode {
16
+ /**
17
+ * The component configuration to render. Follows Auth0 Forms component schema.
18
+ */
19
+ "component": FormComponent | RuntimeComponent;
20
+ /**
21
+ * Whether the component is disabled.
22
+ * @default false
23
+ */
24
+ "disabled": boolean;
25
+ /**
26
+ * Current value for field components.
27
+ */
28
+ "value"?: string;
29
+ }
30
+ interface AuthheroWidget {
31
+ /**
32
+ * API endpoint to fetch the initial screen from. If provided, the widget will fetch the screen on load.
33
+ */
34
+ "apiUrl"?: string;
35
+ /**
36
+ * Whether the widget should automatically submit forms to the action URL. When false (default), the widget only emits events and the consuming application handles all HTTP requests. When true, the widget handles form submission and screen updates.
37
+ * @default false
38
+ */
39
+ "autoSubmit": boolean;
40
+ /**
41
+ * Branding configuration from AuthHero API. Controls logo, primary color, and page background. Can be passed as a JSON string or object.
42
+ */
43
+ "branding"?: WidgetBranding | string;
44
+ /**
45
+ * Whether the widget is in a loading state.
46
+ * @default false
47
+ */
48
+ "loading": boolean;
49
+ /**
50
+ * The UI screen configuration from the server. Can be passed as a JSON string or object. Follows Auth0 Forms component schema.
51
+ */
52
+ "screen"?: UiScreen | string;
53
+ /**
54
+ * Theme configuration from AuthHero API. Controls colors, borders, fonts, and layout. Can be passed as a JSON string or object.
55
+ */
56
+ "theme"?: WidgetTheme | string;
57
+ }
58
+ }
59
+ export interface AuthheroNodeCustomEvent<T> extends CustomEvent<T> {
60
+ detail: T;
61
+ target: HTMLAuthheroNodeElement;
62
+ }
63
+ export interface AuthheroWidgetCustomEvent<T> extends CustomEvent<T> {
64
+ detail: T;
65
+ target: HTMLAuthheroWidgetElement;
66
+ }
67
+ declare global {
68
+ interface HTMLAuthheroNodeElementEventMap {
69
+ "fieldChange": { id: string; value: string };
70
+ "buttonClick": {
71
+ id: string;
72
+ type: string;
73
+ value?: string;
74
+ };
75
+ }
76
+ interface HTMLAuthheroNodeElement extends Components.AuthheroNode, HTMLStencilElement {
77
+ addEventListener<K extends keyof HTMLAuthheroNodeElementEventMap>(type: K, listener: (this: HTMLAuthheroNodeElement, ev: AuthheroNodeCustomEvent<HTMLAuthheroNodeElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
78
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
79
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
80
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
81
+ removeEventListener<K extends keyof HTMLAuthheroNodeElementEventMap>(type: K, listener: (this: HTMLAuthheroNodeElement, ev: AuthheroNodeCustomEvent<HTMLAuthheroNodeElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
82
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
83
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
84
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
85
+ }
86
+ var HTMLAuthheroNodeElement: {
87
+ prototype: HTMLAuthheroNodeElement;
88
+ new (): HTMLAuthheroNodeElement;
89
+ };
90
+ interface HTMLAuthheroWidgetElementEventMap {
91
+ "formSubmit": SubmitEventDetail;
92
+ "buttonClick": ButtonClickEventDetail;
93
+ "linkClick": LinkClickEventDetail;
94
+ "navigate": NavigateEventDetail;
95
+ "flowComplete": CompleteEventDetail;
96
+ "flowError": ErrorEventDetail;
97
+ "screenChange": UiScreen;
98
+ }
99
+ interface HTMLAuthheroWidgetElement extends Components.AuthheroWidget, HTMLStencilElement {
100
+ addEventListener<K extends keyof HTMLAuthheroWidgetElementEventMap>(type: K, listener: (this: HTMLAuthheroWidgetElement, ev: AuthheroWidgetCustomEvent<HTMLAuthheroWidgetElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
101
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
102
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
103
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
104
+ removeEventListener<K extends keyof HTMLAuthheroWidgetElementEventMap>(type: K, listener: (this: HTMLAuthheroWidgetElement, ev: AuthheroWidgetCustomEvent<HTMLAuthheroWidgetElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
105
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
106
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
107
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
108
+ }
109
+ var HTMLAuthheroWidgetElement: {
110
+ prototype: HTMLAuthheroWidgetElement;
111
+ new (): HTMLAuthheroWidgetElement;
112
+ };
113
+ interface HTMLElementTagNameMap {
114
+ "authhero-node": HTMLAuthheroNodeElement;
115
+ "authhero-widget": HTMLAuthheroWidgetElement;
116
+ }
117
+ }
118
+ declare namespace LocalJSX {
119
+ interface AuthheroNode {
120
+ /**
121
+ * The component configuration to render. Follows Auth0 Forms component schema.
122
+ */
123
+ "component": FormComponent | RuntimeComponent;
124
+ /**
125
+ * Whether the component is disabled.
126
+ * @default false
127
+ */
128
+ "disabled"?: boolean;
129
+ /**
130
+ * Emitted when a button is clicked.
131
+ */
132
+ "onButtonClick"?: (event: AuthheroNodeCustomEvent<{
133
+ id: string;
134
+ type: string;
135
+ value?: string;
136
+ }>) => void;
137
+ /**
138
+ * Emitted when a field value changes.
139
+ */
140
+ "onFieldChange"?: (event: AuthheroNodeCustomEvent<{ id: string; value: string }>) => void;
141
+ /**
142
+ * Current value for field components.
143
+ */
144
+ "value"?: string;
145
+ }
146
+ interface AuthheroWidget {
147
+ /**
148
+ * API endpoint to fetch the initial screen from. If provided, the widget will fetch the screen on load.
149
+ */
150
+ "apiUrl"?: string;
151
+ /**
152
+ * Whether the widget should automatically submit forms to the action URL. When false (default), the widget only emits events and the consuming application handles all HTTP requests. When true, the widget handles form submission and screen updates.
153
+ * @default false
154
+ */
155
+ "autoSubmit"?: boolean;
156
+ /**
157
+ * Branding configuration from AuthHero API. Controls logo, primary color, and page background. Can be passed as a JSON string or object.
158
+ */
159
+ "branding"?: WidgetBranding | string;
160
+ /**
161
+ * Whether the widget is in a loading state.
162
+ * @default false
163
+ */
164
+ "loading"?: boolean;
165
+ /**
166
+ * Emitted when a non-submit button is clicked (social login, back, etc.). The consuming application decides what to do based on id/type/value.
167
+ */
168
+ "onButtonClick"?: (event: AuthheroWidgetCustomEvent<ButtonClickEventDetail>) => void;
169
+ /**
170
+ * Emitted when auth flow completes with a redirect URL. The consuming application can redirect or extract the code.
171
+ */
172
+ "onFlowComplete"?: (event: AuthheroWidgetCustomEvent<CompleteEventDetail>) => void;
173
+ /**
174
+ * Emitted when an error occurs.
175
+ */
176
+ "onFlowError"?: (event: AuthheroWidgetCustomEvent<ErrorEventDetail>) => void;
177
+ /**
178
+ * Emitted when the form is submitted. The consuming application should handle the submission unless autoSubmit is true.
179
+ */
180
+ "onFormSubmit"?: (event: AuthheroWidgetCustomEvent<SubmitEventDetail>) => void;
181
+ /**
182
+ * Emitted when a link is clicked. The consuming application decides how to handle navigation.
183
+ */
184
+ "onLinkClick"?: (event: AuthheroWidgetCustomEvent<LinkClickEventDetail>) => void;
185
+ /**
186
+ * Emitted when the widget wants to navigate (e.g., after successful auth). The consuming application decides how to handle navigation.
187
+ */
188
+ "onNavigate"?: (event: AuthheroWidgetCustomEvent<NavigateEventDetail>) => void;
189
+ /**
190
+ * Emitted when the screen changes.
191
+ */
192
+ "onScreenChange"?: (event: AuthheroWidgetCustomEvent<UiScreen>) => void;
193
+ /**
194
+ * The UI screen configuration from the server. Can be passed as a JSON string or object. Follows Auth0 Forms component schema.
195
+ */
196
+ "screen"?: UiScreen | string;
197
+ /**
198
+ * Theme configuration from AuthHero API. Controls colors, borders, fonts, and layout. Can be passed as a JSON string or object.
199
+ */
200
+ "theme"?: WidgetTheme | string;
201
+ }
202
+ interface IntrinsicElements {
203
+ "authhero-node": AuthheroNode;
204
+ "authhero-widget": AuthheroWidget;
205
+ }
206
+ }
207
+ export { LocalJSX as JSX };
208
+ declare module "@stencil/core" {
209
+ export namespace JSX {
210
+ interface IntrinsicElements {
211
+ "authhero-node": LocalJSX.AuthheroNode & JSXBase.HTMLAttributes<HTMLAuthheroNodeElement>;
212
+ "authhero-widget": LocalJSX.AuthheroWidget & JSXBase.HTMLAttributes<HTMLAuthheroWidgetElement>;
213
+ }
214
+ }
215
+ }
@@ -0,0 +1 @@
1
+ export * from './types/components';
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Hono SSR Helper for AuthHero Widget
3
+ *
4
+ * This module provides utilities for server-side rendering
5
+ * the AuthHero widget in Hono applications.
6
+ */
7
+ import type { UiScreen, FormComponent, ScreenLink, ComponentMessage } from "../types/components";
8
+ export type { UiScreen, FormComponent, ScreenLink, ComponentMessage };
9
+ type ScreenBranding = {
10
+ logo_url?: string;
11
+ primaryColor?: string;
12
+ backgroundColor?: string;
13
+ };
14
+ /**
15
+ * Creates a basic login screen configuration using the new UiScreen format.
16
+ */
17
+ export declare function createLoginScreen(options: {
18
+ action: string;
19
+ title?: string;
20
+ showSocialProviders?: string[];
21
+ showForgotPassword?: boolean;
22
+ showSignUp?: boolean;
23
+ branding?: ScreenBranding;
24
+ }): UiScreen;
25
+ /**
26
+ * Creates an identifier-first screen (email first, then password or social)
27
+ */
28
+ export declare function createIdentifierScreen(options: {
29
+ action: string;
30
+ title?: string;
31
+ tenantName?: string;
32
+ logoUrl?: string;
33
+ showSocialProviders?: string[];
34
+ showSignUp?: boolean;
35
+ signUpUrl?: string;
36
+ branding?: ScreenBranding;
37
+ }): UiScreen;
38
+ /**
39
+ * Creates a registration screen configuration
40
+ */
41
+ export declare function createSignupScreen(options: {
42
+ action: string;
43
+ title?: string;
44
+ fields?: Array<{
45
+ name: string;
46
+ type?: "email" | "password" | "text" | "tel" | "url" | "number" | "date";
47
+ label: string;
48
+ required?: boolean;
49
+ placeholder?: string;
50
+ }>;
51
+ showSocialProviders?: string[];
52
+ showLogin?: boolean;
53
+ branding?: ScreenBranding;
54
+ }): UiScreen;
55
+ /**
56
+ * Creates an MFA verification screen
57
+ */
58
+ export declare function createMfaScreen(options: {
59
+ action: string;
60
+ title?: string;
61
+ codeLength?: number;
62
+ method?: "totp" | "sms" | "email";
63
+ branding?: ScreenBranding;
64
+ }): UiScreen;
65
+ /**
66
+ * Creates a password reset request screen
67
+ */
68
+ export declare function createForgotPasswordScreen(options: {
69
+ action: string;
70
+ title?: string;
71
+ branding?: ScreenBranding;
72
+ }): UiScreen;
73
+ /**
74
+ * Adds an error message to a screen
75
+ */
76
+ export declare function withError(screen: UiScreen, error: string): UiScreen;
77
+ /**
78
+ * Adds a success message to a screen
79
+ */
80
+ export declare function withSuccess(screen: UiScreen, success: string): UiScreen;
81
+ /**
82
+ * Adds a field-level error to a specific component.
83
+ * Recursively searches nested components/children.
84
+ */
85
+ export declare function withFieldError(screen: UiScreen, componentId: string, error: string): UiScreen;