@shipengine/elements 0.15.0 → 0.16.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 (176) hide show
  1. package/components/field/create-field-controller.d.ts +3 -1
  2. package/components/field/credit-card-input/credit-card-input.d.ts +3 -0
  3. package/components/field/credit-card-input/index.d.ts +1 -0
  4. package/components/field/fields.d.ts +1 -0
  5. package/components/field/money-input/hooks/use-utils.d.ts +1 -1
  6. package/components/field/money-input/money-input.d.ts +1 -1
  7. package/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +1 -1
  8. package/components/form-portal/form-portal.d.ts +18 -0
  9. package/components/form-portal/index.d.ts +1 -0
  10. package/components/index.d.ts +1 -0
  11. package/components/items-breakdown/items-breakdown.d.ts +1 -1
  12. package/components/organisms/auto-funding-form/auto-funding-form.d.ts +4 -3
  13. package/components/organisms/auto-funding-form/auto-funding-form.styles.d.ts +1 -0
  14. package/components/organisms/auto-funding-form/auto-funding-schema.d.ts +10 -10
  15. package/components/organisms/manual-funding-form/manual-funding-form.d.ts +3 -2
  16. package/components/organisms/manual-funding-form/manual-funding-schema.d.ts +5 -5
  17. package/components/portal/portal.d.ts +1 -1
  18. package/components/settings-card/settings-card.d.ts +6 -1
  19. package/components/settings-card/settings-card.styles.d.ts +1 -6
  20. package/components/templates/{billing-form/billing-schema.d.ts → add-carrier-form/add-carrier-form-schema.d.ts} +38 -109
  21. package/components/templates/add-carrier-form/add-carrier-form-test.d.ts +1 -0
  22. package/components/templates/add-carrier-form/add-carrier-form.d.ts +10 -0
  23. package/components/templates/add-carrier-form/index.d.ts +2 -0
  24. package/components/templates/address-display/address-display.d.ts +1 -1
  25. package/components/templates/address-form/address-fields.d.ts +2 -1
  26. package/components/templates/address-form/address-form-schema.d.ts +0 -9
  27. package/components/templates/address-form/address-form.d.ts +2 -2
  28. package/components/templates/address-form/address-schema.d.ts +2 -3
  29. package/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
  30. package/components/templates/carrier-recovery-form/carrier-recovery-form-schema.d.ts +238 -0
  31. package/components/templates/carrier-recovery-form/carrier-recovery-form.d.ts +10 -0
  32. package/components/templates/carrier-recovery-form/carrier-recovery-form.styles.d.ts +1 -0
  33. package/components/templates/carrier-recovery-form/index.d.ts +2 -0
  34. package/components/templates/carrier-terms-form/carrier-terms-form-schema.d.ts +10 -0
  35. package/components/templates/carrier-terms-form/carrier-terms-form.d.ts +6 -0
  36. package/components/templates/carrier-terms-form/carrier-terms-form.styles.d.ts +1 -0
  37. package/components/templates/carrier-terms-form/index.d.ts +1 -0
  38. package/components/templates/customs-item-form/customs-item-form-schema.d.ts +112 -12
  39. package/components/templates/customs-item-form/customs-item-form.d.ts +3 -2
  40. package/components/templates/customs-items-display/customs-items-display.d.ts +1 -1
  41. package/components/templates/display-carrier-terms/display-carrier-terms.d.ts +6 -0
  42. package/components/templates/display-carrier-terms/index.d.ts +1 -0
  43. package/components/templates/edit-billing-form/edit-billing-form.d.ts +6 -0
  44. package/components/templates/edit-billing-form/edit-billing-form.styles.d.ts +1 -0
  45. package/components/templates/edit-billing-form/index.d.ts +1 -0
  46. package/components/templates/funding-methods/funding-methods.d.ts +6 -5
  47. package/components/templates/funding-methods/funding-methods.styles.d.ts +1 -0
  48. package/components/templates/index.d.ts +8 -3
  49. package/components/templates/label/label.d.ts +2 -2
  50. package/components/templates/landing-page/index.d.ts +1 -0
  51. package/components/templates/landing-page/landing-page-form-schema.d.ts +10 -0
  52. package/components/templates/landing-page/landing-page-form.d.ts +4 -0
  53. package/components/templates/landing-page/landing-page.d.ts +4 -0
  54. package/components/templates/landing-page/landing-page.styles.d.ts +1 -0
  55. package/components/templates/list-carriers/index.d.ts +1 -0
  56. package/components/templates/list-carriers/list-carriers.d.ts +9 -0
  57. package/components/templates/list-carriers/list-carriers.styles.d.ts +1 -0
  58. package/components/templates/list-carriers-row/index.d.ts +1 -0
  59. package/components/templates/list-carriers-row/list-carriers-row.d.ts +9 -0
  60. package/components/templates/list-carriers-row/list-carriers-row.styles.d.ts +1 -0
  61. package/components/templates/manage-wallet/index.d.ts +1 -0
  62. package/components/templates/manage-wallet/manage-wallet.d.ts +1 -0
  63. package/components/templates/manage-wallet/manage-wallet.styles.d.ts +1 -0
  64. package/components/templates/manage-warehouses/manage-warehouses.d.ts +7 -2
  65. package/components/templates/onboarding/index.d.ts +1 -0
  66. package/components/templates/onboarding/onboarding.d.ts +18 -0
  67. package/components/templates/onboarding/onboarding.styles.d.ts +1 -0
  68. package/components/templates/rate-form/rate-form.d.ts +2 -2
  69. package/components/templates/sales-order/sales-order.d.ts +1 -1
  70. package/components/templates/shipment/shipment.d.ts +1 -1
  71. package/components/templates/shipment-form/shipment-form.d.ts +3 -3
  72. package/components/templates/shipment-form/shipment-schema.d.ts +11 -11
  73. package/components/templates/void-label/void-label.d.ts +1 -1
  74. package/components/templates/wallet-card/index.d.ts +1 -0
  75. package/components/templates/wallet-card/wallet-card.d.ts +4 -0
  76. package/components/templates/wallet-card/wallet-card.styles.d.ts +1 -0
  77. package/components/templates/wallet-form/billing-fields.d.ts +6 -0
  78. package/components/templates/wallet-form/edit-wallet-address-form.d.ts +16 -0
  79. package/components/templates/wallet-form/index.d.ts +4 -0
  80. package/components/templates/wallet-form/wallet-form.d.ts +11 -0
  81. package/components/templates/wallet-form/wallet-form.styles.d.ts +1 -0
  82. package/components/templates/wallet-form/wallet-schema.d.ts +269 -0
  83. package/components/templates/warehouse-display/warehouse-display.d.ts +1 -1
  84. package/components/templates/warehouse-form/index.d.ts +1 -0
  85. package/components/templates/warehouse-form/warehouse-form-schema.d.ts +503 -0
  86. package/components/templates/warehouse-form/warehouse-form.d.ts +10 -0
  87. package/components/templates/warehouse-form/warehouse-form.styles.d.ts +1 -0
  88. package/constants/shipengine/address.d.ts +4 -0
  89. package/elements/components/configure-shipment/configure-shipment.d.ts +1 -1
  90. package/elements/components/configure-shipment/hooks/use-address.d.ts +3 -3
  91. package/elements/components/configure-shipment/hooks/use-customs.d.ts +3 -3
  92. package/elements/components/configure-shipment/hooks/use-presets.d.ts +2 -2
  93. package/elements/components/configure-shipment/hooks/use-rates-form.d.ts +1 -1
  94. package/elements/components/configure-shipment/hooks/use-request-rates.d.ts +2 -2
  95. package/elements/components/configure-shipment/hooks/use-shipment-form.d.ts +6 -6
  96. package/elements/components/index.d.ts +2 -2
  97. package/elements/components/list-carriers/hooks/use-list-connected-carriers.d.ts +11 -0
  98. package/elements/components/list-carriers/index.d.ts +1 -0
  99. package/elements/components/list-carriers/list-carriers.d.ts +1 -0
  100. package/elements/components/manage-funding/manage-funding.d.ts +6 -2
  101. package/elements/components/onboarding/index.d.ts +1 -0
  102. package/elements/components/onboarding/onboarding.d.ts +4 -0
  103. package/elements/components/sales-order/hooks/use-configure-shipment.d.ts +3 -1
  104. package/elements/components/sales-order/hooks/use-import-sales-order.d.ts +2 -2
  105. package/elements/components/sales-order/hooks/use-pending-shipment.d.ts +1 -1
  106. package/elements/components/sales-order/sales-order.d.ts +1 -1
  107. package/elements/components/shipment/shipment.d.ts +1 -1
  108. package/elements/components/void-label/void-label.d.ts +1 -1
  109. package/elements/index.d.ts +2 -2
  110. package/elements/list-carriers.d.ts +1 -0
  111. package/elements/manage-funding.d.ts +1 -1
  112. package/elements/onboarding.d.ts +1 -0
  113. package/factories/shipengine/address.d.ts +1 -1
  114. package/factories/shipengine/carrier.d.ts +1 -1
  115. package/factories/shipengine/label.d.ts +1 -1
  116. package/factories/shipengine/money.d.ts +1 -1
  117. package/factories/shipengine/order-source.d.ts +10 -2
  118. package/factories/shipengine/package.d.ts +2 -2
  119. package/factories/shipengine/resource.d.ts +1 -1
  120. package/factories/shipengine/sales-order.d.ts +1 -1
  121. package/factories/shipengine/service.d.ts +2 -2
  122. package/factories/shipengine/shipment.d.ts +4 -4
  123. package/factories/shipengine/warehouse.d.ts +1 -1
  124. package/factories/shipengine/weight.d.ts +1 -1
  125. package/hooks/index.d.ts +1 -0
  126. package/hooks/options/use-confirmation-options.d.ts +1 -1
  127. package/hooks/options/use-customs-contents-options.d.ts +1 -1
  128. package/hooks/options/use-customs-non-delivery-options.d.ts +1 -1
  129. package/hooks/options/use-insurance-provider-options.d.ts +2 -2
  130. package/hooks/options/use-package-options.d.ts +2 -2
  131. package/hooks/options/use-rate-options.d.ts +1 -1
  132. package/hooks/options/use-service-code-options.d.ts +1 -1
  133. package/hooks/options/use-warehouse-options.d.ts +1 -1
  134. package/hooks/use-carrier-metadata.d.ts +2 -5
  135. package/hooks/use-toggle.d.ts +12 -0
  136. package/index.cjs +19246 -17173
  137. package/index.js +19793 -17720
  138. package/locales/en/index.d.ts +105 -2
  139. package/mocks/browser.d.ts +1 -0
  140. package/mocks/carriers/handlers.d.ts +1 -0
  141. package/mocks/handlers.d.ts +12 -0
  142. package/package.json +8 -6
  143. package/register.d.ts +1 -4
  144. package/schemas/shipengine/index.d.ts +0 -1
  145. package/schemas/shipengine/money.d.ts +1 -1
  146. package/testing/index.d.ts +0 -1
  147. package/types/carrier-metadata.d.ts +10 -5
  148. package/types/shipping-preset/shipping-preset.d.ts +2 -2
  149. package/utilities/date.d.ts +13 -1
  150. package/utilities/money.d.ts +2 -1
  151. package/utilities/rates.d.ts +1 -1
  152. package/utilities/shipengine/address.d.ts +1 -1
  153. package/utilities/shipengine/dimensions.d.ts +1 -1
  154. package/utilities/shipengine/sales-order.d.ts +1 -1
  155. package/utilities/shipengine/shipment.d.ts +1 -1
  156. package/utilities/shipengine/weight.d.ts +1 -1
  157. package/components/templates/add-carriers/add-carriers.d.ts +0 -5
  158. package/components/templates/add-carriers/index.d.ts +0 -1
  159. package/components/templates/agreement-form/agreement-form-schema.d.ts +0 -10
  160. package/components/templates/agreement-form/agreement-form.d.ts +0 -8
  161. package/components/templates/agreement-form/agreement-form.styles.d.ts +0 -1
  162. package/components/templates/agreement-form/index.d.ts +0 -1
  163. package/components/templates/billing-form/billing-form-stories.d.ts +0 -6
  164. package/components/templates/billing-form/billing-form.d.ts +0 -9
  165. package/components/templates/billing-form/index.d.ts +0 -2
  166. package/components/templates/register-wallet/index.d.ts +0 -1
  167. package/components/templates/register-wallet/register-wallet.d.ts +0 -3
  168. package/components/templates/register-wallet/register-wallet.styles.d.ts +0 -6
  169. package/elements/add-carriers.d.ts +0 -1
  170. package/elements/components/add-carriers/add-carriers.d.ts +0 -8
  171. package/elements/components/add-carriers/index.d.ts +0 -1
  172. package/elements/components/register-wallet/index.d.ts +0 -1
  173. package/elements/components/register-wallet/register-wallet.d.ts +0 -9
  174. package/elements/register-wallet.d.ts +0 -1
  175. package/schemas/shipengine/address.d.ts +0 -17
  176. package/testing/swr.d.ts +0 -15
