diff --git a/example/src/ContractorOnboarding.tsx b/example/src/ContractorOnboarding.tsx index b35a6113..a09a5f00 100644 --- a/example/src/ContractorOnboarding.tsx +++ b/example/src/ContractorOnboarding.tsx @@ -43,8 +43,10 @@ const PricingPlanCards = ({ 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} /> ))} diff --git a/example/src/components/PricingPlanCard.tsx b/example/src/components/PricingPlanCard.tsx index 85b1666a..bfb8a07f 100644 --- a/example/src/components/PricingPlanCard.tsx +++ b/example/src/components/PricingPlanCard.tsx @@ -6,11 +6,7 @@ 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 { @@ -18,7 +14,7 @@ interface PricingPlanCardProps { description: React.ReactNode; features: string[]; selected?: boolean; - onSelect?: () => void; + onSelect?: (value: string) => void; value: string; } @@ -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); + }} > {title} @@ -56,17 +54,38 @@ export function PricingPlanCard({ - -
- - +
+
+ {selected && ( + + )}
- + + Select plan + +
);