@gusto/embedded-react-sdk 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/Base/Base.js +18 -19
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Common/DataView/DataView.js +20 -20
  5. package/dist/components/Common/DataView/DataView.js.map +1 -1
  6. package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
  7. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
  9. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
  11. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/AssignSignatory.js +2 -3
  13. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  14. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
  15. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -10
  17. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
  20. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -8
  21. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  22. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
  24. package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
  25. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  26. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
  27. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
  28. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  29. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -11
  30. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  31. package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
  32. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -12
  33. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  34. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +11 -13
  35. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  36. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
  37. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  38. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -7
  39. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  40. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +6 -7
  41. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  42. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  43. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
  44. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  45. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  46. package/dist/components/Company/FederalTaxes/Actions.js +7 -9
  47. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  48. package/dist/components/Company/FederalTaxes/FederalTaxes.js +6 -7
  49. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  50. package/dist/components/Company/FederalTaxes/Form.js +3 -5
  51. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  52. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
  53. package/dist/components/Company/Industry/Actions.js +5 -7
  54. package/dist/components/Company/Industry/Actions.js.map +1 -1
  55. package/dist/components/Company/Industry/Context.js +1 -1
  56. package/dist/components/Company/Industry/Edit.js +10 -12
  57. package/dist/components/Company/Industry/Edit.js.map +1 -1
  58. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -8
  59. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  60. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  61. package/dist/components/Company/Locations/LocationForm/LocationForm.js +3 -4
  62. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  63. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
  64. package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
  65. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  66. package/dist/components/Company/Locations/LocationsList/List.js +2 -4
  67. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  68. package/dist/components/Company/Locations/LocationsList/LocationsList.js +8 -9
  69. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  70. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
  71. package/dist/components/Company/OnboardingOverview/Completed.js +12 -14
  72. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  73. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -8
  74. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  75. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -3
  76. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  77. package/dist/components/Company/OnboardingOverview/context.js +1 -1
  78. package/dist/components/Company/PaySchedule/PaySchedule.js +3 -4
  79. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  80. package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -12
  81. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  82. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  83. package/dist/components/Company/PaySchedule/_parts/Head.js +6 -8
  84. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  85. package/dist/components/Company/PaySchedule/_parts/List.js +13 -15
  86. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  87. package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
  88. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -7
  89. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  90. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
  91. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -8
  92. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  93. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -7
  94. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  95. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
  96. package/dist/components/Contractor/Address/Address.js +4 -5
  97. package/dist/components/Contractor/Address/Address.js.map +1 -1
  98. package/dist/components/Contractor/Address/Form.js +1 -1
  99. package/dist/components/Contractor/Address/useAddress.js +1 -1
  100. package/dist/components/Contractor/NewHireReport/NewHireReport.js +16 -17
  101. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  102. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +6 -7
  103. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  104. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  105. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  106. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
  107. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  108. package/dist/components/Contractor/Profile/ContractorProfileForm.js +20 -18
  109. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
  110. package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
  111. package/dist/components/Contractor/Submit/index.js +9 -11
  112. package/dist/components/Contractor/Submit/index.js.map +1 -1
  113. package/dist/components/Employee/Compensation/Actions.js +5 -6
  114. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  115. package/dist/components/Employee/Compensation/Edit.js +29 -29
  116. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  117. package/dist/components/Employee/Compensation/List.js +23 -25
  118. package/dist/components/Employee/Compensation/List.js.map +1 -1
  119. package/dist/components/Employee/Deductions/Actions.js +10 -12
  120. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  121. package/dist/components/Employee/Deductions/DeductionForm.js +10 -12
  122. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  123. package/dist/components/Employee/Deductions/DeductionsList.js +5 -7
  124. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  125. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +11 -12
  126. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  127. package/dist/components/Employee/Deductions/useDeductions.js +1 -1
  128. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -8
  129. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  130. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +6 -7
  131. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  132. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -4
  133. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  134. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  135. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +7 -8
  136. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  137. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  138. package/dist/components/Employee/EmployeeList/Actions.js +4 -6
  139. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  140. package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
  141. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  142. package/dist/components/Employee/EmployeeList/Head.js +5 -7
  143. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  144. package/dist/components/Employee/EmployeeList/List.js +14 -15
  145. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  146. package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
  147. package/dist/components/Employee/Landing/Landing.js +12 -13
  148. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  149. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  150. package/dist/components/Employee/PaymentMethod/Actions.js +7 -9
  151. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  152. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +7 -7
  153. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  154. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +8 -10
  155. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  156. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -3
  157. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  158. package/dist/components/Employee/PaymentMethod/Split.js +10 -11
  159. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  160. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
  161. package/dist/components/Employee/Profile/Actions.js +7 -9
  162. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  163. package/dist/components/Employee/Profile/AdminPersonalDetails.js +9 -10
  164. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  165. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  166. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +51 -49
  167. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  168. package/dist/components/Employee/Profile/Profile.js +1 -1
  169. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  170. package/dist/components/Employee/Profile/useProfile.js +1 -1
  171. package/dist/components/Employee/Taxes/Actions.js +8 -10
  172. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  173. package/dist/components/Employee/Taxes/FederalForm.js +13 -14
  174. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  175. package/dist/components/Employee/Taxes/useTaxes.js +1 -1
  176. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -4
  177. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  178. package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js +34 -23
  179. package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js.map +1 -1
  180. package/dist/style.css +1 -1
  181. package/package.json +6 -6
  182. package/dist/hooks/useDebounce/useDebounce.js +0 -19
  183. package/dist/hooks/useDebounce/useDebounce.js.map +0 -1
