@shipengine/elements 1.8.0 → 1.9.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 (118) hide show
  1. package/address-8f8119f4.js +1 -0
  2. package/carrier-2abb4760.js +1 -0
  3. package/carrier-logo-1b6c767e.js +1 -0
  4. package/components.js +1 -0
  5. package/constants.js +1 -0
  6. package/elements.js +1 -0
  7. package/extensions.js +1 -0
  8. package/feature-flags-3e03717c.js +1 -0
  9. package/formatString-413ec7c7.js +1 -0
  10. package/hooks.js +1 -0
  11. package/index.js +1 -25578
  12. package/money-fbc4d0b3.js +1 -0
  13. package/package.json +47 -5
  14. package/payment-method-settings-element-595cc38d.js +1 -0
  15. package/phone-87dd7bd8.js +1 -0
  16. package/schemas.js +1 -0
  17. package/shipment-90d35708.js +1 -0
  18. package/src/components/address-preference-context/address-preference-context.d.ts +5 -2
  19. package/src/components/carrier-icon/carrier-icon.d.ts +9 -9
  20. package/src/components/carrier-logo/carrier-logo.d.ts +2 -1
  21. package/src/components/field/date-picker/date-picker.d.ts +1 -1
  22. package/src/components/field/rate-card/rate-card.d.ts +2 -1
  23. package/src/components/field/rate-card/rate-card.styles.d.ts +0 -1
  24. package/src/components/field/rate-select/rate-select.d.ts +6 -1
  25. package/src/components/fund-and-purchase/fund-and-purchase.d.ts +4 -1
  26. package/src/components/here-map/here-map.d.ts +16 -0
  27. package/src/components/here-map/here-map.styles.d.ts +23 -0
  28. package/src/components/index.d.ts +1 -0
  29. package/src/components/modal/modal.d.ts +2 -1
  30. package/src/components/rate-details/index.d.ts +1 -0
  31. package/src/components/rate-details/rate-details.d.ts +17 -0
  32. package/src/components/rate-details/rate-details.styles.d.ts +23 -0
  33. package/src/components/search-bar/index.d.ts +1 -0
  34. package/src/components/search-bar/search-bar.d.ts +8 -0
  35. package/src/components/service-point-display/operating-hours.d.ts +6 -0
  36. package/src/components/service-point-display/operating-hours.styles.d.ts +44 -0
  37. package/src/components/service-point-display/service-point-display.d.ts +6 -6
  38. package/src/components/service-point-display/service-point-display.styles.d.ts +13 -19
  39. package/src/components/service-points/service-points.d.ts +2 -1
  40. package/src/components/tabs/tabs.d.ts +5 -1
  41. package/src/components/tabs/tabs.styles.d.ts +3 -2
  42. package/src/components/templates/index.d.ts +1 -1
  43. package/src/components/templates/label/label.styles.d.ts +21 -1
  44. package/src/components/templates/product-form/product-form-schema.d.ts +12 -0
  45. package/src/components/templates/pudo-rate-tabs/index.d.ts +0 -1
  46. package/src/components/templates/pudo-rate-tabs/pudo-list-view/pudo-list-view.d.ts +5 -0
  47. package/src/components/templates/pudo-rate-tabs/pudo-map-view/pudo-map-view.d.ts +15 -0
  48. package/src/components/templates/pudo-rate-tabs/pudo-rate-tabs.d.ts +17 -15
  49. package/src/components/templates/rate-form/rate-form.d.ts +10 -2
  50. package/src/components/templates/register-funding-source-carrier-form/index.d.ts +2 -0
  51. package/src/components/templates/register-funding-source-carrier-form/register-funding-source-carrier-form.d.ts +13 -0
  52. package/src/components/templates/register-funding-source-carrier-form/register-funding-source-carrier-form.styles.d.ts +25 -0
  53. package/src/components/templates/{add-carrier-form/add-carrier-form-schema.d.ts → register-funding-source-carrier-form/register-funding-source-carrier-schema.d.ts} +42 -88
  54. package/src/components/templates/shipment/shipment.d.ts +2 -1
  55. package/src/elements/external-carriers/external-carriers.d.ts +74 -4
  56. package/src/elements/label-layout/label-layout-element.d.ts +49 -3
  57. package/src/elements/labels-grid/labels-grid.d.ts +49 -3
  58. package/src/elements/manage-funding/manage-funding-element.d.ts +49 -3
  59. package/src/elements/manage-warehouses/manage-warehouses.d.ts +49 -3
  60. package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +49 -3
  61. package/src/elements/purchase-label/configure-shipment.d.ts +2 -1
  62. package/src/elements/purchase-label/hooks/use-rates-form.d.ts +5 -0
  63. package/src/elements/purchase-label/purchase-label.d.ts +49 -3
  64. package/src/elements/shipengine-carriers/shipengine-carriers.d.ts +49 -3
  65. package/src/elements/shipments-grid/shipments-grid.d.ts +49 -3
  66. package/src/elements/theme-creator/theme-creator.d.ts +49 -3
  67. package/src/elements/theme-creator/themeData/themeData.d.ts +0 -1
  68. package/src/elements/unit-settings/unit-settings-element.d.ts +49 -3
  69. package/src/elements/vat-settings/vat-settings-element.d.ts +49 -3
  70. package/src/elements/view-shipment/view-shipment.d.ts +80 -27
  71. package/src/elements/void-label/components/actions/actions.d.ts +3 -3
  72. package/src/elements/void-label/void-label.d.ts +55 -4
  73. package/src/elements/wallet-history/wallet-history-element.d.ts +49 -3
  74. package/src/factories/shipengine/label.d.ts +2 -0
  75. package/src/features/external-carriers/external-carriers.d.ts +2 -1
  76. package/src/features/shipengine-carriers/hooks/index.d.ts +2 -1
  77. package/src/features/shipengine-carriers/hooks/use-carrier-metadata.d.ts +2 -13
  78. package/src/features/shipengine-carriers/hooks/{use-list-connected-carriers.d.ts → use-list-funding-source-carriers.d.ts} +3 -3
  79. package/src/features/shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.d.ts +9 -7
  80. package/src/hooks/here-map/init.d.ts +6 -0
  81. package/src/hooks/here-map/use-here-map-ui.d.ts +10 -0
  82. package/src/hooks/here-map/use-here-map.d.ts +5 -0
  83. package/src/hooks/options/use-service-points.d.ts +5 -3
  84. package/src/locales/en/index.d.ts +49 -3
  85. package/src/testing/test-utils.d.ts +1 -0
  86. package/src/types/carrier-metadata.d.ts +7 -11
  87. package/src/types/index.d.ts +0 -1
  88. package/src/utilities/date.d.ts +1 -2
  89. package/src/utilities/feature-flags.d.ts +2 -2
  90. package/src/utilities/shipengine/carrier.d.ts +8 -0
  91. package/src/workflows/account-settings/account-settings.d.ts +49 -3
  92. package/src/workflows/connect-carrier/connect-carrier.d.ts +49 -3
  93. package/src/workflows/manage-wallet-workflow/manage-wallet-workflow.d.ts +49 -3
  94. package/src/workflows/onboarding/components/carrier-recovery-form/carrier-recovery-form.d.ts +3 -4
  95. package/src/workflows/onboarding/components/funding-and-carrier-connection-step/use-funding-and-carrier-connection-step.d.ts +1 -2
  96. package/src/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.d.ts +1 -6
  97. package/src/workflows/onboarding/onboarding.d.ts +50 -4
  98. package/story-notes-ce2d8cca.js +1 -0
  99. package/suspend-text-c8c7b6b6.js +1 -0
  100. package/types.js +1 -0
  101. package/use-page-layout-93ffae78.js +1 -0
  102. package/use-scrub-errors-2c4db406.js +1 -0
  103. package/use-toggle-838d2ebd.js +1 -0
  104. package/utilities.js +1 -0
  105. package/validation-b941a548.js +1 -0
  106. package/wallet-form-3981400b.js +1 -0
  107. package/wallet-history-5b34c856.js +1 -0
  108. package/warehouse-form-c0b3ea78.js +34 -0
  109. package/warehouses-dfcdce23.js +1 -0
  110. package/workflows.js +1 -0
  111. package/zod-60def96c.js +1 -0
  112. package/index.cjs +0 -25795
  113. package/src/components/templates/add-carrier-form/add-carrier-form-test.d.ts +0 -1
  114. package/src/components/templates/add-carrier-form/add-carrier-form.d.ts +0 -10
  115. package/src/components/templates/add-carrier-form/index.d.ts +0 -2
  116. package/src/components/templates/pudo-rate-tabs/service-points-search-bar/index.d.ts +0 -1
  117. package/src/components/templates/pudo-rate-tabs/service-points-search-bar/service-points-search-bar.d.ts +0 -6
  118. package/src/types/patch.d.ts +0 -2
