@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
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  import { SelectCategory } from "../../components/field/select";
3
3
  /**
4
4
  * @internal
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  import { PreferredRateAcknowledgementMessage, PreferredRatesResponse } from "../../types";
3
3
  /**
4
4
  * @internal
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  import { SelectCategory } from "../../components/field/select";
3
3
  /**
4
4
  * @internal
@@ -1,4 +1,4 @@
1
- import { ListServicePointsOptionAddress, ListServicePointsOptionAddressQuery, ListServicePointsOptionCoordinates, Rate, SE } from "@shipengine/alchemy";
1
+ import { ListServicePointsOptionAddress, ListServicePointsOptionAddressQuery, ListServicePointsOptionCoordinates, Rate, SE } from "@shipengine/react-api";
2
2
  export type ServicePointSearchQuery = ListServicePointsOptionAddress["address"] | ListServicePointsOptionAddressQuery["addressQuery"] | ListServicePointsOptionCoordinates;
3
3
  export declare const useServicePoints: (rates?: Rate[], shipment?: SE.SalesOrderShipment) => {
4
4
  fetchServicePoints: (searchQuery?: ServicePointSearchQuery) => void;
@@ -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 { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  import { ShippingPreset } from "../../types";
3
3
  /**
4
4
  * @internal
@@ -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
1
  /// <reference types="react" />
2
- import { SE } from "@shipengine/alchemy";
2
+ import { SE } from "@shipengine/react-api";
3
3
  import { ValidationPreference } from "../components/address-preference-context";
4
4
  /**
5
5
  * @internal
@@ -1,7 +1,7 @@
1
- import { SalesOrderShipment } from "@shipengine/alchemy";
1
+ import { SalesOrderShipment } from "@shipengine/react-api";
2
2
  export declare const useGetOrCreateShipment: (onShipmentUpdated: ((shipment: SalesOrderShipment) => void | Promise<void>) | undefined, shipmentId?: string) => {
3
- errors: import("@shipengine/alchemy").CodedError[] | undefined;
3
+ errors: import("@shipengine/react-api").CodedError[] | undefined;
4
4
  isLoading: boolean;
5
- refetchShipment: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<SalesOrderShipment, import("@shipengine/alchemy").CodedError[]>>;
5
+ refetchShipment: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<SalesOrderShipment, import("@shipengine/react-api").CodedError[]>>;
6
6
  shipment: SalesOrderShipment | undefined;
7
7
  };
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  type UseScrubErrorsProps = {
3
3
  errors?: SE.CodedError[];
4
4
  predicate?: (e: SE.CodedError) => boolean;
package/src/index.d.ts CHANGED
@@ -7,3 +7,4 @@ export * from "./schemas";
7
7
  export * from "./types";
8
8
  export * from "./utilities";
9
9
  export * from "./workflows";
10
+ export * from "./elements-provider";
@@ -94,7 +94,7 @@ declare const _default: {
94
94
  genericText: string;
95
95
  };
96
96
  };
97
- "shipengine-carriers": {
97
+ "manage-carriers": {
98
98
  title: string;
99
99
  headers: {
100
100
  accountCarriers: string;
@@ -1,5 +1,5 @@
1
1
  import { DeepPartial } from "fishery";
2
- import { SE } from "@shipengine/alchemy";
2
+ import { SE } from "@shipengine/react-api";
3
3
  export type CreateCarrierHandlersParams = {
4
4
  get?: DeepPartial<SE.Carrier>;
5
5
  list?: [count: number, listParams?: DeepPartial<SE.Carrier>];
@@ -1,5 +1,5 @@
1
1
  import { DeepPartial } from "fishery";
2
- import { SE } from "@shipengine/alchemy";
2
+ import { SE } from "@shipengine/react-api";
3
3
  export type CreateWarehouseHandlersParams = {
4
4
  get?: DeepPartial<SE.Warehouse>;
5
5
  list?: [count: number, listParams?: DeepPartial<SE.Warehouse>];
@@ -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
  /**
4
4
  * @internal
5
5
  *
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { prettyFormat as __ } from "@testing-library/dom/types/pretty-dom";
3
+ import { RenderOptions } from "@testing-library/react";
3
4
  import { UserEvent } from "@testing-library/user-event/dist/types/setup/setup";
4
5
  import { IconNames, Theme } from "@shipengine/giger-theme";
6
+ import { ElementsTestProviderProps } from "../elements-provider/elements-test-provider";
5
7
  import server, { baseUrl } from "../mocks/server";
6
8
  declare const theme: Theme;
7
9
  declare const delayedFn: () => Promise<void>;
@@ -170,6 +172,9 @@ declare const customWithin: (element: HTMLElement) => {
170
172
  export * from "@testing-library/react";
171
173
  export { rest } from "msw";
172
174
  export { baseUrl, customScreen as screen, customWithin as within, delayedFn, server, theme };
175
+ export declare const ContentWrapper: ({ children }: {
176
+ children: JSX.Element;
177
+ }) => import("@emotion/react/jsx-runtime").JSX.Element;
173
178
  export declare const renderWithProviders: (component: any) => {
174
179
  readonly user: UserEvent;
175
180
  view: import("@testing-library/react").RenderResult<{
@@ -234,7 +239,7 @@ export declare const renderWithProviders: (component: any) => {
234
239
  * This allows components to simulate usage in an Element via `decorators: [withAllProviders]`
235
240
  **/
