@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
@@ -167,6 +167,11 @@ declare const _default: {
167
167
  purchaseAmount: string;
168
168
  };
169
169
  otp: {
170
+ error: {
171
+ title: string;
172
+ message: string;
173
+ };
174
+ isLoading: string;
170
175
  labels: {
171
176
  amount: string;
172
177
  currentBalance: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "typedoc": {
5
5
  "entryPoint": "./src/index.ts",
6
6
  "readmeFile": "../../README.md",
@@ -19,21 +19,21 @@
19
19
  "react": "^18.2.0",
20
20
  "@emotion/react": "^11.10.0",
21
21
  "@packlink/brands": "^3.18.0",
22
- "@shipengine/react": "0.13.1",
22
+ "@shipengine/react": "0.14.0",
23
23
  "react-hook-form": "^7.31.2",
24
24
  "@emotion/css": "^11.10.5",
25
25
  "humps": "^2.0.1",
26
26
  "react-datepicker": "^4.8.0",
27
- "@shipengine/types": "0.13.1",
27
+ "@shipengine/types": "0.14.0",
28
28
  "zod": "^3.17.3",
29
29
  "react-dom": "^18.2.0",
30
30
  "libphonenumber-js": "^1.10.14",
31
31
  "card-validator": "^8.1.1",
32
32
  "js-base64": "^3.7.2",
33
33
  "@faker-js/faker": "^7.3.0",
34
- "swr": "^2.0.0-beta.5",
35
- "stylis": "^4.1.2",
36
34
  "i18next-browser-languagedetector": "^6.1.4",
35
+ "stylis": "^4.1.2",
36
+ "swr": "^2.0.0-beta.5",
37
37
  "axios": "^0.26.1",
38
38
  "@hookform/resolvers": "2.9.1"
39
39
  }
@@ -1,5 +1,5 @@
1
- import { z } from "zod";
2
1
  import { CountryCode } from "libphonenumber-js/min";
2
+ import { z } from "zod";
3
3
  /**
4
4
  * @category Form Validation
5
5
  */
package/testing/swr.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  /// <reference types="jest" />
2
2
  export declare const buildSwrGetMock: (response: any) => {
3
+ data: any;
3
4
  errors: undefined;
4
- mutate: () => Promise<any>;
5
- isValidating: boolean;
6
5
  isLoading: boolean;
7
- data: any;
6
+ isValidating: boolean;
7
+ mutate: () => Promise<any>;
8
8
  };
9
9
  export declare const buildSwrPostMock: (response: any) => {
10
+ data: any;
10
11
  errors: undefined;
11
- trigger: () => Promise<any>;
12
12
  isMutating: boolean;
13
- data: any;
14
13
  reset: jest.Mock<any, any>;
14
+ trigger: () => Promise<any>;
15
15
  };
@@ -1,6 +1,17 @@
1
1
  import * as SE from "@shipengine/types";
2
+ export type CarrierTerm = {
3
+ description: string;
4
+ name: string;
5
+ url: string;
6
+ };
2
7
  export type CarrierMetadata = {
3
8
  carrierCode: SE.Carrier["carrierCode"];
9
+ logo: string;
10
+ name: string;
11
+ optionalFields: string[];
12
+ requiredFields: string[];
13
+ shortname: string;
14
+ terms: Record<string, CarrierTerm[]> | Record<never, never>;
4
15
  };
5
16
  export type CarriersFeatures = {
6
17
  enabledCarriers?: SE.Carrier["carrierCode"][];
@@ -10,7 +10,7 @@ import { FieldValues, ResolverResult, UseFormHandleSubmit } from "react-hook-for
10
10
  * @category Utilities
11
11
  */
12
12
  export declare const formLogger: {
13
- isSubmitting: boolean;
14
13
  capture(handleSubmit: ReturnType<UseFormHandleSubmit<any>>): (e?: React.BaseSyntheticEvent) => void;
14
+ isSubmitting: boolean;
15
15
  log: <T, U extends FieldValues>(values: T, getValidationResult: () => Promise<ResolverResult<U>>) => Promise<ResolverResult<U>>;
16
16
  };
@@ -1,9 +1,9 @@
1
1
  import * as SE from "@shipengine/types";
2
2
  export declare const getRateRequiresAcknowledgement: (serviceCode: string) => boolean;
3
3
  export declare const getTotalRateAmount: (rateCosts: {
4
- shippingAmount?: SE.Money;
5
- taxAmount?: SE.Money;
6
- insuranceAmount?: SE.Money;
7
4
  confirmationAmount?: SE.Money;
5
+ insuranceAmount?: SE.Money;
8
6
  otherAmount?: SE.Money;
7
+ shippingAmount?: SE.Money;
8
+ taxAmount?: SE.Money;
9
9
  }) => number;
@@ -8,6 +8,6 @@ export declare function convertWeight(weight: SE.FractionalWeight): SE.WeightWit
8
8
  * @category Utilities
9
9
  */
10
10
  export declare function formatFractionalWeight(weight: {
11
- whole?: number | null;
12
11
  fractional?: number | null;
12
+ whole?: number | null;
13
13
  } | undefined | null): SE.FractionalWeight;
@@ -1,5 +1,5 @@
1
- import { z } from "zod";
2
1
  import { Resolver } from "@hookform/resolvers/zod";
2
+ import { z } from "zod";
3
3
  /**
4
4
  * @category Utilities
5
5
  */
@@ -1,2 +0,0 @@
1
- import { Theme } from "@packlink/brands";
2
- export declare const getGridStyles: (theme: Theme) => import("@emotion/utils").SerializedStyles;