@remoteoss/remote-flows 0.3.0 → 0.4.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VZM3HYXN.js → chunk-2KK5HDYP.js} +2 -2
- package/dist/chunk-2PXGLWCY.js +2 -0
- package/dist/chunk-2PXGLWCY.js.map +1 -0
- package/dist/{chunk-P3N4X5KU.js → chunk-344TN4EG.js} +2 -2
- package/dist/{chunk-GGZV4QYL.js → chunk-4HAR3Z2C.js} +2 -2
- package/dist/chunk-6CT35VQR.js +2 -0
- package/dist/chunk-6CT35VQR.js.map +1 -0
- package/dist/chunk-BKBIALOU.js +2 -0
- package/dist/chunk-BKBIALOU.js.map +1 -0
- package/dist/chunk-BKROCZRD.js +2 -0
- package/dist/chunk-BKROCZRD.js.map +1 -0
- package/dist/chunk-BL2HRBUQ.js +2 -0
- package/dist/chunk-BL2HRBUQ.js.map +1 -0
- package/dist/{chunk-RCX4JUI3.js → chunk-D3XENMEM.js} +2 -2
- package/dist/chunk-DPKJX4NS.js +2 -0
- package/dist/chunk-DPKJX4NS.js.map +1 -0
- package/dist/chunk-FNMWKUNJ.js +2 -0
- package/dist/{chunk-AG27JG4N.js.map → chunk-FNMWKUNJ.js.map} +1 -1
- package/dist/chunk-GFBF55NR.js +2 -0
- package/dist/chunk-GFBF55NR.js.map +1 -0
- package/dist/{chunk-KQEIZSUS.js → chunk-GPICG72A.js} +2 -2
- package/dist/chunk-GULCZWSK.js +1 -0
- package/dist/chunk-GULCZWSK.js.map +1 -0
- package/dist/{chunk-THCM2G6C.js → chunk-GYSK6CY5.js} +2 -2
- package/dist/chunk-HSW5HMHH.js +2 -0
- package/dist/{chunk-U3TYUMTJ.js → chunk-J6LUE5K7.js} +2 -2
- package/dist/chunk-JIBRNWD2.js +2 -0
- package/dist/chunk-JIBRNWD2.js.map +1 -0
- package/dist/{chunk-LLA3Z2PK.js → chunk-JWIYUQ5X.js} +2 -2
- package/dist/{chunk-4APN5ST6.js → chunk-M5VZBMLC.js} +2 -2
- package/dist/chunk-M7WCW7WD.js +2 -0
- package/dist/chunk-M7WCW7WD.js.map +1 -0
- package/dist/chunk-MHKNAQLP.js +2 -0
- package/dist/chunk-MHKNAQLP.js.map +1 -0
- package/dist/{chunk-WJPC4J3U.js → chunk-NFEY2YL6.js} +2 -2
- package/dist/{chunk-BDCIVWHR.js → chunk-QEMICBEY.js} +2 -2
- package/dist/chunk-RIAYBN32.js +2 -0
- package/dist/chunk-RIAYBN32.js.map +1 -0
- package/dist/chunk-RLS4PMWA.js +2 -0
- package/dist/chunk-RLS4PMWA.js.map +1 -0
- package/dist/{chunk-G4R7TPQL.js → chunk-RRFSGYAC.js} +2 -2
- package/dist/chunk-S4FKLPBB.js +2 -0
- package/dist/chunk-S4FKLPBB.js.map +1 -0
- package/dist/chunk-SSIHUUZY.js +2 -0
- package/dist/chunk-SSIHUUZY.js.map +1 -0
- package/dist/chunk-WS3C3WIJ.js +2 -0
- package/dist/chunk-WS3C3WIJ.js.map +1 -0
- package/dist/{chunk-4C45VY6F.js → chunk-XJMVWJZ4.js} +2 -2
- package/dist/{chunk-WDV5ZDXL.js → chunk-XQ6WWP6K.js} +2 -2
- package/dist/chunk-XVOJ4RMC.js +2 -0
- package/dist/chunk-XVOJ4RMC.js.map +1 -0
- package/dist/{chunk-QJGFU4YO.js → chunk-YDUUQU4R.js} +2 -2
- package/dist/{chunk-L3E32MJU.js → chunk-YH5F6MGK.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +3 -1
- package/dist/flows/ContractAmendment/hooks.d.ts +3 -1
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +4 -2
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/types.d.ts +6 -8
- package/dist/flows/ContractAmendment/utils.d.ts +1 -1
- package/dist/flows/ContractAmendment/utils.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.d.ts +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +1 -1
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.d.ts +1 -1
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/BasicInformationStep.d.ts +15 -0
- package/dist/flows/Onboarding/BasicInformationStep.js +2 -0
- package/dist/flows/Onboarding/BasicInformationStep.js.map +1 -0
- package/dist/flows/Onboarding/BenefitsStep.d.ts +34 -0
- package/dist/flows/Onboarding/BenefitsStep.js +2 -0
- package/dist/flows/Onboarding/BenefitsStep.js.map +1 -0
- package/dist/flows/Onboarding/ContractDetailsStep.d.ts +12 -0
- package/dist/flows/Onboarding/ContractDetailsStep.js +2 -0
- package/dist/flows/Onboarding/ContractDetailsStep.js.map +1 -0
- package/dist/flows/Onboarding/OnboardingBack.d.ts +5 -0
- package/dist/flows/Onboarding/OnboardingBack.js +2 -0
- package/dist/flows/Onboarding/OnboardingBack.js.map +1 -0
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +52 -0
- package/dist/flows/Onboarding/OnboardingFlow.js +2 -0
- package/dist/flows/Onboarding/OnboardingFlow.js.map +1 -0
- package/dist/flows/Onboarding/OnboardingForm.d.ts +19 -0
- package/dist/flows/Onboarding/OnboardingForm.js +2 -0
- package/dist/flows/Onboarding/OnboardingForm.js.map +1 -0
- package/dist/flows/Onboarding/OnboardingInvite.d.ts +11 -0
- package/dist/flows/Onboarding/OnboardingInvite.js +2 -0
- package/dist/flows/Onboarding/OnboardingInvite.js.map +1 -0
- package/dist/flows/Onboarding/OnboardingSubmit.d.ts +5 -0
- package/dist/flows/Onboarding/OnboardingSubmit.js +2 -0
- package/dist/flows/Onboarding/OnboardingSubmit.js.map +1 -0
- package/dist/flows/Onboarding/context.d.ts +81 -0
- package/dist/flows/Onboarding/context.js +2 -0
- package/dist/flows/Onboarding/context.js.map +1 -0
- package/dist/flows/Onboarding/hooks.d.ts +136 -0
- package/dist/flows/Onboarding/hooks.js +2 -0
- package/dist/flows/Onboarding/hooks.js.map +1 -0
- package/dist/flows/Onboarding/index.d.ts +20 -0
- package/dist/flows/Onboarding/index.js +2 -0
- package/dist/flows/Onboarding/index.js.map +1 -0
- package/dist/flows/Onboarding/types.d.ts +31 -0
- package/dist/flows/Onboarding/types.js +1 -0
- package/dist/flows/Onboarding/types.js.map +1 -0
- package/dist/flows/Onboarding/utils.d.ts +8 -0
- package/dist/flows/Onboarding/utils.js +2 -0
- package/dist/flows/Onboarding/utils.js.map +1 -0
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +1 -1
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +1 -1
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/TimeOff.d.ts +1 -1
- package/dist/flows/Termination/TimeOff.js +1 -1
- package/dist/flows/Termination/context.d.ts +1 -1
- package/dist/flows/Termination/hooks.d.ts +1 -1
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +1 -1
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/types.d.ts +1 -1
- package/dist/flows/types.d.ts +16 -1
- package/dist/flows/utils.d.ts +3 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +14 -115
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/remoteFlows-CswYencu.d.ts +116 -0
- package/dist/{types.gen-Dta9Iy5C.d.ts → types.gen-HC04kr7n.d.ts} +169 -1
- package/package.json +3 -2
- package/dist/chunk-2Y22JKVE.js +0 -2
- package/dist/chunk-3MAYMGXF.js +0 -2
- package/dist/chunk-3MAYMGXF.js.map +0 -1
- package/dist/chunk-6YO6XWPH.js +0 -2
- package/dist/chunk-6YO6XWPH.js.map +0 -1
- package/dist/chunk-AG27JG4N.js +0 -2
- package/dist/chunk-VTPDBEHE.js +0 -2
- package/dist/chunk-VTPDBEHE.js.map +0 -1
- package/dist/chunk-YBACB5A6.js +0 -2
- package/dist/chunk-YBACB5A6.js.map +0 -1
- /package/dist/{chunk-VZM3HYXN.js.map → chunk-2KK5HDYP.js.map} +0 -0
- /package/dist/{chunk-P3N4X5KU.js.map → chunk-344TN4EG.js.map} +0 -0
- /package/dist/{chunk-GGZV4QYL.js.map → chunk-4HAR3Z2C.js.map} +0 -0
- /package/dist/{chunk-RCX4JUI3.js.map → chunk-D3XENMEM.js.map} +0 -0
- /package/dist/{chunk-KQEIZSUS.js.map → chunk-GPICG72A.js.map} +0 -0
- /package/dist/{chunk-THCM2G6C.js.map → chunk-GYSK6CY5.js.map} +0 -0
- /package/dist/{chunk-2Y22JKVE.js.map → chunk-HSW5HMHH.js.map} +0 -0
- /package/dist/{chunk-U3TYUMTJ.js.map → chunk-J6LUE5K7.js.map} +0 -0
- /package/dist/{chunk-LLA3Z2PK.js.map → chunk-JWIYUQ5X.js.map} +0 -0
- /package/dist/{chunk-4APN5ST6.js.map → chunk-M5VZBMLC.js.map} +0 -0
- /package/dist/{chunk-WJPC4J3U.js.map → chunk-NFEY2YL6.js.map} +0 -0
- /package/dist/{chunk-BDCIVWHR.js.map → chunk-QEMICBEY.js.map} +0 -0
- /package/dist/{chunk-G4R7TPQL.js.map → chunk-RRFSGYAC.js.map} +0 -0
- /package/dist/{chunk-4C45VY6F.js.map → chunk-XJMVWJZ4.js.map} +0 -0
- /package/dist/{chunk-WDV5ZDXL.js.map → chunk-XQ6WWP6K.js.map} +0 -0
- /package/dist/{chunk-QJGFU4YO.js.map → chunk-YDUUQU4R.js.map} +0 -0
- /package/dist/{chunk-L3E32MJU.js.map → chunk-YH5F6MGK.js.map} +0 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ControllerRenderProps, FieldValues, ControllerFieldState } from 'react-hook-form';
|
|
3
|
+
import { AnySchema } from 'yup';
|
|
4
|
+
|
|
5
|
+
type ThemeProviderProps = PropsWithChildren<{
|
|
6
|
+
theme?: Partial<{
|
|
7
|
+
colors: ThemeColors;
|
|
8
|
+
spacing: string;
|
|
9
|
+
borderRadius: string;
|
|
10
|
+
font: ThemeFont;
|
|
11
|
+
}>;
|
|
12
|
+
}>;
|
|
13
|
+
type ThemeColors = Partial<{
|
|
14
|
+
borderInput: string;
|
|
15
|
+
primaryBackground: string;
|
|
16
|
+
primaryForeground: string;
|
|
17
|
+
accentBackground: string;
|
|
18
|
+
accentForeground: string;
|
|
19
|
+
danger: string;
|
|
20
|
+
warningBackground: string;
|
|
21
|
+
warningBorder: string;
|
|
22
|
+
}>;
|
|
23
|
+
type ThemeFont = {
|
|
24
|
+
fontSizeBase: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type SupportedTypes = 'text' | 'number' | 'email' | 'select' | 'radio' | 'fieldset' | 'date' | 'checkbox' | 'textarea' | 'money' | 'file' | 'countries';
|
|
28
|
+
|
|
29
|
+
type StatementProps = {
|
|
30
|
+
title?: string;
|
|
31
|
+
description: string;
|
|
32
|
+
severity: 'warning' | 'error' | 'success' | 'info' | 'neutral' | 'time';
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
type AuthResponse = {
|
|
36
|
+
accessToken: string;
|
|
37
|
+
expiresIn: number;
|
|
38
|
+
};
|
|
39
|
+
type JSFField = {
|
|
40
|
+
computedAttributes: Record<string, unknown>;
|
|
41
|
+
description: string;
|
|
42
|
+
errorMessage: Record<string, string>;
|
|
43
|
+
inputType: SupportedTypes;
|
|
44
|
+
isVisible: boolean;
|
|
45
|
+
jsonType: string;
|
|
46
|
+
label: string;
|
|
47
|
+
name: string;
|
|
48
|
+
required: boolean;
|
|
49
|
+
schema: AnySchema;
|
|
50
|
+
scopedJsonSchema: Record<string, unknown>;
|
|
51
|
+
type: string;
|
|
52
|
+
options?: Array<{
|
|
53
|
+
value: string;
|
|
54
|
+
label: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
}>;
|
|
57
|
+
defaultValue?: string | number;
|
|
58
|
+
minDate?: string;
|
|
59
|
+
maxLength?: number;
|
|
60
|
+
multiple?: boolean;
|
|
61
|
+
};
|
|
62
|
+
type Components = {
|
|
63
|
+
[K in SupportedTypes]?: React.ComponentType<{
|
|
64
|
+
/**
|
|
65
|
+
* Field prop from React Hook Form's Controller component.
|
|
66
|
+
* Contains field state and methods for registration.
|
|
67
|
+
* @see https://react-hook-form.com/docs/usecontroller/controller
|
|
68
|
+
*/
|
|
69
|
+
field: ControllerRenderProps<FieldValues, string>;
|
|
70
|
+
/**
|
|
71
|
+
* Field state prop from React Hook Form's Controller component.
|
|
72
|
+
* Contains information about the field's state, such as errors, touched status, etc.
|
|
73
|
+
* @see https://react-hook-form.com/docs/usecontroller/controller
|
|
74
|
+
*/
|
|
75
|
+
fieldState: ControllerFieldState;
|
|
76
|
+
/**
|
|
77
|
+
* Metadata derived from JSON schema parsing that provides additional context and validation rules for the field.
|
|
78
|
+
* Contains properties defined in the original JSON schema such as type, format, constraints, etc.
|
|
79
|
+
*/
|
|
80
|
+
fieldData: JSFField;
|
|
81
|
+
}>;
|
|
82
|
+
} & {
|
|
83
|
+
statement?: React.ComponentType<{
|
|
84
|
+
data: StatementProps;
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
type RemoteFlowsSDKProps = Omit<ThemeProviderProps, 'children'> & {
|
|
88
|
+
/**
|
|
89
|
+
* Function to authenticate the user and obtain an access token.
|
|
90
|
+
* @returns A promise that resolves to an object containing the access token and its expiration time.
|
|
91
|
+
*/
|
|
92
|
+
auth: () => Promise<AuthResponse>;
|
|
93
|
+
/**
|
|
94
|
+
* Components to override the default field components used in the SDK.
|
|
95
|
+
*/
|
|
96
|
+
components?: Components;
|
|
97
|
+
/**
|
|
98
|
+
* Flag to indicate if the SDK is in testing mode and use the testing environment.
|
|
99
|
+
* If true, the SDK will use the testing environment for all API calls.
|
|
100
|
+
*/
|
|
101
|
+
isTestingMode?: boolean;
|
|
102
|
+
proxy?: {
|
|
103
|
+
/**
|
|
104
|
+
* URL of the proxy server to use for API calls.
|
|
105
|
+
*/
|
|
106
|
+
url: string;
|
|
107
|
+
/**
|
|
108
|
+
* Headers to include in the API requests.
|
|
109
|
+
*/
|
|
110
|
+
headers?: {
|
|
111
|
+
[key: string]: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export type { Components as C, RemoteFlowsSDKProps as R };
|
|
@@ -162,6 +162,33 @@ type EmploymentShowResponse = {
|
|
|
162
162
|
};
|
|
163
163
|
};
|
|
164
164
|
};
|
|
165
|
+
/**
|
|
166
|
+
* Complete information of an employment
|
|
167
|
+
*/
|
|
168
|
+
type EmploymentBasicResponse = {
|
|
169
|
+
/**
|
|
170
|
+
* Employment basic information. As its properties may vary depending on the country,
|
|
171
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
172
|
+
* passing the country code and `basic_information` as path parameters.
|
|
173
|
+
*/
|
|
174
|
+
basic_information?: {
|
|
175
|
+
[key: string]: unknown;
|
|
176
|
+
};
|
|
177
|
+
company_id?: string;
|
|
178
|
+
country_code?: string;
|
|
179
|
+
created_at?: string;
|
|
180
|
+
employment_lifecycle_stage?: EmploymentLifecycleStage;
|
|
181
|
+
full_name?: string;
|
|
182
|
+
id?: UuidSlug;
|
|
183
|
+
job_title?: string;
|
|
184
|
+
personal_email?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Required for employees, optional for contractors
|
|
187
|
+
*/
|
|
188
|
+
provisional_start_date?: string;
|
|
189
|
+
type?: 'employee' | 'contractor';
|
|
190
|
+
updated_at?: string;
|
|
191
|
+
};
|
|
165
192
|
/**
|
|
166
193
|
* Optional UTC date time in YYYY-MM-DDTHH:mm:ss format
|
|
167
194
|
*/
|
|
@@ -491,6 +518,11 @@ type OnboardingTasks = {
|
|
|
491
518
|
personal_details: TaskDescription;
|
|
492
519
|
pricing_plan_details: TaskDescription;
|
|
493
520
|
};
|
|
521
|
+
type EmploymentCreationResponse = {
|
|
522
|
+
data?: {
|
|
523
|
+
employment?: EmploymentBasicResponse;
|
|
524
|
+
};
|
|
525
|
+
};
|
|
494
526
|
/**
|
|
495
527
|
* The status of employment
|
|
496
528
|
*/
|
|
@@ -502,6 +534,12 @@ type CostCalculatorEmployment = {
|
|
|
502
534
|
region: MinimalRegion;
|
|
503
535
|
regional_currency_costs: CostCalculatorCosts;
|
|
504
536
|
};
|
|
537
|
+
type UuidSlug = string;
|
|
538
|
+
type SuccessResponse = {
|
|
539
|
+
data: {
|
|
540
|
+
status?: string;
|
|
541
|
+
};
|
|
542
|
+
};
|
|
505
543
|
type LeavePolicy = {
|
|
506
544
|
leave_policy_variant_slug: string;
|
|
507
545
|
leave_type: TimeoffType;
|
|
@@ -510,6 +548,9 @@ type LeavePolicy = {
|
|
|
510
548
|
type TooManyRequestsResponse = {
|
|
511
549
|
message?: string;
|
|
512
550
|
};
|
|
551
|
+
type ConflictResponse = {
|
|
552
|
+
message?: string;
|
|
553
|
+
};
|
|
513
554
|
/**
|
|
514
555
|
* TimeoffDay schema
|
|
515
556
|
*/
|
|
@@ -687,7 +728,46 @@ type Timeoff = {
|
|
|
687
728
|
timeoff_type: TimeoffType;
|
|
688
729
|
timezone: Timezone;
|
|
689
730
|
};
|
|
731
|
+
/**
|
|
732
|
+
* Description of the basic required and onboarding tasks params to create an employment.
|
|
733
|
+
* You do not need to include all onboarding tasks when creating or updating an employment.
|
|
734
|
+
*
|
|
735
|
+
*/
|
|
736
|
+
type EmploymentCreateParams = {
|
|
737
|
+
/**
|
|
738
|
+
* Employment basic information. As its properties may vary depending on the country,
|
|
739
|
+
* you must query the [Show form schema](#tag/Countries/operation/get_show_form_country) endpoint
|
|
740
|
+
* passing the country code and `employment_basic_information` as path parameters.
|
|
741
|
+
*/
|
|
742
|
+
basic_information: {
|
|
743
|
+
[key: string]: unknown;
|
|
744
|
+
};
|
|
745
|
+
/**
|
|
746
|
+
* This optional field is deprecated.
|
|
747
|
+
*/
|
|
748
|
+
company_id?: string;
|
|
749
|
+
country_code: string;
|
|
750
|
+
/**
|
|
751
|
+
* A unique reference code for the employment record in a non-Remote system. This optional field links to external data sources. If not provided, it defaults to `null`. While uniqueness is recommended, it is not strictly enforced within Remote's system.
|
|
752
|
+
*/
|
|
753
|
+
external_id?: string;
|
|
754
|
+
/**
|
|
755
|
+
* If not provided, it will default to `employee`.
|
|
756
|
+
*/
|
|
757
|
+
type?: 'employee' | 'contractor';
|
|
758
|
+
};
|
|
690
759
|
type TimeoffStatus = 'approved' | 'cancelled' | 'declined' | 'requested' | 'taken' | 'cancel_requested';
|
|
760
|
+
type ForbiddenResponse = {
|
|
761
|
+
message: string;
|
|
762
|
+
};
|
|
763
|
+
/**
|
|
764
|
+
* Complete information of an employment
|
|
765
|
+
*/
|
|
766
|
+
type EmploymentResponse = {
|
|
767
|
+
data: {
|
|
768
|
+
employment?: Employment;
|
|
769
|
+
};
|
|
770
|
+
};
|
|
691
771
|
/**
|
|
692
772
|
* Contract Amendment response
|
|
693
773
|
*/
|
|
@@ -723,6 +803,29 @@ type PostCreateOffboardingErrors = {
|
|
|
723
803
|
500: RequestError;
|
|
724
804
|
};
|
|
725
805
|
type PostCreateOffboardingError = PostCreateOffboardingErrors[keyof PostCreateOffboardingErrors];
|
|
806
|
+
type PostCreateEmployment2Errors = {
|
|
807
|
+
/**
|
|
808
|
+
* Bad Request
|
|
809
|
+
*/
|
|
810
|
+
400: BadRequestResponse;
|
|
811
|
+
/**
|
|
812
|
+
* Unauthorized
|
|
813
|
+
*/
|
|
814
|
+
401: UnauthorizedResponse;
|
|
815
|
+
/**
|
|
816
|
+
* Not Found
|
|
817
|
+
*/
|
|
818
|
+
404: NotFoundResponse;
|
|
819
|
+
/**
|
|
820
|
+
* Unprocessable Entity
|
|
821
|
+
*/
|
|
822
|
+
422: UnprocessableEntityResponse;
|
|
823
|
+
/**
|
|
824
|
+
* Too many requests
|
|
825
|
+
*/
|
|
826
|
+
429: TooManyRequestsResponse;
|
|
827
|
+
};
|
|
828
|
+
type PostCreateEmployment2Error = PostCreateEmployment2Errors[keyof PostCreateEmployment2Errors];
|
|
726
829
|
type PostCreateEstimationErrors = {
|
|
727
830
|
/**
|
|
728
831
|
* Not Found
|
|
@@ -734,6 +837,25 @@ type PostCreateEstimationErrors = {
|
|
|
734
837
|
422: UnprocessableEntityResponse;
|
|
735
838
|
};
|
|
736
839
|
type PostCreateEstimationError = PostCreateEstimationErrors[keyof PostCreateEstimationErrors];
|
|
840
|
+
type PutUpdateBenefitOfferErrors = {
|
|
841
|
+
/**
|
|
842
|
+
* Unauthorized
|
|
843
|
+
*/
|
|
844
|
+
401: UnauthorizedResponse;
|
|
845
|
+
/**
|
|
846
|
+
* Forbidden
|
|
847
|
+
*/
|
|
848
|
+
403: ForbiddenResponse;
|
|
849
|
+
/**
|
|
850
|
+
* Not Found
|
|
851
|
+
*/
|
|
852
|
+
404: NotFoundResponse;
|
|
853
|
+
/**
|
|
854
|
+
* Unprocessable Entity
|
|
855
|
+
*/
|
|
856
|
+
422: UnprocessableEntityResponse;
|
|
857
|
+
};
|
|
858
|
+
type PutUpdateBenefitOfferError = PutUpdateBenefitOfferErrors[keyof PutUpdateBenefitOfferErrors];
|
|
737
859
|
type PostCreateEstimationPdfErrors = {
|
|
738
860
|
/**
|
|
739
861
|
* Not Found
|
|
@@ -760,6 +882,33 @@ type PostCreateContractAmendmentErrors = {
|
|
|
760
882
|
422: UnprocessableEntityResponse;
|
|
761
883
|
};
|
|
762
884
|
type PostCreateContractAmendmentError = PostCreateContractAmendmentErrors[keyof PostCreateContractAmendmentErrors];
|
|
885
|
+
type PatchUpdateEmployment2Errors = {
|
|
886
|
+
/**
|
|
887
|
+
* Bad Request
|
|
888
|
+
*/
|
|
889
|
+
400: BadRequestResponse;
|
|
890
|
+
/**
|
|
891
|
+
* Unauthorized
|
|
892
|
+
*/
|
|
893
|
+
401: UnauthorizedResponse;
|
|
894
|
+
/**
|
|
895
|
+
* Not Found
|
|
896
|
+
*/
|
|
897
|
+
404: NotFoundResponse;
|
|
898
|
+
/**
|
|
899
|
+
* Conflict
|
|
900
|
+
*/
|
|
901
|
+
409: ConflictResponse;
|
|
902
|
+
/**
|
|
903
|
+
* Unprocessable Entity
|
|
904
|
+
*/
|
|
905
|
+
422: UnprocessableEntityResponse;
|
|
906
|
+
/**
|
|
907
|
+
* Too many requests
|
|
908
|
+
*/
|
|
909
|
+
429: TooManyRequestsResponse;
|
|
910
|
+
};
|
|
911
|
+
type PatchUpdateEmployment2Error = PatchUpdateEmployment2Errors[keyof PatchUpdateEmployment2Errors];
|
|
763
912
|
type PostAutomatableContractAmendmentErrors = {
|
|
764
913
|
/**
|
|
765
914
|
* Unauthorized
|
|
@@ -775,5 +924,24 @@ type PostAutomatableContractAmendmentErrors = {
|
|
|
775
924
|
422: UnprocessableEntityResponse;
|
|
776
925
|
};
|
|
777
926
|
type PostAutomatableContractAmendmentError = PostAutomatableContractAmendmentErrors[keyof PostAutomatableContractAmendmentErrors];
|
|
927
|
+
type PostInviteEmploymentInvitationErrors = {
|
|
928
|
+
/**
|
|
929
|
+
* Bad Request
|
|
930
|
+
*/
|
|
931
|
+
400: BadRequestResponse;
|
|
932
|
+
/**
|
|
933
|
+
* Conflict
|
|
934
|
+
*/
|
|
935
|
+
409: ConflictResponse;
|
|
936
|
+
/**
|
|
937
|
+
* Unprocessable Entity
|
|
938
|
+
*/
|
|
939
|
+
422: UnprocessableEntityResponse;
|
|
940
|
+
/**
|
|
941
|
+
* Unprocessable Entity
|
|
942
|
+
*/
|
|
943
|
+
429: TooManyRequestsResponse;
|
|
944
|
+
};
|
|
945
|
+
type PostInviteEmploymentInvitationError = PostInviteEmploymentInvitationErrors[keyof PostInviteEmploymentInvitationErrors];
|
|
778
946
|
|
|
779
|
-
export type { ContractAmendmentAutomatableResponse as C, EmploymentShowResponse as E, ListTimeoffResponse as L, OffboardingResponse as O, PostAutomatableContractAmendmentError as P, TerminationDetailsParams as T, ContractAmendmentResponse as a, PostCreateContractAmendmentError as b, CostCalculatorEstimateResponse as c, PostCreateEstimationError as d, CostCalculatorEstimatePdfResponse as e, PostCreateEstimationPdfError as f, CostCalculatorEstimateParams as g, EmploymentTermType as h, PostCreateOffboardingError as i,
|
|
947
|
+
export type { ContractAmendmentAutomatableResponse as C, EmploymentShowResponse as E, ListTimeoffResponse as L, OffboardingResponse as O, PostAutomatableContractAmendmentError as P, SuccessResponse as S, TerminationDetailsParams as T, ContractAmendmentResponse as a, PostCreateContractAmendmentError as b, CostCalculatorEstimateResponse as c, PostCreateEstimationError as d, CostCalculatorEstimatePdfResponse as e, PostCreateEstimationPdfError as f, CostCalculatorEstimateParams as g, EmploymentTermType as h, PostCreateOffboardingError as i, EmploymentCreationResponse as j, PostCreateEmployment2Error as k, EmploymentResponse as l, PatchUpdateEmployment2Error as m, PutUpdateBenefitOfferError as n, PostInviteEmploymentInvitationError as o, EmploymentCreateParams as p, TimeoffStatus as q };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remoteoss/remote-flows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-alpha.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "NODE_ENV=production tsup",
|
|
6
6
|
"ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@hey-api/client-fetch": "^0.8.1",
|
|
54
54
|
"@hookform/resolvers": "^4.1.3",
|
|
55
55
|
"@radix-ui/react-checkbox": "^1.1.4",
|
|
56
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
56
|
+
"@radix-ui/react-dialog": "^1.1.13",
|
|
57
57
|
"@radix-ui/react-label": "^2.1.2",
|
|
58
58
|
"@radix-ui/react-popover": "^1.1.6",
|
|
59
59
|
"@radix-ui/react-radio-group": "^1.2.3",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"@tanstack/react-query": "^5.67.2",
|
|
70
70
|
"class-variance-authority": "^0.7.1",
|
|
71
71
|
"clsx": "^2.1.1",
|
|
72
|
+
"cmdk": "^1.1.1",
|
|
72
73
|
"date-fns": "^3.6.0",
|
|
73
74
|
"dompurify": "^3.2.5",
|
|
74
75
|
"lodash": "^4.17.21",
|
package/dist/chunk-2Y22JKVE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-JODJFARP.js";import{a as m}from"./chunk-W5DG5WWJ.js";import{a as e}from"./chunk-VX2UC3HG.js";import{a as i}from"./chunk-XSHHMBMT.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
|
|
2
|
-
//# sourceMappingURL=chunk-2Y22JKVE.js.map
|
package/dist/chunk-3MAYMGXF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./chunk-WJPC4J3U.js";import{a as S}from"./chunk-JRQSZHUU.js";import{a as l,b as g}from"./chunk-RCX4JUI3.js";import{c as P,f as b,j}from"./chunk-AG27JG4N.js";import{a as k}from"./chunk-S56EWAS4.js";import{d}from"./chunk-WRDKLT4N.js";import{a as w,c as A}from"./chunk-YBACB5A6.js";import{a as e}from"./chunk-AYDF3IFZ.js";import{createHeadlessForm as I,modify as R}from"@remoteoss/json-schema-form";import{useMutation as M,useQuery as J}from"@tanstack/react-query";var K=e(({countryCode:a,employment:t,fieldValues:i,options:n})=>{let{client:u}=d(),s=n?.jsonSchemaVersion?.contract_amendments?{json_schema_version:n.jsonSchemaVersion.contract_amendments}:{};return J({queryKey:["contract-amendment-schema"],retry:!1,queryFn:e(async()=>{let r=await P({client:u,headers:{Authorization:""},query:{employment_id:t?.data?.employment?.id,country_code:a,...s}});if(r.error||!r.data)throw new Error("Failed to fetch contract amendment schema");return r},"queryFn"),enabled:!!t,select:e(({data:r})=>{let c=r?.data||{};if(n&&n.jsfModify){let{schema:p}=R(c,n.jsfModify);c=p}let o={...i,annual_gross_salary:i?.annual_gross_salary?w(i?.annual_gross_salary):void 0},f=Object.keys(o).length>0;return I(c,{initialValues:f?o:g(t)})},"select")})},"useContractAmendmentSchemaQuery"),N=e(()=>{let{client:a}=d();return M({mutationFn:e(t=>b({client:a,headers:{Authorization:""},body:t}),"mutationFn")})},"useCreateContractAmendmentMutation"),U=e(()=>{let{client:a}=d();return M({mutationFn:e(t=>j({client:a,headers:{Authorization:""},body:t}),"mutationFn")})},"useAutomatableContractAmendmentMutation"),re=e(({employmentId:a,countryCode:t,options:i})=>{let{fieldValues:n,setFieldValues:u,stepState:s,nextStep:r,previousStep:c}=k(l),{data:o,isLoading:f,isError:V,error:p}=v({employmentId:a}),T=Object.keys(n).length===0&&Object.keys(s.values?.form||{}).length>0,{data:m,isLoading:L,isError:Q,error:q}=K({employment:o,countryCode:t,fieldValues:T?s.values?.form:n,options:i}),z=g(o,m?.fields),_=N(),F=U();async function O(y){let h=A(y,m?.fields||[],{isPartialValidation:!1}),E={employment_id:o?.data.employment?.id,amendment_contract_id:o?.data.employment?.active_contract_id,contract_amendment:{...h}};switch(s.currentStep.name){case l.form.name:{let{mutateAsync:C}=S(F),H=await C(E);return r(),H}case l.confirmation_form.name:{let{mutateAsync:C}=S(_);return C(E)}default:throw new Error("Invalid step state")}}e(O,"onSubmit");function x(y){if(m){let h=A(y,m?.fields);return m?.handleValidation(h)}return null}e(x,"handleValidation");function B(){c()}return e(B,"back"),{stepState:s,fields:m?.fields||[],isLoading:f||L,isError:V||Q,error:p||q,isSubmitting:F.isPending||_.isPending,initialValues:z,values:n,handleValidation:x,checkFieldUpdates:u,onSubmit:O,back:B}},"useContractAmendment");export{re as a};
|
|
2
|
-
//# sourceMappingURL=chunk-3MAYMGXF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/ContractAmendment/hooks.ts"],"sourcesContent":["import {\n CreateContractAmendmentParams,\n EmploymentShowResponse,\n getShowContractAmendmentSchema,\n postAutomatableContractAmendment,\n postCreateContractAmendment,\n} from '@/src/client';\n\nimport {\n convertToCents,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport { mutationToPromise } from '@/src/lib/mutations';\n\nimport { Client } from '@hey-api/client-fetch';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { ContractAmendmentParams } from './types';\n\nimport { useEmploymentQuery } from '@/src/common/hooks';\nimport { useClient } from '@/src/context';\nimport { FieldValues } from 'react-hook-form';\nimport { useStepState } from '../useStepState';\nimport { buildInitialValues, STEPS } from './utils';\n\ntype ContractAmendmentSchemaParams = {\n countryCode: string;\n employment: EmploymentShowResponse | undefined;\n fieldValues: FieldValues | undefined;\n options?: ContractAmendmentParams['options'];\n};\n\nconst useContractAmendmentSchemaQuery = ({\n countryCode,\n employment,\n fieldValues,\n options,\n}: ContractAmendmentSchemaParams) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.contract_amendments\n ? {\n json_schema_version: options.jsonSchemaVersion.contract_amendments,\n }\n : {};\n return useQuery({\n queryKey: ['contract-amendment-schema'],\n retry: false,\n queryFn: async () => {\n const response = await getShowContractAmendmentSchema({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n query: {\n employment_id: employment?.data?.employment?.id as string,\n country_code: countryCode,\n ...jsonSchemaQueryParam,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch contract amendment schema');\n }\n\n return response;\n },\n enabled: Boolean(employment),\n select: ({ data }) => {\n let jsfSchema = data?.data || {};\n\n if (options && options.jsfModify) {\n const { schema } = modify(jsfSchema, options.jsfModify);\n jsfSchema = schema;\n }\n\n const copyFieldValues = {\n ...fieldValues,\n annual_gross_salary: fieldValues?.annual_gross_salary\n ? convertToCents(fieldValues?.annual_gross_salary)\n : undefined,\n };\n\n const hasFieldValues = Object.keys(copyFieldValues).length > 0;\n\n const result = createHeadlessForm(jsfSchema, {\n initialValues: hasFieldValues\n ? copyFieldValues\n : buildInitialValues(employment),\n });\n return result;\n },\n });\n};\n\nconst useCreateContractAmendmentMutation = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: CreateContractAmendmentParams) => {\n return postCreateContractAmendment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n });\n },\n });\n};\n\nconst useAutomatableContractAmendmentMutation = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: CreateContractAmendmentParams) => {\n return postAutomatableContractAmendment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n });\n },\n });\n};\n\nexport const useContractAmendment = ({\n employmentId,\n countryCode,\n options,\n}: ContractAmendmentParams) => {\n const { fieldValues, setFieldValues, stepState, nextStep, previousStep } =\n useStepState<keyof typeof STEPS>(STEPS);\n\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n isError: isErrorEmployment,\n error: errorEmployment,\n } = useEmploymentQuery({\n employmentId,\n });\n\n const isNavigatingBackToForm =\n Object.keys(fieldValues).length === 0 &&\n Object.keys(stepState.values?.form || {}).length > 0;\n\n const {\n data: contractAmendmentHeadlessForm,\n isLoading: isLoadingContractAmendments,\n isError: isErrorContractAmendmentSchema,\n error: errorContractAmendmentSchema,\n } = useContractAmendmentSchemaQuery({\n employment,\n countryCode,\n // In case the user is navigating back to the form step, we need to\n // pass the previous field values, so that the schema can be\n // generated with the correct values.\n fieldValues: isNavigatingBackToForm ? stepState.values?.form : fieldValues,\n options,\n });\n\n const initialValues = buildInitialValues(\n employment,\n contractAmendmentHeadlessForm?.fields,\n );\n\n const createContractAmendmentMutation = useCreateContractAmendmentMutation();\n const automatableContractAmendmentMutation =\n useAutomatableContractAmendmentMutation();\n\n async function onSubmit(values: FieldValues) {\n const parsedValues = parseJSFToValidate(\n values,\n contractAmendmentHeadlessForm?.fields || [],\n {\n isPartialValidation: false,\n },\n );\n\n const payload = {\n employment_id: employment?.data.employment?.id as string,\n amendment_contract_id: employment?.data.employment\n ?.active_contract_id as string,\n contract_amendment: {\n ...parsedValues,\n },\n };\n\n switch (stepState.currentStep.name) {\n case STEPS.form.name: {\n const { mutateAsync } = mutationToPromise(\n automatableContractAmendmentMutation,\n );\n\n const automatableContractAmendment = await mutateAsync(payload);\n\n nextStep();\n\n return automatableContractAmendment;\n }\n case STEPS.confirmation_form.name: {\n const { mutateAsync } = mutationToPromise(\n createContractAmendmentMutation,\n );\n\n return mutateAsync(payload);\n }\n\n default:\n throw new Error('Invalid step state');\n }\n }\n\n function handleValidation(values: FieldValues) {\n if (contractAmendmentHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n contractAmendmentHeadlessForm?.fields,\n );\n\n return contractAmendmentHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n }\n\n function back() {\n previousStep();\n }\n\n return {\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: contractAmendmentHeadlessForm?.fields || [],\n /**\n * Loading state indicating if either employment or contract amendment data is being fetched\n */\n isLoading: isLoadingEmployment || isLoadingContractAmendments,\n /**\n * Error state indicating if there was an error fetching either employment or contract amendment data\n */\n isError: isErrorEmployment || isErrorContractAmendmentSchema,\n /**\n * Error object containing details about any errors that occurred during data fetching\n */\n error: errorEmployment || errorContractAmendmentSchema,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting:\n automatableContractAmendmentMutation.isPending ||\n createContractAmendmentMutation.isPending,\n /**\n * Initial form values built from employment data and contract amendment fields\n */\n initialValues,\n /**\n * Current form field values\n */\n values: fieldValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation,\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n };\n};\n"],"mappings":"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","names":["createHeadlessForm","modify","useMutation","useQuery","useContractAmendmentSchemaQuery","__name","countryCode","employment","fieldValues","options","client","useClient","jsonSchemaQueryParam","useQuery","response","getShowContractAmendmentSchema","data","jsfSchema","schema","modify","copyFieldValues","convertToCents","hasFieldValues","createHeadlessForm","buildInitialValues","useCreateContractAmendmentMutation","useMutation","payload","postCreateContractAmendment","useAutomatableContractAmendmentMutation","postAutomatableContractAmendment","useContractAmendment","employmentId","setFieldValues","stepState","nextStep","previousStep","useStepState","STEPS","isLoadingEmployment","isErrorEmployment","errorEmployment","useEmploymentQuery","isNavigatingBackToForm","contractAmendmentHeadlessForm","isLoadingContractAmendments","isErrorContractAmendmentSchema","errorContractAmendmentSchema","initialValues","createContractAmendmentMutation","automatableContractAmendmentMutation","onSubmit","values","parsedValues","parseJSFToValidate","mutateAsync","mutationToPromise","automatableContractAmendment","handleValidation","back"]}
|
package/dist/chunk-6YO6XWPH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as x}from"./chunk-KH6QS5OU.js";import{a as T}from"./chunk-J55S4SEH.js";import{a as P}from"./chunk-6A3F6JG6.js";import{a as y,b as v,c as h,d as _,e as w}from"./chunk-GMGKIQLI.js";import{a as k}from"./chunk-WQHKB5T7.js";import{a as n}from"./chunk-5ETXP2QF.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-6YO6XWPH.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorResults.tsx","../src/components/ui/badge.tsx","../src/components/ui/tabs.tsx"],"sourcesContent":["import { Euro } from 'lucide-react';\nimport React, { lazy, useState } from 'react';\n\nimport { CostCalculatorEstimateResponse } from '@/src/client';\nimport { Badge } from '@/src/components/ui/badge';\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '@/src/components/ui/card';\nimport { Tabs, TabsList, TabsTrigger } from '@/src/components/ui/tabs';\nimport { cn } from '@/src/lib/utils';\nimport { CostCalculatorBenefitsBreakdown } from './CostCalculatorBenefitsBreakdown';\nimport { CostCalculatorContributionsBreakdown } from './CostCalculatorContributionsBreakdown';\nimport { CostCalculatorGrossSalary } from './CostCalculatorGrossSalary';\nimport { CostCalculatorTotalCost } from './CostCalculatorTotalCost';\n\nconst CostCalculatorResultsChart = lazy(\n () => import('./CostCalculatorResultsChart'),\n);\n\ninterface CostCalculatorResultProps {\n employmentData: CostCalculatorEstimateResponse['data'];\n options?: Partial<{\n title: string;\n description: string;\n showChart: boolean;\n chartColors: {\n grossSalary: string;\n contributions: string;\n benefits: string;\n };\n }>;\n}\n\nexport function CostCalculatorResults({\n employmentData,\n options,\n}: CostCalculatorResultProps) {\n const [view, setView] = useState<'monthly' | 'annual'>('monthly');\n const employment = employmentData.employments?.[0];\n\n if (!employment) {\n return null;\n }\n\n const costs =\n view === 'monthly'\n ? employment.employer_currency_costs\n : employment.employer_currency_costs;\n\n const currency = costs.currency.symbol;\n const grossSalary =\n view === 'monthly' ? costs.monthly_gross_salary : costs.annual_gross_salary;\n const benefitsTotal =\n view === 'monthly'\n ? costs.monthly_benefits_total\n : costs.annual_benefits_total;\n const contributionsTotal =\n view === 'monthly'\n ? costs.monthly_contributions_total\n : costs.annual_contributions_total;\n const totalCost =\n view === 'monthly' ? costs.monthly_total : costs.annual_total;\n\n const benefitsBreakdown =\n view === 'monthly'\n ? costs.monthly_benefits_breakdown\n : costs.annual_benefits_breakdown;\n const contributionsBreakdown =\n view === 'monthly'\n ? costs.monthly_contributions_breakdown\n : costs.annual_contributions_breakdown;\n\n const chartData = [\n {\n name: 'Gross Salary',\n value: grossSalary,\n color: options?.chartColors?.grossSalary ?? '#3b82f6',\n },\n {\n name: 'Contributions',\n value: contributionsTotal,\n color: options?.chartColors?.contributions ?? '#f59e0b',\n },\n ];\n\n if (benefitsBreakdown) {\n chartData.push({\n name: 'Benefits',\n value: benefitsTotal ?? 0,\n color: options?.chartColors?.benefits ?? '#10b981',\n });\n }\n\n return (\n <>\n <div className=\"flex flex-col md:flex-row gap-4 md:items-center justify-between mb-6 RemoteFlows__CostCalculatorResults\">\n <div className=\"RemoteFlows__CostCalculatorResults__Header\">\n <h2 className=\"text-xl font-semibold flex items-center gap-2\">\n <span className=\"flex items-center gap-1\">\n <Euro className=\"h-5 w-5 text-gray-600\" />\n {options?.title ?? 'Cost Calculator'}\n </span>\n <Badge className=\"ml-2\">{employment.country.name}</Badge>\n </h2>\n <p className=\"text-primary-foreground font-medium mt-1\">\n {options?.description ??\n `Total cost of employment in ${employment.country.name}`}\n </p>\n </div>\n\n <Tabs\n value={view}\n onValueChange={(v) => setView(v as 'monthly' | 'annual')}\n className=\"w-full md:w-auto RemoteFlows__CostCalculatorResults__Tabs\"\n >\n <TabsList className=\"grid w-full md:w-[200px] grid-cols-2\">\n <TabsTrigger value=\"monthly\">Monthly</TabsTrigger>\n <TabsTrigger value=\"annual\">Annual</TabsTrigger>\n </TabsList>\n </Tabs>\n </div>\n\n <div\n className={cn(\n 'grid grid-cols-1 gap-6',\n options?.showChart ? 'md:grid-cols-3' : '',\n 'RemoteFlows__CostCalculatorResults_CostBreakdown',\n )}\n >\n <Card className=\"md:col-span-2 rounded-lg\">\n <CardHeader className=\"pb-2\">\n <CardTitle>Cost Breakdown</CardTitle>\n <CardDescription>\n Detailed breakdown of all employer costs\n </CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-6\">\n {/* Salary Section */}\n <CostCalculatorGrossSalary\n grossSalary={grossSalary}\n currency={currency}\n />\n {/* Benefits Section */}\n {benefitsBreakdown ? (\n <CostCalculatorBenefitsBreakdown\n benefitsBreakdown={benefitsBreakdown}\n benefitsTotal={benefitsTotal}\n currency={currency}\n />\n ) : null}\n {/* Contributions Section */}\n <CostCalculatorContributionsBreakdown\n contributionsBreakdown={contributionsBreakdown}\n contributionsTotal={contributionsTotal}\n currency={currency}\n />\n {/* Total */}\n <CostCalculatorTotalCost\n totalCost={totalCost}\n currency={currency}\n />\n </div>\n </CardContent>\n </Card>\n\n {options?.showChart && (\n <CostCalculatorResultsChart\n chartData={chartData}\n currency={currency}\n />\n )}\n </div>\n </>\n );\n}\n","import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/src/lib/utils';\n\nconst badgeVariants = cva(\n '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',\n {\n variants: {\n variant: {\n default:\n 'border-transparent bg-badge text-badge-foreground rounded-full [a&]:hover:bg-primary/90',\n secondary:\n 'border-transparent bg-secondary text-secondary-foreground rounded-full [a&]:hover:bg-secondary/90',\n destructive:\n 'border-transparent bg-destructive text-white rounded-full [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',\n outline:\n 'text-foreground rounded-full [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<'span'> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : 'span';\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nexport { Badge, badgeVariants };\n","import * as React from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Tabs({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn('flex flex-col gap-2', className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n 'bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-1',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\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\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('flex-1 outline-none', className)}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n"],"mappings":"oTAAA,OAAS,QAAAA,MAAY,eACrB,OAAOC,GAAS,QAAAC,EAAM,YAAAC,MAAgB,QCDtC,UAAYC,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAA8B,2BAIvC,IAAMC,EAAgBC,EACpB,iZACA,CACE,SAAU,CACR,QAAS,CACP,QACE,0FACF,UACE,oGACF,YACE,kKACF,QACE,qFACJ,CACF,EACA,gBAAiB,CACf,QAAS,SACX,CACF,CACF,EAEA,SAASC,EAAM,CACb,UAAAC,EACA,QAAAC,EACA,QAAAC,EAAU,GACV,GAAGC,CACL,EAC8D,CAG5D,OACE,gBAHWD,EAAUE,EAAO,OAG3B,CACC,YAAU,QACV,UAAWC,EAAGR,EAAc,CAAE,QAAAI,CAAQ,CAAC,EAAGD,CAAS,EAClD,GAAGG,EACN,CAEJ,CAhBSG,EAAAP,EAAA,SC3BT,UAAYQ,MAAW,QACvB,UAAYC,MAAmB,uBAI/B,SAASC,EAAK,CACZ,UAAAC,EACA,GAAGC,CACL,EAAoD,CAClD,OACE,gBAAe,OAAd,CACC,YAAU,OACV,UAAWC,EAAG,sBAAuBF,CAAS,EAC7C,GAAGC,EACN,CAEJ,CAXSE,EAAAJ,EAAA,QAaT,SAASK,EAAS,CAChB,UAAAJ,EACA,GAAGC,CACL,EAAoD,CAClD,OACE,gBAAe,OAAd,CACC,YAAU,YACV,UAAWC,EACT,kGACAF,CACF,EACC,GAAGC,EACN,CAEJ,CAdSE,EAAAC,EAAA,YAgBT,SAASC,EAAY,CACnB,UAAAL,EACA,GAAGC,CACL,EAAuD,CACrD,OACE,gBAAe,UAAd,CACC,YAAU,eACV,UAAWC,EACT,0fACAF,CACF,EACC,GAAGC,EACN,CAEJ,CAdSE,EAAAE,EAAA,eFfT,IAAMC,EAA6BC,EACjC,IAAM,OAAO,8DAA8B,CAC7C,EAgBO,SAASC,GAAsB,CACpC,eAAAC,EACA,QAAAC,CACF,EAA8B,CAC5B,GAAM,CAACC,EAAMC,CAAO,EAAIC,EAA+B,SAAS,EAC1DC,EAAaL,EAAe,cAAc,CAAC,EAEjD,GAAI,CAACK,EACH,OAAO,KAGT,IAAMC,EAEAD,EAAW,wBAGXE,EAAWD,EAAM,SAAS,OAC1BE,EACJN,IAAS,UAAYI,EAAM,qBAAuBA,EAAM,oBACpDG,EACJP,IAAS,UACLI,EAAM,uBACNA,EAAM,sBACNI,EACJR,IAAS,UACLI,EAAM,4BACNA,EAAM,2BACNK,EACJT,IAAS,UAAYI,EAAM,cAAgBA,EAAM,aAE7CM,EACJV,IAAS,UACLI,EAAM,2BACNA,EAAM,0BACNO,EACJX,IAAS,UACLI,EAAM,gCACNA,EAAM,+BAENQ,EAAY,CAChB,CACE,KAAM,eACN,MAAON,EACP,MAAOP,GAAS,aAAa,aAAe,SAC9C,EACA,CACE,KAAM,gBACN,MAAOS,EACP,MAAOT,GAAS,aAAa,eAAiB,SAChD,CACF,EAEA,OAAIW,GACFE,EAAU,KAAK,CACb,KAAM,WACN,MAAOL,GAAiB,EACxB,MAAOR,GAAS,aAAa,UAAY,SAC3C,CAAC,EAIDc,EAAA,cAAAA,EAAA,cACEA,EAAA,cAAC,OAAI,UAAU,2GACbA,EAAA,cAAC,OAAI,UAAU,8CACbA,EAAA,cAAC,MAAG,UAAU,iDACZA,EAAA,cAAC,QAAK,UAAU,2BACdA,EAAA,cAACC,EAAA,CAAK,UAAU,wBAAwB,EACvCf,GAAS,OAAS,iBACrB,EACAc,EAAA,cAACE,EAAA,CAAM,UAAU,QAAQZ,EAAW,QAAQ,IAAK,CACnD,EACAU,EAAA,cAAC,KAAE,UAAU,4CACVd,GAAS,aACR,+BAA+BI,EAAW,QAAQ,IAAI,EAC1D,CACF,EAEAU,EAAA,cAACG,EAAA,CACC,MAAOhB,EACP,cAAgBiB,GAAMhB,EAAQgB,CAAyB,EACvD,UAAU,6DAEVJ,EAAA,cAACK,EAAA,CAAS,UAAU,wCAClBL,EAAA,cAACM,EAAA,CAAY,MAAM,WAAU,SAAO,EACpCN,EAAA,cAACM,EAAA,CAAY,MAAM,UAAS,QAAM,CACpC,CACF,CACF,EAEAN,EAAA,cAAC,OACC,UAAWO,EACT,yBACArB,GAAS,UAAY,iBAAmB,GACxC,kDACF,GAEAc,EAAA,cAACQ,EAAA,CAAK,UAAU,4BACdR,EAAA,cAACS,EAAA,CAAW,UAAU,QACpBT,EAAA,cAACU,EAAA,KAAU,gBAAc,EACzBV,EAAA,cAACW,EAAA,KAAgB,0CAEjB,CACF,EACAX,EAAA,cAACY,EAAA,KACCZ,EAAA,cAAC,OAAI,UAAU,aAEbA,EAAA,cAACa,EAAA,CACC,YAAapB,EACb,SAAUD,EACZ,EAECK,EACCG,EAAA,cAACc,EAAA,CACC,kBAAmBjB,EACnB,cAAeH,EACf,SAAUF,EACZ,EACE,KAEJQ,EAAA,cAACe,EAAA,CACC,uBAAwBjB,EACxB,mBAAoBH,EACpB,SAAUH,EACZ,EAEAQ,EAAA,cAACgB,EAAA,CACC,UAAWpB,EACX,SAAUJ,EACZ,CACF,CACF,CACF,EAECN,GAAS,WACRc,EAAA,cAAClB,EAAA,CACC,UAAWiB,EACX,SAAUP,EACZ,CAEJ,CACF,CAEJ,CA9IgByB,EAAAjC,GAAA","names":["Euro","React","lazy","useState","React","Slot","cva","badgeVariants","cva","Badge","className","variant","asChild","props","Slot","cn","__name","React","TabsPrimitive","Tabs","className","props","cn","__name","TabsList","TabsTrigger","CostCalculatorResultsChart","lazy","CostCalculatorResults","employmentData","options","view","setView","useState","employment","costs","currency","grossSalary","benefitsTotal","contributionsTotal","totalCost","benefitsBreakdown","contributionsBreakdown","chartData","React","Euro","Badge","Tabs","v","TabsList","TabsTrigger","cn","Card","CardHeader","CardTitle","CardDescription","CardContent","CostCalculatorGrossSalary","CostCalculatorBenefitsBreakdown","CostCalculatorContributionsBreakdown","CostCalculatorTotalCost","__name"]}
|
package/dist/chunk-AG27JG4N.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as t}from"./chunk-AYDF3IFZ.js";import{formDataBodySerializer as i}from"@hey-api/client-fetch";import{createClient as o,createConfig as n}from"@hey-api/client-fetch";var r=o(n({baseUrl:"https://gateway.remote.com/"}));var c=t(e=>(e?.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/offboardings",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateOffboarding");var h=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/schema",...e}),"getShowContractAmendmentSchema");var d=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/estimation",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEstimation");var m=t(e=>(e?.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/estimation-pdf",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEstimationPdf");var u=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateContractAmendment");var E=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/countries",...e}),"getIndexCountry");var y=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e}),"getShowEmployment");var w=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/regions/{slug}/fields",...e}),"getShowRegionField");var C=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/automatable",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postAutomatableContractAmendment");var O=t(e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/company-currencies",...e}),"getIndexCompanyCurrency");var T=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/timeoff",...e}),"getIndexTimeoff");export{r as a,c as b,h as c,d,m as e,u as f,E as g,y as h,w as i,C as j,O as k,T as l};
|
|
2
|
-
//# sourceMappingURL=chunk-AG27JG4N.js.map
|
package/dist/chunk-VTPDBEHE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as g}from"./chunk-WRDKLT4N.js";import{a as Y,b as U}from"./chunk-56BNVYTD.js";import{b as _,c as S,d as y,e as R,f as w,g as N}from"./chunk-IDSJI7KQ.js";import{a as s}from"./chunk-5ETXP2QF.js";import{a as o}from"./chunk-AYDF3IFZ.js";import*as B from"react";import*as J from"@radix-ui/react-checkbox";import{Check as Be}from"lucide-react";var O=B.forwardRef(({className:e,...t},r)=>B.createElement(J.Root,{ref:r,className:s("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},B.createElement(J.Indicator,{className:s("flex items-center justify-center text-current")},B.createElement(Be,{className:"h-4 w-4"}))));O.displayName=J.Root.displayName;import*as b from"react";import{useFormContext as Ee}from"react-hook-form";function ae({name:e,defaultValue:t,description:r,label:a,onChange:i,multiple:d,options:u,...C}){let{components:c}=g(),{control:l}=Ee(),m=o((n,x,p)=>{let A=p.value?[...p.value]:[];x?A.includes(n)||p.onChange([...A,n]):p.onChange(A.filter(z=>z!==n))},"handleCheckboxChange");return b.createElement(_,{control:l,name:e,defaultValue:t,render:({field:n,fieldState:x})=>{if(c?.checkbox){let p=c?.checkbox,A={name:e,description:r,label:a,defaultValue:t,multiple:d,options:u,...C};return b.createElement(p,{field:{...n,onChange:o(z=>{if(d){let{checked:re,value:Me}=z.target;m(Me,re,n),i?.(re);return}n.onChange(z),i?.(z)},"onChange")},fieldState:x,fieldData:A})}return b.createElement(S,{"data-field":e,className:s(`RemoteFlows__CheckBoxField__Item__${e}`)},b.createElement(R,null,b.createElement(b.Fragment,null,u&&d?b.createElement(y,null,a):null,u&&d?u.map(p=>b.createElement("div",{key:p.value,className:"flex space-x-2"},b.createElement(O,{id:p.value,onCheckedChange:A=>{m(p.value,A===!0,n),i?.(A,p.value)},checked:n.value?.includes(p.value),className:"RemoteFlows__CheckBox__Input"}),b.createElement(y,{htmlFor:p.value,className:"mb-0 RemoteFlows__CheckBox__Label"},p.label))):b.createElement("div",{className:"flex space-x-2"},b.createElement(O,{id:e,onCheckedChange:p=>{n.onChange(p),i?.(p)},checked:n.value,className:"RemoteFlows__CheckBox__Input"}),b.createElement(y,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label"},a)))),r&&b.createElement(w,null,r),x.error&&b.createElement(N,null))}})}o(ae,"CheckBoxField");import{CalendarIcon as Ue}from"lucide-react";import*as v from"react";import{useFormContext as Je}from"react-hook-form";import*as W from"react";import{ChevronLeft as Ge,ChevronRight as Ve}from"lucide-react";import{DayPicker as ze}from"react-day-picker";function ie({className:e,classNames:t,showOutsideDays:r=!0,...a}){return W.createElement(ze,{showOutsideDays:r,className:s("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:s(Y({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:s("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",a.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:s(Y({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:o(({className:i,...d})=>W.createElement(Ge,{className:s("size-4",i),...d}),"IconLeft"),IconRight:o(({className:i,...d})=>W.createElement(Ve,{className:s("size-4",i),...d}),"IconRight")},...a})}o(ie,"Calendar");import*as H from"react";import*as D from"@radix-ui/react-popover";function ne({...e}){return H.createElement(D.Root,{"data-slot":"popover",...e})}o(ne,"Popover");function se({...e}){return H.createElement(D.Trigger,{"data-slot":"popover-trigger",...e})}o(se,"PopoverTrigger");function le({className:e,align:t="center",sideOffset:r=4,...a}){return H.createElement(D.Portal,null,H.createElement(D.Content,{"data-slot":"popover-content",align:t,sideOffset:r,className:s("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),...a}))}o(le,"PopoverContent");import{PopoverClose as He}from"@radix-ui/react-popover";import{format as me}from"date-fns";function ce({description:e,label:t,name:r,minDate:a,onChange:i,...d}){let{components:u}=g(),{control:C}=Je();return v.createElement(_,{control:C,name:r,render:({field:c,fieldState:l})=>{if(u?.date){let m=u?.date,n={description:e,label:t,name:r,minDate:a,onChange:i,...d};return v.createElement(m,{field:{...c,onChange:o(x=>{c.onChange(x),i?.(x)},"onChange")},fieldState:l,fieldData:n})}return v.createElement(S,{"data-field":r,className:`flex flex-col RemoteFlows__DatePickerField__Item__${r}`},v.createElement(y,{className:"RemoteFlows__DatePickerField__Label"},t),v.createElement(ne,null,v.createElement(se,{asChild:!0},v.createElement(R,null,v.createElement("div",null,v.createElement(U,{type:"button",variant:"outline",className:s("w-full pl-3 text-left font-normal",!c.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${r}`},c.value&&v.createElement(v.Fragment,null,me(c.value,"yyyy-MM-dd")),v.createElement(Ue,{className:"ml-auto h-4 w-4 opacity-50"}))))),v.createElement(le,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start"},v.createElement(ie,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:c.value?new Date(c.value):void 0,onSelect:m=>{c.onChange(m?me(m,"yyyy-MM-dd"):null),i?.(m)},defaultMonth:a?new Date(a):void 0,components:{DayContent:o(m=>v.createElement(He,null,m.date.getDate()),"DayContent")},...a&&{disabled:o(m=>m<new Date(a),"disabled")}}))),e?v.createElement(w,null,e):null,l.error&&v.createElement(N,{className:"RemoteFlows__DatePickerField__Error"}))}})}o(ce,"DatePickerField");import*as E from"react";function de({label:e,name:t,fields:r,description:a}){return E.createElement("fieldset",{className:s("border-1 border-input p-4 rounded-xl",`RemoteFlows__FieldSetField__${t}`)},E.createElement("legend",{className:"text-sm font-semibold px-2"},e),a?E.createElement("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:a}}):null,E.createElement("div",{className:"grid gap-4"},r.map(i=>{let d=q[i.type];return E.createElement(d,{...i,key:i.name,name:`${t}.${i.name}`})})))}o(de,"FieldSetField");import*as I from"react";import{useFormContext as qe}from"react-hook-form";import T,{useState as $e,useRef as je}from"react";import{Upload as Oe,X as We}from"lucide-react";function pe({onChange:e,className:t,multiple:r}){let[a,i]=$e([]),d=je(null),u=o(l=>{l.preventDefault(),d.current?.click()},"handleClick"),C=o(l=>{if(l.target.files&&l.target.files.length>0){let m=Array.from(l.target.files);i(m),e(l)}},"handleChange"),c=o(l=>{i(m=>m.filter(n=>n!==l))},"onRemoveFile");return T.createElement("div",{className:s("flex flex-col items-start gap-4",t)},T.createElement("input",{type:"file",ref:d,onChange:C,className:"hidden","aria-label":"File upload",multiple:r}),T.createElement(U,{type:"button",onClick:u,className:"gap-2"},T.createElement(Oe,{className:"h-4 w-4"}),"Choose File"),a.length===0&&T.createElement("div",{className:"text-sm"},r?T.createElement("span",{className:"font-medium"},"No files selected. You can select multiple files"):T.createElement("span",{className:"font-medium"},"No file selected.")),a.length>0&&a.map((l,m)=>T.createElement("div",{key:m,className:"text-sm flex items-center gap-2"},"Selected file: ",T.createElement("span",{className:"font-medium"},l.name)," (",Math.round(l.size/1024)," KB)",T.createElement(U,{variant:"ghost",onClick:()=>c(l)},T.createElement(We,null)))))}o(pe,"FileUploader");var Ke=o(e=>new Promise((t,r)=>{let a=new FileReader;a.readAsDataURL(e),a.onload=()=>t(a.result),a.onerror=i=>r(i)}),"toBase64"),ue=o(async e=>{let t=e.target.files?Array.from(e.target.files):[];return await Promise.all(t.map(async a=>{let i=await Ke(a);return{name:a.name,content:i.split(",")[1]}}))},"convertFilesToBase64");function fe({name:e,description:t,label:r,multiple:a,onChange:i,...d}){let{components:u}=g(),{control:C}=qe();return I.createElement(_,{control:C,name:e,render:({field:c,fieldState:l})=>{if(u?.file){let m=u?.file,n={name:e,description:t,label:r,multiple:a,...d};return I.createElement(m,{field:{...c,value:null,onChange:o(async x=>{let p=await ue(x);c.onChange(p),i?.(p)},"onChange")},fieldState:l,fieldData:n})}return I.createElement(S,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`},I.createElement(y,{className:"RemoteFlows__FileUpload__Label"},r),I.createElement(R,null,I.createElement(pe,{onChange:async m=>{let n=await ue(m);c.onChange(n),i?.(n)},multiple:a,className:s("RemoteFlows__FileUpload__Input")})),t&&I.createElement("div",{className:"flex items-center justify-between"},I.createElement(w,{className:"RemoteFlows__FileUpload__Description"},t)),l.error&&I.createElement(N,{className:"RemoteFlows__FileUpload__Error"}))}})}o(fe,"FileUploadField");import Q from"react";import{useFormContext as Ye}from"react-hook-form";import*as L from"react";import{useFormContext as Xe}from"react-hook-form";import*as Fe from"react";function ge({className:e,type:t,...r}){return Fe.createElement("input",{type:t,"data-slot":"input",className:s("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),...r})}o(ge,"Input");function G({name:e,description:t,label:r,type:a,onChange:i,...d}){let{components:u}=g(),{control:C}=Xe();return L.createElement(_,{control:C,name:e,render:({field:c,fieldState:l})=>{if(u?.text){let m=u?.text,n={name:e,description:t,label:r,type:a,onChange:i,...d};return L.createElement(m,{field:{...c,onChange:o(x=>{c.onChange(x),i?.(x)},"onChange")},fieldState:l,fieldData:n})}return L.createElement(S,{"data-field":e,className:`RemoteFlows__TextField__Item__${e}`},L.createElement(y,{className:"RemoteFlows__TextField__Label"},r),L.createElement(R,null,L.createElement(ge,{...c,value:c.value??"",onChange:m=>{c.onChange(m),i?.(m)},className:"RemoteFlows__TextField__Input",placeholder:r})),t&&L.createElement(w,{className:"RemoteFlows__TextField__Description"},t),l.error&&L.createElement(N,{className:"RemoteFlows__TextField__Error"}))}})}o(G,"TextField");function Z(e){let{components:t}=g(),{control:r}=Ye();return t?.number?Q.createElement(_,{control:r,name:e.name,render:({field:a,fieldState:i})=>{let d=t.number;return Q.createElement(d,{field:{...a,onChange:o(u=>{a.onChange(u),e.onChange?.(u)},"onChange")},fieldState:i,fieldData:e})}}):Q.createElement(G,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}o(Z,"NumberField");import*as V from"@radix-ui/react-radio-group";import{CircleIcon as Qe}from"lucide-react";import*as $ from"react";function ve({className:e,...t}){return $.createElement(V.Root,{"data-slot":"radio-group",className:s("grid gap-3",e),...t})}o(ve,"RadioGroup");function xe({className:e,...t}){return $.createElement(V.Item,{"data-slot":"radio-group-item",className:s("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},$.createElement(V.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center"},$.createElement(Qe,{className:"fill-radio absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})))}o(xe,"RadioGroupItem");import*as h from"react";import{useFormContext as Ze}from"react-hook-form";function _e({name:e,defaultValue:t,description:r,label:a,options:i,onChange:d,...u}){let{components:C}=g(),{control:c}=Ze();return h.createElement(_,{control:c,name:e,defaultValue:t,render:({field:l,fieldState:m})=>{if(C?.radio){let n=C?.radio,x={name:e,defaultValue:t,description:r,label:a,options:i,...u};return h.createElement(n,{field:{...l,onChange:o(p=>{l.onChange(p),d?.(p)},"onChange")},fieldState:m,fieldData:x})}return h.createElement(S,{className:s("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e},h.createElement(y,null,a),h.createElement(R,null,h.createElement(ve,{"aria-label":a,onValueChange:n=>{l.onChange(n),d?.(n)},value:l.value,className:"flex flex-col space-y-3"},i?.map(n=>h.createElement(h.Fragment,null,h.createElement(S,{key:n.value,"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item"},h.createElement(R,null,h.createElement(xe,{value:n.value,className:"RemoteFlows__RadioField__Input"})),h.createElement("div",null,h.createElement(y,{className:"font-normal mb-0 RemoteFlows__RadioField__Label"},n.label),n.description&&h.createElement(w,{className:"mt-2"},n.description))))))),r&&h.createElement(w,null,r),m.error&&h.createElement(N,null))}})}o(_e,"RadioGroupField");import*as P from"react";import*as F from"react";import*as f from"@radix-ui/react-select";import{CheckIcon as et,ChevronDownIcon as he,ChevronUpIcon as tt}from"lucide-react";function ye({...e}){return F.createElement(f.Root,{"data-slot":"select",...e})}o(ye,"Select");function be({...e}){return F.createElement(f.Group,{"data-slot":"select-group",...e})}o(be,"SelectGroup");function Ce({...e}){return F.createElement(f.Value,{"data-slot":"select-value",...e})}o(Ce,"SelectValue");function Pe({className:e,children:t,...r}){return F.createElement(f.Trigger,{"data-slot":"select-trigger",className:s("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),...r},t,F.createElement(f.Icon,{asChild:!0,className:"absolute right-4"},F.createElement(he,{className:"size-4"})))}o(Pe,"SelectTrigger");function Se({className:e,children:t,position:r="popper",...a}){return F.createElement(f.Portal,null,F.createElement(f.Content,{"data-slot":"select-content",className:s("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",r==="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:r,...a},F.createElement(ot,null),F.createElement(f.Viewport,{className:s(r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1")},t),F.createElement(rt,null)))}o(Se,"SelectContent");function Re({className:e,children:t,...r}){return F.createElement(f.Item,{"data-slot":"select-item",className:s("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),...r},F.createElement(f.ItemText,null,t),F.createElement("span",{className:"flex size-3.5 items-center justify-center"},F.createElement(f.ItemIndicator,null,F.createElement(et,{className:"size-4"}))))}o(Re,"SelectItem");function ot({className:e,...t}){return F.createElement(f.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:s("flex cursor-default items-center justify-center py-1",e),...t},F.createElement(tt,{className:"size-4"}))}o(ot,"SelectScrollUpButton");function rt({className:e,...t}){return F.createElement(f.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:s("flex cursor-default items-center justify-center py-1",e),...t},F.createElement(he,{className:"size-4"}))}o(rt,"SelectScrollDownButton");import{useFormContext as at}from"react-hook-form";function we({label:e,name:t,options:r,defaultValue:a,description:i,onChange:d,...u}){let{control:C}=at(),{components:c}=g();return P.createElement(_,{defaultValue:a,control:C,name:t,render:({field:l,fieldState:m})=>{if(c?.select){let n=c?.select,x={label:e,name:t,options:r,defaultValue:a,description:i,onChange:d,...u};return P.createElement(n,{field:{...l,onChange:o(p=>{l.onChange(p),d?.(p)},"onChange")},fieldState:m,fieldData:x})}return P.createElement(S,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`},P.createElement(y,{className:"RemoteFlows__SelectField__Label"},e),P.createElement(R,null,P.createElement("div",{className:"relative"},P.createElement(ye,{value:l.value||"",onValueChange:n=>{l.onChange(n),d?.(n)}},P.createElement(Pe,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!m.error,"aria-label":e},P.createElement("span",{className:"absolute"},P.createElement(Ce,{placeholder:e}))),P.createElement(Se,{className:"RemoteFlows__SelectField__Content"},P.createElement(be,{className:"RemoteFlows__SelectField__Group"},r.map(n=>P.createElement(Re,{key:n.value,value:n.value,className:"RemoteFlows__SelectField__SelectItem"},n.label))))))),i&&P.createElement(w,null,i),m.error&&P.createElement(N,null))}})}o(we,"SelectField");import*as k from"react";import{useFormContext as it}from"react-hook-form";import*as K from"react";var ee=K.forwardRef(({className:e,...t},r)=>K.createElement("textarea",{className:s("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:r,...t}));ee.displayName="Textarea";function Ne({name:e,description:t,label:r,onChange:a,maxLength:i,...d}){let{components:u}=g(),{control:C}=it();return k.createElement(_,{control:C,name:e,render:({field:c,fieldState:l})=>{if(u?.textarea){let n=u?.textarea,x={name:e,description:t,label:r,maxLength:i,...d};return k.createElement(n,{field:{...c,onChange:o(p=>{c.onChange(p),a?.(p)},"onChange")},fieldState:l,fieldData:x})}let m=c.value?.length??0;return k.createElement(S,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`},k.createElement(y,{className:"RemoteFlows__TextArea__Label"},r),k.createElement(R,null,k.createElement(ee,{...c,value:c.value??"",onChange:n=>{c.onChange(n),a?.(n)},className:s(l.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:r})),(t||i)&&k.createElement("div",{className:"flex items-center justify-between"},t&&k.createElement(w,{className:"RemoteFlows__TextArea__Description"},t),i&&k.createElement("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength"},m,"/",i)),l.error&&k.createElement(N,{className:"RemoteFlows__TextArea__Error"}))}})}o(Ne,"TextAreaField");import te from"react";import{useFormContext as nt}from"react-hook-form";function Te(e){let{components:t}=g(),{control:r}=nt();return t?.email?te.createElement(_,{control:r,name:e.name,render:({field:a,fieldState:i})=>{let d=t.email;return te.createElement(d,{field:{...a,onChange:o(u=>{a.onChange(u),e.onChange?.(u)},"onChange")},fieldState:i,fieldData:e})}}):te.createElement(G,{...e,type:"email"})}o(Te,"EmailField");var q={checkbox:ae,text:G,email:Te,money:Z,select:we,radio:_e,number:Z,file:fe,fieldset:de,date:ce,textarea:Ne};import M,{Fragment as pt}from"react";import{cva as st}from"class-variance-authority";import*as X from"react";var lt=st("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-card bg-warning border-warning-border [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function ke({className:e,variant:t,...r}){return X.createElement("div",{"data-slot":"alert",role:"alert",className:s(lt({variant:t}),e),...r})}o(ke,"Alert");function Ie({className:e,...t}){return X.createElement("div",{"data-slot":"alert-title",className:s("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}o(Ie,"AlertTitle");function De({className:e,...t}){return X.createElement("div",{"data-slot":"alert-description",className:s("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}o(De,"AlertDescription");import{AlertCircle as mt}from"lucide-react";import j from"react";function Le({title:e,description:t,severity:r}){let{components:a}=g();if(a?.statement){let i=a?.statement;return j.createElement(i,{data:{title:e,description:t,severity:r}})}return j.createElement(ke,{variant:"warning"},j.createElement(mt,{className:"h-4 w-4"}),e&&j.createElement(Ie,null,e),j.createElement(De,null,t))}o(Le,"Statement");import oe,{useEffect as ct}from"react";import{useFormContext as dt}from"react-hook-form";function Ae({name:e,value:t,description:r,statement:a}){let{setValue:i}=dt();return ct(()=>{i(e,t)},[]),oe.createElement("div",null,oe.createElement("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${e}`,dangerouslySetInnerHTML:{__html:a.title}}),oe.createElement("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${e}`,dangerouslySetInnerHTML:{__html:a.description||r}}))}o(Ae,"ForcedValueField");function ut(e){return e.const!==void 0&&e.const===e.default&&e.inputType!=="checkbox"&&e.inputType!=="hidden"}o(ut,"checkFieldHasForcedValue");var Jr=o(({fields:e})=>!e||e.length===0?null:M.createElement(M.Fragment,null,e.map(t=>{if(t.isVisible===!1||t.deprecated)return null;if(ut(t))return M.createElement(Ae,{key:t.name,name:t.name,description:t.description,value:t.const,statement:t.statement});let r=q[t.inputType];return r?M.createElement(pt,{key:t.name},M.createElement(r,{...t}),t.statement?M.createElement(Le,{...t.statement}):null):M.createElement("p",{className:"error"},"Field type ",t.inputType," not supported")})),"JSONSchemaFormFields");export{Jr as a};
|
|
2
|
-
//# sourceMappingURL=chunk-VTPDBEHE.js.map
|