@@ -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
- subTitle: string;
56
+ subtitle: string;
58
57
  descriptionTitle: string;
59
58
  description: string;
60
59
  };
@@ -62,9 +61,43 @@ 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
+ };
87
+ };
88
+ };
89
+ settings: {
90
+ title: string;
91
+ billing: {
92
+ title: string;
93
+ subtitle: string;
65
94
  };
66
95
  };
67
96
  };
97
+ "register-carrier": {
98
+ formTitle: string;
99
+ agreeToTerms: string;
100
+ };
68
101
  "purchase-label": {
69
102
  actions: {
70
103
  calculateRates_one: string;
@@ -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": {
224
+ actions: {
225
+ addNow: string;
226
+ saveRule: string;
227
+ other: string;
228
+ };
157
229
  addFunds: string;
158
230
  autoFunding: {
231
+ addFundsAutomatically: string;
159
232
  error: {
160
233
  title: string;
161
234
  message: string;
@@ -166,6 +239,7 @@ declare const _default: {
166
239
  maximumPurchasesPerDay: string;
167
240
  purchaseAmount: string;
168
241
  };
242
+ currentBalance: string;
169
243
  otp: {
170
244
  error: {
171
245
  title: string;
@@ -181,10 +255,25 @@ declare const _default: {
181
255
  };
182
256
  maximumBalanceAmount: string;
183
257
  };
258
+ "list-carriers": {
259
+ headers: {
260
+ accountCarriers: string;
261
+ carriers: string;
262
+ settings: string;
263
+ };
264
+ actions: {
265
+ status: {
266
+ connected: string;
267
+ notConnected: string;
268
+ };
269
+ };
270
+ };
184
271
  common: {
185
272
  actions: {
186
273
  add: string;
187
274
  cancel: string;
275
+ close: string;
276
+ confirm: string;
188
277
  continue: string;
189
278
  delete: string;
190
279
  edit: string;
@@ -195,6 +284,7 @@ declare const _default: {
195
284
  save: string;
196
285
  skipForNow: string;
197
286
  submit: string;
287
+ tryAgain: string;
198
288
  };
199
289
  address: {
200
290
  fields: {
@@ -208,6 +298,7 @@ declare const _default: {
208
298
  postalCode: string;
209
299
  phone: string;
210
300
  email: string;
301
+ addressResidentialIndicator: string;
211
302
  };
212
303
  subFields: {
213
304
  optional: string;
@@ -234,6 +325,7 @@ declare const _default: {
234
325
  };
235
326
  billing: {
236
327
  fields: {
328
+ differentBillingAddress: string;
237
329
  name: string;
238
330
  cardNumber: string;
239
331
  expirationMonth: string;
@@ -245,6 +337,10 @@ declare const _default: {
245
337
  fields: {
246
338
  agreement: string;
247
339
  };
340
+ terms: {
341
+ agreeToTerms: string;
342
+ title: string;
343
+ };
248
344
  };
249
345
  charsetWarnings: {
250
346
  name: {
@@ -303,6 +399,7 @@ declare const _default: {
303
399
  warehouses: string;
304
400
  };
305
401
  unknown: string;
402
+ noRatesAvailable: string;
306
403
  };
307
404
  errorTypes: {
308
405
  accountStatus: string;
@@ -350,13 +447,18 @@ declare const _default: {
350
447
  packageCodes: {
351
448
  package: string;
352
449
  };
450
+ schema: {
451
+ optionalLabel: string;
452
+ };
353
453
  schemaErrors: {
354
454
  notAValidPhoneNumber: string;
455
+ mustAgreeToTerms: string;
355
456
  group: {
356
457
  allMeasurementsOrNone: string;
357
458
  };
358
459
  invalidAddressName: string;
359
460
  invalidAddressPoBox: string;
461
+ invalidCreditCardType: string;
360
462
  invalidPostalCode: string;
361
463
  invalidStateProvince: string;
362
464
  invalidString: string;
@@ -388,6 +490,7 @@ declare const _default: {
388
490
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkNTAuCg==": string;
389
491
  QSBzaGlwcGluZyBjYXJyaWVyIGVycm9yIG9jY3VycmVkOiBJbnN1ZmZpY2llbnQgYWNjb3VudCBiYWxhbmNlLiBBY2NvdW50IGV4Y2VwdGlvbiBFeGNlcHRpb24gd2l0aCBjb2RlIDB4MDA1NjAxMDE7IG1vZHVsZSA4NiwgY2F0ZWdvcnkgMSwgaXRlbSAx: string;
390
492
  "QWRkcmVzcyBub3QgZm91bmQ=": string;
493
+ QSBzaGlwcGluZyBjYXJyaWVyIGVycm9yIG9jY3VycmVkOiBVUFMgd2VpZ2h0IGxpbWl0IHBlciBwYWNrYWdlIGlzIDE1MCBsYnMu: string;
391
494
  };
392
495
  };
393
496
  export default _default;
@@ -0,0 +1 @@
1
+ export declare const worker: false | import("msw").SetupWorkerApi;
@@ -0,0 +1 @@
1
+ export declare const carrierHandlers: import("msw").RestHandler<import("msw/lib/glossary-de6278a9").M<import("msw/lib/glossary-de6278a9").h>>[];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * These are the global Storybook mock handlers; add your default handlers here.
3
+ *
4
+ * Any handler can be overridden at the story level via the story's `parameters.msw.handlers.yourHandler`.
5
+ *
6
+ * Please match the `libs/shipengine-api/src` folder structure (sorted by domain)
7
+ *
8
+ * https://storybook.js.org/addons/msw-storybook-addon
9
+ */
10
+ export declare const storybookHandlers: {
11
+ carriers: import("msw").RestHandler<import("msw/lib/glossary-de6278a9").M<import("msw/lib/glossary-de6278a9").h>>[];
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
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,20 @@
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",
25
+ "@shipengine/react": "0.16.0",
23
26
  "react-hook-form": "^7.31.2",
24
27
  "@emotion/css": "^11.10.5",
25
28
  "humps": "^2.0.1",
26
29
  "react-datepicker": "^4.8.0",
27
- "@shipengine/types": "0.15.0",
30
+ "@shipengine/api": "0.16.0",
28
31
  "zod": "^3.17.3",
29
32
  "react-dom": "^18.2.0",
30
33
  "libphonenumber-js": "^1.10.14",
31
- "card-validator": "^8.1.1",
32
- "js-base64": "^3.7.2",
33
34
  "@faker-js/faker": "^7.3.0",
35
+ "js-base64": "^3.7.2",
36
+ "card-validator": "^8.1.1",
34
37
  "i18next-browser-languagedetector": "^6.1.4",
35
38
  "stylis": "^4.1.2",
36
- "swr": "^2.0.0-beta.5",
37
39
  "axios": "^0.26.1",
38
40
  "@hookform/resolvers": "2.9.1"
39
41
  }
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>, invalidationKey?: KeyWithStringValue<ElementProps> | KeyWithStringValue<ElementProps>[] | undefined) => (props: ExtendedElementProps<ElementProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
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 {};
@@ -1,3 +1,2 @@
1
- export * from "./address";
2
1
  export * from "./money";
3
2
  export * from "./phone";
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import * as SE from "@shipengine/types";
2
+ import { SE } from "@shipengine/api";
3
3
  /**
4
4
  * @category Form Validation
5
5
  */
@@ -1,2 +1 @@
1
1
  export * from "./render";
2
- export * from "./swr";
@@ -1,17 +1,22 @@
1
- import * as SE from "@shipengine/types";
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: SE.Carrier["carrierCode"];
13
+ carrierCode: CarrierConnection["carrierCode"];
9
14
  logo: string;
10
15
  name: string;
11
- optionalFields: string[];
12
- requiredFields: string[];
16
+ optionalFields?: string[];
17
+ requiredFields?: string[];
13
18
  shortname: string;
14
- terms: Record<string, CarrierTerm[]> | Record<never, never>;
19
+ terms?: CarrierTerms;
15
20
  };
16
21
  export type CarriersFeatures = {
17
22
  enabledCarriers?: SE.Carrier["carrierCode"][];
@@ -1,8 +1,8 @@
1
- import * as SE from "@shipengine/types";
1
+ import { SE } from "@shipengine/api";
2
2
  export type ShippingPreset = {
3
3
  confirmation?: SE.ConfirmationType;
4
4
  dimensions?: SE.DimensionsWithUnit;
5
- insuranceProvider?: SE.InsuranceProvider;
5
+ insuranceProvider?: SE.InsuranceProviderType;
6
6
  insuredValue?: SE.InsuranceAccount;
7
7
  name: string;
8
8
  packageCode?: string;
@@ -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: string) => Date;
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 {};
@@ -1,4 +1,5 @@
1
- import * as SE from "@shipengine/types";
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;
@@ -1,4 +1,4 @@
1
- import * as SE from "@shipengine/types";
1
+ import { SE } from "@shipengine/api";
2
2
  export declare const getRateRequiresAcknowledgement: (serviceCode: string) => boolean;
3
3
  export declare const getTotalRateAmount: (rateCosts: {
4
4
  confirmationAmount?: SE.Money;
@@ -1,4 +1,4 @@
1
- import * as SE from "@shipengine/types";
1
+ import { SE } from "@shipengine/api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,4 +1,4 @@
1
- import * as SE from "@shipengine/types";
1
+ import { SE } from "@shipengine/api";
2
2
  type ConvertDimensionsOptions = {
3
3
  allowAllZeroes?: boolean;
4
4
  };
@@ -1,4 +1,4 @@
1
- import * as SE from "@shipengine/types";
1
+ import { SE } from "@shipengine/api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,4 +1,4 @@
1
- import * as SE from "@shipengine/types";
1
+ import { SE } from "@shipengine/api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,4 +1,4 @@
1
- import * as SE from "@shipengine/types";
1
+ import { SE } from "@shipengine/api";
2
2
  /**
3
3
  * @category Utilities
4
4
  */
@@ -1,5 +0,0 @@
1
- import { CarriersFeatures } from "../../../types";
2
- export type AddCarriersProps = {
3
- features?: CarriersFeatures;
4
- };
5
- export declare const AddCarriers: ({ features }: AddCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -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,2 +0,0 @@
1
- export * from "./billing-form";
2
- export * from "./billing-form-styles";
@@ -1 +0,0 @@
1
- export * from "./register-wallet";
@@ -1,3 +0,0 @@
1
- export type RegisterWalletFeatures = {};
2
- export type RegisterWalletProps = {};
3
- export declare const RegisterWallet: ({}: RegisterWalletProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { Theme } from "@packlink/brands";
2
- export declare const getBillingFormStyles: (theme: Theme) => import("@emotion/utils").SerializedStyles;
3
- export declare const getHeadingStyles: (theme: Theme) => import("@emotion/utils").SerializedStyles;
4
- export declare const getRegisterWalletStyles: () => import("@emotion/utils").SerializedStyles;
5
- export declare const getStampsWalletTermsStyles: (theme: Theme) => import("@emotion/utils").SerializedStyles;
6
- export declare const getSubHeadingStyles: (theme: Theme) => import("@emotion/utils").SerializedStyles;
@@ -1 +0,0 @@
1
- export declare const Element: (props: import("./components").AddCarriersProps & Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,8 +0,0 @@
1
- import { CarriersFeatures } from "../../../types";
2
- export type AddCarriersFeatures = {
3
- carriers?: CarriersFeatures;
4
- };
5
- export type AddCarriersProps = {
6
- features?: AddCarriersFeatures;
7
- };
8
- export declare const AddCarriers: ({ features }: AddCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export * from './add-carriers';
@@ -1 +0,0 @@
1
- export * from "./register-wallet";
@@ -1,9 +0,0 @@
1
- import { Templates } from "../../../components";
2
- export type WalletFeatures = {
3
- wallet?: Templates.RegisterWalletFeatures;
4
- };
5
- export type RegisterWalletProps = {
6
- features: WalletFeatures;
7
- onRegisterWallet: () => void;
8
- };
9
- export declare const RegisterWallet: ({ features, onRegisterWallet }: RegisterWalletProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const Element: (props: import("./components").RegisterWalletProps & Record<string, unknown>) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,17 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * @category Form Validation
4
- */
5
- export declare const addressLine1Schema: z.ZodString;
6
- /**
7
- * @category Form Validation
8
- */
9
- export declare const addressLine1SchemaNoPoBox: z.ZodEffects<z.ZodString, string, string>;
10
- /**
11
- * @category Form Validation
12
- */
13
- export declare const addressLine2Schema: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
14
- /**
15
- * @category Form Validation
16
- */
17
- export declare const addressLine2SchemaNoPoBox: z.ZodEffects<z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>, string | undefined, string | null | undefined>;
package/testing/swr.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /// <reference types="jest" />
2
- export declare const buildSwrGetMock: (response: any) => {
3
- data: any;
4
- errors: undefined;
5
- isLoading: boolean;
6
- isValidating: boolean;
7
- mutate: () => Promise<any>;
8
- };
9
- export declare const buildSwrPostMock: (response: any) => {
10
- data: any;
11
- errors: undefined;
12
- isMutating: boolean;
13
- reset: jest.Mock<any, any>;
14
- trigger: () => Promise<any>;
15
- };