@gusto/embedded-react-sdk 0.13.2 → 0.13.4

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 (484) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/assets/icons/close.svg.js +5 -5
  3. package/dist/assets/icons/close.svg.js.map +1 -1
  4. package/dist/assets/icons/download-cloud.svg.js +10 -0
  5. package/dist/assets/icons/download-cloud.svg.js.map +1 -0
  6. package/dist/assets/icons/hamburger.svg.js +5 -5
  7. package/dist/assets/icons/hamburger.svg.js.map +1 -1
  8. package/dist/assets/icons/receipt-check.svg.js +10 -0
  9. package/dist/assets/icons/receipt-check.svg.js.map +1 -0
  10. package/dist/components/Base/Base.js +3 -2
  11. package/dist/components/Base/Base.js.map +1 -1
  12. package/dist/components/Common/DataView/DataCards/DataCards.js +24 -24
  13. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  14. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +6 -4
  15. package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
  16. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +3 -1
  17. package/dist/components/Common/DataView/DataTable/DataTable.js +38 -35
  18. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  19. package/dist/components/Common/DataView/DataView.d.ts +6 -3
  20. package/dist/components/Common/DataView/DataView.js +19 -16
  21. package/dist/components/Common/DataView/DataView.js.map +1 -1
  22. package/dist/components/Common/DocumentViewer/DocumentViewer.d.ts +1 -1
  23. package/dist/components/Common/DocumentViewer/DocumentViewer.js +9 -9
  24. package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
  25. package/dist/components/Common/Fields/CheckboxField/CheckboxField.d.ts +1 -1
  26. package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +15 -9
  27. package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
  28. package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.d.ts +2 -2
  29. package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js +21 -15
  30. package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
  31. package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.d.ts +2 -2
  32. package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js +19 -13
  33. package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
  34. package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +1 -1
  35. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +24 -18
  36. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
  37. package/dist/components/Common/Fields/NumberInputField/NumberInputField.d.ts +1 -1
  38. package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +18 -12
  39. package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
  40. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +2 -2
  41. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +19 -13
  42. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
  43. package/dist/components/Common/Fields/SelectField/SelectField.d.ts +2 -2
  44. package/dist/components/Common/Fields/SelectField/SelectField.js +19 -13
  45. package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
  46. package/dist/components/Common/Fields/SwitchField/SwitchField.d.ts +1 -1
  47. package/dist/components/Common/Fields/SwitchField/SwitchField.js +15 -9
  48. package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
  49. package/dist/components/Common/Fields/TextInputField/TextInputField.d.ts +1 -1
  50. package/dist/components/Common/Fields/TextInputField/TextInputField.js +15 -9
  51. package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
  52. package/dist/components/Common/Fields/hooks/useField.d.ts +8 -7
  53. package/dist/components/Common/Fields/hooks/useField.js +33 -27
  54. package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
  55. package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
  56. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  57. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  58. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  59. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  60. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  61. package/dist/components/Common/UI/Alert/Alert.js +15 -15
  62. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  63. package/dist/components/Common/UI/Alert/Alert.module.scss.js +14 -12
  64. package/dist/components/Common/UI/Alert/Alert.module.scss.js.map +1 -1
  65. package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
  66. package/dist/components/Common/UI/Checkbox/CheckboxTypes.d.ts +5 -1
  67. package/dist/components/Common/UI/Checkbox/CheckboxTypes.js.map +1 -1
  68. package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +2 -2
  69. package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +2 -2
  70. package/dist/components/Common/UI/Dialog/Dialog.d.ts +2 -0
  71. package/dist/components/Common/UI/Dialog/Dialog.js +84 -0
  72. package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -0
  73. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +18 -0
  74. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js.map +1 -0
  75. package/dist/components/Common/UI/Dialog/DialogTypes.d.ts +52 -0
  76. package/dist/components/Common/UI/Dialog/DialogTypes.js +10 -0
  77. package/dist/components/Common/UI/Dialog/DialogTypes.js.map +1 -0
  78. package/dist/components/Common/UI/Dialog/index.d.ts +4 -0
  79. package/dist/components/Common/UI/Menu/Menu.module.scss.js +1 -1
  80. package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +2 -2
  81. package/dist/components/Common/UI/RadioGroup/RadioGroup.js +33 -31
  82. package/dist/components/Common/UI/RadioGroup/RadioGroup.js.map +1 -1
  83. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +4 -0
  84. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
  85. package/dist/components/Common/UI/Select/SelectTypes.d.ts +2 -2
  86. package/dist/components/Common/UI/Switch/SwitchTypes.d.ts +2 -2
  87. package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
  88. package/dist/components/Common/UI/Table/Table.d.ts +1 -1
  89. package/dist/components/Common/UI/Table/Table.js +23 -11
  90. package/dist/components/Common/UI/Table/Table.js.map +1 -1
  91. package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
  92. package/dist/components/Common/UI/Table/TableTypes.d.ts +15 -0
  93. package/dist/components/Common/UI/Table/TableTypes.js +8 -0
  94. package/dist/components/Common/UI/Table/TableTypes.js.map +1 -0
  95. package/dist/components/Common/UI/Text/Text.js +9 -8
  96. package/dist/components/Common/UI/Text/Text.js.map +1 -1
  97. package/dist/components/Common/UI/Text/Text.module.scss.js +15 -14
  98. package/dist/components/Common/UI/Text/Text.module.scss.js.map +1 -1
  99. package/dist/components/Common/UI/Text/TextTypes.d.ts +2 -2
  100. package/dist/components/Common/UI/Text/TextTypes.js.map +1 -1
  101. package/dist/components/Common/UI/TextInput/TextInput.js +35 -33
  102. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  103. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +5 -1
  104. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  105. package/dist/components/Common/UI/hooks/useFieldIds.d.ts +2 -1
  106. package/dist/components/Common/UI/hooks/useFieldIds.js +11 -6
  107. package/dist/components/Common/UI/hooks/useFieldIds.js.map +1 -1
  108. package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
  109. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  110. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
  111. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  112. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +10 -8
  113. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  114. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
  115. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
  116. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  117. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +8 -6
  118. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  119. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  120. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
  121. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  122. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  123. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  124. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
  125. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  126. package/dist/components/Company/BankAccount/BankAccount.js +25 -21
  127. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  128. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  129. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  130. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
  131. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  132. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
  133. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  134. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +12 -10
  135. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  136. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +13 -11
  137. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  138. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  139. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  140. package/dist/components/Company/BankAccount/stateMachine.d.ts +4 -4
  141. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  142. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +7 -5
  143. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  144. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +33 -32
  145. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  146. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  147. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  148. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  149. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  150. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  151. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  152. package/dist/components/Company/DocumentSigner/assignSignatoryState.d.ts +1 -1
  153. package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -1
  154. package/dist/components/Company/DocumentSigner/stateMachine.d.ts +5 -5
  155. package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
  156. package/dist/components/Company/FederalTaxes/Actions.js +9 -7
  157. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  158. package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -6
  159. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  160. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  161. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  162. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -8
  163. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  164. package/dist/components/Company/Industry/Actions.js +7 -5
  165. package/dist/components/Company/Industry/Actions.js.map +1 -1
  166. package/dist/components/Company/Industry/Context.js +8 -6
  167. package/dist/components/Company/Industry/Context.js.map +1 -1
  168. package/dist/components/Company/Industry/Edit.js +12 -10
  169. package/dist/components/Company/Industry/Edit.js.map +1 -1
  170. package/dist/components/Company/Locations/LocationForm/Actions.js +8 -6
  171. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  172. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  173. package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
  174. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  175. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
  176. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  177. package/dist/components/Company/Locations/Locations.js +21 -17
  178. package/dist/components/Company/Locations/Locations.js.map +1 -1
  179. package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
  180. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  181. package/dist/components/Company/Locations/LocationsList/List.js +17 -16
  182. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  183. package/dist/components/Company/Locations/LocationsList/LocationsList.js +9 -8
  184. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  185. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
  186. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  187. package/dist/components/Company/Locations/stateMachine.d.ts +3 -3
  188. package/dist/components/Company/Locations/stateMachine.js.map +1 -1
  189. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +21 -17
  190. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
  191. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.d.ts +10 -10
  192. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  193. package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
  194. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  195. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
  196. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  197. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
  198. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  199. package/dist/components/Company/OnboardingOverview/context.js +5 -3
  200. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  201. package/dist/components/Company/PaySchedule/PaySchedule.js +4 -3
  202. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  203. package/dist/components/Company/PaySchedule/_parts/Actions.js +12 -10
  204. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  205. package/dist/components/Company/PaySchedule/_parts/Edit.js +14 -14
  206. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -6
  207. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  208. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  209. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  210. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -5
  211. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  212. package/dist/components/Company/StateTaxes/StateTaxes.js +20 -16
  213. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  214. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +7 -5
  215. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  216. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
  217. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  218. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +8 -6
  219. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  220. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +7 -5
  221. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  222. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
  223. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  224. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +3 -3
  225. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  226. package/dist/components/Contractor/Address/Address.js +5 -4
  227. package/dist/components/Contractor/Address/Address.js.map +1 -1
  228. package/dist/components/Contractor/Address/Form.js +1 -1
  229. package/dist/components/Contractor/Address/useAddress.js +7 -5
  230. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  231. package/dist/components/Contractor/ContractorList/index.js +25 -24
  232. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  233. package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
  234. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  235. package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +25 -21
  236. package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
  237. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.d.ts +7 -7
  238. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  239. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +7 -5
  240. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  241. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  242. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  243. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  244. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  245. package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +1 -1
  246. package/dist/components/Contractor/Profile/ContractorProfileForm.js +58 -55
  247. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
  248. package/dist/components/Contractor/Profile/ContractorProfileForm.module.scss.js +8 -0
  249. package/dist/components/Contractor/Profile/ContractorProfileForm.module.scss.js.map +1 -0
  250. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +2 -0
  251. package/dist/components/Contractor/Profile/useContractorProfile.js +97 -94
  252. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  253. package/dist/components/Contractor/Submit/Submit.js +4 -3
  254. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  255. package/dist/components/Employee/Compensation/Actions.js +6 -5
  256. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  257. package/dist/components/Employee/Compensation/Edit.js +15 -14
  258. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  259. package/dist/components/Employee/Compensation/List.js +25 -23
  260. package/dist/components/Employee/Compensation/List.js.map +1 -1
  261. package/dist/components/Employee/Deductions/DeductionsComponents.js +1 -1
  262. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
  263. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +55 -0
  264. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +221 -0
  265. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -0
  266. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +8 -0
  267. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +1 -0
  268. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +42 -0
  269. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +132 -0
  270. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -0
  271. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +11 -10
  272. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  273. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +14 -0
  274. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +1 -0
  275. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.d.ts +7 -0
  276. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js +98 -0
  277. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js.map +1 -0
  278. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +8 -7
  279. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  280. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +11 -10
  281. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
  282. package/dist/components/Employee/Deductions/stateMachine.d.ts +5 -5
  283. package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
  284. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
  285. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  286. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +7 -6
  287. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  288. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  289. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  290. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  291. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  292. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +19 -15
  293. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  294. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +8 -7
  295. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  296. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  297. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  298. package/dist/components/Employee/DocumentSigner/stateMachine.d.ts +3 -3
  299. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
  300. package/dist/components/Employee/EmployeeList/Actions.js +6 -4
  301. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  302. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
  303. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  304. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  305. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  306. package/dist/components/Employee/EmployeeList/List.js +15 -14
  307. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  308. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -3
  309. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  310. package/dist/components/Employee/FederalTaxes/Actions.js +8 -6
  311. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  312. package/dist/components/Employee/FederalTaxes/FederalForm.js +13 -11
  313. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  314. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -3
  315. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  316. package/dist/components/Employee/Landing/Landing.js +13 -12
  317. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  318. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +24 -20
  319. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
  320. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +9 -9
  321. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  322. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  323. package/dist/components/Employee/PaymentMethod/Actions.js +9 -7
  324. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  325. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +6 -5
  326. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  327. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -8
  328. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  329. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  330. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  331. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  332. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  333. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -5
  334. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  335. package/dist/components/Employee/Profile/Actions.js +9 -7
  336. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  337. package/dist/components/Employee/Profile/AdminPersonalDetails.js +32 -29
  338. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  339. package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +8 -0
  340. package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js.map +1 -0
  341. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  342. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  343. package/dist/components/Employee/Profile/Profile.d.ts +1 -0
  344. package/dist/components/Employee/Profile/Profile.js +78 -75
  345. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  346. package/dist/components/Employee/Profile/useProfile.js +5 -3
  347. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  348. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js +17 -13
  349. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
  350. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts +5 -5
  351. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
  352. package/dist/components/Employee/StateTaxes/Actions.js +10 -8
  353. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  354. package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -3
  355. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  356. package/dist/components/Employee/Taxes/Actions.js +10 -8
  357. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  358. package/dist/components/Employee/Taxes/FederalForm.js +14 -12
  359. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  360. package/dist/components/Employee/Taxes/useTaxes.js +5 -3
  361. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  362. package/dist/components/Payroll/PayrollBlocker/PayrollBlockerAlerts.d.ts +7 -0
  363. package/dist/components/Payroll/PayrollBlocker/PayrollBlockerList.d.ts +6 -0
  364. package/dist/components/Payroll/PayrollBlocker/PayrollBlockerTypes.d.ts +101 -0
  365. package/dist/components/Payroll/PayrollBlocker/index.d.ts +4 -0
  366. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +64 -56
  367. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  368. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +36 -36
  369. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  370. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +41 -45
  371. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  372. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +20 -2
  373. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +308 -101
  374. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  375. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +16 -0
  376. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js.map +1 -0
  377. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +7 -0
  378. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +59 -0
  379. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -0
  380. package/dist/components/Payroll/PayrollEditEmployee/index.d.ts +4 -0
  381. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +2 -0
  382. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +26 -0
  383. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -0
  384. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +25 -0
  385. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +59 -0
  386. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -0
  387. package/dist/components/Payroll/PayrollFlow/index.d.ts +3 -0
  388. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +7 -0
  389. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +116 -0
  390. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -0
  391. package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +19 -0
  392. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +114 -0
  393. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -0
  394. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +8 -11
  395. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +194 -0
  396. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -0
  397. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.module.scss.js +8 -0
  398. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.module.scss.js.map +1 -0
  399. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +7 -0
  400. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +41 -0
  401. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -0
  402. package/dist/components/Payroll/PayrollList/PayrollList.js +19 -21
  403. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  404. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +87 -79
  405. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  406. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +3 -1
  407. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +102 -42
  408. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  409. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +12 -1
  410. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +274 -133
  411. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  412. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +7 -0
  413. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +21 -0
  414. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -0
  415. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +6 -0
  416. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +220 -0
  417. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -0
  418. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +28 -0
  419. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js.map +1 -0
  420. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.d.ts +2 -2
  421. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js +58 -43
  422. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js.map +1 -1
  423. package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js +11 -11
  424. package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js.map +1 -1
  425. package/dist/components/Payroll/helpers.d.ts +21 -1
  426. package/dist/components/Payroll/helpers.js +166 -123
  427. package/dist/components/Payroll/helpers.js.map +1 -1
  428. package/dist/components/Payroll/index.d.ts +4 -0
  429. package/dist/components/Payroll/index.js +14 -6
  430. package/dist/components/Payroll/index.js.map +1 -1
  431. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +21 -19
  432. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  433. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  434. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +10 -0
  435. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +35 -31
  436. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  437. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  438. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  439. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +8 -5
  440. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  441. package/dist/contexts/ThemeProvider/theme.d.ts +3 -0
  442. package/dist/contexts/ThemeProvider/theme.js +12 -9
  443. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  444. package/dist/helpers/formattedStrings.js +12 -11
  445. package/dist/helpers/formattedStrings.js.map +1 -1
  446. package/dist/helpers/readableStreamToBlob.d.ts +1 -0
  447. package/dist/helpers/readableStreamToBlob.js +17 -0
  448. package/dist/helpers/readableStreamToBlob.js.map +1 -0
  449. package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.d.ts +2 -4
  450. package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js.map +1 -1
  451. package/dist/i18n/I18n.js +9 -9
  452. package/dist/i18n/I18n.js.map +1 -1
  453. package/dist/i18n/en/Employee.Deductions.json.js +126 -66
  454. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  455. package/dist/i18n/en/Employee.Profile.json.js +32 -30
  456. package/dist/i18n/en/Employee.Profile.json.js.map +1 -1
  457. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +15 -15
  458. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +34 -14
  459. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  460. package/dist/i18n/en/Payroll.PayrollHistory.json.js +22 -0
  461. package/dist/i18n/en/Payroll.PayrollHistory.json.js.map +1 -0
  462. package/dist/i18n/en/Payroll.PayrollLanding.json.js +12 -0
  463. package/dist/i18n/en/Payroll.PayrollLanding.json.js.map +1 -0
  464. package/dist/i18n/en/Payroll.PayrollList.json.js +16 -12
  465. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  466. package/dist/i18n/en/Payroll.PayrollOverview.json.js +50 -22
  467. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  468. package/dist/i18n/en/Payroll.PayrollReceipts.json.js +16 -0
  469. package/dist/i18n/en/Payroll.PayrollReceipts.json.js.map +1 -0
  470. package/dist/i18n/en/PayrollBlocker.json.js +18 -0
  471. package/dist/i18n/en/PayrollBlocker.json.js.map +1 -0
  472. package/dist/node_modules/redux/es/redux.js +2 -2
  473. package/dist/node_modules/redux/es/redux.js.map +1 -1
  474. package/dist/shared/constants.d.ts +41 -4
  475. package/dist/shared/constants.js +85 -57
  476. package/dist/shared/constants.js.map +1 -1
  477. package/dist/style.css +1 -1
  478. package/dist/types/Helpers.d.ts +7 -0
  479. package/dist/types/i18next.d.ts +187 -44
  480. package/package.json +18 -18
  481. package/dist/i18n/en/Payroll.PayrollHistoryList.json.js +0 -16
  482. package/dist/i18n/en/Payroll.PayrollHistoryList.json.js.map +0 -1
  483. package/dist/i18n/en/payroll.payrollhistory.json.js +0 -20
  484. package/dist/i18n/en/payroll.payrollhistory.json.js.map +0 -1
