@shipengine/elements 0.39.0 → 1.0.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 (77) hide show
  1. package/index.cjs +3794 -3721
  2. package/index.js +3794 -3725
  3. package/package.json +10 -13
  4. package/src/components/carrier-logo/carrier-logo.d.ts +11 -0
  5. package/src/components/carrier-logo/index.d.ts +1 -0
  6. package/src/components/display-term/display-term.d.ts +5 -0
  7. package/src/components/display-term/display-term.styles.d.ts +23 -0
  8. package/src/components/display-term/index.d.ts +1 -0
  9. package/src/components/index.d.ts +2 -0
  10. package/src/components/loader/loader.styles.d.ts +11 -0
  11. package/src/components/templates/display-carrier-terms/display-carrier-terms.d.ts +2 -2
  12. package/src/components/templates/display-carrier-terms/display-carrier-terms.styles.d.ts +25 -0
  13. package/src/components/templates/index.d.ts +2 -6
  14. package/src/components/templates/list-carriers/list-carriers.d.ts +2 -2
  15. package/src/components/templates/rate-form/rate-form.d.ts +2 -2
  16. package/src/components/templates/warehouse-form/warehouse-form.d.ts +2 -2
  17. package/src/elements/account-settings/account-settings.d.ts +34 -29
  18. package/src/elements/configure-shipment/hooks/use-rates-form.d.ts +0 -1
  19. package/src/elements/index.d.ts +0 -1
  20. package/src/elements/list-carriers/list-carriers.d.ts +2 -2
  21. package/src/elements/purchase-label/purchase-label.d.ts +37 -10
  22. package/src/elements/view-shipment/view-shipment.d.ts +35 -18
  23. package/src/elements/void-label/void-label.d.ts +45 -36
  24. package/src/index.d.ts +1 -0
  25. package/src/locales/en/index.d.ts +34 -7
  26. package/src/types/index.d.ts +1 -0
  27. package/src/types/patch.d.ts +13 -0
  28. package/src/utilities/assertions.d.ts +2 -0
  29. package/src/utilities/feature-flags.d.ts +1 -1
  30. package/src/utilities/index.d.ts +1 -0
  31. package/src/workflows/onboarding/components/account-registration-form/account-registration-form-schema.d.ts +10 -0
  32. package/src/workflows/onboarding/components/account-registration-form/account-registration-form.d.ts +4 -0
  33. package/src/workflows/onboarding/components/account-registration-form/index.d.ts +1 -0
  34. package/src/workflows/onboarding/components/account-registration-step/account-registration-step.d.ts +5 -0
  35. package/src/workflows/onboarding/components/account-registration-step/index.d.ts +2 -0
  36. package/src/workflows/onboarding/components/account-registration-step/use-account-registration-step.d.ts +7 -0
  37. package/src/workflows/onboarding/components/carrier-recovery-form/carrier-recovery-form-schema.d.ts +241 -0
  38. package/src/{components/templates → workflows/onboarding/components}/carrier-recovery-form/carrier-recovery-form.d.ts +4 -2
  39. package/src/workflows/onboarding/components/carrier-recovery-form/index.d.ts +1 -0
  40. package/src/workflows/onboarding/components/funding-and-carrier-connection-step/funding-and-carrier-connection-step.d.ts +9 -0
  41. package/src/{components/templates/onboarding/onboarding.styles.d.ts → workflows/onboarding/components/funding-and-carrier-connection-step/funding-and-carrier-connection-step.styles.d.ts} +1 -14
  42. package/src/workflows/onboarding/components/funding-and-carrier-connection-step/index.d.ts +2 -0
  43. package/src/workflows/onboarding/components/funding-and-carrier-connection-step/use-funding-and-carrier-connection-step.d.ts +25 -0
  44. package/src/workflows/onboarding/components/onboarding-wizard/index.d.ts +1 -0
  45. package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.d.ts +27 -0
  46. package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.styles.d.ts +10 -0
  47. package/src/workflows/onboarding/components/ship-from-address-step/index.d.ts +2 -0
  48. package/src/workflows/onboarding/components/ship-from-address-step/ship-from-address-step.d.ts +7 -0
  49. package/src/workflows/onboarding/components/ship-from-address-step/use-ship-from-address-step.d.ts +9 -0
  50. package/src/workflows/onboarding/components/step-header/index.d.ts +1 -0
  51. package/src/workflows/onboarding/components/step-header/step-header.d.ts +5 -0
  52. package/src/workflows/onboarding/components/terms-agreement-form/index.d.ts +1 -0
  53. package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form-schema.d.ts +10 -0
  54. package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.d.ts +7 -0
  55. package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.styles.d.ts +24 -0
  56. package/src/workflows/onboarding/components/terms-agreement-step/index.d.ts +1 -0
  57. package/src/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.d.ts +8 -0
  58. package/src/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.styles.d.ts +17 -0
  59. package/src/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.d.ts +18 -0
  60. package/src/{elements → workflows}/onboarding/onboarding.d.ts +55 -48
  61. package/src/components/templates/carrier-recovery-form/carrier-recovery-form-schema.d.ts +0 -241
  62. package/src/components/templates/carrier-recovery-form/index.d.ts +0 -2
  63. package/src/components/templates/carrier-terms-form/carrier-terms-form-schema.d.ts +0 -10
  64. package/src/components/templates/carrier-terms-form/carrier-terms-form.d.ts +0 -6
  65. package/src/components/templates/carrier-terms-form/carrier-terms-form.styles.d.ts +0 -65
  66. package/src/components/templates/carrier-terms-form/index.d.ts +0 -1
  67. package/src/components/templates/landing-page/index.d.ts +0 -1
  68. package/src/components/templates/landing-page/landing-page-form-schema.d.ts +0 -10
  69. package/src/components/templates/landing-page/landing-page-form.d.ts +0 -4
  70. package/src/components/templates/landing-page/landing-page.d.ts +0 -5
  71. package/src/components/templates/onboarding/onboarding.d.ts +0 -42
  72. /package/src/{components/templates/onboarding → workflows}/index.d.ts +0 -0
  73. /package/src/{components/templates/landing-page/landing-page.styles.d.ts → workflows/onboarding/components/account-registration-step/account-registration-step.styles.d.ts} +0 -0
  74. /package/src/{components/templates → workflows/onboarding/components}/carrier-recovery-form/carrier-recovery-form.styles.d.ts +0 -0
  75. /package/src/{components/templates → workflows/onboarding/components}/completion-page/completion-page.d.ts +0 -0
  76. /package/src/{components/templates → workflows/onboarding/components}/completion-page/index.d.ts +0 -0
  77. /package/src/{elements → workflows}/onboarding/index.d.ts +0 -0
