@gusto/embedded-react-sdk 0.47.0 → 0.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/components/Common/ActionsLayout/ActionsLayout.d.ts +1 -0
  3. package/dist/components/Common/ActionsLayout/ActionsLayout.js.map +1 -1
  4. package/dist/components/Common/Alert/Alert.d.ts +2 -0
  5. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -0
  6. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  7. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -0
  8. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  9. package/dist/components/Common/DataView/DataView.d.ts +2 -0
  10. package/dist/components/Common/DataView/DataView.js.map +1 -1
  11. package/dist/components/Common/DataView/useDataView.d.ts +4 -0
  12. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  13. package/dist/components/Common/DataView/useSelectionState.d.ts +1 -0
  14. package/dist/components/Common/DataView/useSelectionState.js.map +1 -1
  15. package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +1 -0
  16. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
  17. package/dist/components/Common/DetailViewLayout/DetailViewLayout.d.ts +1 -0
  18. package/dist/components/Common/DetailViewLayout/DetailViewLayout.js.map +1 -1
  19. package/dist/components/Common/DetailViewLayout/DetailViewLayoutTypes.d.ts +1 -0
  20. package/dist/components/Common/DocumentList/DocumentList.d.ts +6 -0
  21. package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
  22. package/dist/components/Common/DocumentViewer/DocumentViewer.d.ts +1 -0
  23. package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
  24. package/dist/components/Common/EmptyData/EmptyData.d.ts +1 -0
  25. package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
  26. package/dist/components/Common/FadeIn/FadeIn.d.ts +1 -0
  27. package/dist/components/Common/FadeIn/FadeIn.js.map +1 -1
  28. package/dist/components/Common/FieldCaption/FieldCaption.d.ts +8 -0
  29. package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -1
  30. package/dist/components/Common/FieldDescription/FieldDescription.d.ts +5 -0
  31. package/dist/components/Common/FieldDescription/FieldDescription.js.map +1 -1
  32. package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.d.ts +5 -0
  33. package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.js.map +1 -1
  34. package/dist/components/Common/FieldLayout/FieldLayout.d.ts +5 -0
  35. package/dist/components/Common/FieldLayout/FieldLayout.js.map +1 -1
  36. package/dist/components/Common/FieldLayout/FieldLayoutTypes.d.ts +15 -0
  37. package/dist/components/Common/Fieldset/Fieldset.d.ts +2 -0
  38. package/dist/components/Common/Fieldset/Fieldset.js.map +1 -1
  39. package/dist/components/Common/Flex/Flex.d.ts +4 -0
  40. package/dist/components/Common/Flex/Flex.js.map +1 -1
  41. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +20 -0
  42. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
  43. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +33 -7
  44. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +16 -0
  45. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -1
  46. package/dist/components/Common/Form/Form.d.ts +2 -0
  47. package/dist/components/Common/Form/Form.js.map +1 -1
  48. package/dist/components/Common/Grid/Grid.d.ts +2 -0
  49. package/dist/components/Common/Grid/Grid.js.map +1 -1
  50. package/dist/components/Common/HamburgerMenu/HamburgerMenu.d.ts +7 -0
  51. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  52. package/dist/components/Common/HamburgerMenu/HamburgerMenuTypes.d.ts +11 -0
  53. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.d.ts +7 -0
  54. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js.map +1 -1
  55. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayoutTypes.d.ts +14 -0
  56. package/dist/components/Common/InlineSpinner/InlineSpinner.d.ts +1 -0
  57. package/dist/components/Common/InlineSpinner/InlineSpinner.js.map +1 -1
  58. package/dist/components/Common/InternalError/InternalError.d.ts +1 -0
  59. package/dist/components/Common/InternalError/InternalError.js.map +1 -1
  60. package/dist/components/Common/Loading/Loading.d.ts +2 -0
  61. package/dist/components/Common/Loading/Loading.js.map +1 -1
  62. package/dist/components/Common/OnboardingStatusBadge/index.d.ts +3 -0
  63. package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
  64. package/dist/components/Common/ReorderableList/DropZone.d.ts +1 -0
  65. package/dist/components/Common/ReorderableList/DropZone.js.map +1 -1
  66. package/dist/components/Common/ReorderableList/ReorderableItem.d.ts +1 -3
  67. package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
  68. package/dist/components/Common/ReorderableList/ReorderableList.d.ts +1 -0
  69. package/dist/components/Common/ReorderableList/ReorderableList.js.map +1 -1
  70. package/dist/components/Common/ReorderableList/ReorderableListTypes.d.ts +4 -0
  71. package/dist/components/Common/ReorderableList/constants.d.ts +1 -3
  72. package/dist/components/Common/ReorderableList/constants.js.map +1 -1
  73. package/dist/components/Common/RequirementsList/RequirementsList.d.ts +1 -0
  74. package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
  75. package/dist/components/Common/TaxInputs/TaxInputs.d.ts +7 -0
  76. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  77. package/dist/components/Common/Toast/Toast.d.ts +1 -0
  78. package/dist/components/Common/VisuallyHidden/VisuallyHidden.d.ts +2 -0
  79. package/dist/components/Common/VisuallyHidden/VisuallyHidden.js.map +1 -1
  80. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
  81. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  82. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
  83. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  84. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
  85. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  86. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
  87. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  88. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
  89. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  90. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
  91. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  92. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
  93. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
  94. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  95. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
  96. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  97. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
  98. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  99. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
  100. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  101. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  102. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  103. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  104. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  105. package/dist/components/Company/FederalTaxes/Form.js +1 -1
  106. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  107. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
  108. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  109. package/dist/components/Company/Industry/Actions.js +5 -6
  110. package/dist/components/Company/Industry/Actions.js.map +1 -1
  111. package/dist/components/Company/Industry/Context.js +6 -8
  112. package/dist/components/Company/Industry/Context.js.map +1 -1
  113. package/dist/components/Company/Industry/Edit.js +10 -11
  114. package/dist/components/Company/Industry/Edit.js.map +1 -1
  115. package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
  116. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  117. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
  118. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  119. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  120. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  121. package/dist/components/Company/Locations/LocationsList/List.js +2 -3
  122. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  123. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
  124. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  125. package/dist/components/Company/OnboardingOverview/context.js +3 -5
  126. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  127. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
  128. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  129. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
  130. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  131. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
  132. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  133. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
  134. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  135. package/dist/components/Contractor/Address/Form.js +4 -4
  136. package/dist/components/Contractor/Address/useAddress.js +5 -7
  137. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  138. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js +1 -1
  139. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +12 -12
  140. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js +4 -5
  141. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -1
  142. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  143. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  144. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +1 -1
  145. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +1 -1
  146. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +4 -4
  147. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +13 -13
  148. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +2 -3
  149. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
  150. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js +1 -1
  151. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +6 -6
  152. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +12 -12
  153. package/dist/components/Employee/Profile/management/ProfileEditForm.js +1 -1
  154. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +1 -1
  155. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +1 -1
  156. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +1 -1
  157. package/dist/components/Employee/Taxes/Actions.js +7 -8
  158. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  159. package/dist/components/Employee/Taxes/useTaxes.js +3 -5
  160. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  161. package/dist/components/Employee/exports/employeeManagement.d.ts +0 -2
  162. package/dist/components/Employee/exports/employeeManagement.js +50 -52
  163. package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
  164. package/dist/components/Employee/exports/employeeOnboarding.d.ts +1 -0
  165. package/dist/components/Employee/exports/employeeOnboarding.js +20 -18
  166. package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -1
  167. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +10 -11
  168. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  169. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +0 -1
  170. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  171. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +2 -3
  172. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
  173. package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
  174. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  175. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +2 -3
  176. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
  177. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +24 -25
  178. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
  179. package/dist/contexts/GustoProvider/GustoProvider.d.ts +34 -1
  180. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  181. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +42 -2
  182. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
  183. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  184. package/dist/contexts/GustoProvider/SDKI18next.d.ts +1 -1
  185. package/dist/contexts/GustoProvider/SDKI18next.js.map +1 -1
  186. package/dist/contexts/GustoProvider/index.d.ts +0 -2
  187. package/dist/contexts/ThemeProvider/ThemeProvider.d.ts +5 -1
  188. package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
  189. package/dist/contexts/ThemeProvider/customRender.d.ts +1 -0
  190. package/dist/contexts/ThemeProvider/index.d.ts +0 -1
  191. package/dist/contexts/ThemeProvider/theme.d.ts +7 -101
  192. package/dist/contexts/ThemeProvider/theme.js +58 -64
  193. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  194. package/dist/contexts/ThemeProvider/types.d.ts +181 -0
  195. package/dist/contexts/ThemeProvider/useTheme.d.ts +4 -0
  196. package/dist/contexts/ThemeProvider/useTheme.js.map +1 -1
  197. package/dist/contexts/index.d.ts +1 -0
  198. package/dist/index.d.ts +3 -2
  199. package/dist/index.js +145 -141
  200. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +6 -7
  201. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
  202. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +6 -7
  203. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
  204. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +8 -9
  205. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
  206. package/dist/partner-hook-utils/form/fields/SelectHookField.js +2 -3
  207. package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
  208. package/dist/partner-hook-utils/form/fields/SwitchHookField.js +12 -13
  209. package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
  210. package/dist/partner-hook-utils/form/fields/TextInputHookField.js +8 -9
  211. package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
  212. package/dist/partner-hook-utils/form/fields/index.d.ts +2 -0
  213. package/dist/partner-hook-utils/form/index.d.ts +1 -1
  214. package/docs/reference/endpoint-inventory.json +16 -16
  215. package/package.json +7 -6
@@ -21,8 +21,6 @@ interface ReorderableItemProps {
21
21
  }) => ReactElement;
22
22
  className?: string;
23
23
  }
24
- /**
25
- * Component for an individual reorderable item
26
- */
24
+ /** @internal */
27
25
  export declare const ReorderableItem: import('react').NamedExoticComponent<ReorderableItemProps>;