@@ -0,0 +1,10 @@
1
+ /// <reference types="heremaps" />
2
+ /// <reference types="react" />
3
+ export type MarkerData = {
4
+ coordinates: H.geo.IPoint;
5
+ data?: React.ReactNode;
6
+ icon: string | Element;
7
+ key?: string;
8
+ zIndex: number;
9
+ };
10
+ export declare const useHereMapUI: (defaultLayers: Record<string, any> | null, map: H.Map | null, mapOptions: H.Map.Options, markersRef: import("react").MutableRefObject<H.map.DomMarker[]>, showZoomControl: boolean, showMapSettingsControl: boolean, showScaleBarControl: boolean, zoomControlPosition?: H.ui.LayoutAlignment, markerData?: MarkerData[], onClickMarker?: ((markerData: MarkerData) => void) | undefined, onMapCenterChange?: () => void) => void;
@@ -0,0 +1,5 @@
1
+ /// <reference types="heremaps" />
2
+ export declare const useHereMap: (mapRef: React.RefObject<HTMLDivElement>, mapOptions: H.Map.Options, scriptsLoaded?: boolean) => {
3
+ defaultLayers: Record<string, any> | null;
4
+ hereMap: H.Map | null;
5
+ };
@@ -1,8 +1,10 @@
1
- import { Rate, SE } from "@shipengine/alchemy";
1
+ import { ListServicePointsOptionAddress, ListServicePointsOptionAddressQuery, ListServicePointsOptionCoordinates, Rate, SE } from "@shipengine/alchemy";
2
+ export type ServicePointSearchQuery = ListServicePointsOptionAddress["address"] | ListServicePointsOptionAddressQuery["addressQuery"] | ListServicePointsOptionCoordinates;
2
3
  export declare const useServicePoints: (rates?: Rate[], shipment?: SE.SalesOrderShipment) => {
3
- fetchServicePointsByPostalCode: (postalCode: string) => void;
4
+ fetchServicePoints: (searchQuery?: ServicePointSearchQuery) => void;
4
5
  listServicePointsErrors: SE.CodedError[] | null;
5
6
  nestedServicePointErrors: SE.CodedError[] | SE.ServicePointCustomError[] | undefined;
6
- servicePoints: SE.ServicePoint[];
7
+ servicePointSearchQuery: ServicePointSearchQuery | undefined;
7
8
  servicePointsFetching: boolean;
9
+ servicePointsResponse: SE.ServicePointsListResponse | undefined;
8
10
  };
