@shipengine/elements 0.20.2 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/index.cjs +1066 -1054
  2. package/index.js +936 -924
  3. package/package.json +3 -3
  4. package/src/components/add-funds-form/add-funds-schema.d.ts +7 -7
  5. package/src/components/address-preference-context/address-preference-context.d.ts +42 -0
  6. package/src/components/address-preference-context/index.d.ts +1 -0
  7. package/src/components/auto-funding-form/auto-funding-schema.d.ts +10 -10
  8. package/src/components/field/fields.d.ts +2 -1
  9. package/src/components/field/money-input/hooks/use-utils.d.ts +1 -1
  10. package/src/components/field/money-input/money-input.d.ts +1 -1
  11. package/src/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +1 -1
  12. package/src/components/field/select-auto-complete/index.d.ts +1 -0
  13. package/src/components/field/select-auto-complete/select-auto-complete.d.ts +7 -0
  14. package/src/components/history/history-card/history-card.d.ts +5 -0
  15. package/src/components/history/history-card/history-card.styles.d.ts +1 -0
  16. package/src/components/history/history-card/index.d.ts +1 -0
  17. package/src/components/history/index.d.ts +1 -4
  18. package/src/components/index.d.ts +1 -1
  19. package/src/components/inline-label/inline-label.d.ts +5 -1
  20. package/src/components/inline-label/inline-label.styles.d.ts +1 -0
  21. package/src/components/items-breakdown/items-breakdown.d.ts +1 -1
  22. package/src/components/label/index.d.ts +1 -0
  23. package/src/components/label/label.d.ts +10 -0
  24. package/src/components/label/label.styles.d.ts +2 -0
  25. package/src/components/label-layout/label-layout-purchase.d.ts +1 -1
  26. package/src/components/label-layout/label-layout-settings.d.ts +1 -1
  27. package/src/components/section/index.d.ts +1 -0
  28. package/src/components/section/section.d.ts +10 -0
  29. package/src/components/section/section.styles.d.ts +1 -0
  30. package/src/components/templates/add-carrier-form/add-carrier-form.d.ts +1 -1
  31. package/src/components/templates/address-display/address-display.d.ts +1 -1
  32. package/src/components/templates/address-form/address-form.d.ts +1 -1
  33. package/src/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
  34. package/src/components/templates/address-preference-select/address-preference-select.d.ts +24 -0
  35. package/src/components/templates/address-preference-select/index.d.ts +1 -0
  36. package/src/components/templates/carrier-recovery-form/carrier-recovery-form.d.ts +1 -1
  37. package/src/components/templates/carrier-terms-form/carrier-terms-form.d.ts +1 -1
  38. package/src/components/templates/customs-item-form/customs-item-form-schema.d.ts +20 -20
  39. package/src/components/templates/customs-item-form/customs-item-form.d.ts +1 -1
  40. package/src/components/templates/customs-items-display/customs-items-display.d.ts +1 -1
  41. package/src/components/templates/edit-billing-form/edit-billing-form.styles.d.ts +1 -1
  42. package/src/components/templates/index.d.ts +2 -3
  43. package/src/components/templates/label/label.d.ts +1 -1
  44. package/src/components/templates/list-carriers/list-carriers.d.ts +1 -1
  45. package/src/components/templates/list-carriers-row/list-carriers-row.d.ts +1 -1
  46. package/src/components/templates/manage-wallet/manage-wallet.styles.d.ts +1 -1
  47. package/src/components/templates/manage-warehouses/manage-warehouses.d.ts +2 -6
  48. package/src/components/templates/onboarding/onboarding.d.ts +14 -8
  49. package/src/components/templates/onboarding/onboarding.styles.d.ts +1 -1
  50. package/src/components/templates/rate-form/rate-form.d.ts +1 -1
  51. package/src/components/templates/shipment/shipment.d.ts +1 -1
  52. package/src/components/templates/shipment-form/shipment-form.d.ts +1 -1
  53. package/src/components/templates/shipment-form/shipment-schema.d.ts +26 -2
  54. package/src/components/templates/suspend-sales-order/suspend-sales-order.d.ts +1 -1
  55. package/src/components/templates/suspend-shipment/suspend-shipment.d.ts +1 -1
  56. package/src/components/templates/void-label/void-label.d.ts +1 -1
  57. package/src/components/templates/wallet-form/edit-wallet-address-form.d.ts +1 -1
  58. package/src/components/templates/wallet-form/wallet-form.d.ts +7 -6
  59. package/src/components/templates/wallet-form/wallet-form.styles.d.ts +1 -1
  60. package/src/components/templates/wallet-form/wallet-schema.d.ts +1 -1
  61. package/src/components/templates/warehouse-display/warehouse-display.d.ts +1 -1
  62. package/src/components/templates/warehouse-form/warehouse-form.d.ts +1 -1
  63. package/src/elements/components/configure-shipment/configure-shipment.d.ts +1 -1
  64. package/src/elements/components/configure-shipment/hooks/use-address.d.ts +1 -1
  65. package/src/elements/components/configure-shipment/hooks/use-customs.d.ts +1 -1
  66. package/src/elements/components/configure-shipment/hooks/use-presets.d.ts +1 -1
  67. package/src/elements/components/configure-shipment/hooks/use-rates-form.d.ts +1 -1
  68. package/src/elements/components/configure-shipment/hooks/use-request-rates.d.ts +1 -1
  69. package/src/elements/components/configure-shipment/hooks/use-shipment-form.d.ts +1 -1
  70. package/src/elements/components/index.d.ts +0 -1
  71. package/src/elements/components/list-carriers/hooks/use-list-connected-carriers.d.ts +2 -2
  72. package/src/elements/components/purchase-label/hooks/use-configure-shipment.d.ts +1 -1
  73. package/src/elements/components/purchase-label/hooks/use-import-sales-order.d.ts +2 -2
  74. package/src/elements/components/purchase-label/hooks/use-load-shipment.d.ts +3 -3
  75. package/src/elements/components/purchase-label/hooks/use-pending-shipment.d.ts +1 -1
  76. package/src/elements/components/shipment/shipment.d.ts +1 -1
  77. package/src/elements/components/void-label/void-label.d.ts +1 -1
  78. package/src/elements/index.d.ts +0 -1
  79. package/src/factories/shipengine/address.d.ts +8 -1
  80. package/src/factories/shipengine/carrier.d.ts +1 -1
  81. package/src/factories/shipengine/label.d.ts +1 -1
  82. package/src/factories/shipengine/money.d.ts +1 -1
  83. package/src/factories/shipengine/order-source.d.ts +1 -1
  84. package/src/factories/shipengine/package.d.ts +1 -1
  85. package/src/factories/shipengine/resource.d.ts +1 -1
  86. package/src/factories/shipengine/sales-order.d.ts +1 -1
  87. package/src/factories/shipengine/service.d.ts +1 -1
  88. package/src/factories/shipengine/shipment.d.ts +1 -1
  89. package/src/factories/shipengine/wallet-history.d.ts +1 -1
  90. package/src/factories/shipengine/warehouse.d.ts +1 -3
  91. package/src/factories/shipengine/weight.d.ts +1 -1
  92. package/src/features/wallet-history/wallet-history.styles.d.ts +1 -0
  93. package/src/hooks/index.d.ts +1 -1
  94. package/src/hooks/options/use-confirmation-options.d.ts +1 -1
  95. package/src/hooks/options/use-customs-contents-options.d.ts +1 -1
  96. package/src/hooks/options/use-customs-non-delivery-options.d.ts +1 -1
  97. package/src/hooks/options/use-insurance-provider-options.d.ts +1 -1
  98. package/src/hooks/options/use-package-options.d.ts +1 -1
  99. package/src/hooks/options/use-rate-options.d.ts +1 -1
  100. package/src/hooks/options/use-service-code-options.d.ts +1 -1
  101. package/src/hooks/options/use-warehouse-options.d.ts +1 -1
  102. package/src/hooks/use-address-validation.d.ts +12 -0
  103. package/src/hooks/use-carrier-metadata.d.ts +1 -1
  104. package/src/hooks/use-elements.d.ts +2 -2
  105. package/src/hooks/use-scrub-errors.d.ts +1 -1
  106. package/src/locales/en/index.d.ts +13 -2
  107. package/src/mocks/carriers/handlers.d.ts +1 -1
  108. package/src/mocks/warehouses/handlers.d.ts +1 -1
  109. package/src/schemas/shipengine/money.d.ts +1 -1
  110. package/src/types/carrier-metadata.d.ts +1 -1
  111. package/src/types/shipping-preset/shipping-preset.d.ts +1 -1
  112. package/src/utilities/money.d.ts +1 -1
  113. package/src/utilities/rates.d.ts +2 -1
  114. package/src/utilities/shipengine/address.d.ts +1 -1
  115. package/src/utilities/shipengine/dimensions.d.ts +1 -1
  116. package/src/utilities/shipengine/sales-order.d.ts +1 -1
  117. package/src/utilities/shipengine/shipment.d.ts +1 -1
  118. package/src/utilities/shipengine/weight.d.ts +1 -1
  119. package/src/components/accordion/accordion.d.ts +0 -13
  120. package/src/components/accordion/accordion.styles.d.ts +0 -7
  121. package/src/components/accordion/index.d.ts +0 -1
  122. package/src/components/history/history-body/history-body.d.ts +0 -5
  123. package/src/components/history/history-body/history-body.styles.d.ts +0 -1
  124. package/src/components/history/history-body/index.d.ts +0 -1
  125. package/src/components/history/history-list/history-list.d.ts +0 -12
  126. package/src/components/history/history-list/index.d.ts +0 -1
  127. package/src/components/history/history-row/history-row.d.ts +0 -6
  128. package/src/components/history/history-row/index.d.ts +0 -1
  129. package/src/components/history/history.d.ts +0 -10
  130. package/src/components/templates/wallet-history/wallet-history.d.ts +0 -6
  131. package/src/components/templates/warehouse-preference-select/index.d.ts +0 -1
  132. package/src/components/templates/warehouse-preference-select/warehouse-preference-select.d.ts +0 -24
  133. package/src/components/templates/warehouse-preference-wizard/index.d.ts +0 -1
  134. package/src/components/templates/warehouse-preference-wizard/warehouse-preference-wizard.d.ts +0 -23
  135. package/src/elements/wallet-history.d.ts +0 -1
  136. package/src/hooks/use-warehouse-validation.d.ts +0 -14
  137. /package/src/{components/templates/wallet-history → features}/index.d.ts +0 -0
  138. /package/src/{elements/components → features}/wallet-history/index.d.ts +0 -0
  139. /package/src/{elements/components → features}/wallet-history/wallet-history.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export declare const useConfirmationOptions: () => {
3
3
  label: string;
4
4
  value: SE.ConfirmationType;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export declare const useCustomsContentsOptions: () => {
3
3
  label: string;
4
4
  value: SE.CustomsContentsType;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export declare const useCustomsNonDeliveryOptions: () => {
3
3
  label: string;
4
4
  value: SE.CustomsNonDeliveryType;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  interface InsuranceFeatures {
3
3
  includeShipsuranceInsurance?: boolean;
4
4
  includeThirdPartyInsurance?: boolean;
@@ -1,3 +1,3 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  import { SelectCategory } from "../../components/field/select";
3
3
  export declare const usePackageOptions: (carriers?: SE.Carrier[], customPackageTypes?: SE.CustomPackage[], poBox?: boolean) => SelectCategory[] | undefined;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export type RateOption = Omit<SE.Rate, "warningMessages"> & {
3
3
  balance?: number;
4
4
  messages: string[];
@@ -1,3 +1,3 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  import { SelectCategory } from "../../components/field/select";
3
3
  export declare const useServiceCodeOptions: (carriers?: SE.Carrier[], domestic?: boolean, poBox?: boolean) => SelectCategory[];
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export declare const useWarehouseOptions: (warehouses?: SE.Warehouse[]) => {
3
3
  label: string;
4
4
  value: string;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { SE } from "@shipengine/js-api";
3
+ import { Templates } from "../components";
4
+ export declare const useAddressValidation: () => {
5
+ errors: SE.CodedError[] | null;
6
+ setValidationPreference: import("react").Dispatch<import("react").SetStateAction<Templates.ValidationPreference | undefined>>;
7
+ validate: (addresses: {
8
+ originAddress: SE.Address;
9
+ returnAddress?: SE.Address;
10
+ }) => Promise<Templates.ValidationPreference>;
11
+ validationPreference: Templates.ValidationPreference | undefined;
12
+ };
@@ -1,3 +1,3 @@
1
- import { CarrierConnection } from "@shipengine/api";
1
+ import { CarrierConnection } from "@shipengine/js-api";
2
2
  import { CarrierMetadata } from "../types";
3
3
  export declare const useCarrierMetadata: (carrierCodes?: CarrierConnection["carrierCode"][]) => CarrierMetadata[];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ShipEngineProviderProps } from "@shipengine/react";
2
+ import { ShipEngineProps } from "@shipengine/react-api";
3
3
  export type ElementsEnvironment = `dde:${string}` | "development" | "staging" | "production";
4
4
  export type ElementsErrorHandler = (err: Error, context: {
5
5
  componentStack: string;
@@ -19,7 +19,7 @@ export interface ElementsProviderProps {
19
19
  brandName?: string;
20
20
  children: JSX.Element;
21
21
  environment?: ElementsEnvironment;
22
- getToken: ShipEngineProviderProps["getToken"];
22
+ getToken: ShipEngineProps["getToken"];
23
23
  onError?: ElementsErrorHandler;
24
24
  proxyTarget?: string;
25
25
  }
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  type UseScrubErrorsProps = {
3
3
  errors?: SE.CodedError[];
4
4
  predicate?: (e: SE.CodedError) => boolean;
@@ -142,6 +142,7 @@ declare const _default: {
142
142
  };
143
143
  fields: {
144
144
  addOns: string;
145
+ contentDescription: string;
145
146
  confirmation: string;
146
147
  dimensions: {
147
148
  length: string;
@@ -168,6 +169,9 @@ declare const _default: {
168
169
  };
169
170
  weightGroup: string;
170
171
  };
172
+ hints: {
173
+ contentDescription: string;
174
+ };
171
175
  loading: {
172
176
  calculatingRates: string;
173
177
  };
@@ -202,8 +206,9 @@ declare const _default: {
202
206
  action: string;
203
207
  title: string;
204
208
  subtitle: string;
205
- descriptionTitle: string;
206
- description: string;
209
+ welcome: string;
210
+ messageLine1: string;
211
+ messageLine2: string;
207
212
  };
208
213
  steps: {
209
214
  login: string;
@@ -361,6 +366,7 @@ declare const _default: {
361
366
  email: string;
362
367
  addressResidentialIndicator: string;
363
368
  };
369
+ noResults: string;
364
370
  subFields: {
365
371
  optional: string;
366
372
  };
@@ -393,6 +399,9 @@ declare const _default: {
393
399
  cardNumber: string;
394
400
  expiration: string;
395
401
  cvv: string;
402
+ cvvPlaceholder: string;
403
+ expirationPlaceholder: string;
404
+ cardNumberPlaceholder: string;
396
405
  };
397
406
  };
398
407
  carriers: {
@@ -487,6 +496,7 @@ declare const _default: {
487
496
  carriers: string;
488
497
  data: string;
489
498
  importingSalesOrder: string;
499
+ onboarding: string;
490
500
  salesOrder: string;
491
501
  shipment: string;
492
502
  warehouses: string;
@@ -524,6 +534,7 @@ declare const _default: {
524
534
  invalidAddressName: string;
525
535
  invalidAddressPoBox: string;
526
536
  invalidCreditCardType: string;
537
+ invalidExpiration: string;
527
538
  invalidPostalCode: string;
528
539
  invalidStateProvince: string;
529
540
  invalidString: string;
@@ -1,5 +1,5 @@
1
1
  import { DeepPartial } from "fishery";
2
- import { SE } from "@shipengine/api";
2
+ import { SE } from "@shipengine/js-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/api";
2
+ import { SE } from "@shipengine/js-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/api";
2
+ import { SE } from "@shipengine/js-api";
3
3
  /**
4
4
  * @category Form Validation
5
5
  */
@@ -1,4 +1,4 @@
1
- import { CarrierConnection, SE } from "@shipengine/api";
1
+ import { CarrierConnection, SE } from "@shipengine/js-api";
2
2
  export type CarrierTerm = {
3
3
  description: string;
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-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/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export declare const currencySymbol: Record<SE.Currency, string>;
3
3
  export declare const formatMoney: (value: SE.Money, locale?: string) => string;
4
4
  export declare const calculateTotal: (...values: SE.Money[]) => number;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  export declare const getRateRequiresAcknowledgement: (serviceCode: string) => boolean;
3
3
  export declare const getTotalRateAmount: (rateCosts?: {
4
4
  confirmationAmount?: SE.Money;
@@ -7,3 +7,4 @@ export declare const getTotalRateAmount: (rateCosts?: {
7
7
  shippingAmount?: SE.Money;
8
8
  taxAmount?: SE.Money;
9
9
  }) => number;
10
+ export declare const overrideCarrierCodes: (carrier: string, overrides: object) => never;
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  type ConvertDimensionsOptions = {
3
3
  allowAllZeroes?: boolean;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,4 +1,4 @@
1
- import { SE } from "@shipengine/api";
1
+ import { SE } from "@shipengine/js-api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { WithChildrenCommonProps } from "@packlink/giger";
3
- type AccordionProps = WithChildrenCommonProps<{
4
- bold?: boolean;
5
- /** Flag to indicate if the Accordion must appear expanded */
6
- initialExpanded?: boolean;
7
- /** Element to render at the right part of the summary */
8
- rightContent?: JSX.Element;
9
- /** Title to show */
10
- title?: string;
11
- }>;
12
- export declare const Accordion: ({ bold, initialExpanded, title, children, rightContent, ...rest }: AccordionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
13
- export {};
@@ -1,7 +0,0 @@
1
- import { SerializedStyles } from "@emotion/react";
2
- import { Theme } from "@packlink/giger-theme";
3
- export declare const getAccordionSummaryStyles: (theme: Theme) => SerializedStyles;
4
- export declare const getAccordionSummaryWrapperStyles: (theme: Theme) => SerializedStyles;
5
- export declare const getIconStyles: (theme: Theme) => SerializedStyles;
6
- export declare const getSectionStyles: (theme: Theme) => SerializedStyles;
7
- export declare const getRightContentWrapperStyles: () => SerializedStyles;
@@ -1 +0,0 @@
1
- export * from "./accordion";
@@ -1,5 +0,0 @@
1
- import { WalletTransactionHistory } from "@shipengine/api";
2
- export type HistoryBodyProps = {
3
- historyData: WalletTransactionHistory;
4
- };
5
- export declare const HistoryBody: ({ historyData }: HistoryBodyProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const styles: Record<"action" | "gridContainer" | "linkAction" | "pagination", import("@emotion/serialize").Interpolation<import("@packlink/giger-theme/dist/lib/Theme").Theme>>;
@@ -1 +0,0 @@
1
- export * from "./history-body";
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { WalletTransactionHistory } from "@shipengine/api";
3
- export type HistoryListProps = {
4
- historyData: WalletTransactionHistory;
5
- };
6
- /**
7
- * This component is the list of events that represent the history of a
8
- * specific entity. The events are displayed in reverse chronological order.
9
- *
10
- * @param historyData The history data to display.
11
- */
12
- export declare const HistoryList: React.FC<HistoryListProps>;
@@ -1 +0,0 @@
1
- export * from "./history-list";
@@ -1,6 +0,0 @@
1
- import { FC } from "react";
2
- export type HistoryRowProps = {
3
- key: number;
4
- rowItem: number;
5
- };
6
- export declare const HistoryRow: FC<HistoryRowProps>;
@@ -1 +0,0 @@
1
- export * from "./history-row";
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- import { HistoryBodyProps } from "./history-body";
3
- import { HistoryListProps } from "./history-list";
4
- import { HistoryRowProps } from "./history-row";
5
- export type History = React.FC & {
6
- Body: React.FC<HistoryBodyProps>;
7
- List: React.FC<HistoryListProps>;
8
- Row: React.FC<HistoryRowProps>;
9
- };
10
- export declare const History: History;
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- import { WalletTransactionHistory } from "@shipengine/api";
3
- export type WalletHistoryProps = {
4
- historyData: WalletTransactionHistory;
5
- };
6
- export declare const WalletHistory: React.FC<WalletHistoryProps>;
@@ -1 +0,0 @@
1
- export * from "./warehouse-preference-select";
@@ -1,24 +0,0 @@
1
- import { SE } from "@shipengine/api";
2
- export type WarehouseSuggested = {
3
- validation: SE.AddressValidation;
4
- validationType: "SUGGESTED";
5
- };
6
- export type WarehouseError = {
7
- validation: SE.AddressValidation;
8
- validationType: "ERROR";
9
- };
10
- export type WarehouseExactOrSoft = {
11
- address: SE.Address;
12
- validationType: "EXACT" | "SOFT";
13
- };
14
- export type WarehouseAddressPreference = WarehouseSuggested | WarehouseError | WarehouseExactOrSoft;
15
- export type WarehousePreferenceFormProps = {
16
- onCancel: () => void;
17
- onSubmit: (payload: {
18
- originAddress: SE.Address;
19
- returnAddress?: SE.Address;
20
- }) => Promise<void> | void;
21
- originAddress: WarehouseAddressPreference;
22
- returnAddress?: WarehouseAddressPreference;
23
- };
24
- export declare const WarehousePreferenceSelect: ({ onCancel, onSubmit, originAddress, returnAddress, }: WarehousePreferenceFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./warehouse-preference-wizard";
@@ -1,23 +0,0 @@
1
- /// <reference types="react" />
2
- import { SE } from "@shipengine/api";
3
- import { ManageWarehousesProps, WarehousePayload } from "../manage-warehouses";
4
- import { WarehouseAddressPreference } from "../warehouse-preference-select";
5
- export type WarehousePreference = {
6
- isDefault?: boolean;
7
- name: string;
8
- originAddress: WarehouseAddressPreference;
9
- returnAddress?: WarehouseAddressPreference;
10
- };
11
- export type WarehousePreferenceWizardProps = {
12
- className?: string;
13
- formHeader?: React.ReactNode;
14
- isOnboarding?: boolean;
15
- onSubmit: (payload: WarehousePayload) => Promise<void> | void;
16
- onValidate: ManageWarehousesProps["onValidate"];
17
- onWarehouseDelete?: () => Promise<void> | void;
18
- onWarehouseFormCancel?: () => void;
19
- submitButtonTitle: string;
20
- warehouse?: SE.Warehouse;
21
- warehousePreference?: WarehousePreference;
22
- };
23
- export declare const WarehousePreferenceWizard: ({ className, formHeader, isOnboarding, onSubmit, onValidate, onWarehouseDelete, onWarehouseFormCancel, submitButtonTitle, warehouse, warehousePreference, }: WarehousePreferenceWizardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const Element: (props: Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import { SE } from "@shipengine/api";
3
- import { Templates } from "../components";
4
- export declare const useWarehouseValidation: () => {
5
- errors: SE.CodedError[] | null;
6
- setWarehousePreference: import("react").Dispatch<import("react").SetStateAction<Templates.WarehousePreference | undefined>>;
7
- validate: (warehouse: Partial<SE.Warehouse> & Pick<SE.Warehouse, "name" | "originAddress" | "isDefault">) => Promise<{
8
- isDefault: boolean;
9
- name: string;
10
- originAddress: Templates.WarehouseAddressPreference;
11
- returnAddress: Templates.WarehouseAddressPreference;
12
- }>;
13
- warehousePreference: Templates.WarehousePreference | undefined;
14
- };