28
26
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ReorderableItem.js","sources":["../../../../src/components/Common/ReorderableList/ReorderableItem.tsx"],"sourcesContent":["import { useRef, useEffect, useCallback, memo } from 'react'\nimport classnames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useDrag } from 'react-dnd'\nimport type { ReactElement } from 'react'\nimport { VisuallyHidden } from '../VisuallyHidden'\nimport type { ReorderableListItem } from './ReorderableListTypes'\nimport styles from './ReorderableList.module.scss'\nimport { ITEM_TYPE } from './constants'\nimport ListIcon from '@/assets/icons/list.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface ReorderableItemProps {\n item: ReorderableListItem\n index: number\n moveItem: (fromIndex: number, toIndex: number, source: 'keyboard' | 'dragdrop') => void\n itemCount: number\n itemIndex: number\n listId: string\n isDraggingAny: boolean\n setIsDragging: (isDragging: boolean) => void\n isReorderingActive: boolean\n setIsReorderingActive: (isReorderingActive: boolean) => void\n isCurrentlyReordering: boolean\n setReorderingItemIndex: (reorderingItemIndex: number | null) => void\n renderDragHandle?: (props: {\n id: string | number\n label: string\n isReordering: boolean\n isDragging: boolean\n }) => ReactElement\n className?: string\n}\n\n/**\n * Component for an individual reorderable item\n */\nexport const ReorderableItem = memo(function ReorderableItem({\n item,\n index,\n moveItem,\n itemCount,\n itemIndex,\n listId,\n isDraggingAny,\n setIsDragging,\n isReorderingActive,\n setIsReorderingActive,\n isCurrentlyReordering,\n setReorderingItemIndex,\n renderDragHandle,\n className,\n}: ReorderableItemProps) {\n const ref = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n\n // Format the accessible item name\n const accessibleItemName = item.label\n\n // Add a ref to track if this specific item is being dragged\n const isBeingDraggedRef = useRef(false)\n\n // When this item becomes the reordering item, focus on it\n useEffect(() => {\n if (isCurrentlyReordering && buttonRef.current) {\n buttonRef.current.focus()\n }\n }, [isCurrentlyReordering])\n\n // React DnD - Drag source\n const [{ isDragging }, drag, dragPreview] = useDrag(\n () => ({\n type: ITEM_TYPE,\n item: () => {\n isBeingDraggedRef.current = true\n setIsDragging(true)\n return { index, listId }\n },\n collect: monitor => ({\n isDragging: monitor.isDragging(),\n }),\n end: () => {\n isBeingDraggedRef.current = false\n\n setIsDragging(false)\n\n if (buttonRef.current) {\n buttonRef.current.blur()\n }\n },\n canDrag: () => !isDraggingAny || isBeingDraggedRef.current,\n }),\n [index, listId, setIsDragging, isDraggingAny],\n )\n\n /**\n * Handles keyboard interactions for reordering\n */\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n let newReorderingState: boolean\n\n switch (e.key) {\n case 'ArrowUp':\n if (isReorderingActive && index > 0) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index - 1, 'keyboard')\n }\n break\n case 'ArrowDown':\n if (isReorderingActive && index < itemCount - 1) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index + 1, 'keyboard')\n }\n break\n case 'Escape':\n if (isReorderingActive) {\n e.preventDefault()\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case 'Tab':\n if (isReorderingActive) {\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case ' ':\n case 'Enter':\n e.preventDefault()\n newReorderingState = !isReorderingActive\n setIsReorderingActive(newReorderingState)\n\n if (newReorderingState) {\n setReorderingItemIndex(index)\n } else {\n setReorderingItemIndex(null)\n }\n break\n default:\n break\n }\n },\n [isReorderingActive, index, itemCount, setReorderingItemIndex, moveItem, setIsReorderingActive],\n )\n\n // Set up drag preview and drag source\n useEffect(() => {\n if (ref.current) {\n dragPreview(ref.current)\n }\n }, [dragPreview])\n\n const itemClasses = classnames(\n styles.reorderableItem,\n isDragging ? styles.dragging : '',\n isReorderingActive ? styles.reordering : '',\n className,\n )\n\n return (\n <div\n ref={ref}\n role=\"listitem\"\n aria-posinset={index + 1}\n aria-setsize={itemCount}\n className={itemClasses}\n data-position={index}\n data-item-index={itemIndex}\n data-list-id={listId}\n data-testid={`reorderable-item-${index}`}\n data-dragging={isDragging ? 'true' : 'false'}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n >\n <VisuallyHidden>\n {t('reorderableList.draggablePosition', {\n item: accessibleItemName,\n position: String(index + 1),\n total: String(itemCount),\n })}\n </VisuallyHidden>\n <span className={styles.dragHandle}>\n {renderDragHandle ? (\n renderDragHandle({\n id: item.id || index,\n label: accessibleItemName,\n isReordering: isReorderingActive,\n isDragging: isDragging,\n })\n ) : (\n <Components.ButtonIcon\n data-index={index}\n data-item-index={itemIndex}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n data-focus-visible={true}\n data-testid=\"drag-handle-button\"\n tabIndex={0}\n onFocus={e => {\n e.currentTarget.setAttribute('data-focus-visible', 'true')\n }}\n onBlur={e => {\n e.currentTarget.removeAttribute('data-focus-visible')\n }}\n aria-label={\n isReorderingActive\n ? t('reorderableList.draggableLabelActive', {\n item: accessibleItemName,\n })\n : t('reorderableList.draggableLabel', {\n item: accessibleItemName,\n })\n }\n aria-roledescription={t('reorderableList.draggableItem')}\n aria-grabbed={isDragging}\n onKeyDown={handleKeyDown}\n buttonRef={node => {\n if (node) {\n buttonRef.current = node\n drag(node)\n }\n }}\n >\n <ListIcon />\n </Components.ButtonIcon>\n )}\n </span>\n <div className={styles.contentContainer}>{item.content}</div>\n </div>\n )\n})\n"],"names":["ReorderableItem","memo","item","index","moveItem","itemCount","itemIndex","listId","isDraggingAny","setIsDragging","isReorderingActive","setIsReorderingActive","isCurrentlyReordering","setReorderingItemIndex","renderDragHandle","className","ref","useRef","buttonRef","t","useTranslation","Components","useComponentContext","accessibleItemName","isBeingDraggedRef","useEffect","isDragging","drag","dragPreview","useDrag","ITEM_TYPE","monitor","handleKeyDown","useCallback","e","newReorderingState","itemClasses","classnames","styles","jsxs","jsx","VisuallyHidden","node","ListIcon"],"mappings":";;;;;;;;;;AAqCO,MAAMA,IAAkBC,EAAK,SAAyB;AAAA,EAC3D,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC;AACF,GAAyB;AACvB,QAAMC,IAAMC,EAAuB,IAAI,GACjCC,IAAYD,EAA0B,IAAI,GAC1C,EAAE,GAAAE,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAA,GAGbC,IAAqBrB,EAAK,OAG1BsB,IAAoBP,EAAO,EAAK;AAGtC,EAAAQ,EAAU,MAAM;AACd,IAAIb,KAAyBM,EAAU,WACrCA,EAAU,QAAQ,MAAA;AAAA,EAEtB,GAAG,CAACN,CAAqB,CAAC;AAG1B,QAAM,CAAC,EAAE,YAAAc,EAAA,GAAcC,GAAMC,CAAW,IAAIC;AAAA,IAC1C,OAAO;AAAA,MACL,MAAMC;AAAA,MACN,MAAM,OACJN,EAAkB,UAAU,IAC5Bf,EAAc,EAAI,GACX,EAAE,OAAAN,GAAO,QAAAI,EAAA;AAAA,MAElB,SAAS,CAAAwB,OAAY;AAAA,QACnB,YAAYA,EAAQ,WAAA;AAAA,MAAW;AAAA,MAEjC,KAAK,MAAM;AACT,QAAAP,EAAkB,UAAU,IAE5Bf,EAAc,EAAK,GAEfS,EAAU,WACZA,EAAU,QAAQ,KAAA;AAAA,MAEtB;AAAA,MACA,SAAS,MAAM,CAACV,KAAiBgB,E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S;AAAA,UAAA;AAAA,QAAA,GAGhB;AAAA,0BACC,OAAA,EAAI,WAAWL,EAAO,kBAAmB,YAAK,QAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG7D,CAAC;"}
1
+ {"version":3,"file":"ReorderableItem.js","sources":["../../../../src/components/Common/ReorderableList/ReorderableItem.tsx"],"sourcesContent":["import { useRef, useEffect, useCallback, memo } from 'react'\nimport classnames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useDrag } from 'react-dnd'\nimport type { ReactElement } from 'react'\nimport { VisuallyHidden } from '../VisuallyHidden'\nimport type { ReorderableListItem } from './ReorderableListTypes'\nimport styles from './ReorderableList.module.scss'\nimport { ITEM_TYPE } from './constants'\nimport ListIcon from '@/assets/icons/list.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface ReorderableItemProps {\n item: ReorderableListItem\n index: number\n moveItem: (fromIndex: number, toIndex: number, source: 'keyboard' | 'dragdrop') => void\n itemCount: number\n itemIndex: number\n listId: string\n isDraggingAny: boolean\n setIsDragging: (isDragging: boolean) => void\n isReorderingActive: boolean\n setIsReorderingActive: (isReorderingActive: boolean) => void\n isCurrentlyReordering: boolean\n setReorderingItemIndex: (reorderingItemIndex: number | null) => void\n renderDragHandle?: (props: {\n id: string | number\n label: string\n isReordering: boolean\n isDragging: boolean\n }) => ReactElement\n className?: string\n}\n\n/** @internal */\nexport const ReorderableItem = memo(function ReorderableItem({\n item,\n index,\n moveItem,\n itemCount,\n itemIndex,\n listId,\n isDraggingAny,\n setIsDragging,\n isReorderingActive,\n setIsReorderingActive,\n isCurrentlyReordering,\n setReorderingItemIndex,\n renderDragHandle,\n className,\n}: ReorderableItemProps) {\n const ref = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n\n // Format the accessible item name\n const accessibleItemName = item.label\n\n // Add a ref to track if this specific item is being dragged\n const isBeingDraggedRef = useRef(false)\n\n // When this item becomes the reordering item, focus on it\n useEffect(() => {\n if (isCurrentlyReordering && buttonRef.current) {\n buttonRef.current.focus()\n }\n }, [isCurrentlyReordering])\n\n // React DnD - Drag source\n const [{ isDragging }, drag, dragPreview] = useDrag(\n () => ({\n type: ITEM_TYPE,\n item: () => {\n isBeingDraggedRef.current = true\n setIsDragging(true)\n return { index, listId }\n },\n collect: monitor => ({\n isDragging: monitor.isDragging(),\n }),\n end: () => {\n isBeingDraggedRef.current = false\n\n setIsDragging(false)\n\n if (buttonRef.current) {\n buttonRef.current.blur()\n }\n },\n canDrag: () => !isDraggingAny || isBeingDraggedRef.current,\n }),\n [index, listId, setIsDragging, isDraggingAny],\n )\n\n /**\n * Handles keyboard interactions for reordering\n */\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n let newReorderingState: boolean\n\n switch (e.key) {\n case 'ArrowUp':\n if (isReorderingActive && index > 0) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index - 1, 'keyboard')\n }\n break\n case 'ArrowDown':\n if (isReorderingActive && index < itemCount - 1) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index + 1, 'keyboard')\n }\n break\n case 'Escape':\n if (isReorderingActive) {\n e.preventDefault()\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case 'Tab':\n if (isReorderingActive) {\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case ' ':\n case 'Enter':\n e.preventDefault()\n newReorderingState = !isReorderingActive\n setIsReorderingActive(newReorderingState)\n\n if (newReorderingState) {\n setReorderingItemIndex(index)\n } else {\n setReorderingItemIndex(null)\n }\n break\n default:\n break\n }\n },\n [isReorderingActive, index, itemCount, setReorderingItemIndex, moveItem, setIsReorderingActive],\n )\n\n // Set up drag preview and drag source\n useEffect(() => {\n if (ref.current) {\n dragPreview(ref.current)\n }\n }, [dragPreview])\n\n const itemClasses = classnames(\n styles.reorderableItem,\n isDragging ? styles.dragging : '',\n isReorderingActive ? styles.reordering : '',\n className,\n )\n\n return (\n <div\n ref={ref}\n role=\"listitem\"\n aria-posinset={index + 1}\n aria-setsize={itemCount}\n className={itemClasses}\n data-position={index}\n data-item-index={itemIndex}\n data-list-id={listId}\n data-testid={`reorderable-item-${index}`}\n data-dragging={isDragging ? 'true' : 'false'}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n >\n <VisuallyHidden>\n {t('reorderableList.draggablePosition', {\n item: accessibleItemName,\n position: String(index + 1),\n total: String(itemCount),\n })}\n </VisuallyHidden>\n <span className={styles.dragHandle}>\n {renderDragHandle ? (\n renderDragHandle({\n id: item.id || index,\n label: accessibleItemName,\n isReordering: isReorderingActive,\n isDragging: isDragging,\n })\n ) : (\n <Components.ButtonIcon\n data-index={index}\n data-item-index={itemIndex}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n data-focus-visible={true}\n data-testid=\"drag-handle-button\"\n tabIndex={0}\n onFocus={e => {\n e.currentTarget.setAttribute('data-focus-visible', 'true')\n }}\n onBlur={e => {\n e.currentTarget.removeAttribute('data-focus-visible')\n }}\n aria-label={\n isReorderingActive\n ? t('reorderableList.draggableLabelActive', {\n item: accessibleItemName,\n })\n : t('reorderableList.draggableLabel', {\n item: accessibleItemName,\n })\n }\n aria-roledescription={t('reorderableList.draggableItem')}\n aria-grabbed={isDragging}\n onKeyDown={handleKeyDown}\n buttonRef={node => {\n if (node) {\n buttonRef.current = node\n drag(node)\n }\n }}\n >\n <ListIcon />\n </Components.ButtonIcon>\n )}\n </span>\n <div className={styles.contentContainer}>{item.content}</div>\n </div>\n )\n})\n"],"names":["ReorderableItem","memo","item","index","moveItem","itemCount","itemIndex","listId","isDraggingAny","setIsDragging","isReorderingActive","setIsReorderingActive","isCurrentlyReordering","setReorderingItemIndex","renderDragHandle","className","ref","useRef","buttonRef","t","useTranslation","Components","useComponentContext","accessibleItemName","isBeingDraggedRef","useEffect","isDragging","drag","dragPreview","useDrag","ITEM_TYPE","monitor","handleKeyDown","useCallback","e","newReorderingState","itemClasses","classnames","styles","jsxs","jsx","VisuallyHidden","node","ListIcon"],"mappings":";;;;;;;;;;AAmCO,MAAMA,IAAkBC,EAAK,SAAyB;AAAA,EAC3D,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC;AACF,GAAyB;AACvB,QAAMC,IAAMC,EAAuB,IAAI,GACjCC,IAAYD,EAA0B,IAAI,GAC1C,EAAE,GAAAE,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAA,GAGbC,IAAqBrB,EAAK,OAG1BsB,IAAoBP,EAAO,EAAK;AAGtC,EAAAQ,EAAU,MAAM;AACd,IAAIb,KAAyBM,EAAU,WACrCA,EAAU,QAAQ,MAAA;AAAA,EAEtB,GAAG,CAACN,CAAqB,CAAC;AAG1B,QAAM,CAAC,EAAE,YAAAc,EAAA,GAAcC,GAAMC,CAAW,IAAIC;AAAA,IAC1C,OAAO;AAAA,MACL,MAAMC;AAAA,MACN,MAAM,OACJN,EAAkB,UAAU,IAC5Bf,EAAc,EAAI,GACX,EAAE,OAAAN,GAAO,QAAAI,EAAA;AAAA,MAElB,SAAS,CAAAwB,OAAY;AAAA,QACnB,YAAYA,EAAQ,WAAA;AAAA,MAAW;AAAA,MAEjC,KAAK,MAAM;AACT,QAAAP,EAAkB,UAAU,IAE5Bf,EAAc,EAAK,GAEfS,EAAU,WACZA,EAAU,QAAQ,KAAA;AAAA,MAEtB;AAAA,MACA,SAAS,MAAM,CAACV,KAAiBgB,EAAkB;AAAA,IAAA;AAAA,IAErD,CAACrB,GAAOI,GAAQE,GAAeD,CAAa;AAAA,EAAA,GAMxCw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,QAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG7D,CAAC;"}
@@ -21,5 +21,6 @@ interface ReorderableListProps {
21
21
  dropZoneClassName?: string;
22
22
  itemClassName?: string;
23
23
  }
