@shipengine/elements 0.24.0 → 0.26.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 (74) hide show
  1. package/index.cjs +1442 -654
  2. package/index.js +1449 -668
  3. package/package.json +13 -4
  4. package/src/components/error-display/error-display.d.ts +1 -0
  5. package/src/components/error-display/error-display.styles.d.ts +19 -0
  6. package/src/components/error-display/index.d.ts +1 -0
  7. package/src/components/field/field.styles.d.ts +2 -12
  8. package/src/components/field/rate-card/rate-card.d.ts +1 -1
  9. package/src/components/history/history-card/history-card.styles.d.ts +12 -14
  10. package/src/components/history/history-card-extension/history-card-extension.d.ts +1 -0
  11. package/src/components/history/history-card-extension/history-card-extension.styles.d.ts +26 -0
  12. package/src/components/history/history-card-extension/index.d.ts +1 -0
  13. package/src/components/history/index.d.ts +1 -0
  14. package/src/components/index.d.ts +1 -0
  15. package/src/components/label/label.d.ts +1 -1
  16. package/src/components/label/label.styles.d.ts +5 -1
  17. package/src/components/label-layout/label-layout-settings.d.ts +3 -1
  18. package/src/components/link-action/link-action.d.ts +3 -1
  19. package/src/components/powered-by-shipengine/index.d.ts +1 -0
  20. package/src/components/powered-by-shipengine/powered-by-shipengine.d.ts +1 -0
  21. package/src/components/powered-by-shipengine/powered-by-shipengine.styles.d.ts +11 -0
  22. package/src/components/save-status/index.d.ts +2 -0
  23. package/src/components/save-status/save-status-styles.d.ts +43 -0
  24. package/src/components/save-status/save-status.d.ts +6 -0
  25. package/src/components/templates/index.d.ts +0 -1
  26. package/src/components/templates/rate-form/rate-form.d.ts +4 -1
  27. package/src/components/unit-settings/unit-settings.d.ts +1 -4
  28. package/src/constants/shipengine/address.d.ts +2 -0
  29. package/src/elements/configure-shipment/hooks/use-rates-form.d.ts +2 -0
  30. package/src/elements/list-carriers/list-carriers.d.ts +29 -14
  31. package/src/elements/manage-warehouses/manage-warehouses.d.ts +29 -14
  32. package/src/elements/onboarding/onboarding.d.ts +29 -14
  33. package/src/elements/purchase-label/hooks/use-load-or-create-shipment.d.ts +6 -0
  34. package/src/elements/purchase-label/purchase-label-by-shipment.d.ts +5 -2
  35. package/src/elements/purchase-label/purchase-label.d.ts +41 -20
  36. package/src/elements/view-shipment/view-shipment.d.ts +29 -14
  37. package/src/{components/templates/void-label/void-label.d.ts → elements/void-label/components/actions/actions.d.ts} +3 -3
  38. package/src/elements/void-label/components/actions/index.d.ts +1 -0
  39. package/src/elements/void-label/components/index.d.ts +2 -0
  40. package/src/elements/void-label/components/message/index.d.ts +1 -0
  41. package/src/elements/void-label/components/message/message.d.ts +6 -0
  42. package/src/elements/void-label/void-label.d.ts +29 -14
  43. package/src/factories/shipengine/wallet-history.d.ts +52 -0
  44. package/src/features/wallet-history/wallet-history.styles.d.ts +4 -0
  45. package/src/hooks/options/index.d.ts +1 -0
  46. package/src/hooks/options/use-package-options.d.ts +1 -1
  47. package/src/hooks/options/use-service-code-options.d.ts +1 -1
  48. package/src/hooks/options/use-shipment-metadata.d.ts +8 -0
  49. package/src/hooks/options/use-shipping-presets-options.d.ts +2 -1
  50. package/src/hooks/use-get-or-create-shipment.d.ts +2 -0
  51. package/src/locales/en/index.d.ts +29 -14
  52. package/src/mocks/account-settings/handlers.d.ts +8 -0
  53. package/src/mocks/account-settings/index.d.ts +1 -0
  54. package/src/mocks/index.d.ts +1 -0
  55. package/src/mocks/server.d.ts +1 -0
  56. package/src/testing/extensions/index.d.ts +2 -0
  57. package/src/testing/extensions/matchers/extend-matchers.d.ts +8 -0
  58. package/src/testing/extensions/matchers/index.d.ts +1 -0
  59. package/src/testing/extensions/matchers/matchers.d.ts +1 -0
  60. package/src/testing/extensions/matchers/to-have-loading-spinner.d.ts +2 -0
  61. package/src/testing/extensions/queries/by-icon-name.d.ts +4 -0
  62. package/src/testing/extensions/queries/index.d.ts +57 -0
  63. package/src/testing/extensions/queries/queries.d.ts +1 -0
  64. package/src/testing/index.d.ts +1 -1
  65. package/src/testing/test-utils.d.ts +292 -0
  66. package/src/utilities/error.d.ts +13 -0
  67. package/src/utilities/i18nDateUtils.d.ts +16 -0
  68. package/src/utilities/rates.d.ts +1 -1
  69. package/src/utilities/shipengine/address.d.ts +4 -0
  70. package/src/utilities/shipengine/carrier.d.ts +1 -0
  71. package/vite.config.d.ts +2 -0
  72. package/src/components/templates/void-label/index.d.ts +0 -1
  73. package/src/public-sdk.d.ts +0 -38
  74. package/src/testing/render.d.ts +0 -6