@@ -52,6 +52,7 @@ declare const _default: {
52
52
  schedulePickup: string;
53
53
  showItems: string;
54
54
  void: string;
55
+ download: string;
55
56
  };
56
57
  fields: {
57
58
  dimensions: string;
@@ -71,6 +72,7 @@ declare const _default: {
71
72
  multipleShippingServices: string;
72
73
  sections: {
73
74
  labels: string;
75
+ shipmentSummary: string;
74
76
  };
75
77
  noLabels: string;
76
78
  };
@@ -160,8 +162,48 @@ declare const _default: {
160
162
  };
161
163
  };
162
164
  "register-carrier": {
163
- formTitle: string;
164
- agreeToTerms: string;
165
+ formTitle: {
166
+ default: string;
167
+ new: string;
168
+ edit: string;
169
+ };
170
+ notifications: {
171
+ error: {
172
+ title: string;
173
+ };
174
+ };
175
+ };
176
+ "rate-details": {
177
+ total: string;
178
+ subtotal: string;
179
+ registerVat: string;
180
+ concepts: {
181
+ confirmation: string;
182
+ uncategorized: string;
183
+ shipping: string;
184
+ insurance: string;
185
+ confirm: string;
186
+ discount: string;
187
+ fuel_charge: string;
188
+ additional_fees: string;
189
+ tariff: string;
190
+ tax: string;
191
+ delivery: string;
192
+ handling: string;
193
+ special_goods: string;
194
+ pickup: string;
195
+ location_fee: string;
196
+ oversize: string;
197
+ returns: string;
198
+ notifications: string;
199
+ tip: string;
200
+ duties_and_taxes: string;
201
+ brokerage_fee: string;
202
+ admin_fee: string;
203
+ adjustment: string;
204
+ auctane_service_fee: string;
205
+ product_price: string;
206
+ };
165
207
  };
166
208
  "purchase-label": {
167
209
  title: string;
@@ -274,7 +316,10 @@ declare const _default: {
274
316
  today: string;
275
317
  viewMap: string;
276
318
  otherLocations: string;
277
- noServicePointsFound: string;
319
+ noServicePointsForService: string;
320
+ error: string;
321
+ paperless: string;
322
+ localTimeDisclaimer: string;
278
323
  };
279
324
  shipToAddressFormFields: string;
280
325
  sections: {
@@ -778,6 +823,7 @@ declare const _default: {
778
823
  gram: string;
779
824
  kilogram: string;
780
825
  };
826
+ ZnVuZGluZ19zb3VyY2VfaWQgbXVzdCBiZSBhbiBpbnRlZ2Vy: string;
781
827
  T25seSByZXNpZGVudGlhbCBkZWxpdmVyeSBhZGRyZXNzZXMgYXJlIGFsbG93ZWQgZm9yIFVQUyBHcm91bmQgU2F2ZXIu: string;
782
828
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkMTAwLgo=": string;
783
829
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkNTAuCg==": string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { prettyFormat as __ } from "@testing-library/dom/types/pretty-dom";
2
3
  import { UserEvent } from "@testing-library/user-event/dist/types/setup/setup";
3
4
  import { IconNames, Theme } from "@shipengine/giger-theme";
@@ -1,4 +1,4 @@
1
- import { CarrierConnection, SE } from "@shipengine/alchemy";
1
+ import { SE } from "@shipengine/alchemy";
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -21,22 +21,18 @@ export type CarrierTerms = {
21
21
  links: CarrierTerm[];
22
22
  title: string;
23
23
  };
24
- export type CarrierMetadataMapping = {
25
- [countryCode: string]: CarrierMetadata[];
26
- };
27
24
  /**
28
25
  * @internal
29
26
  *
30
27
  * # Carrier Metadata
31
28
  */
32
- export type CarrierMetadata = {
33
- carrierCode: CarrierConnection["carrierCode"];
34
- logo: string;
29
+ export type CarrierWithFriendlyName = {
35
30
  name: string;
36
- optionalFields?: string[];
37
- requiredFields?: string[];
38
- shortname: string;
39
- terms?: CarrierTerms;
31
+ };
32
+ export type CarrierMetadata = Record<string, CarrierWithFriendlyName>;
33
+ export type CarrierMetadataFromFundingSource = {
34
+ carrierProfile: SE.MetadataCarrierProfile;
35
+ friendlyName: string;
40
36
  };
41
37
  /**
42
38
  * @internal
@@ -1,4 +1,3 @@
1
1
  export * from "./carrier-metadata";
2
- export * from "./patch";
3
2
  export * from "./shipping-preset";
4
3
  export * from "./preferred-rates";
@@ -1,4 +1,3 @@
1
- import * as Locales from "date-fns/locale";
2
1
  /**
3
2
  * @internal
4
3
  *
@@ -13,7 +12,7 @@ export declare const formatDate: (date: string, locale?: string) => string;
13
12
  * @param locale string i.e. "en-US"
14
13
  * @returns locale data
15
14
  */
16
- export declare const findDateLocale: (locale?: string) => Locales.Locale;
15
+ export declare const findDateLocale: (locale?: string) => import("date-fns/locale").Locale;
17
16
  /**
18
17
  * @internal
19
18
  * Given a date and a locale, format the date to the locale's date format.
@@ -45,7 +45,7 @@ export declare const featureFlags: {
45
45
  * `CarrierConnections` all scoped feature flags for "Bring your own carrier" connections.
46
46
  */
47
47
  readonly CarrierConnections: {
48
- readonly availableCarrierConnections: readonly ["apc", "asendia", "better_trucks", "canpar", "chronopost", "couriers_please", "courierpost", "dpd", "hermes_germany", "intelliquick_delivery", "lso", "ontrac", "seko", "ups", "yodel"];
48
+ readonly availableCarrierConnections: readonly ["apc", "asendia", "better_trucks", "canpar", "carrier_oauth_demo", "chronopost", "couriers_please", "courierpost", "dpd", "hermes_germany", "intelliquick_delivery", "lso", "ontrac", "seko", "ups", "yodel"];
49
49
  };
50
50
  /**
51
51
  * `ConfigureSalesOrderShipment` all scoped feature flags for the shipment configuration
@@ -161,7 +161,7 @@ export declare const featureFlags: {
161
161
  * `enabledCarriers` is a list of all `carriers` that are enabled for use in ShipEngine
162
162
  * Elements.
163
163
  */
164
- readonly enabledCarriers: readonly ["aramex_au_walleted", "canada_post_walleted", "canpar_walleted", "couriersplease_walleted", "dhl_express_walleted", "dpd_germany_walleted", "dpdwallet", "globalpost", "hermes", "purolator_walleted", "sendle_walleted", "stamps_com", "ups_walleted", "ups", "yodel_walleted"];
164
+ readonly enabledCarriers: readonly ["aramex_au_walleted", "canada_post_walleted", "canpar_walleted", "couriersplease_walleted", "dhl_express_walleted", "dhl_express_worldwide", "dpd_germany_walleted", "dpdwallet", "globalpost", "hermes", "purolator_walleted", "sendle_walleted", "stamps_com", "ups_walleted", "ups", "yodel_walleted"];
165
165
  };
166
166
  /**
167
167
  * All global `presentation` related feature flags.
@@ -23,3 +23,11 @@ export declare const isUpsCarrier: (carrierCode: string) => boolean;
23
23
  * @category Utilities
24
24
  */
25
25
  export declare const getCarrierIdByCarrierCode: (carriers: SE.Carrier[] | undefined, carrierCode: string) => string | undefined;
26
+ /**
27
+ * @internal
28
+ *
29
+ * # Carrier Utilities - getLogoOrIconByCarrierCode
30
+ *
31
+ * @category Utilities
32
+ */
33
+ export declare const getLogoOrIconByCarrierCode: (carrierCode: string, type: "logo" | "icon") => string;
@@ -96,6 +96,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
96
96
  schedulePickup: string;
97
97
  showItems: string;
98
98
  void: string;
99
+ download: string;
99
100
  };
100
101
  fields: {
101
102
  dimensions: string;
@@ -115,6 +116,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
115
116
  multipleShippingServices: string;
116
117
  sections: {
117
118
  labels: string;
119
+ shipmentSummary: string;
118
120
  };
119
121
  noLabels: string;
120
122
  };
@@ -204,8 +206,48 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
204
206
  };