24
+ /** @internal */
24
25
  export declare function ReorderableList({ items, label, onReorder, className, animationConfig, disabled, renderDragHandle, dropZoneClassName, itemClassName, }: ReorderableListProps): import("react").JSX.Element;
25
26
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ReorderableList.js","sources":["../../../../src/components/Common/ReorderableList/ReorderableList.tsx"],"sourcesContent":["import { useRef, useState, useEffect, useCallback, useMemo } from 'react'\nimport classnames from 'classnames'\nimport { DndProvider } from 'react-dnd'\nimport { HTML5Backend } from 'react-dnd-html5-backend'\nimport type { ReactElement } from 'react'\nimport type { ReorderableListItem } from './ReorderableListTypes'\nimport styles from './ReorderableList.module.scss'\nimport { ReorderableItem } from './ReorderableItem'\nimport { DropZone } from './DropZone'\n\n// Helper functions\nfunction generateUniqueListId(prefix = 'reorderable-list'): string {\n return `${prefix}-${Math.random().toString(36).slice(2, 9)}`\n}\n\nfunction reorderArray<T>(array: T[], from: number, to: number): T[] {\n if (from === to || from < 0 || from >= array.length || to < 0 || to > array.length) {\n return [...array]\n }\n\n const newArray = [...array]\n const [removed] = newArray.splice(from, 1)\n\n if (removed === undefined) {\n return [...array]\n }\n\n newArray.splice(to, 0, removed)\n return newArray\n}\n\nfunction calculateNewOrder(\n currentOrder: number[],\n fromPosition: number,\n toPosition: number,\n): number[] {\n if (\n fromPosition === toPosition ||\n fromPosition < 0 ||\n fromPosition >= currentOrder.length ||\n toPosition < 0 ||\n toPosition > currentOrder.length\n ) {\n return [...currentOrder]\n }\n\n return reorderArray(currentOrder, fromPosition, toPosition)\n}\n\nfunction adjustTargetPosition(\n fromPosition: number,\n toPosition: number,\n source: 'keyboard' | 'dragdrop' = 'dragdrop',\n): number {\n // When dragging, adjust the target position if moving an element forward\n if (source === 'dragdrop' && fromPosition < toPosition) {\n return toPosition - 1\n }\n return toPosition\n}\n\ninterface ReorderableListAnimationConfig {\n duration?: number\n easing?: string\n disabled?: boolean\n}\n\ninterface ReorderableListProps {\n items: ReorderableListItem[]\n label: string\n onReorder?: (itemOrder: number[]) => void\n className?: string\n animationConfig?: ReorderableListAnimationConfig\n disabled?: boolean\n renderDragHandle?: (props: {\n id: string | number\n label: string\n isReordering: boolean\n isDragging: boolean\n }) => ReactElement\n dropZoneClassName?: string\n itemClassName?: string\n}\n\n// Default animation config\nconst DEFAULT_ANIMATION_CONFIG: ReorderableListAnimationConfig = {\n duration: 200,\n easing: 'ease-in-out',\n disabled: false,\n}\n\nexport function ReorderableList({\n items,\n label,\n onReorder,\n className,\n animationConfig = DEFAULT_ANIMATION_CONFIG,\n disabled = false,\n renderDragHandle,\n dropZoneClassName,\n itemClassName,\n}: ReorderableListProps) {\n const listId = useRef(generateUniqueListId()).current\n\n const [itemOrder, setItemOrder] = useState<number[]>(() =>\n Array.from({ length: items.length }, (_, i) => i),\n )\n const [activeDropZone, setActiveDropZone] = useState<number | null>(null)\n const [isDragging, setIsDragging] = useState(false)\n const [isReorderingActive, setIsReorderingActive] = useState(false)\n const [reorderingItemIndex, setReorderingItemIndex] = useState<number | null>(null)\n const pendingReorderRef = useRef(false)\n const activeDropZonesRef = useRef<Record<number, boolean>>({})\n\n const mergedAnimationConfig = useMemo(\n () => ({\n ...DEFAULT_ANIMATION_CONFIG,\n ...animationConfig,\n }),\n [animationConfig],\n )\n\n useEffect(() => {\n if (items.length !== itemOrder.length) {\n setItemOrder(Array.from({ length: items.length }, (_, i) => i))\n }\n }, [items.length, itemOrder.length])\n\n // Debounced state setter for drop zones to prevent flickering\n const activateDropZone = useCallback((position: number) => {\n activeDropZonesRef.current = {}\n activeDropZonesRef.current[position] = true\n setActiveDropZone(position)\n }, [])\n\n const deactivateDropZone = useCallback((position: number) => {\n if (position in activeDropZonesRef.current) {\n activeDropZonesRef.current[position] = false\n }\n\n const activeDropZones = Object.entries(activeDropZonesRef.current)\n .filter(([_, isActive]) => isActive)\n .map(([pos]) => Number(pos))\n\n if (activeDropZones.length === 0) {\n setActiveDropZone(null)\n } else if (activeDropZones.length === 1) {\n setActiveDropZone(Number(activeDropZones[0]))\n }\n }, [])\n\n const moveItem = useCallback(\n (fromPosition: number, toPosition: number, source: 'keyboard' | 'dragdrop') => {\n if (\n disabled ||\n fromPosition === toPosition ||\n fromPosition < 0 ||\n fromPosition >= itemOrder.length ||\n toPosition < 0 ||\n toPosition > itemOrder.length\n ) {\n return\n }\n\n pendingReorderRef.current = true\n const movedItemIndex = itemOrder[fromPosition]\n\n // Use utility function to calculate new order\n const newOrder = calculateNewOrder(\n itemOrder,\n fromPosition,\n adjustTargetPosition(fromPosition, toPosition, source),\n )\n\n setItemOrder(newOrder)\n\n // Use the configured animation duration\n const animationDuration = mergedAnimationConfig.disabled ? 0 : mergedAnimationConfig.duration\n\n setTimeout(() => {\n setIsDragging(false)\n pendingReorderRef.current = false\n activeDropZonesRef.current = {}\n setActiveDropZone(null)\n\n if (source === 'keyboard') {\n const newPosition = newOrder.findIndex(idx => idx === movedItemIndex)\n\n if (newPosition >= 0) {\n setReorderingItemIndex(newPosition)\n const dragButtons = document.querySelectorAll(\n `[data-list-id=\"${listId}\"] .${styles.dragHandle} button`,\n )\n\n if (newPosition < dragButtons.length) {\n // Use requestAnimationFrame for smoother focus handling\n requestAnimationFrame(() => {\n if (dragButtons[newPosition]) {\n const buttonToFocus = dragButtons[newPosition] as HTMLElement\n buttonToFocus.focus()\n }\n })\n }\n }\n }\n\n if (onReorder) {\n onReorder(newOrder)\n }\n }, animationDuration)\n },\n [itemOrder, listId, onReorder, disabled, mergedAnimationConfig],\n )\n\n // If the list is disabled, don't render the DnD functionality\n if (disabled) {\n return (\n <div\n role=\"list\"\n aria-label={label}\n className={classnames(styles.reorderableList, className, styles.disabled)}\n data-list-id={listId}\n data-testid=\"reorderable-list\"\n >\n {itemOrder.map(itemIndex => {\n const item = items[itemIndex]\n if (!item) return null\n\n return (\n <div\n key={`item-static-${item.id || itemIndex}`}\n role=\"listitem\"\n className={classnames(styles.reorderableItem, itemClassName)}\n >\n <div className={styles.contentContainer}>{item.content}</div>\n </div>\n )\n })}\n </div>\n )\n }\n\n return (\n <DndProvider backend={HTML5Backend}>\n <div\n role=\"list\"\n aria-label={label}\n className={classnames(styles.reorderableList, className)}\n data-list-id={listId}\n data-testid=\"reorderable-list\"\n style={{\n ...(!mergedAnimationConfig.disabled &&\n ({\n '--animation-duration': `${mergedAnimationConfig.duration}ms`,\n '--animation-easing': mergedAnimationConfig.easing,\n } as React.CSSProperties)),\n }}\n >\n <DropZone\n position={0}\n listId={listId}\n isActive={activeDropZone === 0}\n onActivate={() => {\n activateDropZone(0)\n }}\n onDeactivate={() => {\n deactivateDropZone(0)\n }}\n onDrop={(fromPosition: number) => {\n if (!pendingReorderRef.current) {\n moveItem(fromPosition, 0, 'dragdrop')\n }\n }}\n className={dropZoneClassName}\n />\n\n {itemOrder.map((itemIndex, position) => {\n const item = items[itemIndex]\n if (!item) return null\n\n return (\n <div key={`item-container-${item.id || itemIndex}-${position}`}>\n <ReorderableItem\n key={`item-${item.id || itemIndex}`}\n item={item}\n index={position}\n moveItem={moveItem}\n itemCount={items.length}\n itemIndex={itemIndex}\n listId={listId}\n isDraggingAny={isDragging}\n setIsDragging={setIsDragging}\n isReorderingActive={isReorderingActive}\n setIsReorderingActive={setIsReorderingActive}\n isCurrentlyReordering={isReorderingActive && reorderingItemIndex === position}\n setReorderingItemIndex={setReorderingItemIndex}\n renderDragHandle={renderDragHandle}\n className={itemClassName}\n />\n\n <DropZone\n position={position + 1}\n listId={listId}\n isActive={activeDropZone === position + 1}\n onActivate={() => {\n activateDropZone(position + 1)\n }}\n onDeactivate={() => {\n deactivateDropZone(position + 1)\n }}\n onDrop={(fromPosition: number) => {\n if (!pendingReorderRef.current) {\n moveItem(fromPosition, position + 1, 'dragdrop')\n }\n }}\n className={dropZoneClassName}\n />\n </div>\n )\n })}\n </div>\n </DndProvider>\n )\n}\n"],"names":["generateUniqueListId","prefix","reorderArray","array","from","to","newArray","removed","calculateNewOrder","currentOrder","fromPosition","toPosition","adjustTargetPosition","source","DEFAULT_ANIMATION_CONFIG","ReorderableList","items","label","onReorder","className","animationConfig","disabled","renderDragHandle","dropZoneClassName","itemClassName","listId","useRef","itemOrder","setItemOrder","useState","_","i","activeDropZone","setActiveDropZone","isDragging","setIsDragging","isReorderingActive","setIsReorderingActive","reorderingItemIndex","setReorderingItemIndex","pendingReorderRef","activeDropZonesRef","mergedAnimationConfig","useMemo","useEffect","activateDropZone","useCallback","position","deactivateDropZone","activeDropZones","isActive","pos","moveItem","movedItemIndex","newOrder","animationDuration","newPosition","idx","dragButtons","styles","jsx","classnames","itemIndex","item","DndProvider","HTML5Backend","jsxs","DropZone","ReorderableItem"],"mappings":";;;;;;;;AAWA,SAASA,EAAqBC,IAAS,oBAA4B;AACjE,SAAO,GAAGA,CAAM,IAAI,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;AAC5D;AAEA,SAASC,EAAgBC,GAAYC,GAAcC,GAAiB;AAClE,MAAID,MAASC,KAAMD,IAAO,KAAKA,KAAQD,EAAM,UAAUE,IAAK,KAAKA,IAAKF,EAAM;AAC1E,WAAO,CAAC,GAAGA,CAAK;AAGlB,QAAMG,IAAW,CAAC,GAAGH,CAAK,GACpB,CAACI,CAAO,IAAID,EAAS,OAAOF,GAAM,CAAC;AAEzC,SAAIG,MAAY,SACP,CAAC,GAAGJ,CAAK,KAGlBG,EAAS,OAAOD,GAAI,GAAGE,CAAO,GACvBD;AACT;AAEA,SAASE,EACPC,GACAC,GACAC,GACU;AACV,SACED,MAAiBC,KACjBD,IAAe,KACfA,KAAgBD,EAAa,UAC7BE,IAAa,KACbA,IAAaF,EAAa,SAEnB,CAAC,GAAGA,CAAY,IAGlBP,EAAaO,GAAcC,GAAcC,CAAU;AAC5D;AAEA,SAASC,EACPF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C,MAAyB;AAChC,kBAAK8B,EAAkB,WACrBY,EAAS1C,GAAcqC,IAAW,GAAG,UAAU;AAAA,gBAEnD;AAAA,gBACA,WAAWxB;AAAA,cAAA;AAAA,YAAA;AAAA,UACb,KAnCQ,kBAAkBwC,EAAK,MAAMD,CAAS,IAAIf,CAAQ,EAoC5D,IAvCgB;AAAA,QAyCpB,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
1
+ {"version":3,"file":"ReorderableList.js","sources":["../../../../src/components/Common/ReorderableList/ReorderableList.tsx"],"sourcesContent":["import { useRef, useState, useEffect, useCallback, useMemo } from 'react'\nimport classnames from 'classnames'\nimport { DndProvider } from 'react-dnd'\nimport { HTML5Backend } from 'react-dnd-html5-backend'\nimport type { ReactElement } from 'react'\nimport type { ReorderableListItem } from './ReorderableListTypes'\nimport styles from './ReorderableList.module.scss'\nimport { ReorderableItem } from './ReorderableItem'\nimport { DropZone } from './DropZone'\n\n// Helper functions\nfunction generateUniqueListId(prefix = 'reorderable-list'): string {\n return `${prefix}-${Math.random().toString(36).slice(2, 9)}`\n}\n\nfunction reorderArray<T>(array: T[], from: number, to: number): T[] {\n if (from === to || from < 0 || from >= array.length || to < 0 || to > array.length) {\n return [...array]\n }\n\n const newArray = [...array]\n const [removed] = newArray.splice(from, 1)\n\n if (removed === undefined) {\n return [...array]\n }\n\n newArray.splice(to, 0, removed)\n return newArray\n}\n\nfunction calculateNewOrder(\n currentOrder: number[],\n fromPosition: number,\n toPosition: number,\n): number[] {\n if (\n fromPosition === toPosition ||\n fromPosition < 0 ||\n fromPosition >= currentOrder.length ||\n toPosition < 0 ||\n toPosition > currentOrder.length\n ) {\n return [...currentOrder]\n }\n\n return reorderArray(currentOrder, fromPosition, toPosition)\n}\n\nfunction adjustTargetPosition(\n fromPosition: number,\n toPosition: number,\n source: 'keyboard' | 'dragdrop' = 'dragdrop',\n): number {\n // When dragging, adjust the target position if moving an element forward\n if (source === 'dragdrop' && fromPosition < toPosition) {\n return toPosition - 1\n }\n return toPosition\n}\n\ninterface ReorderableListAnimationConfig {\n duration?: number\n easing?: string\n disabled?: boolean\n}\n\ninterface ReorderableListProps {\n items: ReorderableListItem[]\n label: string\n onReorder?: (itemOrder: number[]) => void\n className?: string\n animationConfig?: ReorderableListAnimationConfig\n disabled?: boolean\n renderDragHandle?: (props: {\n id: string | number\n label: string\n isReordering: boolean\n isDragging: boolean\n }) => ReactElement\n dropZoneClassName?: string\n itemClassName?: string\n}\n\n// Default animation config\nconst DEFAULT_ANIMATION_CONFIG: ReorderableListAnimationConfig = {\n duration: 200,\n easing: 'ease-in-out',\n disabled: false,\n}\n\n/** @internal */\nexport function ReorderableList({\n items,\n label,\n onReorder,\n className,\n animationConfig = DEFAULT_ANIMATION_CONFIG,\n disabled = false,\n renderDragHandle,\n dropZoneClassName,\n itemClassName,\n}: ReorderableListProps) {\n const listId = useRef(generateUniqueListId()).current\n\n const [itemOrder, setItemOrder] = useState<number[]>(() =>\n Array.from({ length: items.length }, (_, i) => i),\n )\n const [activeDropZone, setActiveDropZone] = useState<number | null>(null)\n const [isDragging, setIsDragging] = useState(false)\n const [isReorderingActive, setIsReorderingActive] = useState(false)\n const [reorderingItemIndex, setReorderingItemIndex] = useState<number | null>(null)\n const pendingReorderRef = useRef(false)\n const activeDropZonesRef = useRef<Record<number, boolean>>({})\n\n const mergedAnimationConfig = useMemo(\n () => ({\n ...DEFAULT_ANIMATION_CONFIG,\n ...animationConfig,\n }),\n [animationConfig],\n )\n\n useEffect(() => {\n if (items.length !== itemOrder.length) {\n setItemOrder(Array.from({ length: items.length }, (_, i) => i))\n }\n }, [items.length, itemOrder.length])\n\n // Debounced state setter for drop zones to prevent flickering\n const activateDropZone = useCallback((position: number) => {\n activeDropZonesRef.current = {}\n activeDropZonesRef.current[position] = true\n setActiveDropZone(position)\n }, [])\n\n const deactivateDropZone = useCallback((position: number) => {\n if (position in activeDropZonesRef.current) {\n activeDropZonesRef.current[position] = false\n }\n\n const activeDropZones = Object.entries(activeDropZonesRef.current)\n .filter(([_, isActive]) => isActive)\n .map(([pos]) => Number(pos))\n\n if (activeDropZones.length === 0) {\n setActiveDropZone(null)\n } else if (activeDropZones.length === 1) {\n setActiveDropZone(Number(activeDropZones[0]))\n }\n }, [])\n\n const moveItem = useCallback(\n (fromPosition: number, toPosition: number, source: 'keyboard' | 'dragdrop') => {\n if (\n disabled ||\n fromPosition === toPosition ||\n fromPosition < 0 ||\n fromPosition >= itemOrder.length ||\n toPosition < 0 ||\n toPosition > itemOrder.length\n ) {\n return\n }\n\n pendingReorderRef.current = true\n const movedItemIndex = itemOrder[fromPosition]\n\n // Use utility function to calculate new order\n const newOrder = calculateNewOrder(\n itemOrder,\n fromPosition,\n adjustTargetPosition(fromPosition, toPosition, source),\n )\n\n setItemOrder(newOrder)\n\n // Use the configured animation duration\n const animationDuration = mergedAnimationConfig.disabled ? 0 : mergedAnimationConfig.duration\n\n setTimeout(() => {\n setIsDragging(false)\n pendingReorderRef.current = false\n activeDropZonesRef.current = {}\n setActiveDropZone(null)\n\n if (source === 'keyboard') {\n const newPosition = newOrder.findIndex(idx => idx === movedItemIndex)\n\n if (newPosition >= 0) {\n setReorderingItemIndex(newPosition)\n const dragButtons = document.querySelectorAll(\n `[data-list-id=\"${listId}\"] .${styles.dragHandle} button`,\n )\n\n if (newPosition < dragButtons.length) {\n // Use requestAnimationFrame for smoother focus handling\n requestAnimationFrame(() => {\n if (dragButtons[newPosition]) {\n const buttonToFocus = dragButtons[newPosition] as HTMLElement\n buttonToFocus.focus()\n }\n })\n }\n }\n }\n\n if (onReorder) {\n onReorder(newOrder)\n }\n }, animationDuration)\n },\n [itemOrder, listId, onReorder, disabled, mergedAnimationConfig],\n )\n\n // If the list is disabled, don't render the DnD functionality\n if (disabled) {\n return (\n <div\n role=\"list\"\n aria-label={label}\n className={classnames(styles.reorderableList, className, styles.disabled)}\n data-list-id={listId}\n data-testid=\"reorderable-list\"\n >\n {itemOrder.map(itemIndex => {\n const item = items[itemIndex]\n if (!item) return null\n\n return (\n <div\n key={`item-static-${item.id || itemIndex}`}\n role=\"listitem\"\n className={classnames(styles.reorderableItem, itemClassName)}\n >\n <div className={styles.contentContainer}>{item.content}</div>\n </div>\n )\n })}\n </div>\n )\n }\n\n return (\n <DndProvider backend={HTML5Backend}>\n <div\n role=\"list\"\n aria-label={label}\n className={classnames(styles.reorderableList, className)}\n data-list-id={listId}\n data-testid=\"reorderable-list\"\n style={{\n ...(!mergedAnimationConfig.disabled &&\n ({\n '--animation-duration': `${mergedAnimationConfig.duration}ms`,\n '--animation-easing': mergedAnimationConfig.easing,\n } as React.CSSProperties)),\n }}\n >\n <DropZone\n position={0}\n listId={listId}\n isActive={activeDropZone === 0}\n onActivate={() => {\n activateDropZone(0)\n }}\n onDeactivate={() => {\n deactivateDropZone(0)\n }}\n onDrop={(fromPosition: number) => {\n if (!pendingReorderRef.current) {\n moveItem(fromPosition, 0, 'dragdrop')\n }\n }}\n className={dropZoneClassName}\n />\n\n {itemOrder.map((itemIndex, position) => {\n const item = items[itemIndex]\n if (!item) return null\n\n return (\n <div key={`item-container-${item.id || itemIndex}-${position}`}>\n <ReorderableItem\n key={`item-${item.id || itemIndex}`}\n item={item}\n index={position}\n moveItem={moveItem}\n itemCount={items.length}\n itemIndex={itemIndex}\n listId={listId}\n isDraggingAny={isDragging}\n setIsDragging={setIsDragging}\n isReorderingActive={isReorderingActive}\n setIsReorderingActive={setIsReorderingActive}\n isCurrentlyReordering={isReorderingActive && reorderingItemIndex === position}\n setReorderingItemIndex={setReorderingItemIndex}\n renderDragHandle={renderDragHandle}\n className={itemClassName}\n />\n\n <DropZone\n position={position + 1}\n listId={listId}\n isActive={activeDropZone === position + 1}\n onActivate={() => {\n activateDropZone(position + 1)\n }}\n onDeactivate={() => {\n deactivateDropZone(position + 1)\n }}\n onDrop={(fromPosition: number) => {\n if (!pendingReorderRef.current) {\n moveItem(fromPosition, position + 1, 'dragdrop')\n }\n }}\n className={dropZoneClassName}\n />\n </div>\n )\n })}\n </div>\n </DndProvider>\n )\n}\n"],"names":["generateUniqueListId","prefix","reorderArray","array","from","to","newArray","removed","calculateNewOrder","currentOrder","fromPosition","toPosition","adjustTargetPosition","source","DEFAULT_ANIMATION_CONFIG","ReorderableList","items","label","onReorder","className","animationConfig","disabled","renderDragHandle","dropZoneClassName","itemClassName","listId","useRef","itemOrder","setItemOrder","useState","_","i","activeDropZone","setActiveDropZone","isDragging","setIsDragging","isReorderingActive","setIsReorderingActive","reorderingItemIndex","setReorderingItemIndex","pendingReorderRef","activeDropZonesRef","mergedAnimationConfig","useMemo","useEffect","activateDropZone","useCallback","position","deactivateDropZone","activeDropZones","isActive","pos","moveItem","movedItemIndex","newOrder","animationDuration","newPosition","idx","dragButtons","styles","jsx","classnames","itemIndex","item","DndProvider","HTML5Backend","jsxs","DropZone","ReorderableItem"],"mappings":";;;;;;;;AAWA,SAASA,EAAqBC,IAAS,oBAA4B;AACjE,SAAO,GAAGA,CAAM,IAAI,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;AAC5D;AAEA,SAASC,EAAgBC,GAAYC,GAAcC,GAAiB;AAClE,MAAID,MAASC,KAAMD,IAAO,KAAKA,KAAQD,EAAM,UAAUE,IAAK,KAAKA,IAAKF,EAAM;AAC1E,WAAO,CAAC,GAAGA,CAAK;AAGlB,QAAMG,IAAW,CAAC,GAAGH,CAAK,GACpB,CAACI,CAAO,IAAID,EAAS,OAAOF,GAAM,CAAC;AAEzC,SAAIG,MAAY,SACP,CAAC,GAAGJ,CAAK,KAGlBG,EAAS,OAAOD,GAAI,GAAGE,CAAO,GACvBD;AACT;AAEA,SAASE,EACPC,GACAC,GACAC,GACU;AACV,SACED,MAAiBC,KACjBD,IAAe,KACfA,KAAgBD,EAAa,UAC7BE,IAAa,KACbA,IAAaF,EAAa,SAEnB,CAAC,GAAGA,CAAY,IAGlBP,EAAaO,GAAcC,GAAcC,CAAU;AAC5D;AAEA,S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AQ,CAACrC,MAAyB;AAChC,kBAAK8B,EAAkB,WACrBY,EAAS1C,GAAcqC,IAAW,GAAG,UAAU;AAAA,gBAEnD;AAAA,gBACA,WAAWxB;AAAA,cAAA;AAAA,YAAA;AAAA,UACb,KAnCQ,kBAAkBwC,EAAK,MAAMD,CAAS,IAAIf,CAAQ,EAoC5D,IAvCgB;AAAA,QAyCpB,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;"}
@@ -1,6 +1,10 @@
1
1
  import { ReactElement } from 'react';