@@ -19,6 +19,9 @@ declare const _default: {
19
19
  confirmVoid: string;
20
20
  viewShipment: string;
21
21
  };
22
+ errorMessages: {
23
+ labelIdRequired: string;
24
+ };
22
25
  resultMessages: {
23
26
  approved: string;
24
27
  rejected: string;
@@ -164,6 +167,7 @@ declare const _default: {
164
167
  shipDate: string;
165
168
  service: string;
166
169
  shipTo: string;
170
+ addShipToAddress: string;
167
171
  warehouse: string;
168
172
  weight: {
169
173
  whole: string;
@@ -190,6 +194,7 @@ declare const _default: {
190
194
  };
191
195
  rates: {
192
196
  uspsMediaMailAcknowledgement: string;
197
+ uspsFirstClassMailAcknowledgement_leof: string;
193
198
  };
194
199
  shipToAddressFormFields: string;
195
200
  sections: {
@@ -228,21 +233,8 @@ declare const _default: {
228
233
  };
229
234
  };
230
235
  "manage-defaults": {
231
- units: {
232
- title: string;
233
- dimensions: {
234
- title: string;
235
- standard: string;
236
- metric: string;
237
- };
238
- weight: {
239
- title: string;
240
- standard: string;
241
- g: string;
242
- kg: string;
243
- };
244
- };
245
236
  label: {
237
+ title: string;
246
238
  letter: {
247
239
  title: string;
248
240
  description: string;
@@ -255,7 +247,25 @@ declare const _default: {
255
247
  title: string;
256
248
  description: string;
257
249
  };
250
+ };
251
+ status: {
252
+ saving: string;
253
+ saved: string;
254
+ savingFailed: string;
255
+ };
256
+ units: {
258
257
  title: string;
258
+ dimensions: {
259
+ title: string;
260
+ standard: string;
261
+ metric: string;
262
+ };
263
+ weight: {
264
+ title: string;
265
+ standard: string;
266
+ g: string;
267
+ kg: string;
268
+ };
259
269
  };
260
270
  };
261
271
  "manage-warehouses": {
@@ -466,9 +476,11 @@ declare const _default: {
466
476
  invalidNameOrCompany: string;
467
477
  noWarehouses: string;
468
478
  unableToLoad: {
479
+ accountSettings: string;
469
480
  autoFundingSettings: string;
470
481
  carrier: string;
471
482
  carriers: string;
483
+ label: string;
472
484
  salesOrder: string;
473
485
  shipment: string;
474
486
  warehouses: string;
@@ -494,10 +506,12 @@ declare const _default: {
494
506
  thirdParty: string;
495
507
  };
496
508
  loading: {
509
+ accountSettings: string;
497
510
  carrier: string;
498
511
  carriers: string;
499
512
  data: string;
500
513
  importingSalesOrder: string;
514
+ label: string;
501
515
  onboarding: string;
502
516
  salesOrder: string;
503
517
  shipment: string;
@@ -524,6 +538,7 @@ declare const _default: {
524
538
  packageCodes: {
525
539
  package: string;
526
540
  };
541
+ "powered-by": string;
527
542
  schema: {
528
543
  optionalLabel: string;
529
544
  };
@@ -0,0 +1,8 @@
1
+ export declare const createAccountSettingsHandlers: () => {
2
+ database: {
3
+ default_label_layout: string;
4
+ dimensions_unit: string;
5
+ weight_unit: string;
6
+ };
7
+ handlers: import("msw").RestHandler<import("msw/lib/glossary-de6278a9").M<import("msw/lib/glossary-de6278a9").h>>[];
8
+ };
@@ -0,0 +1 @@
1
+ export * from "./handlers";
@@ -1,2 +1,3 @@
1
1
  export * from "./carriers";
2
2
  export * from "./warehouses";
3
+ export * from "./account-settings";
@@ -1,2 +1,3 @@
1
+ export declare const baseUrl = "http://mock-service-worker";
1
2
  declare const _default: import("msw/lib/SetupServerApi-39df862c").S;
2
3
  export default _default;
@@ -0,0 +1,2 @@
1
+ export * from "./matchers";
2
+ export * from "./queries";
@@ -0,0 +1,8 @@
1
+ export declare const extendMatchers: () => void;
2
+ declare global {
3
+ namespace jest {
4
+ interface Matchers<R> {
5
+ toHaveLoadingSpinner(): R;
6
+ }
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ export * from "./extend-matchers";
@@ -0,0 +1 @@
1
+ export * from "./to-have-loading-spinner";
@@ -0,0 +1,2 @@
1
+ import type { MatcherFunction } from "expect";
2
+ export declare const toHaveLoadingSpinner: MatcherFunction;
@@ -0,0 +1,4 @@
1
+ import { MatcherOptions, queryHelpers } from "@testing-library/react";
2
+ import { IconNames } from "@packlink/brands";
3
+ export declare const queryAllByIconName: (container: HTMLElement, iconName: IconNames, options?: MatcherOptions | undefined) => HTMLElement[];
4
+ export declare const queryByIconName: queryHelpers.QueryBy<[dataIdValue: IconNames]>, getAllByIconName: queryHelpers.GetAllBy<[dataIdValue: IconNames]>, getByIconName: queryHelpers.GetBy<[dataIdValue: IconNames]>, findAllByIconName: queryHelpers.FindAllBy<[dataIdValue: IconNames]>, findByIconName: queryHelpers.FindBy<[dataIdValue: IconNames]>;
@@ -0,0 +1,57 @@
1
+ import { queries } from "@testing-library/react";
2
+ export declare const extendedQueries: {
3
+ queryAllByIconName: (container: HTMLElement, iconName: import("@packlink/giger-theme/dist/lib/Icons").IconNames, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
4
+ queryByIconName: import("@testing-library/react").QueryBy<[dataIdValue: import("@packlink/giger-theme/dist/lib/Icons").IconNames]>;
5
+ getAllByIconName: import("@testing-library/react").GetAllBy<[dataIdValue: import("@packlink/giger-theme/dist/lib/Icons").IconNames]>;
6
+ getByIconName: import("@testing-library/react").GetBy<[dataIdValue: import("@packlink/giger-theme/dist/lib/Icons").IconNames]>;
7
+ findAllByIconName: import("@testing-library/react").FindAllBy<[dataIdValue: import("@packlink/giger-theme/dist/lib/Icons").IconNames]>;
8
+ findByIconName: import("@testing-library/react").FindBy<[dataIdValue: import("@packlink/giger-theme/dist/lib/Icons").IconNames]>;
9
+ getByLabelText<T extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined): T;
10
+ getAllByLabelText<T_1 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined): T_1[];
11
+ queryByLabelText<T_2 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined): T_2 | null;
12
+ queryAllByLabelText<T_3 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined): T_3[];
13
+ findByLabelText<T_4 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_4>;
14
+ findAllByLabelText<T_5 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_5[]>;
15
+ getByPlaceholderText<T_6 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_6;
16
+ getAllByPlaceholderText<T_7 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_7[];
17
+ queryByPlaceholderText<T_8 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_8 | null;
18
+ queryAllByPlaceholderText<T_9 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_9[];
19
+ findByPlaceholderText<T_10 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_10>;
20
+ findAllByPlaceholderText<T_11 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_11[]>;
21
+ getByText<T_12 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined): T_12;
22
+ getAllByText<T_13 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined): T_13[];
23
+ queryByText<T_14 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined): T_14 | null;
24
+ queryAllByText<T_15 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined): T_15[];
25
+ findByText<T_16 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_16>;
26
+ findAllByText<T_17 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_17[]>;
27
+ getByAltText<T_18 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_18;
28
+ getAllByAltText<T_19 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_19[];
29
+ queryByAltText<T_20 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_20 | null;
30
+ queryAllByAltText<T_21 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_21[];
31
+ findByAltText<T_22 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_22>;
32
+ findAllByAltText<T_23 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_23[]>;
33
+ getByTitle<T_24 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_24;
34
+ getAllByTitle<T_25 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_25[];
35
+ queryByTitle<T_26 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_26 | null;
36
+ queryAllByTitle<T_27 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_27[];
37
+ findByTitle<T_28 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_28>;
38
+ findAllByTitle<T_29 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_29[]>;
39
+ getByDisplayValue<T_30 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_30;
40
+ getAllByDisplayValue<T_31 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_31[];
41
+ queryByDisplayValue<T_32 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_32 | null;
42
+ queryAllByDisplayValue<T_33 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_33[];
43
+ findByDisplayValue<T_34 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_34>;
44
+ findAllByDisplayValue<T_35 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_35[]>;
45
+ getByRole<T_36 extends HTMLElement = HTMLElement>(container: HTMLElement, role: import("@testing-library/react").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T_36;
46
+ getAllByRole<T_37 extends HTMLElement = HTMLElement>(container: HTMLElement, role: import("@testing-library/react").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T_37[];
47
+ queryByRole<T_38 extends HTMLElement = HTMLElement>(container: HTMLElement, role: import("@testing-library/react").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T_38 | null;
48
+ queryAllByRole<T_39 extends HTMLElement = HTMLElement>(container: HTMLElement, role: import("@testing-library/react").ByRoleMatcher, options?: queries.ByRoleOptions | undefined): T_39[];
49
+ findByRole<T_40 extends HTMLElement = HTMLElement>(container: HTMLElement, role: import("@testing-library/react").ByRoleMatcher, options?: queries.ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_40>;
50
+ findAllByRole<T_41 extends HTMLElement = HTMLElement>(container: HTMLElement, role: import("@testing-library/react").ByRoleMatcher, options?: queries.ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_41[]>;
51
+ getByTestId<T_42 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_42;
52
+ getAllByTestId<T_43 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_43[];
53
+ queryByTestId<T_44 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_44 | null;
54
+ queryAllByTestId<T_45 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined): T_45[];
55
+ findByTestId<T_46 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_46>;
56
+ findAllByTestId<T_47 extends HTMLElement = HTMLElement>(container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/react").waitForOptions | undefined): Promise<T_47[]>;
57
+ };
@@ -0,0 +1 @@
1
+ export * from "./by-icon-name";
@@ -1 +1 @@
1
- export * from "./render";
1
+ export * from "./test-utils";