205
207
  };
206
208
  "register-carrier": {
207
- formTitle: string;
208
- agreeToTerms: string;
209
+ formTitle: {
210
+ default: string;
211
+ new: string;
212
+ edit: string;
213
+ };
214
+ notifications: {
215
+ error: {
216
+ title: string;
217
+ };
218
+ };
219
+ };
220
+ "rate-details": {
221
+ total: string;
222
+ subtotal: string;
223
+ registerVat: string;
224
+ concepts: {
225
+ confirmation: string;
226
+ uncategorized: string;
227
+ shipping: string;
228
+ insurance: string;
229
+ confirm: string;
230
+ discount: string;
231
+ fuel_charge: string;
232
+ additional_fees: string;
233
+ tariff: string;
234
+ tax: string;
235
+ delivery: string;
236
+ handling: string;
237
+ special_goods: string;
238
+ pickup: string;
239
+ location_fee: string;
240
+ oversize: string;
241
+ returns: string;
242
+ notifications: string;
243
+ tip: string;
244
+ duties_and_taxes: string;
245
+ brokerage_fee: string;
246
+ admin_fee: string;
247
+ adjustment: string;
248
+ auctane_service_fee: string;
249
+ product_price: string;
250
+ };
209
251
  };
210
252
  "purchase-label": {
211
253
  title: string;
@@ -318,7 +360,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
318
360
  today: string;
319
361
  viewMap: string;
320
362
  otherLocations: string;
321
- noServicePointsFound: string;
363
+ noServicePointsForService: string;
364
+ error: string;
365
+ paperless: string;
366
+ localTimeDisclaimer: string;
322
367
  };
323
368
  shipToAddressFormFields: string;
324
369
  sections: {
@@ -822,6 +867,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
822
867
  gram: string;
823
868
  kilogram: string;
824
869
  };
870
+ ZnVuZGluZ19zb3VyY2VfaWQgbXVzdCBiZSBhbiBpbnRlZ2Vy: string;
825
871
  T25seSByZXNpZGVudGlhbCBkZWxpdmVyeSBhZGRyZXNzZXMgYXJlIGFsbG93ZWQgZm9yIFVQUyBHcm91bmQgU2F2ZXIu: string;