2
+ /** @internal */
2
3
  export interface ReorderableListItem {
4
+ /** Rendered content displayed inside the reorderable row. */
3
5
  content: ReactElement;
6
+ /** Accessible name announced for the item by screen readers. */
4
7
  label: string;
8
+ /** Stable identifier used as a React key; falls back to the item's index when omitted. */
5
9
  id?: string;
6
10
  }
@@ -1,4 +1,2 @@
1
- /**
2
- * Define item type for react-dnd with a unique identifier to avoid conflicts
3
- */
1
+ /** @internal */
4
2
  export declare const ITEM_TYPE = "reorderable-item";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/components/Common/ReorderableList/constants.ts"],"sourcesContent":["/**\n * Define item type for react-dnd with a unique identifier to avoid conflicts\n */\nexport const ITEM_TYPE = 'reorderable-item'\n"],"names":["ITEM_TYPE"],"mappings":"AAGO,MAAMA,IAAY;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/components/Common/ReorderableList/constants.ts"],"sourcesContent":["/** @internal */\nexport const ITEM_TYPE = 'reorderable-item'\n"],"names":["ITEM_TYPE"],"mappings":"AACO,MAAMA,IAAY;"}
@@ -5,5 +5,6 @@ interface RequirementsListProps {
5
5
  completed: boolean;
6
6
  }[];
