Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
983d9b3
feat(types) - update opeanpi types
gabrielseco Apr 20, 2026
b58bbd7
fix onboarding form abstraction
gabrielseco Apr 20, 2026
a97043f
Merge branch 'docs/refactor-onboarding-form-to-use-abstraction' into …
gabrielseco Apr 20, 2026
094567c
more types
gabrielseco Apr 20, 2026
372eae7
add hooks && types
gabrielseco Apr 20, 2026
7e55e04
changes for engagement
gabrielseco Apr 20, 2026
8ff69c8
add functionality to preload default field
gabrielseco Apr 20, 2026
a63d23c
add submission
gabrielseco Apr 20, 2026
e5fcc0f
format
gabrielseco Apr 20, 2026
91b9402
export payload type
gabrielseco Apr 20, 2026
542fd9d
fix types
gabrielseco Apr 20, 2026
3ed56a8
fix type
gabrielseco Apr 20, 2026
4eb07a5
fix type
gabrielseco Apr 20, 2026
f762fa3
fix type
gabrielseco Apr 20, 2026
9e8c94b
recover data
gabrielseco Apr 20, 2026
80e1f07
Merge branch 'main' into engagement-form-ii
gabrielseco Apr 21, 2026
5d1740d
Merge branch 'main' into engagement-form-ii
gabrielseco Apr 21, 2026
442a3fa
Merge branch 'main' into engagement-form-ii
gabrielseco Apr 22, 2026
79709fa
fix step and title
gabrielseco Apr 22, 2026
5cb90ee
fix inclusion of the form
gabrielseco Apr 22, 2026
0a33cfe
fix agreement
gabrielseco Apr 22, 2026
41cba3a
fix tests
gabrielseco Apr 22, 2026
e997e80
remove todo
gabrielseco Apr 22, 2026
3e08efe
remove code
gabrielseco Apr 22, 2026
f69268b
add tests
gabrielseco Apr 22, 2026
9e94411
add description
gabrielseco Apr 22, 2026
994967e
remove comments
gabrielseco Apr 23, 2026
60af133
set contract details to 3
gabrielseco Apr 23, 2026
54c0a9c
Merge branch 'main' into feat/contract-details-deu
gabrielseco Apr 24, 2026
b57c751
Merge branch 'main' into feat/contract-details-deu
gabrielseco Apr 28, 2026
0506ab6
Merge branch 'main' into feat/contract-details-deu
gabrielseco Apr 28, 2026
bcc1b01
Merge branch 'main' into feat/contract-details-deu
gabrielseco Apr 29, 2026
1ff72dc
add recommended
gabrielseco Apr 29, 2026
bd9ded5
fix alignment
gabrielseco Apr 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/src/Onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ const OnboardingWithProps = ({
},
DEU: {
// Germany
contract_details: 1,
contract_details: 4,
},
BLR: {
// Belarus
Expand Down
21 changes: 15 additions & 6 deletions src/components/form/fields/default/RadioGroupFieldDefault.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import {
} from '@/src/components/ui/form';
import { RadioGroup, RadioGroupItem } from '@/src/components/ui/radio-group';
import { cn } from '@/src/lib/utils';
import { FieldComponentProps } from '@/src/types/fields';
import { RadioGroupComponentProps } from '@/src/types/fields';
import { HelpCenter } from '@/src/components/shared/zendesk-drawer/HelpCenter';
import { Badge } from '@/src/components/ui/badge';

export const RadioGroupFieldDefault = ({
field,
fieldData,
fieldState,
}: FieldComponentProps) => {
}: RadioGroupComponentProps) => {
const { name, label, description, options } = fieldData;
return (
<fieldset
Expand All @@ -38,24 +39,32 @@ export const RadioGroupFieldDefault = ({
field.onChange(value);
}}
value={field.value}
className='flex flex-col space-y-3'
className='flex flex-col'
>
{options?.map((option) => (
<Fragment key={option.value}>
<FormItem
data-field={name}
className='flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item'
className='flex items-start space-x-3 space-y-0 gap-0 min-h-[24px] RemoteFlows__RadioField__Item'
>
<FormControl>
<RadioGroupItem
value={option.value}
className='RemoteFlows__RadioField__Input'
className={cn(
'RemoteFlows__RadioField__Input',
option.recommended && 'mt-1',
)}
disabled={option.disabled}
/>
</FormControl>
<div>
<FormLabel className='font-normal mb-0 RemoteFlows__RadioField__Label'>
{option.label}
{option.label}{' '}
{option.recommended && (
<Badge variant='secondary' className='ml-2'>
Recommended
</Badge>
)}
</FormLabel>
{option.description && (
<FormDescription className='mt-2'>
Expand Down
19 changes: 19 additions & 0 deletions src/types/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,22 @@ export type PricingPlanComponentProps = Omit<
export type TelFieldComponentProps = Omit<FieldComponentProps, 'fieldData'> & {
fieldData: TelFieldDataProps;
};

type RadioGroupDataProps = Omit<FieldDataProps, 'options'> & {
options?: Array<{
value: string;
label: string;
description?: string;
disabled?: boolean;
recommended?: boolean;
nested_field?: string;
meta?: Record<string, unknown>;
}>;
};

export type RadioGroupComponentProps = Omit<
FieldComponentProps,
'fieldData'
> & {
fieldData: RadioGroupDataProps;
};
3 changes: 3 additions & 0 deletions src/types/remoteFlows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
TextFieldComponentProps,
WorkScheduleComponentProps,
TelFieldComponentProps,
RadioGroupComponentProps,
} from '@/src/types/fields';

type AuthResponse = {
Expand Down Expand Up @@ -137,6 +138,7 @@ type FieldComponentTypes = Exclude<
| 'money'
| 'date'
| 'tel'
| 'radio'
>;

export type Components = {
Expand All @@ -155,6 +157,7 @@ export type Components = {
'work-schedule'?: React.ComponentType<WorkScheduleComponentProps>;
pdfViewer?: React.ComponentType<PDFPreviewComponentProps>;
tel?: React.ComponentType<TelFieldComponentProps>;
radio?: React.ComponentType<RadioGroupComponentProps>;
};

export type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
Expand Down
Loading