826
872
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkMTAwLgo=": string;
827
873
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkNTAuCg==": string;
@@ -93,6 +93,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
93
93
  schedulePickup: string;
94
94
  showItems: string;
95
95
  void: string;
96
+ download: string;
96
97
  };
97
98
  fields: {
98
99
  dimensions: string;
@@ -112,6 +113,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
112
113
  multipleShippingServices: string;
113
114
  sections: {
114
115
  labels: string;
116
+ shipmentSummary: string;
115
117
  };
116
118
  noLabels: string;
117
119
  };
@@ -201,8 +203,48 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
201
203
  };
202
204
  };
203
205
  "register-carrier": {
204
- formTitle: string;
205
- agreeToTerms: string;
206
+ formTitle: {
207
+ default: string;
208
+ new: string;
209
+ edit: string;
210
+ };
211
+ notifications: {
212
+ error: {
213
+ title: string;
214
+ };
215
+ };
216
+ };
217
+ "rate-details": {
218
+ total: string;
219
+ subtotal: string;
220
+ registerVat: string;
221
+ concepts: {
222
+ confirmation: string;
223
+ uncategorized: string;
224
+ shipping: string;
225
+ insurance: string;
226
+ confirm: string;
227
+ discount: string;
228
+ fuel_charge: string;
229
+ additional_fees: string;
230
+ tariff: string;
231
+ tax: string;
232
+ delivery: string;
233
+ handling: string;
234
+ special_goods: string;
235
+ pickup: string;
236
+ location_fee: string;
237
+ oversize: string;
238
+ returns: string;
239
+ notifications: string;
240
+ tip: string;
241
+ duties_and_taxes: string;
242
+ brokerage_fee: string;
243
+ admin_fee: string;
244
+ adjustment: string;
245
+ auctane_service_fee: string;
246
+ product_price: string;
247
+ };
206
248
  };
207
249
  "purchase-label": {
208
250
  title: string;
@@ -315,7 +357,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
315
357
  today: string;
316
358
  viewMap: string;
317
359
  otherLocations: string;
318
- noServicePointsFound: string;
360
+ noServicePointsForService: string;
361
+ error: string;
362
+ paperless: string;
363
+ localTimeDisclaimer: string;
319
364
  };
320
365
  shipToAddressFormFields: string;
321
366
  sections: {
@@ -842,6 +887,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
842
887
  gram: string;
843
888
  kilogram: string;
844
889
  };
890
+ ZnVuZGluZ19zb3VyY2VfaWQgbXVzdCBiZSBhbiBpbnRlZ2Vy: string;
845
891
  T25seSByZXNpZGVudGlhbCBkZWxpdmVyeSBhZGRyZXNzZXMgYXJlIGFsbG93ZWQgZm9yIFVQUyBHcm91bmQgU2F2ZXIu: string;
846
892
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkMTAwLgo=": string;
847
893
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkNTAuCg==": string;
@@ -91,6 +91,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
91
91
  schedulePickup: string;
92
92
  showItems: string;
93
93
  void: string;
94
+ download: string;
94
95
  };
95
96
  fields: {
96
97
  dimensions: string;
@@ -110,6 +111,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
110
111
  multipleShippingServices: string;
111
112
  sections: {
112
113
  labels: string;
114
+ shipmentSummary: string;
113
115
  };
114
116
  noLabels: string;
115
117
  };
@@ -199,8 +201,48 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
199
201
  };
200
202
  };
201
203
  "register-carrier": {
202
- formTitle: string;
203
- agreeToTerms: string;
204
+ formTitle: {
205
+ default: string;
206
+ new: string;
207
+ edit: string;
208
+ };
209
+ notifications: {
210
+ error: {
211
+ title: string;
212
+ };
213
+ };
214
+ };
215
+ "rate-details": {
216
+ total: string;
217
+ subtotal: string;
218
+ registerVat: string;
219
+ concepts: {
220
+ confirmation: string;
221
+ uncategorized: string;
222
+ shipping: string;
223
+ insurance: string;
224
+ confirm: string;
225
+ discount: string;
226
+ fuel_charge: string;
227
+ additional_fees: string;
228
+ tariff: string;
229
+ tax: string;
230
+ delivery: string;
231
+ handling: string;
232
+ special_goods: string;
233
+ pickup: string;
234
+ location_fee: string;
235
+ oversize: string;
236
+ returns: string;
237
+ notifications: string;
238
+ tip: string;
239
+ duties_and_taxes: string;
240
+ brokerage_fee: string;
241
+ admin_fee: string;
242
+ adjustment: string;
243
+ auctane_service_fee: string;
244
+ product_price: string;
245
+ };
204
246
  };
205
247
  "purchase-label": {
206
248
  title: string;
@@ -313,7 +355,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
313
355
  today: string;
314
356
  viewMap: string;
315
357
  otherLocations: string;
316
- noServicePointsFound: string;
358
+ noServicePointsForService: string;
359
+ error: string;
360
+ paperless: string;
361
+ localTimeDisclaimer: string;
317
362
  };
318
363
  shipToAddressFormFields: string;
319
364
  sections: {
@@ -820,6 +865,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
820
865
  gram: string;
821
866
  kilogram: string;
822
867
  };
868
+ ZnVuZGluZ19zb3VyY2VfaWQgbXVzdCBiZSBhbiBpbnRlZ2Vy: string;
823
869
  T25seSByZXNpZGVudGlhbCBkZWxpdmVyeSBhZGRyZXNzZXMgYXJlIGFsbG93ZWQgZm9yIFVQUyBHcm91bmQgU2F2ZXIu: string;
