@shipengine/elements 0.10.1 → 0.11.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.
@@ -3,13 +3,13 @@ import * as SE from "@shipengine/types";
3
3
  import { UseShippingPresetsOptionsProps } from "@shipengine/elements-ui";
4
4
  import { UseRatesFormProps, UseShipmentFormProps } from "./hooks";
5
5
  export type ShipmentFormMode = "browse_rates" | "select_service";
6
- export type Features = {
7
- shipmentForm?: Templates.ShipmentFormFeatures;
6
+ export type SalesOrderFeatures = {
8
7
  rateForm?: Templates.RateFormFeatures;
8
+ shipmentForm?: Templates.ShipmentFormFeatures;
9
9
  };
10
10
  export type ConfigureShipmentProps = {
11
11
  errors?: Templates.ShipmentFormProps["errors"];
12
- features?: Features;
12
+ features?: SalesOrderFeatures;
13
13
  isLoading?: Templates.ShipmentFormProps["isLoading"];
14
14
  onAddressValidation?: UseShipmentFormProps["onAddressValidation"];
15
15
  onApplyPreset?: UseShipmentFormProps["onApplyPreset"];
@@ -9,6 +9,7 @@ export type UseAddressProps = {
9
9
  export declare const useAddress: ({ onChange, onValidation, salesOrder, shipment }: UseAddressProps) => {
10
10
  addressErrors: SE.CodedError[] | undefined;
11
11
  addressPreference: Templates.AddressPreference | undefined;
12
- handleChangeAddress: (shipTo: SE.Address, { shouldValidate }: Templates.OnChangeAddressOptions) => Promise<void>;
12
+ charsetWarning: Templates.CharsetWarning | undefined;
13
+ handleChangeAddress: (shipTo: SE.Address, { shouldValidate }: Templates.OnChangeAddressOptions) => Promise<SE.SalesOrderShipment | undefined>;
13
14
  handleParseShipTo: ({ fullAddress }: Templates.AddressParserPayload) => Promise<SE.AddressParseResponse | undefined>;
14
15
  };
@@ -13,11 +13,12 @@ export type UseShipmentFormProps = {
13
13
  };
14
14
  export declare const useShipmentForm: ({ onAddressValidation, onApplyPreset, onChangeAddress, onShipmentUpdated, onSubmit, salesOrder, shipment, }: UseShipmentFormProps) => {
15
15
  addressPreference: import("dist/elements-ui/components/templates").AddressPreference | undefined;
16
+ charsetWarning: import("dist/elements-ui/components/templates").CharsetWarning | undefined;
16
17
  carriers: SE.Carrier[] | undefined;
17
18
  customPackageTypes: SE.Package[] | undefined;
18
19
  errors: SE.CodedError[] | undefined;
19
20
  onApplyPreset: (preset: ShippingPreset) => Promise<void>;
20
- onChangeAddress: (shipTo: SE.Address, { shouldValidate }: import("dist/elements-ui/components/templates").OnChangeAddressOptions) => Promise<void>;
21
+ onChangeAddress: (shipTo: SE.Address, { shouldValidate }: import("dist/elements-ui/components/templates").OnChangeAddressOptions) => Promise<SE.SalesOrderShipment | undefined>;
21
22
  onSubmit: (values: Partial<SE.SalesOrderShipment>) => Promise<SE.SalesOrderShipment | undefined>;
22
23
  onSubmitParseShipTo: ({ fullAddress }: {
23
24
  fullAddress: string;
@@ -1,8 +1,13 @@
1
1
  import * as SE from "@shipengine/types";
2
+ import { Templates } from "@shipengine/elements-ui";
3
+ export type ShipmentFeatures = {
4
+ shipment?: Templates.ShipmentFeatures;
5
+ };
2
6
  export type ShipmentProps = {
3
- shipmentId?: string;
4
- onClickPurchaseLabel?: (order: SE.SalesOrder) => void;
7
+ features: ShipmentFeatures;
5
8
  onClickPrintLabel?: () => void;
9
+ onClickPurchaseLabel?: (order: SE.SalesOrder) => void;
6
10
  onClickVoidLabel?: (label: SE.Label) => void;
11
+ shipmentId?: string;
7
12
  };
8
- export declare const Shipment: ({ onClickPrintLabel, onClickPurchaseLabel, onClickVoidLabel, shipmentId, }: ShipmentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
13
+ export declare const Shipment: ({ features, onClickPrintLabel, onClickPurchaseLabel, onClickVoidLabel, shipmentId, }: ShipmentProps) => import("@emotion/react/jsx-runtime").JSX.Element;