@shipengine/elements 0.13.1 → 0.15.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.
- package/components/accordion/accordion.d.ts +2 -2
- package/components/error-boundary/error-boundary.d.ts +2 -2
- package/components/field/create-field-controller.d.ts +3 -3
- package/components/field/input-group/input-group.d.ts +1 -1
- package/components/field/money-input/money-input.d.ts +4 -4
- package/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +4 -4
- package/components/field/rate-select/rate-select.d.ts +1 -1
- package/components/field/select/select.d.ts +1 -1
- package/components/field/switch/switch.d.ts +2 -2
- package/components/items-breakdown/items-breakdown.d.ts +3 -3
- package/components/organisms/manual-funding-form/index.d.ts +1 -0
- package/components/organisms/manual-funding-form/manual-funding-form.d.ts +4 -1
- package/components/settings-card/settings-card.d.ts +2 -2
- package/components/templates/address-form/address-fields.d.ts +9 -0
- package/components/templates/address-form/address-form-schema.d.ts +103 -0
- package/components/templates/address-form/address-schema.d.ts +7 -220
- package/components/templates/address-form/index.d.ts +2 -0
- package/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
- package/components/templates/billing-form/billing-schema.d.ts +199 -64
- package/components/templates/customs-item-form/customs-item-form-schema.d.ts +2 -2
- package/components/templates/funding-methods/funding-methods.d.ts +8 -1
- package/components/templates/label/label.d.ts +3 -3
- package/components/templates/rate-form/rate-form.d.ts +2 -2
- package/components/templates/sales-order/sales-order.d.ts +1 -1
- package/components/templates/shipment-form/shipment-form.d.ts +4 -4
- package/components/templates/shipment-form/shipment-schema.d.ts +140 -140
- package/constants/shipengine/address.d.ts +1 -0
- package/elements/components/configure-shipment/configure-shipment.d.ts +1 -1
- package/elements/components/configure-shipment/hooks/use-address.d.ts +1 -1
- package/elements/components/configure-shipment/hooks/use-customs.d.ts +1 -1
- package/elements/components/configure-shipment/hooks/use-presets.d.ts +1 -1
- package/elements/components/configure-shipment/hooks/use-rates-form.d.ts +2 -2
- package/elements/components/configure-shipment/hooks/use-shipment-form.d.ts +2 -2
- package/factories/shipengine/address.d.ts +1 -1
- package/factories/shipengine/sales-order.d.ts +1 -1
- package/factories/shipengine/shipment.d.ts +2 -2
- package/hooks/options/use-insurance-provider-options.d.ts +1 -1
- package/hooks/options/use-shipping-presets-options.d.ts +1 -1
- package/hooks/use-elements.d.ts +5 -5
- package/hooks/use-page-layout.d.ts +1 -1
- package/index.cjs +5074 -4853
- package/index.js +5252 -5031
- package/locales/en/index.d.ts +7 -0
- package/package.json +5 -5
- package/schemas/shipengine/phone.d.ts +1 -1
- package/testing/swr.d.ts +5 -5
- package/types/carrier-metadata.d.ts +11 -0
- package/utilities/form-logger.d.ts +1 -1
- package/utilities/rates.d.ts +3 -3
- package/utilities/shipengine/weight.d.ts +1 -1
- package/utilities/validation.d.ts +1 -1
- package/components/field/input-group/input-group.styles.d.ts +0 -2
package/locales/en/index.d.ts
CHANGED
|
@@ -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;
|
|
@@ -352,6 +357,8 @@ declare const _default: {
|
|
|
352
357
|
};
|
|
353
358
|
invalidAddressName: string;
|
|
354
359
|
invalidAddressPoBox: string;
|
|
360
|
+
invalidPostalCode: string;
|
|
361
|
+
invalidStateProvince: string;
|
|
355
362
|
invalidString: string;
|
|
356
363
|
nonnegative: string;
|
|
357
364
|
nonnegativeList: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipengine/elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.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.
|
|
22
|
+
"@shipengine/react": "0.15.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.
|
|
27
|
+
"@shipengine/types": "0.15.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
|
}
|
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
|
-
|
|
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
|
};
|
package/utilities/rates.d.ts
CHANGED
|
@@ -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;
|