@shipengine/elements 1.7.0 → 1.8.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 (57) hide show
  1. package/index.cjs +15309 -14863
  2. package/index.js +15310 -14867
  3. package/package.json +3 -3
  4. package/src/components/collapsible-panel/collapsible-panel.styles.d.ts +2 -3
  5. package/src/components/display-term/display-term.d.ts +2 -2
  6. package/src/components/display-term/display-term.styles.d.ts +2 -0
  7. package/src/components/index.d.ts +6 -5
  8. package/src/components/templates/wallet-form/wallet-form.d.ts +3 -1
  9. package/src/components/templates/wallet-form/wallet-form.styles.d.ts +3 -0
  10. package/src/components/vat-form/index.d.ts +1 -0
  11. package/src/components/vat-form/vat-form-schema.d.ts +10 -0
  12. package/src/components/vat-form/vat-form.d.ts +6 -0
  13. package/src/components/vat-form/vat-form.styles.d.ts +9 -0
  14. package/src/elements/external-carriers/external-carriers.d.ts +124 -97
  15. package/src/elements/label-layout/label-layout-element.d.ts +101 -74
  16. package/src/elements/labels-grid/labels-grid.d.ts +101 -74
  17. package/src/elements/manage-funding/manage-funding-element.d.ts +101 -74
  18. package/src/elements/manage-warehouses/manage-warehouses.d.ts +101 -74
  19. package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +101 -74
  20. package/src/elements/purchase-label/purchase-label.d.ts +121 -77
  21. package/src/elements/shipengine-carriers/shipengine-carriers.d.ts +124 -97
  22. package/src/elements/shipments-grid/shipments-grid.d.ts +101 -74
  23. package/src/elements/theme-creator/theme-creator.d.ts +101 -74
  24. package/src/elements/unit-settings/unit-settings-element.d.ts +101 -74
  25. package/src/elements/vat-settings/index.d.ts +1 -0
  26. package/src/elements/vat-settings/vat-settings-element.d.ts +818 -0
  27. package/src/elements/view-shipment/view-shipment.d.ts +111 -83
  28. package/src/elements/void-label/components/message/message.d.ts +3 -2
  29. package/src/elements/void-label/void-label.d.ts +128 -92
  30. package/src/elements/wallet-history/wallet-history-element.d.ts +101 -74
  31. package/src/features/index.d.ts +5 -4
  32. package/src/features/unit-settings/unit-settings.d.ts +2 -2
  33. package/src/features/unit-settings/use-unit-settings.d.ts +1 -1
  34. package/src/features/vat-settings/index.d.ts +2 -0
  35. package/src/features/vat-settings/use-vat-settings.d.ts +8 -0
  36. package/src/features/vat-settings/vat-settings.d.ts +9 -0
  37. package/src/features/vat-settings/vat-settings.styles.d.ts +29 -0
  38. package/src/hooks/index.d.ts +3 -3
  39. package/src/locales/en/index.d.ts +101 -74
  40. package/src/types/patch.d.ts +1 -12
  41. package/src/utilities/feature-flags.d.ts +10 -0
  42. package/src/utilities/shipengine/index.d.ts +1 -0
  43. package/src/utilities/shipengine/shipment.d.ts +11 -0
  44. package/src/workflows/account-settings/account-settings.d.ts +104 -79
  45. package/src/workflows/connect-carrier/connect-carrier.d.ts +101 -74
  46. package/src/workflows/manage-wallet-workflow/manage-wallet-workflow.d.ts +106 -78
  47. package/src/workflows/onboarding/components/account-registration-form/account-registration-form-schema.d.ts +3 -0
  48. package/src/workflows/onboarding/components/funding-and-carrier-connection-step/funding-and-carrier-connection-step.d.ts +3 -1
  49. package/src/workflows/onboarding/components/funding-and-carrier-connection-step/use-funding-and-carrier-connection-step.d.ts +2 -2
  50. package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.d.ts +2 -2
  51. package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.d.ts +3 -4
  52. package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.styles.d.ts +6 -7
  53. package/src/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.d.ts +3 -4
  54. package/src/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.styles.d.ts +3 -0
  55. package/src/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.d.ts +7 -7
  56. package/src/workflows/onboarding/onboarding.d.ts +101 -74
  57. package/vite.config.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "peerDependencies": {
5
5
  "@shipengine/alchemy": "5.x.x",
6
6
  "@emotion/react": "11.x",
@@ -26,7 +26,7 @@
26
26
  "@rjsf/validator-ajv8": "5.16.1",
27
27
  "@shipengine/giger": "1.9.0",
28
28
  "@shipengine/giger-theme": "1.3.0",
29
- "@shipengine/js-api": "1.9.0",
29
+ "@shipengine/js-api": "1.13.0",
30
30
  "@storybook/addons": "6.5.16",
31
31
  "@storybook/components": "7.0.0-rc.1",
32
32
  "@storybook/core-events": "7.0.0-rc.1",
@@ -35,7 +35,7 @@
35
35
  "@tanstack/react-query": "4.36.1",
36
36
  "@testing-library/dom": "8.19.0",
37
37
  "@vitejs/plugin-react": "1.3.2",
38
- "axios": "0.26.1",
38
+ "axios": "0.28.1",
39
39
  "card-validator": "8.1.1",
40
40
  "copy-to-clipboard": "3.3.3",
41
41
  "date-fns": "3.6.0",
@@ -1,11 +1,10 @@
1
1
  export declare const styles: {
2
- content: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
3
- padding: string;
2
+ getContentStyles: (nested?: boolean) => (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
3
+ padding: number;
4
4
  };
5
5
  getHeaderStyles: (nested?: boolean) => (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
6
6
  backgroundColor: string;
7
7
  display: "flex";
8
- height: number;
9
8
  padding: string;
10
9
  };
11
10
  icon: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
@@ -1,5 +1,5 @@
1
- import { MetadataRequiredTermWithLinks } from "../../types";
1
+ import { SE } from "@shipengine/alchemy";
2
2
  export type DisplayTermProps = {
3
- term: MetadataRequiredTermWithLinks;
3
+ term: Pick<SE.MetadataRequiredTerm, "links">;
4
4
  };
5
5
  export declare const DisplayTerm: ({ term }: DisplayTermProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -9,10 +9,12 @@ export declare const styles: {
9
9
  "&:visited": {
10
10
  color: string;
11
11
  };
12
+ fontWeight: number;
12
13
  };
13
14
  termLink: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
14
15
  display: "flex";
15
16
  flexDirection: "column";
17
+ gap: number;
16
18
  listStyle: "none";
17
19
  };
18
20
  terms: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
@@ -1,8 +1,8 @@
1
1
  export * from "./add-funds-form";
2
- export * from "./carrier-connection-card";
3
2
  export * from "./auto-funding-form";
4
3
  export * from "./button-group";
5
4
  export * from "./carrier-balance";
5
+ export * from "./carrier-connection-card";
6
6
  export * from "./carrier-icon";
7
7
  export * from "./carrier-logo";
8
8
  export * from "./collapsible-panel";
@@ -12,12 +12,14 @@ export * from "./date-range-combo";
12
12
  export * from "./date-range-select";
13
13
  export * from "./display-term";
14
14
  export * from "./drawer";
15
+ export * from "./edit-billing-form";
15
16
  export * from "./error-fallback";
16
17
  export * from "./field-label";
17
18
  export * from "./field";
18
19
  export * from "./form-portal";
19
20
  export * from "./fund-and-purchase";
20
21
  export * from "./grid-controller";
22
+ export * from "./history";
21
23
  export * from "./inline-label";
22
24
  export * from "./items-breakdown";
23
25
  export * from "./link-action";
@@ -27,13 +29,12 @@ export * from "./portal";
27
29
  export * from "./powered-by-shipengine";
28
30
  export * from "./section";
29
31
  export * from "./settings-card";
32
+ export * from "./skeleton";
30
33
  export * from "./spacer";
31
34
  export * from "./spread";
32
- export * from "./skeleton";
33
- export * from "./suspend";
34
35
  export * from "./story-notes";
36
+ export * from "./suspend";
35
37
  export * from "./tabs";
38
+ export * from "./vat-form";
36
39
  export * from "./wallet-card";
37
40
  export * from "./warehouse-form";
38
- export * from "./edit-billing-form";
39
- export * from "./history";
@@ -1,4 +1,5 @@
1
1
  import { SE } from "@shipengine/alchemy";
2
+ import { VatSettingsFeatures } from "../../../features";
2
3
  export type WalletFormFeatures = {};
3
4
  export type WalletPayload = {
4
5
  address: SE.Address;
@@ -8,6 +9,7 @@ export type WalletPayload = {
8
9
  export type WalletFormProps = {
9
10
  address: SE.Address;
10
11
  errors?: SE.CodedError[] | null;
12
+ features?: VatSettingsFeatures;
11
13
  onSubmit: (payload: WalletPayload) => Promise<void>;
12
14
  };
13
- export declare const WalletForm: ({ address, errors, onSubmit }: WalletFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
15
+ export declare const WalletForm: ({ address, errors, onSubmit, features }: WalletFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,4 +1,7 @@
1
1
  export declare const styles: {
2
+ centeredText: () => {
3
+ textAlign: "center";
4
+ };
2
5
  grid: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
3
6
  margin: number;
4
7
  };
@@ -0,0 +1 @@
1
+ export * from "./vat-form";
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+ export declare const vatSchema: z.ZodObject<{
3
+ vatNumber: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ vatNumber: string;
6
+ }, {
7
+ vatNumber: string;
8
+ }>;
9
+ export type VatSchemaFields = z.input<typeof vatSchema>;
10
+ export type VatSchemaPayload = z.output<typeof vatSchema>;
@@ -0,0 +1,6 @@
1
+ export type VatFormProps = {
2
+ onCancel?: () => void;
3
+ onSuccess?: () => void;
4
+ showRegisterLaterText?: boolean;
5
+ };
6
+ export declare const VatForm: ({ onCancel, onSuccess, showRegisterLaterText }: VatFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export declare const styles: {
2
+ formSection: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
3
+ backgroundColor: string;
4
+ padding: number;
5
+ };
6
+ inlineError: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
7
+ marginBottom: number;
8
+ };
9
+ };
@@ -66,6 +66,7 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
66
66
  resultMessages: {
67
67
  approved: string;
68
68
  rejected: string;
69
+ dpdwallet: string;
69
70
  };
70
71
  refund_process: string;
71
72
  refund_rules: string;
@@ -107,6 +108,38 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
107
108
  };
108
109
  noLabels: string;
109
110
  };
111
+ "vat-settings": {
112
+ addNew: string;
113
+ vatNumber: string;
114
+ vatRegistrationTooltip: string;
115
+ vatFormText: string;
116
+ vatFormRegisterLater: string;
117
+ vatNumberInputHint: string;
118
+ vatNumberInputPlaceholder: string;
119
+ verifiedVat: string;
120
+ vatFormErrors: {
121
+ invalidFieldValue: string;
122
+ verificationFailure: string;
123
+ forbidden: string;
124
+ connectionNotSupported: string;
125
+ genericTitle: string;
126
+ genericText: string;
127
+ };
128
+ };
129
+ "shipengine-carriers": {
130
+ title: string;
131
+ headers: {
132
+ accountCarriers: string;
133
+ carriers: string;
134
+ settings: string;
135
+ };
136
+ actions: {
137
+ status: {
138
+ connected: string;
139
+ notConnected: string;
140
+ };
141
+ };
142
+ };
110
143
  "register-wallet": {
111
144
  sections: {
112
145
  setup: {
@@ -122,6 +155,9 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
122
155
  addressSubTitle: string;
123
156
  info: string;
124
157
  };
158
+ vatSettings: {
159
+ title: string;
160
+ };
125
161
  carriers: {
126
162
  title: string;
127
163
  subtitle: string;
@@ -248,6 +284,7 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
248
284
  rateSavings: string;
249
285
  upsGroundSaverTermsAcknowledgement: string;
250
286
  dhlExpressTermsAcknowledgement: string;
287
+ noRateService: string;
251
288
  };
252
289
  requirements: {
253
290
  noWarehouse: string;
@@ -314,6 +351,8 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
314
351
  action: string;
315
352
  };
316
353
  termsAndAgreementLinkText: {
354
+ shipEngineToS: string;
355
+ auctanePrivacyPolicy: string;
317
356
  aHR0cHM6Ly9teWRobC5leHByZXNzLmRobC91cy9lbi9sZWdhbC90ZXJtcy1hbmQtY29uZGl0aW9ucy5odG1s: string;
318
357
  "aHR0cHM6Ly93d3cuc3RhbXBzLmNvbS9wcml2YWN5LXBvbGljeQ==": string;
319
358
  "aHR0cHM6Ly93d3cuc3RhbXBzLmNvbS9jb25kaXRpb25zLw==": string;
@@ -338,65 +377,6 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
338
377
  UHVyb2xhdG9yIE1vZGFsaXTDqXMgZXQgY29uZGl0aW9ucyBkZSBzZXJ2aWNl: string;
339
378
  };
340
379
  };
341
- "manage-defaults": {
342
- label: {
343
- title: string;
344
- letter: {
345
- title: string;
346
- description: string;
347
- };
348
- purchase: {
349
- title: string;
350
- description: string;
351
- };
352
- thermal: {
353
- title: string; /**
354
- * # ExternalCarriers Component
355
- *
356
- * @param ComponentProps The base props that will be passed into the `<ExternalCarriers />` component.
357
- *
358
- * @returns Element A React element that renders the `<ExternalCarriers />` component allowing users
359
- * to view a list of their own carrier accounts that have been connected to their ShipEngine account,
360
- * and to add additional carriers.
361
- * This component is composed in the `<AccountSettings />` Element.
362
- *
363
- * @example
364
- * ```tsx
365
- * (() => {
366
- * const features = useFeatures("Global");
367
- *
368
- * return <ExternalCarriers.Component features={features} />;
369
- * })();
370
- * ```
371
- *
372
- * <br />
373
- *
374
- * @see {@link ExternalCarriers.ComponentProps | The props that are passed into the `<ExternalCarriers />` component}
375
- * @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<ExternalCarriers />` component}
376
- */
377
- description: string;
378
- };
379
- };
380
- status: {
381
- saving: string;
382
- saved: string;
383
- savingFailed: string;
384
- };
385
- units: {
386
- title: string;
387
- dimensions: {
388
- title: string;
389
- standard: string;
390
- metric: string;
391
- };
392
- weight: {
393
- title: string;
394
- standard: string;
395
- g: string;
396
- kg: string;
397
- };
398
- };
399
- };
400
380
  "manage-warehouses": {
401
381
  title: string;
402
382
  addNew: string;
@@ -464,6 +444,65 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
464
444
  currentBalance: string;
465
445
  maximumBalanceAmount: string;
466
446
  };
447
+ "manage-defaults": {
448
+ label: {
449
+ title: string;
450
+ letter: {
451
+ title: string;
452
+ description: string;
453
+ };
454
+ purchase: {
455
+ title: string;
456
+ description: string;
457
+ };
458
+ thermal: {
459
+ title: string; /**
460
+ * # ExternalCarriers Component
461
+ *
462
+ * @param ComponentProps The base props that will be passed into the `<ExternalCarriers />` component.
463
+ *
464
+ * @returns Element A React element that renders the `<ExternalCarriers />` component allowing users
465
+ * to view a list of their own carrier accounts that have been connected to their ShipEngine account,
466
+ * and to add additional carriers.
467
+ * This component is composed in the `<AccountSettings />` Element.
468
+ *
469
+ * @example
470
+ * ```tsx
471
+ * (() => {
472
+ * const features = useFeatures("Global");
473
+ *
474
+ * return <ExternalCarriers.Component features={features} />;
475
+ * })();
476
+ * ```
477
+ *
478
+ * <br />
479
+ *
480
+ * @see {@link ExternalCarriers.ComponentProps | The props that are passed into the `<ExternalCarriers />` component}
481
+ * @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<ExternalCarriers />` component}
482
+ */
483
+ description: string;
484
+ };
485
+ };
486
+ status: {
487
+ saving: string;
488
+ saved: string;
489
+ savingFailed: string;
490
+ };
491
+ units: {
492
+ title: string;
493
+ dimensions: {
494
+ title: string;
495
+ standard: string;
496
+ metric: string;
497
+ };
498
+ weight: {
499
+ title: string;
500
+ standard: string;
501
+ g: string;
502
+ kg: string;
503
+ };
504
+ };
505
+ };
467
506
  "list-shipments": {
468
507
  title: string;
469
508
  headers: {
@@ -494,18 +533,31 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
494
533
  };
495
534
  };
496
535
  };
497
- "shipengine-carriers": {
498
- title: string;
499
- headers: {
500
- accountCarriers: string;
501
- carriers: string;
502
- settings: string;
503
- };
536
+ "connect-carrier": {
504
537
  actions: {
505
- status: {
506
- connected: string;
507
- notConnected: string;
508
- };
538
+ cancel: string;
539
+ carrierSettings: string;
540
+ connectCarriers: string;
541
+ disconnect: string;
542
+ disconnectCarrier: string;
543
+ };
544
+ noCarriersDescription: string;
545
+ registrationForm: {
546
+ error: string;
547
+ title: string;
548
+ betaWarning: string;
549
+ };
550
+ search: string;
551
+ settingsModal: {
552
+ closeDialog: string;
553
+ header: string;
554
+ };
555
+ status: {
556
+ connected: string;
557
+ };
558
+ disconnectDropdown: {
559
+ toastTitle: string;
560
+ toastBody: string;
509
561
  };
510
562
  };
511
563
  common: {
@@ -692,6 +744,7 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
692
744
  accountSettings: string;
693
745
  carrier: string;
694
746
  carriers: string;
747
+ carrierServices: string;
695
748
  connectCarrierForm: string;
696
749
  connectingCarriers: string;
697
750
  creatingFundingSource: string;
@@ -794,33 +847,6 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
794
847
  "QSBzaGlwcGluZyBjYXJyaWVyIGVycm9yIG9jY3VycmVkOiBNaXNzaW5nIG9yIGludmFsaWQgc2hpcCB0byBTdGF0ZVByb3ZpbmNlQ29kZQ==": string;
795
848
  "QSBzaGlwcGluZyBjYXJyaWVyIGVycm9yIG9jY3VycmVkOiBJbnZhbGlkIHNvbGQgdG8gc3RhdGUgcHJvdmluY2UgY29kZS4gVmFsaWQgbGVuZ3RoIGlzIDAgdG8gNSBhbHBoYW51bWVyaWM=": string;
796
849
  };
797
- "connect-carrier": {
798
- actions: {
799
- cancel: string;
800
- carrierSettings: string;
801
- connectCarriers: string;
802
- disconnect: string;
803
- disconnectCarrier: string;
804
- };
805
- noCarriersDescription: string;
806
- registrationForm: {
807
- error: string;
808
- title: string;
809
- betaWarning: string;
810
- };
811
- search: string;
812
- settingsModal: {
813
- closeDialog: string;
814
- header: string;
815
- };
816
- status: {
817
- connected: string;
818
- };
819
- disconnectDropdown: {
820
- toastTitle: string;
821
- toastBody: string;
822
- };
823
- };
824
850
  "account-settings": {
825
851
  messages: {
826
852
  noFundingSources: string;
@@ -836,6 +862,7 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
836
862
  externalCarriers: string;
837
863
  labelLayout: string;
838
864
  unitSettings: string;
865
+ vatSettings: string;
839
866
  };
840
867
  };
841
868
  };