@shipengine/elements 2.14.0 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/actions-menu.js +5 -5
  2. package/components.js +1 -1
  3. package/elements.js +1 -1
  4. package/hooks.js +1 -1
  5. package/index.js +1 -1
  6. package/package.json +4 -4
  7. package/src/components/address-preference-context/address-preference-context.d.ts +1 -1
  8. package/src/components/pager/usePager.d.ts +1 -0
  9. package/src/components/templates/address-form/address-fields.d.ts +1 -2
  10. package/src/components/templates/address-form/address-form.d.ts +1 -2
  11. package/src/components/templates/product-form/product-form.d.ts +3 -1
  12. package/src/components/templates/products-display/products-display.d.ts +4 -4
  13. package/src/components/templates/shipment-form/sections/customs-forms/customs-forms.d.ts +3 -2
  14. package/src/components/templates/shipment-form/shipment-form.d.ts +3 -2
  15. package/src/components/templates/wallet-form/edit-wallet-address-form.d.ts +1 -1
  16. package/src/components/vat-form/vat-form-schema.d.ts +21 -3
  17. package/src/components/vat-form/vat-form.d.ts +7 -2
  18. package/src/components/vat-form/vat-form.styles.d.ts +3 -0
  19. package/src/components/vat-form/vat-types.d.ts +6 -0
  20. package/src/components/warehouse-form/warehouse-form-schema.d.ts +6 -0
  21. package/src/components/warehouse-form/warehouse-form.d.ts +3 -1
  22. package/src/elements/labels-grid/hooks/use-labels-grid.d.ts +1 -0
  23. package/src/elements/labels-grid/labels-grid.d.ts +39 -16
  24. package/src/elements/manage-carriers/manage-carriers.d.ts +6 -2
  25. package/src/elements/manage-external-carriers/manage-external-carriers.d.ts +6 -2
  26. package/src/elements/manage-funding/manage-funding-element.d.ts +6 -2
  27. package/src/elements/manage-warehouses/manage-warehouses.d.ts +6 -2
  28. package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +6 -2
  29. package/src/elements/purchase-label/configure-shipment.d.ts +2 -1
  30. package/src/elements/purchase-label/hooks/index.d.ts +0 -2
  31. package/src/elements/purchase-label/hooks/use-shipment-form.d.ts +2 -1
  32. package/src/elements/purchase-label/purchase-label.d.ts +28 -39
  33. package/src/elements/select-label-layout/select-label-layout-element.d.ts +6 -2
  34. package/src/elements/shipment-summary/shipment-summary.d.ts +8 -2
  35. package/src/elements/shipments-grid/hooks/use-shipments-grid.d.ts +1 -0
  36. package/src/elements/shipments-grid/shipments-grid.d.ts +6 -5
  37. package/src/elements/theme-creator/theme-creator.d.ts +6 -2
  38. package/src/elements/transaction-history/transaction-history-element.d.ts +6 -2
  39. package/src/elements/unit-settings/unit-settings-element.d.ts +6 -2
  40. package/src/elements/vat-settings/vat-settings-element.d.ts +6 -2
  41. package/src/elements/void-label/void-label.d.ts +36 -52
  42. package/src/elements-provider/elements-provider.d.ts +1 -2
  43. package/src/features/vat-settings/use-vat-settings.d.ts +1 -1
  44. package/src/features/vat-settings/vat-settings.d.ts +1 -4
  45. package/src/features/vat-settings/vat-settings.styles.d.ts +7 -0
  46. package/src/hooks/index.d.ts +2 -0
  47. package/src/hooks/options/use-country-code-options.d.ts +1 -1
  48. package/src/hooks/options/use-state-code-options.d.ts +2 -2
  49. package/src/{elements/purchase-label/hooks → hooks}/use-configure-shipment.d.ts +5 -10
  50. package/src/hooks/use-helpers.stories.d.ts +3 -0
  51. package/src/locales/en/index.d.ts +6 -2
  52. package/src/types/harmonized-tariff-code.d.ts +10 -0
  53. package/src/types/index.d.ts +4 -3
  54. package/src/workflows/account-settings/account-settings.d.ts +6 -2
  55. package/src/workflows/carrier-services/carrier-services.d.ts +6 -25
  56. package/src/workflows/connect-external-carrier/connect-external-carrier.d.ts +6 -2
  57. package/src/workflows/label-workflow/label-workflow.d.ts +1126 -101
  58. package/src/workflows/onboarding/components/ship-from-address-step/ship-from-address-step.d.ts +1 -1
  59. package/src/workflows/onboarding/onboarding.d.ts +7 -3
  60. package/transaction-history-element.js +1 -1
  61. package/use-configure-shipment.js +1 -0
  62. package/use-toggle.js +1 -1
  63. package/use-unit-settings.js +1 -1
  64. package/usePager.js +1 -1
  65. package/utilities.js +1 -1
  66. package/vat.js +1 -1
  67. package/wallet-form.js +1 -1
  68. package/warehouses.js +1 -0
  69. package/workflows.js +1 -1
  70. package/shipment.js +0 -1
  71. package/use-scrub-errors.js +0 -1
  72. /package/src/{elements/purchase-label/hooks → hooks}/use-import-sales-order.d.ts +0 -0
