@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.
Files changed (43) hide show
  1. package/components/fund-and-purchase/fund-and-purchase.d.ts +3 -1
  2. package/components/history/history-actions/history-actions.d.ts +1 -0
  3. package/components/history/history-actions/history-actions.styles.d.ts +1 -0
  4. package/components/history/history-actions/index.d.ts +1 -0
  5. package/components/history/history-body/history-body.d.ts +6 -0
  6. package/components/history/history-body/index.d.ts +1 -0
  7. package/components/history/history-list/history-list.d.ts +12 -0
  8. package/components/history/history-list/index.d.ts +1 -0
  9. package/components/history/history-row/history-row.d.ts +6 -0
  10. package/components/history/history-row/index.d.ts +1 -0
  11. package/components/history/history.d.ts +11 -0
  12. package/components/history/index.d.ts +1 -0
  13. package/components/templates/index.d.ts +3 -0
  14. package/components/templates/manage-warehouses/manage-warehouse.styles.d.ts +1 -0
  15. package/components/templates/manage-warehouses/manage-warehouses.d.ts +10 -5
  16. package/components/templates/onboarding/onboarding.d.ts +8 -1
  17. package/components/templates/shipment-form/shipment-schema.d.ts +2 -2
  18. package/components/templates/wallet-history/index.d.ts +1 -0
  19. package/components/templates/wallet-history/wallet-history.d.ts +6 -0
  20. package/components/templates/warehouse-form/warehouse-form-schema.d.ts +52 -146
  21. package/components/templates/warehouse-form/warehouse-form.d.ts +2 -1
  22. package/components/templates/warehouse-preference-select/index.d.ts +1 -0
  23. package/components/templates/warehouse-preference-select/warehouse-preference-select.d.ts +24 -0
  24. package/components/templates/warehouse-preference-wizard/index.d.ts +1 -0
  25. package/components/templates/warehouse-preference-wizard/warehouse-preference-wizard.d.ts +23 -0
  26. package/elements/components/index.d.ts +1 -0
  27. package/elements/components/manage-warehouses/manage-warehouses.d.ts +5 -2
  28. package/elements/components/wallet-history/index.d.ts +1 -0
  29. package/elements/components/wallet-history/wallet-history.d.ts +1 -0
  30. package/elements/index.d.ts +1 -0
  31. package/elements/manage-warehouses.d.ts +1 -1
  32. package/elements/wallet-history.d.ts +1 -0
  33. package/factories/shipengine/index.d.ts +1 -0
  34. package/factories/shipengine/wallet-history.d.ts +14 -0
  35. package/factories/shipengine/warehouse.d.ts +2 -0
  36. package/hooks/index.d.ts +1 -0
  37. package/hooks/use-warehouse-validation.d.ts +14 -0
  38. package/index.cjs +1044 -1250
  39. package/index.d.ts +0 -2
  40. package/index.js +1042 -1215
  41. package/locales/en/index.d.ts +15 -0
  42. package/package.json +3 -3
  43. 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: Omit<SE.Warehouse, "createdAt" | "warehouseId">) => void;
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;
@@ -4,4 +4,5 @@ export * from "./manage-warehouses";
4
4
  export * from "./onboarding";
5
5
  export * from "./purchase-label";
6
6
  export * from "./shipment";
7
+ export * from "./wallet-history";
7
8
  export * from "./void-label";
@@ -1,2 +1,5 @@
1
- export type ManageWarehousesProps = {};
2
- export declare const ManageWarehouses: () => import("@emotion/react/jsx-runtime").JSX.Element;
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;
@@ -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;
@@ -8,5 +8,6 @@ export * from "./resource";
8
8
  export * from "./sales-order";
9
9
  export * from "./service";
10
10
  export * from "./shipment";
11
+ export * from "./wallet-history";
11
12
  export * from "./warehouse";
12
13
  export * from "./weight";
@@ -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
@@ -6,3 +6,4 @@ export * from "./use-page-layout";
6
6
  export * from "./use-root-portal";
7
7
  export * from "./use-run-once-on-true";
8
8
  export * from "./use-toggle";
9
+ export * from "./use-warehouse-validation";
@@ -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
+ };