@shipengine/elements 0.9.0 → 0.9.4

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 (28) hide show
  1. package/components/configure-shipment/configure-shipment.d.ts +26 -0
  2. package/components/configure-shipment/hooks/index.d.ts +5 -0
  3. package/components/configure-shipment/hooks/use-address.d.ts +14 -0
  4. package/components/configure-shipment/hooks/use-customs.d.ts +9 -0
  5. package/components/configure-shipment/hooks/use-presets.d.ts +10 -0
  6. package/components/configure-shipment/hooks/use-rates-form.d.ts +23 -0
  7. package/components/configure-shipment/hooks/use-request-rates.d.ts +11 -0
  8. package/components/configure-shipment/hooks/use-shipment-form.d.ts +29 -0
  9. package/components/configure-shipment/index.d.ts +1 -0
  10. package/components/index.d.ts +1 -2
  11. package/components/sales-order/hooks/index.d.ts +3 -0
  12. package/components/sales-order/hooks/use-configure-shipment.d.ts +16 -0
  13. package/components/sales-order/hooks/use-import-sales-order.d.ts +11 -0
  14. package/components/sales-order/hooks/use-pending-shipment.d.ts +12 -0
  15. package/components/sales-order/sales-order.d.ts +23 -25
  16. package/components/shipment/shipment.d.ts +2 -3
  17. package/components/void-label/void-label.d.ts +2 -3
  18. package/index.cjs +15647 -15547
  19. package/index.js +15649 -15549
  20. package/package.json +6 -6
  21. package/purchase-label.d.ts +1 -1
  22. package/view-shipment.d.ts +1 -1
  23. package/void-label.d.ts +1 -1
  24. package/components/rate-form/index.d.ts +0 -1
  25. package/components/rate-form/rate-form.d.ts +0 -14
  26. package/components/shipment-form/index.d.ts +0 -1
  27. package/components/shipment-form/shipment-form.d.ts +0 -27
  28. package/hooks/use-address-preference.d.ts +0 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "0.9.0",
3
+ "version": "0.9.4",
4
4
  "peerDependencies": {
5
5
  "@packlink/giger": "*",
6
6
  "react-i18next": "*",
@@ -12,10 +12,10 @@
12
12
  "types": "./index.d.ts",
13
13
  "dependencies": {
14
14
  "react": "^18.2.0",
15
- "@shipengine/elements-core": "0.9.0",
16
- "i18next-http-backend": "^1.4.1",
17
- "i18next-browser-languagedetector": "^6.1.4",
18
- "@shipengine/types": "0.9.0",
19
- "@shipengine/elements-ui": "0.9.0"
15
+ "@shipengine/elements-core": "0.9.4",
16
+ "@shipengine/elements-ui": "0.9.4",
17
+ "@shipengine/types": "0.9.4",
18
+ "@emotion/react": "^11.10.0",
19
+ "@packlink/brands": "^3.18.0"
20
20
  }
21
21
  }
