@shipengine/elements 0.13.1 → 0.14.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 (48) hide show
  1. package/components/accordion/accordion.d.ts +2 -2
  2. package/components/error-boundary/error-boundary.d.ts +2 -2
  3. package/components/field/create-field-controller.d.ts +3 -3
  4. package/components/field/input-group/input-group.d.ts +1 -1
  5. package/components/field/money-input/money-input.d.ts +4 -4
  6. package/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +4 -4
  7. package/components/field/rate-select/rate-select.d.ts +1 -1
  8. package/components/field/select/select.d.ts +1 -1
  9. package/components/field/switch/switch.d.ts +2 -2
  10. package/components/items-breakdown/items-breakdown.d.ts +3 -3
  11. package/components/organisms/manual-funding-form/index.d.ts +1 -0
  12. package/components/organisms/manual-funding-form/manual-funding-form.d.ts +4 -1
  13. package/components/settings-card/settings-card.d.ts +2 -2
  14. package/components/templates/address-form/address-schema.d.ts +98 -98
  15. package/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
  16. package/components/templates/billing-form/billing-schema.d.ts +26 -26
  17. package/components/templates/customs-item-form/customs-item-form-schema.d.ts +2 -2
  18. package/components/templates/funding-methods/funding-methods.d.ts +8 -1
  19. package/components/templates/label/label.d.ts +3 -3
  20. package/components/templates/rate-form/rate-form.d.ts +2 -2
  21. package/components/templates/sales-order/sales-order.d.ts +1 -1
  22. package/components/templates/shipment-form/shipment-form.d.ts +4 -4
  23. package/components/templates/shipment-form/shipment-schema.d.ts +140 -140
  24. package/elements/components/configure-shipment/configure-shipment.d.ts +1 -1
  25. package/elements/components/configure-shipment/hooks/use-address.d.ts +1 -1
  26. package/elements/components/configure-shipment/hooks/use-customs.d.ts +1 -1
  27. package/elements/components/configure-shipment/hooks/use-presets.d.ts +1 -1
  28. package/elements/components/configure-shipment/hooks/use-rates-form.d.ts +1 -1
  29. package/elements/components/configure-shipment/hooks/use-shipment-form.d.ts +2 -2
  30. package/factories/shipengine/address.d.ts +1 -1
  31. package/factories/shipengine/sales-order.d.ts +1 -1
  32. package/factories/shipengine/shipment.d.ts +2 -2
  33. package/hooks/options/use-insurance-provider-options.d.ts +1 -1
  34. package/hooks/options/use-shipping-presets-options.d.ts +1 -1
  35. package/hooks/use-elements.d.ts +3 -3
  36. package/hooks/use-page-layout.d.ts +1 -1
  37. package/index.cjs +8378 -8195
  38. package/index.js +4969 -4786
  39. package/locales/en/index.d.ts +5 -0
  40. package/package.json +5 -5
  41. package/schemas/shipengine/phone.d.ts +1 -1
  42. package/testing/swr.d.ts +5 -5
  43. package/types/carrier-metadata.d.ts +11 -0
  44. package/utilities/form-logger.d.ts +1 -1
  45. package/utilities/rates.d.ts +3 -3
  46. package/utilities/shipengine/weight.d.ts +1 -1
  47. package/utilities/validation.d.ts +1 -1
  48. package/components/field/input-group/input-group.styles.d.ts +0 -2
@@ -1,6 +1,6 @@
1
1
  import * as SE from "@shipengine/types";
2
- import { UseShippingPresetsOptionsProps } from "../../../hooks";
3
2
  import { Templates } from "../../../components";
3
+ import { UseShippingPresetsOptionsProps } from "../../../hooks";
4
4
  import { UseRatesFormProps, UseShipmentFormProps } from "./hooks";
5
5
  export type ShipmentFormMode = "browse_rates" | "select_service";
