@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,6 +1,8 @@
1
+ import { Control } from "react-hook-form";
1
2
  export type FundAndPurchaseProps = {
2
3
  carrierId?: string;
3
4
  className?: string;
5
+ control: Control<any, any>;
4
6
  disabled?: boolean;
5
7
  isFundingEnabled?: boolean;
6
8
  isFundingRequired: boolean;
@@ -13,4 +15,4 @@ export type FundAndPurchaseProps = {
13
15
  * has the necessary funds available and can add them if not. It allows a single button
14
16
  * to submit the funding form followed by the purchase form.
15
17
  */
16
- export declare const FundAndPurchase: ({ carrierId, className, disabled, isFundingEnabled, isFundingRequired, onSave, purchaseAmount, onPurchase, }: FundAndPurchaseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
18
+ export declare const FundAndPurchase: ({ carrierId, className, control, disabled, isFundingEnabled, isFundingRequired, onSave, purchaseAmount, onPurchase, }: FundAndPurchaseProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const HistoryActions: () => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const styles: Record<"dateRangeInput", import("@emotion/serialize").Interpolation<import("@packlink/brands/dist/js/theme/Theme").Theme>>;
@@ -0,0 +1 @@
1
+ export * from "./history-actions";
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { WalletTransactionHistory } from "@shipengine/api";
3
+ export type HistoryBodyProps = {
4
+ historyData: WalletTransactionHistory;
5
+ };
6
+ export declare const HistoryBody: React.FC<HistoryBodyProps>;
@@ -0,0 +1 @@
1
+ export * from "./history-body";
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { WalletTransactionHistory } from "@shipengine/api";
3
+ export type HistoryListProps = {
4
+ historyData: WalletTransactionHistory;
5
+ };
6
+ /**
7
+ * This component is the list of events that represent the history of a
8
+ * specific entity. The events are displayed in reverse chronological order.
9
+ *
10
+ * @param historyData The history data to display.
11
+ */
12
+ export declare const HistoryList: React.FC<HistoryListProps>;
@@ -0,0 +1 @@
1
+ export * from "./history-list";
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ export type HistoryRowProps = {
3
+ key: number;
4
+ rowItem: number;
5
+ };
6
+ export declare const HistoryRow: FC<HistoryRowProps>;
@@ -0,0 +1 @@
1
+ export * from "./history-row";
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { HistoryBodyProps } from "./history-body";
3
+ import { HistoryListProps } from "./history-list";
4
+ import { HistoryRowProps } from "./history-row";
5
+ export type HistoryType = React.FC & {
6
+ Actions: React.FC;
7
+ Body: React.FC<HistoryBodyProps>;
8
+ List: React.FC<HistoryListProps>;
9
+ Row: React.FC<HistoryRowProps>;
10
+ };
11
+ export declare const History: HistoryType;
@@ -0,0 +1 @@
1
+ export * from "./history";
@@ -16,6 +16,9 @@ export * from "./suspend-sales-order";
16
16
  export * from "./shipment-form";
17
17
  export * from "./shipment";
18
18
  export * from "./suspend-shipment";
19
+ export * from "./wallet-history";
19
20
  export * from "./warehouse-form";
20
21
  export * from "./void-label";
21
22
  export * from "./wallet-form";
23
+ export * from "./warehouse-preference-wizard";
24
+ export * from "./warehouse-preference-select";
@@ -0,0 +1 @@
1
+ export declare const styles: Record<"cardSpacing" | "header" | "well", import("@emotion/serialize").Interpolation<import("@packlink/brands/dist/js/theme/Theme").Theme>>;
@@ -1,10 +1,15 @@
1
1
  import { SE } from "@shipengine/api";
2
+ import { WarehousePreference } from "../warehouse-preference-wizard";
3
+ export type WarehousePayload = Partial<SE.Warehouse> & Pick<SE.Warehouse, "name" | "originAddress" | "isDefault">;
2
4
  export type ManageWarehousesProps = {
3
5
  errors?: SE.CodedError[];
4
- onAdd: (payload: Omit<SE.Warehouse, "createdAt" | "warehouseId">) => Promise<void> | void;
5
- onDelete: (warehouseId: string) => Promise<void> | void;
6
- onEdit: (payload: Omit<SE.Warehouse, "createdAt" | "warehouseId">, warehouseId: string) => Promise<void> | void;
7
- onSetDefault: (warehouse: Partial<SE.Warehouse>, warehouseId: string) => Promise<void> | void;
6
+ onAdd: (payload: WarehousePayload) => Promise<void>;
7
+ onDelete: (warehouseId: string) => Promise<void>;
8
+ onEdit: (payload: WarehousePayload, warehouseId: string) => Promise<void>;
9
+ onSetDefault: (warehouse: Partial<SE.Warehouse>, warehouseId: string) => Promise<void>;
10
+ onValidate: (warehouse: WarehousePayload) => Promise<WarehousePreference>;
11
+ setWarehousePreference: (warehousePreference?: WarehousePreference) => void;
12
+ warehousePreference?: WarehousePreference;
8
13
  warehouses: SE.Warehouse[];
9
14
  };
10
- export declare const ManageWarehouses: ({ errors, onAdd, onDelete, onEdit, onSetDefault, warehouses, }: ManageWarehousesProps) => import("@emotion/react/jsx-runtime").JSX.Element;
15
+ export declare const ManageWarehouses: ({ errors, onAdd, onDelete, onEdit, onSetDefault, onValidate, setWarehousePreference, warehousePreference, warehouses, }: ManageWarehousesProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,9 +1,13 @@
1
1
  import { SE } from "@shipengine/api";
2
+ import { Templates } from "../../../components";
3
+ import { WarehousePayload } from "../manage-warehouses";
4
+ import { WarehousePreference } from "../warehouse-preference-wizard";
2
5
  export type OnboardingProps = {
3
6
  carriers: SE.Carrier[];
4
7
  createWarehouse: (payload: Partial<SE.Warehouse>) => Promise<SE.Warehouse>;
5
8
  onCarrierCreated: () => Promise<void>;
6
9
  onCompleteOnboarding: () => void;
10
+ onValidateWarehouse: (warehouse: WarehousePayload) => Promise<WarehousePreference>;
7
11
  onWarehouseCreated: () => Promise<void>;
8
12
  registerDhlCarrier: (payload: SE.CarrierConnection) => Promise<void>;
9
13
  registerDhlCarrierErrors: SE.CodedError[] | null;
@@ -11,6 +15,9 @@ export type OnboardingProps = {
11
15
  registerStampsCarrierErrors: SE.CodedError[] | null;
12
16
  registerUpsCarrier: (payload: SE.CarrierConnection) => Promise<void>;
13
17
  registerUpsCarrierErrors: SE.CodedError[] | null;
18
+ setWarehousePreference: (warehousePreference?: WarehousePreference) => void;
19
+ validationErrors: SE.CodedError[] | null;
20
+ warehousePreference?: WarehousePreference;
14
21
  warehouses: SE.Warehouse[];
15
22
  };
16
- export declare const Onboarding: ({ carriers, createWarehouse, onCarrierCreated, onWarehouseCreated, onCompleteOnboarding, registerDhlCarrier, registerDhlCarrierErrors, registerStampsCarrier, registerStampsCarrierErrors, registerUpsCarrier, registerUpsCarrierErrors, warehouses, }: OnboardingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
23
+ export declare const Onboarding: ({ carriers, createWarehouse, onCarrierCreated, onWarehouseCreated, onValidateWarehouse, warehousePreference, setWarehousePreference, onCompleteOnboarding, registerDhlCarrier, registerDhlCarrierErrors, registerStampsCarrier, registerStampsCarrierErrors, registerUpsCarrier, registerUpsCarrierErrors, warehouses, validationErrors, }: OnboardingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -194,7 +194,7 @@ export declare const getShipmentSchema: ({ allowInternationalShipFrom, warehouse
194
194
  }>>>;
195
195
  shipDate: z.ZodString;
196
196
  shipmentId: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
197
- warehouseId: z.ZodEffects<z.ZodString, string, string>;
197
+ warehouseId: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
198
198
  }, {
199
199
  __mode: z.ZodLiteral<"browse_rates">;
200
200
  }>, "strip", z.ZodTypeAny, {
@@ -471,7 +471,7 @@ export declare const getShipmentSchema: ({ allowInternationalShipFrom, warehouse
471
471
  }>>>;
472
472
  shipDate: z.ZodString;
473
473
  shipmentId: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
474
- warehouseId: z.ZodEffects<z.ZodString, string, string>;
474
+ warehouseId: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
475
475
  }, {
476
476
  __mode: z.ZodLiteral<"select_service">;
477
477
  packages: z.ZodArray<z.ZodObject<z.extendShape<{
@@ -0,0 +1 @@
1
+ export * from "./wallet-history";
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { WalletTransactionHistory } from "@shipengine/api";
3
+ export type WalletHistoryProps = {
4
+ historyData: WalletTransactionHistory;
5
+ };
6
+ export declare const WalletHistory: React.FC<WalletHistoryProps>;