@@ -0,0 +1,24 @@
1
+ export declare const styles: {
2
+ closeButton: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
3
+ marginRight: number;
4
+ };
5
+ container: {
6
+ alignItems: "center";
7
+ display: "flex";
8
+ flexDirection: "column";
9
+ justifyContent: "center";
10
+ };
11
+ expanderLink: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
12
+ alignItems: "center";
13
+ display: "inline-flex";
14
+ fontWeight: number;
15
+ };
16
+ termsWell: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
17
+ backgroundColor: string;
18
+ marginBottom: number;
19
+ padding: string;
20
+ };
21
+ termTypeDivider: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
22
+ margin: string;
23
+ };
24
+ };
@@ -0,0 +1 @@
1
+ export * from "./terms-agreement-step";
@@ -0,0 +1,8 @@
1
+ import { MetadataRequiredTermWithLinks } from "../../../../types";
2
+ export type TermsAgreementStepProps = {
3
+ carrierCodes: string[];
4
+ carrierTerms: MetadataRequiredTermWithLinks[];
5
+ fundingSourceTerms: MetadataRequiredTermWithLinks[];
6
+ onSubmit: (agreement: boolean) => void;
7
+ };
8
+ export declare const TermsAgreementStep: ({ carrierCodes, carrierTerms, fundingSourceTerms, onSubmit, }: TermsAgreementStepProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ export declare const styles: {
2
+ carrierLogos: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
3
+ display: "flex";
4
+ flexDirection: "row";
5
+ gap: number;
6
+ justifyContent: "center";
7
+ padding: string;
8
+ };
9
+ container: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
10
+ alignItems: "center";
11
+ display: "flex";
12
+ flexDirection: "column";
13
+ paddingBottom: number;
14
+ paddingTop: number;
15
+ textAlign: "center";
16
+ };
17
+ };
@@ -0,0 +1,18 @@
1
+ import { MetadataRequiredTermWithLinks } from "../../../../types";
2
+ export type UseTermsAgreementStepProps = {
3
+ enabledCarriers: string[];
4
+ onStepComplete: () => void;
5
+ };
6
+ export declare const useTermsAgreementStep: ({ enabledCarriers, onStepComplete, }: UseTermsAgreementStepProps) => {
7
+ carrierCodes: string[] | undefined;
8
+ carrierProfiles: {
9
+ capabilities: import("@shipengine/alchemy").MetadataCapability[] | null;
10
+ carrierCode: string;
11
+ registrationRequirements: import("@shipengine/alchemy").MetadataRegistrationRequirement[];
12
+ requiredTerms: import("@shipengine/alchemy").MetadataRequiredTerm[];
13
+ }[] | undefined;
14
+ carrierTerms: MetadataRequiredTermWithLinks[] | undefined;
15
+ fundingSourceMetadata: import("@tanstack/react-query").UseQueryResult<import("@shipengine/alchemy").MetadataResponse, import("@shipengine/alchemy").CodedError[]>;
16
+ fundingSourceTerms: MetadataRequiredTermWithLinks[] | undefined;
17
+ handleSubmitTermsAgreement: () => void;
18
+ };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { OnboardingProps } from "../../components/templates/onboarding";
2
+ import { OnboardingWizardProps } from "./components/onboarding-wizard";
3
3
  /**
4
4
  * # Onboarding Component Props
5
5
  *
@@ -8,25 +8,14 @@ import { OnboardingProps } from "../../components/templates/onboarding";
8
8
  * @see {@link Onboarding.Component | This prop types usage in the `<Onboarding />` component}
9
9
  */
