@gusto/embedded-react-sdk 0.48.0 → 0.48.2

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 (451) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/components/Common/DocumentList/DocumentList.js +12 -12
  3. package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
  4. package/dist/components/Common/DocumentList/DocumentList.module.scss.js +3 -5
  5. package/dist/components/Common/DocumentList/DocumentList.module.scss.js.map +1 -1
  6. package/dist/components/Common/EmptyData/EmptyData.d.ts +1 -1
  7. package/dist/components/Common/EmptyData/EmptyData.js +10 -12
  8. package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
  9. package/dist/components/Common/EmptyData/EmptyData.module.scss.js +6 -10
  10. package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
  11. package/dist/components/Common/Form/Form.d.ts +1 -1
  12. package/dist/components/Common/Form/Form.js +8 -7
  13. package/dist/components/Common/Form/Form.js.map +1 -1
  14. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayoutTypes.d.ts +1 -0
  15. package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +7 -3
  16. package/dist/components/Common/PayrollLoading/PayrollLoadingTypes.d.ts +1 -0
  17. package/dist/components/Common/UI/Alert/AlertTypes.d.ts +1 -0
  18. package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
  19. package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +1 -0
  20. package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
  21. package/dist/components/Common/UI/Banner/BannerTypes.d.ts +1 -0
  22. package/dist/components/Common/UI/Banner/BannerTypes.js.map +1 -1
  23. package/dist/components/Common/UI/Box/BoxTypes.d.ts +1 -0
  24. package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.d.ts +1 -0
  25. package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js.map +1 -1
  26. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +2 -0
  27. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -1
  28. package/dist/components/Common/UI/Button/ButtonTypes.d.ts +4 -2
  29. package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
  30. package/dist/components/Common/UI/CalendarPreview/CalendarPreviewTypes.d.ts +3 -2
  31. package/dist/components/Common/UI/Card/Card.js +8 -8
  32. package/dist/components/Common/UI/Card/Card.js.map +1 -1
  33. package/dist/components/Common/UI/Card/Card.module.scss.js +5 -3
  34. package/dist/components/Common/UI/Card/Card.module.scss.js.map +1 -1
  35. package/dist/components/Common/UI/Card/CardTypes.d.ts +1 -0
  36. package/dist/components/Common/UI/Checkbox/CheckboxTypes.d.ts +1 -0
  37. package/dist/components/Common/UI/Checkbox/CheckboxTypes.js.map +1 -1
  38. package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.d.ts +2 -0
  39. package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
  40. package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +2 -0
  41. package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +1 -0
  42. package/dist/components/Common/UI/DateRangePicker/DateRangePickerTypes.d.ts +2 -0
  43. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +2 -0
  44. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
  45. package/dist/components/Common/UI/Dialog/DialogTypes.d.ts +1 -0
  46. package/dist/components/Common/UI/Dialog/DialogTypes.js.map +1 -1
  47. package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +1 -0
  48. package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -1
  49. package/dist/components/Common/UI/Heading/HeadingTypes.d.ts +1 -0
  50. package/dist/components/Common/UI/Link/LinkTypes.d.ts +4 -3
  51. package/dist/components/Common/UI/List/ListTypes.d.ts +13 -4
  52. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.d.ts +1 -0
  53. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js.map +1 -1
  54. package/dist/components/Common/UI/Menu/MenuTypes.d.ts +2 -0
  55. package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
  56. package/dist/components/Common/UI/Modal/ModalTypes.d.ts +1 -0
  57. package/dist/components/Common/UI/Modal/ModalTypes.js.map +1 -1
  58. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +2 -0
  59. package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +1 -0
  60. package/dist/components/Common/UI/ProgressBar/ProgressBarTypes.d.ts +1 -0
  61. package/dist/components/Common/UI/Radio/RadioTypes.d.ts +1 -0
  62. package/dist/components/Common/UI/Radio/RadioTypes.js.map +1 -1
  63. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +2 -0
  64. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
  65. package/dist/components/Common/UI/Select/SelectTypes.d.ts +2 -0
  66. package/dist/components/Common/UI/Switch/SwitchTypes.d.ts +1 -0
  67. package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
  68. package/dist/components/Common/UI/Table/TableTypes.d.ts +3 -0
  69. package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
  70. package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +2 -0
  71. package/dist/components/Common/UI/Text/TextTypes.d.ts +1 -0
  72. package/dist/components/Common/UI/Text/TextTypes.js.map +1 -1
  73. package/dist/components/Common/UI/TextArea/TextAreaTypes.d.ts +1 -0
  74. package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -1
  75. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -0
  76. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  77. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
  78. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  79. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
  80. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  81. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
  82. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  83. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
  84. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  85. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  86. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  87. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
  88. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -9
  89. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  90. package/dist/components/Company/Industry/Context.js +8 -7
  91. package/dist/components/Company/Industry/Context.js.map +1 -1
  92. package/dist/components/Company/Industry/IndustrySelect.js +6 -8
  93. package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
  94. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
  95. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  96. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
  97. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  98. package/dist/components/Company/OnboardingOverview/context.js +5 -4
  99. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  100. package/dist/components/Company/PaySchedule/PayScheduleForm.js +3 -1
  101. package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
  102. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
  103. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
  104. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  105. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
  106. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  107. package/dist/components/Contractor/Address/useAddress.js +7 -6
  108. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  109. package/dist/components/Contractor/Profile/useContractorProfile.js +26 -27
  110. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  111. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +6 -6
  112. package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +10 -10
  113. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +1 -1
  114. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +2 -2
  115. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +25 -5
  116. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  117. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/index.d.ts +3 -0
  118. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  119. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  120. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +28 -5
  121. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +3 -1
  122. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  123. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/index.d.ts +3 -0
  124. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.d.ts +26 -5
  125. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +3 -1
  126. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
  127. package/dist/components/Employee/Documents/shared/SignatureForm/index.d.ts +3 -0
  128. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +2 -2
  129. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +1 -1
  130. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
  131. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
  132. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +6 -6
  133. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
  134. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
  135. package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -0
  136. package/dist/components/Employee/exports/employeeOnboarding.js +28 -22
  137. package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -1
  138. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +36 -2
  139. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  140. package/dist/components/InformationRequests/InformationRequestForm/index.d.ts +1 -1
  141. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +22 -2
  142. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  143. package/dist/components/InformationRequests/InformationRequestList/index.d.ts +1 -1
  144. package/dist/components/InformationRequests/InformationRequests.d.ts +29 -2
  145. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  146. package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +2 -0
  147. package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -1
  148. package/dist/components/InformationRequests/index.d.ts +3 -3
  149. package/dist/components/InformationRequests/informationRequestsStateMachine.d.ts +2 -0
  150. package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -1
  151. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +36 -3
  152. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +6 -2
  153. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  154. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +1 -0
  155. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
  156. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +14 -0
  157. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
  158. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +1 -8
  159. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +1 -2
  160. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  161. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +1 -1
  162. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +0 -1
  163. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
  164. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +11 -0
  165. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
  166. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -2
  167. package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +23 -0
  168. package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +18 -0
  169. package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
  170. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +15 -0
  171. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
  172. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +24 -0
  173. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
  174. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +7 -0
  175. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
  176. package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +2 -0
  177. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -1
  178. package/dist/components/Payroll/Dismissal/index.d.ts +1 -1
  179. package/dist/components/Payroll/GrossUpModal/GrossUpModal.d.ts +1 -0
  180. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
  181. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  182. package/dist/components/Payroll/GrossUpModal/GrossUpModalTypes.d.ts +5 -0
  183. package/dist/components/Payroll/GrossUpModal/index.d.ts +0 -1
  184. package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +31 -0
  185. package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
  186. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +20 -0
  187. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  188. package/dist/components/Payroll/OffCycle/offCycleStateMachine.d.ts +2 -0
  189. package/dist/components/Payroll/OffCycle/offCycleStateMachine.js.map +1 -1
  190. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +20 -0
  191. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  192. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -0
  193. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  194. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +24 -0
  195. package/dist/components/Payroll/OffCycleCreation/index.d.ts +1 -1
  196. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +16 -0
  197. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
  198. package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +13 -0
  199. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -0
  200. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  201. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +18 -1
  202. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
  203. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -1
  204. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +0 -1
  205. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
  206. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +15 -0
  207. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
  208. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +1 -0
  209. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  210. package/dist/components/Payroll/OffCycleReasonSelection/types.d.ts +43 -0
  211. package/dist/components/Payroll/OffCycleReasonSelection/types.js.map +1 -1
  212. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +1 -0
  213. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
  214. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts +5 -1
  215. package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +0 -1
  216. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +1 -0
  217. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -1
  218. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +14 -0
  219. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
  220. package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +0 -2
  221. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +3 -0
  222. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  223. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.d.ts +19 -5
  224. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  225. package/dist/components/Payroll/PayrollBlocker/index.d.ts +0 -1
  226. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +17 -11
  227. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +0 -2
  228. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  229. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +31 -3
  230. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +1 -2
  231. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  232. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -0
  233. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  234. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +2 -0
  235. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
  236. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -0
  237. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  238. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +42 -3
  239. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +1 -2
  240. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  241. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +3 -1
  242. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +0 -1
  243. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  244. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +8 -6
  245. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +0 -1
  246. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  247. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +65 -0
  248. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
  249. package/dist/components/Payroll/PayrollExecutionFlow/index.d.ts +0 -1
  250. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +2 -0
  251. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  252. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
  253. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -1
  254. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.d.ts +1 -0
  255. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
  256. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +38 -0
  257. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  258. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +27 -0
  259. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  260. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
  261. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -1
  262. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  263. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  264. package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +25 -1
  265. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +1 -2
  266. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  267. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +1 -0
  268. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  269. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +33 -4
  270. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +1 -2
  271. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  272. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +19 -0
  273. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  274. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +2 -0
  275. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
  276. package/dist/components/Payroll/PayrollList/PayrollList.d.ts +32 -13
  277. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  278. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -0
  279. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +65 -68
  280. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  281. package/dist/components/Payroll/PayrollList/types.d.ts +1 -0
  282. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +39 -3
  283. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +1 -2
  284. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  285. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -0
  286. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  287. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +1 -0
  288. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -1
  289. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +1 -0
  290. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  291. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +1 -0
  292. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -1
  293. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +26 -3
  294. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +2 -7
  295. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  296. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -0
  297. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  298. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +1 -0
  299. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js.map +1 -1
  300. package/dist/components/Payroll/PayrollStatusBadges/index.d.ts +0 -2
  301. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +26 -0
  302. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
  303. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.d.ts +2 -0
  304. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js.map +1 -1
  305. package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +21 -1
  306. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
  307. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +5 -0
  308. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -1
  309. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +1 -0
  310. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  311. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +1 -0
  312. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  313. package/dist/components/Payroll/RecoveryCases/index.d.ts +0 -1
  314. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +5 -0
  315. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -1
  316. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.d.ts +5 -0
  317. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  318. package/dist/components/Payroll/Transition/TransitionFlow.d.ts +21 -0
  319. package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
  320. package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +23 -0
  321. package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
  322. package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +2 -0
  323. package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -1
  324. package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +20 -0
  325. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
  326. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +7 -0
  327. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
  328. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +27 -0
  329. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -1
  330. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +1 -0
  331. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
  332. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +5 -0
  333. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
  334. package/dist/components/Payroll/helpers.d.ts +157 -26
  335. package/dist/components/Payroll/helpers.js +0 -1
  336. package/dist/components/Payroll/helpers.js.map +1 -1
  337. package/dist/components/Payroll/index.d.ts +11 -2
  338. package/dist/components/Payroll/payrollTypes.d.ts +24 -0
  339. package/dist/components/Payroll/payrollTypes.js.map +1 -1
  340. package/dist/components/Payroll/usePreparedPayrollData.d.ts +12 -0
  341. package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
  342. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  343. package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.d.ts +7 -0
  344. package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js.map +1 -1
  345. package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +19 -0
  346. package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -1
  347. package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +44 -0
  348. package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -1
  349. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.d.ts +4 -0
  350. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
  351. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +1 -0
  352. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
  353. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailTypes.d.ts +28 -2
  354. package/dist/components/TimeOff/HolidayPolicyDetail/index.d.ts +0 -2
  355. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.d.ts +26 -0
  356. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
  357. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +1 -0
  358. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
  359. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +10 -0
  360. package/dist/components/TimeOff/PolicyList/PolicyList.d.ts +25 -0
  361. package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
  362. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.d.ts +1 -0
  363. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
  364. package/dist/components/TimeOff/PolicyList/PolicyListTypes.d.ts +17 -0
  365. package/dist/components/TimeOff/PolicySettings/PolicySettings.d.ts +22 -0
  366. package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
  367. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +14 -0
  368. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
  369. package/dist/components/TimeOff/PolicySettings/PolicySettingsTypes.d.ts +31 -0
  370. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +23 -0
  371. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -1
  372. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +1 -0
  373. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
  374. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorTypes.d.ts +10 -0
  375. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.d.ts +42 -0
  376. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -1
  377. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +26 -0
  378. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  379. package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +15 -2
  380. package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js +1 -6
  381. package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js.map +1 -1
  382. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.d.ts +1 -0
  383. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
  384. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +29 -0
  385. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
  386. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -0
  387. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
  388. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +59 -1
  389. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/index.d.ts +0 -3
  390. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.d.ts +1 -0
  391. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
  392. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -0
  393. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +43 -42
  394. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
  395. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +2 -0
  396. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.d.ts +1 -0
  397. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
  398. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +3 -0
  399. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
  400. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +9 -0
  401. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
  402. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.d.ts +25 -0
  403. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
  404. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +14 -0
  405. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -1
  406. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailTypes.d.ts +97 -6
  407. package/dist/components/TimeOff/TimeOffPolicyDetail/index.d.ts +1 -5
  408. package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +23 -0
  409. package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js.map +1 -1
  410. package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.d.ts +22 -0
  411. package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.js.map +1 -1
  412. package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +22 -0
  413. package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js.map +1 -1
  414. package/dist/components/TimeOff/index.d.ts +8 -2
  415. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -0
  416. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +48 -49
  417. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
  418. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +66 -0
  419. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +1 -0
  420. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
  421. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayoutTypes.d.ts +28 -0
  422. package/dist/components/TimeOff/shared/PolicyDetailLayout/index.d.ts +0 -1
  423. package/dist/components/TimeOff/shared/holidayHelpers.d.ts +5 -0
  424. package/dist/components/TimeOff/shared/holidayHelpers.js.map +1 -1
  425. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +4 -4
  426. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +39 -39
  427. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  428. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +42 -42
  429. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  430. package/dist/i18n/en/common.json.d.ts +0 -1
  431. package/dist/i18n/en/common.json.js +2 -2
  432. package/dist/index.d.ts +1 -1
  433. package/dist/index.js +206 -205
  434. package/dist/node_modules/react-dnd/dist/core/DndProvider.js +1 -1
  435. package/dist/node_modules/react-dnd/dist/core/DndProvider.js.map +1 -1
  436. package/dist/partner-hook-utils/composeErrorHandler.js +3 -1
  437. package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
  438. package/dist/shared/constants.d.ts +12 -1
  439. package/dist/shared/constants.js.map +1 -1
  440. package/dist/style.css +1 -1
  441. package/dist/types/i18next.d.ts +0 -1
  442. package/docs/reference/endpoint-inventory.json +55 -0
  443. package/package.json +24 -11
  444. package/dist/assets/icons/feature-icon-check.svg.js +0 -10
  445. package/dist/assets/icons/feature-icon-check.svg.js.map +0 -1
  446. package/dist/assets/icons/magnifyingGlass.png.js +0 -5
  447. package/dist/assets/icons/magnifyingGlass.png.js.map +0 -1
  448. package/dist/components/Payroll/PayrollEditEmployee/index.d.ts +0 -4
  449. package/dist/components/Payroll/PayrollFlow/index.d.ts +0 -3
  450. package/dist/components/TimeOff/TimeOffFlow/index.d.ts +0 -3
  451. package/dist/components/TimeOff/shared/EmployeeTable/index.d.ts +0 -4
