@authhero/widget 0.2.2 → 0.4.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 (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 +2 -2
@@ -0,0 +1,360 @@
1
+ import { h } from "@stencil/core";
2
+ export class AuthheroNode {
3
+ /**
4
+ * The component configuration to render.
5
+ * Follows Auth0 Forms component schema.
6
+ */
7
+ component;
8
+ /**
9
+ * Current value for field components.
10
+ */
11
+ value;
12
+ /**
13
+ * Whether the component is disabled.
14
+ */
15
+ disabled = false;
16
+ /**
17
+ * Emitted when a field value changes.
18
+ */
19
+ fieldChange;
20
+ /**
21
+ * Emitted when a button is clicked.
22
+ */
23
+ buttonClick;
24
+ handleInput = (e) => {
25
+ const target = e.target;
26
+ this.fieldChange.emit({ id: this.component.id, value: target.value });
27
+ };
28
+ handleCheckbox = (e) => {
29
+ const target = e.target;
30
+ this.fieldChange.emit({
31
+ id: this.component.id,
32
+ value: target.checked ? "true" : "false",
33
+ });
34
+ };
35
+ handleButtonClick = (e, type, value) => {
36
+ if (type !== "submit") {
37
+ e.preventDefault();
38
+ }
39
+ this.buttonClick.emit({ id: this.component.id, type, value });
40
+ };
41
+ /**
42
+ * Get error messages from the component.
43
+ */
44
+ getErrors() {
45
+ const runtimeComp = this.component;
46
+ return (runtimeComp.messages?.filter((m) => m.type === "error") || []);
47
+ }
48
+ /**
49
+ * Render a label for a field.
50
+ */
51
+ renderLabel(text, inputId, required) {
52
+ if (!text)
53
+ return null;
54
+ return (h("label", { class: "input-label", part: "label", htmlFor: inputId }, text, required && h("span", { class: "required" }, "*")));
55
+ }
56
+ /**
57
+ * Render error messages.
58
+ */
59
+ renderErrors() {
60
+ const errors = this.getErrors();
61
+ return errors.map((err) => (h("span", { class: "error-text", part: "error-text", key: err.id ?? err.text }, err.text)));
62
+ }
63
+ /**
64
+ * Render hint text.
65
+ */
66
+ renderHint(hint) {
67
+ if (!hint)
68
+ return null;
69
+ return (h("span", { class: "helper-text", part: "helper-text" }, hint));
70
+ }
71
+ // ===========================================================================
72
+ // BLOCK Component Renderers
73
+ // ===========================================================================
74
+ renderDivider() {
75
+ return h("hr", { class: "divider", part: "divider" });
76
+ }
77
+ renderHtml(component) {
78
+ return (h("div", { class: "html-content", part: "html-content", innerHTML: component.config?.content ?? "" }));
79
+ }
80
+ renderImage(component) {
81
+ const { src, alt, width, height } = component.config ?? {};
82
+ if (!src)
83
+ return null;
84
+ return (h("img", { class: "image", part: "image", src: src, alt: alt ?? "", width: width, height: height, loading: "lazy" }));
85
+ }
86
+ renderRichText(component) {
87
+ return (h("div", { class: "rich-text", part: "rich-text", innerHTML: component.config?.content ?? "" }));
88
+ }
89
+ renderNextButton(component) {
90
+ return (h("button", { type: "submit", class: "btn btn-primary", part: "button button-primary", disabled: this.disabled, onClick: (e) => this.handleButtonClick(e, "submit", "next") }, component.config.text ?? "Continue"));
91
+ }
92
+ renderPreviousButton(component) {
93
+ return (h("button", { type: "button", class: "btn btn-secondary", part: "button button-secondary", disabled: this.disabled, onClick: (e) => this.handleButtonClick(e, "previous", "back") }, component.config.text ?? "Back"));
94
+ }
95
+ renderJumpButton(component) {
96
+ return (h("button", { type: "button", class: "btn btn-link", part: "button button-link", disabled: this.disabled, onClick: (e) => this.handleButtonClick(e, "jump", component.config.target_step) }, component.config.text ?? "Go"));
97
+ }
98
+ renderResendButton(component) {
99
+ return (h("button", { type: "button", class: "btn btn-link", part: "button button-link", disabled: this.disabled, onClick: (e) => this.handleButtonClick(e, "resend", component.config.resend_action) }, component.config.text ?? "Resend"));
100
+ }
101
+ // ===========================================================================
102
+ // FIELD Component Renderers
103
+ // ===========================================================================
104
+ renderTextField(component) {
105
+ const inputId = `input-${component.id}`;
106
+ const errors = this.getErrors();
107
+ const { placeholder, multiline, max_length } = component.config ?? {};
108
+ if (multiline) {
109
+ return (h("div", { class: "input-wrapper", part: "input-wrapper" }, this.renderLabel(component.label, inputId, component.required), h("textarea", { id: inputId, class: { "input-field": true, "has-error": errors.length > 0 }, part: "input textarea", name: component.id, placeholder: placeholder, required: component.required, disabled: this.disabled, maxLength: max_length, onInput: this.handleInput }, this.value ?? ""), this.renderErrors(), errors.length === 0 && this.renderHint(component.hint)));
110
+ }
111
+ return (h("div", { class: "input-wrapper", part: "input-wrapper" }, this.renderLabel(component.label, inputId, component.required), h("input", { id: inputId, class: { "input-field": true, "has-error": errors.length > 0 }, part: "input", type: component.sensitive ? "password" : "text", name: component.id, value: this.value ?? "", placeholder: placeholder, required: component.required, disabled: this.disabled, maxLength: max_length, onInput: this.handleInput }), this.renderErrors(), errors.length === 0 && this.renderHint(component.hint)));
112
+ }
113
+ renderEmailField(component) {
114
+ const inputId = `input-${component.id}`;
115
+ const errors = this.getErrors();
116
+ return (h("div", { class: "input-wrapper", part: "input-wrapper" }, this.renderLabel(component.label, inputId, component.required), h("input", { id: inputId, class: { "input-field": true, "has-error": errors.length > 0 }, part: "input", type: "email", name: component.id, value: this.value ?? "", placeholder: component.config?.placeholder, required: component.required, disabled: this.disabled, autocomplete: "email", onInput: this.handleInput }), this.renderErrors(), errors.length === 0 && this.renderHint(component.hint)));
117
+ }
118
+ renderPasswordField(component) {
119
+ const inputId = `input-${component.id}`;
120
+ const errors = this.getErrors();
121
+ return (h("div", { class: "input-wrapper", part: "input-wrapper" }, this.renderLabel(component.label, inputId, component.required), h("input", { id: inputId, class: { "input-field": true, "has-error": errors.length > 0 }, part: "input", type: "password", name: component.id, value: this.value ?? "", placeholder: component.config?.placeholder, required: component.required, disabled: this.disabled, minLength: component.config?.min_length, autocomplete: "current-password", onInput: this.handleInput }), this.renderErrors(), errors.length === 0 && this.renderHint(component.hint)));
122
+ }
123
+ renderNumberField(component) {
124
+ const inputId = `input-${component.id}`;
125
+ const errors = this.getErrors();
126
+ const { placeholder, min, max, step } = component.config ?? {};
127
+ return (h("div", { class: "input-wrapper", part: "input-wrapper" }, this.renderLabel(component.label, inputId, component.required), h("input", { id: inputId, class: { "input-field": true, "has-error": errors.length > 0 }, part: "input", type: "number", name: component.id, value: this.value ?? "", placeholder: placeholder, required: component.required, disabled: this.disabled, min: min, max: max, step: step, onInput: this.handleInput }), this.renderErrors(), errors.length === 0 && this.renderHint(component.hint)));
128
+ }
129
+ renderTelField(component) {
130
+ const inputId = `input-${component.id}`;
131
+ const errors = this.getErrors();
132
+ return (h("div", { class: "input-wrapper", part: "input-wrapper" }, this.renderLabel(component.label, inputId, component.required), h("input", { id: inputId, class: { "input-field": true, "has-error": errors.length > 0 }, part: "input", type: "tel", name: component.id, value: this.value ?? "", placeholder: component.config?.placeholder, required: component.required, disabled: this.disabled, autocomplete: "tel", onInput: this.handleInput }), this.renderErrors(), errors.length === 0 && this.renderHint(component.hint)));
133
+ }
134
+ renderUrlField(component) {
135
+ const inputId = `input-${component.id}`;
136
+ const errors = this.getErrors();
137
+ return (h("div", { class: "input-wrapper", part: "input-wrapper" }, this.renderLabel(component.label, inputId, component.required), h("input", { id: inputId, class: { "input-field": true, "has-error": errors.length > 0 }, part: "input", type: "url", name: component.id, value: this.value ?? "", placeholder: component.config?.placeholder, required: component.required, disabled: this.disabled, onInput: this.handleInput }), this.renderErrors(), errors.length === 0 && this.renderHint(component.hint)));
138
+ }
139
+ renderDateField(component) {
140
+ const inputId = `input-${component.id}`;
141
+ const errors = this.getErrors();
142
+ const { min, max } = component.config ?? {};
143
+ return (h("div", { class: "input-wrapper", part: "input-wrapper" }, this.renderLabel(component.label, inputId, component.required), h("input", { id: inputId, class: { "input-field": true, "has-error": errors.length > 0 }, part: "input", type: "date", name: component.id, value: this.value ?? "", required: component.required, disabled: this.disabled, min: min, max: max, onInput: this.handleInput }), this.renderErrors(), errors.length === 0 && this.renderHint(component.hint)));
144
+ }
145
+ renderBooleanField(component) {
146
+ return (h("label", { class: "checkbox-wrapper", part: "checkbox-wrapper" }, h("input", { type: "checkbox", part: "checkbox", name: component.id, checked: this.value === "true" || component.config?.default_value === true, required: component.required, disabled: this.disabled, onChange: this.handleCheckbox }), h("span", { class: "checkbox-label", part: "checkbox-label" }, component.label)));
147
+ }
148
+ renderLegalField(component) {
149
+ const text = component.config?.text ?? component.label ?? "";
150
+ const isHtml = component.config?.html === true;
151
+ return (h("label", { class: "checkbox-wrapper", part: "checkbox-wrapper" }, h("input", { type: "checkbox", part: "checkbox", name: component.id, checked: this.value === "true", required: component.required, disabled: this.disabled, onChange: this.handleCheckbox }), isHtml ? (h("span", { class: "checkbox-label", part: "checkbox-label", innerHTML: text })) : (h("span", { class: "checkbox-label", part: "checkbox-label" }, text))));
152
+ }
153
+ renderDropdownField(component) {
154
+ const inputId = `input-${component.id}`;
155
+ const errors = this.getErrors();
156
+ const { options, placeholder } = component.config ?? {};
157
+ return (h("div", { class: "input-wrapper", part: "input-wrapper" }, this.renderLabel(component.label, inputId, component.required), h("select", { id: inputId, class: { "input-field": true, "has-error": errors.length > 0 }, part: "input select", name: component.id, required: component.required, disabled: this.disabled, onChange: this.handleInput }, placeholder && (h("option", { value: "", disabled: true, selected: !this.value }, placeholder)), options?.map((opt) => (h("option", { value: opt.value, selected: this.value === opt.value, key: opt.value }, opt.label)))), this.renderErrors(), errors.length === 0 && this.renderHint(component.hint)));
158
+ }
159
+ renderChoiceField(component) {
160
+ const errors = this.getErrors();
161
+ const { options, display } = component.config ?? {};
162
+ const isCheckbox = display === "checkbox";
163
+ const inputType = isCheckbox ? "checkbox" : "radio";
164
+ return (h("div", { class: "choice-wrapper", part: "choice-wrapper" }, component.label && (h("span", { class: "choice-label", part: "choice-label" }, component.label, component.required && h("span", { class: "required" }, "*"))), h("div", { class: "choice-options", part: "choice-options" }, options?.map((opt) => (h("label", { class: "choice-option", part: "choice-option", key: opt.value }, h("input", { type: inputType, part: inputType, name: component.id, value: opt.value, checked: this.value === opt.value, required: component.required && !isCheckbox, disabled: this.disabled, onChange: this.handleInput }), h("span", null, opt.label))))), this.renderErrors(), errors.length === 0 && this.renderHint(component.hint)));
165
+ }
166
+ renderSocialField(component) {
167
+ const providers = component.config?.providers ?? [];
168
+ return (h("div", { class: "social-buttons", part: "social-buttons" }, providers.map((provider) => (h("button", { type: "button", class: "btn btn-secondary btn-social", part: "button button-secondary button-social", "data-provider": provider, disabled: this.disabled, onClick: (e) => this.handleButtonClick(e, "social", provider), key: provider }, "Continue with ", provider.charAt(0).toUpperCase() + provider.slice(1))))));
169
+ }
170
+ // ===========================================================================
171
+ // Main Render
172
+ // ===========================================================================
173
+ render() {
174
+ if (!this.component) {
175
+ return null;
176
+ }
177
+ // Hidden components
178
+ if (this.component.visible === false) {
179
+ return null;
180
+ }
181
+ switch (this.component.type) {
182
+ // BLOCK components
183
+ case "DIVIDER":
184
+ return this.renderDivider();
185
+ case "HTML":
186
+ return this.renderHtml(this.component);
187
+ case "IMAGE":
188
+ return this.renderImage(this.component);
189
+ case "RICH_TEXT":
190
+ return this.renderRichText(this.component);
191
+ case "NEXT_BUTTON":
192
+ return this.renderNextButton(this.component);
193
+ case "PREVIOUS_BUTTON":
194
+ return this.renderPreviousButton(this.component);
195
+ case "JUMP_BUTTON":
196
+ return this.renderJumpButton(this.component);
197
+ case "RESEND_BUTTON":
198
+ return this.renderResendButton(this.component);
199
+ // FIELD components
200
+ case "TEXT":
201
+ return this.renderTextField(this.component);
202
+ case "EMAIL":
203
+ return this.renderEmailField(this.component);
204
+ case "PASSWORD":
205
+ return this.renderPasswordField(this.component);
206
+ case "NUMBER":
207
+ return this.renderNumberField(this.component);
208
+ case "TEL":
209
+ return this.renderTelField(this.component);
210
+ case "URL":
211
+ return this.renderUrlField(this.component);
212
+ case "DATE":
213
+ return this.renderDateField(this.component);
214
+ case "BOOLEAN":
215
+ return this.renderBooleanField(this.component);
216
+ case "LEGAL":
217
+ return this.renderLegalField(this.component);
218
+ case "DROPDOWN":
219
+ return this.renderDropdownField(this.component);
220
+ case "CHOICE":
221
+ return this.renderChoiceField(this.component);
222
+ case "SOCIAL":
223
+ return this.renderSocialField(this.component);
224
+ // WIDGET components (not yet implemented)
225
+ case "AUTH0_VERIFIABLE_CREDENTIALS":
226
+ case "GMAPS_ADDRESS":
227
+ case "RECAPTCHA":
228
+ console.warn(`Widget component "${this.component.type}" not yet implemented`);
229
+ return null;
230
+ // Other FIELD components (not yet implemented)
231
+ case "CARDS":
232
+ case "CUSTOM":
233
+ case "FILE":
234
+ case "PAYMENT":
235
+ console.warn(`Component "${this.component.type}" not yet implemented`);
236
+ return null;
237
+ default:
238
+ console.warn(`Unknown component type: ${this.component.type}`);
239
+ return null;
240
+ }
241
+ }
242
+ static get is() { return "authhero-node"; }
243
+ static get encapsulation() { return "shadow"; }
244
+ static get originalStyleUrls() {
245
+ return {
246
+ "$": ["authhero-node.css"]
247
+ };
248
+ }
249
+ static get styleUrls() {
250
+ return {
251
+ "$": ["authhero-node.css"]
252
+ };
253
+ }
254
+ static get properties() {
255
+ return {
256
+ "component": {
257
+ "type": "unknown",
258
+ "mutable": false,
259
+ "complexType": {
260
+ "original": "FormComponent | RuntimeComponent",
261
+ "resolved": "{ type: \"AUTH0_VERIFIABLE_CREDENTIALS\"; id: string; config: { credential_type?: string | undefined; }; visible: boolean; required?: boolean | undefined; category?: \"WIDGET\" | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"AUTH0_VERIFIABLE_CREDENTIALS\"; id: string; config: { credential_type?: string | undefined; }; visible: boolean; required?: boolean | undefined; category?: \"WIDGET\" | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"BOOLEAN\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { default_value?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"BOOLEAN\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { default_value?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"CARDS\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { options?: { value: string; label: string; description?: string | undefined; image?: string | undefined; }[] | undefined; multi_select?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"CARDS\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { options?: { value: string; label: string; description?: string | undefined; image?: string | undefined; }[] | undefined; multi_select?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"CHOICE\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { options?: { value: string; label: string; }[] | undefined; display?: \"radio\" | \"checkbox\" | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"CHOICE\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { options?: { value: string; label: string; }[] | undefined; display?: \"radio\" | \"checkbox\" | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"CUSTOM\"; id: string; config: { component?: string | undefined; props?: Record<string, any> | undefined; }; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"CUSTOM\"; id: string; config: { component?: string | undefined; props?: Record<string, any> | undefined; }; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"DATE\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { format?: string | undefined; min?: string | undefined; max?: string | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"DATE\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { format?: string | undefined; min?: string | undefined; max?: string | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"DIVIDER\"; id: string; visible: boolean; category?: \"BLOCK\" | undefined; config?: {} | undefined; order?: number | undefined; } | { type: \"DIVIDER\"; id: string; visible: boolean; category?: \"BLOCK\" | undefined; config?: {} | undefined; order?: number | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"DROPDOWN\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { options?: { value: string; label: string; }[] | undefined; placeholder?: string | undefined; searchable?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"DROPDOWN\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { options?: { value: string; label: string; }[] | undefined; placeholder?: string | undefined; searchable?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"EMAIL\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"EMAIL\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"FILE\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { accept?: string | undefined; max_size?: number | undefined; multiple?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"FILE\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { accept?: string | undefined; max_size?: number | undefined; multiple?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"GMAPS_ADDRESS\"; id: string; config: { api_key?: string | undefined; }; visible: boolean; required?: boolean | undefined; category?: \"WIDGET\" | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"GMAPS_ADDRESS\"; id: string; config: { api_key?: string | undefined; }; visible: boolean; required?: boolean | undefined; category?: \"WIDGET\" | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"HTML\"; id: string; visible: boolean; category?: \"BLOCK\" | undefined; config?: { content?: string | undefined; } | undefined; order?: number | undefined; } | { type: \"HTML\"; id: string; visible: boolean; category?: \"BLOCK\" | undefined; config?: { content?: string | undefined; } | undefined; order?: number | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"IMAGE\"; id: string; visible: boolean; category?: \"BLOCK\" | undefined; config?: { src?: string | undefined; alt?: string | undefined; width?: number | undefined; height?: number | undefined; } | undefined; order?: number | undefined; } | { type: \"IMAGE\"; id: string; visible: boolean; category?: \"BLOCK\" | undefined; config?: { src?: string | undefined; alt?: string | undefined; width?: number | undefined; height?: number | undefined; } | undefined; order?: number | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"JUMP_BUTTON\"; id: string; config: { text?: string | undefined; target_step?: string | undefined; }; visible: boolean; category?: \"BLOCK\" | undefined; order?: number | undefined; } | { type: \"JUMP_BUTTON\"; id: string; config: { text?: string | undefined; target_step?: string | undefined; }; visible: boolean; category?: \"BLOCK\" | undefined; order?: number | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"LEGAL\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { text: string; html?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"LEGAL\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { text: string; html?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"NEXT_BUTTON\"; id: string; config: { text?: string | undefined; }; visible: boolean; category?: \"BLOCK\" | undefined; order?: number | undefined; } | { type: \"NEXT_BUTTON\"; id: string; config: { text?: string | undefined; }; visible: boolean; category?: \"BLOCK\" | undefined; order?: number | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"NUMBER\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; min?: number | undefined; max?: number | undefined; step?: number | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"NUMBER\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; min?: number | undefined; max?: number | undefined; step?: number | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"PASSWORD\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; min_length?: number | undefined; show_toggle?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"PASSWORD\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; min_length?: number | undefined; show_toggle?: boolean | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"PAYMENT\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { provider?: string | undefined; currency?: string | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"PAYMENT\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { provider?: string | undefined; currency?: string | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"PREVIOUS_BUTTON\"; id: string; config: { text?: string | undefined; }; visible: boolean; category?: \"BLOCK\" | undefined; order?: number | undefined; } | { type: \"PREVIOUS_BUTTON\"; id: string; config: { text?: string | undefined; }; visible: boolean; category?: \"BLOCK\" | undefined; order?: number | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"RECAPTCHA\"; id: string; config: { site_key?: string | undefined; }; visible: boolean; required?: boolean | undefined; category?: \"WIDGET\" | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"RECAPTCHA\"; id: string; config: { site_key?: string | undefined; }; visible: boolean; required?: boolean | undefined; category?: \"WIDGET\" | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"RESEND_BUTTON\"; id: string; config: { text?: string | undefined; resend_action?: string | undefined; }; visible: boolean; category?: \"BLOCK\" | undefined; order?: number | undefined; } | { type: \"RESEND_BUTTON\"; id: string; config: { text?: string | undefined; resend_action?: string | undefined; }; visible: boolean; category?: \"BLOCK\" | undefined; order?: number | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"RICH_TEXT\"; id: string; visible: boolean; category?: \"BLOCK\" | undefined; config?: { content?: string | undefined; } | undefined; order?: number | undefined; } | { type: \"RICH_TEXT\"; id: string; visible: boolean; category?: \"BLOCK\" | undefined; config?: { content?: string | undefined; } | undefined; order?: number | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"SOCIAL\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { providers?: string[] | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"SOCIAL\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { providers?: string[] | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"TEL\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; default_country?: string | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"TEL\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; default_country?: string | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"TEXT\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; multiline?: boolean | undefined; max_length?: number | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"TEXT\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; multiline?: boolean | undefined; max_length?: number | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; } | { type: \"URL\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } | { type: \"URL\"; id: string; visible: boolean; required?: boolean | undefined; category?: \"FIELD\" | undefined; config?: { placeholder?: string | undefined; } | undefined; sensitive?: boolean | undefined; label?: string | undefined; order?: number | undefined; hint?: string | undefined; } & { messages?: { type: \"info\" | \"error\" | \"success\" | \"warning\"; text: string; id?: number | undefined; }[] | undefined; }",
262
+ "references": {
263
+ "FormComponent": {
264
+ "location": "import",
265
+ "path": "../../types/components",
266
+ "id": "src/types/components.ts::FormNodeComponent",
267
+ "referenceLocation": "FormComponent"
268
+ },
269
+ "RuntimeComponent": {
270
+ "location": "import",
271
+ "path": "../../types/components",
272
+ "id": "src/types/components.ts::RuntimeComponent",
273
+ "referenceLocation": "RuntimeComponent"
274
+ }
275
+ }
276
+ },
277
+ "required": true,
278
+ "optional": false,
279
+ "docs": {
280
+ "tags": [],
281
+ "text": "The component configuration to render.\nFollows Auth0 Forms component schema."
282
+ },
283
+ "getter": false,
284
+ "setter": false
285
+ },
286
+ "value": {
287
+ "type": "string",
288
+ "mutable": false,
289
+ "complexType": {
290
+ "original": "string",
291
+ "resolved": "string | undefined",
292
+ "references": {}
293
+ },
294
+ "required": false,
295
+ "optional": true,
296
+ "docs": {
297
+ "tags": [],
298
+ "text": "Current value for field components."
299
+ },
300
+ "getter": false,
301
+ "setter": false,
302
+ "reflect": false,
303
+ "attribute": "value"
304
+ },
305
+ "disabled": {
306
+ "type": "boolean",
307
+ "mutable": false,
308
+ "complexType": {
309
+ "original": "boolean",
310
+ "resolved": "boolean",
311
+ "references": {}
312
+ },
313
+ "required": false,
314
+ "optional": false,
315
+ "docs": {
316
+ "tags": [],
317
+ "text": "Whether the component is disabled."
318
+ },
319
+ "getter": false,
320
+ "setter": false,
321
+ "reflect": false,
322
+ "attribute": "disabled",
323
+ "defaultValue": "false"
324
+ }
325
+ };
326
+ }
327
+ static get events() {
328
+ return [{
329
+ "method": "fieldChange",
330
+ "name": "fieldChange",
331
+ "bubbles": true,
332
+ "cancelable": true,
333
+ "composed": true,
334
+ "docs": {
335
+ "tags": [],
336
+ "text": "Emitted when a field value changes."
337
+ },
338
+ "complexType": {
339
+ "original": "{ id: string; value: string }",
340
+ "resolved": "{ id: string; value: string; }",
341
+ "references": {}
342
+ }
343
+ }, {
344
+ "method": "buttonClick",
345
+ "name": "buttonClick",
346
+ "bubbles": true,
347
+ "cancelable": true,
348
+ "composed": true,
349
+ "docs": {
350
+ "tags": [],
351
+ "text": "Emitted when a button is clicked."
352
+ },
353
+ "complexType": {
354
+ "original": "{\n id: string;\n type: string;\n value?: string;\n }",
355
+ "resolved": "{ id: string; type: string; value?: string | undefined; }",
356
+ "references": {}
357
+ }
358
+ }];
359
+ }
360
+ }
@@ -0,0 +1,186 @@
1
+ /**
2
+ * AuthHero Widget Component Styles
3
+ *
4
+ * Uses CSS custom properties from themes/variables.css
5
+ * Exposes CSS parts for external styling via ::part()
6
+ */
7
+
8
+ :host {
9
+ display: block;
10
+ font-family: var(--ah-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
11
+ }
12
+
13
+ /* ==========================================================================
14
+ Widget Container
15
+ Part: container
16
+ ========================================================================== */
17
+
18
+ .widget-container {
19
+ max-width: var(--ah-widget-max-width, 400px);
20
+ margin: 0 auto;
21
+ padding: var(--ah-widget-padding, 2rem);
22
+ background-color: var(--ah-color-bg, #ffffff);
23
+ border-radius: var(--ah-widget-radius, 8px);
24
+ box-shadow: var(--ah-widget-shadow, 0 2px 10px rgba(0, 0, 0, 0.1));
25
+ }
26
+
27
+ /* ==========================================================================
28
+ Logo
29
+ Part: logo
30
+ ========================================================================== */
31
+
32
+ .logo {
33
+ display: block;
34
+ width: var(--ah-logo-size, 48px);
35
+ height: var(--ah-logo-size, 48px);
36
+ margin: 0 auto var(--ah-space-6, 1.5rem);
37
+ object-fit: contain;
38
+ border-radius: var(--ah-logo-radius, 8px);
39
+ }
40
+
41
+ /* ==========================================================================
42
+ Title
43
+ Part: title
44
+ ========================================================================== */
45
+
46
+ .title {
47
+ font-size: var(--ah-font-size-2xl, 1.5rem);
48
+ font-weight: var(--ah-font-weight-semibold, 600);
49
+ text-align: center;
50
+ margin: 0 0 var(--ah-space-8, 2rem);
51
+ color: var(--ah-color-text, #111827);
52
+ line-height: var(--ah-line-height-tight, 1.25);
53
+ }
54
+
55
+ /* ==========================================================================
56
+ Messages
57
+ Part: message, message-error, message-success
58
+ ========================================================================== */
59
+
60
+ .message {
61
+ padding: var(--ah-space-3, 0.75rem) var(--ah-space-4, 1rem);
62
+ border-radius: var(--ah-radius-md, 4px);
63
+ margin-bottom: var(--ah-space-4, 1rem);
64
+ font-size: var(--ah-font-size-sm, 0.875rem);
65
+ line-height: var(--ah-line-height-normal, 1.5);
66
+ }
67
+
68
+ .message-error {
69
+ background-color: var(--ah-color-error-bg, #fee2e2);
70
+ color: var(--ah-color-error, #dc2626);
71
+ border: 1px solid var(--ah-color-error-border, #fecaca);
72
+ }
73
+
74
+ .message-success {
75
+ background-color: var(--ah-color-success-bg, #dcfce7);
76
+ color: var(--ah-color-success, #16a34a);
77
+ border: 1px solid var(--ah-color-success-border, #bbf7d0);
78
+ }
79
+
80
+ /* ==========================================================================
81
+ Form
82
+ Part: form
83
+ ========================================================================== */
84
+
85
+ form {
86
+ display: flex;
87
+ flex-direction: column;
88
+ gap: var(--ah-space-4, 1rem);
89
+ }
90
+
91
+ /* ==========================================================================
92
+ Links Footer
93
+ Part: links
94
+ ========================================================================== */
95
+
96
+ .links {
97
+ display: flex;
98
+ flex-direction: column;
99
+ align-items: center;
100
+ gap: var(--ah-space-2, 0.5rem);
101
+ margin-top: var(--ah-space-6, 1.5rem);
102
+ padding-top: var(--ah-space-4, 1rem);
103
+ }
104
+
105
+ .link-wrapper {
106
+ font-size: var(--ah-font-size-sm, 0.875rem);
107
+ color: var(--ah-color-text-muted, #6b7280);
108
+ }
109
+
110
+ .link {
111
+ color: var(--ah-color-primary, #0066cc);
112
+ text-decoration: none;
113
+ font-size: var(--ah-font-size-sm, 0.875rem);
114
+ transition: color var(--ah-transition-fast, 150ms ease);
115
+ }
116
+
117
+ .link:hover {
118
+ text-decoration: underline;
119
+ }
120
+
121
+ .link:focus-visible {
122
+ outline: 2px solid var(--ah-color-primary, #0066cc);
123
+ outline-offset: 2px;
124
+ }
125
+
126
+ /* ==========================================================================
127
+ Divider
128
+ Part: divider
129
+ ========================================================================== */
130
+
131
+ .divider {
132
+ display: flex;
133
+ align-items: center;
134
+ text-align: center;
135
+ margin: var(--ah-space-2, 0.5rem) 0;
136
+ }
137
+
138
+ .divider::before,
139
+ .divider::after {
140
+ content: '';
141
+ flex: 1;
142
+ border-bottom: 1px solid var(--ah-color-border-muted, #e5e7eb);
143
+ }
144
+
145
+ .divider-text {
146
+ padding: 0 var(--ah-space-4, 1rem);
147
+ font-size: var(--ah-font-size-sm, 0.875rem);
148
+ color: var(--ah-color-text-muted, #9ca3af);
149
+ text-transform: uppercase;
150
+ letter-spacing: 0.05em;
151
+ }
152
+
153
+ /* ==========================================================================
154
+ Loading Spinner
155
+ Part: spinner
156
+ ========================================================================== */
157
+
158
+ .loading-spinner {
159
+ width: 40px;
160
+ height: 40px;
161
+ margin: var(--ah-space-8, 2rem) auto;
162
+ border: 3px solid var(--ah-color-border-muted, #f3f3f3);
163
+ border-top: 3px solid var(--ah-color-primary, #0066cc);
164
+ border-radius: 50%;
165
+ animation: spin 1s linear infinite;
166
+ }
167
+
168
+ @keyframes spin {
169
+ 0% {
170
+ transform: rotate(0deg);
171
+ }
172
+ 100% {
173
+ transform: rotate(360deg);
174
+ }
175
+ }
176
+
177
+ /* ==========================================================================
178
+ Error State
179
+ Part: error-message
180
+ ========================================================================== */
181
+
182
+ .error-message {
183
+ text-align: center;
184
+ color: var(--ah-color-error, #dc2626);
185
+ padding: var(--ah-space-4, 1rem);
186
+ }