@shipengine/elements 1.9.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/README.md +0 -4
  2. package/assertions-dfa95b4d.js +1 -0
  3. package/carrier-c2a5ed53.js +1 -0
  4. package/{carrier-logo-1b6c767e.js → carrier-logo-330e926f.js} +1 -1
  5. package/components.js +1 -1
  6. package/elements.js +1 -1
  7. package/hooks.js +1 -1
  8. package/index.js +1 -1
  9. package/money-d4f3d7c3.js +1 -0
  10. package/package.json +7 -3
  11. package/schemas.js +1 -1
  12. package/{shipment-90d35708.js → shipment-150160e0.js} +1 -1
  13. package/src/components/add-funds-form/add-funds-form.d.ts +1 -1
  14. package/src/components/auto-funding-form/auto-funding-form.d.ts +1 -1
  15. package/src/components/carrier-balance/carrier-balance.d.ts +1 -1
  16. package/src/components/collapsible-panel/collapsible-panel.d.ts +1 -1
  17. package/src/components/display-term/display-term.d.ts +1 -1
  18. package/src/components/edit-billing-form/edit-billing-form.d.ts +1 -1
  19. package/src/components/field/money-input/money-input.d.ts +1 -1
  20. package/src/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +1 -1
  21. package/src/components/field/rate-card/rate-card.d.ts +1 -1
  22. package/src/components/field/rate-select/rate-select.d.ts +1 -1
  23. package/src/components/fund-and-purchase/fund-and-purchase.d.ts +1 -1
  24. package/src/components/history/history-card/history-card.d.ts +1 -1
  25. package/src/components/items-breakdown/items-breakdown.d.ts +1 -1
  26. package/src/components/pager/pager.d.ts +1 -1
  27. package/src/components/rate-details/rate-details.d.ts +1 -1
  28. package/src/components/save-status/save-status.d.ts +1 -1
  29. package/src/components/service-points/service-points.d.ts +1 -1
  30. package/src/components/templates/address-display/address-display.d.ts +1 -1
  31. package/src/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
  32. package/src/components/templates/address-preference-select/address-preference-select.d.ts +1 -1
  33. package/src/components/templates/connect-external-carrier-form/connect-external-carrier-form.d.ts +12 -0
  34. package/src/components/templates/connect-external-carrier-form/index.d.ts +1 -0
  35. package/src/components/templates/index.d.ts +1 -1
  36. package/src/components/templates/label/label.d.ts +1 -1
  37. package/src/components/templates/product-form/product-form.d.ts +1 -1
  38. package/src/components/templates/products-display/products-display.d.ts +1 -1
  39. package/src/components/templates/rate-form/rate-form.d.ts +3 -4
  40. package/src/components/templates/shipment/shipment.d.ts +3 -11
  41. package/src/components/templates/shipment-form/shipment-form.d.ts +2 -9
  42. package/src/components/templates/shipment-form/shipment-schema.d.ts +1 -1
  43. package/src/components/templates/suspend-sales-order/suspend-sales-order.d.ts +1 -1
  44. package/src/components/templates/suspend-shipment/suspend-shipment.d.ts +1 -1
  45. package/src/components/templates/wallet-form/edit-wallet-address-form.d.ts +1 -1
  46. package/src/components/templates/wallet-form/wallet-form.d.ts +2 -4
  47. package/src/components/templates/wallet-form/wallet-schema.d.ts +1 -1
  48. package/src/components/wallet-card/wallet-card.d.ts +1 -1
  49. package/src/components/warehouse-form/warehouse-form.d.ts +1 -1
  50. package/src/create-element/create-element.d.ts +10 -0
  51. package/src/create-element/element/element.d.ts +16 -0
  52. package/src/create-element/element/hooks/index.d.ts +1 -0
  53. package/src/create-element/element/hooks/use-i18n.d.ts +12 -0
  54. package/src/create-element/element/index.d.ts +3 -0
  55. package/src/create-element/element/utils/get-emotion-cache.d.ts +2 -0
  56. package/src/create-element/element/utils/index.d.ts +1 -0
  57. package/src/create-element/error-boundary/error-boundary.d.ts +21 -0
  58. package/src/create-element/error-boundary/index.d.ts +1 -0
  59. package/src/create-element/index.d.ts +1 -0
  60. package/src/elements/index.d.ts +5 -4
  61. package/src/elements/label-layout/label-layout-element.d.ts +1 -1
  62. package/src/elements/labels-grid/labels-grid.d.ts +2 -2
  63. package/src/elements/manage-carriers/index.d.ts +1 -0
  64. package/src/elements/{shipengine-carriers/shipengine-carriers.d.ts → manage-carriers/manage-carriers.d.ts} +52 -46
  65. package/src/elements/manage-external-carriers/index.d.ts +1 -0
  66. package/src/elements/manage-external-carriers/manage-external-carriers.d.ts +888 -0
  67. package/src/elements/manage-funding/manage-funding-element.d.ts +1 -1
  68. package/src/elements/manage-warehouses/manage-warehouses.d.ts +19 -2
  69. package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +1 -1
  70. package/src/elements/purchase-label/configure-shipment.d.ts +4 -27
  71. package/src/elements/purchase-label/hooks/use-address.d.ts +1 -1
  72. package/src/elements/purchase-label/hooks/use-configure-shipment.d.ts +1 -1
  73. package/src/elements/purchase-label/hooks/use-customs.d.ts +1 -1
  74. package/src/elements/purchase-label/hooks/use-import-sales-order.d.ts +2 -2
  75. package/src/elements/purchase-label/hooks/use-load-shipment.d.ts +3 -3
  76. package/src/elements/purchase-label/hooks/use-pending-shipment.d.ts +1 -1
  77. package/src/elements/purchase-label/hooks/use-presets.d.ts +1 -1
  78. package/src/elements/purchase-label/hooks/use-rates-form.d.ts +1 -1
  79. package/src/elements/purchase-label/hooks/use-rates-with-cache.d.ts +1 -1
  80. package/src/elements/purchase-label/hooks/use-request-preferred-rates.d.ts +1 -1
  81. package/src/elements/purchase-label/hooks/use-request-rates.d.ts +1 -1
  82. package/src/elements/purchase-label/hooks/use-shipment-form.d.ts +1 -1
  83. package/src/elements/purchase-label/purchase-label-by-sales-order.d.ts +1 -1
  84. package/src/elements/purchase-label/purchase-label-by-shipment.d.ts +1 -1
  85. package/src/elements/purchase-label/purchase-label.d.ts +18 -41
  86. package/src/elements/shipment-summary/index.d.ts +1 -0
  87. package/src/elements/{view-shipment/view-shipment.d.ts → shipment-summary/shipment-summary.d.ts} +42 -59
  88. package/src/elements/shipments-grid/shipments-grid.d.ts +2 -2
  89. package/src/elements/theme-creator/theme-creator.d.ts +1 -1
  90. package/src/elements/transaction-history/index.d.ts +1 -0
  91. package/src/elements/{wallet-history/wallet-history-element.d.ts → transaction-history/transaction-history-element.d.ts} +1 -1
  92. package/src/elements/unit-settings/unit-settings-element.d.ts +1 -1
  93. package/src/elements/vat-settings/vat-settings-element.d.ts +1 -1
  94. package/src/elements/void-label/components/actions/actions.d.ts +1 -1
  95. package/src/elements/void-label/components/message/message.d.ts +1 -1
  96. package/src/elements/void-label/void-label.d.ts +33 -49
  97. package/src/elements-provider/elements-provider.d.ts +46 -0
  98. package/src/elements-provider/elements-test-provider.d.ts +3 -0
  99. package/src/elements-provider/hooks/index.d.ts +1 -0
  100. package/src/elements-provider/hooks/use-load-icons.d.ts +7 -0
  101. package/src/elements-provider/index.d.ts +1 -0
  102. package/src/factories/shipengine/address.d.ts +1 -1
  103. package/src/factories/shipengine/carrier.d.ts +1 -1
  104. package/src/factories/shipengine/index.d.ts +1 -1
  105. package/src/factories/shipengine/label.d.ts +1 -1
  106. package/src/factories/shipengine/money.d.ts +1 -1
  107. package/src/factories/shipengine/order-source.d.ts +1 -1
  108. package/src/factories/shipengine/package.d.ts +1 -1
  109. package/src/factories/shipengine/resource.d.ts +1 -1
  110. package/src/factories/shipengine/sales-order.d.ts +1 -1
  111. package/src/factories/shipengine/service-point.d.ts +1 -1
  112. package/src/factories/shipengine/service.d.ts +1 -1
  113. package/src/factories/shipengine/shipment.d.ts +1 -1
  114. package/src/factories/shipengine/{wallet-history.d.ts → transaction-history.d.ts} +1 -1
  115. package/src/factories/shipengine/warehouse.d.ts +1 -1
  116. package/src/factories/shipengine/weight.d.ts +1 -1
  117. package/src/features/index.d.ts +3 -3
  118. package/src/features/label-layout/label-layout.d.ts +1 -1
  119. package/src/features/label-layout/use-label-layout.d.ts +1 -1
  120. package/src/features/{shipengine-carriers → manage-carriers}/hooks/use-list-funding-source-carriers.d.ts +2 -2
  121. package/src/features/manage-carriers/index.d.ts +1 -0
  122. package/src/features/manage-carriers/manage-carriers-row/index.d.ts +1 -0
  123. package/src/features/{shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.d.ts → manage-carriers/manage-carriers-row/manage-carriers-row.d.ts} +3 -3
  124. package/src/features/manage-carriers/manage-carriers.d.ts +4 -0
  125. package/src/features/manage-external-carriers/index.d.ts +1 -0
  126. package/src/features/manage-external-carriers/manage-external-carriers.d.ts +4 -0
  127. package/src/features/manage-warehouses/manage-warehouses.d.ts +1 -1
  128. package/src/features/manage-warehouses/use-manage-warehouses.d.ts +9 -9
  129. package/src/features/manage-warehouses/warehouse-display/warehouse-display.d.ts +1 -1
  130. package/src/features/transaction-history/index.d.ts +1 -0
  131. package/src/features/transaction-history/transaction-history.d.ts +6 -0
  132. package/src/features/unit-settings/unit-settings.d.ts +1 -1
  133. package/src/features/unit-settings/use-unit-settings.d.ts +1 -1
  134. package/src/features/vat-settings/use-vat-settings.d.ts +5 -5
  135. package/src/hooks/here-map/init.d.ts +1 -1
  136. package/src/hooks/options/use-confirmation-options.d.ts +1 -1
  137. package/src/hooks/options/use-customs-contents-options.d.ts +1 -1
  138. package/src/hooks/options/use-customs-non-delivery-options.d.ts +1 -1
  139. package/src/hooks/options/use-insurance-provider-options.d.ts +1 -1
  140. package/src/hooks/options/use-package-options.d.ts +1 -1
  141. package/src/hooks/options/use-rate-options.d.ts +1 -1
  142. package/src/hooks/options/use-service-code-options.d.ts +1 -1
  143. package/src/hooks/options/use-service-points.d.ts +1 -1
  144. package/src/hooks/options/use-shipment-metadata.d.ts +1 -1
  145. package/src/hooks/options/use-shipping-presets-options.d.ts +1 -1
  146. package/src/hooks/options/use-warehouse-options.d.ts +1 -1
  147. package/src/hooks/use-address-validation.d.ts +1 -1
  148. package/src/hooks/use-get-or-create-shipment.d.ts +3 -3
  149. package/src/hooks/use-scrub-errors.d.ts +1 -1
  150. package/src/index.d.ts +1 -0
  151. package/src/locales/en/index.d.ts +1 -1
  152. package/src/mocks/carriers/handlers.d.ts +1 -1
  153. package/src/mocks/warehouses/handlers.d.ts +1 -1
  154. package/src/schemas/shipengine/money.d.ts +1 -1
  155. package/src/testing/test-utils.d.ts +7 -1
  156. package/src/themes/fallback.d.ts +3 -0
  157. package/src/themes/index.d.ts +4 -0
  158. package/src/types/carrier-metadata.d.ts +1 -1
  159. package/src/types/preferred-rates.d.ts +1 -1
  160. package/src/types/shipping-preset/shipping-preset.d.ts +1 -1
  161. package/src/utilities/error.d.ts +1 -1
  162. package/src/utilities/feature-flags/feature-flags.d.ts +18 -0
  163. package/src/utilities/feature-flags/index.d.ts +2 -0
  164. package/src/utilities/feature-flags/types.d.ts +141 -0
  165. package/src/utilities/money.d.ts +1 -1
  166. package/src/utilities/rates.d.ts +1 -1
  167. package/src/utilities/shipengine/address.d.ts +1 -1
  168. package/src/utilities/shipengine/carrier.d.ts +1 -1
  169. package/src/utilities/shipengine/dimensions.d.ts +1 -1
  170. package/src/utilities/shipengine/sales-order.d.ts +1 -1
  171. package/src/utilities/shipengine/shipment.d.ts +1 -1
  172. package/src/utilities/shipengine/warehouses.d.ts +1 -1
  173. package/src/utilities/shipengine/weight.d.ts +1 -1
  174. package/src/workflows/account-settings/account-settings.d.ts +7 -14
  175. package/src/workflows/{connect-carrier/connect-carrier.d.ts → carrier-services/carrier-services.d.ts} +35 -49
  176. package/src/workflows/carrier-services/index.d.ts +1 -0
  177. package/src/workflows/{manage-wallet-workflow/manage-wallet-workflow.d.ts → connect-external-carrier/connect-external-carrier.d.ts} +16 -21
  178. package/src/workflows/connect-external-carrier/index.d.ts +1 -0
  179. package/src/workflows/index.d.ts +3 -2
  180. package/src/workflows/label-workflow/index.d.ts +1 -0
  181. package/src/workflows/{purchase-label-workflow/purchase-label-workflow.d.ts → label-workflow/label-workflow.d.ts} +16 -34
  182. package/src/workflows/onboarding/components/carrier-recovery-form/carrier-recovery-form.d.ts +1 -1
  183. package/src/workflows/onboarding/components/funding-and-carrier-connection-step/funding-and-carrier-connection-step.d.ts +2 -4
  184. package/src/workflows/onboarding/components/funding-and-carrier-connection-step/use-funding-and-carrier-connection-step.d.ts +1 -1
  185. package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.d.ts +2 -9
  186. package/src/workflows/onboarding/components/ship-from-address-step/ship-from-address-step.d.ts +1 -1
  187. package/src/workflows/onboarding/components/ship-from-address-step/use-ship-from-address-step.d.ts +1 -1
  188. package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.d.ts +1 -1
  189. package/src/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.d.ts +1 -1
  190. package/src/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.d.ts +1 -1
  191. package/src/workflows/onboarding/onboarding.d.ts +22 -70
  192. package/story-notes-c714d2ed.js +1 -0
  193. package/{suspend-text-c8c7b6b6.js → suspend-text-cad3a977.js} +1 -1
  194. package/transaction-history-element-cbfe487c.js +1 -0
  195. package/{use-page-layout-93ffae78.js → use-page-layout-8cb5075f.js} +1 -1
  196. package/use-scrub-errors-9870a6f3.js +1 -0
  197. package/use-toggle-866d7938.js +1 -0
  198. package/use-unit-settings-a5bae16e.js +1 -0
  199. package/utilities.js +1 -1
  200. package/validation-528e7834.js +1 -0
  201. package/wallet-form-9e4bfaea.js +1 -0
  202. package/warehouse-form-da6a7ac5.js +34 -0
  203. package/{warehouses-dfcdce23.js → warehouses-a83188ab.js} +1 -1
  204. package/workflows.js +1 -1
  205. package/carrier-2abb4760.js +0 -1
  206. package/feature-flags-3e03717c.js +0 -1
  207. package/money-fbc4d0b3.js +0 -1
  208. package/payment-method-settings-element-595cc38d.js +0 -1
  209. package/src/components/templates/connect-carrier-form/connect-carrier-form.d.ts +0 -12
  210. package/src/components/templates/connect-carrier-form/index.d.ts +0 -1
  211. package/src/elements/external-carriers/external-carriers.d.ts +0 -941
  212. package/src/elements/external-carriers/index.d.ts +0 -1
  213. package/src/elements/shipengine-carriers/index.d.ts +0 -1
  214. package/src/elements/view-shipment/index.d.ts +0 -1
  215. package/src/elements/wallet-history/index.d.ts +0 -1
  216. package/src/features/external-carriers/external-carriers.d.ts +0 -11
  217. package/src/features/external-carriers/index.d.ts +0 -1
  218. package/src/features/shipengine-carriers/index.d.ts +0 -1
  219. package/src/features/shipengine-carriers/shipengine-carriers-row/index.d.ts +0 -1
  220. package/src/features/shipengine-carriers/shipengine-carriers.d.ts +0 -10
  221. package/src/features/wallet-history/index.d.ts +0 -1
  222. package/src/features/wallet-history/wallet-history.d.ts +0 -6
  223. package/src/hooks/use-elements.d.ts +0 -35
  224. package/src/utilities/feature-flags.d.ts +0 -232
  225. package/src/workflows/connect-carrier/index.d.ts +0 -1
  226. package/src/workflows/manage-wallet-workflow/index.d.ts +0 -1
  227. package/src/workflows/purchase-label-workflow/index.d.ts +0 -1
  228. package/story-notes-ce2d8cca.js +0 -1
  229. package/use-scrub-errors-2c4db406.js +0 -1
  230. package/use-toggle-838d2ebd.js +0 -1
  231. package/validation-b941a548.js +0 -1
  232. package/wallet-form-3981400b.js +0 -1
  233. package/wallet-history-5b34c856.js +0 -1
  234. package/warehouse-form-c0b3ea78.js +0 -34
  235. /package/src/components/templates/{connect-carrier-form/connect-carrier-form.styles.d.ts → connect-external-carrier-form/connect-external-carrier-form.styles.d.ts} +0 -0
  236. /package/src/features/{shipengine-carriers → manage-carriers}/hooks/index.d.ts +0 -0
  237. /package/src/features/{shipengine-carriers → manage-carriers}/hooks/use-carrier-metadata.d.ts +0 -0
  238. /package/src/features/{shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.styles.d.ts → manage-carriers/manage-carriers-row/manage-carriers-row.styles.d.ts} +0 -0
  239. /package/src/features/{shipengine-carriers/shipengine-carriers.styles.d.ts → manage-carriers/manage-carriers.styles.d.ts} +0 -0
  240. /package/src/features/{wallet-history/wallet-history.styles.d.ts → transaction-history/transaction-history.styles.d.ts} +0 -0
  241. /package/src/workflows/{manage-wallet-workflow → carrier-services}/use-get-wallet-panel-props.d.ts +0 -0