@@ -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 { GTheme } from '@/types/GTheme'\nimport type { DeepPartial, ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\n\ninterface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: DeepPartial<GTheme>\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 url={config.baseUrl} headers={config.headers}>\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","language","lang","ns","SDKI18next","useEffect","ComponentsProvider","jsx","LoadingIndicatorProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;;AAyCA,MAAMA,IAA4E,CAASC,MAAA;AACnF,QAAA;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,EAAA,IACET;AAGJ,MAAIG;AACF,eAAWO,KAAYP,GAAY;AACjC,YAAMQ,IAAOD;AACF,iBAAAE,KAAMT,EAAWQ,CAAI;AAEnB,QAAAE,EAAA;AAAA,UACTF;AAAA,UACAC;AAAA,UACCT,EAAWQ,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QACF;AAAA,IACF;AAKJ,SAAAE,EAAU,MAAM;AACd,KAAM,YACE,MAAAD,EAAW,eAAeT,CAAG;AAAA,EAClC,GACF,CAACA,CAAG,CAAC,qBAGLW,GAAmB,EAAA,OAAOP,GACzB,UAAA,gBAAAQ,EAACC,KAAyB,OAAOR,GAC/B,UAAC,gBAAAO,EAAAE,GAAA,EAAc,mBAAmBC,GAChC,UAAA,gBAAAH,EAACI,KAAc,OAAAb,GACb,UAAA,gBAAAS,EAACK,KAAe,QAAAhB,GAAgB,UAAAC,GAC9B,UAAC,gBAAAU,EAAAM,GAAA,EAAgB,MAAMT,GACrB,UAAA,gBAAAG,EAACO,GAAY,EAAA,KAAKrB,EAAO,SAAS,SAASA,EAAO,SAC/C,UAAAD,EACH,CAAA,EAHsC,GAAAG,CAIxC,GACF,EACF,CAAA,GACF,GACF,EACF,CAAA;AAEJ;"}
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 { GTheme } from '@/types/GTheme'\nimport type { DeepPartial, ResourceDictionary, SupportedLanguages } from '@/types/Helpers'\n\ninterface APIConfig {\n baseUrl: string\n headers?: HeadersInit\n}\n\nexport interface GustoProviderProps {\n config: APIConfig\n dictionary?: ResourceDictionary\n lng?: string\n locale?: string\n currency?: string\n theme?: DeepPartial<GTheme>\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 url={config.baseUrl} headers={config.headers}>\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","language","lang","ns","SDKI18next","useEffect","ComponentsProvider","jsx","LoadingIndicatorProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;AAyCA,MAAMA,IAA4E,CAASC,MAAA;AACnF,QAAA;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,EAAA,IACET;AAGJ,MAAIG;AACF,eAAWO,KAAYP,GAAY;AACjC,YAAMQ,IAAOD;AACF,iBAAAE,KAAMT,EAAWQ,CAAI;AAEnB,QAAAE,EAAA;AAAA,UACTF;AAAA,UACAC;AAAA,UACCT,EAAWQ,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QACF;AAAA,IACF;AAKJ,SAAAE,EAAU,MAAM;AACd,KAAM,YACE,MAAAD,EAAW,eAAeT,CAAG;AAAA,EAClC,GACF,CAACA,CAAG,CAAC,qBAGLW,GAAmB,EAAA,OAAOP,GACzB,UAAA,gBAAAQ,EAACC,KAAyB,OAAOR,GAC/B,UAAC,gBAAAO,EAAAE,GAAA,EAAc,mBAAmBC,GAChC,UAAA,gBAAAH,EAACI,KAAc,OAAAb,GACb,UAAA,gBAAAS,EAACK,KAAe,QAAAhB,GAAgB,UAAAC,GAC9B,UAAC,gBAAAU,EAAAM,GAAA,EAAgB,MAAMT,GACrB,UAAA,gBAAAG,EAACO,GAAY,EAAA,KAAKrB,EAAO,SAAS,SAASA,EAAO,SAC/C,UAAAD,EACH,CAAA,EAHsC,GAAAG,CAIxC,GACF,EACF,CAAA,GACF,GACF,EACF,CAAA;AAEJ;"}
@@ -1,30 +1,41 @@
1
- import { useState as m, useEffect as p } from "react";
2
- import { BREAKPOINTS_VALUES as b } from "../../shared/constants.js";
3
- import { useDebounce as v } from "../useDebounce/useDebounce.js";
4
- import { remToPx as u } from "../../helpers/rem.js";
5
- const B = 10, z = ({
6
- ref: r,
7
- breakpoints: a = b,
8
- debounceTimeout: f = B
1
+ import { useState as l, useRef as m, useEffect as B } from "react";
2
+ import { BREAKPOINTS_VALUES as d } from "../../shared/constants.js";
3
+ import { remToPx as k } from "../../helpers/rem.js";
4
+ const h = 10, T = ({
5
+ ref: o,
6
+ breakpoints: a = d,
7
+ debounceTimeout: c = h
9
8
  }) => {
10
- const [e, l] = m([]), s = v((t) => {
11
- if (t.length >= 1) {
12
- const i = t[0]?.contentRect.width ?? 0;
13
- let n = e;
14
- for (const [o, c] of Object.entries(a))
15
- i >= u(c) && !e.includes(o) ? n = [...n, o] : e.includes(o) && i < u(c) && (n = e.filter((d) => d !== o));
16
- l(n);
9
+ const [f, i] = l([]), e = m(null), u = (s) => {
10
+ const r = [];
11
+ for (const [t, n] of Object.entries(a))
12
+ s >= k(n) && r.push(t);
13
+ return r;
14
+ };
15
+ return B(() => {
16
+ const s = (t) => {
17
+ e.current && clearTimeout(e.current), e.current = setTimeout(() => {
18
+ if (t.length >= 1) {
19
+ const n = t[0]?.contentRect.width ?? 0, p = u(n);
20
+ i(p);
21
+ }
22
+ }, c);
23
+ }, r = new ResizeObserver(s);
24
+ if (o.current) {
25
+ const t = o.current.offsetWidth;
26
+ if (t > 0) {
27
+ const n = u(t);
28
+ i(n);
29
+ }
30
+ r.observe(o.current);
17
31
  }
18
- }, f);
19
- return p(() => {
20
- const t = new ResizeObserver(s);
21
- return r.current && t.observe(r.current), () => {
22
- t.disconnect();
32
+ return () => {
33
+ r.disconnect(), e.current && clearTimeout(e.current);
23
34
  };
24
- }, [s, r]), e;
35
+ }, [c]), f;
25
36
  };
26
37
  export {
27
- z as default,
28
- z as useContainerBreakpoints
38
+ T as default,
39
+ T as useContainerBreakpoints
29
40
  };
30
41
  //# sourceMappingURL=useContainerBreakpoints.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useContainerBreakpoints.js","sources":["../../../src/hooks/useContainerBreakpoints/useContainerBreakpoints.ts"],"sourcesContent":["import { useState, useEffect } from 'react'\nimport type React from 'react'\nimport type { BREAKPOINTS } from '@/shared/constants'\nimport { BREAKPOINTS_VALUES } from '@/shared/constants'\nimport { useDebounce } from '@/hooks/useDebounce/useDebounce'\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?: Partial<{ [K in BreakpointKey]: 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\n const handleResize = (entries: ResizeObserverEntry[]) => {\n if (entries.length >= 1) {\n const width = entries[0]?.contentRect.width ?? 0\n let returnBreakpoints = activeBreakpoints\n\n for (const [key, value] of Object.entries(breakpoints)) {\n if (\n width >= remToPx(value) &&\n !activeBreakpoints.includes(key as keyof typeof breakpoints)\n ) {\n // Add key if not already in array\n returnBreakpoints = [...returnBreakpoints, key as keyof typeof breakpoints]\n } else if (\n activeBreakpoints.includes(key as keyof typeof breakpoints) &&\n width < remToPx(value)\n ) {\n // Remove Key if already in array\n returnBreakpoints = activeBreakpoints.filter(bp => bp !== key)\n }\n }\n\n setActiveBreakpoint(returnBreakpoints)\n }\n }\n const debounceResizeHandler = useDebounce(handleResize, debounceTimeout)\n\n useEffect(() => {\n const observer = new ResizeObserver(debounceResizeHandler)\n\n if (ref.current) {\n observer.observe(ref.current)\n }\n\n return () => {\n observer.disconnect()\n }\n }, [debounceResizeHandler, ref])\n\n return activeBreakpoints\n}\n\nexport default useContainerBreakpoints\n"],"names":["DEBOUNCE_TIMEOUT","useContainerBreakpoints","ref","breakpoints","BREAKPOINTS_VALUES","debounceTimeout","activeBreakpoints","setActiveBreakpoint","useState","debounceResizeHandler","useDebounce","entries","width","returnBreakpoints","key","value","remToPx","bp","useEffect","observer"],"mappings":";;;;AAeA,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,GA0BvFC,IAAwBC,EAxBT,CAACC,MAAmC;AACnD,QAAAA,EAAQ,UAAU,GAAG;AACvB,YAAMC,IAAQD,EAAQ,CAAC,GAAG,YAAY,SAAS;AAC/C,UAAIE,IAAoBP;AAExB,iBAAW,CAACQ,GAAKC,CAAK,KAAK,OAAO,QAAQZ,CAAW;AAEjD,QAAAS,KAASI,EAAQD,CAAK,KACtB,CAACT,EAAkB,SAASQ,CAA+B,IAGvCD,IAAA,CAAC,GAAGA,GAAmBC,CAA+B,IAE1ER,EAAkB,SAASQ,CAA+B,KAC1DF,IAAQI,EAAQD,CAAK,MAGrBF,IAAoBP,EAAkB,OAAO,CAAMW,MAAAA,MAAOH,CAAG;AAIjE,MAAAP,EAAoBM,CAAiB;AAAA,IAAA;AAAA,EAEzC,GACwDR,CAAe;AAEvE,SAAAa,EAAU,MAAM;AACR,UAAAC,IAAW,IAAI,eAAeV,CAAqB;AAEzD,WAAIP,EAAI,WACGiB,EAAA,QAAQjB,EAAI,OAAO,GAGvB,MAAM;AACX,MAAAiB,EAAS,WAAW;AAAA,IACtB;AAAA,EAAA,GACC,CAACV,GAAuBP,CAAG,CAAC,GAExBI;AACT;"}
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?: Partial<{ [K in BreakpointKey]: 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 as keyof typeof breakpoints)\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,CAAC;AAE5D,eAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQZ,CAAW;AAC/C,MAAAS,KAASI,EAAQD,CAAK,KACxBF,EAAkB,KAAKC,CAA+B;AAInD,WAAAD;AAAA,EACT;AAEA,SAAAI,EAAU,MAAM;AACR,UAAAC,IAAwB,CAACC,MAAmC;AAChE,MAAIV,EAAW,WACb,aAAaA,EAAW,OAAO,GAEtBA,EAAA,UAAU,WAAW,MAAM;AAChC,YAAAU,EAAQ,UAAU,GAAG;AACvB,gBAAMP,IAAQO,EAAQ,CAAC,GAAG,YAAY,SAAS,GACzCC,IAAiBT,EAAqBC,CAAK;AACjD,UAAAL,EAAoBa,CAAc;AAAA,QAAA;AAAA,SAEnCf,CAAe;AAAA,IACpB,GAEMgB,IAAW,IAAI,eAAeH,CAAqB;AAEzD,QAAIhB,EAAI,SAAS;AAET,YAAAU,IAAQV,EAAI,QAAQ;AAC1B,UAAIU,IAAQ,GAAG;AACP,cAAAU,IAAqBX,EAAqBC,CAAK;AACrD,QAAAL,EAAoBe,CAAkB;AAAA,MAAA;AAG/B,MAAAD,EAAA,QAAQnB,EAAI,OAAO;AAAA,IAAA;AAG9B,WAAO,MAAM;AACX,MAAAmB,EAAS,WAAW,GAChBZ,EAAW,WACb,aAAaA,EAAW,OAAO;AAAA,IAEnC;AAAA,EAAA,GACC,CAACJ,CAAe,CAAC,GAEbC;AACT;"}