236
241
  export declare const renderWithAllProviders: (component: any) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
237
- export declare const renderWithAlchemy: (component: any) => {
242
+ export declare const renderWithElements: (component: any, features?: ElementsTestProviderProps["features"]) => {
238
243
  user: UserEvent;
239
244
  container: HTMLElement;
240
245
  baseElement: HTMLElement;
@@ -291,3 +296,4 @@ export declare const renderWithAlchemy: (component: any) => {
291
296
  findByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement>;
292
297
  findAllByTestId: (id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined) => Promise<HTMLElement[]>;
293
298
  };
299
+ export declare const renderWithContent: (ui: React.ReactElement, options?: Omit<RenderOptions, "wrapper">) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
@@ -0,0 +1,3 @@
1
+ import { CustomThemeData } from "@shipengine/giger-theme";
2
+ declare const fallbackThemeData: CustomThemeData;
3
+ export default fallbackThemeData;
@@ -0,0 +1,4 @@
1
+ declare const themeData: {
2
+ fallback: import("@shipengine/giger-theme/dist/lib/ThemeTypes").CustomThemeData;
3
+ };
4
+ export default themeData;
@@ -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 { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type PreferredRateAcknowledgementMessage = {
3
3
  link?: {
4
4
  text: string;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type ShippingPreset = {
3
3
  confirmation?: SE.ConfirmationType;
4
4
  dimensions?: SE.DimensionsWithUnit;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -0,0 +1,18 @@
1
+ import { ElementsFeatureFlags } from "./types";
2
+ declare const defaultFeatureFlags: Required<ElementsFeatureFlags>;
3
+ /**
4
+ * @internal
5
+ *
6
+ * # Feature Flags - featureFlagComponentNameLookup
7
+ */
8
+ export declare const featureFlagComponentNameLookup: (componentName: string) => string;
9
+ /**
10
+ * @internal
11
+ *
12
+ * # Feature Flags - getFeatures
13
+ */
14
+ export declare const getDefaultFeatures: (elements: Array<keyof typeof defaultFeatureFlags>) => ElementsFeatureFlags[keyof typeof defaultFeatureFlags];
15
+ export type FeatureObject = Record<string, unknown>;
16
+ export declare const isObject: (item: unknown) => item is FeatureObject;
17
+ export declare function deepMergeFeatures<T extends FeatureObject>(defaults: T, custom?: T): T;
18
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./feature-flags";
2
+ export * from "./types";
@@ -0,0 +1,141 @@
1
+ import { CountryCode } from "../../constants";
2
+ export type EnabledExternalCarriers = ("apc" | "asendia" | "better_trucks" | "canpar" | "chronopost" | "couriers_please" | "courierpost" | "dpd" | "hermes_germany" | "intelliquick_delivery" | "lso" | "ontrac" | "seko" | "ups" | "yodel")[];
3
+ export type EnabledShipEngineCarriers = ("aramex_au_walleted" | "canada_post_walleted" | "canpar_walleted" | "couriersplease_walleted" | "sendle_walleted" | "dhl_express_walleted" | "dhl_express_worldwide" | "dpd_germany_walleted" | "dpdwallet" | "globalpost" | "hermes" | "purolator_walleted" | "stamps_com" | "ups_walleted" | "ups" | "yodel_walleted")[];
4
+ export type RateFormFeatures = {
5
+ /**
6
+ * Enables the `funding` section of the rate form.
7
+ */
8
+ enableFunding?: boolean;
9
+ /**
10
+ * Enables the `global post filtering` on all rates fetched in the rates form.
11
+ */
12
+ enableGlobalPostFiltering?: boolean;
13
+ /**
14
+ * Enables the Pick Up/Drop Off tabs UI in the Rate Form to separate rates with PUDO capability by type.
15
+ */
16
+ enablePudoUI?: boolean;
17
+ /**
18
+ * Enables the `label layout` section of the Purchase Label element.
19
+ */
20
+ labelLayout?: boolean;
21
+ /**
22
+ * Enables showing the `carrier nickname` when rates are fetched.
23
+ */
24
+ nicknameRate?: boolean;
25
+ /**
26
+ * Enables the `DHL terms acknowledgement` when rates are fetched.
27
+ */
28
+ requireDhlTermsAcknowledgement?: boolean;
29
+ /**
30
+ * Enables the `save rate` button in the rate form. This allows users to save a `rateId` for a shipment to be purchased later.
31
+ */
32
+ saveRate?: boolean;
33
+ };
34
+ export type ShipmentFormFeatures = {
35
+ /**
36
+ * Enables the `Add-Ons` section of the shipment form. This allows users to add additional services to their shipment such as
37
+ * delivery confirmation and insurance.
38
+ */
39
+ addOns?: boolean;
40
+ /**
41
+ * Enables the `browse rates` button in the shipment form. This allows users to browse rates for a shipment with
42
+ * varying shipment configurations. This is useful for rate shopping.
43
+ */
44
+ browseRates?: boolean;
45
+ /**
46
+ * Enables the `shipsurance insurance` feature, allowing users to select Shipsurance when insuring their shipment.
47
+ */
48
+ includeShipsuranceInsurance?: boolean;
49
+ /**
50
+ * Enables the `third party insurance` feature, allowing users to opt for third party insurance when insuring their shipment.
51
+ */
52
+ includeThirdPartyInsurance?: boolean;
53
+ /**
54
+ * Enables the `select service` feature, allowing users to select a service when rate shopping across multiple carrier providers.
55
+ */
56
+ selectService?: boolean;
57
+ /**
58
+ * Enables the `shipping presets` feature, allowing users to pass in a set of shipping presets they wish to use within the
59
+ * shipment form of the PurchaseLabel element.
60
+ */
61
+ shippingPresets?: boolean;
62
+ };
63
+ export type ShipmentSummaryFeatures = {
64
+ schedulePickup?: boolean;
65
+ };
66
+ export type PurchaseLabelFeatures = {
67
+ /**
68
+ * List of all supported `countries` available in ShipEngine Elements.
69
+ */
70
+ compatibleCountryCodes?: CountryCode[];
71
+ /**
72
+ * When enabled will modify the default behavior of creating a new shipment for a salesorder to throwing an error
73
+ */
74
+ enableErrorWhenShipmentCancelled?: boolean;
75
+ /**
76
+ * @internal
77
+ *
78
+ * `partnerMessages` enables the partner consuming elements to specify override messages in specific cases.
79
+ */
80
+ partnerMessages?: {
81
+ incompleteLabelPurchaseRequirements?: string;
82
+ };
83
+ /**
84
+ * All scoped feature flags for the `rate form` section of the PurchaseLabel element.
85
+ */
86
+ rateForm?: RateFormFeatures;
87
+ /**
88
+ * All scoped feature flags for the `shipment form` section of the PurchaseLabel element.
89
+ */
90
+ shipmentForm?: ShipmentFormFeatures;
91
+ };
92
+ export type AccountSettingsFeatures = {
93
+ /**
94
+ * Whether or not to display the ShipEngine Carriers section on the Account Settings element.
95
+ */
96
+ showCarrierServices?: boolean;
97
+ /**
98
+ * Whether or not to display the External Carriers section on the Account Settings element.
99
+ */
100
+ showExternalCarriers?: boolean;
101
+ /**
102
+ * Whether or not to display the Shipping Label Layout section on the Account Settings element.
103
+ */
104
+ showLabelLayout?: boolean;
105
+ /**
106
+ * Whether or not to display the Ship From Locations section on the Account Settings element.
107
+ */
108
+ showManageWarehouses?: boolean;
109
+ /**
110
+ * Whether or not to display the Units of Measure section on the Account Settings element.
111
+ */
112
+ showUnitSettings?: boolean;
113
+ /**
114
+ * Whether or not to display the Taxes section on the Account Settings element.
115
+ */
116
+ showVatSettings?: boolean;
117
+ };
118
+ export type GlobalFeatures = {
119
+ /**
120
+ * Availible "Bring your own carrier" carrier codes for carriers that may be added. If this is omitted, new carriers may not be added by this element.
121
+ */
122
+ enabledExternalCarriers?: EnabledExternalCarriers;
123
+ /**
124
+ * list of all walleted carriers that are enabled for use in Elements.
125
+ */
126
+ enabledShipEngineCarriers?: EnabledShipEngineCarriers;
127
+ /**
128
+ * Enables the `Powered by ShipEngine` logo in the footer various elements.
129
+ */
130
+ poweredByShipEngine?: boolean;
131
+ /**
132
+ * Enable the VAT settings to be shown
133
+ */
134
+ showVatSettings?: boolean;
135
+ };
136
+ export type ElementsFeatureFlags = {
137
+ accountSettingsFeatures?: AccountSettingsFeatures;
138
+ globalFeatures?: GlobalFeatures;
139
+ purchaseLabelFeatures?: PurchaseLabelFeatures;
140
+ shipmentSummaryFeatures?: ShipmentSummaryFeatures;
141
+ };
@@ -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 { Rate, SE } from "@shipengine/alchemy";
1
+ import { Rate, SE } from "@shipengine/react-api";
2
2
  /**
3
3
  * @internal
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,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 { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  /**
3
3
  * @internal
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,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -1,2 +1,2 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export declare const getDefaultWarehouse: (warehouses: SE.Warehouse[]) => SE.Warehouse;
@@ -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,17 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { ShipEngineCarriersFeatures, VatSettingsFeatures } from "../../features";
3
- import { ConnectCarrier } from "../connect-carrier";
4
- export type AccountSettingsFeatures = ShipEngineCarriersFeatures & ConnectCarrier.ConnectCarrierFeatures & VatSettingsFeatures;
5
- /**
6
- * # Account Settings Component Props
7
- *
8
- * - These are the base props that will be passed into the `<AccountSettings />` component.
9
- *
10
- * @see {@link AccountSettings.Component | This prop types usage in the `<AccountSettings /> component`}
11
- */
2
+ import { AccountSettingsFeatures } from "../../utilities";
12
3
  export type ComponentProps = {
13
4
  /**
14
- * Feature flags controlling operation of various sub components.
5
+ * `features` is a set of feature flags you would like to enable or disable in this component.
15
6
  */
16
7
  features?: AccountSettingsFeatures;
17
8
  };
@@ -35,7 +26,7 @@ export declare const Component: ({ features }: ComponentProps) => import("@emoti
35
26
  * <br />
36
27
  *
37
28
  * @see {@link AccountSettings.ComponentProps | The **props** that can be passed into the `<AccountSettings.Element />` component}
38
- * @see {@link ManageWalletWorkflow.Element | The `<Manage-Wallet-Workflow />` component used to view connected carriers and manage funding}
29
+ * @see {@link CarrierServices.Element | The `<CarrierServices />` component used to view connected carriers and manage funding}
39
30
  * @see {@link ManageWarehouses.Component | The `<ManageWarehouses />` component used to add, update, or remove warehouses}
40
31
  * @see {@link PaymentMethodSettings | The `<PaymentMethodSettings />` component used to manage payment methods}
41
32
  * @see {@link ManageFunding | The `<ManageFunding />` component used to manage funding rules and add funds to a carrier account}
@@ -138,7 +129,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
138
129
  genericText: string;
139
130
  };
140
131
  };
141
- "shipengine-carriers": {
132
+ "manage-carriers": {
142
133
  title: string;
143
134
  headers: {
144
135
  accountCarriers: string;
@@ -270,7 +261,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
270
261
  addPackageDetails: string;
271
262
  };
272
263
  errorMessages: {
273
- customsItemsRequired: string;
264
+ customsItemsRequired: string; /**
265
+ * `features` is a set of feature flags you would like to enable or disable in this component.
266
+ */
274
267
  invalidAddress: string;
275
268
  noRates: string;
276
269
  salesOrderNotLoaded: string;
@@ -1,43 +1,29 @@
1
1
  /// <reference types="react" />
2
- export type ConnectCarrierFeatures = {
3
- availableCarrierConnections?: string[];
4
- };
5
2
  /**
6
- * # Connect-Carrier Props
3
+ * # Manage-Wallet-Workflow Component
7
4
  *
8
- * @see {@link ConnectCarrier.Component | The `<ConnectCarrier />` component}
9
- */
10
- export type ComponentProps = {
11
- carrierName?: string;
12
- features?: ConnectCarrierFeatures;
13
- onCancel?: () => void;
14
- onCarrierConnected?: (carrierId: string) => void;
15
- };
16
- /**
17
- * # Connect-Carriers Component
5
+ * @param ComponentProps The base props that will be passed into the `<CarrierServices />` component.
18
6
  *
19
- * @param ComponentProps The base props that will be passed into the `<ConnectCarrier />` component.
20
- *
21
- * @returns Element A React element that renders the `<ConnectCarrier />` component allowing users
22
- * to connect their own existing carrier account. If no carrier is provided, the user may
23
- * select from a list of carriers specified by `features.availableCarrierConnections`.
24
- * This component is composed in the `<AccountSettings />` Element.
7
+ * @returns Element A React element that renders the `<CarrierServices />` component allowing users
8
+ * to view a list of carriers that are connected to their ShipEngine account, add funds to their wallet, view transaction history, and manage their payment method. This component is
9
+ * composed in the `<AccountSettings />` Element.
25
10
  *
26
11
  * @example
27
12
  * ```tsx
28
13
  * (() => {
29
- * const features = useFeatures("CarrierConnections");
14
+ * const features = useFeatures("Global");
30
15
  *
31
- * return <ConnectCarrier.Component features={features} />;
16
+ * return <CarrierServices.Element features={features} />;
32
17
  * })();
33
18
  * ```
34
19
  *
35
20
  * <br />
36
21
  *
37
- * @see {@link ConnectCarrier.ComponentProps | The props that are passed into the `<ConnectCarrier />` component}
22
+ * @see {@link CarrierServices.ComponentProps | The props that are passed into the `<Manage-Wallet-Workflow />` component}
23
+ * @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<Manage-Wallet-Workflow />` component}
38
24
  */
39
- export declare const Component: ({ carrierName, features, onCancel, onCarrierConnected, }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
40
- export declare const Element: ({ resources, ...props }: ComponentProps & {
25
+ export declare const Component: () => import("@emotion/react/jsx-runtime").JSX.Element;
26
+ export declare const Element: ({ resources, ...props }: object & {
41
27
  resources?: {
42
28
  en: {
43
29
  "wallet-history": {
@@ -135,7 +121,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
135
121
  genericText: string;
136
122
  };
137
123
  };
138
- "shipengine-carriers": {
124
+ "manage-carriers": {
139
125
  title: string;
140
126
  headers: {
141
127
  accountCarriers: string;
@@ -160,6 +146,29 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
160
146
  };
161
147
  billing: {
162
148
  title: string;
149
+ /**
150
+ * # Manage-Wallet-Workflow Component
151
+ *
152
+ * @param ComponentProps The base props that will be passed into the `<CarrierServices />` component.
153
+ *
154
+ * @returns Element A React element that renders the `<CarrierServices />` component allowing users
155
+ * to view a list of carriers that are connected to their ShipEngine account, add funds to their wallet, view transaction history, and manage their payment method. This component is
156
+ * composed in the `<AccountSettings />` Element.
157
+ *
158
+ * @example
159
+ * ```tsx
160
+ * (() => {
161
+ * const features = useFeatures("Global");
162
+ *
163
+ * return <CarrierServices.Element features={features} />;
164
+ * })();
165
+ * ```
166
+ *
167
+ * <br />
168
+ *
169
+ * @see {@link CarrierServices.ComponentProps | The props that are passed into the `<Manage-Wallet-Workflow />` component}
170
+ * @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<Manage-Wallet-Workflow />` component}
171
+ */
163
172
  cardSubTitle: string;
164
173
  addressSubTitle: string;
165
174
  info: string;
@@ -621,29 +630,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
621
630
  postalCode: string;
622
631
  phone: string;
623
632
  email: string;
624
- /**
625
- * # Connect-Carriers Component
626
- *
627
- * @param ComponentProps The base props that will be passed into the `<ConnectCarrier />` component.
628
- *
629
- * @returns Element A React element that renders the `<ConnectCarrier />` component allowing users
630
- * to connect their own existing carrier account. If no carrier is provided, the user may
631
- * select from a list of carriers specified by `features.availableCarrierConnections`.
632
- * This component is composed in the `<AccountSettings />` Element.
633
- *
634
- * @example
635
- * ```tsx
636
- * (() => {
637
- * const features = useFeatures("CarrierConnections");
638
- *
639
- * return <ConnectCarrier.Component features={features} />;
640
- * })();
641
- * ```
642
- *
643
- * <br />
644
- *
645
- * @see {@link ConnectCarrier.ComponentProps | The props that are passed into the `<ConnectCarrier />` component}
646
- */
647
633
  addressResidentialIndicator: string;
648
634
  };
649
635
  noResults: string;
@@ -0,0 +1 @@
1
+ export * as CarrierServices from "./carrier-services";