package/README.md CHANGED
@@ -9,7 +9,3 @@ Visit [our documentation page](https://www.shipengine.com/docs/elements/elements
9
9
  ```bash
10
10
  npm install @shipengine/elements @shipengine/alchemy
11
11
  ```
12
-
13
- ```bash
14
- yarn add @shipengine/elements @shipengine/alchemy
15
- ```
@@ -0,0 +1 @@
1
+ function r(r,o){if(!r)throw new Error(o)}function o(r){throw new Error(r)}export{r as a,o as r};
@@ -0,0 +1 @@
1
+ import{format as e}from"date-fns/format";import{enGB as t,enUS as r}from"date-fns/locale";import{parse as n}from"date-fns/parse";import{SE as a}from"@shipengine/react-api";import{c as s,u as o,f as i}from"./address-8f8119f4.js";function c(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function u(e,t,r,n){return new(r||(r=Promise))((function(a,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function i(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,i)}c((n=n.apply(e,t||[])).next())}))}const d=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"numeric",month:"long",year:"numeric"}),l=(e="en-US")=>{const n=e.replaceAll("-",""),a=e.split("-")[0],s={enGB:t,enUS:r};return s[n in s?n:a]},p=(t,r="en-US",n)=>{const a=l(r),s=v(r);return e(t,null!=n?n:s,{locale:a})},y=(e,t="en-US",r="P")=>{const a=l(t);return n(e,r,new Date,{locale:a})},m=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"2-digit",month:"2-digit",year:"2-digit"}),g=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"2-digit",month:"2-digit",year:"numeric"}),v=(e="en-US")=>{var t;return null===(t=l(e).formatLong)||void 0===t?void 0:t.date({width:"short"})},f=(e,t=new Date)=>((t=new Date(t)).setDate(t.getDate()+e),t),D=(e,t=new Date)=>t.getHours()>=e?f(1,new Date(t)):new Date(t),w=(...e)=>new Date(Math.max(...e.map(Number))),h=e=>{const t=e?new Date(e):new Date;return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())},b=e=>{const t=(new Date).getFullYear(),r=[];for(let n=0;n<e;n++)r.push(`${t+n}`);return r},C=(e,t,r="desc")=>{const[n,a]="asc"===r?[e,t]:[t,e];return new Date(n.createdAt).getTime()-new Date(a.createdAt).getTime()},U=e=>!!e&&new Date(e)>=new Date,_=e=>{const t=null!=e?e:new Date;return{firstDayOfMonth:new Date(t.getFullYear(),t.getMonth(),1),lastDayOfTheMonth:new Date(t.getFullYear(),t.getMonth()+1,0),origin:t,previousMonthFirstDay:new Date(t.getFullYear(),t.getMonth()-1,1),previousMonthLastDay:new Date(t.getFullYear(),t.getMonth()-1+1,0),thirtyDaysAgo:new Date((new Date).setDate(t.getDate()-30))}},O={aud:"$",cad:"$",eur:"€",gbp:"£",nzd:"$",usd:"$"},S=(e,t="en-US")=>Intl.NumberFormat(t,{currency:e.currency,style:"currency"}).format(e.amount),j=(...e)=>e.reduce(((e,t)=>{var r;return t?e+(null!==(r=t.amount)&&void 0!==r?r:0):e}),0),A=e=>[e.substring(0,4),e.substring(4,8),e.substring(8,12),e.substring(12)].join(" ").trim(),M=e=>{const t=e.replace(/\//g,"");return t.length>2?[t.substring(0,2),t.substring(2,6)].join("/").trim():t},L=e=>{switch(null==e?void 0:e.toLowerCase()){case"usd":default:return a.Currency.USD;case"cad":return a.Currency.CAD;case"aud":return a.Currency.AUD;case"gbp":return a.Currency.GBP;case"eur":return a.Currency.EUR;case"nzd":return a.Currency.NZD}},x=e=>{let t;switch(e){case a.Currency.USD:case a.Currency.CAD:case a.Currency.AUD:case a.Currency.NZD:t="$";break;case a.Currency.GBP:t="£‎";break;case a.Currency.EUR:t="€"}return t},F=(e,t,r)=>{switch(e){case"usps_media_mail":return!0;case"usps_first_class_mail":return"large_envelope_or_flat"===t;case"dhl_express_worldwide":return r;default:return!1}},P=(e={})=>j(...Object.values(e)),T=(e,t)=>t[e]||e,$=[{carrier:"yodel_walleted"},{carrier:"hermes",serviceCodes:[{serviceCode:"domestic_courier_collections",type:"pick_up"},{serviceCode:"postable_courier_collections",type:"pick_up"}]},{carrier:"dpdwallet"}],k=e=>$.some((t=>e.carrierCode===t.carrier)),Y=(e,t)=>$.some((r=>{var n;return r.carrier===e&&(null===(n=r.serviceCodes)||void 0===n?void 0:n.some((e=>e.serviceCode===t&&"pick_up"===e.type)))})),B=e=>{var t;return"US"===e.countryCode||(null===(t=s.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnitedStatesTerritory)},N=e=>{var t,r;return!(!(null===(t=o.find((t=>t.code===e.stateProvince)))||void 0===t?void 0:t.isMilitary)&&!(null===(r=i.find((t=>t.code===e.cityLocality)))||void 0===r?void 0:r.isMilitary))},E=e=>{var t,r;return!(!(null===(t=s.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnitedStatesTerritory)&&!(null===(r=o.find((t=>t.code===e.stateProvince)))||void 0===r?void 0:r.isUnitedStatesTerritory))},G=e=>{var t;return!!(null===(t=s.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnsupportedByUps)},I=/^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i,z=e=>I.test(e),H=e=>!!(z(e.addressLine1)||e.addressLine2&&z(e.addressLine2)),R=e=>!e||Object.entries(e).every((([e,t])=>"countryCode"===e||[null,"","unknown"].includes(t))),Z=(e,t)=>Object.assign(Object.assign(Object.assign({},e),e.matchedAddress&&{matchedAddress:Object.assign(Object.assign({},e.matchedAddress),{email:t})}),{originalAddress:Object.assign(Object.assign({},e.originalAddress),{email:t})}),q=["usps","stamps_com"],J=e=>q.includes(e),K=e=>"ups"===e,Q=(e=[],t)=>{const r=e.find((e=>e.carrierCode===t));return null==r?void 0:r.carrierId},V=(e,t)=>{var r;return`https://logos.shipstation.com/ipaas/carriers/${null!==(r={stamps_com:"stamps_com_wl"}[e])&&void 0!==r?r:e}/${t}.svg`};export{Y as A,B,N as C,E as D,G as E,z as F,H as G,R as H,Z as I,J,K,Q as L,V as M,u as N,c as _,l as a,p as b,m as c,g as d,f as e,d as f,v as g,b as h,U as i,_ as j,O as k,S as l,w as m,D as n,h as o,y as p,j as q,A as r,C as s,M as t,L as u,x as v,F as w,P as x,T as y,k as z};
@@ -1 +1 @@
1
- import{jsx as r}from"@emotion/react/jsx-runtime";import{M as o}from"./carrier-2abb4760.js";const e={md:40,lg:68,xl:105},t=({carrierCode:t,carrierName:i,size:m="md"})=>{const a=o(t,"logo");return a?r("img",{alt:`${i}-logo`,height:e[m],src:a,width:e[m]},i):null};export{t as C};
1
+ import{jsx as r}from"@emotion/react/jsx-runtime";import{M as o}from"./carrier-c2a5ed53.js";const e={md:40,lg:68,xl:105},t=({carrierCode:t,carrierName:i,size:m="md"})=>{const a=o(t,"logo");return a?r("img",{alt:`${i}-logo`,height:e[m],src:a,width:e[m]},i):null};export{t as C};
package/components.js CHANGED
@@ -1 +1 @@
1
- export{A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CollapsiblePanel,f as CopyButton,h as Cube,D as DateRangeCombo,i as DateRangeSelect,j as DisplayTerm,E as EditBillingForm,k as ErrorFallback,F as FieldLabel,l as FormPortal,m as FundAndPurchase,H as HistoryCard,n as HistoryCardExtension,I as InlineLabel,o as ItemsBreakdown,L as LinkAction,p as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,q as SettingsCard,r as SkeletonCarrierRow,t as Spacer,u as Spread,T as Tabs,V as VatForm,W as WalletCard,v as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./warehouse-form-c0b3ea78.js";export{C as CarrierLogo}from"./carrier-logo-1b6c767e.js";export{C as CellFormattedDate,D as Drawer,G as GridController,P as Pager,S as SuspendText,u as usePager}from"./suspend-text-c8c7b6b6.js";export{f as Field,S as StoryNotes}from"./story-notes-ce2d8cca.js";export{P as Portal}from"./use-toggle-838d2ebd.js";import"./carrier-2abb4760.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"@shipengine/alchemy";import"./address-8f8119f4.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./validation-b941a548.js";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"lodash/isEqual";import"./money-fbc4d0b3.js";import"copy-to-clipboard";import"js-base64";import"card-validator";import"libphonenumber-js/min";import"./zod-60def96c.js";import"lodash/omit";import"react-dom";
1
+ export{A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CollapsiblePanel,f as CopyButton,h as Cube,D as DateRangeCombo,i as DateRangeSelect,j as DisplayTerm,E as EditBillingForm,k as ErrorFallback,F as FieldLabel,l as FormPortal,m as FundAndPurchase,H as HistoryCard,n as HistoryCardExtension,I as InlineLabel,o as ItemsBreakdown,L as LinkAction,p as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,q as SettingsCard,r as SkeletonCarrierRow,t as Spacer,u as Spread,T as Tabs,V as VatForm,W as WalletCard,v as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./warehouse-form-da6a7ac5.js";export{C as CarrierLogo}from"./carrier-logo-330e926f.js";export{C as CellFormattedDate,D as Drawer,G as GridController,P as Pager,S as SuspendText,u as usePager}from"./suspend-text-cad3a977.js";export{f as Field,S as StoryNotes}from"./story-notes-c714d2ed.js";export{P as Portal}from"./use-toggle-866d7938.js";import"./carrier-c2a5ed53.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"@shipengine/react-api";import"./address-8f8119f4.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./validation-528e7834.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"lodash/isEqual";import"./money-d4f3d7c3.js";import"copy-to-clipboard";import"js-base64";import"card-validator";import"libphonenumber-js/min";import"axios";import"./zod-60def96c.js";import"lodash/omit";import"react-dom";
package/elements.js CHANGED
@@ -1 +1 @@
1
- export{e as ExternalCarriers,d as LabelLayout,l as LabelsGrid,c as ManageFunding,m as ManageWarehouses,p as PaymentMethodSettings,s as ShipEngineCarriers,a as ShipmentsGrid,t as ThemeCreator,T as ThemeCreatorProvider,b as UnitSettings,u as useThemeCreator}from"./payment-method-settings-element-595cc38d.js";export{m as ManageWalletWorkflow,p as PurchaseLabel,v as ViewShipment,a as VoidLabel}from"./wallet-history-5b34c856.js";import"@emotion/react/jsx-runtime";import"@shipengine/alchemy";import"./warehouse-form-c0b3ea78.js";import"./carrier-2abb4760.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"./address-8f8119f4.js";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./validation-b941a548.js";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"./use-toggle-838d2ebd.js";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"./money-fbc4d0b3.js";import"copy-to-clipboard";import"js-base64";import"card-validator";import"libphonenumber-js/min";import"./zod-60def96c.js";import"./suspend-text-c8c7b6b6.js";import"./formatString-413ec7c7.js";import"humps";import"@tanstack/react-query";import"./use-scrub-errors-2c4db406.js";import"./shipment-90d35708.js";import"lodash/orderBy";import"lodash/merge";import"lodash/mergeWith";import"./warehouses-dfcdce23.js";import"axios";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";
1
+ export{e as LabelLayout,l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,d as ManageFunding,a as ManageWarehouses,p as PaymentMethodSettings,s as ShipmentsGrid,t as ThemeCreator,T as ThemeCreatorProvider,f as TransactionHistory,c as UnitSettings,u as useThemeCreator}from"./transaction-history-element-cbfe487c.js";export{c as CarrierServices,p as PurchaseLabel,s as ShipmentSummary,v as VoidLabel}from"./use-unit-settings-a5bae16e.js";import"@emotion/react/jsx-runtime";import"./warehouse-form-da6a7ac5.js";import"./carrier-c2a5ed53.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"@shipengine/react-api";import"./address-8f8119f4.js";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./validation-528e7834.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"./use-toggle-866d7938.js";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"./money-d4f3d7c3.js";import"copy-to-clipboard";import"js-base64";import"card-validator";import"libphonenumber-js/min";import"axios";import"./zod-60def96c.js";import"./suspend-text-cad3a977.js";import"./formatString-413ec7c7.js";import"humps";import"@tanstack/react-query";import"./use-scrub-errors-9870a6f3.js";import"./shipment-150160e0.js";import"lodash/orderBy";import"lodash/merge";import"lodash/mergeWith";import"./warehouses-a83188ab.js";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";
package/hooks.js CHANGED
@@ -1 +1 @@
1
- export{R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle-838d2ebd.js";export{P as PudoType,l as useBlackboxDetection,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,d as useInsuranceProviderOptions,m as useNestedForm,e as usePackageOptions,f as useRateOptions,n as useRunOnceOnTrue,o as useScrubErrors,g as useServiceCodeOptions,k as useServicePoints,h as useShipmentMetadata,i as useShippingPresetsOptions,j as useWarehouseOptions}from"./use-scrub-errors-2c4db406.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as usePageLayout}from"./use-page-layout-93ffae78.js";import"react";import"./address-8f8119f4.js";import"./carrier-2abb4760.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"@shipengine/alchemy";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"@emotion/react/jsx-runtime";import"humps";import"react-i18next";import"./shipment-90d35708.js";import"lodash/orderBy";import"@shipengine/giger";import"@emotion/react";import"js-base64";
1
+ export{R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle-866d7938.js";export{P as PudoType,l as useBlackboxDetection,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,d as useInsuranceProviderOptions,m as useNestedForm,e as usePackageOptions,f as useRateOptions,n as useRunOnceOnTrue,o as useScrubErrors,g as useServiceCodeOptions,k as useServicePoints,h as useShipmentMetadata,i as useShippingPresetsOptions,j as useWarehouseOptions}from"./use-scrub-errors-9870a6f3.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as usePageLayout}from"./use-page-layout-8cb5075f.js";import"react";import"./address-8f8119f4.js";import"./carrier-c2a5ed53.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"@shipengine/react-api";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"@emotion/react/jsx-runtime";import"humps";import"react-i18next";import"./shipment-150160e0.js";import"lodash/orderBy";import"@shipengine/giger";import"@emotion/react";import"js-base64";
package/index.js CHANGED
@@ -1 +1 @@
1
- export{A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CollapsiblePanel,f as CopyButton,h as Cube,D as DateRangeCombo,i as DateRangeSelect,j as DisplayTerm,E as EditBillingForm,k as ErrorFallback,F as FieldLabel,l as FormPortal,m as FundAndPurchase,H as HistoryCard,n as HistoryCardExtension,I as InlineLabel,o as ItemsBreakdown,L as LinkAction,p as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,q as SettingsCard,r as SkeletonCarrierRow,t as Spacer,u as Spread,T as Tabs,V as VatForm,W as WalletCard,v as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./warehouse-form-c0b3ea78.js";export{C as CarrierLogo}from"./carrier-logo-1b6c767e.js";export{C as CellFormattedDate,D as Drawer,G as GridController,P as Pager,S as SuspendText,u as usePager}from"./suspend-text-c8c7b6b6.js";export{f as Field,S as StoryNotes}from"./story-notes-ce2d8cca.js";export{P as Portal,R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle-838d2ebd.js";export{C as Country,U as UsState,d as UsaCity,c as countries,a as countryCodes,e as euCountryCodes,p as postalCodeRegex,f as usCities,b as usStateCodes,u as usStates}from"./address-8f8119f4.js";export{e as ExternalCarriers,d as LabelLayout,l as LabelsGrid,c as ManageFunding,m as ManageWarehouses,p as PaymentMethodSettings,s as ShipEngineCarriers,a as ShipmentsGrid,t as ThemeCreator,T as ThemeCreatorProvider,b as UnitSettings,u as useThemeCreator}from"./payment-method-settings-element-595cc38d.js";export{c as ConnectCarrier,m as ManageWalletWorkflow,p as PurchaseLabel,v as ViewShipment,a as VoidLabel}from"./wallet-history-5b34c856.js";export{e as extendZod}from"./zod-60def96c.js";export{P as PudoType,l as useBlackboxDetection,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,d as useInsuranceProviderOptions,m as useNestedForm,e as usePackageOptions,f as useRateOptions,n as useRunOnceOnTrue,o as useScrubErrors,g as useServiceCodeOptions,k as useServicePoints,h as useShipmentMetadata,i as useShippingPresetsOptions,j as useWarehouseOptions}from"./use-scrub-errors-2c4db406.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as usePageLayout}from"./use-page-layout-93ffae78.js";export{m as moneySchema}from"./money-fbc4d0b3.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone-87dd7bd8.js";export{a as assert,d as deepMergeFeatures,b as featureFlagComponentNameLookup,f as featureFlags,g as getFeatures,i as isObject,r as raise,u as useFeatures}from"./feature-flags-3e03717c.js";export{a as convertDimensions,c as createDictionary,f as formatDimensions,e as getCancelledShipment,b as getIsCustomsRequiredForShipment,g as getIsInternationalShipment,d as getPendingShipment,h as getShipmentByStatus,m as moveCustomsItemsToProducts}from"./shipment-90d35708.js";export{I as addEmailToValidation,q as calculateTotal,k as currencySymbol,e as daysAfter,a as findDateLocale,b as formatByDateAndLocale,r as formatCreditCardNumber,f as formatDate,c as formatDateDDMMYY,d as formatDateDDMMYYYY,t as formatExpiration,l as formatMoney,L as getCarrierIdByCarrierCode,u as getCurrencyFromString,v as getCurrencySymbolFromString,h as getExpirationYears,M as getLogoOrIconByCarrierCode,w as getRateRequiresAcknowledgement,j as getRelativeDates,x as getTotalRateAmount,g as getlocaleDateStringFormat,A as isCollectionService,B as isDomesticAddress,H as isEmptyAddress,C as isMilitaryAddress,i as isNowOrInTheFuture,F as isPoBox,G as isPoBoxAddress,z as isPudoEligibleRate,D as isUnitedStatesTerritory,E as isUnsupportedByUps,K as isUpsCarrier,J as isUspsCarrier,m as mostRecent,n as nextDayCutoff,o as omitTime,y as overrideCarrierCodes,p as parseLocaleDate,s as sortByCreationDate}from"./carrier-2abb4760.js";export{k as convertDecimalWeightToFractionalWeight,j as convertFractionalWeightToDecimalWeight,h as convertPoundsAndOuncesToOunces,l as convertWeight,c as createCodedErrors,m as formatFractionalWeight,g as getCustomsFromSalesOrder,o as getDefaultWarehouse,b as getIsCustomsRequiredForSalesOrder,d as getRequestedServices,e as getSalesOrderItemsFromSalesOrderOrShipment,f as isDecimalWeight,n as isFlatRatePackageCode,i as isMetricWeightUnit,a as throwAny,t as throwJoinedMessages}from"./warehouses-dfcdce23.js";export{c as createStyles,e as errorMap,f as formLogger,i as isString,t as trackingStatusFormatter,v as validationResolver}from"./validation-b941a548.js";export{a as addSpaceBetweenWords,c as capitalizeFirstLetter,p as pascalize}from"./formatString-413ec7c7.js";export{a as AccountSettings,o as Onboarding,p as PurchaseLabelWorkflow}from"./wallet-form-3981400b.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/alchemy";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"@emotion/react";import"@shipengine/giger-theme";import"lodash/isEqual";import"zod";import"copy-to-clipboard";import"js-base64";import"card-validator";import"libphonenumber-js/min";import"lodash/omit";import"react-dom";import"@tanstack/react-query";import"lodash/merge";import"lodash/mergeWith";import"humps";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";import"lodash/orderBy";import"lodash/get";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"axios";import"@hookform/resolvers/zod";
1
+ export{A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CollapsiblePanel,f as CopyButton,h as Cube,D as DateRangeCombo,i as DateRangeSelect,j as DisplayTerm,E as EditBillingForm,w as ElementsContext,x as ElementsProvider,k as ErrorFallback,F as FieldLabel,l as FormPortal,m as FundAndPurchase,H as HistoryCard,n as HistoryCardExtension,I as InlineLabel,o as ItemsBreakdown,L as LinkAction,p as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,q as SettingsCard,r as SkeletonCarrierRow,t as Spacer,u as Spread,T as Tabs,V as VatForm,W as WalletCard,v as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles,y as useElements}from"./warehouse-form-da6a7ac5.js";export{C as CarrierLogo}from"./carrier-logo-330e926f.js";export{C as CellFormattedDate,D as Drawer,G as GridController,P as Pager,S as SuspendText,u as usePager}from"./suspend-text-cad3a977.js";export{f as Field,S as StoryNotes}from"./story-notes-c714d2ed.js";export{P as Portal,R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle-866d7938.js";export{C as Country,U as UsState,d as UsaCity,c as countries,a as countryCodes,e as euCountryCodes,p as postalCodeRegex,f as usCities,b as usStateCodes,u as usStates}from"./address-8f8119f4.js";export{e as LabelLayout,l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,d as ManageFunding,a as ManageWarehouses,p as PaymentMethodSettings,s as ShipmentsGrid,t as ThemeCreator,T as ThemeCreatorProvider,f as TransactionHistory,c as UnitSettings,u as useThemeCreator}from"./transaction-history-element-cbfe487c.js";export{c as CarrierServices,a as ConnectExternalCarrier,p as PurchaseLabel,s as ShipmentSummary,v as VoidLabel}from"./use-unit-settings-a5bae16e.js";export{e as extendZod}from"./zod-60def96c.js";export{P as PudoType,l as useBlackboxDetection,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,d as useInsuranceProviderOptions,m as useNestedForm,e as usePackageOptions,f as useRateOptions,n as useRunOnceOnTrue,o as useScrubErrors,g as useServiceCodeOptions,k as useServicePoints,h as useShipmentMetadata,i as useShippingPresetsOptions,j as useWarehouseOptions}from"./use-scrub-errors-9870a6f3.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as usePageLayout}from"./use-page-layout-8cb5075f.js";export{m as moneySchema}from"./money-d4f3d7c3.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone-87dd7bd8.js";export{a as assert,r as raise}from"./assertions-dfa95b4d.js";export{a as convertDimensions,c as createDictionary,f as formatDimensions,e as getCancelledShipment,b as getIsCustomsRequiredForShipment,g as getIsInternationalShipment,d as getPendingShipment,h as getShipmentByStatus,m as moveCustomsItemsToProducts}from"./shipment-150160e0.js";export{I as addEmailToValidation,q as calculateTotal,k as currencySymbol,e as daysAfter,a as findDateLocale,b as formatByDateAndLocale,r as formatCreditCardNumber,f as formatDate,c as formatDateDDMMYY,d as formatDateDDMMYYYY,t as formatExpiration,l as formatMoney,L as getCarrierIdByCarrierCode,u as getCurrencyFromString,v as getCurrencySymbolFromString,h as getExpirationYears,M as getLogoOrIconByCarrierCode,w as getRateRequiresAcknowledgement,j as getRelativeDates,x as getTotalRateAmount,g as getlocaleDateStringFormat,A as isCollectionService,B as isDomesticAddress,H as isEmptyAddress,C as isMilitaryAddress,i as isNowOrInTheFuture,F as isPoBox,G as isPoBoxAddress,z as isPudoEligibleRate,D as isUnitedStatesTerritory,E as isUnsupportedByUps,K as isUpsCarrier,J as isUspsCarrier,m as mostRecent,n as nextDayCutoff,o as omitTime,y as overrideCarrierCodes,p as parseLocaleDate,s as sortByCreationDate}from"./carrier-c2a5ed53.js";export{k as convertDecimalWeightToFractionalWeight,j as convertFractionalWeightToDecimalWeight,h as convertPoundsAndOuncesToOunces,l as convertWeight,c as createCodedErrors,m as formatFractionalWeight,g as getCustomsFromSalesOrder,o as getDefaultWarehouse,b as getIsCustomsRequiredForSalesOrder,d as getRequestedServices,e as getSalesOrderItemsFromSalesOrderOrShipment,f as isDecimalWeight,n as isFlatRatePackageCode,i as isMetricWeightUnit,a as throwAny,t as throwJoinedMessages}from"./warehouses-a83188ab.js";export{c as createStyles,d as deepMergeFeatures,e as errorMap,f as featureFlagComponentNameLookup,a as formLogger,g as getDefaultFeatures,i as isObject,b as isString,t as trackingStatusFormatter,v as validationResolver}from"./validation-528e7834.js";export{a as addSpaceBetweenWords,c as capitalizeFirstLetter,p as pascalize}from"./formatString-413ec7c7.js";export{a as AccountSettings,l as LabelWorkflow,o as Onboarding}from"./wallet-form-9e4bfaea.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"@emotion/react";import"@shipengine/giger-theme";import"@shipengine/react-api";import"lodash/isEqual";import"zod";import"copy-to-clipboard";import"js-base64";import"card-validator";import"libphonenumber-js/min";import"axios";import"lodash/omit";import"react-dom";import"@tanstack/react-query";import"lodash/merge";import"lodash/mergeWith";import"humps";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";import"lodash/orderBy";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get";import"@hookform/resolvers/zod";
@@ -0,0 +1 @@
1
+ import{z as n}from"zod";import{SE as e}from"@shipengine/react-api";const r=n.object({amount:n.number().nonnegative(),currency:n.nativeEnum(e.Currency)});export{r as m};
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "1.9.0",
3
+ "version": "2.0.0",
4
4
  "peerDependencies": {
5
- "@shipengine/alchemy": "5.x.x",
6
5
  "@emotion/react": "11.x",
7
6
  "react-i18next": "11.x",
8
7
  "i18next": "22.x",
@@ -59,6 +58,7 @@
59
58
  "type": "module",
60
59
  "types": "./src/index.d.ts",
61
60
  "dependencies": {
61
+ "@emotion/cache": "11.10.5",
62
62
  "@emotion/serialize": "1.1.1",
63
63
  "@faker-js/faker": "7.6.0",
64
64
  "@hookform/resolvers": "2.9.1",
@@ -69,6 +69,7 @@
69
69
  "@shipengine/giger": "1.11.2",
70
70
  "@shipengine/giger-theme": "1.5.1",
71
71
  "@shipengine/js-api": "1.21.0",
72
+ "@shipengine/react-api": "2.11.8",
72
73
  "@storybook/addons": "6.5.16",
73
74
  "@storybook/components": "7.0.0-rc.1",
74
75
  "@storybook/core-events": "7.0.0-rc.1",
@@ -77,17 +78,20 @@
77
78
  "@tanstack/react-query": "4.36.1",
78
79
  "@testing-library/dom": "8.19.0",
79
80
  "@vitejs/plugin-react": "1.3.2",
80
- "axios": "0.28.1",
81
+ "axios": "1.7.2",
81
82
  "card-validator": "8.1.1",
83
+ "classnames": "2.5.1",
82
84
  "copy-to-clipboard": "3.3.3",
83
85
  "date-fns": "3.6.0",
84
86
  "expect": "28.1.3",
85
87
  "humps": "2.0.1",
88
+ "i18next-browser-languagedetector": "6.1.8",
86
89
  "js-base64": "3.7.3",
87
90
  "libphonenumber-js": "1.10.14",
88
91
  "lodash": "4.17.21",
89
92
  "react-hook-form": "7.40.0",
90
93
  "rollup-plugin-copy": "3.4.0",
94
+ "stylis": "4.1.3",
91
95
  "use-debounce": "10.0.0",
92
96
  "zod": "3.19.1"
93
97
  }
package/schemas.js CHANGED
@@ -1 +1 @@
1
- export{m as moneySchema}from"./money-fbc4d0b3.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone-87dd7bd8.js";import"zod";import"@shipengine/alchemy";import"libphonenumber-js/min";
1
+ export{m as moneySchema}from"./money-d4f3d7c3.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone-87dd7bd8.js";import"zod";import"@shipengine/react-api";import"libphonenumber-js/min";
@@ -1 +1 @@
1
- import{C as s,D as t,s as e,_ as n}from"./carrier-2abb4760.js";const o=(s,t)=>{var e;return null!==(e=null==s?void 0:s.reduce(((s,e)=>Object.assign(Object.assign({},s),t(e,s))),{}))&&void 0!==e?e:{}},i=s=>`${s.length} x ${s.width} x ${s.height} `;function a(s,{allowAllZeroes:t}={}){const{length:e,width:n,height:o,unit:i}=s;if(![e,n,o].every((s=>0===s))||t)return Object.assign(Object.assign({},s),{unit:null!=i?i:"inch"})}const u=({shipFrom:s,shipTo:t})=>(null==s?void 0:s.countryCode)!==(null==t?void 0:t.countryCode),l=({shipFrom:e,shipTo:n})=>e&&s(e)||n&&(s(n)||t(n))||(null==e?void 0:e.countryCode)!==(null==n?void 0:n.countryCode),c=s=>null==s?void 0:s.filter((s=>"pending"===s.shipmentStatus)).sort(e)[0],r=s=>null==s?void 0:s.filter((s=>"cancelled"===s.shipmentStatus)).sort(e)[0],d=(s,t)=>null==t?void 0:t.filter((({shipmentStatus:t})=>t===s)).sort(e)[0],m=s=>{var t,e;if(!(null===(e=null===(t=s.customs)||void 0===t?void 0:t.customsItems)||void 0===e?void 0:e.length))return s;const o=s.customs.customsItems.map((s=>Object.assign(Object.assign({},s),{value:s.value instanceof Object?s.value:{amount:s.value,currency:s.valueCurrency||"USD"}}))),i=s.customs,a=n(i,["customsItems"]);return Object.assign(Object.assign({},s),{customs:a,packages:s.packages.map(((s,t)=>0===t?Object.assign(Object.assign({},s),{products:o}):s))})};export{a,l as b,o as c,c as d,r as e,i as f,u as g,d as h,m};
1
+ import{C as s,D as t,s as e,_ as n}from"./carrier-c2a5ed53.js";const o=(s,t)=>{var e;return null!==(e=null==s?void 0:s.reduce(((s,e)=>Object.assign(Object.assign({},s),t(e,s))),{}))&&void 0!==e?e:{}},i=s=>`${s.length} x ${s.width} x ${s.height} `;function a(s,{allowAllZeroes:t}={}){const{length:e,width:n,height:o,unit:i}=s;if(![e,n,o].every((s=>0===s))||t)return Object.assign(Object.assign({},s),{unit:null!=i?i:"inch"})}const u=({shipFrom:s,shipTo:t})=>(null==s?void 0:s.countryCode)!==(null==t?void 0:t.countryCode),c=({shipFrom:e,shipTo:n})=>e&&s(e)||n&&(s(n)||t(n))||(null==e?void 0:e.countryCode)!==(null==n?void 0:n.countryCode),l=s=>null==s?void 0:s.filter((s=>"pending"===s.shipmentStatus)).sort(e)[0],r=s=>null==s?void 0:s.filter((s=>"cancelled"===s.shipmentStatus)).sort(e)[0],d=(s,t)=>null==t?void 0:t.filter((({shipmentStatus:t})=>t===s)).sort(e)[0],m=s=>{var t,e;if(!(null===(e=null===(t=s.customs)||void 0===t?void 0:t.customsItems)||void 0===e?void 0:e.length))return s;const o=s.customs.customsItems.map((s=>Object.assign(Object.assign({},s),{value:s.value instanceof Object?s.value:{amount:s.value,currency:s.valueCurrency||"USD"}}))),i=s.customs,a=n(i,["customsItems"]);return Object.assign(Object.assign({},s),{customs:a,packages:s.packages.map(((s,t)=>0===t?Object.assign(Object.assign({},s),{products:o}):s))})};export{a,c as b,o as c,l as d,r as e,i as f,u as g,d as h,m};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SE } from "@shipengine/alchemy";
2
+ import { SE } from "@shipengine/react-api";
3
3
  /**
4
4
  * @internal
5
5
  *
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  /**
3
3
  * @internalccount
4
4
  *
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -1,5 +1,5 @@
1
- import { SE } from "@shipengine/alchemy";
2
1
  import { WithChildrenCommonProps } from "@shipengine/giger";
2
+ import { SE } from "@shipengine/react-api";
3
3
  /**
4
4
  * @internal
5
5
  *
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export type DisplayTermProps = {
3
3
  term: Pick<SE.MetadataRequiredTerm, "links">;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type EditBillingFormProps = {
3
3
  onCancel: () => void;
4
4
  onSubmit: (billingInfo: SE.FundingSourceAddress, creditCardInfo: SE.CreditCardInfo) => void;
@@ -1,5 +1,5 @@
1
- import { SE } from "@shipengine/alchemy";
2
1
  import { InputProps } from "@shipengine/giger";
2
+ import { SE } from "@shipengine/react-api";
3
3
  import { ControlledField } from "../create-field-controller";
4
4
  export declare const transform: {
5
5
  in: ({ amount, currency }?: Partial<{
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SE } from "@shipengine/alchemy";
2
+ import { SE } from "@shipengine/react-api";
3
3
  export interface CostBreakdownProps {
4
4
  confirmationAmount?: SE.Money;
5
5
  insuranceAmount?: SE.Money;
@@ -1,5 +1,5 @@
1
- import type { SE } from "@shipengine/alchemy";
2
1
  import { WithCommonProps } from "@shipengine/giger";
2
+ import type { SE } from "@shipengine/react-api";
3
3
  import { RateOption } from "../../../hooks";
4
4
  export type RateCardProps = Partial<RateOption> & WithCommonProps<{
5
5
  isAcknowledged?: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { SE } from "@shipengine/alchemy";
2
+ import type { SE } from "@shipengine/react-api";
3
3
  import { RateOption } from "../../../hooks";
4
4
  import { RateFormProps } from "../../templates";
5
5
  import { ControlledField } from "../create-field-controller";
@@ -1,5 +1,5 @@
1
1
  import { Control } from "react-hook-form";
2
- import { SE } from "@shipengine/alchemy";
2
+ import { SE } from "@shipengine/react-api";
3
3
  /**
4
4
  * @internal
5
5
  *
@@ -1,4 +1,4 @@
1
- import { FundingSourceTransaction } from "@shipengine/alchemy";
1
+ import { FundingSourceTransaction } from "@shipengine/react-api";
2
2
  export type HistoryCardProps = {
3
3
  carrierInfo: {
4
4
  carrierCode: string;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -1,4 +1,4 @@
1
- import { PageableResult } from "@shipengine/alchemy";
1
+ import { PageableResult } from "@shipengine/react-api";
2
2
  type PagerProps = {
3
3
  currentPageSize: number;
4
4
  onPageSelect: (page: number) => void;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type RateDetailsProps = {
3
3
  /**
4
4
  * `onVatRegistrationComplete` callback that notifies that the vat registration has been successfully completed
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type SaveStatusProps = {
3
3
  errors?: SE.CodedError[] | null;
4
4
  isSaving?: boolean;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  type ServicePointsProps = {
3
3
  mapViewEnabled?: boolean;
4
4
  onSelectServicePoint?: (servicePoint: SE.ServicePoint) => void;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  type AddressDisplayProps = {
3
3
  address: SE.Address;
4
4
  decoratorText?: string;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type AddressPreference = SE.AddressValidation & {
3
3
  alternative?: SE.Address;
4
4
  alternativeSource: "originalAddress" | "matchedAddress";
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type AddressSuggested = {
3
3
  validation: SE.AddressValidation;
4
4
  validationType: "SUGGESTED";
@@ -0,0 +1,12 @@
1
+ import { RJSFSchema, UiSchema } from "@rjsf/utils";
2
+ export type ConnectExternalCarrierFormProps = {
3
+ carrierName: string;
4
+ displayName: string;
5
+ iconUrl: string;
6
+ isBeta?: boolean;
7
+ jsonSchema: RJSFSchema;
8
+ onCancel?: () => void;
9
+ onCarrierConnected?: (carrierId: string) => void;
10
+ uiSchema: UiSchema;
11
+ };
12
+ export declare const ConnectExternalCarrierForm: ({ carrierName, displayName, iconUrl, isBeta, jsonSchema, uiSchema, onCancel, onCarrierConnected, }: ConnectExternalCarrierFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./connect-external-carrier-form";
@@ -5,7 +5,7 @@ export * from "./address-parser";
5
5
  export * from "./address-preference-display";
6
6
  export * from "./address-preference-select";
7
7
  export * from "./label";
8
- export * from "../../features/shipengine-carriers";
8
+ export * from "../../features/manage-carriers";
9
9
  export * from "./product-form";
10
10
  export * from "./rate-form";
11
11
  export * from "./shipment-form";
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type LabelProps = {
3
3
  label: SE.Label & {
4
4
  carrier?: SE.Carrier;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SE } from "@shipengine/alchemy";
2
+ import { SE } from "@shipengine/react-api";
3
3
  export type ProductFormProps<T = undefined> = {
4
4
  currency: SE.Currency;
5
5
  expectedCurrency?: SE.Currency;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  type ProductsDisplayProps = {
3
3
  currency: SE.Currency;
4
4
  onUpdate: (products: SE.Product[]) => Promise<void>;
@@ -1,8 +1,7 @@
1
- import { SE } from "@shipengine/alchemy";
2
- import { ConfigureShipmentFeatures } from "../../../elements/purchase-label/configure-shipment";
3
- import { VatSettingsFeatures } from "../../../features";
1
+ import { SE } from "@shipengine/react-api";
4
2
  import { ServicePointSearchQuery } from "../../../hooks";
5
3
  import { PreferredRatesResponse } from "../../../types";
4
+ import { RateFormFeatures } from "../../../utilities";
6
5
  export type RateFormProps = {
7
6
  carriers?: SE.Carrier[];
8
7
  currency: SE.Currency;
@@ -11,7 +10,7 @@ export type RateFormProps = {
11
10
  displayableSaveRateErrors?: string[];
12
11
  displayableShipmentErrors?: string[];
13
12
  errors?: SE.CodedError[];
14
- features?: ConfigureShipmentFeatures & VatSettingsFeatures;
13
+ features?: RateFormFeatures;
15
14
  fetchServicePoints: (searchQuery: string) => void;
16
15
  isLoading?: boolean;
17
16
  labelErrors?: string[];
@@ -1,17 +1,9 @@
1
- import { SE } from "@shipengine/alchemy";
2
- import { VatSettingsFeatures } from "../../../features";
1
+ import { SE } from "@shipengine/react-api";
2
+ import { ShipmentSummaryFeatures } from "../../../utilities";
3
3
  export declare const schedulePickupForCarrier: (carrierCode?: string, plaftformSchedulePickupUrl?: string) => string | undefined;
4
- export type ShipmentFeatures = {
5
- presentation?: {
6
- poweredByShipEngine?: boolean;
7
- };
8
- shipment?: {
9
- schedulePickup?: boolean;
10
- };
11
- };
12
4
  export type ShipmentProps = {
13
5
  carriers?: SE.Carrier[];
14
- features?: ShipmentFeatures & VatSettingsFeatures;
6
+ features?: ShipmentSummaryFeatures;
15
7
  labels?: SE.Label[];
16
8
  onClickPrintLabel?: () => void;
17
9
  onClickPurchaseLabel?: (order: SE.SalesOrder) => void;
@@ -1,21 +1,14 @@
1
1
  import React from "react";
2
- import { SE } from "@shipengine/alchemy";
2
+ import { SE } from "@shipengine/react-api";
3
3
  import { UseShippingPresetsOptionsProps } from "../../../hooks";
4
4
  import { ShippingPreset } from "../../../types";
5
+ import { ShipmentFormFeatures } from "../../../utilities";
5
6
  import { AddressParserPayload } from "../address-parser";
6
7
  import { AddressPreference, AddressPreferenceDisplayProps } from "../address-preference-display";
7
8
  export type OnChangeAddressOptions = {
8
9
  shouldValidate?: boolean;
9
10
  };
10
11
  export type ShipmentFormMode = "browse_rates" | "select_service";
11
- export type ShipmentFormFeatures = {
12
- addOns?: boolean;
13
- browseRates?: boolean;
14
- includeShipsuranceInsurance?: boolean;
15
- includeThirdPartyInsurance?: boolean;
16
- selectService?: boolean;
17
- shippingPresets?: boolean;
18
- };
19
12
  export type ShipmentFormProps = {
20
13
  accountSettings?: SE.AccountSettings;
21
14
  addressLoading: boolean;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { SE } from "@shipengine/alchemy";
2
+ import { SE } from "@shipengine/react-api";
3
3
  type GetShipmentSchemaOptions = {
4
4
  dimensionsUnit?: SE.DimensionUnit;
5
5
  isContentDescriptionRequired?: boolean;
@@ -1,5 +1,5 @@
1
- import { SE } from "@shipengine/alchemy";
2
1
  import { WithChildrenCommonProps } from "@shipengine/giger";
2
+ import { SE } from "@shipengine/react-api";
3
3
  export type SuspendSalesOrderProps = WithChildrenCommonProps<{
4
4
  errors?: SE.CodedError[];
5
5
  isLoading?: boolean;
@@ -1,5 +1,5 @@
1
- import { SE } from "@shipengine/alchemy";
2
1
  import { WithChildrenCommonProps } from "@shipengine/giger";
2
+ import { SE } from "@shipengine/react-api";
3
3
  export type SuspendShipmentProps = WithChildrenCommonProps<{
4
4
  errors?: SE.CodedError[];
5
5
  isLoading?: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SE } from "@shipengine/alchemy";
2
+ import { SE } from "@shipengine/react-api";
3
3
  import { BillingAddressPayload } from "./wallet-schema";
4
4
  export type EditWalletAddressFormProps<T = undefined> = {
5
5
  address?: SE.Address;
@@ -1,5 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
2
- import { VatSettingsFeatures } from "../../../features";
1
+ import { SE } from "@shipengine/react-api";
3
2
  export type WalletFormFeatures = {};
4
3
  export type WalletPayload = {
5
4
  address: SE.Address;
@@ -9,7 +8,6 @@ export type WalletPayload = {
9
8
  export type WalletFormProps = {
10
9
  address: SE.Address;
11
10
  errors?: SE.CodedError[] | null;
12
- features?: VatSettingsFeatures;
13
11
  onSubmit: (payload: WalletPayload) => Promise<void>;
14
12
  };
15
- export declare const WalletForm: ({ address, errors, onSubmit, features }: WalletFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
13
+ export declare const WalletForm: ({ address, errors, onSubmit }: WalletFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { Provider } from "@shipengine/alchemy";
2
+ import { Provider } from "@shipengine/react-api";
3
3
  export declare const walletEmailSchemas: {
4
4
  emailOptional: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
5
5
  emailRequired: z.ZodString;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type WalletCardProps = {
3
3
  fundingSource?: SE.FundingSource;
4
4
  onEdit: () => void;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type WarehousePayload = Partial<SE.Warehouse> & Pick<SE.Warehouse, "name" | "originAddress" | "isDefault">;
3
3
  export type WarehouseFormProps = {
4
4
  onCancel?: () => void;
@@ -0,0 +1,10 @@
1
+ import { Theme } from "@emotion/react";
2
+ import { Interpolation } from "@emotion/serialize";
3
+ import { ElementComponent, ElementFallbackComponent, TranslationResources } from "./element";
4
+ export interface CreateElementOptions<T extends TranslationResources> {
5
+ css?: Interpolation<Theme>;
6
+ resources?: T;
7
+ }
8
+ export declare const createElement: <P extends object, T extends TranslationResources<import("./element").TranslationNamespaces>>(Component: ElementComponent<P>, fallback: ElementFallbackComponent, options?: CreateElementOptions<T> | undefined) => ({ resources, ...props }: P & {
9
+ resources?: T | undefined;
10
+ }) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { WithConditionalCSSProp } from "@emotion/react/types/jsx-namespace";
3
+ import { TranslationResources } from "./hooks";
4
+ export type ElementComponentProps = object & WithConditionalCSSProp<object>;
5
+ export type ElementComponent<P extends ElementComponentProps> = React.ComponentType<P>;
6
+ export type ElementFallbackComponentProps = {
7
+ error: Error;
8
+ };
9
+ export type ElementFallbackComponent = React.ComponentType<ElementFallbackComponentProps>;
10
+ export interface ElementProps {
11
+ children: React.ReactElement<ElementComponentProps>;
12
+ className?: string;
13
+ fallback: ElementFallbackComponent;
14
+ resources?: TranslationResources;
15
+ }
16
+ export declare const Element: ({ children, className, fallback: FallbackComponent, resources, }: ElementProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
@@ -0,0 +1 @@
1
+ export * from "./use-i18n";
@@ -0,0 +1,12 @@
1
+ export type TranslationNamespaces = {
2
+ [key: string]: Record<string, any>;
3
+ common: Record<string, any>;
4
+ };
5
+ export type TranslationResources<Namespaces = TranslationNamespaces> = {
6
+ [key: string]: Namespaces;
7
+ en: Namespaces;
8
+ };
9
+ export interface UseI18nProps {
10
+ resources?: TranslationResources;
11
+ }
12
+ export declare const useI18n: ({ resources }: UseI18nProps) => import("i18next").i18n;
@@ -0,0 +1,3 @@
1
+ export * from "./element";
2
+ export * from "./hooks";
3
+ export * from "./utils";
@@ -0,0 +1,2 @@
1
+ import { EmotionCache } from "@emotion/react";
2
+ export declare const getEmotionCache: (scope: string, container?: HTMLElement) => EmotionCache;
@@ -0,0 +1 @@
1
+ export * from "./get-emotion-cache";
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+ import { ElementsErrorHandler } from "../../elements-provider";
3
+ export interface ErrorProps {
4
+ error: Error;
5
+ }
6
+ export type ErrorBoundaryProps = {
7
+ children: React.ReactNode;
8
+ fallback: React.ComponentType<{
9
+ error: Error;
10
+ }>;
11
+ onError: ElementsErrorHandler;
12
+ };
13
+ type ErrorBoundaryState = {
14
+ error?: Error;
15
+ };
16
+ declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
17
+ constructor(props: ErrorBoundaryProps);
18
+ componentDidCatch(error: Error, context: React.ErrorInfo): void;
19
+ render(): string | number | boolean | React.ReactFragment | import("@emotion/react/jsx-runtime").JSX.Element | null | undefined;
20
+ }
21
+ export { ErrorBoundary };
@@ -0,0 +1 @@
1
+ export * from "./error-boundary";
@@ -0,0 +1 @@
1
+ export * from "./create-element";