@gusto/embedded-react-sdk 0.21.0 → 0.23.0-rc.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.
- package/CHANGELOG.md +62 -0
- package/README.md +32 -17
- package/dist/assets/icons/eye.svg.js +10 -0
- package/dist/assets/icons/eye.svg.js.map +1 -0
- package/dist/assets/icons/icon-file-outline.svg.js +10 -0
- package/dist/assets/icons/icon-file-outline.svg.js.map +1 -0
- package/dist/assets/icons/icon-receipt-outline.svg.js +10 -0
- package/dist/assets/icons/icon-receipt-outline.svg.js.map +1 -0
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
- package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -1
- package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
- package/dist/components/Common/Fieldset/Fieldset.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +1 -0
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js +14 -0
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -0
- package/dist/components/Common/FlowBreadcrumbs/index.d.ts +1 -0
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.d.ts +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableList.js +7 -7
- package/dist/components/Common/ReorderableList/ReorderableList.js.map +1 -1
- package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
- package/dist/components/Common/UI/Banner/BannerTypes.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonIcon.d.ts +1 -1
- package/dist/components/Common/UI/Button/ButtonIcon.js +10 -7
- package/dist/components/Common/UI/Button/ButtonIcon.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +7 -7
- package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js.map +1 -1
- package/dist/components/Common/UI/Radio/RadioTypes.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/Select/Select.module.scss.js +6 -6
- package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +5 -5
- package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/index.d.ts +2 -0
- package/dist/components/Company/index.js +20 -16
- package/dist/components/Company/index.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.d.ts +7 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +204 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +15 -9
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +140 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +39 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +131 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +11 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +139 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/helpers.d.ts +2 -0
- package/dist/components/Contractor/Payments/CreatePayment/helpers.js +6 -0
- package/dist/components/Contractor/Payments/CreatePayment/helpers.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js +26 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +16 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +31 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/index.d.ts +3 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +7 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +122 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +26 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +17 -15
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +114 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +9 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +49 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +12 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +116 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +10 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Payments/types.d.ts +8 -0
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +26 -26
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/index.d.ts +1 -0
- package/dist/components/Contractor/index.js +4 -2
- package/dist/components/Contractor/index.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +0 -3
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +62 -77
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +83 -50
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +56 -0
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +159 -0
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -0
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.d.ts +22 -7
- package/dist/components/Employee/FederalTaxes/FederalForm.js +86 -32
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +62 -46
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +25 -23
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +116 -106
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +6 -6
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
- package/dist/components/Employee/Profile/useProfile.js +3 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.d.ts +22 -7
- package/dist/components/Employee/Taxes/FederalForm.js +86 -32
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +97 -81
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.d.ts +3 -3
- package/dist/components/Flow/Flow.js +35 -31
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +46 -39
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.module.scss.js +8 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.module.scss.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +71 -72
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +21 -22
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +2 -2
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +19 -19
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +75 -68
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +66 -65
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +127 -103
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +254 -185
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/{FastAchThresholdExceeded.d.ts → FastAchSubmissionBlockerBanner.d.ts} +2 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +55 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/index.d.ts +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +1 -1
- package/dist/components/Payroll/index.js +8 -6
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +6 -7
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +4 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +9 -11
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/LocaleProvider/useLocale.d.ts +6 -3
- package/dist/contexts/LocaleProvider/useLocale.js +12 -9
- package/dist/contexts/LocaleProvider/useLocale.js.map +1 -1
- package/dist/helpers/currencyHelpers.d.ts +2 -0
- package/dist/helpers/currencyHelpers.js +6 -0
- package/dist/helpers/currencyHelpers.js.map +1 -0
- package/dist/helpers/formattedStrings.js +11 -12
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/I18n.js +10 -10
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +40 -0
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +24 -0
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +36 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js.map +1 -0
- package/dist/i18n/en/Employee.Deductions.json.js +58 -46
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/Employee.FederalTaxes.json.js +49 -41
- package/dist/i18n/en/Employee.FederalTaxes.json.js.map +1 -1
- package/dist/i18n/en/Employee.Taxes.json.js +53 -45
- package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
- package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +35 -31
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/shared/constants.d.ts +18 -0
- package/dist/shared/constants.js +73 -59
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +182 -125
- package/package.json +18 -18
- package/dist/components/Contractor/Payments/Detail/DetailPresentation.d.ts +0 -19
- package/dist/components/Contractor/Payments/Overview/OverviewPresentation.d.ts +0 -18
- package/dist/components/Contractor/Payments/PaymentEdit/PaymentEditPresentation.d.ts +0 -6
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +0 -52
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js +0 -32
- package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js +0 -24
- package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js +0 -32
- package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js.map +0 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js +0 -32
- package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.23.0
|
|
4
|
+
|
|
5
|
+
### Features & Enhancements
|
|
6
|
+
|
|
7
|
+
- Add support for all garnishment types
|
|
8
|
+
- Update to include earned fast ach in submission blockers
|
|
9
|
+
- Add contractor payment progress and functionality
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
- Restore defaults to icon button
|
|
14
|
+
- Updated copy on payroll overview
|
|
15
|
+
- Updated payrollHistory to display complete instead of paid
|
|
16
|
+
- Prevent multiple progress saved alerts on payroll overview
|
|
17
|
+
- Updated the payroll state machine to get the payroll dates
|
|
18
|
+
- Updated icons in payroll history action menu
|
|
19
|
+
|
|
20
|
+
### Chores & Maintenance
|
|
21
|
+
|
|
22
|
+
- Fix tree shaking and add pagination to adapter docs
|
|
23
|
+
- Export signatory components and add docs
|
|
24
|
+
- Add docs for confirm wire details and export payroll blockers
|
|
25
|
+
- Remove ability for custom deduction to be court-ordered
|
|
26
|
+
- Bump react-aria-components from 1.13.0 to 1.14.0
|
|
27
|
+
- Bump typescript-eslint from 8.49.0 to 8.50.0
|
|
28
|
+
- Bump @gusto/embedded-api from 0.11.3 to 0.11.4
|
|
29
|
+
- Bump i18next from 25.7.2 to 25.7.3
|
|
30
|
+
- Bump react-i18next from 16.4.0 to 16.5.0
|
|
31
|
+
- Bump eslint from 9.39.1 to 9.39.2
|
|
32
|
+
- Bump sass-embedded from 1.93.3 to 1.96.0
|
|
33
|
+
|
|
34
|
+
## 0.22.0
|
|
35
|
+
|
|
36
|
+
### Features & Enhancements
|
|
37
|
+
|
|
38
|
+
- Add support for fed/state lien garnishments
|
|
39
|
+
- Add notification for wire payroll submitted
|
|
40
|
+
- Update employee federal taxes to support pre 2020 W4
|
|
41
|
+
- Implement payroll overview updates based on radio selection
|
|
42
|
+
- Add contractor payment walking skeleton with FSM scaffolding
|
|
43
|
+
|
|
44
|
+
### Fixes
|
|
45
|
+
|
|
46
|
+
- Clean up confirm wire details with correct selected wire in
|
|
47
|
+
- Add .md extensions to internal doc links for GitHub browsing
|
|
48
|
+
- Update readme to reference existing docs files
|
|
49
|
+
|
|
50
|
+
### Chores & Maintenance
|
|
51
|
+
|
|
52
|
+
- Upgrade embedded API to 0.11.2
|
|
53
|
+
- Bump embedded-api version to 0.11.1
|
|
54
|
+
- Bump typescript-eslint from 8.48.0 to 8.49.0
|
|
55
|
+
- Bump dompurify from 3.3.0 to 3.3.1
|
|
56
|
+
- Bump vite-plugin-checker from 0.11.0 to 0.12.0
|
|
57
|
+
- Bump i18next from 25.7.1 to 25.7.2
|
|
58
|
+
- Bump @commitlint/config-conventional from 20.0.0 to 20.2.0
|
|
59
|
+
- Bump react-i18next from 16.3.5 to 16.4.0
|
|
60
|
+
- Bump @commitlint/cli from 20.1.0 to 20.2.0
|
|
61
|
+
- Bump msw from 2.12.3 to 2.12.4
|
|
62
|
+
- Bump react-hook-form from 7.67.0 to 7.68.0
|
|
63
|
+
- Bump prettier from 3.6.2 to 3.7.3
|
|
64
|
+
|
|
3
65
|
## 0.21.0
|
|
4
66
|
|
|
5
67
|
### Features & Enhancements
|
package/README.md
CHANGED
|
@@ -14,20 +14,35 @@ https://codesandbox.io/p/sandbox/gusto-embedded-sdk-demo-employeelist-nzpslw
|
|
|
14
14
|
|
|
15
15
|
Live documentation is available at: https://docs.gusto.com/embedded-payroll/docs/what-is-the-gep-react-sdk
|
|
16
16
|
|
|
17
|
-
- [What is the GEP React SDK](docs/
|
|
18
|
-
- [Deciding to build with the SDK](docs/
|
|
19
|
-
- [Build Pathways - SDK, Flows & APIs](docs/
|
|
20
|
-
- [Component Types](docs/
|
|
21
|
-
- [Getting Started](docs/
|
|
22
|
-
- [Authentication](docs/
|
|
23
|
-
- [Integration Guide](docs/
|
|
24
|
-
- [Versioning](docs/
|
|
25
|
-
- [Event Handling](docs/
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
|
|
17
|
+
- [What is the GEP React SDK](docs/what-is-the-gep-react-sdk.md)
|
|
18
|
+
- [Deciding to build with the SDK](docs/deciding-to-build-with-the-sdk/deciding-to-build-with-the-sdk.md)
|
|
19
|
+
- [Build Pathways - SDK, Flows & APIs](docs/deciding-to-build-with-the-sdk/build-pathways-sdk-flows-api.md)
|
|
20
|
+
- [Component Types](docs/deciding-to-build-with-the-sdk/component-types.md)
|
|
21
|
+
- [Getting Started](docs/getting-started/getting-started.md)
|
|
22
|
+
- [Authentication](docs/getting-started/authentication.md)
|
|
23
|
+
- [Integration Guide](docs/integration-guide/integration-guide.md)
|
|
24
|
+
- [Versioning](docs/integration-guide/versioning.md)
|
|
25
|
+
- [Event Handling](docs/integration-guide/event-handling.md)
|
|
26
|
+
- [Event Types](docs/integration-guide/event-types.md)
|
|
27
|
+
- [Error Handling](docs/integration-guide/error-handling.md)
|
|
28
|
+
- [Composition](docs/integration-guide/composition.md)
|
|
29
|
+
- [Providing your own data](docs/integration-guide/providing-your-own-data.md)
|
|
30
|
+
- [Translation](docs/integration-guide/translation.md)
|
|
31
|
+
- [Routing](docs/integration-guide/routing.md)
|
|
32
|
+
- [Request Interceptors](docs/integration-guide/request-interceptors.md)
|
|
33
|
+
- [Customizing SDK UI](docs/integration-guide/customizing-sdk-ui.md)
|
|
34
|
+
- [Theming](docs/theming/theming.md)
|
|
35
|
+
- [Theming Guide](docs/theming/theming-guide.md)
|
|
36
|
+
- [Theme Variables](docs/theming/theme-variables.md)
|
|
37
|
+
- [Component Adapter](docs/component-adapter/component-adapter.md)
|
|
38
|
+
- [How the Component Adapter Works](docs/component-adapter/how-the-component-adapter-works.md)
|
|
39
|
+
- [Component Adapter Types](docs/component-adapter/component-adapter-types.md)
|
|
40
|
+
- [Setting up your Component Adapter](docs/component-adapter/setting-up-your-component-adapter.md)
|
|
41
|
+
- [Component Inventory](docs/component-adapter/component-inventory.md)
|
|
42
|
+
- [Component Adapter FAQ](docs/component-adapter/component-adapter-faq.md)
|
|
43
|
+
- [Workflows Overview](docs/workflows-overview/workflows-overview.md)
|
|
44
|
+
- [Company Onboarding](docs/workflows-overview/company-onboarding.md)
|
|
45
|
+
- [Contractor Onboarding](docs/workflows-overview/contractor-onboarding.md)
|
|
46
|
+
- [Employee Onboarding](docs/workflows-overview/employee-onboarding/employee-onboarding.md)
|
|
47
|
+
- [Employee Self-Onboarding](docs/workflows-overview/employee-onboarding/employee-self-onboarding.md)
|
|
48
|
+
- [Run Payroll](docs/workflows-overview/run-payroll.md)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const n = ({
|
|
3
|
+
title: t,
|
|
4
|
+
titleId: r,
|
|
5
|
+
...o
|
|
6
|
+
}) => /* @__PURE__ */ e.createElement("svg", { width: 19, height: 14, viewBox: "0 0 19 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": r, ...o }, t ? /* @__PURE__ */ e.createElement("title", { id: r }, t) : null, /* @__PURE__ */ e.createElement("path", { d: "M1.05315 7.26098C0.939657 7.08128 0.882912 6.99143 0.851147 6.85284C0.827287 6.74874 0.827287 6.58458 0.851147 6.48048C0.882912 6.3419 0.939657 6.25205 1.05315 6.07235C1.99098 4.58736 4.78254 0.833328 9.03671 0.833328C13.2909 0.833328 16.0824 4.58736 17.0203 6.07235C17.1338 6.25205 17.1905 6.3419 17.2223 6.48048C17.2461 6.58458 17.2461 6.74874 17.2223 6.85284C17.1905 6.99143 17.1338 7.08128 17.0203 7.26098C16.0824 8.74596 13.2909 12.5 9.03671 12.5C4.78254 12.5 1.99098 8.74596 1.05315 7.26098Z", stroke: "currentColor", strokeWidth: 1.66667, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ e.createElement("path", { d: "M9.03671 9.16666C10.4174 9.16666 11.5367 8.04737 11.5367 6.66666C11.5367 5.28595 10.4174 4.16666 9.03671 4.16666C7.656 4.16666 6.53671 5.28595 6.53671 6.66666C6.53671 8.04737 7.656 9.16666 9.03671 9.16666Z", stroke: "currentColor", strokeWidth: 1.66667, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
7
|
+
export {
|
|
8
|
+
n as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=eye.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eye.svg.js","sources":["../../../src/assets/icons/eye.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgEye = ({\n title,\n titleId,\n ...props\n}) => /* @__PURE__ */ React.createElement(\"svg\", { width: 19, height: 14, viewBox: \"0 0 19 14\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", \"aria-labelledby\": titleId, ...props }, title ? /* @__PURE__ */ React.createElement(\"title\", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement(\"path\", { d: \"M1.05315 7.26098C0.939657 7.08128 0.882912 6.99143 0.851147 6.85284C0.827287 6.74874 0.827287 6.58458 0.851147 6.48048C0.882912 6.3419 0.939657 6.25205 1.05315 6.07235C1.99098 4.58736 4.78254 0.833328 9.03671 0.833328C13.2909 0.833328 16.0824 4.58736 17.0203 6.07235C17.1338 6.25205 17.1905 6.3419 17.2223 6.48048C17.2461 6.58458 17.2461 6.74874 17.2223 6.85284C17.1905 6.99143 17.1338 7.08128 17.0203 7.26098C16.0824 8.74596 13.2909 12.5 9.03671 12.5C4.78254 12.5 1.99098 8.74596 1.05315 7.26098Z\", stroke: \"currentColor\", strokeWidth: 1.66667, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M9.03671 9.16666C10.4174 9.16666 11.5367 8.04737 11.5367 6.66666C11.5367 5.28595 10.4174 4.16666 9.03671 4.16666C7.656 4.16666 6.53671 5.28595 6.53671 6.66666C6.53671 8.04737 7.656 9.16666 9.03671 9.16666Z\", stroke: \"currentColor\", strokeWidth: 1.66667, strokeLinecap: \"round\", strokeLinejoin: \"round\" }));\nexport default SvgEye;\n"],"names":["SvgEye","title","titleId","props","React"],"mappings":";AACK,MAACA,IAAS,CAAC;AAAA,EACd,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,MAAsB,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,MAAM,QAAQ,OAAO,8BAA8B,mBAAmBF,GAAS,GAAGC,EAAK,GAAIF,IAAwB,gBAAAG,EAAM,cAAc,SAAS,EAAE,IAAIF,EAAO,GAAID,CAAK,IAAI,MAAsB,gBAAAG,EAAM,cAAc,QAAQ,EAAE,GAAG,qfAAqf,QAAQ,gBAAgB,aAAa,SAAS,eAAe,SAAS,gBAAgB,QAAO,CAAE,GAAmB,gBAAAA,EAAM,cAAc,QAAQ,EAAE,GAAG,iNAAiN,QAAQ,gBAAgB,aAAa,SAAS,eAAe,SAAS,gBAAgB,QAAO,CAAE,CAAC;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const r = ({
|
|
3
|
+
title: t,
|
|
4
|
+
titleId: C,
|
|
5
|
+
...o
|
|
6
|
+
}) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": C, ...o }, t ? /* @__PURE__ */ e.createElement("title", { id: C }, t) : null, /* @__PURE__ */ e.createElement("path", { d: "M9.33317 1.51367V4.26737C9.33317 4.64073 9.33317 4.82742 9.40583 4.97003C9.46975 5.09547 9.57174 5.19745 9.69718 5.26137C9.83978 5.33403 10.0265 5.33403 10.3998 5.33403H13.1535M9.33317 11.334H5.33317M10.6665 8.66732H5.33317M13.3332 6.65947V11.4673C13.3332 12.5874 13.3332 13.1475 13.1152 13.5753C12.9234 13.9516 12.6175 14.2576 12.2412 14.4493C11.8133 14.6673 11.2533 14.6673 10.1332 14.6673H5.8665C4.7464 14.6673 4.18635 14.6673 3.75852 14.4493C3.3822 14.2576 3.07624 13.9516 2.88449 13.5753C2.6665 13.1475 2.6665 12.5874 2.6665 11.4673V4.53398C2.6665 3.41388 2.6665 2.85383 2.88449 2.426C3.07624 2.04968 3.3822 1.74372 3.75852 1.55197C4.18635 1.33398 4.7464 1.33398 5.8665 1.33398H8.00769C8.49687 1.33398 8.74146 1.33398 8.97163 1.38924C9.17571 1.43824 9.3708 1.51905 9.54974 1.6287C9.75157 1.75239 9.92453 1.92534 10.2704 2.27124L12.3959 4.39673C12.7418 4.74263 12.9148 4.91558 13.0385 5.11741C13.1481 5.29636 13.2289 5.49145 13.2779 5.69552C13.3332 5.9257 13.3332 6.17029 13.3332 6.65947Z", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
7
|
+
export {
|
|
8
|
+
r as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=icon-file-outline.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-file-outline.svg.js","sources":["../../../src/assets/icons/icon-file-outline.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgIconFileOutline = ({\n title,\n titleId,\n ...props\n}) => /* @__PURE__ */ React.createElement(\"svg\", { width: 16, height: 16, viewBox: \"0 0 16 16\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", \"aria-labelledby\": titleId, ...props }, title ? /* @__PURE__ */ React.createElement(\"title\", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement(\"path\", { d: \"M9.33317 1.51367V4.26737C9.33317 4.64073 9.33317 4.82742 9.40583 4.97003C9.46975 5.09547 9.57174 5.19745 9.69718 5.26137C9.83978 5.33403 10.0265 5.33403 10.3998 5.33403H13.1535M9.33317 11.334H5.33317M10.6665 8.66732H5.33317M13.3332 6.65947V11.4673C13.3332 12.5874 13.3332 13.1475 13.1152 13.5753C12.9234 13.9516 12.6175 14.2576 12.2412 14.4493C11.8133 14.6673 11.2533 14.6673 10.1332 14.6673H5.8665C4.7464 14.6673 4.18635 14.6673 3.75852 14.4493C3.3822 14.2576 3.07624 13.9516 2.88449 13.5753C2.6665 13.1475 2.6665 12.5874 2.6665 11.4673V4.53398C2.6665 3.41388 2.6665 2.85383 2.88449 2.426C3.07624 2.04968 3.3822 1.74372 3.75852 1.55197C4.18635 1.33398 4.7464 1.33398 5.8665 1.33398H8.00769C8.49687 1.33398 8.74146 1.33398 8.97163 1.38924C9.17571 1.43824 9.3708 1.51905 9.54974 1.6287C9.75157 1.75239 9.92453 1.92534 10.2704 2.27124L12.3959 4.39673C12.7418 4.74263 12.9148 4.91558 13.0385 5.11741C13.1481 5.29636 13.2289 5.49145 13.2779 5.69552C13.3332 5.9257 13.3332 6.17029 13.3332 6.65947Z\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\", strokeLinejoin: \"round\" }));\nexport default SvgIconFileOutline;\n"],"names":["SvgIconFileOutline","title","titleId","props","React"],"mappings":";AACK,MAACA,IAAqB,CAAC;AAAA,EAC1B,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,MAAsB,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,MAAM,QAAQ,OAAO,8BAA8B,mBAAmBF,GAAS,GAAGC,EAAK,GAAIF,IAAwB,gBAAAG,EAAM,cAAc,SAAS,EAAE,IAAIF,KAAWD,CAAK,IAAI,MAAsB,gBAAAG,EAAM,cAAc,QAAQ,EAAE,GAAG,o+BAAo+B,QAAQ,gBAAgB,aAAa,KAAK,eAAe,SAAS,gBAAgB,SAAS,CAAC;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const n = ({
|
|
3
|
+
title: t,
|
|
4
|
+
titleId: o,
|
|
5
|
+
...r
|
|
6
|
+
}) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": o, ...r }, t ? /* @__PURE__ */ e.createElement("title", { id: o }, t) : null, /* @__PURE__ */ e.createElement("path", { d: "M2.6665 5.2C2.6665 4.0799 2.6665 3.51984 2.88449 3.09202C3.07624 2.71569 3.3822 2.40973 3.75852 2.21799C4.18635 2 4.7464 2 5.8665 2H10.1332C11.2533 2 11.8133 2 12.2412 2.21799C12.6175 2.40973 12.9234 2.71569 13.1152 3.09202C13.3332 3.51984 13.3332 4.0799 13.3332 5.2V14L11.4998 12.6667L9.83317 14L7.99984 12.6667L6.1665 14L4.49984 12.6667L2.6665 14V5.2Z", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
7
|
+
export {
|
|
8
|
+
n as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=icon-receipt-outline.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-receipt-outline.svg.js","sources":["../../../src/assets/icons/icon-receipt-outline.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgIconReceiptOutline = ({\n title,\n titleId,\n ...props\n}) => /* @__PURE__ */ React.createElement(\"svg\", { width: 16, height: 16, viewBox: \"0 0 16 16\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", \"aria-labelledby\": titleId, ...props }, title ? /* @__PURE__ */ React.createElement(\"title\", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement(\"path\", { d: \"M2.6665 5.2C2.6665 4.0799 2.6665 3.51984 2.88449 3.09202C3.07624 2.71569 3.3822 2.40973 3.75852 2.21799C4.18635 2 4.7464 2 5.8665 2H10.1332C11.2533 2 11.8133 2 12.2412 2.21799C12.6175 2.40973 12.9234 2.71569 13.1152 3.09202C13.3332 3.51984 13.3332 4.0799 13.3332 5.2V14L11.4998 12.6667L9.83317 14L7.99984 12.6667L6.1665 14L4.49984 12.6667L2.6665 14V5.2Z\", stroke: \"currentColor\", strokeWidth: 1.5, strokeLinecap: \"round\", strokeLinejoin: \"round\" }));\nexport default SvgIconReceiptOutline;\n"],"names":["SvgIconReceiptOutline","title","titleId","props","React"],"mappings":";AACK,MAACA,IAAwB,CAAC;AAAA,EAC7B,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,MAAsB,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,MAAM,QAAQ,OAAO,8BAA8B,mBAAmBF,GAAS,GAAGC,EAAK,GAAIF,IAAwB,gBAAAG,EAAM,cAAc,SAAS,EAAE,IAAIF,KAAWD,CAAK,IAAI,MAAsB,gBAAAG,EAAM,cAAc,QAAQ,EAAE,GAAG,qWAAqW,QAAQ,gBAAgB,aAAa,KAAK,eAAe,SAAS,gBAAgB,SAAS,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX, ErrorInfo } from 'react'\nimport { Suspense } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type KnownErrors, type OnEventType } from './useBase'\nimport { useBaseSubmit } from './useBaseSubmit'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { renderErrorList } from '@/helpers/apiErrorToList'\n\nexport interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {\n children?: ReactNode\n className?: string\n defaultValues?: unknown\n dictionary?: ResourceDictionary<TResourceKey>\n}\n\n// Base component wrapper with error and suspense handling\nexport interface BaseComponentInterface
|
|
1
|
+
{"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX, ErrorInfo } from 'react'\nimport { Suspense } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type KnownErrors, type OnEventType } from './useBase'\nimport { useBaseSubmit } from './useBaseSubmit'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { renderErrorList } from '@/helpers/apiErrorToList'\n\nexport interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {\n children?: ReactNode\n className?: string\n defaultValues?: unknown\n dictionary?: ResourceDictionary<TResourceKey>\n}\n\n// Base component wrapper with error and suspense handling\nexport interface BaseComponentInterface<\n TResourceKey extends keyof Resources = keyof Resources,\n> extends CommonComponentInterface<TResourceKey> {\n FallbackComponent?: BaseBoundariesProps['FallbackComponent']\n LoaderComponent?: BaseBoundariesProps['LoaderComponent']\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const BaseComponent = <TResourceKey extends keyof Resources = keyof Resources>({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onEvent,\n}: BaseComponentInterface<TResourceKey>) => {\n const { error, fieldErrors, baseSubmitHandler, setError } = useBaseSubmit()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n const onErrorBoundaryError = (error: Error) => {\n onEvent(componentEvents.ERROR, error)\n }\n\n return (\n <BaseContext.Provider\n value={{\n error,\n fieldErrors,\n setError,\n onEvent,\n baseSubmitHandler,\n LoadingIndicator: LoaderComponent,\n }}\n >\n <BaseBoundaries\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n onErrorBoundaryError={onErrorBoundaryError}\n >\n <BaseLayout error={error} fieldErrors={fieldErrors}>\n {children}\n </BaseLayout>\n </BaseBoundaries>\n </BaseContext.Provider>\n )\n}\n\ninterface BaseLayoutProps {\n children?: ReactNode\n error: KnownErrors | null\n fieldErrors: Array<EntityErrorObject> | null\n}\n\nexport const BaseLayout = ({ children, error, fieldErrors }: BaseLayoutProps) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n\n return (\n <FadeIn>\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {fieldErrors && <Components.UnorderedList items={renderErrorList(fieldErrors)} />}\n {error && error instanceof APIError && <Components.Text>{error.message}</Components.Text>}\n {error && error instanceof SDKValidationError && (\n <Components.Text as=\"pre\">{error.pretty()}</Components.Text>\n )}\n </Components.Alert>\n )}\n {children}\n </FadeIn>\n )\n}\n\nexport interface BaseBoundariesProps {\n children?: ReactNode\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n onErrorBoundaryError?: (error: Error, info: ErrorInfo) => void\n}\n\nexport const BaseBoundaries = ({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onErrorBoundaryError,\n}: BaseBoundariesProps) => {\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n return (\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={onErrorBoundaryError}\n >\n <Suspense fallback={<LoaderComponent />}>{children}</Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n )\n}\n"],"names":["BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","error","fieldErrors","baseSubmitHandler","setError","useBaseSubmit","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","onErrorBoundaryError","componentEvents","jsx","BaseContext","BaseBoundaries","BaseLayout","Components","useComponentContext","t","useTranslation","FadeIn","jsxs","renderErrorList","APIError","SDKValidationError","QueryErrorResetBoundary","resetQueries","ErrorBoundary","Suspense"],"mappings":";;;;;;;;;;;;;;;;AAoCO,MAAMA,IAAgB,CAAyD;AAAA,EACpF,UAAAC;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAiBC;AAAA,EACjB,SAAAC;AACF,MAA4C;AAC1C,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,mBAAAC,GAAmB,UAAAC,EAAA,IAAaC,EAAA,GAEtD,EAAE,kBAAkBC,EAAA,IAAgCC,EAAA,GACpDC,IAAkBT,KAA6BO,GAE/CG,IAAuB,CAACR,MAAiB;AAC7C,IAAAD,EAAQU,EAAgB,OAAOT,CAAK;AAAA,EACtC;AAEA,SACE,gBAAAU;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,OAAAX;AAAA,QACA,aAAAC;AAAA,QACA,UAAAE;AAAA,QACA,SAAAJ;AAAA,QACA,mBAAAG;AAAA,QACA,kBAAkBK;AAAA,MAAA;AAAA,MAGpB,UAAA,gBAAAG;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,mBAAAhB;AAAA,UACA,iBAAAW;AAAA,UACA,sBAAAC;AAAA,UAEA,UAAA,gBAAAE,EAACG,GAAA,EAAW,OAAAb,GAAc,aAAAC,GACvB,UAAAN,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN,GAQakB,IAAa,CAAC,EAAE,UAAAlB,GAAU,OAAAK,GAAO,aAAAC,QAAmC;AAC/E,QAAMa,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA;AAEd,2BACGC,GAAA,EACG,UAAA;AAAA,KAAAlB,KAASC,MACT,gBAAAkB,EAACL,EAAW,OAAX,EAAiB,OAAOE,EAAE,yBAAyB,GAAG,QAAO,SAC3D,UAAA;AAAA,MAAAf,uBAAgBa,EAAW,eAAX,EAAyB,OAAOM,EAAgBnB,CAAW,GAAG;AAAA,MAC9ED,KAASA,aAAiBqB,KAAY,gBAAAX,EAACI,EAAW,MAAX,EAAiB,YAAM,SAAQ;AAAA,MACtEd,KAASA,aAAiBsB,KACzB,gBAAAZ,EAACI,EAAW,MAAX,EAAgB,IAAG,OAAO,UAAAd,EAAM,OAAA,EAAO,CAAE;AAAA,IAAA,GAE9C;AAAA,IAEDL;AAAA,EAAA,GACH;AAEJ,GASaiB,IAAiB,CAAC;AAAA,EAC7B,UAAAjB;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAiBC;AAAA,EACjB,sBAAAU;AACF,MAA2B;AACzB,QAAM,EAAE,kBAAkBH,EAAA,IAAgCC,EAAA,GACpDC,IAAkBT,KAA6BO;AAErD,2BACGkB,GAAA,EACE,UAAA,CAAC,EAAE,OAAOC,QACT,gBAAAd;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,mBAAA7B;AAAA,MACA,SAAS4B;AAAA,MACT,SAAShB;AAAA,MAET,4BAACkB,GAAA,EAAS,UAAU,gBAAAhB,EAACH,GAAA,EAAgB,GAAK,UAAAZ,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA,GAGzD;AAEJ;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
|
-
export { BaseComponent, type BaseComponentInterface, type CommonComponentInterface } from './Base';
|
|
2
|
+
export { BaseComponent, BaseBoundaries, type BaseComponentInterface, type CommonComponentInterface, } from './Base';
|
|
3
3
|
export { createCompoundContext } from './createCompoundContext';
|
|
4
4
|
export { useBase } from './useBase';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxField.js","sources":["../../../../../src/components/Common/Fields/CheckboxField/CheckboxField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface CheckboxFieldProps\n extends Omit<CheckboxProps, 'name' | 'value' | 'isInvalid'
|
|
1
|
+
{"version":3,"file":"CheckboxField.js","sources":["../../../../../src/components/Common/Fields/CheckboxField/CheckboxField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface CheckboxFieldProps\n extends Omit<CheckboxProps, 'name' | 'value' | 'isInvalid'>, UseFieldProps<boolean> {}\n\nexport const CheckboxField: React.FC<CheckboxFieldProps> = ({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n ...checkboxProps\n}: CheckboxFieldProps) => {\n const Components = useComponentContext()\n const fieldProps = useField({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n return <Components.Checkbox {...checkboxProps} {...fieldProps} />\n}\n"],"names":["CheckboxField","rules","defaultValue","name","errorMessage","isRequired","onChange","transform","description","onBlur","inputRef","checkboxProps","Components","useComponentContext","fieldProps","useField"],"mappings":";;;AAOO,MAAMA,IAA8C,CAAC;AAAA,EAC1D,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA0B;AACxB,QAAMC,IAAaC,EAAA,GACbC,IAAaC,EAAS;AAAA,IAC1B,MAAAZ;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD;AAED,2BAAQE,EAAW,UAAX,EAAqB,GAAGD,GAAgB,GAAGG,GAAY;AACjE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroupField.js","sources":["../../../../../src/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { CheckboxGroupOption } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport {\n useStringifyGenericFieldValueArray,\n type OptionWithGenericValue,\n} from '@/components/Common/Fields/hooks/useStringifyGenericFieldValue'\n\ntype GenericCheckboxGroupOption<TValue> = OptionWithGenericValue<TValue, CheckboxGroupOption>\n\nexport interface CheckboxGroupFieldProps<TValue>\n extends
|
|
1
|
+
{"version":3,"file":"CheckboxGroupField.js","sources":["../../../../../src/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { CheckboxGroupOption } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport {\n useStringifyGenericFieldValueArray,\n type OptionWithGenericValue,\n} from '@/components/Common/Fields/hooks/useStringifyGenericFieldValue'\n\ntype GenericCheckboxGroupOption<TValue> = OptionWithGenericValue<TValue, CheckboxGroupOption>\n\nexport interface CheckboxGroupFieldProps<TValue>\n extends\n Omit<CheckboxGroupProps, 'value' | 'onChange' | 'options' | 'isInvalid'>,\n UseFieldProps<TValue[]> {\n options: GenericCheckboxGroupOption<TValue>[]\n convertValueToString?: (value: TValue) => string\n}\n\nexport const CheckboxGroupField = <TValue = string,>({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange: onChangeFromProps,\n transform,\n options,\n description,\n onBlur,\n inputRef,\n convertValueToString,\n ...checkboxGroupProps\n}: CheckboxGroupFieldProps<TValue>) => {\n const Components = useComponentContext()\n const { value, onChange, ...fieldProps } = useField({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange: onChangeFromProps,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n const stringFieldProps = useStringifyGenericFieldValueArray<TValue, CheckboxGroupOption>({\n options,\n value,\n onChange,\n convertValueToString,\n })\n\n return <Components.CheckboxGroup {...checkboxGroupProps} {...fieldProps} {...stringFieldProps} />\n}\n"],"names":["CheckboxGroupField","rules","defaultValue","name","errorMessage","isRequired","onChangeFromProps","transform","options","description","onBlur","inputRef","convertValueToString","checkboxGroupProps","Components","useComponentContext","value","onChange","fieldProps","useField","stringFieldProps","useStringifyGenericFieldValueArray","jsx"],"mappings":";;;;AAmBO,MAAMA,IAAqB,CAAmB;AAAA,EACnD,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAUC;AAAA,EACV,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,GAAGC;AACL,MAAuC;AACrC,QAAMC,IAAaC,EAAA,GACb,EAAE,OAAAC,GAAO,UAAAC,GAAU,GAAGC,EAAA,IAAeC,EAAS;AAAA,IAClD,MAAAhB;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAUC;AAAA,IACV,WAAAC;AAAA,IACA,aAAAE;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD,GAEKS,IAAmBC,EAAgE;AAAA,IACvF,SAAAb;AAAA,IACA,OAAAQ;AAAA,IACA,UAAAC;AAAA,IACA,sBAAAL;AAAA,EAAA,CACD;AAED,SAAO,gBAAAU,EAACR,EAAW,eAAX,EAA0B,GAAGD,GAAqB,GAAGK,GAAa,GAAGE,GAAkB;AACjG;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBoxField.js","sources":["../../../../../src/components/Common/Fields/ComboBoxField/ComboBoxField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { ComboBoxProps, ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport {\n useStringifyGenericFieldValue,\n type OptionWithGenericValue,\n} from '@/components/Common/Fields/hooks/useStringifyGenericFieldValue'\n\ntype GenericComboBoxOption<TValue> = OptionWithGenericValue<TValue, ComboBoxOption>\n\nexport interface ComboBoxFieldProps<TValue>\n extends
|
|
1
|
+
{"version":3,"file":"ComboBoxField.js","sources":["../../../../../src/components/Common/Fields/ComboBoxField/ComboBoxField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { ComboBoxProps, ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport {\n useStringifyGenericFieldValue,\n type OptionWithGenericValue,\n} from '@/components/Common/Fields/hooks/useStringifyGenericFieldValue'\n\ntype GenericComboBoxOption<TValue> = OptionWithGenericValue<TValue, ComboBoxOption>\n\nexport interface ComboBoxFieldProps<TValue>\n extends\n Omit<ComboBoxProps, 'name' | 'value' | 'onChange' | 'options' | 'isInvalid'>,\n UseFieldProps<TValue> {\n options: GenericComboBoxOption<TValue>[]\n convertValueToString?: (value: TValue) => string\n}\n\nexport const ComboBoxField = <TValue = string,>({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange: onChangeFromProps,\n transform,\n options,\n convertValueToString,\n description,\n onBlur,\n inputRef,\n ...comboBoxProps\n}: ComboBoxFieldProps<TValue>) => {\n const Components = useComponentContext()\n const { value, onChange, ...fieldProps } = useField<TValue>({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange: onChangeFromProps,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n const stringFieldProps = useStringifyGenericFieldValue<TValue, ComboBoxOption>({\n options,\n value,\n onChange,\n convertValueToString,\n })\n\n return <Components.ComboBox {...comboBoxProps} {...fieldProps} {...stringFieldProps} />\n}\n"],"names":["ComboBoxField","rules","defaultValue","name","errorMessage","isRequired","onChangeFromProps","transform","options","convertValueToString","description","onBlur","inputRef","comboBoxProps","Components","useComponentContext","value","onChange","fieldProps","useField","stringFieldProps","useStringifyGenericFieldValue","jsx"],"mappings":";;;;AAkBO,MAAMA,IAAgB,CAAmB;AAAA,EAC9C,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAUC;AAAA,EACV,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAkC;AAChC,QAAMC,IAAaC,EAAA,GACb,EAAE,OAAAC,GAAO,UAAAC,GAAU,GAAGC,EAAA,IAAeC,EAAiB;AAAA,IAC1D,MAAAhB;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAUC;AAAA,IACV,WAAAC;AAAA,IACA,aAAAG;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD,GAEKQ,IAAmBC,EAAsD;AAAA,IAC7E,SAAAb;AAAA,IACA,OAAAQ;AAAA,IACA,UAAAC;AAAA,IACA,sBAAAR;AAAA,EAAA,CACD;AAED,SAAO,gBAAAa,EAACR,EAAW,UAAX,EAAqB,GAAGD,GAAgB,GAAGK,GAAa,GAAGE,GAAkB;AACvF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerField.js","sources":["../../../../../src/components/Common/Fields/DatePickerField/DatePickerField.tsx"],"sourcesContent":["import React from 'react'\nimport { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { normalizeDateToLocal } from '@/helpers/dateFormatting'\n\ninterface DatePickerFieldProps\n extends Omit<DatePickerProps, 'name' | 'onChange' | 'isInvalid'
|
|
1
|
+
{"version":3,"file":"DatePickerField.js","sources":["../../../../../src/components/Common/Fields/DatePickerField/DatePickerField.tsx"],"sourcesContent":["import React from 'react'\nimport { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { normalizeDateToLocal } from '@/helpers/dateFormatting'\n\ninterface DatePickerFieldProps\n extends Omit<DatePickerProps, 'name' | 'onChange' | 'isInvalid'>, UseFieldProps<Date | null> {}\n\nexport const DatePickerField: React.FC<DatePickerFieldProps> = ({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n ...datePickerProps\n}: DatePickerFieldProps) => {\n const Components = useComponentContext()\n const fieldProps = useField({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n /**\n * Normalizes dates from any adapter to ensure they represent the intended local date,\n * handling timezone issues that can occur when adapters use `new Date(dateString)`.\n */\n const handleTimezoneSafeChange = React.useCallback(\n (value: Date | null) => {\n // Normalize the date to ensure it represents the intended local date\n const normalizedDate = normalizeDateToLocal(value)\n fieldProps.onChange(normalizedDate)\n },\n [fieldProps],\n )\n\n return (\n <Components.DatePicker\n {...datePickerProps}\n {...fieldProps}\n onChange={handleTimezoneSafeChange}\n />\n )\n}\n"],"names":["DatePickerField","rules","defaultValue","name","errorMessage","isRequired","onChange","transform","description","onBlur","inputRef","datePickerProps","Components","useComponentContext","fieldProps","useField","handleTimezoneSafeChange","React","value","normalizedDate","normalizeDateToLocal","jsx"],"mappings":";;;;;AASO,MAAMA,IAAkD,CAAC;AAAA,EAC9D,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA4B;AAC1B,QAAMC,IAAaC,EAAA,GACbC,IAAaC,EAAS;AAAA,IAC1B,MAAAZ;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD,GAMKM,IAA2BC,EAAM;AAAA,IACrC,CAACC,MAAuB;AAEtB,YAAMC,IAAiBC,EAAqBF,CAAK;AACjD,MAAAJ,EAAW,SAASK,CAAc;AAAA,IACpC;AAAA,IACA,CAACL,CAAU;AAAA,EAAA;AAGb,SACE,gBAAAO;AAAA,IAACT,EAAW;AAAA,IAAX;AAAA,MACE,GAAGD;AAAA,MACH,GAAGG;AAAA,MACJ,UAAUE;AAAA,IAAA;AAAA,EAAA;AAGhB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInputField.js","sources":["../../../../../src/components/Common/Fields/NumberInputField/NumberInputField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface NumberInputFieldProps\n extends Omit<NumberInputProps, 'name' | 'value' | 'isInvalid'
|
|
1
|
+
{"version":3,"file":"NumberInputField.js","sources":["../../../../../src/components/Common/Fields/NumberInputField/NumberInputField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface NumberInputFieldProps\n extends Omit<NumberInputProps, 'name' | 'value' | 'isInvalid'>, UseFieldProps<number> {}\n\nexport const NumberInputField: React.FC<NumberInputFieldProps> = ({\n rules: providedRules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n ...numberInputProps\n}: NumberInputFieldProps) => {\n const Components = useComponentContext()\n const rules = {\n validate: (value: number) => {\n if (isRequired && isNaN(value)) {\n return false\n }\n return true\n },\n ...providedRules,\n }\n\n const fieldProps = useField({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n return <Components.NumberInput {...numberInputProps} {...fieldProps} />\n}\n"],"names":["NumberInputField","providedRules","defaultValue","name","errorMessage","isRequired","onChange","transform","description","onBlur","inputRef","numberInputProps","Components","useComponentContext","rules","value","fieldProps","useField"],"mappings":";;;AAOO,MAAMA,IAAoD,CAAC;AAAA,EAChE,OAAOC;AAAA,EACP,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA6B;AAC3B,QAAMC,IAAaC,EAAA,GACbC,IAAQ;AAAA,IACZ,UAAU,CAACC,MACL,EAAAV,KAAc,MAAMU,CAAK;AAAA,IAK/B,GAAGd;AAAA,EAAA,GAGCe,IAAaC,EAAS;AAAA,IAC1B,MAAAd;AAAA,IACA,OAAAW;AAAA,IACA,cAAAZ;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD;AAED,2BAAQE,EAAW,aAAX,EAAwB,GAAGD,GAAmB,GAAGK,GAAY;AACvE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupField.js","sources":["../../../../../src/components/Common/Fields/RadioGroupField/RadioGroupField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type {\n RadioGroupProps,\n RadioGroupOption,\n} from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport {\n useStringifyGenericFieldValue,\n type OptionWithGenericValue,\n} from '@/components/Common/Fields/hooks/useStringifyGenericFieldValue'\n\ntype GenericRadioGroupOption<TValue> = OptionWithGenericValue<TValue, RadioGroupOption>\n\nexport interface RadioGroupFieldProps<TValue>\n extends
|
|
1
|
+
{"version":3,"file":"RadioGroupField.js","sources":["../../../../../src/components/Common/Fields/RadioGroupField/RadioGroupField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type {\n RadioGroupProps,\n RadioGroupOption,\n} from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport {\n useStringifyGenericFieldValue,\n type OptionWithGenericValue,\n} from '@/components/Common/Fields/hooks/useStringifyGenericFieldValue'\n\ntype GenericRadioGroupOption<TValue> = OptionWithGenericValue<TValue, RadioGroupOption>\n\nexport interface RadioGroupFieldProps<TValue>\n extends\n Omit<RadioGroupProps, 'value' | 'onChange' | 'options' | 'isInvalid' | 'defaultValue'>,\n UseFieldProps<TValue> {\n options: GenericRadioGroupOption<TValue>[]\n convertValueToString?: (value: TValue) => string\n}\n\nexport const RadioGroupField = <TValue = string,>({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange: onChangeFromProps,\n transform,\n options,\n convertValueToString,\n description,\n onBlur,\n inputRef,\n ...radioGroupProps\n}: RadioGroupFieldProps<TValue>) => {\n const Components = useComponentContext()\n const { value, onChange, ...fieldProps } = useField<TValue>({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange: onChangeFromProps,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n const stringFieldProps = useStringifyGenericFieldValue<TValue, RadioGroupOption>({\n options,\n value,\n onChange,\n convertValueToString,\n })\n\n return <Components.RadioGroup {...radioGroupProps} {...fieldProps} {...stringFieldProps} />\n}\n"],"names":["RadioGroupField","rules","defaultValue","name","errorMessage","isRequired","onChangeFromProps","transform","options","convertValueToString","description","onBlur","inputRef","radioGroupProps","Components","useComponentContext","value","onChange","fieldProps","useField","stringFieldProps","useStringifyGenericFieldValue","jsx"],"mappings":";;;;AAqBO,MAAMA,IAAkB,CAAmB;AAAA,EAChD,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAUC;AAAA,EACV,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAoC;AAClC,QAAMC,IAAaC,EAAA,GACb,EAAE,OAAAC,GAAO,UAAAC,GAAU,GAAGC,EAAA,IAAeC,EAAiB;AAAA,IAC1D,MAAAhB;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAUC;AAAA,IACV,WAAAC;AAAA,IACA,aAAAG;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD,GAEKQ,IAAmBC,EAAwD;AAAA,IAC/E,SAAAb;AAAA,IACA,OAAAQ;AAAA,IACA,UAAAC;AAAA,IACA,sBAAAR;AAAA,EAAA,CACD;AAED,SAAO,gBAAAa,EAACR,EAAW,YAAX,EAAuB,GAAGD,GAAkB,GAAGK,GAAa,GAAGE,GAAkB;AAC3F;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.js","sources":["../../../../../src/components/Common/Fields/SelectField/SelectField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { SelectOption, SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport {\n useStringifyGenericFieldValue,\n type OptionWithGenericValue,\n} from '@/components/Common/Fields/hooks/useStringifyGenericFieldValue'\n\ntype GenericSelectOption<TValue> = OptionWithGenericValue<TValue, SelectOption>\n\nexport interface SelectFieldProps<TValue>\n extends
|
|
1
|
+
{"version":3,"file":"SelectField.js","sources":["../../../../../src/components/Common/Fields/SelectField/SelectField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { SelectOption, SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport {\n useStringifyGenericFieldValue,\n type OptionWithGenericValue,\n} from '@/components/Common/Fields/hooks/useStringifyGenericFieldValue'\n\ntype GenericSelectOption<TValue> = OptionWithGenericValue<TValue, SelectOption>\n\nexport interface SelectFieldProps<TValue>\n extends\n Omit<SelectProps, 'name' | 'value' | 'onChange' | 'options' | 'isInvalid'>,\n UseFieldProps<TValue, HTMLButtonElement> {\n options: GenericSelectOption<TValue>[]\n convertValueToString?: (value: TValue) => string\n}\n\nexport const SelectField = <TValue = string,>({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange: onChangeFromProps,\n transform,\n options,\n convertValueToString,\n description,\n onBlur,\n inputRef,\n ...selectProps\n}: SelectFieldProps<TValue>) => {\n const Components = useComponentContext()\n const { value, onChange, ...fieldProps } = useField<TValue, HTMLButtonElement>({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange: onChangeFromProps,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n const stringFieldProps = useStringifyGenericFieldValue<TValue, SelectOption>({\n options,\n value,\n onChange,\n convertValueToString,\n })\n\n return <Components.Select {...selectProps} {...fieldProps} {...stringFieldProps} />\n}\n"],"names":["SelectField","rules","defaultValue","name","errorMessage","isRequired","onChangeFromProps","transform","options","convertValueToString","description","onBlur","inputRef","selectProps","Components","useComponentContext","value","onChange","fieldProps","useField","stringFieldProps","useStringifyGenericFieldValue","jsx"],"mappings":";;;;AAkBO,MAAMA,IAAc,CAAmB;AAAA,EAC5C,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAUC;AAAA,EACV,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAgC;AAC9B,QAAMC,IAAaC,EAAA,GACb,EAAE,OAAAC,GAAO,UAAAC,GAAU,GAAGC,EAAA,IAAeC,EAAoC;AAAA,IAC7E,MAAAhB;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAUC;AAAA,IACV,WAAAC;AAAA,IACA,aAAAG;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD,GAEKQ,IAAmBC,EAAoD;AAAA,IAC3E,SAAAb;AAAA,IACA,OAAAQ;AAAA,IACA,UAAAC;AAAA,IACA,sBAAAR;AAAA,EAAA,CACD;AAED,SAAO,gBAAAa,EAACR,EAAW,QAAX,EAAmB,GAAGD,GAAc,GAAGK,GAAa,GAAGE,GAAkB;AACnF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchField.js","sources":["../../../../../src/components/Common/Fields/SwitchField/SwitchField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nexport interface SwitchFieldProps\n extends
|
|
1
|
+
{"version":3,"file":"SwitchField.js","sources":["../../../../../src/components/Common/Fields/SwitchField/SwitchField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nexport interface SwitchFieldProps\n extends\n Omit<SwitchProps, 'name' | 'checked' | 'onChange' | 'isInvalid'>,\n UseFieldProps<boolean> {}\n\nexport const SwitchField: React.FC<SwitchFieldProps> = ({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n ...switchProps\n}: SwitchFieldProps) => {\n const Components = useComponentContext()\n const fieldProps = useField({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n return <Components.Switch {...switchProps} {...fieldProps} />\n}\n"],"names":["SwitchField","rules","defaultValue","name","errorMessage","isRequired","onChange","transform","description","onBlur","inputRef","switchProps","Components","useComponentContext","fieldProps","useField"],"mappings":";;;AAQO,MAAMA,IAA0C,CAAC;AAAA,EACtD,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAwB;AACtB,QAAMC,IAAaC,EAAA,GACbC,IAAaC,EAAS;AAAA,IAC1B,MAAAZ;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD;AAED,2BAAQE,EAAW,QAAX,EAAmB,GAAGD,GAAc,GAAGG,GAAY;AAC7D;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAreaField.js","sources":["../../../../../src/components/Common/Fields/TextAreaField/TextAreaField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { TextAreaProps } from '@/components/Common/UI/TextArea/TextAreaTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface TextAreaFieldProps\n extends
|
|
1
|
+
{"version":3,"file":"TextAreaField.js","sources":["../../../../../src/components/Common/Fields/TextAreaField/TextAreaField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { TextAreaProps } from '@/components/Common/UI/TextArea/TextAreaTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface TextAreaFieldProps\n extends\n Omit<TextAreaProps, 'name' | 'value' | 'isInvalid'>,\n UseFieldProps<string, HTMLTextAreaElement> {}\n\nexport const TextAreaField: React.FC<TextAreaFieldProps> = ({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n ...textAreaProps\n}: TextAreaFieldProps) => {\n const Components = useComponentContext()\n const fieldProps = useField({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n return <Components.TextArea {...textAreaProps} {...fieldProps} />\n}\n"],"names":["TextAreaField","rules","defaultValue","name","errorMessage","isRequired","onChange","transform","description","onBlur","inputRef","textAreaProps","Components","useComponentContext","fieldProps","useField"],"mappings":";;;AASO,MAAMA,IAA8C,CAAC;AAAA,EAC1D,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA0B;AACxB,QAAMC,IAAaC,EAAA,GACbC,IAAaC,EAAS;AAAA,IAC1B,MAAAZ;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD;AAED,2BAAQE,EAAW,UAAX,EAAqB,GAAGD,GAAgB,GAAGG,GAAY;AACjE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputField.js","sources":["../../../../../src/components/Common/Fields/TextInputField/TextInputField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface TextInputFieldProps\n extends Omit<TextInputProps, 'name' | 'value' | 'isInvalid'
|
|
1
|
+
{"version":3,"file":"TextInputField.js","sources":["../../../../../src/components/Common/Fields/TextInputField/TextInputField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface TextInputFieldProps\n extends Omit<TextInputProps, 'name' | 'value' | 'isInvalid'>, UseFieldProps {}\n\nexport const TextInputField: React.FC<TextInputFieldProps> = ({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n ...textInputProps\n}: TextInputFieldProps) => {\n const Components = useComponentContext()\n const fieldProps = useField({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n return <Components.TextInput {...textInputProps} {...fieldProps} />\n}\n"],"names":["TextInputField","rules","defaultValue","name","errorMessage","isRequired","onChange","transform","description","onBlur","inputRef","textInputProps","Components","useComponentContext","fieldProps","useField"],"mappings":";;;AAOO,MAAMA,IAAgD,CAAC;AAAA,EAC5D,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA2B;AACzB,QAAMC,IAAaC,EAAA,GACbC,IAAaC,EAAS;AAAA,IAC1B,MAAAZ;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD;AAED,2BAAQE,EAAW,WAAX,EAAsB,GAAGD,GAAiB,GAAGG,GAAY;AACnE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fieldset.js","sources":["../../../../src/components/Common/Fieldset/Fieldset.tsx"],"sourcesContent":["import { useId } from 'react'\nimport classNames from 'classnames'\nimport { FieldDescription } from '../FieldDescription'\nimport { FieldErrorMessage } from '../FieldErrorMessage'\nimport { FieldCaption } from '../FieldCaption'\nimport type { SharedFieldLayoutProps } from '../FieldLayout/FieldLayoutTypes'\nimport styles from './Fieldset.module.scss'\nimport { getDataProps } from '@/helpers/getDataProps'\n\nexport interface FieldsetProps
|
|
1
|
+
{"version":3,"file":"Fieldset.js","sources":["../../../../src/components/Common/Fieldset/Fieldset.tsx"],"sourcesContent":["import { useId } from 'react'\nimport classNames from 'classnames'\nimport { FieldDescription } from '../FieldDescription'\nimport { FieldErrorMessage } from '../FieldErrorMessage'\nimport { FieldCaption } from '../FieldCaption'\nimport type { SharedFieldLayoutProps } from '../FieldLayout/FieldLayoutTypes'\nimport styles from './Fieldset.module.scss'\nimport { getDataProps } from '@/helpers/getDataProps'\n\nexport interface FieldsetProps extends Omit<\n SharedFieldLayoutProps,\n 'label' | 'shouldVisuallyHideLabel'\n> {\n children: React.ReactNode\n description?: React.ReactNode\n errorMessage?: string\n isRequired?: boolean\n legend: React.ReactNode\n shouldVisuallyHideLegend?: boolean\n className?: string\n}\n\nexport const Fieldset: React.FC<FieldsetProps> = ({\n children,\n description,\n errorMessage,\n isRequired = false,\n legend,\n shouldVisuallyHideLegend = false,\n className,\n ...props\n}: FieldsetProps) => {\n const generatedErrorMessageId = useId()\n const errorMessageId = `error-message-${generatedErrorMessageId}`\n\n return (\n <fieldset\n className={classNames(styles.root, className)}\n aria-describedby={errorMessage ? errorMessageId : undefined}\n {...getDataProps(props)}\n >\n <div\n className={classNames(styles.legendAndDescription, {\n [styles.withVisibleLegend as string]: !shouldVisuallyHideLegend,\n [styles.withDescription as string]: Boolean(description),\n })}\n >\n <FieldCaption\n as=\"legend\"\n isRequired={isRequired}\n isVisuallyHidden={shouldVisuallyHideLegend}\n >\n {legend}\n </FieldCaption>\n <FieldDescription>{description}</FieldDescription>\n </div>\n {children}\n <FieldErrorMessage\n id={errorMessageId}\n className={styles.errorMessage}\n aria-live=\"polite\"\n role=\"alert\"\n >\n {errorMessage}\n </FieldErrorMessage>\n </fieldset>\n )\n}\n"],"names":["Fieldset","children","description","errorMessage","isRequired","legend","shouldVisuallyHideLegend","className","props","errorMessageId","useId","jsxs","classNames","styles","getDataProps","jsx","FieldCaption","FieldDescription","FieldErrorMessage"],"mappings":";;;;;;;;AAsBO,MAAMA,IAAoC,CAAC;AAAA,EAChD,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,QAAAC;AAAA,EACA,0BAAAC,IAA2B;AAAA,EAC3B,WAAAC;AAAA,EACA,GAAGC;AACL,MAAqB;AAEnB,QAAMC,IAAiB,iBADSC,EAAA,CAC+B;AAE/D,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAWC,EAAO,MAAMN,CAAS;AAAA,MAC5C,oBAAkBJ,IAAeM,IAAiB;AAAA,MACjD,GAAGK,EAAaN,CAAK;AAAA,MAEtB,UAAA;AAAA,QAAA,gBAAAG;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC,EAAWC,EAAO,sBAAsB;AAAA,cACjD,CAACA,EAAO,iBAA2B,GAAG,CAACP;AAAA,cACvC,CAACO,EAAO,eAAyB,GAAG,EAAQX;AAAA,YAAW,CACxD;AAAA,YAED,UAAA;AAAA,cAAA,gBAAAa;AAAA,gBAACC;AAAA,gBAAA;AAAA,kBACC,IAAG;AAAA,kBACH,YAAAZ;AAAA,kBACA,kBAAkBE;AAAA,kBAEjB,UAAAD;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEH,gBAAAU,EAACE,KAAkB,UAAAf,EAAA,CAAY;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAEhCD;AAAA,QACD,gBAAAc;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,IAAIT;AAAA,YACJ,WAAWI,EAAO;AAAA,YAClB,aAAU;AAAA,YACV,MAAK;AAAA,YAEJ,UAAAV;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createBreadcrumbNavigateTransition: <TContext>() => (targetState: string) => import('robot3').Transition<"breadcrumb/navigate">;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { transition as e, guard as n, reduce as t } from "robot3";
|
|
2
|
+
import { componentEvents as i } from "../../../shared/constants.js";
|
|
3
|
+
const p = () => (r) => e(
|
|
4
|
+
i.BREADCRUMB_NAVIGATE,
|
|
5
|
+
r,
|
|
6
|
+
n((a, o) => o.payload.key === r),
|
|
7
|
+
t(
|
|
8
|
+
(a, o) => o.payload.onNavigate(a)
|
|
9
|
+
)
|
|
10
|
+
);
|
|
11
|
+
export {
|
|
12
|
+
p as createBreadcrumbNavigateTransition
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=breadcrumbTransitionHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbTransitionHelpers.js","sources":["../../../../src/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.ts"],"sourcesContent":["import { guard, reduce, transition } from 'robot3'\nimport { componentEvents } from '@/shared/constants'\n\ntype BreadcrumbNavigateEvent<TContext> = {\n payload: {\n key: string\n onNavigate: (ctx: TContext) => TContext\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters\nexport const createBreadcrumbNavigateTransition = <TContext>() => {\n return (targetState: string) =>\n transition(\n componentEvents.BREADCRUMB_NAVIGATE,\n targetState,\n guard((ctx: TContext, ev: { payload: { key: string } }) => ev.payload.key === targetState),\n reduce(\n (ctx: TContext, ev: BreadcrumbNavigateEvent<TContext>): TContext =>\n ev.payload.onNavigate(ctx),\n ),\n )\n}\n"],"names":["createBreadcrumbNavigateTransition","targetState","transition","componentEvents","guard","ctx","ev","reduce"],"mappings":";;AAWO,MAAMA,IAAqC,MACzC,CAACC,MACNC;AAAA,EACEC,EAAgB;AAAA,EAChBF;AAAA,EACAG,EAAM,CAACC,GAAeC,MAAqCA,EAAG,QAAQ,QAAQL,CAAW;AAAA,EACzFM;AAAA,IACE,CAACF,GAAeC,MACdA,EAAG,QAAQ,WAAWD,CAAG;AAAA,EAAA;AAC7B;"}
|
|
@@ -3,7 +3,7 @@ import { ReorderableListItem } from './ReorderableListTypes';
|
|
|
3
3
|
interface ReorderableItemProps {
|
|
4
4
|
item: ReorderableListItem;
|
|
5
5
|
index: number;
|
|
6
|
-
moveItem: (fromIndex: number, toIndex: number, source
|
|
6
|
+
moveItem: (fromIndex: number, toIndex: number, source: 'keyboard' | 'dragdrop') => void;
|
|
7
7
|
itemCount: number;
|
|
8
8
|
itemIndex: number;
|
|
9
9
|
listId: string;
|
|
@@ -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":"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"}
|
|
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":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as M } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as $, useState as
|
|
2
|
+
import { useRef as $, useState as b, useMemo as U, useEffect as G, useCallback as R } from "react";
|
|
3
3
|
import T from "classnames";
|
|
4
4
|
import { HTML5Backend as z } from "../../../node_modules/react-dnd-html5-backend/dist/index.js";
|
|
5
5
|
import g from "./ReorderableList.module.scss.js";
|
|
@@ -37,9 +37,9 @@ function ce({
|
|
|
37
37
|
dropZoneClassName: y,
|
|
38
38
|
itemClassName: L
|
|
39
39
|
}) {
|
|
40
|
-
const c = $(Q()).current, [i, Z] =
|
|
40
|
+
const c = $(Q()).current, [i, Z] = b(
|
|
41
41
|
() => Array.from({ length: t.length }, (r, e) => e)
|
|
42
|
-
), [F,
|
|
42
|
+
), [F, p] = b(null), [S, _] = b(!1), [j, B] = b(!1), [E, k] = b(null), A = $(!1), u = $({}), o = U(
|
|
43
43
|
() => ({
|
|
44
44
|
...q,
|
|
45
45
|
...f
|
|
@@ -50,13 +50,13 @@ function ce({
|
|
|
50
50
|
t.length !== i.length && Z(Array.from({ length: t.length }, (r, e) => e));
|
|
51
51
|
}, [t.length, i.length]);
|
|
52
52
|
const w = R((r) => {
|
|
53
|
-
u.current = {}, u.current[r] = !0,
|
|
53
|
+
u.current = {}, u.current[r] = !0, p(r);
|
|
54
54
|
}, []), x = R((r) => {
|
|
55
55
|
r in u.current && (u.current[r] = !1);
|
|
56
56
|
const e = Object.entries(u.current).filter(([l, m]) => m).map(([l]) => Number(l));
|
|
57
|
-
e.length === 0 ?
|
|
57
|
+
e.length === 0 ? p(null) : e.length === 1 && p(Number(e[0]));
|
|
58
58
|
}, []), I = R(
|
|
59
|
-
(r, e, l
|
|
59
|
+
(r, e, l) => {
|
|
60
60
|
if (D || r === e || r < 0 || r >= i.length || e < 0 || e > i.length)
|
|
61
61
|
return;
|
|
62
62
|
A.current = !0;
|
|
@@ -68,7 +68,7 @@ function ce({
|
|
|
68
68
|
Z(N);
|
|
69
69
|
const H = o.disabled ? 0 : o.duration;
|
|
70
70
|
setTimeout(() => {
|
|
71
|
-
if (_(!1), A.current = !1, u.current = {},
|
|
71
|
+
if (_(!1), A.current = !1, u.current = {}, p(null), l === "keyboard") {
|
|
72
72
|
const h = N.findIndex((v) => v === m);
|
|
73
73
|
if (h >= 0) {
|
|
74
74
|
k(h);
|