10
10
  export type ComponentProps = {
11
- /**
12
- * `features` is a set of feature flags you would like to enable or disable in this component.
13
- */
14
- features?: OnboardingProps["features"];
15
- /**
16
- * `onboardingAddress` is the address that will be used to create the warehouse for the user
17
- * during the onboarding process.
18
- */
19
- onboardingAddress?: OnboardingProps["onboardingAddress"];
20
- /**
21
- * `onCompleteOnboarding` is a callback function that will be invoked once the onboarding process
22
- * is completed.
23
- */
24
- onCompleteOnboarding: () => void;
25
- /**
26
- * `partnerName` is the name of the partner that is using the Onboarding component. This is typically
27
- * the name of the entity that owns the host application.
28
- */
29
- partnerName?: OnboardingProps["partnerName"];
11
+ /** If provided, the address form will be pre-filled */
12
+ defaultShipFromAddress?: OnboardingWizardProps["defaultShipFromAddress"];
13
+ /** Flags to selectively enable / disable features. */
14
+ features?: OnboardingWizardProps["features"];
15
+ /** Invoked when the onboarding process is completed. */
16
+ onComplete: () => void;
17
+ /** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
18
+ partnerName?: OnboardingWizardProps["partnerName"];
30
19
  };
31
20
  /**
32
21
  * # Onboarding Component
@@ -61,7 +50,7 @@ export type ComponentProps = {
61
50
  *
62
51
  * @see {@link Onboarding.Element | The **Element** created to render `<Onboarding />`}
63
52
  */
64
- export declare const Component: ({ features, onboardingAddress, onCompleteOnboarding, partnerName, }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
53
+ export declare const Component: ({ defaultShipFromAddress, features, onComplete, partnerName, }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
65
54
  /**
66
55
  * # Registered Onboarding Element
67
56
  *
@@ -145,13 +134,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
145
134
  warehouse: string;
146
135
  weight: string;
147
136
  insuredValue: string;
148
- deliveryConfirmation: string;
137
+ deliveryConfirmation: string; /** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
149
138
  };
150
139
  highVolumeForms: string;
151
- multipleShippingServices: string; /**
152
- * `onCompleteOnboarding` is a callback function that will be invoked once the onboarding process
153
- * is completed.
154
- */
140
+ multipleShippingServices: string;
155
141
  sections: {
156
142
  labels: string;
157
143
  };
@@ -169,6 +155,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
169
155
  title: string;
170
156
  cardSubTitle: string;
171
157
  addressSubTitle: string;
158
+ /** If provided, the address form will be pre-filled */
172
159
  info: string;
173
160
  };
174
161
  carriers: {
@@ -177,7 +164,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
177
164
  };
178
165
  notifications: {
179
166
  error: {
180
- title: string;
167
+ title: string; /** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
181
168
  };
182
169
  info: {
183
170
  title: string;
@@ -317,20 +304,20 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
317
304
  onboarding: {
318
305
  title: string;
319
306
  inlineTitle: string;
320
- landing: {
307
+ accountRegistration: {
321
308
  action: string;
322
309
  title: string;
323
310
  subtitle: string;
324
311
  welcome: string;
325
312
  messageLine1: string;
326
313
  partnerMessageLine1: string;
327
- messageLine2: string;
314
+ messageLine2: string; /** Flags to selectively enable / disable features. */
328
315
  };
329
- steps: {
330
- register: string;
331
- carriers: string;
332
- addresses: string;
333
- billing: string;
316
+ stepLabel: {
317
+ accountRegistration: string;
318
+ termsAgreement: string;
319
+ shipFromAddress: string;
320
+ fundingAndCarrierConnection: string;
334
321
  };
335
322
  warehouse: {
336
323
  title: string;
@@ -342,6 +329,22 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
342
329
  subtitle: string;
343
330
  action: string;
344
331
  };
332
+ termsAndAgreementLinkText: {
333
+ aHR0cHM6Ly9teWRobC5leHByZXNzLmRobC91cy9lbi9sZWdhbC90ZXJtcy1hbmQtY29uZGl0aW9ucy5odG1s: string;
334
+ "aHR0cHM6Ly93d3cuc3RhbXBzLmNvbS9wcml2YWN5LXBvbGljeQ==": string;
335
+ "aHR0cHM6Ly93d3cuc3RhbXBzLmNvbS9jb25kaXRpb25zLw==": string;
336
+ "aHR0cHM6Ly93d3cudXBzLmNvbS91cy9lbi9zdXBwb3J0L3NoaXBwaW5nLXN1cHBvcnQvc2hpcHBpbmctc3BlY2lhbC1jYXJlLXJlZ3VsYXRlZC1pdGVtcy9wcm9oaWJpdGVkLWl0ZW1zLnBhZ2U=": string;
337
+ aHR0cHM6Ly93d3cudXBzLmNvbS9hc3NldHMvcmVzb3VyY2VzL21lZGlhL2VuX1VTL1VQU19EQVBfVEMucGRm: string;
338
+ "aHR0cHM6Ly93d3cudXBzLmNvbS9hc3NldHMvcmVzb3VyY2VzL21lZGlhL2VuX1VTL1VUQS5wZGY=": string;
339
+ "aHR0cHM6Ly93d3cuZXZyaS5jb20vdGVybXMtYW5kLWNvbmRpdGlvbnM=": string;
340
+ "aHR0cHM6Ly93d3cueW9kZWxkaXJlY3QuY28udWsvY29udGVudC9hYm91dC10ZXJtcw==": string;
341
+ aHR0cHM6Ly93d3cuc2hpcHN0YXRpb24uY29tL3Rlcm1zLXNlcnZpY2UtdW5pdGVkLWtpbmdkb20v: string;
342
+ };
343
+ termsAndAgreementTitles: {
344
+ "WW9kZWwgRGlyZWN0IC0gVGVybXMgYW5kIENvbmRpdGlvbnMgKOKAnFRlcm1z4oCdKQ==": string;
345
+ "RXZyaSBTZW5kIFRlcm1zICYgQ29uZGl0aW9ucw==": string;
346
+ "VGVybXMgb2YgU2VydmljZSBVbml0ZWQgS2luZ2RvbQ==": string;
347
+ };
345
348
  };
346
349
  "manage-defaults": {
347
350
  label: {
@@ -368,13 +371,11 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
368
371
  title: string;
369
372
  dimensions: {
370
373
  title: string;
371
- standard: string;
372
- metric: string; /**
373
- * `features` is a set of feature flags you would like to enable or disable in this component.
374
- */
374
+ standard: string; /** Invoked when the onboarding process is completed. */
375
+ metric: string;
375
376
  };
376
377
  weight: {
377
- title: string;
378
+ title: string; /** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
378
379
  standard: string;
379
380
  g: string;
380
381
  kg: string;
@@ -422,10 +423,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
422
423
  error: {
423
424
  title: string;
424
425
  message: string;
425
- }; /**
426
- * `onCompleteOnboarding` is a callback function that will be invoked once the onboarding process
427
- * is completed.
428
- */
426
+ };
429
427
  isLoading: string;
430
428
  labels: {
431
429
  amount: string;
@@ -484,16 +482,15 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
484
482
  fields: {
485
483
  name: string;
486
484
  company: string;
485
+ county: string;
487
486
  countryCode: string;
488
487
  addressLine1: string;
489
488
  addressLine2: string;
490
489
  cityLocality: string;
491
490
  stateProvince: string;
492
491
  postalCode: string;
493
- phone: string; /**
494
- * `features` is a set of feature flags you would like to enable or disable in this component.
495
- */
496
- email: string;
492
+ phone: string;
493
+ email: string; /** The partner responsible for the currently onboarding seller. This is typically the name of the entity that owns the host application. */
497
494
  addressResidentialIndicator: string;
498
495
  };
499
496
  noResults: string;
@@ -600,6 +597,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
600
597
  autoFundingSettings: string;
601
598
  carrier: string;
602
599
  carriers: string;
600
+ fundingSourceMetadata: string;
603
601
  label: string;
604
602
  salesOrder: string;
605
603
  shipment: string;
@@ -607,7 +605,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
607
605
  };
608
606
  unknown: string;
609
607
  noRatesAvailable: string;
610
- saveRateError: string;
611
608
  };
612
609
  errorTypes: {
613
610
  accountStatus: string;
@@ -633,6 +630,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
633
630
  carrier: string;
634
631
  carriers: string;
635
632
  connectingCarriers: string;
633
+ creatingFundingSource: string;
636
634
  data: string;
637
635
  importingSalesOrder: string;
638
636
  label: string;
@@ -694,6 +692,14 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
694
692
  platform: string;
695
693
  user: string;
696
694
  };
695
+ terms: {
696
+ fields: {
697
+ agreement: string;
698
+ };
699
+ agreeToTerms: string;
700
+ carriersTitle: string;
701
+ fundingSourceTitle: string;
702
+ };
697
703
  weight: {
698
704
  ounces: string;
699
705
  pounds_one: string;
@@ -709,6 +715,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
709
715
  gram: string;
710
716
  kilogram: string;
711
717
  };
718
+ T25seSByZXNpZGVudGlhbCBkZWxpdmVyeSBhZGRyZXNzZXMgYXJlIGFsbG93ZWQgZm9yIFVQUyBHcm91bmQgU2F2ZXIu: string;
712
719
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkMTAwLgo=": string;
713
720
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkNTAuCg==": string;
714
721
  QSBzaGlwcGluZyBjYXJyaWVyIGVycm9yIG9jY3VycmVkOiBJbnN1ZmZpY2llbnQgYWNjb3VudCBiYWxhbmNlLiBBY2NvdW50IGV4Y2VwdGlvbiBFeGNlcHRpb24gd2l0aCBjb2RlIDB4MDA1NjAxMDE7IG1vZHVsZSA4NiwgY2F0ZWdvcnkgMSwgaXRlbSAx: string;