@shipengine/elements 0.9.1 → 0.9.7

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.
@@ -1,10 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { Templates } from "@shipengine/elements-ui";
3
2
  import * as SE from "@shipengine/types";
4
3
  import { UseShippingPresetsOptionsProps } from "@shipengine/elements-ui";
5
4
  import { UseRatesFormProps, UseShipmentFormProps } from "./hooks";
6
- export declare type ShipmentFormMode = "browse_rates" | "select_service";
7
- export declare type ConfigureShipmentProps = {
5
+ export type ShipmentFormMode = "browse_rates" | "select_service";
6
+ export type ConfigureShipmentProps = {
8
7
  errors?: Templates.ShipmentFormProps["errors"];
9
8
  isLoading?: Templates.ShipmentFormProps["isLoading"];
10
9
  onAddressValidation?: UseShipmentFormProps["onAddressValidation"];
@@ -24,4 +23,4 @@ export declare type ConfigureShipmentProps = {
24
23
  shippingPresets?: UseShippingPresetsOptionsProps;
25
24
  warehouseId?: string;
26
25
  };
27
- export declare const ConfigureShipment: ({ onAddressValidation, onApplyPreset, onBeforeLabelCreate, onChangeAddress, onLabelCreateFailure, onLabelCreateSuccess, onRateSaved, onRatesCalculated, onShipmentUpdated, printLabelLayout, salesOrder, shipment, ...props }: ConfigureShipmentProps) => JSX.Element;
26
+ export declare const ConfigureShipment: ({ onAddressValidation, onApplyPreset, onBeforeLabelCreate, onChangeAddress, onLabelCreateFailure, onLabelCreateSuccess, onRateSaved, onRatesCalculated, onShipmentUpdated, printLabelLayout, salesOrder, shipment, ...props }: ConfigureShipmentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { Templates } from "@shipengine/elements-ui";
2
2
  import * as SE from "@shipengine/types";
3
- export declare type UseAddressProps = {
3
+ export type UseAddressProps = {
4
4
  onChange?: (oldShipment: SE.SalesOrderShipment, updatedShipment: SE.SalesOrderShipment) => Promise<void> | void;
5
5
  onValidation?: (addressPreference: Templates.AddressPreference) => Promise<void> | void;
6
6
  salesOrder: SE.SalesOrder;
@@ -1,5 +1,5 @@
1
1
  import * as SE from "@shipengine/types";
2
- export declare type UseCustomsProps = {
2
+ export type UseCustomsProps = {
3
3
  onUpdate?: (shipment: SE.SalesOrderShipment) => Promise<void> | void;
4
4
  shipment?: SE.SalesOrderShipment;
5
5
  };
@@ -1,7 +1,7 @@
1
1
  import { ShippingPreset } from "@shipengine/elements-core";
2
2
  import * as SE from "@shipengine/types";
3
- export declare type UsePresetsProps = {
4
- onApply?: (preset: ShippingPreset, shipment: SE.SalesOrderShipment) => Promise<void>;
3
+ export type UsePresetsProps = {
4
+ onApply?: (preset: ShippingPreset, shipment: SE.SalesOrderShipment) => Promise<void> | void;
5
5
  shipment?: SE.SalesOrderShipment;
6
6
  };
7
7
  export declare const usePresets: ({ onApply, shipment }: UsePresetsProps) => {
@@ -1,6 +1,6 @@
1
1
  import * as SE from "@shipengine/types";
2
2
  import { UseRequestRatesProps } from "./use-request-rates";
3
- export declare type UseRatesFormProps = {
3
+ export type UseRatesFormProps = {
4
4
  onBeforeLabelCreate?: (rate: SE.Rate, shipment: SE.SalesOrderShipment) => Promise<void> | void;
5
5
  onLabelCreateFailure?: (rate: SE.Rate, shipment: SE.SalesOrderShipment) => Promise<void> | void;
6
6
  onLabelCreateSuccess?: (label: SE.Label, shipment: SE.SalesOrderShipment) => Promise<void> | void;
@@ -1,5 +1,5 @@
1
1
  import * as SE from "@shipengine/types";
2
- export declare type UseRequestRatesProps = {
2
+ export type UseRequestRatesProps = {
3
3
  onRatesCalculated?: (rates: SE.Rate[], shipment: SE.SalesOrderShipment) => Promise<void> | void;
4
4
  };
5
5
  export declare const useRequestRates: ({ onRatesCalculated }: UseRequestRatesProps) => {
@@ -2,12 +2,12 @@ import { ShippingPreset } from "@shipengine/elements-core";
2
2
  import * as SE from "@shipengine/types";
3
3
  import { UseAddressProps } from "./use-address";
4
4
  import { UsePresetsProps } from "./use-presets";
5
- export declare type UseShipmentFormProps = {
5
+ export type UseShipmentFormProps = {
6
6
  onAddressValidation?: UseAddressProps["onValidation"];
7
7
  onApplyPreset?: UsePresetsProps["onApply"];
8
8
  onChangeAddress?: UseAddressProps["onChange"];
9
- onShipmentUpdated?: (shipment: SE.SalesOrderShipment) => Promise<void>;
10
- onSubmit?: (shipment: SE.SalesOrderShipment) => Promise<void>;
9
+ onShipmentUpdated?: (shipment: SE.SalesOrderShipment) => Promise<void> | void;
10
+ onSubmit?: (shipment: SE.SalesOrderShipment) => Promise<void> | void;
11
11
  salesOrder: SE.SalesOrder;
12
12
  shipment?: SE.SalesOrderShipment;
13
13
  };
@@ -1,7 +1,7 @@
1
1
  import * as SE from "@shipengine/types";
2
2
  import { ConfigureShipmentProps } from "../../configure-shipment";
3
3
  import { UsePendingShipmentProps } from "./use-pending-shipment";
4
- export declare type UseConfigureShipmentProps = {
4
+ export type UseConfigureShipmentProps = {
5
5
  onLoad?: UsePendingShipmentProps["onLoad"];
6
6
  onShipmentUpdated?: ConfigureShipmentProps["onShipmentUpdated"];
7
7
  salesOrder?: SE.SalesOrder;
@@ -1,4 +1,4 @@
1
- export declare type UseImportSalesOrderProps = {
1
+ export type UseImportSalesOrderProps = {
2
2
  externalOrderId?: string;
3
3
  externalOrderNumber?: string;
4
4
  orderSourceCode?: string;
@@ -1,6 +1,6 @@
1
1
  import * as SE from "@shipengine/types";
2
- export declare type UsePendingShipmentProps = {
3
- onLoad?: (salesOrder: SE.SalesOrder, shipments: SE.SalesOrderShipment[], pendingShipment?: SE.SalesOrderShipment) => Promise<void>;
2
+ export type UsePendingShipmentProps = {
3
+ onLoad?: (salesOrder: SE.SalesOrder, shipments: SE.SalesOrderShipment[], pendingShipment?: SE.SalesOrderShipment) => Promise<void> | void;
4
4
  salesOrder?: SE.SalesOrder;
5
5
  warehouseId?: string;
6
6
  };
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { UseShippingPresetsOptionsProps } from "@shipengine/elements-ui";
3
2
  import { ConfigureShipmentProps } from "../configure-shipment";
4
3
  import { UseConfigureShipmentProps, UseImportSalesOrderProps } from "./hooks";
5
- export declare type SalesOrderProps = {
4
+ export type SalesOrderProps = {
6
5
  externalOrderId?: UseImportSalesOrderProps["externalOrderId"];
7
6
  externalOrderNumber?: UseImportSalesOrderProps["externalOrderNumber"];
8
7
  onAddressValidation?: ConfigureShipmentProps["onAddressValidation"];
@@ -23,4 +22,4 @@ export declare type SalesOrderProps = {
23
22
  shippingPresets?: UseShippingPresetsOptionsProps;
24
23
  warehouseId?: UseConfigureShipmentProps["warehouseId"];
25
24
  };
26
- export declare const SalesOrder: ({ externalOrderId, externalOrderNumber, onLoad, onShipmentUpdated, orderSourceCode, salesOrderId, warehouseId, ...props }: SalesOrderProps) => JSX.Element;
25
+ export declare const SalesOrder: ({ externalOrderId, externalOrderNumber, onLoad, onShipmentUpdated, orderSourceCode, salesOrderId, warehouseId, ...props }: SalesOrderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,9 +1,8 @@
1
- /// <reference types="react" />
2
1
  import * as SE from "@shipengine/types";
3
- export declare type ShipmentProps = {
2
+ export type ShipmentProps = {
4
3
  shipmentId?: string;
5
4
  onClickPurchaseLabel?: (order: SE.SalesOrder) => void;
6
5
  onClickPrintLabel?: () => void;
7
6
  onClickVoidLabel?: (label: SE.Label) => void;
8
7
  };
9
- export declare const Shipment: ({ onClickPrintLabel, onClickPurchaseLabel, onClickVoidLabel, shipmentId, }: ShipmentProps) => JSX.Element;
8
+ export declare const Shipment: ({ onClickPrintLabel, onClickPurchaseLabel, onClickVoidLabel, shipmentId, }: ShipmentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,9 +1,8 @@
1
- /// <reference types="react" />
2
1
  import * as SE from "@shipengine/types";
3
- export declare type VoidLabelProps = {
2
+ export type VoidLabelProps = {
4
3
  labelId?: string;
5
4
  onComplete: (request: SE.VoidRequest, shipment: SE.SalesOrderShipment) => void;
6
5
  onSuccess?: (label: SE.Label, shipment: SE.SalesOrderShipment) => void;
7
6
  onViewShipment: (shipment: SE.SalesOrderShipment) => void;
8
7
  };
9
- export declare const VoidLabel: ({ labelId, onComplete, onSuccess, onViewShipment }: VoidLabelProps) => JSX.Element;
8
+ export declare const VoidLabel: ({ labelId, onComplete, onSuccess, onViewShipment }: VoidLabelProps) => import("@emotion/react/jsx-runtime").JSX.Element;