@gusto/embedded-react-sdk 0.13.4 → 0.14.0
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 +20 -0
- package/dist/assets/icons/spinner_large.svg.js +10 -0
- package/dist/assets/icons/spinner_large.svg.js.map +1 -0
- package/dist/components/Common/Flex/Flex.js +16 -12
- package/dist/components/Common/Flex/Flex.js.map +1 -1
- package/dist/components/Common/Loading/Loading.d.ts +5 -1
- package/dist/components/Common/Loading/Loading.js +9 -9
- package/dist/components/Common/Loading/Loading.js.map +1 -1
- package/dist/components/Common/Loading/Loading.module.scss.js +1 -1
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinner.d.ts +3 -0
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinner.js +25 -0
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinner.js.map +1 -0
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinner.module.scss.js +10 -0
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinner.module.scss.js.map +1 -0
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.d.ts +18 -0
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js +8 -0
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js.map +1 -0
- package/dist/components/Common/UI/LoadingSpinner/index.d.ts +4 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +0 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +25 -24
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/PayrollBlockerAlerts.d.ts +10 -3
- package/dist/components/Payroll/PayrollBlocker/PayrollBlockerAlerts.js +54 -0
- package/dist/components/Payroll/PayrollBlocker/PayrollBlockerAlerts.js.map +1 -0
- package/dist/components/Payroll/PayrollBlocker/PayrollBlockerList.d.ts +14 -1
- package/dist/components/Payroll/PayrollBlocker/index.d.ts +1 -2
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +27 -0
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +39 -0
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +76 -66
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +4 -2
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +157 -122
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +39 -36
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +2 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +28 -36
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +15 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +62 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -0
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +5 -0
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +93 -0
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +49 -45
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +309 -263
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +2 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +26 -12
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +44 -40
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +1 -1
- package/dist/components/Payroll/index.js +6 -8
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +40 -24
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +28 -26
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +28 -23
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +3 -1
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js +8 -8
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -1
- package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +19 -19
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +50 -44
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollReceipts.json.js +14 -12
- package/dist/i18n/en/Payroll.PayrollReceipts.json.js.map +1 -1
- package/dist/i18n/en/PayrollBlocker.json.js +17 -11
- package/dist/i18n/en/PayrollBlocker.json.js.map +1 -1
- package/dist/shared/constants.d.ts +1 -1
- package/dist/shared/constants.js +1 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +145 -3
- package/package.json +16 -16
- package/dist/components/Payroll/PayrollBlocker/PayrollBlockerTypes.d.ts +0 -101
- package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js +0 -126
- package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js.map +0 -1
- package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js +0 -22
- package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js.map +0 -1
|
@@ -1,39 +1,55 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as m, useCallback as c, useEffect as P } from "react";
|
|
2
2
|
import { usePayrollsPrepareMutation as y } from "@gusto/embedded-api/react-query/payrollsPrepare";
|
|
3
|
-
import { usePaySchedulesGet as
|
|
4
|
-
|
|
3
|
+
import { usePaySchedulesGet as S } from "@gusto/embedded-api/react-query/paySchedulesGet";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "react-error-boundary";
|
|
6
|
+
import "react-i18next";
|
|
7
|
+
import "@gusto/embedded-api/models/errors/apierror";
|
|
8
|
+
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
9
|
+
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
10
|
+
import "@tanstack/react-query";
|
|
11
|
+
import { useBase as h } from "../Base/useBase.js";
|
|
12
|
+
import "../../shared/constants.js";
|
|
13
|
+
import "classnames";
|
|
14
|
+
import "dompurify";
|
|
15
|
+
import "../../contexts/LocaleProvider/useLocale.js";
|
|
16
|
+
import "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
17
|
+
import "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
18
|
+
const H = ({
|
|
5
19
|
companyId: e,
|
|
6
|
-
payrollId:
|
|
20
|
+
payrollId: t
|
|
7
21
|
}) => {
|
|
8
|
-
const { mutateAsync: o, isPending:
|
|
22
|
+
const { mutateAsync: o, isPending: p } = y(), [r, l] = m(), { baseSubmitHandler: i } = h(), { data: s, isLoading: d } = S(
|
|
9
23
|
{
|
|
10
24
|
companyId: e,
|
|
11
|
-
payScheduleId:
|
|
25
|
+
payScheduleId: r?.payPeriod?.payScheduleUuid || ""
|
|
12
26
|
},
|
|
13
27
|
{
|
|
14
|
-
enabled: !!
|
|
28
|
+
enabled: !!r?.payPeriod?.payScheduleUuid
|
|
15
29
|
}
|
|
16
|
-
),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
), a = c(async () => {
|
|
31
|
+
await i(null, async () => {
|
|
32
|
+
const n = await o({
|
|
33
|
+
request: {
|
|
34
|
+
companyId: e,
|
|
35
|
+
payrollId: t
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
l(n.payrollPrepared);
|
|
22
39
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const i = t || u;
|
|
40
|
+
}, [e, t, o, i]);
|
|
41
|
+
P(() => {
|
|
42
|
+
a();
|
|
43
|
+
}, [a]);
|
|
44
|
+
const u = p || d;
|
|
29
45
|
return {
|
|
30
|
-
handlePreparePayroll:
|
|
31
|
-
preparedPayroll:
|
|
32
|
-
paySchedule:
|
|
33
|
-
isLoading:
|
|
46
|
+
handlePreparePayroll: a,
|
|
47
|
+
preparedPayroll: r,
|
|
48
|
+
paySchedule: s?.payScheduleObject,
|
|
49
|
+
isLoading: u
|
|
34
50
|
};
|
|
35
51
|
};
|
|
36
52
|
export {
|
|
37
|
-
|
|
53
|
+
H as usePreparedPayrollData
|
|
38
54
|
};
|
|
39
55
|
//# sourceMappingURL=usePreparedPayrollData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payrollprepared'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled:
|
|
1
|
+
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payrollprepared'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport { useBase } from '../Base'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const { baseSubmitHandler } = useBase()\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n })\n }, [companyId, payrollId, preparePayroll, baseSubmitHandler])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isLoading = isPreparePayrollPending || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","baseSubmitHandler","useBase","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isLoading"],"mappings":";;;;;;;;;;;;;;;;;AAmBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxC,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExB,EAAE,MAAMC,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAAZ;AAAA,MACA,eAAeK,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIQ,IAAuBC,EAAY,YAAY;AACnD,UAAMN,EAAkB,MAAM,YAAY;AACxC,YAAMO,IAAS,MAAMb,EAAe;AAAA,QAClC,SAAS;AAAA,UACP,WAAAF;AAAA,UACA,WAAAC;AAAA,QAAA;AAAA,MACF,CACD;AACD,MAAAK,EAAmBS,EAAO,eAAe;AAAA,IAC3C,CAAC;AAAA,EACH,GAAG,CAACf,GAAWC,GAAWC,GAAgBM,CAAiB,CAAC;AAE5D,EAAAQ,EAAU,MAAM;AACd,IAAKH,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMI,IAAYd,KAA2BQ;AAE7C,SAAO;AAAA,IACL,sBAAAE;AAAA,IACA,iBAAAR;AAAA,IACA,aAAaK,GAAiB;AAAA,IAC9B,WAAAO;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { TextInput as m } from "../../../components/Common/UI/TextInput/TextInput.js";
|
|
3
3
|
import { NumberInput as t } from "../../../components/Common/UI/NumberInput/NumberInput.js";
|
|
4
|
-
import { CheckboxGroup as
|
|
5
|
-
import { ComboBox as
|
|
4
|
+
import { CheckboxGroup as i } from "../../../components/Common/UI/CheckboxGroup/CheckboxGroup.js";
|
|
5
|
+
import { ComboBox as e } from "../../../components/Common/UI/ComboBox/ComboBox.js";
|
|
6
6
|
import { Checkbox as p } from "../../../components/Common/UI/Checkbox/Checkbox.js";
|
|
7
7
|
import { DatePicker as f } from "../../../components/Common/UI/DatePicker/DatePicker.js";
|
|
8
|
-
import { Radio as
|
|
9
|
-
import { RadioGroup as
|
|
8
|
+
import { Radio as n } from "../../../components/Common/UI/Radio/Radio.js";
|
|
9
|
+
import { RadioGroup as a } from "../../../components/Common/UI/RadioGroup/RadioGroup.js";
|
|
10
10
|
import { Select as d } from "../../../components/Common/UI/Select/Select.js";
|
|
11
11
|
import { Switch as u } from "../../../components/Common/UI/Switch/Switch.js";
|
|
12
12
|
import { Button as c } from "../../../components/Common/UI/Button/Button.js";
|
|
@@ -15,17 +15,18 @@ import { Alert as b } from "../../../components/Common/UI/Alert/Alert.js";
|
|
|
15
15
|
import { Card as x } from "../../../components/Common/UI/Card/Card.js";
|
|
16
16
|
import { Badge as l } from "../../../components/Common/UI/Badge/Badge.js";
|
|
17
17
|
import { Link as C } from "../../../components/Common/UI/Link/Link.js";
|
|
18
|
-
import { Menu as
|
|
19
|
-
import { Table as
|
|
18
|
+
import { Menu as g } from "../../../components/Common/UI/Menu/Menu.js";
|
|
19
|
+
import { Table as B } from "../../../components/Common/UI/Table/Table.js";
|
|
20
20
|
import { OrderedList as k } from "../../../components/Common/UI/List/OrderedList.js";
|
|
21
|
-
import { UnorderedList as
|
|
22
|
-
import { Heading as
|
|
23
|
-
import { Text as
|
|
24
|
-
import { CalendarPreview as
|
|
21
|
+
import { UnorderedList as L } from "../../../components/Common/UI/List/UnorderedList.js";
|
|
22
|
+
import { Heading as T } from "../../../components/Common/UI/Heading/Heading.js";
|
|
23
|
+
import { Text as h } from "../../../components/Common/UI/Text/Text.js";
|
|
24
|
+
import { CalendarPreview as I } from "../../../components/Common/UI/CalendarPreview/CalendarPreview.js";
|
|
25
25
|
import { ProgressBar as P } from "../../../components/Common/UI/ProgressBar/ProgressBar.js";
|
|
26
|
-
import { Tabs as
|
|
27
|
-
import { Dialog as
|
|
28
|
-
|
|
26
|
+
import { Tabs as S } from "../../../components/Common/UI/Tabs/Tabs.js";
|
|
27
|
+
import { Dialog as w } from "../../../components/Common/UI/Dialog/Dialog.js";
|
|
28
|
+
import { LoadingSpinner as D } from "../../../components/Common/UI/LoadingSpinner/LoadingSpinner.js";
|
|
29
|
+
const to = {
|
|
29
30
|
Alert: (o) => /* @__PURE__ */ r(b, { ...o }),
|
|
30
31
|
Badge: (o) => /* @__PURE__ */ r(l, { ...o }),
|
|
31
32
|
Button: (o) => /* @__PURE__ */ r(c, { ...o }),
|
|
@@ -33,27 +34,28 @@ const ro = {
|
|
|
33
34
|
Card: (o) => /* @__PURE__ */ r(x, { ...o }),
|
|
34
35
|
TextInput: (o) => /* @__PURE__ */ r(m, { ...o }),
|
|
35
36
|
Checkbox: (o) => /* @__PURE__ */ r(p, { ...o }),
|
|
36
|
-
CheckboxGroup: (o) => /* @__PURE__ */ r(
|
|
37
|
-
ComboBox: (o) => /* @__PURE__ */ r(
|
|
37
|
+
CheckboxGroup: (o) => /* @__PURE__ */ r(i, { ...o }),
|
|
38
|
+
ComboBox: (o) => /* @__PURE__ */ r(e, { ...o }),
|
|
38
39
|
DatePicker: (o) => /* @__PURE__ */ r(f, { ...o }),
|
|
39
40
|
OrderedList: (o) => /* @__PURE__ */ r(k, { ...o }),
|
|
40
|
-
UnorderedList: (o) => /* @__PURE__ */ r(
|
|
41
|
+
UnorderedList: (o) => /* @__PURE__ */ r(L, { ...o }),
|
|
41
42
|
NumberInput: (o) => /* @__PURE__ */ r(t, { ...o }),
|
|
42
|
-
Radio: (o) => /* @__PURE__ */ r(
|
|
43
|
-
RadioGroup: (o) => /* @__PURE__ */ r(
|
|
43
|
+
Radio: (o) => /* @__PURE__ */ r(n, { ...o }),
|
|
44
|
+
RadioGroup: (o) => /* @__PURE__ */ r(a, { ...o }),
|
|
44
45
|
Select: (o) => /* @__PURE__ */ r(d, { ...o }),
|
|
45
46
|
Switch: (o) => /* @__PURE__ */ r(u, { ...o }),
|
|
46
47
|
Link: (o) => /* @__PURE__ */ r(C, { ...o }),
|
|
47
|
-
Menu: (o) => /* @__PURE__ */ r(
|
|
48
|
-
Table: (o) => /* @__PURE__ */ r(
|
|
49
|
-
Heading: (o) => /* @__PURE__ */ r(
|
|
50
|
-
Text: (o) => /* @__PURE__ */ r(
|
|
51
|
-
CalendarPreview: (o) => /* @__PURE__ */ r(
|
|
48
|
+
Menu: (o) => /* @__PURE__ */ r(g, { ...o }),
|
|
49
|
+
Table: (o) => /* @__PURE__ */ r(B, { ...o }),
|
|
50
|
+
Heading: (o) => /* @__PURE__ */ r(T, { ...o }),
|
|
51
|
+
Text: (o) => /* @__PURE__ */ r(h, { ...o }),
|
|
52
|
+
CalendarPreview: (o) => /* @__PURE__ */ r(I, { ...o }),
|
|
52
53
|
ProgressBar: (o) => /* @__PURE__ */ r(P, { ...o }),
|
|
53
|
-
Tabs: (o) => /* @__PURE__ */ r(
|
|
54
|
-
Dialog: (o) => /* @__PURE__ */ r(
|
|
54
|
+
Tabs: (o) => /* @__PURE__ */ r(S, { ...o }),
|
|
55
|
+
Dialog: (o) => /* @__PURE__ */ r(w, { ...o }),
|
|
56
|
+
LoadingSpinner: (o) => /* @__PURE__ */ r(D, { ...o })
|
|
55
57
|
};
|
|
56
58
|
export {
|
|
57
|
-
|
|
59
|
+
to as defaultComponents
|
|
58
60
|
};
|
|
59
61
|
//# sourceMappingURL=defaultComponentAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultComponentAdapter.js","sources":["../../../../src/contexts/ComponentAdapter/adapters/defaultComponentAdapter.tsx"],"sourcesContent":["// This is used to set the default adapter and can already be ommitted by using the\n// `GustoProviderCustomUIAdapter` component. That means this is a safe file to use\n// non type imports from the UI directory so the lint rule is disabled for this file.\n/* eslint-disable no-restricted-imports */\nimport type { ComponentsContextType } from '../useComponentContext'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { TextInput } from '@/components/Common/UI/TextInput'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport { NumberInput } from '@/components/Common/UI/NumberInput'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { CheckboxGroup } from '@/components/Common/UI/CheckboxGroup'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport { ComboBox } from '@/components/Common/UI/ComboBox/ComboBox'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { Checkbox } from '@/components/Common/UI/Checkbox'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport { DatePicker } from '@/components/Common/UI/DatePicker'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport { Radio } from '@/components/Common/UI/Radio'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { RadioGroup } from '@/components/Common/UI/RadioGroup'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport { Select } from '@/components/Common/UI/Select'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { Switch } from '@/components/Common/UI/Switch'\nimport type { ButtonProps, ButtonIconProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport { Button } from '@/components/Common/UI/Button'\nimport { ButtonIcon } from '@/components/Common/UI/Button/ButtonIcon'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport { Alert } from '@/components/Common/UI/Alert/Alert'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport { Card } from '@/components/Common/UI/Card/Card'\nimport { Badge } from '@/components/Common/UI/Badge/Badge'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport { Link } from '@/components/Common/UI/Link'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport { Menu } from '@/components/Common/UI/Menu'\nimport type { TableProps } from '@/components/Common/UI/Table'\nimport { Table } from '@/components/Common/UI/Table'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List'\nimport { OrderedList, UnorderedList } from '@/components/Common/UI/List'\nimport { Heading } from '@/components/Common/UI/Heading'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport { Text } from '@/components/Common/UI/Text'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport { CalendarPreview } from '@/components/Common/UI/CalendarPreview'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar'\nimport { ProgressBar } from '@/components/Common/UI/ProgressBar'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport { Tabs } from '@/components/Common/UI/Tabs'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport { Dialog } from '@/components/Common/UI/Dialog'\n\nexport const defaultComponents: ComponentsContextType = {\n Alert: (props: AlertProps) => <Alert {...props} />,\n Badge: (props: BadgeProps) => <Badge {...props} />,\n Button: (props: ButtonProps) => <Button {...props} />,\n ButtonIcon: (props: ButtonIconProps) => <ButtonIcon {...props} />,\n Card: (props: CardProps) => <Card {...props} />,\n TextInput: (props: TextInputProps) => <TextInput {...props} />,\n Checkbox: (props: CheckboxProps) => <Checkbox {...props} />,\n CheckboxGroup: (props: CheckboxGroupProps) => <CheckboxGroup {...props} />,\n ComboBox: (props: ComboBoxProps) => <ComboBox {...props} />,\n DatePicker: (props: DatePickerProps) => <DatePicker {...props} />,\n OrderedList: (props: OrderedListProps) => <OrderedList {...props} />,\n UnorderedList: (props: UnorderedListProps) => <UnorderedList {...props} />,\n NumberInput: (props: NumberInputProps) => <NumberInput {...props} />,\n Radio: (props: RadioProps) => <Radio {...props} />,\n RadioGroup: (props: RadioGroupProps) => <RadioGroup {...props} />,\n Select: (props: SelectProps) => <Select {...props} />,\n Switch: (props: SwitchProps) => <Switch {...props} />,\n Link: (props: LinkProps) => <Link {...props} />,\n Menu: (props: MenuProps) => <Menu {...props} />,\n Table: (props: TableProps) => <Table {...props} />,\n Heading: (props: HeadingProps) => <Heading {...props} />,\n Text: (props: TextProps) => <Text {...props} />,\n CalendarPreview: (props: CalendarPreviewProps) => <CalendarPreview {...props} />,\n ProgressBar: (props: ProgressBarProps) => <ProgressBar {...props} />,\n Tabs: (props: TabsProps) => <Tabs {...props} />,\n Dialog: (props: DialogProps) => <Dialog {...props} />,\n}\n"],"names":["defaultComponents","props","jsx","Alert","Badge","Button","ButtonIcon","Card","TextInput","Checkbox","CheckboxGroup","ComboBox","DatePicker","OrderedList","UnorderedList","NumberInput","Radio","RadioGroup","Select","Switch","Link","Menu","Table","Heading","Text","CalendarPreview","ProgressBar","Tabs","Dialog"],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaultComponentAdapter.js","sources":["../../../../src/contexts/ComponentAdapter/adapters/defaultComponentAdapter.tsx"],"sourcesContent":["// This is used to set the default adapter and can already be ommitted by using the\n// `GustoProviderCustomUIAdapter` component. That means this is a safe file to use\n// non type imports from the UI directory so the lint rule is disabled for this file.\n/* eslint-disable no-restricted-imports */\nimport type { ComponentsContextType } from '../useComponentContext'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { TextInput } from '@/components/Common/UI/TextInput'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport { NumberInput } from '@/components/Common/UI/NumberInput'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { CheckboxGroup } from '@/components/Common/UI/CheckboxGroup'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport { ComboBox } from '@/components/Common/UI/ComboBox/ComboBox'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { Checkbox } from '@/components/Common/UI/Checkbox'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport { DatePicker } from '@/components/Common/UI/DatePicker'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport { Radio } from '@/components/Common/UI/Radio'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { RadioGroup } from '@/components/Common/UI/RadioGroup'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport { Select } from '@/components/Common/UI/Select'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { Switch } from '@/components/Common/UI/Switch'\nimport type { ButtonProps, ButtonIconProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport { Button } from '@/components/Common/UI/Button'\nimport { ButtonIcon } from '@/components/Common/UI/Button/ButtonIcon'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport { Alert } from '@/components/Common/UI/Alert/Alert'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport { Card } from '@/components/Common/UI/Card/Card'\nimport { Badge } from '@/components/Common/UI/Badge/Badge'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport { Link } from '@/components/Common/UI/Link'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport { Menu } from '@/components/Common/UI/Menu'\nimport type { TableProps } from '@/components/Common/UI/Table'\nimport { Table } from '@/components/Common/UI/Table'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List'\nimport { OrderedList, UnorderedList } from '@/components/Common/UI/List'\nimport { Heading } from '@/components/Common/UI/Heading'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport { Text } from '@/components/Common/UI/Text'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport { CalendarPreview } from '@/components/Common/UI/CalendarPreview'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar'\nimport { ProgressBar } from '@/components/Common/UI/ProgressBar'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport { Tabs } from '@/components/Common/UI/Tabs'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport { Dialog } from '@/components/Common/UI/Dialog'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\nimport { LoadingSpinner } from '@/components/Common/UI/LoadingSpinner'\n\nexport const defaultComponents: ComponentsContextType = {\n Alert: (props: AlertProps) => <Alert {...props} />,\n Badge: (props: BadgeProps) => <Badge {...props} />,\n Button: (props: ButtonProps) => <Button {...props} />,\n ButtonIcon: (props: ButtonIconProps) => <ButtonIcon {...props} />,\n Card: (props: CardProps) => <Card {...props} />,\n TextInput: (props: TextInputProps) => <TextInput {...props} />,\n Checkbox: (props: CheckboxProps) => <Checkbox {...props} />,\n CheckboxGroup: (props: CheckboxGroupProps) => <CheckboxGroup {...props} />,\n ComboBox: (props: ComboBoxProps) => <ComboBox {...props} />,\n DatePicker: (props: DatePickerProps) => <DatePicker {...props} />,\n OrderedList: (props: OrderedListProps) => <OrderedList {...props} />,\n UnorderedList: (props: UnorderedListProps) => <UnorderedList {...props} />,\n NumberInput: (props: NumberInputProps) => <NumberInput {...props} />,\n Radio: (props: RadioProps) => <Radio {...props} />,\n RadioGroup: (props: RadioGroupProps) => <RadioGroup {...props} />,\n Select: (props: SelectProps) => <Select {...props} />,\n Switch: (props: SwitchProps) => <Switch {...props} />,\n Link: (props: LinkProps) => <Link {...props} />,\n Menu: (props: MenuProps) => <Menu {...props} />,\n Table: (props: TableProps) => <Table {...props} />,\n Heading: (props: HeadingProps) => <Heading {...props} />,\n Text: (props: TextProps) => <Text {...props} />,\n CalendarPreview: (props: CalendarPreviewProps) => <CalendarPreview {...props} />,\n ProgressBar: (props: ProgressBarProps) => <ProgressBar {...props} />,\n Tabs: (props: TabsProps) => <Tabs {...props} />,\n Dialog: (props: DialogProps) => <Dialog {...props} />,\n LoadingSpinner: (props: LoadingSpinnerProps) => <LoadingSpinner {...props} />,\n}\n"],"names":["defaultComponents","props","jsx","Alert","Badge","Button","ButtonIcon","Card","TextInput","Checkbox","CheckboxGroup","ComboBox","DatePicker","OrderedList","UnorderedList","NumberInput","Radio","RadioGroup","Select","Switch","Link","Menu","Table","Heading","Text","CalendarPreview","ProgressBar","Tabs","Dialog","LoadingSpinner"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDO,MAAMA,KAA2C;AAAA,EACtD,OAAO,CAACC,MAAsB,gBAAAC,EAACC,GAAA,EAAO,GAAGF,GAAO;AAAA,EAChD,OAAO,CAACA,MAAsB,gBAAAC,EAACE,GAAA,EAAO,GAAGH,GAAO;AAAA,EAChD,QAAQ,CAACA,MAAuB,gBAAAC,EAACG,GAAA,EAAQ,GAAGJ,GAAO;AAAA,EACnD,YAAY,CAACA,MAA2B,gBAAAC,EAACI,GAAA,EAAY,GAAGL,GAAO;AAAA,EAC/D,MAAM,CAACA,MAAqB,gBAAAC,EAACK,GAAA,EAAM,GAAGN,GAAO;AAAA,EAC7C,WAAW,CAACA,MAA0B,gBAAAC,EAACM,GAAA,EAAW,GAAGP,GAAO;AAAA,EAC5D,UAAU,CAACA,MAAyB,gBAAAC,EAACO,GAAA,EAAU,GAAGR,GAAO;AAAA,EACzD,eAAe,CAACA,MAA8B,gBAAAC,EAACQ,GAAA,EAAe,GAAGT,GAAO;AAAA,EACxE,UAAU,CAACA,MAAyB,gBAAAC,EAACS,GAAA,EAAU,GAAGV,GAAO;AAAA,EACzD,YAAY,CAACA,MAA2B,gBAAAC,EAACU,GAAA,EAAY,GAAGX,GAAO;AAAA,EAC/D,aAAa,CAACA,MAA4B,gBAAAC,EAACW,GAAA,EAAa,GAAGZ,GAAO;AAAA,EAClE,eAAe,CAACA,MAA8B,gBAAAC,EAACY,GAAA,EAAe,GAAGb,GAAO;AAAA,EACxE,aAAa,CAACA,MAA4B,gBAAAC,EAACa,GAAA,EAAa,GAAGd,GAAO;AAAA,EAClE,OAAO,CAACA,MAAsB,gBAAAC,EAACc,GAAA,EAAO,GAAGf,GAAO;AAAA,EAChD,YAAY,CAACA,MAA2B,gBAAAC,EAACe,GAAA,EAAY,GAAGhB,GAAO;AAAA,EAC/D,QAAQ,CAACA,MAAuB,gBAAAC,EAACgB,GAAA,EAAQ,GAAGjB,GAAO;AAAA,EACnD,QAAQ,CAACA,MAAuB,gBAAAC,EAACiB,GAAA,EAAQ,GAAGlB,GAAO;AAAA,EACnD,MAAM,CAACA,MAAqB,gBAAAC,EAACkB,GAAA,EAAM,GAAGnB,GAAO;AAAA,EAC7C,MAAM,CAACA,MAAqB,gBAAAC,EAACmB,GAAA,EAAM,GAAGpB,GAAO;AAAA,EAC7C,OAAO,CAACA,MAAsB,gBAAAC,EAACoB,GAAA,EAAO,GAAGrB,GAAO;AAAA,EAChD,SAAS,CAACA,MAAwB,gBAAAC,EAACqB,GAAA,EAAS,GAAGtB,GAAO;AAAA,EACtD,MAAM,CAACA,MAAqB,gBAAAC,EAACsB,GAAA,EAAM,GAAGvB,GAAO;AAAA,EAC7C,iBAAiB,CAACA,MAAgC,gBAAAC,EAACuB,GAAA,EAAiB,GAAGxB,GAAO;AAAA,EAC9E,aAAa,CAACA,MAA4B,gBAAAC,EAACwB,GAAA,EAAa,GAAGzB,GAAO;AAAA,EAClE,MAAM,CAACA,MAAqB,gBAAAC,EAACyB,GAAA,EAAM,GAAG1B,GAAO;AAAA,EAC7C,QAAQ,CAACA,MAAuB,gBAAAC,EAAC0B,GAAA,EAAQ,GAAG3B,GAAO;AAAA,EACnD,gBAAgB,CAACA,MAA+B,gBAAAC,EAAC2B,GAAA,EAAgB,GAAG5B,EAAA,CAAO;AAC7E;"}
|
|
@@ -13,6 +13,7 @@ import { TableProps } from '../../components/Common/UI/Table/TableTypes';
|
|
|
13
13
|
import { TextProps } from '../../components/Common/UI/Text/TextTypes';
|
|
14
14
|
import { TextInputProps } from '../../components/Common/UI/TextInput/TextInputTypes';
|
|
15
15
|
import { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
|
|
16
|
+
import { LoadingSpinnerProps } from '../../components/Common/UI/LoadingSpinner/LoadingSpinnerTypes';
|
|
16
17
|
export declare const componentCreators: {
|
|
17
18
|
readonly Alert: (customComponent: (props: AlertProps) => React.ReactElement | null) => {
|
|
18
19
|
(props: AlertProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
|
|
@@ -70,6 +71,10 @@ export declare const componentCreators: {
|
|
|
70
71
|
(props: DialogProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
|
|
71
72
|
displayName: string;
|
|
72
73
|
};
|
|
74
|
+
readonly LoadingSpinner: (customComponent: (props: LoadingSpinnerProps) => React.ReactElement | null) => {
|
|
75
|
+
(props: LoadingSpinnerProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
|
|
76
|
+
displayName: string;
|
|
77
|
+
};
|
|
73
78
|
};
|
|
74
79
|
/**
|
|
75
80
|
* Creates components with automatic default prop handling.
|
|
@@ -1,57 +1,62 @@
|
|
|
1
|
-
import { defaultComponents as
|
|
2
|
-
import { applyMissingDefaults as
|
|
1
|
+
import { defaultComponents as m } from "./adapters/defaultComponentAdapter.js";
|
|
2
|
+
import { applyMissingDefaults as f } from "../../helpers/applyMissingDefaults.js";
|
|
3
3
|
import { AlertDefaults as s } from "../../components/Common/UI/Alert/AlertTypes.js";
|
|
4
|
-
import { BadgeDefaults as
|
|
5
|
-
import { ButtonIconDefaults as
|
|
4
|
+
import { BadgeDefaults as l } from "../../components/Common/UI/Badge/BadgeTypes.js";
|
|
5
|
+
import { ButtonIconDefaults as c, ButtonDefaults as D } from "../../components/Common/UI/Button/ButtonTypes.js";
|
|
6
6
|
import { CheckboxDefaults as d } from "../../components/Common/UI/Checkbox/CheckboxTypes.js";
|
|
7
7
|
import { CheckboxGroupDefaults as x } from "../../components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js";
|
|
8
8
|
import { MenuDefaults as h } from "../../components/Common/UI/Menu/MenuTypes.js";
|
|
9
9
|
import { RadioDefaults as C } from "../../components/Common/UI/Radio/RadioTypes.js";
|
|
10
10
|
import { RadioGroupDefaults as b } from "../../components/Common/UI/RadioGroup/RadioGroupTypes.js";
|
|
11
|
-
import { SwitchDefaults as
|
|
12
|
-
import { TableDefaults as
|
|
13
|
-
import { TextDefaults as
|
|
11
|
+
import { SwitchDefaults as g } from "../../components/Common/UI/Switch/SwitchTypes.js";
|
|
12
|
+
import { TableDefaults as B } from "../../components/Common/UI/Table/TableTypes.js";
|
|
13
|
+
import { TextDefaults as T } from "../../components/Common/UI/Text/TextTypes.js";
|
|
14
14
|
import { TextInputDefaults as k } from "../../components/Common/UI/TextInput/TextInputTypes.js";
|
|
15
15
|
import { DialogDefaults as G } from "../../components/Common/UI/Dialog/DialogTypes.js";
|
|
16
|
+
import { LoadingSpinnerDefaults as I } from "../../components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js";
|
|
16
17
|
function o(a, t) {
|
|
17
18
|
return (e) => {
|
|
18
19
|
const r = (n) => {
|
|
19
|
-
const
|
|
20
|
-
return e(
|
|
20
|
+
const p = f(n, a);
|
|
21
|
+
return e(p);
|
|
21
22
|
};
|
|
22
23
|
return r.displayName = `withAutoDefault(${t})`, r;
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
|
-
const
|
|
26
|
+
const i = {
|
|
26
27
|
Alert: o(s, "Alert"),
|
|
27
|
-
Badge: o(
|
|
28
|
+
Badge: o(l, "Badge"),
|
|
28
29
|
Button: o(D, "Button"),
|
|
29
|
-
ButtonIcon: o(
|
|
30
|
+
ButtonIcon: o(c, "ButtonIcon"),
|
|
30
31
|
Checkbox: o(d, "Checkbox"),
|
|
31
32
|
CheckboxGroup: o(x, "CheckboxGroup"),
|
|
32
33
|
Menu: o(h, "Menu"),
|
|
33
34
|
Radio: o(C, "Radio"),
|
|
34
35
|
RadioGroup: o(b, "RadioGroup"),
|
|
35
|
-
Switch: o(
|
|
36
|
-
Table: o(
|
|
37
|
-
Text: o(
|
|
36
|
+
Switch: o(g, "Switch"),
|
|
37
|
+
Table: o(B, "Table"),
|
|
38
|
+
Text: o(T, "Text"),
|
|
38
39
|
TextInput: o(k, "TextInput"),
|
|
39
|
-
Dialog: o(G, "Dialog")
|
|
40
|
+
Dialog: o(G, "Dialog"),
|
|
41
|
+
LoadingSpinner: o(
|
|
42
|
+
I,
|
|
43
|
+
"LoadingSpinner"
|
|
44
|
+
)
|
|
40
45
|
};
|
|
41
|
-
function
|
|
42
|
-
const t = { ...
|
|
46
|
+
function E(a = {}) {
|
|
47
|
+
const t = { ...m };
|
|
43
48
|
for (const [e, r] of Object.entries(a)) {
|
|
44
49
|
const n = e;
|
|
45
|
-
if (e in
|
|
46
|
-
const
|
|
47
|
-
t[n] =
|
|
50
|
+
if (e in i) {
|
|
51
|
+
const u = i[e];
|
|
52
|
+
t[n] = u(r);
|
|
48
53
|
} else
|
|
49
54
|
t[n] = r;
|
|
50
55
|
}
|
|
51
56
|
return t;
|
|
52
57
|
}
|
|
53
58
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
i as componentCreators,
|
|
60
|
+
E as createComponents
|
|
56
61
|
};
|
|
57
62
|
//# sourceMappingURL=createComponentsWithDefaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponentsWithDefaults.js","sources":["../../../src/contexts/ComponentAdapter/createComponentsWithDefaults.ts"],"sourcesContent":["import type React from 'react'\nimport type { ComponentsContextType } from './useComponentContext'\nimport { defaultComponents } from './adapters/defaultComponentAdapter'\nimport { applyMissingDefaults } from '@/helpers/applyMissingDefaults'\n// Import prop types and their defaults\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport { AlertDefaults } from '@/components/Common/UI/Alert/AlertTypes'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport { BadgeDefaults } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { ButtonProps, ButtonIconProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport { ButtonDefaults, ButtonIconDefaults } from '@/components/Common/UI/Button/ButtonTypes'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { CheckboxDefaults } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { CheckboxGroupDefaults } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport { MenuDefaults } from '@/components/Common/UI/Menu/MenuTypes'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport { RadioDefaults } from '@/components/Common/UI/Radio/RadioTypes'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { RadioGroupDefaults } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { SwitchDefaults } from '@/components/Common/UI/Switch/SwitchTypes'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport { TableDefaults } from '@/components/Common/UI/Table/TableTypes'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport { TextDefaults } from '@/components/Common/UI/Text/TextTypes'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { TextInputDefaults } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport { DialogDefaults } from '@/components/Common/UI/Dialog/DialogTypes'\n\nfunction composeWithDefaults<TProps>(defaults: Partial<TProps>, componentName: string) {\n return (customComponent: (props: TProps) => React.ReactElement | null) => {\n const wrappedComponent = (props: TProps) => {\n const propsWithDefaults = applyMissingDefaults(props, defaults)\n return customComponent(propsWithDefaults)\n }\n wrappedComponent.displayName = `withAutoDefault(${componentName})`\n return wrappedComponent\n }\n}\n\n// Component creators with defaults\nexport const componentCreators = {\n Alert: composeWithDefaults<AlertProps>(AlertDefaults, 'Alert'),\n Badge: composeWithDefaults<BadgeProps>(BadgeDefaults, 'Badge'),\n Button: composeWithDefaults<ButtonProps>(ButtonDefaults, 'Button'),\n ButtonIcon: composeWithDefaults<ButtonIconProps>(ButtonIconDefaults, 'ButtonIcon'),\n Checkbox: composeWithDefaults<CheckboxProps>(CheckboxDefaults, 'Checkbox'),\n CheckboxGroup: composeWithDefaults<CheckboxGroupProps>(CheckboxGroupDefaults, 'CheckboxGroup'),\n Menu: composeWithDefaults<MenuProps>(MenuDefaults, 'Menu'),\n Radio: composeWithDefaults<RadioProps>(RadioDefaults, 'Radio'),\n RadioGroup: composeWithDefaults<RadioGroupProps>(RadioGroupDefaults, 'RadioGroup'),\n Switch: composeWithDefaults<SwitchProps>(SwitchDefaults, 'Switch'),\n Table: composeWithDefaults<TableProps>(TableDefaults, 'Table'),\n Text: composeWithDefaults<TextProps>(TextDefaults, 'Text'),\n TextInput: composeWithDefaults<TextInputProps>(TextInputDefaults, 'TextInput'),\n Dialog: composeWithDefaults<DialogProps>(DialogDefaults, 'Dialog'),\n} as const\n\n/**\n * Creates components with automatic default prop handling.\n * Supports both partial (GustoProvider) and full (GustoProviderCustomUIAdapter) component sets.\n */\nexport function createComponents(\n providedComponents: Partial<ComponentsContextType> = {},\n): ComponentsContextType {\n const components = { ...defaultComponents }\n\n for (const [componentName, providedComponent] of Object.entries(providedComponents)) {\n const typedComponentName = componentName as keyof ComponentsContextType\n\n if (componentName in componentCreators) {\n const creatorKey = componentName as keyof typeof componentCreators\n const creator = componentCreators[creatorKey]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n components[typedComponentName] = creator(providedComponent as any) as any\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n components[typedComponentName] = providedComponent as any\n }\n }\n\n return components\n}\n"],"names":["composeWithDefaults","defaults","componentName","customComponent","wrappedComponent","props","propsWithDefaults","applyMissingDefaults","componentCreators","AlertDefaults","BadgeDefaults","ButtonDefaults","ButtonIconDefaults","CheckboxDefaults","CheckboxGroupDefaults","MenuDefaults","RadioDefaults","RadioGroupDefaults","SwitchDefaults","TableDefaults","TextDefaults","TextInputDefaults","DialogDefaults","createComponents","providedComponents","components","defaultComponents","providedComponent","typedComponentName","creator"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createComponentsWithDefaults.js","sources":["../../../src/contexts/ComponentAdapter/createComponentsWithDefaults.ts"],"sourcesContent":["import type React from 'react'\nimport type { ComponentsContextType } from './useComponentContext'\nimport { defaultComponents } from './adapters/defaultComponentAdapter'\nimport { applyMissingDefaults } from '@/helpers/applyMissingDefaults'\n// Import prop types and their defaults\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport { AlertDefaults } from '@/components/Common/UI/Alert/AlertTypes'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport { BadgeDefaults } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { ButtonProps, ButtonIconProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport { ButtonDefaults, ButtonIconDefaults } from '@/components/Common/UI/Button/ButtonTypes'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport { CheckboxDefaults } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport { CheckboxGroupDefaults } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport { MenuDefaults } from '@/components/Common/UI/Menu/MenuTypes'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport { RadioDefaults } from '@/components/Common/UI/Radio/RadioTypes'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport { RadioGroupDefaults } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport { SwitchDefaults } from '@/components/Common/UI/Switch/SwitchTypes'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport { TableDefaults } from '@/components/Common/UI/Table/TableTypes'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport { TextDefaults } from '@/components/Common/UI/Text/TextTypes'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport { TextInputDefaults } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport { DialogDefaults } from '@/components/Common/UI/Dialog/DialogTypes'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\nimport { LoadingSpinnerDefaults } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\n\nfunction composeWithDefaults<TProps>(defaults: Partial<TProps>, componentName: string) {\n return (customComponent: (props: TProps) => React.ReactElement | null) => {\n const wrappedComponent = (props: TProps) => {\n const propsWithDefaults = applyMissingDefaults(props, defaults)\n return customComponent(propsWithDefaults)\n }\n wrappedComponent.displayName = `withAutoDefault(${componentName})`\n return wrappedComponent\n }\n}\n\n// Component creators with defaults\nexport const componentCreators = {\n Alert: composeWithDefaults<AlertProps>(AlertDefaults, 'Alert'),\n Badge: composeWithDefaults<BadgeProps>(BadgeDefaults, 'Badge'),\n Button: composeWithDefaults<ButtonProps>(ButtonDefaults, 'Button'),\n ButtonIcon: composeWithDefaults<ButtonIconProps>(ButtonIconDefaults, 'ButtonIcon'),\n Checkbox: composeWithDefaults<CheckboxProps>(CheckboxDefaults, 'Checkbox'),\n CheckboxGroup: composeWithDefaults<CheckboxGroupProps>(CheckboxGroupDefaults, 'CheckboxGroup'),\n Menu: composeWithDefaults<MenuProps>(MenuDefaults, 'Menu'),\n Radio: composeWithDefaults<RadioProps>(RadioDefaults, 'Radio'),\n RadioGroup: composeWithDefaults<RadioGroupProps>(RadioGroupDefaults, 'RadioGroup'),\n Switch: composeWithDefaults<SwitchProps>(SwitchDefaults, 'Switch'),\n Table: composeWithDefaults<TableProps>(TableDefaults, 'Table'),\n Text: composeWithDefaults<TextProps>(TextDefaults, 'Text'),\n TextInput: composeWithDefaults<TextInputProps>(TextInputDefaults, 'TextInput'),\n Dialog: composeWithDefaults<DialogProps>(DialogDefaults, 'Dialog'),\n LoadingSpinner: composeWithDefaults<LoadingSpinnerProps>(\n LoadingSpinnerDefaults,\n 'LoadingSpinner',\n ),\n} as const\n\n/**\n * Creates components with automatic default prop handling.\n * Supports both partial (GustoProvider) and full (GustoProviderCustomUIAdapter) component sets.\n */\nexport function createComponents(\n providedComponents: Partial<ComponentsContextType> = {},\n): ComponentsContextType {\n const components = { ...defaultComponents }\n\n for (const [componentName, providedComponent] of Object.entries(providedComponents)) {\n const typedComponentName = componentName as keyof ComponentsContextType\n\n if (componentName in componentCreators) {\n const creatorKey = componentName as keyof typeof componentCreators\n const creator = componentCreators[creatorKey]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n components[typedComponentName] = creator(providedComponent as any) as any\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n components[typedComponentName] = providedComponent as any\n }\n }\n\n return components\n}\n"],"names":["composeWithDefaults","defaults","componentName","customComponent","wrappedComponent","props","propsWithDefaults","applyMissingDefaults","componentCreators","AlertDefaults","BadgeDefaults","ButtonDefaults","ButtonIconDefaults","CheckboxDefaults","CheckboxGroupDefaults","MenuDefaults","RadioDefaults","RadioGroupDefaults","SwitchDefaults","TableDefaults","TextDefaults","TextInputDefaults","DialogDefaults","LoadingSpinnerDefaults","createComponents","providedComponents","components","defaultComponents","providedComponent","typedComponentName","creator"],"mappings":";;;;;;;;;;;;;;;;AAkCA,SAASA,EAA4BC,GAA2BC,GAAuB;AACrF,SAAO,CAACC,MAAkE;AACxE,UAAMC,IAAmB,CAACC,MAAkB;AAC1C,YAAMC,IAAoBC,EAAqBF,GAAOJ,CAAQ;AAC9D,aAAOE,EAAgBG,CAAiB;AAAA,IAC1C;AACA,WAAAF,EAAiB,cAAc,mBAAmBF,CAAa,KACxDE;AAAA,EACT;AACF;AAGO,MAAMI,IAAoB;AAAA,EAC/B,OAAOR,EAAgCS,GAAe,OAAO;AAAA,EAC7D,OAAOT,EAAgCU,GAAe,OAAO;AAAA,EAC7D,QAAQV,EAAiCW,GAAgB,QAAQ;AAAA,EACjE,YAAYX,EAAqCY,GAAoB,YAAY;AAAA,EACjF,UAAUZ,EAAmCa,GAAkB,UAAU;AAAA,EACzE,eAAeb,EAAwCc,GAAuB,eAAe;AAAA,EAC7F,MAAMd,EAA+Be,GAAc,MAAM;AAAA,EACzD,OAAOf,EAAgCgB,GAAe,OAAO;AAAA,EAC7D,YAAYhB,EAAqCiB,GAAoB,YAAY;AAAA,EACjF,QAAQjB,EAAiCkB,GAAgB,QAAQ;AAAA,EACjE,OAAOlB,EAAgCmB,GAAe,OAAO;AAAA,EAC7D,MAAMnB,EAA+BoB,GAAc,MAAM;AAAA,EACzD,WAAWpB,EAAoCqB,GAAmB,WAAW;AAAA,EAC7E,QAAQrB,EAAiCsB,GAAgB,QAAQ;AAAA,EACjE,gBAAgBtB;AAAA,IACduB;AAAA,IACA;AAAA,EAAA;AAEJ;AAMO,SAASC,EACdC,IAAqD,IAC9B;AACvB,QAAMC,IAAa,EAAE,GAAGC,EAAA;AAExB,aAAW,CAACzB,GAAe0B,CAAiB,KAAK,OAAO,QAAQH,CAAkB,GAAG;AACnF,UAAMI,IAAqB3B;AAE3B,QAAIA,KAAiBM,GAAmB;AAEtC,YAAMsB,IAAUtB,EADGN,CACyB;AAE5C,MAAAwB,EAAWG,CAAkB,IAAIC,EAAQF,CAAwB;AAAA,IACnE;AAEE,MAAAF,EAAWG,CAAkB,IAAID;AAAA,EAErC;AAEA,SAAOF;AACT;"}
|
|
@@ -24,6 +24,7 @@ import { CalendarPreviewProps } from '../../components/Common/UI/CalendarPreview
|
|
|
24
24
|
import { ProgressBarProps } from '../../components/Common/UI/ProgressBar/ProgressBarTypes';
|
|
25
25
|
import { TabsProps } from '../../components/Common/UI/Tabs/TabsTypes';
|
|
26
26
|
import { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
|
|
27
|
+
import { LoadingSpinnerProps } from '../../components/Common/UI/LoadingSpinner/LoadingSpinnerTypes';
|
|
27
28
|
export interface ComponentsContextType {
|
|
28
29
|
Alert: (props: AlertProps) => JSX.Element | null;
|
|
29
30
|
Badge: (props: BadgeProps) => JSX.Element | null;
|
|
@@ -52,6 +53,7 @@ export interface ComponentsContextType {
|
|
|
52
53
|
ProgressBar: (props: ProgressBarProps) => JSX.Element | null;
|
|
53
54
|
Tabs: (props: TabsProps) => JSX.Element | null;
|
|
54
55
|
Dialog: (props: DialogProps) => JSX.Element | null;
|
|
56
|
+
LoadingSpinner: (props: LoadingSpinnerProps) => JSX.Element | null;
|
|
55
57
|
}
|
|
56
58
|
export declare const ComponentsContext: import('react').Context<ComponentsContextType | null>;
|
|
57
59
|
export declare const useComponentContext: () => ComponentsContextType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComponentContext.js","sources":["../../../src/contexts/ComponentAdapter/useComponentContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { JSX } from 'react'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport type { ButtonIconProps, ButtonProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List/ListTypes'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar/ProgressBarTypes'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\n\nexport interface ComponentsContextType {\n Alert: (props: AlertProps) => JSX.Element | null\n Badge: (props: BadgeProps) => JSX.Element | null\n Button: (props: ButtonProps) => JSX.Element | null\n ButtonIcon: (props: ButtonIconProps) => JSX.Element | null\n Card: (props: CardProps) => JSX.Element | null\n Checkbox: (props: CheckboxProps) => JSX.Element | null\n CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element | null\n ComboBox: (props: ComboBoxProps) => JSX.Element | null\n DatePicker: (props: DatePickerProps) => JSX.Element | null\n OrderedList: (props: OrderedListProps) => JSX.Element | null\n UnorderedList: (props: UnorderedListProps) => JSX.Element | null\n NumberInput: (props: NumberInputProps) => JSX.Element | null\n Radio: (props: RadioProps) => JSX.Element | null\n RadioGroup: (props: RadioGroupProps) => JSX.Element | null\n Select: (props: SelectProps) => JSX.Element | null\n Switch: (props: SwitchProps) => JSX.Element | null\n TextInput: (props: TextInputProps) => JSX.Element | null\n Link: (props: LinkProps) => JSX.Element | null\n Menu: (props: MenuProps) => JSX.Element | null\n Table: (props: TableProps) => JSX.Element | null\n Heading: (props: HeadingProps) => JSX.Element | null\n PaginationControl?: (props: PaginationControlProps) => JSX.Element | null\n Text: (props: TextProps) => JSX.Element | null\n CalendarPreview: (props: CalendarPreviewProps) => JSX.Element | null\n ProgressBar: (props: ProgressBarProps) => JSX.Element | null\n Tabs: (props: TabsProps) => JSX.Element | null\n Dialog: (props: DialogProps) => JSX.Element | null\n}\n\nexport const ComponentsContext = createContext<ComponentsContextType | null>(null)\n\nexport const useComponentContext = () => {\n const context = useContext(ComponentsContext)\n if (!context) {\n throw new Error('useComponentContext must be used within a ComponentsProvider')\n }\n return context\n}\n"],"names":["ComponentsContext","createContext","useComponentContext","context","useContext"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useComponentContext.js","sources":["../../../src/contexts/ComponentAdapter/useComponentContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { JSX } from 'react'\nimport type { TextInputProps } from '@/components/Common/UI/TextInput/TextInputTypes'\nimport type { NumberInputProps } from '@/components/Common/UI/NumberInput/NumberInputTypes'\nimport type { CheckboxGroupProps } from '@/components/Common/UI/CheckboxGroup/CheckboxGroupTypes'\nimport type { ComboBoxProps } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\nimport type { CheckboxProps } from '@/components/Common/UI/Checkbox/CheckboxTypes'\nimport type { DatePickerProps } from '@/components/Common/UI/DatePicker/DatePickerTypes'\nimport type { RadioProps } from '@/components/Common/UI/Radio/RadioTypes'\nimport type { RadioGroupProps } from '@/components/Common/UI/RadioGroup/RadioGroupTypes'\nimport type { SelectProps } from '@/components/Common/UI/Select/SelectTypes'\nimport type { SwitchProps } from '@/components/Common/UI/Switch/SwitchTypes'\nimport type { ButtonIconProps, ButtonProps } from '@/components/Common/UI/Button/ButtonTypes'\nimport type { AlertProps } from '@/components/Common/UI/Alert/AlertTypes'\nimport type { CardProps } from '@/components/Common/UI/Card/CardTypes'\nimport type { LinkProps } from '@/components/Common/UI/Link/LinkTypes'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport type { MenuProps } from '@/components/Common/UI/Menu/MenuTypes'\nimport type { TableProps } from '@/components/Common/UI/Table/TableTypes'\nimport type { OrderedListProps, UnorderedListProps } from '@/components/Common/UI/List/ListTypes'\nimport type { HeadingProps } from '@/components/Common/UI/Heading/HeadingTypes'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport type { TextProps } from '@/components/Common/UI/Text/TextTypes'\nimport type { CalendarPreviewProps } from '@/components/Common/UI/CalendarPreview/CalendarPreviewTypes'\nimport type { ProgressBarProps } from '@/components/Common/UI/ProgressBar/ProgressBarTypes'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\n\nexport interface ComponentsContextType {\n Alert: (props: AlertProps) => JSX.Element | null\n Badge: (props: BadgeProps) => JSX.Element | null\n Button: (props: ButtonProps) => JSX.Element | null\n ButtonIcon: (props: ButtonIconProps) => JSX.Element | null\n Card: (props: CardProps) => JSX.Element | null\n Checkbox: (props: CheckboxProps) => JSX.Element | null\n CheckboxGroup: (props: CheckboxGroupProps) => JSX.Element | null\n ComboBox: (props: ComboBoxProps) => JSX.Element | null\n DatePicker: (props: DatePickerProps) => JSX.Element | null\n OrderedList: (props: OrderedListProps) => JSX.Element | null\n UnorderedList: (props: UnorderedListProps) => JSX.Element | null\n NumberInput: (props: NumberInputProps) => JSX.Element | null\n Radio: (props: RadioProps) => JSX.Element | null\n RadioGroup: (props: RadioGroupProps) => JSX.Element | null\n Select: (props: SelectProps) => JSX.Element | null\n Switch: (props: SwitchProps) => JSX.Element | null\n TextInput: (props: TextInputProps) => JSX.Element | null\n Link: (props: LinkProps) => JSX.Element | null\n Menu: (props: MenuProps) => JSX.Element | null\n Table: (props: TableProps) => JSX.Element | null\n Heading: (props: HeadingProps) => JSX.Element | null\n PaginationControl?: (props: PaginationControlProps) => JSX.Element | null\n Text: (props: TextProps) => JSX.Element | null\n CalendarPreview: (props: CalendarPreviewProps) => JSX.Element | null\n ProgressBar: (props: ProgressBarProps) => JSX.Element | null\n Tabs: (props: TabsProps) => JSX.Element | null\n Dialog: (props: DialogProps) => JSX.Element | null\n LoadingSpinner: (props: LoadingSpinnerProps) => JSX.Element | null\n}\n\nexport const ComponentsContext = createContext<ComponentsContextType | null>(null)\n\nexport const useComponentContext = () => {\n const context = useContext(ComponentsContext)\n if (!context) {\n throw new Error('useComponentContext must be used within a ComponentsProvider')\n }\n return context\n}\n"],"names":["ComponentsContext","createContext","useComponentContext","context","useContext"],"mappings":";AA4DO,MAAMA,IAAoBC,EAA4C,IAAI,GAEpEC,IAAsB,MAAM;AACvC,QAAMC,IAAUC,EAAWJ,CAAiB;AAC5C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,8DAA8D;AAEhF,SAAOA;AACT;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
export interface LoadingIndicatorContextProps {
|
|
3
|
-
LoadingIndicator: (
|
|
3
|
+
LoadingIndicator: ({ children }: {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}) => JSX.Element;
|
|
4
6
|
}
|
|
5
7
|
export declare const LoadingIndicatorContext: import('react').Context<LoadingIndicatorContextProps>;
|
|
6
8
|
export declare const useLoadingIndicator: () => LoadingIndicatorContextProps;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { Loading as
|
|
4
|
-
const
|
|
5
|
-
LoadingIndicator: () => /* @__PURE__ */
|
|
6
|
-
}),
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as n, createContext as r } from "react";
|
|
3
|
+
import { Loading as i } from "../../components/Common/Loading/Loading.js";
|
|
4
|
+
const a = r({
|
|
5
|
+
LoadingIndicator: ({ children: o }) => /* @__PURE__ */ t(i, { children: o })
|
|
6
|
+
}), m = () => n(a);
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
a as LoadingIndicatorContext,
|
|
9
|
+
m as useLoadingIndicator
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=useLoadingIndicator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLoadingIndicator.js","sources":["../../../src/contexts/LoadingIndicatorProvider/useLoadingIndicator.tsx"],"sourcesContent":["import type { JSX } from 'react'\nimport { createContext, useContext } from 'react'\nimport { Loading } from '@/components/Common/Loading/Loading'\n\nexport interface LoadingIndicatorContextProps {\n LoadingIndicator: () => JSX.Element\n}\nexport const LoadingIndicatorContext = createContext<LoadingIndicatorContextProps>({\n LoadingIndicator: () => <Loading
|
|
1
|
+
{"version":3,"file":"useLoadingIndicator.js","sources":["../../../src/contexts/LoadingIndicatorProvider/useLoadingIndicator.tsx"],"sourcesContent":["import type { JSX } from 'react'\nimport { createContext, useContext } from 'react'\nimport { Loading } from '@/components/Common/Loading/Loading'\n\nexport interface LoadingIndicatorContextProps {\n LoadingIndicator: ({ children }: { children?: React.ReactNode }) => JSX.Element\n}\nexport const LoadingIndicatorContext = createContext<LoadingIndicatorContextProps>({\n LoadingIndicator: ({ children }: { children?: React.ReactNode }) => <Loading>{children}</Loading>,\n})\n\nexport const useLoadingIndicator = () => useContext(LoadingIndicatorContext)\n"],"names":["LoadingIndicatorContext","createContext","children","jsx","Loading","useLoadingIndicator","useContext"],"mappings":";;;AAOO,MAAMA,IAA0BC,EAA4C;AAAA,EACjF,kBAAkB,CAAC,EAAE,UAAAC,QAA+C,gBAAAC,EAACC,KAAS,UAAAF,EAAA,CAAS;AACzF,CAAC,GAEYG,IAAsB,MAAMC,EAAWN,CAAuB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContainerBreakpoints.js","sources":["../../../src/hooks/useContainerBreakpoints/useContainerBreakpoints.ts"],"sourcesContent":["import { useState, useEffect, useRef } from 'react'\nimport type React from 'react'\nimport type { BREAKPOINTS } from '@/shared/constants'\nimport { BREAKPOINTS_VALUES } from '@/shared/constants'\nimport { remToPx } from '@/helpers/rem'\n\nexport type BreakpointKey = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS]\n\nexport type useContainerBreakpointsProps = {\n ref: React.RefObject<HTMLElement | null>\n breakpoints?: Record<string, number | string>\n debounceTimeout?: number\n}\n\nconst DEBOUNCE_TIMEOUT = 10\n\nexport const useContainerBreakpoints = ({\n ref,\n breakpoints = BREAKPOINTS_VALUES,\n debounceTimeout = DEBOUNCE_TIMEOUT,\n}: useContainerBreakpointsProps) => {\n const [activeBreakpoints, setActiveBreakpoint] = useState<Array<keyof typeof breakpoints>>([])\n const timeoutRef = useRef<NodeJS.Timeout | null>(null)\n\n const calculateBreakpoints = (width: number) => {\n const returnBreakpoints: Array<keyof typeof breakpoints> = []\n\n for (const [key, value] of Object.entries(breakpoints)) {\n if (width >= remToPx(value)) {\n returnBreakpoints.push(key)\n }\n }\n\n return returnBreakpoints\n }\n\n useEffect(() => {\n const debouncedHandleResize = (entries: ResizeObserverEntry[]) => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current)\n }\n timeoutRef.current = setTimeout(() => {\n if (entries.length >= 1) {\n const width = entries[0]?.contentRect.width ?? 0\n const newBreakpoints = calculateBreakpoints(width)\n setActiveBreakpoint(newBreakpoints)\n }\n }, debounceTimeout)\n }\n\n const observer = new ResizeObserver(debouncedHandleResize)\n\n if (ref.current) {\n // Do initial calculation\n const width = ref.current.offsetWidth\n if (width > 0) {\n const initialBreakpoints = calculateBreakpoints(width)\n setActiveBreakpoint(initialBreakpoints)\n }\n\n observer.observe(ref.current)\n }\n\n return () => {\n observer.disconnect()\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current)\n }\n }\n
|
|
1
|
+
{"version":3,"file":"useContainerBreakpoints.js","sources":["../../../src/hooks/useContainerBreakpoints/useContainerBreakpoints.ts"],"sourcesContent":["import { useState, useEffect, useRef } from 'react'\nimport type React from 'react'\nimport type { BREAKPOINTS } from '@/shared/constants'\nimport { BREAKPOINTS_VALUES } from '@/shared/constants'\nimport { remToPx } from '@/helpers/rem'\n\nexport type BreakpointKey = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS]\n\nexport type useContainerBreakpointsProps = {\n ref: React.RefObject<HTMLElement | null>\n breakpoints?: Record<string, number | string>\n debounceTimeout?: number\n}\n\nconst DEBOUNCE_TIMEOUT = 10\n\nexport const useContainerBreakpoints = ({\n ref,\n breakpoints = BREAKPOINTS_VALUES,\n debounceTimeout = DEBOUNCE_TIMEOUT,\n}: useContainerBreakpointsProps) => {\n const [activeBreakpoints, setActiveBreakpoint] = useState<Array<keyof typeof breakpoints>>([])\n const timeoutRef = useRef<NodeJS.Timeout | null>(null)\n\n const calculateBreakpoints = (width: number) => {\n const returnBreakpoints: Array<keyof typeof breakpoints> = []\n\n for (const [key, value] of Object.entries(breakpoints)) {\n if (width >= remToPx(value)) {\n returnBreakpoints.push(key)\n }\n }\n\n return returnBreakpoints\n }\n\n useEffect(() => {\n const debouncedHandleResize = (entries: ResizeObserverEntry[]) => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current)\n }\n timeoutRef.current = setTimeout(() => {\n if (entries.length >= 1) {\n const width = entries[0]?.contentRect.width ?? 0\n const newBreakpoints = calculateBreakpoints(width)\n setActiveBreakpoint(newBreakpoints)\n }\n }, debounceTimeout)\n }\n\n const observer = new ResizeObserver(debouncedHandleResize)\n\n if (ref.current) {\n // Do initial calculation\n const width = ref.current.offsetWidth\n if (width > 0) {\n const initialBreakpoints = calculateBreakpoints(width)\n setActiveBreakpoint(initialBreakpoints)\n }\n\n observer.observe(ref.current)\n }\n\n return () => {\n observer.disconnect()\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current)\n }\n }\n }, [debounceTimeout])\n\n return activeBreakpoints\n}\n\nexport default useContainerBreakpoints\n"],"names":["DEBOUNCE_TIMEOUT","useContainerBreakpoints","ref","breakpoints","BREAKPOINTS_VALUES","debounceTimeout","activeBreakpoints","setActiveBreakpoint","useState","timeoutRef","useRef","calculateBreakpoints","width","returnBreakpoints","key","value","remToPx","useEffect","debouncedHandleResize","entries","newBreakpoints","observer","initialBreakpoints"],"mappings":";;;AAcA,MAAMA,IAAmB,IAEZC,IAA0B,CAAC;AAAA,EACtC,KAAAC;AAAA,EACA,aAAAC,IAAcC;AAAA,EACd,iBAAAC,IAAkBL;AACpB,MAAoC;AAClC,QAAM,CAACM,GAAmBC,CAAmB,IAAIC,EAA0C,CAAA,CAAE,GACvFC,IAAaC,EAA8B,IAAI,GAE/CC,IAAuB,CAACC,MAAkB;AAC9C,UAAMC,IAAqD,CAAA;AAE3D,eAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQZ,CAAW;AACnD,MAAIS,KAASI,EAAQD,CAAK,KACxBF,EAAkB,KAAKC,CAAG;AAI9B,WAAOD;AAAA,EACT;AAEA,SAAAI,EAAU,MAAM;AACd,UAAMC,IAAwB,CAACC,MAAmC;AAChE,MAAIV,EAAW,WACb,aAAaA,EAAW,OAAO,GAEjCA,EAAW,UAAU,WAAW,MAAM;AACpC,YAAIU,EAAQ,UAAU,GAAG;AACvB,gBAAMP,IAAQO,EAAQ,CAAC,GAAG,YAAY,SAAS,GACzCC,IAAiBT,EAAqBC,CAAK;AACjD,UAAAL,EAAoBa,CAAc;AAAA,QACpC;AAAA,MACF,GAAGf,CAAe;AAAA,IACpB,GAEMgB,IAAW,IAAI,eAAeH,CAAqB;AAEzD,QAAIhB,EAAI,SAAS;AAEf,YAAMU,IAAQV,EAAI,QAAQ;AAC1B,UAAIU,IAAQ,GAAG;AACb,cAAMU,IAAqBX,EAAqBC,CAAK;AACrD,QAAAL,EAAoBe,CAAkB;AAAA,MACxC;AAEA,MAAAD,EAAS,QAAQnB,EAAI,OAAO;AAAA,IAC9B;AAEA,WAAO,MAAM;AACX,MAAAmB,EAAS,WAAA,GACLZ,EAAW,WACb,aAAaA,EAAW,OAAO;AAAA,IAEnC;AAAA,EACF,GAAG,CAACJ,CAAe,CAAC,GAEbC;AACT;"}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
const e = "
|
|
1
|
+
const e = "Edit Payroll", a = "Regular payroll for <dateWrapper>{{startDate}} - {{endDate}}</dateWrapper>", o = "Calculate payroll", l = "Calculate payroll", t = "Hours and additional earnings", s = "Review and update your employee's hours, reimbursements, and additional earnings below.", n = "Employee compensations", i = { employees: "Employees", hours: "Hours", timeOff: "Time off", additionalEarnings: "Additional earnings", reimbursements: "Reimbursements", totalPay: "Total pay" }, r = "Skipped", d = { edit: "Edit" }, p = { progressSaved: "Your progress has been saved", payrollDeadline: { label: "Payroll Deadline", message: "To pay your employees with direct deposit on the check date, you'll need to run payroll by the deadline." }, skippedEmployees: { label: "Skipped Employees", employeeAddressNotVerified: "Employee address not verified" }, employeeUpdated: { label: "{{employeeName}} updated successfully" } }, y = "Preparing payroll...", c = "This may take a minute or two. You can navigate away while this happens.", u = {
|
|
2
2
|
pageTitle: e,
|
|
3
|
-
|
|
4
|
-
calculatePayroll:
|
|
3
|
+
description: a,
|
|
4
|
+
calculatePayroll: o,
|
|
5
5
|
calculatePayrollTitle: l,
|
|
6
|
-
hoursAndEarningsTitle:
|
|
7
|
-
hoursAndEarningsDescription:
|
|
6
|
+
hoursAndEarningsTitle: t,
|
|
7
|
+
hoursAndEarningsDescription: s,
|
|
8
8
|
employeeCompensationsTitle: n,
|
|
9
|
-
tableColumns:
|
|
10
|
-
skippedBadge:
|
|
9
|
+
tableColumns: i,
|
|
10
|
+
skippedBadge: r,
|
|
11
11
|
editMenu: d,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
alerts: p,
|
|
13
|
+
loadingTitle: y,
|
|
14
|
+
loadingDescription: c
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
y as backButtonTitle,
|
|
20
|
-
a as calculatePayroll,
|
|
17
|
+
p as alerts,
|
|
18
|
+
o as calculatePayroll,
|
|
21
19
|
l as calculatePayrollTitle,
|
|
22
20
|
u as default,
|
|
21
|
+
a as description,
|
|
23
22
|
d as editMenu,
|
|
24
23
|
n as employeeCompensationsTitle,
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
s as hoursAndEarningsDescription,
|
|
25
|
+
t as hoursAndEarningsTitle,
|
|
26
|
+
c as loadingDescription,
|
|
27
|
+
y as loadingTitle,
|
|
27
28
|
e as pageTitle,
|
|
28
|
-
|
|
29
|
-
i as
|
|
30
|
-
r as tableColumns
|
|
29
|
+
r as skippedBadge,
|
|
30
|
+
i as tableColumns
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=Payroll.PayrollConfiguration.json.js.map
|