@@ -166,7 +166,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
166
166
  title: string;
167
167
  description: string;
168
168
  cta: {
169
- title: string;
169
+ title: string; /**
170
+ * `onSuccess` is a callback function that will be invoked when the request to void a given
171
+ * shipping label is successful.
172
+ */
170
173
  description: string;
171
174
  };
172
175
  registerSuccess: {
@@ -188,16 +191,18 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
188
191
  vatNumber: string;
189
192
  vatRegistrationTooltip: string;
190
193
  vatFormText: string;
191
- vatFormRegisterLater: string;
192
194
  vatNumberInputHint: string;
193
195
  vatNumberInputPlaceholder: string;
194
196
  verifiedVat: string;
197
+ vatNumberFieldLabel: string;
198
+ vatTypePlaceholder: string;
199
+ issuingAuthorityPlaceholder: string;
200
+ issuingAuthorityFieldLabel: string;
195
201
  vatFormErrors: {
196
202
  invalidFieldValue: string;
197
203
  verificationFailure: string;
198
204
  forbidden: string;
199
205
  connectionNotSupported: string;
200
- genericTitle: string;
201
206
  genericText: string;
202
207
  };
203
208
  };
@@ -240,6 +245,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
240
245
  termsLink: string;
241
246
  popover: {
242
247
  title: string;
248
+ /**
249
+ * `onComplete` is a callback function that will be invoked when the request to void a given
250
+ * shipping label is completed.
251
+ */
243
252
  description: string;
244
253
  };
245
254
  };
@@ -251,12 +260,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
251
260
  info: {
252
261
  description: string;
253
262
  };
