diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a93480c..6de95fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ # SDKs at the same dependency level run concurrently; push conflicts are # handled by a retry-with-rebase loop in the publish step. -name: 🧩 Release SDKs +name: 🚀 Release on: workflow_dispatch: diff --git a/packages/javascript/src/models/embedded-flow.ts b/packages/javascript/src/models/embedded-flow.ts index 234b3da..7162721 100644 --- a/packages/javascript/src/models/embedded-flow.ts +++ b/packages/javascript/src/models/embedded-flow.ts @@ -310,6 +310,11 @@ export interface EmbeddedFlowComponent { */ alt?: string; + /** + * Space-separated list of CSS class names to apply to the rendered element. + */ + classes?: string; + /** * Icon color, CSS color value (for Icon components). */ diff --git a/packages/nextjs/src/client/components/presentation/SignIn/SignIn.tsx b/packages/nextjs/src/client/components/presentation/SignIn/SignIn.tsx index 5b79908..f2ad078 100644 --- a/packages/nextjs/src/client/components/presentation/SignIn/SignIn.tsx +++ b/packages/nextjs/src/client/components/presentation/SignIn/SignIn.tsx @@ -27,7 +27,7 @@ import useThunderID from '../../../contexts/ThunderID/useThunderID'; * Props for the SignIn component. * Extends BaseSignInProps for full compatibility with the React BaseSignIn component */ -export type SignInProps = Pick; +export type SignInProps = Pick; /** * A SignIn component for Next.js that provides native authentication flow. diff --git a/packages/nuxt/src/runtime/components/actions/SignInButton.ts b/packages/nuxt/src/runtime/components/actions/SignInButton.ts index 538039d..ff32903 100644 --- a/packages/nuxt/src/runtime/components/actions/SignInButton.ts +++ b/packages/nuxt/src/runtime/components/actions/SignInButton.ts @@ -83,6 +83,7 @@ const SignInButton: Component = defineComponent({ BaseSignInButton, { class: attrs.class, + id: attrs.id, isLoading: isLoading.value, onClick: handleSignIn, style: attrs.style, diff --git a/packages/nuxt/src/runtime/components/actions/SignOutButton.ts b/packages/nuxt/src/runtime/components/actions/SignOutButton.ts index 70b5976..d586908 100644 --- a/packages/nuxt/src/runtime/components/actions/SignOutButton.ts +++ b/packages/nuxt/src/runtime/components/actions/SignOutButton.ts @@ -70,6 +70,7 @@ const SignOutButton: Component = defineComponent({ BaseSignOutButton, { class: attrs.class, + id: attrs.id, isLoading: isLoading.value, onClick: handleSignOut, style: attrs.style, diff --git a/packages/nuxt/src/runtime/components/actions/SignUpButton.ts b/packages/nuxt/src/runtime/components/actions/SignUpButton.ts index 0f841cc..f05abcf 100644 --- a/packages/nuxt/src/runtime/components/actions/SignUpButton.ts +++ b/packages/nuxt/src/runtime/components/actions/SignUpButton.ts @@ -76,6 +76,7 @@ const SignUpButton: Component = defineComponent({ BaseSignUpButton, { class: attrs.class, + id: attrs.id, isLoading: isLoading.value, onClick: handleSignUp, style: attrs.style, diff --git a/packages/react/src/components/factories/FieldFactory.tsx b/packages/react/src/components/factories/FieldFactory.tsx index ddb769c..382262b 100644 --- a/packages/react/src/components/factories/FieldFactory.tsx +++ b/packages/react/src/components/factories/FieldFactory.tsx @@ -41,6 +41,10 @@ export interface FieldConfig { * Error message to display. */ error?: string; + /** + * HTML id to apply to the rendered field. + */ + id?: string; /** * Display name for the field. */ @@ -146,6 +150,7 @@ export const createField = (config: FieldConfig): ReactElement => { disabled = false, error, className, + id, options = [], touched = false, placeholder, @@ -158,6 +163,7 @@ export const createField = (config: FieldConfig): ReactElement => { 'data-testid': `thunderid-signin-${name}`, disabled, error: validationError, + id, label, name, onBlur, diff --git a/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx b/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx index 90c5262..4be53ec 100644 --- a/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx +++ b/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx @@ -16,7 +16,7 @@ * under the License. */ -import {css} from '@emotion/css'; +import {css, cx} from '@emotion/css'; import { FieldType, FlowMetadataResponse, @@ -258,8 +258,9 @@ const createAuthComponentFromFlow = ( const fieldType: string = getFieldType(component.type); const field: any = createField({ - className: options.inputClassName, + className: cx(options.inputClassName, component.classes), error, + id: component.id, label: resolve(component.label) || '', name: identifier, onBlur: () => options.onInputBlur?.(identifier), @@ -280,8 +281,9 @@ const createAuthComponentFromFlow = ( const error: string = isTouched ? formErrors[identifier] : undefined!; const field: any = createField({ - className: options.inputClassName, + className: cx(options.inputClassName, component.classes), error, + id: component.id, label: resolve(component.label) || '', name: identifier, onBlur: () => options.onInputBlur?.(identifier), @@ -346,26 +348,35 @@ const createAuthComponentFromFlow = ( // Render branded social login buttons for known action IDs + const socialButtonClassName: string = cx(options.buttonClassName, component.classes); + if (matchesSocialProvider(actionId, eventType, buttonText, 'google', authType, componentVariant)) { - return ; + return ; } if (matchesSocialProvider(actionId, eventType, buttonText, 'github', authType, componentVariant)) { - return ; + return ; } if (matchesSocialProvider(actionId, eventType, buttonText, 'facebook', authType, componentVariant)) { - return ; + return ; } if (matchesSocialProvider(actionId, eventType, buttonText, 'microsoft', authType, componentVariant)) { - return ; + return ; } if (matchesSocialProvider(actionId, eventType, buttonText, 'linkedin', authType, componentVariant)) { - return ; + return ; } if (matchesSocialProvider(actionId, eventType, buttonText, 'ethereum', authType, componentVariant)) { - return ; + return ( + + ); } if (actionId === 'prompt_mobile' || eventType === 'prompt_mobile') { - return ; + return ; } const startIconEl: ReactElement | null = component.startIcon ? ( @@ -390,6 +401,7 @@ const createAuthComponentFromFlow = (