@gusto/embedded-react-sdk 0.13.0 → 0.13.1

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 (183) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/_virtual/dynamic-import-helper.js +8 -1
  3. package/dist/_virtual/dynamic-import-helper.js.map +1 -1
  4. package/dist/components/Base/Base.js +4 -4
  5. package/dist/components/Common/FieldDescription/FieldDescription.js +7 -14
  6. package/dist/components/Common/FieldDescription/FieldDescription.js.map +1 -1
  7. package/dist/components/Common/Fields/hooks/useField.d.ts +4 -1
  8. package/dist/components/Common/Fields/hooks/useField.js +31 -24
  9. package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureForm.js +3 -4
  11. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  12. package/dist/components/Common/SignatureForm/SignatureFormActions.js +6 -7
  13. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  14. package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -8
  15. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  16. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js +1 -1
  17. package/dist/components/Common/UI/DatePicker/DatePicker.js +1 -1
  18. package/dist/components/Common/UI/Tabs/Tabs.d.ts +7 -0
  19. package/dist/components/Common/UI/Tabs/Tabs.js +25 -0
  20. package/dist/components/Common/UI/Tabs/Tabs.js.map +1 -0
  21. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +8 -0
  22. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js.map +1 -0
  23. package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +51 -0
  24. package/dist/components/Common/UI/Tabs/index.d.ts +3 -0
  25. package/dist/components/Common/hooks/useNumberFormatter.js +1 -1
  26. package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -7
  27. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +7 -8
  29. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
  31. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +8 -3
  33. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +9 -10
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
  37. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  38. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +8 -3
  39. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  40. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +10 -5
  41. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  42. package/dist/components/Company/BankAccount/BankAccount.js +1 -1
  43. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +2 -2
  44. package/dist/components/Company/BankAccount/BankAccountForm/context.js +8 -3
  45. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  46. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +1 -1
  47. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +2 -2
  48. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +10 -11
  49. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  50. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +8 -3
  51. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  52. package/dist/components/Company/DocumentSigner/DocumentSigner.js +1 -1
  53. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +9 -10
  54. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  55. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +8 -3
  56. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  57. package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -16
  58. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  59. package/dist/components/Company/FederalTaxes/Form.js +1 -1
  60. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +14 -9
  61. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  62. package/dist/components/Company/Industry/Context.js +11 -6
  63. package/dist/components/Company/Industry/Context.js.map +1 -1
  64. package/dist/components/Company/Industry/Industry.js +2 -2
  65. package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
  66. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  67. package/dist/components/Company/Locations/LocationForm/LocationForm.js +13 -14
  68. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  69. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +8 -3
  70. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  71. package/dist/components/Company/Locations/LocationsList/LocationsList.js +7 -8
  72. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  73. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +8 -3
  74. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  75. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -4
  76. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  77. package/dist/components/Company/OnboardingOverview/context.js +8 -3
  78. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  79. package/dist/components/Company/PaySchedule/PaySchedule.js +37 -38
  80. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  81. package/dist/components/Company/PaySchedule/_parts/Edit.js +2 -3
  82. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  83. package/dist/components/Company/PaySchedule/usePaySchedule.js +11 -6
  84. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  85. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +3 -3
  86. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +8 -3
  87. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  88. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +1 -1
  89. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +8 -3
  90. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  91. package/dist/components/Contractor/Address/Address.js +7 -8
  92. package/dist/components/Contractor/Address/Address.js.map +1 -1
  93. package/dist/components/Contractor/Address/Form.js +2 -3
  94. package/dist/components/Contractor/Address/Form.js.map +1 -1
  95. package/dist/components/Contractor/Address/useAddress.js +10 -5
  96. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  97. package/dist/components/Contractor/ContractorList/index.js +1 -1
  98. package/dist/components/Contractor/ContractorList/useContractorList.js +1 -1
  99. package/dist/components/Contractor/NewHireReport/NewHireReport.js +3 -3
  100. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +7 -7
  101. package/dist/components/Contractor/Profile/ContractorProfile.js +1 -1
  102. package/dist/components/Contractor/Profile/useContractorProfile.js +39 -34
  103. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  104. package/dist/components/Contractor/Submit/Submit.js +3 -3
  105. package/dist/components/Employee/Compensation/Compensation.js +10 -10
  106. package/dist/components/Employee/Deductions/Deductions.js +1 -1
  107. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +4 -4
  108. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +2 -2
  109. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +1 -1
  110. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +8 -9
  111. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  112. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +8 -3
  113. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  114. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +12 -13
  115. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  116. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +8 -3
  117. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  118. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -4
  119. package/dist/components/Employee/EmployeeList/useEmployeeList.js +8 -3
  120. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  121. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +3 -3
  122. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +8 -3
  123. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  124. package/dist/components/Employee/Landing/Landing.js +2 -2
  125. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +2 -2
  126. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +8 -8
  127. package/dist/components/Employee/PaymentMethod/Split.js +1 -1
  128. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +14 -9
  129. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  130. package/dist/components/Employee/Profile/HomeAddress.js +4 -5
  131. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  132. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +20 -21
  133. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  134. package/dist/components/Employee/Profile/Profile.js +13 -13
  135. package/dist/components/Employee/Profile/useProfile.js +8 -3
  136. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  137. package/dist/components/Employee/StateTaxes/StateTaxes.js +3 -3
  138. package/dist/components/Employee/StateTaxes/useStateTaxes.js +8 -3
  139. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  140. package/dist/components/Employee/Taxes/Taxes.js +5 -5
  141. package/dist/components/Employee/Taxes/useTaxes.js +8 -3
  142. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  143. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +60 -65
  144. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  145. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +60 -57
  146. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  147. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +5 -2
  148. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +64 -13
  149. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  150. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +18 -2
  151. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +117 -19
  152. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  153. package/dist/components/Payroll/PayrollList/PayrollList.js +3 -3
  154. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +8 -8
  155. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  156. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +1 -1
  157. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +42 -36
  158. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  159. package/dist/components/Payroll/helpers.d.ts +7 -6
  160. package/dist/components/Payroll/helpers.js +44 -43
  161. package/dist/components/Payroll/helpers.js.map +1 -1
  162. package/dist/components/Payroll/usePreparedPayrollData.d.ts +14 -0
  163. package/dist/components/Payroll/usePreparedPayrollData.js +39 -0
  164. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -0
  165. package/dist/contexts/ApiProvider/ApiProvider.js +4 -4
  166. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +28 -26
  167. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  168. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  169. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  170. package/dist/i18n/I18n.js +5 -5
  171. package/dist/i18n/I18n.js.map +1 -1
  172. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +20 -18
  173. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
  174. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +20 -0
  175. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -0
  176. package/dist/i18n/en/Payroll.PayrollOverview.json.js +18 -0
  177. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -0
  178. package/dist/shared/constants.d.ts +6 -0
  179. package/dist/shared/constants.js +43 -34
  180. package/dist/shared/constants.js.map +1 -1
  181. package/dist/style.css +1 -1
  182. package/dist/types/i18next.d.ts +52 -1
  183. package/package.json +14 -13
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.1
4
+
5
+ ### Fixes
6
+
7
+ - Patch release for bug fixes and improvements
8
+
3
9
  ## 0.13.0
