@shipengine/elements 0.25.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/index.cjs +1147 -663
  2. package/index.js +1154 -677
  3. package/package.json +12 -4
  4. package/src/components/field/field.styles.d.ts +2 -12
  5. package/src/components/index.d.ts +1 -0
  6. package/src/components/label-layout/label-layout-settings.d.ts +3 -1
  7. package/src/components/powered-by-shipengine/index.d.ts +1 -0
  8. package/src/components/powered-by-shipengine/powered-by-shipengine.d.ts +1 -0
  9. package/src/components/powered-by-shipengine/powered-by-shipengine.styles.d.ts +11 -0
  10. package/src/components/save-status/index.d.ts +2 -0
  11. package/src/components/save-status/save-status-styles.d.ts +43 -0
  12. package/src/components/save-status/save-status.d.ts +6 -0
  13. package/src/components/templates/index.d.ts +0 -1
  14. package/src/components/templates/rate-form/rate-form.d.ts +1 -0
  15. package/src/constants/shipengine/address.d.ts +2 -0
  16. package/src/elements/list-carriers/list-carriers.d.ts +28 -14
  17. package/src/elements/manage-warehouses/manage-warehouses.d.ts +28 -14
  18. package/src/elements/onboarding/onboarding.d.ts +28 -14
  19. package/src/elements/purchase-label/hooks/use-load-or-create-shipment.d.ts +6 -0
  20. package/src/elements/purchase-label/purchase-label-by-shipment.d.ts +5 -2
  21. package/src/elements/purchase-label/purchase-label.d.ts +40 -20
  22. package/src/elements/view-shipment/view-shipment.d.ts +28 -14
  23. package/src/{components/templates/void-label/void-label.d.ts → elements/void-label/components/actions/actions.d.ts} +3 -3
  24. package/src/elements/void-label/components/actions/index.d.ts +1 -0
  25. package/src/elements/void-label/components/index.d.ts +2 -0
  26. package/src/elements/void-label/components/message/index.d.ts +1 -0
  27. package/src/elements/void-label/components/message/message.d.ts +6 -0
  28. package/src/elements/void-label/void-label.d.ts +28 -14
  29. package/src/hooks/options/index.d.ts +1 -0
  30. package/src/hooks/options/use-package-options.d.ts +1 -1
  31. package/src/hooks/options/use-service-code-options.d.ts +1 -1
  32. package/src/hooks/options/use-shipment-metadata.d.ts +8 -0
  33. package/src/hooks/options/use-shipping-presets-options.d.ts +2 -1
  34. package/src/hooks/use-get-or-create-shipment.d.ts +2 -0
  35. package/src/locales/en/index.d.ts +28 -14
  36. package/src/mocks/server.d.ts +1 -0
  37. package/src/testing/extensions/index.d.ts +2 -0
  38. package/src/testing/extensions/matchers/extend-matchers.d.ts +8 -0
  39. package/src/testing/extensions/matchers/index.d.ts +1 -0
  40. package/src/testing/extensions/matchers/matchers.d.ts +1 -0
  41. package/src/testing/extensions/matchers/to-have-loading-spinner.d.ts +2 -0
  42. package/src/testing/extensions/queries/by-icon-name.d.ts +4 -0
  43. package/src/testing/extensions/queries/index.d.ts +57 -0
  44. package/src/testing/extensions/queries/queries.d.ts +1 -0
  45. package/src/testing/index.d.ts +1 -1
  46. package/src/testing/test-utils.d.ts +292 -0
  47. package/src/utilities/error.d.ts +13 -0
  48. package/src/utilities/i18nDateUtils.d.ts +16 -0
  49. package/src/utilities/shipengine/address.d.ts +4 -0
  50. package/src/utilities/shipengine/carrier.d.ts +1 -0
  51. package/src/components/templates/void-label/index.d.ts +0 -1
  52. package/src/public-sdk.d.ts +0 -38
  53. package/src/testing/render.d.ts +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "0.25.0",
