@gusto/embedded-react-sdk 0.23.0 → 0.24.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 +26 -0
- package/dist/components/Common/PayrollLoading/PayrollLoading.d.ts +2 -0
- package/dist/components/Common/PayrollLoading/PayrollLoading.js +19 -0
- package/dist/components/Common/PayrollLoading/PayrollLoading.js.map +1 -0
- package/dist/components/Common/PayrollLoading/PayrollLoadingTypes.d.ts +5 -0
- package/dist/components/Common/PayrollLoading/index.d.ts +3 -0
- package/dist/components/Common/index.d.ts +1 -0
- 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 +8 -9
- 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/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/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
- package/dist/components/Contractor/Profile/useContractorProfile.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.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- 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.js +2 -0
- package/dist/components/Employee/FederalTaxes/FederalForm.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/usePaymentMethod.js +5 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- 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.js +6 -4
- package/dist/components/Employee/Taxes/FederalForm.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/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +4 -4
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +26 -21
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +8 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +2 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +56 -54
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +90 -91
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +2 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +33 -31
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +88 -87
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +24 -18
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +5 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +77 -51
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +4 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +29 -21
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +5 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +36 -26
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +4 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -60
- 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 +239 -234
- 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 +25 -15
- 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 +152 -137
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +1 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +5 -6
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.d.ts +3 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +26 -18
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProvider.d.ts +2 -0
- package/dist/contexts/GustoProvider/GustoProvider.js +12 -11
- package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +24 -14
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiProvider.js","sources":["../../../src/contexts/ApiProvider/ApiProvider.tsx"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { GustoEmbeddedProvider } from '@gusto/embedded-api/react-query/_context'\nimport { GustoEmbeddedCore } from '@gusto/embedded-api/core'\nimport { SDKHooks as NativeSDKHooks } from '@gusto/embedded-api/hooks/hooks'\nimport { useMemo } from 'react'\nimport type { SDKHooks, BeforeRequestHook } from '@/types/hooks'\n\nexport interface ApiProviderProps {\n url: string\n headers?: HeadersInit\n hooks?: SDKHooks\n children: React.ReactNode\n}\n\nexport function ApiProvider({
|
|
1
|
+
{"version":3,"file":"ApiProvider.js","sources":["../../../src/contexts/ApiProvider/ApiProvider.tsx"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { GustoEmbeddedProvider } from '@gusto/embedded-api/react-query/_context'\nimport { GustoEmbeddedCore } from '@gusto/embedded-api/core'\nimport { SDKHooks as NativeSDKHooks } from '@gusto/embedded-api/hooks/hooks'\nimport { useMemo } from 'react'\nimport type { SDKHooks, BeforeRequestHook } from '@/types/hooks'\n\nexport interface ApiProviderProps {\n url: string\n headers?: HeadersInit\n hooks?: SDKHooks\n children: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport function ApiProvider({\n url,\n headers,\n hooks,\n children,\n queryClient: queryClientFromProps,\n}: ApiProviderProps) {\n const gustoClient = useMemo(() => {\n const client = new GustoEmbeddedCore({\n serverURL: url,\n })\n\n const sdkHooks = client._options.hooks || new NativeSDKHooks()\n\n if (headers) {\n const defaultHeaderHook: BeforeRequestHook = {\n beforeRequest: (context, request) => {\n const headersInstance = new Headers(headers)\n headersInstance.forEach((headerValue, headerName) => {\n if (headerValue) {\n request.headers.set(headerName, headerValue)\n }\n })\n return request\n },\n }\n sdkHooks.registerBeforeRequestHook(defaultHeaderHook)\n }\n\n if (hooks?.beforeCreateRequest) {\n hooks.beforeCreateRequest.forEach(hook => {\n sdkHooks.registerBeforeCreateRequestHook(hook)\n })\n }\n\n if (hooks?.beforeRequest) {\n hooks.beforeRequest.forEach(hook => {\n sdkHooks.registerBeforeRequestHook(hook)\n })\n }\n\n if (hooks?.afterSuccess) {\n hooks.afterSuccess.forEach(hook => {\n sdkHooks.registerAfterSuccessHook(hook)\n })\n }\n\n if (hooks?.afterError) {\n hooks.afterError.forEach(hook => {\n sdkHooks.registerAfterErrorHook(hook)\n })\n }\n\n if (!client._options.hooks) {\n client._options.hooks = sdkHooks\n }\n\n return client\n }, [url, headers, hooks])\n\n const queryClient = useMemo(() => {\n if (queryClientFromProps) {\n return queryClientFromProps\n }\n\n // Create and configure a new QueryClient for internal SDK use\n const client = new QueryClient()\n\n const onSettled = async () => {\n await client.invalidateQueries()\n }\n client.setQueryDefaults(['@gusto/embedded-api'], { retry: false })\n client.setMutationDefaults(['@gusto/embedded-api'], { onSettled, retry: false })\n\n return client\n }, [queryClientFromProps])\n\n return (\n <QueryClientProvider client={queryClient}>\n <GustoEmbeddedProvider client={gustoClient}>{children}</GustoEmbeddedProvider>\n </QueryClientProvider>\n )\n}\n"],"names":["ApiProvider","url","headers","hooks","children","queryClientFromProps","gustoClient","useMemo","client","GustoEmbeddedCore","sdkHooks","NativeSDKHooks","defaultHeaderHook","context","request","headerValue","headerName","hook","queryClient","QueryClient","onSettled","jsx","QueryClientProvider","GustoEmbeddedProvider"],"mappings":";;;;;;AAeO,SAASA,EAAY;AAAA,EAC1B,KAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAaC;AACf,GAAqB;AACnB,QAAMC,IAAcC,EAAQ,MAAM;AAChC,UAAMC,IAAS,IAAIC,EAAkB;AAAA,MACnC,WAAWR;AAAA,IAAA,CACZ,GAEKS,IAAWF,EAAO,SAAS,SAAS,IAAIG,EAAA;AAE9C,QAAIT,GAAS;AACX,YAAMU,IAAuC;AAAA,QAC3C,eAAe,CAACC,GAASC,OACC,IAAI,QAAQZ,CAAO,EAC3B,QAAQ,CAACa,GAAaC,MAAe;AACnD,UAAID,KACFD,EAAQ,QAAQ,IAAIE,GAAYD,CAAW;AAAA,QAE/C,CAAC,GACMD;AAAA,MACT;AAEF,MAAAJ,EAAS,0BAA0BE,CAAiB;AAAA,IACtD;AAEA,WAAIT,GAAO,uBACTA,EAAM,oBAAoB,QAAQ,CAAAc,MAAQ;AACxC,MAAAP,EAAS,gCAAgCO,CAAI;AAAA,IAC/C,CAAC,GAGCd,GAAO,iBACTA,EAAM,cAAc,QAAQ,CAAAc,MAAQ;AAClC,MAAAP,EAAS,0BAA0BO,CAAI;AAAA,IACzC,CAAC,GAGCd,GAAO,gBACTA,EAAM,aAAa,QAAQ,CAAAc,MAAQ;AACjC,MAAAP,EAAS,yBAAyBO,CAAI;AAAA,IACxC,CAAC,GAGCd,GAAO,cACTA,EAAM,WAAW,QAAQ,CAAAc,MAAQ;AAC/B,MAAAP,EAAS,uBAAuBO,CAAI;AAAA,IACtC,CAAC,GAGET,EAAO,SAAS,UACnBA,EAAO,SAAS,QAAQE,IAGnBF;AAAA,EACT,GAAG,CAACP,GAAKC,GAASC,CAAK,CAAC,GAElBe,IAAcX,EAAQ,MAAM;AAChC,QAAIF;AACF,aAAOA;AAIT,UAAMG,IAAS,IAAIW,EAAA,GAEbC,IAAY,YAAY;AAC5B,YAAMZ,EAAO,kBAAA;AAAA,IACf;AACA,WAAAA,EAAO,iBAAiB,CAAC,qBAAqB,GAAG,EAAE,OAAO,IAAO,GACjEA,EAAO,oBAAoB,CAAC,qBAAqB,GAAG,EAAE,WAAAY,GAAW,OAAO,IAAO,GAExEZ;AAAA,EACT,GAAG,CAACH,CAAoB,CAAC;AAEzB,SACE,gBAAAgB,EAACC,KAAoB,QAAQJ,GAC3B,4BAACK,GAAA,EAAsB,QAAQjB,GAAc,UAAAF,EAAA,CAAS,EAAA,CACxD;AAEJ;"}
|
|
@@ -21,6 +21,7 @@ export type { BannerProps } from '../../components/Common/UI/Banner/BannerTypes'
|
|
|
21
21
|
export type { OrderedListProps, UnorderedListProps } from '../../components/Common/UI/List/ListTypes';
|
|
22
22
|
export type { HeadingProps } from '../../components/Common/UI/Heading/HeadingTypes';
|
|
23
23
|
export type { PaginationControlProps, PaginationItemsPerPage, } from '../../components/Common/PaginationControl/PaginationControlTypes';
|
|
24
|
+
export type { PayrollLoadingProps } from '../../components/Common/PayrollLoading/PayrollLoadingTypes';
|
|
24
25
|
export type { TextProps } from '../../components/Common/UI/Text/TextTypes';
|
|
25
26
|
export type { CalendarPreviewProps } from '../../components/Common/UI/CalendarPreview/CalendarPreviewTypes';
|
|
26
27
|
export type { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
|
|
@@ -30,6 +30,7 @@ import { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
|
|
|
30
30
|
import { ModalProps } from '../../components/Common/UI/Modal/ModalTypes';
|
|
31
31
|
import { LoadingSpinnerProps } from '../../components/Common/UI/LoadingSpinner/LoadingSpinnerTypes';
|
|
32
32
|
import { DescriptionListProps } from '../../components/Common/UI/DescriptionList/DescriptionListTypes';
|
|
33
|
+
import { PayrollLoadingProps } from '../../components/Common/PayrollLoading/PayrollLoadingTypes';
|
|
33
34
|
export interface ComponentsContextType {
|
|
34
35
|
Alert: (props: AlertProps) => JSX.Element | null;
|
|
35
36
|
Badge: (props: BadgeProps) => JSX.Element | null;
|
|
@@ -55,6 +56,7 @@ export interface ComponentsContextType {
|
|
|
55
56
|
Table: (props: TableProps) => JSX.Element | null;
|
|
56
57
|
Heading: (props: HeadingProps) => JSX.Element | null;
|
|
57
58
|
PaginationControl?: (props: PaginationControlProps) => JSX.Element | null;
|
|
59
|
+
PayrollLoading?: (props: PayrollLoadingProps) => JSX.Element | null;
|
|
58
60
|
Text: (props: TextProps) => JSX.Element | null;
|
|
59
61
|
CalendarPreview: (props: CalendarPreviewProps) => JSX.Element | null;
|
|
60
62
|
ProgressBar: (props: ProgressBarProps) => JSX.Element | null;
|
|
@@ -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 { TextAreaProps } from '@/components/Common/UI/TextArea/TextAreaTypes'\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 { BannerProps } from '@/components/Common/UI/Banner/BannerTypes'\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 { BreadcrumbsProps } from '@/components/Common/UI/Breadcrumbs/BreadcrumbsTypes'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport type { ModalProps } from '@/components/Common/UI/Modal/ModalTypes'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\nimport type { DescriptionListProps } from '@/components/Common/UI/DescriptionList/DescriptionListTypes'\n\nexport interface ComponentsContextType {\n Alert: (props: AlertProps) => JSX.Element | null\n Badge: (props: BadgeProps) => JSX.Element | null\n Banner: (props: BannerProps) => 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 TextArea: (props: TextAreaProps) => 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 Breadcrumbs: (props: BreadcrumbsProps) => JSX.Element | null\n Tabs: (props: TabsProps) => JSX.Element | null\n Dialog: (props: DialogProps) => JSX.Element | null\n Modal: (props: ModalProps) => JSX.Element | null\n LoadingSpinner: (props: LoadingSpinnerProps) => JSX.Element | null\n DescriptionList: (props: DescriptionListProps) => 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 { TextAreaProps } from '@/components/Common/UI/TextArea/TextAreaTypes'\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 { BannerProps } from '@/components/Common/UI/Banner/BannerTypes'\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 { BreadcrumbsProps } from '@/components/Common/UI/Breadcrumbs/BreadcrumbsTypes'\nimport type { TabsProps } from '@/components/Common/UI/Tabs/TabsTypes'\nimport type { DialogProps } from '@/components/Common/UI/Dialog/DialogTypes'\nimport type { ModalProps } from '@/components/Common/UI/Modal/ModalTypes'\nimport type { LoadingSpinnerProps } from '@/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes'\nimport type { DescriptionListProps } from '@/components/Common/UI/DescriptionList/DescriptionListTypes'\nimport type { PayrollLoadingProps } from '@/components/Common/PayrollLoading/PayrollLoadingTypes'\n\nexport interface ComponentsContextType {\n Alert: (props: AlertProps) => JSX.Element | null\n Badge: (props: BadgeProps) => JSX.Element | null\n Banner: (props: BannerProps) => 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 TextArea: (props: TextAreaProps) => 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 PayrollLoading?: (props: PayrollLoadingProps) => 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 Breadcrumbs: (props: BreadcrumbsProps) => JSX.Element | null\n Tabs: (props: TabsProps) => JSX.Element | null\n Dialog: (props: DialogProps) => JSX.Element | null\n Modal: (props: ModalProps) => JSX.Element | null\n LoadingSpinner: (props: LoadingSpinnerProps) => JSX.Element | null\n DescriptionList: (props: DescriptionListProps) => 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":";AAwEO,MAAMA,IAAoBC,EAA4C,IAAI,GAEpEC,IAAsB,MAAM;AACvC,QAAMC,IAAUC,EAAWJ,CAAiB;AAC5C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,8DAA8D;AAEhF,SAAOA;AACT;"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
3
|
import { ComponentsContextType } from '../ComponentAdapter/useComponentContext';
|
|
3
4
|
import { GustoProviderProps } from './GustoProviderCustomUIAdapter';
|
|
4
5
|
export interface GustoApiProps extends Omit<GustoProviderProps, 'components'> {
|
|
6
|
+
queryClient?: QueryClient;
|
|
5
7
|
components?: Partial<ComponentsContextType>;
|
|
6
8
|
children?: React.ReactNode;
|
|
7
9
|
}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { I18nProvider as
|
|
3
|
-
import { createComponents as
|
|
4
|
-
import { GustoProviderCustomUIAdapter as
|
|
5
|
-
const
|
|
6
|
-
const { children: e, components: n = {}, locale: o,
|
|
2
|
+
import { I18nProvider as s } from "react-aria-components";
|
|
3
|
+
import { createComponents as p } from "../ComponentAdapter/createComponentsWithDefaults.js";
|
|
4
|
+
import { GustoProviderCustomUIAdapter as c } from "./GustoProviderCustomUIAdapter.js";
|
|
5
|
+
const d = (t) => {
|
|
6
|
+
const { children: e, components: n = {}, locale: o, queryClient: i, ...m } = t;
|
|
7
7
|
return /* @__PURE__ */ r(
|
|
8
|
-
|
|
8
|
+
c,
|
|
9
9
|
{
|
|
10
10
|
locale: o,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
queryClient: i,
|
|
12
|
+
...m,
|
|
13
|
+
components: p(n),
|
|
14
|
+
children: /* @__PURE__ */ r(s, { locale: o, children: e })
|
|
14
15
|
}
|
|
15
16
|
);
|
|
16
|
-
}, f =
|
|
17
|
+
}, f = d;
|
|
17
18
|
export {
|
|
18
19
|
f as GustoApiProvider,
|
|
19
|
-
|
|
20
|
+
d as GustoProvider
|
|
20
21
|
};
|
|
21
22
|
//# sourceMappingURL=GustoProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GustoProvider.js","sources":["../../../src/contexts/GustoProvider/GustoProvider.tsx"],"sourcesContent":["import type React from 'react'\n// GustoProvider uses react-aria as the default components so we need to include the react-aria I18nProvider here.\n// For use without react-aria, the GustoProviderCustomUIAdapter can be used which does not includes it.\n// eslint-disable-next-line no-restricted-imports\nimport { I18nProvider } from 'react-aria-components'\nimport { createComponents } from '../ComponentAdapter/createComponentsWithDefaults'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport {\n GustoProviderCustomUIAdapter,\n type GustoProviderProps,\n} from './GustoProviderCustomUIAdapter'\n\nexport interface GustoApiProps extends Omit<GustoProviderProps, 'components'> {\n components?: Partial<ComponentsContextType>\n children?: React.ReactNode\n}\n\nconst GustoProvider: React.FC<GustoApiProps> = props => {\n const { children, components = {}, locale, ...remainingProps } = props\n\n return (\n <GustoProviderCustomUIAdapter\n locale={locale}\n {...remainingProps}\n components={createComponents(components)}\n >\n {/* react-aria locale provider that exposes correct locale to number formatters */}\n <I18nProvider locale={locale}>{children}</I18nProvider>\n </GustoProviderCustomUIAdapter>\n )\n}\n\nexport { GustoProvider }\n\n/** @deprecated Import from `GustoProvider` instead */\nexport const GustoApiProvider = GustoProvider\n"],"names":["GustoProvider","props","children","components","locale","remainingProps","jsx","GustoProviderCustomUIAdapter","createComponents","I18nProvider","GustoApiProvider"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"GustoProvider.js","sources":["../../../src/contexts/GustoProvider/GustoProvider.tsx"],"sourcesContent":["import type React from 'react'\n// GustoProvider uses react-aria as the default components so we need to include the react-aria I18nProvider here.\n// For use without react-aria, the GustoProviderCustomUIAdapter can be used which does not includes it.\n// eslint-disable-next-line no-restricted-imports\nimport { I18nProvider } from 'react-aria-components'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { createComponents } from '../ComponentAdapter/createComponentsWithDefaults'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport {\n GustoProviderCustomUIAdapter,\n type GustoProviderProps,\n} from './GustoProviderCustomUIAdapter'\n\nexport interface GustoApiProps extends Omit<GustoProviderProps, 'components'> {\n queryClient?: QueryClient\n components?: Partial<ComponentsContextType>\n children?: React.ReactNode\n}\n\nconst GustoProvider: React.FC<GustoApiProps> = props => {\n const { children, components = {}, locale, queryClient, ...remainingProps } = props\n\n return (\n <GustoProviderCustomUIAdapter\n locale={locale}\n queryClient={queryClient}\n {...remainingProps}\n components={createComponents(components)}\n >\n {/* react-aria locale provider that exposes correct locale to number formatters */}\n <I18nProvider locale={locale}>{children}</I18nProvider>\n </GustoProviderCustomUIAdapter>\n )\n}\n\nexport { GustoProvider }\n\n/** @deprecated Import from `GustoProvider` instead */\nexport const GustoApiProvider = GustoProvider\n"],"names":["GustoProvider","props","children","components","locale","queryClient","remainingProps","jsx","GustoProviderCustomUIAdapter","createComponents","I18nProvider","GustoApiProvider"],"mappings":";;;;AAmBA,MAAMA,IAAyC,CAAAC,MAAS;AACtD,QAAM,EAAE,UAAAC,GAAU,YAAAC,IAAa,CAAA,GAAI,QAAAC,GAAQ,aAAAC,GAAa,GAAGC,EAAA,IAAmBL;AAE9E,SACE,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,QAAAJ;AAAA,MACA,aAAAC;AAAA,MACC,GAAGC;AAAA,MACJ,YAAYG,EAAiBN,CAAU;AAAA,MAGvC,UAAA,gBAAAI,EAACG,GAAA,EAAa,QAAAN,GAAiB,UAAAF,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAG9C,GAKaS,IAAmBX;"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { ErrorBoundary as
|
|
3
|
-
import { I18nextProvider as
|
|
4
|
-
import { useEffect as
|
|
5
|
-
import { ComponentsProvider as
|
|
6
|
-
import { ApiProvider as
|
|
7
|
-
import { LoadingIndicatorProvider as
|
|
2
|
+
import { ErrorBoundary as v } from "react-error-boundary";
|
|
3
|
+
import { I18nextProvider as g } from "react-i18next";
|
|
4
|
+
import { useEffect as P } from "react";
|
|
5
|
+
import { ComponentsProvider as y } from "../ComponentAdapter/ComponentsProvider.js";
|
|
6
|
+
import { ApiProvider as C } from "../ApiProvider/ApiProvider.js";
|
|
7
|
+
import { LoadingIndicatorProvider as I } from "../LoadingIndicatorProvider/LoadingIndicatorProvider.js";
|
|
8
8
|
import { SDKI18next as t } from "./SDKI18next.js";
|
|
9
9
|
import "../../shared/constants.js";
|
|
10
10
|
import "classnames";
|
|
11
|
-
import { InternalError as
|
|
11
|
+
import { InternalError as x } from "../../components/Common/InternalError/InternalError.js";
|
|
12
12
|
import "../ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import { LocaleProvider as
|
|
14
|
-
import { ThemeProvider as
|
|
13
|
+
import { LocaleProvider as L } from "../LocaleProvider/LocaleProvider.js";
|
|
14
|
+
import { ThemeProvider as U } from "../ThemeProvider/ThemeProvider.js";
|
|
15
15
|
const T = (a) => {
|
|
16
16
|
const {
|
|
17
17
|
children: d,
|
|
@@ -22,11 +22,12 @@ const T = (a) => {
|
|
|
22
22
|
currency: l = "USD",
|
|
23
23
|
theme: p,
|
|
24
24
|
components: s,
|
|
25
|
-
LoaderComponent: f
|
|
25
|
+
LoaderComponent: f,
|
|
26
|
+
queryClient: u
|
|
26
27
|
} = a;
|
|
27
28
|
if (o)
|
|
28
|
-
for (const
|
|
29
|
-
const i =
|
|
29
|
+
for (const h in o) {
|
|
30
|
+
const i = h;
|
|
30
31
|
for (const m in o[i])
|
|
31
32
|
t.addResourceBundle(
|
|
32
33
|
i,
|
|
@@ -36,9 +37,18 @@ const T = (a) => {
|
|
|
36
37
|
!0
|
|
37
38
|
);
|
|
38
39
|
}
|
|
39
|
-
return
|
|
40
|
+
return P(() => {
|
|
40
41
|
(async () => await t.changeLanguage(n))();
|
|
41
|
-
}, [n]), /* @__PURE__ */ r(
|
|
42
|
+
}, [n]), /* @__PURE__ */ r(y, { value: s, children: /* @__PURE__ */ r(I, { value: f, children: /* @__PURE__ */ r(v, { FallbackComponent: x, children: /* @__PURE__ */ r(U, { theme: p, children: /* @__PURE__ */ r(L, { locale: c, currency: l, children: /* @__PURE__ */ r(g, { i18n: t, children: /* @__PURE__ */ r(
|
|
43
|
+
C,
|
|
44
|
+
{
|
|
45
|
+
url: e.baseUrl,
|
|
46
|
+
headers: e.headers,
|
|
47
|
+
hooks: e.hooks,
|
|
48
|
+
queryClient: u,
|
|
49
|
+
children: d
|
|
50
|
+
}
|
|
51
|
+
) }, n) }) }) }) }) });
|
|
42
52
|
};
|
|
43
53
|
export {
|
|
44
54
|
T as GustoProviderCustomUIAdapter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport type { LoadingIndicatorContextProps } from '../LoadingIndicatorProvider/useLoadingIndicator'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\n\nexport interface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n hooks?: SDKHooks\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: GustoSDKTheme\n queryClient?: QueryClient\n components: ComponentsContextType\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport interface GustoProviderCustomUIAdapterProps extends GustoProviderProps {\n children?: React.ReactNode\n}\n\n/**\n * A provider that accepts UI component adapters through the components prop\n */\nconst GustoProviderCustomUIAdapter: React.FC<GustoProviderCustomUIAdapterProps> = props => {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n components,\n LoaderComponent,\n } = props\n\n // Handle dictionary resources\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n // Adding resources overrides to i18next instance - initial load will override common namespace and add component specific dictionaries provided by partners\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n // Handle language change\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n return (\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ErrorBoundary FallbackComponent={InternalError}>\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider
|
|
1
|
+
{"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport type { LoadingIndicatorContextProps } from '../LoadingIndicatorProvider/useLoadingIndicator'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\n\nexport interface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n hooks?: SDKHooks\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: GustoSDKTheme\n queryClient?: QueryClient\n components: ComponentsContextType\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport interface GustoProviderCustomUIAdapterProps extends GustoProviderProps {\n children?: React.ReactNode\n}\n\n/**\n * A provider that accepts UI component adapters through the components prop\n */\nconst GustoProviderCustomUIAdapter: React.FC<GustoProviderCustomUIAdapterProps> = props => {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n components,\n LoaderComponent,\n queryClient,\n } = props\n\n // Handle dictionary resources\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n // Adding resources overrides to i18next instance - initial load will override common namespace and add component specific dictionaries provided by partners\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n // Handle language change\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n return (\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ErrorBoundary FallbackComponent={InternalError}>\n <ThemeProvider theme={theme}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n {children}\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n )\n}\n\nexport { GustoProviderCustomUIAdapter }\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","components","LoaderComponent","queryClient","language","lang","ns","SDKI18next","useEffect","jsx","ComponentsProvider","LoadingIndicatorProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;;;AA2CA,MAAMA,IAA4E,CAAAC,MAAS;AACzF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEV;AAGJ,MAAIG;AACF,eAAWQ,KAAYR,GAAY;AACjC,YAAMS,IAAOD;AACb,iBAAWE,KAAMV,EAAWS,CAAI;AAE9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCV,EAAWS,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAIF,SAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeV,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC,GAGN,gBAAAY,EAACC,KAAmB,OAAOT,GACzB,4BAACU,GAAA,EAAyB,OAAOT,GAC/B,UAAA,gBAAAO,EAACG,GAAA,EAAc,mBAAmBC,GAChC,UAAA,gBAAAJ,EAACK,GAAA,EAAc,OAAAd,GACb,UAAA,gBAAAS,EAACM,GAAA,EAAe,QAAAjB,GAAgB,UAAAC,GAC9B,UAAA,gBAAAU,EAACO,GAAA,EAAgB,MAAMT,GACrB,UAAA,gBAAAE;AAAA,IAACQ;AAAA,IAAA;AAAA,MACC,KAAKtB,EAAO;AAAA,MACZ,SAASA,EAAO;AAAA,MAChB,OAAOA,EAAO;AAAA,MACd,aAAAQ;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EAAA,KAPmCG,CASxC,EAAA,CACF,EAAA,CACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export * from './components';
|
|
|
3
3
|
export * from './contexts';
|
|
4
4
|
export { componentEvents } from './shared/constants';
|
|
5
5
|
export type { BeforeCreateRequestHook, BeforeRequestHook, AfterSuccessHook, AfterErrorHook, BeforeCreateRequestContext, BeforeRequestContext, AfterSuccessContext, AfterErrorContext, SDKHooks, } from './types/hooks';
|
|
6
|
+
export type { ConfirmWireDetailsProps, ConfirmWireDetailsComponentType, } from './components/Payroll/ConfirmWireDetails';
|