@shipengine/elements 0.37.12 → 0.37.21
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/index.cjs +11662 -11649
- package/index.js +13374 -13360
- package/package.json +1 -1
- package/src/components/index.d.ts +0 -1
- package/src/components/templates/customs-items-display/customs-items-display.styles.d.ts +9 -0
- package/src/components/templates/onboarding/onboarding.d.ts +0 -1
- package/src/elements/account-settings/account-settings.d.ts +37 -60
- package/src/elements/configure-shipment/configure-shipment.d.ts +8 -7
- package/src/elements/configure-shipment/hooks/use-address.d.ts +8 -6
- package/src/elements/configure-shipment/hooks/use-request-rates.d.ts +1 -0
- package/src/elements/list-carriers/list-carriers.d.ts +1 -1
- package/src/elements/manage-warehouses/manage-warehouses.d.ts +3 -3
- package/src/elements/onboarding/onboarding.d.ts +17 -30
- package/src/elements/purchase-label/purchase-label.d.ts +1 -0
- package/src/elements/view-shipment/view-shipment.d.ts +27 -45
- package/src/elements/void-label/void-label.d.ts +1 -0
- package/src/factories/shipengine/address.d.ts +2 -2
- package/src/hooks/use-address-validation.d.ts +4 -4
- package/src/locales/en/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -12,6 +12,15 @@ export declare const styles: {
|
|
|
12
12
|
padding: string;
|
|
13
13
|
width: number;
|
|
14
14
|
};
|
|
15
|
+
alertContainer: (theme: import("@packlink/giger-theme/dist/lib/Theme").Theme) => {
|
|
16
|
+
color: string;
|
|
17
|
+
display: "flex";
|
|
18
|
+
};
|
|
19
|
+
alertText: (theme: import("@packlink/giger-theme/dist/lib/Theme").Theme) => {
|
|
20
|
+
color: "inherit";
|
|
21
|
+
fontWeight: number;
|
|
22
|
+
paddingLeft: string;
|
|
23
|
+
};
|
|
15
24
|
header: (theme: import("@packlink/giger-theme/dist/lib/Theme").Theme) => {
|
|
16
25
|
"& > tr > th": {
|
|
17
26
|
"&:after": {
|
|
@@ -176,32 +176,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
176
176
|
};
|
|
177
177
|
};
|
|
178
178
|
settings: {
|
|
179
|
-
/**
|
|
180
|
-
* # Registered Account Settings Element
|
|
181
|
-
*
|
|
182
|
-
* - This is the registered `<AccountSettings />` element that will be used to render the
|
|
183
|
-
* `<AccountSettings.Element />` component.
|
|
184
|
-
*
|
|
185
|
-
* @param ElementProps The props, callbacks, and resources necessary to render
|
|
186
|
-
* the `<AccountSettings.Element />` component.
|
|
187
|
-
*
|
|
188
|
-
* @example
|
|
189
|
-
* The `<Component />` is the source JSX that is rendered when you make use of the `AccountSettings`
|
|
190
|
-
* Element directly. Here is a brief example of how you would use it within your application.
|
|
191
|
-
* ```tsx
|
|
192
|
-
* <AccountSettings.Element
|
|
193
|
-
* onSaveSettings={() => console.log('Settings Saved!')}
|
|
194
|
-
* />
|
|
195
|
-
* ```
|
|
196
|
-
*
|
|
197
|
-
* <br />
|
|
198
|
-
*
|
|
199
|
-
* @see {@link AccountSettings.ComponentProps | The **props** that can be passed into the `<AccountSettings.Element />` component}
|
|
200
|
-
* @see {@link ListCarriers.Component | The `<List-Carriers />` component used to view connected carriers}
|
|
201
|
-
* @see {@link ManageWarehouses.Component | The `<ManageWarehouses />` component used to add, update, or remove warehouses}
|
|
202
|
-
* @see {@link PaymentMethodSettings | The `<PaymentMethodSettings />` component used to manage payment methods}
|
|
203
|
-
* @see {@link ManageFunding | The `<ManageFunding />` component used to manage funding rules and add funds to a carrier account}
|
|
204
|
-
*/
|
|
205
179
|
title: string;
|
|
206
180
|
billing: {
|
|
207
181
|
title: string;
|
|
@@ -250,32 +224,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
250
224
|
"requires-additional-handling": string;
|
|
251
225
|
addOns: string;
|
|
252
226
|
contentDescription: string;
|
|
253
|
-
/**
|
|
254
|
-
* # Registered Account Settings Element
|
|
255
|
-
*
|
|
256
|
-
* - This is the registered `<AccountSettings />` element that will be used to render the
|
|
257
|
-
* `<AccountSettings.Element />` component.
|
|
258
|
-
*
|
|
259
|
-
* @param ElementProps The props, callbacks, and resources necessary to render
|
|
260
|
-
* the `<AccountSettings.Element />` component.
|
|
261
|
-
*
|
|
262
|
-
* @example
|
|
263
|
-
* The `<Component />` is the source JSX that is rendered when you make use of the `AccountSettings`
|
|
264
|
-
* Element directly. Here is a brief example of how you would use it within your application.
|
|
265
|
-
* ```tsx
|
|
266
|
-
* <AccountSettings.Element
|
|
267
|
-
* onSaveSettings={() => console.log('Settings Saved!')}
|
|
268
|
-
* />
|
|
269
|
-
* ```
|
|
270
|
-
*
|
|
271
|
-
* <br />
|
|
272
|
-
*
|
|
273
|
-
* @see {@link AccountSettings.ComponentProps | The **props** that can be passed into the `<AccountSettings.Element />` component}
|
|
274
|
-
* @see {@link ListCarriers.Component | The `<List-Carriers />` component used to view connected carriers}
|
|
275
|
-
* @see {@link ManageWarehouses.Component | The `<ManageWarehouses />` component used to add, update, or remove warehouses}
|
|
276
|
-
* @see {@link PaymentMethodSettings | The `<PaymentMethodSettings />` component used to manage payment methods}
|
|
277
|
-
* @see {@link ManageFunding | The `<ManageFunding />` component used to manage funding rules and add funds to a carrier account}
|
|
278
|
-
*/
|
|
279
227
|
confirmation: string;
|
|
280
228
|
dimensions: {
|
|
281
229
|
length: string;
|
|
@@ -359,6 +307,31 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
359
307
|
steps: {
|
|
360
308
|
register: string;
|
|
361
309
|
carriers: string;
|
|
310
|
+
/**
|
|
311
|
+
* # Account Settings Component
|
|
312
|
+
*
|
|
313
|
+
* - The `<AccountSettings />` component is used to display the user's account settings, as well as
|
|
314
|
+
* allowing them to make changes to various aspects of their account.
|
|
315
|
+
*
|
|
316
|
+
* @param onSaveSettings Any `void` function you wish to execute when the user saves any changes
|
|
317
|
+
* to their account settings.
|
|
318
|
+
*
|
|
319
|
+
* @returns Element An EmotionJSX.Element that will render the `<AccountSettings />` component
|
|
320
|
+
* with all the appropriate wrappers.
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* You can see how the `<Component />` is used in the `createElement` function call below.
|
|
324
|
+
* ```tsx
|
|
325
|
+
* export const Element = alchemy.createElement(Component, ErrorFallback, {
|
|
326
|
+
* css: { height: "100%", maxWidth: "800px", minWidth: "440px", width: "100%" },
|
|
327
|
+
* resources: { en },
|
|
328
|
+
* });
|
|
329
|
+
* ```
|
|
330
|
+
*
|
|
331
|
+
* <br />
|
|
332
|
+
*
|
|
333
|
+
* @see {@link AccountSettings.Element | The **Element** created to render `<AccountSettings />`}
|
|
334
|
+
*/
|
|
362
335
|
addresses: string;
|
|
363
336
|
billing: string;
|
|
364
337
|
};
|
|
@@ -421,7 +394,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
421
394
|
returnTo: string;
|
|
422
395
|
returnToAddressIsDifferent: string;
|
|
423
396
|
setDefault: string;
|
|
424
|
-
shipFrom: string;
|
|
397
|
+
shipFrom: string; /**
|
|
398
|
+
* This callback function will be used to house the logic you wish to execute when the
|
|
399
|
+
* user saves new changes to their account settings.
|
|
400
|
+
*/
|
|
425
401
|
};
|
|
426
402
|
"manage-funding": {
|
|
427
403
|
actions: {
|
|
@@ -497,6 +473,13 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
497
473
|
delete: string;
|
|
498
474
|
edit: string;
|
|
499
475
|
hide: string;
|
|
476
|
+
/**
|
|
477
|
+
* # Account Settings Component Props
|
|
478
|
+
*
|
|
479
|
+
* - These are the base props that will be passed into the `<AccountSettings />` component.
|
|
480
|
+
*
|
|
481
|
+
* @see {@link AccountSettings.Component | This prop types usage in the `<AccountSettings /> component`}
|
|
482
|
+
*/
|
|
500
483
|
parse: string;
|
|
501
484
|
purchase: string;
|
|
502
485
|
remove: string;
|
|
@@ -582,13 +565,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
582
565
|
directSignature: string;
|
|
583
566
|
none: string;
|
|
584
567
|
signature: string;
|
|
585
|
-
/**
|
|
586
|
-
* # Account Settings Element Props
|
|
587
|
-
*
|
|
588
|
-
* - These are the base props that will be passed into the `<AccountSettings />` element.
|
|
589
|
-
*
|
|
590
|
-
* @see {@link AccountSettings.Element | See the full type that `typeof Element` will return}
|
|
591
|
-
*/
|
|
592
568
|
verbalConfirmation: string;
|
|
593
569
|
};
|
|
594
570
|
customs: {
|
|
@@ -695,6 +671,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
695
671
|
schema: {
|
|
696
672
|
optionalLabel: string;
|
|
697
673
|
};
|
|
674
|
+
required: string;
|
|
698
675
|
schemaErrors: {
|
|
699
676
|
notAValidPhoneNumber: string;
|
|
700
677
|
mustAgreeToTerms: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SE } from "@shipengine/alchemy";
|
|
2
|
-
import {
|
|
2
|
+
import { RateFormProps } from "../../components/templates/rate-form";
|
|
3
|
+
import { ShipmentFormFeatures, ShipmentFormProps } from "../../components/templates/shipment-form";
|
|
3
4
|
import { UseShippingPresetsOptionsProps } from "../../hooks";
|
|
4
5
|
import { UseRatesFormProps, UseShipmentFormProps } from "./hooks";
|
|
5
6
|
export type PreferredRateAcknowledgementMessage = {
|
|
@@ -35,27 +36,27 @@ export type ConfigureShipmentFeatures = {
|
|
|
35
36
|
poweredByShipEngine?: boolean;
|
|
36
37
|
};
|
|
37
38
|
rateForm?: RateFormFeatures;
|
|
38
|
-
shipmentForm?:
|
|
39
|
+
shipmentForm?: ShipmentFormFeatures;
|
|
39
40
|
};
|
|
40
41
|
export type ConfigureShipmentProps = {
|
|
41
|
-
errors?:
|
|
42
|
+
errors?: ShipmentFormProps["errors"];
|
|
42
43
|
features?: ConfigureShipmentFeatures;
|
|
43
44
|
getPreferredRates?: (shipment: SE.SalesOrderShipment, isInternational: boolean) => Promise<PreferredRatesResponse | undefined>;
|
|
44
45
|
insuranceAccount?: SE.InsuranceAccount;
|
|
45
|
-
isLoading?:
|
|
46
|
+
isLoading?: ShipmentFormProps["isLoading"];
|
|
46
47
|
onAddressValidation?: UseShipmentFormProps["onAddressValidation"];
|
|
47
48
|
onApplyPreset?: UseShipmentFormProps["onApplyPreset"];
|
|
48
49
|
onBeforeLabelCreate?: UseRatesFormProps["onBeforeLabelCreate"];
|
|
49
50
|
onBeforeRateSaved?: UseRatesFormProps["onBeforeRateSaved"];
|
|
50
51
|
onChangeAddress?: UseShipmentFormProps["onChangeAddress"];
|
|
51
|
-
onChangeShipmentFormMode?:
|
|
52
|
+
onChangeShipmentFormMode?: ShipmentFormProps["onChangeMode"];
|
|
52
53
|
onLabelCreateFailure?: UseRatesFormProps["onLabelCreateFailure"];
|
|
53
54
|
onLabelCreateSuccess?: UseRatesFormProps["onLabelCreateSuccess"];
|
|
54
55
|
onRateSaved?: UseRatesFormProps["onRateSaved"];
|
|
55
56
|
onRatesCalculated?: UseRatesFormProps["onRatesCalculated"];
|
|
56
57
|
onShipmentUpdated: UseShipmentFormProps["onShipmentUpdated"];
|
|
57
|
-
onToggleAddressPreferenceDisclosure?:
|
|
58
|
-
preferredServiceCodes?:
|
|
58
|
+
onToggleAddressPreferenceDisclosure?: ShipmentFormProps["onToggleAddressPreferenceDisclosure"];
|
|
59
|
+
preferredServiceCodes?: RateFormProps["preferredServiceCodes"];
|
|
59
60
|
printLabelLayout?: UseRatesFormProps["printLabelLayout"];
|
|
60
61
|
salesOrder?: SE.SalesOrder;
|
|
61
62
|
shipment?: SE.SalesOrderShipment;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { SE } from "@shipengine/alchemy";
|
|
2
|
-
import {
|
|
2
|
+
import { AddressParserPayload } from "../../../components/templates/address-parser";
|
|
3
|
+
import { AddressPreference } from "../../../components/templates/address-preference-display";
|
|
4
|
+
import { CharsetWarning, OnChangeAddressOptions } from "../../../components/templates/shipment-form";
|
|
3
5
|
import { CountryCode } from "../../../constants";
|
|
4
6
|
export type UseAddressProps = {
|
|
5
7
|
compatibleCountryCodes?: CountryCode[];
|
|
6
8
|
onChange?: (oldShipment: SE.SalesOrderShipment, updatedShipment: SE.SalesOrderShipment) => Promise<void> | void;
|
|
7
|
-
onValidation?: (addressPreference:
|
|
9
|
+
onValidation?: (addressPreference: AddressPreference) => Promise<void> | void;
|
|
8
10
|
salesOrder?: SE.SalesOrder;
|
|
9
11
|
shipment?: SE.SalesOrderShipment;
|
|
10
12
|
};
|
|
11
13
|
export declare const useAddress: ({ compatibleCountryCodes, onChange, onValidation, salesOrder, shipment, }: UseAddressProps) => {
|
|
12
14
|
addressErrors: SE.CodedError[] | undefined;
|
|
13
15
|
addressLoading: boolean;
|
|
14
|
-
addressPreference:
|
|
15
|
-
charsetWarning:
|
|
16
|
-
handleChangeAddress: (shipTo: SE.Address, { shouldValidate }:
|
|
17
|
-
handleParseShipTo: ({ fullAddress }:
|
|
16
|
+
addressPreference: AddressPreference | undefined;
|
|
17
|
+
charsetWarning: CharsetWarning | undefined;
|
|
18
|
+
handleChangeAddress: (shipTo: SE.Address, { shouldValidate }: OnChangeAddressOptions) => Promise<SE.SalesOrderShipment>;
|
|
19
|
+
handleParseShipTo: ({ fullAddress }: AddressParserPayload) => Promise<SE.AddressExtraction>;
|
|
18
20
|
parseAddressErrors: SE.CodedError[] | undefined;
|
|
19
21
|
resetParseAddress: () => void;
|
|
20
22
|
};
|
|
@@ -9,6 +9,7 @@ export declare const useRequestRates: ({ onRatesCalculated, getPreferredRates }:
|
|
|
9
9
|
preferredRatesResponse: PreferredRatesResponse | undefined;
|
|
10
10
|
ratesErrors: SE.CodedError[] | null;
|
|
11
11
|
ratesResponse: SE.RateResponse | undefined;
|
|
12
|
+
requestPreferredRates: import("react-query").UseMutateAsyncFunction<PreferredRatesResponse | undefined, SE.CodedError[], [shipment: SE.SalesOrderShipment, isInternational: boolean], unknown>;
|
|
12
13
|
requestRates: (shipment: SE.SalesOrderShipment, isInternational: boolean) => Promise<void>;
|
|
13
14
|
resetRates: () => void;
|
|
14
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AddressPreference } from "../../components/templates/address-preference-display";
|
|
2
2
|
/**
|
|
3
3
|
* # Manage Warehouses Props
|
|
4
4
|
*
|
|
@@ -11,7 +11,7 @@ export type ComponentProps = {
|
|
|
11
11
|
* `onWarehouseAddressValidation` is an optional callback function that will be invoked when a
|
|
12
12
|
* warehouse address is validated.
|
|
13
13
|
*/
|
|
14
|
-
onWarehouseAddressValidation?: (originAddressPreference:
|
|
14
|
+
onWarehouseAddressValidation?: (originAddressPreference: AddressPreference, returnAddressPreference?: AddressPreference) => Promise<void> | void;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* # Manage Warehouses Component
|
|
@@ -36,4 +36,4 @@ export type ComponentProps = {
|
|
|
36
36
|
* @see {@link ManageWarehouses.ComponentProps | The props that are passed into the `<ManageWarehouses />` component}
|
|
37
37
|
* @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<ManageWarehouses />` component}
|
|
38
38
|
*/
|
|
39
|
-
export declare const Component: ({ onWarehouseAddressValidation }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare const Component: ({ onWarehouseAddressValidation: _ARE_WE_ACTUALLY_GOING_TO_USE_THIS, }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { OnboardingProps } from "../../components/templates";
|
|
2
|
+
import { OnboardingProps } from "../../components/templates/onboarding";
|
|
3
3
|
/**
|
|
4
4
|
* # Onboarding Component Props
|
|
5
5
|
*
|
|
@@ -148,7 +148,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
148
148
|
deliveryConfirmation: string;
|
|
149
149
|
};
|
|
150
150
|
highVolumeForms: string;
|
|
151
|
-
multipleShippingServices: string;
|
|
151
|
+
multipleShippingServices: string; /**
|
|
152
|
+
* `onCompleteOnboarding` is a callback function that will be invoked once the onboarding process
|
|
153
|
+
* is completed.
|
|
154
|
+
*/
|
|
152
155
|
sections: {
|
|
153
156
|
labels: string;
|
|
154
157
|
};
|
|
@@ -325,9 +328,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
325
328
|
};
|
|
326
329
|
steps: {
|
|
327
330
|
register: string;
|
|
328
|
-
carriers: string;
|
|
329
|
-
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
330
|
-
*/
|
|
331
|
+
carriers: string;
|
|
331
332
|
addresses: string;
|
|
332
333
|
billing: string;
|
|
333
334
|
};
|
|
@@ -368,7 +369,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
368
369
|
dimensions: {
|
|
369
370
|
title: string;
|
|
370
371
|
standard: string;
|
|
371
|
-
metric: string;
|
|
372
|
+
metric: string; /**
|
|
373
|
+
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
374
|
+
*/
|
|
372
375
|
};
|
|
373
376
|
weight: {
|
|
374
377
|
title: string;
|
|
@@ -419,7 +422,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
419
422
|
error: {
|
|
420
423
|
title: string;
|
|
421
424
|
message: string;
|
|
422
|
-
};
|
|
425
|
+
}; /**
|
|
426
|
+
* `onCompleteOnboarding` is a callback function that will be invoked once the onboarding process
|
|
427
|
+
* is completed.
|
|
428
|
+
*/
|
|
423
429
|
isLoading: string;
|
|
424
430
|
labels: {
|
|
425
431
|
amount: string;
|
|
@@ -484,7 +490,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
484
490
|
cityLocality: string;
|
|
485
491
|
stateProvince: string;
|
|
486
492
|
postalCode: string;
|
|
487
|
-
phone: string;
|
|
493
|
+
phone: string; /**
|
|
494
|
+
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
495
|
+
*/
|
|
488
496
|
email: string;
|
|
489
497
|
addressResidentialIndicator: string;
|
|
490
498
|
};
|
|
@@ -587,28 +595,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
587
595
|
parsingFailure: string;
|
|
588
596
|
incompleteLabelPurchaseRequirements: string;
|
|
589
597
|
shipmentCancelled: string;
|
|
590
|
-
/**
|
|
591
|
-
* # Registered Onboarding Element
|
|
592
|
-
*
|
|
593
|
-
* - This is the registered `<Onboarding />` element that will be used to render the
|
|
594
|
-
* `<Onboarding.Element />` component.
|
|
595
|
-
*
|
|
596
|
-
* @param ElementProps The props, callbacks, and resources necessary to render
|
|
597
|
-
* the `<Onboarding.Element />` component.
|
|
598
|
-
*
|
|
599
|
-
* @example
|
|
600
|
-
* The `<Component />` is the source JSX that is rendered when you make use of the `Onboarding`
|
|
601
|
-
* Element directly. Here is a brief example of how you would use it within your application.
|
|
602
|
-
* ```tsx
|
|
603
|
-
* <Onboarding.Element
|
|
604
|
-
* onCompleteOnboarding={() => console.log('Onboarding Complete!')}
|
|
605
|
-
* />
|
|
606
|
-
* ```
|
|
607
|
-
*
|
|
608
|
-
* <br />
|
|
609
|
-
*
|
|
610
|
-
* @see {@link Onboarding.ComponentProps | The **props** that can be passed into the `<Onboarding.Element />` component}
|
|
611
|
-
*/
|
|
612
598
|
unableToLoad: {
|
|
613
599
|
accountSettings: string;
|
|
614
600
|
autoFundingSettings: string;
|
|
@@ -679,6 +665,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
679
665
|
schema: {
|
|
680
666
|
optionalLabel: string;
|
|
681
667
|
};
|
|
668
|
+
required: string;
|
|
682
669
|
schemaErrors: {
|
|
683
670
|
notAValidPhoneNumber: string;
|
|
684
671
|
mustAgreeToTerms: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SE } from "@shipengine/alchemy";
|
|
3
|
-
import {
|
|
3
|
+
import { ShipmentFeatures } from "../../components/templates/shipment";
|
|
4
4
|
/**
|
|
5
5
|
* # View Shipment Component Props
|
|
6
6
|
*
|
|
@@ -12,7 +12,7 @@ export type ComponentProps = {
|
|
|
12
12
|
/**
|
|
13
13
|
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
14
14
|
*/
|
|
15
|
-
features?:
|
|
15
|
+
features?: ShipmentFeatures;
|
|
16
16
|
/**
|
|
17
17
|
* `onClickPrintLabel` is a callback function that will be invoked when the user clicks the
|
|
18
18
|
* `Print Label` button.
|
|
@@ -168,13 +168,21 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
168
168
|
description: string;
|
|
169
169
|
};
|
|
170
170
|
billing: {
|
|
171
|
-
title: string;
|
|
171
|
+
title: string; /**
|
|
172
|
+
* # View Shipment Component Props
|
|
173
|
+
*
|
|
174
|
+
* - These are the base props that will be passed into the `<ViewShipment />` component.
|
|
175
|
+
*
|
|
176
|
+
* @see {@link ViewShipment.Component | This prop types usage in the `<ViewShipment />` component}
|
|
177
|
+
*/
|
|
172
178
|
cardSubTitle: string;
|
|
173
179
|
addressSubTitle: string;
|
|
174
180
|
info: string;
|
|
175
181
|
};
|
|
176
182
|
carriers: {
|
|
177
|
-
title: string;
|
|
183
|
+
title: string; /**
|
|
184
|
+
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
185
|
+
*/
|
|
178
186
|
subtitle: string;
|
|
179
187
|
};
|
|
180
188
|
notifications: {
|
|
@@ -230,7 +238,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
230
238
|
insufficientBalanceCTA: string;
|
|
231
239
|
};
|
|
232
240
|
cta: {
|
|
233
|
-
addPackageDetails: string;
|
|
241
|
+
addPackageDetails: string; /**
|
|
242
|
+
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
243
|
+
*/
|
|
234
244
|
};
|
|
235
245
|
errorMessages: {
|
|
236
246
|
customsItemsRequired: string;
|
|
@@ -332,10 +342,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
332
342
|
register: string;
|
|
333
343
|
carriers: string;
|
|
334
344
|
addresses: string;
|
|
335
|
-
/**
|
|
336
|
-
* `onClickPrintLabel` is a callback function that will be invoked when the user clicks the
|
|
337
|
-
* `Print Label` button.
|
|
338
|
-
*/
|
|
339
345
|
billing: string;
|
|
340
346
|
};
|
|
341
347
|
warehouse: {
|
|
@@ -372,12 +378,12 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
372
378
|
};
|
|
373
379
|
units: {
|
|
374
380
|
title: string;
|
|
381
|
+
/**
|
|
382
|
+
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
383
|
+
*/
|
|
375
384
|
dimensions: {
|
|
376
385
|
title: string;
|
|
377
|
-
standard: string;
|
|
378
|
-
* `onClickPrintLabel` is a callback function that will be invoked when the user clicks the
|
|
379
|
-
* `Print Label` button.
|
|
380
|
-
*/
|
|
386
|
+
standard: string;
|
|
381
387
|
metric: string;
|
|
382
388
|
};
|
|
383
389
|
weight: {
|
|
@@ -420,6 +426,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
420
426
|
isEnabled: string;
|
|
421
427
|
isLoading: string;
|
|
422
428
|
lowBalancePurchaseThreshold: string;
|
|
429
|
+
/**
|
|
430
|
+
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
431
|
+
*/
|
|
423
432
|
maximumPurchasesPerDay: string;
|
|
424
433
|
purchaseAmount: string;
|
|
425
434
|
readSettings: string;
|
|
@@ -496,6 +505,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
496
505
|
postalCode: string;
|
|
497
506
|
phone: string;
|
|
498
507
|
email: string;
|
|
508
|
+
/**
|
|
509
|
+
* `onClickPrintLabel` is a callback function that will be invoked when the user clicks the
|
|
510
|
+
* `Print Label` button.
|
|
511
|
+
*/
|
|
499
512
|
addressResidentialIndicator: string;
|
|
500
513
|
};
|
|
501
514
|
noResults: string;
|
|
@@ -513,31 +526,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
513
526
|
title: string;
|
|
514
527
|
originalAddress: string;
|
|
515
528
|
matchedAddress: string;
|
|
516
|
-
/**
|
|
517
|
-
* # View Shipment Component
|
|
518
|
-
*
|
|
519
|
-
* - The `<ViewShipment />` component is used to for viewing the shipment's tracking number, printing the label that
|
|
520
|
-
* was created, and the option to void the label. When a label is voided, you can see a list of the
|
|
521
|
-
* previously voided labels for a given shipment using this component.
|
|
522
|
-
*
|
|
523
|
-
* @param ComponentProps The base props that will be passed into the `<ViewShipment />` component.
|
|
524
|
-
*
|
|
525
|
-
* @returns Element An EmotionJSX.Element that will render the `<ViewShipment />` component
|
|
526
|
-
* with all the appropriate wrappers.
|
|
527
|
-
*
|
|
528
|
-
* @example
|
|
529
|
-
* You can see how the `<Component />` is used in the `createElement` function call below.
|
|
530
|
-
* ```tsx
|
|
531
|
-
* export const Element = alchemy.createElement(Component, ErrorFallback, {
|
|
532
|
-
* css: { height: "100%", maxWidth: "800px", minWidth: "440px", width: "100%" },
|
|
533
|
-
* resources: { en },
|
|
534
|
-
* });
|
|
535
|
-
* ```
|
|
536
|
-
*
|
|
537
|
-
* <br />
|
|
538
|
-
*
|
|
539
|
-
* @see {@link ViewShipment.Element | The **Element** created to render `<ViewShipment />`}
|
|
540
|
-
*/
|
|
541
529
|
unableToValidate: string;
|
|
542
530
|
use: {
|
|
543
531
|
originalAddress: string;
|
|
@@ -625,13 +613,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
625
613
|
unableToLoad: {
|
|
626
614
|
accountSettings: string;
|
|
627
615
|
autoFundingSettings: string;
|
|
628
|
-
/**
|
|
629
|
-
* # View Shipment Element Props
|
|
630
|
-
*
|
|
631
|
-
* - These are the base props that will be passed into the `<ViewShipment />` element.
|
|
632
|
-
*
|
|
633
|
-
* @see {@link ViewShipment.Element | See the full type that `typeof Element` will return}
|
|
634
|
-
*/
|
|
635
616
|
carrier: string;
|
|
636
617
|
carriers: string;
|
|
637
618
|
label: string;
|
|
@@ -699,6 +680,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
699
680
|
schema: {
|
|
700
681
|
optionalLabel: string;
|
|
701
682
|
};
|
|
683
|
+
required: string;
|
|
702
684
|
schemaErrors: {
|
|
703
685
|
notAValidPhoneNumber: string;
|
|
704
686
|
mustAgreeToTerms: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Factory } from "fishery";
|
|
2
2
|
import { SE } from "@shipengine/alchemy";
|
|
3
|
-
import {
|
|
3
|
+
import { AddressValidationPreference } from "../../components/templates/address-preference-select";
|
|
4
4
|
export type AddressTransientParams = {
|
|
5
5
|
isInternational?: boolean;
|
|
6
6
|
};
|
|
@@ -31,5 +31,5 @@ export declare const addressPreferenceFactory: Factory<AddressPreference, any, A
|
|
|
31
31
|
* used for warehouse management and onboarding.
|
|
32
32
|
* @category Factory
|
|
33
33
|
*/
|
|
34
|
-
export declare const addressValidationWithTypeFactory: Factory<
|
|
34
|
+
export declare const addressValidationWithTypeFactory: Factory<AddressValidationPreference, any, AddressValidationPreference>;
|
|
35
35
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SE } from "@shipengine/alchemy";
|
|
3
|
-
import {
|
|
3
|
+
import { ValidationPreference } from "../components/address-preference-context";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*
|
|
@@ -10,10 +10,10 @@ import { Templates } from "../components";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const useAddressValidation: () => {
|
|
12
12
|
errors: SE.CodedError[] | null;
|
|
13
|
-
setValidationPreference: import("react").Dispatch<import("react").SetStateAction<
|
|
13
|
+
setValidationPreference: import("react").Dispatch<import("react").SetStateAction<ValidationPreference | undefined>>;
|
|
14
14
|
validate: (addresses: {
|
|
15
15
|
originAddress: SE.Address;
|
|
16
16
|
returnAddress?: SE.Address;
|
|
17
|
-
}) => Promise<
|
|
18
|
-
validationPreference:
|
|
17
|
+
}) => Promise<ValidationPreference>;
|
|
18
|
+
validationPreference: ValidationPreference | undefined;
|
|
19
19
|
};
|