7
7
  }
8
+ /** @internal */
8
9
  export declare const RequirementsList: ({ requirements }: RequirementsListProps) => import("react").JSX.Element;
9
10
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"RequirementsList.js","sources":["../../../../src/components/Common/RequirementsList/RequirementsList.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useId } from 'react'\nimport { Flex } from '../Flex/Flex'\nimport styles from './RequirementsList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport SuccessCheck from '@/assets/icons/checkbox.svg?react'\n\ninterface RequirementsListProps {\n requirements: {\n title: string\n description: string\n completed: boolean\n }[]\n}\nexport const RequirementsList = ({ requirements }: RequirementsListProps) => {\n const Components = useComponentContext()\n const id = useId()\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={8}>\n <Components.UnorderedList\n className={styles.list}\n items={requirements\n .sort((a, b) => (a.completed ? -1 : 1))\n .map((step, i) => {\n return (\n <div key={`${id}-${i}-${step.description}`} className={styles.listItem}>\n {step.completed ? (\n <div className={classNames(styles.listItemIcon, styles.success)}>\n <SuccessCheck width={16} height={16} />\n </div>\n ) : (\n <div className={styles.listItemIcon}>{i + 1}</div>\n )}\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text size=\"md\" weight=\"medium\">\n {step.title}\n </Components.Text>\n <Components.Text variant=\"supporting\">{step.description}</Components.Text>\n </Flex>\n </div>\n )\n })}\n />\n </Flex>\n )\n}\n"],"names":["RequirementsList","requirements","Components","useComponentContext","id","useId","Flex","jsx","styles","a","b","step","i","jsxs","classNames","SuccessCheck"],"mappings":";;;;;;;AAcO,MAAMA,IAAmB,CAAC,EAAE,cAAAC,QAA0C;AAC3E,QAAMC,IAAaC,EAAA,GACbC,IAAKC,EAAA;AAEX,2BACGC,GAAA,EAAK,eAAc,UAAS,YAAW,cAAa,KAAK,GACxD,UAAA,gBAAAC;AAAA,IAACL,EAAW;AAAA,IAAX;AAAA,MACC,WAAWM,EAAO;AAAA,MAClB,OAAOP,EACJ,KAAK,CAACQ,GAAGC,MAAOD,EAAE,YAAY,KAAK,CAAE,EACrC,IAAI,CAACE,GAAMC,MAER,gBAAAC,EAAC,OAAA,EAA2C,WAAWL,EAAO,UAC3D,UAAA;AAAA,QAAAG,EAAK,YACJ,gBAAAJ,EAAC,OAAA,EAAI,WAAWO,EAAWN,EAAO,cAAcA,EAAO,OAAO,GAC5D,UAAA,gBAAAD,EAACQ,GAAA,EAAa,OAAO,IAAI,QAAQ,GAAA,CAAI,EAAA,CACvC,IAEA,gBAAAR,EAAC,SAAI,WAAWC,EAAO,cAAe,UAAAI,IAAI,EAAA,CAAE;AAAA,QAE9C,gBAAAC,EAACP,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAC,EAACL,EAAW,MAAX,EAAgB,MAAK,MAAK,QAAO,UAC/B,YAAK,MAAA,CACR;AAAA,4BACCA,EAAW,MAAX,EAAgB,SAAQ,cAAc,YAAK,YAAA,CAAY;AAAA,QAAA,EAAA,CAC1D;AAAA,MAAA,KAbQ,GAAGE,CAAE,IAAIQ,CAAC,IAAID,EAAK,WAAW,EAcxC,CAEH;AAAA,IAAA;AAAA,EAAA,GAEP;AAEJ;"}
1
+ {"version":3,"file":"RequirementsList.js","sources":["../../../../src/components/Common/RequirementsList/RequirementsList.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useId } from 'react'\nimport { Flex } from '../Flex/Flex'\nimport styles from './RequirementsList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport SuccessCheck from '@/assets/icons/checkbox.svg?react'\n\ninterface RequirementsListProps {\n requirements: {\n title: string\n description: string\n completed: boolean\n }[]\n}\n/** @internal */\nexport const RequirementsList = ({ requirements }: RequirementsListProps) => {\n const Components = useComponentContext()\n const id = useId()\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={8}>\n <Components.UnorderedList\n className={styles.list}\n items={requirements\n .sort((a, b) => (a.completed ? -1 : 1))\n .map((step, i) => {\n return (\n <div key={`${id}-${i}-${step.description}`} className={styles.listItem}>\n {step.completed ? (\n <div className={classNames(styles.listItemIcon, styles.success)}>\n <SuccessCheck width={16} height={16} />\n </div>\n ) : (\n <div className={styles.listItemIcon}>{i + 1}</div>\n )}\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text size=\"md\" weight=\"medium\">\n {step.title}\n </Components.Text>\n <Components.Text variant=\"supporting\">{step.description}</Components.Text>\n </Flex>\n </div>\n )\n })}\n />\n </Flex>\n )\n}\n"],"names":["RequirementsList","requirements","Components","useComponentContext","id","useId","Flex","jsx","styles","a","b","step","i","jsxs","classNames","SuccessCheck"],"mappings":";;;;;;;AAeO,MAAMA,IAAmB,CAAC,EAAE,cAAAC,QAA0C;AAC3E,QAAMC,IAAaC,EAAA,GACbC,IAAKC,EAAA;AAEX,2BACGC,GAAA,EAAK,eAAc,UAAS,YAAW,cAAa,KAAK,GACxD,UAAA,gBAAAC;AAAA,IAACL,EAAW;AAAA,IAAX;AAAA,MACC,WAAWM,EAAO;AAAA,MAClB,OAAOP,EACJ,KAAK,CAACQ,GAAGC,MAAOD,EAAE,YAAY,KAAK,CAAE,EACrC,IAAI,CAACE,GAAMC,MAER,gBAAAC,EAAC,OAAA,EAA2C,WAAWL,EAAO,UAC3D,UAAA;AAAA,QAAAG,EAAK,YACJ,gBAAAJ,EAAC,OAAA,EAAI,WAAWO,EAAWN,EAAO,cAAcA,EAAO,OAAO,GAC5D,UAAA,gBAAAD,EAACQ,GAAA,EAAa,OAAO,IAAI,QAAQ,GAAA,CAAI,EAAA,CACvC,IAEA,gBAAAR,EAAC,SAAI,WAAWC,EAAO,cAAe,UAAAI,IAAI,EAAA,CAAE;AAAA,QAE9C,gBAAAC,EAACP,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAC,EAACL,EAAW,MAAX,EAAgB,MAAK,MAAK,QAAO,UAC/B,YAAK,MAAA,CACR;AAAA,4BACCA,EAAW,MAAX,EAAgB,SAAQ,cAAc,YAAK,YAAA,CAAY;AAAA,QAAA,EAAA,CAC1D;AAAA,MAAA,KAbQ,GAAGE,CAAE,IAAIQ,CAAC,IAAID,EAAK,WAAW,EAcxC,CAEH;AAAA,IAAA;AAAA,EAAA,GAEP;AAEJ;"}
@@ -18,13 +18,20 @@ type TextInputProps = {
18
18
  type?: string;
19
19
  isPercent?: boolean;
20
20
  };
21
+ /** @internal */
21
22
  export declare function QuestionInput({ questionType, ...props }: (EmpQ | CompR) & {
22
23
  questionType: string;
23
24
  }): import("react").JSX.Element;
25
+ /** @internal */
24
26
  export declare function SelectInput({ question, requirement, isDisabled }: EmpQ | CompR): import("react").JSX.Element | null;
27
+ /** @internal */
25
28
  export declare function TextInput({ question, requirement, isDisabled, type, isPercent, }: (EmpQ | CompR) & TextInputProps): import("react").JSX.Element | null;
29
+ /** @internal */
26
30
  export declare function NumberInput({ question, requirement, isCurrency, isPercent, isDisabled, }: (EmpQ | CompR) & NumberFieldProps): import("react").JSX.Element | null;
31
+ /** @internal */
27
32
  export declare function RadioInput({ question, requirement, isDisabled }: EmpQ | CompR): import("react").JSX.Element | null;
33
+ /** @internal */
28
34
  export declare function DateField({ question, requirement, isDisabled, }: (EmpQ | CompR) & NumberFieldProps): import("react").JSX.Element | null;
35
+ /** @internal */
29
36
  export declare function TaxRateInput({ requirement, question, ...props }: EmpQ | CompR): import("react").JSX.Element;
