@remoteoss/remote-flows 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{chunk-2DWTIFOU.js → chunk-2EKC7DK3.js} +2 -2
- package/dist/{chunk-G2GI6FEO.js → chunk-55VACCVZ.js} +2 -2
- package/dist/{chunk-G2GI6FEO.js.map → chunk-55VACCVZ.js.map} +1 -1
- package/dist/{chunk-5YDR5BIG.js → chunk-6LTJBLSD.js} +2 -2
- package/dist/chunk-AYFHWLQZ.js +2 -0
- package/dist/chunk-AYFHWLQZ.js.map +1 -0
- package/dist/chunk-CTG3DYJR.js +2 -0
- package/dist/chunk-CTG3DYJR.js.map +1 -0
- package/dist/chunk-EQBNHLR4.js +2 -0
- package/dist/chunk-EQBNHLR4.js.map +1 -0
- package/dist/{chunk-QWZVBZED.js → chunk-F5QJZKDL.js} +2 -2
- package/dist/chunk-FZ2HS6G7.js +2 -0
- package/dist/chunk-FZ2HS6G7.js.map +1 -0
- package/dist/chunk-GW7GG5ZW.js +2 -0
- package/dist/chunk-GW7GG5ZW.js.map +1 -0
- package/dist/chunk-HP7ZP256.js +2 -0
- package/dist/chunk-HP7ZP256.js.map +1 -0
- package/dist/{chunk-ZCG5JUUR.js → chunk-IJPE22L7.js} +2 -2
- package/dist/chunk-IPZEZMLD.js +2 -0
- package/dist/chunk-IPZEZMLD.js.map +1 -0
- package/dist/chunk-JLUDKN4H.js +2 -0
- package/dist/chunk-JLUDKN4H.js.map +1 -0
- package/dist/chunk-JODJFARP.js +2 -0
- package/dist/chunk-JODJFARP.js.map +1 -0
- package/dist/chunk-KPSFJ6BN.js +2 -0
- package/dist/chunk-KPSFJ6BN.js.map +1 -0
- package/dist/chunk-LNF27NTC.js +2 -0
- package/dist/chunk-LNF27NTC.js.map +1 -0
- package/dist/chunk-N5AQSLAU.js +2 -0
- package/dist/chunk-N5AQSLAU.js.map +1 -0
- package/dist/{chunk-WTGUGPHV.js → chunk-NBD4VOG3.js} +2 -2
- package/dist/{chunk-TPKAREI4.js → chunk-RCX4JUI3.js} +2 -2
- package/dist/chunk-S56EWAS4.js +2 -0
- package/dist/chunk-S56EWAS4.js.map +1 -0
- package/dist/chunk-SABMDOWE.js +2 -0
- package/dist/chunk-SABMDOWE.js.map +1 -0
- package/dist/chunk-SEUQNAF6.js +2 -0
- package/dist/chunk-SEUQNAF6.js.map +1 -0
- package/dist/chunk-VX2UC3HG.js +2 -0
- package/dist/chunk-VX2UC3HG.js.map +1 -0
- package/dist/chunk-W5DG5WWJ.js +2 -0
- package/dist/chunk-W5DG5WWJ.js.map +1 -0
- package/dist/chunk-XFD3ULUF.js +2 -0
- package/dist/chunk-XFD3ULUF.js.map +1 -0
- package/dist/{chunk-ROPNMSSM.js → chunk-XULIEA44.js} +2 -2
- package/dist/{chunk-5O2L2L25.js → chunk-YAHWFLDH.js} +2 -2
- package/dist/{chunk-6DMCAUPE.js → chunk-YBACB5A6.js} +2 -2
- package/dist/chunk-YBACB5A6.js.map +1 -0
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +1 -1
- package/dist/flows/ContractAmendment/hooks.d.ts +1 -1
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +1 -1
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/utils.d.ts +1 -1
- package/dist/flows/ContractAmendment/utils.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +1 -1
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Termination/TerminationBack.d.ts +5 -0
- package/dist/flows/Termination/TerminationBack.js +2 -0
- package/dist/flows/Termination/TerminationFlow.d.ts +31 -5
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +2 -2
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/TimeOff.d.ts +11 -0
- package/dist/flows/Termination/TimeOff.js +2 -0
- package/dist/flows/Termination/TimeOff.js.map +1 -0
- package/dist/flows/Termination/context.d.ts +14 -5
- package/dist/flows/Termination/hooks.d.ts +51 -5
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +5 -1
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/additionalInformation.d.ts +25 -0
- package/dist/flows/Termination/json-schemas/additionalInformation.js +2 -0
- package/dist/flows/Termination/json-schemas/additionalInformation.js.map +1 -0
- package/dist/flows/Termination/json-schemas/defaultSchema.d.ts +15 -0
- package/dist/flows/Termination/json-schemas/defaultSchema.js +2 -0
- package/dist/flows/Termination/json-schemas/defaultSchema.js.map +1 -0
- package/dist/flows/Termination/json-schemas/employeeComunication.d.ts +133 -0
- package/dist/flows/Termination/json-schemas/employeeComunication.js +2 -0
- package/dist/flows/Termination/json-schemas/employeeComunication.js.map +1 -0
- package/dist/flows/Termination/{jsonSchema.d.ts → json-schemas/jsonSchema.d.ts} +42 -0
- package/dist/flows/Termination/json-schemas/jsonSchema.js +2 -0
- package/dist/flows/Termination/json-schemas/jsonSchema.js.map +1 -0
- package/dist/flows/Termination/json-schemas/paidTimeOff.d.ts +71 -0
- package/dist/flows/Termination/json-schemas/paidTimeOff.js +2 -0
- package/dist/flows/Termination/json-schemas/paidTimeOff.js.map +1 -0
- package/dist/flows/Termination/json-schemas/schema.d.ts +8 -0
- package/dist/flows/Termination/json-schemas/schema.js +2 -0
- package/dist/flows/Termination/json-schemas/schema.js.map +1 -0
- package/dist/flows/Termination/json-schemas/terminationDetails.d.ts +126 -0
- package/dist/flows/Termination/json-schemas/terminationDetails.js +2 -0
- package/dist/flows/Termination/json-schemas/terminationDetails.js.map +1 -0
- package/dist/flows/Termination/types.d.ts +6 -6
- package/dist/flows/Termination/utils.d.ts +8 -0
- package/dist/flows/Termination/utils.js +2 -0
- package/dist/flows/Termination/utils.js.map +1 -0
- package/dist/flows/useStepState.d.ts +6 -6
- package/dist/flows/useStepState.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +30 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{types.gen-BhkGMC9-.d.ts → types.gen-BgLeTAqP.d.ts} +1 -1
- package/package.json +2 -1
- package/dist/chunk-5PXYSIYN.js +0 -2
- package/dist/chunk-5PXYSIYN.js.map +0 -1
- package/dist/chunk-6DMCAUPE.js.map +0 -1
- package/dist/chunk-HELGRHUB.js +0 -2
- package/dist/chunk-HELGRHUB.js.map +0 -1
- package/dist/chunk-JWMY3OVH.js +0 -2
- package/dist/chunk-JWMY3OVH.js.map +0 -1
- package/dist/chunk-LUCFM5TE.js +0 -2
- package/dist/chunk-LUCFM5TE.js.map +0 -1
- package/dist/chunk-RL2KU7BM.js +0 -2
- package/dist/chunk-RL2KU7BM.js.map +0 -1
- package/dist/chunk-TIXDBKBM.js +0 -2
- package/dist/chunk-TIXDBKBM.js.map +0 -1
- package/dist/chunk-XFE56PM4.js +0 -2
- package/dist/chunk-XFE56PM4.js.map +0 -1
- package/dist/chunk-Y5UG6SJJ.js +0 -2
- package/dist/chunk-Y5UG6SJJ.js.map +0 -1
- package/dist/flows/Termination/jsonSchema.js +0 -2
- /package/dist/{chunk-2DWTIFOU.js.map → chunk-2EKC7DK3.js.map} +0 -0
- /package/dist/{chunk-5YDR5BIG.js.map → chunk-6LTJBLSD.js.map} +0 -0
- /package/dist/{chunk-QWZVBZED.js.map → chunk-F5QJZKDL.js.map} +0 -0
- /package/dist/{chunk-ZCG5JUUR.js.map → chunk-IJPE22L7.js.map} +0 -0
- /package/dist/{chunk-WTGUGPHV.js.map → chunk-NBD4VOG3.js.map} +0 -0
- /package/dist/{chunk-TPKAREI4.js.map → chunk-RCX4JUI3.js.map} +0 -0
- /package/dist/{chunk-ROPNMSSM.js.map → chunk-XULIEA44.js.map} +0 -0
- /package/dist/{chunk-5O2L2L25.js.map → chunk-YAHWFLDH.js.map} +0 -0
- /package/dist/flows/Termination/{jsonSchema.js.map → TerminationBack.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ui/checkbox.tsx","../src/components/form/fields/CheckBoxField.tsx","../src/components/form/fields/DatePickerField.tsx","../src/components/ui/calendar.tsx","../src/components/ui/popover.tsx","../src/components/form/fields/FieldSetField.tsx","../src/components/form/fields/FileUploadField.tsx","../src/components/ui/file-uploader.tsx","../src/components/form/fields/NumberField.tsx","../src/components/form/fields/TextField.tsx","../src/components/ui/input.tsx","../src/components/ui/radio-group.tsx","../src/components/form/fields/RadioGroupField.tsx","../src/components/form/fields/SelectField.tsx","../src/components/ui/select.tsx","../src/components/form/fields/TextAreaField.tsx","../src/components/ui/textarea.tsx","../src/components/form/fields/EmailField.tsx","../src/components/form/fields/fieldsMapping.tsx","../src/components/form/JSONSchemaForm.tsx","../src/components/ui/alert.tsx","../src/components/form/Statement.tsx","../src/components/form/fields/ForcedValueField.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Check } from 'lucide-react';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'peer h-4 w-4 shrink-0 rounded-sm border border-input ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-checkbox data-[state=checked]:text-primary',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn('flex items-center justify-center text-current')}\n >\n <Check className=\"h-4 w-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Checkbox } from '@/src/components/ui/checkbox';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/src/components/ui/form';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { CheckedState } from '@radix-ui/react-checkbox';\nimport * as React from 'react';\nimport {\n ControllerRenderProps,\n FieldValues,\n useFormContext,\n} from 'react-hook-form';\n\nexport type CheckBoxFieldProps = JSFField & {\n onChange?: (checked: any, optionId?: string) => void;\n};\n\nexport function CheckBoxField({\n name,\n defaultValue,\n description,\n label,\n onChange,\n multiple,\n options,\n ...rest\n}: CheckBoxFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n const handleCheckboxChange = (\n optionId: string,\n checked: boolean,\n field: ControllerRenderProps<FieldValues, string>,\n ) => {\n const currentValues = field.value ? [...field.value] : [];\n\n if (checked) {\n // Add the value if it's not already in the array\n if (!currentValues.includes(optionId)) {\n field.onChange([...currentValues, optionId]);\n }\n } else {\n // Remove the value from the array\n field.onChange(currentValues.filter((value) => value !== optionId));\n }\n };\n\n return (\n <FormField\n control={control}\n name={name}\n defaultValue={defaultValue}\n render={({ field, fieldState }) => {\n if (components?.checkbox) {\n const CustomCheckboxField = components?.checkbox;\n const customCheckboxFieldProps = {\n name,\n description,\n label,\n defaultValue,\n multiple,\n options,\n ...rest,\n };\n return (\n <CustomCheckboxField\n field={{\n ...field,\n onChange: (evt: any) => {\n if (multiple) {\n const { checked, value } = evt.target;\n handleCheckboxChange(value, checked, field);\n onChange?.(checked);\n return;\n }\n field.onChange(evt);\n onChange?.(evt);\n },\n }}\n fieldState={fieldState}\n fieldData={customCheckboxFieldProps}\n />\n );\n }\n return (\n <FormItem className={cn(`RemoteFlows__CheckBoxField__Item__${name}`)}>\n <FormControl>\n <>\n {options && multiple ? (\n options.map((option) => (\n <div key={option.value} className=\"flex space-x-2\">\n <Checkbox\n id={option.value}\n onCheckedChange={(checked: CheckedState) => {\n handleCheckboxChange(\n option.value,\n checked === true,\n field,\n );\n onChange?.(checked, option.value);\n }}\n checked={field.value?.includes(option.value)}\n className=\"RemoteFlows__CheckBox__Input\"\n />\n <FormLabel\n htmlFor={option.value}\n className=\"mb-0 RemoteFlows__CheckBox__Label\"\n >\n {option.label}\n </FormLabel>\n </div>\n ))\n ) : (\n <div className=\"flex space-x-2\">\n <Checkbox\n id={name}\n onCheckedChange={(event: CheckedState) => {\n field.onChange(event);\n onChange?.(event);\n }}\n checked={field.value}\n className=\"RemoteFlows__CheckBox__Input\"\n />\n <FormLabel\n htmlFor={name}\n className=\"mb-0 RemoteFlows__CheckBox__Label\"\n >\n {label}\n </FormLabel>\n </div>\n )}\n </>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { CalendarIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { useFormContext } from 'react-hook-form';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Calendar } from '@/src/components/ui/calendar';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/src/components/ui/form';\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@/src/components/ui/popover';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { PopoverClose } from '@radix-ui/react-popover';\nimport { format } from 'date-fns';\n\nexport type DatePickerFieldProps = JSFField & {\n onChange?: (value: any) => void;\n};\n\nexport function DatePickerField({\n description,\n label,\n name,\n minDate,\n onChange,\n ...rest\n}: DatePickerFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n if (components?.date) {\n const CustomDatePickerField = components?.date;\n const customDatePickerFieldProps = {\n description,\n label,\n name,\n minDate,\n onChange,\n ...rest,\n };\n return (\n <CustomDatePickerField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customDatePickerFieldProps}\n />\n );\n }\n return (\n <FormItem\n className={`flex flex-col RemoteFlows__DatePickerField__Item__${name}`}\n >\n <FormLabel className=\"RemoteFlows__DatePickerField__Label\">\n {label}\n </FormLabel>\n <Popover>\n <PopoverTrigger asChild>\n <FormControl>\n <div>\n <Button\n type=\"button\"\n variant={'outline'}\n className={cn(\n 'w-full pl-3 text-left font-normal',\n !field.value && 'text-muted-foreground',\n )}\n data-testid=\"date-picker-button\"\n >\n {field.value && <>{format(field.value, 'yyyy-MM-dd')}</>}\n <CalendarIcon className=\"ml-auto h-4 w-4 opacity-50\" />\n </Button>\n </div>\n </FormControl>\n </PopoverTrigger>\n <PopoverContent\n className={`w-auto p-0 RemoteFlows__DatepickerField__PopoverContent`}\n align=\"start\"\n >\n <Calendar\n mode=\"single\"\n className=\"RemoteFlows__DatepickerField__Calendar\"\n selected={field.value ? new Date(field.value) : undefined}\n onSelect={(date) => {\n field.onChange(date ? format(date, 'yyyy-MM-dd') : null);\n onChange?.(date);\n }}\n defaultMonth={minDate ? new Date(minDate) : undefined}\n components={{\n DayContent: (props) => {\n return (\n <PopoverClose>{props.date.getDate()}</PopoverClose>\n );\n },\n }}\n {...(minDate && {\n disabled: (date: Date) => date < new Date(minDate),\n })}\n />\n </PopoverContent>\n </Popover>\n {description ? (\n <FormDescription>{description}</FormDescription>\n ) : null}\n {fieldState.error && (\n <FormMessage className=\"RemoteFlows__DatePickerField__Error\" />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","import * as React from 'react';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { DayPicker } from 'react-day-picker';\n\nimport { cn } from '@/src/lib/utils';\nimport { buttonVariants } from '@/src/components/ui/button';\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: React.ComponentProps<typeof DayPicker>) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn('p-3', className)}\n classNames={{\n months: 'flex flex-col sm:flex-row gap-2',\n month: 'flex flex-col gap-4',\n caption: 'flex justify-center pt-1 relative items-center w-full',\n caption_label: 'text-sm font-medium',\n nav: 'flex items-center gap-1',\n nav_button: cn(\n buttonVariants({ variant: 'outline' }),\n 'size-7 bg-transparent p-0 opacity-50 hover:opacity-100',\n ),\n nav_button_previous: 'absolute left-1',\n nav_button_next: 'absolute right-1',\n table: 'w-full border-collapse space-x-1',\n head_row: 'flex',\n head_cell:\n 'text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]',\n row: 'flex w-full mt-2',\n cell: cn(\n 'relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md',\n props.mode === 'range'\n ? '[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md'\n : '[&:has([aria-selected])]:rounded-md',\n ),\n day: cn(\n buttonVariants({ variant: 'ghost' }),\n 'size-8 p-0 font-normal aria-selected:opacity-100',\n ),\n day_range_start:\n 'day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground',\n day_range_end:\n 'day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground',\n day_selected:\n 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',\n day_today: 'bg-accent text-accent-foreground',\n day_outside:\n 'day-outside text-muted-foreground aria-selected:text-muted-foreground',\n day_disabled: 'text-muted-foreground opacity-50',\n day_range_middle:\n 'aria-selected:bg-accent aria-selected:text-accent-foreground',\n day_hidden: 'invisible',\n ...classNames,\n }}\n components={{\n IconLeft: ({ className, ...props }) => (\n <ChevronLeft className={cn('size-4', className)} {...props} />\n ),\n IconRight: ({ className, ...props }) => (\n <ChevronRight className={cn('size-4', className)} {...props} />\n ),\n }}\n {...props}\n />\n );\n}\n\nexport { Calendar };\n","import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n","import { fieldsMap } from '@/src/components/form/fields/fieldsMapping';\nimport { cn } from '@/src/lib/utils';\nimport * as React from 'react';\nimport { SupportedTypes } from './types';\n\ntype FieldBase = {\n label: string;\n name: string;\n description: string;\n};\n\ntype FieldWithOptions = FieldBase & {\n type: 'select' | 'radio';\n options: Array<{ value: string; label: string }>;\n};\n\ntype FieldWithoutOptions = FieldBase & {\n type: Exclude<SupportedTypes, 'select' | 'radio'>;\n options?: never;\n};\n\ntype Field = FieldWithOptions | FieldWithoutOptions;\n\ntype FieldSetProps = {\n label: string;\n name: string;\n description: string;\n fields: Field[];\n};\n\nexport function FieldSetField({\n label,\n name,\n fields,\n description,\n}: FieldSetProps) {\n return (\n <fieldset\n className={cn(\n 'border-1 border-input p-4 rounded-xl',\n `RemoteFlows__FieldSetField__${name}`,\n )}\n >\n <legend className=\"text-sm font-semibold px-2\">{label}</legend>\n {description ? (\n <div\n className=\"mb-5 RemoteFlows__FieldSetField__Description\"\n dangerouslySetInnerHTML={{ __html: description }}\n />\n ) : null}\n <div className=\"grid gap-4\">\n {fields.map((field) => {\n const FieldComponent = fieldsMap[field.type];\n return (\n <FieldComponent\n {...field}\n key={field.name}\n name={`${name}.${field.name}`}\n />\n );\n })}\n </div>\n </fieldset>\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\n\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useFormContext } from 'react-hook-form';\nimport { FileUploader } from '../../ui/file-uploader';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '../../ui/form';\n\nconst toBase64 = (file: File): Promise<string> => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = (error) => reject(error);\n });\n};\n\nconst convertFilesToBase64 = async (\n event: React.ChangeEvent<HTMLInputElement>,\n) => {\n const files = event.target.files ? Array.from(event.target.files) : [];\n\n const base64Files = await Promise.all(\n files.map(async (file) => {\n const base64 = await toBase64(file);\n return {\n name: file.name,\n content: base64.split(',')[1],\n };\n }),\n );\n return base64Files;\n};\n\nexport type FileUploadFieldProps = JSFField & {\n onChange?: (value: any) => void;\n multiple?: boolean;\n};\n\nexport function FileUploadField({\n name,\n description,\n label,\n multiple,\n onChange,\n ...rest\n}: FileUploadFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n if (components?.file) {\n const CustomFileUploadField = components?.file;\n const customFileUploadFieldProps = {\n name,\n description,\n label,\n multiple,\n ...rest,\n };\n return (\n <CustomFileUploadField\n field={{\n ...field,\n value: null,\n onChange: async (value: any) => {\n const files = await convertFilesToBase64(value);\n if (multiple) {\n field.onChange(files);\n onChange?.(files);\n } else {\n field.onChange([files[0]]);\n onChange?.([files[0]]);\n }\n },\n }}\n fieldState={fieldState}\n fieldData={customFileUploadFieldProps}\n />\n );\n }\n return (\n <FormItem className={`RemoteFlows__FileUpload__Item__${name}`}>\n <FormLabel className=\"RemoteFlows__FileUpload__Label\">\n {label}\n </FormLabel>\n <FormControl>\n <FileUploader\n onChange={async (\n event: React.ChangeEvent<HTMLInputElement>,\n ) => {\n const files = await convertFilesToBase64(event);\n if (multiple) {\n field.onChange(files);\n onChange?.(files);\n } else {\n field.onChange([files[0]]);\n onChange?.([files[0]]);\n }\n }}\n multiple={multiple}\n className={cn('RemoteFlows__FileUpload__Input')}\n />\n </FormControl>\n {description && (\n <div className=\"flex items-center justify-between\">\n <FormDescription className=\"RemoteFlows__FileUpload__Description\">\n {description}\n </FormDescription>\n </div>\n )}\n {fieldState.error && (\n <FormMessage className=\"RemoteFlows__FileUpload__Error\" />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","import React, { useState, useRef } from 'react';\nimport { Button } from '@/src/components/ui/button';\nimport { Upload, X } from 'lucide-react';\nimport { cn } from '@/src/lib/utils';\n\ntype FileUploaderProps = {\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n className?: string;\n multiple?: boolean;\n};\n\nexport function FileUploader({\n onChange,\n className,\n multiple,\n}: FileUploaderProps) {\n const [files, setFiles] = useState<File[]>([]);\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleClick = () => {\n inputRef.current?.click();\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files.length > 0) {\n const newFiles = Array.from(e.target.files);\n\n setFiles(newFiles);\n onChange(e);\n }\n };\n\n const onRemoveFile = (file: File) => {\n setFiles((prevFiles) => prevFiles.filter((f) => f !== file));\n };\n\n return (\n <div className={cn('flex flex-col items-start gap-4', className)}>\n <input\n type=\"file\"\n ref={inputRef}\n onChange={handleChange}\n className=\"hidden\"\n aria-label=\"File upload\"\n multiple={multiple}\n />\n <Button onClick={handleClick} className=\"gap-2\">\n <Upload className=\"h-4 w-4\" />\n Choose File\n </Button>\n {files.length === 0 && (\n <div className=\"text-sm\">\n {!multiple ? (\n <span className=\"font-medium\">No file selected.</span>\n ) : (\n <span className=\"font-medium\">\n No files selected. You can select multiple files\n </span>\n )}\n </div>\n )}\n {files.length > 0 &&\n files.map((file, index) => (\n <div key={index} className=\"text-sm flex items-center gap-2\">\n Selected file: <span className=\"font-medium\">{file.name}</span> (\n {Math.round(file.size / 1024)} KB)\n <Button variant=\"ghost\" onClick={() => onRemoveFile(file)}>\n <X />\n </Button>\n </div>\n ))}\n </div>\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useFormFields } from '@/src/context';\nimport React from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { FormField } from '../../ui/form';\nimport { TextField, TextFieldProps } from './TextField';\n\nexport function NumberField(props: TextFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n if (components?.number) {\n return (\n <FormField\n control={control}\n name={props.name}\n render={({ field, fieldState }) => {\n const CustomNumberField =\n components.number as React.ComponentType<any>;\n return (\n <CustomNumberField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n props.onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={props}\n />\n );\n }}\n />\n );\n }\n\n return (\n <TextField {...props} type=\"text\" inputMode=\"decimal\" pattern=\"^[0-9.]*$\" />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\n\nimport { useFormFields } from '@/src/context';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useFormContext } from 'react-hook-form';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '../../ui/form';\nimport { Input } from '../../ui/input';\n\nexport type TextFieldProps = React.ComponentProps<'input'> &\n JSFField & {\n onChange?: (value: any) => void;\n };\n\nexport function TextField({\n name,\n description,\n label,\n type,\n onChange,\n ...rest\n}: TextFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n if (components?.text) {\n const CustomTextField = components?.text;\n const customTextFieldProps = {\n name,\n description,\n label,\n type,\n onChange,\n ...rest,\n };\n return (\n <CustomTextField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customTextFieldProps}\n />\n );\n }\n\n return (\n <FormItem className={`RemoteFlows__TextField__Item__${name}`}>\n <FormLabel className=\"RemoteFlows__TextField__Label\">\n {label}\n </FormLabel>\n <FormControl>\n <Input\n {...field}\n value={field.value ?? ''}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n field.onChange(event);\n onChange?.(event);\n }}\n className=\"RemoteFlows__TextField__Input\"\n placeholder={label}\n />\n </FormControl>\n {description && (\n <FormDescription className=\"RemoteFlows__TextField__Description\">\n {description}\n </FormDescription>\n )}\n {fieldState.error && (\n <FormMessage className=\"RemoteFlows__TextField__Error\" />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n 'shadow-xs border-input file:text-foreground placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-xl border bg-transparent px-4 py-7 text-sm transition-[color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-visible:border-focused',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n","import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { CircleIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction RadioGroup({\n className,\n ...props\n}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {\n return (\n <RadioGroupPrimitive.Root\n data-slot=\"radio-group\"\n className={cn('grid gap-3', className)}\n {...props}\n />\n );\n}\n\nfunction RadioGroupItem({\n className,\n ...props\n}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {\n return (\n <RadioGroupPrimitive.Item\n data-slot=\"radio-group-item\"\n className={cn(\n 'border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator\n data-slot=\"radio-group-indicator\"\n className=\"relative flex items-center justify-center\"\n >\n <CircleIcon className=\"fill-radio absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n}\n\nexport { RadioGroup, RadioGroupItem };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '@/src/components/ui/form';\nimport { RadioGroup, RadioGroupItem } from '@/src/components/ui/radio-group';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport * as React from 'react';\nimport { useFormContext } from 'react-hook-form';\n\ntype RadioGroupFieldProps = JSFField & {\n onChange?: (value: any) => void;\n};\n\nexport function RadioGroupField({\n name,\n defaultValue,\n description,\n label,\n options,\n onChange,\n ...rest\n}: RadioGroupFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n defaultValue={defaultValue}\n render={({ field, fieldState }) => {\n if (components?.radio) {\n const CustomRadioGroupField = components?.radio;\n const customRadioGroupFieldProps = {\n name,\n defaultValue,\n description,\n label,\n options,\n ...rest,\n };\n return (\n <CustomRadioGroupField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customRadioGroupFieldProps}\n />\n );\n }\n\n return (\n <FormItem\n className={cn(\n 'space-y-3',\n `RemoteFlows__RadioGroupField__Item__${name}`,\n )}\n >\n <FormLabel>{label}</FormLabel>\n <FormControl>\n <RadioGroup\n onValueChange={(value: string) => {\n field.onChange(value);\n onChange?.(value);\n }}\n value={field.value}\n className=\"flex flex-col space-y-3\"\n >\n {options?.map((option) => (\n <>\n <FormItem\n key={option.value}\n className=\"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item\"\n >\n <FormControl>\n <RadioGroupItem\n value={option.value}\n className=\"RemoteFlows__RadioField__Input\"\n />\n </FormControl>\n <div>\n <FormLabel className=\"font-normal mb-0 RemoteFlows__RadioField__Label\">\n {option.label}\n </FormLabel>\n {option.description && (\n <FormDescription className=\"mt-2\">\n {option.description}\n </FormDescription>\n )}\n </div>\n </FormItem>\n </>\n ))}\n </RadioGroup>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\n\nimport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/src/components/ui/select';\nimport { useFormFields } from '@/src/context';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useFormContext } from 'react-hook-form';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '../../ui/form';\n\ntype SelectFieldProps = JSFField & {\n placeholder?: string;\n options: Array<{ value: string; label: string }>;\n className?: string;\n onChange?: (value: any) => void;\n};\n\nexport function SelectField({\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n ...rest\n}: SelectFieldProps) {\n const { control } = useFormContext();\n const { components } = useFormFields();\n\n return (\n <FormField\n defaultValue={defaultValue}\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n if (components?.select) {\n const CustomSelectField = components?.select;\n const customSelectFieldProps = {\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n ...rest,\n };\n return (\n <CustomSelectField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customSelectFieldProps}\n />\n );\n }\n\n return (\n <FormItem className={`RemoteFlows__SelectField__Item__${name}`}>\n <FormLabel className=\"RemoteFlows__SelectField__Label\">\n {label}\n </FormLabel>\n <FormControl aria-label={label}>\n <div className=\"relative\">\n <Select\n value={field.value || ''}\n onValueChange={(value: string) => {\n field.onChange(value);\n onChange?.(value);\n }}\n >\n <SelectTrigger\n className=\"RemoteFlows__SelectField__Trigger\"\n aria-invalid={Boolean(fieldState.error)}\n >\n <span className=\"absolute\">\n <SelectValue placeholder={label} />\n </span>\n </SelectTrigger>\n <SelectContent className=\"RemoteFlows__SelectField__Content\">\n <SelectGroup className=\"RemoteFlows__SelectField__Group\">\n {options.map((option) => (\n <SelectItem\n key={option.value}\n value={option.value}\n className=\"RemoteFlows__SelectField__SelectItem\"\n >\n {option.label}\n </SelectItem>\n ))}\n </SelectGroup>\n </SelectContent>\n </Select>\n </div>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","import * as React from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nfunction SelectTrigger({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger>) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n className={cn(\n \"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex w-full items-center justify-between rounded-xl border bg-transparent px-4 py-7 text-sm whitespace-nowrap transition-[color] outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n 'focus-visible:border-focused',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild className=\"absolute right-4\">\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n position = 'popper',\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-xl border',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn('px-2 py-1.5 text-sm font-medium', className)}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground min-h-11 justify-between [&_svg:not([class*='text-'])]:text-muted-foreground flex w-full cursor-default items-center gap-2 py-2 px-4 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className,\n )}\n {...props}\n >\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <span className=\"flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn('bg-border pointer-events-none -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from 'react';\n\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useFormContext } from 'react-hook-form';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '../../ui/form';\nimport { Textarea } from '../../ui/textarea';\n\nexport type TextAreaFieldProps = JSFField & {\n onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n maxLength?: number;\n};\n\nexport function TextAreaField({\n name,\n description,\n label,\n onChange,\n maxLength,\n ...rest\n}: TextAreaFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n if (components?.textarea) {\n const CustomTextAreaField = components?.textarea;\n const customTextAreaFieldProps = {\n name,\n description,\n label,\n maxLength,\n ...rest,\n };\n return (\n <CustomTextAreaField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={customTextAreaFieldProps}\n />\n );\n }\n\n const valueLength = field.value?.length ?? 0;\n return (\n <FormItem className={`RemoteFlows__TextArea__Item__${name}`}>\n <FormLabel className=\"RemoteFlows__TextArea__Label\">\n {label}\n </FormLabel>\n <FormControl>\n <Textarea\n {...field}\n value={field.value ?? ''}\n onChange={(event: React.ChangeEvent<HTMLTextAreaElement>) => {\n field.onChange(event);\n onChange?.(event);\n }}\n className={cn(\n fieldState.error &&\n 'border-red-500 focus-visible:ring-red-500',\n 'RemoteFlows__TextArea__Input',\n )}\n placeholder={label}\n />\n </FormControl>\n {(description || maxLength) && (\n <div className=\"flex items-center justify-between\">\n {description && (\n <FormDescription className=\"RemoteFlows__TextArea__Description\">\n {description}\n </FormDescription>\n )}\n {maxLength && (\n <span className=\"text-sm ml-auto RemoteFlows__TextArea__MaxLength\">\n {valueLength}/{maxLength}\n </span>\n )}\n </div>\n )}\n {fieldState.error && (\n <FormMessage className=\"RemoteFlows__TextArea__Error\" />\n )}\n </FormItem>\n );\n }}\n />\n );\n}\n","import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Textarea = React.forwardRef<\n HTMLTextAreaElement,\n React.ComponentProps<'textarea'>\n>(({ className, ...props }, ref) => {\n return (\n <textarea\n className={cn(\n 'flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n});\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useFormFields } from '@/src/context';\nimport React from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { FormField } from '../../ui/form';\nimport { TextField, TextFieldProps } from './TextField';\n\nexport function EmailField(props: TextFieldProps) {\n const { components } = useFormFields();\n const { control } = useFormContext();\n\n if (components?.email) {\n return (\n <FormField\n control={control}\n name={props.name}\n render={({ field, fieldState }) => {\n const CustomEmailField = components.email as React.ComponentType<any>;\n return (\n <CustomEmailField\n field={{\n ...field,\n onChange: (value: any) => {\n field.onChange(value);\n props.onChange?.(value);\n },\n }}\n fieldState={fieldState}\n fieldData={props}\n />\n );\n }}\n />\n );\n }\n\n return <TextField {...props} type=\"email\" />;\n}\n","import { CheckBoxField } from '@/src/components/form/fields/CheckBoxField';\nimport { DatePickerField } from '@/src/components/form/fields/DatePickerField';\nimport { FieldSetField } from '@/src/components/form/fields/FieldSetField';\nimport { FileUploadField } from '@/src/components/form/fields/FileUploadField';\nimport { NumberField } from '@/src/components/form/fields/NumberField';\nimport { RadioGroupField } from '@/src/components/form/fields/RadioGroupField';\nimport { SelectField } from '@/src/components/form/fields/SelectField';\nimport { TextAreaField } from '@/src/components/form/fields/TextAreaField';\nimport { TextField } from '@/src/components/form/fields/TextField';\nimport { EmailField } from '@/src/components/form/fields/EmailField';\nimport { SupportedTypes } from '@/src/components/form/fields/types';\nimport React from 'react';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const fieldsMap: Record<SupportedTypes, React.ComponentType<any>> = {\n checkbox: CheckBoxField,\n text: TextField,\n email: EmailField,\n money: NumberField,\n select: SelectField,\n radio: RadioGroupField,\n number: NumberField,\n file: FileUploadField,\n fieldset: FieldSetField,\n date: DatePickerField,\n textarea: TextAreaField,\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { fieldsMap } from '@/src/components/form/fields/fieldsMapping';\nimport { SupportedTypes } from '@/src/components/form/fields/types';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport React, { Fragment } from 'react';\nimport { Statement, StatementProps } from './Statement';\nimport { ForcedValueField } from './fields/ForcedValueField';\n\ntype JSONSchemaFormFieldsProps = {\n fields: Fields;\n};\n\nfunction checkFieldHasForcedValue(field: any) {\n // A field to be considered \"forced value\" must:\n return (\n field.const !== undefined && // Only accepts a specific value\n field.const === field.default && // It can be prefilled, meaning it's not critical\n field.inputType !== 'checkbox' && // Because checkbox must always be visible\n field.inputType !== 'hidden' // Because hidden inputs shouldn't be visible\n );\n}\n\nexport const JSONSchemaFormFields = ({ fields }: JSONSchemaFormFieldsProps) => {\n if (!fields || fields.length === 0) return null;\n\n return (\n <>\n {fields.map((field) => {\n if (field.isVisible === false || field.deprecated) {\n return null; // Skip hidden or deprecated fields\n }\n\n if (checkFieldHasForcedValue(field)) {\n return (\n <ForcedValueField\n key={field.name as string}\n name={field.name as string}\n description={field.description as string}\n value={field.const as string}\n statement={field.statement as any}\n />\n );\n }\n\n const FieldComponent = fieldsMap[field.inputType as SupportedTypes];\n return FieldComponent ? (\n <Fragment key={field.name as string}>\n <FieldComponent {...field} />\n {field.statement ? (\n <Statement {...(field.statement as StatementProps)} />\n ) : null}\n </Fragment>\n ) : (\n <p className=\"error\">\n Field type {field.inputType as string} not supported\n </p>\n );\n })}\n </>\n );\n};\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nconst alertVariants = cva(\n 'relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground',\n destructive:\n 'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90',\n warning:\n 'bg-card bg-warning border-warning-border [&>svg]:text-current',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nfunction Alert({\n className,\n variant,\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>) {\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\n 'col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDescription({\n className,\n ...props\n}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n 'text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Alert, AlertDescription, AlertTitle };\n","import { Alert, AlertDescription, AlertTitle } from '@/src/components/ui/alert';\nimport { useFormFields } from '@/src/context';\nimport { AlertCircle } from 'lucide-react';\nimport React from 'react';\n\nexport type StatementProps = {\n title: string;\n description: string;\n severity: 'warning' | 'error' | 'success' | 'info' | 'neutral' | 'time';\n};\n\nexport function Statement({ title, description, severity }: StatementProps) {\n const { components } = useFormFields();\n\n if (components?.statement) {\n const CustomStatement = components?.statement;\n return (\n <CustomStatement\n data={{\n title,\n description,\n severity,\n }}\n />\n );\n }\n\n return (\n <Alert variant=\"warning\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertTitle>{title}</AlertTitle>\n <AlertDescription>{description}</AlertDescription>\n </Alert>\n );\n}\n","import React, { useEffect } from 'react';\nimport { useFormContext } from 'react-hook-form';\n\ntype ForcedValueFieldProps = {\n name: string;\n value: string;\n description: string;\n statement: {\n title: string;\n description: string;\n };\n};\n\nexport function ForcedValueField({\n name,\n value,\n description,\n statement,\n}: ForcedValueFieldProps) {\n const { setValue } = useFormContext();\n\n useEffect(() => {\n setValue(name, value);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div>\n <p\n className={`text-sm RemoteFlows__ForcedValue__Title__${name}`}\n dangerouslySetInnerHTML={{ __html: statement.title }}\n />\n <p\n className={`text-xs RemoteFlows__ForcedValue__Description__${name}`}\n dangerouslySetInnerHTML={{\n __html: statement.description || description,\n }}\n />\n </div>\n );\n}\n"],"mappings":"kPAEA,UAAYA,MAAW,QACvB,UAAYC,M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C,CAAE,OAAAE,CAAO,IACxC,CAACA,GAAUA,EAAO,SAAW,EAAU,KAGzCC,EAAA,cAAAA,EAAA,cACGD,EAAO,IAAKH,GAAU,CACrB,GAAIA,EAAM,YAAc,IAASA,EAAM,WACrC,OAAO,KAGT,GAAID,GAAyBC,CAAK,EAChC,OACEI,EAAA,cAACC,GAAA,CACC,IAAKL,EAAM,KACX,KAAMA,EAAM,KACZ,YAAaA,EAAM,YACnB,MAAOA,EAAM,MACb,UAAWA,EAAM,UACnB,EAIJ,IAAMM,EAAiBC,EAAUP,EAAM,SAA2B,EAClE,OAAOM,EACLF,EAAA,cAACI,GAAA,CAAS,IAAKR,EAAM,MACnBI,EAAA,cAACE,EAAA,CAAgB,GAAGN,EAAO,EAC1BA,EAAM,UACLI,EAAA,cAACK,GAAA,CAAW,GAAIT,EAAM,UAA8B,EAClD,IACN,EAEAI,EAAA,cAAC,KAAE,UAAU,SAAQ,cACPJ,EAAM,UAAoB,gBACxC,CAEJ,CAAC,CACH,EApCgC","names":["React","CheckboxPrimitive","Check","Checkbox","className","props","ref","cn","Check","React","useFormContext","CheckBoxField","name","defaultValue","description","label","onChange","multiple","options","rest","components","useFormFields","control","useFormContext","handleCheckboxChange","__name","optionId","checked","field","currentValues","value","FormField","fieldState","CustomCheckboxField","customCheckboxFieldProps","evt","FormItem","cn","FormControl","option","Checkbox","FormLabel","event","FormDescription","FormMessage","CalendarIcon","React","useFormContext","React","ChevronLeft","ChevronRight","DayPicker","Calendar","className","classNames","showOutsideDays","props","DayPicker","cn","buttonVariants","__name","ChevronLeft","ChevronRight","React","PopoverPrimitive","Popover","props","__name","PopoverTrigger","PopoverContent","className","align","sideOffset","cn","PopoverClose","format","DatePickerField","description","label","name","minDate","onChange","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomDatePickerField","customDatePickerFieldProps","__name","value","FormItem","FormLabel","Popover","PopoverTrigger","FormControl","Button","cn","format","CalendarIcon","PopoverContent","Calendar","date","props","PopoverClose","FormDescription","FormMessage","React","FieldSetField","label","name","fields","description","cn","field","FieldComponent","fieldsMap","__name","React","useFormContext","React","useState","useRef","Upload","X","FileUploader","onChange","className","multiple","files","setFiles","useState","inputRef","useRef","handleClick","__name","handleChange","e","newFiles","onRemoveFile","file","prevFiles","f","React","cn","Button","Upload","index","X","toBase64","__name","file","resolve","reject","reader","error","convertFilesToBase64","event","files","base64","FileUploadField","name","description","label","multiple","onChange","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomFileUploadField","customFileUploadFieldProps","value","FormItem","FormLabel","FormControl","FileUploader","cn","FormDescription","FormMessage","React","useFormContext","React","useFormContext","React","Input","className","type","props","cn","__name","TextField","name","description","label","type","onChange","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomTextField","customTextFieldProps","__name","value","FormItem","FormLabel","FormControl","Input","event","FormDescription","FormMessage","NumberField","props","components","useFormFields","control","useFormContext","React","FormField","field","fieldState","CustomNumberField","__name","value","TextField","RadioGroupPrimitive","CircleIcon","React","RadioGroup","className","props","cn","__name","RadioGroupItem","CircleIcon","React","useFormContext","RadioGroupField","name","defaultValue","description","label","options","onChange","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomRadioGroupField","customRadioGroupFieldProps","__name","value","FormItem","cn","FormLabel","FormControl","RadioGroup","option","RadioGroupItem","FormDescription","FormMessage","React","React","SelectPrimitive","CheckIcon","ChevronDownIcon","ChevronUpIcon","Select","props","__name","SelectGroup","SelectValue","SelectTrigger","className","children","cn","ChevronDownIcon","SelectContent","position","SelectScrollUpButton","SelectScrollDownButton","SelectItem","className","children","props","cn","CheckIcon","__name","SelectScrollUpButton","className","props","cn","ChevronUpIcon","__name","SelectScrollDownButton","ChevronDownIcon","useFormContext","SelectField","label","name","options","defaultValue","description","onChange","rest","control","useFormContext","components","useFormFields","FormField","field","fieldState","CustomSelectField","customSelectFieldProps","__name","value","FormItem","FormLabel","FormControl","Select","SelectTrigger","SelectValue","SelectContent","SelectGroup","option","SelectItem","FormDescription","FormMessage","React","useFormContext","React","Textarea","className","props","ref","cn","TextAreaField","name","description","label","onChange","maxLength","rest","components","useFormFields","control","useFormContext","FormField","field","fieldState","CustomTextAreaField","customTextAreaFieldProps","__name","value","valueLength","FormItem","FormLabel","FormControl","Textarea","event","cn","FormDescription","FormMessage","React","useFormContext","EmailField","props","components","useFormFields","control","useFormContext","React","FormField","field","fieldState","CustomEmailField","__name","value","TextField","fieldsMap","CheckBoxField","TextField","EmailField","NumberField","SelectField","RadioGroupField","FileUploadField","FieldSetField","DatePickerField","TextAreaField","React","Fragment","cva","React","alertVariants","cva","Alert","className","variant","props","cn","__name","AlertTitle","AlertDescription","AlertCircle","React","Statement","title","description","severity","components","useFormFields","CustomStatement","React","Alert","AlertCircle","AlertTitle","AlertDescription","__name","React","useEffect","useFormContext","ForcedValueField","name","value","description","statement","setValue","useFormContext","useEffect","React","__name","checkFieldHasForcedValue","field","__name","JSONSchemaFormFields","fields","React","ForcedValueField","FieldComponent","fieldsMap","Fragment","Statement"]}
|
package/dist/chunk-RL2KU7BM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={data:{version:7,schema:{additionalProperties:!1,allOf:[{if:{properties:{customer_informed_employee:{const:"yes"}},required:["customer_informed_employee"]},then:{properties:{customer_informed_employee_date:{type:"string"},customer_informed_employee_description:{type:"string"}},required:["customer_informed_employee_date","customer_informed_employee_description"]},else:{properties:{customer_informed_employee_date:!1,customer_informed_employee_description:!1}}},{if:{properties:{will_challenge_termination:{const:"yes"}},required:["will_challenge_termination"]},then:{properties:{will_challenge_termination_description:{type:"string"}},required:["will_challenge_termination_description"]},else:{properties:{will_challenge_termination_description:!1}}},{if:{properties:{agrees_to_pto_amount:{const:"no"}},required:["agrees_to_pto_amount"]},then:{properties:{agrees_to_pto_amount_notes:{type:"string"}},required:["agrees_to_pto_amount_notes"]},else:{properties:{agrees_to_pto_amount_notes:!1,timesheet_file:!1}}}],properties:{confidential:{description:"Confidential requests are visible only to you. Non-confidential requests are visible to all admins in your company.",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Is this request confidential?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},customer_informed_employee:{description:"",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Have you informed the employee of the termination?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},customer_informed_employee_date:{description:"",format:"date",maxLength:255,title:"When the employee was told about the termination",type:["string","null"],"x-jsf-presentation":{inputType:"date"}},customer_informed_employee_description:{description:"",maxLength:1e3,title:"How did you share this information?",type:["string","null"],"x-jsf-presentation":{inputType:"textarea"}},personal_email:{description:"",maxLength:255,title:"Employee\u2019s personal email",format:"email",type:"string","x-jsf-presentation":{inputType:"email"}},termination_reason:{title:"Termination reason",description:"Make sure you choose an accurate termination reason to avoid unfair or unlawful dismissal claims.",type:"string",oneOf:[{const:"gross_misconduct",title:"Gross misconduct"},{const:"performance",title:"Performance"},{const:"workforce_reduction",title:"Workforce Reduction"},{const:"values",title:"Values"},{const:"compliance_issue",title:"Compliance issue"},{const:"incapacity_to_perform_inherent_duties",title:"Incapacity To perform inherent duties"},{const:"mutual_agreement",title:"Mutual agreement"},{const:"cancellation_before_start_date",title:"Decision to cancel hiring before the employee starts"},{const:"job_abandonment",title:"Job abandonment"},{const:"dissatisfaction_with_remote_service",title:"Dissatisfaction with EOR service"},{const:"end_of_fixed_term_contract_compliance_issue",title:"End of fixed-term contract"},{const:"other",title:"Other"}],"x-jsf-presentation":{inputType:"select"}},reason_description:{description:"",maxLength:1e3,title:"Termination reason details",type:"string","x-jsf-presentation":{inputType:"textarea"}},additional_comments:{description:"",maxLength:1e3,title:"Additional details regarding this termination process.",type:"string","x-jsf-presentation":{inputType:"textarea"}},termination_reason_files:{description:"Please upload any supporting documents regarding the termination reason.",title:"Termination reason files",type:"string","x-jsf-presentation":{inputType:"file",accept:".pdf",multiple:!0}},risk_assessment_reasons:{description:"",title:"This employee is...",type:"array",items:{anyOf:[{const:"sick_leave",title:"Currently on or recently returned from sick leave"},{const:"family_leave",title:"Currently on or recently returned from maternity, paternity, or other family leave"},{const:"pregnant_or_breastfeeding",title:"Pregnant or breastfeeding"},{const:"requested_medical_or_family_leave",title:"Requested medical or family leave"},{const:"disabled_or_health_condition",title:"Disabled or has a health condition"},{const:"member_of_union_or_works_council",title:"A member of a union or works council"},{const:"caring_responsibilities",title:"Caring responsibilities"},{const:"reported_concerns_with_workplace",title:"Reported any wrongdoing; raised any allegations of discrimination, harassment, retaliation, etc.; or asserted their employment rights or raised complaints about their working conditions"},{const:"none_of_these",title:"To the best of my knowledge, I am not aware of any of these"}]},"x-jsf-presentation":{inputType:"checkbox",direction:"column"}},will_challenge_termination:{description:"",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Do you consider it is likely that the employee will challenge their termination?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},will_challenge_termination_description:{description:"",maxLength:1e3,title:"Please explain how the employee will challenge their termination",type:["string","null"],"x-jsf-presentation":{inputType:"textarea"}},proposed_termination_date:{description:"",format:"date",maxLength:255,title:"Proposed termination date",type:"string","x-jsf-presentation":{inputType:"date"}},agrees_to_pto_amount:{description:"",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Are these paid time off records correct?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},agrees_to_pto_amount_notes:{description:"Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.",maxLength:1e3,title:"Provide time off details",type:["string","null"],"x-jsf-presentation":{inputType:"textarea"}},timesheet_file:{description:"Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.",title:"Timesheet document",type:["string","null"],"x-jsf-presentation":{inputType:"file",accept:".pdf"}},acknowledge_termination_procedure:{description:"",title:"I, {{username}} have read and agree to the procedures as defined in the termination form.",type:"boolean","x-jsf-presentation":{direction:"column",inputType:"checkbox"}}},required:["confidential","customer_informed_employee","personal_email","termination_reason","reason_description","risk_assessment_reasons","will_challenge_termination","proposed_termination_date","agrees_to_pto_amount","acknowledge_termination_procedure"],type:"object","x-jsf-order":["is_confidential","customer_informed_employee","customer_informed_employee_date","customer_informed_employee_description","personal_email","termination_reason","reason_description","additional_comments","termination_reason_files","risk_assessment_reasons","will_challenge_termination","will_challenge_termination_description","proposed_termination_date","agrees_to_pto_amount","agrees_to_pto_amount_notes","timesheet_file","acknowledge_termination_procedure"]}}};export{e as a};
|
|
2
|
-
//# sourceMappingURL=chunk-RL2KU7BM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Termination/jsonSchema.ts"],"sourcesContent":["export const jsonSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [\n {\n if: {\n properties: {\n customer_informed_employee: {\n const: 'yes', // Ensure this matches the value in the form data\n },\n },\n required: ['customer_informed_employee'], // Ensure this field is required\n },\n then: {\n properties: {\n customer_informed_employee_date: {\n type: 'string',\n },\n customer_informed_employee_description: {\n type: 'string',\n },\n },\n required: [\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n ], // Make the field required when condition is met\n },\n else: {\n properties: {\n customer_informed_employee_date: false,\n customer_informed_employee_description: false,\n },\n },\n },\n {\n if: {\n properties: {\n will_challenge_termination: {\n const: 'yes',\n },\n },\n required: ['will_challenge_termination'],\n },\n then: {\n properties: {\n will_challenge_termination_description: {\n type: 'string',\n },\n },\n required: ['will_challenge_termination_description'],\n },\n else: {\n properties: {\n will_challenge_termination_description: false,\n },\n },\n },\n {\n if: {\n properties: {\n agrees_to_pto_amount: {\n const: 'no',\n },\n },\n required: ['agrees_to_pto_amount'],\n },\n then: {\n properties: {\n agrees_to_pto_amount_notes: {\n type: 'string',\n },\n },\n required: ['agrees_to_pto_amount_notes'],\n },\n else: {\n properties: {\n agrees_to_pto_amount_notes: false,\n timesheet_file: false,\n },\n },\n },\n ],\n properties: {\n confidential: {\n description:\n 'Confidential requests are visible only to you. Non-confidential requests are visible to all admins in your company.',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title: 'Is this request confidential?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n customer_informed_employee: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title: 'Have you informed the employee of the termination?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n customer_informed_employee_date: {\n description: '',\n format: 'date',\n maxLength: 255,\n title: 'When the employee was told about the termination',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'date',\n },\n },\n customer_informed_employee_description: {\n description: '',\n maxLength: 1000,\n title: 'How did you share this information?',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n personal_email: {\n description: '',\n maxLength: 255,\n title: 'Employee’s personal email',\n format: 'email',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'email',\n },\n },\n termination_reason: {\n title: 'Termination reason',\n description:\n 'Make sure you choose an accurate termination reason to avoid unfair or unlawful dismissal claims.',\n type: 'string',\n oneOf: [\n {\n const: 'gross_misconduct',\n title: 'Gross misconduct',\n },\n {\n const: 'performance',\n title: 'Performance',\n },\n {\n const: 'workforce_reduction',\n title: 'Workforce Reduction',\n },\n { const: 'values', title: 'Values' },\n {\n const: 'compliance_issue',\n title: 'Compliance issue',\n },\n {\n const: 'incapacity_to_perform_inherent_duties',\n title: 'Incapacity To perform inherent duties',\n },\n {\n const: 'mutual_agreement',\n title: 'Mutual agreement',\n },\n {\n const: 'cancellation_before_start_date',\n title: 'Decision to cancel hiring before the employee starts',\n },\n {\n const: 'job_abandonment',\n title: 'Job abandonment',\n },\n {\n const: 'dissatisfaction_with_remote_service',\n title: 'Dissatisfaction with EOR service',\n },\n {\n const: 'end_of_fixed_term_contract_compliance_issue',\n title: 'End of fixed-term contract',\n },\n { const: 'other', title: 'Other' },\n ],\n 'x-jsf-presentation': {\n inputType: 'select',\n },\n },\n reason_description: {\n description: '',\n maxLength: 1000,\n title: 'Termination reason details',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n additional_comments: {\n description: '',\n maxLength: 1000,\n title: 'Additional details regarding this termination process.',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n termination_reason_files: {\n description:\n 'Please upload any supporting documents regarding the termination reason.',\n title: 'Termination reason files',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: '.pdf',\n multiple: true,\n },\n },\n risk_assessment_reasons: {\n description: '',\n title: 'This employee is...',\n type: 'array',\n items: {\n anyOf: [\n {\n const: 'sick_leave',\n title: 'Currently on or recently returned from sick leave',\n },\n {\n const: 'family_leave',\n title:\n 'Currently on or recently returned from maternity, paternity, or other family leave',\n },\n {\n const: 'pregnant_or_breastfeeding',\n title: 'Pregnant or breastfeeding',\n },\n {\n const: 'requested_medical_or_family_leave',\n title: 'Requested medical or family leave',\n },\n {\n const: 'disabled_or_health_condition',\n title: 'Disabled or has a health condition',\n },\n {\n const: 'member_of_union_or_works_council',\n title: 'A member of a union or works council',\n },\n {\n const: 'caring_responsibilities',\n title: 'Caring responsibilities',\n },\n {\n const: 'reported_concerns_with_workplace',\n title:\n 'Reported any wrongdoing; raised any allegations of discrimination, harassment, retaliation, etc.; or asserted their employment rights or raised complaints about their working conditions',\n },\n {\n const: 'none_of_these',\n title:\n 'To the best of my knowledge, I am not aware of any of these',\n },\n ],\n },\n 'x-jsf-presentation': {\n inputType: 'checkbox',\n direction: 'column',\n },\n },\n will_challenge_termination: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title:\n 'Do you consider it is likely that the employee will challenge their termination?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n will_challenge_termination_description: {\n description: '',\n maxLength: 1000,\n title:\n 'Please explain how the employee will challenge their termination',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n proposed_termination_date: {\n description: '',\n format: 'date',\n maxLength: 255,\n title: 'Proposed termination date',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'date',\n },\n },\n agrees_to_pto_amount: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title: 'Are these paid time off records correct?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n agrees_to_pto_amount_notes: {\n description:\n 'Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.',\n maxLength: 1000,\n title: 'Provide time off details',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n timesheet_file: {\n description:\n 'Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.',\n title: 'Timesheet document',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: '.pdf',\n },\n },\n acknowledge_termination_procedure: {\n description: '',\n title:\n 'I, {{username}} have read and agree to the procedures as defined in the termination form.',\n type: 'boolean',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'checkbox',\n },\n },\n },\n required: [\n 'confidential',\n 'customer_informed_employee',\n 'personal_email',\n 'termination_reason',\n 'reason_description',\n 'risk_assessment_reasons',\n 'will_challenge_termination',\n 'proposed_termination_date',\n 'agrees_to_pto_amount',\n 'acknowledge_termination_procedure',\n ],\n type: 'object',\n 'x-jsf-order': [\n 'is_confidential',\n 'customer_informed_employee',\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n 'personal_email',\n 'termination_reason',\n 'reason_description',\n 'additional_comments',\n 'termination_reason_files',\n 'risk_assessment_reasons',\n 'will_challenge_termination',\n 'will_challenge_termination_description',\n 'proposed_termination_date',\n 'agrees_to_pto_amount',\n 'agrees_to_pto_amount_notes',\n 'timesheet_file',\n 'acknowledge_termination_procedure',\n ],\n },\n },\n};\n"],"mappings":"AAAO,IAAMA,EAAa,CACxB,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CACL,CACE,GAAI,CACF,WAAY,CACV,2BAA4B,CAC1B,MAAO,KACT,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,gCAAiC,CAC/B,KAAM,QACR,EACA,uCAAwC,CACtC,KAAM,QACR,CACF,EACA,SAAU,CACR,kCACA,wCACF,CACF,EACA,KAAM,CACJ,WAAY,CACV,gCAAiC,GACjC,uCAAwC,EAC1C,CACF,CACF,EACA,CACE,GAAI,CACF,WAAY,CACV,2BAA4B,CAC1B,MAAO,KACT,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,uCAAwC,CACtC,KAAM,QACR,CACF,EACA,SAAU,CAAC,wCAAwC,CACrD,EACA,KAAM,CACJ,WAAY,CACV,uCAAwC,EAC1C,CACF,CACF,EACA,CACE,GAAI,CACF,WAAY,CACV,qBAAsB,CACpB,MAAO,IACT,CACF,EACA,SAAU,CAAC,sBAAsB,CACnC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,CAC1B,KAAM,QACR,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,GAC5B,eAAgB,EAClB,CACF,CACF,CACF,EACA,WAAY,CACV,aAAc,CACZ,YACE,sHACF,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MAAO,gCACP,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,2BAA4B,CAC1B,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MAAO,qDACP,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,gCAAiC,CAC/B,YAAa,GACb,OAAQ,OACR,UAAW,IACX,MAAO,mDACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,MACb,CACF,EACA,uCAAwC,CACtC,YAAa,GACb,UAAW,IACX,MAAO,sCACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,eAAgB,CACd,YAAa,GACb,UAAW,IACX,MAAO,iCACP,OAAQ,QACR,KAAM,SACN,qBAAsB,CACpB,UAAW,OACb,CACF,EACA,mBAAoB,CAClB,MAAO,qBACP,YACE,oGACF,KAAM,SACN,MAAO,CACL,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,cACP,MAAO,aACT,EACA,CACE,MAAO,sBACP,MAAO,qBACT,EACA,CAAE,MAAO,SAAU,MAAO,QAAS,EACnC,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,wCACP,MAAO,uCACT,EACA,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,iCACP,MAAO,sDACT,EACA,CACE,MAAO,kBACP,MAAO,iBACT,EACA,CACE,MAAO,sCACP,MAAO,kCACT,EACA,CACE,MAAO,8CACP,MAAO,4BACT,EACA,CAAE,MAAO,QAAS,MAAO,OAAQ,CACnC,EACA,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,mBAAoB,CAClB,YAAa,GACb,UAAW,IACX,MAAO,6BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,oBAAqB,CACnB,YAAa,GACb,UAAW,IACX,MAAO,yDACP,KAAM,SACN,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,yBAA0B,CACxB,YACE,2EACF,MAAO,2BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,OACX,OAAQ,OACR,SAAU,EACZ,CACF,EACA,wBAAyB,CACvB,YAAa,GACb,MAAO,sBACP,KAAM,QACN,MAAO,CACL,MAAO,CACL,CACE,MAAO,aACP,MAAO,mDACT,EACA,CACE,MAAO,eACP,MACE,oFACJ,EACA,CACE,MAAO,4BACP,MAAO,2BACT,EACA,CACE,MAAO,oCACP,MAAO,mCACT,EACA,CACE,MAAO,+BACP,MAAO,oCACT,EACA,CACE,MAAO,mCACP,MAAO,sCACT,EACA,CACE,MAAO,0BACP,MAAO,yBACT,EACA,CACE,MAAO,mCACP,MACE,2LACJ,EACA,CACE,MAAO,gBACP,MACE,6DACJ,CACF,CACF,EACA,qBAAsB,CACpB,UAAW,WACX,UAAW,QACb,CACF,EACA,2BAA4B,CAC1B,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MACE,mFACF,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,uCAAwC,CACtC,YAAa,GACb,UAAW,IACX,MACE,mEACF,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,0BAA2B,CACzB,YAAa,GACb,OAAQ,OACR,UAAW,IACX,MAAO,4BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,MACb,CACF,EACA,qBAAsB,CACpB,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MAAO,2CACP,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,2BAA4B,CAC1B,YACE,sIACF,UAAW,IACX,MAAO,2BACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,eAAgB,CACd,YACE,4HACF,MAAO,qBACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,OACX,OAAQ,MACV,CACF,EACA,kCAAmC,CACjC,YAAa,GACb,MACE,4FACF,KAAM,UACN,qBAAsB,CACpB,UAAW,SACX,UAAW,UACb,CACF,CACF,EACA,SAAU,CACR,eACA,6BACA,iBACA,qBACA,qBACA,0BACA,6BACA,4BACA,uBACA,mCACF,EACA,KAAM,SACN,cAAe,CACb,kBACA,6BACA,kCACA,yCACA,iBACA,qBACA,qBACA,sBACA,2BACA,0BACA,6BACA,yCACA,4BACA,uBACA,6BACA,iBACA,mCACF,CACF,CACF,CACF","names":["jsonSchema"]}
|
package/dist/chunk-TIXDBKBM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk-SJ56GVNV.js";import{a}from"./chunk-AYDF3IFZ.js";import{Slot as p}from"@radix-ui/react-slot";import*as t from"react";import{Controller as x,FormProvider as C,useFormContext as P,useFormState as R}from"react-hook-form";import*as d from"react";import*as c from"@radix-ui/react-label";function u({className:e,...o}){return d.createElement(c.Root,{"data-slot":"label",className:n("flex items-center gap-2 text-sm leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",e),...o})}a(u,"Label");var $=C,F=t.createContext({}),w=a(({...e})=>t.createElement(F.Provider,{value:{name:e.name}},t.createElement(x,{...e})),"FormField"),l=a(()=>{let e=t.useContext(F),o=t.useContext(f),{getFieldState:r}=P(),i=R({name:e.name}),m=r(e.name,i);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:s}=o;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...m}},"useFormField"),f=t.createContext({});function D({className:e,...o}){let r=t.useId();return t.createElement(f.Provider,{value:{id:r}},t.createElement("div",{"data-slot":"form-item",className:n("grid gap-2",e),...o}))}a(D,"FormItem");function M({className:e,...o}){let{error:r,formItemId:i}=l();return t.createElement(u,{"data-slot":"form-label","data-error":!!r,className:n("text-base-color mb-1 data-[error=true]:text-destructive",e),htmlFor:i,...o})}a(M,"FormLabel");var b=t.forwardRef(({...e},o)=>{let{error:r,formItemId:i,formDescriptionId:m,formMessageId:s}=l();return t.createElement(p,{"data-slot":"form-control",ref:o,id:i,"aria-describedby":r?`${m} ${s}`:`${m}`,"aria-invalid":!!r,...e})});b.displayName="FormControl";function E({className:e,...o}){let{formDescriptionId:r}=l();return t.createElement("p",{"data-slot":"form-description",id:r,className:n("text-base-color text-xs",e),...o})}a(E,"FormDescription");function W({className:e,...o}){let{error:r,formMessageId:i}=l(),m=r?String(r?.message??""):o.children;return m?t.createElement("p",{"data-slot":"form-message",id:i,className:n("text-destructive text-sm",e),...o},m):null}a(W,"FormMessage");export{$ as a,w as b,D as c,M as d,b as e,E as f,W as g};
|
|
2
|
-
//# sourceMappingURL=chunk-TIXDBKBM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ui/form.tsx","../src/components/ui/label.tsx"],"sourcesContent":["import * as LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n useFormState,\n} from 'react-hook-form';\n\nimport { Label } from '@/src/components/ui/label';\nimport { cn } from '@/src/lib/utils';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue,\n);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue,\n);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div\n data-slot=\"form-item\"\n className={cn('grid gap-2', className)}\n {...props}\n />\n </FormItemContext.Provider>\n );\n}\n\nfunction FormLabel({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(\n 'text-base-color mb-1 data-[error=true]:text-destructive',\n className,\n )}\n htmlFor={formItemId}\n {...props}\n />\n );\n}\n\nconst FormControl = React.forwardRef<\n React.ComponentRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n\n return (\n <Slot\n data-slot=\"form-control\"\n ref={ref}\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n );\n});\n\nFormControl.displayName = 'FormControl';\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn('text-base-color text-xs', className)}\n {...props}\n />\n );\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? '') : props.children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n data-slot=\"form-message\"\n id={formMessageId}\n className={cn('text-destructive text-sm', className)}\n {...props}\n >\n {body}\n </p>\n );\n}\n\nexport {\n Form,\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n useFormField,\n};\n","'use client';\n\nimport * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'flex items-center gap-2 text-sm leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":"2EACA,OAAS,QAAAA,MAAY,uBACrB,UAAYC,MAAW,QACvB,OACE,cAAAC,EAIA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,MACK,kBCTP,UAAYC,MAAW,QACvB,UAAYC,MAAoB,wBAIhC,SAASC,EAAM,CACb,UAAAC,EACA,GAAGC,CACL,EAAqD,CACnD,OACE,gBAAgB,OAAf,CACC,YAAU,QACV,UAAWC,EACT,gJACAF,CACF,EACC,GAAGC,EACN,CAEJ,CAdSE,EAAAJ,EAAA,SDST,IAAMK,EAAOC,EASPC,EAAyB,gBAC7B,CAAC,CACH,EAEMC,EAAYC,EAAA,CAGhB,CACA,GAAGC,CACL,IAEI,gBAACH,EAAiB,SAAjB,CAA0B,MAAO,CAAE,KAAMG,EAAM,IAAK,GACnD,gBAACC,EAAA,CAAY,GAAGD,EAAO,CACzB,EATc,aAaZE,E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H,EACJ,mBACGD,EAEG,GAAGK,CAAiB,IAAIC,CAAa,GADrC,GAAGD,CAAiB,GAG1B,eAAc,CAAC,CAACL,EACf,GAAGhB,EACN,CAEJ,CAAC,EAEDmB,EAAY,YAAc,cAE1B,SAASK,EAAgB,CAAE,UAAAX,EAAW,GAAGb,CAAM,EAA8B,CAC3E,GAAM,CAAE,kBAAAqB,CAAkB,EAAInB,EAAa,EAE3C,OACE,gBAAC,KACC,YAAU,mBACV,GAAImB,EACJ,UAAWP,EAAG,0BAA2BD,CAAS,EACjD,GAAGb,EACN,CAEJ,CAXSD,EAAAyB,EAAA,mBAaT,SAASC,EAAY,CAAE,UAAAZ,EAAW,GAAGb,CAAM,EAA8B,CACvE,GAAM,CAAE,MAAAgB,EAAO,cAAAM,CAAc,EAAIpB,EAAa,EACxCwB,EAAOV,EAAQ,OAAOA,GAAO,SAAW,EAAE,EAAIhB,EAAM,SAE1D,OAAK0B,EAKH,gBAAC,KACC,YAAU,eACV,GAAIJ,EACJ,UAAWR,EAAG,2BAA4BD,CAAS,EAClD,GAAGb,GAEH0B,CACH,EAXO,IAaX,CAlBS3B,EAAA0B,EAAA","names":["Slot","React","Controller","FormProvider","useFormContext","useFormState","React","LabelPrimitive","Label","className","props","cn","__name","Form","FormProvider","FormFieldContext","FormField","__name","props","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","useFormContext","formState","useFormState","fieldState","id","FormItem","className","cn","FormLabel","error","formItemId","Label","FormControl","ref","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","body"]}
|
package/dist/chunk-XFE56PM4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as c}from"./chunk-RL2KU7BM.js";import{b as p}from"./chunk-36UPHOJS.js";import{a as f}from"./chunk-JRQSZHUU.js";import{b as l}from"./chunk-G2GI6FEO.js";import{c as a}from"./chunk-6DMCAUPE.js";import{d as u}from"./chunk-WRDKLT4N.js";import{a as e}from"./chunk-AYDF3IFZ.js";import{createHeadlessForm as P,modify as C}from"@remoteoss/json-schema-form";import{useMutation as M,useQuery as b}from"@tanstack/react-query";import{useState as w}from"react";import j from"lodash/omit";var H=e(()=>{let{client:t}=u();return M({mutationFn:e(r=>l({client:t,headers:{Authorization:""},body:r}),"mutationFn")})},"useCreateTermination"),J=e(({formValues:t,jsfModify:r})=>b({queryKey:["rmt-flows-termination-schema"],queryFn:e(()=>c,"queryFn"),select:e(({data:s})=>{let{schema:m}=C(s.schema,r||{});return P(m||{},{initialValues:t||{}})},"select")}),"useTerminationSchema"),U=e(({employmentId:t,options:r})=>{let[s,m]=w(void 0),{data:o,isLoading:y}=J({formValues:s,jsfModify:r?.jsfModify}),d=H(),{mutateAsync:_}=f(d);async function V(n){if(!t)throw new Error("Employment id is missing");if(o){let i=a(n,o.fields),{customer_informed_employee:F}=i,T=F==="yes"?{employee_awareness:{date:i.customer_informed_employee_date,note:i.customer_informed_employee_description}}:void 0,g=p(i,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),h=j(g,"customer_informed_employee_date","customer_informed_employee_description"),S={employment_id:t,termination_details:{...h,...T},type:"termination"};return _(S)}}return e(V,"onSubmit"),{stepState:{current:0,total:1,isLastStep:!0},fields:o?.fields||[],isLoading:y,isSubmitting:d.isPending,initialValues:{},handleValidation:e(n=>{if(o){let i=a(n,o?.fields);return o?.handleValidation(i)}return null},"handleValidation"),checkFieldUpdates:e(n=>{if(o){let i=a(n,o?.fields);m(i)}},"checkFieldUpdates"),onSubmit:V}},"useTermination");export{U as a};
|
|
2
|
-
//# sourceMappingURL=chunk-XFE56PM4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Termination/hooks.ts"],"sourcesContent":["import { CreateOffboardingParams, postCreateOffboarding } from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { Client } from '@hey-api/client-fetch';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { jsonSchema } from './jsonSchema';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport { useState } from 'react';\nimport { JSFModify } from '@/src/flows/CostCalculator/types';\nimport { TerminationFormValues } from '@/src/flows/Termination/types';\nimport { useClient } from '@/src/context';\nimport omit from 'lodash/omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\n\nconst useCreateTermination = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: CreateOffboardingParams) => {\n return postCreateOffboarding({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n });\n },\n });\n};\n\nconst useTerminationSchema = ({\n formValues,\n jsfModify,\n}: {\n formValues?: TerminationFormValues;\n jsfModify?: JSFModify;\n}) => {\n return useQuery({\n queryKey: ['rmt-flows-termination-schema'],\n queryFn: () => {\n return jsonSchema;\n },\n select: ({ data }) => {\n const { schema } = modify(data.schema, jsfModify || {});\n const form = createHeadlessForm(schema || {}, {\n initialValues: formValues || {},\n });\n return form;\n },\n });\n};\n\ntype TerminationHookProps = {\n employmentId: string;\n options?: {\n jsfModify?: JSFModify;\n };\n};\n\nexport const useTermination = ({\n employmentId,\n options,\n}: TerminationHookProps) => {\n const [formValues, setFormValues] = useState<\n TerminationFormValues | undefined\n >(undefined);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({ formValues, jsfModify: options?.jsfModify });\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm.fields,\n );\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: {\n ...normalizedValues,\n ...employeeAwareness,\n } as TerminationFormValues,\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n return {\n stepState: {\n current: 0,\n total: 1,\n isLastStep: true,\n },\n fields: terminationHeadlessForm?.fields || [],\n isLoading: isLoadingTermination,\n isSubmitting: createTermination.isPending,\n initialValues: {},\n handleValidation: (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n },\n checkFieldUpdates: (values: Partial<TerminationFormValues>) => {\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n setFormValues(parsedValues as TerminationFormValues);\n }\n },\n onSubmit,\n };\n};\n"],"mappings":"wRAGA,OAAS,sBAAAA,EAAoB,UAAAC,MAAc,8BAC3C,OAAS,eAAAC,EAAa,YAAAC,MAAgB,wBAGtC,OAAS,YAAAC,MAAgB,QAIzB,OAAOC,MAAU,cAGjB,IAAMC,EAAuBC,EAAA,IAAM,CACjC,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAY,CACjB,WAAYH,EAACI,GACJC,EAAsB,CAC3B,OAAQJ,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAMG,CACR,CAAC,EAPS,aASd,CAAC,CACH,EAb6B,wBAevBE,EAAuBN,EAAA,CAAC,CAC5B,WAAAO,EACA,UAAAC,CACF,IAISC,EAAS,CACd,SAAU,CAA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AkB,UAChC,cAAe,CAAC,EAChB,iBAAkBtB,EAAC0B,GAAkC,CACnD,GAAIN,EAAyB,CAC3B,IAAMO,EAAeC,EACnBF,EACAN,GAAyB,MAC3B,EACA,OAAOA,GAAyB,iBAAiBO,CAAY,CAC/D,CACA,OAAO,IACT,EATkB,oBAUlB,kBAAmB3B,EAAC0B,GAA2C,CAC7D,GAAIN,EAAyB,CAC3B,IAAMO,EAAeC,EACnBF,EACAN,GAAyB,MAC3B,EACAF,EAAcS,CAAqC,CACrD,CACF,EARmB,qBASnB,SAAAF,CACF,CACF,EAtG8B","names":["createHeadlessForm","modify","useMutation","useQuery","useState","omit","useCreateTermination","__name","client","useClient","useMutation","payload","postCreateOffboarding","useTerminationSchema","formValues","jsfModify","useQuery","jsonSchema","data","schema","modify","createHeadlessForm","useTermination","employmentId","options","setFormValues","useState","terminationHeadlessForm","isLoadingTermination","createTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseJSFToValidate","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationPayload"]}
|
package/dist/chunk-Y5UG6SJJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as l}from"./chunk-DZYFSFZ7.js";import{a as m}from"./chunk-LUCFM5TE.js";import{b as a}from"./chunk-A4RX3KRZ.js";import{a as s}from"./chunk-TIXDBKBM.js";import{a as t}from"./chunk-AYDF3IFZ.js";import n,{useEffect as S}from"react";import{useForm as h}from"react-hook-form";function E({username:d,onSubmit:f,onError:u,onSuccess:c}){let{formId:p,terminationBag:o}=l(),F=a(o.handleValidation),i=h({resolver:F,defaultValues:o?.initialValues,shouldUnregister:!0,mode:"onBlur"});S(()=>{let r=i?.watch(e=>{Object.keys(i.formState.dirtyFields).length>0&&o?.checkFieldUpdates(e)});return()=>r?.unsubscribe()},[]);let b=t(async r=>{await f?.(r);let e=await o?.onSubmit(r);e?.error?u?.(e.error):e?.data&&c?.(e.data)},"handleSubmit"),g=(o?.fields?o.fields:[]).map(r=>r.name==="acknowledge_termination_procedure"?{...r,label:r.label.replace("{{username}}",d)}:r);return n.createElement(s,{...i},n.createElement("form",{id:p,onSubmit:i.handleSubmit(b),className:"space-y-4 RemoteFlows__TerminationForm"},n.createElement(m,{fields:g})))}t(E,"TerminationForm");export{E as a};
|
|
2
|
-
//# sourceMappingURL=chunk-Y5UG6SJJ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Termination/TerminationForm.tsx"],"sourcesContent":["import { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { Form } from '@/src/components/ui/form';\nimport React, { useEffect } from 'react';\nimport { useTerminationContext } from './context';\nimport { TerminationFormValues } from '@/src/flows/Termination/types';\nimport { OffboardingResponse, PostCreateOffboardingError } from '@/src/client';\nimport { useForm } from 'react-hook-form';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/yupValidationResolver';\n\ntype TerminationFormProps = {\n username: string;\n onSubmit?: (values: TerminationFormValues) => Promise<void>;\n onError?: (error: PostCreateOffboardingError) => void;\n onSuccess?: (data: OffboardingResponse) => void;\n};\n\nexport function TerminationForm({\n username,\n onSubmit,\n onError,\n onSuccess,\n}: TerminationFormProps) {\n const { formId, terminationBag } = useTerminationContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n terminationBag.handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues: terminationBag?.initialValues,\n shouldUnregister: true,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n if (Object.keys(form.formState.dirtyFields).length > 0) {\n // TODO: for some reason isDirty doesn't work the first time we touch the form\n terminationBag?.checkFieldUpdates(\n values as Partial<TerminationFormValues>,\n );\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleSubmit = async (values: TerminationFormValues) => {\n await onSubmit?.(values);\n\n const terminationResult = await terminationBag?.onSubmit(values);\n\n if (terminationResult?.error) {\n onError?.(terminationResult.error);\n } else {\n if (terminationResult?.data) {\n onSuccess?.(terminationResult.data as OffboardingResponse);\n }\n }\n };\n\n const fields = terminationBag?.fields ? terminationBag.fields : [];\n\n const updatedFields = fields.map((field) => {\n if (field.name === 'acknowledge_termination_procedure') {\n return {\n ...field,\n label: (field.label as string).replace('{{username}}', username),\n };\n }\n return field;\n });\n\n return (\n <Form {...form}>\n <form\n id={formId}\n onSubmit={form.handleSubmit(handleSubmit)}\n className=\"space-y-4 RemoteFlows__TerminationForm\"\n >\n <JSONSchemaFormFields fields={updatedFields} />\n </form>\n </Form>\n );\n}\n"],"mappings":"wMAEA,OAAOA,GAAS,aAAAC,MAAiB,QAIjC,OAAS,WAAAC,MAAe,kBAUjB,SAASC,EAAgB,CAC9B,SAAAC,EACA,SAAAC,EACA,QAAAC,EACA,UAAAC,CACF,EAAyB,CACvB,GAAM,CAAE,OAAAC,EAAQ,eAAAC,CAAe,EAAIC,EAAsB,EAEnDC,EAAWC,EAEfH,EAAe,gBACjB,EAEMI,EAAOC,EAAQ,CACnB,SAAAH,EACA,cAAeF,GAAgB,cAC/B,iBAAkB,GAClB,KAAM,QACR,CAAC,EAEDM,EAAU,IAAM,CACd,IAAMC,EAAeH,GAAM,MAAOI,GAAW,CACvC,OAAO,KAAKJ,EAAK,UAAU,WAAW,EAAE,OAAS,GAEnDJ,GAAgB,kBACdQ,CACF,CAEJ,CAAC,EACD,MAAO,IAAMD,GAAc,YAAY,CAEzC,EAAG,CAAC,CAAC,EAEL,IAAME,EAAeC,EAAA,MAAOF,GAAkC,CAC5D,MAAMZ,IAAWY,CAAM,EAEvB,IAAMG,EAAoB,MAAMX,GAAgB,SAASQ,CAAM,EAE3DG,GAAmB,MACrBd,IAAUc,EAAkB,KAAK,EAE7BA,GAAmB,MACrBb,IAAYa,EAAkB,IAA2B,CAG/D,EAZqB,gBAgBfC,GAFSZ,GAAgB,OAASA,EAAe,OAAS,CAAC,GAEpC,IAAKa,GAC5BA,EAAM,OAAS,oCACV,CACL,GAAGA,EACH,MAAQA,EAAM,MAAiB,QAAQ,eAAgBlB,CAAQ,CACjE,EAEKkB,CACR,EAED,OACEC,EAAA,cAACC,EAAA,CAAM,GAAGX,GACRU,EAAA,cAAC,QACC,GAAIf,EACJ,SAAUK,EAAK,aAAaK,CAAY,EACxC,UAAU,0CAEVK,EAAA,cAACE,EAAA,CAAqB,OAAQJ,EAAe,CAC/C,CACF,CAEJ,CAtEgBF,EAAAhB,EAAA","names":["React","useEffect","useForm","TerminationForm","username","onSubmit","onError","onSuccess","formId","terminationBag","useTerminationContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","handleSubmit","__name","terminationResult","updatedFields","field","React","Form","JSONSchemaFormFields"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|