@@ -1 +1 @@
1
- export declare const Element: (props: import("./components/sales-order").SalesOrderProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
1
+ export declare const Element: (props: import("./components/sales-order").SalesOrderProps & Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export declare const Element: (props: import("./components").ShipmentProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
1
+ export declare const Element: (props: import("./components").ShipmentProps & Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
package/void-label.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const Element: (props: import("./components").VoidLabelProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
1
+ export declare const Element: (props: import("./components").VoidLabelProps & Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./rate-form";
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import * as SE from "@shipengine/types";
3
- export declare type RateFormProps = {
4
- errors?: SE.CodedError[];
5
- loading?: boolean;
6
- onBeforeLabelCreate?: (rate: SE.Rate, shipment?: SE.SalesOrderShipment) => Promise<void> | void;
7
- onLabelCreateFailure?: (rate?: SE.Rate, shipment?: SE.SalesOrderShipment) => Promise<void> | void;
8
- onLabelCreateSuccess?: (label: SE.Label, shipment?: SE.SalesOrderShipment) => Promise<void> | void;
9
- onRateSaved?: (shipment: SE.SalesOrderShipment) => Promise<void> | void;
10
- printLabelLayout?: SE.LabelLayout;
11
- rates?: SE.Rate[];
12
- shipment?: SE.SalesOrderShipment;
13
- };
14
- export declare const RateForm: ({ errors, loading, onBeforeLabelCreate, onLabelCreateFailure, onLabelCreateSuccess, onRateSaved, printLabelLayout, rates, shipment, }: RateFormProps) => JSX.Element;
@@ -1 +0,0 @@
1
- export * from "./shipment-form";
@@ -1,27 +0,0 @@
1
- /// <reference types="react" />
2
- import { Templates } from "@shipengine/elements-ui";
3
- import * as SE from "@shipengine/types";
4
- import { ShippingPreset } from "@shipengine/elements-core";
5
- import { UseShippingPresetsOptionsProps } from "@shipengine/elements-ui";
6
- export declare type ShipmentFormMode = "browse_rates" | "select_service";
7
- export declare type ShipmentUpdatedOptions = {
8
- shouldCalculateRates?: boolean;
9
- shouldResetAddressPreference?: boolean;
10
- };
11
- declare type ShipmentFormTemplateProps = React.ComponentProps<typeof Templates.ShipmentForm>;
12
- export declare type ShipmentFormProps = {
13
- addressPreference?: Templates.AddressPreference;
14
- onApplyPreset?: (preset: ShippingPreset, shipment?: SE.SalesOrderShipment) => Promise<void> | void;
15
- onChangeAddress?: (addressPreference: Templates.AddressPreference) => any | void;
16
- onChangeShipmentFormMode?: ShipmentFormTemplateProps["onChangeMode"];
17
- onShipmentDirty: () => void;
18
- onShipmentUpdated: (shipment: SE.SalesOrderShipment, options?: ShipmentUpdatedOptions) => Promise<void> | void;
19
- onShipmentUpdateFailure?: () => void;
20
- onToggleAddressPreferenceDisclosure?: ShipmentFormTemplateProps["onToggleAddressPreferenceDisclosure"];
21
- salesOrder: SE.SalesOrder;
22
- shipment?: SE.SalesOrderShipment;
23
- shippingPresets?: UseShippingPresetsOptionsProps;
24
- warehouseId?: string;
25
- };
26
- export declare const ShipmentForm: ({ addressPreference, onApplyPreset, onChangeAddress, onChangeShipmentFormMode, onShipmentDirty, onShipmentUpdated, onShipmentUpdateFailure, onToggleAddressPreferenceDisclosure, salesOrder, shipment, shippingPresets, warehouseId, }: ShipmentFormProps) => JSX.Element;
27
- export {};
@@ -1,26 +0,0 @@
1
- import { Templates } from "@shipengine/elements-ui";
2
- import * as SE from "@shipengine/types";
3
- export declare type ResetAddressPreferenceParams = {
4
- validation: SE.AddressValidation;
5
- fallbackAddress?: SE.Address;
6
- };
7
- export declare const useAddressPreference: () => {
8
- readonly addressPreference: Templates.AddressPreference | undefined;
9
- readonly resetAddressPreference: ({ validation, fallbackAddress }: ResetAddressPreferenceParams) => {
10
- alternative: SE.Address | undefined;
11
- selection: SE.Address;
12
- status: "unverified" | "verified" | "warning" | "error";
13
- originalAddress: SE.Address;
14
- matchedAddress?: SE.Address | undefined;
15
- messages: {
16
- code: "a1000" | "a1001" | "a1002" | "a1003" | "a1004" | "a1005" | "a1006" | "a1007" | "a1008" | "r1000" | "r1001" | "r1002" | "r1003";
17
- message: string;
18
- type: "warning" | "error" | "info";
19
- detailCode: "address_not_found" | "city_locality_changed_or_added" | "city_locality_max_length_exceeded" | "coded_to_community_level" | "coded_to_neighborhood_level" | "coded_to_rooftop_interpolation_level" | "coded_to_rooftop_level" | "coded_to_state_level" | "coded_to_street_lavel" | "company_name_max_length_exceeded" | "country_invalid_length" | "double_dependent_locality_changed_or_added" | "house_number_changed" | "incompatible_paired_labels" | "invalid_box_number" | "invalid_charge_event" | "invalid_house_number" | "invalid_postal_code" | "line1_min_max_length" | "line2_max_length_exceeded" | "line3_max_length_exceeded" | "minimum_postal_code_verification_failed" | "missing_box_number" | "missing_cmra_or_private_mail_box_number" | "missing_house_number" | "multiple_directionals" | "multiple_matches" | "name_max_length_exceeded" | "non_supported_country" | "organization_changed_or_added" | "partially_verified_to_city_level" | "partially_verified_to_premise_level" | "partially_verified_to_state_level" | "partially_verified_to_street_level" | "phone_max_length_exceeded" | "po_box_changed_or_added" | "postal_code_changed_or_added" | "premise_type_changed_or_added" | "state_province_changed_or_added" | "state_province_max_length_exceeded" | "street_direction_changed_or_added" | "street_does_not_match_unique_street_name" | "street_name_spelling_changed_or_added" | "street_name_type_changed_or_added" | "subadministrative_area_changed_or_added" | "subnational_area_changed_or_added" | "suite_has_no_secondaries" | "suite_missing" | "suite_not_valid" | "suite_type_changed_or_added" | "suite_unit_number_changed_or_added" | "unsupported_country" | "urbanization_changed" | "verified_to_city_level" | "verified_to_premise_level" | "verified_to_state_level" | "verified_to_street_level" | "verified_to_suite_level";
20
- }[];
21
- alternativeSource: "originalAddress" | "matchedAddress";
22
- isModified: boolean;
23
- selectionSource: "originalAddress" | "matchedAddress";
24
- toggle: () => SE.Address;
25
- };
26
- };