6
6
  export type ConfigureShipmentFeatures = {
@@ -1,6 +1,6 @@
1
1
  import * as SE from "@shipengine/types";
2
- import { CountryCode } from "../../../../constants";
3
2
  import { Templates } from "../../../../components";
3
+ import { CountryCode } from "../../../../constants";
4
4
  export type UseAddressProps = {
5
5
  compatibleCountryCodes?: CountryCode[];
6
6
  onChange?: (oldShipment: SE.SalesOrderShipment, updatedShipment: SE.SalesOrderShipment) => Promise<void> | void;
@@ -4,6 +4,6 @@ export type UseCustomsProps = {
4
4
  shipment?: SE.SalesOrderShipment;
5
5
  };
6
6
  export declare const useCustoms: ({ onUpdate, shipment }: UseCustomsProps) => {
7
- handleUpdateCustoms: (customs: SE.Customs) => Promise<SE.SalesOrderShipment | undefined>;
8
7
  customsErrors: SE.CodedError[] | undefined;
8
+ handleUpdateCustoms: (customs: SE.Customs) => Promise<SE.SalesOrderShipment | undefined>;
9
9
  };
@@ -1,5 +1,5 @@
1
- import { ShippingPreset } from "../../../../types";
2
1
  import * as SE from "@shipengine/types";
2
+ import { ShippingPreset } from "../../../../types";
3
3
  export type UsePresetsProps = {
4
4
  onApply?: (preset: ShippingPreset, shipment: SE.SalesOrderShipment) => Promise<void> | void;
5
5
  shipment?: SE.SalesOrderShipment;
@@ -13,8 +13,8 @@ export type UseRatesFormProps = {
13
13
  export declare const useRatesForm: ({ onBeforeLabelCreate, onLabelCreateFailure, onLabelCreateSuccess, onRateSaved, onRatesCalculated, onShipmentUpdated, printLabelLayout, shipment, }: UseRatesFormProps) => {
14
14
  carriers: SE.Carrier[] | undefined;
15
15
  errors: SE.CodedError[] | undefined;
16
- labelErrors: SE.CodedError[] | undefined;
17
16
  isLoading: boolean;
17
+ labelErrors: SE.CodedError[] | undefined;
18
18
  onSave: ({ carrierId, serviceCode }: Pick<SE.Rate, "carrierId" | "serviceCode">) => Promise<void>;
19
19
  onSubmit: (rateId: string) => Promise<void>;
20
20
  rates: SE.Rate[] | undefined;
@@ -1,5 +1,5 @@
1
- import { ShippingPreset } from "../../../../types";
2
1
  import * as SE from "@shipengine/types";
2
+ import { ShippingPreset } from "../../../../types";
3
3
  import { UseAddressProps } from "./use-address";
4
4
  import { UsePresetsProps } from "./use-presets";
5
5
  export type UseShipmentFormProps = {
@@ -14,8 +14,8 @@ export type UseShipmentFormProps = {
14
14
  };
15
15
  export declare const useShipmentForm: ({ compatibleCountryCodes, onAddressValidation, onApplyPreset, onChangeAddress, onShipmentUpdated, onSubmit, salesOrder, shipment, }: UseShipmentFormProps) => {
16
16
  addressPreference: import("../../../../components/templates").AddressPreference | undefined;
17
- charsetWarning: import("../../../../components/templates").CharsetWarning | undefined;
18
17
  carriers: SE.Carrier[] | undefined;
18
+ charsetWarning: import("../../../../components/templates").CharsetWarning | undefined;
19
19
  customPackageTypes: SE.Package[] | undefined;
20
20
  errors: SE.CodedError[] | undefined;
21
21
  onApplyPreset: (preset: ShippingPreset) => Promise<void>;
@@ -15,9 +15,9 @@ type AddressPreference = SE.AddressValidation & {
15
15
  alternative?: SE.Address;
16
16
  alternativeSource: "originalAddress" | "matchedAddress";
17
17
  isModified: boolean;
18
- toggle: () => SE.Address;
19
18
  selection: SE.Address;
20
19
  selectionSource: "originalAddress" | "matchedAddress";
20
+ toggle: () => SE.Address;
21
21
  };
22
22
  /**
23
23
  * Mock the addressValidation object used to hyrdate address valiation feature
@@ -1,6 +1,6 @@
1
1
  import { Factory } from "fishery";
2
- import { MoneyTransientParams } from "./money";
3
2
  import * as SE from "@shipengine/types";
3
+ import { MoneyTransientParams } from "./money";
4
4
  export declare const randomPaymentStatus: () => SE.PaymentStatus;
5
5
  export declare const randomFulfillmentStatus: () => SE.FulfillmentStatus;
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { Factory } from "fishery";
2
- import { MoneyTransientParams } from "./money";
3
2
  import * as SE from "@shipengine/types";
3
+ import { MoneyTransientParams } from "./money";
4
4
  export declare const randomDeliveryConfirmation: () => SE.ConfirmationType;
5
5
  export declare const randomInsuranceProvider: (allowNone?: boolean) => SE.InsuranceProvider;
6
6
  /**
@@ -24,8 +24,8 @@ export type ShipmentTransientParams = {
24
24
  isInsured?: boolean;
25
25
  isInternational?: boolean;
26
26
  isShipped?: boolean;
27
- service?: SE.Service;
28
27
  salesOrder?: SE.SalesOrder;
28
+ service?: SE.Service;
29
29
  warehouse?: SE.Warehouse;
30
30
  };
31
31
  /**
@@ -1,7 +1,7 @@
1
1
  import * as SE from "@shipengine/types";
2
2
  interface InsuranceFeatures {
3
- includeThirdPartyInsurance?: boolean;
4
3
  includeShipsuranceInsurance?: boolean;
4
+ includeThirdPartyInsurance?: boolean;
5
5
  }
6
6
  export declare const useInsuranceProviderOptions: (insuranceAccount?: SE.InsuranceAccount, features?: InsuranceFeatures) => {
7
7
  label: string;
@@ -12,8 +12,8 @@ export type UseShippingPresetsOptionsProps = {
12
12
  export declare const useShippingPresetsOptions: ({ platform, user }: UseShippingPresetsOptionsProps | undefined, isInternationalShipment: boolean) => {
13
13
  categoryName: string;
14
14
  options: {
15
- displayName: string;
16
15
  description: import("@emotion/react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
17
  value: ShippingPreset;
18
18
  }[];
19
19
  }[];
@@ -1,13 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  export type ElementsEnvironment = `dde:${string}` | "development" | "staging" | "production";
3
3
  export type ElementsErrorHandler = (err: Error, context: {
4
- element?: string;
5
4
  componentStack: string;
5
+ element?: string;
6
6
  }) => void;
7
7
  export interface ElementsContextValue {
8
+ brandName?: string;
8
9
  environment: ElementsEnvironment;
9
10
  onError?: ElementsErrorHandler;
10
- brandName?: string;
11
11
  }
12
12
  /**
13
13
  * @category Contexts
@@ -15,11 +15,11 @@ export interface ElementsContextValue {
15
15
  export declare const ElementsContext: import("react").Context<ElementsContextValue | undefined>;
16
16
  export interface ElementsProviderProps {
17
17
  baseURL?: string;
18
+ brandName?: string;
18
19
  children: JSX.Element;
19
20
  environment?: ElementsEnvironment;
20
21
  onError?: ElementsErrorHandler;
21
22
  proxyTarget?: string;
22
- brandName?: string;
23
23
  token: string;
24
24
  }
25
25
  /**
@@ -1,7 +1,7 @@
1
1
  import React, { PropsWithChildren } from "react";
2
2
  type PageLayoutContextValue = {
3
- HeaderPortal: React.FC<PropsWithChildren>;
4
3
  FooterPortal: React.FC<PropsWithChildren>;
4
+ HeaderPortal: React.FC<PropsWithChildren>;
5
5
  };
6
6
  type PageLayoutProviderProps = {
7
7
  children: React.ReactNode;