30
37
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"TaxInputs.js","sources":["../../../../src/components/Common/TaxInputs/TaxInputs.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport type { EmployeeStateTaxQuestion } from '@gusto/embedded-api-v-2025-11-15/models/components/employeestatetaxquestion'\nimport { type TaxRequirement } from '@gusto/embedded-api-v-2025-11-15/models/components/taxrequirement'\nimport { useTranslation } from 'react-i18next'\nimport { SelectField } from '../Fields/SelectField/SelectField'\nimport { TextInputField } from '../Fields/TextInputField/TextInputField'\nimport { NumberInputField } from '../Fields/NumberInputField/NumberInputField'\nimport { RadioGroupField } from '../Fields/RadioGroupField/RadioGroupField'\nimport { DatePickerField } from '../Fields/DatePickerField/DatePickerField'\nimport { PercentageField } from '../Fields/PercentageField/PercentageField'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useLocale } from '@/contexts/LocaleProvider'\nimport { useMaskedTransform } from '@/helpers/mask'\nimport { formatPercentLabel } from '@/helpers/percentageConversion'\n\nconst dompurifyConfig = { ALLOWED_TAGS: ['a', 'b', 'strong'], ALLOWED_ATTR: ['target', 'href'] }\n\ninterface EmpQ {\n question: NonNullable<EmployeeStateTaxQuestion>\n requirement?: never\n isDisabled?: boolean\n}\ninterface CompR {\n requirement: TaxRequirement\n question?: never\n isDisabled?: boolean\n}\n\ntype NumberFieldProps = { isCurrency?: boolean; isPercent?: boolean }\n\ntype TextInputProps = { type?: string; isPercent?: boolean }\n\nexport function QuestionInput({\n questionType,\n ...props\n}: (EmpQ | CompR) & {\n questionType: string\n}) {\n switch (questionType.toLowerCase()) {\n case 'date':\n return <DateField {...props} />\n case 'radio':\n return <RadioInput {...props} />\n case 'text':\n case 'account_number': //TODO: temporary - need special handling for account numbers\n return <TextInput {...props} />\n case 'select':\n return <SelectInput {...props} />\n case 'number':\n return <NumberInput {...props} />\n case 'workers_compensation_rate':\n return (\n <NumberInput {...props} isPercent={props.requirement?.metadata?.rateType === 'percent'} />\n )\n case 'percent':\n case 'tax_rate':\n return <TaxRateInput {...props} />\n case 'currency':\n return <NumberInput {...props} isCurrency />\n default:\n return <TextInput {...props} />\n // return null\n }\n}\n\nexport function SelectInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error('Select input must have options')\n\n if (!key) return null\n\n return (\n <SelectField\n isRequired\n name={key}\n defaultValue={value}\n label={label as string}\n description={description}\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n options={meta.options.map((item, _) => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n\nexport function TextInput({\n question,\n requirement,\n isDisabled = false,\n type = 'text',\n isPercent = false,\n}: (EmpQ | CompR) & TextInputProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const mask = requirement?.metadata?.mask ?? null\n const transform = useMaskedTransform(mask)\n\n if (!key) return null\n return (\n <TextInputField\n isRequired\n name={key}\n label={label}\n // @ts-expect-error HACK value is insufficiently narrowed here\n defaultValue={value}\n description={description}\n isDisabled={isDisabled}\n transform={mask ? transform : undefined}\n placeholder={mask ? mask : undefined}\n type={type}\n adornmentEnd={isPercent ? '%' : undefined}\n />\n )\n}\n\nexport function NumberInput({\n question,\n requirement,\n isCurrency,\n isPercent,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { t } = useTranslation('common')\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n if (!key) return null\n\n const wcDescription =\n requirement?.metadata?.type === 'workers_compensation_rate' &&\n requirement.metadata.riskClassCode !== undefined\n ? `${requirement.metadata.riskClassCode}: ${requirement.metadata.riskClassDescription}`\n : null\n const adornmentEnd =\n requirement?.metadata?.rateType === 'currency_per_hour'\n ? t('inputs.workersCompensationRatePerHourAdornment')\n : undefined\n\n return (\n <NumberInputField\n isRequired\n name={key}\n label={label}\n description={description ?? wcDescription}\n defaultValue={value !== undefined && value !== null ? Number(value) : undefined}\n format={isCurrency ? 'currency' : isPercent ? 'percent' : 'decimal'}\n isDisabled={isDisabled}\n maximumFractionDigits={isPercent ? 4 : undefined}\n adornmentEnd={adornmentEnd}\n />\n )\n}\n\nexport function RadioInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const { Text } = useComponentContext()\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error(`RadioInput must have options:${JSON.stringify(question)}`)\n\n if (!key) return null\n\n return (\n <RadioGroupField\n isRequired\n name={key}\n //File new hire report setting cannot be changed after it has been configured.\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n description={\n description && (\n <Text as=\"span\">\n <span\n dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(description, dompurifyConfig) }}\n />\n </Text>\n )\n }\n label={label as string}\n options={meta.options.map(item => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n//TODO: This type is untested as of yet\nexport function DateField({\n question,\n requirement,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n if (typeof value !== 'string' && typeof value !== 'undefined')\n throw new Error('Expecting value to be string for DateInput')\n\n if (!key) return null\n\n return (\n <DatePickerField\n isRequired\n name={key}\n defaultValue={value ? new Date(value) : null}\n label={label as string}\n description={description}\n isDisabled={isDisabled}\n />\n )\n}\n\nexport function TaxRateInput({ requirement, question, ...props }: EmpQ | CompR) {\n const { locale } = useLocale()\n\n if (requirement) {\n const { key, metadata, label, description } = requirement\n const { validation } = metadata || {}\n\n if (validation?.type === 'one_of') {\n return (\n <SelectField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n options={\n validation.rates?.map(rate => ({\n value: rate,\n label: formatPercentLabel(rate, locale),\n })) || []\n }\n />\n )\n }\n\n return (\n <PercentageField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n decimalValue={requirement.value}\n decimalMin={validation?.min}\n decimalMax={validation?.max}\n isDisabled={props.isDisabled}\n />\n )\n }\n\n const { key, label, description, answers } = question\n return (\n <PercentageField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n decimalValue={answers[0]?.value}\n isDisabled={props.isDisabled}\n />\n )\n}\n"],"names":["dompurifyConfig","QuestionInput","questionType","props","jsx","DateField","RadioInput","TextInput","SelectInput","NumberInput","TaxRateInput","question","requirement","isDisabled","key","label","description","value","meta","SelectField","item","_","type","isPercent","mask","transform","useMaskedTransform","TextInputField","isCurrency","t","useTranslation","wcDescription","adornmentEnd","NumberInputField","Text","useComponentContext","RadioGroupField","DOMPurify","DatePickerField","locale","useLocale","metadata","validation","rate","formatPercentLabel","PercentageField","answers"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,IAAkB,EAAE,cAAc,CAAC,KAAK,KAAK,QAAQ,GAAG,cAAc,CAAC,UAAU,MAAM,EAAA;AAiBtF,SAASC,EAAc;AAAA,EAC5B,cAAAC;AAAA,EACA,GAAGC;AACL,GAEG;AACD,UAAQD,EAAa,eAAY;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAE,EAACC,GAAA,EAAW,GAAGF,EAAA,CAAO;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAC,EAACE,GAAA,EAAY,GAAGH,EAAA,CAAO;AAAA,IAChC,KAAK;AAAA,IACL,KAAK;AACH,aAAO,gBAAAC,EAACG,GAAA,EAAW,GAAGJ,EAAA,CAAO;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAC,EAACI,GAAA,EAAa,GAAGL,EAAA,CAAO;AAAA,IACjC,KAAK;AACH,aAAO,gBAAAC,EAACK,GAAA,EAAa,GAAGN,EAAA,CAAO;AAAA,IACjC,KAAK;AACH,aACE,gBAAAC,EAACK,KAAa,GAAGN,GAAO,WAAWA,EAAM,aAAa,UAAU,aAAa,UAAA,CAAW;AAAA,IAE5F,KAAK;AAAA,IACL,KAAK;AACH,aAAO,gBAAAC,EAACM,GAAA,EAAc,GAAGP,EAAA,CAAO;AAAA,IAClC,KAAK;AACH,aAAO,gBAAAC,EAACK,GAAA,EAAa,GAAGN,GAAO,YAAU,IAAC;AAAA,IAC5C;AACE,aAAO,gBAAAC,EAACG,GAAA,EAAW,GAAGJ,EAAA,CAAO;AAAA,EAAA;AAGnC;AAEO,SAASK,EAAY,EAAE,UAAAG,GAAU,aAAAC,GAAa,YAAAC,IAAa,MAAuB;AACvF,QAAM,EAAE,KAAAC,GAAK,OAAAC,GAAO,aAAAC,EAAA,IAAgBL,KAAsBC,GACpDK,IAAQN,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E,YAAA8B,MAAeD,KAAY,CAAA;AAEnC,WAAIC,GAAY,SAAS,WAErB,gBAAAtC;AAAA,MAACe;AAAA,MAAA;AAAA,QACC,YAAU;AAAA,QACV,MAAML,KAAO;AAAA,QACb,OAAOC,KAAS;AAAA,QAChB,aAAaC;AAAAA,QACb,SACE0B,EAAW,OAAO,IAAI,CAAAC,OAAS;AAAA,UAC7B,OAAOA;AAAA,UACP,OAAOC,EAAmBD,GAAMJ,CAAM;AAAA,QAAA,EACtC,KAAK,CAAA;AAAA,MAAC;AAAA,IAAA,IAOd,gBAAAnC;AAAA,MAACyC;AAAA,MAAA;AAAA,QACC,YAAU;AAAA,QACV,MAAM/B,KAAO;AAAA,QACb,OAAOC,KAAS;AAAA,QAChB,aAAaC;AAAAA,QACb,cAAcJ,EAAY;AAAA,QAC1B,YAAY8B,GAAY;AAAA,QACxB,YAAYA,GAAY;AAAA,QACxB,YAAYvC,EAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAGxB;AAEA,QAAM,EAAE,KAAAW,GAAK,OAAAC,GAAO,aAAAC,GAAa,SAAA8B,MAAYnC;AAC7C,SACE,gBAAAP;AAAA,IAACyC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,MAAM/B,KAAO;AAAA,MACb,OAAOC,KAAS;AAAA,MAChB,aAAAC;AAAA,MACA,cAAc8B,EAAQ,CAAC,GAAG;AAAA,MAC1B,YAAY3C,EAAM;AAAA,IAAA;AAAA,EAAA;AAGxB;"}
1
+ {"version":3,"file":"TaxInputs.js","sources":["../../../../src/components/Common/TaxInputs/TaxInputs.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport type { EmployeeStateTaxQuestion } from '@gusto/embedded-api-v-2025-11-15/models/components/employeestatetaxquestion'\nimport { type TaxRequirement } from '@gusto/embedded-api-v-2025-11-15/models/components/taxrequirement'\nimport { useTranslation } from 'react-i18next'\nimport { SelectField } from '../Fields/SelectField/SelectField'\nimport { TextInputField } from '../Fields/TextInputField/TextInputField'\nimport { NumberInputField } from '../Fields/NumberInputField/NumberInputField'\nimport { RadioGroupField } from '../Fields/RadioGroupField/RadioGroupField'\nimport { DatePickerField } from '../Fields/DatePickerField/DatePickerField'\nimport { PercentageField } from '../Fields/PercentageField/PercentageField'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useLocale } from '@/contexts/LocaleProvider'\nimport { useMaskedTransform } from '@/helpers/mask'\nimport { formatPercentLabel } from '@/helpers/percentageConversion'\n\nconst dompurifyConfig = { ALLOWED_TAGS: ['a', 'b', 'strong'], ALLOWED_ATTR: ['target', 'href'] }\n\ninterface EmpQ {\n question: NonNullable<EmployeeStateTaxQuestion>\n requirement?: never\n isDisabled?: boolean\n}\ninterface CompR {\n requirement: TaxRequirement\n question?: never\n isDisabled?: boolean\n}\n\ntype NumberFieldProps = { isCurrency?: boolean; isPercent?: boolean }\n\ntype TextInputProps = { type?: string; isPercent?: boolean }\n\n/** @internal */\nexport function QuestionInput({\n questionType,\n ...props\n}: (EmpQ | CompR) & {\n questionType: string\n}) {\n switch (questionType.toLowerCase()) {\n case 'date':\n return <DateField {...props} />\n case 'radio':\n return <RadioInput {...props} />\n case 'text':\n case 'account_number': //TODO: temporary - need special handling for account numbers\n return <TextInput {...props} />\n case 'select':\n return <SelectInput {...props} />\n case 'number':\n return <NumberInput {...props} />\n case 'workers_compensation_rate':\n return (\n <NumberInput {...props} isPercent={props.requirement?.metadata?.rateType === 'percent'} />\n )\n case 'percent':\n case 'tax_rate':\n return <TaxRateInput {...props} />\n case 'currency':\n return <NumberInput {...props} isCurrency />\n default:\n return <TextInput {...props} />\n // return null\n }\n}\n\n/** @internal */\nexport function SelectInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error('Select input must have options')\n\n if (!key) return null\n\n return (\n <SelectField\n isRequired\n name={key}\n defaultValue={value}\n label={label as string}\n description={description}\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n options={meta.options.map((item, _) => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n\n/** @internal */\nexport function TextInput({\n question,\n requirement,\n isDisabled = false,\n type = 'text',\n isPercent = false,\n}: (EmpQ | CompR) & TextInputProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const mask = requirement?.metadata?.mask ?? null\n const transform = useMaskedTransform(mask)\n\n if (!key) return null\n return (\n <TextInputField\n isRequired\n name={key}\n label={label}\n // @ts-expect-error HACK value is insufficiently narrowed here\n defaultValue={value}\n description={description}\n isDisabled={isDisabled}\n transform={mask ? transform : undefined}\n placeholder={mask ? mask : undefined}\n type={type}\n adornmentEnd={isPercent ? '%' : undefined}\n />\n )\n}\n\n/** @internal */\nexport function NumberInput({\n question,\n requirement,\n isCurrency,\n isPercent,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { t } = useTranslation('common')\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n\n if (!key) return null\n\n const wcDescription =\n requirement?.metadata?.type === 'workers_compensation_rate' &&\n requirement.metadata.riskClassCode !== undefined\n ? `${requirement.metadata.riskClassCode}: ${requirement.metadata.riskClassDescription}`\n : null\n const adornmentEnd =\n requirement?.metadata?.rateType === 'currency_per_hour'\n ? t('inputs.workersCompensationRatePerHourAdornment')\n : undefined\n\n return (\n <NumberInputField\n isRequired\n name={key}\n label={label}\n description={description ?? wcDescription}\n defaultValue={value !== undefined && value !== null ? Number(value) : undefined}\n format={isCurrency ? 'currency' : isPercent ? 'percent' : 'decimal'}\n isDisabled={isDisabled}\n maximumFractionDigits={isPercent ? 4 : undefined}\n adornmentEnd={adornmentEnd}\n />\n )\n}\n\n/** @internal */\nexport function RadioInput({ question, requirement, isDisabled = false }: EmpQ | CompR) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n const { Text } = useComponentContext()\n\n const meta = question ? question.inputQuestionFormat : requirement.metadata\n if (!meta?.options) throw new Error(`RadioInput must have options:${JSON.stringify(question)}`)\n\n if (!key) return null\n\n return (\n <RadioGroupField\n isRequired\n name={key}\n //File new hire report setting cannot be changed after it has been configured.\n isDisabled={\n key.includes('fileNewHireReport') ? (value === undefined ? false : true) : isDisabled\n }\n description={\n description && (\n <Text as=\"span\">\n <span\n dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(description, dompurifyConfig) }}\n />\n </Text>\n )\n }\n label={label as string}\n options={meta.options.map(item => ({\n value: item.value,\n label: item.label,\n }))}\n />\n )\n}\n//TODO: This type is untested as of yet\n/** @internal */\nexport function DateField({\n question,\n requirement,\n isDisabled = false,\n}: (EmpQ | CompR) & NumberFieldProps) {\n const { key, label, description } = question ? question : requirement\n const value = question ? question.answers[0]?.value : requirement.value\n if (typeof value !== 'string' && typeof value !== 'undefined')\n throw new Error('Expecting value to be string for DateInput')\n\n if (!key) return null\n\n return (\n <DatePickerField\n isRequired\n name={key}\n defaultValue={value ? new Date(value) : null}\n label={label as string}\n description={description}\n isDisabled={isDisabled}\n />\n )\n}\n\n/** @internal */\nexport function TaxRateInput({ requirement, question, ...props }: EmpQ | CompR) {\n const { locale } = useLocale()\n\n if (requirement) {\n const { key, metadata, label, description } = requirement\n const { validation } = metadata || {}\n\n if (validation?.type === 'one_of') {\n return (\n <SelectField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n options={\n validation.rates?.map(rate => ({\n value: rate,\n label: formatPercentLabel(rate, locale),\n })) || []\n }\n />\n )\n }\n\n return (\n <PercentageField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n decimalValue={requirement.value}\n decimalMin={validation?.min}\n decimalMax={validation?.max}\n isDisabled={props.isDisabled}\n />\n )\n }\n\n const { key, label, description, answers } = question\n return (\n <PercentageField\n isRequired\n name={key || ''}\n label={label || ''}\n description={description}\n decimalValue={answers[0]?.value}\n isDisabled={props.isDisabled}\n />\n )\n}\n"],"names":["dompurifyConfig","QuestionInput","questionType","props","jsx","DateField","RadioInput","TextInput","SelectInput","NumberInput","TaxRateInput","question","requirement","isDisabled","key","label","description","value","meta","SelectField","item","_","type","isPercent","mask","transform","useMaskedTransform","TextInputField","isCurrency","t","useTranslation","wcDescription","adornmentEnd","NumberInputField","Text","useComponentContext","RadioGroupField","DOMPurify","DatePickerField","locale","useLocale","metadata","validation","rate","formatPercentLabel","PercentageField","answers"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,IAAkB,EAAE,cAAc,CAAC,KAAK,KAAK,QAAQ,GAAG,cAAc,CAAC,UAAU,MAAM,EAAA;AAkBtF,SAASC,EAAc;AAAA,EAC5B,cAAAC;AAAA,EACA,GAAGC;AACL,GAEG;AACD,UAAQD,EAAa,eAAY;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAE,EAACC,GAAA,EAAW,GAAGF,EAAA,CAAO;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAC,EAACE,GAAA,EAAY,GAAGH,EAAA,CAAO;AAAA,IAChC,KAAK;AAAA,IACL,KAAK;AACH,aAAO,gBAAAC,EAACG,GAAA,EAAW,GAAGJ,EAAA,CAAO;AAAA,IAC/B,KAAK;AACH,aAAO,gBAAAC,EAACI,GAAA,EAAa,GAAGL,EAAA,CAAO;AAAA,IACjC,KAAK;AACH,aAAO,gBAAAC,EAACK,GAAA,EAAa,GAAGN,EAAA,CAAO;AAAA,IACjC,KAAK;AACH,aACE,gBAAAC,EAACK,KAAa,GAAGN,GAAO,WAAWA,EAAM,aAAa,UAAU,aAAa,UAAA,CAAW;AAAA,IAE5F,KAAK;AAAA,IACL,KAAK;AACH,aAAO,gBAAAC,EAACM,GAAA,EAAc,GAAGP,EAAA,CAAO;AAAA,IAClC,KAAK;AACH,aAAO,gBAAAC,EAACK,GAAA,EAAa,GAAGN,GAAO,YAAU,IAAC;AAAA,IAC5C;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
3
4
  onClose: () => void;
@@ -1,4 +1,5 @@
1
1
  import { HTMLAttributes, default as React } from 'react';
2
+ /** @internal */
2
3
  export interface VisuallyHiddenProps extends HTMLAttributes<HTMLDivElement> {
3
4
  /**
4
5
  * The element to render the visually hidden content as.
@@ -10,4 +11,5 @@ export interface VisuallyHiddenProps extends HTMLAttributes<HTMLDivElement> {
10
11
  */
11
12
  children: React.ReactNode;
12
13
  }
14
+ /** @internal */
13
15
  export declare function VisuallyHidden({ as: Component, children, className, ...props }: VisuallyHiddenProps): React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"VisuallyHidden.js","sources":["../../../../src/components/Common/VisuallyHidden/VisuallyHidden.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react'\nimport type React from 'react'\nimport classnames from 'classnames'\nimport styles from './VisuallyHidden.module.scss'\n\nexport interface VisuallyHiddenProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The element to render the visually hidden content as.\n * @defaultValue 'div'\n */\n as?: React.ElementType\n /**\n * The content to hide visually but keep available for screen readers.\n */\n children: React.ReactNode\n}\n\nexport function VisuallyHidden({\n as: Component = 'div',\n children,\n className,\n ...props\n}: VisuallyHiddenProps) {\n return (\n <Component {...props} className={classnames(styles.visuallyHidden, className)}>\n {children}\n </Component>\n )\n}\n"],"names":["VisuallyHidden","Component","children","className","props","jsx","classnames","styles"],"mappings":";;;AAiBO,SAASA,EAAe;AAAA,EAC7B,IAAIC,IAAY;AAAA,EAChB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAAwB;AACtB,SACE,gBAAAC,EAACJ,GAAA,EAAW,GAAGG,GAAO,WAAWE,EAAWC,EAAO,gBAAgBJ,CAAS,GACzE,UAAAD,EAAA,CACH;AAEJ;"}
1
+ {"version":3,"file":"VisuallyHidden.js","sources":["../../../../src/components/Common/VisuallyHidden/VisuallyHidden.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react'\nimport type React from 'react'\nimport classnames from 'classnames'\nimport styles from './VisuallyHidden.module.scss'\n\n/** @internal */\nexport interface VisuallyHiddenProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The element to render the visually hidden content as.\n * @defaultValue 'div'\n */\n as?: React.ElementType\n /**\n * The content to hide visually but keep available for screen readers.\n */\n children: React.ReactNode\n}\n\n/** @internal */\nexport function VisuallyHidden({\n as: Component = 'div',\n children,\n className,\n ...props\n}: VisuallyHiddenProps) {\n return (\n <Component {...props} className={classnames(styles.visuallyHidden, className)}>\n {children}\n </Component>\n )\n}\n"],"names":["VisuallyHidden","Component","children","className","props","jsx","classnames","styles"],"mappings":";;;AAmBO,SAASA,EAAe;AAAA,EAC7B,IAAIC,IAAY;AAAA,EAChB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAAwB;AACtB,SACE,gBAAAC,EAACJ,GAAA,EAAW,GAAGG,GAAO,WAAWE,EAAWC,EAAO,gBAAgBJ,CAAS,GACzE,UAAAD,EAAA,CACH;AAEJ;"}
@@ -1,13 +1,12 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { useTranslation as e } from "react-i18next";
3
3
  import { useAssignSignatory as s, SignatoryAssignmentMode as o } from "./useAssignSignatory.js";
4
- import r from "./AssignSignatorySelection.module.scss.js";
5
- import "../../../shared/constants.js";
6
- import { RadioGroupField as a } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
7
- const u = () => {
4
+ import a from "./AssignSignatorySelection.module.scss.js";
5
+ import { RadioGroupField as r } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
6
+ const c = () => {
8
7
  const { t: n } = e("Company.AssignSignatory"), { onSignatoryAssignmentModeChange: t } = s();
9
- return /* @__PURE__ */ i("section", { className: r.container, children: /* @__PURE__ */ i(
10
- a,
8
+ return /* @__PURE__ */ i("section", { className: a.container, children: /* @__PURE__ */ i(
9
+ r,
11
10
  {
12
11
  onChange: t,
13
12
  label: n("signingOptions.label"),
@@ -27,6 +26,6 @@ const u = () => {
27
26
  ) });
28
27
  };
29
28
  export {
30
- u as AssignSignatorySelection
29
+ c as AssignSignatorySelection
31
30
  };
32
31
  //# sourceMappingURL=AssignSignatorySelection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssignSignatorySelection.js","sources":["../../../../src/components/Company/AssignSignatory/AssignSignatorySelection.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SignatoryAssignmentMode, useAssignSignatory } from './useAssignSignatory'\nimport styles from './AssignSignatorySelection.module.scss'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const AssignSignatorySelection = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { onSignatoryAssignmentModeChange } = useAssignSignatory()\n\n return (\n <section className={styles.container}>\n <RadioGroupField\n onChange={onSignatoryAssignmentModeChange}\n label={t('signingOptions.label')}\n shouldVisuallyHideLabel\n name=\"signatoryAssignmentMode\"\n options={[\n {\n label: t('signingOptions.selfSign'),\n value: SignatoryAssignmentMode.createSignatory,\n },\n {\n label: t('signingOptions.appointOther'),\n value: SignatoryAssignmentMode.inviteSignatory,\n },\n ]}\n />\n </section>\n )\n}\n"],"names":["AssignSignatorySelection","t","useTranslation","onSignatoryAssignmentModeChange","useAssignSignatory","jsx","styles","RadioGroupField","SignatoryAssignmentMode"],"mappings":";;;;;;AAKO,MAAMA,IAA2B,MAAM;AAC5C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,iCAAAC,EAAA,IAAoCC,EAAA;AAE5C,SACE,gBAAAC,EAAC,WAAA,EAAQ,WAAWC,EAAO,WACzB,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAUJ;AAAA,MACV,OAAOF,EAAE,sBAAsB;AAAA,MAC/B,yBAAuB;AAAA,MACvB,MAAK;AAAA,MACL,SAAS;AAAA,QACP;AAAA,UACE,OAAOA,EAAE,yBAAyB;AAAA,UAClC,OAAOO,EAAwB;AAAA,QAAA;AAAA,QAEjC;AAAA,UACE,OAAOP,EAAE,6BAA6B;AAAA,UACtC,OAAOO,EAAwB;AAAA,QAAA;AAAA,MACjC;AAAA,IACF;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"AssignSignatorySelection.js","sources":["../../../../src/components/Company/AssignSignatory/AssignSignatorySelection.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { SignatoryAssignmentMode, useAssignSignatory } from './useAssignSignatory'\nimport styles from './AssignSignatorySelection.module.scss'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const AssignSignatorySelection = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { onSignatoryAssignmentModeChange } = useAssignSignatory()\n\n return (\n <section className={styles.container}>\n <RadioGroupField\n onChange={onSignatoryAssignmentModeChange}\n label={t('signingOptions.label')}\n shouldVisuallyHideLabel\n name=\"signatoryAssignmentMode\"\n options={[\n {\n label: t('signingOptions.selfSign'),\n value: SignatoryAssignmentMode.createSignatory,\n },\n {\n label: t('signingOptions.appointOther'),\n value: SignatoryAssignmentMode.inviteSignatory,\n },\n ]}\n />\n </section>\n )\n}\n"],"names":["AssignSignatorySelection","t","useTranslation","onSignatoryAssignmentModeChange","useAssignSignatory","jsx","styles","RadioGroupField","SignatoryAssignmentMode"],"mappings":";;;;;AAKO,MAAMA,IAA2B,MAAM;AAC5C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,iCAAAC,EAAA,IAAoCC,EAAA;AAE5C,SACE,gBAAAC,EAAC,WAAA,EAAQ,WAAWC,EAAO,WACzB,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAUJ;AAAA,MACV,OAAOF,EAAE,sBAAsB;AAAA,MAC/B,yBAAuB;AAAA,MACvB,MAAK;AAAA,MACL,SAAS;AAAA,QACP;AAAA,UACE,OAAOA,EAAE,yBAAyB;AAAA,UAClC,OAAOO,EAAwB;AAAA,QAAA;AAAA,QAEjC;AAAA,UACE,OAAOP,EAAE,6BAA6B;AAAA,UACtC,OAAOO,EAAwB;AAAA,QAAA;AAAA,MACjC;AAAA,IACF;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,14 +1,13 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { useTranslation as r } from "react-i18next";
3
- import { useCreateSignatory as s } from "./useCreateSignatory.js";
4
- import "../../../../shared/constants.js";
5
- import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
- import { useComponentContext as e } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
- const y = () => {
8
- const { t } = r("Company.AssignSignatory"), { isPending: n } = s(), i = e();
9
- return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("buttons.signDocuments") }) });
2
+ import { useTranslation as i } from "react-i18next";
3
+ import { useCreateSignatory as r } from "./useCreateSignatory.js";
4
+ import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
+ import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ const f = () => {
7
+ const { t } = i("Company.AssignSignatory"), { isPending: n } = r(), s = m();
8
+ return /* @__PURE__ */ o(e, { children: /* @__PURE__ */ o(s.Button, { type: "submit", isLoading: n, children: t("buttons.signDocuments") }) });
10
9
  };
11
10
  export {
12
- y as Actions
11
+ f as Actions
13
12
  };
14
13
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/AssignSignatory/CreateSignatory/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useCreateSignatory } from './useCreateSignatory'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { isPending } = useCreateSignatory()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('buttons.signDocuments')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useCreateSignatory","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,uBAAuB,GAC5B,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/AssignSignatory/CreateSignatory/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useCreateSignatory } from './useCreateSignatory'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { isPending } = useCreateSignatory()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('buttons.signDocuments')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useCreateSignatory","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,uBAAuB,GAC5B,GACF;AAEJ;"}
@@ -9,15 +9,13 @@ import "@gusto/embedded-api-v-2025-11-15/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api-v-2025-11-15/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api-v-2025-11-15/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api-v-2025-11-15/models/errors/httpclienterrors";
12
- import "dompurify";
13
- import "../../../../contexts/LocaleProvider/useLocale.js";
14
12
  import "../../../../shared/constants.js";
15
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
14
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
17
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
18
- const [f, v] = t("CreateSignatoryContext");
16
+ const [s, u] = t("CreateSignatoryContext");
19
17
  export {
20
- v as CreateSignatoryProvider,
21
- f as useCreateSignatory
18
+ u as CreateSignatoryProvider,
19
+ s as useCreateSignatory
22
20
  };
23
21
  //# sourceMappingURL=useCreateSignatory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCreateSignatory.js","sources":["../../../../../src/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api-v-2025-11-15/models/components/signatory'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport type CreateSignatoryDefaultValues = RequireAtLeastOne<\n Pick<Signatory, 'firstName' | 'lastName' | 'email' | 'title' | 'phone' | 'birthday'> &\n Pick<\n NonNullable<Signatory['homeAddress']>,\n 'street1' | 'street2' | 'city' | 'state' | 'zip'\n > & {\n ssn?: string\n }\n>\ntype CreateSignatoryContextType = {\n isPending: boolean\n currentSignatory?: Signatory\n}\n\nconst [useCreateSignatory, CreateSignatoryProvider] =\n createCompoundContext<CreateSignatoryContextType>('CreateSignatoryContext')\n\nexport { useCreateSignatory, CreateSignatoryProvider }\n"],"names":["useCreateSignatory","CreateSignatoryProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,MAAM,CAACA,GAAoBC,CAAuB,IAChDC,EAAkD,wBAAwB;"}
1
+ {"version":3,"file":"useCreateSignatory.js","sources":["../../../../../src/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api-v-2025-11-15/models/components/signatory'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport type CreateSignatoryDefaultValues = RequireAtLeastOne<\n Pick<Signatory, 'firstName' | 'lastName' | 'email' | 'title' | 'phone' | 'birthday'> &\n Pick<\n NonNullable<Signatory['homeAddress']>,\n 'street1' | 'street2' | 'city' | 'state' | 'zip'\n > & {\n ssn?: string\n }\n>\ntype CreateSignatoryContextType = {\n isPending: boolean\n currentSignatory?: Signatory\n}\n\nconst [useCreateSignatory, CreateSignatoryProvider] =\n createCompoundContext<CreateSignatoryContextType>('CreateSignatoryContext')\n\nexport { useCreateSignatory, CreateSignatoryProvider }\n"],"names":["useCreateSignatory","CreateSignatoryProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAM,CAACA,GAAoBC,CAAuB,IAChDC,EAAkD,wBAAwB;"}
@@ -1,14 +1,13 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as r } from "react-i18next";
3
3
  import { useInviteSignatory as s } from "./useInviteSignatory.js";
4
- import "../../../../shared/constants.js";
5
- import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
- import { useComponentContext as e } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
- const f = () => {
8
- const { t } = r("Company.AssignSignatory"), { isPending: n } = s(), i = e();
9
- return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("buttons.inviteSignatory") }) });
4
+ import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
+ import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ const y = () => {
7
+ const { t } = r("Company.AssignSignatory"), { isPending: n } = s(), i = m();
8
+ return /* @__PURE__ */ o(e, { children: /* @__PURE__ */ o(i.Button, { type: "submit", isLoading: n, children: t("buttons.inviteSignatory") }) });
10
9
  };