254
- /**
255
- * `onViewShipment` is a callback function that will be invoked when the user clicks the
256
- * `View Shipment` button. This will take you back to the
257
- * {@link ShipmentSummary.Element | `Shipment Summary Element`} for the given shipment, where you
258
- * will be able to see the voided label listed.
259
- */
260
263
  poBox: {
261
264
  title: string;
262
265
  description: string;
@@ -320,6 +323,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
320
323
  duties_and_taxes: string;
321
324
  brokerage_fee: string;
322
325
  admin_fee: string;
326
+ /**
327
+ * `labelId` is the unique identifier for the label you wish to void.
328
+ */
323
329
  adjustment: string;
324
330
  auctane_service_fee: string;
325
331
  product_price: string;
@@ -362,31 +368,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
362
368
  "requires-additional-handling": string;
363
369
  addOns: string;
364
370
  contentDescription: string;
365
- /**
366
- * # Void Label Component
367
- *
368
- * - The `<VoidLabel />` component is used to void a given shipping label. When a label is voided,
369
- * you then get the option to view the associated shipment via the `Shipment Summary` Element, or
370
- * you can purchase another label for the shipment via the `Purchase Label` Element.
371
- *
372
- * @param ComponentProps The base props that will be passed into the `<VoidLabel />` component.
373
- *
374
- * @returns Element An EmotionJSX.Element that will render the `<VoidLabel />` component
375
- * with all the appropriate wrappers.
376
- *
377
- * @example
378
- * You can see how the `<Component />` is used in the `createElement` function call below.
379
- * ```tsx
380
- * export const Element = createElement(Component, ErrorFallback, {
381
- *
382
- * resources: { en },
383
- * });
384
- * ```
385
- *
386
- * <br />
387
- *
388
- * @see {@link VoidLabel.Element | The **Element** created to render `<VoidLabel />`}
389
- */
390
371
  confirmation: string;
391
372
  dimensions: {
392
373
  length: string;
@@ -481,11 +462,12 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
481
462
  shipToAddressFormFields: string;
482
463
  sections: {
483
464
  customsForm: string;
484
- windsorFramework: string; /**
465
+ /**
485
466
  * # Void Label Element Props
486
467
  *
487
468
  * @see {@link VoidLabel.Element | See the full type that `typeof Element` will return}
488
469
  */
470
+ windsorFramework: string;
489
471
  shipment: string;
490
472
  rate_one: string;
491
473
  rate_other: string;
@@ -598,24 +580,24 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
598
580
  isEnabled: string;
599
581
  isLoading: string;
600
582
  lowBalancePurchaseThreshold: string;
601
- /**
602
- * # Void Label Component Props
603
- *
604
- * - These are the base props that will be passed into the `<VoidLabel />` component.
605
- *
606
- * @see {@link VoidLabel.Component | This prop types usage in the `<VoidLabel />` component}
607
- */
608
583
  maximumPurchasesPerDay: string;
609
584
  purchaseAmount: string;
610
585
  readSettings: string;
611
586
  };
612
587
  addFunds: {
613
- custom: string;
588
+ custom: string; /**
589
+ * `onComplete` is a callback function that will be invoked when the request to void a given
590
+ * shipping label is completed.
591
+ */
614
592
  error: {
615
593
  title: string;
616
594
  message: string;
617
595
  };
618
596
  isLoading: string;
597
+ /**
598
+ * `onSuccess` is a callback function that will be invoked when the request to void a given
599
+ * shipping label is successful.
600
+ */
619
601
  labels: {
620
602
  amount: string;
621
603
  };
@@ -663,7 +645,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
663
645
  savingFailed: string;
664
646
  };
665
647
  units: {
666
- title: string;
667
648
  /**
668
649
  * # Void Label Component Props
669
650
  *
@@ -671,6 +652,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
671
652
  *
672
653
  * @see {@link VoidLabel.Component | This prop types usage in the `<VoidLabel />` component}
673
654
  */
655
+ title: string;
674
656
  dimensions: {
675
657
  title: string;
676
658
  standard: string;
@@ -747,9 +729,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
747
729
  voided: string;
748
730
  error: string;
749
731
  completed: string;
750
- processing: string; /**
751
- * `labelId` is the unique identifier for the label you wish to void.
752
- */
732
+ processing: string;
753
733
  };
754
734
  trackingStatus: {
755
735
  unknown: string;
@@ -766,7 +746,12 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
766
746
  errorMessages: {
767
747
  title: string;
768
748
  subtitle: string;
769
- };
749
+ }; /**
750
+ * `onViewShipment` is a callback function that will be invoked when the user clicks the
751
+ * `View Shipment` button. This will take you back to the
752
+ * {@link ShipmentSummary.Element | `Shipment Summary Element`} for the given shipment, where you
753
+ * will be able to see the voided label listed.
754
+ */
770
755
  };
771
756
  "connect-carrier": {
772
757
  actions: {
@@ -795,10 +780,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
795
780
  toastBody: string;
796
781
  };
797
782
  deleteCarrierErrorTitle: string;
798
- deleteCarrierErrorMessage: string; /**
799
- * `onSuccess` is a callback function that will be invoked when the request to void a given
800
- * shipping label is successful.
801
- */
783
+ deleteCarrierErrorMessage: string;
802
784
  loadingDeletingCarrier: string;
803
785
  };
804
786
  common: {
@@ -943,6 +925,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
943
925
  taxIssuingAuthority: string;
944
926
  entityType: string;
945
927
  };
928
+ hsCode: string;
946
929
  nonDelivery: {
947
930
  returnToSender: string;
948
931
  treatAsAbandoned: string;
@@ -980,6 +963,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
980
963
  shipments: string;
981
964
  warehouses: string;
982
965
  };
966
+ labelHasBeenPurchased: string;
983
967
  emailIsRequired: string;
984
968
  unknown: string;
985
969
  noRatesAvailable: string;
@@ -6,7 +6,6 @@ import { ElementsContextProviderProps } from "./elements-context-provider";
6
6
  export type ElementsProviderProps = Omit<ElementsContextProviderProps, "theme"> & ShipEngineAPIConfig & {
7
7
  defaultQueryClientOptions?: DefaultOptions;
8
8
  emotionCacheShadowRootContainer?: ShadowRoot & HTMLElement;
9
- emotionCacheShadowRootContainerWrapper?: HTMLDivElement;
10
9
  themeConfig?: CustomThemeData | {
11
10
  [THEME_ID]: CustomThemeData;
12
11
  };
@@ -14,4 +13,4 @@ export type ElementsProviderProps = Omit<ElementsContextProviderProps, "theme">
14
13
  /**
15
14
  * @category Providers
16
15
  */
17
- export declare const ElementsProvider: ({ baseURL, cdnURL, children, container, features, getToken, headers, locale, onApiError, onError, scope, themeConfig, defaultQueryClientOptions, emotionCacheShadowRootContainer, emotionCacheShadowRootContainerWrapper, }: ElementsProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
16
+ export declare const ElementsProvider: ({ baseURL, cdnURL, children, container, features, getToken, headers, locale, onApiError, onError, scope, themeConfig, defaultQueryClientOptions, emotionCacheShadowRootContainer, }: ElementsProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -4,5 +4,5 @@ export declare const useVatSettings: () => {
4
4
  refreshVatSettings: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@shipengine/react-api").ShipEngineAccountSettings, import("@shipengine/react-api").CodedError[]>>;
5
5
  updateVatSettings: import("@tanstack/react-query").UseMutateAsyncFunction<import("@shipengine/react-api").ShipEngineAccountSettings, import("@shipengine/react-api").CodedError[], Partial<import("@shipengine/react-api").ShipEngineAccountSettings>, unknown>;
6
6
  updateVatSettingsErrors: import("@shipengine/react-api").CodedError[] | null;
7
- vatSettings: import("@shipengine/react-api").ShipEngineAccountSettings | undefined;
7
+ vatSettings: import("@shipengine/react-api").AccountSettingsTaxIdentifier | undefined;
8
8
  };
@@ -1,4 +1 @@
1
- export type VatSettingsProps = {
2
- showRegisterLaterText?: boolean;
3
- };
4
- export declare const VatSettings: ({ showRegisterLaterText }: VatSettingsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
1
+ export declare const VatSettings: () => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -18,6 +18,13 @@ export declare const styles: {
18
18
  tooltipContainer: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
19
19
  maxWidth: string;
20
20
  };
21
+ vatIssuingAuthority: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
22
+ color: string;
23
+ margin: number;
24
+ };
25
+ vatParagraph: () => {
26
+ margin: number;
27
+ };
21
28
  vatText: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
22
29
  alignItems: "center";
23
30
  display: "flex";
@@ -10,3 +10,5 @@ export * from "./use-root-portal";
10
10
  export * from "./use-run-once-on-true";
11
11
  export * from "./use-scrub-errors";
12
12
  export * from "./use-toggle";
13
+ export * from "./use-configure-shipment";
14
+ export * from "./use-import-sales-order";
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * @category Hooks
7
7
  */
8
- export declare const useCountryCodeOptions: (domestic?: boolean) => {
8
+ export declare const useCountryCodeOptions: () => {
9
9
  countryCodeOptions: {
10
10
  label: "Afghanistan" | "Aland Islands" | "Albania" | "Algeria" | "American Samoa" | "Andorra" | "Angola" | "Anguilla" | "Antarctica" | "Antigua Barbuda" | "Argentina" | "Armenia" | "Aruba" | "Australia" | "Austria" | "Azerbaijan" | "Bahamas" | "Bahrain" | "Bangladesh" | "Barbados" | "Belarus" | "Belgium" | "Belize" | "Benin" | "Bermuda" | "Bhutan" | "Bolivia" | "Bonaire, Sint Eustatius And Saba" | "Bosnia and Herzegovina" | "Botswana" | "Brazil" | "British Indian Ocean Territory" | "British Virgin Islands" | "Brunei Darussalam" | "Bulgaria" | "Burkina Faso" | "Burundi" | "Canada" | "Cambodia" | "Cameroon" | "Cape Verde Islands" | "Cayman Islands" | "Central African Republic" | "Chad" | "Chile" | "China" | "Christmas Island" | "Cocos(Keeling) Islands" | "Colombia" | "Comoros" | "Congo" | "Congo, The Democratic Republic of" | "Cook Islands" | "Costa Rica" | "Croatia" | "Cuba" | "Curacao" | "Cyprus" | "Czech Republic" | "Denmark" | "Djibouti" | "Dominica" | "Dominican Republic" | "Ecuador" | "Egypt" | "El Salvador" | "Equatorial Guinea" | "Eritrea" | "Estonia" | "Ethiopia" | "Falkland Islands" | "Faroe Islands" | "Federated States of Micronesia" | "Fiji" | "Finland" | "France" | "French Guiana" | "French Polynesia" | "French Southern Territories" | "Gabon" | "Gambia" | "Georgia" | "Germany" | "Ghana" | "Gibraltar" | "Greece" | "Greenland" | "Grenada" | "Guadeloupe" | "Guam" | "Guatemala" | "Guernsey" | "Guinea" | "Guinea - Bissau" | "Guyana" | "Haiti" | "Holy See" | "Honduras" | "Hong Kong" | "Hungary" | "Iceland" | "India" | "Indonesia" | "Iran" | "Iraq" | "Ireland" | "Isle of Man" | "Israel" | "Italy" | "Ivory Coast" | "Jamaica" | "Japan" | "Jersey" | "Jordan" | "Kazakhstan" | "Kenya" | "Kiribati" | "Korea, Republic of" | "Kuwait" | "Kyrgyzstan" | "Laos" | "Latvia" | "Lebanon" | "Lesotho" | "Liberia" | "Libya" | "Liechtenstein" | "Lithuania" | "Luxembourg" | "Macao" | "Macedonia" | "Madagascar" | "Malawi" | "Malaysia" | "Maldives" | "Mali" | "Malta" | "Marshall Islands" | "Martinique" | "Mauritania" | "Mauritius0" | "Mayotte" | "Mexico" | "Moldova" | "Monaco" | "Mongolia" | "Montenegro" | "Montserrat" | "Morocco" | "Mozambique" | "Myanmar" | "Namibia" | "Nauru" | "Nepal" | "Netherlands" | "Netherlands Antilles" | "New Caledonia" | "New Zealand" | "Nicaragua" | "Niger" | "Nigeria" | "Niue" | "Norfolk Island" | "North Korea" | "Northern Mariana Islands" | "Norway" | "Oman" | "Pakistan" | "Palau" | "Palestinian Territory" | "Panama" | "Papua New Guinea" | "Paraguay" | "Peru" | "Philippines" | "Pitcairn Island" | "Poland" | "Portugal" | "Puerto Rico" | "Qatar" | "Reunion" | "Romania" | "Russia" | "Rwanda" | "Saint Barthelemy" | "Saint Helena" | "Saint Kitts and Nevis" | "Saint Lucia" | "Saint Martin" | "Saint Pierre and Miquelon" | "Saint Vincent & the Grenadines" | "Samoa" | "San Marino" | "Sao Tome and Principe" | "Saudi Arabia" | "Senegal" | "Serbia" | "Seychelles" | "Sierra Leone" | "Singapore" | "Sint Maarten(Dutch)" | "Slovakia" | "Slovenia" | "Solomon Islands" | "Somalia" | "South Africa" | "South Georgia & the South Sandwich Islands" | "South Sudan" | "Spain" | "Sri Lanka" | "Sudan" | "Suriname" | "Svalbard & Jan Mayen Islands" | "Swaziland" | "Sweden" | "Switzerland" | "Syria" | "Taiwan" | "Tajikistan" | "Tanzania" | "Thailand" | "Timor - Leste(formerly East Timor)" | "Togo" | "Tokelau" | "Tonga" | "Trinidad and Tobago" | "Tunisia" | "Turkey" | "Turkmenistan" | "Turks and Caicos Islands" | "Tuvalu" | "Uganda" | "Ukraine" | "United Arab Emirates" | "United Kingdom" | "United States Virgin Islands" | "U.S. Minor Outlying Islands" | "United States of America" | "Uruguay" | "Uzbekistan" | "Vanuatu" | "Venezuela" | "Vietnam" | "Wallis and Futuna Islands" | "Western Sahara" | "Yemen" | "Zambia" | "Zimbabwe";
11
11
  value: "AF" | "AX" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AI" | "AQ" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BM" | "BT" | "BO" | "BQ" | "BA" | "BW" | "BR" | "IO" | "VG" | "BN" | "BG" | "BF" | "BI" | "CA" | "KH" | "CM" | "CV" | "KY" | "CF" | "TD" | "CL" | "CN" | "CX" | "CC" | "CO" | "KM" | "CG" | "CD" | "CK" | "CR" | "HR" | "CU" | "CW" | "CY" | "CZ" | "DK" | "DJ" | "DM" | "DO" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "ET" | "FK" | "FO" | "FM" | "FJ" | "FI" | "FR" | "GF" | "PF" | "TF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GI" | "GR" | "GL" | "GD" | "GP" | "GU" | "GT" | "GG" | "GN" | "GW" | "GY" | "HT" | "VA" | "HN" | "HK" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "CI" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "KR" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LY" | "LI" | "LT" | "LU" | "MO" | "MK" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MH" | "MQ" | "MR" | "MU" | "YT" | "MX" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "MM" | "NA" | "NR" | "NP" | "NL" | "AN" | "NC" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "KP" | "MP" | "NO" | "OM" | "PK" | "PW" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PN" | "PL" | "PT" | "PR" | "QA" | "RE" | "RO" | "RU" | "RW" | "BL" | "SH" | "KN" | "LC" | "MF" | "PM" | "VC" | "WS" | "SM" | "ST" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SB" | "SO" | "ZA" | "GS" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SZ" | "SE" | "CH" | "SY" | "TW" | "TJ" | "TZ" | "TH" | "TL" | "TG" | "TK" | "TO" | "TT" | "TN" | "TR" | "TM" | "TC" | "TV" | "UG" | "UA" | "AE" | "GB" | "VI" | "UM" | "US" | "UY" | "UZ" | "VU" | "VE" | "VN" | "WF" | "EH" | "YE" | "ZM" | "ZW";
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * @category Hooks
7
7
  */
8
- export declare const useStateCodeOptions: (domestic?: boolean) => {
9
- label: "Alabama" | "Alaska" | "American Samoa" | "Arizona" | "Arkansas" | "Armed Forces Americas" | "Armed Forces Europe" | "Armed Forces Pacific" | "California" | "Colorado" | "Connecticut" | "Delaware" | "District of Columbia" | "Florida" | "Georgia" | "Guam" | "Hawaii" | "Idaho" | "Illinois" | "Indiana" | "Iowa" | "Kansas" | "Kentucky" | "Louisiana" | "Maine" | "Marshall Islands" | "Maryland" | "Massachusetts" | "Michigan" | "Micronesia" | "Minnesota" | "Mississippi" | "Missouri" | "Montana" | "Nebraska" | "Nevada" | "New Hampshire" | "New Jersey" | "New Mexico" | "New York" | "North Carolina" | "North Dakota" | "Northern Mariana Islands" | "Ohio" | "Oklahoma" | "Oregon" | "Palau" | "Pennsylvania" | "Puerto Rico" | "Rhode Island" | "South Carolina" | "South Dakota" | "Tennessee" | "Texas" | "Utah" | "Vermont" | "Virgin Islands" | "Virginia" | "Washington" | "West Virginia" | "Wisconsin" | "Wyoming" | "U.S. Minor Outlying Islands";
8
+ export declare const useStateCodeOptions: () => {
9
+ label: string;
10
10
  value: "AL" | "AK" | "AS" | "AZ" | "AR" | "AA" | "AE" | "AP" | "CA" | "CO" | "CT" | "DE" | "DC" | "FL" | "GA" | "GU" | "HI" | "ID" | "IL" | "IN" | "IA" | "KS" | "KY" | "LA" | "ME" | "MH" | "MD" | "MA" | "MI" | "FM" | "MN" | "MS" | "MO" | "MT" | "NE" | "NV" | "NH" | "NJ" | "NM" | "NY" | "NC" | "ND" | "MP" | "OH" | "OK" | "OR" | "PW" | "PA" | "PR" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VT" | "VI" | "VA" | "WA" | "WV" | "WI" | "WY" | "UM";
11
11
  }[];
@@ -1,30 +1,25 @@
1
1
  import { CodedError, SE } from "@shipengine/react-api";
2
- import { ConfigureShipmentProps } from "../configure-shipment";
2
+ import { ShipFromAddress } from "../types";
3
3
  export type UseConfigureShipmentProps = {
4
4
  errorWhenShipmentCancelled?: boolean;
5
5
  externalOrderId?: string;
6
6
  externalOrderNumber?: string;
7
7
  externalShipmentId?: string;
8
8
  onLoad?: (shipments: SE.SalesOrderShipment[], salesOrder?: SE.SalesOrder, pendingShipment?: SE.SalesOrderShipment) => Promise<void> | void;
9
- onShipmentUpdated: ConfigureShipmentProps["onShipmentUpdated"];
9
+ onShipmentUpdated?: (shipment: SE.SalesOrderShipment) => Promise<void> | void;
10
10
  orderSourceCode?: string;
11
11
  salesOrderId?: string;
12
- shipFromAddresses?: ConfigureShipmentProps["shipFromAddresses"];
12
+ shipFromAddresses?: ShipFromAddress[];
13
13
  shipmentId?: string;
14
14
  useWarehouses?: boolean;
15
15
  warehouseId?: string;
16
16
  };
17
- /**
18
- * The high-level goal of this hook is to get or create the required data to run the Configure shipment component.
19
- * To run the Configure Shipment Component you need shipments. To get a shipment you either need a Shipment ID or
20
- * a Sales Order Id (or other relevant Sales Order entity id, external order id, order source code, external order number).
21
- * My initial thought is to combine the hooks used in useGetOrCreateShipment and useImportSalesOrder to pull in all
22
- * the relevant information. I will leverage the built-in functionality of the React Query Hooks to optimize this custom hook.
23
- */
24
17
  export declare const useConfigureShipment: ({ onShipmentUpdated, onLoad, errorWhenShipmentCancelled, externalOrderId, externalOrderNumber, externalShipmentId, orderSourceCode, salesOrderId, shipFromAddresses, shipmentId, warehouseId, useWarehouses, }: UseConfigureShipmentProps) => {
18
+ carriers: SE.Carrier[] | undefined;
25
19
  errors: CodedError[] | undefined;
26
20
  isLoading: boolean;
27
21
  refetchPendingSalesOrderShipments: () => Promise<SE.SalesOrderShipment | undefined>;
28
22
  salesOrder: SE.SalesOrder | undefined;
29
23
  shipment: SE.SalesOrderShipment | undefined;
24
+ warehouses: SE.Warehouse[] | undefined;
30
25
  };
@@ -0,0 +1,3 @@
1
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
2
+ export default _default;
3
+ export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
@@ -97,16 +97,18 @@ declare const _default: {
97
97
  vatNumber: string;
98
98
  vatRegistrationTooltip: string;
99
99
  vatFormText: string;
100
- vatFormRegisterLater: string;
101
100
  vatNumberInputHint: string;
102
101
  vatNumberInputPlaceholder: string;
103
102
  verifiedVat: string;
103
+ vatNumberFieldLabel: string;
104
+ vatTypePlaceholder: string;
105
+ issuingAuthorityPlaceholder: string;
106
+ issuingAuthorityFieldLabel: string;
104
107
  vatFormErrors: {
105
108
  invalidFieldValue: string;
106
109
  verificationFailure: string;
107
110
  forbidden: string;
108
111
  connectionNotSupported: string;
109
- genericTitle: string;
110
112
  genericText: string;
111
113
  };
112
114
  };
@@ -798,6 +800,7 @@ declare const _default: {
798
800
  taxIssuingAuthority: string;
799
801
  entityType: string;
800
802
  };
803
+ hsCode: string;
801
804
  nonDelivery: {
802
805
  returnToSender: string;
803
806
  treatAsAbandoned: string;
@@ -835,6 +838,7 @@ declare const _default: {
835
838
  shipments: string;
836
839
  warehouses: string;
837
840
  };
841
+ labelHasBeenPurchased: string;
838
842
  emailIsRequired: string;
839
843
  unknown: string;
840
844
  noRatesAvailable: string;
@@ -0,0 +1,10 @@
1
+ export type HarmonizedTariffCode = {
2
+ /**
3
+ * The HS Code value
4
+ */
5
+ code: string;
6
+ /**
7
+ * The description of the HS Code
8
+ */
9
+ description: string;
10
+ };
@@ -1,6 +1,7 @@
1
+ export * from "./canada-ddp";
1
2
  export * from "./carrier-metadata";
2
- export * from "./shipping-preset";
3
- export * from "./preferred-rates";
3
+ export * from "./harmonized-tariff-code";
4
4
  export * from "./insurance-metadata";
5
+ export * from "./preferred-rates";
5
6
  export * from "./ship-from-address";
6
- export * from "./canada-ddp";
7
+ export * from "./shipping-preset";
@@ -133,16 +133,18 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
133
133
  vatNumber: string;
134
134
  vatRegistrationTooltip: string;
135
135
  vatFormText: string;
136
- vatFormRegisterLater: string;
137
136
  vatNumberInputHint: string;
138
137
  vatNumberInputPlaceholder: string;
139
138
  verifiedVat: string;
139
+ vatNumberFieldLabel: string;
140
+ vatTypePlaceholder: string;
141
+ issuingAuthorityPlaceholder: string;
142
+ issuingAuthorityFieldLabel: string;
140
143
  vatFormErrors: {
141
144
  invalidFieldValue: string;
142
145
  verificationFailure: string;
143
146
  forbidden: string;
144
147
  connectionNotSupported: string;
145
- genericTitle: string;
146
148
  genericText: string;
147
149
  };
148
150
  };
@@ -834,6 +836,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
834
836
  taxIssuingAuthority: string;
835
837
  entityType: string;
836
838
  };
839
+ hsCode: string;
837
840
  nonDelivery: {
838
841
  returnToSender: string;
839
842
  treatAsAbandoned: string;
@@ -871,6 +874,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
871
874
  shipments: string;
872
875
  warehouses: string;
873
876
  };
877
+ labelHasBeenPurchased: string;
874
878
  emailIsRequired: string;
875
879
  unknown: string;
876
880
  noRatesAvailable: string;
@@ -130,39 +130,18 @@ export declare const Element: ({ resources, ...props }: CarrierServicesProps & {
130
130
  vatNumber: string;
131
131
  vatRegistrationTooltip: string;
132
132
  vatFormText: string;
133
- vatFormRegisterLater: string;
134
133
  vatNumberInputHint: string;
135
- /**
136
- * # Carrier-Services Component
137
- *
138
- * @param ComponentProps The base props that will be passed into the `<CarrierServices />` component.
139
- *
140
- * @returns Element A React element that renders the `<CarrierServices />` component allowing users
141
- * to view a list of carriers that are connected to their ShipEngine account, add funds to their wallet, view transaction history, and manage their payment method. This component is
142
- * composed in the `<AccountSettings />` Element.
143
- *
144
- * @example
145
- * ```tsx
146
- * (() => {
147
- * const features = useFeatures("Global");
148
- *
149
- * return <CarrierServices.Element features={features} />;
150
- * })();
151
- * ```
152
- *
153
- * <br />
154
- *
155
- * @see {@link CarrierServices.ComponentProps | The props that are passed into the `<CarrierServices />` component}
156
- * @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<CarrierServices />` component}
157
- */
158
134
  vatNumberInputPlaceholder: string;
159
135
  verifiedVat: string;
136
+ vatNumberFieldLabel: string;
137
+ vatTypePlaceholder: string;
138
+ issuingAuthorityPlaceholder: string;
139
+ issuingAuthorityFieldLabel: string;
160
140
  vatFormErrors: {
161
141
  invalidFieldValue: string;
162
142
  verificationFailure: string;
163
143
  forbidden: string;
164
144
  connectionNotSupported: string;
165
- genericTitle: string;
166
145
  genericText: string;
167
146
  };
168
147
  };
@@ -877,6 +856,7 @@ export declare const Element: ({ resources, ...props }: CarrierServicesProps & {
877
856
  taxIssuingAuthority: string;
878
857
  entityType: string;
879
858
  };
859
+ hsCode: string;
880
860
  nonDelivery: {
881
861
  returnToSender: string;
882
862
  treatAsAbandoned: string;
@@ -914,6 +894,7 @@ export declare const Element: ({ resources, ...props }: CarrierServicesProps & {
914
894
  shipments: string;
915
895
  warehouses: string;
916
896
  };
897
+ labelHasBeenPurchased: string;
917
898
  emailIsRequired: string;
918
899
  unknown: string;
919
900
  noRatesAvailable: string;
@@ -157,16 +157,18 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
157
157
  vatNumber: string;
158
158
  vatRegistrationTooltip: string;
159
159
  vatFormText: string;
160
- vatFormRegisterLater: string;
161
160
  vatNumberInputHint: string;
162
161
  vatNumberInputPlaceholder: string;
163
162
  verifiedVat: string;
163
+ vatNumberFieldLabel: string;
164
+ vatTypePlaceholder: string;
165
+ issuingAuthorityPlaceholder: string;
166
+ issuingAuthorityFieldLabel: string;
164
167
  vatFormErrors: {
165
168
  invalidFieldValue: string;
166
169
  verificationFailure: string;
167
170
  forbidden: string;
168
171
  connectionNotSupported: string;
169
- genericTitle: string;
170
172
  genericText: string;
171
173
  };
172
174
  };
@@ -858,6 +860,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
858
860
  taxIssuingAuthority: string;
859
861
  entityType: string;
860
862
  };
863
+ hsCode: string;
861
864
  nonDelivery: {
862
865
  returnToSender: string;
863
866
  treatAsAbandoned: string;
@@ -895,6 +898,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
895
898
  shipments: string;
896
899
  warehouses: string;
897
900
  };
901
+ labelHasBeenPurchased: string;
898
902
  emailIsRequired: string;
899
903
  unknown: string;
900
904
  noRatesAvailable: string;