@@ -4,6 +4,7 @@ import { ControlledDatePicker } from '@lambdacurry/medusa-forms/controlled/Contr
44import { ControlledInput } from '@lambdacurry/medusa-forms/controlled/ControlledInput' ;
55import { ControlledSelect } from '@lambdacurry/medusa-forms/controlled/ControlledSelect' ;
66import { ControlledTextArea } from '@lambdacurry/medusa-forms/controlled/ControlledTextArea' ;
7+ import { Button } from '@medusajs/ui' ;
78import type { Meta , StoryObj } from '@storybook/react-vite' ;
89import { useState } from 'react' ;
910import { FormProvider , useForm } from 'react-hook-form' ;
@@ -216,17 +217,15 @@ const CompleteRegistrationForm = () => {
216217
217218 { /* Submit Section */ }
218219 < div className = "pt-4 border-t" >
219- < button
220+ < Button
220221 type = "submit"
221222 disabled = { ! isValid || isSubmitting }
222- className = { `w-full py-3 px-4 rounded-md font-medium transition-colors ${
223- isValid && ! isSubmitting
224- ? 'bg-blue-600 hover:bg-blue-700 text-white'
225- : 'bg-gray-300 text-gray-500 cursor-not-allowed'
226- } `}
223+ isLoading = { isSubmitting }
224+ className = "w-full"
225+ variant = "primary"
227226 >
228227 { isSubmitting ? 'Creating Account...' : 'Create Account' }
229- </ button >
228+ </ Button >
230229
231230 { submitResult && (
232231 < div className = "mt-4 p-3 bg-green-100 border border-green-400 text-green-700 rounded" > { submitResult } </ div >
@@ -442,25 +441,19 @@ const ProductCreationForm = () => {
442441 { /* Submit Section */ }
443442 < div className = "pt-4 border-t" >
444443 < div className = "flex gap-4" >
445- < button
446- type = "button"
447- className = "flex-1 py-3 px-4 border border-gray-300 rounded-md font-medium text-gray-700 hover:bg-gray-50 transition-colors"
448- onClick = { ( ) => form . reset ( ) }
449- >
444+ < Button type = "button" variant = "secondary" className = "flex-1" onClick = { ( ) => form . reset ( ) } >
450445 Reset Form
451- </ button >
446+ </ Button >
452447
453- < button
448+ < Button
454449 type = "submit"
455450 disabled = { ! isValid || isSubmitting }
456- className = { `flex-1 py-3 px-4 rounded-md font-medium transition-colors ${
457- isValid && ! isSubmitting
458- ? 'bg-green-600 hover:bg-green-700 text-white'
459- : 'bg-gray-300 text-gray-500 cursor-not-allowed'
460- } `}
451+ isLoading = { isSubmitting }
452+ variant = "primary"
453+ className = "flex-1"
461454 >
462455 { isSubmitting ? 'Creating Product...' : 'Create Product' }
463- </ button >
456+ </ Button >
464457 </ div >
465458
466459 { submitResult && (
@@ -651,17 +644,9 @@ export const FormValidationShowcase: Story = {
651644 />
652645
653646 < div className = "pt-4 border-t" >
654- < button
655- type = "button"
656- disabled = { ! form . formState . isValid }
657- className = { `w-full py-2 px-4 rounded-md font-medium transition-colors ${
658- form . formState . isValid
659- ? 'bg-blue-600 hover:bg-blue-700 text-white'
660- : 'bg-gray-300 text-gray-500 cursor-not-allowed'
661- } `}
662- >
647+ < Button type = "button" disabled = { ! form . formState . isValid } variant = "primary" className = "w-full" >
663648 Submit (Validation Demo)
664- </ button >
649+ </ Button >
665650 </ div >
666651 </ div >
667652 </ FormProvider >
0 commit comments