824
870
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkMTAwLgo=": string;
825
871
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkNTAuCg==": string;
@@ -1,13 +1,12 @@
1
1
  import { SE } from "@shipengine/alchemy";
2
- import { CarrierMetadata } from "../../../../types";
2
+ import { CarrierMetadataFromFundingSource } from "../../../../types";
3
3
  import { CarrierRecoveryFormPayload } from "./carrier-recovery-form-schema";
4
4
  export type CarrierRecoveryFormProps = {
5
5
  address?: SE.Address;
6
- carrierFriendlyName: string;
7
- carrierMetadata: CarrierMetadata;
6
+ carrierMetadata: CarrierMetadataFromFundingSource;
8
7
  errors?: SE.CodedError[] | null;
9
8
  fundingSourceId: string;
10
9
  onSkip?: () => void;
11
10
  onSubmit: (fundingSourceId: string, payload: CarrierRecoveryFormPayload) => Promise<void>;
12
11
  };
13
- export declare const CarrierRecoveryForm: ({ address, carrierFriendlyName, carrierMetadata, errors, fundingSourceId, onSkip, onSubmit, }: CarrierRecoveryFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
12
+ export declare const CarrierRecoveryForm: ({ address, carrierMetadata, errors, fundingSourceId, onSkip, onSubmit, }: CarrierRecoveryFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,13 +1,12 @@
1
1
  import { SE } from "@shipengine/alchemy";
2
2
  import { WalletPayload } from "../../../../components/templates/wallet-form";
3
- import { CarrierProfile } from "../../../../types";
4
3
  type UseFundingAndCarrierConnectionStepProps = {
5
4
  isUpsEnabled: boolean;
6
5
  onStepComplete: () => void;
7
6
  };
8
7
  export declare const useFundingAndCarrierConnectionStep: ({ isUpsEnabled, onStepComplete, }: UseFundingAndCarrierConnectionStepProps) => {
9
8
  createFundingAndCarrierConnectionSubmissionHandler: ({ carrierProfiles, defaultWarehouse, email, fundingSourceTerms, }: {
10
- carrierProfiles: CarrierProfile[];
9
+ carrierProfiles: SE.MetadataCarrierProfile[];
11
10
  defaultWarehouse: SE.Warehouse;
12
11
  email: string;
13
12
  fundingSourceTerms: SE.MetadataRequiredTerm[];
@@ -5,12 +5,7 @@ export type UseTermsAgreementStepProps = {
5
5
  };
6
6
  export declare const useTermsAgreementStep: ({ enabledCarriers, onStepComplete, }: UseTermsAgreementStepProps) => {
7
7
  carrierCodes: string[] | undefined;
8
- carrierProfiles: {
9
- capabilities: SE.MetadataCapability[] | null;
10
- carrierCode: string;
11
- registrationRequirements: SE.MetadataRegistrationRequirement[];
12
- requiredTerms: SE.MetadataRequiredTerm[];
13
- }[] | undefined;
8
+ carrierProfiles: SE.MetadataCarrierProfile[] | undefined;
14
9
  carrierTerms: SE.MetadataRequiredTerm[] | undefined;
15
10
  fundingSourceMetadata: import("@tanstack/react-query").UseQueryResult<SE.MetadataResponse, SE.CodedError[]>;
16
11
  fundingSourceTerms: SE.MetadataRequiredTerm[] | undefined;
@@ -129,6 +129,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
129
129
  schedulePickup: string;
130
130
  showItems: string;
131
131
  void: string;
132
+ download: string;
132
133
  };
133
134
  fields: {
134
135
  dimensions: string;
@@ -141,13 +142,14 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
141
142
  shipTo: string;
142
143
  warehouse: string;
143
144
  weight: string;
144
- insuredValue: string; /** Invoked when the onboarding process is completed. */
145
+ insuredValue: string;
145
146
  deliveryConfirmation: string;
146
147
  };
147
148
  highVolumeForms: string;
148
149
  multipleShippingServices: string;
149
150
  sections: {
150
151
  labels: string;
152
+ shipmentSummary: string;
151
153
  };
152
154
  noLabels: string;
153
155
  };
@@ -237,8 +239,48 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
237
239
  };
238
240
  };
239
241
  "register-carrier": {
240
- formTitle: string;
241
- agreeToTerms: string;
242
+ formTitle: {
243
+ default: string;
244
+ new: string;
245
+ edit: string;
246
+ };
247
+ notifications: {
248
+ error: {
249
+ title: string;
250
+ };
251
+ };
252
+ };
253
+ "rate-details": {
254
+ total: string;
255
+ subtotal: string;
256
+ registerVat: string;
257
+ concepts: {
258
+ confirmation: string;
259
+ uncategorized: string;
260
+ shipping: string;
261
+ insurance: string;
262
+ confirm: string;
263
+ discount: string;
264
+ fuel_charge: string;
265
+ additional_fees: string;
266
+ tariff: string;
267
+ tax: string;
268
+ delivery: string;
269
+ handling: string;
270
+ special_goods: string;
271
+ pickup: string;
272
+ location_fee: string;
273
+ oversize: string;
274
+ returns: string;
275
+ notifications: string; /** Invoked when the onboarding process is completed. */
276
+ tip: string;
277
+ duties_and_taxes: string;
278
+ brokerage_fee: string;
279
+ admin_fee: string;
280
+ adjustment: string;
281
+ auctane_service_fee: string;
282
+ product_price: string;
283
+ };
242
284
  };
243
285
  "purchase-label": {
244
286
  title: string;
@@ -351,7 +393,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
351
393
  today: string;
352
394
  viewMap: string;
353
395
  otherLocations: string;
354
- noServicePointsFound: string;
396
+ noServicePointsForService: string;
397
+ error: string;
398
+ paperless: string;
399
+ localTimeDisclaimer: string;
355
400
  };
356
401
  shipToAddressFormFields: string;
357
402
  sections: {
@@ -901,6 +946,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
901
946
  gram: string;
902
947
  kilogram: string;
903
948
  };
949
+ ZnVuZGluZ19zb3VyY2VfaWQgbXVzdCBiZSBhbiBpbnRlZ2Vy: string;
904
950
  T25seSByZXNpZGVudGlhbCBkZWxpdmVyeSBhZGRyZXNzZXMgYXJlIGFsbG93ZWQgZm9yIFVQUyBHcm91bmQgU2F2ZXIu: string;
905
951
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkMTAwLgo=": string;
906
952
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkNTAuCg==": string;
@@ -0,0 +1 @@
1
+ import{w as e,x as t,y as r,z as a,G as n,J as s,M as o,N as i,K as p,O as c,Q as l,U as d,X as m,Y as u,Z as g}from"./warehouse-form-c0b3ea78.js";import{jsxs as h,Fragment as b,jsx as x}from"@emotion/react/jsx-runtime";import{Typography as f}from"@shipengine/giger";var I=Object.freeze({__proto__:null,CheckboxInput:e,CreditCardInput:t,DatePicker:r,ExpirationInput:a,InputGroup:n,transform:s,MoneyInput:o,NumberInput:i,RateSelect:p,SelectAutoComplete:c,Select:l,SubmitButton:d,Switch:m,TextArea:u,TextInput:g});const S=({children:e,notes:t})=>h(b,{children:[h("div",Object.assign({css:()=>({backgroundColor:"lightsteelblue",marginBottom:"16px",padding:"16px",paddingLeft:"32px"})},{children:[x(f,Object.assign({variant:"heading5"},{children:"Story notes:"})),x("ul",Object.assign({css:e=>({"> li":{marginTop:e.spacing(1)}})},{children:t.map((e=>x("li",{children:e},e)))}))]})),x("hr",{css:()=>({backgroundColor:"transparent",borderTop:"1px dotted lightgrey",marginBottom:"16px"})}),e]});export{S,I as f};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as n}from"@emotion/react/jsx-runtime";import{useRef as t,useLayoutEffect as r,useState as i,useMemo as o,useCallback as a}from"react";import{Icon as s,Table as c,TableFooter as l,TableHeader as d,TableHeaderRow as g,TableHeaderCell as h,Checkbox as p,TableBody as m,TableRow as u,TableBodyCell as b,Button as f,ButtonVariant as C,IconSize as w,DropdownOptionList as v,Option as O,Pagination as y,Skeleton as S,SkeletonAnimation as j,SkeletonVariant as x}from"@shipengine/giger";import{IconNames as k}from"@shipengine/giger-theme";import{c as P}from"./validation-b941a548.js";import{useAlchemy as E}from"@shipengine/alchemy";import{c as D,f as I}from"./carrier-2abb4760.js";import{useTranslation as T,Trans as z}from"react-i18next";const A=P({container:{backgroundColor:"#11003A"},getChildrenStyles:e=>n=>({height:e?"90%":"0",overflow:"scroll"}),getDrawerStyles:e=>n=>({backgroundColor:"#11003A",bottom:0,height:e?"50%":`${n.spacing(6)}px`,minWidth:"440px",position:"fixed",transformOrigin:"bottom",transition:"height 0.5s;"}),header:e=>({alignItems:"center",color:"#fff",display:"flex",height:e.spacing(6),justifyContent:"space-between",padding:e.spacing(1)})}),R=({children:i,headerContent:o,isOpen:a,toggleDrawer:c})=>{const l=t(null);return r((()=>{const e=()=>{const e=l.current;e&&e.parentElement&&(e.style.width=`${e.parentElement.clientWidth}px`)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e("div",Object.assign({"aria-label":"Drawer",css:A.getDrawerStyles(a),ref:l},{children:[e("header",Object.assign({"aria-expanded":a,css:A.header},{children:[n("div",Object.assign({onClick:c,role:"button"},{children:n(s,{css:{transform:`rotate(${a?"-90":"90"}deg)`},name:k.PAGINATION_LEFT})})),o]})),n("div",Object.assign({"aria-labelledby":"drawer",css:A.getChildrenStyles(a),role:"region"},{children:i}))]}))},W=({date:e,short:t})=>{const{locale:r}=E();return n("div",{children:n("div",{children:t?D(e,r):I(e,r)})})},M=P({checkboxHeader:e=>({width:e.spacing(6)}),table:{"*":{overflow:"hidden",textOverflow:"clip !important"}}}),_=({columns:t,data:r,footerContent:s,onRowClick:f,useCheckboxes:C=!1})=>{var w,v,O;const[y,S]=i(null!==(w=null==r?void 0:r.map((()=>!1)))&&void 0!==w?w:[]),j=o((()=>y.length>0&&y.every((e=>e))),[y]),x=o((()=>y.some((e=>e))),[y]),k=a((e=>{S((n=>{const t=[...n];return t[e]=!t[e],t}))}),[]),P=a((e=>{S((n=>{const t=[...n];for(const n of t.entries())t[n[0]]=e;return t}))}),[]);return n(c,Object.assign({css:M.table,"data-testid":"grid",footer:s&&n(l,{children:s}),header:n(d,{children:e(g,{children:[C?n(h,Object.assign({css:M.checkboxHeader},{children:n(p,{checked:null!==(v=j||x)&&void 0!==v&&v,indeterminate:null!==(O=!j&&x)&&void 0!==O&&O,onChange:e=>P(e.target.checked)})})):null,t.map((e=>e.headerContent)).map(((e,t)=>n(h,{children:e},t)))]})})},{children:n(m,{children:r.map(((r,i)=>{var o;return e(u,Object.assign({onClick:f?()=>f(r):void 0},{children:[C?n(b,{children:n(p,{checked:null!==(o=y[i])&&void 0!==o&&o,onChange:()=>k(i)})}):null,t.map(((e,t)=>e.renderCellContent?n(b,{children:e.renderCellContent(r)},t):null))]}),i)}))})}))},H=P({footer:{"> *":{borderTop:"0 !important"},alignItems:"center",display:"flex",justifyContent:"space-between",width:"100%"},leftFooter:e=>({display:"flex",margin:e.spacing(2),span:{fontWeight:e.typography.fontWeight.bold}}),rowCount:e=>({alignItems:"center",display:"flex",marginRight:e.spacing(4),whiteSpace:"pre"}),rowCountDropDown:{"> * > *":{justifyContent:"center !important"}},rowsActions:e=>({"#selected-row":{":hover":{backgroundColor:"transparent"},borderRadius:e.borderRadius.XS,color:e.palette.black,padding:e.spacing(1),paddingRight:e.spacing(.5)},alignItems:"baseline",display:"flex",span:{alignSelf:"center"}})}),N=[5,10,25,50],F=({currentPageSize:r,pagingData:o,rowCountSelection:c=N,onPageSelect:l,onPageSizeSelect:d})=>{const[g,h]=i(!1),p=t(null),{t:m}=T(),u=a((()=>h((e=>!e))),[]);return e("div",Object.assign({css:H.footer},{children:[e("div",Object.assign({css:H.leftFooter},{children:[n("div",Object.assign({css:H.rowCount},{children:n(z,{components:[n("b",{style:{fontWeight:"bold"}},"1")],count:o.total,i18nKey:"common:grid.row-count",values:{firstIndex:0!==o.total?1+(o.page-1)*r:0,lastIndex:Math.min(o.total,o.page*r)}})})),e("div",Object.assign({css:H.rowsActions},{children:[m("common:grid.rows"),n(f,Object.assign({id:"selected-row",onClick:()=>u(),ref:p,variant:C.TEXT},{children:r})),n(s,g?{name:k.CHEVRON_TOP,onClick:()=>u(),size:w.SIZE_MEDIUM}:{name:k.CHEVRON_BOTTOM,onClick:()=>u(),size:w.SIZE_MEDIUM}),n(v,Object.assign({css:H.rowCountDropDown,dropdownWidth:"max-content",isOpen:g,onChange:()=>u(),onClickAway:e=>{var n;(null===(n=p.current)||void 0===n?void 0:n.contains(e.target))||u()},placement:"bottom",reference:p.current},{children:c.map((e=>n(O,Object.assign({onClick:()=>d(e),value:String(e)},{children:e}),e)))}))]}))]})),n("div",{children:n(y,{boundaryPagesToShow:5,currentPage:o.page,onPageChange:l,totalPages:o.pages})})]}))},L=(e=10)=>{const[n,t]=i(1),[r,o]=i(e);return{page:n,pagerProps:{currentPage:n,currentPageSize:r,onPageSelect:e=>{t(e)},onPageSizeSelect:e=>{o(e)}},pageSize:r}},V=({children:e,loading:t})=>t?n(S,{animation:j.WAVE,variant:x.TEXT}):n("span",{children:e});export{W as C,R as D,_ as G,F as P,V as S,L as u};
package/types.js ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ import{useTranslation as e}from"react-i18next";import{jsx as l,jsxs as a}from"@emotion/react/jsx-runtime";import{useRef as t,useState as o,useContext as r,createContext as n}from"react";import{P as s}from"./use-toggle-838d2ebd.js";const i=()=>{const{t:l}=e("common");return[{label:l("months.january"),value:"01"},{label:l("months.february"),value:"02"},{label:l("months.march"),value:"03"},{label:l("months.april"),value:"04"},{label:l("months.may"),value:"05"},{label:l("months.june"),value:"06"},{label:l("months.july"),value:"07"},{label:l("months.august"),value:"08"},{label:l("months.september"),value:"09"},{label:l("months.october"),value:"10"},{label:l("months.november"),value:"11"},{label:l("months.december"),value:"12"}]},u=n(void 0);u.displayName="PageLayoutContext";const c=({children:e})=>{const r=t(null),n=t(null),[i]=o({FooterPortal:e=>l(s,Object.assign({target:n},{children:e.children})),HeaderPortal:e=>l(s,Object.assign({target:r},{children:e.children}))});return l(u.Provider,Object.assign({value:i},{children:a("div",Object.assign({css:{display:"flex",flexDirection:"column",height:"100%"}},{children:[l("div",{css:{flexShrink:0},id:"page-layout-header",ref:r}),l("div",Object.assign({css:{overflow:"scroll"},id:"page-layout-content"},{children:e})),l("div",{css:{flexShrink:0},id:"page-layout-footer",ref:n})]}))}))},m=()=>{const e=r(u);if(!e)throw new Error("usePageLayout must be called from within the scope of PageLayoutProvider");return e};export{c as P,m as a,i as u};