4
10
 
5
11
  ### Features & Enhancements
@@ -1,7 +1,14 @@
1
1
  const l = (r, n, t) => {
2
2
  const e = r[n];
3
3
  return e ? typeof e == "function" ? e() : Promise.resolve(e) : new Promise((i, o) => {
4
- (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + n + (n.split("/").length !== t ? ". Note that variables only represent file names one level deep." : ""))));
4
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
5
+ o.bind(
6
+ null,
7
+ new Error(
8
+ "Unknown variable dynamic import: " + n + (n.split("/").length !== t ? ". Note that variables only represent file names one level deep." : "")
9
+ )
10
+ )
11
+ );
5
12
  });
6
13
  };
7
14
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-import-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"dynamic-import-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -2,10 +2,10 @@ import { jsx as o, jsxs as y } from "react/jsx-runtime";
2
2
  import { useState as E, useCallback as g, Suspense as R } from "react";
3
3
  import { ErrorBoundary as S } from "react-error-boundary";
4
4
  import { useTranslation as B } from "react-i18next";
5
- import { APIError as C } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/models/errors/apierror.js";
6
- import { SDKValidationError as h } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/models/errors/sdkvalidationerror.js";
7
- import { UnprocessableEntityErrorObject as k } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/models/errors/unprocessableentityerrorobject.js";
8
- import { QueryErrorResetBoundary as T } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@tanstack/react-query/build/modern/index.js";
5
+ import { APIError as C } from "@gusto/embedded-api/models/errors/apierror";
6
+ import { SDKValidationError as h } from "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
+ import { UnprocessableEntityErrorObject as k } from "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import { QueryErrorResetBoundary as T } from "@tanstack/react-query";
9
9
  import { FadeIn as _ } from "../Common/FadeIn/FadeIn.js";
10
10
  import { BaseContext as j } from "./useBase.js";
11
11
  import { componentEvents as F } from "../../shared/constants.js";
@@ -1,19 +1,12 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import e from "classnames";
3
- import p from "./FieldDescription.module.scss.js";
4
- import { createMarkup as a } from "../../../helpers/formattedStrings.js";
5
- const u = ({
2
+ import m from "classnames";
3
+ import e from "./FieldDescription.module.scss.js";
4
+ const c = ({
6
5
  children: o,
7
- className: s,
8
- id: m
9
- }) => {
10
- const r = {
11
- className: e(p.root, s),
12
- id: m
13
- };
14
- return o && (typeof o == "string" ? /* @__PURE__ */ t("div", { ...r, dangerouslySetInnerHTML: a(o) }) : /* @__PURE__ */ t("div", { ...r, children: o }));
15
- };
6
+ className: r,
7
+ ...s
8
+ }) => o && /* @__PURE__ */ t("div", { ...s, className: m(e.root, r), children: o });
16
9
  export {
17
- u as FieldDescription
10
+ c as FieldDescription
18
11
  };
19
12
  //# sourceMappingURL=FieldDescription.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FieldDescription.js","sources":["../../../../src/components/Common/FieldDescription/FieldDescription.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport styles from './FieldDescription.module.scss'\nimport { createMarkup } from '@/helpers/formattedStrings'\n\ninterface FieldDescriptionProps {\n children: React.ReactNode\n className?: string\n id?: string\n}\n\nexport const FieldDescription: React.FC<FieldDescriptionProps> = ({\n children,\n className,\n id,\n}: FieldDescriptionProps) => {\n const commonProps = {\n className: classNames(styles.root, className),\n id,\n }\n\n return (\n children &&\n (typeof children === 'string' ? (\n <div {...commonProps} dangerouslySetInnerHTML={createMarkup(children)} />\n ) : (\n <div {...commonProps}>{children}</div>\n ))\n )\n}\n"],"names":["FieldDescription","children","className","id","commonProps","classNames","styles","jsx","createMarkup"],"mappings":";;;;AAUO,MAAMA,IAAoD,CAAC;AAAA,EAChE,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,IAAAC;AACF,MAA6B;AAC3B,QAAMC,IAAc;AAAA,IAClB,WAAWC,EAAWC,EAAO,MAAMJ,CAAS;AAAA,IAC5C,IAAAC;AAAA,EAAA;AAGF,SACEF,MACC,OAAOA,KAAa,WACnB,gBAAAM,EAAC,SAAK,GAAGH,GAAa,yBAAyBI,EAAaP,CAAQ,EAAA,CAAG,sBAEtE,OAAA,EAAK,GAAGG,GAAc,UAAAH,EAAA,CAAS;AAGtC;"}
1
+ {"version":3,"file":"FieldDescription.js","sources":["../../../../src/components/Common/FieldDescription/FieldDescription.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport styles from './FieldDescription.module.scss'\n\ninterface FieldDescriptionProps {\n children: React.ReactNode\n className?: string\n id?: string\n}\n\nexport const FieldDescription: React.FC<FieldDescriptionProps> = ({\n children,\n className,\n ...props\n}: FieldDescriptionProps) => {\n return (\n children && (\n <div {...props} className={classNames(styles.root, className)}>\n {children}\n </div>\n )\n )\n}\n"],"names":["FieldDescription","children","className","props","jsx","classNames","styles"],"mappings":";;;AASO,MAAMA,IAAoD,CAAC;AAAA,EAChE,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,MAEIF,KACE,gBAAAG,EAAC,OAAA,EAAK,GAAGD,GAAO,WAAWE,EAAWC,EAAO,MAAMJ,CAAS,GACzD,UAAAD,EAAA,CACH;"}
@@ -1,4 +1,5 @@
1
1
  import { RegisterOptions } from 'react-hook-form';
2
+ import { default as React } from 'react';
2
3
  export type Transform<TValue> = (value: TValue) => TValue;
