@shipengine/elements 0.15.0 → 0.16.1
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/add-funds-form/add-funds-form.d.ts +22 -0
- package/components/add-funds-form/add-funds-form.styles.d.ts +6 -0
- package/components/add-funds-form/add-funds-schema.d.ts +37 -0
- package/components/add-funds-form/index.d.ts +2 -0
- package/components/auto-funding-form/auto-funding-form.d.ts +8 -0
- package/components/auto-funding-form/auto-funding-form.styles.d.ts +1 -0
- package/components/{organisms/auto-funding-form → auto-funding-form}/auto-funding-schema.d.ts +10 -10
- package/components/auto-funding-form/index.d.ts +2 -0
- package/components/carrier-balance/carrier-balance.d.ts +4 -0
- package/components/carrier-balance/carrier-balance.styles.d.ts +1 -0
- package/components/carrier-balance/index.d.ts +1 -0
- package/components/field/create-field-controller.d.ts +4 -1
- package/components/field/credit-card-input/credit-card-input.d.ts +3 -0
- package/components/field/credit-card-input/index.d.ts +1 -0
- package/components/field/fields.d.ts +1 -0
- package/components/field/money-input/hooks/use-utils.d.ts +1 -1
- package/components/field/money-input/money-input.d.ts +1 -1
- package/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +1 -1
- package/components/form-portal/form-portal.d.ts +18 -0
- package/components/form-portal/index.d.ts +1 -0
- package/components/fund-and-purchase/fund-and-purchase.d.ts +15 -0
- package/components/fund-and-purchase/fund-and-purchase.styles.d.ts +1 -0
- package/components/fund-and-purchase/index.d.ts +1 -0
- package/components/index.d.ts +10 -0
- package/components/inline-label/index.d.ts +1 -0
- package/components/inline-label/inline-label.d.ts +6 -0
- package/components/items-breakdown/items-breakdown.d.ts +1 -1
- package/components/link-action/index.d.ts +1 -0
- package/components/link-action/link-action.d.ts +12 -0
- package/components/manage-funding/manage-funding.d.ts +4 -0
- package/components/portal/portal.d.ts +1 -1
- package/components/settings-card/settings-card.d.ts +6 -1
- package/components/settings-card/settings-card.styles.d.ts +1 -6
- package/components/spread/index.d.ts +1 -0
- package/components/spread/spread.d.ts +5 -0
- package/components/story-notes/index.d.ts +1 -0
- package/components/story-notes/story-notes.d.ts +11 -0
- package/components/templates/{billing-form/billing-schema.d.ts → add-carrier-form/add-carrier-form-schema.d.ts} +38 -109
- package/components/templates/add-carrier-form/add-carrier-form-test.d.ts +1 -0
- package/components/templates/add-carrier-form/add-carrier-form.d.ts +10 -0
- package/components/templates/add-carrier-form/index.d.ts +2 -0
- package/components/templates/address-display/address-display.d.ts +1 -1
- package/components/templates/address-form/address-fields.d.ts +2 -1
- package/components/templates/address-form/address-form-schema.d.ts +0 -9
- package/components/templates/address-form/address-form.d.ts +2 -2
- package/components/templates/address-form/address-schema.d.ts +2 -3
- package/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
- package/components/templates/carrier-recovery-form/carrier-recovery-form-schema.d.ts +238 -0
- package/components/templates/carrier-recovery-form/carrier-recovery-form.d.ts +10 -0
- package/components/templates/carrier-recovery-form/carrier-recovery-form.styles.d.ts +1 -0
- package/components/templates/carrier-recovery-form/index.d.ts +2 -0
- package/components/templates/carrier-terms-form/carrier-terms-form-schema.d.ts +10 -0
- package/components/templates/carrier-terms-form/carrier-terms-form.d.ts +6 -0
- package/components/templates/carrier-terms-form/carrier-terms-form.styles.d.ts +1 -0
- package/components/templates/carrier-terms-form/index.d.ts +1 -0
- package/components/templates/customs-item-form/customs-item-form-schema.d.ts +112 -12
- package/components/templates/customs-item-form/customs-item-form.d.ts +3 -2
- package/components/templates/customs-items-display/customs-items-display.d.ts +1 -1
- package/components/templates/display-carrier-terms/display-carrier-terms.d.ts +6 -0
- package/components/templates/display-carrier-terms/index.d.ts +1 -0
- package/components/templates/edit-billing-form/edit-billing-form.d.ts +6 -0
- package/components/templates/edit-billing-form/edit-billing-form.styles.d.ts +1 -0
- package/components/templates/edit-billing-form/index.d.ts +1 -0
- package/components/templates/index.d.ts +8 -4
- package/components/templates/label/label.d.ts +2 -2
- package/components/templates/landing-page/index.d.ts +1 -0
- package/components/templates/landing-page/landing-page-form-schema.d.ts +10 -0
- package/components/templates/landing-page/landing-page-form.d.ts +4 -0
- package/components/templates/landing-page/landing-page.d.ts +4 -0
- package/components/templates/landing-page/landing-page.styles.d.ts +1 -0
- package/components/templates/list-carriers/index.d.ts +1 -0
- package/components/templates/list-carriers/list-carriers.d.ts +9 -0
- package/components/templates/list-carriers/list-carriers.styles.d.ts +1 -0
- package/components/templates/list-carriers-row/index.d.ts +1 -0
- package/components/templates/list-carriers-row/list-carriers-row.d.ts +9 -0
- package/components/templates/list-carriers-row/list-carriers-row.styles.d.ts +1 -0
- package/components/templates/manage-wallet/index.d.ts +1 -0
- package/components/templates/manage-wallet/manage-wallet.d.ts +1 -0
- package/components/templates/manage-wallet/manage-wallet.styles.d.ts +1 -0
- package/components/templates/manage-warehouses/manage-warehouses.d.ts +7 -2
- package/components/templates/onboarding/index.d.ts +1 -0
- package/components/templates/onboarding/onboarding.d.ts +18 -0
- package/components/templates/onboarding/onboarding.styles.d.ts +1 -0
- package/components/templates/rate-form/rate-form.d.ts +2 -2
- package/components/templates/rate-form/rate-form.styles.d.ts +1 -0
- package/components/templates/sales-order/sales-order.d.ts +1 -1
- package/components/templates/shipment/shipment.d.ts +1 -1
- package/components/templates/shipment-form/shipment-form.d.ts +3 -3
- package/components/templates/shipment-form/shipment-schema.d.ts +11 -11
- package/components/templates/void-label/void-label.d.ts +1 -1
- package/components/templates/wallet-card/index.d.ts +1 -0
- package/components/templates/wallet-card/wallet-card.d.ts +4 -0
- package/components/templates/wallet-card/wallet-card.styles.d.ts +1 -0
- package/components/templates/wallet-form/billing-fields.d.ts +6 -0
- package/components/templates/wallet-form/edit-wallet-address-form.d.ts +16 -0
- package/components/templates/wallet-form/index.d.ts +4 -0
- package/components/templates/wallet-form/wallet-form.d.ts +11 -0
- package/components/templates/wallet-form/wallet-form.styles.d.ts +1 -0
- package/components/templates/wallet-form/wallet-schema.d.ts +269 -0
- package/components/templates/warehouse-display/warehouse-display.d.ts +1 -1
- package/components/templates/warehouse-form/index.d.ts +1 -0
- package/components/templates/warehouse-form/warehouse-form-schema.d.ts +503 -0
- package/components/templates/warehouse-form/warehouse-form.d.ts +10 -0
- package/components/templates/warehouse-form/warehouse-form.styles.d.ts +1 -0
- package/constants/shipengine/address.d.ts +4 -0
- package/elements/components/configure-shipment/configure-shipment.d.ts +1 -1
- package/elements/components/configure-shipment/hooks/use-address.d.ts +3 -3
- package/elements/components/configure-shipment/hooks/use-customs.d.ts +3 -3
- package/elements/components/configure-shipment/hooks/use-presets.d.ts +2 -2
- package/elements/components/configure-shipment/hooks/use-rates-form.d.ts +1 -1
- package/elements/components/configure-shipment/hooks/use-request-rates.d.ts +2 -2
- package/elements/components/configure-shipment/hooks/use-shipment-form.d.ts +6 -6
- package/elements/components/index.d.ts +2 -3
- package/elements/components/list-carriers/hooks/use-list-connected-carriers.d.ts +11 -0
- package/elements/components/list-carriers/index.d.ts +1 -0
- package/elements/components/list-carriers/list-carriers.d.ts +1 -0
- package/elements/components/onboarding/index.d.ts +1 -0
- package/elements/components/onboarding/onboarding.d.ts +4 -0
- package/elements/components/sales-order/hooks/use-configure-shipment.d.ts +3 -1
- package/elements/components/sales-order/hooks/use-import-sales-order.d.ts +2 -2
- package/elements/components/sales-order/hooks/use-pending-shipment.d.ts +1 -1
- package/elements/components/sales-order/sales-order.d.ts +1 -1
- package/elements/components/shipment/shipment.d.ts +1 -1
- package/elements/components/void-label/void-label.d.ts +1 -1
- package/elements/index.d.ts +2 -3
- package/elements/onboarding.d.ts +1 -0
- package/factories/shipengine/address.d.ts +1 -1
- package/factories/shipengine/carrier.d.ts +1 -1
- package/factories/shipengine/label.d.ts +1 -1
- package/factories/shipengine/money.d.ts +1 -1
- package/factories/shipengine/order-source.d.ts +10 -2
- package/factories/shipengine/package.d.ts +2 -2
- package/factories/shipengine/resource.d.ts +1 -1
- package/factories/shipengine/sales-order.d.ts +1 -1
- package/factories/shipengine/service.d.ts +2 -2
- package/factories/shipengine/shipment.d.ts +4 -4
- package/factories/shipengine/warehouse.d.ts +1 -1
- package/factories/shipengine/weight.d.ts +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/options/use-confirmation-options.d.ts +1 -1
- package/hooks/options/use-customs-contents-options.d.ts +1 -1
- package/hooks/options/use-customs-non-delivery-options.d.ts +1 -1
- package/hooks/options/use-insurance-provider-options.d.ts +2 -2
- package/hooks/options/use-package-options.d.ts +2 -2
- package/hooks/options/use-rate-options.d.ts +1 -1
- package/hooks/options/use-service-code-options.d.ts +1 -1
- package/hooks/options/use-warehouse-options.d.ts +1 -1
- package/hooks/use-carrier-metadata.d.ts +2 -5
- package/hooks/use-nested-form.d.ts +2 -2
- package/hooks/use-toggle.d.ts +12 -0
- package/index.cjs +20093 -17773
- package/index.js +20769 -18460
- package/locales/en/index.d.ts +122 -6
- package/mocks/browser.d.ts +1 -0
- package/mocks/carriers/handlers.d.ts +12 -0
- package/mocks/carriers/index.d.ts +1 -0
- package/mocks/index.d.ts +2 -0
- package/mocks/server.d.ts +2 -0
- package/mocks/warehouses/handlers.d.ts +1 -0
- package/mocks/warehouses/index.d.ts +1 -0
- package/package.json +10 -7
- package/register.d.ts +1 -4
- package/schemas/shipengine/index.d.ts +0 -1
- package/schemas/shipengine/money.d.ts +1 -1
- package/testing/index.d.ts +0 -1
- package/testing/render.d.ts +5 -0
- package/types/carrier-metadata.d.ts +10 -5
- package/types/shipping-preset/shipping-preset.d.ts +2 -2
- package/utilities/date.d.ts +13 -1
- package/utilities/money.d.ts +2 -1
- package/utilities/rates.d.ts +2 -2
- package/utilities/shipengine/address.d.ts +1 -1
- package/utilities/shipengine/dimensions.d.ts +1 -1
- package/utilities/shipengine/sales-order.d.ts +1 -1
- package/utilities/shipengine/shipment.d.ts +1 -1
- package/utilities/shipengine/weight.d.ts +1 -1
- package/components/organisms/auto-funding-form/auto-funding-form.d.ts +0 -15
- package/components/organisms/auto-funding-form/index.d.ts +0 -1
- package/components/organisms/index.d.ts +0 -2
- package/components/organisms/manual-funding-form/index.d.ts +0 -2
- package/components/organisms/manual-funding-form/manual-funding-form.d.ts +0 -17
- package/components/organisms/manual-funding-form/manual-funding-schema.d.ts +0 -27
- package/components/templates/add-carriers/add-carriers.d.ts +0 -5
- package/components/templates/add-carriers/index.d.ts +0 -1
- package/components/templates/agreement-form/agreement-form-schema.d.ts +0 -10
- package/components/templates/agreement-form/agreement-form.d.ts +0 -8
- package/components/templates/agreement-form/agreement-form.styles.d.ts +0 -1
- package/components/templates/agreement-form/index.d.ts +0 -1
- package/components/templates/billing-form/billing-form-stories.d.ts +0 -6
- package/components/templates/billing-form/billing-form.d.ts +0 -9
- package/components/templates/billing-form/index.d.ts +0 -2
- package/components/templates/funding-methods/funding-methods.d.ts +0 -17
- package/components/templates/funding-methods/index.d.ts +0 -1
- package/components/templates/register-wallet/index.d.ts +0 -1
- package/components/templates/register-wallet/register-wallet.d.ts +0 -3
- package/components/templates/register-wallet/register-wallet.styles.d.ts +0 -6
- package/elements/add-carriers.d.ts +0 -1
- package/elements/components/add-carriers/add-carriers.d.ts +0 -8
- package/elements/components/add-carriers/index.d.ts +0 -1
- package/elements/components/manage-funding/manage-funding.d.ts +0 -2
- package/elements/components/register-wallet/index.d.ts +0 -1
- package/elements/components/register-wallet/register-wallet.d.ts +0 -9
- package/elements/register-wallet.d.ts +0 -1
- package/schemas/shipengine/address.d.ts +0 -17
- package/testing/swr.d.ts +0 -15
- /package/{elements/components → components}/manage-funding/index.d.ts +0 -0
- /package/elements/{manage-funding.d.ts → list-carriers.d.ts} +0 -0
package/locales/en/index.d.ts
CHANGED
|
@@ -50,11 +50,10 @@ declare const _default: {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
"register-wallet": {
|
|
53
|
-
agreeToTerms: string;
|
|
54
53
|
sections: {
|
|
55
54
|
setup: {
|
|
56
55
|
title: string;
|
|
57
|
-
|
|
56
|
+
subtitle: string;
|
|
58
57
|
descriptionTitle: string;
|
|
59
58
|
description: string;
|
|
60
59
|
};
|
|
@@ -62,8 +61,42 @@ declare const _default: {
|
|
|
62
61
|
title: string;
|
|
63
62
|
cardSubTitle: string;
|
|
64
63
|
addressSubTitle: string;
|
|
64
|
+
info: string;
|
|
65
|
+
};
|
|
66
|
+
carriers: {
|
|
67
|
+
title: string;
|
|
68
|
+
subtitle: string;
|
|
69
|
+
};
|
|
70
|
+
notifications: {
|
|
71
|
+
error: {
|
|
72
|
+
title: string;
|
|
73
|
+
};
|
|
74
|
+
info: {
|
|
75
|
+
title: string;
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
poBox: {
|
|
79
|
+
title: string;
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
carrier: {
|
|
83
|
+
title: string;
|
|
84
|
+
confirmAddress: string;
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
65
87
|
};
|
|
66
88
|
};
|
|
89
|
+
settings: {
|
|
90
|
+
title: string;
|
|
91
|
+
billing: {
|
|
92
|
+
title: string;
|
|
93
|
+
subtitle: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
"register-carrier": {
|
|
98
|
+
formTitle: string;
|
|
99
|
+
agreeToTerms: string;
|
|
67
100
|
};
|
|
68
101
|
"purchase-label": {
|
|
69
102
|
actions: {
|
|
@@ -149,13 +182,53 @@ declare const _default: {
|
|
|
149
182
|
rate_other: string;
|
|
150
183
|
};
|
|
151
184
|
};
|
|
185
|
+
onboarding: {
|
|
186
|
+
inlineTitle: string;
|
|
187
|
+
landing: {
|
|
188
|
+
action: string;
|
|
189
|
+
title: string;
|
|
190
|
+
subtitle: string;
|
|
191
|
+
descriptionTitle: string;
|
|
192
|
+
description: string;
|
|
193
|
+
};
|
|
194
|
+
steps: {
|
|
195
|
+
login: string;
|
|
196
|
+
carriers: string;
|
|
197
|
+
addresses: string;
|
|
198
|
+
payment: string;
|
|
199
|
+
};
|
|
200
|
+
warehouse: {
|
|
201
|
+
title: string;
|
|
202
|
+
subtitle: string;
|
|
203
|
+
inlineMessage: string;
|
|
204
|
+
};
|
|
205
|
+
success: {
|
|
206
|
+
title: string;
|
|
207
|
+
subtitle: string;
|
|
208
|
+
action: string;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
152
211
|
"manage-warehouses": {
|
|
212
|
+
addNew: string;
|
|
213
|
+
contactName: string;
|
|
214
|
+
default: string;
|
|
215
|
+
isDefault: string;
|
|
216
|
+
locationName: string;
|
|
217
|
+
residentialAddress: string;
|
|
153
218
|
returnTo: string;
|
|
219
|
+
returnToAddressIsDifferent: string;
|
|
220
|
+
setDefault: string;
|
|
154
221
|
shipFrom: string;
|
|
155
222
|
};
|
|
156
223
|
"manage-funding": {
|
|
157
|
-
|
|
224
|
+
actions: {
|
|
225
|
+
addFunds: string;
|
|
226
|
+
addFundsAndPurchase: string;
|
|
227
|
+
addNow: string;
|
|
228
|
+
saveRule: string;
|
|
229
|
+
};
|
|
158
230
|
autoFunding: {
|
|
231
|
+
addFundsAutomatically: string;
|
|
159
232
|
error: {
|
|
160
233
|
title: string;
|
|
161
234
|
message: string;
|
|
@@ -166,7 +239,8 @@ declare const _default: {
|
|
|
166
239
|
maximumPurchasesPerDay: string;
|
|
167
240
|
purchaseAmount: string;
|
|
168
241
|
};
|
|
169
|
-
|
|
242
|
+
addFunds: {
|
|
243
|
+
custom: string;
|
|
170
244
|
error: {
|
|
171
245
|
title: string;
|
|
172
246
|
message: string;
|
|
@@ -174,17 +248,43 @@ declare const _default: {
|
|
|
174
248
|
isLoading: string;
|
|
175
249
|
labels: {
|
|
176
250
|
amount: string;
|
|
177
|
-
currentBalance: string;
|
|
178
|
-
resultingBalance: string;
|
|
179
251
|
};
|
|
180
252
|
minimumPurchaseAmount: string;
|
|
181
253
|
};
|
|
254
|
+
fundAndPurchase: {
|
|
255
|
+
finalBalance: string;
|
|
256
|
+
insufficientFunds: string;
|
|
257
|
+
insufficientFundsTitle: string;
|
|
258
|
+
negativeBalance: string;
|
|
259
|
+
negativeBalanceTitle: string;
|
|
260
|
+
newBalance: string;
|
|
261
|
+
};
|
|
262
|
+
errors: {
|
|
263
|
+
balanceUnknown: string;
|
|
264
|
+
unableToFindBalance: string;
|
|
265
|
+
};
|
|
266
|
+
currentBalance: string;
|
|
182
267
|
maximumBalanceAmount: string;
|
|
183
268
|
};
|
|
269
|
+
"list-carriers": {
|
|
270
|
+
headers: {
|
|
271
|
+
accountCarriers: string;
|
|
272
|
+
carriers: string;
|
|
273
|
+
settings: string;
|
|
274
|
+
};
|
|
275
|
+
actions: {
|
|
276
|
+
status: {
|
|
277
|
+
connected: string;
|
|
278
|
+
notConnected: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
};
|
|
184
282
|
common: {
|
|
185
283
|
actions: {
|
|
186
284
|
add: string;
|
|
187
285
|
cancel: string;
|
|
286
|
+
close: string;
|
|
287
|
+
confirm: string;
|
|
188
288
|
continue: string;
|
|
189
289
|
delete: string;
|
|
190
290
|
edit: string;
|
|
@@ -195,6 +295,7 @@ declare const _default: {
|
|
|
195
295
|
save: string;
|
|
196
296
|
skipForNow: string;
|
|
197
297
|
submit: string;
|
|
298
|
+
tryAgain: string;
|
|
198
299
|
};
|
|
199
300
|
address: {
|
|
200
301
|
fields: {
|
|
@@ -208,6 +309,7 @@ declare const _default: {
|
|
|
208
309
|
postalCode: string;
|
|
209
310
|
phone: string;
|
|
210
311
|
email: string;
|
|
312
|
+
addressResidentialIndicator: string;
|
|
211
313
|
};
|
|
212
314
|
subFields: {
|
|
213
315
|
optional: string;
|
|
@@ -234,6 +336,7 @@ declare const _default: {
|
|
|
234
336
|
};
|
|
235
337
|
billing: {
|
|
236
338
|
fields: {
|
|
339
|
+
differentBillingAddress: string;
|
|
237
340
|
name: string;
|
|
238
341
|
cardNumber: string;
|
|
239
342
|
expirationMonth: string;
|
|
@@ -245,6 +348,10 @@ declare const _default: {
|
|
|
245
348
|
fields: {
|
|
246
349
|
agreement: string;
|
|
247
350
|
};
|
|
351
|
+
terms: {
|
|
352
|
+
agreeToTerms: string;
|
|
353
|
+
title: string;
|
|
354
|
+
};
|
|
248
355
|
};
|
|
249
356
|
charsetWarnings: {
|
|
250
357
|
name: {
|
|
@@ -297,12 +404,14 @@ declare const _default: {
|
|
|
297
404
|
invalidNameOrCompany: string;
|
|
298
405
|
noWarehouses: string;
|
|
299
406
|
unableToLoad: {
|
|
407
|
+
carrier: string;
|
|
300
408
|
carriers: string;
|
|
301
409
|
salesOrder: string;
|
|
302
410
|
shipment: string;
|
|
303
411
|
warehouses: string;
|
|
304
412
|
};
|
|
305
413
|
unknown: string;
|
|
414
|
+
noRatesAvailable: string;
|
|
306
415
|
};
|
|
307
416
|
errorTypes: {
|
|
308
417
|
accountStatus: string;
|
|
@@ -322,6 +431,7 @@ declare const _default: {
|
|
|
322
431
|
thirdParty: string;
|
|
323
432
|
};
|
|
324
433
|
loading: {
|
|
434
|
+
carrier: string;
|
|
325
435
|
carriers: string;
|
|
326
436
|
data: string;
|
|
327
437
|
importingSalesOrder: string;
|
|
@@ -350,13 +460,18 @@ declare const _default: {
|
|
|
350
460
|
packageCodes: {
|
|
351
461
|
package: string;
|
|
352
462
|
};
|
|
463
|
+
schema: {
|
|
464
|
+
optionalLabel: string;
|
|
465
|
+
};
|
|
353
466
|
schemaErrors: {
|
|
354
467
|
notAValidPhoneNumber: string;
|
|
468
|
+
mustAgreeToTerms: string;
|
|
355
469
|
group: {
|
|
356
470
|
allMeasurementsOrNone: string;
|
|
357
471
|
};
|
|
358
472
|
invalidAddressName: string;
|
|
359
473
|
invalidAddressPoBox: string;
|
|
474
|
+
invalidCreditCardType: string;
|
|
360
475
|
invalidPostalCode: string;
|
|
361
476
|
invalidStateProvince: string;
|
|
362
477
|
invalidString: string;
|
|
@@ -388,6 +503,7 @@ declare const _default: {
|
|
|
388
503
|
"VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkNTAuCg==": string;
|
|
389
504
|
QSBzaGlwcGluZyBjYXJyaWVyIGVycm9yIG9jY3VycmVkOiBJbnN1ZmZpY2llbnQgYWNjb3VudCBiYWxhbmNlLiBBY2NvdW50IGV4Y2VwdGlvbiBFeGNlcHRpb24gd2l0aCBjb2RlIDB4MDA1NjAxMDE7IG1vZHVsZSA4NiwgY2F0ZWdvcnkgMSwgaXRlbSAx: string;
|
|
390
505
|
"QWRkcmVzcyBub3QgZm91bmQ=": string;
|
|
506
|
+
QSBzaGlwcGluZyBjYXJyaWVyIGVycm9yIG9jY3VycmVkOiBVUFMgd2VpZ2h0IGxpbWl0IHBlciBwYWNrYWdlIGlzIDE1MCBsYnMu: string;
|
|
391
507
|
};
|
|
392
508
|
};
|
|
393
509
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const worker: false | import("msw").SetupWorkerApi;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepPartial } from "fishery";
|
|
2
|
+
import { SE } from "@shipengine/api";
|
|
3
|
+
export type CreateCarrierHandlersParams = {
|
|
4
|
+
get?: DeepPartial<SE.Carrier>;
|
|
5
|
+
list?: [count: number, listParams?: DeepPartial<SE.Carrier>];
|
|
6
|
+
};
|
|
7
|
+
export declare const createCarrierHandlers: (params?: CreateCarrierHandlersParams) => {
|
|
8
|
+
database: {
|
|
9
|
+
balanceAmount: number;
|
|
10
|
+
};
|
|
11
|
+
handlers: import("msw").RestHandler<import("msw/lib/glossary-de6278a9").M<import("msw/lib/glossary-de6278a9").h>>[];
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./handlers";
|
package/mocks/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const warehouseHandlers: import("msw").RestHandler<import("msw/lib/glossary-de6278a9").M<import("msw/lib/glossary-de6278a9").h>>[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./handlers";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipengine/elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"typedoc": {
|
|
5
5
|
"entryPoint": "./src/index.ts",
|
|
6
6
|
"readmeFile": "../../README.md",
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"react-i18next": "*",
|
|
12
12
|
"i18next": "*"
|
|
13
13
|
},
|
|
14
|
+
"msw": {
|
|
15
|
+
"workerDirectory": "public"
|
|
16
|
+
},
|
|
14
17
|
"module": "./index.js",
|
|
15
18
|
"main": "./index.cjs",
|
|
16
19
|
"type": "module",
|
|
@@ -19,21 +22,21 @@
|
|
|
19
22
|
"react": "^18.2.0",
|
|
20
23
|
"@emotion/react": "^11.10.0",
|
|
21
24
|
"@packlink/brands": "^3.18.0",
|
|
22
|
-
"@shipengine/react": "0.15.0",
|
|
23
25
|
"react-hook-form": "^7.31.2",
|
|
26
|
+
"@shipengine/api": "0.16.1",
|
|
27
|
+
"@shipengine/react": "0.16.1",
|
|
28
|
+
"zod": "^3.17.3",
|
|
24
29
|
"@emotion/css": "^11.10.5",
|
|
25
30
|
"humps": "^2.0.1",
|
|
26
31
|
"react-datepicker": "^4.8.0",
|
|
27
|
-
"
|
|
28
|
-
"zod": "^3.17.3",
|
|
32
|
+
"react-query": "^3.39.3",
|
|
29
33
|
"react-dom": "^18.2.0",
|
|
30
34
|
"libphonenumber-js": "^1.10.14",
|
|
31
|
-
"card-validator": "^8.1.1",
|
|
32
|
-
"js-base64": "^3.7.2",
|
|
33
35
|
"@faker-js/faker": "^7.3.0",
|
|
36
|
+
"js-base64": "^3.7.2",
|
|
37
|
+
"card-validator": "^8.1.1",
|
|
34
38
|
"i18next-browser-languagedetector": "^6.1.4",
|
|
35
39
|
"stylis": "^4.1.2",
|
|
36
|
-
"swr": "^2.0.0-beta.5",
|
|
37
40
|
"axios": "^0.26.1",
|
|
38
41
|
"@hookform/resolvers": "2.9.1"
|
|
39
42
|
}
|
package/register.d.ts
CHANGED
|
@@ -8,12 +8,9 @@ export interface ErrorFallbackProps {
|
|
|
8
8
|
* @see {@link registerElement}
|
|
9
9
|
*/
|
|
10
10
|
export declare const ErrorFallback: ({ error }: ErrorFallbackProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
-
type KeyWithStringValue<T> = string & keyof {
|
|
12
|
-
[K in keyof Required<T> as Required<T>[K] extends string ? K : never]: T[K] extends string ? T[K] : never;
|
|
13
|
-
};
|
|
14
11
|
type ExtendedElementProps<ElementProps> = ElementProps & Record<string, unknown>;
|
|
15
12
|
/**
|
|
16
13
|
* Registers element with all necessary providers and wrappers
|
|
17
14
|
*/
|
|
18
|
-
export declare const registerElement: <ElementProps>(name: string, Element: import("react").ComponentType<ElementProps>,
|
|
15
|
+
export declare const registerElement: <ElementProps>(name: string, Element: import("react").ComponentType<ElementProps>, rootId?: string) => (props: ExtendedElementProps<ElementProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
19
16
|
export {};
|
package/testing/index.d.ts
CHANGED
package/testing/render.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
1
|
export declare const renderWithProviders: (component: any) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
2
|
+
/**
|
|
3
|
+
* Wraps the test with all of the usual Shipengine / Giger / i18 / etc providers that a full, registered "Element" would have.
|
|
4
|
+
* This allows components to simulate usage in an Element via `decorators: [withAllProviders]`
|
|
5
|
+
**/
|
|
6
|
+
export declare const renderWithAllProviders: (component: any) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CarrierConnection, SE } from "@shipengine/api";
|
|
2
2
|
export type CarrierTerm = {
|
|
3
3
|
description: string;
|
|
4
4
|
name: string;
|
|
5
5
|
url: string;
|
|
6
6
|
};
|
|
7
|
+
export type CarrierTerms = {
|
|
8
|
+
content: string[];
|
|
9
|
+
links: CarrierTerm[];
|
|
10
|
+
title: string;
|
|
11
|
+
};
|
|
7
12
|
export type CarrierMetadata = {
|
|
8
|
-
carrierCode:
|
|
13
|
+
carrierCode: CarrierConnection["carrierCode"];
|
|
9
14
|
logo: string;
|
|
10
15
|
name: string;
|
|
11
|
-
optionalFields
|
|
12
|
-
requiredFields
|
|
16
|
+
optionalFields?: string[];
|
|
17
|
+
requiredFields?: string[];
|
|
13
18
|
shortname: string;
|
|
14
|
-
terms
|
|
19
|
+
terms?: CarrierTerms;
|
|
15
20
|
};
|
|
16
21
|
export type CarriersFeatures = {
|
|
17
22
|
enabledCarriers?: SE.Carrier["carrierCode"][];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SE } from "@shipengine/api";
|
|
2
2
|
export type ShippingPreset = {
|
|
3
3
|
confirmation?: SE.ConfirmationType;
|
|
4
4
|
dimensions?: SE.DimensionsWithUnit;
|
|
5
|
-
insuranceProvider?: SE.
|
|
5
|
+
insuranceProvider?: SE.InsuranceProviderType;
|
|
6
6
|
insuredValue?: SE.InsuranceAccount;
|
|
7
7
|
name: string;
|
|
8
8
|
packageCode?: string;
|
package/utilities/date.d.ts
CHANGED
|
@@ -17,8 +17,20 @@ export declare const mostRecent: (...dates: Date[]) => Date;
|
|
|
17
17
|
/**
|
|
18
18
|
* @category Utilities
|
|
19
19
|
*/
|
|
20
|
-
export declare const omitTime: (shipDate
|
|
20
|
+
export declare const omitTime: (shipDate?: string) => Date;
|
|
21
21
|
/**
|
|
22
22
|
* @category Utilities
|
|
23
23
|
*/
|
|
24
24
|
export declare const getExpirationYears: (yearsValid: number) => string[];
|
|
25
|
+
/**
|
|
26
|
+
* @category Utilities
|
|
27
|
+
*/
|
|
28
|
+
type HasCreationDate = {
|
|
29
|
+
createdAt: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const sortByCreationDate: (a: HasCreationDate, b: HasCreationDate, order?: "asc" | "desc") => number;
|
|
32
|
+
/**
|
|
33
|
+
* @category Utilities
|
|
34
|
+
*/
|
|
35
|
+
export declare const isNowOrInTheFuture: (shipDate?: string) => boolean;
|
|
36
|
+
export {};
|
package/utilities/money.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SE } from "@shipengine/api";
|
|
2
2
|
export declare const currencySymbol: Record<SE.Currency, string>;
|
|
3
3
|
export declare const formatMoney: (value: SE.Money, locale?: string) => string;
|
|
4
4
|
export declare const calculateTotal: (...values: SE.Money[]) => number;
|
|
5
|
+
export declare const formatCreditCardNumber: (cc: string) => string;
|
package/utilities/rates.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SE } from "@shipengine/api";
|
|
2
2
|
export declare const getRateRequiresAcknowledgement: (serviceCode: string) => boolean;
|
|
3
|
-
export declare const getTotalRateAmount: (rateCosts
|
|
3
|
+
export declare const getTotalRateAmount: (rateCosts?: {
|
|
4
4
|
confirmationAmount?: SE.Money;
|
|
5
5
|
insuranceAmount?: SE.Money;
|
|
6
6
|
otherAmount?: SE.Money;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { CarrierAutoFunding } from "@shipengine/types";
|
|
2
|
-
import { AutoFundingFormPayload } from "./auto-funding-schema";
|
|
3
|
-
export type AutoFundingFormProps = {
|
|
4
|
-
defaultValues: CarrierAutoFunding;
|
|
5
|
-
errorMessage?: string;
|
|
6
|
-
hasError: boolean;
|
|
7
|
-
isLoading: boolean;
|
|
8
|
-
onSubmit: (payload: AutoFundingFormPayload) => Promise<void> | void;
|
|
9
|
-
onToggle: (enabled: boolean) => Promise<void> | void;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* This form that allows users to enable or disable auto funding, and
|
|
13
|
-
* configure auto funding settings in ShipEngine API.
|
|
14
|
-
*/
|
|
15
|
-
export declare const AutoFundingForm: ({ defaultValues, errorMessage, hasError, isLoading, onSubmit, onToggle, }: AutoFundingFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./auto-funding-form";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ManualFundingFormPayload } from "./manual-funding-schema";
|
|
3
|
-
export type ManualFundingFormProps<T = undefined> = {
|
|
4
|
-
currentBalance: number;
|
|
5
|
-
errorMessage?: string;
|
|
6
|
-
hasError: boolean;
|
|
7
|
-
isLoading: boolean;
|
|
8
|
-
onSubmit: (payload: ManualFundingFormPayload) => Promise<void> | void;
|
|
9
|
-
requiredAmount?: number;
|
|
10
|
-
} & ({
|
|
11
|
-
formId: string;
|
|
12
|
-
portalRef: React.RefObject<T>;
|
|
13
|
-
} | {
|
|
14
|
-
formId?: string;
|
|
15
|
-
portalRef?: never;
|
|
16
|
-
});
|
|
17
|
-
export declare const ManualFundingForm: <T extends Element>({ currentBalance, errorMessage, formId, hasError, isLoading, onSubmit, portalRef, requiredAmount, }: ManualFundingFormProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const manualFundingSchema: z.ZodObject<{
|
|
3
|
-
funds: z.ZodObject<z.extendShape<{
|
|
4
|
-
amount: z.ZodNumber;
|
|
5
|
-
currency: z.ZodNativeEnum<typeof import("dist/shipengine-types/src").Currency>;
|
|
6
|
-
}, {
|
|
7
|
-
amount: z.ZodNumber;
|
|
8
|
-
}>, "strip", z.ZodTypeAny, {
|
|
9
|
-
amount: number;
|
|
10
|
-
currency: import("dist/shipengine-types/src").Currency;
|
|
11
|
-
}, {
|
|
12
|
-
amount: number;
|
|
13
|
-
currency: import("dist/shipengine-types/src").Currency;
|
|
14
|
-
}>;
|
|
15
|
-
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
funds: {
|
|
17
|
-
amount: number;
|
|
18
|
-
currency: import("dist/shipengine-types/src").Currency;
|
|
19
|
-
};
|
|
20
|
-
}, {
|
|
21
|
-
funds: {
|
|
22
|
-
amount: number;
|
|
23
|
-
currency: import("dist/shipengine-types/src").Currency;
|
|
24
|
-
};
|
|
25
|
-
}>;
|
|
26
|
-
export type ManualFundingFormFields = z.input<typeof manualFundingSchema>;
|
|
27
|
-
export type ManualFundingFormPayload = z.output<typeof manualFundingSchema>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './add-carriers';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const agreementFormSchema: z.ZodObject<{
|
|
3
|
-
agreement: z.ZodLiteral<boolean>;
|
|
4
|
-
}, "strip", z.ZodTypeAny, {
|
|
5
|
-
agreement: boolean;
|
|
6
|
-
}, {
|
|
7
|
-
agreement: boolean;
|
|
8
|
-
}>;
|
|
9
|
-
export type AgreementFormFields = z.input<typeof agreementFormSchema>;
|
|
10
|
-
export type AgreementFormPayload = z.output<typeof agreementFormSchema>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import { AgreementFormPayload } from "./agreement-form-schema";
|
|
3
|
-
export type AgreementFormProps = {
|
|
4
|
-
checkboxLabel: ReactNode;
|
|
5
|
-
onAgree: (values: AgreementFormPayload) => Promise<void>;
|
|
6
|
-
onSkip?: () => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const AgreementForm: ({ checkboxLabel, onAgree, onSkip }: AgreementFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getAgreementStyles: () => import("@emotion/utils").SerializedStyles;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./agreement-form";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
2
|
-
import { BillingFormProps } from "./billing-form";
|
|
3
|
-
declare const _default: ComponentMeta<({ onSkip, onSubmit }: BillingFormProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const Default: ComponentStory<({ onSkip, onSubmit }: BillingFormProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|
|
6
|
-
export declare const WithLabels: ComponentStory<({ onSkip, onSubmit }: BillingFormProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as SE from "@shipengine/types";
|
|
2
|
-
import { BillingFormPayload } from "./billing-schema";
|
|
3
|
-
export type BillingFormProps = {
|
|
4
|
-
address?: SE.Address;
|
|
5
|
-
onCancel?: () => void;
|
|
6
|
-
onSkip: () => void;
|
|
7
|
-
onSubmit: (billingPayload: BillingFormPayload) => void;
|
|
8
|
-
};
|
|
9
|
-
export declare const BillingForm: ({ onSkip, onSubmit }: BillingFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CarrierAutoFunding } from "@shipengine/types";
|
|
2
|
-
import { ManualFundingFormPayload } from "../../organisms/manual-funding-form/manual-funding-schema";
|
|
3
|
-
export type FundingMethodsProps = {
|
|
4
|
-
addFundsErrorMessage?: string;
|
|
5
|
-
autoFundingData: CarrierAutoFunding;
|
|
6
|
-
autoFundingErrorMessage?: string;
|
|
7
|
-
hasAutoFundingError: boolean;
|
|
8
|
-
hasManualFundingError: boolean;
|
|
9
|
-
isAutoFundingLoading: boolean;
|
|
10
|
-
isManualFundingLoading: boolean;
|
|
11
|
-
manualFundingCurrentBalance: number;
|
|
12
|
-
manualFundingRequiredAmount?: number;
|
|
13
|
-
onSubmitAutoFunding: (payload: CarrierAutoFunding) => Promise<void> | void;
|
|
14
|
-
onSubmitManualFunding: (payload: ManualFundingFormPayload) => Promise<void> | void;
|
|
15
|
-
onToggleAutoFunding: (enabled: boolean) => Promise<void> | void;
|
|
16
|
-
};
|
|
17
|
-
export declare const FundingMethods: ({ addFundsErrorMessage, autoFundingData, autoFundingErrorMessage, hasAutoFundingError, hasManualFundingError, isAutoFundingLoading, isManualFundingLoading, manualFundingCurrentBalance, manualFundingRequiredAmount, onSubmitAutoFunding, onSubmitManualFunding, onToggleAutoFunding, }: FundingMethodsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./funding-methods";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./register-wallet";
|