@shipengine/elements 0.17.3 → 0.19.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.
- package/components/fund-and-purchase/fund-and-purchase.d.ts +3 -1
- package/components/history/history-actions/history-actions.d.ts +1 -0
- package/components/history/history-actions/history-actions.styles.d.ts +1 -0
- package/components/history/history-actions/index.d.ts +1 -0
- package/components/history/history-body/history-body.d.ts +6 -0
- package/components/history/history-body/index.d.ts +1 -0
- package/components/history/history-list/history-list.d.ts +12 -0
- package/components/history/history-list/index.d.ts +1 -0
- package/components/history/history-row/history-row.d.ts +6 -0
- package/components/history/history-row/index.d.ts +1 -0
- package/components/history/history.d.ts +11 -0
- package/components/history/index.d.ts +1 -0
- package/components/templates/index.d.ts +3 -0
- package/components/templates/manage-warehouses/manage-warehouse.styles.d.ts +1 -0
- package/components/templates/manage-warehouses/manage-warehouses.d.ts +10 -5
- package/components/templates/onboarding/onboarding.d.ts +8 -1
- package/components/templates/shipment-form/shipment-schema.d.ts +2 -2
- package/components/templates/wallet-history/index.d.ts +1 -0
- package/components/templates/wallet-history/wallet-history.d.ts +6 -0
- package/components/templates/warehouse-form/warehouse-form-schema.d.ts +52 -146
- package/components/templates/warehouse-form/warehouse-form.d.ts +2 -1
- package/components/templates/warehouse-preference-select/index.d.ts +1 -0
- package/components/templates/warehouse-preference-select/warehouse-preference-select.d.ts +24 -0
- package/components/templates/warehouse-preference-wizard/index.d.ts +1 -0
- package/components/templates/warehouse-preference-wizard/warehouse-preference-wizard.d.ts +23 -0
- package/elements/components/index.d.ts +1 -0
- package/elements/components/manage-warehouses/manage-warehouses.d.ts +5 -2
- package/elements/components/wallet-history/index.d.ts +1 -0
- package/elements/components/wallet-history/wallet-history.d.ts +1 -0
- package/elements/index.d.ts +1 -0
- package/elements/manage-warehouses.d.ts +1 -1
- package/elements/wallet-history.d.ts +1 -0
- package/factories/shipengine/index.d.ts +1 -0
- package/factories/shipengine/wallet-history.d.ts +14 -0
- package/factories/shipengine/warehouse.d.ts +2 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/use-warehouse-validation.d.ts +14 -0
- package/index.cjs +1044 -1250
- package/index.d.ts +0 -2
- package/index.js +1042 -1215
- package/locales/en/index.d.ts +15 -0
- package/package.json +3 -3
- package/components/templates/warehouse-form/warehouse-form.styles.d.ts +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SE } from "@shipengine/api";
|
|
2
|
+
import { WarehousePayload } from "../manage-warehouses";
|
|
2
3
|
export type WarehouseFormProps = {
|
|
3
4
|
isOnboarding?: boolean;
|
|
4
5
|
onCancel?: () => void;
|
|
5
6
|
onDelete?: () => void;
|
|
6
|
-
onSubmit: (payload:
|
|
7
|
+
onSubmit: (payload: WarehousePayload) => void;
|
|
7
8
|
submitButtonTitle: string;
|
|
8
9
|
warehouse?: SE.Warehouse;
|
|
9
10
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./warehouse-preference-select";
|
|
@@ -0,0 +1,24 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./warehouse-preference-wizard";
|
|
@@ -0,0 +1,23 @@
|
|
|
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,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { Templates } from "../../../components";
|
|
2
|
+
export type ManageWarehousesProps = {
|
|
3
|
+
onWarehouseAddressValidation?: (originAddressPreference: Templates.AddressPreference, returnAddressPreference?: Templates.AddressPreference) => Promise<void> | void;
|
|
4
|
+
};
|
|
5
|
+
export declare const ManageWarehouses: ({ onWarehouseAddressValidation }: ManageWarehousesProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./wallet-history";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WalletHistory: () => import("@emotion/react/jsx-runtime").JSX.Element;
|
package/elements/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { Element as ListCarriers } from "./list-carriers";
|
|
|
2
2
|
export { Element as ManageWarehouses } from "./manage-warehouses";
|
|
3
3
|
export { Element as PurchaseLabel } from "./purchase-label";
|
|
4
4
|
export { Element as Onboarding } from "./onboarding";
|
|
5
|
+
export { Element as WalletHistory } from "./wallet-history";
|
|
5
6
|
export { Element as ViewShipment } from "./view-shipment";
|
|
6
7
|
export { Element as VoidLabel } from "./void-label";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Element: (props: Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const Element: (props: import("./components/manage-warehouses").ManageWarehousesProps & Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Element: (props: Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Factory } from "fishery";
|
|
2
|
+
import { SE } from "@shipengine/api";
|
|
3
|
+
/**
|
|
4
|
+
* Wallet Transaction Factory
|
|
5
|
+
*
|
|
6
|
+
* @category Factories
|
|
7
|
+
*/
|
|
8
|
+
export declare const walletTransactionFactory: Factory<SE.WalletTransaction, any, SE.WalletTransaction>;
|
|
9
|
+
/**
|
|
10
|
+
* Wallet History Factory
|
|
11
|
+
*
|
|
12
|
+
* @category Factories
|
|
13
|
+
*/
|
|
14
|
+
export declare const walletHistoryFactory: (currentPage?: number, count?: number) => Factory<SE.WalletTransactionHistory, any, SE.WalletTransactionHistory>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Factory } from "fishery";
|
|
2
2
|
import { SE } from "@shipengine/api";
|
|
3
|
+
import { Templates } from "../../components";
|
|
3
4
|
/**
|
|
4
5
|
* @category Factories
|
|
5
6
|
*/
|
|
6
7
|
export declare const warehouseFactory: Factory<SE.Warehouse, any, SE.Warehouse>;
|
|
8
|
+
export declare const warehouseAddressPreferenceFactory: Factory<Templates.WarehouseAddressPreference, any, Templates.WarehouseAddressPreference>;
|
package/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
};
|