11
10
  export {
12
- f as Actions
11
+ y as Actions
13
12
  };
14
13
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInviteSignatory } from './useInviteSignatory'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { isPending } = useInviteSignatory()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('buttons.inviteSignatory')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useInviteSignatory","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,yBAAyB,GAC9B,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInviteSignatory } from './useInviteSignatory'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.AssignSignatory')\n const { isPending } = useInviteSignatory()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('buttons.inviteSignatory')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useInviteSignatory","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,yBAAyB,GAC9B,GACF;AAEJ;"}
@@ -9,15 +9,13 @@ import "@gusto/embedded-api-v-2025-11-15/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api-v-2025-11-15/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api-v-2025-11-15/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api-v-2025-11-15/models/errors/httpclienterrors";
12
- import "dompurify";
13
- import "../../../../contexts/LocaleProvider/useLocale.js";
14
12
  import "../../../../shared/constants.js";
15
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
14
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
17
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
18
- const [s, u] = t("InviteSignatoryContext");
16
+ const [c, d] = t("InviteSignatoryContext");
19
17
  export {
20
- u as InviteSignatoryProvider,
21
- s as useInviteSignatory
18
+ d as InviteSignatoryProvider,
19
+ c as useInviteSignatory
22
20
  };
23
21
  //# sourceMappingURL=useInviteSignatory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInviteSignatory.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api-v-2025-11-15/models/components/signatory'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\ntype InviteSignatoryContextType = {\n isPending: boolean\n}\n\nexport type InviteSignatoryDefaultValues = RequireAtLeastOne<\n Pick<Signatory, 'firstName' | 'lastName' | 'email' | 'title'> & {\n confirmEmail: string\n }\n>\n\nconst [useInviteSignatory, InviteSignatoryProvider] =\n createCompoundContext<InviteSignatoryContextType>('InviteSignatoryContext')\n\nexport { useInviteSignatory, InviteSignatoryProvider }\n"],"names":["useInviteSignatory","InviteSignatoryProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAcA,MAAM,CAACA,GAAoBC,CAAuB,IAChDC,EAAkD,wBAAwB;"}
