@remoteoss/remote-flows 0.0.3 → 0.0.4

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.
Files changed (71) hide show
  1. package/README.md +4 -460
  2. package/dist/chunk-6RRSUL7Q.js +2 -0
  3. package/dist/{chunk-K44YP7ZG.js.map → chunk-6RRSUL7Q.js.map} +1 -1
  4. package/dist/chunk-DARQDP44.js +2 -0
  5. package/dist/chunk-DARQDP44.js.map +1 -0
  6. package/dist/chunk-DYB3RWP7.js +20 -0
  7. package/dist/chunk-DYB3RWP7.js.map +1 -0
  8. package/dist/chunk-EEWCEZ3D.js +2 -0
  9. package/dist/chunk-EEWCEZ3D.js.map +1 -0
  10. package/dist/chunk-FGBEOUQK.js +1 -0
  11. package/dist/chunk-KEV7VRZ5.js +2 -0
  12. package/dist/chunk-KEV7VRZ5.js.map +1 -0
  13. package/dist/{chunk-DHJSRW7Y.js → chunk-LT4TLUWZ.js} +2 -2
  14. package/dist/chunk-OLJ2S6A6.js +2 -0
  15. package/dist/chunk-OLJ2S6A6.js.map +1 -0
  16. package/dist/chunk-P5PQMJ4T.js +2 -0
  17. package/dist/chunk-P5PQMJ4T.js.map +1 -0
  18. package/dist/chunk-ZEGD25G2.js +2 -0
  19. package/dist/chunk-ZEGD25G2.js.map +1 -0
  20. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.d.ts +8 -0
  21. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +2 -0
  22. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +36 -0
  23. package/dist/flows/CostCalculator/CostCalculatorFlow.js +2 -0
  24. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +29 -0
  25. package/dist/flows/CostCalculator/CostCalculatorForm.js +2 -0
  26. package/dist/flows/CostCalculator/CostCalculatorResetButton.d.ts +5 -0
  27. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +2 -0
  28. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.d.ts +5 -0
  29. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +2 -0
  30. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js.map +1 -0
  31. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.d.ts +2 -2
  32. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.d.ts +2 -2
  33. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.d.ts +2 -2
  34. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +2 -2
  35. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  36. package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.d.ts +2 -2
  37. package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.d.ts +2 -2
  38. package/dist/flows/CostCalculator/context.d.ts +38 -0
  39. package/dist/flows/CostCalculator/context.js +2 -0
  40. package/dist/flows/CostCalculator/context.js.map +1 -0
  41. package/dist/flows/CostCalculator/disclaimerUtils.d.ts +10 -0
  42. package/dist/flows/CostCalculator/disclaimerUtils.js +2 -0
  43. package/dist/flows/CostCalculator/disclaimerUtils.js.map +1 -0
  44. package/dist/flows/CostCalculator/hooks.d.ts +2 -17
  45. package/dist/flows/CostCalculator/hooks.js +1 -1
  46. package/dist/flows/CostCalculator/index.d.ts +9 -4
  47. package/dist/flows/CostCalculator/index.js +1 -1
  48. package/dist/flows/CostCalculator/types.d.ts +1 -1
  49. package/dist/flows/CostCalculator/utils.js +1 -1
  50. package/dist/index.d.ts +9 -4
  51. package/dist/index.js +1 -1
  52. package/package.json +1 -1
  53. package/dist/chunk-32G7XF2D.js +0 -2
  54. package/dist/chunk-32G7XF2D.js.map +0 -1
  55. package/dist/chunk-56PULCHS.js +0 -2
  56. package/dist/chunk-56PULCHS.js.map +0 -1
  57. package/dist/chunk-FX6BYIQS.js +0 -1
  58. package/dist/chunk-HMDVBCX2.js +0 -1
  59. package/dist/chunk-K44YP7ZG.js +0 -20
  60. package/dist/flows/CostCalculator/CostCalculator.d.ts +0 -65
  61. package/dist/flows/CostCalculator/CostCalculator.js +0 -2
  62. package/dist/flows/CostCalculator/Disclaimer/Disclaimer.d.ts +0 -8
  63. package/dist/flows/CostCalculator/Disclaimer/Disclaimer.js +0 -2
  64. package/dist/flows/CostCalculator/Disclaimer/index.d.ts +0 -2
  65. package/dist/flows/CostCalculator/Disclaimer/index.js +0 -2
  66. /package/dist/{chunk-FX6BYIQS.js.map → chunk-FGBEOUQK.js.map} +0 -0
  67. /package/dist/{chunk-DHJSRW7Y.js.map → chunk-LT4TLUWZ.js.map} +0 -0
  68. /package/dist/{chunk-HMDVBCX2.js.map → flows/CostCalculator/CostCalculatorDisclaimer.js.map} +0 -0
  69. /package/dist/flows/CostCalculator/{CostCalculator.js.map → CostCalculatorFlow.js.map} +0 -0
  70. /package/dist/flows/CostCalculator/{Disclaimer/Disclaimer.js.map → CostCalculatorForm.js.map} +0 -0
  71. /package/dist/flows/CostCalculator/{Disclaimer/index.js.map → CostCalculatorResetButton.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{b as n}from"./chunk-HHNKZK2V.js";import{a as e}from"./chunk-ATKR5HCM.js";import{b as r}from"./chunk-OLJ2S6A6.js";import{a as o}from"./chunk-AYDF3IFZ.js";import i from"react";function d(t){let{form:l,formId:m,costCalculatorBag:s}=r();return i.createElement(n,{type:"reset",className:e("RemoteFlows__CostCalculatorForm__ResetButton",t.className),form:m,onClick:u=>{s?.resetForm(),l.reset(),t.onClick?.(u)},...t},t.children)}o(d,"CostCalculatorResetButton");export{d as a};
2
+ //# sourceMappingURL=chunk-DARQDP44.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/CostCalculator/CostCalculatorResetButton.tsx"],"sourcesContent":["import { Button } from '@/src/components/ui/button';\nimport React, { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useCostCalculatorContext } from './context';\nimport { cn } from '@/src/lib/utils';\n\nexport function CostCalculatorResetButton(\n props: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>>,\n) {\n const { form, formId, costCalculatorBag } = useCostCalculatorContext();\n\n return (\n <Button\n type=\"reset\"\n className={cn(\n 'RemoteFlows__CostCalculatorForm__ResetButton',\n props.className,\n )}\n form={formId}\n onClick={(evt) => {\n costCalculatorBag?.resetForm();\n form.reset();\n props.onClick?.(evt);\n }}\n {...props}\n >\n {props.children}\n </Button>\n );\n}\n"],"mappings":"gKACA,OAAOA,MAAwD,QAIxD,SAASC,EACdC,EACA,CACA,GAAM,CAAE,KAAAC,EAAM,OAAAC,EAAQ,kBAAAC,CAAkB,EAAIC,EAAyB,EAErE,OACEC,EAAA,cAACC,EAAA,CACC,KAAK,QACL,UAAWC,EACT,+CACAP,EAAM,SACR,EACA,KAAME,EACN,QAAUM,GAAQ,CAChBL,GAAmB,UAAU,EAC7BF,EAAK,MAAM,EACXD,EAAM,UAAUQ,CAAG,CACrB,EACC,GAAGR,GAEHA,EAAM,QACT,CAEJ,CAvBgBS,EAAAV,EAAA","names":["React","CostCalculatorResetButton","props","form","formId","costCalculatorBag","useCostCalculatorContext","React","Button","cn","evt","__name"]}
@@ -0,0 +1,20 @@
1
+ var e={data:{id:4668194326797,title:"Disclaimer information on Cost of Employment calculations",body:`<h3 id="h_01HHJFVR5Q4F8A52F06EVG289R">Remote disclaimer</h3>
2
+ <p>The estimate provides a transparent detailed breakdown for in-country statutory social contributions, statutory benefits, and other benefits that may be required. Estimates do not take into account additional costs that may be incurred for relocation, visa, right-to-work requirements, or other activities.\xA0</p>
3
+ <p><strong>See also:</strong> <a href="https://support.remote.com/hc/en-us/articles/22329255813133">What other type of costs does the Cost Calculator not include?</a></p>
4
+ <h3 id="h_01HHJFVYRAAGDKJ36EZS8W6P5N">EOR services</h3>
5
+ <p>Our EOR services allow you to retain ownership of your employees' IP and inventions. Compliance, taxes, and payroll are handled by our local teams for a seamless end-to-end experience.</p>
6
+ <h3 id="h_01HHJFW4FQPGPK14FSM4XCY5MR">Pricing and payroll</h3>
7
+ <p>When it comes to payroll, legal and operational complexities are reduced to a single invoice for all of your Remote employees across every country you hire in \u2013 no hidden costs and no long-term commitments needed. Just a simple pricing structure that includes a fixed hiring fee for each EOR employee.</p>
8
+ <h3 id="01JMCR2YZ0GVTCXNPY88TADWQ1">Currency conversions</h3>
9
+ <p>When the employee currency differs from the billing currency, we use market rates to convert. The rate figures on this quote are a rough estimate. When the employee currency differs from the billing currency, we use market rates to convert. The rate figures on this quote are a rough estimated.</p>
10
+ <h3 id="h_01HHJFWD1TFB5DQ6B4WD5F1GY6">Employee off-boarding related costs</h3>
11
+ <p>The estimate here does not include any costs related to off-boarding of employees. Whilst we do not charge any processing fees when you want to off-board an employee, any other costs such as severance pay, covering remaining vacation days and etc will be charged back to you.<br><strong>See also:\xA0</strong><a href="https://support.remote.com/hc/en-us/articles/22329371247885">Are the costs of employee off-boarding included in the Cost Calculator?</a></p>
12
+ <p>Please note the \u2018employee net income estimate\u2019 section (if available for the country) is intended for informational purposes only and should not be used as a substitute for professional financial advice.</p>
13
+ <p>Additionally, tax laws and rates can vary by location and are subject to change, which may not be immediately reflected in the calculator.</p>
14
+ <p>For a detailed and accurate assessment of your take-home pay, please consult with a qualified tax professional or financial advisor.</p>
15
+ <p><strong>See also</strong>: <a href="https://support.remote.com/hc/en-us/articles/25196498469773">How to use the \u2018employee net income estimate\u2019 section in the Cost Calculator?</a></p>
16
+ <p><!-- notionvc: 04d0e276-e0d7-4793-93ee-d4ad14600217 --></p>
17
+ <h3 id="h_01HHJFWTHJ58YAZ87M3E090H4J">Note</h3>
18
+ <p>This estimate is for guidance only and may not constitute accurate financial advice. Information contained in this document is subject to changes in laws in different jurisdictions, which can change without notice. This document is the property of Remote, is confidential, cannot be reproduced without permission, and cannot be disclosed to any third parties.</p>
19
+ <p><!-- notionvc: 09e777b4-c10c-438e-bb95-ce1f3fb86c9a --></p>`,html_url:"https://support.remote.com/hc/en-us/articles/4668194326797-Disclaimer-information-on-Cost-of-Employment-calculations"}};export{e as a};
20
+ //# sourceMappingURL=chunk-DYB3RWP7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/CostCalculator/disclaimerUtils.ts"],"sourcesContent":["export const disclaimerData = {\n data: {\n id: 4668194326797,\n title: 'Disclaimer information on Cost of Employment calculations',\n body: '<h3 id=\"h_01HHJFVR5Q4F8A52F06EVG289R\">Remote disclaimer</h3>\\n<p>The estimate provides a transparent detailed breakdown for in-country statutory social contributions, statutory benefits, and other benefits that may be required. Estimates do not take into account additional costs that may be incurred for relocation, visa, right-to-work requirements, or other activities. </p>\\n<p><strong>See also:</strong> <a href=\"https://support.remote.com/hc/en-us/articles/22329255813133\">What other type of costs does the Cost Calculator not include?</a></p>\\n<h3 id=\"h_01HHJFVYRAAGDKJ36EZS8W6P5N\">EOR services</h3>\\n<p>Our EOR services allow you to retain ownership of your employees\\' IP and inventions. Compliance, taxes, and payroll are handled by our local teams for a seamless end-to-end experience.</p>\\n<h3 id=\"h_01HHJFW4FQPGPK14FSM4XCY5MR\">Pricing and payroll</h3>\\n<p>When it comes to payroll, legal and operational complexities are reduced to a single invoice for all of your Remote employees across every country you hire in – no hidden costs and no long-term commitments needed. Just a simple pricing structure that includes a fixed hiring fee for each EOR employee.</p>\\n<h3 id=\"01JMCR2YZ0GVTCXNPY88TADWQ1\">Currency conversions</h3>\\n<p>When the employee currency differs from the billing currency, we use market rates to convert. The rate figures on this quote are a rough estimate. When the employee currency differs from the billing currency, we use market rates to convert. The rate figures on this quote are a rough estimated.</p>\\n<h3 id=\"h_01HHJFWD1TFB5DQ6B4WD5F1GY6\">Employee off-boarding related costs</h3>\\n<p>The estimate here does not include any costs related to off-boarding of employees. Whilst we do not charge any processing fees when you want to off-board an employee, any other costs such as severance pay, covering remaining vacation days and etc will be charged back to you.<br><strong>See also: </strong><a href=\"https://support.remote.com/hc/en-us/articles/22329371247885\">Are the costs of employee off-boarding included in the Cost Calculator?</a></p>\\n<p>Please note the ‘employee net income estimate’ section (if available for the country) is intended for informational purposes only and should not be used as a substitute for professional financial advice.</p>\\n<p>Additionally, tax laws and rates can vary by location and are subject to change, which may not be immediately reflected in the calculator.</p>\\n<p>For a detailed and accurate assessment of your take-home pay, please consult with a qualified tax professional or financial advisor.</p>\\n<p><strong>See also</strong>: <a href=\"https://support.remote.com/hc/en-us/articles/25196498469773\">How to use the ‘employee net income estimate’ section in the Cost Calculator?</a></p>\\n<p><!-- notionvc: 04d0e276-e0d7-4793-93ee-d4ad14600217 --></p>\\n<h3 id=\"h_01HHJFWTHJ58YAZ87M3E090H4J\">Note</h3>\\n<p>This estimate is for guidance only and may not constitute accurate financial advice. Information contained in this document is subject to changes in laws in different jurisdictions, which can change without notice. This document is the property of Remote, is confidential, cannot be reproduced without permission, and cannot be disclosed to any third parties.</p>\\n<p><!-- notionvc: 09e777b4-c10c-438e-bb95-ce1f3fb86c9a --></p>',\n html_url:\n 'https://support.remote.com/hc/en-us/articles/4668194326797-Disclaimer-information-on-Cost-of-Employment-calculations',\n },\n};\n"],"mappings":"AAAO,IAAMA,EAAiB,CAC5B,KAAM,CACJ,GAAI,cACJ,MAAO,4DACP,KAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gEACN,SACE,sHACJ,CACF","names":["disclaimerData"]}
@@ -0,0 +1,2 @@
1
+ import{a as H,b as V}from"./chunk-HHNKZK2V.js";import{a}from"./chunk-ATKR5HCM.js";import{b as q}from"./chunk-OLJ2S6A6.js";import{a as r}from"./chunk-AYDF3IFZ.js";import $ from"react";import tt from"react";import{CalendarIcon as Ve}from"lucide-react";import*as f from"react";import{useFormContext as Me}from"react-hook-form";import*as A from"react";import{ChevronLeft as Se,ChevronRight as Ne}from"lucide-react";import{DayPicker as we}from"react-day-picker";function K({className:e,classNames:t,showOutsideDays:o=!0,...n}){return A.createElement(we,{showOutsideDays:o,className:a("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:a(H({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:a("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.mode==="range"?"[&: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":"[&:has([aria-selected])]:rounded-md"),day:a(H({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:i,...l})=>A.createElement(Se,{className:a("size-4",i),...l}),"IconLeft"),IconRight:r(({className:i,...l})=>A.createElement(Ne,{className:a("size-4",i),...l}),"IconRight")},...n})}r(K,"Calendar");import*as u from"react";import{Slot as Ie}from"@radix-ui/react-slot";import{Controller as Te,FormProvider as ke,useFormContext as Le,useFormState as De}from"react-hook-form";import*as X from"react";import*as Y from"@radix-ui/react-label";function Q({className:e,...t}){return X.createElement(Y.Root,{"data-slot":"label",className:a("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),...t})}r(Q,"Label");var Z=ke,ee=u.createContext({}),b=r(({...e})=>u.createElement(ee.Provider,{value:{name:e.name}},u.createElement(Te,{...e})),"FormField"),G=r(()=>{let e=u.useContext(ee),t=u.useContext(te),{getFieldState:o}=Le(),n=De({name:e.name}),i=o(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:l}=t;return{id:l,name:e.name,formItemId:`${l}-form-item`,formDescriptionId:`${l}-form-item-description`,formMessageId:`${l}-form-item-message`,...i}},"useFormField"),te=u.createContext({});function v({className:e,...t}){let o=u.useId();return u.createElement(te.Provider,{value:{id:o}},u.createElement("div",{"data-slot":"form-item",className:a("grid gap-2",e),...t}))}r(v,"FormItem");function x({className:e,...t}){let{error:o,formItemId:n}=G();return u.createElement(Q,{"data-slot":"form-label","data-error":!!o,className:a("text-base-color mb-1 data-[error=true]:text-destructive",e),htmlFor:n,...t})}r(x,"FormLabel");var g=u.forwardRef(({...e},t)=>{let{error:o,formItemId:n,formDescriptionId:i,formMessageId:l}=G();return u.createElement(Ie,{"data-slot":"form-control",ref:t,id:n,"aria-describedby":o?`${i} ${l}`:`${i}`,"aria-invalid":!!o,...e})});g.displayName="FormControl";function C({className:e,...t}){let{formDescriptionId:o}=G();return u.createElement("p",{"data-slot":"form-description",id:o,className:a("text-base-color text-sm",e),...t})}r(C,"FormDescription");function P({className:e,...t}){let{error:o,formMessageId:n}=G(),i=o?String(o?.message??""):t.children;return i?u.createElement("p",{"data-slot":"form-message",id:n,className:a("text-destructive text-sm",e),...t},i):null}r(P,"FormMessage");import*as M from"react";import*as S from"@radix-ui/react-popover";function oe({...e}){return M.createElement(S.Root,{"data-slot":"popover",...e})}r(oe,"Popover");function re({...e}){return M.createElement(S.Trigger,{"data-slot":"popover-trigger",...e})}r(re,"PopoverTrigger");function ae({className:e,align:t="center",sideOffset:o=4,...n}){return M.createElement(S.Portal,null,M.createElement(S.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:a("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",e),...n}))}r(ae,"PopoverContent");import{PopoverClose as Ee}from"@radix-ui/react-popover";import{format as Be}from"date-fns";function ie({description:e,label:t,name:o}){let{control:n}=Me();return f.createElement(b,{control:n,name:o,render:({field:i})=>f.createElement(v,{className:`flex flex-col RemoteFlows__DatePickerField__Item__${o}`},f.createElement(x,{className:"RemoteFlows__DatePickerField__Label"},t),f.createElement(oe,null,f.createElement(re,{asChild:!0},f.createElement(g,null,f.createElement("div",null,f.createElement(V,{variant:"outline",className:a("w-full pl-3 text-left font-normal",!i.value&&"text-muted-foreground")},i.value?f.createElement(f.Fragment,null,Be(i.value,"yyyy-MM-dd")):f.createElement("span",null,"Pick a date"),f.createElement(Ve,{className:"ml-auto h-4 w-4 opacity-50"}))))),f.createElement(ae,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start"},f.createElement(K,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:i.value,onSelect:i.onChange,components:{DayContent:r(l=>f.createElement(Ee,null,l.date.getDate()),"DayContent")},disabled:l=>l<new Date("1900-01-01")}))),e?f.createElement(C,null,e):null,f.createElement(P,null))})}r(ie,"DatePickerField");import*as k from"react";function ne({label:e,name:t,fields:o,description:n}){return k.createElement("fieldset",{className:a("border-1 border-input p-4 rounded-xl",`RemoteFlows__FieldSetField__${t}`)},k.createElement("legend",{className:"text-sm font-semibold px-2"},e),n?k.createElement("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:n}}):null,k.createElement("div",{className:"grid gap-4"},o.map(i=>{let l=z[i.type];return k.createElement(l,{...i,key:i.name,name:`${t}.${i.name}`})})))}r(ne,"FieldSetField");import*as N from"react";import{useFormContext as $e}from"react-hook-form";import y,{useState as Ae,useRef as Ge}from"react";import{Upload as ze,X as Ue}from"lucide-react";function le({onChange:e,className:t,multiple:o}){let[n,i]=Ae([]),l=Ge(null),p=r(()=>{l.current?.click()},"handleClick"),F=r(c=>{if(c.target.files&&c.target.files.length>0){let I=Array.from(c.target.files);i(I),e(c)}},"handleChange"),m=r(c=>{i(I=>I.filter(Re=>Re!==c))},"onRemoveFile");return y.createElement("div",{className:a("flex flex-col items-start gap-4",t)},y.createElement("input",{type:"file",ref:l,onChange:F,className:"hidden","aria-label":"File upload",multiple:o}),y.createElement(V,{onClick:p,className:"gap-2"},y.createElement(ze,{className:"h-4 w-4"}),"Choose File"),n.length===0&&y.createElement("div",{className:"text-sm"},o?y.createElement("span",{className:"font-medium"},"No files selected. You can select multiple files"):y.createElement("span",{className:"font-medium"},"No file selected.")),n.length>0&&n.map((c,I)=>y.createElement("div",{key:I,className:"text-sm flex items-center gap-2"},"Selected file: ",y.createElement("span",{className:"font-medium"},c.name)," (",Math.round(c.size/1024)," KB)",y.createElement(V,{variant:"ghost",onClick:()=>m(c)},y.createElement(Ue,null)))))}r(le,"FileUploader");function se({name:e,description:t,label:o,multiple:n,onChange:i}){let{control:l}=$e();return N.createElement(b,{control:l,name:e,render:({field:p,fieldState:F})=>N.createElement(v,{className:`RemoteFlows__FileUpload__Item__${e}`},N.createElement(x,{className:"RemoteFlows__FileUpload__Label"},o),N.createElement(g,null,N.createElement(le,{...p,onChange:m=>{p.onChange(m),i?.(m)},multiple:n,className:a("RemoteFlows__FileUpload__Input")})),t&&N.createElement("div",{className:"flex items-center justify-between"},N.createElement(C,{className:"RemoteFlows__FileUpload__Description"},t)),F.error&&N.createElement(P,{className:"RemoteFlows__FileUpload__Error"}))})}r(se,"FileUploadField");import*as L from"@radix-ui/react-radio-group";import{CircleIcon as He}from"lucide-react";import*as E from"react";function me({className:e,...t}){return E.createElement(L.Root,{"data-slot":"radio-group",className:a("grid gap-3",e),...t})}r(me,"RadioGroup");function ce({className:e,...t}){return E.createElement(L.Item,{"data-slot":"radio-group-item",className:a("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",e),...t},E.createElement(L.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center"},E.createElement(He,{className:"fill-radio absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})))}r(ce,"RadioGroupItem");import*as h from"react";import{useFormContext as je}from"react-hook-form";function de({name:e,defaultValue:t,description:o,label:n,options:i}){let{control:l}=je();return h.createElement(b,{control:l,name:e,defaultValue:t,render:({field:p,fieldState:F})=>h.createElement(v,{className:a("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`)},h.createElement(x,null,n),h.createElement(g,null,h.createElement(me,{onValueChange:p.onChange,defaultValue:p.value,className:"flex flex-col space-y-1"},i.map(m=>h.createElement(v,{key:m.value,className:"flex items-center space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item"},h.createElement(g,null,h.createElement(ce,{value:m.value,className:"RemoteFlows__RadioField__Input"})),h.createElement(x,{className:"font-normal mb-0 RemoteFlows__RadioField__Label"},m.label))))),o&&h.createElement(C,null,o),F.error&&h.createElement(P,null))})}r(de,"RadioGroupField");import*as _ from"react";import*as d from"react";import*as s from"@radix-ui/react-select";import{CheckIcon as Oe,ChevronDownIcon as pe,ChevronUpIcon as We}from"lucide-react";function ue({...e}){return d.createElement(s.Root,{"data-slot":"select",...e})}r(ue,"Select");function fe({...e}){return d.createElement(s.Group,{"data-slot":"select-group",...e})}r(fe,"SelectGroup");function Fe({...e}){return d.createElement(s.Value,{"data-slot":"select-value",...e})}r(Fe,"SelectValue");function ge({className:e,children:t,...o}){return d.createElement(s.Trigger,{"data-slot":"select-trigger",className:a("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","focus-visible:border-focused",e),...o},t,d.createElement(s.Icon,{asChild:!0,className:"absolute right-4"},d.createElement(pe,{className:"size-4"})))}r(ge,"SelectTrigger");function ve({className:e,children:t,position:o="popper",...n}){return d.createElement(s.Portal,null,d.createElement(s.Content,{"data-slot":"select-content",className:a("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",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...n},d.createElement(Je,null),d.createElement(s.Viewport,{className:a(o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1")},t),d.createElement(qe,null)))}r(ve,"SelectContent");function xe({className:e,children:t,...o}){return d.createElement(s.Item,{"data-slot":"select-item",className:a("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",e),...o},d.createElement(s.ItemText,null,t),d.createElement("span",{className:"flex size-3.5 items-center justify-center"},d.createElement(s.ItemIndicator,null,d.createElement(Oe,{className:"size-4"}))))}r(xe,"SelectItem");function Je({className:e,...t}){return d.createElement(s.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:a("flex cursor-default items-center justify-center py-1",e),...t},d.createElement(We,{className:"size-4"}))}r(Je,"SelectScrollUpButton");function qe({className:e,...t}){return d.createElement(s.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:a("flex cursor-default items-center justify-center py-1",e),...t},d.createElement(pe,{className:"size-4"}))}r(qe,"SelectScrollDownButton");import{useFormContext as Ke}from"react-hook-form";function _e({label:e,name:t,options:o,defaultValue:n,description:i,onChange:l}){let{control:p}=Ke();return _.createElement(b,{defaultValue:n,control:p,name:t,render:({field:F,fieldState:m})=>_.createElement(v,{className:`RemoteFlows__SelectField__Item__${t}`},_.createElement(x,{className:"RemoteFlows__SelectField__Label"},e),_.createElement(g,{"aria-label":e},_.createElement("div",{className:"relative"},_.createElement(ue,{value:F.value||"",onValueChange:c=>{F.onChange(c),l?.(c)}},_.createElement(ge,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!m.error},_.createElement("span",{className:"absolute"},_.createElement(Fe,{placeholder:e}))),_.createElement(ve,{className:"RemoteFlows__SelectField__Content"},_.createElement(fe,{className:"RemoteFlows__SelectField__Group"},o.map(c=>_.createElement(xe,{key:c.value,value:c.value,className:"RemoteFlows__SelectField__SelectItem"},c.label))))))),i&&_.createElement(C,null,i),m.error&&_.createElement(P,null))})}r(_e,"SelectField");import*as T from"react";import{useFormContext as Xe}from"react-hook-form";import*as be from"react";function Ce({className:e,type:t,...o}){return be.createElement("input",{type:t,"data-slot":"input",className:a("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","focus-visible:border-focused","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...o})}r(Ce,"Input");var Ye={type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"};function j({name:e,description:t,label:o,type:n,onChange:i}){let{control:l}=Xe(),F=n==="number"?Ye:{type:n};return T.createElement(b,{control:l,name:e,render:({field:m,fieldState:c})=>T.createElement(v,{className:`RemoteFlows__TextField__Item__${e}`},T.createElement(x,{className:"RemoteFlows__TextField__Label"},o),T.createElement(g,null,T.createElement(Ce,{...m,value:m.value??"",onChange:I=>{m.onChange(I),i?.(I)},...F,className:"RemoteFlows__TextField__Input",placeholder:o})),t&&T.createElement(C,{className:"RemoteFlows__TextField__Description"},t),c.error&&T.createElement(P,{className:"RemoteFlows__TextField__Error"}))})}r(j,"TextField");import*as D from"react";import*as B from"@radix-ui/react-checkbox";import{Check as Qe}from"lucide-react";var O=D.forwardRef(({className:e,...t},o)=>D.createElement(B.Root,{ref:o,className:a("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",e),...t},D.createElement(B.Indicator,{className:a("flex items-center justify-center text-current")},D.createElement(Qe,{className:"h-4 w-4"}))));O.displayName=B.Root.displayName;import*as w from"react";import{useFormContext as Ze}from"react-hook-form";function Pe({name:e,defaultValue:t,description:o,label:n}){let{control:i}=Ze();return w.createElement(b,{control:i,name:e,defaultValue:t,render:({field:l,fieldState:p})=>w.createElement(v,{className:a(`RemoteFlows__CheckBoxField__Item__${e}`)},w.createElement(g,null,w.createElement("div",{className:"flex space-x-2"},w.createElement(O,{id:e,onCheckedChange:l.onChange,checked:l.value,className:"RemoteFlows__CheckBox__Input"}),w.createElement(x,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label"},n))),o&&w.createElement(C,null,o),p.error&&w.createElement(P,null))})}r(Pe,"CheckBoxField");import*as R from"react";import{useFormContext as et}from"react-hook-form";import*as U from"react";var W=U.forwardRef(({className:e,...t},o)=>U.createElement("textarea",{className:a("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",e),ref:o,...t}));W.displayName="Textarea";function he({name:e,description:t,label:o,onChange:n,maxLength:i}){let{control:l}=et();return R.createElement(b,{control:l,name:e,render:({field:p,fieldState:F})=>{let m=p.value?.length??0;return R.createElement(v,{className:`RemoteFlows__TextArea__Item__${e}`},R.createElement(x,{className:"RemoteFlows__TextArea__Label"},o),R.createElement(g,null,R.createElement(W,{...p,value:p.value??"",onChange:c=>{p.onChange(c),n?.(c)},className:a(F.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:o})),(t||i)&&R.createElement("div",{className:"flex items-center justify-between"},t&&R.createElement(C,{className:"RemoteFlows__TextArea__Description"},t),i&&R.createElement("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength"},m,"/",i)),F.error&&R.createElement(P,{className:"RemoteFlows__TextArea__Error"}))}})}r(he,"TextAreaField");var z={checkbox:Pe,text:j,select:_e,radio:de,number:r(e=>tt.createElement(j,{...e,type:"text"}),"number"),file:se,fieldset:ne,date:ie,textarea:he};var ye=r(({fields:e})=>!e||e.length===0?null:$.createElement($.Fragment,null,e.map(t=>{if(t.isVisible===!1||t.deprecated)return null;let o=z[t.inputType];return o?$.createElement(o,{key:t.name,...t}):$.createElement("p",{className:"error"},"Field type ",t.inputType," not supported")})),"JSONSchemaFormFields");import J from"react";function nr({onSubmit:e,onError:t,onSuccess:o}){let{form:n,formId:i,costCalculatorBag:l}=q(),p=r(async F=>{let m=await l?.onSubmit(F);await e?.(F),m?.error?t?.(m.error):m?.data&&o?.(m?.data)},"handleSubmit");return J.createElement(Z,{...n},J.createElement("form",{id:i,onSubmit:n.handleSubmit(p),className:"space-y-4 RemoteFlows__CostCalculatorForm"},J.createElement(ye,{fields:l?.fields??[]})))}r(nr,"CostCalculatorForm");export{nr as a};
2
+ //# sourceMappingURL=chunk-EEWCEZ3D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/form/JSONSchemaForm.tsx","../src/components/form/fields/fieldsMapping.tsx","../src/components/form/fields/DatePickerField.tsx","../src/components/ui/calendar.tsx","../src/components/ui/form.tsx","../src/components/ui/label.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/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/TextField.tsx","../src/components/ui/input.tsx","../src/components/ui/checkbox.tsx","../src/components/form/fields/CheckBoxField.tsx","../src/components/form/fields/TextAreaField.tsx","../src/components/ui/textarea.tsx","../src/flows/CostCalculator/CostCalculatorForm.tsx"],"sourcesContent":["import React from 'react';\nimport { fieldsMap } from '@/src/components/form/fields/fieldsMapping';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport { SupportedTypes } from '@/src/components/form/fields/types';\n\ntype JSONSchemaFormFieldsProps = {\n fields: Fields;\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 const FieldComponent = fieldsMap[field.inputType as SupportedTypes];\n\n return FieldComponent ? (\n <FieldComponent key={field.name} {...field} />\n ) : (\n <p className=\"error\">\n Field type {field.inputType as string} not supported\n </p>\n );\n })}\n </>\n );\n};\n","import React from 'react';\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 { RadioGroupField } from '@/src/components/form/fields/RadioGroupField';\nimport { SelectField } from '@/src/components/form/fields/SelectField';\nimport { TextField } from '@/src/components/form/fields/TextField';\nimport { CheckBoxField } from '@/src/components/form/fields/CheckBoxField';\nimport { TextAreaField } from '@/src/components/form/fields/TextAreaField';\nimport { SupportedTypes } from '@/src/components/form/fields/types';\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 select: SelectField,\n radio: RadioGroupField,\n number: (props) => <TextField {...props} type=\"text\" />,\n file: FileUploadField,\n fieldset: FieldSetField,\n date: DatePickerField,\n textarea: TextAreaField,\n};\n","import { 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 { cn } from '@/src/lib/utils';\nimport { PopoverClose } from '@radix-ui/react-popover';\nimport { format } from 'date-fns';\n\ntype DatePickerFieldProps = {\n description?: string;\n label: string;\n name: string;\n};\n\nexport function DatePickerField({\n description,\n label,\n name,\n}: DatePickerFieldProps) {\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }) => (\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 variant={'outline'}\n className={cn(\n 'w-full pl-3 text-left font-normal',\n !field.value && 'text-muted-foreground',\n )}\n >\n {field.value ? (\n <>{format(field.value, 'yyyy-MM-dd')}</>\n ) : (\n <span>Pick a date</span>\n )}\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}\n onSelect={field.onChange}\n components={{\n DayContent: (props) => {\n return <PopoverClose>{props.date.getDate()}</PopoverClose>;\n },\n }}\n disabled={(date) => date < new Date('1900-01-01')}\n />\n </PopoverContent>\n </Popover>\n {description ? (\n <FormDescription>{description}</FormDescription>\n ) : null}\n <FormMessage />\n </FormItem>\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 LabelPrimitive from '@radix-ui/react-label';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n ControllerProps,\n FieldPath,\n FieldValues,\n FormProvider,\n useFormContext,\n useFormState,\n} from 'react-hook-form';\n\nimport { cn } from '@/src/lib/utils';\nimport { Label } from '@/src/components/ui/label';\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-sm', 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 useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\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","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","import * as React from 'react';\n\nimport { useFormContext } from 'react-hook-form';\nimport {\n FormControl,\n FormDescription,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from '../../ui/form';\nimport { FileUploader } from '../../ui/file-uploader';\nimport { cn } from '@/src/lib/utils';\n\ntype FileUploadFieldProps = {\n label: string;\n description?: string;\n name: string;\n multiple?: boolean;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n};\n\nexport function FileUploadField({\n name,\n description,\n label,\n multiple,\n onChange,\n}: FileUploadFieldProps) {\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n return (\n <FormItem className={`RemoteFlows__FileUpload__Item__${name}`}>\n <FormLabel className=\"RemoteFlows__FileUpload__Label\">\n {label}\n </FormLabel>\n <FormControl>\n <FileUploader\n {...field}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n field.onChange(event);\n onChange?.(event);\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","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","import {\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 { cn } from '@/src/lib/utils';\nimport * as React from 'react';\nimport { useFormContext } from 'react-hook-form';\n\ntype RadioGroupFieldProps = {\n name: string;\n label: string;\n description?: string;\n defaultValue?: string;\n options: Array<{ value: string; label: string }>;\n};\n\nexport function RadioGroupField({\n name,\n defaultValue,\n description,\n label,\n options,\n}: RadioGroupFieldProps) {\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n defaultValue={defaultValue}\n render={({ field, fieldState }) => (\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={field.onChange}\n defaultValue={field.value}\n className=\"flex flex-col space-y-1\"\n >\n {options.map((option) => (\n <FormItem\n key={option.value}\n className=\"flex items-center 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 <FormLabel className=\"font-normal mb-0 RemoteFlows__RadioField__Label\">\n {option.label}\n </FormLabel>\n </FormItem>\n ))}\n </RadioGroup>\n </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n )}\n />\n );\n}\n","import * 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 { 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 = {\n label: string;\n name: string;\n placeholder?: string;\n description?: string;\n options: Array<{ value: string; label: string }>;\n defaultValue?: string;\n className?: string;\n onChange?: (value: string) => void;\n};\n\nexport function SelectField({\n label,\n name,\n options,\n defaultValue,\n description,\n onChange,\n}: SelectFieldProps) {\n const { control } = useFormContext();\n return (\n <FormField\n defaultValue={defaultValue}\n control={control}\n name={name}\n render={({ field, fieldState }) => {\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","import * as React from 'react';\n\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\ntype TextFieldProps = React.ComponentProps<'input'> & {\n label: string;\n description?: string;\n name: string;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n};\n\ntype InputModeAttrsProps = Pick<\n React.ComponentProps<'input'>,\n 'type' | 'inputMode' | 'pattern'\n>;\n\nconst inputModeAttrs: InputModeAttrsProps = {\n type: 'text',\n inputMode: 'decimal',\n pattern: '^[0-9.]*$',\n};\n\nexport function TextField({\n name,\n description,\n label,\n type,\n onChange,\n}: TextFieldProps) {\n const { control } = useFormContext();\n const isTypeNumber = type === 'number';\n const typeAttrs = isTypeNumber ? inputModeAttrs : { type };\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => (\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 {...typeAttrs}\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","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","'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","import { 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 { cn } from '@/src/lib/utils';\nimport * as React from 'react';\nimport { useFormContext } from 'react-hook-form';\n\ntype CheckBoxFieldProps = {\n name: string;\n label: string;\n description?: string;\n defaultValue?: string;\n};\n\nexport function CheckBoxField({\n name,\n defaultValue,\n description,\n label,\n}: CheckBoxFieldProps) {\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n defaultValue={defaultValue}\n render={({ field, fieldState }) => {\n return (\n <FormItem className={cn(`RemoteFlows__CheckBoxField__Item__${name}`)}>\n <FormControl>\n <div className=\"flex space-x-2\">\n <Checkbox\n id={name}\n onCheckedChange={field.onChange}\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 </FormControl>\n {description && <FormDescription>{description}</FormDescription>}\n {fieldState.error && <FormMessage />}\n </FormItem>\n );\n }}\n />\n );\n}\n","import * as React from 'react';\n\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';\nimport { cn } from '@/src/lib/utils';\n\ntype TextAreaFieldProps = {\n label: string;\n description?: string;\n name: string;\n maxLength?: number;\n onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n};\n\nexport function TextAreaField({\n name,\n description,\n label,\n onChange,\n maxLength,\n}: TextAreaFieldProps) {\n const { control } = useFormContext();\n return (\n <FormField\n control={control}\n name={name}\n render={({ field, fieldState }) => {\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","import { CostCalculatorEstimateResponse } from '@/src/client';\nimport { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { Form } from '@/src/components/ui/form';\nimport { useCostCalculatorContext } from '@/src/flows/CostCalculator/context';\nimport { EstimationError } from '@/src/flows/CostCalculator/hooks';\nimport { CostCalculatorEstimationFormValues } from '@/src/flows/CostCalculator/types';\nimport React from 'react';\n\ntype CostCalculatorFormProps = Partial<{\n /**\n * Callback function that handles form submission. When form is submit, the form values are sent to the consumer app before behind submitted to Remote.\n * @param data - The payload sent to the /cost-calculator/estimation endpoint.\n */\n onSubmit: (data: CostCalculatorEstimationFormValues) => Promise<void> | void;\n /**\n * Callback function to handle the success when the estimation succeeds. The CostCalculatorEstimateResponse is sent back to you.\n * @param data - The response data from the /cost-calculator/estimation endpoint.\n */\n onSuccess: (data: CostCalculatorEstimateResponse) => Promise<void> | void;\n /**\n * Callback function to handle the error when the estimation fails.\n * @param error - The error object.\n */\n onError: (error: EstimationError) => void;\n}>;\n\nexport function CostCalculatorForm({\n onSubmit,\n onError,\n onSuccess,\n}: CostCalculatorFormProps) {\n const { form, formId, costCalculatorBag } = useCostCalculatorContext();\n\n const handleSubmit = async (values: CostCalculatorEstimationFormValues) => {\n const costCalculatorResults = await costCalculatorBag?.onSubmit(values);\n\n await onSubmit?.(values);\n if (costCalculatorResults?.error) {\n onError?.(costCalculatorResults.error);\n } else {\n if (costCalculatorResults?.data) {\n onSuccess?.(costCalculatorResults?.data);\n }\n }\n };\n\n return (\n <Form {...form}>\n <form\n id={formId}\n onSubmit={form.handleSubmit(handleSubmit)}\n className=\"space-y-4 RemoteFlows__CostCalculatorForm\"\n >\n <JSONSchemaFormFields fields={costCalculatorBag?.fields ?? []} />\n </form>\n </Form>\n );\n}\n"],"mappings":"kKAAA,OAAOA,MAAW,QCAlB,OAAOC,OAAW,QCAlB,OAAS,gBAAAC,OAAoB,eAC7B,UAAYC,MAAW,QACvB,OAAS,kBAAAC,OAAsB,kBCF/B,UAAYC,MAAW,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zE,IAAMC,EAAwB,MAAML,GAAmB,SAASI,CAAM,EAEtE,MAAMT,IAAWS,CAAM,EACnBC,GAAuB,MACzBT,IAAUS,EAAsB,KAAK,EAEjCA,GAAuB,MACzBR,IAAYQ,GAAuB,IAAI,CAG7C,EAXqB,gBAarB,OACEC,EAAA,cAACC,EAAA,CAAM,GAAGT,GACRQ,EAAA,cAAC,QACC,GAAIP,EACJ,SAAUD,EAAK,aAAaI,CAAY,EACxC,UAAU,6CAEVI,EAAA,cAACE,GAAA,CAAqB,OAAQR,GAAmB,QAAU,CAAC,EAAG,CACjE,CACF,CAEJ,CA/BgBG,EAAAT,GAAA","names":["React","React","CalendarIcon","React","useFormContext","React","ChevronLeft","ChevronRight","DayPicker","Calendar","className","classNames","showOutsideDays","props","DayPicker","cn","buttonVariants","__name","ChevronLeft","ChevronRight","React","Slot","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","React","PopoverPrimitive","Popover","props","__name","PopoverTrigger","PopoverContent","className","align","sideOffset","cn","PopoverClose","format","DatePickerField","description","label","name","control","useFormContext","FormField","field","FormItem","FormLabel","Popover","PopoverTrigger","FormControl","Button","cn","format","CalendarIcon","PopoverContent","Calendar","__name","props","PopoverClose","date","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","FileUploadField","name","description","label","multiple","onChange","control","useFormContext","FormField","field","fieldState","FormItem","FormLabel","FormControl","FileUploader","event","cn","FormDescription","FormMessage","__name","RadioGroupPrimitive","CircleIcon","React","RadioGroup","className","props","cn","__name","RadioGroupItem","CircleIcon","React","useFormContext","RadioGroupField","name","defaultValue","description","label","options","control","useFormContext","FormField","field","fieldState","FormItem","cn","FormLabel","FormControl","RadioGroup","option","RadioGroupItem","FormDescription","FormMessage","__name","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","control","useFormContext","FormField","field","fieldState","FormItem","FormLabel","FormControl","Select","value","SelectTrigger","SelectValue","SelectContent","SelectGroup","option","SelectItem","FormDescription","FormMessage","__name","React","useFormContext","React","Input","className","type","props","cn","__name","inputModeAttrs","TextField","name","description","label","type","onChange","control","useFormContext","typeAttrs","FormField","field","fieldState","FormItem","FormLabel","FormControl","Input","event","FormDescription","FormMessage","__name","React","CheckboxPrimitive","Check","Checkbox","className","props","ref","cn","Check","React","useFormContext","CheckBoxField","name","defaultValue","description","label","control","useFormContext","FormField","field","fieldState","FormItem","cn","FormControl","Checkbox","FormLabel","FormDescription","FormMessage","__name","React","useFormContext","React","Textarea","className","props","ref","cn","TextAreaField","name","description","label","onChange","maxLength","control","useFormContext","FormField","field","fieldState","valueLength","FormItem","FormLabel","FormControl","Textarea","event","cn","FormDescription","FormMessage","__name","fieldsMap","CheckBoxField","TextField","SelectField","RadioGroupField","__name","props","React","FileUploadField","FieldSetField","DatePickerField","TextAreaField","JSONSchemaFormFields","__name","fields","React","field","FieldComponent","fieldsMap","React","CostCalculatorForm","onSubmit","onError","onSuccess","form","formId","costCalculatorBag","useCostCalculatorContext","handleSubmit","__name","values","costCalculatorResults","React","Form","JSONSchemaFormFields"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-FGBEOUQK.js.map
@@ -0,0 +1,2 @@
1
+ import{e as i,f as u}from"./chunk-6RRSUL7Q.js";import{a as l}from"./chunk-OLJ2S6A6.js";import{a}from"./chunk-AYDF3IFZ.js";import{useCallback as c}from"react";var p=a(r=>c(async o=>await r.validate(o,{abortEarly:!1}),[r]),"useValidationYupResolver");function d(r){return r.inner.reduce((e,t)=>({...e,[t.path]:{type:t.type??"validation",message:t.message}}),{})}a(d,"iterateErrors");var y=a(r=>{let o=p(r);return c(async e=>{let t,s={};try{t=await o(e)}catch(n){s=d(n)}return Object.keys(s).length>0?{values:{},errors:s}:{values:t,errors:{}}},[r])},"useValidationFormResolver");import g,{useId as m}from"react";import{useForm as C}from"react-hook-form";function f({costCalculatorBag:r,defaultValues:o,render:e}){let t=m(),s=y(r.validationSchema),n=C({resolver:s,defaultValues:{country:o?.countryRegionSlug,currency:o?.currencySlug,region:"",salary:o?.salary},shouldUnregister:!0,mode:"onBlur"});return g.createElement(l.Provider,{value:{form:n,formId:t,costCalculatorBag:r}},e(r))}a(f,"CostCalculatorFlowProvider");var O=a(({estimationOptions:r=i,defaultValues:o={countryRegionSlug:"",currencySlug:"",salary:""},render:e})=>{let t=u({defaultRegion:o.countryRegionSlug,estimationOptions:r});return t.isLoading?e(t):g.createElement(f,{costCalculatorBag:t,defaultValues:o,render:e})},"CostCalculatorFlow");export{O as a};
2
+ //# sourceMappingURL=chunk-KEV7VRZ5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/form/yupValidationResolver.ts","../src/flows/CostCalculator/CostCalculatorFlow.tsx"],"sourcesContent":["import { useCallback } from 'react';\nimport { FieldValues, Resolver } from 'react-hook-form';\nimport type { AnyObjectSchema, InferType, ValidationError } from 'yup';\n\nconst useValidationYupResolver = <T extends AnyObjectSchema>(\n validationSchema: T,\n) => {\n return useCallback(\n async (data: FieldValues) => {\n return await validationSchema.validate(data, {\n abortEarly: false,\n });\n },\n [validationSchema],\n );\n};\n\nfunction iterateErrors(error: ValidationError) {\n const errors = (error as ValidationError).inner.reduce(\n (\n allErrors: Record<string, { type: string; message: string }>,\n currentError: ValidationError,\n ) => {\n return {\n ...allErrors,\n [currentError.path as string]: {\n type: currentError.type ?? 'validation',\n message: currentError.message,\n },\n };\n },\n {} as Record<string, { type: string; message: string }>,\n );\n\n return errors;\n}\n\nexport const useValidationFormResolver = <T extends AnyObjectSchema>(\n validationSchema: T,\n): Resolver<InferType<T>> => {\n const yupValidation = useValidationYupResolver(validationSchema);\n return useCallback(\n async (data: FieldValues) => {\n let values;\n let errors = {};\n\n try {\n values = await yupValidation(data);\n } catch (error) {\n errors = iterateErrors(error as ValidationError);\n }\n\n if (Object.keys(errors).length > 0) {\n return {\n values: {},\n errors: errors,\n };\n }\n\n return {\n values,\n errors: {},\n };\n },\n [validationSchema],\n );\n};\n","import { useValidationFormResolver } from '@/src/components/form/yupValidationResolver';\nimport { CostCalculatorContext } from '@/src/flows/CostCalculator/context';\nimport {\n defaultEstimationOptions,\n useCostCalculator,\n} from '@/src/flows/CostCalculator/hooks';\nimport { CostCalculatorEstimationOptions } from '@/src/flows/CostCalculator/types';\nimport React, { PropsWithChildren, useId } from 'react';\nimport { useForm } from 'react-hook-form';\n\nfunction CostCalculatorFlowProvider({\n costCalculatorBag,\n defaultValues,\n render,\n}: PropsWithChildren<{\n costCalculatorBag: ReturnType<typeof useCostCalculator>;\n defaultValues: Partial<{\n countryRegionSlug: string;\n currencySlug: string;\n salary: string;\n }>;\n render: (\n costCalculatorBag: ReturnType<typeof useCostCalculator>,\n ) => React.ReactNode;\n}>) {\n const formId = useId();\n const resolver = useValidationFormResolver(\n costCalculatorBag.validationSchema,\n );\n\n const form = useForm({\n resolver,\n defaultValues: {\n country: defaultValues?.countryRegionSlug,\n currency: defaultValues?.currencySlug,\n region: '',\n salary: defaultValues?.salary,\n },\n shouldUnregister: true,\n mode: 'onBlur',\n });\n\n return (\n <CostCalculatorContext.Provider\n value={{\n form,\n formId: formId,\n costCalculatorBag,\n }}\n >\n {render(costCalculatorBag)}\n </CostCalculatorContext.Provider>\n );\n}\n\nexport type CostCalculatorFlowProps = {\n /**\n * Estimation params allows you to customize the parameters sent to the /cost-calculator/estimation endpoint.\n */\n estimationOptions?: CostCalculatorEstimationOptions;\n /**\n * Default values for the form fields.\n */\n defaultValues?: Partial<{\n /**\n * Default value for the country field.\n */\n countryRegionSlug: string;\n /**\n * Default value for the currency field.\n */\n currencySlug: string;\n /**\n * Default value for the salary field.\n */\n salary: string;\n }>;\n render: (\n costCalculatorBag: ReturnType<typeof useCostCalculator>,\n ) => React.ReactNode;\n};\n\nexport const CostCalculatorFlow = ({\n estimationOptions = defaultEstimationOptions,\n defaultValues = {\n countryRegionSlug: '',\n currencySlug: '',\n salary: '',\n },\n render,\n}: CostCalculatorFlowProps) => {\n const costCalculatorBag = useCostCalculator({\n defaultRegion: defaultValues.countryRegionSlug,\n estimationOptions,\n });\n\n if (costCalculatorBag.isLoading) {\n return render(costCalculatorBag);\n }\n\n return (\n <CostCalculatorFlowProvider\n costCalculatorBag={costCalculatorBag}\n defaultValues={defaultValues}\n render={render}\n />\n );\n};\n"],"mappings":"0HAAA,OAAS,eAAAA,MAAmB,QAI5B,IAAMC,EAA2BC,EAC/BC,GAEOC,EACL,MAAOC,GACE,MAAMF,EAAiB,SAASE,EAAM,CAC3C,WAAY,EACd,CAAC,EAEH,CAACF,CAAgB,CACnB,EAV+B,4BAajC,SAASG,EAAcC,EAAwB,CAiB7C,OAhBgBA,EAA0B,MAAM,OAC9C,CACEC,EACAC,KAEO,CACL,GAAGD,EACH,CAACC,EAAa,IAAc,EAAG,CAC7B,KAAMA,EAAa,MAAQ,aAC3B,QAASA,EAAa,OACxB,CACF,GAEF,CAAC,CACH,CAGF,CAlBSP,EAAAI,EAAA,iBAoBF,IAAMI,EAA4BR,EACvCC,GAC2B,CAC3B,IAAMQ,EAAgBV,EAAyBE,CAAgB,EAC/D,OAAOC,EACL,MAAOC,GAAsB,CAC3B,IAAIO,EACAC,EAAS,CAAC,EAEd,GAAI,CACFD,EAAS,MAAMD,EAAcN,CAAI,CACnC,OAASE,EAAO,CACdM,EAASP,EAAcC,CAAwB,CACjD,CAEA,OAAI,OAAO,KAAKM,CAAM,EAAE,OAAS,EACxB,CACL,OAAQ,CAAC,EACT,OAAQA,CACV,EAGK,CACL,OAAAD,EACA,OAAQ,CAAC,CACX,CACF,EACA,CAACT,CAAgB,CACnB,CACF,EA7ByC,6BC9BzC,OAAOW,GAA4B,SAAAC,MAAa,QAChD,OAAS,WAAAC,MAAe,kBAExB,SAASC,EAA2B,CAClC,kBAAAC,EACA,cAAAC,EACA,OAAAC,CACF,EAUI,CACF,IAAMC,EAASC,EAAM,EACfC,EAAWC,EACfN,EAAkB,gBACpB,EAEMO,EAAOC,EAAQ,CACnB,SAAAH,EACA,cAAe,CACb,QAASJ,GAAe,kBACxB,SAAUA,GAAe,aACzB,OAAQ,GACR,OAAQA,GAAe,MACzB,EACA,iBAAkB,GAClB,KAAM,QACR,CAAC,EAED,OACEQ,EAAA,cAACC,EAAsB,SAAtB,CACC,MAAO,CACL,KAAAH,EACA,OAAQJ,EACR,kBAAAH,CACF,GAECE,EAAOF,CAAiB,CAC3B,CAEJ,CA3CSW,EAAAZ,EAAA,8BAwEF,IAAMa,EAAqBD,EAAA,CAAC,CACjC,kBAAAE,EAAoBC,EACpB,cAAAb,EAAgB,CACd,kBAAmB,GACnB,aAAc,GACd,OAAQ,EACV,EACA,OAAAC,CACF,IAA+B,CAC7B,IAAMF,EAAoBe,EAAkB,CAC1C,cAAed,EAAc,kBAC7B,kBAAAY,CACF,CAAC,EAED,OAAIb,EAAkB,UACbE,EAAOF,CAAiB,EAI/BS,EAAA,cAACV,EAAA,CACC,kBAAmBC,EACnB,cAAeC,EACf,OAAQC,EACV,CAEJ,EAzBkC","names":["useCallback","useValidationYupResolver","__name","validationSchema","useCallback","data","iterateErrors","error","allErrors","currentError","useValidationFormResolver","yupValidation","values","errors","React","useId","useForm","CostCalculatorFlowProvider","costCalculatorBag","defaultValues","render","formId","useId","resolver","useValidationFormResolver","form","useForm","React","CostCalculatorContext","__name","CostCalculatorFlow","estimationOptions","defaultEstimationOptions","useCostCalculator"]}
@@ -1,2 +1,2 @@
1
- import{a as x}from"./chunk-HGBJ3RNH.js";import{a as T}from"./chunk-BY2NZ5QF.js";import{a as P}from"./chunk-Q2ZB5MOF.js";import{a as y,b as v,c as h,d as _,e as w}from"./chunk-JEULWBZA.js";import{a as k}from"./chunk-BIWKEH5R.js";import{a as n}from"./chunk-ATKR5HCM.js";import{a as s}from"./chunk-AYDF3IFZ.js";import{Euro as H}from"lucide-react";import t,{lazy as G,useState as A}from"react";import*as N from"react";import{Slot as z}from"@radix-ui/react-slot";import{cva as F}from"class-variance-authority";var E=F("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-badge text-badge-foreground rounded-full [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground rounded-full [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white rounded-full [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"text-foreground rounded-full [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function B({className:a,variant:o,asChild:r=!1,...u}){return N.createElement(r?z:"span",{"data-slot":"badge",className:n(E({variant:o}),a),...u})}s(B,"Badge");import*as m from"react";import*as i from"@radix-ui/react-tabs";function S({className:a,...o}){return m.createElement(i.Root,{"data-slot":"tabs",className:n("flex flex-col gap-2",a),...o})}s(S,"Tabs");function V({className:a,...o}){return m.createElement(i.List,{"data-slot":"tabs-list",className:n("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-1",a),...o})}s(V,"TabsList");function b({className:a,...o}){return m.createElement(i.Trigger,{"data-slot":"tabs-trigger",className:n("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),...o})}s(b,"TabsTrigger");var M=G(()=>import("./flows/CostCalculator/Results/CostCalculatorResultsChart.js"));function st({employmentData:a,options:o}){let[r,u]=A("monthly"),l=a.employments?.[0];if(!l)return null;let e=l.employer_currency_costs,c=e.currency.symbol,f=r==="monthly"?e.monthly_gross_salary:e.annual_gross_salary,p=r==="monthly"?e.monthly_benefits_total:e.annual_benefits_total,g=r==="monthly"?e.monthly_contributions_total:e.annual_contributions_total,D=r==="monthly"?e.monthly_total:e.annual_total,d=r==="monthly"?e.monthly_benefits_breakdown:e.annual_benefits_breakdown,L=r==="monthly"?e.monthly_contributions_breakdown:e.annual_contributions_breakdown,C=[{name:"Gross Salary",value:f,color:o?.chartColors?.grossSalary??"#3b82f6"},{name:"Contributions",value:g,color:o?.chartColors?.contributions??"#f59e0b"}];return d&&C.push({name:"Benefits",value:p??0,color:o?.chartColors?.benefits??"#10b981"}),t.createElement(t.Fragment,null,t.createElement("div",{className:"flex flex-col md:flex-row gap-4 md:items-center justify-between mb-6 RemoteFlows__CostCalculatorResults"},t.createElement("div",{className:"RemoteFlows__CostCalculatorResults__Header"},t.createElement("h2",{className:"text-xl font-semibold flex items-center gap-2"},t.createElement("span",{className:"flex items-center gap-1"},t.createElement(H,{className:"h-5 w-5 text-gray-600"}),o?.title??"Cost Calculator"),t.createElement(B,{className:"ml-2"},l.country.name)),t.createElement("p",{className:"text-primary-foreground font-medium mt-1"},o?.description??`Total cost of employment in ${l.country.name}`)),t.createElement(S,{value:r,onValueChange:j=>u(j),className:"w-full md:w-auto RemoteFlows__CostCalculatorResults__Tabs"},t.createElement(V,{className:"grid w-full md:w-[200px] grid-cols-2"},t.createElement(b,{value:"monthly"},"Monthly"),t.createElement(b,{value:"annual"},"Annual")))),t.createElement("div",{className:n("grid grid-cols-1 gap-6",o?.showChart?"md:grid-cols-3":"","RemoteFlows__CostCalculatorResults_CostBreakdown")},t.createElement(y,{className:"md:col-span-2 rounded-lg"},t.createElement(v,{className:"pb-2"},t.createElement(h,null,"Cost Breakdown"),t.createElement(_,null,"Detailed breakdown of all employer costs")),t.createElement(w,null,t.createElement("div",{className:"space-y-6"},t.createElement(P,{grossSalary:f,currency:c}),d?t.createElement(x,{benefitsBreakdown:d,benefitsTotal:p,currency:c}):null,t.createElement(T,{contributionsBreakdown:L,contributionsTotal:g,currency:c}),t.createElement(k,{totalCost:D,currency:c})))),o?.showChart&&t.createElement(M,{chartData:C,currency:c})))}s(st,"CostCalculatorResults");export{st as a};
2
- //# sourceMappingURL=chunk-DHJSRW7Y.js.map
1
+ import{a as P}from"./chunk-Q2ZB5MOF.js";import{a as y,b as v,c as h,d as _,e as w}from"./chunk-JEULWBZA.js";import{a as k}from"./chunk-BIWKEH5R.js";import{a as x}from"./chunk-HGBJ3RNH.js";import{a as T}from"./chunk-BY2NZ5QF.js";import{a as n}from"./chunk-ATKR5HCM.js";import{a as s}from"./chunk-AYDF3IFZ.js";import{Euro as H}from"lucide-react";import t,{lazy as G,useState as A}from"react";import*as N from"react";import{Slot as z}from"@radix-ui/react-slot";import{cva as F}from"class-variance-authority";var E=F("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-badge text-badge-foreground rounded-full [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground rounded-full [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white rounded-full [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"text-foreground rounded-full [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function B({className:a,variant:o,asChild:r=!1,...u}){return N.createElement(r?z:"span",{"data-slot":"badge",className:n(E({variant:o}),a),...u})}s(B,"Badge");import*as m from"react";import*as i from"@radix-ui/react-tabs";function S({className:a,...o}){return m.createElement(i.Root,{"data-slot":"tabs",className:n("flex flex-col gap-2",a),...o})}s(S,"Tabs");function V({className:a,...o}){return m.createElement(i.List,{"data-slot":"tabs-list",className:n("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-1",a),...o})}s(V,"TabsList");function b({className:a,...o}){return m.createElement(i.Trigger,{"data-slot":"tabs-trigger",className:n("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),...o})}s(b,"TabsTrigger");var M=G(()=>import("./flows/CostCalculator/Results/CostCalculatorResultsChart.js"));function st({employmentData:a,options:o}){let[r,u]=A("monthly"),l=a.employments?.[0];if(!l)return null;let e=l.employer_currency_costs,c=e.currency.symbol,f=r==="monthly"?e.monthly_gross_salary:e.annual_gross_salary,p=r==="monthly"?e.monthly_benefits_total:e.annual_benefits_total,g=r==="monthly"?e.monthly_contributions_total:e.annual_contributions_total,D=r==="monthly"?e.monthly_total:e.annual_total,d=r==="monthly"?e.monthly_benefits_breakdown:e.annual_benefits_breakdown,L=r==="monthly"?e.monthly_contributions_breakdown:e.annual_contributions_breakdown,C=[{name:"Gross Salary",value:f,color:o?.chartColors?.grossSalary??"#3b82f6"},{name:"Contributions",value:g,color:o?.chartColors?.contributions??"#f59e0b"}];return d&&C.push({name:"Benefits",value:p??0,color:o?.chartColors?.benefits??"#10b981"}),t.createElement(t.Fragment,null,t.createElement("div",{className:"flex flex-col md:flex-row gap-4 md:items-center justify-between mb-6 RemoteFlows__CostCalculatorResults"},t.createElement("div",{className:"RemoteFlows__CostCalculatorResults__Header"},t.createElement("h2",{className:"text-xl font-semibold flex items-center gap-2"},t.createElement("span",{className:"flex items-center gap-1"},t.createElement(H,{className:"h-5 w-5 text-gray-600"}),o?.title??"Cost Calculator"),t.createElement(B,{className:"ml-2"},l.country.name)),t.createElement("p",{className:"text-primary-foreground font-medium mt-1"},o?.description??`Total cost of employment in ${l.country.name}`)),t.createElement(S,{value:r,onValueChange:j=>u(j),className:"w-full md:w-auto RemoteFlows__CostCalculatorResults__Tabs"},t.createElement(V,{className:"grid w-full md:w-[200px] grid-cols-2"},t.createElement(b,{value:"monthly"},"Monthly"),t.createElement(b,{value:"annual"},"Annual")))),t.createElement("div",{className:n("grid grid-cols-1 gap-6",o?.showChart?"md:grid-cols-3":"","RemoteFlows__CostCalculatorResults_CostBreakdown")},t.createElement(y,{className:"md:col-span-2 rounded-lg"},t.createElement(v,{className:"pb-2"},t.createElement(h,null,"Cost Breakdown"),t.createElement(_,null,"Detailed breakdown of all employer costs")),t.createElement(w,null,t.createElement("div",{className:"space-y-6"},t.createElement(P,{grossSalary:f,currency:c}),d?t.createElement(x,{benefitsBreakdown:d,benefitsTotal:p,currency:c}):null,t.createElement(T,{contributionsBreakdown:L,contributionsTotal:g,currency:c}),t.createElement(k,{totalCost:D,currency:c})))),o?.showChart&&t.createElement(M,{chartData:C,currency:c})))}s(st,"CostCalculatorResults");export{st as a};
2
+ //# sourceMappingURL=chunk-LT4TLUWZ.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-AYDF3IFZ.js";import{createContext as r,useContext as e}from"react";var a=r({form:null,formId:void 0,costCalculatorBag:void 0}),n=t(()=>{let o=e(a);if(!o.form)throw new Error("useCostCalculatorContext must be used within a CostCalculatorProvider");return{form:o.form,formId:o.formId,costCalculatorBag:o.costCalculatorBag}},"useCostCalculatorContext");export{a,n as b};
2
+ //# sourceMappingURL=chunk-OLJ2S6A6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/CostCalculator/context.ts"],"sourcesContent":["import { useCostCalculator } from '@/src/flows/CostCalculator/hooks';\nimport { $TSFixMe } from '@remoteoss/json-schema-form';\nimport { createContext, useContext } from 'react';\nimport { UseFormReturn } from 'react-hook-form';\n\nexport const CostCalculatorContext = createContext<{\n form: UseFormReturn<$TSFixMe> | null;\n formId: string | undefined;\n costCalculatorBag?: ReturnType<typeof useCostCalculator>;\n}>({\n form: null,\n formId: undefined,\n costCalculatorBag: undefined,\n});\n\nexport const useCostCalculatorContext = () => {\n const context = useContext(CostCalculatorContext);\n if (!context.form) {\n throw new Error(\n 'useCostCalculatorContext must be used within a CostCalculatorProvider',\n );\n }\n\n return {\n form: context.form,\n formId: context.formId,\n costCalculatorBag: context.costCalculatorBag,\n } as const;\n};\n"],"mappings":"wCAEA,OAAS,iBAAAA,EAAe,cAAAC,MAAkB,QAGnC,IAAMC,EAAwBC,EAIlC,CACD,KAAM,KACN,OAAQ,OACR,kBAAmB,MACrB,CAAC,EAEYC,EAA2BC,EAAA,IAAM,CAC5C,IAAMC,EAAUC,EAAWL,CAAqB,EAChD,GAAI,CAACI,EAAQ,KACX,MAAM,IAAI,MACR,uEACF,EAGF,MAAO,CACL,KAAMA,EAAQ,KACd,OAAQA,EAAQ,OAChB,kBAAmBA,EAAQ,iBAC7B,CACF,EAbwC","names":["createContext","useContext","CostCalculatorContext","createContext","useCostCalculatorContext","__name","context","useContext"]}
@@ -0,0 +1,2 @@
1
+ import{a as p}from"./chunk-DYB3RWP7.js";import{b as d}from"./chunk-HHNKZK2V.js";import{a as s}from"./chunk-ATKR5HCM.js";import{a as m}from"./chunk-AYDF3IFZ.js";import o from"react";import*as a from"react";import{Drawer as l}from"vaul";var f=m(({shouldScaleBackground:r=!0,...e})=>a.createElement(l.Root,{shouldScaleBackground:r,...e}),"Drawer");f.displayName="Drawer";var y=l.Trigger,h=l.Portal,P=l.Close,N=a.forwardRef(({className:r,...e},i)=>a.createElement(l.Overlay,{ref:i,className:s("fixed inset-0 z-50 bg-black/80",r),...e}));N.displayName=l.Overlay.displayName;var D=a.forwardRef(({className:r,children:e,...i},c)=>a.createElement(h,null,a.createElement(N,null),a.createElement(l.Content,{ref:c,className:s("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",r),...i},a.createElement("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),e)));D.displayName="DrawerContent";var w=m(({className:r,...e})=>a.createElement("div",{className:s("grid gap-1.5 p-4 text-center sm:text-left",r),...e}),"DrawerHeader");w.displayName="DrawerHeader";var C=m(({className:r,...e})=>a.createElement("div",{className:s("mt-auto flex flex-col gap-2 p-4",r),...e}),"DrawerFooter");C.displayName="DrawerFooter";var u=a.forwardRef(({className:r,...e},i)=>a.createElement(l.Title,{ref:i,className:s("text-lg font-semibold leading-none tracking-tight",r),...e}));u.displayName=l.Title.displayName;var v=a.forwardRef(({className:r,...e},i)=>a.createElement(l.Description,{ref:i,className:s("text-sm text-muted-foreground",r),...e}));v.displayName=l.Description.displayName;import*as n from"react";import*as t from"@radix-ui/react-scroll-area";var g=n.forwardRef(({className:r,children:e,...i},c)=>n.createElement(t.Root,{ref:c,className:s("relative overflow-hidden",r),...i},n.createElement(t.Viewport,{className:"h-full w-full rounded-[inherit]"},e),n.createElement(b,null),n.createElement(t.Corner,null)));g.displayName=t.Root.displayName;var b=n.forwardRef(({className:r,orientation:e="vertical",...i},c)=>n.createElement(t.ScrollAreaScrollbar,{ref:c,orientation:e,className:s("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",r),...i},n.createElement(t.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})));b.displayName=t.ScrollAreaScrollbar.displayName;import{X as S}from"lucide-react";var O=m(({label:r="Disclaimer"})=>o.createElement(f,null,o.createElement(y,{asChild:!0},o.createElement(d,{variant:"link",size:"link"},r)),o.createElement(D,null,o.createElement(w,null,o.createElement(P,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none"},o.createElement(S,{className:"h-4 w-4"}),o.createElement("span",{className:"sr-only"},"Close")),o.createElement(u,null,p?.data.title),o.createElement(v,null,"For more details read our"," ",o.createElement(d,{variant:"link",size:"link",asChild:!0},o.createElement("a",{href:p?.data.html_url,target:"_blank",rel:"noopener noreferrer"},"Disclaimer")))),o.createElement(g,{className:"px-4 pb-4 overflow-y-auto max-h-[calc(80vh-120px)] cost-calculator-disclaimer-drawer-scroll-area"},o.createElement("div",{className:"cost-calculator-disclaimer-drawer-body",dangerouslySetInnerHTML:{__html:p?.data.body??""}})))),"CostCalculatorDisclaimer");export{O as a};
2
+ //# sourceMappingURL=chunk-P5PQMJ4T.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/CostCalculator/CostCalculatorDisclaimer.tsx","../src/components/ui/drawer.tsx","../src/components/ui/scroll-area.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerHeader,\n DrawerTitle,\n DrawerTrigger,\n} from '@/src/components/ui/drawer';\nimport { ScrollArea } from '@/src/components/ui/scroll-area';\nimport { X } from 'lucide-react';\nimport { Button } from '@/src/components/ui/button';\nimport { disclaimerData } from '@/src/flows/CostCalculator/disclaimerUtils';\n\ntype CostCalculatorDisclaimerProps = {\n label?: string;\n};\n\nexport const CostCalculatorDisclaimer = ({\n label = 'Disclaimer',\n}: CostCalculatorDisclaimerProps) => {\n return (\n <Drawer>\n <DrawerTrigger asChild>\n <Button variant=\"link\" size=\"link\">\n {label}\n </Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerHeader>\n <DrawerClose className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DrawerClose>\n <DrawerTitle>{disclaimerData?.data.title}</DrawerTitle>\n <DrawerDescription>\n For more details read our{' '}\n <Button variant=\"link\" size=\"link\" asChild>\n <a\n href={disclaimerData?.data.html_url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Disclaimer\n </a>\n </Button>\n </DrawerDescription>\n </DrawerHeader>\n <ScrollArea className=\"px-4 pb-4 overflow-y-auto max-h-[calc(80vh-120px)] cost-calculator-disclaimer-drawer-scroll-area\">\n <div\n className=\"cost-calculator-disclaimer-drawer-body\"\n dangerouslySetInnerHTML={{\n __html: disclaimerData?.data.body ?? '',\n }}\n ></div>\n </ScrollArea>\n </DrawerContent>\n </Drawer>\n );\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n);\nDrawer.displayName = 'Drawer';\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-black/80', className)}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background',\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = 'DrawerContent';\n\nconst DrawerHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)}\n {...props}\n />\n);\nDrawerHeader.displayName = 'DrawerHeader';\n\nconst DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('mt-auto flex flex-col gap-2 p-4', className)}\n {...props}\n />\n);\nDrawerFooter.displayName = 'DrawerFooter';\n\nconst DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n","import * as React from 'react';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\n\nimport { cn } from '@/src/lib/utils';\n\nconst ScrollArea = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn('relative overflow-hidden', className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = 'vertical', ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex touch-none select-none transition-colors',\n orientation === 'vertical' &&\n 'h-full w-2.5 border-l border-l-transparent p-[1px]',\n orientation === 'horizontal' &&\n 'h-2.5 flex-col border-t border-t-transparent p-[1px]',\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\n"],"mappings":"gKAAA,OAAOA,MAAW,QCElB,UAAYC,MAAW,QACvB,OAAS,UAAUC,MAAuB,OAI1C,IAAMC,EAASC,EAAA,CAAC,CACd,sBAAAC,EAAwB,GACxB,GAAGC,CACL,IACE,gBAACC,EAAgB,KAAhB,CACC,sBAAuBF,EACtB,GAAGC,EACN,EAPa,UASfH,EAAO,YAAc,SAErB,IAAMK,EAAgBD,EAAgB,QAEhCE,EAAeF,EAAgB,OAE/BG,EAAcH,EAAgB,MAE9BI,EAAsB,aAG1B,CAAC,CAAE,UAAAC,EAAW,GAAGN,CAAM,EAAGO,IAC1B,gBAACN,EAAgB,QAAhB,CACC,IAAKM,EACL,UAAWC,EAAG,iCAAkCF,CAAS,EACxD,GAAGN,EACN,CACD,EACDK,EAAc,YAAcJ,EAAgB,QAAQ,YAEpD,IAAMQ,EAAsB,aAG1B,CAAC,CAAE,UAAAH,EAAW,SAAAI,EAAU,GAAGV,CAAM,EAAGO,IACpC,gBAACJ,EAAA,KACC,gBAACE,EAAA,IAAc,EACf,gBAACJ,EAAgB,QAAhB,CACC,IAAKM,EACL,UAAWC,EACT,iGACAF,CACF,EACC,GAAGN,GAEJ,gBAAC,OAAI,UAAU,mDAAmD,EACjEU,CACH,CACF,CACD,EACDD,EAAc,YAAc,gBAE5B,IAAME,EAAeb,EAAA,CAAC,CACpB,UAAAQ,EACA,GAAGN,CACL,IACE,gBAAC,OACC,UAAWQ,EAAG,4CAA6CF,CAAS,EACnE,GAAGN,EACN,EAPmB,gBASrBW,EAAa,YAAc,eAE3B,IAAMC,EAAed,EAAA,CAAC,CACpB,UAAAQ,EACA,GAAGN,CACL,IACE,gBAAC,OACC,UAAWQ,EAAG,kCAAmCF,CAAS,EACzD,GAAGN,EACN,EAPmB,gBASrBY,EAAa,YAAc,eAE3B,IAAMC,EAAoB,aAGxB,CAAC,CAAE,UAAAP,EA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,cAACI,EAAA,KACCJ,EAAA,cAACK,EAAA,KACCL,EAAA,cAACM,EAAA,CAAY,UAAU,6MACrBN,EAAA,cAACO,EAAA,CAAE,UAAU,UAAU,EACvBP,EAAA,cAAC,QAAK,UAAU,WAAU,OAAK,CACjC,EACAA,EAAA,cAACQ,EAAA,KAAaC,GAAgB,KAAK,KAAM,EACzCT,EAAA,cAACU,EAAA,KAAkB,4BACS,IAC1BV,EAAA,cAACG,EAAA,CAAO,QAAQ,OAAO,KAAK,OAAO,QAAO,IACxCH,EAAA,cAAC,KACC,KAAMS,GAAgB,KAAK,SAC3B,OAAO,SACP,IAAI,uBACL,YAED,CACF,CACF,CACF,EACAT,EAAA,cAACW,EAAA,CAAW,UAAU,oGACpBX,EAAA,cAAC,OACC,UAAU,yCACV,wBAAyB,CACvB,OAAQS,GAAgB,KAAK,MAAQ,EACvC,EACD,CACH,CACF,CACF,EAvCoC","names":["React","React","DrawerPrimitive","Drawer","__name","shouldScaleBackground","props","DrawerPrimitive","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","className","ref","cn","DrawerContent","children","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription","React","ScrollAreaPrimitive","ScrollArea","className","children","props","ref","cn","ScrollBar","orientation","X","CostCalculatorDisclaimer","__name","label","React","Drawer","DrawerTrigger","Button","DrawerContent","DrawerHeader","DrawerClose","X","DrawerTitle","disclaimerData","DrawerDescription","ScrollArea"]}
@@ -0,0 +1,2 @@
1
+ import{b as u}from"./chunk-HHNKZK2V.js";import{a as m}from"./chunk-ATKR5HCM.js";import{b as r}from"./chunk-OLJ2S6A6.js";import{a as o}from"./chunk-AYDF3IFZ.js";import e from"react";function f(t){let{formId:n}=r();return e.createElement(u,{type:"submit",className:m("RemoteFlows__CostCalculatorForm__SubmitButton",t.className),form:n,...t},t.children)}o(f,"CostCalculatorSubmitButton");export{f as a};
2
+ //# sourceMappingURL=chunk-ZEGD25G2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/CostCalculator/CostCalculatorSubmitButton.tsx"],"sourcesContent":["import { Button } from '@/src/components/ui/button';\nimport React, { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useCostCalculatorContext } from './context';\nimport { cn } from '@/src/lib/utils';\n\nexport function CostCalculatorSubmitButton(\n props: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>>,\n) {\n const { formId } = useCostCalculatorContext();\n\n return (\n <Button\n type=\"submit\"\n className={cn(\n 'RemoteFlows__CostCalculatorForm__SubmitButton',\n props.className,\n )}\n form={formId}\n {...props}\n >\n {props.children}\n </Button>\n );\n}\n"],"mappings":"gKACA,OAAOA,MAAwD,QAIxD,SAASC,EACdC,EACA,CACA,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAyB,EAE5C,OACEC,EAAA,cAACC,EAAA,CACC,KAAK,SACL,UAAWC,EACT,gDACAL,EAAM,SACR,EACA,KAAMC,EACL,GAAGD,GAEHA,EAAM,QACT,CAEJ,CAlBgBM,EAAAP,EAAA","names":["React","CostCalculatorSubmitButton","props","formId","useCostCalculatorContext","React","Button","cn","__name"]}
@@ -0,0 +1,8 @@
1
+ import React__default from 'react';
2
+
3
+ type CostCalculatorDisclaimerProps = {
4
+ label?: string;
5
+ };
6
+ declare const CostCalculatorDisclaimer: ({ label, }: CostCalculatorDisclaimerProps) => React__default.JSX.Element;
7
+
8
+ export { CostCalculatorDisclaimer };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-P5PQMJ4T.js";import"../../chunk-DYB3RWP7.js";import"../../chunk-HHNKZK2V.js";import"../../chunk-ATKR5HCM.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorDisclaimer};
2
+ //# sourceMappingURL=CostCalculatorDisclaimer.js.map
@@ -0,0 +1,36 @@
1
+ import { useCostCalculator } from './hooks.js';
2
+ import { CostCalculatorEstimationOptions } from './types.js';
3
+ import React__default from 'react';
4
+ import '@remoteoss/json-schema-form';
5
+ import 'yup';
6
+ import '@tanstack/react-query';
7
+ import '../../types.gen-dIMXHE0Y.js';
8
+ import '../types.js';
9
+
10
+ type CostCalculatorFlowProps = {
11
+ /**
12
+ * Estimation params allows you to customize the parameters sent to the /cost-calculator/estimation endpoint.
13
+ */
14
+ estimationOptions?: CostCalculatorEstimationOptions;
15
+ /**
16
+ * Default values for the form fields.
17
+ */
18
+ defaultValues?: Partial<{
19
+ /**
20
+ * Default value for the country field.
21
+ */
22
+ countryRegionSlug: string;
23
+ /**
24
+ * Default value for the currency field.
25
+ */
26
+ currencySlug: string;
27
+ /**
28
+ * Default value for the salary field.
29
+ */
30
+ salary: string;
31
+ }>;
32
+ render: (costCalculatorBag: ReturnType<typeof useCostCalculator>) => React__default.ReactNode;
33
+ };
34
+ declare const CostCalculatorFlow: ({ estimationOptions, defaultValues, render, }: CostCalculatorFlowProps) => string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null | undefined;
35
+
36
+ export { CostCalculatorFlow, type CostCalculatorFlowProps };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-KEV7VRZ5.js";import"../../chunk-6RRSUL7Q.js";import"../../chunk-2AGPO366.js";import"../../chunk-ATKR5HCM.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorFlow};
2
+ //# sourceMappingURL=CostCalculatorFlow.js.map
@@ -0,0 +1,29 @@
1
+ import { C as CostCalculatorEstimateResponse } from '../../types.gen-dIMXHE0Y.js';
2
+ import { EstimationError } from './hooks.js';
3
+ import { CostCalculatorEstimationFormValues } from './types.js';
4
+ import React__default from 'react';
5
+ import '@remoteoss/json-schema-form';
6
+ import 'yup';
7
+ import '@tanstack/react-query';
8
+ import '../types.js';
9
+
10
+ type CostCalculatorFormProps = Partial<{
11
+ /**
12
+ * Callback function that handles form submission. When form is submit, the form values are sent to the consumer app before behind submitted to Remote.
13
+ * @param data - The payload sent to the /cost-calculator/estimation endpoint.
14
+ */
15
+ onSubmit: (data: CostCalculatorEstimationFormValues) => Promise<void> | void;
16
+ /**
17
+ * Callback function to handle the success when the estimation succeeds. The CostCalculatorEstimateResponse is sent back to you.
18
+ * @param data - The response data from the /cost-calculator/estimation endpoint.
19
+ */
20
+ onSuccess: (data: CostCalculatorEstimateResponse) => Promise<void> | void;
21
+ /**
22
+ * Callback function to handle the error when the estimation fails.
23
+ * @param error - The error object.
24
+ */
25
+ onError: (error: EstimationError) => void;
26
+ }>;
27
+ declare function CostCalculatorForm({ onSubmit, onError, onSuccess, }: CostCalculatorFormProps): React__default.JSX.Element;
28
+
29
+ export { CostCalculatorForm };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-EEWCEZ3D.js";import"../../chunk-HHNKZK2V.js";import"../../chunk-ATKR5HCM.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorForm};
2
+ //# sourceMappingURL=CostCalculatorForm.js.map
@@ -0,0 +1,5 @@
1
+ import React__default, { PropsWithChildren, ButtonHTMLAttributes } from 'react';
2
+
3
+ declare function CostCalculatorResetButton(props: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>>): React__default.JSX.Element;
4
+
5
+ export { CostCalculatorResetButton };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-DARQDP44.js";import"../../chunk-HHNKZK2V.js";import"../../chunk-ATKR5HCM.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorResetButton};
2
+ //# sourceMappingURL=CostCalculatorResetButton.js.map
@@ -0,0 +1,5 @@
1
+ import React__default, { PropsWithChildren, ButtonHTMLAttributes } from 'react';
2
+
3
+ declare function CostCalculatorSubmitButton(props: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>>): React__default.JSX.Element;
4
+
5
+ export { CostCalculatorSubmitButton };
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-ZEGD25G2.js";import"../../chunk-HHNKZK2V.js";import"../../chunk-ATKR5HCM.js";import"../../chunk-OLJ2S6A6.js";import"../../chunk-AYDF3IFZ.js";export{a as CostCalculatorSubmitButton};
2
+ //# sourceMappingURL=CostCalculatorSubmitButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
 
3
3
  type CostCalculatorBenefitsBreakdownProps = {
4
4
  benefitsTotal: number | undefined;
@@ -9,6 +9,6 @@ type CostCalculatorBenefitsBreakdownProps = {
9
9
  }[];
10
10
  currency: string;
11
11
  };
12
- declare function CostCalculatorBenefitsBreakdown({ benefitsTotal, benefitsBreakdown, currency, }: CostCalculatorBenefitsBreakdownProps): React.JSX.Element;
12
+ declare function CostCalculatorBenefitsBreakdown({ benefitsTotal, benefitsBreakdown, currency, }: CostCalculatorBenefitsBreakdownProps): React__default.JSX.Element;
13
13
 
14
14
  export { CostCalculatorBenefitsBreakdown };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
 
3
3
  type CostCalculatorContributionsBreakdownProps = {
4
4
  contributionsTotal: number;
@@ -10,6 +10,6 @@ type CostCalculatorContributionsBreakdownProps = {
10
10
  zendesk_article_url: string | null;
11
11
  }[] | undefined;
12
12
  };
13
- declare function CostCalculatorContributionsBreakdown({ contributionsTotal, currency, contributionsBreakdown, }: CostCalculatorContributionsBreakdownProps): React.JSX.Element;
13
+ declare function CostCalculatorContributionsBreakdown({ contributionsTotal, currency, contributionsBreakdown, }: CostCalculatorContributionsBreakdownProps): React__default.JSX.Element;
14
14
 
15
15
  export { CostCalculatorContributionsBreakdown };
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
 
3
3
  type CostCalculatorGrossSalaryProps = {
4
4
  grossSalary: number;
5
5
  currency: string;
6
6
  };
7
- declare function CostCalculatorGrossSalary({ grossSalary, currency, }: CostCalculatorGrossSalaryProps): React.JSX.Element;
7
+ declare function CostCalculatorGrossSalary({ grossSalary, currency, }: CostCalculatorGrossSalaryProps): React__default.JSX.Element;
8
8
 
9
9
  export { CostCalculatorGrossSalary };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React__default from 'react';
2
2
  import { C as CostCalculatorEstimateResponse } from '../../../types.gen-dIMXHE0Y.js';
3
3
 
4
4
  interface CostCalculatorResultProps {
@@ -14,6 +14,6 @@ interface CostCalculatorResultProps {
14
14
  };
15
15
  }>;
16
16
  }
17
- declare function CostCalculatorResults({ employmentData, options, }: CostCalculatorResultProps): React.JSX.Element | null;
17
+ declare function CostCalculatorResults({ employmentData, options, }: CostCalculatorResultProps): React__default.JSX.Element | null;
18
18
 
19
19
  export { CostCalculatorResults };