@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,40 +1,38 @@
1
1
  /// <reference types="react" />
2
- import { ShipEngineCarriersFeatures } from "../../features/shipengine-carriers";
3
2
  /**
4
- * # Manage-Wallet-Workflow Props
3
+ * # ConnectExternalCarrier Props
5
4
  *
6
- * @see {@link ManageWalletWorkflow.Element | The `<Manage-Wallet-Workflow />` component}
5
+ * @see {@link ConnectExternalCarrier.Component | The `<ConnectExternalCarrier />` component}
7
6
  */
8
7
  export type ComponentProps = {
9
- /**
10
- * `features` is a set of feature flags you would like to enable or disable in this component.
11
- */
12
- features?: ShipEngineCarriersFeatures;
8
+ carrierName?: string;
9
+ onCancel?: () => void;
10
+ onCarrierConnected?: (carrierId: string) => void;
13
11
  };
14
12
  /**
15
- * # Manage-Wallet-Workflow Component
13
+ * # ConnectExternalCarrier Component
16
14
  *
17
- * @param ComponentProps The base props that will be passed into the `<Manage-Wallet-Workflow />` component.
15
+ * @param ComponentProps The base props that will be passed into the `<ConnectExternalCarrier />` component.
18
16
  *
19
- * @returns Element A React element that renders the `<Manage-Wallet-Workflow />` component allowing users
20
- * 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
21
- * composed in the `<AccountSettings />` Element.
17
+ * @returns Element A React element that renders the `<ConnectExternalCarrier />` component allowing users
18
+ * to connect their own existing carrier account. If no carrier is provided, the user may
19
+ * select from a list of carriers specified by `features.availableCarrierConnections`.
20
+ * This component is composed in the `<AccountSettings />` Element.
22
21
  *
23
22
  * @example
24
23
  * ```tsx
25
24
  * (() => {
26
- * const features = useFeatures("Global");
25
+ * const features = useFeatures("CarrierConnections");
27
26
  *
28
- * return <ManageWalletWorkflow.Element features={features} />;
27
+ * return <ConnectExternalCarrier.Component features={features} />;
29
28
  * })();
30
29
  * ```
31
30
  *
32
31
  * <br />
33
32
  *
34
- * @see {@link ManageWalletWorkflow.ComponentProps | The props that are passed into the `<Manage-Wallet-Workflow />` component}
35
- * @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<Manage-Wallet-Workflow />` component}
33
+ * @see {@link ConnectExternalCarrier.ComponentProps | The props that are passed into the `<ConnectExternalCarrier />` component}
36
34
  */
