@shipengine/elements 0.16.0 → 0.17.2
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.
- package/components/add-funds-form/add-funds-form.d.ts +22 -0
- package/components/add-funds-form/add-funds-form.styles.d.ts +6 -0
- package/components/{organisms/manual-funding-form/manual-funding-schema.d.ts → add-funds-form/add-funds-schema.d.ts} +13 -3
- package/components/add-funds-form/index.d.ts +2 -0
- package/components/auto-funding-form/auto-funding-form.d.ts +8 -0
- package/components/auto-funding-form/index.d.ts +2 -0
- package/components/carrier-balance/carrier-balance.d.ts +4 -0
- package/components/carrier-balance/carrier-balance.styles.d.ts +1 -0
- package/components/carrier-balance/index.d.ts +1 -0
- package/components/field/create-field-controller.d.ts +2 -1
- package/components/fund-and-purchase/fund-and-purchase.d.ts +15 -0
- package/components/fund-and-purchase/fund-and-purchase.styles.d.ts +1 -0
- package/components/fund-and-purchase/index.d.ts +1 -0
- package/components/index.d.ts +9 -0
- package/components/inline-label/index.d.ts +1 -0
- package/components/inline-label/inline-label.d.ts +6 -0
- package/components/items-breakdown/items-breakdown.d.ts +1 -1
- package/components/link-action/index.d.ts +1 -0
- package/components/link-action/link-action.d.ts +12 -0
- package/components/manage-funding/manage-funding.d.ts +4 -0
- package/components/spread/index.d.ts +1 -0
- package/components/spread/spread.d.ts +5 -0
- package/components/story-notes/index.d.ts +1 -0
- package/components/story-notes/story-notes.d.ts +11 -0
- package/components/templates/completion-page/completion-page.d.ts +4 -0
- package/components/templates/completion-page/index.d.ts +1 -0
- package/components/templates/index.d.ts +2 -2
- package/components/templates/list-carriers-row/list-carriers-row.styles.d.ts +1 -1
- package/components/templates/rate-form/rate-form.styles.d.ts +1 -0
- package/components/templates/shipment-form/shipment-form.d.ts +1 -1
- package/components/templates/suspend-sales-order/index.d.ts +1 -0
- package/components/templates/suspend-sales-order/suspend-sales-order.d.ts +8 -0
- package/components/templates/suspend-shipment/index.d.ts +1 -0
- package/components/templates/suspend-shipment/suspend-shipment.d.ts +8 -0
- package/elements/components/configure-shipment/configure-shipment.d.ts +1 -1
- package/elements/components/configure-shipment/hooks/use-address.d.ts +1 -1
- package/elements/components/configure-shipment/hooks/use-shipment-form.d.ts +2 -2
- package/elements/components/index.d.ts +1 -2
- package/elements/components/{sales-order → purchase-label}/hooks/use-configure-shipment.d.ts +1 -1
- package/elements/components/purchase-label/hooks/use-load-shipment.d.ts +9 -0
- package/elements/components/purchase-label/index.d.ts +3 -0
- package/elements/components/{sales-order/sales-order.d.ts → purchase-label/purchase-label-by-sales-order.d.ts} +1 -1
- package/elements/components/purchase-label/purchase-label-by-shipment.d.ts +9 -0
- package/elements/components/purchase-label/purchase-label.d.ts +6 -0
- package/elements/index.d.ts +0 -1
- package/elements/purchase-label.d.ts +3 -1
- package/hooks/use-elements.d.ts +2 -1
- package/hooks/use-nested-form.d.ts +2 -2
- package/index.cjs +1326 -947
- package/index.js +1315 -948
- package/locales/en/index.d.ts +19 -6
- package/mocks/carriers/handlers.d.ts +12 -1
- package/mocks/carriers/index.d.ts +1 -0
- package/mocks/index.d.ts +2 -0
- package/mocks/server.d.ts +2 -0
- package/mocks/warehouses/handlers.d.ts +1 -0
- package/mocks/warehouses/index.d.ts +1 -0
- package/package.json +5 -4
- package/testing/render.d.ts +5 -0
- package/utilities/rates.d.ts +1 -1
- package/utilities/shipengine/sales-order.d.ts +10 -0
- package/components/organisms/auto-funding-form/auto-funding-form.d.ts +0 -16
- package/components/organisms/auto-funding-form/index.d.ts +0 -1
- package/components/organisms/index.d.ts +0 -2
- package/components/organisms/manual-funding-form/index.d.ts +0 -2
- package/components/organisms/manual-funding-form/manual-funding-form.d.ts +0 -18
- package/components/templates/funding-methods/funding-methods.d.ts +0 -18
- package/components/templates/funding-methods/funding-methods.styles.d.ts +0 -1
- package/components/templates/funding-methods/index.d.ts +0 -1
- package/components/templates/sales-order/index.d.ts +0 -1
- package/components/templates/sales-order/sales-order.d.ts +0 -8
- package/elements/components/manage-funding/manage-funding.d.ts +0 -6
- package/elements/components/sales-order/index.d.ts +0 -1
- package/elements/manage-funding.d.ts +0 -1
- package/mocks/handlers.d.ts +0 -12
- /package/components/{organisms/auto-funding-form → auto-funding-form}/auto-funding-form.styles.d.ts +0 -0
- /package/components/{organisms/auto-funding-form → auto-funding-form}/auto-funding-schema.d.ts +0 -0
- /package/{elements/components → components}/manage-funding/index.d.ts +0 -0
- /package/elements/components/{sales-order → purchase-label}/hooks/index.d.ts +0 -0
- /package/elements/components/{sales-order → purchase-label}/hooks/use-import-sales-order.d.ts +0 -0
- /package/elements/components/{sales-order → purchase-label}/hooks/use-pending-shipment.d.ts +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type AddFundsFormProvider = {
|
|
3
|
+
isCustomAmount?: boolean;
|
|
4
|
+
isSubmitted?: boolean;
|
|
5
|
+
isSubmitting?: boolean;
|
|
6
|
+
isValid?: boolean;
|
|
7
|
+
selectedAmount?: number;
|
|
8
|
+
submit?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export type AddFundsFormProps = {
|
|
11
|
+
carrierId: string;
|
|
12
|
+
children?: (addFundsForm: AddFundsFormProvider) => React.ReactElement;
|
|
13
|
+
minimumAmount?: number;
|
|
14
|
+
onCancel?: () => void;
|
|
15
|
+
onSuccess?: () => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Form for adding funds to a carrier's account.
|
|
19
|
+
*
|
|
20
|
+
* If a render child is provided, external control is assumed and the cancel / submit buttons are hidden.
|
|
21
|
+
*/
|
|
22
|
+
export declare const AddFundsForm: ({ carrierId, children, onCancel, onSuccess, minimumAmount, }: AddFundsFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type GetStylesProps = {
|
|
2
|
+
isDisabled?: boolean;
|
|
3
|
+
isSelected?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const getStyles: ({ isDisabled, isSelected }?: GetStylesProps) => Record<"chip" | "chipList" | "fundsInput", import("@emotion/serialize").Interpolation<import("@packlink/brands/dist/js/theme/Theme").Theme>>;
|
|
6
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getAddFundsSchema: (minimumAmount?: number) => z.ZodEffects<z.ZodObject<{
|
|
3
3
|
funds: z.ZodObject<z.extendShape<{
|
|
4
4
|
amount: z.ZodNumber;
|
|
5
5
|
currency: z.ZodNativeEnum<typeof import("@shipengine/api").Currency>;
|
|
@@ -22,6 +22,16 @@ export declare const manualFundingSchema: z.ZodObject<{
|
|
|
22
22
|
amount: number;
|
|
23
23
|
currency: import("@shipengine/api").Currency;
|
|
24
24
|
};
|
|
25
|
+
}>, {
|
|
26
|
+
amount: number;
|
|
27
|
+
currency: import("@shipengine/api").Currency;
|
|
28
|
+
}, {
|
|
29
|
+
funds: {
|
|
30
|
+
amount: number;
|
|
31
|
+
currency: import("@shipengine/api").Currency;
|
|
32
|
+
};
|
|
25
33
|
}>;
|
|
26
|
-
|
|
27
|
-
export type
|
|
34
|
+
type AddFundsFormSchema = ReturnType<typeof getAddFundsSchema>;
|
|
35
|
+
export type AddFundsFormFields = z.input<AddFundsFormSchema>;
|
|
36
|
+
export type AddFundsFormPayload = z.output<AddFundsFormSchema>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type AutoFundingFormProps = {
|
|
2
|
+
carrierId: string;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* This form that allows users to enable or disable auto funding, and
|
|
6
|
+
* configure auto funding settings in ShipEngine API.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AutoFundingForm: ({ carrierId }: AutoFundingFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getStyles: (balance?: number) => Record<"balanceText", import("@emotion/serialize").Interpolation<import("@packlink/brands/dist/js/theme/Theme").Theme>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./carrier-balance";
|
|
@@ -10,6 +10,7 @@ export type FieldControllerProps<NP, TFieldValues extends FieldValues = FieldVal
|
|
|
10
10
|
displayErrors?: boolean;
|
|
11
11
|
displayLabel?: boolean;
|
|
12
12
|
errors?: string[];
|
|
13
|
+
hint?: string;
|
|
13
14
|
inputOnly?: boolean;
|
|
14
15
|
isOptional?: boolean;
|
|
15
16
|
label: string;
|
|
@@ -19,7 +20,7 @@ export type FieldControllerProps<NP, TFieldValues extends FieldValues = FieldVal
|
|
|
19
20
|
type FieldControllerOptions = {
|
|
20
21
|
inputOnly?: boolean;
|
|
21
22
|
};
|
|
22
|
-
export declare const createFieldController: <P>(options?: FieldControllerOptions) => <TFieldValues extends FieldValues = FieldValues, TName extends import("react-hook-form").Path<TFieldValues> = import("react-hook-form").Path<TFieldValues>>({ children, control, defaultValue, displayErrors, displayLabel, errors: errorsProp, inputOnly, isOptional, label, labelWeight, name, nativeLabel, rules, shouldUnregister, subLabel, ...formInputProps }: FieldControllerProps<P, TFieldValues, TName>) => JSX.Element;
|
|
23
|
+
export declare const createFieldController: <P>(options?: FieldControllerOptions) => <TFieldValues extends FieldValues = FieldValues, TName extends import("react-hook-form").Path<TFieldValues> = import("react-hook-form").Path<TFieldValues>>({ children, control, defaultValue, displayErrors, displayLabel, errors: errorsProp, hint, inputOnly, isOptional, label, labelWeight, name, nativeLabel, rules, shouldUnregister, subLabel, ...formInputProps }: FieldControllerProps<P, TFieldValues, TName>) => JSX.Element;
|
|
23
24
|
export type ControlledFieldProps = Parameters<ControlledField>[0];
|
|
24
25
|
export type ControlledField<NP = object, CP = object, OK extends string = ""> = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(fieldProps: Omit<FieldControllerProps<NP, TFieldValues, TName>, "children" | OK> & CP) => JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type FundAndPurchaseProps = {
|
|
2
|
+
carrierId?: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
isFundingRequired: boolean;
|
|
6
|
+
onPurchase: () => void;
|
|
7
|
+
onSave: () => Promise<void>;
|
|
8
|
+
purchaseAmount: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Fund and Purchase handles the label purchase submission UX, ensuring that a user
|
|
12
|
+
* has the necessary funds available and can add them if not. It allows a single button
|
|
13
|
+
* to submit the funding form followed by the purchase form.
|
|
14
|
+
*/
|
|
15
|
+
export declare const FundAndPurchase: ({ carrierId, className, disabled, isFundingRequired, onSave, purchaseAmount, onPurchase, }: FundAndPurchaseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getStyles: (isCustomAmount?: boolean) => Record<"balanceText" | "container" | "formExtension" | "saveRateButton", import("@emotion/serialize").Interpolation<import("@packlink/brands/dist/js/theme/Theme").Theme>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./fund-and-purchase";
|
package/components/index.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
export * as Templates from "./templates";
|
|
2
2
|
export * from "./accordion";
|
|
3
|
+
export * from "./add-funds-form";
|
|
4
|
+
export * from "./auto-funding-form";
|
|
3
5
|
export * from "./button-group";
|
|
6
|
+
export * from "./carrier-balance";
|
|
4
7
|
export * from "./cube";
|
|
5
8
|
export * from "./error-boundary";
|
|
6
9
|
export * from "./field";
|
|
7
10
|
export * from "./field-label";
|
|
8
11
|
export * from "./form-portal";
|
|
12
|
+
export * from "./fund-and-purchase";
|
|
13
|
+
export * from "./inline-label";
|
|
9
14
|
export * from "./items-breakdown";
|
|
15
|
+
export * from "./link-action";
|
|
10
16
|
export * from "./loader";
|
|
17
|
+
export * from "./manage-funding";
|
|
11
18
|
export * from "./portal";
|
|
12
19
|
export * from "./spacer";
|
|
20
|
+
export * from "./spread";
|
|
21
|
+
export * from "./story-notes";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./inline-label";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./link-action";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IconNames } from "@packlink/brands";
|
|
2
|
+
import { ILinkProps } from "@packlink/giger";
|
|
3
|
+
declare const icons: {
|
|
4
|
+
readonly add: IconNames.ADD;
|
|
5
|
+
readonly download: IconNames.DOWNLOAD;
|
|
6
|
+
};
|
|
7
|
+
export type LinkActionProps = {
|
|
8
|
+
icon?: keyof typeof icons;
|
|
9
|
+
title: string;
|
|
10
|
+
} & ILinkProps;
|
|
11
|
+
export declare const LinkAction: ({ css, icon, isDisabled, isLoading, title, ...props }: LinkActionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./spread";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./story-notes";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type StoryNotesProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
notes: string[];
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* For relevant notes about Storybook stories
|
|
8
|
+
*
|
|
9
|
+
* Stopgap until we setup https://storybook.js.org/addons/@storybook/addon-docs
|
|
10
|
+
*/
|
|
11
|
+
export declare const StoryNotes: ({ children, notes }: StoryNotesProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./completion-page";
|
|
@@ -6,16 +6,16 @@ export * from "./address-preference-display";
|
|
|
6
6
|
export * from "./carrier-recovery-form";
|
|
7
7
|
export * from "./carrier-terms-form";
|
|
8
8
|
export * from "./customs-item-form";
|
|
9
|
-
export * from "./funding-methods";
|
|
10
9
|
export * from "./label";
|
|
11
10
|
export * from "./landing-page";
|
|
12
11
|
export * from "./list-carriers";
|
|
13
12
|
export * from "./manage-warehouses";
|
|
14
13
|
export * from "./onboarding";
|
|
15
14
|
export * from "./rate-form";
|
|
16
|
-
export * from "./sales-order";
|
|
15
|
+
export * from "./suspend-sales-order";
|
|
17
16
|
export * from "./shipment-form";
|
|
18
17
|
export * from "./shipment";
|
|
18
|
+
export * from "./suspend-shipment";
|
|
19
19
|
export * from "./warehouse-form";
|
|
20
20
|
export * from "./void-label";
|
|
21
21
|
export * from "./wallet-form";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const getStyles: (isConnected?: boolean) => Record<"connectButton" | "container" | "logoContainer" | "rowContainer", import("@emotion/serialize").Interpolation<import("@packlink/brands/dist/js/theme/Theme").Theme>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: Record<"fundAndPurchase" | "ratesInterstitial" | "showMoreOrLessRatesButton", import("@emotion/serialize").Interpolation<import("@packlink/brands/dist/js/theme/Theme").Theme>>;
|
|
@@ -30,7 +30,7 @@ export type ShipmentFormProps = {
|
|
|
30
30
|
onSubmitParseShipTo: (payload: AddressParserPayload) => Promise<SE.AddressExtraction | undefined>;
|
|
31
31
|
onToggleAddressPreferenceDisclosure?: AddressPreferenceDisplayProps["onToggleDisclosure"];
|
|
32
32
|
onUpdateCustoms?: (customs: SE.Customs) => Promise<SE.SalesOrderShipment | undefined>;
|
|
33
|
-
salesOrder
|
|
33
|
+
salesOrder?: SE.SalesOrder;
|
|
34
34
|
shipment?: SE.SalesOrderShipment;
|
|
35
35
|
shippingPresets?: UseShippingPresetsOptionsProps;
|
|
36
36
|
warehouseId?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./suspend-sales-order";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WithChildrenCommonProps } from "@packlink/giger";
|
|
2
|
+
import { SE } from "@shipengine/api";
|
|
3
|
+
export type SuspendSalesOrderProps = WithChildrenCommonProps<{
|
|
4
|
+
errors?: SE.CodedError[];
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
salesOrder?: SE.SalesOrder;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const SuspendSalesOrder: ({ children, errors, isLoading, salesOrder, }: SuspendSalesOrderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./suspend-shipment";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WithChildrenCommonProps } from "@packlink/giger";
|
|
2
|
+
import { SE } from "@shipengine/api";
|
|
3
|
+
export type SuspendShipmentProps = WithChildrenCommonProps<{
|
|
4
|
+
errors?: SE.CodedError[];
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
shipment?: SE.SalesOrderShipment;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const SuspendShipment: ({ children, errors, isLoading, shipment, }: SuspendShipmentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -24,7 +24,7 @@ export type ConfigureShipmentProps = {
|
|
|
24
24
|
onShipmentUpdated: UseShipmentFormProps["onShipmentUpdated"];
|
|
25
25
|
onToggleAddressPreferenceDisclosure?: Templates.ShipmentFormProps["onToggleAddressPreferenceDisclosure"];
|
|
26
26
|
printLabelLayout?: UseRatesFormProps["printLabelLayout"];
|
|
27
|
-
salesOrder
|
|
27
|
+
salesOrder?: SE.SalesOrder;
|
|
28
28
|
shipment?: SE.SalesOrderShipment;
|
|
29
29
|
shippingPresets?: UseShippingPresetsOptionsProps;
|
|
30
30
|
warehouseId?: string;
|
|
@@ -5,7 +5,7 @@ export type UseAddressProps = {
|
|
|
5
5
|
compatibleCountryCodes?: CountryCode[];
|
|
6
6
|
onChange?: (oldShipment: SE.SalesOrderShipment, updatedShipment: SE.SalesOrderShipment) => Promise<void> | void;
|
|
7
7
|
onValidation?: (addressPreference: Templates.AddressPreference) => Promise<void> | void;
|
|
8
|
-
salesOrder
|
|
8
|
+
salesOrder?: SE.SalesOrder;
|
|
9
9
|
shipment?: SE.SalesOrderShipment;
|
|
10
10
|
};
|
|
11
11
|
export declare const useAddress: ({ compatibleCountryCodes, onChange, onValidation, salesOrder, shipment, }: UseAddressProps) => {
|
|
@@ -9,7 +9,7 @@ export type UseShipmentFormProps = {
|
|
|
9
9
|
onChangeAddress?: UseAddressProps["onChange"];
|
|
10
10
|
onShipmentUpdated?: (shipment: SE.SalesOrderShipment) => Promise<void> | void;
|
|
11
11
|
onSubmit?: (shipment: SE.SalesOrderShipment) => Promise<void> | void;
|
|
12
|
-
salesOrder
|
|
12
|
+
salesOrder?: SE.SalesOrder;
|
|
13
13
|
shipment?: SE.SalesOrderShipment;
|
|
14
14
|
};
|
|
15
15
|
export declare const useShipmentForm: ({ compatibleCountryCodes, onAddressValidation, onApplyPreset, onChangeAddress, onShipmentUpdated, onSubmit, salesOrder, shipment, }: UseShipmentFormProps) => {
|
|
@@ -25,7 +25,7 @@ export declare const useShipmentForm: ({ compatibleCountryCodes, onAddressValida
|
|
|
25
25
|
fullAddress: string;
|
|
26
26
|
}) => Promise<SE.AddressExtraction>;
|
|
27
27
|
onUpdateCustoms: (customs: SE.Customs) => Promise<SE.SalesOrderShipment>;
|
|
28
|
-
salesOrder: SE.SalesOrder;
|
|
28
|
+
salesOrder: SE.SalesOrder | undefined;
|
|
29
29
|
shipment: SE.SalesOrderShipment | undefined;
|
|
30
30
|
warehouses: SE.Warehouse[] | undefined;
|
|
31
31
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export * from "./configure-shipment";
|
|
2
2
|
export * from "./list-carriers";
|
|
3
|
-
export * from "./manage-funding";
|
|
4
3
|
export * from "./manage-warehouses";
|
|
5
4
|
export * from "./onboarding";
|
|
6
|
-
export * from "./
|
|
5
|
+
export * from "./purchase-label";
|
|
7
6
|
export * from "./shipment";
|
|
8
7
|
export * from "./void-label";
|
package/elements/components/{sales-order → purchase-label}/hooks/use-configure-shipment.d.ts
RENAMED
|
@@ -8,7 +8,7 @@ export type UseConfigureShipmentProps = {
|
|
|
8
8
|
salesOrder?: SE.SalesOrder;
|
|
9
9
|
warehouseId?: UsePendingShipmentProps["warehouseId"];
|
|
10
10
|
};
|
|
11
|
-
export declare const useConfigureShipment: ({ onLoad, onShipmentUpdated, salesOrder, warehouseId, }: UseConfigureShipmentProps) => {
|
|
11
|
+
export declare const useConfigureShipment: ({ onLoad, onShipmentUpdated, salesOrder, warehouseId, printLabelLayout, }: UseConfigureShipmentProps) => {
|
|
12
12
|
errors: SE.CodedError[] | undefined;
|
|
13
13
|
isLoading: boolean;
|
|
14
14
|
onShipmentUpdated: (shipment: SE.SalesOrderShipment) => Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type UseLoadShipmentProps = {
|
|
2
|
+
shipmentId: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const useLoadShipment: ({ shipmentId }: UseLoadShipmentProps) => {
|
|
5
|
+
errors: import("@shipengine/api").CodedError[] | undefined;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
refetchShipment: <TPageData>(options?: (import("react-query").RefetchOptions & import("react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("react-query").QueryObserverResult<import("@shipengine/api").SalesOrderShipment, import("@shipengine/api").CodedError[]>>;
|
|
8
|
+
shipment: import("@shipengine/api").SalesOrderShipment | undefined;
|
|
9
|
+
};
|
|
@@ -23,4 +23,4 @@ export type SalesOrderProps = {
|
|
|
23
23
|
shippingPresets?: UseShippingPresetsOptionsProps;
|
|
24
24
|
warehouseId?: UseConfigureShipmentProps["warehouseId"];
|
|
25
25
|
};
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const PurchaseLabelBySalesOrder: ({ features, externalOrderId, externalOrderNumber, onLoad, onShipmentUpdated, orderSourceCode, salesOrderId, warehouseId, printLabelLayout, ...props }: SalesOrderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { SalesOrderProps } from "./purchase-label-by-sales-order";
|
|
3
|
+
type ShipmentOrderProps = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
shipmentId: string;
|
|
6
|
+
};
|
|
7
|
+
type PurchaseLabelByShipmentProps = Partial<SalesOrderProps> & ShipmentOrderProps;
|
|
8
|
+
export declare const PurchaseLabelByShipment: ({ shipmentId, onLoad, onShipmentUpdated, features, ...props }: PurchaseLabelByShipmentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SalesOrderProps } from "./purchase-label-by-sales-order";
|
|
2
|
+
type PurchaseLabelProps = SalesOrderProps & {
|
|
3
|
+
shipmentId?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const PurchaseLabel: ({ shipmentId, ...props }: PurchaseLabelProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
package/elements/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { Element as ListCarriers } from "./list-carriers";
|
|
2
|
-
export { Element as ManageFunding } from "./manage-funding";
|
|
3
2
|
export { Element as ManageWarehouses } from "./manage-warehouses";
|
|
4
3
|
export { Element as PurchaseLabel } from "./purchase-label";
|
|
5
4
|
export { Element as Onboarding } from "./onboarding";
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export declare const Element: (props: import("./components
|
|
1
|
+
export declare const Element: (props: import("./components").SalesOrderProps & {
|
|
2
|
+
shipmentId?: string | undefined;
|
|
3
|
+
} & Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
package/hooks/use-elements.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ShipEngineProviderProps } from "@shipengine/react";
|
|
2
3
|
export type ElementsEnvironment = `dde:${string}` | "development" | "staging" | "production";
|
|
3
4
|
export type ElementsErrorHandler = (err: Error, context: {
|
|
4
5
|
componentStack: string;
|
|
@@ -18,7 +19,7 @@ export interface ElementsProviderProps {
|
|
|
18
19
|
brandName?: string;
|
|
19
20
|
children: JSX.Element;
|
|
20
21
|
environment?: ElementsEnvironment;
|
|
21
|
-
getToken:
|
|
22
|
+
getToken: ShipEngineProviderProps["getToken"];
|
|
22
23
|
onError?: ElementsErrorHandler;
|
|
23
24
|
proxyTarget?: string;
|
|
24
25
|
}
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
export type NestedFormProps<T, U> = {
|
|
3
3
|
formId: string;
|
|
4
4
|
onCancel?: () => void;
|
|
5
|
-
onSubmit: (payload: U) => Promise<void
|
|
5
|
+
onSubmit: (payload: U) => Promise<void> | void;
|
|
6
6
|
} & T;
|
|
7
7
|
/**
|
|
8
8
|
* Returns a nested form element that can be rendered within another form
|
|
@@ -16,7 +16,7 @@ export type NestedFormProps<T, U> = {
|
|
|
16
16
|
export declare const useNestedForm: <T, U>(form: React.FC<NestedFormProps<T, U>>, props: {
|
|
17
17
|
formId: string;
|
|
18
18
|
onCancel?: (() => void) | undefined;
|
|
19
|
-
onSubmit: (payload: U) => Promise<void
|
|
19
|
+
onSubmit: (payload: U) => Promise<void> | void;
|
|
20
20
|
} & T & {
|
|
21
21
|
portalRef?: undefined;
|
|
22
22
|
}) => readonly [import("@emotion/react/jsx-runtime").JSX.Element, boolean, React.DispatchWithoutAction];
|