@@ -1,19 +1,36 @@
1
+ /** @internal */
1
2
  export interface PolicyListItem {
3
+ /** Stable identifier for the policy row (time-off policy UUID, or company UUID for the merged holiday entry). */
2
4
  uuid: string;
5
+ /** Display name of the policy. */
3
6
  name: string;
7
+ /** Policy type string from the time-off API (e.g. sick, vacation), or `'holiday'` for the merged holiday entry. */
4
8
  policyType: string;
9
+ /** Whether the policy has finished setup. Incomplete entries show a finish-setup action. */
5
10
  isComplete: boolean;
11
+ /** Pre-formatted enrolled-employees label (e.g. "All employees", "3 employees", or a dash). */
6
12
  enrolledDisplay: string;
13
+ /** True for the merged holiday pay policy entry; controls the delete-confirmation copy. */
7
14
  isHoliday?: boolean;
8
15
  }
16
+ /** @internal */
9
17
  export interface PolicyListPresentationProps {
18
+ /** The list of policies to render, including the optional merged holiday entry. */
10
19
  policies: PolicyListItem[];
20
+ /** Invoked when the user clicks the create-policy action. */
11
21
  onCreatePolicy: () => void;
22
+ /** Invoked when the user opens an existing policy from the row menu. */
12
23
  onEditPolicy: (policy: PolicyListItem) => void;
24
+ /** Invoked when the user clicks the finish-setup action on an incomplete policy. */
13
25
  onFinishSetup: (policy: PolicyListItem) => void;
26
+ /** Invoked when the user confirms deletion; resolves to true on success so the dialog can close. */
14
27
  onDeletePolicy: (policy: PolicyListItem) => Promise<boolean>;
28
+ /** Optional success message rendered as a dismissible alert after a delete. */
15
29
  deleteSuccessAlert?: string | null;
30
+ /** Invoked when the user dismisses the delete success alert. */
16
31
  onDismissDeleteAlert?: () => void;
32
+ /** UUID of the policy currently being deleted; used to show a per-row loading state. */
17
33
  isDeletingPolicyId?: string | null;
34
+ /** True while any mutation is in flight; drives the dialog confirm button's loading state. */
18
35
  isPending?: boolean;
19
36
  }
@@ -1,6 +1,28 @@
1
1
  import { BaseComponentInterface } from '../../Base';
2
+ /**
3
+ * Props for {@link PolicySettings}.
4
+ *
5
+ * @public
6
+ */
2
7
  export interface PolicySettingsProps extends BaseComponentInterface {
8
+ /** UUID of the time off policy being configured. */
3
9
  policyId: string;
10
+ /** Whether the form is being used to create a new policy or edit an existing one. Defaults to create. */
4
11
  mode?: 'create' | 'edit';
5
12
  }