@@ -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'\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}\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqDO,MAAMA,IAA2C;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,EAAA,CAAO;AAC/C;"}
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDO,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,EAAA,CAAO;AACrD;"}
@@ -21,3 +21,4 @@ export type { HeadingProps } from '../../components/Common/UI/Heading/HeadingTyp
21
21
  export type { PaginationControlProps } from '../../components/Common/PaginationControl/PaginationControlTypes';
22
22
  export type { TextProps } from '../../components/Common/UI/Text/TextTypes';
23
23
  export type { CalendarPreviewProps } from '../../components/Common/UI/CalendarPreview/CalendarPreviewTypes';
24
+ export type { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
@@ -9,8 +9,10 @@ import { MenuProps } from '../../components/Common/UI/Menu/MenuTypes';
9
9
  import { RadioProps } from '../../components/Common/UI/Radio/RadioTypes';
10
10
  import { RadioGroupProps } from '../../components/Common/UI/RadioGroup/RadioGroupTypes';
11
11
  import { SwitchProps } from '../../components/Common/UI/Switch/SwitchTypes';
12
+ import { TableProps } from '../../components/Common/UI/Table/TableTypes';
12
13
  import { TextProps } from '../../components/Common/UI/Text/TextTypes';
13
14
  import { TextInputProps } from '../../components/Common/UI/TextInput/TextInputTypes';
15
+ import { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
14
16
  export declare const componentCreators: {
15
17
  readonly Alert: (customComponent: (props: AlertProps) => React.ReactElement | null) => {
16
18
  (props: AlertProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
@@ -52,6 +54,10 @@ export declare const componentCreators: {
52
54
  (props: SwitchProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
53
55
  displayName: string;
54
56
  };
57
+ readonly Table: (customComponent: (props: TableProps) => React.ReactElement | null) => {
58
+ (props: TableProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
59
+ displayName: string;
60
+ };
55
61
  readonly Text: (customComponent: (props: TextProps) => React.ReactElement | null) => {
56
62
  (props: TextProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
57
63
  displayName: string;
@@ -60,6 +66,10 @@ export declare const componentCreators: {
60
66
  (props: TextInputProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
61
67
  displayName: string;
62
68
  };
69
+ readonly Dialog: (customComponent: (props: DialogProps) => React.ReactElement | null) => {
70
+ (props: DialogProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
71
+ displayName: string;
72
+ };
63
73
  };
64
74
  /**
65
75
  * Creates components with automatic default prop handling.
@@ -7,47 +7,51 @@ import { CheckboxDefaults as d } from "../../components/Common/UI/Checkbox/Check
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
- import { RadioGroupDefaults as B } from "../../components/Common/UI/RadioGroup/RadioGroupTypes.js";
11
- import { SwitchDefaults as b } from "../../components/Common/UI/Switch/SwitchTypes.js";
12
- import { TextDefaults as k } from "../../components/Common/UI/Text/TextTypes.js";
13
- import { TextInputDefaults as G } from "../../components/Common/UI/TextInput/TextInputTypes.js";
14
- function t(u, o) {
10
+ import { RadioGroupDefaults as b } from "../../components/Common/UI/RadioGroup/RadioGroupTypes.js";
11
+ import { SwitchDefaults as B } from "../../components/Common/UI/Switch/SwitchTypes.js";
12
+ import { TableDefaults as T } from "../../components/Common/UI/Table/TableTypes.js";
13
+ import { TextDefaults as g } from "../../components/Common/UI/Text/TextTypes.js";
14
+ import { TextInputDefaults as k } from "../../components/Common/UI/TextInput/TextInputTypes.js";
15
+ import { DialogDefaults as G } from "../../components/Common/UI/Dialog/DialogTypes.js";
16
+ function o(a, t) {
15
17
  return (e) => {
16
18
  const r = (n) => {
17
- const p = i(n, u);
18
- return e(p);
19
+ const u = i(n, a);
20
+ return e(u);
19
21
  };
20
- return r.displayName = `withAutoDefault(${o})`, r;
22
+ return r.displayName = `withAutoDefault(${t})`, r;
21
23
  };
22
24
  }
23
- const m = {
24
- Alert: t(s, "Alert"),
25
- Badge: t(c, "Badge"),
26
- Button: t(D, "Button"),
27
- ButtonIcon: t(l, "ButtonIcon"),
28
- Checkbox: t(d, "Checkbox"),
29
- CheckboxGroup: t(x, "CheckboxGroup"),
30
- Menu: t(h, "Menu"),
31
- Radio: t(C, "Radio"),
32
- RadioGroup: t(B, "RadioGroup"),
33
- Switch: t(b, "Switch"),
34
- Text: t(k, "Text"),
35
- TextInput: t(G, "TextInput")
25
+ const p = {
26
+ Alert: o(s, "Alert"),
27
+ Badge: o(c, "Badge"),
28
+ Button: o(D, "Button"),
29
+ ButtonIcon: o(l, "ButtonIcon"),
30
+ Checkbox: o(d, "Checkbox"),
31
+ CheckboxGroup: o(x, "CheckboxGroup"),
32
+ Menu: o(h, "Menu"),
33
+ Radio: o(C, "Radio"),
34
+ RadioGroup: o(b, "RadioGroup"),
35
+ Switch: o(B, "Switch"),
36
+ Table: o(T, "Table"),
37
+ Text: o(g, "Text"),
38
+ TextInput: o(k, "TextInput"),
39
+ Dialog: o(G, "Dialog")
36
40
  };
37
- function v(u = {}) {
38
- const o = { ...f };
39
- for (const [e, r] of Object.entries(u)) {
41
+ function z(a = {}) {
42
+ const t = { ...f };
43
+ for (const [e, r] of Object.entries(a)) {
40
44
  const n = e;
41
- if (e in m) {
42
- const a = m[e];
43
- o[n] = a(r);
45
+ if (e in p) {
46
+ const m = p[e];
47
+ t[n] = m(r);
44
48
  } else
45
- o[n] = r;
49
+ t[n] = r;
46
50
  }
47
- return o;
51
+ return t;
48
52
  }
49
53
  export {
50
- m as componentCreators,
51
- v as createComponents
54
+ p as componentCreators,
55
+ z as createComponents
52
56
  };
53
57
  //# 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 { 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'\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 Text: composeWithDefaults<TextProps>(TextDefaults, 'Text'),\n TextInput: composeWithDefaults<TextInputProps>(TextInputDefaults, 'TextInput'),\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","TextDefaults","TextInputDefaults","createComponents","providedComponents","components","defaultComponents","providedComponent","typedComponentName","creator"],"mappings":";;;;;;;;;;;;;AA4BA,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,MAAMlB,EAA+BmB,GAAc,MAAM;AAAA,EACzD,WAAWnB,EAAoCoB,GAAmB,WAAW;AAC/E;AAMO,SAASC,EACdC,IAAqD,IAC9B;AACvB,QAAMC,IAAa,EAAE,GAAGC,EAAA;AAExB,aAAW,CAACtB,GAAeuB,CAAiB,KAAK,OAAO,QAAQH,CAAkB,GAAG;AACnF,UAAMI,IAAqBxB;AAE3B,QAAIA,KAAiBM,GAAmB;AAEtC,YAAMmB,IAAUnB,EADGN,CACyB;AAE5C,MAAAqB,EAAWG,CAAkB,IAAIC,EAAQF,CAAwB;AAAA,IACnE;AAEE,MAAAF,EAAWG,CAAkB,IAAID;AAAA,EAErC;AAEA,SAAOF;AACT;"}
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":";;;;;;;;;;;;;;;AAgCA,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;AACnE;AAMO,SAASC,EACdC,IAAqD,IAC9B;AACvB,QAAMC,IAAa,EAAE,GAAGC,EAAA;AAExB,aAAW,CAACxB,GAAeyB,CAAiB,KAAK,OAAO,QAAQH,CAAkB,GAAG;AACnF,UAAMI,IAAqB1B;AAE3B,QAAIA,KAAiBM,GAAmB;AAEtC,YAAMqB,IAAUrB,EADGN,CACyB;AAE5C,MAAAuB,EAAWG,CAAkB,IAAIC,EAAQF,CAAwB;AAAA,IACnE;AAEE,MAAAF,EAAWG,CAAkB,IAAID;AAAA,EAErC;AAEA,SAAOF;AACT;"}
@@ -23,6 +23,7 @@ import { TextProps } from '../../components/Common/UI/Text/TextTypes';
23
23
  import { CalendarPreviewProps } from '../../components/Common/UI/CalendarPreview/CalendarPreviewTypes';
24
24
  import { ProgressBarProps } from '../../components/Common/UI/ProgressBar/ProgressBarTypes';
25
25
  import { TabsProps } from '../../components/Common/UI/Tabs/TabsTypes';
26
+ import { DialogProps } from '../../components/Common/UI/Dialog/DialogTypes';
26
27
  export interface ComponentsContextType {
27
28
  Alert: (props: AlertProps) => JSX.Element | null;
28
29
  Badge: (props: BadgeProps) => JSX.Element | null;
@@ -50,6 +51,7 @@ export interface ComponentsContextType {
50
51
  CalendarPreview: (props: CalendarPreviewProps) => JSX.Element | null;
51
52
  ProgressBar: (props: ProgressBarProps) => JSX.Element | null;
52
53
  Tabs: (props: TabsProps) => JSX.Element | null;
54
+ Dialog: (props: DialogProps) => JSX.Element | null;
53
55
  }
54
56
  export declare const ComponentsContext: import('react').Context<ComponentsContextType | null>;
55
57
  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'\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}\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":";AAwDO,MAAMA,IAAoBC,EAA4C,IAAI,GAEpEC,IAAsB,MAAM;AACvC,QAAMC,IAAUC,EAAWJ,CAAiB;AAC5C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,8DAA8D;AAEhF,SAAOA;AACT;"}
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":";AA0DO,MAAMA,IAAoBC,EAA4C,IAAI,GAEpEC,IAAsB,MAAM;AACvC,QAAMC,IAAUC,EAAWJ,CAAiB;AAC5C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,8DAA8D;AAEhF,SAAOA;AACT;"}
@@ -7,18 +7,21 @@ import { createComponents as C } from "../ComponentAdapter/createComponentsWithD
7
7
  import { ApiProvider as I } from "../ApiProvider/ApiProvider.js";
8
8
  import { LoadingIndicatorProvider as x } from "../LoadingIndicatorProvider/LoadingIndicatorProvider.js";
9
9
  import { SDKI18next as t } from "./SDKI18next.js";
10
+ import "classnames";
11
+ import "../../shared/constants.js";
10
12
  import { InternalError as y } from "../../components/Common/InternalError/InternalError.js";
11
13
  import { LocaleProvider as L } from "../LocaleProvider/LocaleProvider.js";
14
+ import "../LocaleProvider/useLocale.js";
12
15
  import { ThemeProvider as U } from "../ThemeProvider/ThemeProvider.js";
13
- const R = (a) => {
16
+ const z = (a) => {
14
17
  const {
15
18
  children: c,
16
19
  config: e,
17
20
  dictionary: o,
18
21
  lng: n = "en",
19
22
  locale: d = "en-US",
20
- currency: l = "USD",
21
- theme: p,
23
+ currency: p = "USD",
24
+ theme: l,
22
25
  components: s,
23
26
  LoaderComponent: f
24
27
  } = a;
@@ -36,9 +39,9 @@ const R = (a) => {
36
39
  }
37
40
  return g(() => {
38
41
  (async () => await t.changeLanguage(n))();
39
- }, [n]), /* @__PURE__ */ r(P, { value: C(s), children: /* @__PURE__ */ r(x, { value: f, children: /* @__PURE__ */ r(h, { FallbackComponent: y, children: /* @__PURE__ */ r(U, { theme: p, children: /* @__PURE__ */ r(L, { locale: d, currency: l, children: /* @__PURE__ */ r(v, { i18n: t, children: /* @__PURE__ */ r(I, { url: e.baseUrl, headers: e.headers, hooks: e.hooks, children: c }) }, n) }) }) }) }) });
42
+ }, [n]), /* @__PURE__ */ r(P, { value: C(s), children: /* @__PURE__ */ r(x, { value: f, children: /* @__PURE__ */ r(h, { FallbackComponent: y, children: /* @__PURE__ */ r(U, { theme: l, children: /* @__PURE__ */ r(L, { locale: d, currency: p, children: /* @__PURE__ */ r(v, { i18n: t, children: /* @__PURE__ */ r(I, { url: e.baseUrl, headers: e.headers, hooks: e.hooks, children: c }) }, n) }) }) }) }) });
40
43
  };
41
44
  export {
42
- R as GustoProviderCustomUIAdapter
45
+ z as GustoProviderCustomUIAdapter
43
46
  };
44
47
  //# sourceMappingURL=GustoProviderCustomUIAdapter.js.map
@@ -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 { createComponents } from '../ComponentAdapter/createComponentsWithDefaults'\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={createComponents(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} hooks={config.hooks}>\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","createComponents","LoadingIndicatorProvider","jsx","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;AA4CA,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,EAAA,IACET;AAGJ,MAAIG;AACF,eAAWO,KAAYP,GAAY;AACjC,YAAMQ,IAAOD;AACb,iBAAWE,KAAMT,EAAWQ,CAAI;AAE9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCT,EAAWQ,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAIF,SAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeT,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC,qBAGLW,GAAA,EAAmB,OAAOC,EAAiBR,CAAU,GACpD,4BAACS,GAAA,EAAyB,OAAOR,GAC/B,UAAA,gBAAAS,EAACC,GAAA,EAAc,mBAAmBC,GAChC,UAAA,gBAAAF,EAACG,KAAc,OAAAd,GACb,UAAA,gBAAAW,EAACI,KAAe,QAAAjB,GAAgB,UAAAC,GAC9B,4BAACiB,GAAA,EAAgB,MAAMV,GACrB,UAAA,gBAAAK,EAACM,GAAA,EAAY,KAAKtB,EAAO,SAAS,SAASA,EAAO,SAAS,OAAOA,EAAO,OACtE,UAAAD,GACH,EAAA,GAHsCG,CAIxC,GACF,EAAA,CACF,GACF,GACF,EAAA,CACF;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 { createComponents } from '../ComponentAdapter/createComponentsWithDefaults'\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={createComponents(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} hooks={config.hooks}>\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","createComponents","LoadingIndicatorProvider","jsx","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider"],"mappings":";;;;;;;;;;;;;;;AA4CA,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,EAAA,IACET;AAGJ,MAAIG;AACF,eAAWO,KAAYP,GAAY;AACjC,YAAMQ,IAAOD;AACb,iBAAWE,KAAMT,EAAWQ,CAAI;AAE9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCT,EAAWQ,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAIF,SAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeT,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC,qBAGLW,GAAA,EAAmB,OAAOC,EAAiBR,CAAU,GACpD,4BAACS,GAAA,EAAyB,OAAOR,GAC/B,UAAA,gBAAAS,EAACC,GAAA,EAAc,mBAAmBC,GAChC,UAAA,gBAAAF,EAACG,KAAc,OAAAd,GACb,UAAA,gBAAAW,EAACI,KAAe,QAAAjB,GAAgB,UAAAC,GAC9B,4BAACiB,GAAA,EAAgB,MAAMV,GACrB,UAAA,gBAAAK,EAACM,GAAA,EAAY,KAAKtB,EAAO,SAAS,SAASA,EAAO,SAAS,OAAOA,EAAO,OACtE,UAAAD,GACH,EAAA,GAHsCG,CAIxC,GACF,EAAA,CACF,GACF,GACF,EAAA,CACF;AAEJ;"}
@@ -1,3 +1,4 @@
1
+ export declare const transitionDuration = 200;
1
2
  declare const defaultThemeColors: {
2
3
  colorBody: string;
3
4
  colorBodyAccent: string;
@@ -39,10 +40,12 @@ export declare const createTheme: (colors?: GustoSDKThemeColors) => {
39
40
  inputErrorColor: string | undefined;
40
41
  inputRadius: string;
41
42
  buttonRadius: string;
43
+ cardRadius: string;
42
44
  badgeRadius: string;
43
45
  fontSizeRoot: string;
44
46
  fontFamily: string;
45
47
  fontLineHeight: string;
48
+ fontSizeExtraSmall: string;
46
49
  fontSizeSmall: string;
47
50
  fontSizeRegular: string;
48
51
  fontSizeLarge: string;
@@ -5,7 +5,7 @@ const o = {
5
5
  300: "#F4F4F3",
6
6
  400: "#EAEAEA",
7
7
  500: "#DCDCDC",
8
- 800: "#6C6C72",
8
+ 800: "#414651",
9
9
  900: "#525257",
10
10
  1e3: "#1C1C1C"
11
11
  },
@@ -29,7 +29,7 @@ const o = {
29
29
  500: "#DCDCDC",
30
30
  800: "#1C1C1C"
31
31
  }
32
- }, i = {
32
+ }, u = 200, i = {
33
33
  colorBody: o.neutral[100],
34
34
  colorBodyAccent: o.neutral[300],
35
35
  colorBodyContent: o.neutral[1e3],
@@ -53,7 +53,7 @@ const o = {
53
53
  colorSuccessAccent: o.success[500],
54
54
  colorSuccessContent: o.success[800],
55
55
  colorBorder: o.neutral[400]
56
- }, u = (r = {}) => ({
56
+ }, d = (r = {}) => ({
57
57
  // Colors
58
58
  ...i,
59
59
  ...r,
@@ -74,11 +74,13 @@ const o = {
74
74
  // Radius
75
75
  inputRadius: n(8),
76
76
  buttonRadius: n(8),
77
+ cardRadius: n(8),
77
78
  badgeRadius: n(16),
78
79
  // Font
79
80
  fontSizeRoot: a(),
80
81
  fontFamily: "Geist",
81
82
  fontLineHeight: n(24),
83
+ fontSizeExtraSmall: n(12),
82
84
  fontSizeSmall: n(14),
83
85
  fontSizeRegular: n(16),
84
86
  fontSizeLarge: n(18),
@@ -93,25 +95,26 @@ const o = {
93
95
  fontWeightSemibold: "600",
94
96
  fontWeightBold: "700",
95
97
  // Transitions
96
- transitionDuration: "200ms",
98
+ transitionDuration: `${u}ms`,
97
99
  // Shadows
98
100
  shadowResting: "0px 1px 2px 0px rgba(10, 13, 18, 0.05)",
99
101
  shadowTopmost: "0px 4px 6px 0px rgba(28, 28, 28, 0.05), 0px 10px 15px 0px rgba(28, 28, 28, 0.10)",
100
102
  // Focus
101
103
  focusRingColor: r.colorPrimary,
102
104
  focusRingWidth: "2px"
103
- }), s = (r) => {
105
+ }), g = (r) => {
104
106
  const c = Object.entries(i).reduce(
105
- (e, [t, l]) => (e[t] = r[t] || l, e),
107
+ (t, [e, l]) => (t[e] = r[e] || l, t),
106
108
  {}
107
109
  );
108
110
  return {
109
- ...u(c),
111
+ ...d(c),
110
112
  ...r
111
113
  };
112
114
  };
113
115
  export {
114
- u as createTheme,
115
- s as mergePartnerTheme
116
+ d as createTheme,
117
+ g as mergePartnerTheme,
118
+ u as transitionDuration
116
119
  };
117
120
  //# sourceMappingURL=theme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","sources":["../../../src/contexts/ThemeProvider/theme.ts"],"sourcesContent":["import { getRootFontSize, toRem } from '@/helpers/rem'\n\n// Colors are for internal use in our theme currently\n// We don't export them for partner use or overrides\nconst baseColors = {\n neutral: {\n 100: '#FFFFFF',\n 200: '#FBFAFA',\n 300: '#F4F4F3',\n 400: '#EAEAEA',\n 500: '#DCDCDC',\n 600: '#BABABC',\n 700: '#919197',\n 800: '#6C6C72',\n 900: '#525257',\n 1000: '#1C1C1C',\n },\n error: {\n 100: '#FEF3F2',\n 500: '#C5271C',\n 800: '#D92D20',\n },\n warning: {\n 100: '#FFFAF2',\n 500: '#E9B550',\n 700: '#B88023',\n 800: '#B88023',\n },\n success: {\n 100: '#F3FAFB',\n 400: '#2BABAD',\n 500: '#0A8080',\n 800: '#005961',\n },\n info: {\n 100: '#F4F4F3',\n 500: '#DCDCDC',\n 800: '#1C1C1C',\n },\n}\n\nconst defaultThemeColors = {\n colorBody: baseColors.neutral[100],\n colorBodyAccent: baseColors.neutral[300],\n colorBodyContent: baseColors.neutral[1000],\n colorBodySubContent: baseColors.neutral[800],\n colorPrimary: baseColors.neutral[1000],\n colorPrimaryAccent: baseColors.neutral[900],\n colorPrimaryContent: baseColors.neutral[100],\n colorSecondary: baseColors.neutral[100],\n colorSecondaryAccent: baseColors.neutral[400],\n colorSecondaryContent: baseColors.neutral[1000],\n colorInfo: baseColors.info[100],\n colorInfoAccent: baseColors.info[500],\n colorInfoContent: baseColors.info[800],\n colorWarning: baseColors.warning[100],\n colorWarningAccent: baseColors.warning[500],\n colorWarningContent: baseColors.warning[800],\n colorError: baseColors.error[100],\n colorErrorAccent: baseColors.error[500],\n colorErrorContent: baseColors.error[800],\n colorSuccess: baseColors.success[100],\n colorSuccessAccent: baseColors.success[500],\n colorSuccessContent: baseColors.success[800],\n colorBorder: baseColors.neutral[400],\n}\n\nexport type GustoSDKThemeColors = Partial<typeof defaultThemeColors>\n\nexport const createTheme = (colors: GustoSDKThemeColors = {}) => {\n return {\n // Colors\n ...defaultThemeColors,\n ...colors,\n // Input Colors\n inputBackgroundColor: colors.colorBody,\n inputBorderColor: baseColors.neutral[500],\n inputContentColor: colors.colorBodyContent,\n inputBorderWidth: '1px',\n inputPlaceholderColor: colors.colorBodySubContent,\n inputAdornmentColor: colors.colorBodySubContent,\n inputDisabledBackgroundColor: colors.colorBodyAccent,\n // Field Colors\n inputLabelColor: colors.colorBodyContent,\n inputLabelFontSize: toRem(16),\n inputLabelFontWeight: '500',\n inputDescriptionColor: colors.colorBodySubContent,\n inputErrorColor: colors.colorErrorAccent,\n // Radius\n inputRadius: toRem(8),\n buttonRadius: toRem(8),\n badgeRadius: toRem(16),\n // Font\n fontSizeRoot: getRootFontSize(),\n fontFamily: 'Geist',\n fontLineHeight: toRem(24),\n fontSizeSmall: toRem(14),\n fontSizeRegular: toRem(16),\n fontSizeLarge: toRem(18),\n fontSizeHeading1: toRem(32),\n fontSizeHeading2: toRem(24),\n fontSizeHeading3: toRem(20),\n fontSizeHeading4: toRem(18),\n fontSizeHeading5: toRem(16),\n fontSizeHeading6: toRem(14),\n fontWeightRegular: '400',\n fontWeightMedium: '500',\n fontWeightSemibold: '600',\n fontWeightBold: '700',\n // Transitions\n transitionDuration: '200ms',\n // Shadows\n shadowResting: '0px 1px 2px 0px rgba(10, 13, 18, 0.05)',\n shadowTopmost:\n '0px 4px 6px 0px rgba(28, 28, 28, 0.05), 0px 10px 15px 0px rgba(28, 28, 28, 0.10)',\n // Focus\n focusRingColor: colors.colorPrimary,\n focusRingWidth: '2px',\n }\n}\n\nexport type GustoSDKTheme = Partial<ReturnType<typeof createTheme>>\n\nexport const mergePartnerTheme = (partnerTheme: GustoSDKTheme): GustoSDKTheme => {\n const colors = Object.entries(defaultThemeColors).reduce(\n (acc: GustoSDKThemeColors, [key, value]) => {\n acc[key as keyof typeof defaultThemeColors] =\n partnerTheme[key as keyof typeof defaultThemeColors] || value\n return acc\n },\n {},\n )\n\n const theme = createTheme(colors)\n\n return {\n ...theme,\n ...partnerTheme,\n }\n}\n"],"names":["baseColors","defaultThemeColors","createTheme","colors","toRem","getRootFontSize","mergePartnerTheme","partnerTheme","acc","key","value"],"mappings":";AAIA,MAAMA,IAAa;AAAA,EACjB,SAAS;AAAA,IACP,KAAK;AAAA,IAEL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IAGL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAM;AAAA,EAAA;AAAA,EAER,OAAO;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP,SAAS;AAAA,IACP,KAAK;AAAA,IACL,KAAK;AAAA,IAEL,KAAK;AAAA,EAAA;AAAA,EAEP,SAAS;AAAA,IACP,KAAK;AAAA,IAEL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP,MAAM;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAET,GAEMC,IAAqB;AAAA,EACzB,WAAWD,EAAW,QAAQ,GAAG;AAAA,EACjC,iBAAiBA,EAAW,QAAQ,GAAG;AAAA,EACvC,kBAAkBA,EAAW,QAAQ,GAAI;AAAA,EACzC,qBAAqBA,EAAW,QAAQ,GAAG;AAAA,EAC3C,cAAcA,EAAW,QAAQ,GAAI;AAAA,EACrC,oBAAoBA,EAAW,QAAQ,GAAG;AAAA,EAC1C,qBAAqBA,EAAW,QAAQ,GAAG;AAAA,EAC3C,gBAAgBA,EAAW,QAAQ,GAAG;AAAA,EACtC,sBAAsBA,EAAW,QAAQ,GAAG;AAAA,EAC5C,uBAAuBA,EAAW,QAAQ,GAAI;AAAA,EAC9C,WAAWA,EAAW,KAAK,GAAG;AAAA,EAC9B,iBAAiBA,EAAW,KAAK,GAAG;AAAA,EACpC,kBAAkBA,EAAW,KAAK,GAAG;AAAA,EACrC,cAAcA,EAAW,QAAQ,GAAG;AAAA,EACpC,oBAAoBA,EAAW,QAAQ,GAAG;AAAA,EAC1C,qBAAqBA,EAAW,QAAQ,GAAG;AAAA,EAC3C,YAAYA,EAAW,MAAM,GAAG;AAAA,EAChC,kBAAkBA,EAAW,MAAM,GAAG;AAAA,EACtC,mBAAmBA,EAAW,MAAM,GAAG;AAAA,EACvC,cAAcA,EAAW,QAAQ,GAAG;AAAA,EACpC,oBAAoBA,EAAW,QAAQ,GAAG;AAAA,EAC1C,qBAAqBA,EAAW,QAAQ,GAAG;AAAA,EAC3C,aAAaA,EAAW,QAAQ,GAAG;AACrC,GAIaE,IAAc,CAACC,IAA8B,QACjD;AAAA;AAAA,EAEL,GAAGF;AAAA,EACH,GAAGE;AAAA;AAAA,EAEH,sBAAsBA,EAAO;AAAA,EAC7B,kBAAkBH,EAAW,QAAQ,GAAG;AAAA,EACxC,mBAAmBG,EAAO;AAAA,EAC1B,kBAAkB;AAAA,EAClB,uBAAuBA,EAAO;AAAA,EAC9B,qBAAqBA,EAAO;AAAA,EAC5B,8BAA8BA,EAAO;AAAA;AAAA,EAErC,iBAAiBA,EAAO;AAAA,EACxB,oBAAoBC,EAAM,EAAE;AAAA,EAC5B,sBAAsB;AAAA,EACtB,uBAAuBD,EAAO;AAAA,EAC9B,iBAAiBA,EAAO;AAAA;AAAA,EAExB,aAAaC,EAAM,CAAC;AAAA,EACpB,cAAcA,EAAM,CAAC;AAAA,EACrB,aAAaA,EAAM,EAAE;AAAA;AAAA,EAErB,cAAcC,EAAA;AAAA,EACd,YAAY;AAAA,EACZ,gBAAgBD,EAAM,EAAE;AAAA,EACxB,eAAeA,EAAM,EAAE;AAAA,EACvB,iBAAiBA,EAAM,EAAE;AAAA,EACzB,eAAeA,EAAM,EAAE;AAAA,EACvB,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,gBAAgB;AAAA;AAAA,EAEhB,oBAAoB;AAAA;AAAA,EAEpB,eAAe;AAAA,EACf,eACE;AAAA;AAAA,EAEF,gBAAgBD,EAAO;AAAA,EACvB,gBAAgB;AAAA,IAMPG,IAAoB,CAACC,MAA+C;AAC/E,QAAMJ,IAAS,OAAO,QAAQF,CAAkB,EAAE;AAAA,IAChD,CAACO,GAA0B,CAACC,GAAKC,CAAK,OACpCF,EAAIC,CAAsC,IACxCF,EAAaE,CAAsC,KAAKC,GACnDF;AAAA,IAET,CAAA;AAAA,EAAC;AAKH,SAAO;AAAA,IACL,GAHYN,EAAYC,CAAM;AAAA,IAI9B,GAAGI;AAAA,EAAA;AAEP;"}
1
+ {"version":3,"file":"theme.js","sources":["../../../src/contexts/ThemeProvider/theme.ts"],"sourcesContent":["import { getRootFontSize, toRem } from '@/helpers/rem'\n\n// Colors are for internal use in our theme currently\n// We don't export them for partner use or overrides\nconst baseColors = {\n neutral: {\n 100: '#FFFFFF',\n 200: '#FBFAFA',\n 300: '#F4F4F3',\n 400: '#EAEAEA',\n 500: '#DCDCDC',\n 600: '#BABABC',\n 700: '#919197',\n 800: '#414651',\n 900: '#525257',\n 1000: '#1C1C1C',\n },\n error: {\n 100: '#FEF3F2',\n 500: '#C5271C',\n 800: '#D92D20',\n },\n warning: {\n 100: '#FFFAF2',\n 500: '#E9B550',\n 700: '#B88023',\n 800: '#B88023',\n },\n success: {\n 100: '#F3FAFB',\n 400: '#2BABAD',\n 500: '#0A8080',\n 800: '#005961',\n },\n info: {\n 100: '#F4F4F3',\n 500: '#DCDCDC',\n 800: '#1C1C1C',\n },\n}\n\nexport const transitionDuration = 200\n\nconst defaultThemeColors = {\n colorBody: baseColors.neutral[100],\n colorBodyAccent: baseColors.neutral[300],\n colorBodyContent: baseColors.neutral[1000],\n colorBodySubContent: baseColors.neutral[800],\n colorPrimary: baseColors.neutral[1000],\n colorPrimaryAccent: baseColors.neutral[900],\n colorPrimaryContent: baseColors.neutral[100],\n colorSecondary: baseColors.neutral[100],\n colorSecondaryAccent: baseColors.neutral[400],\n colorSecondaryContent: baseColors.neutral[1000],\n colorInfo: baseColors.info[100],\n colorInfoAccent: baseColors.info[500],\n colorInfoContent: baseColors.info[800],\n colorWarning: baseColors.warning[100],\n colorWarningAccent: baseColors.warning[500],\n colorWarningContent: baseColors.warning[800],\n colorError: baseColors.error[100],\n colorErrorAccent: baseColors.error[500],\n colorErrorContent: baseColors.error[800],\n colorSuccess: baseColors.success[100],\n colorSuccessAccent: baseColors.success[500],\n colorSuccessContent: baseColors.success[800],\n colorBorder: baseColors.neutral[400],\n}\n\nexport type GustoSDKThemeColors = Partial<typeof defaultThemeColors>\n\nexport const createTheme = (colors: GustoSDKThemeColors = {}) => {\n return {\n // Colors\n ...defaultThemeColors,\n ...colors,\n // Input Colors\n inputBackgroundColor: colors.colorBody,\n inputBorderColor: baseColors.neutral[500],\n inputContentColor: colors.colorBodyContent,\n inputBorderWidth: '1px',\n inputPlaceholderColor: colors.colorBodySubContent,\n inputAdornmentColor: colors.colorBodySubContent,\n inputDisabledBackgroundColor: colors.colorBodyAccent,\n // Field Colors\n inputLabelColor: colors.colorBodyContent,\n inputLabelFontSize: toRem(16),\n inputLabelFontWeight: '500',\n inputDescriptionColor: colors.colorBodySubContent,\n inputErrorColor: colors.colorErrorAccent,\n // Radius\n inputRadius: toRem(8),\n buttonRadius: toRem(8),\n cardRadius: toRem(8),\n badgeRadius: toRem(16),\n // Font\n fontSizeRoot: getRootFontSize(),\n fontFamily: 'Geist',\n fontLineHeight: toRem(24),\n fontSizeExtraSmall: toRem(12),\n fontSizeSmall: toRem(14),\n fontSizeRegular: toRem(16),\n fontSizeLarge: toRem(18),\n fontSizeHeading1: toRem(32),\n fontSizeHeading2: toRem(24),\n fontSizeHeading3: toRem(20),\n fontSizeHeading4: toRem(18),\n fontSizeHeading5: toRem(16),\n fontSizeHeading6: toRem(14),\n fontWeightRegular: '400',\n fontWeightMedium: '500',\n fontWeightSemibold: '600',\n fontWeightBold: '700',\n // Transitions\n transitionDuration: `${transitionDuration}ms`,\n // Shadows\n shadowResting: '0px 1px 2px 0px rgba(10, 13, 18, 0.05)',\n shadowTopmost:\n '0px 4px 6px 0px rgba(28, 28, 28, 0.05), 0px 10px 15px 0px rgba(28, 28, 28, 0.10)',\n // Focus\n focusRingColor: colors.colorPrimary,\n focusRingWidth: '2px',\n }\n}\n\nexport type GustoSDKTheme = Partial<ReturnType<typeof createTheme>>\n\nexport const mergePartnerTheme = (partnerTheme: GustoSDKTheme): GustoSDKTheme => {\n const colors = Object.entries(defaultThemeColors).reduce(\n (acc: GustoSDKThemeColors, [key, value]) => {\n acc[key as keyof typeof defaultThemeColors] =\n partnerTheme[key as keyof typeof defaultThemeColors] || value\n return acc\n },\n {},\n )\n\n const theme = createTheme(colors)\n\n return {\n ...theme,\n ...partnerTheme,\n }\n}\n"],"names":["baseColors","transitionDuration","defaultThemeColors","createTheme","colors","toRem","getRootFontSize","mergePartnerTheme","partnerTheme","acc","key","value"],"mappings":";AAIA,MAAMA,IAAa;AAAA,EACjB,SAAS;AAAA,IACP,KAAK;AAAA,IAEL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IAGL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAM;AAAA,EAAA;AAAA,EAER,OAAO;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP,SAAS;AAAA,IACP,KAAK;AAAA,IACL,KAAK;AAAA,IAEL,KAAK;AAAA,EAAA;AAAA,EAEP,SAAS;AAAA,IACP,KAAK;AAAA,IAEL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAAA,EAEP,MAAM;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EAAA;AAET,GAEaC,IAAqB,KAE5BC,IAAqB;AAAA,EACzB,WAAWF,EAAW,QAAQ,GAAG;AAAA,EACjC,iBAAiBA,EAAW,QAAQ,GAAG;AAAA,EACvC,kBAAkBA,EAAW,QAAQ,GAAI;AAAA,EACzC,qBAAqBA,EAAW,QAAQ,GAAG;AAAA,EAC3C,cAAcA,EAAW,QAAQ,GAAI;AAAA,EACrC,oBAAoBA,EAAW,QAAQ,GAAG;AAAA,EAC1C,qBAAqBA,EAAW,QAAQ,GAAG;AAAA,EAC3C,gBAAgBA,EAAW,QAAQ,GAAG;AAAA,EACtC,sBAAsBA,EAAW,QAAQ,GAAG;AAAA,EAC5C,uBAAuBA,EAAW,QAAQ,GAAI;AAAA,EAC9C,WAAWA,EAAW,KAAK,GAAG;AAAA,EAC9B,iBAAiBA,EAAW,KAAK,GAAG;AAAA,EACpC,kBAAkBA,EAAW,KAAK,GAAG;AAAA,EACrC,cAAcA,EAAW,QAAQ,GAAG;AAAA,EACpC,oBAAoBA,EAAW,QAAQ,GAAG;AAAA,EAC1C,qBAAqBA,EAAW,QAAQ,GAAG;AAAA,EAC3C,YAAYA,EAAW,MAAM,GAAG;AAAA,EAChC,kBAAkBA,EAAW,MAAM,GAAG;AAAA,EACtC,mBAAmBA,EAAW,MAAM,GAAG;AAAA,EACvC,cAAcA,EAAW,QAAQ,GAAG;AAAA,EACpC,oBAAoBA,EAAW,QAAQ,GAAG;AAAA,EAC1C,qBAAqBA,EAAW,QAAQ,GAAG;AAAA,EAC3C,aAAaA,EAAW,QAAQ,GAAG;AACrC,GAIaG,IAAc,CAACC,IAA8B,QACjD;AAAA;AAAA,EAEL,GAAGF;AAAA,EACH,GAAGE;AAAA;AAAA,EAEH,sBAAsBA,EAAO;AAAA,EAC7B,kBAAkBJ,EAAW,QAAQ,GAAG;AAAA,EACxC,mBAAmBI,EAAO;AAAA,EAC1B,kBAAkB;AAAA,EAClB,uBAAuBA,EAAO;AAAA,EAC9B,qBAAqBA,EAAO;AAAA,EAC5B,8BAA8BA,EAAO;AAAA;AAAA,EAErC,iBAAiBA,EAAO;AAAA,EACxB,oBAAoBC,EAAM,EAAE;AAAA,EAC5B,sBAAsB;AAAA,EACtB,uBAAuBD,EAAO;AAAA,EAC9B,iBAAiBA,EAAO;AAAA;AAAA,EAExB,aAAaC,EAAM,CAAC;AAAA,EACpB,cAAcA,EAAM,CAAC;AAAA,EACrB,YAAYA,EAAM,CAAC;AAAA,EACnB,aAAaA,EAAM,EAAE;AAAA;AAAA,EAErB,cAAcC,EAAA;AAAA,EACd,YAAY;AAAA,EACZ,gBAAgBD,EAAM,EAAE;AAAA,EACxB,oBAAoBA,EAAM,EAAE;AAAA,EAC5B,eAAeA,EAAM,EAAE;AAAA,EACvB,iBAAiBA,EAAM,EAAE;AAAA,EACzB,eAAeA,EAAM,EAAE;AAAA,EACvB,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,kBAAkBA,EAAM,EAAE;AAAA,EAC1B,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,gBAAgB;AAAA;AAAA,EAEhB,oBAAoB,GAAGJ,CAAkB;AAAA;AAAA,EAEzC,eAAe;AAAA,EACf,eACE;AAAA;AAAA,EAEF,gBAAgBG,EAAO;AAAA,EACvB,gBAAgB;AAAA,IAMPG,IAAoB,CAACC,MAA+C;AAC/E,QAAMJ,IAAS,OAAO,QAAQF,CAAkB,EAAE;AAAA,IAChD,CAACO,GAA0B,CAACC,GAAKC,CAAK,OACpCF,EAAIC,CAAsC,IACxCF,EAAaE,CAAsC,KAAKC,GACnDF;AAAA,IAET,CAAA;AAAA,EAAC;AAKH,SAAO;AAAA,IACL,GAHYN,EAAYC,CAAM;AAAA,IAI9B,GAAGI;AAAA,EAAA;AAEP;"}
@@ -1,19 +1,20 @@
1
1
  import m from "dompurify";
2
2
  import "react-i18next";
3
3
  import "react";
4
- const c = (t) => t.charAt(0).toLocaleUpperCase() + t.slice(1), l = ({
4
+ import "../contexts/LocaleProvider/useLocale.js";
5
+ const c = (t) => t.charAt(0).toLocaleUpperCase() + t.slice(1), h = ({
5
6
  first_name: t,
6
7
  last_name: e
7
8
  }) => `${t ? c(t) : ""}${e ? n(c(e)) : ""}`, n = (t) => t ? ` ${t}` : "", i = (t) => {
8
9
  const e = n(t.street1), r = n(t.street2);
9
10
  return `${e},${r}`;
10
- }, u = (t) => `${n(t.city)}, ${n(t.state)} ${n(t.zip)}`, h = (t) => `${i(t)} ${u(t)}`, p = (t, e) => e ? `${t}%` : `$${t}`, s = (t, e = "en-US") => {
11
+ }, u = (t) => `${n(t.city)}, ${n(t.state)} ${n(t.zip)}`, C = (t) => `${i(t)} ${u(t)}`, p = (t, e) => e ? `${t}%` : `$${t}`, s = (t, e = "en-US") => {
11
12
  const r = t.toLocaleString(e, {
12
13
  minimumFractionDigits: 2,
13
14
  maximumFractionDigits: 2
14
15
  });
15
16
  return p(r, !1);
16
- }, C = ({
17
+ }, S = ({
17
18
  rate: t,
18
19
  paymentUnit: e,
19
20
  t: r,
@@ -41,20 +42,20 @@ const c = (t) => t.charAt(0).toLocaleUpperCase() + t.slice(1), l = ({
41
42
  return o;
42
43
  }
43
44
  }, y = { ALLOWED_TAGS: ["a", "b", "strong"], ALLOWED_ATTR: ["href", "target"] };
44
- function S(t) {
45
+ function D(t) {
45
46
  return t ? { __html: m.sanitize(t, y) } : { __html: "" };
46
47
  }
47
- const D = (t) => t.replace(/\D/g, ""), F = (t) => t.replace(/_([a-z])/g, (e, r) => r.toUpperCase());
48
+ const F = (t) => t.replace(/\D/g, ""), L = (t) => t.replace(/_([a-z])/g, (e, r) => r.toUpperCase());
48
49
  export {
49
- h as addressInline,
50
+ C as addressInline,
50
51
  p as amountStr,
51
- S as createMarkup,
52
- l as firstLastName,
52
+ D as createMarkup,
53
+ h as firstLastName,
53
54
  s as formatNumberAsCurrency,
54
- C as formatPayRate,
55
+ S as formatPayRate,
55
56
  u as getCityStateZip,
56
57
  i as getStreet,
57
- D as removeNonDigits,
58
- F as snakeCaseToCamelCase
58
+ F as removeNonDigits,
59
+ L as snakeCaseToCamelCase
59
60
  };
60
61
  //# sourceMappingURL=formattedStrings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formattedStrings.js","sources":["../../src/helpers/formattedStrings.ts"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { type TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport { useCallback } from 'react'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\n\nconst capitalize = (word: string) => word.charAt(0).toLocaleUpperCase() + word.slice(1)\n\nexport const firstLastName = ({\n first_name,\n last_name,\n}: {\n first_name?: string | null\n last_name?: string | null\n}) =>\n `${first_name ? capitalize(first_name) : ''}${last_name ? maybeString(capitalize(last_name)) : ''}`\n\nconst maybeString = (str: string | null | undefined) => {\n return str ? ` ${str}` : ''\n}\n\nexport const getStreet = (address: EmployeeAddress | Location) => {\n const street1 = maybeString(address.street1)\n const street2 = maybeString(address.street2)\n\n return `${street1},${street2}`\n}\n\nexport const getCityStateZip = (address: EmployeeAddress | Location) =>\n `${maybeString(address.city)}, ${maybeString(address.state)} ${maybeString(address.zip)}`\n\nexport const addressInline = (address: EmployeeAddress | Location) =>\n `${getStreet(address)} ${getCityStateZip(address)}`\n\nexport const currentDateString = () => {\n const d = new Date()\n const dateString = `${String(d.getFullYear())}-${('0' + String(d.getMonth() + 1)).slice(-2)}-${('0' + String(d.getDate())).slice(-2)}`\n return dateString\n}\n\nexport function isNumberKey({ which, keyCode }: KeyboardEvent) {\n const charCode = which ? which : keyCode\n if (charCode > 31 && charCode != 46 && (charCode < 48 || charCode > 57)) return false\n return true\n}\n\nexport const booleanToString = (value: boolean) => (value ? 'true' : 'false')\n\nexport const amountStr = (amount: string, isPercentage: boolean) =>\n isPercentage ? `${amount}%` : `$${amount}`\n\nexport const formatNumberAsCurrency = (amount: number, locale: string = 'en-US') => {\n const formattedNumber = amount.toLocaleString(locale, {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n })\n return amountStr(formattedNumber, false)\n}\n\nexport const formatPayRate = ({\n rate,\n paymentUnit,\n t,\n locale = 'en-US',\n}: {\n rate: number\n paymentUnit: string\n t: TFunction\n locale?: string\n}) => {\n const amount = formatNumberAsCurrency(rate, locale)\n\n switch (paymentUnit) {\n case 'Hour':\n return t('payRateFormats.hourly', { amount, ns: 'common' })\n case 'Week':\n return t('payRateFormats.weekly', {\n amount: formatNumberAsCurrency(rate * 52, locale),\n ns: 'common',\n })\n case 'Month':\n return t('payRateFormats.monthly', {\n amount: formatNumberAsCurrency(rate * 12, locale),\n ns: 'common',\n })\n case 'Year':\n return t('payRateFormats.yearly', { amount, ns: 'common' })\n case 'Paycheck':\n return t('payRateFormats.paycheck', { amount, ns: 'common' })\n default:\n return amount\n }\n}\n\nexport const useFormatPayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (rate: number, paymentUnit: string) => {\n return formatPayRate({ rate, paymentUnit, t, locale })\n },\n [t, locale],\n )\n}\n\nconst dompurifyConfig = { ALLOWED_TAGS: ['a', 'b', 'strong'], ALLOWED_ATTR: ['href', 'target'] }\nexport function createMarkup(dirty: string) {\n if (!dirty) return { __html: '' }\n return { __html: DOMPurify.sanitize(dirty, dompurifyConfig) }\n}\n\nexport const removeNonDigits = (value: string): string => {\n return value.replace(/\\D/g, '')\n}\n\nexport const snakeCaseToCamelCase = (s: string) => {\n return s.replace(/_([a-z])/g, (_: string, char: string) => char.toUpperCase())\n}\n\nexport const camelCaseToSnakeCase = (s: string) => {\n return s\n .replace(\n /([a-z0-9])([A-Z])/g,\n (_: string, group1: string, group2: string) => `${group1}_${group2.toLowerCase()}`,\n )\n .replace(\n /([A-Z])([A-Z])(?=[a-z])/g,\n (_: string, group1: string, group2: string) =>\n `${group1.toLowerCase()}_${group2.toLowerCase()}`,\n )\n .toLowerCase()\n}\n"],"names":["capitalize","word","firstLastName","first_name","last_name","maybeString","str","getStreet","address","street1","street2","getCityStateZip","addressInline","amountStr","amount","isPercentage","formatNumberAsCurrency","locale","formattedNumber","formatPayRate","rate","paymentUnit","t","dompurifyConfig","createMarkup","dirty","DOMPurify","removeNonDigits","value","snakeCaseToCamelCase","s","_","char"],"mappings":";;;AAQA,MAAMA,IAAa,CAACC,MAAiBA,EAAK,OAAO,CAAC,EAAE,sBAAsBA,EAAK,MAAM,CAAC,GAEzEC,IAAgB,CAAC;AAAA,EAC5B,YAAAC;AAAA,EACA,WAAAC;AACF,MAIE,GAAGD,IAAaH,EAAWG,CAAU,IAAI,EAAE,GAAGC,IAAYC,EAAYL,EAAWI,CAAS,CAAC,IAAI,EAAE,IAE7FC,IAAc,CAACC,MACZA,IAAM,IAAIA,CAAG,KAAK,IAGdC,IAAY,CAACC,MAAwC;AAChE,QAAMC,IAAUJ,EAAYG,EAAQ,OAAO,GACrCE,IAAUL,EAAYG,EAAQ,OAAO;AAE3C,SAAO,GAAGC,CAAO,IAAIC,CAAO;AAC9B,GAEaC,IAAkB,CAACH,MAC9B,GAAGH,EAAYG,EAAQ,IAAI,CAAC,KAAKH,EAAYG,EAAQ,KAAK,CAAC,IAAIH,EAAYG,EAAQ,GAAG,CAAC,IAE5EI,IAAgB,CAACJ,MAC5B,GAAGD,EAAUC,CAAO,CAAC,IAAIG,EAAgBH,CAAO,CAAC,IAgBtCK,IAAY,CAACC,GAAgBC,MACxCA,IAAe,GAAGD,CAAM,MAAM,IAAIA,CAAM,IAE7BE,IAAyB,CAACF,GAAgBG,IAAiB,YAAY;AAClF,QAAMC,IAAkBJ,EAAO,eAAeG,GAAQ;AAAA,IACpD,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,EAAA,CACxB;AACD,SAAOJ,EAAUK,GAAiB,EAAK;AACzC,GAEaC,IAAgB,CAAC;AAAA,EAC5B,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,GAAAC;AAAA,EACA,QAAAL,IAAS;AACX,MAKM;AACJ,QAAMH,IAASE,EAAuBI,GAAMH,CAAM;AAElD,UAAQI,GAAA;AAAA,IACN,KAAK;AACH,aAAOC,EAAE,yBAAyB,EAAE,QAAAR,GAAQ,IAAI,UAAU;AAAA,IAC5D,KAAK;AACH,aAAOQ,EAAE,yBAAyB;AAAA,QAChC,QAAQN,EAAuBI,IAAO,IAAIH,CAAM;AAAA,QAChD,IAAI;AAAA,MAAA,CACL;AAAA,IACH,KAAK;AACH,aAAOK,EAAE,0BAA0B;AAAA,QACjC,QAAQN,EAAuBI,IAAO,IAAIH,CAAM;AAAA,QAChD,IAAI;AAAA,MAAA,CACL;AAAA,IACH,KAAK;AACH,aAAOK,EAAE,yBAAyB,EAAE,QAAAR,GAAQ,IAAI,UAAU;AAAA,IAC5D,KAAK;AACH,aAAOQ,EAAE,2BAA2B,EAAE,QAAAR,GAAQ,IAAI,UAAU;AAAA,IAC9D;AACE,aAAOA;AAAA,EAAA;AAEb,GAcMS,IAAkB,EAAE,cAAc,CAAC,KAAK,KAAK,QAAQ,GAAG,cAAc,CAAC,QAAQ,QAAQ,EAAA;AACtF,SAASC,EAAaC,GAAe;AAC1C,SAAKA,IACE,EAAE,QAAQC,EAAU,SAASD,GAAOF,CAAe,EAAA,IADvC,EAAE,QAAQ,GAAA;AAE/B;AAEO,MAAMI,IAAkB,CAACC,MACvBA,EAAM,QAAQ,OAAO,EAAE,GAGnBC,IAAuB,CAACC,MAC5BA,EAAE,QAAQ,aAAa,CAACC,GAAWC,MAAiBA,EAAK,aAAa;"}
1
+ {"version":3,"file":"formattedStrings.js","sources":["../../src/helpers/formattedStrings.ts"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { type TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport { useCallback } from 'react'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\n\nconst capitalize = (word: string) => word.charAt(0).toLocaleUpperCase() + word.slice(1)\n\nexport const firstLastName = ({\n first_name,\n last_name,\n}: {\n first_name?: string | null\n last_name?: string | null\n}) =>\n `${first_name ? capitalize(first_name) : ''}${last_name ? maybeString(capitalize(last_name)) : ''}`\n\nconst maybeString = (str: string | null | undefined) => {\n return str ? ` ${str}` : ''\n}\n\nexport const getStreet = (address: EmployeeAddress | Location) => {\n const street1 = maybeString(address.street1)\n const street2 = maybeString(address.street2)\n\n return `${street1},${street2}`\n}\n\nexport const getCityStateZip = (address: EmployeeAddress | Location) =>\n `${maybeString(address.city)}, ${maybeString(address.state)} ${maybeString(address.zip)}`\n\nexport const addressInline = (address: EmployeeAddress | Location) =>\n `${getStreet(address)} ${getCityStateZip(address)}`\n\nexport const currentDateString = () => {\n const d = new Date()\n const dateString = `${String(d.getFullYear())}-${('0' + String(d.getMonth() + 1)).slice(-2)}-${('0' + String(d.getDate())).slice(-2)}`\n return dateString\n}\n\nexport function isNumberKey({ which, keyCode }: KeyboardEvent) {\n const charCode = which ? which : keyCode\n if (charCode > 31 && charCode != 46 && (charCode < 48 || charCode > 57)) return false\n return true\n}\n\nexport const booleanToString = (value: boolean) => (value ? 'true' : 'false')\n\nexport const amountStr = (amount: string, isPercentage: boolean) =>\n isPercentage ? `${amount}%` : `$${amount}`\n\nexport const formatNumberAsCurrency = (amount: number, locale: string = 'en-US') => {\n const formattedNumber = amount.toLocaleString(locale, {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n })\n return amountStr(formattedNumber, false)\n}\n\nexport const formatPayRate = ({\n rate,\n paymentUnit,\n t,\n locale = 'en-US',\n}: {\n rate: number\n paymentUnit: string\n t: TFunction\n locale?: string\n}) => {\n const amount = formatNumberAsCurrency(rate, locale)\n\n switch (paymentUnit) {\n case 'Hour':\n return t('payRateFormats.hourly', { amount, ns: 'common' })\n case 'Week':\n return t('payRateFormats.weekly', {\n amount: formatNumberAsCurrency(rate * 52, locale),\n ns: 'common',\n })\n case 'Month':\n return t('payRateFormats.monthly', {\n amount: formatNumberAsCurrency(rate * 12, locale),\n ns: 'common',\n })\n case 'Year':\n return t('payRateFormats.yearly', { amount, ns: 'common' })\n case 'Paycheck':\n return t('payRateFormats.paycheck', { amount, ns: 'common' })\n default:\n return amount\n }\n}\n\nexport const useFormatPayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (rate: number, paymentUnit: string) => {\n return formatPayRate({ rate, paymentUnit, t, locale })\n },\n [t, locale],\n )\n}\n\nconst dompurifyConfig = { ALLOWED_TAGS: ['a', 'b', 'strong'], ALLOWED_ATTR: ['href', 'target'] }\nexport function createMarkup(dirty: string) {\n if (!dirty) return { __html: '' }\n return { __html: DOMPurify.sanitize(dirty, dompurifyConfig) }\n}\n\nexport const removeNonDigits = (value: string): string => {\n return value.replace(/\\D/g, '')\n}\n\nexport const snakeCaseToCamelCase = (s: string) => {\n return s.replace(/_([a-z])/g, (_: string, char: string) => char.toUpperCase())\n}\n\nexport const camelCaseToSnakeCase = (s: string) => {\n return s\n .replace(\n /([a-z0-9])([A-Z])/g,\n (_: string, group1: string, group2: string) => `${group1}_${group2.toLowerCase()}`,\n )\n .replace(\n /([A-Z])([A-Z])(?=[a-z])/g,\n (_: string, group1: string, group2: string) =>\n `${group1.toLowerCase()}_${group2.toLowerCase()}`,\n )\n .toLowerCase()\n}\n"],"names":["capitalize","word","firstLastName","first_name","last_name","maybeString","str","getStreet","address","street1","street2","getCityStateZip","addressInline","amountStr","amount","isPercentage","formatNumberAsCurrency","locale","formattedNumber","formatPayRate","rate","paymentUnit","t","dompurifyConfig","createMarkup","dirty","DOMPurify","removeNonDigits","value","snakeCaseToCamelCase","s","_","char"],"mappings":";;;;AAQA,MAAMA,IAAa,CAACC,MAAiBA,EAAK,OAAO,CAAC,EAAE,sBAAsBA,EAAK,MAAM,CAAC,GAEzEC,IAAgB,CAAC;AAAA,EAC5B,YAAAC;AAAA,EACA,WAAAC;AACF,MAIE,GAAGD,IAAaH,EAAWG,CAAU,IAAI,EAAE,GAAGC,IAAYC,EAAYL,EAAWI,CAAS,CAAC,IAAI,EAAE,IAE7FC,IAAc,CAACC,MACZA,IAAM,IAAIA,CAAG,KAAK,IAGdC,IAAY,CAACC,MAAwC;AAChE,QAAMC,IAAUJ,EAAYG,EAAQ,OAAO,GACrCE,IAAUL,EAAYG,EAAQ,OAAO;AAE3C,SAAO,GAAGC,CAAO,IAAIC,CAAO;AAC9B,GAEaC,IAAkB,CAACH,MAC9B,GAAGH,EAAYG,EAAQ,IAAI,CAAC,KAAKH,EAAYG,EAAQ,KAAK,CAAC,IAAIH,EAAYG,EAAQ,GAAG,CAAC,IAE5EI,IAAgB,CAACJ,MAC5B,GAAGD,EAAUC,CAAO,CAAC,IAAIG,EAAgBH,CAAO,CAAC,IAgBtCK,IAAY,CAACC,GAAgBC,MACxCA,IAAe,GAAGD,CAAM,MAAM,IAAIA,CAAM,IAE7BE,IAAyB,CAACF,GAAgBG,IAAiB,YAAY;AAClF,QAAMC,IAAkBJ,EAAO,eAAeG,GAAQ;AAAA,IACpD,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,EAAA,CACxB;AACD,SAAOJ,EAAUK,GAAiB,EAAK;AACzC,GAEaC,IAAgB,CAAC;AAAA,EAC5B,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,GAAAC;AAAA,EACA,QAAAL,IAAS;AACX,MAKM;AACJ,QAAMH,IAASE,EAAuBI,GAAMH,CAAM;AAElD,UAAQI,GAAA;AAAA,IACN,KAAK;AACH,aAAOC,EAAE,yBAAyB,EAAE,QAAAR,GAAQ,IAAI,UAAU;AAAA,IAC5D,KAAK;AACH,aAAOQ,EAAE,yBAAyB;AAAA,QAChC,QAAQN,EAAuBI,IAAO,IAAIH,CAAM;AAAA,QAChD,IAAI;AAAA,MAAA,CACL;AAAA,IACH,KAAK;AACH,aAAOK,EAAE,0BAA0B;AAAA,QACjC,QAAQN,EAAuBI,IAAO,IAAIH,CAAM;AAAA,QAChD,IAAI;AAAA,MAAA,CACL;AAAA,IACH,KAAK;AACH,aAAOK,EAAE,yBAAyB,EAAE,QAAAR,GAAQ,IAAI,UAAU;AAAA,IAC5D,KAAK;AACH,aAAOQ,EAAE,2BAA2B,EAAE,QAAAR,GAAQ,IAAI,UAAU;AAAA,IAC9D;AACE,aAAOA;AAAA,EAAA;AAEb,GAcMS,IAAkB,EAAE,cAAc,CAAC,KAAK,KAAK,QAAQ,GAAG,cAAc,CAAC,QAAQ,QAAQ,EAAA;AACtF,SAASC,EAAaC,GAAe;AAC1C,SAAKA,IACE,EAAE,QAAQC,EAAU,SAASD,GAAOF,CAAe,EAAA,IADvC,EAAE,QAAQ,GAAA;AAE/B;AAEO,MAAMI,IAAkB,CAACC,MACvBA,EAAM,QAAQ,OAAO,EAAE,GAGnBC,IAAuB,CAACC,MAC5BA,EAAE,QAAQ,aAAa,CAACC,GAAWC,MAAiBA,EAAK,aAAa;"}
@@ -0,0 +1 @@
1
+ export declare function readableStreamToBlob(stream: ReadableStream<Uint8Array>, mimeType: string): Promise<Blob>;
@@ -0,0 +1,17 @@
1
+ async function f(s, c) {
2
+ const l = s.getReader(), t = [];
3
+ let o = !1;
4
+ for (; !o; ) {
5
+ const { value: e, done: n } = await l.read();
6
+ e && t.push(e), o = n;
7
+ }
8
+ const d = t.reduce((e, n) => e + n.length, 0), r = new Uint8Array(d);
9
+ let a = 0;
10
+ for (const e of t)
11
+ r.set(e, a), a += e.length;
12
+ return new Blob([r], { type: c });
13
+ }
14
+ export {
15
+ f as readableStreamToBlob
16
+ };
17
+ //# sourceMappingURL=readableStreamToBlob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readableStreamToBlob.js","sources":["../../src/helpers/readableStreamToBlob.ts"],"sourcesContent":["export async function readableStreamToBlob(stream: ReadableStream<Uint8Array>, mimeType: string) {\n const reader = stream.getReader()\n const chunks: Uint8Array[] = []\n let done = false\n while (!done) {\n const { value, done: readerDone } = await reader.read()\n if (value) chunks.push(value)\n done = readerDone\n }\n // Concatenate all chunks\n const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0)\n const merged = new Uint8Array(totalLength)\n let offset = 0\n for (const chunk of chunks) {\n merged.set(chunk, offset)\n offset += chunk.length\n }\n return new Blob([merged], { type: mimeType })\n}\n"],"names":["readableStreamToBlob","stream","mimeType","reader","chunks","done","value","readerDone","totalLength","acc","chunk","merged","offset"],"mappings":"AAAA,eAAsBA,EAAqBC,GAAoCC,GAAkB;AAC/F,QAAMC,IAASF,EAAO,UAAA,GAChBG,IAAuB,CAAA;AAC7B,MAAIC,IAAO;AACX,SAAO,CAACA,KAAM;AACZ,UAAM,EAAE,OAAAC,GAAO,MAAMC,MAAe,MAAMJ,EAAO,KAAA;AACjD,IAAIG,KAAOF,EAAO,KAAKE,CAAK,GAC5BD,IAAOE;AAAA,EACT;AAEA,QAAMC,IAAcJ,EAAO,OAAO,CAACK,GAAKC,MAAUD,IAAMC,EAAM,QAAQ,CAAC,GACjEC,IAAS,IAAI,WAAWH,CAAW;AACzC,MAAII,IAAS;AACb,aAAWF,KAASN;AAClB,IAAAO,EAAO,IAAID,GAAOE,CAAM,GACxBA,KAAUF,EAAM;AAElB,SAAO,IAAI,KAAK,CAACC,CAAM,GAAG,EAAE,MAAMT,GAAU;AAC9C;"}
@@ -3,10 +3,8 @@ import { BREAKPOINTS } from '../../shared/constants';
3
3
  export type BreakpointKey = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS];
4
4
  export type useContainerBreakpointsProps = {
5
5
  ref: React.RefObject<HTMLElement | null>;
6
- breakpoints?: Partial<{
7
- [K in BreakpointKey]: number | string;
8
- }>;
6
+ breakpoints?: Record<string, number | string>;
9
7
  debounceTimeout?: number;
10
8
  };
11
- export declare const useContainerBreakpoints: ({ ref, breakpoints, debounceTimeout, }: useContainerBreakpointsProps) => BreakpointKey[];
9
+ export declare const useContainerBreakpoints: ({ ref, breakpoints, debounceTimeout, }: useContainerBreakpointsProps) => string[];
12
10
  export default useContainerBreakpoints;
@@ -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?: 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 // eslint-disable-next-line react-hooks/exhaustive-deps\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,CAA+B;AAI1D,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,EAEF,GAAG,CAACJ,CAAe,CAAC,GAEbC;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?: 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 // eslint-disable-next-line react-hooks/exhaustive-deps\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,EAEF,GAAG,CAACJ,CAAe,CAAC,GAEbC;AACT;"}