@gusto/embedded-react-sdk 0.55.2 → 0.55.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
  3. package/dist/components/Common/DataView/DataCards/DataCards.js +63 -54
  4. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  5. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +14 -12
  6. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
  7. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
  8. package/dist/components/Common/DataView/DataTable/DataTable.js +75 -66
  9. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  10. package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js +8 -4
  11. package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js.map +1 -1
  12. package/dist/components/Common/DataView/DataView.js +18 -17
  13. package/dist/components/Common/DataView/DataView.js.map +1 -1
  14. package/dist/components/Common/FieldLayout/FieldLayout.js +6 -6
  15. package/dist/components/Common/Fieldset/Fieldset.js +6 -6
  16. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js +6 -6
  17. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +58 -49
  18. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -1
  19. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js +14 -10
  20. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js.map +1 -1
  21. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +4 -0
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  26. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  27. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  28. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  29. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  30. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +4 -0
  31. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  32. package/dist/components/Company/DocumentSigner/DocumentList/List.js +11 -8
  33. package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -1
  34. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  35. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  36. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
  37. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  38. package/dist/components/Company/Industry/Context.js +6 -7
  39. package/dist/components/Company/Industry/Context.js.map +1 -1
  40. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  41. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  42. package/dist/components/Company/Locations/LocationsList/List.js +27 -25
  43. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  44. package/dist/components/Company/Locations/LocationsList/LocationsList.js +41 -36
  45. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  46. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
  47. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  48. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  49. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  50. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  51. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +9 -2
  52. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +19 -18
  53. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  54. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +63 -62
  55. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  56. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  57. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  58. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  59. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  60. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js +69 -65
  61. package/dist/components/Company/StateTaxes/TaxRateManagement/AddTaxRateDialog.js.map +1 -1
  62. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -4
  63. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  64. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js +30 -23
  65. package/dist/components/Company/StateTaxes/TaxRateManagement/toHistoryRows.js.map +1 -1
  66. package/dist/components/Company/StateTaxes/shared/RequirementFields.d.ts +8 -4
  67. package/dist/components/Company/StateTaxes/shared/RequirementFields.js +13 -12
  68. package/dist/components/Company/StateTaxes/shared/RequirementFields.js.map +1 -1
  69. package/dist/components/Company/StateTaxes/shared/prepareRequirements.d.ts +29 -0
  70. package/dist/components/Company/StateTaxes/shared/prepareRequirements.js +24 -0
  71. package/dist/components/Company/StateTaxes/shared/prepareRequirements.js.map +1 -0
  72. package/dist/components/Company/StateTaxes/shared/prepareRequirements.test.d.ts +1 -0
  73. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +68 -55
  74. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  75. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +36 -35
  76. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  77. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +116 -116
  78. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  79. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +4 -0
  80. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +19 -19
  81. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  82. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +16 -13
  83. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
  84. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  85. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  86. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +4 -0
  87. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
  88. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +84 -96
  89. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
  90. package/dist/components/Flow/Flow.js +22 -22
  91. package/dist/components/Flow/Flow.js.map +1 -1
  92. package/dist/components/Flow/useFlow.js +3 -3
  93. package/dist/components/InformationRequests/InformationRequests.d.ts +1 -1
  94. package/dist/components/InformationRequests/InformationRequests.js +68 -53
  95. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  96. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
  97. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  98. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +87 -81
  99. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  100. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
  101. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +86 -67
  102. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  103. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +4 -0
  104. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -1
  105. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +26 -21
  106. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
  107. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +8 -1
  108. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +29 -17
  109. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  110. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js +21 -18
  111. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -1
  112. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js +9 -7
  113. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js.map +1 -1
  114. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +2 -0
  115. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
  116. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +200 -199
  117. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  118. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +3 -2
  119. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +32 -32
  120. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  121. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +254 -243
  122. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  123. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +83 -76
  124. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  125. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +23 -22
  126. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  127. package/dist/components/Payroll/PayrollList/PayrollList.js +108 -97
  128. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  129. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +38 -37
  130. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  131. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +8 -1
  132. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +196 -174
  133. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  134. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +3 -1
  135. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +173 -163
  136. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  137. package/dist/components/Payroll/helpers.d.ts +0 -15
  138. package/dist/components/Payroll/helpers.js +13 -18
  139. package/dist/components/Payroll/helpers.js.map +1 -1
  140. package/dist/components/Payroll/usePreparedPayrollData.js +8 -9
  141. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  142. package/dist/helpers/openPdfInNewTab.d.ts +15 -0
  143. package/dist/helpers/openPdfInNewTab.js +28 -0
  144. package/dist/helpers/openPdfInNewTab.js.map +1 -0
  145. package/dist/i18n/en/Company.DocumentList.json.js +34 -32
  146. package/dist/i18n/en/Company.DocumentList.json.js.map +1 -1
  147. package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
  148. package/dist/i18n/en/Employee.DocumentSigner.json.js +24 -22
  149. package/dist/i18n/en/Employee.DocumentSigner.json.js.map +1 -1
  150. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +11 -9
  151. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
  152. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +7 -7
  153. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -27
  154. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  155. package/dist/i18n/en/Payroll.PayrollOverview.json.js +41 -39
  156. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  157. package/dist/i18n/types.d.ts +331 -1
  158. package/dist/style.css +1 -1
  159. package/package.json +21 -21
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { useCompanyFormsGetAllSuspense } from '@gusto/embedded-api/react-query/companyFormsGetAll'\nimport { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { ManageSignatories } from './ManageSignatories'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\n/**\n * Props for {@link DocumentList}.\n *\n * @public\n */\nexport interface DocumentListProps extends BaseComponentInterface<'Company.DocumentList'> {\n /** The associated company identifier. */\n companyId: string\n /**\n * Identifier of the signatory viewing the documents. When it matches the\n * company's saved signatory, the user is treated as that signatory and is\n * allowed to sign documents.\n */\n signatoryId?: string\n}\n\n/**\n * Displays the list of company documents to be signed and lets the user manage signatories.\n *\n * @remarks\n * Lower-level building block used internally by `CompanyOnboarding.DocumentSigner` for its list\n * view. Use this component directly when you need full control over navigation between the\n * document list and the signature form.\n *\n * When `signatoryId` matches the currently saved signatory's id, the user is treated as the\n * signatory and is allowed to sign documents.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/forms/view` | Fired when a user selects a form to sign from the document list | The selected company form |\n * | `company/forms/editSignatory` | Fired when user requests to change the document signatory | The current signatory entity |\n * | `company/forms/done` | Fired when user completes the document signing process | — |\n *\n * @param props - Component props including the company id and optional signatory id\n * @returns The document list view with signatory management and continue action\n * @public\n */\nexport function DocumentList(props: DocumentListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, signatoryId, className, children, dictionary }: DocumentListProps) {\n useComponentDictionary('Company.DocumentList', dictionary)\n useI18n('Company.DocumentList')\n const { onEvent } = useBase()\n\n const {\n data: { forms },\n error: documentListError,\n } = useCompanyFormsGetAllSuspense({\n companyId,\n })\n const companyForms = forms!\n\n const {\n data: { signatories: signatoryList },\n } = useSignatoriesListSuspense({\n companyUuid: companyId,\n })\n const signatories = signatoryList!\n\n // For now, this will only ever have one entry for the current signatory since companies can\n // only have one signatory. If that changes in the future, this UX will need to be revisited.\n const signatory = signatories[0]\n const isSelfSignatory = !!signatoryId && signatory?.uuid === signatoryId\n\n const handleRequestFormToSign = (form: FormSchema) => {\n onEvent(companyEvents.COMPANY_VIEW_FORM_TO_SIGN, form)\n }\n\n const handleChangeSignatory = () => {\n onEvent(companyEvents.COMPANY_FORM_EDIT_SIGNATORY, signatory)\n }\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n companyForms,\n documentListError,\n handleRequestFormToSign,\n handleChangeSignatory,\n handleContinue,\n isSelfSignatory,\n signatory,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <ManageSignatories />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </DocumentListProvider>\n </section>\n )\n}\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","companyId","signatoryId","className","children","dictionary","useComponentDictionary","useI18n","onEvent","useBase","forms","documentListError","useCompanyFormsGetAllSuspense","companyForms","signatoryList","useSignatoriesListSuspense","signatory","isSelfSignatory","DocumentListProvider","form","companyEvents","Flex","jsxs","Fragment","Head","ManageSignatories","List","Actions"],"mappings":";;;;;;;;;;;;;AAoDO,SAASA,EAAaC,GAA0B;AACrD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,aAAAC,GAAa,WAAAC,GAAW,UAAAC,GAAU,YAAAC,KAAiC;AAC5F,EAAAC,EAAuB,wBAAwBD,CAAU,GACzDE,EAAQ,sBAAsB;AAC9B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd;AAAA,IACJ,MAAM,EAAE,OAAAC,EAAA;AAAA,IACR,OAAOC;AAAA,EAAA,IACLC,EAA8B;AAAA,IAChC,WAAAX;AAAA,EAAA,CACD,GACKY,IAAeH,GAEf;AAAA,IACJ,MAAM,EAAE,aAAaI,EAAA;AAAA,EAAc,IACjCC,EAA2B;AAAA,IAC7B,aAAad;AAAA,EAAA,CACd,GAKKe,IAJcF,EAIU,CAAC,GACzBG,IAAkB,CAAC,CAACf,KAAec,GAAW,SAASd;AAc7D,SACE,gBAAAJ,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,cAAAL;AAAA,QACA,mBAAAF;AAAA,QACA,yBAlBwB,CAACQ,MAAqB;AACpD,UAAAX,EAAQY,EAAc,2BAA2BD,CAAI;AAAA,QACvD;AAAA,QAiBQ,uBAfsB,MAAM;AAClC,UAAAX,EAAQY,EAAc,6BAA6BJ,CAAS;AAAA,QAC9D;AAAA,QAcQ,gBAZe,MAAM;AAC3B,UAAAR,EAAQY,EAAc,kBAAkB;AAAA,QAC1C;AAAA,QAWQ,iBAAAH;AAAA,QACA,WAAAD;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAlB,EAACuB,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAjB,KAGC,gBAAAkB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAzB,EAAC0B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAkB;AAAA,0BAClBC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { useCompanyFormsGetAllSuspense } from '@gusto/embedded-api/react-query/companyFormsGetAll'\nimport { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { ManageSignatories } from './ManageSignatories'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\n/**\n * Props for {@link DocumentList}.\n *\n * @public\n */\nexport interface DocumentListProps extends BaseComponentInterface<'Company.DocumentList'> {\n /** The associated company identifier. */\n companyId: string\n /**\n * Identifier of the signatory viewing the documents. When it matches the\n * company's saved signatory, the user is treated as that signatory and is\n * allowed to sign documents.\n */\n signatoryId?: string\n}\n\n/**\n * Displays the list of company documents to be signed and lets the user manage signatories.\n *\n * @remarks\n * Lower-level building block used internally by `CompanyOnboarding.DocumentSigner` for its list\n * view. Use this component directly when you need full control over navigation between the\n * document list and the signature form.\n *\n * When `signatoryId` matches the currently saved signatory's id, the user is treated as the\n * signatory and is allowed to sign documents.\n *\n * Each form's description is rendered as returned by the API, unless the `dictionary` prop\n * supplies a `forms.<name>.description` override for that form's `name` (e.g.\n * `forms.US_8655.description`).\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/forms/view` | Fired when a user selects a form to sign from the document list | The selected company form |\n * | `company/forms/editSignatory` | Fired when user requests to change the document signatory | The current signatory entity |\n * | `company/forms/done` | Fired when user completes the document signing process | — |\n *\n * @param props - Component props including the company id and optional signatory id\n * @returns The document list view with signatory management and continue action\n * @public\n */\nexport function DocumentList(props: DocumentListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, signatoryId, className, children, dictionary }: DocumentListProps) {\n useComponentDictionary('Company.DocumentList', dictionary)\n useI18n('Company.DocumentList')\n const { onEvent } = useBase()\n\n const {\n data: { forms },\n error: documentListError,\n } = useCompanyFormsGetAllSuspense({\n companyId,\n })\n const companyForms = forms!\n\n const {\n data: { signatories: signatoryList },\n } = useSignatoriesListSuspense({\n companyUuid: companyId,\n })\n const signatories = signatoryList!\n\n // For now, this will only ever have one entry for the current signatory since companies can\n // only have one signatory. If that changes in the future, this UX will need to be revisited.\n const signatory = signatories[0]\n const isSelfSignatory = !!signatoryId && signatory?.uuid === signatoryId\n\n const handleRequestFormToSign = (form: FormSchema) => {\n onEvent(companyEvents.COMPANY_VIEW_FORM_TO_SIGN, form)\n }\n\n const handleChangeSignatory = () => {\n onEvent(companyEvents.COMPANY_FORM_EDIT_SIGNATORY, signatory)\n }\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n companyForms,\n documentListError,\n handleRequestFormToSign,\n handleChangeSignatory,\n handleContinue,\n isSelfSignatory,\n signatory,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <ManageSignatories />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </DocumentListProvider>\n </section>\n )\n}\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","companyId","signatoryId","className","children","dictionary","useComponentDictionary","useI18n","onEvent","useBase","forms","documentListError","useCompanyFormsGetAllSuspense","companyForms","signatoryList","useSignatoriesListSuspense","signatory","isSelfSignatory","DocumentListProvider","form","companyEvents","Flex","jsxs","Fragment","Head","ManageSignatories","List","Actions"],"mappings":";;;;;;;;;;;;;AAwDO,SAASA,EAAaC,GAA0B;AACrD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,aAAAC,GAAa,WAAAC,GAAW,UAAAC,GAAU,YAAAC,KAAiC;AAC5F,EAAAC,EAAuB,wBAAwBD,CAAU,GACzDE,EAAQ,sBAAsB;AAC9B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd;AAAA,IACJ,MAAM,EAAE,OAAAC,EAAA;AAAA,IACR,OAAOC;AAAA,EAAA,IACLC,EAA8B;AAAA,IAChC,WAAAX;AAAA,EAAA,CACD,GACKY,IAAeH,GAEf;AAAA,IACJ,MAAM,EAAE,aAAaI,EAAA;AAAA,EAAc,IACjCC,EAA2B;AAAA,IAC7B,aAAad;AAAA,EAAA,CACd,GAKKe,IAJcF,EAIU,CAAC,GACzBG,IAAkB,CAAC,CAACf,KAAec,GAAW,SAASd;AAc7D,SACE,gBAAAJ,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,cAAAL;AAAA,QACA,mBAAAF;AAAA,QACA,yBAlBwB,CAACQ,MAAqB;AACpD,UAAAX,EAAQY,EAAc,2BAA2BD,CAAI;AAAA,QACvD;AAAA,QAiBQ,uBAfsB,MAAM;AAClC,UAAAX,EAAQY,EAAc,6BAA6BJ,CAAS;AAAA,QAC9D;AAAA,QAcQ,gBAZe,MAAM;AAC3B,UAAAR,EAAQY,EAAc,kBAAkB;AAAA,QAC1C;AAAA,QAWQ,iBAAAH;AAAA,QACA,WAAAD;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAlB,EAACuB,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAjB,KAGC,gBAAAkB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAzB,EAAC0B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAkB;AAAA,0BAClBC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -2,22 +2,25 @@ import { jsx as a } from "react/jsx-runtime";
2
2
  import { useTranslation as c } from "react-i18next";
3
3
  import { useDocumentList as l } from "./useDocumentList.js";
4
4
  import { DocumentList as p } from "../../../Common/DocumentList/DocumentList.js";
5
- function S() {
6
- const { companyForms: o, handleRequestFormToSign: i, documentListError: e, isSelfSignatory: r } = l(), { t } = c("Company.DocumentList"), s = (n) => {
7
- const m = o.find((u) => u.uuid === n.uuid);
8
- i(m || n);
5
+ function d(e, i) {
6
+ return e.name && i(`forms.${e.name}.description`, { defaultValue: "" }) || e.description;
7
+ }
8
+ function f() {
9
+ const { companyForms: e, handleRequestFormToSign: i, documentListError: o, isSelfSignatory: r } = l(), { t } = c("Company.DocumentList"), s = (n) => {
10
+ const u = e.find((m) => m.uuid === n.uuid);
11
+ i(u || n);
9
12
  };
10
13
  return /* @__PURE__ */ a(
11
14
  p,
12
15
  {
13
- forms: o.map((n) => ({
16
+ forms: e.map((n) => ({
14
17
  uuid: n.uuid,
15
18
  title: n.title,
16
- description: n.description,
19
+ description: d(n, t),
17
20
  requires_signing: n.requiresSigning
18
21
  })),
19
22
  onRequestSign: s,
20
- withError: !!e,
23
+ withError: !!o,
21
24
  label: t("documentListLabel"),
22
25
  columnLabels: {
23
26
  form: t("formColumnLabel"),
@@ -35,6 +38,6 @@ function S() {
35
38
  );
36
39
  }
37
40
  export {
38
- S as List
41
+ f as List
39
42
  };
40
43
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { DocumentList, type FormData } from '@/components/Common/DocumentList'\n\n/** @internal */\nfunction List() {\n const { companyForms, handleRequestFormToSign, documentListError, isSelfSignatory } =\n useDocumentList()\n\n const { t } = useTranslation('Company.DocumentList')\n\n const onRequestSign = (requestedForm: FormData) => {\n const companyForm = companyForms.find(currentForm => currentForm.uuid === requestedForm.uuid)\n handleRequestFormToSign(companyForm || requestedForm)\n }\n\n return (\n <DocumentList\n forms={companyForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={onRequestSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n canSign={isSelfSignatory}\n />\n )\n}\n\nexport { List }\n"],"names":["List","companyForms","handleRequestFormToSign","documentListError","isSelfSignatory","useDocumentList","useTranslation","onRequestSign","requestedForm","companyForm","currentForm","jsx","DocumentList","form"],"mappings":";;;;AAKA,SAASA,IAAO;AACd,QAAM,EAAE,cAAAC,GAAc,yBAAAC,GAAyB,mBAAAC,GAAmB,iBAAAC,EAAA,IAChEC,EAAA,GAEI,EAAE,EAAA,IAAMC,EAAe,sBAAsB,GAE7CC,IAAgB,CAACC,MAA4B;AACjD,UAAMC,IAAcR,EAAa,KAAK,OAAeS,EAAY,SAASF,EAAc,IAAI;AAC5F,IAAAN,EAAwBO,KAAeD,CAAa;AAAA,EACtD;AAEA,SACE,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAOX,EAAa,IAAI,CAAAY,OAAS;AAAA,QAC/B,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaA,EAAK;AAAA,QAClB,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAAN;AAAA,MACA,WAAW,CAAC,CAACJ;AAAA,MACb,OAAO,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAM,EAAE,iBAAiB;AAAA,QACzB,QAAQ,EAAE,mBAAmB;AAAA,MAAA;AAAA,MAE/B,cAAc;AAAA,QACZ,SAAS,EAAE,iBAAiB;AAAA,QAC5B,WAAW,EAAE,WAAW;AAAA,QACxB,UAAU,EAAE,sBAAsB;AAAA,MAAA;AAAA,MAEpC,iBAAiB,EAAE,iBAAiB;AAAA,MACpC,YAAY,EAAE,mBAAmB;AAAA,MACjC,SAASC;AAAA,IAAA;AAAA,EAAA;AAGf;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { TFunction } from 'i18next'\nimport type { Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { useDocumentList } from './useDocumentList'\nimport { DocumentList, type FormData } from '@/components/Common/DocumentList'\n\n/**\n * Resolves a form's rendered description, preferring a partner-provided\n * `forms.<name>.description` dictionary override over the API-provided text.\n * Falls back to the API text when no override exists (including for form\n * names outside the SDK's known catalog).\n */\nfunction resolveFormDescription(form: FormSchema, t: TFunction<'Company.DocumentList'>) {\n if (!form.name) return form.description\n const override = t(`forms.${form.name}.description` as never, { defaultValue: '' }) as string\n return override || form.description\n}\n\n/** @internal */\nfunction List() {\n const { companyForms, handleRequestFormToSign, documentListError, isSelfSignatory } =\n useDocumentList()\n\n const { t } = useTranslation('Company.DocumentList')\n\n const onRequestSign = (requestedForm: FormData) => {\n const companyForm = companyForms.find(currentForm => currentForm.uuid === requestedForm.uuid)\n handleRequestFormToSign(companyForm || requestedForm)\n }\n\n return (\n <DocumentList\n forms={companyForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: resolveFormDescription(form, t),\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={onRequestSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n canSign={isSelfSignatory}\n />\n )\n}\n\nexport { List }\n"],"names":["resolveFormDescription","form","t","List","companyForms","handleRequestFormToSign","documentListError","isSelfSignatory","useDocumentList","useTranslation","onRequestSign","requestedForm","companyForm","currentForm","jsx","DocumentList"],"mappings":";;;;AAYA,SAASA,EAAuBC,GAAkBC,GAAsC;AACtF,SAAKD,EAAK,QACOC,EAAE,SAASD,EAAK,IAAI,gBAAyB,EAAE,cAAc,IAAI,KAC/DA,EAAK;AAC1B;AAGA,SAASE,IAAO;AACd,QAAM,EAAE,cAAAC,GAAc,yBAAAC,GAAyB,mBAAAC,GAAmB,iBAAAC,EAAA,IAChEC,EAAA,GAEI,EAAE,EAAA,IAAMC,EAAe,sBAAsB,GAE7CC,IAAgB,CAACC,MAA4B;AACjD,UAAMC,IAAcR,EAAa,KAAK,OAAeS,EAAY,SAASF,EAAc,IAAI;AAC5F,IAAAN,EAAwBO,KAAeD,CAAa;AAAA,EACtD;AAEA,SACE,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAOX,EAAa,IAAI,CAAAH,OAAS;AAAA,QAC/B,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaD,EAAuBC,GAAM,CAAC;AAAA,QAC3C,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAAS;AAAA,MACA,WAAW,CAAC,CAACJ;AAAA,MACb,OAAO,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAM,EAAE,iBAAiB;AAAA,QACzB,QAAQ,EAAE,mBAAmB;AAAA,MAAA;AAAA,MAE/B,cAAc;AAAA,QACZ,SAAS,EAAE,iBAAiB;AAAA,QAC5B,WAAW,EAAE,WAAW;AAAA,QACxB,UAAU,EAAE,sBAAsB;AAAA,MAAA;AAAA,MAEpC,iBAAiB,EAAE,iBAAiB;AAAA,MACpC,YAAY,EAAE,mBAAmB;AAAA,MACjC,SAASC;AAAA,IAAA;AAAA,EAAA;AAGf;"}
@@ -11,13 +11,12 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
12
  import "../../../../shared/constants.js";
13
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
14
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
16
- const [d, f] = t(
15
+ const [a, d] = t(
17
16
  "CompanyDocumentListContext"
18
17
  );
19
18
  export {
20
- f as DocumentListProvider,
21
- d as useDocumentList
19
+ d as DocumentListProvider,
20
+ a as useDocumentList
22
21
  };
23
22
  //# sourceMappingURL=useDocumentList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n companyForms: FormSchema[]\n documentListError: Error | null\n handleRequestFormToSign: (form: FormSchema) => void\n handleChangeSignatory: () => void\n handleContinue: () => void\n isSelfSignatory: boolean\n signatory?: Signatory\n}\n\nconst [useDocumentList, DocumentListProvider] = createCompoundContext<DocumentListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,CAACA,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
1
+ {"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api/models/components/signatory'\nimport { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n companyForms: FormSchema[]\n documentListError: Error | null\n handleRequestFormToSign: (form: FormSchema) => void\n handleChangeSignatory: () => void\n handleContinue: () => void\n isSelfSignatory: boolean\n signatory?: Signatory\n}\n\nconst [useDocumentList, DocumentListProvider] = createCompoundContext<DocumentListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,CAACA,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
@@ -13,19 +13,18 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
13
13
  import "@gusto/embedded-api/models/errors/httpclienterrors";
14
14
  import "../../../shared/constants.js";
15
15
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
16
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
17
16
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
18
- const b = o.object({
17
+ const C = o.object({
19
18
  federalEin: o.string().optional(),
20
19
  taxPayerType: o.enum(Object.values(e)).optional(),
21
20
  filingForm: o.enum(Object.values(r)).optional(),
22
21
  legalName: o.string().min(1)
23
- }), [j, v] = t(
22
+ }), [b, j] = t(
24
23
  "CompanyFederalTaxesContext"
25
24
  );
26
25
  export {
27
- b as FederalTaxFormSchema,
28
- v as FederalTaxesProvider,
29
- j as useFederalTaxes
26
+ C as FederalTaxFormSchema,
27
+ j as FederalTaxesProvider,
28
+ b as useFederalTaxes
30
29
  };
31
30
  //# sourceMappingURL=useFederalTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport { FilingForm, TaxPayerType } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\n/** @internal */\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\n/** @internal */\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\n/**\n * Pre-populated values for the company federal tax form, supplied via {@link FederalTaxesProps}.\n * At least one of `taxPayerType`, `filingForm`, or `legalName` must be provided.\n *\n * @public\n */\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAOO,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAA;AAAA,EAC3E,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAA;AAAA,EACvE,WAAWF,EAAE,OAAA,EAAS,IAAI,CAAC;AAC7B,CAAC,GAsBK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
1
+ {"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport { FilingForm, TaxPayerType } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\n/** @internal */\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\n/** @internal */\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\n/**\n * Pre-populated values for the company federal tax form, supplied via {@link FederalTaxesProps}.\n * At least one of `taxPayerType`, `filingForm`, or `legalName` must be provided.\n *\n * @public\n */\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAOO,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAA;AAAA,EAC3E,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAA;AAAA,EACvE,WAAWF,EAAE,OAAA,EAAS,IAAI,CAAC;AAC7B,CAAC,GAsBK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
@@ -11,17 +11,16 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
12
  import "../../../shared/constants.js";
13
13
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
14
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
16
- const [P, f] = t("IndustryItems", {
15
+ const [A, P] = t("IndustryItems", {
17
16
  items: []
18
- }), [v, x] = t("IndustryApi", {
17
+ }), [f, v] = t("IndustryApi", {
19
18
  isPending: !1
20
19
  });
21
20
  export {
22
- x as IndustryApiStateProvider,
23
- f as IndustryItemsProvider,
24
- v as useIndustryApiState,
25
- P as useIndustryItems
21
+ v as IndustryApiStateProvider,
22
+ P as IndustryItemsProvider,
23
+ f as useIndustryApiState,
24
+ A as useIndustryItems
26
25
  };
27
26
  //# sourceMappingURL=Context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
1
+ {"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
@@ -11,13 +11,12 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
12
  import "../../../../shared/constants.js";
13
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
14
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
16
- const [L, f] = o(
15
+ const [d, L] = o(
17
16
  "CompanyDocumentFormContext"
18
17
  );
19
18
  export {
20
- f as LocationsFormProvider,
21
- L as useLocationsForm
19
+ L as LocationsFormProvider,
20
+ d as useLocationsForm
22
21
  };
23
22
  //# sourceMappingURL=useLocationForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAOA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
1
+ {"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAOA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
@@ -1,18 +1,18 @@
1
- import { jsxs as r, jsx as e, Fragment as o } from "react/jsx-runtime";
2
- import { useTranslation as P } from "react-i18next";
3
- import { useLocationsList as y } from "./useLocationsList.js";
4
- import b from "./List.module.scss.js";
5
- import x from "../../../../assets/icons/pencil.svg.js";
6
- import { EmptyData as T } from "../../../Common/EmptyData/EmptyData.js";
7
- import { HamburgerMenu as A } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
8
- import { useComponentContext as k } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
9
- import { getStreet as w, getCityStateZip as D } from "../../../../helpers/formattedStrings.js";
1
+ import { jsxs as r, jsx as e, Fragment as n } from "react/jsx-runtime";
2
+ import { useTranslation as y } from "react-i18next";
3
+ import { useLocationsList as b } from "./useLocationsList.js";
4
+ import x from "./List.module.scss.js";
5
+ import T from "../../../../assets/icons/pencil.svg.js";
6
+ import { EmptyData as A } from "../../../Common/EmptyData/EmptyData.js";
7
+ import { HamburgerMenu as k } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
8
+ import { useComponentContext as w } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
9
+ import { getStreet as D, getCityStateZip as F } from "../../../../helpers/formattedStrings.js";
10
10
  import { VisuallyHidden as S } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
11
11
  import { useDataView as V } from "../../../Common/DataView/useDataView.js";
12
12
  import { DataView as v } from "../../../Common/DataView/DataView.js";
13
- const J = () => {
14
- const a = k(), {
15
- locationList: n,
13
+ const K = () => {
14
+ const a = w(), {
15
+ locationList: o,
16
16
  handleEditLocation: s,
17
17
  currentPage: d,
18
18
  totalPages: l,
@@ -23,24 +23,25 @@ const J = () => {
23
23
  handleNextPage: p,
24
24
  handlePreviousPage: h,
25
25
  handleAddLocation: f,
26
- itemsPerPage: C
27
- } = y(), { t } = P("Company.Locations"), { ...L } = V({
28
- data: n,
26
+ itemsPerPage: C,
27
+ isFetching: L
28
+ } = b(), { t } = y("Company.Locations"), { ...P } = V({
29
+ data: o,
29
30
  columns: [
30
31
  {
31
32
  key: "name",
32
33
  title: t("locationListCol1"),
33
- render: (i) => /* @__PURE__ */ r("address", { className: b.addressCell, children: [
34
- /* @__PURE__ */ e(a.Text, { size: "sm", weight: "medium", children: w(i) }),
35
- /* @__PURE__ */ e(a.Text, { size: "sm", children: D(i) })
34
+ render: (i) => /* @__PURE__ */ r("address", { className: x.addressCell, children: [
35
+ /* @__PURE__ */ e(a.Text, { size: "sm", weight: "medium", children: D(i) }),
36
+ /* @__PURE__ */ e(a.Text, { size: "sm", children: F(i) })
36
37
  ] })
37
38
  },
38
39
  {
39
40
  key: "status",
40
41
  title: /* @__PURE__ */ e(S, { children: t("locationListCol2") }),
41
- render: (i) => /* @__PURE__ */ r(o, { children: [
42
+ render: (i) => /* @__PURE__ */ r(n, { children: [
42
43
  i.mailingAddress && /* @__PURE__ */ e(a.Badge, { status: "info", children: t("mailingAddress") }),
43
- i.filingAddress && /* @__PURE__ */ r(o, { children: [
44
+ i.filingAddress && /* @__PURE__ */ r(n, { children: [
44
45
  " ",
45
46
  /* @__PURE__ */ e(a.Badge, { status: "info", children: t("filingAddress") })
46
47
  ] })
@@ -48,7 +49,7 @@ const J = () => {
48
49
  }
49
50
  ],
50
51
  itemMenu: (i) => /* @__PURE__ */ e(
51
- A,
52
+ k,
52
53
  {
53
54
  items: [
54
55
  {
@@ -56,7 +57,7 @@ const J = () => {
56
57
  onClick: () => {
57
58
  s(i.uuid);
58
59
  },
59
- icon: /* @__PURE__ */ e(x, { "aria-hidden": !0 }),
60
+ icon: /* @__PURE__ */ e(T, { "aria-hidden": !0 }),
60
61
  "data-testid": "edit-location"
61
62
  }
62
63
  ],
@@ -75,11 +76,12 @@ const J = () => {
75
76
  totalCount: m,
76
77
  itemsPerPage: C
77
78
  },
78
- emptyState: () => /* @__PURE__ */ e(T, { title: t("emptyTableTitle"), description: t("emptyTableDescription"), children: /* @__PURE__ */ e(a.Button, { variant: "secondary", onClick: f, children: t("addFirstLocationCta") }) })
79
+ emptyState: () => /* @__PURE__ */ e(A, { title: t("emptyTableTitle"), description: t("emptyTableDescription"), children: /* @__PURE__ */ e(a.Button, { variant: "secondary", onClick: f, children: t("addFirstLocationCta") }) }),
80
+ isFetching: L
79
81
  });
80
- return /* @__PURE__ */ e(v, { label: t("locationListLabel"), ...L });
82
+ return /* @__PURE__ */ e(v, { label: t("locationListLabel"), ...P });
81
83
  };
82
84
  export {
83
- J as List
85
+ K as List
84
86
  };
85
87
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport styles from './List.module.scss'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/** @internal */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n totalCount,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n itemsPerPage,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <address className={styles.addressCell}>\n <Components.Text size=\"sm\" weight=\"medium\">\n {getStreet(location)}\n </Components.Text>\n <Components.Text size=\"sm\">{getCityStateZip(location)}</Components.Text>\n </address>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n totalCount,\n itemsPerPage,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","totalCount","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","itemsPerPage","useLocationsList","useTranslation","dataViewProps","useDataView","location","jsxs","styles","jsx","getStreet","getCityStateZip","VisuallyHidden","Fragment","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;;AAUO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,IACEC,EAAA,GAEE,EAAE,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMf;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAAgB,MAEJ,gBAAAC,EAAC,WAAA,EAAQ,WAAWC,EAAO,aACzB,UAAA;AAAA,UAAA,gBAAAC,EAACrB,EAAW,MAAX,EAAgB,MAAK,MAAK,QAAO,UAC/B,UAAAsB,EAAUJ,CAAQ,EAAA,CACrB;AAAA,UACA,gBAAAG,EAACrB,EAAW,MAAX,EAAgB,MAAK,MAAM,UAAAuB,EAAgBL,CAAQ,EAAA,CAAE;AAAA,QAAA,GACxD;AAAA,MAEJ;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAO,gBAAAG,EAACG,GAAA,EAAgB,UAAA,EAAE,kBAAkB,GAAE;AAAA,QAC9C,QAAQ,CAAAN,MAEJ,gBAAAC,EAAAM,GAAA,EACG,UAAA;AAAA,UAAAP,EAAS,oCACPlB,EAAW,OAAX,EAAiB,QAAQ,QAAS,UAAA,EAAE,gBAAgB,EAAA,CAAE;AAAA,UAExDkB,EAAS,iBACR,gBAAAC,EAAAM,GAAA,EACG,UAAA;AAAA,YAAA;AAAA,YACD,gBAAAJ,EAACrB,EAAW,OAAX,EAAiB,QAAQ,QAAS,UAAA,EAAE,eAAe,EAAA,CAAE;AAAA,UAAA,EAAA,CACxD;AAAA,QAAA,GAEJ;AAAA,MAEJ;AAAA,IACF;AAAA,IAEF,UAAU,CAAAkB,MAEN,gBAAAG;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAvB,EAAmBe,EAAS,IAAI;AAAA,YAClC;AAAA,YACA,MAAM,gBAAAG,EAACM,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,YAC7B,eAAe;AAAA,UAAA;AAAA,QACjB;AAAA,QAEF,eAAY;AAAA,QACZ,cAAc,EAAE,gBAAgB;AAAA,MAAA;AAAA,IAAA;AAAA,IAItC,YAAY;AAAA,MACV,gBAAAjB;AAAA,MACA,iBAAAH;AAAA,MACA,gBAAAE;AAAA,MACA,oBAAAE;AAAA,MACA,0BAAAH;AAAA,MACA,aAAAJ;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAO;AAAA,IAAA;AAAA,IAEF,YAAY,MACV,gBAAAQ,EAACO,GAAA,EAAU,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,GAC5E,UAAA,gBAAAP,EAACrB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASY,GAC7C,UAAA,EAAE,qBAAqB,EAAA,CAC1B,EAAA,CACF;AAAA,EAAA,CAEH;AACD,2BAAQiB,GAAA,EAAS,OAAO,EAAE,mBAAmB,GAAI,GAAGb,GAAe;AACrE;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport styles from './List.module.scss'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/** @internal */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n totalCount,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n itemsPerPage,\n isFetching,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <address className={styles.addressCell}>\n <Components.Text size=\"sm\" weight=\"medium\">\n {getStreet(location)}\n </Components.Text>\n <Components.Text size=\"sm\">{getCityStateZip(location)}</Components.Text>\n </address>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n totalCount,\n itemsPerPage,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n isFetching,\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","totalCount","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","itemsPerPage","isFetching","useLocationsList","useTranslation","dataViewProps","useDataView","location","jsxs","styles","jsx","getStreet","getCityStateZip","VisuallyHidden","Fragment","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;;AAUO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,EAAA,IACEC,EAAA,GAEE,EAAE,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMhB;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAAiB,MAEJ,gBAAAC,EAAC,WAAA,EAAQ,WAAWC,EAAO,aACzB,UAAA;AAAA,UAAA,gBAAAC,EAACtB,EAAW,MAAX,EAAgB,MAAK,MAAK,QAAO,UAC/B,UAAAuB,EAAUJ,CAAQ,EAAA,CACrB;AAAA,UACA,gBAAAG,EAACtB,EAAW,MAAX,EAAgB,MAAK,MAAM,UAAAwB,EAAgBL,CAAQ,EAAA,CAAE;AAAA,QAAA,GACxD;AAAA,MAEJ;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAO,gBAAAG,EAACG,GAAA,EAAgB,UAAA,EAAE,kBAAkB,GAAE;AAAA,QAC9C,QAAQ,CAAAN,MAEJ,gBAAAC,EAAAM,GAAA,EACG,UAAA;AAAA,UAAAP,EAAS,oCACPnB,EAAW,OAAX,EAAiB,QAAQ,QAAS,UAAA,EAAE,gBAAgB,EAAA,CAAE;AAAA,UAExDmB,EAAS,iBACR,gBAAAC,EAAAM,GAAA,EACG,UAAA;AAAA,YAAA;AAAA,YACD,gBAAAJ,EAACtB,EAAW,OAAX,EAAiB,QAAQ,QAAS,UAAA,EAAE,eAAe,EAAA,CAAE;AAAA,UAAA,EAAA,CACxD;AAAA,QAAA,GAEJ;AAAA,MAEJ;AAAA,IACF;AAAA,IAEF,UAAU,CAAAmB,MAEN,gBAAAG;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAxB,EAAmBgB,EAAS,IAAI;AAAA,YAClC;AAAA,YACA,MAAM,gBAAAG,EAACM,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,YAC7B,eAAe;AAAA,UAAA;AAAA,QACjB;AAAA,QAEF,eAAY;AAAA,QACZ,cAAc,EAAE,gBAAgB;AAAA,MAAA;AAAA,IAAA;AAAA,IAItC,YAAY;AAAA,MACV,gBAAAlB;AAAA,MACA,iBAAAH;AAAA,MACA,gBAAAE;AAAA,MACA,oBAAAE;AAAA,MACA,0BAAAH;AAAA,MACA,aAAAJ;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAO;AAAA,IAAA;AAAA,IAEF,YAAY,MACV,gBAAAS,EAACO,GAAA,EAAU,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,GAC5E,UAAA,gBAAAP,EAACtB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASY,GAC7C,UAAA,EAAE,qBAAqB,EAAA,CAC1B,EAAA,CACF;AAAA,IAEF,YAAAE;AAAA,EAAA,CACD;AACD,2BAAQgB,GAAA,EAAS,OAAO,EAAE,mBAAmB,GAAI,GAAGb,GAAe;AACrE;"}
@@ -1,48 +1,53 @@
1
- import { jsx as o, jsxs as l, Fragment as L } from "react/jsx-runtime";
2
- import { useLocationsGetSuspense as h } from "@gusto/embedded-api/react-query/locationsGet";
3
- import { Head as u } from "./Head.js";
4
- import { List as C } from "./List.js";
5
- import { Actions as O } from "./Actions.js";
6
- import { LocationsListProvider as A } from "./useLocationsList.js";
7
- import { useI18n as E } from "../../../../i18n/I18n.js";
8
- import { BaseComponent as N } from "../../../Base/Base.js";
9
- import { useBase as P } from "../../../Base/useBase.js";
10
- import { Flex as g } from "../../../Common/Flex/Flex.js";
11
- import { companyEvents as i } from "../../../../shared/constants.js";
12
- import { usePagination as I } from "../../../../hooks/usePagination/usePagination.js";
13
- function H(t) {
14
- return /* @__PURE__ */ o(N, { ...t, children: /* @__PURE__ */ o(_, { ...t, children: t.children }) });
1
+ import { jsx as o, jsxs as h, Fragment as O } from "react/jsx-runtime";
2
+ import { keepPreviousData as C } from "@tanstack/react-query";
3
+ import { useLocationsGet as A } from "@gusto/embedded-api/react-query/locationsGet";
4
+ import { Head as g } from "./Head.js";
5
+ import { List as E } from "./List.js";
6
+ import { Actions as P } from "./Actions.js";
7
+ import { LocationsListProvider as N } from "./useLocationsList.js";
8
+ import { useI18n as I } from "../../../../i18n/I18n.js";
9
+ import { BaseComponent as _, BaseLayout as v } from "../../../Base/Base.js";
10
+ import { useBase as x } from "../../../Base/useBase.js";
11
+ import { Flex as D } from "../../../Common/Flex/Flex.js";
12
+ import { companyEvents as r } from "../../../../shared/constants.js";
13
+ import { usePagination as T } from "../../../../hooks/usePagination/usePagination.js";
14
+ function J(t) {
15
+ return /* @__PURE__ */ o(_, { ...t, children: /* @__PURE__ */ o(y, { ...t, children: t.children }) });
15
16
  }
16
- function _({ companyId: t, className: r, children: e }) {
17
- E("Company.Locations");
18
- const { onEvent: n } = P(), { getPaginationProps: s } = I(), {
19
- data: { companyLocationsList: m, httpMeta: a }
20
- } = h({ companyId: t }), c = () => {
21
- n(i.COMPANY_LOCATION_DONE);
22
- }, p = () => {
23
- n(i.COMPANY_LOCATION_CREATE);
24
- }, d = (f) => {
25
- n(i.COMPANY_LOCATION_EDIT, { uuid: f });
17
+ function y({ companyId: t, className: a, children: i, LoaderComponent: s }) {
18
+ I("Company.Locations");
19
+ const { onEvent: n } = x(), { getPaginationProps: m } = T(), { data: e, isFetching: c } = A(
20
+ { companyId: t },
21
+ { placeholderData: C, throwOnError: !0 }
22
+ ), p = () => {
23
+ n(r.COMPANY_LOCATION_DONE);
24
+ }, d = () => {
25
+ n(r.COMPANY_LOCATION_CREATE);
26
+ }, f = (u) => {
27
+ n(r.COMPANY_LOCATION_EDIT, { uuid: u });
26
28
  };
27
- return /* @__PURE__ */ o("section", { className: r, children: /* @__PURE__ */ o(
28
- A,
29
+ if (!e)
30
+ return /* @__PURE__ */ o(v, { isLoading: !0, LoaderComponent: s });
31
+ const { companyLocationsList: l, httpMeta: L } = e;
32
+ return /* @__PURE__ */ o("section", { className: a, children: /* @__PURE__ */ o(
33
+ N,
29
34
  {
30
35
  value: {
31
- ...s(a.response.headers),
32
- locationList: m ?? [],
33
- handleAddLocation: p,
34
- handleEditLocation: d,
35
- handleContinue: c
36
+ ...m(L.response.headers, c),
37
+ locationList: l ?? [],
38
+ handleAddLocation: d,
39
+ handleEditLocation: f,
40
+ handleContinue: p
36
41
  },
37
- children: /* @__PURE__ */ o(g, { flexDirection: "column", gap: 32, alignItems: "stretch", children: e || /* @__PURE__ */ l(L, { children: [
38
- /* @__PURE__ */ o(u, {}),
39
- /* @__PURE__ */ o(C, {}),
40
- /* @__PURE__ */ o(O, {})
42
+ children: /* @__PURE__ */ o(D, { flexDirection: "column", gap: 32, alignItems: "stretch", children: i || /* @__PURE__ */ h(O, { children: [
43
+ /* @__PURE__ */ o(g, {}),
44
+ /* @__PURE__ */ o(E, {}),
45
+ /* @__PURE__ */ o(P, {})
41
46
  ] }) })
42
47
  }
43
48
  ) });
44
49
  }
45
50
  export {
46
- H as LocationsList
51
+ J as LocationsList
47
52
  };
48
53
  //# sourceMappingURL=LocationsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\n\n/**\n * Props for the {@link LocationsList} component.\n *\n * @public\n */\nexport interface LocationsListProps extends BaseComponentInterface<'Company.Locations'> {\n /** The associated company identifier. */\n companyId: string\n}\n\n/**\n * Displays the list of work locations for a company.\n *\n * @remarks\n * Standalone building block used internally by the orchestrated `Locations` component for its list view. Use this directly when you need full control over navigation between the list and form views.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/location/add` | A user chose to add a new location | — |\n * | `company/location/edit` | A user chose to edit a specific location | `{ uuid: string }` |\n * | `company/location/done` | The user chose to proceed to the next step | — |\n *\n * @param props - Component props including the `companyId` whose locations should be listed.\n * @returns The rendered locations list section.\n * @public\n */\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const { getPaginationProps } = usePagination()\n\n const {\n data: { companyLocationsList, httpMeta },\n } = useLocationsGetSuspense({ companyId })\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n ...getPaginationProps(httpMeta.response.headers),\n locationList: companyLocationsList ?? [],\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32} alignItems=\"stretch\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","getPaginationProps","usePagination","companyLocationsList","httpMeta","useLocationsGetSuspense","handleContinue","companyEvents","handleAddLocation","handleEditLocation","uuid","LocationsListProvider","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;AAuCO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,oBAAAC,EAAA,IAAuBC,EAAA,GAEzB;AAAA,IACJ,MAAM,EAAE,sBAAAC,GAAsB,UAAAC,EAAA;AAAA,EAAS,IACrCC,EAAwB,EAAE,WAAAV,GAAW,GAEnCW,IAAiB,MAAM;AAC3B,IAAAP,EAAQQ,EAAc,qBAAqB;AAAA,EAC7C,GACMC,IAAoB,MAAM;AAC9B,IAAAT,EAAQQ,EAAc,uBAAuB;AAAA,EAC/C,GACME,IAAqB,CAACC,MAAiB;AAC3C,IAAAX,EAAQQ,EAAc,uBAAuB,EAAE,MAAAG,EAAA,CAAM;AAAA,EACvD;AAEA,SACE,gBAAAlB,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACmB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,GAAGV,EAAmBG,EAAS,SAAS,OAAO;AAAA,QAC/C,cAAcD,KAAwB,CAAA;AAAA,QACtC,mBAAAK;AAAA,QACA,oBAAAC;AAAA,QACA,gBAAAH;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAd,EAACoB,GAAA,EAAK,eAAc,UAAS,KAAK,IAAI,YAAW,WAC9C,UAAAf,KAGC,gBAAAgB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAtB,EAACuB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { keepPreviousData } from '@tanstack/react-query'\nimport { useLocationsGet } from '@gusto/embedded-api/react-query/locationsGet'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, BaseLayout, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\n\n/**\n * Props for the {@link LocationsList} component.\n *\n * @public\n */\nexport interface LocationsListProps extends BaseComponentInterface<'Company.Locations'> {\n /** The associated company identifier. */\n companyId: string\n}\n\n/**\n * Displays the list of work locations for a company.\n *\n * @remarks\n * Standalone building block used internally by the orchestrated `Locations` component for its list view. Use this directly when you need full control over navigation between the list and form views.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/location/add` | A user chose to add a new location | — |\n * | `company/location/edit` | A user chose to edit a specific location | `{ uuid: string }` |\n * | `company/location/done` | The user chose to proceed to the next step | — |\n *\n * @param props - Component props including the `companyId` whose locations should be listed.\n * @returns The rendered locations list section.\n * @public\n */\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children, LoaderComponent }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const { getPaginationProps } = usePagination()\n\n const { data, isFetching } = useLocationsGet(\n { companyId },\n { placeholderData: keepPreviousData, throwOnError: true },\n )\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n if (!data) {\n return <BaseLayout isLoading LoaderComponent={LoaderComponent} />\n }\n\n const { companyLocationsList, httpMeta } = data\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n ...getPaginationProps(httpMeta.response.headers, isFetching),\n locationList: companyLocationsList ?? [],\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32} alignItems=\"stretch\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","LoaderComponent","useI18n","onEvent","useBase","getPaginationProps","usePagination","data","isFetching","useLocationsGet","keepPreviousData","handleContinue","companyEvents","handleAddLocation","handleEditLocation","uuid","BaseLayout","companyLocationsList","httpMeta","LocationsListProvider","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;;AAwCO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,iBAAAC,KAAuC;AACrF,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,oBAAAC,EAAA,IAAuBC,EAAA,GAEzB,EAAE,MAAAC,GAAM,YAAAC,EAAA,IAAeC;AAAA,IAC3B,EAAE,WAAAX,EAAA;AAAA,IACF,EAAE,iBAAiBY,GAAkB,cAAc,GAAA;AAAA,EAAK,GAGpDC,IAAiB,MAAM;AAC3B,IAAAR,EAAQS,EAAc,qBAAqB;AAAA,EAC7C,GACMC,IAAoB,MAAM;AAC9B,IAAAV,EAAQS,EAAc,uBAAuB;AAAA,EAC/C,GACME,IAAqB,CAACC,MAAiB;AAC3C,IAAAZ,EAAQS,EAAc,uBAAuB,EAAE,MAAAG,EAAA,CAAM;AAAA,EACvD;AAEA,MAAI,CAACR;AACH,WAAO,gBAAAZ,EAACqB,GAAA,EAAW,WAAS,IAAC,iBAAAf,EAAA,CAAkC;AAGjE,QAAM,EAAE,sBAAAgB,GAAsB,UAAAC,EAAA,IAAaX;AAE3C,SACE,gBAAAZ,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACwB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,GAAGd,EAAmBa,EAAS,SAAS,SAASV,CAAU;AAAA,QAC3D,cAAcS,KAAwB,CAAA;AAAA,QACtC,mBAAAJ;AAAA,QACA,oBAAAC;AAAA,QACA,gBAAAH;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAhB,EAACyB,GAAA,EAAK,eAAc,UAAS,KAAK,IAAI,YAAW,WAC9C,UAAApB,KAGC,gBAAAqB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -6,6 +6,7 @@ type LocationsListContextType = {
6
6
  totalCount: number;
7
7
  currentPage: number;
8
8
  itemsPerPage: PaginationItemsPerPage;
9
+ isFetching?: boolean;
9
10
  handleItemsPerPageChange: (n: PaginationItemsPerPage) => void;
10
11
  handleFirstPage: () => void;
11
12
  handlePreviousPage: () => void;
@@ -11,13 +11,12 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
12
  import "../../../../shared/constants.js";
13
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
14
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
16
- const [f, v] = o(
15
+ const [d, f] = o(
17
16
  "CompanyDocumentListContext"
18
17
  );
19
18
  export {
20
- v as LocationsListProvider,
21
- f as useLocationsList
19
+ f as LocationsListProvider,
20
+ d as useLocationsList
22
21
  };
23
22
  //# sourceMappingURL=useLocationsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n totalCount: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
1
+ {"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n totalCount: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n isFetching?: boolean\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
@@ -11,11 +11,10 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
12
  import "../../../shared/constants.js";
13
13
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
14
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
16
- const [C, c] = o("OnboardingOverviewContext");
15
+ const [x, C] = o("OnboardingOverviewContext");
17
16
  export {
18
- c as OnboardingOverviewProvider,
19
- C as useOnboardingOverview
17
+ C as OnboardingOverviewProvider,
18
+ x as useOnboardingOverview
20
19
  };
21
20
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
@@ -1,2 +1,9 @@
1
- /** @internal */
2
- export declare function Form(): (import("react").JSX.Element | null)[];
1
+ /**
2
+ * Renders one section per requirement set, skipping sets that have nothing left to edit once
3
+ * non-editable requirements — and requirements resolved as never-applicable against a
4
+ * non-editable sibling — are dropped (mirrors gws-flows' `TaxRequirements::Edit.set_editable?`,
5
+ * which drops such sets from its own edit view entirely).
6
+ *
7
+ * @internal
8
+ */
9
+ export declare function Form(): import("react").JSX.Element | (import("react").JSX.Element | null)[];
@@ -1,26 +1,27 @@
1
- import { jsxs as i, Fragment as d, jsx as e } from "react/jsx-runtime";
2
- import { useTranslation as x } from "react-i18next";
3
- import { RequirementFields as h } from "../shared/RequirementFields.js";
1
+ import { jsxs as u, Fragment as q, jsx as t } from "react/jsx-runtime";
2
+ import { useTranslation as h } from "react-i18next";
3
+ import { RequirementFields as x } from "../shared/RequirementFields.js";
4
4
  import { getUniqueRhfKey as F } from "../shared/rhfKey.js";
5
- import { useStateTaxesForm as q } from "./context.js";
6
- import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
5
+ import { isRequirementSetEditable as b } from "../shared/prepareRequirements.js";
6
+ import { useStateTaxesForm as y } from "./context.js";
7
+ import { useComponentContext as R } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
8
  import { useDateFormatter as S } from "../../../../hooks/useDateFormatter.js";
8
- function k() {
9
- const { t: s } = x("Company.StateTaxes", { keyPrefix: "form" }), a = S(), { stateTaxRequirements: f } = q(), t = y(), r = f.requirementSets ?? [];
10
- return r.map((o, u) => {
11
- const { requirements: c, label: p, effectiveFrom: n, key: l } = o;
12
- if (!l) return null;
13
- const m = F(o, u, r);
14
- return /* @__PURE__ */ i(d, { children: [
15
- /* @__PURE__ */ i("div", { children: [
16
- /* @__PURE__ */ e(t.Heading, { as: "h3", children: p }),
17
- n && /* @__PURE__ */ e(t.Text, { size: "sm", children: s("effectiveFromLabel", { date: a.formatLongWithYear(n) }) })
9
+ function K() {
10
+ const { t: r } = h("Company.StateTaxes", { keyPrefix: "form" }), l = S(), { stateTaxRequirements: f } = y(), n = R(), o = f.requirementSets ?? [], i = o.map((e, c) => {
11
+ const { requirements: m, label: p, effectiveFrom: s, key: d } = e;
12
+ if (!d || !b(m ?? [])) return null;
13
+ const a = F(e, c, o);
14
+ return /* @__PURE__ */ u(q, { children: [
15
+ /* @__PURE__ */ u("div", { children: [
16
+ /* @__PURE__ */ t(n.Heading, { as: "h3", children: p }),
17
+ s && /* @__PURE__ */ t(n.Text, { size: "sm", children: r("effectiveFromLabel", { date: l.formatLongWithYear(s) }) })
18
18
  ] }),
19
- /* @__PURE__ */ e(h, { requirements: c, requirementSetKey: m })
20
- ] }, m);
19
+ /* @__PURE__ */ t(x, { requirements: m, requirementSetKey: a })
20
+ ] }, a);
21
21
  });
22
+ return i.every((e) => e === null) ? /* @__PURE__ */ t(n.Alert, { status: "info", label: r("noEditableRequirementsTitle"), children: r("noEditableRequirementsDescription") }) : i;
22
23
  }
23
24
  export {
24
- k as Form
25
+ K as Form
25
26
  };
26
27
  //# sourceMappingURL=Form.js.map