3
4
  export interface UseFieldProps<TValue = string> {
4
5
  name: string;
@@ -8,14 +9,16 @@ export interface UseFieldProps<TValue = string> {
8
9
  isRequired?: boolean;
9
10
  onChange?: (value: TValue) => void;
10
11
  transform?: Transform<TValue>;
12
+ description?: React.ReactNode;
11
13
  }
12
- export declare function useField<TValue = string>({ name, rules, defaultValue, errorMessage, isRequired, onChange, transform, }: UseFieldProps<TValue>): {
14
+ export declare function useField<TValue = string>({ name, rules, defaultValue, errorMessage, isRequired, onChange, transform, description, }: UseFieldProps<TValue>): {
13
15
  value: TValue;
14
16
  inputRef: import('react-hook-form').RefCallBack;
15
17
  isInvalid: boolean;
16
18
  errorMessage: string | undefined;
17
19
  onChange: (updatedValue: TValue) => void;
18
20
  isRequired: boolean;
21
+ description: React.ReactNode;
19
22
  onBlur: import('react-hook-form').Noop;
20
23
  disabled?: boolean;
21
24
  name: string;
@@ -1,36 +1,43 @@
1
- import { useFormContext as h, useController as m } from "react-hook-form";
2
- function F({
3
- name: a,
4
- rules: i = {},
5
- defaultValue: c,
6
- errorMessage: u,
1
+ import { useFormContext as h, useController as M } from "react-hook-form";
2
+ import F, { useMemo as x } from "react";
3
+ import { createMarkup as y } from "../../../../helpers/formattedStrings.js";
4
+ const D = (e) => !e || typeof e != "string" ? e : F.createElement("div", {
5
+ dangerouslySetInnerHTML: y(e)
6
+ });
7
+ function k({
8
+ name: e,
9
+ rules: u = {},
10
+ defaultValue: i,
11
+ errorMessage: f,
7
12
  isRequired: o = !1,
8
- onChange: f,
9
- transform: r
13
+ onChange: m,
14
+ transform: t,
15
+ description: n
10
16
  }) {
11
- const { control: d } = h(), { field: e, fieldState: n } = m({
12
- name: a,
13
- control: d,
17
+ const { control: p } = h(), { field: r, fieldState: s } = M({
18
+ name: e,
19
+ control: p,
14
20
  rules: {
15
21
  required: o,
16
- ...i
22
+ ...u
17
23
  },
18
- defaultValue: c
19
- }), { ref: g, ...v } = e, C = (t) => {
20
- const l = r ? r(t) : t;
21
- e.onChange(l), f?.(l);
22
- }, s = !!n.error;
24
+ defaultValue: i
25
+ }), { ref: g, ...d } = r, v = (a) => {
26
+ const c = t ? t(a) : a;
27
+ r.onChange(c), m?.(c);
28
+ }, l = !!s.error, C = x(() => D(n), [n]);
23
29
  return {
24
- ...v,
25
- value: e.value,
30
+ ...d,
31
+ value: r.value,
26
32
  inputRef: g,
27
- isInvalid: s,
28
- errorMessage: s ? u ?? n.error?.message : void 0,
29
- onChange: C,
30
- isRequired: o
33
+ isInvalid: l,
34
+ errorMessage: l ? f ?? s.error?.message : void 0,
35
+ onChange: v,
36
+ isRequired: o,
37
+ description: C
31
38
  };
32
39
  }
33
40
  export {
34
- F as useField
41
+ k as useField
35
42
  };
36
43
  //# sourceMappingURL=useField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useField.js","sources":["../../../../../src/components/Common/Fields/hooks/useField.ts"],"sourcesContent":["import type { RegisterOptions } from 'react-hook-form'\nimport { useController, useFormContext } from 'react-hook-form'\n\nexport type Transform<TValue> = (value: TValue) => TValue\n\nexport interface UseFieldProps<TValue = string> {\n name: string\n rules?: RegisterOptions\n defaultValue?: TValue\n errorMessage?: string\n isRequired?: boolean\n onChange?: (value: TValue) => void\n transform?: Transform<TValue>\n}\n\nexport function useField<TValue = string>({\n name,\n rules = {},\n defaultValue,\n errorMessage,\n isRequired = false,\n onChange,\n transform,\n}: UseFieldProps<TValue>) {\n const { control } = useFormContext()\n const { field, fieldState } = useController({\n name,\n control,\n rules: {\n required: isRequired,\n ...rules,\n },\n defaultValue,\n })\n\n const { ref, ...restFieldProps } = field\n\n const handleChange = (updatedValue: TValue) => {\n const value = transform ? transform(updatedValue) : updatedValue\n field.onChange(value)\n onChange?.(value)\n }\n\n const isInvalid = !!fieldState.error\n\n return {\n ...restFieldProps,\n value: field.value as TValue,\n inputRef: ref,\n isInvalid,\n errorMessage: isInvalid ? (errorMessage ?? fieldState.error?.message) : undefined,\n onChange: handleChange,\n isRequired,\n }\n}\n"],"names":["useField","name","rules","defaultValue","errorMessage","isRequired","onChange","transform","control","useFormContext","field","fieldState","useController","ref","restFieldProps","handleChange","updatedValue","value","isInvalid"],"mappings":";AAeO,SAASA,EAA0B;AAAA,EACxC,MAAAC;AAAA,EACA,OAAAC,IAAQ,CAAA;AAAA,EACR,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,UAAAC;AAAA,EACA,WAAAC;AACF,GAA0B;AACxB,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,OAAAC,GAAO,YAAAC,EAAA,IAAeC,EAAc;AAAA,IAC1C,MAAAX;AAAA,IACA,SAAAO;AAAA,IACA,OAAO;AAAA,MACL,UAAUH;AAAA,MACV,GAAGH;AAAA,IAAA;AAAA,IAEL,cAAAC;AAAA,EAAA,CACD,GAEK,EAAE,KAAAU,GAAK,GAAGC,EAAA,IAAmBJ,GAE7BK,IAAe,CAACC,MAAyB;AAC7C,UAAMC,IAAQV,IAAYA,EAAUS,CAAY,IAAIA;AACpD,IAAAN,EAAM,SAASO,CAAK,GACpBX,IAAWW,CAAK;AAAA,EAClB,GAEMC,IAAY,CAAC,CAACP,EAAW;AAE/B,SAAO;AAAA,IACL,GAAGG;AAAA,IACH,OAAOJ,EAAM;AAAA,IACb,UAAUG;AAAA,IACV,WAAAK;AAAA,IACA,cAAcA,IAAad,KAAgBO,EAAW,OAAO,UAAW;AAAA,IACxE,UAAUI;AAAA,IACV,YAAAV;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"useField.js","sources":["../../../../../src/components/Common/Fields/hooks/useField.ts"],"sourcesContent":["import type { RegisterOptions } from 'react-hook-form'\nimport { useController, useFormContext } from 'react-hook-form'\nimport React, { useMemo } from 'react'\nimport { createMarkup } from '@/helpers/formattedStrings'\n\nexport type Transform<TValue> = (value: TValue) => TValue\n\nexport interface UseFieldProps<TValue = string> {\n name: string\n rules?: RegisterOptions\n defaultValue?: TValue\n errorMessage?: string\n isRequired?: boolean\n onChange?: (value: TValue) => void\n transform?: Transform<TValue>\n description?: React.ReactNode\n}\n\nconst processDescription = (description: React.ReactNode): React.ReactNode => {\n if (!description || typeof description !== 'string') {\n return description\n }\n\n // Use DOMPurify to sanitize the string and return a React element\n return React.createElement('div', {\n dangerouslySetInnerHTML: createMarkup(description),\n })\n}\n\nexport function useField<TValue = string>({\n name,\n rules = {},\n defaultValue,\n errorMessage,\n isRequired = false,\n onChange,\n transform,\n description,\n}: UseFieldProps<TValue>) {\n const { control } = useFormContext()\n const { field, fieldState } = useController({\n name,\n control,\n rules: {\n required: isRequired,\n ...rules,\n },\n defaultValue,\n })\n\n const { ref, ...restFieldProps } = field\n\n const handleChange = (updatedValue: TValue) => {\n const value = transform ? transform(updatedValue) : updatedValue\n field.onChange(value)\n onChange?.(value)\n }\n\n const isInvalid = !!fieldState.error\n\n const processedDescription = useMemo(() => processDescription(description), [description])\n\n return {\n ...restFieldProps,\n value: field.value as TValue,\n inputRef: ref,\n isInvalid,\n errorMessage: isInvalid ? (errorMessage ?? fieldState.error?.message) : undefined,\n onChange: handleChange,\n isRequired,\n description: processedDescription,\n }\n}\n"],"names":["processDescription","description","React","createMarkup","useField","name","rules","defaultValue","errorMessage","isRequired","onChange","transform","control","useFormContext","field","fieldState","useController","ref","restFieldProps","handleChange","updatedValue","value","isInvalid","processedDescription","useMemo"],"mappings":";;;AAkBA,MAAMA,IAAqB,CAACC,MACtB,CAACA,KAAe,OAAOA,KAAgB,WAClCA,IAIFC,EAAM,cAAc,OAAO;AAAA,EAChC,yBAAyBC,EAAaF,CAAW;AAAA,CAClD;AAGI,SAASG,EAA0B;AAAA,EACxC,MAAAC;AAAA,EACA,OAAAC,IAAQ,CAAA;AAAA,EACR,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAV;AACF,GAA0B;AACxB,QAAM,EAAE,SAAAW,EAAA,IAAYC,EAAA,GACd,EAAE,OAAAC,GAAO,YAAAC,EAAA,IAAeC,EAAc;AAAA,IAC1C,MAAAX;AAAA,IACA,SAAAO;AAAA,IACA,OAAO;AAAA,MACL,UAAUH;AAAA,MACV,GAAGH;AAAA,IAAA;AAAA,IAEL,cAAAC;AAAA,EAAA,CACD,GAEK,EAAE,KAAAU,GAAK,GAAGC,EAAA,IAAmBJ,GAE7BK,IAAe,CAACC,MAAyB;AAC7C,UAAMC,IAAQV,IAAYA,EAAUS,CAAY,IAAIA;AACpD,IAAAN,EAAM,SAASO,CAAK,GACpBX,IAAWW,CAAK;AAAA,EAClB,GAEMC,IAAY,CAAC,CAACP,EAAW,OAEzBQ,IAAuBC,EAAQ,MAAMxB,EAAmBC,CAAW,GAAG,CAACA,CAAW,CAAC;AAEzF,SAAO;AAAA,IACL,GAAGiB;AAAA,IACH,OAAOJ,EAAM;AAAA,IACb,UAAUG;AAAA,IACV,WAAAK;AAAA,IACA,cAAcA,IAAad,KAAgBO,EAAW,OAAO,UAAW;AAAA,IACxE,UAAUI;AAAA,IACV,YAAAV;AAAA,IACA,aAAac;AAAA,EAAA;AAEjB;"}
@@ -1,20 +1,19 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { z as o } from "zod";
3
3
  import { useForm as s, FormProvider as a } from "react-hook-form";
4
- import { zodResolver as l } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@hookform/resolvers/zod/dist/zod.mjs";
4
+ import { zodResolver as l } from "@hookform/resolvers/zod";
5
5
  import t from "./SignatureForm.module.scss.js";
6
6
  import { Form as u } from "../Form/Form.js";
7
7
  import { Flex as c } from "../Flex/Flex.js";
8
8
  import "classnames";
9
9
  import "../../../shared/constants.js";
10
- import "react-i18next";
11
10
  const f = o.object({
12
11
  signature: o.string().min(1),
13
12
  confirmSignature: o.literal(!0)
14
13
  }), p = {
15
14
  signature: ""
16
15
  };
17
- function D({ onSubmit: m, children: i, formProps: n }) {
16
+ function z({ onSubmit: m, children: i, formProps: n }) {
18
17
  const e = s({
19
18
  resolver: l(f),
20
19
  defaultValues: p,
@@ -23,7 +22,7 @@ function D({ onSubmit: m, children: i, formProps: n }) {
23
22
  return /* @__PURE__ */ r(a, { ...e, children: /* @__PURE__ */ r(u, { onSubmit: e.handleSubmit(m), className: t.container, children: /* @__PURE__ */ r("div", { className: t.formFields, children: /* @__PURE__ */ r(c, { flexDirection: "column", gap: 20, children: i }) }) }) });
24
23
  }
25
24
  export {
26
- D as SignatureForm,
25
+ z as SignatureForm,
27
26
  f as SignatureFormSchema
28
27
  };
29
28
  //# sourceMappingURL=SignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;;;;AAOO,MAAMA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACE,gBAAAI,EAACC,GAAA,EAAc,GAAGJ,GAChB,UAAA,gBAAAG,EAACE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,EAAA,CACH,EAAA,CACF,EAAA,CACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;;;AAOO,MAAMA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACE,gBAAAI,EAACC,GAAA,EAAc,GAAGJ,GAChB,UAAA,gBAAAG,EAACE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,EAAA,CACH,EAAA,CACF,EAAA,CACF,GACF;AAEJ;"}
@@ -1,22 +1,21 @@
1
1
  import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
2
  import "classnames";
3
3
  import "../../../shared/constants.js";
4
- import "react-i18next";
5
- import { ActionsLayout as p } from "../ActionsLayout/ActionsLayout.js";
6
- import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- function x({
4
+ import { ActionsLayout as s } from "../ActionsLayout/ActionsLayout.js";
5
+ import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ function d({
8
7
  onBack: t,
9
8
  backLabel: r,
10
9
  submitLabel: i,
11
10
  isLoading: e = !1
12
11
  }) {
13
- const o = s();
14
- return /* @__PURE__ */ m(p, { children: [
12
+ const o = p();
13
+ return /* @__PURE__ */ m(s, { children: [
15
14
  t && /* @__PURE__ */ n(o.Button, { variant: "secondary", type: "button", onClick: t, children: r }),
16
15
  /* @__PURE__ */ n(o.Button, { type: "submit", isLoading: e, children: i })
17
16
  ] });
18
17
  }
19
18
  export {
20
- x as SignatureFormActions
19
+ d as SignatureFormActions
21
20
  };
22
21
  //# sourceMappingURL=SignatureFormActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAN,KACC,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UAAAC,EAAA,CACH;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UAAAD,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAN,KACC,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UAAAC,EAAA,CACH;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UAAAD,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,28 +1,27 @@
1
- import { jsxs as n, Fragment as s, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as n, Fragment as s, jsx as e } from "react/jsx-runtime";
2
2
  import "classnames";
3
3
  import "../../../shared/constants.js";
4
- import "react-i18next";
5
4
  import { TextInputField as a } from "../Fields/TextInputField/TextInputField.js";
6
5
  import { CheckboxField as u } from "../Fields/CheckboxField/CheckboxField.js";
7
- function x({
8
- signatureLabel: e,
6
+ function f({
7
+ signatureLabel: r,
9
8
  signatureDescription: i = "",
10
9
  signatureError: t = "",
11
10
  confirmationLabel: o,
12
11
  confirmationError: m = ""
13
12
  }) {
14
13
  return /* @__PURE__ */ n(s, { children: [
15
- /* @__PURE__ */ r(
14
+ /* @__PURE__ */ e(
16
15
  a,
17
16
  {
18
17
  name: "signature",
19
- label: e,
18
+ label: r,
20
19
  description: i,
21
20
  errorMessage: t,
22
21
  isRequired: !0
23
22
  }
24
23
  ),
25
- /* @__PURE__ */ r(
24
+ /* @__PURE__ */ e(
26
25
  u,
27
26
  {
28
27
  name: "confirmSignature",
@@ -34,6 +33,6 @@ function x({
34
33
  ] });
35
34
  }
36
35
  export {
37
- x as SignatureFormFields
36
+ f as SignatureFormFields
38
37
  };
39
38
  //# sourceMappingURL=SignatureFormFields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":";;;;;;AAUO,SAASA,EAAoB;AAAA,EAClC,gBAAAC;AAAA,EACA,sBAAAC,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,GAA6B;AAC3B,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR;AAAA,QACP,aAAaC;AAAA,QACb,cAAcC;AAAA,QACd,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON;AAAA,QACP,cAAcC;AAAA,MAAA;AAAA,IAAA;AAAA,EAChB,GACF;AAEJ;"}
1
+ {"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":";;;;;AAUO,SAASA,EAAoB;AAAA,EAClC,gBAAAC;AAAA,EACA,sBAAAC,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,GAA6B;AAC3B,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR;AAAA,QACP,aAAaC;AAAA,QACb,cAAcC;AAAA,QACd,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON;AAAA,QACP,cAAcC;AAAA,MAAA;AAAA,IAAA;AAAA,EAChB,GACF;AAEJ;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
2
  import { Text as m, RangeCalendar as D, CalendarGrid as x, CalendarGridHeader as N, CalendarHeaderCell as I, CalendarGridBody as S, CalendarCell as F } from "react-aria-components";
3
- import { parseDate as p } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@internationalized/date/dist/import.mjs";
3
+ import { parseDate as p } from "@internationalized/date";
4
4
  import { useMemo as u } from "react";
5
5
  import { CalendarLegend as g } from "./CalendarLegend.js";
6
6
  import d from "./CalendarPreview.module.scss.js";
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
2
  import { DatePicker as b, Group as k, DateInput as A, DateSegment as B, Button as c, Popover as F, Dialog as L, Calendar as j, Heading as E, CalendarGrid as G, CalendarCell as M } from "react-aria-components";
3
3
  import { useTranslation as z } from "react-i18next";
4
4
  import u from "classnames";
5
- import { parseDate as H } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@internationalized/date/dist/import.mjs";
5
+ import { parseDate as H } from "@internationalized/date";
6
6
  import { useFieldIds as R } from "../hooks/useFieldIds.js";
7
7
  import i from "./DatePicker.module.scss.js";
8
8
  import { FieldLayout as U } from "../../FieldLayout/FieldLayout.js";
@@ -0,0 +1,7 @@
1
+ import { TabsProps } from './TabsTypes';
2
+ /**
3
+ * Controlled Tabs component that provides a simple object-based interface to React Aria Tabs
4
+ * This allows consumers to provide tabs as an array of objects with content and events
5
+ * Requires selectedId and onSelectionChange to be managed by parent component
6
+ */
7
+ export declare function Tabs({ tabs, selectedId, onSelectionChange, className, ...ariaProps }: TabsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
+ import { Tabs as a, TabList as m, Tab as c, TabPanel as t } from "react-aria-components";
3
+ import p from "classnames";
4
+ import f from "./Tabs.module.scss.js";
5
+ function g({ tabs: s, selectedId: r, onSelectionChange: o, className: l, ...n }) {
6
+ return /* @__PURE__ */ d(
7
+ a,
8
+ {
9
+ className: p(f.root, l),
10
+ selectedKey: r,
11
+ onSelectionChange: (i) => {
12
+ i && o(i.toString());
13
+ },
14
+ ...n,
15
+ children: [
16
+ /* @__PURE__ */ e(m, { children: s.map((i) => /* @__PURE__ */ e(c, { id: i.id, isDisabled: i.isDisabled, children: i.label }, i.id)) }),
17
+ s.map((i) => /* @__PURE__ */ e(t, { id: i.id, children: i.content }, i.id))
18
+ ]
19
+ }
20
+ );
21
+ }
22
+ export {
23
+ g as Tabs
24
+ };
25
+ //# sourceMappingURL=Tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tabs.js","sources":["../../../../../src/components/Common/UI/Tabs/Tabs.tsx"],"sourcesContent":["import {\n Tabs as AriaTabs,\n TabList as AriaTabList,\n TabPanel as AriaTabPanel,\n Tab as AriaTab,\n} from 'react-aria-components'\nimport classNames from 'classnames'\nimport { type TabsProps } from './TabsTypes'\nimport styles from './Tabs.module.scss'\n\n/**\n * Controlled Tabs component that provides a simple object-based interface to React Aria Tabs\n * This allows consumers to provide tabs as an array of objects with content and events\n * Requires selectedId and onSelectionChange to be managed by parent component\n */\nexport function Tabs({ tabs, selectedId, onSelectionChange, className, ...ariaProps }: TabsProps) {\n return (\n <AriaTabs\n className={classNames(styles.root, className)}\n selectedKey={selectedId}\n onSelectionChange={key => {\n if (key) {\n onSelectionChange(key.toString())\n }\n }}\n {...ariaProps}\n >\n <AriaTabList>\n {tabs.map(tab => (\n <AriaTab key={tab.id} id={tab.id} isDisabled={tab.isDisabled}>\n {tab.label}\n </AriaTab>\n ))}\n </AriaTabList>\n\n {tabs.map(tab => (\n <AriaTabPanel key={tab.id} id={tab.id}>\n {tab.content}\n </AriaTabPanel>\n ))}\n </AriaTabs>\n )\n}\n"],"names":["Tabs","tabs","selectedId","onSelectionChange","className","ariaProps","jsxs","AriaTabs","classNames","styles","key","jsx","AriaTabList","tab","AriaTab","AriaTabPanel"],"mappings":";;;;AAeO,SAASA,EAAK,EAAE,MAAAC,GAAM,YAAAC,GAAY,mBAAAC,GAAmB,WAAAC,GAAW,GAAGC,KAAwB;AAChG,SACE,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,WAAWC,EAAWC,EAAO,MAAML,CAAS;AAAA,MAC5C,aAAaF;AAAA,MACb,mBAAmB,CAAAQ,MAAO;AACxB,QAAIA,KACFP,EAAkBO,EAAI,UAAU;AAAA,MAEpC;AAAA,MACC,GAAGL;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAM,EAACC,KACE,UAAAX,EAAK,IAAI,CAAAY,MACR,gBAAAF,EAACG,KAAqB,IAAID,EAAI,IAAI,YAAYA,EAAI,YAC/C,UAAAA,EAAI,SADOA,EAAI,EAElB,CACD,GACH;AAAA,QAECZ,EAAK,IAAI,CAAAY,MACR,gBAAAF,EAACI,GAAA,EAA0B,IAAIF,EAAI,IAChC,UAAAA,EAAI,QAAA,GADYA,EAAI,EAEvB,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -0,0 +1,8 @@
1
+ const o = "_root_o57yt_1", t = {
2
+ root: o
3
+ };
4
+ export {
5
+ t as default,
6
+ o as root
7
+ };
8
+ //# sourceMappingURL=Tabs.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tabs.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,51 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Individual tab configuration
4
+ */
5
+ export interface TabProps {
6
+ /**
7
+ * Unique identifier for the tab
8
+ */
9
+ id: string;
10
+ /**
11
+ * Label to display in the tab button
12
+ */
13
+ label: ReactNode;
14
+ /**
15
+ * Content to display in the tab panel
16
+ */
17
+ content: ReactNode;
18
+ /**
19
+ * Whether the tab is disabled
20
+ */
21
+ isDisabled?: boolean;
22
+ }
23
+ /**
24
+ * Props for the Tabs component - provides accessible tab navigation (controlled only)
25
+ */
26
+ export interface TabsProps {
27
+ /**
28
+ * Array of tab configuration objects
29
+ */
30
+ tabs: TabProps[];
31
+ /**
32
+ * Currently selected tab id
33
+ */
34
+ selectedId?: string;
35
+ /**
36
+ * Callback when tab selection changes
37
+ */
38
+ onSelectionChange: (id: string) => void;
39
+ /**
40
+ * Accessible label for the tabs
41
+ */
42
+ 'aria-label'?: string;
43
+ /**
44
+ * ID of element that labels the tabs
45
+ */
46
+ 'aria-labelledby'?: string;
47
+ /**
48
+ * Additional CSS class name
49
+ */
50
+ className?: string;
51
+ }
@@ -0,0 +1,3 @@
1
+ import "./types/i18next.d.ts"
2
+ export { Tabs } from './Tabs';
3
+ export type { TabsProps, TabProps } from './TabsTypes';
@@ -1,5 +1,5 @@
1
1
  import { useMemo as e } from "react";
2
- import { NumberFormatter as t } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@internationalized/number/dist/import.mjs";
2
+ import { NumberFormatter as t } from "@internationalized/number";
3
3
  import { useLocale as n } from "../../../contexts/LocaleProvider/useLocale.js";
4
4
  const f = (r = "currency") => {
5
5
  const { locale: m, currency: o } = n();
@@ -1,7 +1,7 @@
1
1
  import { jsx as o, jsxs as y, Fragment as f } from "react/jsx-runtime";
2
2
  import { z as e } from "zod";
3
- import { useForm as d, FormProvider as p } from "react-hook-form";
4
- import { zodResolver as N } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@hookform/resolvers/zod/dist/zod.mjs";
3
+ import { useForm as d, FormProvider as N } from "react-hook-form";
4
+ import { zodResolver as p } from "@hookform/resolvers/zod";
5
5
  import { SignatoryForm as _ } from "./SignatoryForm.js";
6
6
  import { Head as O } from "./Head.js";
7
7
  import { AssignSignatorySelection as u } from "./AssignSignatorySelection.js";
@@ -9,11 +9,10 @@ import { SignatoryAssignmentMode as m, AssignSignatoryProvider as E } from "./us
9
9
  import { companyEvents as i } from "../../../shared/constants.js";
10
10
  import { Flex as C } from "../../Common/Flex/Flex.js";
11
11
  import "classnames";
12
- import "react-i18next";
13
12
  import { BaseComponent as M } from "../../Base/Base.js";
14
13
  import { useBase as h } from "../../Base/useBase.js";
15
14
  import { useI18n as I, useComponentDictionary as Y } from "../../../i18n/I18n.js";
16
- function K(n) {
15
+ function J(n) {
17
16
  return /* @__PURE__ */ o(M, { ...n, children: /* @__PURE__ */ o(v, { ...n, children: n.children }) });
18
17
  }
19
18
  const D = e.object({
@@ -32,7 +31,7 @@ function v({
32
31
  }) {
33
32
  I("Company.AssignSignatory"), Y("Company.AssignSignatory", A);
34
33
  const { onEvent: t } = h(), c = d({
35
- resolver: N(D),
34
+ resolver: p(D),
36
35
  defaultValues: {
37
36
  signatoryAssignmentMode: m.createSignatory
38
37
  }
@@ -51,7 +50,7 @@ function v({
51
50
  r === i.COMPANY_CREATE_SIGNATORY_DONE ? t(i.COMPANY_ASSIGN_SIGNATORY_DONE) : r === i.COMPANY_INVITE_SIGNATORY_DONE ? t(i.COMPANY_ASSIGN_SIGNATORY_DONE) : t(r, l);
52
51
  }
53
52
  },
54
- children: /* @__PURE__ */ o(C, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(p, { ...c, children: s || /* @__PURE__ */ y(f, { children: [
53
+ children: /* @__PURE__ */ o(C, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(N, { ...c, children: s || /* @__PURE__ */ y(f, { children: [
55
54
  /* @__PURE__ */ o(O, {}),
56
55
  /* @__PURE__ */ o(u, {}),
57
56
  /* @__PURE__ */ o(_, {})
@@ -60,6 +59,6 @@ function v({
60
59
  ) });
61
60
  }
62
61
  export {
63
- K as AssignSignatory
62
+ J as AssignSignatory
64
63
  };
65
64
  //# sourceMappingURL=AssignSignatory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssignSignatory.js","sources":["../../../../src/components/Company/AssignSignatory/AssignSignatory.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { SignatoryForm } from './SignatoryForm'\nimport { Head } from './Head'\nimport { AssignSignatorySelection } from './AssignSignatorySelection'\nimport type { AssignSignatoryDefaultValues } from './useAssignSignatory'\nimport { AssignSignatoryProvider, SignatoryAssignmentMode } from './useAssignSignatory'\nimport { companyEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport { useBase, BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\n\ninterface AssignSignatoryProps extends BaseComponentInterface<'Company.AssignSignatory'> {\n companyId: string\n signatoryId?: string\n defaultValues?: AssignSignatoryDefaultValues\n}\n\nexport function AssignSignatory(props: AssignSignatoryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst AssignSignatorySelectionSchema = z.object({\n signatoryAssignmentMode: z.union([\n z.literal(SignatoryAssignmentMode.createSignatory),\n z.literal(SignatoryAssignmentMode.inviteSignatory),\n ]),\n})\n\ntype AssignSignatorySelectionInputs = z.infer<typeof AssignSignatorySelectionSchema>\n\nfunction Root({\n companyId,\n signatoryId,\n defaultValues,\n className,\n children,\n dictionary,\n}: AssignSignatoryProps) {\n useI18n('Company.AssignSignatory')\n useComponentDictionary('Company.AssignSignatory', dictionary)\n\n const { onEvent } = useBase()\n\n const formMethods = useForm<AssignSignatorySelectionInputs>({\n resolver: zodResolver(AssignSignatorySelectionSchema),\n defaultValues: {\n signatoryAssignmentMode: SignatoryAssignmentMode.createSignatory,\n },\n })\n\n const onSignatoryAssignmentModeChange = (mode: string) => {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_MODE_UPDATED, mode)\n }\n\n const onSignatoryFormEvent: BaseComponentInterface['onEvent'] = (event, data) => {\n if (event === companyEvents.COMPANY_CREATE_SIGNATORY_DONE) {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_DONE)\n } else if (event === companyEvents.COMPANY_INVITE_SIGNATORY_DONE) {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_DONE)\n } else {\n onEvent(event, data)\n }\n }\n\n return (\n <section className={className}>\n <AssignSignatoryProvider\n value={{\n companyId,\n signatoryId,\n defaultValues,\n onSignatoryAssignmentModeChange,\n onSignatoryFormEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n <FormProvider {...formMethods}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <AssignSignatorySelection />\n <SignatoryForm />\n </>\n )}\n </FormProvider>\n </Flex>\n </AssignSignatoryProvider>\n </section>\n )\n}\n"],"names":["AssignSignatory","props","jsx","BaseComponent","Root","AssignSignatorySelectionSchema","z","SignatoryAssignmentMode","companyId","signatoryId","defaultValues","className","children","dictionary","useI18n","useComponentDictionary","onEvent","useBase","formMethods","useForm","zodResolver","AssignSignatoryProvider","mode","companyEvents","event","data","Flex","FormProvider","jsxs","Fragment","Head","AssignSignatorySelection","SignatoryForm"],"mappings":";;;;;;;;;;;;;;;AAmBO,SAASA,EAAgBC,GAA6B;AAC3D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMI,IAAiCC,EAAE,OAAO;AAAA,EAC9C,yBAAyBA,EAAE,MAAM;AAAA,IAC/BA,EAAE,QAAQC,EAAwB,eAAe;AAAA,IACjDD,EAAE,QAAQC,EAAwB,eAAe;AAAA,EAAA,CAClD;AACH,CAAC;AAID,SAASH,EAAK;AAAA,EACZ,WAAAI;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,GAAyB;AACvB,EAAAC,EAAQ,yBAAyB,GACjCC,EAAuB,2BAA2BF,CAAU;AAE5D,QAAM,EAAE,SAAAG,EAAA,IAAYC,EAAA,GAEdC,IAAcC,EAAwC;AAAA,IAC1D,UAAUC,EAAYf,CAA8B;AAAA,IACpD,eAAe;AAAA,MACb,yBAAyBE,EAAwB;AAAA,IAAA;AAAA,EACnD,CACD;AAgBD,SACE,gBAAAL,EAAC,aAAQ,WAAAS,GACP,UAAA,gBAAAT;AAAA,IAACmB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAAb;AAAA,QACA,aAAAC;AAAA,QACA,eAAAC;AAAA,QACA,iCArBgC,CAACY,MAAiB;AACxD,UAAAN,EAAQO,EAAc,uCAAuCD,CAAI;AAAA,QACnE;AAAA,QAoBQ,sBAlBwD,CAACE,GAAOC,MAAS;AAC/E,UAAID,MAAUD,EAAc,gCAC1BP,EAAQO,EAAc,6BAA6B,IAC1CC,MAAUD,EAAc,gCACjCP,EAAQO,EAAc,6BAA6B,IAEnDP,EAAQQ,GAAOC,CAAI;AAAA,QAEvB;AAAA,MAUQ;AAAA,MAGF,UAAA,gBAAAvB,EAACwB,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAxB,EAACyB,GAAA,EAAc,GAAGT,GACf,UAAAN,KAGC,gBAAAgB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAyB;AAAA,0BACzBC,GAAA,CAAA,CAAc;AAAA,MAAA,EAAA,CACjB,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"AssignSignatory.js","sources":["../../../../src/components/Company/AssignSignatory/AssignSignatory.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { SignatoryForm } from './SignatoryForm'\nimport { Head } from './Head'\nimport { AssignSignatorySelection } from './AssignSignatorySelection'\nimport type { AssignSignatoryDefaultValues } from './useAssignSignatory'\nimport { AssignSignatoryProvider, SignatoryAssignmentMode } from './useAssignSignatory'\nimport { companyEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport { useBase, BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\n\ninterface AssignSignatoryProps extends BaseComponentInterface<'Company.AssignSignatory'> {\n companyId: string\n signatoryId?: string\n defaultValues?: AssignSignatoryDefaultValues\n}\n\nexport function AssignSignatory(props: AssignSignatoryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst AssignSignatorySelectionSchema = z.object({\n signatoryAssignmentMode: z.union([\n z.literal(SignatoryAssignmentMode.createSignatory),\n z.literal(SignatoryAssignmentMode.inviteSignatory),\n ]),\n})\n\ntype AssignSignatorySelectionInputs = z.infer<typeof AssignSignatorySelectionSchema>\n\nfunction Root({\n companyId,\n signatoryId,\n defaultValues,\n className,\n children,\n dictionary,\n}: AssignSignatoryProps) {\n useI18n('Company.AssignSignatory')\n useComponentDictionary('Company.AssignSignatory', dictionary)\n\n const { onEvent } = useBase()\n\n const formMethods = useForm<AssignSignatorySelectionInputs>({\n resolver: zodResolver(AssignSignatorySelectionSchema),\n defaultValues: {\n signatoryAssignmentMode: SignatoryAssignmentMode.createSignatory,\n },\n })\n\n const onSignatoryAssignmentModeChange = (mode: string) => {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_MODE_UPDATED, mode)\n }\n\n const onSignatoryFormEvent: BaseComponentInterface['onEvent'] = (event, data) => {\n if (event === companyEvents.COMPANY_CREATE_SIGNATORY_DONE) {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_DONE)\n } else if (event === companyEvents.COMPANY_INVITE_SIGNATORY_DONE) {\n onEvent(companyEvents.COMPANY_ASSIGN_SIGNATORY_DONE)\n } else {\n onEvent(event, data)\n }\n }\n\n return (\n <section className={className}>\n <AssignSignatoryProvider\n value={{\n companyId,\n signatoryId,\n defaultValues,\n onSignatoryAssignmentModeChange,\n onSignatoryFormEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n <FormProvider {...formMethods}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <AssignSignatorySelection />\n <SignatoryForm />\n </>\n )}\n </FormProvider>\n </Flex>\n </AssignSignatoryProvider>\n </section>\n )\n}\n"],"names":["AssignSignatory","props","jsx","BaseComponent","Root","AssignSignatorySelectionSchema","z","SignatoryAssignmentMode","companyId","signatoryId","defaultValues","className","children","dictionary","useI18n","useComponentDictionary","onEvent","useBase","formMethods","useForm","zodResolver","AssignSignatoryProvider","mode","companyEvents","event","data","Flex","FormProvider","jsxs","Fragment","Head","AssignSignatorySelection","SignatoryForm"],"mappings":";;;;;;;;;;;;;;AAmBO,SAASA,EAAgBC,GAA6B;AAC3D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMI,IAAiCC,EAAE,OAAO;AAAA,EAC9C,yBAAyBA,EAAE,MAAM;AAAA,IAC/BA,EAAE,QAAQC,EAAwB,eAAe;AAAA,IACjDD,EAAE,QAAQC,EAAwB,eAAe;AAAA,EAAA,CAClD;AACH,CAAC;AAID,SAASH,EAAK;AAAA,EACZ,WAAAI;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,GAAyB;AACvB,EAAAC,EAAQ,yBAAyB,GACjCC,EAAuB,2BAA2BF,CAAU;AAE5D,QAAM,EAAE,SAAAG,EAAA,IAAYC,EAAA,GAEdC,IAAcC,EAAwC;AAAA,IAC1D,UAAUC,EAAYf,CAA8B;AAAA,IACpD,eAAe;AAAA,MACb,yBAAyBE,EAAwB;AAAA,IAAA;AAAA,EACnD,CACD;AAgBD,SACE,gBAAAL,EAAC,aAAQ,WAAAS,GACP,UAAA,gBAAAT;AAAA,IAACmB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAAb;AAAA,QACA,aAAAC;AAAA,QACA,eAAAC;AAAA,QACA,iCArBgC,CAACY,MAAiB;AACxD,UAAAN,EAAQO,EAAc,uCAAuCD,CAAI;AAAA,QACnE;AAAA,QAoBQ,sBAlBwD,CAACE,GAAOC,MAAS;AAC/E,UAAID,MAAUD,EAAc,gCAC1BP,EAAQO,EAAc,6BAA6B,IAC1CC,MAAUD,EAAc,gCACjCP,EAAQO,EAAc,6BAA6B,IAEnDP,EAAQQ,GAAOC,CAAI;AAAA,QAEvB;AAAA,MAUQ;AAAA,MAGF,UAAA,gBAAAvB,EAACwB,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAxB,EAACyB,GAAA,EAAc,GAAGT,GACf,UAAAN,KAGC,gBAAAgB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAyB;AAAA,0BACzBC,GAAA,CAAA,CAAc;AAAA,MAAA,EAAA,CACjB,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,11 +1,11 @@
1
1
  import { jsx as o, jsxs as F, Fragment as Y } from "react/jsx-runtime";
2
2
  import { useForm as q, FormProvider as w } from "react-hook-form";
3
- import { zodResolver as x } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@hookform/resolvers/zod/dist/zod.mjs";
3
+ import { zodResolver as x } from "@hookform/resolvers/zod";
4
4
  import z from "classnames";
5
- import { useSignatoriesListSuspense as B } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/signatoriesList.js";
6
- import { useSignatoriesCreateMutation as k } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/signatoriesCreate.js";
7
- import { useSignatoriesUpdateMutation as G } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/signatoriesUpdate.js";
8
- import { useSignatoriesDeleteMutation as j } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/react-query/signatoriesDelete.js";
5
+ import { useSignatoriesListSuspense as B } from "@gusto/embedded-api/react-query/signatoriesList";
6
+ import { useSignatoriesCreateMutation as k } from "@gusto/embedded-api/react-query/signatoriesCreate";
7
+ import { useSignatoriesUpdateMutation as G } from "@gusto/embedded-api/react-query/signatoriesUpdate";
8
+ import { useSignatoriesDeleteMutation as j } from "@gusto/embedded-api/react-query/signatoriesDelete";
9
9
  import { CreateSignatoryForm as L } from "./CreateSignatoryForm.js";
10
10
  import { Actions as H } from "./Actions.js";
11
11
  import I from "./CreateSignatory.module.scss.js";
@@ -17,10 +17,9 @@ import { BaseComponent as X } from "../../../Base/Base.js";
17
17
  import { useBase as Z } from "../../../Base/useBase.js";
18
18
  import { Flex as $ } from "../../../Common/Flex/Flex.js";
19
19
  import { companyEvents as c } from "../../../../shared/constants.js";
20
- import "react-i18next";
21
20
  import { formatDateToStringDate as V } from "../../../../helpers/dateFormatting.js";
22
21
  import { useMaskedTransform as tt, commonMasks as et } from "../../../../helpers/mask.js";
23
- function bt(r) {
22
+ function Pt(r) {
24
23
  return /* @__PURE__ */ o(X, { ...r, children: /* @__PURE__ */ o(ot, { ...r, children: r.children }) });
25
24
  }
26
25
  function ot({
@@ -114,6 +113,6 @@ function ot({
114
113
  ) });
115
114
  }
116
115
  export {
117
- bt as CreateSignatory
116
+ Pt as CreateSignatory
118
117
  };
119
118
  //# sourceMappingURL=CreateSignatory.js.map