1
+ {"version":3,"file":"useInviteSignatory.js","sources":["../../../../../src/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.ts"],"sourcesContent":["import { type Signatory } from '@gusto/embedded-api-v-2025-11-15/models/components/signatory'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\ntype InviteSignatoryContextType = {\n isPending: boolean\n}\n\nexport type InviteSignatoryDefaultValues = RequireAtLeastOne<\n Pick<Signatory, 'firstName' | 'lastName' | 'email' | 'title'> & {\n confirmEmail: string\n }\n>\n\nconst [useInviteSignatory, InviteSignatoryProvider] =\n createCompoundContext<InviteSignatoryContextType>('InviteSignatoryContext')\n\nexport { useInviteSignatory, InviteSignatoryProvider }\n"],"names":["useInviteSignatory","InviteSignatoryProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,CAACA,GAAoBC,CAAuB,IAChDC,EAAkD,wBAAwB;"}
@@ -9,19 +9,17 @@ import "@gusto/embedded-api-v-2025-11-15/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api-v-2025-11-15/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api-v-2025-11-15/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api-v-2025-11-15/models/errors/httpclienterrors";
12
- import "dompurify";
13
- import "../../../contexts/LocaleProvider/useLocale.js";
14
12
  import "../../../shared/constants.js";
15
13
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
16
14
  import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
17
15
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
18
- const C = {
16
+ const v = {
19
17
  createSignatory: "createSignatory",
20
18
  inviteSignatory: "inviteSignatory"
21
- }, [u, f] = t("AssignSignatoryContext");
19
+ }, [x, C] = t("AssignSignatoryContext");
22
20
  export {
23
- f as AssignSignatoryProvider,
24
- C as SignatoryAssignmentMode,
25
- u as useAssignSignatory
21
+ C as AssignSignatoryProvider,
22
+ v as SignatoryAssignmentMode,
23
+ x as useAssignSignatory
26
24
  };
27
25
  //# sourceMappingURL=useAssignSignatory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAssignSignatory.js","sources":["../../../../src/components/Company/AssignSignatory/useAssignSignatory.ts"],"sourcesContent":["import { type CreateSignatoryDefaultValues } from './CreateSignatory'\nimport { type InviteSignatoryDefaultValues } from './InviteSignatory'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const SignatoryAssignmentMode = {\n createSignatory: 'createSignatory',\n inviteSignatory: 'inviteSignatory',\n} as const\n\nexport type AssignSignatoryDefaultValues = RequireAtLeastOne<{\n create?: CreateSignatoryDefaultValues\n invite?: InviteSignatoryDefaultValues\n}>\n\ntype AssignSignatoryContextType = {\n companyId: string\n signatoryId?: string\n defaultValues?: AssignSignatoryDefaultValues\n onSignatoryAssignmentModeChange: (mode: string) => void\n onSignatoryFormEvent: BaseComponentInterface['onEvent']\n}\n\nconst [useAssignSignatory, AssignSignatoryProvider] =\n createCompoundContext<AssignSignatoryContextType>('AssignSignatoryContext')\n\nexport { useAssignSignatory, AssignSignatoryProvider }\n"],"names":["SignatoryAssignmentMode","useAssignSignatory","AssignSignatoryProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAMO,MAAMA,IAA0B;AAAA,EACrC,iBAAiB;AAAA,EACjB,iBAAiB;AACnB,GAeM,CAACC,GAAoBC,CAAuB,IAChDC,EAAkD,wBAAwB;"}
1
+ {"version":3,"file":"useAssignSignatory.js","sources":["../../../../src/components/Company/AssignSignatory/useAssignSignatory.ts"],"sourcesContent":["import { type CreateSignatoryDefaultValues } from './CreateSignatory'\nimport { type InviteSignatoryDefaultValues } from './InviteSignatory'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const SignatoryAssignmentMode = {\n createSignatory: 'createSignatory',\n inviteSignatory: 'inviteSignatory',\n} as const\n\nexport type AssignSignatoryDefaultValues = RequireAtLeastOne<{\n create?: CreateSignatoryDefaultValues\n invite?: InviteSignatoryDefaultValues\n}>\n\ntype AssignSignatoryContextType = {\n companyId: string\n signatoryId?: string\n defaultValues?: AssignSignatoryDefaultValues\n onSignatoryAssignmentModeChange: (mode: string) => void\n onSignatoryFormEvent: BaseComponentInterface['onEvent']\n}\n\nconst [useAssignSignatory, AssignSignatoryProvider] =\n createCompoundContext<AssignSignatoryContextType>('AssignSignatoryContext')\n\nexport { useAssignSignatory, AssignSignatoryProvider }\n"],"names":["SignatoryAssignmentMode","useAssignSignatory","AssignSignatoryProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAMO,MAAMA,IAA0B;AAAA,EACrC,iBAAiB;AAAA,EACjB,iBAAiB;AACnB,GAeM,CAACC,GAAoBC,CAAuB,IAChDC,EAAkD,wBAAwB;"}
@@ -1,19 +1,19 @@
1
1
  import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as s } from "react-i18next";
3
3
  import { useBankAccountForm as m } from "./context.js";
4
- import { componentEvents as a } from "../../../../shared/constants.js";
5
- import { ActionsLayout as u } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
- import { useComponentContext as p } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
4
+ import { ActionsLayout as a } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
+ import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ import { componentEvents as p } from "../../../../shared/constants.js";
7
7
  function B() {
8
- const { t } = s("Company.BankAccount"), { isPending: i, isEditing: r, onEvent: c } = m(), n = p();
9
- return /* @__PURE__ */ e(u, { children: [
8
+ const { t } = s("Company.BankAccount"), { isPending: i, isEditing: r, onEvent: c } = m(), n = u();
9
+ return /* @__PURE__ */ e(a, { children: [
10
10
  r && /* @__PURE__ */ o(
11
11
  n.Button,
12
12
  {
13
13
  type: "button",
14
14
  variant: "secondary",
15
15
  onClick: () => {
16
- c(a.COMPANY_BANK_ACCOUNT_CANCEL);
16
+ c(p.COMPANY_BANK_ACCOUNT_CANCEL);
17
17
  },
18
18
  children: t("cancelCta")
19
19
  }