37
- export declare const Component: ({ features }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
35
+ export declare const Component: ({ carrierName, onCancel, onCarrierConnected }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
38
36
  export declare const Element: ({ resources, ...props }: ComponentProps & {
39
37
  resources?: {
40
38
  en: {
@@ -133,7 +131,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
133
131
  genericText: string;
134
132
  };
135
133
  };
136
- "shipengine-carriers": {
134
+ "manage-carriers": {
137
135
  title: string;
138
136
  headers: {
139
137
  accountCarriers: string;
@@ -385,9 +383,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
385
383
  messageLine2: string;
386
384
  };
387
385
  stepLabel: {
388
- /**
389
- * `features` is a set of feature flags you would like to enable or disable in this component.
390
- */
391
386
  accountRegistration: string;
392
387
  termsAgreement: string;
393
388
  shipFromAddress: string;
@@ -0,0 +1 @@
1
+ export * as ConnectExternalCarrier from "./connect-external-carrier";
@@ -1,4 +1,5 @@
1
1
  export * from "./onboarding";
2
- export * from "./purchase-label-workflow";
2
+ export * from "./label-workflow";
3
3
  export * from "./account-settings";
4
- export * from "./connect-carrier";
4
+ export * from "./connect-external-carrier";
5
+ export * from "./carrier-services";
@@ -0,0 +1 @@
1
+ export * as LabelWorkflow from "./label-workflow";
@@ -1,16 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  import { Shipment } from "@shipengine/js-api";
3
- import { PurchaseLabel, ViewShipment, VoidLabel } from "../../elements";
3
+ import { PurchaseLabelFeatures, ShipmentSummaryFeatures } from "../../utilities";
4
4
  /**
5
5
  * @internal
6
6
  *
7
7
  * # Label Workflow Props
8
8
  *
9
- * - These are the base props that will be passed into the `<PurchaseLabelWorkflow />` component.
9
+ * - These are the base props that will be passed into the `<LabelWorkflow />` component.
10
10
  *
11
- * @see {@link PurchaseLabelWorkflow.Element | The `<PurchaseLabelWorkflow.Element />` component}
11
+ * @see {@link LabelWorkflow.Element | The `<LabelWorkflow.Element />` component}
12
12
  */
13
- export type PurchaseLabelWorkflowProps = {
13
+ export type LabelWorkflowProps = {
14
14
  /**
15
15
  * `callbacks` is an optional set of callbacks that will be invoked at various points in the
16
16
  * label purchasing workflow.
@@ -27,11 +27,7 @@ export type PurchaseLabelWorkflowProps = {
27
27
  /**
28
28
  * `features` is a set of feature flags you would like to enable or disable in this component.
29
29
  */
30
- features: PurchaseLabel.PurchaseLabelCommonProps["features"] & ViewShipment.ComponentProps["features"] & VoidLabel.ComponentProps["features"];
31
- /**
32
- * `labelId` is the unique identifier for the label you wish to view.
33
- */
34
- labelId?: string;
30
+ features: PurchaseLabelFeatures & ShipmentSummaryFeatures;
35
31
  /**
36
32
  * `multiplexedId` is the unique pattern of props that help index which Element is being displayed.
37
33
  */
@@ -64,7 +60,7 @@ export type PurchaseLabelWorkflowProps = {
64
60
  * setLabelId,
65
61
  * setShipmentId,
66
62
  * setIsVoidingLabel,
67
- * } = usePurchaseLabelWorkflow({
63
+ * } = useLabelWorkflow({
68
64
  * _labelId,
69
65
  * _multiplexedId,
70
66
  * });
@@ -72,9 +68,9 @@ export type PurchaseLabelWorkflowProps = {
72
68
  *
73
69
  * <br />
74
70
  *
75
- * @see {@link PurchaseLabelWorkflow.Element | The `<PurchaseLabelWorkflow.Element />` component using this hook}
71
+ * @see {@link LabelWorkflow.Element | The `<LabelWorkflow.Element />` component using this hook}
76
72
  */
77
- export declare const usePurchaseLabelWorkflow: ({ _multiplexedId, _labelId, }: {
73
+ export declare const useLabelWorkflow: ({ _multiplexedId, }: {
78
74
  _callbacks?: {
79
75
  /**
80
76
  * `onLabelCreateSuccess` is an optional callback function that will be invoked when a label
@@ -84,7 +80,6 @@ export declare const usePurchaseLabelWorkflow: ({ _multiplexedId, _labelId, }: {
84
80
  labelId: string;
85
81
  }, shipment: Shipment) => void) | undefined;
86
82
  } | undefined;
87
- _labelId?: string | undefined;
88
83
  _multiplexedId: ({
89
84
  orderSourceCode: string;
90
85
  } & ({
@@ -115,20 +110,7 @@ export declare const usePurchaseLabelWorkflow: ({ _multiplexedId, _labelId, }: {
115
110
  oneOff: true;
116
111
  };
117
112
  setIsVoidingLabel: import("react").Dispatch<import("react").SetStateAction<boolean>>;
118
- setLabelId: (nextLabelId: PurchaseLabelWorkflowProps["labelId"]) => void;
119
- setMultiplexedId: import("react").Dispatch<import("react").SetStateAction<({
120
- orderSourceCode: string;
121
- } & ({
122
- externalOrderNumber: string;
123
- } | {
124
- externalOrderId: string;
125
- })) | {
126
- salesOrderId: string;
127
- } | {
128
- shipmentId: string;
129
- } | {
130
- oneOff: true;
131
- }>>;
113
+ setLabelId: (nextLabelId?: string) => void;
132
114
  setShipmentId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
133
115
  shipmentId: string | undefined;
134
116
  };
@@ -137,17 +119,17 @@ export declare const usePurchaseLabelWorkflow: ({ _multiplexedId, _labelId, }: {
137
119
  *
138
120
  * # Label Workflow Element
139
121
  *
140
- * - The `<PurchaseLabelWorkflow.Element />` component is a composition of the PurchaseLabel, ViewShipment,
122
+ * - The `<LabelWorkflow.Element />` component is a composition of the PurchaseLabel, ShipmentSummary,
141
123
  * and VoidLabel elements that allows users to purchase a label, view the shipment details, and optionally void their shipping label.
142
124
  *
143
- * @param PurchaseLabelWorkflowProps The props necessary to render the `<PurchaseLabelWorkflow.Element />` for shipment
125
+ * @param LabelWorkflowProps The props necessary to render the `<LabelWorkflow.Element />` for shipment
144
126
  * based or sales order based label purchasing.
145
127
  *
146
- * @returns Element A React Element that will render the `<PurchaseLabelWorkflow />` component.
128
+ * @returns Element A React Element that will render the `<LabelWorkflow />` component.
147
129
  *
148
130
  * @example
149
131
  * ```tsx
150
- * <PurchaseLabelWorkflow
132
+ * <LabelWorkflow
151
133
  * {...elementProps}
152
134
  * callbacks={{ onLabelCreateSuccess }}
153
135
  * multiplexedId={elementIdProps}
@@ -156,7 +138,7 @@ export declare const usePurchaseLabelWorkflow: ({ _multiplexedId, _labelId, }: {
156
138
  *
157
139
  * <br />
158
140
  *
159
- * @see {@link PurchaseLabelWorkflowProps | The props that are passed into the `<PurchaseLabelWorkflow />` component}
160
- * @see {@link PurchaseLabelWorkflow.usePurchaseLabelWorkflow | The `hook` that is used to manage the state of the `<PurchaseLabelWorkflow />` component}
141
+ * @see {@link LabelWorkflowProps | The props that are passed into the `<LabelWorkflow />` component}
142
+ * @see {@link LabelWorkflow.useLabelWorkflow | The `hook` that is used to manage the state of the `<LabelWorkflow />` component}
161
143
  */
162
- export declare const Element: ({ multiplexedId: _multiplexedId, labelId: _labelId, features: propFeatures, callbacks, }: PurchaseLabelWorkflowProps) => import("@emotion/react/jsx-runtime").JSX.Element;
144
+ export declare const Element: ({ multiplexedId: _multiplexedId, features: propFeatures, callbacks }: LabelWorkflowProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  import { CarrierMetadataFromFundingSource } from "../../../../types";
3
3
  import { CarrierRecoveryFormPayload } from "./carrier-recovery-form-schema";
4
4
  export type CarrierRecoveryFormProps = {
@@ -1,11 +1,9 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  import { WalletPayload } from "../../../../components/templates/wallet-form";
3
- import { VatSettingsFeatures } from "../../../../features";
4
3
  export type FundingAndCarrierConnectionStepProps = {
5
4
  address: SE.Address;
6
5
  createFundingSourceErrors: SE.CodedError[] | null;
7
- features?: VatSettingsFeatures;
8
6
  onSubmit: (payload: WalletPayload) => Promise<void>;
9
7
  registerCarrierErrors: SE.CodedError[] | null;
10
8
  };
11
- export declare const FundingAndCarrierConnectionStep: ({ address, createFundingSourceErrors, onSubmit, registerCarrierErrors, features, }: FundingAndCarrierConnectionStepProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
9
+ export declare const FundingAndCarrierConnectionStep: ({ address, createFundingSourceErrors, onSubmit, registerCarrierErrors, }: FundingAndCarrierConnectionStepProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  import { WalletPayload } from "../../../../components/templates/wallet-form";
3
3
  type UseFundingAndCarrierConnectionStepProps = {
4
4
  isUpsEnabled: boolean;
@@ -1,5 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
2
- import { ShipEngineCarriersFeatures, VatSettingsFeatures } from "../../../../features";
1
+ import { SE } from "@shipengine/react-api";
3
2
  import { ShipFromAddressStepProps } from "../ship-from-address-step";
4
3
  export type ValidateWarehouse = {
5
4
  type: "warehouse";
@@ -13,15 +12,9 @@ export type ValidateBilling = {
13
12
  type: "billing";
14
13
  };
15
14
  export type ValidateAddress = ValidateWarehouse | ValidateBilling;
16
- export type OnboardingWizardFeatures = ShipEngineCarriersFeatures & {
17
- presentation: {
18
- poweredByShipEngine?: boolean;
19
- };
20
- } & VatSettingsFeatures;
21
15
  export type OnboardingWizardProps = {
22
16
  defaultShipFromAddress?: ShipFromAddressStepProps["defaultShipFromAddress"];
23
- features?: Partial<OnboardingWizardFeatures>;
24
17
  onComplete: () => void;
25
18
  partnerName?: string;
26
19
  };
27
- export declare const OnboardingWizard: ({ defaultShipFromAddress, features: customizedFeatures, onComplete: onWizardComplete, partnerName, }: OnboardingWizardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
20
+ export declare const OnboardingWizard: ({ defaultShipFromAddress, onComplete: onWizardComplete, partnerName, }: OnboardingWizardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  import { WarehousePayload } from "../../../../components";
3
3
  export type ShipFromAddressStepProps = {
4
4
  defaultShipFromAddress?: Pick<SE.Warehouse, "name" | "isDefault" | "originAddress" | "returnAddress">;
@@ -3,7 +3,7 @@ export type UseShipFromAddressStepProps = {
3
3
  onStepComplete: () => void;
4
4
  };
5
5
  export declare const useShipFromAddressStep: ({ onStepComplete }: UseShipFromAddressStepProps) => {
6
- defaultWarehouse: import("@shipengine/alchemy").Warehouse | undefined;
6
+ defaultWarehouse: import("@shipengine/react-api").Warehouse | undefined;
7
7
  handleSubmitShipFromAddress: (payload: WarehousePayload) => Promise<void>;
8
8
  isLoadingWarehouses: boolean;
9
9
  };
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export type TermsAgreementFormProps = {
3
3
  carrierTerms: SE.MetadataRequiredTerm[];
4
4
  hideTerms: boolean;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export type TermsAgreementStepProps = {
3
3
  carrierCodes: string[];
4
4
  carrierTerms: SE.MetadataRequiredTerm[];
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/react-api";
2
2
  export type UseTermsAgreementStepProps = {
3
3
  enabledCarriers: string[];
4
4
  onStepComplete: () => void;
@@ -10,8 +10,6 @@ import { OnboardingWizardProps } from "./components/onboarding-wizard";
10
10
  export type ComponentProps = {
11
11
  /** If provided, the address form will be pre-filled */
12
12
  defaultShipFromAddress?: OnboardingWizardProps["defaultShipFromAddress"];
13
- /** Flags to selectively enable / disable features. */
14
- features?: OnboardingWizardProps["features"];
15
13
  /** Invoked when the onboarding process is completed. */
16
14
  onComplete: () => void;
17
15
  /** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
@@ -33,7 +31,7 @@ export type ComponentProps = {
33
31
  * @example
34
32
  * You can see how the `<Component />` is used in the `createElement` function call below.
35
33
  * ```tsx
36
- * export const Element = alchemy.createElement(Component, ErrorFallback, {
34
+ * export const Element = createElement(Component, ErrorFallback, {
37
35
  * css: {
38
36
  * height: "100%",
39
37
  * maxWidth: "800px",
@@ -50,7 +48,7 @@ export type ComponentProps = {
50
48
  *
51
49
  * @see {@link Onboarding.Element | The **Element** created to render `<Onboarding />`}
52
50
  */
53
- export declare const Component: ({ defaultShipFromAddress, features, onComplete, partnerName, }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
51
+ export declare const Component: ({ defaultShipFromAddress, onComplete, partnerName }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
54
52
  /**
55
53
  * # Registered Onboarding Element
56
54
  *
@@ -135,7 +133,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
135
133
  dimensions: string;
136
134
  estimatedShipping: string;
137
135
  items: string;
138
- orderDate: string;
136
+ orderDate: string; /** If provided, the address form will be pre-filled */
139
137
  orderValue: string;
140
138
  requestedShipping: string;
141
139
  shipDate: string;
@@ -158,10 +156,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
158
156
  vatNumber: string;
159
157
  vatRegistrationTooltip: string;
160
158
  vatFormText: string;
161
- vatFormRegisterLater: string;
159
+ vatFormRegisterLater: string; /** If provided, the address form will be pre-filled */
162
160
  vatNumberInputHint: string;
163
161
  vatNumberInputPlaceholder: string;
164
- verifiedVat: string;
162
+ verifiedVat: string; /** Invoked when the onboarding process is completed. */
165
163
  vatFormErrors: {
166
164
  invalidFieldValue: string;
167
165
  verificationFailure: string;
@@ -171,7 +169,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
171
169
  genericText: string;
172
170
  };
173
171
  };
174
- "shipengine-carriers": {
172
+ "manage-carriers": {
175
173
  title: string;
176
174
  headers: {
177
175
  accountCarriers: string;
@@ -201,7 +199,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
201
199
  info: string;
202
200
  };
203
201
  vatSettings: {
204
- title: string; /** Invoked when the onboarding process is completed. */
202
+ title: string;
205
203
  };
206
204
  carriers: {
207
205
  title: string;
@@ -272,7 +270,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
272
270
  location_fee: string;
273
271
  oversize: string;
274
272
  returns: string;
275
- notifications: string; /** Invoked when the onboarding process is completed. */
273
+ notifications: string;
276
274
  tip: string;
277
275
  duties_and_taxes: string;
278
276
  brokerage_fee: string;
@@ -420,7 +418,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
420
418
  welcome: string;
421
419
  messageLine1: string;
422
420
  partnerMessageLine1: string;
423
- messageLine2: string; /** Flags to selectively enable / disable features. */
421
+ messageLine2: string;
424
422
  };
425
423
  stepLabel: {
426
424
  accountRegistration: string;
@@ -557,11 +555,11 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
557
555
  title: string;
558
556
  dimensions: {
559
557
  title: string;
560
- standard: string; /** Invoked when the onboarding process is completed. */
558
+ standard: string;
561
559
  metric: string;
562
560
  };
563
561
  weight: {
564
- title: string; /** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
562
+ title: string;
565
563
  standard: string;
566
564
  g: string;
567
565
  kg: string;
@@ -576,13 +574,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
576
574
  shipmentId: string;
577
575
  shipDate: string;
578
576
  shipTo: string;
579
- }; /**
580
- * # Onboarding Component Props
581
- *
582
- * - These are the base props that will be passed into the `<Onboarding />` component.
583
- *
584
- * @see {@link Onboarding.Component | This prop types usage in the `<Onboarding />` component}
585
- */
577
+ };
586
578
  actions: {
587
579
  download: {
588
580
  pdf: string;
@@ -612,9 +604,16 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
612
604
  disconnect: string;
613
605
  disconnectCarrier: string;
614
606
  };
607
+ /**
608
+ * # Onboarding Component Props
609
+ *
610
+ * - These are the base props that will be passed into the `<Onboarding />` component.
611
+ *
612
+ * @see {@link Onboarding.Component | This prop types usage in the `<Onboarding />` component}
613
+ */
615
614
  noCarriersDescription: string;
616
615
  registrationForm: {
617
- error: string;
616
+ error: string; /** If provided, the address form will be pre-filled */
618
617
  title: string;
619
618
  betaWarning: string;
620
619
  };
@@ -641,13 +640,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
641
640
  continue: string;
642
641
  delete: string;
643
642
  edit: string;
644
- /**
645
- * # Onboarding Component Props
646
- *
647
- * - These are the base props that will be passed into the `<Onboarding />` component.
648
- *
649
- * @see {@link Onboarding.Component | This prop types usage in the `<Onboarding />` component}
650
- */
651
643
  hide: string;
652
644
  parse: string;
653
645
  purchase: string;
@@ -665,10 +657,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
665
657
  countryCode: string;
666
658
  addressLine1: string;
667
659
  addressLine2: string;
668
- cityLocality: string;
660
+ cityLocality: string; /** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
669
661
  stateProvince: string;
670
662
  postalCode: string;
671
- phone: string; /** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
663
+ phone: string;
672
664
  email: string;
673
665
  addressResidentialIndicator: string;
674
666
  };
@@ -676,39 +668,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
676
668
  subFields: {
677
669
  optional: string;
678
670
  };
679
- /**
680
- * # Onboarding Component
681
- *
682
- * - The `<Onboarding />` component is used to onboard a new user to the ShipEngine platform. This
683
- * component will allow the user to create a warehouse, register a carrier, and create a funding
684
- * source for their account. This is everything a user needs to begin fulfilling their shipments
685
- * using the ShipEngine Platform.
686
- *
687
- * @param ComponentProps The base props that will be passed into the `<Onboarding />` component.
688
- *
689
- * @returns Element An EmotionJSX.Element that will render the `<Onboarding />` component
690
- * with all the appropriate wrappers.
691
- *
692
- * @example
693
- * You can see how the `<Component />` is used in the `createElement` function call below.
694
- * ```tsx
695
- * export const Element = alchemy.createElement(Component, ErrorFallback, {
696
- * css: {
697
- * height: "100%",
698
- * maxWidth: "800px",
699
- * minWidth: "440px",
700
- * overflow: "auto",
701
- * scrollbarGutter: "stable both-edges",
702
- * width: "100%",
703
- * },
704
- * resources: { en },
705
- * });
706
- * ```
707
- *
708
- * <br />
709
- *
710
- * @see {@link Onboarding.Element | The **Element** created to render `<Onboarding />`}
711
- */
712
671
  parserFields: {
713
672
  fullAddress: string;
714
673
  };
@@ -965,13 +924,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
965
924
  };
966
925
  title: string;
967
926
  sections: {
968
- /**
969
- * # Onboarding Component Props
970
- *
971
- * - These are the base props that will be passed into the `<Onboarding />` component.
972
- *
973
- * @see {@link Onboarding.Component | This prop types usage in the `<Onboarding />` component}
974
- */
975
927
  accountBalance: string;
976
928
  paymentMethod: string;
977
929
  transactionHistory: string;
@@ -0,0 +1 @@
1
+ import{z as t,G as e,J as a,K as r,M as n,N as s,O as o,Q as i,U as p,X as c,Y as l,Z as d,_ as m,$ as u,a0 as g}from"./warehouse-form-da6a7ac5.js";import{jsxs as h,Fragment as b,jsx as x}from"@emotion/react/jsx-runtime";import{Typography as f}from"@shipengine/giger";var I=Object.freeze({__proto__:null,CheckboxInput:t,CreditCardInput:e,DatePicker:a,ExpirationInput:r,InputGroup:n,transform:s,MoneyInput:o,NumberInput:i,RateSelect:p,SelectAutoComplete:c,Select:l,SubmitButton:d,Switch:m,TextArea:u,TextInput:g});const S=({children:t,notes:e})=>h(b,{children:[h("div",Object.assign({css:()=>({backgroundColor:"lightsteelblue",marginBottom:"16px",padding:"16px",paddingLeft:"32px"})},{children:[x(f,Object.assign({variant:"heading5"},{children:"Story notes:"})),x("ul",Object.assign({css:t=>({"> li":{marginTop:t.spacing(1)}})},{children:e.map((t=>x("li",{children:t},t)))}))]})),x("hr",{css:()=>({backgroundColor:"transparent",borderTop:"1px dotted lightgrey",marginBottom:"16px"})}),t]});export{S,I as f};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as n}from"@emotion/react/jsx-runtime";import{useRef as t,useLayoutEffect as r,useState as i,useMemo as o,useCallback as a}from"react";import{Icon as s,Table as c,TableFooter as l,TableHeader as d,TableHeaderRow as g,TableHeaderCell as h,Checkbox as p,TableBody as m,TableRow as u,TableBodyCell as b,Button as f,ButtonVariant as C,IconSize as w,DropdownOptionList as v,Option as O,Pagination as y,Skeleton as S,SkeletonAnimation as j,SkeletonVariant as x}from"@shipengine/giger";import{IconNames as k}from"@shipengine/giger-theme";import{c as P}from"./validation-b941a548.js";import{useAlchemy as E}from"@shipengine/alchemy";import{c as D,f as I}from"./carrier-2abb4760.js";import{useTranslation as T,Trans as z}from"react-i18next";const A=P({container:{backgroundColor:"#11003A"},getChildrenStyles:e=>n=>({height:e?"90%":"0",overflow:"scroll"}),getDrawerStyles:e=>n=>({backgroundColor:"#11003A",bottom:0,height:e?"50%":`${n.spacing(6)}px`,minWidth:"440px",position:"fixed",transformOrigin:"bottom",transition:"height 0.5s;"}),header:e=>({alignItems:"center",color:"#fff",display:"flex",height:e.spacing(6),justifyContent:"space-between",padding:e.spacing(1)})}),R=({children:i,headerContent:o,isOpen:a,toggleDrawer:c})=>{const l=t(null);return r((()=>{const e=()=>{const e=l.current;e&&e.parentElement&&(e.style.width=`${e.parentElement.clientWidth}px`)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e("div",Object.assign({"aria-label":"Drawer",css:A.getDrawerStyles(a),ref:l},{children:[e("header",Object.assign({"aria-expanded":a,css:A.header},{children:[n("div",Object.assign({onClick:c,role:"button"},{children:n(s,{css:{transform:`rotate(${a?"-90":"90"}deg)`},name:k.PAGINATION_LEFT})})),o]})),n("div",Object.assign({"aria-labelledby":"drawer",css:A.getChildrenStyles(a),role:"region"},{children:i}))]}))},W=({date:e,short:t})=>{const{locale:r}=E();return n("div",{children:n("div",{children:t?D(e,r):I(e,r)})})},M=P({checkboxHeader:e=>({width:e.spacing(6)}),table:{"*":{overflow:"hidden",textOverflow:"clip !important"}}}),_=({columns:t,data:r,footerContent:s,onRowClick:f,useCheckboxes:C=!1})=>{var w,v,O;const[y,S]=i(null!==(w=null==r?void 0:r.map((()=>!1)))&&void 0!==w?w:[]),j=o((()=>y.length>0&&y.every((e=>e))),[y]),x=o((()=>y.some((e=>e))),[y]),k=a((e=>{S((n=>{const t=[...n];return t[e]=!t[e],t}))}),[]),P=a((e=>{S((n=>{const t=[...n];for(const n of t.entries())t[n[0]]=e;return t}))}),[]);return n(c,Object.assign({css:M.table,"data-testid":"grid",footer:s&&n(l,{children:s}),header:n(d,{children:e(g,{children:[C?n(h,Object.assign({css:M.checkboxHeader},{children:n(p,{checked:null!==(v=j||x)&&void 0!==v&&v,indeterminate:null!==(O=!j&&x)&&void 0!==O&&O,onChange:e=>P(e.target.checked)})})):null,t.map((e=>e.headerContent)).map(((e,t)=>n(h,{children:e},t)))]})})},{children:n(m,{children:r.map(((r,i)=>{var o;return e(u,Object.assign({onClick:f?()=>f(r):void 0},{children:[C?n(b,{children:n(p,{checked:null!==(o=y[i])&&void 0!==o&&o,onChange:()=>k(i)})}):null,t.map(((e,t)=>e.renderCellContent?n(b,{children:e.renderCellContent(r)},t):null))]}),i)}))})}))},H=P({footer:{"> *":{borderTop:"0 !important"},alignItems:"center",display:"flex",justifyContent:"space-between",width:"100%"},leftFooter:e=>({display:"flex",margin:e.spacing(2),span:{fontWeight:e.typography.fontWeight.bold}}),rowCount:e=>({alignItems:"center",display:"flex",marginRight:e.spacing(4),whiteSpace:"pre"}),rowCountDropDown:{"> * > *":{justifyContent:"center !important"}},rowsActions:e=>({"#selected-row":{":hover":{backgroundColor:"transparent"},borderRadius:e.borderRadius.XS,color:e.palette.black,padding:e.spacing(1),paddingRight:e.spacing(.5)},alignItems:"baseline",display:"flex",span:{alignSelf:"center"}})}),N=[5,10,25,50],F=({currentPageSize:r,pagingData:o,rowCountSelection:c=N,onPageSelect:l,onPageSizeSelect:d})=>{const[g,h]=i(!1),p=t(null),{t:m}=T(),u=a((()=>h((e=>!e))),[]);return e("div",Object.assign({css:H.footer},{children:[e("div",Object.assign({css:H.leftFooter},{children:[n("div",Object.assign({css:H.rowCount},{children:n(z,{components:[n("b",{style:{fontWeight:"bold"}},"1")],count:o.total,i18nKey:"common:grid.row-count",values:{firstIndex:0!==o.total?1+(o.page-1)*r:0,lastIndex:Math.min(o.total,o.page*r)}})})),e("div",Object.assign({css:H.rowsActions},{children:[m("common:grid.rows"),n(f,Object.assign({id:"selected-row",onClick:()=>u(),ref:p,variant:C.TEXT},{children:r})),n(s,g?{name:k.CHEVRON_TOP,onClick:()=>u(),size:w.SIZE_MEDIUM}:{name:k.CHEVRON_BOTTOM,onClick:()=>u(),size:w.SIZE_MEDIUM}),n(v,Object.assign({css:H.rowCountDropDown,dropdownWidth:"max-content",isOpen:g,onChange:()=>u(),onClickAway:e=>{var n;(null===(n=p.current)||void 0===n?void 0:n.contains(e.target))||u()},placement:"bottom",reference:p.current},{children:c.map((e=>n(O,Object.assign({onClick:()=>d(e),value:String(e)},{children:e}),e)))}))]}))]})),n("div",{children:n(y,{boundaryPagesToShow:5,currentPage:o.page,onPageChange:l,totalPages:o.pages})})]}))},L=(e=10)=>{const[n,t]=i(1),[r,o]=i(e);return{page:n,pagerProps:{currentPage:n,currentPageSize:r,onPageSelect:e=>{t(e)},onPageSizeSelect:e=>{o(e)}},pageSize:r}},V=({children:e,loading:t})=>t?n(S,{animation:j.WAVE,variant:x.TEXT}):n("span",{children:e});export{W as C,R as D,_ as G,F as P,V as S,L as u};
1
+ import{jsxs as e,jsx as n}from"@emotion/react/jsx-runtime";import{useRef as t,useLayoutEffect as r,useState as i,useMemo as o,useCallback as a}from"react";import{Icon as s,Table as c,TableFooter as l,TableHeader as d,TableHeaderRow as g,TableHeaderCell as h,Checkbox as p,TableBody as m,TableRow as u,TableBodyCell as f,Button as b,ButtonVariant as w,IconSize as C,DropdownOptionList as v,Option as O,Pagination as y,Skeleton as S,SkeletonAnimation as j,SkeletonVariant as x}from"@shipengine/giger";import{IconNames as k}from"@shipengine/giger-theme";import{c as P}from"./validation-528e7834.js";import{y as E}from"./warehouse-form-da6a7ac5.js";import{c as D,f as I}from"./carrier-c2a5ed53.js";import{useTranslation as T,Trans as z}from"react-i18next";const A=P({container:{backgroundColor:"#11003A"},getChildrenStyles:e=>n=>({height:e?"90%":"0",overflow:"scroll"}),getDrawerStyles:e=>n=>({backgroundColor:"#11003A",bottom:0,height:e?"50%":`${n.spacing(6)}px`,minWidth:"440px",position:"fixed",transformOrigin:"bottom",transition:"height 0.5s;"}),header:e=>({alignItems:"center",color:"#fff",display:"flex",height:e.spacing(6),justifyContent:"space-between",padding:e.spacing(1)})}),R=({children:i,headerContent:o,isOpen:a,toggleDrawer:c})=>{const l=t(null);return r((()=>{const e=()=>{const e=l.current;e&&e.parentElement&&(e.style.width=`${e.parentElement.clientWidth}px`)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e("div",Object.assign({"aria-label":"Drawer",css:A.getDrawerStyles(a),ref:l},{children:[e("header",Object.assign({"aria-expanded":a,css:A.header},{children:[n("div",Object.assign({onClick:c,role:"button"},{children:n(s,{css:{transform:`rotate(${a?"-90":"90"}deg)`},name:k.PAGINATION_LEFT})})),o]})),n("div",Object.assign({"aria-labelledby":"drawer",css:A.getChildrenStyles(a),role:"region"},{children:i}))]}))},W=({date:e,short:t})=>{const{locale:r}=E();return n("div",{children:n("div",{children:t?D(e,r):I(e,r)})})},M=P({checkboxHeader:e=>({width:e.spacing(6)}),table:{"*":{overflow:"hidden",textOverflow:"clip !important"}}}),_=({columns:t,data:r,footerContent:s,onRowClick:b,useCheckboxes:w=!1})=>{var C,v,O;const[y,S]=i(null!==(C=null==r?void 0:r.map((()=>!1)))&&void 0!==C?C:[]),j=o((()=>y.length>0&&y.every((e=>e))),[y]),x=o((()=>y.some((e=>e))),[y]),k=a((e=>{S((n=>{const t=[...n];return t[e]=!t[e],t}))}),[]),P=a((e=>{S((n=>{const t=[...n];for(const n of t.entries())t[n[0]]=e;return t}))}),[]);return n(c,Object.assign({css:M.table,"data-testid":"grid",footer:s&&n(l,{children:s}),header:n(d,{children:e(g,{children:[w?n(h,Object.assign({css:M.checkboxHeader},{children:n(p,{checked:null!==(v=j||x)&&void 0!==v&&v,indeterminate:null!==(O=!j&&x)&&void 0!==O&&O,onChange:e=>P(e.target.checked)})})):null,t.map((e=>e.headerContent)).map(((e,t)=>n(h,{children:e},t)))]})})},{children:n(m,{children:r.map(((r,i)=>{var o;return e(u,Object.assign({onClick:b?()=>b(r):void 0},{children:[w?n(f,{children:n(p,{checked:null!==(o=y[i])&&void 0!==o&&o,onChange:()=>k(i)})}):null,t.map(((e,t)=>e.renderCellContent?n(f,{children:e.renderCellContent(r)},t):null))]}),i)}))})}))},H=P({footer:{"> *":{borderTop:"0 !important"},alignItems:"center",display:"flex",justifyContent:"space-between",width:"100%"},leftFooter:e=>({display:"flex",margin:e.spacing(2),span:{fontWeight:e.typography.fontWeight.bold}}),rowCount:e=>({alignItems:"center",display:"flex",marginRight:e.spacing(4),whiteSpace:"pre"}),rowCountDropDown:{"> * > *":{justifyContent:"center !important"}},rowsActions:e=>({"#selected-row":{":hover":{backgroundColor:"transparent"},borderRadius:e.borderRadius.XS,color:e.palette.black,padding:e.spacing(1),paddingRight:e.spacing(.5)},alignItems:"baseline",display:"flex",span:{alignSelf:"center"}})}),N=[5,10,25,50],F=({currentPageSize:r,pagingData:o,rowCountSelection:c=N,onPageSelect:l,onPageSizeSelect:d})=>{const[g,h]=i(!1),p=t(null),{t:m}=T(),u=a((()=>h((e=>!e))),[]);return e("div",Object.assign({css:H.footer},{children:[e("div",Object.assign({css:H.leftFooter},{children:[n("div",Object.assign({css:H.rowCount},{children:n(z,{components:[n("b",{style:{fontWeight:"bold"}},"1")],count:o.total,i18nKey:"common:grid.row-count",values:{firstIndex:0!==o.total?1+(o.page-1)*r:0,lastIndex:Math.min(o.total,o.page*r)}})})),e("div",Object.assign({css:H.rowsActions},{children:[m("common:grid.rows"),n(b,Object.assign({id:"selected-row",onClick:()=>u(),ref:p,variant:w.TEXT},{children:r})),n(s,g?{name:k.CHEVRON_TOP,onClick:()=>u(),size:C.SIZE_MEDIUM}:{name:k.CHEVRON_BOTTOM,onClick:()=>u(),size:C.SIZE_MEDIUM}),n(v,Object.assign({css:H.rowCountDropDown,dropdownWidth:"max-content",isOpen:g,onChange:()=>u(),onClickAway:e=>{var n;(null===(n=p.current)||void 0===n?void 0:n.contains(e.target))||u()},placement:"bottom",reference:p.current},{children:c.map((e=>n(O,Object.assign({onClick:()=>d(e),value:String(e)},{children:e}),e)))}))]}))]})),n("div",{children:n(y,{boundaryPagesToShow:5,currentPage:o.page,onPageChange:l,totalPages:o.pages})})]}))},L=(e=10)=>{const[n,t]=i(1),[r,o]=i(e);return{page:n,pagerProps:{currentPage:n,currentPageSize:r,onPageSelect:e=>{t(e)},onPageSizeSelect:e=>{o(e)}},pageSize:r}},V=({children:e,loading:t})=>t?n(S,{animation:j.WAVE,variant:x.TEXT}):n("span",{children:e});export{W as C,R as D,_ as G,F as P,V as S,L as u};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t,Fragment as n}from"@emotion/react/jsx-runtime";import{S as a,b as r,e as i,u as s,M as o,E as l,d as c,U as d,f as p,g as h,h as g,P as m,T as u}from"./use-unit-settings-a5bae16e.js";import{T as b,f,k as C,p as v,a1 as j,d as x}from"./warehouse-form-da6a7ac5.js";import{_ as O}from"./carrier-c2a5ed53.js";import{useTranslation as w}from"react-i18next";import{Icon as y,IconSize as _,Select as S,Option as T,Input as k,Popover as D,Typography as E,ButtonIcon as W,Tag as z,TagColor as $}from"@shipengine/giger";import{IconNames as R}from"@shipengine/giger-theme";import{useListCarriers as I,useListLabels as P,useListSalesOrderShipments as F,useListShipments as L}from"@shipengine/react-api";import{D as A,u as B,C as M,S as N,G as U,P as K}from"./suspend-text-cad3a977.js";import{useState as G,useCallback as H,useRef as V,useContext as Z,createContext as q}from"react";import{c as J}from"./validation-528e7834.js";import{c as Q,a as X,p as Y}from"./formatString-413ec7c7.js";import{d as ee}from"./use-toggle-866d7938.js";const te=J({category:{alignItems:"center",cursor:"pointer",display:"flex",flexDirection:"row",justifyContent:"space-between"},colorPicker:e=>({"&::-webkit-color-swatch":{border:`1px solid ${e.palette.gray.light}`,borderRadius:"4px",padding:0},"&::-webkit-color-swatch-wrapper":{padding:0},alignSelf:"center",appearance:"none",background:"none",border:0,cursor:"pointer",height:e.spacing(4.25),outline:"none",width:e.spacing(4.25)}),container:e=>({marginBottom:e.spacing(2)}),input:e=>({border:`1px solid ${e.palette.gray.light}`,borderRadius:"4px",color:e.palette.gray.main,fontSize:"14px",padding:e.spacing(1)}),inputContainer:e=>({alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between",padding:`${e.spacing(2)}px 0`}),wrapper:e=>({display:"flex",gap:e.spacing(1)})}),ne=({paletteConfig:n,onUpdatePaletteConfig:a,formatKey:r})=>{const[i,s]=G(new Set),o=H(((e,t,r)=>{const i=(e=>{if(e)return e.match(/^#[0-9A-Fa-f]{0,6}$/)?e:e.match(/^[0-9A-Fa-f]{6}$/)?`#${e}`:void 0})(r),s=Object.assign(Object.assign({},n||{}),{[e]:Object.assign(Object.assign({},(null==n?void 0:n[e])||{}),{[t]:i})});a(s)}),[a,n]);return e("div",Object.assign({"data-test-id":"color-palette-editor"},{children:n&&Object.keys(n).map((a=>t("div",Object.assign({css:te.container,id:a},{children:[t("div",Object.assign({"aria-expanded":i.has(a),css:te.category,onClick:e=>{e.preventDefault(),(e=>{s((t=>{const n=new Set(t);return n.has(e)?new Set([...n].filter((t=>t!==e))):new Set([...n,e])}))})(a)},role:"button"},{children:[e("p",{children:Q(a)}),e(y,{name:i.has(a)?R.CHEVRON_TOP:R.CHEVRON_BOTTOM,size:_.SIZE_REGULAR})]})),i.has(a)&&Object.keys(n[a]).map((i=>t("div",Object.assign({css:te.inputContainer,id:"input-container"},{children:[e("label",Object.assign({css:{fontWeight:"bold"},htmlFor:`${a}.${i}`},{children:r(i)})),t("form",Object.assign({css:te.wrapper},{children:[e("input",{css:te.input,onChange:e=>{e.preventDefault(),o(a,i,e.target.value)},onKeyDown:e=>{"Enter"===e.key&&e.preventDefault()},type:"text",value:n[a][i]}),e("input",{css:te.colorPicker,onChange:e=>o(a,i,e.target.value),type:"color",value:n[a][i]})]}))]}),i)))]}),a)))}))},ae=J({input:e=>({border:`1px solid ${e.palette.gray.light}`,borderRadius:"4px",color:e.palette.gray.main,fontSize:"14px",maxWidth:e.spacing(16),padding:0}),keys:{fontSize:"16px",fontWeight:"bold",marginTop:"8px"},section:e=>({"& > div:first-child":{flexGrow:3},"& > div:last-child":{flexShrink:1},display:"flex",gap:e.spacing(1),justifyContent:"space-between"}),sectionContainer:e=>({marginBottom:e.spacing(4)}),select:e=>({border:`1px solid ${e.palette.gray.light}`,borderRadius:"4px",color:e.palette.gray.main,fontSize:"14px"})}),re=({onUpdateTypographyConfig:a,typographyConfig:r,formatKey:i})=>{const s=H(((e,t,n)=>{const i=Object.assign(Object.assign({},r||{}),{[e]:Object.assign(Object.assign({},(null==r?void 0:r[e])||{}),{[t]:n})});a(i)}),[a,r]),o=H(((e,t)=>{if(e)return e[t]}),[]),l=(t,n)=>{var a;const i=[{label:"Normal",value:"400"},{label:"Semi Bold",value:"600"},{label:"Bold",value:"700"}],l=null===(a=o(r,t))||void 0===a?void 0:a.fontWeight.toString(),c=void 0!==l?i.find((e=>e.value===l)):void 0;return e(S,Object.assign({css:ae.select,label:"Font Weight",name:"font-weight",onChange:(e,a)=>s(t,n,null==a?void 0:a.value),value:c},{children:i.map((t=>e(T,Object.assign({value:t.value},{children:t.label}),t.value)))}))},c=(t,n)=>{var a;const i=null===(a=o(r,t))||void 0===a?void 0:a.fontSize.replace("px","");return e(k,{"aria-labelledby":`${t}.${n}`,css:ae.input,label:"Font Size(px)",onChange:e=>{e.target.value.match(/^\d{0,2}$/)&&s(t,n,`${e.target.value}px`)},value:i})},d=(t,a)=>{switch(a){case"fontWeight":return e(n,{children:l(t,a)});case"fontSize":return e(n,{children:c(t,a)});default:return null}};return e("div",{children:r&&Object.keys(r).map((n=>t("div",Object.assign({css:ae.sectionContainer},{children:[e("p",Object.assign({css:ae.keys,id:n},{children:i(n)})),e("section",Object.assign({css:ae.section},{children:Object.keys(r[n]).map((t=>e("div",Object.assign({id:`${n}.${t}`},{children:d(n,t)}),t)))}))]}),n)))})},ie=J({container:e=>({color:e.palette.gray.dark,display:"flex",flexDirection:"column",flexGrow:1,overflow:"hidden",position:"relative"}),content:e=>({display:"flex",flexDirection:"column",gap:e.spacing(3),padding:e.spacing(3)}),copy:e=>({backgroundColor:e.palette.white,borderRadius:"4px",padding:e.spacing(.5)}),drawerHeader:e=>({alignItems:"center",display:"flex",gap:e.spacing(2),justifyContent:"end",width:"50%"}),drawerWrapper:{display:"flex",justifyContent:"space-between",position:"relative"},header:{alignItems:"center",display:"flex",justifyContent:"space-between"},popoverWrapper:e=>({display:"flex",flexDirection:"column",gap:e.spacing(1)}),pre:e=>({backgroundColor:"#FFFFFF66",borderRadius:"8px",fontSize:"14px",padding:e.spacing(.3)}),presetOption:e=>({"&:hover":{backgroundColor:"theme.palette.gray.ultraLight"},backgroundColor:"transparent",borderRadius:"4px",fontSize:"14px",padding:e.spacing(1)}),presetsButton:e=>({"&:hover":{backgroundColor:"#d1d4d7"},backgroundColor:"#E4E5E7",borderRadius:"4px",cursor:"pointer",display:"flex",fontSize:"14px",gap:e.spacing(.5),padding:`${e.spacing(.5)}px ${e.spacing(1)}px`})}),se=({themeConfig:n,onUpdateThemeConfig:a,presets:r,showDrawer:i})=>{const s=V(n),[o,l]=G(!1),c=Object.keys(n).flatMap((e=>{if("components"===e&&n[e]&&"object"==typeof n[e]){return Object.keys(n[e])}return[e]})).map((e=>"palette"===e?{label:"Color Palette",value:"Color Palette"}:{label:Q(e),value:Q(e)})),[d,p]=G(c.sort()[0].value),h=e=>X(Y(e)),g=V(null),[m,u]=ee(!1),C=e=>{a(e)};return t("div",Object.assign({"aria-label":"Theme Creator",css:ie.container,"data-testid":"theme-creator",role:"region"},{children:[t("div",Object.assign({css:ie.content},{children:[t("div",Object.assign({css:ie.header},{children:[e(b,{onSelectTab:e=>{p(e)},selectedTab:d,tabs:c}),r?t("div",{children:[t("button",Object.assign({"aria-controls":"presets-popover","aria-expanded":m,css:ie.presetsButton,onClick:e=>{e.preventDefault(),u()},ref:g},{children:["Presets",e(y,{name:R.CARET_BOTTOM,size:_.SIZE_SMALL})]})),e(D,Object.assign({container:document.querySelector("#theme-creator"),isOpen:m,onClickAway:()=>u(),placement:"bottom-end",reference:g.current},{children:t("div",Object.assign({css:ie.popoverWrapper},{children:[e("button",Object.assign({"aria-label":"Set Default Theme",css:ie.presetOption,onClick:e=>{e.preventDefault(),u(),C(s.current)},role:"menuitem"},{children:"Default"})),r.map((t=>e("button",Object.assign({"aria-label":`Set ${t.presetName} Theme`,css:ie.presetOption,onClick:e=>{e.preventDefault(),u(),C(t.themeConfig)},role:"menuitem"},{children:t.presetName}),t.presetName)))]}))}))]}):e("button",Object.assign({"aria-label":"Set Default Theme",css:ie.presetsButton,onClick:()=>{C(s.current)},role:"menuitem"},{children:"Reset to Default"}))]})),e(E,Object.assign({role:"heading",variant:"heading4"},{children:`${d} Editor`})),((t,n)=>{var r;switch(n){case"Color Palette":return e(ne,{formatKey:h,onUpdatePaletteConfig:e=>{a(Object.assign(Object.assign({},t),{palette:e}))},paletteConfig:t.palette});case"Typography":return e(re,{formatKey:h,onUpdateTypographyConfig:e=>{a(Object.assign(Object.assign({},t),{components:Object.assign(Object.assign({},t.components),{Typography:e})}))},typographyConfig:null===(r=t.components)||void 0===r?void 0:r.Typography});default:return null}})(n,d)]})),i&&e(A,Object.assign({"aria-label":"Show themeConfig.js Code Drawer",headerContent:t("div",Object.assign({css:ie.drawerHeader},{children:[e("pre",Object.assign({css:ie.pre},{children:"themeConfig.js"})),i.copyToClipboardText&&e("div",Object.assign({css:ie.copy},{children:e(f,{content:i.copyToClipboardText})}))]})),isOpen:o,toggleDrawer:()=>l(!o)},{children:i.content}))]}))},oe=()=>e(a,{}),le=r(oe,C,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:i}});var ce=Object.freeze({__proto__:null,Component:oe,Element:le});const de=()=>{const t=O(s(),[]);return e(o,Object.assign({},t))},pe=r(de,C,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:i}});var he=Object.freeze({__proto__:null,Component:de,Element:pe});const ge=({isModalFullScreen:t})=>e(l,{isModalFullScreen:t}),me=r(ge,C,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:i}});var ue=Object.freeze({__proto__:null,Component:ge,Element:me});const be=r((({onRowClick:n})=>{const{t:a}=w(["common","list-labels"]),{page:r,pageSize:i,pagerProps:s}=B(),{data:o,isLoading:l}=I(),{data:c,isLoading:d,isError:p,error:h}=P({page:r,pageSize:i}),g=(null==c?void 0:c.labels)?c.labels.filter((e=>e.shipmentId)).map((e=>e.shipmentId)):[],{data:m,isLoading:u}=F({shipmentIds:g});if(d)return e(v,{message:a("loading.labels")});if(p)throw new Error(h.map((e=>e.message)).join(", "));if(!c)throw new Error(a("errorMessages.unableToLoad.labels"));const b=[{headerContent:a("list-labels:headers.labelId"),renderCellContent:t=>e("div",{children:t.labelId})},{headerContent:a("list-labels:headers.created"),renderCellContent:t=>(null==t?void 0:t.shipDate)&&e(M,{date:t.shipDate})},{headerContent:a("list-labels:headers.shipTo"),renderCellContent:t=>{const n=null==m?void 0:m.find((e=>e.shipmentId===t.shipmentId)),a=n&&n.shipTo.addressLine1?e(j,{address:n.shipTo}):"--";return e(N,Object.assign({loading:u},{children:a}))}},{headerContent:a("list-labels:headers.service"),renderCellContent:n=>{if(!l&&o){const a=o.find((e=>e.carrierCode===n.carrierCode));if(a){const r=a.services.find((e=>e.serviceCode===n.serviceCode));if(r)return t("div",{children:[e(x,{carrierCode:n.carrierCode},n.carrierCode),"  ",r.name]})}}return t(N,Object.assign({loading:l},{children:["`$",n.carrierCode," - $",n.serviceCode,"`"]}))}},{headerContent:e("div",{"aria-label":a("list-labels:headers.download")}),renderCellContent:t=>"completed"===t.status?e("div",Object.assign({css:{textAlign:"right"}},{children:e(W,{ariaDescribedby:"",children:a("list-labels:actions.download.pdf"),icon:R.DOWNLOAD,onClick:e=>{e.stopPropagation(),window.open(t.labelDownload.pdf)}})})):e("div",Object.assign({css:{textAlign:"right"}},{children:e(z,Object.assign({color:$.INFO},{children:t.status.toLocaleUpperCase()}))}))}];return e(U,{columns:b,data:c.labels,footerContent:e(K,Object.assign({},s,{pagingData:c})),onRowClick:n})}),C,{css:{height:"100%",minWidth:"440px",width:"100%"},resources:{en:i}});var fe=Object.freeze({__proto__:null,Element:be});const Ce=r((({onRowClick:t,shipmentStatus:n="pending"})=>{const{t:a}=w(["common","list-shipments"]),{page:r,pageSize:i,pagerProps:s}=B(),{data:o,isLoading:l,isError:c,error:d}=L({page:r,pageSize:i,shipmentStatus:n});if(l)return e(v,{message:a("loading.shipments")});if(c)throw new Error(d.map((e=>e.message)).join(", "));if(!o)throw new Error(a("errorMessages.unableToLoad.shipments"));const p=[{headerContent:a("list-shipments:headers.shipmentId"),renderCellContent:t=>e("div",{children:t.shipmentId})},{headerContent:a("list-shipments:headers.shipTo"),renderCellContent:t=>t.shipTo.addressLine1?e(j,{address:t.shipTo}):"--"},{headerContent:a("list-shipments:headers.shipDate"),renderCellContent:t=>t.shipDate?e(M,{date:t.shipDate}):"--"}];return e(U,{columns:p,data:o.shipments,footerContent:e(K,Object.assign({},s,{pagingData:o})),onRowClick:t})}),C,{css:{height:"100%",minWidth:"440px",width:"100%"},resources:{en:i}});var ve=Object.freeze({__proto__:null,Element:Ce});const je=q(void 0),xe=({children:t,editableTheme:n})=>{const[a,r]=G(n);return e(je.Provider,Object.assign({value:{setThemeConfig:r,themeConfig:a}},{children:t}))},Oe=()=>{const e=Z(je);if(!e)throw new Error("useThemeConfigurator must be used within a ThemeConfiguratorProvider");return e},we=t=>{var n=O(t,[]);return e(se,Object.assign({},n))},ye=r(we,C,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:i}});var _e=Object.freeze({__proto__:null,Component:we,Element:ye});const Se=()=>{const t=O(c(),[]);return e(d,Object.assign({},t))},Te=r(Se,C,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:i}});var ke=Object.freeze({__proto__:null,Component:Se,Element:Te});const De=()=>e(p,{}),Ee=r(De,C,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:i}});var We=Object.freeze({__proto__:null,Component:De,Element:Ee});const ze=()=>{const t=O(h(),[]);return e(g,Object.assign({},t))},$e=r(ze,C,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:i}});var Re=Object.freeze({__proto__:null,Component:ze,Element:$e});const Ie=()=>e(m,{}),Pe=r(Ie,C,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:i}});var Fe=Object.freeze({__proto__:null,Component:Ie,Element:Pe});const Le=()=>e(u,{}),Ae=r(Le,C,{css:{height:"100%",maxWidth:"800px",minWidth:"440px",width:"100%"},resources:{en:i}});var Be=Object.freeze({__proto__:null,Component:Le,Element:Ae});export{xe as T,he as a,ue as b,ke as c,We as d,Re as e,Be as f,fe as l,ce as m,Fe as p,ve as s,_e as t,Oe as u};
@@ -1 +1 @@
1
- import{useTranslation as e}from"react-i18next";import{jsx as l,jsxs as a}from"@emotion/react/jsx-runtime";import{useRef as t,useState as o,useContext as r,createContext as n}from"react";import{P as s}from"./use-toggle-838d2ebd.js";const i=()=>{const{t:l}=e("common");return[{label:l("months.january"),value:"01"},{label:l("months.february"),value:"02"},{label:l("months.march"),value:"03"},{label:l("months.april"),value:"04"},{label:l("months.may"),value:"05"},{label:l("months.june"),value:"06"},{label:l("months.july"),value:"07"},{label:l("months.august"),value:"08"},{label:l("months.september"),value:"09"},{label:l("months.october"),value:"10"},{label:l("months.november"),value:"11"},{label:l("months.december"),value:"12"}]},u=n(void 0);u.displayName="PageLayoutContext";const c=({children:e})=>{const r=t(null),n=t(null),[i]=o({FooterPortal:e=>l(s,Object.assign({target:n},{children:e.children})),HeaderPortal:e=>l(s,Object.assign({target:r},{children:e.children}))});return l(u.Provider,Object.assign({value:i},{children:a("div",Object.assign({css:{display:"flex",flexDirection:"column",height:"100%"}},{children:[l("div",{css:{flexShrink:0},id:"page-layout-header",ref:r}),l("div",Object.assign({css:{overflow:"scroll"},id:"page-layout-content"},{children:e})),l("div",{css:{flexShrink:0},id:"page-layout-footer",ref:n})]}))}))},m=()=>{const e=r(u);if(!e)throw new Error("usePageLayout must be called from within the scope of PageLayoutProvider");return e};export{c as P,m as a,i as u};
1
+ import{useTranslation as e}from"react-i18next";import{jsx as l,jsxs as a}from"@emotion/react/jsx-runtime";import{useRef as t,useState as o,useContext as r,createContext as n}from"react";import{P as s}from"./use-toggle-866d7938.js";const i=()=>{const{t:l}=e("common");return[{label:l("months.january"),value:"01"},{label:l("months.february"),value:"02"},{label:l("months.march"),value:"03"},{label:l("months.april"),value:"04"},{label:l("months.may"),value:"05"},{label:l("months.june"),value:"06"},{label:l("months.july"),value:"07"},{label:l("months.august"),value:"08"},{label:l("months.september"),value:"09"},{label:l("months.october"),value:"10"},{label:l("months.november"),value:"11"},{label:l("months.december"),value:"12"}]},u=n(void 0);u.displayName="PageLayoutContext";const c=({children:e})=>{const r=t(null),n=t(null),[i]=o({FooterPortal:e=>l(s,Object.assign({target:n},{children:e.children})),HeaderPortal:e=>l(s,Object.assign({target:r},{children:e.children}))});return l(u.Provider,Object.assign({value:i},{children:a("div",Object.assign({css:{display:"flex",flexDirection:"column",height:"100%"}},{children:[l("div",{css:{flexShrink:0},id:"page-layout-header",ref:r}),l("div",Object.assign({css:{overflow:"scroll"},id:"page-layout-content"},{children:e})),l("div",{css:{flexShrink:0},id:"page-layout-footer",ref:n})]}))}))},m=()=>{const e=r(u);if(!e)throw new Error("usePageLayout must be called from within the scope of PageLayoutProvider");return e};export{c as P,m as a,i as u};