13
+ /**
14
+ * Configures additional policy limits and rules for a sick or vacation policy. This step is skipped for policies with unlimited accrual.
15
+ *
16
+ * @remarks
17
+ * Fetches the time off policy, derives the accrual method category, and submits updates to the time off policies endpoint. Emits the following events:
18
+ *
19
+ * | Event | Description | Data |
20
+ * | ----- | ----------- | ---- |
21
+ * | `timeOff/policySettings/done` | Fired when policy settings are saved | The updated `TimeOffPolicy` |
22
+ * | `timeOff/policySettings/back` | Fired when the user navigates back | — |
23
+ *
24
+ * @param props - {@link PolicySettingsProps}
25
+ * @returns The rendered policy settings form.
26
+ * @public
27
+ */
6
28
  export declare function PolicySettings(props: PolicySettingsProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"PolicySettings.js","sources":["../../../../src/components/TimeOff/PolicySettings/PolicySettings.tsx"],"sourcesContent":["import { useTimeOffPoliciesGetSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/timeOffPoliciesGet'\nimport { useTimeOffPoliciesUpdateMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/timeOffPoliciesUpdate'\nimport type { PutV1TimeOffPoliciesTimeOffPolicyUuidRequestBody } from '@gusto/embedded-api-v-2025-11-15/models/operations/putv1timeoffpoliciestimeoffpolicyuuid'\nimport type { TimeOffPolicy } from '@gusto/embedded-api-v-2025-11-15/models/components/timeoffpolicy'\nimport { UnprocessableEntityError } from '@gusto/embedded-api-v-2025-11-15/models/errors/unprocessableentityerror'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { useTranslation } from 'react-i18next'\nimport { PolicySettingsPresentation } from './PolicySettingsPresentation'\nimport type { PolicySettingsFormData, PolicySettingsAccrualMethod } from './PolicySettingsTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n'\n\nexport interface PolicySettingsProps extends BaseComponentInterface {\n policyId: string\n mode?: 'create' | 'edit'\n}\n\nexport function PolicySettings(props: PolicySettingsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nconst HOURLY_ACCRUAL_METHODS = [\n 'per_hour_worked',\n 'per_hour_worked_no_overtime',\n 'per_hour_paid',\n 'per_hour_paid_no_overtime',\n]\n\nconst ALL_AT_ONCE_ACCRUAL_METHODS = ['per_anniversary_year', 'per_calendar_year']\n\nfunction deriveAccrualMethodCategory(apiAccrualMethod: string): PolicySettingsAccrualMethod {\n if (HOURLY_ACCRUAL_METHODS.includes(apiAccrualMethod)) return 'hours_worked'\n if (ALL_AT_ONCE_ACCRUAL_METHODS.includes(apiAccrualMethod)) return 'fixed_all_at_once'\n return 'fixed_per_pay_period'\n}\n\nfunction deriveDefaultValues(policy: TimeOffPolicy): Partial<PolicySettingsFormData> {\n const defaults: Partial<PolicySettingsFormData> = {}\n\n if (policy.maxAccrualHoursPerYear != null) {\n defaults.accrualMaximumEnabled = true\n defaults.accrualMaximum = Number(policy.maxAccrualHoursPerYear)\n }\n\n if (policy.maxHours != null) {\n defaults.balanceMaximumEnabled = true\n defaults.balanceMaximum = Number(policy.maxHours)\n }\n\n if (policy.carryoverLimitHours != null) {\n defaults.carryOverLimitEnabled = true\n defaults.carryOverLimit = Number(policy.carryoverLimitHours)\n }\n\n if (policy.accrualWaitingPeriodDays != null && policy.accrualWaitingPeriodDays > 0) {\n defaults.waitingPeriodEnabled = true\n defaults.waitingPeriod = policy.accrualWaitingPeriodDays\n }\n\n if (policy.paidOutOnTermination != null) {\n defaults.paidOutOnTermination = policy.paidOutOnTermination\n }\n\n return defaults\n}\n\nfunction buildUpdateRequestBody(\n data: PolicySettingsFormData,\n version: string,\n accrualCategory: PolicySettingsAccrualMethod,\n): PutV1TimeOffPoliciesTimeOffPolicyUuidRequestBody {\n const isAllAtOnce = accrualCategory === 'fixed_all_at_once'\n\n return {\n maxAccrualHoursPerYear:\n !isAllAtOnce && data.accrualMaximumEnabled && data.accrualMaximum != null\n ? String(data.accrualMaximum)\n : null,\n maxHours:\n data.balanceMaximumEnabled && data.balanceMaximum != null\n ? String(data.balanceMaximum)\n : null,\n carryoverLimitHours:\n data.carryOverLimitEnabled && data.carryOverLimit != null\n ? String(data.carryOverLimit)\n : null,\n accrualWaitingPeriodDays:\n !isAllAtOnce && data.waitingPeriodEnabled && data.waitingPeriod != null\n ? data.waitingPeriod\n : null,\n paidOutOnTermination: data.paidOutOnTermination,\n version,\n }\n}\n\nfunction Root({ policyId, mode }: PolicySettingsProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n\n const { data: policyResponse } = useTimeOffPoliciesGetSuspense({\n timeOffPolicyUuid: policyId,\n })\n\n const { mutateAsync: updateTimeOffPolicy, isPending } = useTimeOffPoliciesUpdateMutation()\n\n const policy = policyResponse.timeOffPolicy\n if (!policy) throw new Error('Unexpected response: missing timeOffPolicy')\n\n const accrualCategory = deriveAccrualMethodCategory(policy.accrualMethod)\n const version = policy.version ?? ''\n\n const handleContinue = async (data: PolicySettingsFormData) => {\n await baseSubmitHandler(data, async () => {\n try {\n const { timeOffPolicy } = await updateTimeOffPolicy({\n request: {\n timeOffPolicyUuid: policyId,\n requestBody: buildUpdateRequestBody(data, version, accrualCategory),\n },\n })\n\n void queryClient.invalidateQueries({\n queryKey: ['@gusto/embedded-api-v-2025-11-15', 'timeOffPolicies', 'get'],\n })\n onEvent(componentEvents.TIME_OFF_POLICY_SETTINGS_DONE, timeOffPolicy)\n } catch (err) {\n if (err instanceof UnprocessableEntityError) {\n if (err.errors.some(e => e.message === 'LIMIT_VIOLATION_MAX_HOURS')) {\n throw new SDKInternalError(\n t('policySettings.errors.balanceExceedsMaximum'),\n 'api_error',\n )\n }\n const uniqueMessages = [...new Set(err.errors.map(e => e.message).filter(Boolean))]\n throw new SDKInternalError(\n t('errors.updatePolicySettingsFailed', {\n details: uniqueMessages.join('. '),\n }),\n 'api_error',\n )\n }\n throw err\n }\n })\n }\n\n const handleBack = () => {\n onEvent(componentEvents.TIME_OFF_POLICY_SETTINGS_BACK)\n }\n\n return (\n <PolicySettingsPresentation\n accrualMethod={accrualCategory}\n onContinue={handleContinue}\n onBack={handleBack}\n defaultValues={deriveDefaultValues(policy)}\n mode={mode}\n editingPolicyName={mode === 'edit' ? policy.name : undefined}\n isPending={isPending}\n />\n )\n}\n"],"names":["PolicySettings","props","jsx","BaseComponent","Root","HOURLY_ACCRUAL_METHODS","ALL_AT_ONCE_ACCRUAL_METHODS","deriveAccrualMethodCategory","apiAccrualMethod","deriveDefaultValues","policy","defaults","buildUpdateRequestBody","data","version","accrualCategory","isAllAtOnce","policyId","mode","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","policyResponse","useTimeOffPoliciesGetSuspense","updateTimeOffPolicy","isPending","useTimeOffPoliciesUpdateMutation","PolicySettingsPresentation","timeOffPolicy","componentEvents","err","UnprocessableEntityError","e","SDKInternalError","uniqueMessages"],"mappings":";;;;;;;;;;;;AAoBO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,MAAMI,IAAyB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAA8B,CAAC,wBAAwB,mBAAmB;AAEhF,SAASC,EAA4BC,GA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UACR;AAAA,QACF,CAAC;AAAA,MACH;AAAA,MAUI,QARe,MAAM;AACvB,QAAAb,EAAQY,EAAgB,6BAA6B;AAAA,MACvD;AAAA,MAOI,eAAezB,EAAoBC,CAAM;AAAA,MACzC,MAAAQ;AAAA,MACA,mBAAmBA,MAAS,SAASR,EAAO,OAAO;AAAA,MACnD,WAAAoB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PolicySettings.js","sources":["../../../../src/components/TimeOff/PolicySettings/PolicySettings.tsx"],"sourcesContent":["import { useTimeOffPoliciesGetSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/timeOffPoliciesGet'\nimport { useTimeOffPoliciesUpdateMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/timeOffPoliciesUpdate'\nimport type { PutV1TimeOffPoliciesTimeOffPolicyUuidRequestBody } from '@gusto/embedded-api-v-2025-11-15/models/operations/putv1timeoffpoliciestimeoffpolicyuuid'\nimport type { TimeOffPolicy } from '@gusto/embedded-api-v-2025-11-15/models/components/timeoffpolicy'\nimport { UnprocessableEntityError } from '@gusto/embedded-api-v-2025-11-15/models/errors/unprocessableentityerror'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { useTranslation } from 'react-i18next'\nimport { PolicySettingsPresentation } from './PolicySettingsPresentation'\nimport type { PolicySettingsFormData, PolicySettingsAccrualMethod } from './PolicySettingsTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n'\n\n/**\n * Props for {@link PolicySettings}.\n *\n * @public\n */\nexport interface PolicySettingsProps extends BaseComponentInterface {\n /** UUID of the time off policy being configured. */\n policyId: string\n /** Whether the form is being used to create a new policy or edit an existing one. Defaults to create. */\n mode?: 'create' | 'edit'\n}\n\n/**\n * Configures additional policy limits and rules for a sick or vacation policy. This step is skipped for policies with unlimited accrual.\n *\n * @remarks\n * Fetches the time off policy, derives the accrual method category, and submits updates to the time off policies endpoint. Emits the following events:\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `timeOff/policySettings/done` | Fired when policy settings are saved | The updated `TimeOffPolicy` |\n * | `timeOff/policySettings/back` | Fired when the user navigates back | — |\n *\n * @param props - {@link PolicySettingsProps}\n * @returns The rendered policy settings form.\n * @public\n */\nexport function PolicySettings(props: PolicySettingsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nconst HOURLY_ACCRUAL_METHODS = [\n 'per_hour_worked',\n 'per_hour_worked_no_overtime',\n 'per_hour_paid',\n 'per_hour_paid_no_overtime',\n]\n\nconst ALL_AT_ONCE_ACCRUAL_METHODS = ['per_anniversary_year', 'per_calendar_year']\n\nfunction deriveAccrualMethodCategory(apiAccrualMethod: string): PolicySettingsAccrualMethod {\n if (HOURLY_ACCRUAL_METHODS.includes(apiAccrualMethod)) return 'hours_worked'\n if (ALL_AT_ONCE_ACCRUAL_METHODS.includes(apiAccrualMethod)) return 'fixed_all_at_once'\n return 'fixed_per_pay_period'\n}\n\nfunction deriveDefaultValues(policy: TimeOffPolicy): Partial<PolicySettingsFormData> {\n const defaults: Partial<PolicySettingsFormData> = {}\n\n if (policy.maxAccrualHoursPerYear != null) {\n defaults.accrualMaximumEnabled = true\n defaults.accrualMaximum = Number(policy.maxAccrualHoursPerYear)\n }\n\n if (policy.maxHours != null) {\n defaults.balanceMaximumEnabled = true\n defaults.balanceMaximum = Number(policy.maxHours)\n }\n\n if (policy.carryoverLimitHours != null) {\n defaults.carryOverLimitEnabled = true\n defaults.carryOverLimit = Number(policy.carryoverLimitHours)\n }\n\n if (policy.accrualWaitingPeriodDays != null && policy.accrualWaitingPeriodDays > 0) {\n defaults.waitingPeriodEnabled = true\n defaults.waitingPeriod = policy.accrualWaitingPeriodDays\n }\n\n if (policy.paidOutOnTermination != null) {\n defaults.paidOutOnTermination = policy.paidOutOnTermination\n }\n\n return defaults\n}\n\nfunction buildUpdateRequestBody(\n data: PolicySettingsFormData,\n version: string,\n accrualCategory: PolicySettingsAccrualMethod,\n): PutV1TimeOffPoliciesTimeOffPolicyUuidRequestBody {\n const isAllAtOnce = accrualCategory === 'fixed_all_at_once'\n\n return {\n maxAccrualHoursPerYear:\n !isAllAtOnce && data.accrualMaximumEnabled && data.accrualMaximum != null\n ? String(data.accrualMaximum)\n : null,\n maxHours:\n data.balanceMaximumEnabled && data.balanceMaximum != null\n ? String(data.balanceMaximum)\n : null,\n carryoverLimitHours:\n data.carryOverLimitEnabled && data.carryOverLimit != null\n ? String(data.carryOverLimit)\n : null,\n accrualWaitingPeriodDays:\n !isAllAtOnce && data.waitingPeriodEnabled && data.waitingPeriod != null\n ? data.waitingPeriod\n : null,\n paidOutOnTermination: data.paidOutOnTermination,\n version,\n }\n}\n\nfunction Root({ policyId, mode }: PolicySettingsProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n\n const { data: policyResponse } = useTimeOffPoliciesGetSuspense({\n timeOffPolicyUuid: policyId,\n })\n\n const { mutateAsync: updateTimeOffPolicy, isPending } = useTimeOffPoliciesUpdateMutation()\n\n const policy = policyResponse.timeOffPolicy\n if (!policy) throw new Error('Unexpected response: missing timeOffPolicy')\n\n const accrualCategory = deriveAccrualMethodCategory(policy.accrualMethod)\n const version = policy.version ?? ''\n\n const handleContinue = async (data: PolicySettingsFormData) => {\n await baseSubmitHandler(data, async () => {\n try {\n const { timeOffPolicy } = await updateTimeOffPolicy({\n request: {\n timeOffPolicyUuid: policyId,\n requestBody: buildUpdateRequestBody(data, version, accrualCategory),\n },\n })\n\n void queryClient.invalidateQueries({\n queryKey: ['@gusto/embedded-api-v-2025-11-15', 'timeOffPolicies', 'get'],\n })\n onEvent(componentEvents.TIME_OFF_POLICY_SETTINGS_DONE, timeOffPolicy)\n } catch (err) {\n if (err instanceof UnprocessableEntityError) {\n if (err.errors.some(e => e.message === 'LIMIT_VIOLATION_MAX_HOURS')) {\n throw new SDKInternalError(\n t('policySettings.errors.balanceExceedsMaximum'),\n 'api_error',\n )\n }\n const uniqueMessages = [...new Set(err.errors.map(e => e.message).filter(Boolean))]\n throw new SDKInternalError(\n t('errors.updatePolicySettingsFailed', {\n details: uniqueMessages.join('. '),\n }),\n 'api_error',\n )\n }\n throw err\n }\n })\n }\n\n const handleBack = () => {\n onEvent(componentEvents.TIME_OFF_POLICY_SETTINGS_BACK)\n }\n\n return (\n <PolicySettingsPresentation\n accrualMethod={accrualCategory}\n onContinue={handleContinue}\n onBack={handleBack}\n defaultValues={deriveDefaultValues(policy)}\n mode={mode}\n editingPolicyName={mode === 'edit' ? policy.name : undefined}\n isPending={isPending}\n />\n )\n}\n"],"names":["PolicySettings","props","jsx","BaseComponent","Root","HOURLY_ACCRUAL_METHODS","ALL_AT_ONCE_ACCRUAL_METHODS","deriveAccrualMethodCategory","apiAccrualMethod","deriveDefaultValues","policy","defaults","buildUpdateRequestBody","data","version","accrualCategory","isAllAtOnce","policyId","mode","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","policyResponse","useTimeOffPoliciesGetSuspense","updateTimeOffPolicy","isPending","useTimeOffPoliciesUpdateMutation","PolicySettingsPresentation","timeOffPolicy","componentEvents","err","UnprocessableEntityError","e","SDKInternalError","uniqueMessages"],"mappings":";;;;;;;;;;;;AA0CO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,MAAMI,IAAyB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAA8B,CAAC,wBAAwB,mBAAmB;AAEhF,SAASC,EAA4BC,GAAuD;AAC1F,SAAIH,EAAuB,SAASG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;AAAA,MAUI,QARe,MAAM;AACvB,QAAAb,EAAQY,EAAgB,6BAA6B;AAAA,MACvD;AAAA,MAOI,eAAezB,EAAoBC,CAAM;AAAA,MACzC,MAAAQ;AAAA,MACA,mBAAmBA,MAAS,SAASR,EAAO,OAAO;AAAA,MACnD,WAAAoB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,16 @@
1
1
  import { PolicySettingsPresentationProps } from './PolicySettingsTypes';
2
+ /**
3
+ * Presentation-only form for configuring time off policy limits and rules.
4
+ *
5
+ * @remarks
6
+ * Use this component when you need to render the policy settings form without the data-fetching container — provide the `accrualMethod` and handle submission yourself. For the data-connected version, use {@link PolicySettings}.
7
+ *
8
+ * The fields shown depend on `accrualMethod`:
9
+ * - Accrual maximum and waiting period are shown for `'hours_worked'` and `'fixed_per_pay_period'`
10
+ * - Balance maximum, carry-over limit, and paid-out-on-termination are always shown
11
+ *
12
+ * @param props - {@link PolicySettingsPresentationProps}
13
+ * @returns The rendered policy settings form.
14
+ * @public
15
+ */
2
16
  export declare function PolicySettingsPresentation({ accrualMethod, onContinue, onBack, defaultValues, mode, editingPolicyName, isPending, }: PolicySettingsPresentationProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"PolicySettingsPresentation.js","sources":["../../../../src/components/TimeOff/PolicySettings/PolicySettingsPresentation.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { PolicySettingsFormData, PolicySettingsPresentationProps } from './PolicySettingsTypes'\nimport styles from './PolicySettings.module.scss'\nimport { Flex, ActionsLayout, NumberInputField, SwitchField } from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nconst PolicySettingsSchema = z.object({\n accrualMaximumEnabled: z.boolean(),\n accrualMaximum: z.number().optional(),\n balanceMaximumEnabled: z.boolean(),\n balanceMaximum: z.number().optional(),\n carryOverLimitEnabled: z.boolean(),\n carryOverLimit: z.number().optional(),\n waitingPeriodEnabled: z.boolean(),\n waitingPeriod: z.number().int().optional(),\n paidOutOnTermination: z.boolean(),\n})\n\nexport function PolicySettingsPresentation({\n accrualMethod,\n onContinue,\n onBack,\n defaultValues,\n mode,\n editingPolicyName,\n isPending = false,\n}: PolicySettingsPresentationProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { Heading, Button } = useComponentContext()\n const headingId = useId()\n\n const accrualMaxInputId = useId()\n const balanceMaxInputId = useId()\n const carryOverInputId = useId()\n const waitingPeriodInputId = useId()\n\n const formMethods = useForm<PolicySettingsFormData>({\n resolver: zodResolver(PolicySettingsSchema),\n defaultValues: {\n accrualMaximumEnabled: false,\n balanceMaximumEnabled: false,\n carryOverLimitEnabled: false,\n waitingPeriodEnabled: false,\n paidOutOnTermination: false,\n ...defaultValues,\n },\n })\n\n const { control } = formMethods\n const accrualMaximumEnabled = useWatch({ control, name: 'accrualMaximumEnabled' })\n const balanceMaximumEnabled = useWatch({ control, name: 'balanceMaximumEnabled' })\n const carryOverLimitEnabled = useWatch({ control, name: 'carryOverLimitEnabled' })\n const waitingPeriodEnabled = useWatch({ control, name: 'waitingPeriodEnabled' })\n\n const isHoursWorked = accrualMethod === 'hours_worked'\n const isFixedPerPayPeriod = accrualMethod === 'fixed_per_pay_period'\n const showAccrualMaximum = isHoursWorked || isFixedPerPayPeriod\n const showWaitingPeriod = isHoursWorked || isFixedPerPayPeriod\n\n const handleSubmit = (data: PolicySettingsFormData) => {\n onContinue(data)\n }\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm aria-labelledby={headingId} onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <div className={styles.policySettings}>\n <Flex flexDirection=\"column\" gap={32}>\n <Heading as=\"h2\" id={headingId}>\n {mode === 'edit' && editingPolicyName\n ? t('policySettings.editTitle', { name: editingPolicyName })\n : t('policySettings.createTitle')}\n </Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {showAccrualMaximum && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={accrualMaxInputId}\n name=\"accrualMaximum\"\n label={t('policySettings.accrualMaximumLabel')}\n description={t('policySettings.accrualMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!accrualMaximumEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"accrualMaximumEnabled\"\n label={t('policySettings.accrualMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={accrualMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={balanceMaxInputId}\n name=\"balanceMaximum\"\n label={t('policySettings.balanceMaximumLabel')}\n description={t('policySettings.balanceMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!balanceMaximumEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"balanceMaximumEnabled\"\n label={t('policySettings.balanceMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={balanceMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={carryOverInputId}\n name=\"carryOverLimit\"\n label={t('policySettings.carryOverLimitLabel')}\n description={t('policySettings.carryOverLimitHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!carryOverLimitEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"carryOverLimitEnabled\"\n label={t('policySettings.carryOverLimitLabel')}\n shouldVisuallyHideLabel\n aria-controls={carryOverInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n {showWaitingPeriod && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={waitingPeriodInputId}\n name=\"waitingPeriod\"\n label={t('policySettings.waitingPeriodLabel')}\n description={t('policySettings.waitingPeriodHint')}\n adornmentEnd={t('policySettings.daysUnit')}\n placeholder={t('policySettings.numberOfDaysPlaceholder')}\n isDisabled={!waitingPeriodEnabled}\n min={0}\n max={20000}\n maximumFractionDigits={0}\n errorMessage={t('policySettings.errors.waitingPeriodMustBeWholeNumber')}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"waitingPeriodEnabled\"\n label={t('policySettings.waitingPeriodLabel')}\n shouldVisuallyHideLabel\n aria-controls={waitingPeriodInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <SwitchField\n name=\"paidOutOnTermination\"\n label={t('policySettings.paidOutOnTerminationLabel')}\n description={t('policySettings.paidOutOnTerminationHint')}\n />\n\n <hr className={styles.divider} />\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onBack} isDisabled={isPending}>\n {t('backCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\" isLoading={isPending}>\n {t('policySettings.continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n </div>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicySettingsSchema","z","PolicySettingsPresentation","accrualMethod","onContinue","onBack","defaultValues","mode","editingPolicyName","isPending","useI18n","t","useTranslation","Heading","Button","useComponentContext","headingId","useId","accrualMaxInputId","balanceMaxInputId","carryOverInputId","waitingPeriodInputId","formMethods","useForm","zodResolver","control","accrualMaximumEnabled","useWatch","balanceMaximumEnabled","carryOverLimitEnabled","waitingPeriodEnabled","isHoursWorked","isFixedPerPayPeriod","showAccrualMaximum","showWaitingPeriod","handleSubmit","data","jsx","FormProvider","HtmlForm","styles","Flex","jsxs","Fragment","NumberInputField","SwitchField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;AAYA,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EACpC,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,sBAAsBA,EAAE,QAAA;AAAA,EACxB,eAAeA,EAAE,OAAA,EAAS,IAAA,EAAM,SAAA;AAAA,EAChC,sBAAsBA,EAAE,QAAA;AAC1B,CAAC;AAEM,SAASC,GAA2B;AAAA,EACzC,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,MAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAAoC;AAClC,EAAAC,EAAQ,qCAAqC;AAC7C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qCAAqC,GAC5D,EAAE,SAAAC,GAAS,QAAAC,EAAA,IAAWC,EAAA,GACtBC,IAAYC,EAAA,GAEZC,IAAoBD,EAAA,GACpBE,IAAoBF,EAAA,GACpBG,IAAmBH,EAAA,GACnBI,IAAuBJ,EAAA,GAEvBK,IAAcC,EAAgC;AAAA,IAClD,UAAUC,EAAYxB,CAAoB;AAAA,IAC1C,eAAe;AAAA,MACb,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,MACvB,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB,GAAGM;AAAA,IAAA;AAAA,EACL,CACD,GAEK,EAAE,SAAAmB,MAAYH,GACdI,IAAwBC,EAAS,EAAE,SAAAF,GAAS,MAAM,y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AEA,gBAAAgB,EAAC,MAAA,EAAG,WAAWG,EAAO,QAAA,CAAS;AAAA,MAAA,GACjC;AAAA,MAGF,gBAAAH;AAAA,QAACQ;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOlC,EAAE,0CAA0C;AAAA,UACnD,aAAaA,EAAE,yCAAyC;AAAA,QAAA;AAAA,MAAA;AAAA,MAG1D,gBAAA0B,EAAC,MAAA,EAAG,WAAWG,EAAO,QAAA,CAAS;AAAA,wBAE9BM,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAT,EAACvB,GAAA,EAAO,SAAQ,aAAY,SAAST,GAAQ,YAAYI,GACtD,UAAAE,EAAE,SAAS,EAAA,CACd;AAAA,QACA,gBAAA0B,EAACvB,GAAA,EAAO,SAAQ,WAAU,MAAK,UAAS,WAAWL,GAChD,UAAAE,EAAE,4BAA4B,EAAA,CACjC;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"PolicySettingsPresentation.js","sources":["../../../../src/components/TimeOff/PolicySettings/PolicySettingsPresentation.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { PolicySettingsFormData, PolicySettingsPresentationProps } from './PolicySettingsTypes'\nimport styles from './PolicySettings.module.scss'\nimport { Flex, ActionsLayout, NumberInputField, SwitchField } from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nconst PolicySettingsSchema = z.object({\n accrualMaximumEnabled: z.boolean(),\n accrualMaximum: z.number().optional(),\n balanceMaximumEnabled: z.boolean(),\n balanceMaximum: z.number().optional(),\n carryOverLimitEnabled: z.boolean(),\n carryOverLimit: z.number().optional(),\n waitingPeriodEnabled: z.boolean(),\n waitingPeriod: z.number().int().optional(),\n paidOutOnTermination: z.boolean(),\n})\n\n/**\n * Presentation-only form for configuring time off policy limits and rules.\n *\n * @remarks\n * Use this component when you need to render the policy settings form without the data-fetching container — provide the `accrualMethod` and handle submission yourself. For the data-connected version, use {@link PolicySettings}.\n *\n * The fields shown depend on `accrualMethod`:\n * - Accrual maximum and waiting period are shown for `'hours_worked'` and `'fixed_per_pay_period'`\n * - Balance maximum, carry-over limit, and paid-out-on-termination are always shown\n *\n * @param props - {@link PolicySettingsPresentationProps}\n * @returns The rendered policy settings form.\n * @public\n */\nexport function PolicySettingsPresentation({\n accrualMethod,\n onContinue,\n onBack,\n defaultValues,\n mode,\n editingPolicyName,\n isPending = false,\n}: PolicySettingsPresentationProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { Heading, Button } = useComponentContext()\n const headingId = useId()\n\n const accrualMaxInputId = useId()\n const balanceMaxInputId = useId()\n const carryOverInputId = useId()\n const waitingPeriodInputId = useId()\n\n const formMethods = useForm<PolicySettingsFormData>({\n resolver: zodResolver(PolicySettingsSchema),\n defaultValues: {\n accrualMaximumEnabled: false,\n balanceMaximumEnabled: false,\n carryOverLimitEnabled: false,\n waitingPeriodEnabled: false,\n paidOutOnTermination: false,\n ...defaultValues,\n },\n })\n\n const { control } = formMethods\n const accrualMaximumEnabled = useWatch({ control, name: 'accrualMaximumEnabled' })\n const balanceMaximumEnabled = useWatch({ control, name: 'balanceMaximumEnabled' })\n const carryOverLimitEnabled = useWatch({ control, name: 'carryOverLimitEnabled' })\n const waitingPeriodEnabled = useWatch({ control, name: 'waitingPeriodEnabled' })\n\n const isHoursWorked = accrualMethod === 'hours_worked'\n const isFixedPerPayPeriod = accrualMethod === 'fixed_per_pay_period'\n const showAccrualMaximum = isHoursWorked || isFixedPerPayPeriod\n const showWaitingPeriod = isHoursWorked || isFixedPerPayPeriod\n\n const handleSubmit = (data: PolicySettingsFormData) => {\n onContinue(data)\n }\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm aria-labelledby={headingId} onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <div className={styles.policySettings}>\n <Flex flexDirection=\"column\" gap={32}>\n <Heading as=\"h2\" id={headingId}>\n {mode === 'edit' && editingPolicyName\n ? t('policySettings.editTitle', { name: editingPolicyName })\n : t('policySettings.createTitle')}\n </Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {showAccrualMaximum && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={accrualMaxInputId}\n name=\"accrualMaximum\"\n label={t('policySettings.accrualMaximumLabel')}\n description={t('policySettings.accrualMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!accrualMaximumEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"accrualMaximumEnabled\"\n label={t('policySettings.accrualMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={accrualMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={balanceMaxInputId}\n name=\"balanceMaximum\"\n label={t('policySettings.balanceMaximumLabel')}\n description={t('policySettings.balanceMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!balanceMaximumEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"balanceMaximumEnabled\"\n label={t('policySettings.balanceMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={balanceMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={carryOverInputId}\n name=\"carryOverLimit\"\n label={t('policySettings.carryOverLimitLabel')}\n description={t('policySettings.carryOverLimitHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!carryOverLimitEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"carryOverLimitEnabled\"\n label={t('policySettings.carryOverLimitLabel')}\n shouldVisuallyHideLabel\n aria-controls={carryOverInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n {showWaitingPeriod && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={waitingPeriodInputId}\n name=\"waitingPeriod\"\n label={t('policySettings.waitingPeriodLabel')}\n description={t('policySettings.waitingPeriodHint')}\n adornmentEnd={t('policySettings.daysUnit')}\n placeholder={t('policySettings.numberOfDaysPlaceholder')}\n isDisabled={!waitingPeriodEnabled}\n min={0}\n max={20000}\n maximumFractionDigits={0}\n errorMessage={t('policySettings.errors.waitingPeriodMustBeWholeNumber')}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"waitingPeriodEnabled\"\n label={t('policySettings.waitingPeriodLabel')}\n shouldVisuallyHideLabel\n aria-controls={waitingPeriodInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <SwitchField\n name=\"paidOutOnTermination\"\n label={t('policySettings.paidOutOnTerminationLabel')}\n description={t('policySettings.paidOutOnTerminationHint')}\n />\n\n <hr className={styles.divider} />\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onBack} isDisabled={isPending}>\n {t('backCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\" isLoading={isPending}>\n {t('policySettings.continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n </div>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicySettingsSchema","z","PolicySettingsPresentation","accrualMethod","onContinue","onBack","defaultValues","mode","editingPolicyName","isPending","useI18n","t","useTranslation","Heading","Button","useComponentContext","headingId","useId","accrualMaxInputId","balanceMaxInputId","carryOverInputId","waitingPeriodInputId","formMethods","useForm","zodResolver","control","accrualMaximumEnabled","useWatch","balanceMaximumEnabled","carryOverLimitEnabled","waitingPeriodEnabled","isHoursWorked","isFixedPerPayPeriod","showAccrualMaximum","showWaitingPeriod","handleSubmit","data","jsx","FormProvider","HtmlForm","styles","Flex","jsxs","Fragment","NumberInputField","SwitchField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;AAYA,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EACpC,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,sBAAsBA,EAAE,QAAA;AAAA,EACxB,eAAeA,EAAE,OAAA,EAAS,IAAA,EAAM,SAAA;AAAA,EAChC,sBAAsBA,EAAE,QAAA;AAC1B,CAAC;AAgBM,SAASC,GAA2B;AAAA,EACzC,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,MAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAAoC;AAClC,EAAAC,EAAQ,qCAAqC;AAC7C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qCAAqC,GAC5D,EAAE,SAAAC,GAAS,QAAAC,EAAA,IAAWC,EAAA,GACtBC,IAAYC,EAAA,GAEZC,IAAoBD,EAAA,GACpBE,IAAoBF,EAAA,GACpBG,IAAmBH,EAAA,GACnBI,IAAuBJ,EAAA,GAEvBK,IAAcC,EAAgC;AAAA,IAClD,UAAUC,EAAYxB,CAAoB;AAAA,IAC1C,eAAe;AAAA,MACb,uBAAuB;AAAA,MACvB,u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AAA,gBAAAH;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAOlC,EAAE,mCAAmC;AAAA,cAC5C,yBAAuB;AAAA,cACvB,iBAAeU;AAAA,YAAA;AAAA,UAAA,EACjB,CACF;AAAA,QAAA,GACF;AAAA,QAEA,gBAAAgB,EAAC,MAAA,EAAG,WAAWG,EAAO,QAAA,CAAS;AAAA,MAAA,GACjC;AAAA,MAGF,gBAAAH;AAAA,QAACQ;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOlC,EAAE,0CAA0C;AAAA,UACnD,aAAaA,EAAE,yCAAyC;AAAA,QAAA;AAAA,MAAA;AAAA,MAG1D,gBAAA0B,EAAC,MAAA,EAAG,WAAWG,EAAO,QAAA,CAAS;AAAA,wBAE9BM,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAT,EAACvB,GAAA,EAAO,SAAQ,aAAY,SAAST,GAAQ,YAAYI,GACtD,UAAAE,EAAE,SAAS,EAAA,CACd;AAAA,QACA,gBAAA0B,EAACvB,GAAA,EAAO,SAAQ,WAAU,MAAK,UAAS,WAAWL,GAChD,UAAAE,EAAE,4BAA4B,EAAA,CACjC;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
@@ -1,21 +1,52 @@
1
+ /**
2
+ * Accrual method category for a time off policy. Determines which settings fields are shown.
3
+ *
4
+ * @public
5
+ */
1
6
  export type PolicySettingsAccrualMethod = 'hours_worked' | 'fixed_per_pay_period' | 'fixed_all_at_once';
7
+ /**
8
+ * Form values captured by the policy settings form.
9
+ *
10
+ * @public
11
+ */
2
12
  export interface PolicySettingsFormData {
13
+ /** Whether an annual accrual cap is enabled. */
3
14
  accrualMaximumEnabled: boolean;
15
+ /** Maximum hours that can accrue per year when {@link PolicySettingsFormData.accrualMaximumEnabled} is true. */
4
16
  accrualMaximum?: number;
17
+ /** Whether a total balance cap is enabled. */
5
18
  balanceMaximumEnabled: boolean;
19
+ /** Maximum hours an employee can hold in their balance at any time when {@link PolicySettingsFormData.balanceMaximumEnabled} is true. */
6
20
  balanceMaximum?: number;
21
+ /** Whether a carry-over limit is enabled. */
7
22
  carryOverLimitEnabled: boolean;
23
+ /** Maximum hours that carry over when the policy resets when {@link PolicySettingsFormData.carryOverLimitEnabled} is true. */
8
24
  carryOverLimit?: number;
25
+ /** Whether a waiting period is enabled. */
9
26
  waitingPeriodEnabled: boolean;
27
+ /** Number of days a new employee must wait before accrual begins when {@link PolicySettingsFormData.waitingPeriodEnabled} is true. */
10
28
  waitingPeriod?: number;
29
+ /** Whether accrued balance is paid out when an employee is terminated. */
11
30
  paidOutOnTermination: boolean;
12
31
  }
32
+ /**
33
+ * Props for {@link PolicySettingsPresentation}.
34
+ *
35
+ * @public
36
+ */
13
37
  export interface PolicySettingsPresentationProps {
38
+ /** Accrual method category of the policy. Controls which fields are shown. */
14
39
  accrualMethod: PolicySettingsAccrualMethod;
40
+ /** Called with the form values when the user submits. */
15
41
  onContinue: (data: PolicySettingsFormData) => void;
42
+ /** Called when the user navigates back. */
16
43
  onBack: () => void;
44
+ /** Optional default values to prefill the form. */
17
45
  defaultValues?: Partial<PolicySettingsFormData>;
46
+ /** Whether the form is being used to create a new policy or edit an existing one. Defaults to create. */
18
47
  mode?: 'create' | 'edit';
48
+ /** Name of the policy being edited. Shown in the heading when `mode` is `'edit'`. */
19
49
  editingPolicyName?: string;
50
+ /** Whether a submit is in flight. Disables the back button and shows a loading state on the continue button. */
20
51
  isPending?: boolean;
21
52
  }
@@ -1,7 +1,30 @@
1
1
  import { PolicyType } from './PolicyTypeSelectorTypes';
2
2
  import { BaseComponentInterface } from '../../Base';
3
+ /**
4
+ * Props for {@link PolicyTypeSelector}.
5
+ *
6
+ * @public
7
+ */
3
8
  export interface PolicyTypeSelectorProps extends BaseComponentInterface<'Company.TimeOff.SelectPolicyType'> {
9
+ /** The associated company identifier. */
4
10
  companyId: string;
11
+ /** Pre-selected policy type rendered when the form mounts. */
5
12
  defaultPolicyType?: PolicyType;
6
13
  }
14
+ /**
15
+ * Selection screen for choosing which kind of time-off policy to create — sick, vacation, or holiday.
16
+ *
17
+ * @remarks
18
+ * The holiday option is omitted when the company already has a holiday pay policy, since a company
19
+ * can only have one.
20
+ *
21
+ * | Event | Description | Data |
22
+ * | ----- | ----------- | ---- |
23
+ * | `timeOff/policyTypeSelected` | The user confirms a selection | `{ policyType: {@link PolicyType} }` |
24
+ * | `CANCEL` | The user cancels | — |
25
+ *
26
+ * @param props - See {@link PolicyTypeSelectorProps}.
27
+ * @returns The rendered policy type selection screen.
28
+ * @public
29
+ */
7
30
  export declare function PolicyTypeSelector(props: PolicyTypeSelectorProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"PolicyTypeSelector.js","sources":["../../../../src/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.tsx"],"sourcesContent":["import { useHolidayPayPoliciesGet } from '@gusto/embedded-api-v-2025-11-15/react-query/holidayPayPoliciesGet'\nimport { PolicyTypeSelectorPresentation } from './PolicyTypeSelectorPresentation'\nimport type { PolicyType } from './PolicyTypeSelectorTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\n\nexport interface PolicyTypeSelectorProps extends BaseComponentInterface<'Company.TimeOff.SelectPolicyType'> {\n companyId: string\n defaultPolicyType?: PolicyType\n}\n\nexport function PolicyTypeSelector(props: PolicyTypeSelectorProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, defaultPolicyType }: PolicyTypeSelectorProps) {\n const { onEvent } = useBase()\n\n const holidayQuery = useHolidayPayPoliciesGet({ companyUuid: companyId })\n const holidayPolicyExists = Boolean(holidayQuery.data?.holidayPayPolicy)\n\n const handleContinue = (policyType: PolicyType) => {\n onEvent(componentEvents.TIME_OFF_POLICY_TYPE_SELECTED, {\n policyType,\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <PolicyTypeSelectorPresentation\n onContinue={handleContinue}\n onCancel={handleCancel}\n defaultPolicyType={defaultPolicyType}\n holidayPolicyExists={holidayPolicyExists}\n />\n )\n}\n"],"names":["PolicyTypeSelector","props","jsx","BaseComponent","Root","companyId","defaultPolicyType","onEvent","useBase","holidayPolicyExists","useHolidayPayPoliciesGet","PolicyTypeSelectorPresentation","policyType","componentEvents"],"mappings":";;;;;;AAYO,SAASA,EAAmBC,GAAgC;AACjE,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,mBAAAC,KAA8C;AACvE,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAGdC,IAAsB,EADPC,EAAyB,EAAE,aAAaL,GAAW,EACvB,MAAM;AAYvD,SACE,gBAAAH;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,YAZmB,CAACC,MAA2B;AACjD,QAAAL,EAAQM,EAAgB,+BAA+B;AAAA,UACrD,YAAAD;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MASI,UAPiB,MAAM;AACzB,QAAAL,EAAQM,EAAgB,MAAM;AAAA,MAChC;AAAA,MAMI,mBAAAP;AAAA,MACA,qBAAAG;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PolicyTypeSelector.js","sources":["../../../../src/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.tsx"],"sourcesContent":["import { useHolidayPayPoliciesGet } from '@gusto/embedded-api-v-2025-11-15/react-query/holidayPayPoliciesGet'\nimport { PolicyTypeSelectorPresentation } from './PolicyTypeSelectorPresentation'\nimport type { PolicyType } from './PolicyTypeSelectorTypes'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * Props for {@link PolicyTypeSelector}.\n *\n * @public\n */\nexport interface PolicyTypeSelectorProps extends BaseComponentInterface<'Company.TimeOff.SelectPolicyType'> {\n /** The associated company identifier. */\n companyId: string\n /** Pre-selected policy type rendered when the form mounts. */\n defaultPolicyType?: PolicyType\n}\n\n/**\n * Selection screen for choosing which kind of time-off policy to create — sick, vacation, or holiday.\n *\n * @remarks\n * The holiday option is omitted when the company already has a holiday pay policy, since a company\n * can only have one.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `timeOff/policyTypeSelected` | The user confirms a selection | `{ policyType: {@link PolicyType} }` |\n * | `CANCEL` | The user cancels | — |\n *\n * @param props - See {@link PolicyTypeSelectorProps}.\n * @returns The rendered policy type selection screen.\n * @public\n */\nexport function PolicyTypeSelector(props: PolicyTypeSelectorProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, defaultPolicyType }: PolicyTypeSelectorProps) {\n const { onEvent } = useBase()\n\n const holidayQuery = useHolidayPayPoliciesGet({ companyUuid: companyId })\n const holidayPolicyExists = Boolean(holidayQuery.data?.holidayPayPolicy)\n\n const handleContinue = (policyType: PolicyType) => {\n onEvent(componentEvents.TIME_OFF_POLICY_TYPE_SELECTED, {\n policyType,\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <PolicyTypeSelectorPresentation\n onContinue={handleContinue}\n onCancel={handleCancel}\n defaultPolicyType={defaultPolicyType}\n holidayPolicyExists={holidayPolicyExists}\n />\n )\n}\n"],"names":["PolicyTypeSelector","props","jsx","BaseComponent","Root","companyId","defaultPolicyType","onEvent","useBase","holidayPolicyExists","useHolidayPayPoliciesGet","PolicyTypeSelectorPresentation","policyType","componentEvents"],"mappings":";;;;;;AAmCO,SAASA,EAAmBC,GAAgC;AACjE,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,mBAAAC,KAA8C;AACvE,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAGdC,IAAsB,EADPC,EAAyB,EAAE,aAAaL,GAAW,EACvB,MAAM;AAYvD,SACE,gBAAAH;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,YAZmB,CAACC,MAA2B;AACjD,QAAAL,EAAQM,EAAgB,+BAA+B;AAAA,UACrD,YAAAD;AAAA,QAAA,CACD;AAAA,MACH;AAAA,MASI,UAPiB,MAAM;AACzB,QAAAL,EAAQM,EAAgB,MAAM;AAAA,MAChC;AAAA,MAMI,mBAAAP;AAAA,MACA,qBAAAG;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,3 @@
1
1
  import { PolicyTypeSelectorPresentationProps } from './PolicyTypeSelectorTypes';
2
+ /** @internal */
2
3
  export declare function PolicyTypeSelectorPresentation({ onContinue, onCancel, defaultPolicyType, holidayPolicyExists, }: PolicyTypeSelectorPresentationProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"PolicyTypeSelectorPresentation.js","sources":["../../../../src/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.tsx"],"sourcesContent":["import { useId, useMemo } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { PolicyType, PolicyTypeSelectorPresentationProps } from './PolicyTypeSelectorTypes'\nimport { Flex, ActionsLayout, RadioGroupField } from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\ninterface PolicyTypeSelectorFormData {\n policyType: PolicyType\n}\n\nexport function PolicyTypeSelectorPresentation({\n onContinue,\n onCancel,\n defaultPolicyType,\n holidayPolicyExists = false,\n}: PolicyTypeSelectorPresentationProps) {\n useI18n('Company.TimeOff.SelectPolicyType')\n const { t } = useTranslation('Company.TimeOff.SelectPolicyType')\n const { Heading, Text, Button } = useComponentContext()\n const headingId = useId()\n\n const formMethods = useForm<PolicyTypeSelectorFormData>({\n defaultValues: {\n policyType: defaultPolicyType as PolicyType,\n },\n })\n\n const selectedPolicyType = useWatch({ control: formMethods.control, name: 'policyType' })\n\n const policyTypeOptions = useMemo(() => {\n const options: Array<{ value: PolicyType; label: string; description: string }> = []\n if (!holidayPolicyExists) {\n options.push({\n value: 'holiday',\n label: t('holidayLabel'),\n description: t('holidayHint'),\n })\n }\n options.push(\n {\n value: 'vacation',\n label: t('timeOffLabel'),\n description: t('timeOffHint'),\n },\n {\n value: 'sick',\n label: t('sickLeaveLabel'),\n description: t('sickLeaveHint'),\n },\n )\n return options\n }, [t, holidayPolicyExists])\n\n const handleSubmit = (data: PolicyTypeSelectorFormData) => {\n onContinue(data.policyType)\n }\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm aria-labelledby={headingId} onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\" id={headingId}>\n {t('title')}\n </Heading>\n <Text variant=\"supporting\">{t('policyTypeHint')}</Text>\n </Flex>\n\n <RadioGroupField<PolicyType>\n name=\"policyType\"\n label={t('policyTypeLabel')}\n options={policyTypeOptions}\n isRequired\n errorMessage={t('validations.policyTypeRequired')}\n />\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\" isDisabled={!selectedPolicyType}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicyTypeSelectorPresentation","onContinue","onCancel","defaultPolicyType","holidayPolicyExists","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","headingId","useId","formMethods","useForm","selectedPolicyType","useWatch","policyTypeOptions","useMemo","options","handleSubmit","data","FormProvider","jsx","HtmlForm","jsxs","Flex","RadioGroupField","ActionsLayout"],"mappings":";;;;;;;;;;AAaO,SAASA,EAA+B;AAAA,EAC7C,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,qBAAAC,IAAsB;AACxB,GAAwC;AACtC,EAAAC,EAAQ,kCAAkC;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzD,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GAC5BC,IAAYC,EAAA,GAEZC,IAAcC,EAAoC;AAAA,IACtD,eAAe;AAAA,MACb,YAAYZ;AAAA,IAAA;AAAA,EACd,CACD,GAEKa,IAAqBC,EAAS,EAAE,SAASH,EAAY,SAAS,MAAM,cAAc,GAElFI,IAAoBC,EAAQ,MAAM;AACtC,UAAMC,IAA4E,CAAA;AAClF,WAAKhB,KACHgB,EAAQ,KAAK;AAAA,MACX,OAAO;AAAA,MACP,OAAOd,EAAE,cAAc;AAAA,MACvB,aAAaA,EAAE,aAAa;AAAA,IAAA,CAC7B,GAEHc,EAAQ;AAAA,MACN;AAAA,QACE,OAAO;AAAA,QACP,OAAOd,EAAE,cAAc;AAAA,QACvB,aAAaA,EAAE,aAAa;AAAA,MAAA;AAAA,MAE9B;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAE,gBAAgB;AAAA,QACzB,aAAaA,EAAE,eAAe;AAAA,MAAA;AAAA,IAChC,GAEKc;AAAA,EACT,GAAG,CAACd,GAAGF,CAAmB,CAAC,GAErBiB,IAAe,CAACC,MAAqC;AACzD,IAAArB,EAAWqB,EAAK,UAAU;AAAA,EAC5B;AAEA,2BACGC,GAAA,EAAc,GAAGT,GAChB,UAAA,gBAAAU,EAACC,GAAA,EAAS,mBAAiBb,GAAW,UAAUE,EAAY,aAAaO,CAAY,GACnF,UAAA,gBAAAK,EAACC,KAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAH,EAAChB,KAAQ,IAAG,MAAK,IAAII,GAClB,UAAAN,EAAE,OAAO,GACZ;AAAA,wBACCG,GAAA,EAAK,SAAQ,cAAc,UAAAH,EAAE,gBAAgB,EAAA,CAAE;AAAA,IAAA,GAClD;AAAA,IAEA,gBAAAkB;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOtB,EAAE,iBAAiB;AAAA,QAC1B,SAASY;AAAA,QACT,YAAU;AAAA,QACV,cAAcZ,EAAE,gCAAgC;AAAA,MAAA;AAAA,IAAA;AAAA,sBAGjDuB,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAL,EAACd,KAAO,SAAQ,aAAY,SAASR,GAClC,UAAAI,EAAE,WAAW,GAChB;AAAA,MACA,gBAAAkB,EAACd,GAAA,EAAO,SAAQ,WAAU,MAAK,UAAS,YAAY,CAACM,GAClD,UAAAV,EAAE,aAAa,EAAA,CAClB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"PolicyTypeSelectorPresentation.js","sources":["../../../../src/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.tsx"],"sourcesContent":["import { useId, useMemo } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { PolicyType, PolicyTypeSelectorPresentationProps } from './PolicyTypeSelectorTypes'\nimport { Flex, ActionsLayout, RadioGroupField } from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\ninterface PolicyTypeSelectorFormData {\n policyType: PolicyType\n}\n\n/** @internal */\nexport function PolicyTypeSelectorPresentation({\n onContinue,\n onCancel,\n defaultPolicyType,\n holidayPolicyExists = false,\n}: PolicyTypeSelectorPresentationProps) {\n useI18n('Company.TimeOff.SelectPolicyType')\n const { t } = useTranslation('Company.TimeOff.SelectPolicyType')\n const { Heading, Text, Button } = useComponentContext()\n const headingId = useId()\n\n const formMethods = useForm<PolicyTypeSelectorFormData>({\n defaultValues: {\n policyType: defaultPolicyType as PolicyType,\n },\n })\n\n const selectedPolicyType = useWatch({ control: formMethods.control, name: 'policyType' })\n\n const policyTypeOptions = useMemo(() => {\n const options: Array<{ value: PolicyType; label: string; description: string }> = []\n if (!holidayPolicyExists) {\n options.push({\n value: 'holiday',\n label: t('holidayLabel'),\n description: t('holidayHint'),\n })\n }\n options.push(\n {\n value: 'vacation',\n label: t('timeOffLabel'),\n description: t('timeOffHint'),\n },\n {\n value: 'sick',\n label: t('sickLeaveLabel'),\n description: t('sickLeaveHint'),\n },\n )\n return options\n }, [t, holidayPolicyExists])\n\n const handleSubmit = (data: PolicyTypeSelectorFormData) => {\n onContinue(data.policyType)\n }\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm aria-labelledby={headingId} onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\" id={headingId}>\n {t('title')}\n </Heading>\n <Text variant=\"supporting\">{t('policyTypeHint')}</Text>\n </Flex>\n\n <RadioGroupField<PolicyType>\n name=\"policyType\"\n label={t('policyTypeLabel')}\n options={policyTypeOptions}\n isRequired\n errorMessage={t('validations.policyTypeRequired')}\n />\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('cancelCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\" isDisabled={!selectedPolicyType}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicyTypeSelectorPresentation","onContinue","onCancel","defaultPolicyType","holidayPolicyExists","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","headingId","useId","formMethods","useForm","selectedPolicyType","useWatch","policyTypeOptions","useMemo","options","handleSubmit","data","FormProvider","jsx","HtmlForm","jsxs","Flex","RadioGroupField","ActionsLayout"],"mappings":";;;;;;;;;;AAcO,SAASA,EAA+B;AAAA,EAC7C,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,qBAAAC,IAAsB;AACxB,GAAwC;AACtC,EAAAC,EAAQ,kCAAkC;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzD,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GAC5BC,IAAYC,EAAA,GAEZC,IAAcC,EAAoC;AAAA,IACtD,eAAe;AAAA,MACb,YAAYZ;AAAA,IAAA;AAAA,EACd,CACD,GAEKa,IAAqBC,EAAS,EAAE,SAASH,EAAY,SAAS,MAAM,cAAc,GAElFI,IAAoBC,EAAQ,MAAM;AACtC,UAAMC,IAA4E,CAAA;AAClF,WAAKhB,KACHgB,EAAQ,KAAK;AAAA,MACX,OAAO;AAAA,MACP,OAAOd,EAAE,cAAc;AAAA,MACvB,aAAaA,EAAE,aAAa;AAAA,IAAA,CAC7B,GAEHc,EAAQ;AAAA,MACN;AAAA,QACE,OAAO;AAAA,QACP,OAAOd,EAAE,cAAc;AAAA,QACvB,aAAaA,EAAE,aAAa;AAAA,MAAA;AAAA,MAE9B;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAE,gBAAgB;AAAA,QACzB,aAAaA,EAAE,eAAe;AAAA,MAAA;AAAA,IAChC,GAEKc;AAAA,EACT,GAAG,CAACd,GAAGF,CAAmB,CAAC,GAErBiB,IAAe,CAACC,MAAqC;AACzD,IAAArB,EAAWqB,EAAK,UAAU;AAAA,EAC5B;AAEA,2BACGC,GAAA,EAAc,GAAGT,GAChB,UAAA,gBAAAU,EAACC,GAAA,EAAS,mBAAiBb,GAAW,UAAUE,EAAY,aAAaO,CAAY,GACnF,UAAA,gBAAAK,EAACC,KAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAH,EAAChB,KAAQ,IAAG,MAAK,IAAII,GAClB,UAAAN,EAAE,OAAO,GACZ;AAAA,wBACCG,GAAA,EAAK,SAAQ,cAAc,UAAAH,EAAE,gBAAgB,EAAA,CAAE;AAAA,IAAA,GAClD;AAAA,IAEA,gBAAAkB;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOtB,EAAE,iBAAiB;AAAA,QAC1B,SAASY;AAAA,QACT,YAAU;AAAA,QACV,cAAcZ,EAAE,gCAAgC;AAAA,MAAA;AAAA,IAAA;AAAA,sBAGjDuB,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAL,EAACd,KAAO,SAAQ,aAAY,SAASR,GAClC,UAAAI,EAAE,WAAW,GAChB;AAAA,MACA,gBAAAkB,EAACd,GAAA,EAAO,SAAQ,WAAU,MAAK,UAAS,YAAY,CAACM,GAClD,UAAAV,EAAE,aAAa,EAAA,CAClB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
@@ -1,7 +1,17 @@
1
+ /**
2
+ * Identifier for the kind of time-off policy a company can configure.
3
+ *
4
+ * @public
5
+ */
1
6
  export type PolicyType = 'sick' | 'vacation' | 'holiday';
7
+ /** @internal */
2
8
  export interface PolicyTypeSelectorPresentationProps {
9
+ /** Called with the chosen policy type when the user confirms the selection. */
3
10
  onContinue: (policyType: PolicyType) => void;
11
+ /** Called when the user cancels the selection. */
4
12
  onCancel: () => void;
13
+ /** Pre-selected policy type rendered when the form mounts. */
5
14
  defaultPolicyType?: PolicyType;
15
+ /** When true, the holiday option is omitted because the company already has a holiday pay policy. */
6
16
  holidayPolicyExists?: boolean;
7
17
  }
@@ -1,2 +1,44 @@
1
1
  import { TimeOffFlowProps } from './TimeOffFlowComponents';
2
+ /**
3
+ * End-to-end workflow for creating and managing a company's sick, vacation, and holiday time off policies.
4
+ *
5
+ * @remarks
6
+ * Composes the time off list, policy-type selection, configuration, settings, employee assignment, and policy detail screens into a single multi-step flow. Sick and vacation policies share a common creation path (configure → settings → add employees); holiday policies follow a separate path (select federal holidays → add employees). All policy types can be viewed, edited, and removed from the unified policy list.
7
+ *
8
+ * The flow emits these events as users navigate:
9
+ *
10
+ * | Event | Description | Data |
11
+ * | ----- | ----------- | ---- |
12
+ * | `timeOff/createPolicy` | User initiates policy creation | — |
13
+ * | `timeOff/viewPolicy` | User selects a policy to view | `{ policyId: string, policyType: string }` |
14
+ * | `timeOff/policyTypeSelected` | User selects a policy type | `{ policyType: 'sick' \| 'vacation' \| 'holiday' }` |
15
+ * | `timeOff/policyDetails/done` | Policy details form is submitted | `{ policyId: string, accrualMethod: string }` |
16
+ * | `timeOff/policySettings/done` | Policy settings are saved | TimeOffPolicy response |
17
+ * | `timeOff/policySettings/back` | User navigates back from settings | — |
18
+ * | `timeOff/addEmployees/done` | Employees are added to a sick/vacation policy | TimeOffPolicy response |
19
+ * | `timeOff/addEmployees/back` | User navigates back from employee selection | — |
20
+ * | `timeOff/holidaySelection/done` | Holiday selection completed (create) | — |
21
+ * | `timeOff/holidaySelection/editDone` | Holiday selection completed (edit) | — |
22
+ * | `timeOff/holidayAddEmployees/done` | Employees added to holiday policy | HolidayPayPolicy response |
23
+ * | `timeOff/backToList` | User navigates back to the policy list | — |
24
+ * | `timeOff/editPolicy` | User edits a sick/vacation policy | `{ policyId: string }` |
25
+ * | `timeOff/changeSettings` | User edits policy settings | `{ policyId: string }` |
26
+ * | `timeOff/addEmployeesToPolicy` | User adds employees from a policy detail | `{ policyId: string }` |
27
+ * | `timeOff/holidayAddEmployees` | User adds employees from holiday detail | — |
28
+ * | `timeOff/editHolidayPolicy` | User edits the holiday policy | — |
29
+ * | `timeOff/viewHolidayEmployees` | User switches to the holiday employees tab | — |
30
+ * | `timeOff/viewHolidaySchedule` | User switches to the holiday schedule tab | — |
31
+ * | `timeOff/policyCreate/error` | Policy creation fails | `{ alert?: { type, title, content? } }` |
32
+ * | `timeOff/policySettings/error` | Policy settings update fails | `{ alert?: { type, title, content? } }` |
33
+ * | `timeOff/addEmployees/error` | Adding employees to a policy fails | `{ alert?: { type, title, content? } }` |
34
+ * | `timeOff/holidayCreate/error` | Holiday policy creation fails | `{ alert?: { type, title, content? } }` |
35
+ * | `timeOff/holidayAddEmployees/error` | Adding employees to the holiday policy fails | `{ alert?: { type, title, content? } }` |
36
+ * | `CANCEL` | User cancels the current step | — |
37
+ *
38
+ * Only one holiday policy can exist per company; the policy-type selector disables the holiday option once one is configured.
39
+ *
40
+ * @param props - {@link TimeOffFlowProps} with the company identifier and event handler.
41
+ * @returns The composed time off policy management flow.
42
+ * @public
43
+ */
2
44
  export declare const TimeOffFlow: ({ companyId, onEvent }: TimeOffFlowProps) => import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"TimeOffFlow.js","sources":["../../../../src/components/TimeOff/TimeOffFlow/TimeOffFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { timeOffMachine } from './timeOffStateMachine'\nimport type { TimeOffFlowProps, TimeOffFlowContextInterface } from './TimeOffFlowComponents'\nimport { PolicyListContextual } from './TimeOffFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\n\nexport const TimeOffFlow = ({ companyId, onEvent }: TimeOffFlowProps) => {\n const timeOffFlow = useMemo(\n () =>\n createMachine(\n 'policyList',\n timeOffMachine,\n (initialContext: TimeOffFlowContextInterface) => ({\n ...initialContext,\n component: PolicyListContextual,\n companyId,\n }),\n ),\n [companyId],\n )\n return <Flow machine={timeOffFlow} onEvent={onEvent} />\n}\n"],"names":["TimeOffFlow","companyId","onEvent","timeOffFlow","useMemo","createMachine","timeOffMachine","initialContext","PolicyListContextual","jsx","Flow"],"mappings":";;;;;;AAOO,MAAMA,IAAc,CAAC,EAAE,WAAAC,GAAW,SAAAC,QAAgC;AACvE,QAAMC,IAAcC;AAAA,IAClB,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAiD;AAAA,QAChD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAP;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACA,CAAS;AAAA,EAAA;AAEZ,SAAO,gBAAAQ,EAACC,GAAA,EAAK,SAASP,GAAa,SAAAD,EAAA,CAAkB;AACvD;"}
1
+ {"version":3,"file":"TimeOffFlow.js","sources":["../../../../src/components/TimeOff/TimeOffFlow/TimeOffFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { timeOffMachine } from './timeOffStateMachine'\nimport type { TimeOffFlowProps, TimeOffFlowContextInterface } from './TimeOffFlowComponents'\nimport { PolicyListContextual } from './TimeOffFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\n\n/**\n * End-to-end workflow for creating and managing a company's sick, vacation, and holiday time off policies.\n *\n * @remarks\n * Composes the time off list, policy-type selection, configuration, settings, employee assignment, and policy detail screens into a single multi-step flow. Sick and vacation policies share a common creation path (configure → settings → add employees); holiday policies follow a separate path (select federal holidays → add employees). All policy types can be viewed, edited, and removed from the unified policy list.\n *\n * The flow emits these events as users navigate:\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `timeOff/createPolicy` | User initiates policy creation | — |\n * | `timeOff/viewPolicy` | User selects a policy to view | `{ policyId: string, policyType: string }` |\n * | `timeOff/policyTypeSelected` | User selects a policy type | `{ policyType: 'sick' \\| 'vacation' \\| 'holiday' }` |\n * | `timeOff/policyDetails/done` | Policy details form is submitted | `{ policyId: string, accrualMethod: string }` |\n * | `timeOff/policySettings/done` | Policy settings are saved | TimeOffPolicy response |\n * | `timeOff/policySettings/back` | User navigates back from settings | — |\n * | `timeOff/addEmployees/done` | Employees are added to a sick/vacation policy | TimeOffPolicy response |\n * | `timeOff/addEmployees/back` | User navigates back from employee selection | — |\n * | `timeOff/holidaySelection/done` | Holiday selection completed (create) | — |\n * | `timeOff/holidaySelection/editDone` | Holiday selection completed (edit) | — |\n * | `timeOff/holidayAddEmployees/done` | Employees added to holiday policy | HolidayPayPolicy response |\n * | `timeOff/backToList` | User navigates back to the policy list | — |\n * | `timeOff/editPolicy` | User edits a sick/vacation policy | `{ policyId: string }` |\n * | `timeOff/changeSettings` | User edits policy settings | `{ policyId: string }` |\n * | `timeOff/addEmployeesToPolicy` | User adds employees from a policy detail | `{ policyId: string }` |\n * | `timeOff/holidayAddEmployees` | User adds employees from holiday detail | — |\n * | `timeOff/editHolidayPolicy` | User edits the holiday policy | — |\n * | `timeOff/viewHolidayEmployees` | User switches to the holiday employees tab | — |\n * | `timeOff/viewHolidaySchedule` | User switches to the holiday schedule tab | — |\n * | `timeOff/policyCreate/error` | Policy creation fails | `{ alert?: { type, title, content? } }` |\n * | `timeOff/policySettings/error` | Policy settings update fails | `{ alert?: { type, title, content? } }` |\n * | `timeOff/addEmployees/error` | Adding employees to a policy fails | `{ alert?: { type, title, content? } }` |\n * | `timeOff/holidayCreate/error` | Holiday policy creation fails | `{ alert?: { type, title, content? } }` |\n * | `timeOff/holidayAddEmployees/error` | Adding employees to the holiday policy fails | `{ alert?: { type, title, content? } }` |\n * | `CANCEL` | User cancels the current step | — |\n *\n * Only one holiday policy can exist per company; the policy-type selector disables the holiday option once one is configured.\n *\n * @param props - {@link TimeOffFlowProps} with the company identifier and event handler.\n * @returns The composed time off policy management flow.\n * @public\n */\nexport const TimeOffFlow = ({ companyId, onEvent }: TimeOffFlowProps) => {\n const timeOffFlow = useMemo(\n () =>\n createMachine(\n 'policyList',\n timeOffMachine,\n (initialContext: TimeOffFlowContextInterface) => ({\n ...initialContext,\n component: PolicyListContextual,\n companyId,\n }),\n ),\n [companyId],\n )\n return <Flow machine={timeOffFlow} onEvent={onEvent} />\n}\n"],"names":["TimeOffFlow","companyId","onEvent","timeOffFlow","useMemo","createMachine","timeOffMachine","initialContext","PolicyListContextual","jsx","Flow"],"mappings":";;;;;;AAiDO,MAAMA,IAAc,CAAC,EAAE,WAAAC,GAAW,SAAAC,QAAgC;AACvE,QAAMC,IAAcC;AAAA,IAClB,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAiD;AAAA,QAChD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAP;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACA,CAAS;AAAA,EAAA;AAEZ,SAAO,gBAAAQ,EAACC,GAAA,EAAK,SAASP,GAAa,SAAAD,EAAA,CAAkB;AACvD;"}
@@ -2,31 +2,57 @@ import { ReactNode } from 'react';
2
2
  import { TimeOffPolicyType } from './timeOffPolicyTypes';
3
3
  import { FlowContextInterface } from '../../Flow/useFlow';
4
4
  import { BaseComponentInterface } from '../../Base';
5
+ /**
6
+ * Props for {@link TimeOffFlow}.
7
+ *
8
+ * @public
9
+ */
5
10
  export interface TimeOffFlowProps extends BaseComponentInterface {
11
+ /** The associated company identifier. */
6
12
  companyId: string;
7
13
  }
14
+ /** @internal */
8
15
  export type TimeOffFlowAlert = {
9
16
  type: 'error' | 'info' | 'success';
10
17
  title: string;
11
18
  content?: ReactNode;
12
19
  };
20
+ /** @internal */
13
21
  export type AddEmployeesSource = 'policySettings' | 'policyDetailsForm' | 'viewTimeOffPolicyDetail' | 'viewHolidayEmployees';
22
+ /** @internal */
14
23
  export interface TimeOffFlowContextInterface extends FlowContextInterface {
24
+ /** The associated company identifier. */
15
25
  companyId: string;
26
+ /** The currently selected policy type, if any. */
16
27
  policyType?: TimeOffPolicyType;
28
+ /** The currently selected policy identifier, if any. */
17
29
  policyId?: string;
30
+ /** Alerts to render at the top of the current step. */
18
31
  alerts?: TimeOffFlowAlert[];
32
+ /** Which step launched the add-employees screen, used to route the back transition. */
19
33
  addEmployeesSource?: AddEmployeesSource;
20
34
  }
35
+ /** @internal */
21
36
  export declare function PolicyListContextual(): import("react").JSX.Element;
37
+ /** @internal */
22
38
  export declare function SelectPolicyTypeContextual(): import("react").JSX.Element;
39
+ /** @internal */
23
40
  export declare function PolicyDetailsFormContextual(): import("react").JSX.Element;
41
+ /** @internal */
24
42
  export declare function PolicySettingsContextual(): import("react").JSX.Element;
43
+ /** @internal */
25
44
  export declare function EditPolicySettingsContextual(): import("react").JSX.Element;
45
+ /** @internal */
26
46
  export declare function AddEmployeesToPolicyContextual(): import("react").JSX.Element;
47
+ /** @internal */
27
48
  export declare function TimeOffPolicyDetailContextual(): import("react").JSX.Element;
49
+ /** @internal */
28
50
  export declare function HolidaySelectionFormContextual(): import("react").JSX.Element;
51
+ /** @internal */
29
52
  export declare function EditHolidaySelectionFormContextual(): import("react").JSX.Element;
53
+ /** @internal */
30
54
  export declare function AddEmployeesHolidayContextual(): import("react").JSX.Element;
55
+ /** @internal */
31
56
  export declare function ViewHolidayEmployeesContextual(): import("react").JSX.Element;
57
+ /** @internal */
32
58
  export declare function ViewHolidayScheduleContextual(): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"TimeOffFlowComponents.js","sources":["../../../../src/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { PolicyList } from '../PolicyList/PolicyList'\nimport { PolicyTypeSelector } from '../PolicyTypeSelector/PolicyTypeSelector'\nimport { PolicyConfigurationForm } from '../TimeOffManagement/PolicyConfigurationForm'\nimport { PolicySettings } from '../PolicySettings/PolicySettings'\nimport { AddEmployeesToPolicy } from '../AddEmployeesToPolicy/AddEmployeesToPolicy'\nimport { TimeOffPolicyDetail } from '../TimeOffPolicyDetail/TimeOffPolicyDetail'\nimport { HolidaySelectionForm } from '../HolidaySelectionForm/HolidaySelectionForm'\nimport { AddEmployeesHoliday } from '../AddEmployeesHoliday/AddEmployeesHoliday'\nimport { ViewHolidayEmployees } from '../ViewHolidayEmployees/ViewHolidayEmployees'\nimport { ViewHolidaySchedule } from '../ViewHolidaySchedule/ViewHolidaySchedule'\nimport { assertCreatablePolicyType, type TimeOffPolicyType } from './timeOffPolicyTypes'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface TimeOffFlowProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport type TimeOffFlowAlert = {\n type: 'error' | 'info' | 'success'\n title: string\n content?: ReactNode\n}\n\nexport type AddEmployeesSource =\n | 'policySettings'\n | 'policyDetailsForm'\n | 'viewTimeOffPolicyDetail'\n | 'viewHolidayEmployees'\n\nexport interface TimeOffFlowContextInterface extends FlowContextInterface {\n companyId: string\n policyType?: TimeOffPolicyType\n policyId?: string\n alerts?: TimeOffFlowAlert[]\n addEmployeesSource?: AddEmployeesSource\n}\n\nexport function PolicyListContextual() {\n const { onEvent, companyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyList onEvent={onEvent} companyId={ensureRequired(companyId)} />\n </Flex>\n )\n}\n\nexport function SelectPolicyTypeContextual() {\n const { onEvent, companyId, policyType, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n const selectorDefault =\n policyType === 'sick' || policyType === 'vacation' || policyType === 'holiday'\n ? policyType\n : undefined\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyTypeSelector\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n defaultPolicyType={selectorDefault}\n />\n </Flex>\n )\n}\n\nexport function PolicyDetailsFormContextual() {\n const { onEvent, companyId, policyType, policyId, alerts } =\n useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n const requiredPolicyType = ensureRequired(policyType)\n assertCreatablePolicyType(requiredPolicyType)\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyConfigurationForm\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n policyType={requiredPolicyType}\n policyId={policyId}\n />\n </Flex>\n )\n}\n\nexport function PolicySettingsContextual() {\n const { onEvent, policyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicySettings onEvent={onEvent} policyId={ensureRequired(policyId)} mode=\"create\" />\n </Flex>\n )\n}\n\nexport function EditPolicySettingsContextual() {\n const { onEvent, policyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicySettings onEvent={onEvent} policyId={ensureRequired(policyId)} mode=\"edit\" />\n </Flex>\n )\n}\n\nexport function AddEmployeesToPolicyContextual() {\n const { onEvent, companyId, policyId, policyType } = useFlow<TimeOffFlowContextInterface>()\n const requiredPolicyType = ensureRequired(policyType)\n assertCreatablePolicyType(requiredPolicyType)\n return (\n <AddEmployeesToPolicy\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n policyId={ensureRequired(policyId)}\n policyType={requiredPolicyType}\n />\n )\n}\n\nexport function TimeOffPolicyDetailContextual() {\n const { onEvent, policyId } = useFlow<TimeOffFlowContextInterface>()\n return <TimeOffPolicyDetail onEvent={onEvent} policyId={ensureRequired(policyId)} />\n}\n\nexport function HolidaySelectionFormContextual() {\n const { onEvent, companyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <HolidaySelectionForm onEvent={onEvent} companyId={ensureRequired(companyId)} mode=\"create\" />\n </Flex>\n )\n}\n\nexport function EditHolidaySelectionFormContextual() {\n const { onEvent, companyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <HolidaySelectionForm onEvent={onEvent} companyId={ensureRequired(companyId)} mode=\"edit\" />\n </Flex>\n )\n}\n\nexport function AddEmployeesHolidayContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <AddEmployeesHoliday onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\nexport function ViewHolidayEmployeesContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewHolidayEmployees onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\nexport function ViewHolidayScheduleContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewHolidaySchedule onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n"],"names":["PolicyListContextual","onEvent","companyId","alerts","useFlow","Alert","useComponentContext","jsxs","Flex","alert","index","PolicyList","ensureRequired","SelectPolicyTypeContextual","policyType","selectorDefault","jsx","PolicyTypeSelector","PolicyDetailsFormContextual","policyId","requiredPolicyType","assertCreatablePolicyType","PolicyConfigurationForm","PolicySettingsContextual","PolicySettings","EditPolicySettingsContextual","AddEmployeesToPolicyContextual","AddEmployeesToPolicy","TimeOffPolicyDetailContextual","TimeOffPolicyDetail","HolidaySelectionFormContextual","HolidaySelectionForm","EditHolidaySelectionFormContextual","AddEmployeesHolidayContextual","AddEmployeesHoliday","ViewHolidayEmployeesContextual","ViewHolidayEmployees","ViewHolidayScheduleContextual","ViewHolidaySchedule"],"mappings":";;;;;;;;;;;;;;;;;;AA0CO,SAASA,IAAuB;AACrC,QAAM,EAAE,SAAAC,GAAS,WAAAC,GAAW,QAAAC,EAAA,IAAWC,EAAA,GACjC,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAElB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAC/B,UAAA;AAAA,IAAAL,GAAQ,IAAI,CAACM,GAAOC,wBAClBL,GAAA,EAAkB,QAAQI,EAAM,MAAM,OAAOA,EAAM,OACjD,UAAAA,EAAM,QAAA,GADGC,CAEZ,CACD;AAAA,sBACAC,GAAA,EAAW,SAAAV,GAAkB,WAAWW,EAAeV,CAAS,EAAA,CAAG;AAAA,EAAA,GACtE;AAEJ;AAEO,SAASW,IAA6B;AAC3C,QAAM,EAAE,SAAAZ,GAAS,WAAAC,GAAW,YAAAY,GAAY,QAAAX,EAAA,IAAWC,EAAA,GAC7C,EAAE,OAAAC,EAAA,IAAUC,EAAA,GAEZS,IACJD,MAAe,UAAUA,MAAe,cAAcA,MAAe,YACjEA,IACA;AAEN,SACE,gBAAAP,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAC/B,UAAA;AAAA,IAAAL,GAAQ,IAAI,CAACM,GAAOC,wBAClBL,GAAA,EAAkB,QAAQI,EAAM,MAAM,OAAOA,EAAM,OACjD,UAAAA,EAAM,QAAA,GADGC,CAEZ,CACD;AAAA,IACD,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,SAAAhB;AAAA,QACA,WAAWW,EAAeV,CAAS;AAAA,QACnC,mBAAmBa;AAAA,MAAA;AAAA,IAAA;AAAA,EACrB,GACF;AAEJ;A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AEJ;AAEO,SAAS8B,IAAqC;AACnD,QAAM,EAAE,SAAA/B,GAAS,WAAAC,GAAW,QAAAC,EAAA,IAAWC,EAAA,GACjC,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAElB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAC/B,UAAA;AAAA,IAAAL,GAAQ,IAAI,CAACM,GAAOC,wBAClBL,GAAA,EAAkB,QAAQI,EAAM,MAAM,OAAOA,EAAM,OACjD,UAAAA,EAAM,QAAA,GADGC,CAEZ,CACD;AAAA,IACD,gBAAAM,EAACe,KAAqB,SAAA9B,GAAkB,WAAWW,EAAeV,CAAS,GAAG,MAAK,OAAA,CAAO;AAAA,EAAA,GAC5F;AAEJ;AAEO,SAAS+B,IAAgC;AAC9C,QAAM,EAAE,SAAAhC,GAAS,WAAAC,EAAA,IAAcE,EAAA;AAC/B,2BAAQ8B,GAAA,EAAoB,SAAAjC,GAAkB,WAAWW,EAAeV,CAAS,GAAG;AACtF;AAEO,SAASiC,KAAiC;AAC/C,QAAM,EAAE,SAAAlC,GAAS,WAAAC,EAAA,IAAcE,EAAA;AAC/B,2BAAQgC,GAAA,EAAqB,SAAAnC,GAAkB,WAAWW,EAAeV,CAAS,GAAG;AACvF;AAEO,SAASmC,KAAgC;AAC9C,QAAM,EAAE,SAAApC,GAAS,WAAAC,EAAA,IAAcE,EAAA;AAC/B,2BAAQkC,GAAA,EAAoB,SAAArC,GAAkB,WAAWW,EAAeV,CAAS,GAAG;AACtF;"}
1
+ {"version":3,"file":"TimeOffFlowComponents.js","sources":["../../../../src/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { PolicyList } from '../PolicyList/PolicyList'\nimport { PolicyTypeSelector } from '../PolicyTypeSelector/PolicyTypeSelector'\nimport { PolicyConfigurationForm } from '../TimeOffManagement/PolicyConfigurationForm'\nimport { PolicySettings } from '../PolicySettings/PolicySettings'\nimport { AddEmployeesToPolicy } from '../AddEmployeesToPolicy/AddEmployeesToPolicy'\nimport { TimeOffPolicyDetail } from '../TimeOffPolicyDetail/TimeOffPolicyDetail'\nimport { HolidaySelectionForm } from '../HolidaySelectionForm/HolidaySelectionForm'\nimport { AddEmployeesHoliday } from '../AddEmployeesHoliday/AddEmployeesHoliday'\nimport { ViewHolidayEmployees } from '../ViewHolidayEmployees/ViewHolidayEmployees'\nimport { ViewHolidaySchedule } from '../ViewHolidaySchedule/ViewHolidaySchedule'\nimport { assertCreatablePolicyType, type TimeOffPolicyType } from './timeOffPolicyTypes'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/**\n * Props for {@link TimeOffFlow}.\n *\n * @public\n */\nexport interface TimeOffFlowProps extends BaseComponentInterface {\n /** The associated company identifier. */\n companyId: string\n}\n\n/** @internal */\nexport type TimeOffFlowAlert = {\n type: 'error' | 'info' | 'success'\n title: string\n content?: ReactNode\n}\n\n/** @internal */\nexport type AddEmployeesSource =\n | 'policySettings'\n | 'policyDetailsForm'\n | 'viewTimeOffPolicyDetail'\n | 'viewHolidayEmployees'\n\n/** @internal */\nexport interface TimeOffFlowContextInterface extends FlowContextInterface {\n /** The associated company identifier. */\n companyId: string\n /** The currently selected policy type, if any. */\n policyType?: TimeOffPolicyType\n /** The currently selected policy identifier, if any. */\n policyId?: string\n /** Alerts to render at the top of the current step. */\n alerts?: TimeOffFlowAlert[]\n /** Which step launched the add-employees screen, used to route the back transition. */\n addEmployeesSource?: AddEmployeesSource\n}\n\n/** @internal */\nexport function PolicyListContextual() {\n const { onEvent, companyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyList onEvent={onEvent} companyId={ensureRequired(companyId)} />\n </Flex>\n )\n}\n\n/** @internal */\nexport function SelectPolicyTypeContextual() {\n const { onEvent, companyId, policyType, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n const selectorDefault =\n policyType === 'sick' || policyType === 'vacation' || policyType === 'holiday'\n ? policyType\n : undefined\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyTypeSelector\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n defaultPolicyType={selectorDefault}\n />\n </Flex>\n )\n}\n\n/** @internal */\nexport function PolicyDetailsFormContextual() {\n const { onEvent, companyId, policyType, policyId, alerts } =\n useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n const requiredPolicyType = ensureRequired(policyType)\n assertCreatablePolicyType(requiredPolicyType)\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicyConfigurationForm\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n policyType={requiredPolicyType}\n policyId={policyId}\n />\n </Flex>\n )\n}\n\n/** @internal */\nexport function PolicySettingsContextual() {\n const { onEvent, policyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicySettings onEvent={onEvent} policyId={ensureRequired(policyId)} mode=\"create\" />\n </Flex>\n )\n}\n\n/** @internal */\nexport function EditPolicySettingsContextual() {\n const { onEvent, policyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <PolicySettings onEvent={onEvent} policyId={ensureRequired(policyId)} mode=\"edit\" />\n </Flex>\n )\n}\n\n/** @internal */\nexport function AddEmployeesToPolicyContextual() {\n const { onEvent, companyId, policyId, policyType } = useFlow<TimeOffFlowContextInterface>()\n const requiredPolicyType = ensureRequired(policyType)\n assertCreatablePolicyType(requiredPolicyType)\n return (\n <AddEmployeesToPolicy\n onEvent={onEvent}\n companyId={ensureRequired(companyId)}\n policyId={ensureRequired(policyId)}\n policyType={requiredPolicyType}\n />\n )\n}\n\n/** @internal */\nexport function TimeOffPolicyDetailContextual() {\n const { onEvent, policyId } = useFlow<TimeOffFlowContextInterface>()\n return <TimeOffPolicyDetail onEvent={onEvent} policyId={ensureRequired(policyId)} />\n}\n\n/** @internal */\nexport function HolidaySelectionFormContextual() {\n const { onEvent, companyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <HolidaySelectionForm onEvent={onEvent} companyId={ensureRequired(companyId)} mode=\"create\" />\n </Flex>\n )\n}\n\n/** @internal */\nexport function EditHolidaySelectionFormContextual() {\n const { onEvent, companyId, alerts } = useFlow<TimeOffFlowContextInterface>()\n const { Alert } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n {alerts?.map((alert, index) => (\n <Alert key={index} status={alert.type} label={alert.title}>\n {alert.content}\n </Alert>\n ))}\n <HolidaySelectionForm onEvent={onEvent} companyId={ensureRequired(companyId)} mode=\"edit\" />\n </Flex>\n )\n}\n\n/** @internal */\nexport function AddEmployeesHolidayContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <AddEmployeesHoliday onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\n/** @internal */\nexport function ViewHolidayEmployeesContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewHolidayEmployees onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\n/** @internal */\nexport function ViewHolidayScheduleContextual() {\n const { onEvent, companyId } = useFlow<TimeOffFlowContextInterface>()\n return <ViewHolidaySchedule onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n"],"names":["PolicyListContextual","onEvent","companyId","alerts","useFlow","Alert","useComponentContext","jsxs","Flex","alert","index","PolicyList","ensureRequired","SelectPolicyTypeContextual","policyType","selectorDefault","jsx","PolicyTypeSelector","PolicyDetailsFormContextual","policyId","requiredPolicyType","assertCreatablePolicyType","PolicyConfigurationForm","PolicySettingsContextual","PolicySettings","EditPolicySettingsContextual","AddEmployeesToPolicyContextual","AddEmployeesToPolicy","TimeOffPolicyDetailContextual","TimeOffPolicyDetail","HolidaySelectionFormContextual","HolidaySelectionForm","EditHolidaySelectionFormContextual","AddEmployeesHolidayContextual","AddEmployeesHoliday","ViewHolidayEmployeesContextual","ViewHolidayEmployees","ViewHolidayScheduleContextual","ViewHolidaySchedule"],"mappings":";;;;;;;;;;;;;;;;;;AAyDO,SAASA,IAAuB;AACrC,QAAM,EAAE,SAAAC,GAAS,WAAAC,GAAW,QAAAC,EAAA,IAAWC,EAAA,GACjC,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAElB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAC/B,UAAA;AAAA,IAAAL,GAAQ,IAAI,CAACM,GAAOC,wBAClBL,GAAA,EAAkB,QAAQI,EAAM,MAAM,OAAOA,EAAM,OACjD,UAAAA,EAAM,QAAA,GADGC,CAEZ,CACD;AAAA,sBACAC,GAAA,EAAW,SAAAV,GAAkB,WAAWW,EAAeV,CAAS,EAAA,CAAG;AAAA,EAAA,GACtE;AAEJ;AAGO,SAASW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lC,GAAS,WAAAC,EAAA,IAAcE,EAAA;AAC/B,2BAAQgC,GAAA,EAAqB,SAAAnC,GAAkB,WAAWW,EAAeV,CAAS,GAAG;AACvF;AAGO,SAASmC,KAAgC;AAC9C,QAAM,EAAE,SAAApC,GAAS,WAAAC,EAAA,IAAcE,EAAA;AAC/B,2BAAQkC,GAAA,EAAoB,SAAArC,GAAkB,WAAWW,EAAeV,CAAS,GAAG;AACtF;"}
@@ -1,9 +1,22 @@
1
1
  import { PolicyType } from '@gusto/embedded-api-v-2025-11-15/models/components/timeoffpolicy';
2
+ /**
3
+ * Time off policy types that can be created through the time off policy management workflow.
4
+ *
5
+ * @remarks
6
+ * Only `sick` and `vacation` are creatable through the time off policy endpoint. Holiday policies are a separate concept managed through the holiday pay policy endpoint family.
7
+ *
8
+ * @public
9
+ */
2
10
  export type CreatableTimeOffPolicyType = Extract<PolicyType, 'sick' | 'vacation'>;
11
+ /** @internal */
3
12
  export type TimeOffPolicyType = PolicyType | 'holiday';
4
- export declare const EDITABLE_TIME_OFF_POLICY_TYPES: readonly ["sick", "vacation", "holiday"];
13
+ declare const EDITABLE_TIME_OFF_POLICY_TYPES: readonly ["sick", "vacation", "holiday"];
14
+ /** @internal */
5
15
  export type EditableTimeOffPolicyType = (typeof EDITABLE_TIME_OFF_POLICY_TYPES)[number];
16
+ /** @internal */
6
17
  export declare function isEditableTimeOffPolicyType(policyType: string | null | undefined): policyType is EditableTimeOffPolicyType;
7
- export declare const LISTED_TIME_OFF_POLICY_TYPES: readonly ["sick", "vacation"];
18
+ /** @internal */
8
19
  export declare function isListedTimeOffPolicyType(policyType: PolicyType | null | undefined): policyType is CreatableTimeOffPolicyType;
20
+ /** @internal */
9
21
  export declare function assertCreatablePolicyType(policyType: TimeOffPolicyType): asserts policyType is CreatableTimeOffPolicyType;
22
+ export {};
@@ -2,10 +2,7 @@ const t = ["sick", "vacation", "holiday"];
2
2
  function c(i) {
3
3
  return t.includes(i);
4
4
  }
5
- const e = [
6
- "sick",
7
- "vacation"
8
- ];
5
+ const e = ["sick", "vacation"];
9
6
  function o(i) {
10
7
  return e.includes(i);
11
8
  }
@@ -16,8 +13,6 @@ function n(i) {
16
13
  );
17
14
  }
18
15
  export {
19
- t as EDITABLE_TIME_OFF_POLICY_TYPES,
20
- e as LISTED_TIME_OFF_POLICY_TYPES,
21
16
  n as assertCreatablePolicyType,
22
17
  c as isEditableTimeOffPolicyType,
23
18
  o as isListedTimeOffPolicyType