Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions example/src/ContractorOnboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@
title={option.label}
description={option.description}
features={option.meta?.features as string[]}
value={field.value}
onSelect={() => field.onChange(option.value)}
value={option.value}
onSelect={(value: string) => {
field.onChange(value);
}}
selected={field.value === option.value}
/>
))}
Expand Down Expand Up @@ -114,10 +116,10 @@
<div className='contractor-onboarding-form-layout'>
<SelectCountryStep
onSubmit={(payload: SelectCountryFormPayload) =>
console.log('payload', payload)

Check warning on line 119 in example/src/ContractorOnboarding.tsx

View workflow job for this annotation

GitHub Actions / Checks and Tests

Unexpected console statement. Only these console methods are allowed: warn, error
}
onSuccess={(response: SelectCountrySuccess) =>
console.log('response', response)

Check warning on line 122 in example/src/ContractorOnboarding.tsx

View workflow job for this annotation

GitHub Actions / Checks and Tests

Unexpected console statement. Only these console methods are allowed: warn, error
}
onError={({
error,
Expand Down
53 changes: 36 additions & 17 deletions example/src/components/PricingPlanCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ import {
CardContent,
CardFooter,
} from '@remoteoss/remote-flows/internals';
import {
RadioGroup,
RadioGroupItem,
cn,
} from '@remoteoss/remote-flows/internals';
import { cn } from '@remoteoss/remote-flows/internals';
import { Check } from 'lucide-react';

interface PricingPlanCardProps {
title: React.ReactNode;
description: React.ReactNode;
features: string[];
selected?: boolean;
onSelect?: () => void;
onSelect?: (value: string) => void;
value: string;
}

Expand All @@ -36,7 +32,9 @@ export function PricingPlanCard({
'px-4 py-4 border-dashed border-[#9AA6B2] cursor-pointer transition-all',
selected && 'border-solid border-[#9AA6B2] ring-2 ring-[#9AA6B2]',
)}
onClick={onSelect}
onClick={() => {
onSelect?.(value);
}}
>
<CardHeader className='pb-4'>
<CardTitle className='text-xl font-bold'>{title}</CardTitle>
Expand All @@ -56,17 +54,38 @@ export function PricingPlanCard({
</CardContent>

<CardFooter className='pt-4'>
<RadioGroup value={selected ? value : undefined} className='w-full'>
<div className='flex items-center gap-2'>
<RadioGroupItem value={value} id={value} />
<label
htmlFor={value}
className='cursor-pointer text-sm font-medium'
>
Select plan
</label>
<div className='flex items-center gap-3 w-full'>
<div
style={{
width: '20px',
height: '20px',
borderRadius: '50%',
border: `2px solid ${selected ? '#9AA6B2' : '#D1D5DB'}`,
backgroundColor: selected ? '#9AA6B2' : '#FFFFFF',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0,
transition: 'all 0.2s',
}}
>
{selected && (
<Check
className='text-white'
style={{ width: '12px', height: '12px' }}
/>
)}
</div>
</RadioGroup>
<span
style={{
fontSize: '14px',
fontWeight: 500,
color: selected ? '#364452' : '#6B7280',
}}
>
Select plan
</span>
</div>
</CardFooter>
</Card>
);
Expand Down
Loading