3
+ "version": "0.26.1",
4
4
  "typedoc": {
5
5
  "entryPoint": "./src/index.ts",
6
6
  "readmeFile": "../../README.md",
@@ -27,22 +27,30 @@
27
27
  "@emotion/serialize": "1.1.1",
28
28
  "@faker-js/faker": "7.6.0",
29
29
  "@hookform/resolvers": "2.9.1",
30
+ "@jest/globals": "28.1.3",
30
31
  "@packlink/brands": "3.24.0",
31
32
  "@packlink/giger-theme": "1.3.1",
32
- "@shipengine/alchemy": "0.4.14",
33
- "@shipengine/js-api": "0.7.1",
33
+ "@shipengine/alchemy": "0.4.18",
34
+ "@shipengine/js-api": "0.10.0",
35
+ "@shipengine/react-api": "0.5.6",
36
+ "@storybook/addons": "6.5.16",
37
+ "@storybook/components": "7.0.0-rc.1",
38
+ "@storybook/core-events": "7.0.0-rc.1",
34
39
  "@storybook/manager-api": "7.0.0-rc.1",
35
40
  "@storybook/theming": "7.0.0-rc.1",
41
+ "@testing-library/dom": "8.19.0",
36
42
  "@vitejs/plugin-react": "1.3.2",
37
43
  "axios": "0.26.1",
38
44
  "card-validator": "8.1.1",
39
45
  "copy-to-clipboard": "3.3.3",
46
+ "date-fns": "2.29.3",
47
+ "expect": "28.1.3",
40
48
  "humps": "2.0.1",
41
49
  "js-base64": "3.7.3",
42
50
  "libphonenumber-js": "1.10.14",
43
51
  "lodash": "4.17.21",
44
52
  "react": "18.2.0",
45
- "react-datepicker": "4.8.0",
53
+ "react-datepicker": "4.11.0",
46
54
  "react-dom": "18.2.0",
47
55
  "react-hook-form": "7.40.0",
48
56
  "react-query": "3.39.3",
@@ -1,13 +1,3 @@
1
+ import { Interpolation } from "@emotion/serialize";
1
2
  import { Theme } from "@packlink/giger-theme";
2
- export declare const getOverrideStyles: (theme: Theme) => {
3
- "&& input, && span[role='button']": {
4
- cursor: string;
5
- fontWeight: number;
6
- };
7
- "&& input:hover": {
8
- cursor: string;
9
- };
10
- "&&.disabled input:hover": {
11
- cursor: string;
12
- };
13
- };
3
+ export declare const getOverrideStyles: (theme: Theme) => Interpolation<Theme>;
@@ -18,6 +18,7 @@ export * from "./link-action";
18
18
  export * from "./loader";
19
19
  export * from "./manage-funding";
20
20
  export * from "./portal";
21
+ export * from "./powered-by-shipengine";
21
22
  export * from "./section";
22
23
  export * from "./spacer";
23
24
  export * from "./spread";
@@ -1,5 +1,7 @@
1
1
  import { SE } from "@shipengine/alchemy";
2
2
  export type LabelLayoutSettingsProps = {
3
+ errors: SE.CodedError[] | null;
4
+ isSaving: boolean;
3
5
  onChange: (layout: SE.LabelLayout) => void;
4
6
  };
5
- export declare const LabelLayoutSettings: ({ onChange }: LabelLayoutSettingsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export declare const LabelLayoutSettings: ({ errors, isSaving, onChange }: LabelLayoutSettingsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './powered-by-shipengine';
@@ -0,0 +1 @@
1
+ export declare const PoweredByShipEngine: () => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ export declare const styles: {
2
+ poweredByShipEngine: {
3
+ display: "flex";
4
+ alignItems: "center";
5
+ justifyContent: "center";
6
+ textAlign: "center";
7
+ margin: string;
8
+ gap: string;
9
+ color: "#818F9C";
10
+ };
11
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./save-status";
2
+ export * from "./save-status-styles";
@@ -0,0 +1,43 @@
1
+ export declare const colors: {
2
+ green: string;
3
+ grey: string;
4
+ red: string;
5
+ };
6
+ export declare const styles: {
7
+ checkmark: () => {
8
+ animation: `${string} forwards`;
9
+ borderRadius: string;
10
+ height: string;
11
+ stroke: "#fff";
12
+ width: string;
13
+ };
14
+ checkmarkCheck: () => {
15
+ animation: `${string} 1s forwards`;
16
+ strokeDasharray: string;
17
+ strokeDashoffset: string;
18
+ };
19
+ container: (theme: import("@packlink/giger-theme/dist/lib/Theme").Theme) => {
20
+ alignItems: "center";
21
+ animation: `${string} 2.5s ease-in-out forwards`;
22
+ display: "flex";
23
+ justifyContent: "flex-start";
24
+ padding: string;
25
+ };
26
+ saved: (theme: import("@packlink/giger-theme/dist/lib/Theme").Theme) => {
27
+ color: string;
28
+ marginLeft: string;
29
+ };
30
+ saving: (theme: import("@packlink/giger-theme/dist/lib/Theme").Theme) => {
31
+ marginLeft: string;
32
+ };
33
+ savingContainer: () => {
34
+ alignItems: "center";
35
+ color: string;
36
+ display: "flex";
37
+ justifyContent: "flex-start";
38
+ };
39
+ savingFailed: (theme: import("@packlink/giger-theme/dist/lib/Theme").Theme) => {
40
+ color: "#EE3B3F";
41
+ marginLeft: string;
42
+ };
43
+ };
@@ -0,0 +1,6 @@
1
+ import { SE } from "@shipengine/alchemy";
2
+ export type SaveStatusProps = {
3
+ errors: SE.CodedError[] | null;
4
+ isSaving: boolean;
5
+ };
6
+ export declare const SaveStatus: ({ errors, isSaving }: SaveStatusProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -17,7 +17,6 @@ export * from "./shipment-form";
17
17
  export * from "./shipment";
18
18
  export * from "./suspend-shipment";
19
19
  export * from "./warehouse-form";
20
- export * from "./void-label";
21
20
  export * from "./wallet-form";
22
21
  export * from "../address-preference-context";
23
22
  export * from "./address-preference-select";
@@ -2,6 +2,7 @@ import { SE } from "@shipengine/alchemy";
2
2
  export type RateFormFeatures = {
3
3
  enableFunding?: boolean;
4
4
  enableGlobalPostFiltering?: boolean;
5
+ labelLayout?: boolean;
5
6
  nicknameRate?: boolean;
6
7
  saveRate?: boolean;
7
8
  };
@@ -2,6 +2,7 @@ export type CountryRules = {
2
2
  hasEuCustomsRules?: boolean;
3
3
  hasProvinces?: boolean;
4
4
  isUnitedStatesTerritory?: boolean;
5
+ isUnsupportedByUps?: boolean;
5
6
  supportsByoa?: boolean;
6
7
  };
7
8
  export declare class Country<T extends string, U extends string> {
@@ -11,6 +12,7 @@ export declare class Country<T extends string, U extends string> {
11
12
  hasProvinces: boolean;
12
13
  isUnitedStatesTerritory: boolean;
13
14
  supportsByoa: boolean;
15
+ isUnsupportedByUps: boolean;
14
16
  constructor(name: T, code: U, rules?: CountryRules);
15
17
  }
16
18
  export declare const countries: readonly [Country<"Afghanistan", "AF">, Country<"Aland Islands", "AX">, Country<"Albania", "AL">, Country<"Algeria", "DZ">, Country<"American Samoa", "AS">, Country<"Andorra", "AD">, Country<"Angola", "AO">, Country<"Anguilla", "AI">, Country<"Antarctica", "AQ">, Country<"Antigua Barbuda", "AG">, Country<"Argentina", "AR">, Country<"Armenia", "AM">, Country<"Aruba", "AW">, Country<"Australia", "AU">, Country<"Austria", "AT">, Country<"Azerbaijan", "AZ">, Country<"Bahamas", "BS">, Country<"Bahrain", "BH">, Country<"Bangladesh", "BD">, Country<"Barbados", "BB">, Country<"Belarus", "BY">, Country<"Belgium", "BE">, Country<"Belize", "BZ">, Country<"Benin", "BJ">, Country<"Bermuda", "BM">, Country<"Bhutan", "BT">, Country<"Bolivia", "BO">, Country<"Bonaire, Sint Eustatius And Saba", "BQ">, Country<"Bosnia and Herzegovina", "BA">, Country<"Botswana", "BW">, Country<"Brazil", "BR">, Country<"British Indian Ocean Territory", "IO">, Country<"British Virgin Islands", "VG">, Country<"Brunei Darussalam", "BN">, Country<"Bulgaria", "BG">, Country<"Burkina Faso", "BF">, Country<"Burundi", "BI">, Country<"Canada", "CA">, Country<"Cambodia", "KH">, Country<"Cameroon", "CM">, Country<"Cape Verde Islands", "CV">, Country<"Cayman Islands", "KY">, Country<"Central African Republic", "CF">, Country<"Chad", "TD">, Country<"Chile", "CL">, Country<"China", "CN">, Country<"Christmas Island", "CX">, Country<"Cocos(Keeling) Islands", "CC">, Country<"Colombia", "CO">, Country<"Comoros", "KM">, Country<"Congo", "CG">, Country<"Congo, The Democratic Republic of", "CD">, Country<"Cook Islands", "CK">, Country<"Costa Rica", "CR">, Country<"Croatia", "HR">, Country<"Cuba", "CU">, Country<"Curacao", "CW">, Country<"Cyprus", "CY">, Country<"Czech Republic", "CZ">, Country<"Denmark", "DK">, Country<"Djibouti", "DJ">, Country<"Dominica", "DM">, Country<"Dominican Republic", "DO">, Country<"Ecuador", "EC">, Country<"Egypt", "EG">, Country<"El Salvador", "SV">, Country<"Equatorial Guinea", "GQ">, Country<"Eritrea", "ER">, Country<"Estonia", "EE">, Country<"Ethiopia", "ET">, Country<"Falkland Islands", "FK">, Country<"Faroe Islands", "FO">, Country<"Federated States of Micronesia", "FM">, Country<"Fiji", "FJ">, Country<"Finland", "FI">, Country<"France", "FR">, Country<"French Guiana", "GF">, Country<"French Polynesia", "PF">, Country<"French Southern Territories", "TF">, Country<"Gabon", "GA">, Country<"Gambia", "GM">, Country<"Georgia", "GE">, Country<"Germany", "DE">, Country<"Ghana", "GH">, Country<"Gibraltar", "GI">, Country<"Greece", "GR">, Country<"Greenland", "GL">, Country<"Grenada", "GD">, Country<"Guadeloupe", "GP">, Country<"Guam", "GU">, Country<"Guatemala", "GT">, Country<"Guernsey", "GG">, Country<"Guinea", "GN">, Country<"Guinea - Bissau", "GW">, Country<"Guyana", "GY">, Country<"Haiti", "HT">, Country<"Holy See", "VA">, Country<"Honduras", "HN">, Country<"Hong Kong", "HK">, Country<"Hungary", "HU">, Country<"Iceland", "IS">, Country<"India", "IN">, Country<"Indonesia", "ID">, Country<"Iran", "IR">, Country<"Iraq", "IQ">, Country<"Ireland", "IE">, Country<"Isle of Man", "IM">, Country<"Israel", "IL">, Country<"Italy", "IT">, Country<"Ivory Coast", "CI">, Country<"Jamaica", "JM">, Country<"Japan", "JP">, Country<"Jersey", "JE">, Country<"Jordan", "JO">, Country<"Kazakhstan", "KZ">, Country<"Kenya", "KE">, Country<"Kiribati", "KI">, Country<"Korea, Republic of", "KR">, Country<"Kuwait", "KW">, Country<"Kyrgyzstan", "KG">, Country<"Laos", "LA">, Country<"Latvia", "LV">, Country<"Lebanon", "LB">, Country<"Lesotho", "LS">, Country<"Liberia", "LR">, Country<"Libya", "LY">, Country<"Liechtenstein", "LI">, Country<"Lithuania", "LT">, Country<"Luxembourg", "LU">, Country<"Macao", "MO">, Country<"Macedonia", "MK">, Country<"Madagascar", "MG">, Country<"Malawi", "MW">, Country<"Malaysia", "MY">, Country<"Maldives", "MV">, Country<"Mali", "ML">, Country<"Malta", "MT">, Country<"Marshall Islands", "MH">, Country<"Martinique", "MQ">, Country<"Mauritania", "MR">, Country<"Mauritius0", "MU">, Country<"Mayotte", "YT">, Country<"Mexico", "MX">, Country<"Moldova", "MD">, Country<"Monaco", "MC">, Country<"Mongolia", "MN">, Country<"Montenegro", "ME">, Country<"Montserrat", "MS">, Country<"Morocco", "MA">, Country<"Mozambique", "MZ">, Country<"Myanmar", "MM">, Country<"Namibia", "NA">, Country<"Nauru", "NR">, Country<"Nepal", "NP">, Country<"Netherlands", "NL">, Country<"Netherlands Antilles", "AN">, Country<"New Caledonia", "NC">, Country<"New Zealand", "NZ">, Country<"Nicaragua", "NI">, Country<"Niger", "NE">, Country<"Nigeria", "NG">, Country<"Niue", "NU">, Country<"Norfolk Island", "NF">, Country<"North Korea", "KP">, Country<"Northern Mariana Islands", "MP">, Country<"Norway", "NO">, Country<"Oman", "OM">, Country<"Pakistan", "PK">, Country<"Palau", "PW">, Country<"Palestinian Territory", "PS">, Country<"Panama", "PA">, Country<"Papua New Guinea", "PG">, Country<"Paraguay", "PY">, Country<"Peru", "PE">, Country<"Philippines", "PH">, Country<"Pitcairn Island", "PN">, Country<"Poland", "PL">, Country<"Portugal", "PT">, Country<"Puerto Rico", "PR">, Country<"Qatar", "QA">, Country<"Reunion", "RE">, Country<"Romania", "RO">, Country<"Russia", "RU">, Country<"Rwanda", "RW">, Country<"Saint Barthelemy", "BL">, Country<"Saint Helena", "SH">, Country<"Saint Kitts and Nevis", "KN">, Country<"Saint Lucia", "LC">, Country<"Saint Martin", "MF">, Country<"Saint Pierre and Miquelon", "PM">, Country<"Saint Vincent & the Grenadines", "VC">, Country<"Samoa", "WS">, Country<"San Marino", "SM">, Country<"Sao Tome and Principe", "ST">, Country<"Saudi Arabia", "SA">, Country<"Senegal", "SN">, Country<"Serbia", "RS">, Country<"Seychelles", "SC">, Country<"Sierra Leone", "SL">, Country<"Singapore", "SG">, Country<"Sint Maarten(Dutch)", "SX">, Country<"Slovakia", "SK">, Country<"Slovenia", "SI">, Country<"Solomon Islands", "SB">, Country<"Somalia", "SO">, Country<"South Africa", "ZA">, Country<"South Georgia & the South Sandwich Islands", "GS">, Country<"South Sudan", "SS">, Country<"Spain", "ES">, Country<"Sri Lanka", "LK">, Country<"Sudan", "SD">, Country<"Suriname", "SR">, Country<"Svalbard & Jan Mayen Islands", "SJ">, Country<"Swaziland", "SZ">, Country<"Sweden", "SE">, Country<"Switzerland", "CH">, Country<"Syria", "SY">, Country<"Taiwan", "TW">, Country<"Tajikistan", "TJ">, Country<"Tanzania", "TZ">, Country<"Thailand", "TH">, Country<"Timor - Leste(formerly East Timor)", "TL">, Country<"Togo", "TG">, Country<"Tokelau", "TK">, Country<"Tonga", "TO">, Country<"Trinidad and Tobago", "TT">, Country<"Tunisia", "TN">, Country<"Turkey", "TR">, Country<"Turkmenistan", "TM">, Country<"Turks and Caicos Islands", "TC">, Country<"Tuvalu", "TV">, Country<"Uganda", "UG">, Country<"Ukraine", "UA">, Country<"United Arab Emirates", "AE">, Country<"United Kingdom", "GB">, Country<"United States Virgin Islands", "VI">, Country<"U.S. Minor Outlying Islands", "UM">, Country<"United States of America", "US">, Country<"Uruguay", "UY">, Country<"Uzbekistan", "UZ">, Country<"Vanuatu", "VU">, Country<"Venezuela", "VE">, Country<"Vietnam", "VN">, Country<"Wallis and Futuna Islands", "WF">, Country<"Western Sahara", "EH">, Country<"Yemen", "YE">, Country<"Zambia", "ZM">, Country<"Zimbabwe", "ZW">];
@@ -23,6 +23,9 @@ export declare const Element: ({ resources, ...props }: object & {
23
23
  confirmVoid: string;
24
24
  viewShipment: string;
25
25
  };
26
+ errorMessages: {
27
+ labelIdRequired: string;
28
+ };
26
29
  resultMessages: {
27
30
  approved: string;
28
31
  rejected: string;
@@ -141,6 +144,8 @@ export declare const Element: ({ resources, ...props }: object & {
141
144
  noRates: string;
142
145
  salesOrderNotLoaded: string;
143
146
  unsupportedAddress: string;
147
+ saveRateFailedMessage: string;
148
+ saveRateFailedTitle: string;
144
149
  };
145
150
  errorTypes: {
146
151
  results: string;
@@ -168,6 +173,7 @@ export declare const Element: ({ resources, ...props }: object & {
168
173
  shipDate: string;
169
174
  service: string;
170
175
  shipTo: string;
176
+ addShipToAddress: string;
171
177
  warehouse: string;
172
178
  weight: {
173
179
  whole: string;
@@ -233,21 +239,8 @@ export declare const Element: ({ resources, ...props }: object & {
233
239
  };
234
240
  };
235
241
  "manage-defaults": {
236
- units: {
237
- title: string;
238
- dimensions: {
239
- title: string;
240
- standard: string;
241
- metric: string;
242
- };
243
- weight: {
244
- title: string;
245
- standard: string;
246
- g: string;
247
- kg: string;
248
- };
249
- };
250
242
  label: {
243
+ title: string;
251
244
  letter: {
252
245
  title: string;
253
246
  description: string;
@@ -260,7 +253,25 @@ export declare const Element: ({ resources, ...props }: object & {
260
253
  title: string;
261
254
  description: string;
262
255
  };
256
+ };
257
+ status: {
258
+ saving: string;
259
+ saved: string;
260
+ savingFailed: string;
261
+ };
262
+ units: {
263
263
  title: string;
264
+ dimensions: {
265
+ title: string;
266
+ standard: string;
267
+ metric: string;
268
+ };
269
+ weight: {
270
+ title: string;
271
+ standard: string;
272
+ g: string;
273
+ kg: string;
274
+ };
264
275
  };
265
276
  };
266
277
  "manage-warehouses": {
@@ -475,6 +486,7 @@ export declare const Element: ({ resources, ...props }: object & {
475
486
  autoFundingSettings: string;
476
487
  carrier: string;
477
488
  carriers: string;
489
+ label: string;
478
490
  salesOrder: string;
479
491
  shipment: string;
480
492
  warehouses: string;
@@ -505,6 +517,7 @@ export declare const Element: ({ resources, ...props }: object & {
505
517
  carriers: string;
506
518
  data: string;
507
519
  importingSalesOrder: string;
520
+ label: string;
508
521
  onboarding: string;
509
522
  salesOrder: string;
510
523
  shipment: string;
@@ -531,6 +544,7 @@ export declare const Element: ({ resources, ...props }: object & {
531
544
  packageCodes: {
532
545
  package: string;
533
546
  };
547
+ "powered-by": string;
534
548
  schema: {
535
549
  optionalLabel: string;
536
550
  };
@@ -27,6 +27,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
27
27
  confirmVoid: string;
28
28
  viewShipment: string;
29
29
  };
30
+ errorMessages: {
31
+ labelIdRequired: string;
32
+ };
30
33
  resultMessages: {
31
34
  approved: string;
32
35
  rejected: string;
@@ -145,6 +148,8 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
145
148
  noRates: string;
146
149
  salesOrderNotLoaded: string;
147
150
  unsupportedAddress: string;
151
+ saveRateFailedMessage: string;
152
+ saveRateFailedTitle: string;
148
153
  };
149
154
  errorTypes: {
150
155
  results: string;
@@ -172,6 +177,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
172
177
  shipDate: string;
173
178
  service: string;
174
179
  shipTo: string;
180
+ addShipToAddress: string;
175
181
  warehouse: string;
176
182
  weight: {
177
183
  whole: string;
@@ -237,21 +243,8 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
237
243
  };
238
244
  };
239
245
  "manage-defaults": {
240
- units: {
241
- title: string;
242
- dimensions: {
243
- title: string;
244
- standard: string;
245
- metric: string;
246
- };
247
- weight: {
248
- title: string;
249
- standard: string;
250
- g: string;
251
- kg: string;
252
- };
253
- };
254
246
  label: {
247
+ title: string;
255
248
  letter: {
256
249
  title: string;
257
250
  description: string;
@@ -264,7 +257,25 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
264
257
  title: string;
265
258
  description: string;
266
259
  };
260
+ };
261
+ status: {
262
+ saving: string;
263
+ saved: string;
264
+ savingFailed: string;
265
+ };
266
+ units: {
267
267
  title: string;
268
+ dimensions: {
269
+ title: string;
270
+ standard: string;
271
+ metric: string;
272
+ };
273
+ weight: {
274
+ title: string;
275
+ standard: string;
276
+ g: string;
277
+ kg: string;
278
+ };
268
279
  };
269
280
  };
270
281
  "manage-warehouses": {
@@ -479,6 +490,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
479
490
  autoFundingSettings: string;
480
491
  carrier: string;
481
492
  carriers: string;
493
+ label: string;
482
494
  salesOrder: string;
483
495
  shipment: string;
484
496
  warehouses: string;
@@ -509,6 +521,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
509
521
  carriers: string;
510
522
  data: string;
511
523
  importingSalesOrder: string;
524
+ label: string;
512
525
  onboarding: string;
513
526
  salesOrder: string;
514
527
  shipment: string;
@@ -535,6 +548,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
535
548
  packageCodes: {
536
549
  package: string;
537
550
  };
551
+ "powered-by": string;
538
552
  schema: {
539
553
  optionalLabel: string;
540
554
  };
@@ -26,6 +26,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
26
26
  confirmVoid: string;
27
27
  viewShipment: string;
28
28
  };
29
+ errorMessages: {
30
+ labelIdRequired: string;
31
+ };
29
32
  resultMessages: {
30
33
  approved: string;
31
34
  rejected: string;
@@ -144,6 +147,8 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
144
147
  noRates: string;
145
148
  salesOrderNotLoaded: string;
146
149
  unsupportedAddress: string;
150
+ saveRateFailedMessage: string;
151
+ saveRateFailedTitle: string;
147
152
  };
148
153
  errorTypes: {
149
154
  results: string;
@@ -171,6 +176,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
171
176
  shipDate: string;
172
177
  service: string;
173
178
  shipTo: string;
179
+ addShipToAddress: string;
174
180
  warehouse: string;
175
181
  weight: {
176
182
  whole: string;
@@ -236,21 +242,8 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
236
242
  };
237
243
  };
238
244
  "manage-defaults": {
239
- units: {
240
- title: string;
241
- dimensions: {
242
- title: string;
243
- standard: string;
244
- metric: string;
245
- };
246
- weight: {
247
- title: string;
248
- standard: string;
249
- g: string;
250
- kg: string;
251
- };
252
- };
253
245
  label: {
246
+ title: string;
254
247
  letter: {
255
248
  title: string;
256
249
  description: string;
@@ -263,7 +256,25 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
263
256
  title: string;
264
257
  description: string;
265
258
  };
259
+ };
260
+ status: {
261
+ saving: string;
262
+ saved: string;
263
+ savingFailed: string;
264
+ };
265
+ units: {
266
266
  title: string;
267
+ dimensions: {
268
+ title: string;
269
+ standard: string;
270
+ metric: string;
271
+ };
272
+ weight: {
273
+ title: string;
274
+ standard: string;
275
+ g: string;
276
+ kg: string;
277
+ };
267
278
  };
268
279
  };
269
280
  "manage-warehouses": {
@@ -478,6 +489,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
478
489
  autoFundingSettings: string;
479
490
  carrier: string;
480
491
  carriers: string;
492
+ label: string;
481
493
  salesOrder: string;
482
494
  shipment: string;
483
495
  warehouses: string;
@@ -508,6 +520,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
508
520
  carriers: string;
509
521
  data: string;
510
522
  importingSalesOrder: string;
523
+ label: string;
511
524
  onboarding: string;
512
525
  salesOrder: string;
513
526
  shipment: string;
@@ -534,6 +547,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
534
547
  packageCodes: {
535
548
  package: string;
536
549
  };
550
+ "powered-by": string;
537
551
  schema: {
538
552
  optionalLabel: string;
539
553
  };
@@ -0,0 +1,6 @@
1
+ export declare const useLoadOrCreateShipment: (shipmentId?: string) => {
2
+ errors: import("@shipengine/js-api").CodedError[] | undefined;
3
+ isLoading: boolean;
4
+ refetchShipment: <TPageData>(options?: (import("react-query").RefetchOptions & import("react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("react-query").QueryObserverResult<import("@shipengine/js-api").SalesOrderShipment, import("@shipengine/js-api").CodedError[]>>;
5
+ shipment: import("@shipengine/js-api").SalesOrderShipment | undefined;
6
+ };
@@ -2,8 +2,11 @@ import { ReactNode } from "react";
2
2
  import { SalesOrderProps } from "./purchase-label-by-sales-order";
3
3
  type ShipmentOrderProps = {
4
4
  children?: ReactNode;
5
+ } & ({
5
6
  shipmentId: string;
6
- };
7
+ } | {
8
+ oneOff: true;
9
+ });
7
10
  type PurchaseLabelByShipmentProps = Partial<SalesOrderProps> & ShipmentOrderProps;
8
- export declare const PurchaseLabelByShipment: ({ shipmentId, onLoad, onShipmentUpdated, features, ...props }: PurchaseLabelByShipmentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
11
+ export declare const PurchaseLabelByShipment: ({ onLoad, onShipmentUpdated, features, ...props }: PurchaseLabelByShipmentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
12
  export {};
@@ -1,12 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  import { SalesOrderProps } from "./purchase-label-by-sales-order";
3
- export type ComponentProps = SalesOrderProps & {
4
- shipmentId?: string;
3
+ type ComponentShipmentProps = SalesOrderProps & {
4
+ shipmentId: string;
5
5
  };
6
- export declare const Component: ({ shipmentId, ...props }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
- export declare const Element: ({ resources, ...props }: SalesOrderProps & {
8
- shipmentId?: string | undefined;
9
- } & {
6
+ type ComponentOneOffProps = SalesOrderProps & {
7
+ oneOff: true;
8
+ };
9
+ type ComponentSalesOrderProps = SalesOrderProps & {
10
+ salesOrderId: string;
11
+ };
12
+ export type ComponentProps = ComponentShipmentProps | ComponentOneOffProps | ComponentSalesOrderProps;
13
+ export declare const Component: ({ ...props }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
14
+ export declare const Element: ({ resources, ...props }: ComponentProps & {
10
15
  resources?: {
11
16
  en: {
12
17
  "wallet-history": {
@@ -29,6 +34,9 @@ export declare const Element: ({ resources, ...props }: SalesOrderProps & {
29
34
  confirmVoid: string;
30
35
  viewShipment: string;
31
36
  };
37
+ errorMessages: {
38
+ labelIdRequired: string;
39
+ };
32
40
  resultMessages: {
33
41
  approved: string;
34
42
  rejected: string;
@@ -147,6 +155,8 @@ export declare const Element: ({ resources, ...props }: SalesOrderProps & {
147
155
  noRates: string;
148
156
  salesOrderNotLoaded: string;
149
157
  unsupportedAddress: string;
158
+ saveRateFailedMessage: string;
159
+ saveRateFailedTitle: string;
150
160
  };
151
161
  errorTypes: {
152
162
  results: string;
@@ -174,6 +184,7 @@ export declare const Element: ({ resources, ...props }: SalesOrderProps & {
174
184
  shipDate: string;
175
185
  service: string;
176
186
  shipTo: string;
187
+ addShipToAddress: string;
177
188
  warehouse: string;
178
189
  weight: {
179
190
  whole: string;
@@ -239,21 +250,8 @@ export declare const Element: ({ resources, ...props }: SalesOrderProps & {
239
250
  };
240
251
  };
241
252
  "manage-defaults": {
242
- units: {
243
- title: string;
244
- dimensions: {
245
- title: string;
246
- standard: string;
247
- metric: string;
248
- };
249
- weight: {
250
- title: string;
251
- standard: string;
252
- g: string;
253
- kg: string;
254
- };
255
- };
256
253
  label: {
254
+ title: string;
257
255
  letter: {
258
256
  title: string;
259
257
  description: string;
@@ -266,7 +264,25 @@ export declare const Element: ({ resources, ...props }: SalesOrderProps & {
266
264
  title: string;
267
265
  description: string;
268
266
  };
267
+ };
268
+ status: {
269
+ saving: string;
270
+ saved: string;
271
+ savingFailed: string;
272
+ };
273
+ units: {
269
274
  title: string;
275
+ dimensions: {
276
+ title: string;
277
+ standard: string;
278
+ metric: string;
279
+ };
280
+ weight: {
281
+ title: string;
282
+ standard: string;
283
+ g: string;
284
+ kg: string;
285
+ };
270
286
  };
271
287
  };
272
288
  "manage-warehouses": {
@@ -481,6 +497,7 @@ export declare const Element: ({ resources, ...props }: SalesOrderProps & {
481
497
  autoFundingSettings: string;
482
498
  carrier: string;
483
499
  carriers: string;
500
+ label: string;
484
501
  salesOrder: string;
485
502
  shipment: string;
486
503
  warehouses: string;
@@ -511,6 +528,7 @@ export declare const Element: ({ resources, ...props }: SalesOrderProps & {
511
528
  carriers: string;
512
529
  data: string;
513
530
  importingSalesOrder: string;
531
+ label: string;
514
532
  onboarding: string;
515
533
  salesOrder: string;
516
534
  shipment: string;
@@ -537,6 +555,7 @@ export declare const Element: ({ resources, ...props }: SalesOrderProps & {
537
555
  packageCodes: {
538
556
  package: string;
539
557
  };
558
+ "powered-by": string;
540
559
  schema: {
541
560
  optionalLabel: string;
542
561
  };
@@ -588,3 +607,4 @@ export declare const Element: ({ resources, ...props }: SalesOrderProps & {
588
607
  } | undefined;
589
608
  }) => import("@emotion/react/jsx-runtime").JSX.Element;
590
609
  export type ElementProps = React.ComponentProps<typeof Element>;
610
+ export {};