@shipengine/elements 2.0.0 → 2.1.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 (118) hide show
  1. package/actions-menu.js +34 -0
  2. package/carrier-logo.js +1 -0
  3. package/components.js +1 -1
  4. package/constants.js +1 -1
  5. package/elements.js +1 -1
  6. package/extensions.js +1 -1
  7. package/formatString.js +1 -0
  8. package/hooks.js +1 -1
  9. package/index.js +1 -1
  10. package/package.json +15 -45
  11. package/pudo.js +1 -0
  12. package/schemas.js +1 -1
  13. package/src/components/actions-menu/actions-menu.d.ts +19 -0
  14. package/src/components/actions-menu/index.d.ts +1 -0
  15. package/src/components/collapsible-panel/collapsible-panel.styles.d.ts +10 -13
  16. package/src/components/field/checkbox-input/checkbox-input.d.ts +1 -0
  17. package/src/components/field/rate-card/rate-card.styles.d.ts +0 -1
  18. package/src/components/field/select/index.d.ts +1 -0
  19. package/src/components/field/select/select-with-categories.d.ts +20 -0
  20. package/src/components/field/select/select.d.ts +5 -10
  21. package/src/components/index.d.ts +1 -0
  22. package/src/components/templates/connected-carrier-list/connected-carrier-list.d.ts +4 -1
  23. package/src/components/templates/connected-carrier-list/connected-carrier-list.styles.d.ts +0 -10
  24. package/src/components/templates/connected-carrier-list/connected-carrier-row/connected-carrier-row.d.ts +4 -1
  25. package/src/components/templates/connected-carrier-list/connected-carrier-row/connected-carrier-row.styles.d.ts +19 -12
  26. package/src/components/templates/products-display/products-display.styles.d.ts +12 -4
  27. package/src/components/templates/shipment-form/sections/customs-forms/components/index.d.ts +2 -0
  28. package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/form/index.d.ts +3 -0
  29. package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/form/schema.d.ts +38 -0
  30. package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/form/values.d.ts +12 -0
  31. package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/index.d.ts +2 -0
  32. package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/tax-id-form.d.ts +17 -0
  33. package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/tax-id-list.d.ts +12 -0
  34. package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/tax-ids.d.ts +8 -0
  35. package/src/components/templates/shipment-form/sections/customs-forms/components/tax-ids/tax-ids.styles.d.ts +70 -0
  36. package/src/components/templates/shipment-form/sections/customs-forms/customs-forms.d.ts +10 -0
  37. package/src/components/templates/shipment-form/sections/customs-forms/index.d.ts +1 -0
  38. package/src/components/templates/shipment-form/sections/index.d.ts +1 -0
  39. package/src/components/templates/shipment-form/shipment-form.d.ts +2 -1
  40. package/src/components/templates/shipment-form/shipment-form.styles.d.ts +9 -0
  41. package/src/components/warehouse-form/warehouse-form.d.ts +10 -3
  42. package/src/components/zero-state/zero-state.d.ts +6 -0
  43. package/src/components/zero-state/zero-state.styles.d.ts +14 -0
  44. package/src/elements/label-layout/label-layout-element.d.ts +43 -1
  45. package/src/elements/labels-grid/labels-grid.d.ts +43 -1
  46. package/src/elements/manage-carriers/manage-carriers.d.ts +93 -52
  47. package/src/elements/manage-external-carriers/manage-external-carriers.d.ts +65 -1
  48. package/src/elements/manage-funding/manage-funding-element.d.ts +46 -3
  49. package/src/elements/manage-warehouses/manage-warehouses.d.ts +43 -1
  50. package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +46 -3
  51. package/src/elements/purchase-label/hooks/use-customs.d.ts +1 -0
  52. package/src/elements/purchase-label/hooks/use-shipment-form.d.ts +1 -0
  53. package/src/elements/purchase-label/purchase-label.d.ts +68 -4
  54. package/src/elements/shipment-summary/shipment-summary.d.ts +47 -1
  55. package/src/elements/shipments-grid/shipments-grid.d.ts +43 -1
  56. package/src/elements/theme-creator/theme-creator.d.ts +43 -1
  57. package/src/elements/transaction-history/transaction-history-element.d.ts +43 -1
  58. package/src/elements/unit-settings/unit-settings-element.d.ts +43 -1
  59. package/src/elements/vat-settings/vat-settings-element.d.ts +43 -1
  60. package/src/elements/void-label/void-label.d.ts +57 -10
  61. package/src/elements-provider/elements-context-provider.d.ts +44 -0
  62. package/src/elements-provider/elements-provider.d.ts +6 -40
  63. package/src/elements-provider/index.d.ts +2 -0
  64. package/src/features/manage-carriers/hooks/use-list-funding-source-carriers.d.ts +1 -1
  65. package/src/features/manage-carriers/manage-carriers.d.ts +2 -1
  66. package/src/features/manage-external-carriers/index.d.ts +1 -0
  67. package/src/features/manage-external-carriers/manage-external-carriers.d.ts +11 -1
  68. package/src/features/manage-external-carriers/use-manage-external-carriers.d.ts +12 -0
  69. package/src/features/manage-funding/manage-funding.d.ts +4 -1
  70. package/src/features/payment-method-settings/payment-method-settings.d.ts +4 -1
  71. package/src/hooks/options/use-package-options.d.ts +1 -1
  72. package/src/hooks/options/use-warehouse-options.d.ts +3 -1
  73. package/src/index.d.ts +1 -0
  74. package/src/locales/en/index.d.ts +43 -1
  75. package/src/testing/test-utils.d.ts +0 -1
  76. package/src/utilities/formatString.d.ts +2 -0
  77. package/src/utilities/index.d.ts +1 -0
  78. package/src/utilities/pudo.d.ts +3 -0
  79. package/src/utilities/rates.d.ts +1 -3
  80. package/src/utilities/shipengine/carrier.d.ts +4 -1
  81. package/src/workflows/account-settings/account-settings.d.ts +45 -2
  82. package/src/workflows/account-settings/use-get-panel-props.d.ts +3 -3
  83. package/src/workflows/carrier-services/carrier-services.d.ts +51 -29
  84. package/src/workflows/connect-external-carrier/connect-external-carrier.d.ts +43 -1
  85. package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.d.ts +2 -1
  86. package/src/workflows/onboarding/onboarding.d.ts +43 -1
  87. package/story-notes.js +1 -0
  88. package/suspend-text.js +1 -0
  89. package/transaction-history-element.js +1 -0
  90. package/use-page-layout.js +1 -0
  91. package/use-scrub-errors.js +1 -0
  92. package/use-toggle.js +1 -0
  93. package/use-unit-settings.js +1 -0
  94. package/utilities.js +1 -1
  95. package/validation.js +1 -0
  96. package/wallet-form.js +1 -0
  97. package/warehouses.js +1 -0
  98. package/workflows.js +1 -1
  99. package/carrier-c2a5ed53.js +0 -1
  100. package/carrier-logo-330e926f.js +0 -1
  101. package/formatString-413ec7c7.js +0 -1
  102. package/shipment-150160e0.js +0 -1
  103. package/story-notes-c714d2ed.js +0 -1
  104. package/suspend-text-cad3a977.js +0 -1
  105. package/transaction-history-element-cbfe487c.js +0 -1
  106. package/use-page-layout-8cb5075f.js +0 -1
  107. package/use-scrub-errors-9870a6f3.js +0 -1
  108. package/use-toggle-866d7938.js +0 -1
  109. package/use-unit-settings-a5bae16e.js +0 -1
  110. package/validation-528e7834.js +0 -1
  111. package/wallet-form-9e4bfaea.js +0 -1
  112. package/warehouse-form-da6a7ac5.js +0 -34
  113. package/warehouses-a83188ab.js +0 -1
  114. /package/{address-8f8119f4.js → address.js} +0 -0
  115. /package/{assertions-dfa95b4d.js → assertions.js} +0 -0
  116. /package/{money-d4f3d7c3.js → money.js} +0 -0
  117. /package/{phone-87dd7bd8.js → phone.js} +0 -0
  118. /package/{zod-60def96c.js → zod.js} +0 -0
@@ -176,6 +176,7 @@ export declare const Element: ({ resources, ...props }: object & {
176
176
  title: string;
177
177
  };
178
178
  };
179
+ noFundingSource: string;
179
180
  };
180
181
  "rate-details": {
181
182
  total: string;
@@ -360,6 +361,12 @@ export declare const Element: ({ resources, ...props }: object & {
360
361
  subtitle: string;
361
362
  inlineMessage: string;
362
363
  };
364
+ errors: {
365
+ noCarriers: {
366
+ title: string;
367
+ subtitle: string;
368
+ };
369
+ };
363
370
  success: {
364
371
  title: string;
365
372
  subtitle: string;
@@ -405,6 +412,7 @@ export declare const Element: ({ resources, ...props }: object & {
405
412
  returnToAddressIsDifferent: string;
406
413
  setDefault: string;
407
414
  shipFrom: string;
415
+ noWarehouses: string;
408
416
  };
409
417
  "manage-funding": {
410
418
  actions: {
@@ -452,6 +460,7 @@ export declare const Element: ({ resources, ...props }: object & {
452
460
  errors: {
453
461
  balanceUnknown: string;
454
462
  unableToFindBalance: string;
463
+ noFundingSource: string;
455
464
  };
456
465
  byoc: {
457
466
  invoiceNotification: string;
@@ -551,6 +560,9 @@ export declare const Element: ({ resources, ...props }: object & {
551
560
  toastTitle: string;
552
561
  toastBody: string;
553
562
  };
563
+ deleteCarrierErrorTitle: string;
564
+ deleteCarrierErrorMessage: string;
565
+ loadingDeletingCarrier: string;
554
566
  };
555
567
  common: {
556
568
  actions: {
@@ -653,6 +665,7 @@ export declare const Element: ({ resources, ...props }: object & {
653
665
  };
654
666
  customs: {
655
667
  addDeclaration: string;
668
+ noResults: string;
656
669
  contents: {
657
670
  documents: string;
658
671
  gift: string;
@@ -660,6 +673,14 @@ export declare const Element: ({ resources, ...props }: object & {
660
673
  returnedGoods: string;
661
674
  sample: string;
662
675
  };
676
+ taxIds: {
677
+ sectionTitle: string;
678
+ addTaxId: string;
679
+ sectionTitleTooltip: string;
680
+ entityTypeTooltipText: string;
681
+ entityTypeTooltipPointOne: string;
682
+ entityTypeTooltipPointTwo: string;
683
+ };
663
684
  currencyChange: string;
664
685
  declarations: string;
665
686
  descriptionTooltip: {
@@ -677,6 +698,11 @@ export declare const Element: ({ resources, ...props }: object & {
677
698
  sku: string;
678
699
  value: string;
679
700
  valueQuantity: string;
701
+ taxId: string;
702
+ taxIdType: string;
703
+ taxIdTypeValue: string;
704
+ taxIssuingAuthority: string;
705
+ entityType: string;
680
706
  };
681
707
  nonDelivery: {
682
708
  returnToSender: string;
@@ -749,6 +775,8 @@ export declare const Element: ({ resources, ...props }: object & {
749
775
  shipment: string;
750
776
  shipments: string;
751
777
  warehouses: string;
778
+ funding: string;
779
+ paymentMethod: string;
752
780
  };
753
781
  months: {
754
782
  january: string;
@@ -827,6 +855,16 @@ export declare const Element: ({ resources, ...props }: object & {
827
855
  gram: string;
828
856
  kilogram: string;
829
857
  };
858
+ actionsMenu: {
859
+ menuTitle: string;
860
+ actions: {
861
+ printLabel: string;
862
+ voidLabel: string;
863
+ printForms: string;
864
+ edit: string;
865
+ remove: string;
866
+ };
867
+ };
830
868
  ZnVuZGluZ19zb3VyY2VfaWQgbXVzdCBiZSBhbiBpbnRlZ2Vy: string;
831
869
  T25seSByZXNpZGVudGlhbCBkZWxpdmVyeSBhZGRyZXNzZXMgYXJlIGFsbG93ZWQgZm9yIFVQUyBHcm91bmQgU2F2ZXIu: string;
832
870
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkMTAwLgo=": string;
@@ -842,7 +880,11 @@ export declare const Element: ({ resources, ...props }: object & {
842
880
  };
843
881
  "account-settings": {
844
882
  messages: {
845
- noFundingSources: string;
883
+ transactionHistory: {
884
+ noTransactions: string;
885
+ };
886
+ noFundingSourceDescription: string;
887
+ noFundingSourceAction: string;
846
888
  };
847
889
  title: string;
848
890
  sections: {
@@ -176,6 +176,7 @@ export declare const Element: ({ resources, ...props }: object & {
176
176
  title: string;
177
177
  };
178
178
  };
179
+ noFundingSource: string;
179
180
  };
180
181
  "rate-details": {
181
182
  total: string;
@@ -360,6 +361,12 @@ export declare const Element: ({ resources, ...props }: object & {
360
361
  subtitle: string;
361
362
  inlineMessage: string;
362
363
  };
364
+ errors: {
365
+ noCarriers: {
366
+ title: string;
367
+ subtitle: string;
368
+ };
369
+ };
363
370
  success: {
364
371
  title: string;
365
372
  subtitle: string;
@@ -405,6 +412,7 @@ export declare const Element: ({ resources, ...props }: object & {
405
412
  returnToAddressIsDifferent: string;
406
413
  setDefault: string;
407
414
  shipFrom: string;
415
+ noWarehouses: string;
408
416
  };
409
417
  "manage-funding": {
410
418
  actions: {
@@ -452,6 +460,7 @@ export declare const Element: ({ resources, ...props }: object & {
452
460
  errors: {
453
461
  balanceUnknown: string;
454
462
  unableToFindBalance: string;
463
+ noFundingSource: string;
455
464
  };
456
465
  byoc: {
457
466
  invoiceNotification: string;
@@ -551,6 +560,9 @@ export declare const Element: ({ resources, ...props }: object & {
551
560
  toastTitle: string;
552
561
  toastBody: string;
553
562
  };
563
+ deleteCarrierErrorTitle: string;
564
+ deleteCarrierErrorMessage: string;
565
+ loadingDeletingCarrier: string;
554
566
  };
555
567
  common: {
556
568
  actions: {
@@ -653,6 +665,7 @@ export declare const Element: ({ resources, ...props }: object & {
653
665
  };
654
666
  customs: {
655
667
  addDeclaration: string;
668
+ noResults: string;
656
669
  contents: {
657
670
  documents: string;
658
671
  gift: string;
@@ -660,6 +673,14 @@ export declare const Element: ({ resources, ...props }: object & {
660
673
  returnedGoods: string;
661
674
  sample: string;
662
675
  };
676
+ taxIds: {
677
+ sectionTitle: string;
678
+ addTaxId: string;
679
+ sectionTitleTooltip: string;
680
+ entityTypeTooltipText: string;
681
+ entityTypeTooltipPointOne: string;
682
+ entityTypeTooltipPointTwo: string;
683
+ };
663
684
  currencyChange: string;
664
685
  declarations: string;
665
686
  descriptionTooltip: {
@@ -677,6 +698,11 @@ export declare const Element: ({ resources, ...props }: object & {
677
698
  sku: string;
678
699
  value: string;
679
700
  valueQuantity: string;
701
+ taxId: string;
702
+ taxIdType: string;
703
+ taxIdTypeValue: string;
704
+ taxIssuingAuthority: string;
705
+ entityType: string;
680
706
  };
681
707
  nonDelivery: {
682
708
  returnToSender: string;
@@ -749,6 +775,8 @@ export declare const Element: ({ resources, ...props }: object & {
749
775
  shipment: string;
750
776
  shipments: string;
751
777
  warehouses: string;
778
+ funding: string;
779
+ paymentMethod: string;
752
780
  };
753
781
  months: {
754
782
  january: string;
@@ -827,6 +855,16 @@ export declare const Element: ({ resources, ...props }: object & {
827
855
  gram: string;
828
856
  kilogram: string;
829
857
  };
858
+ actionsMenu: {
859
+ menuTitle: string;
860
+ actions: {
861
+ printLabel: string;
862
+ voidLabel: string;
863
+ printForms: string;
864
+ edit: string;
865
+ remove: string;
866
+ };
867
+ };
830
868
  ZnVuZGluZ19zb3VyY2VfaWQgbXVzdCBiZSBhbiBpbnRlZ2Vy: string;
831
869
  T25seSByZXNpZGVudGlhbCBkZWxpdmVyeSBhZGRyZXNzZXMgYXJlIGFsbG93ZWQgZm9yIFVQUyBHcm91bmQgU2F2ZXIu: string;
832
870
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkMTAwLgo=": string;
@@ -842,7 +880,11 @@ export declare const Element: ({ resources, ...props }: object & {
842
880
  };
843
881
  "account-settings": {
844
882
  messages: {
845
- noFundingSources: string;
883
+ transactionHistory: {
884
+ noTransactions: string;
885
+ };
886
+ noFundingSourceDescription: string;
887
+ noFundingSourceAction: string;
846
888
  };
847
889
  title: string;
848
890
  sections: {
@@ -267,6 +267,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
267
267
  title: string;
268
268
  };
269
269
  };
270
+ noFundingSource: string;
270
271
  };
271
272
  "rate-details": {
272
273
  total: string;
@@ -451,8 +452,23 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
451
452
  subtitle: string;
452
453
  inlineMessage: string;
453
454
  };
455
+ errors: {
456
+ noCarriers: {
457
+ /**
458
+ * `onSuccess` is a callback function that will be invoked when the request to void a given
459
+ * shipping label is successful.
460
+ */
461
+ title: string;
462
+ subtitle: string;
463
+ };
464
+ };
454
465
  success: {
455
- title: string;
466
+ title: string; /**
467
+ * `onViewShipment` is a callback function that will be invoked when the user clicks the
468
+ * `View Shipment` button. This will take you back to the
469
+ * {@link ShipmentSummary.Element | `Shipment Summary Element`} for the given shipment, where you
470
+ * will be able to see the voided label listed.
471
+ */
456
472
  subtitle: string;
457
473
  action: string;
458
474
  };
@@ -496,6 +512,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
496
512
  returnToAddressIsDifferent: string;
497
513
  setDefault: string;
498
514
  shipFrom: string;
515
+ noWarehouses: string;
499
516
  };
500
517
  "manage-funding": {
501
518
  actions: {
@@ -545,6 +562,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
545
562
  errors: {
546
563
  balanceUnknown: string;
547
564
  unableToFindBalance: string;
565
+ noFundingSource: string;
548
566
  };
549
567
  byoc: {
550
568
  invoiceNotification: string;
@@ -646,6 +664,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
646
664
  toastTitle: string;
647
665
  toastBody: string;
648
666
  };
667
+ deleteCarrierErrorTitle: string;
668
+ deleteCarrierErrorMessage: string;
669
+ loadingDeletingCarrier: string;
649
670
  };
650
671
  common: {
651
672
  actions: {
@@ -751,6 +772,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
751
772
  };
752
773
  customs: {
753
774
  addDeclaration: string;
775
+ noResults: string;
754
776
  contents: {
755
777
  documents: string;
756
778
  gift: string;
@@ -758,6 +780,14 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
758
780
  returnedGoods: string;
759
781
  sample: string;
760
782
  };
783
+ taxIds: {
784
+ sectionTitle: string;
785
+ addTaxId: string;
786
+ sectionTitleTooltip: string;
787
+ entityTypeTooltipText: string;
788
+ entityTypeTooltipPointOne: string;
789
+ entityTypeTooltipPointTwo: string;
790
+ };
761
791
  currencyChange: string;
762
792
  declarations: string;
763
793
  descriptionTooltip: {
@@ -775,6 +805,11 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
775
805
  sku: string;
776
806
  value: string;
777
807
  valueQuantity: string;
808
+ taxId: string;
809
+ taxIdType: string;
810
+ taxIdTypeValue: string;
811
+ taxIssuingAuthority: string;
812
+ entityType: string;
778
813
  };
779
814
  nonDelivery: {
780
815
  returnToSender: string;
@@ -847,6 +882,8 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
847
882
  shipment: string;
848
883
  shipments: string;
849
884
  warehouses: string;
885
+ funding: string;
886
+ paymentMethod: string;
850
887
  };
851
888
  months: {
852
889
  january: string;
@@ -925,6 +962,16 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
925
962
  gram: string;
926
963
  kilogram: string;
927
964
  };
965
+ actionsMenu: {
966
+ menuTitle: string;
967
+ actions: {
968
+ printLabel: string;
969
+ voidLabel: string;
970
+ printForms: string;
971
+ edit: string;
972
+ remove: string;
973
+ };
974
+ };
928
975
  ZnVuZGluZ19zb3VyY2VfaWQgbXVzdCBiZSBhbiBpbnRlZ2Vy: string;
929
976
  T25seSByZXNpZGVudGlhbCBkZWxpdmVyeSBhZGRyZXNzZXMgYXJlIGFsbG93ZWQgZm9yIFVQUyBHcm91bmQgU2F2ZXIu: string;
930
977
  "VGhlIHNlbGVjdGVkIHNlcnZpY2UgaW5jbHVkZXMgaW5zdXJhbmNlIGZvciBhbiBpbnN1cmVkIGFtb3VudCB1cCB0byAkMTAwLgo=": string;
@@ -940,7 +987,11 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
940
987
  };
941
988
  "account-settings": {
942
989
  messages: {
943
- noFundingSources: string;
990
+ transactionHistory: {
991
+ noTransactions: string;
992
+ };
993
+ noFundingSourceDescription: string;
994
+ noFundingSourceAction: string;
944
995
  };
945
996
  title: string;
946
997
  sections: {
@@ -950,18 +1001,14 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
950
1001
  adjustmentHistory: string;
951
1002
  warehouses: string;
952
1003
  carriers: string;
953
- /**
954
- * # Void Label Component Props
955
- *
956
- * - These are the base props that will be passed into the `<VoidLabel />` component.
957
- *
958
- * @see {@link VoidLabel.Component | This prop types usage in the `<VoidLabel />` component}
959
- */
960
1004
  externalCarriers: string;
961
1005
  labelLayout: string;
962
1006
  unitSettings: string;
963
1007
  vatSettings: string;
964
- };
1008
+ }; /**
1009
+ * `onComplete` is a callback function that will be invoked when the request to void a given
1010
+ * shipping label is completed.
1011
+ */
965
1012
  };
966
1013
  };
967
1014
  } | undefined;
@@ -0,0 +1,44 @@
1
+ /// <reference types="react" />
2
+ import { Theme } from "@shipengine/giger-theme";
3
+ import { ShipEngineAPIConfig, ShipEngineProps } from "@shipengine/react-api";
4
+ import { ElementsFeatureFlags, GlobalFeatures } from "../utilities";
5
+ export type ElementsErrorHandler = (err: Error) => void;
6
+ export interface ElementsContextValue {
7
+ baseURL: string;
8
+ cdnURL: string;
9
+ container?: HTMLElement;
10
+ getFeatures: (key: keyof ElementsFeatureFlags) => ElementsFeatureFlags[keyof ElementsFeatureFlags];
11
+ getToken: ShipEngineProps["getToken"];
12
+ globalFeatures: GlobalFeatures;
13
+ locale?: string;
14
+ onError: ElementsErrorHandler;
15
+ scope: string | null;
16
+ theme: Theme;
17
+ }
18
+ /**
19
+ * @category Contexts
20
+ */
21
+ export declare const ElementsContext: import("react").Context<ElementsContextValue | undefined>;
22
+ export type ElementsContextProviderProps = {
23
+ cdnURL?: string;
24
+ children: React.ReactNode;
25
+ container?: HTMLElement;
26
+ features?: ElementsFeatureFlags;
27
+ locale?: string;
28
+ onError?: ElementsErrorHandler;
29
+ /** Scope of the Elements Provider. Can be null to not specify a specific element */
30
+ scope?: string | null;
31
+ theme: Theme;
32
+ } & Pick<ShipEngineAPIConfig, "getToken" | "baseURL">;
33
+ /**
34
+ * @category Providers
35
+ */
36
+ export declare const ElementsContextProvider: ({ baseURL, cdnURL, children, container, features, getToken, locale: localeProp, onError, scope, theme, }: ElementsContextProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
37
+ /**
38
+ * Must be used within {@link ElementsProvider}
39
+ *
40
+ * @category Elements Hooks
41
+ *
42
+ * @see {@link registerElement}
43
+ */
44
+ export declare const useElements: () => ElementsContextValue;
@@ -1,46 +1,12 @@
1
- /// <reference types="react" />
2
1
  import { DefaultOptions } from "@tanstack/react-query";
3
- import { CustomThemeData, Theme } from "@shipengine/giger-theme";
4
- import { ShipEngineAPIConfig, ShipEngineProps } from "@shipengine/react-api";
5
- import { ElementsFeatureFlags, GlobalFeatures } from "../utilities";
6
- export type ElementsErrorHandler = (err: Error) => void;
7
- export interface ElementsContextValue {
8
- baseURL: string;
9
- cdnURL: string;
10
- container?: HTMLElement;
11
- getFeatures: (key: keyof ElementsFeatureFlags) => ElementsFeatureFlags[keyof ElementsFeatureFlags];
12
- getToken: ShipEngineProps["getToken"];
13
- globalFeatures: GlobalFeatures;
14
- locale?: string;
15
- onError: ElementsErrorHandler;
16
- scope: string | null;
17
- theme: Theme;
18
- }
19
- /**
20
- * @category Contexts
21
- */
22
- export declare const ElementsContext: import("react").Context<ElementsContextValue | undefined>;
23
- export type ElementsProviderProps = {
24
- cdnURL?: string;
25
- children: React.ReactNode;
26
- container?: HTMLElement;
2
+ import { CustomThemeData } from "@shipengine/giger-theme";
3
+ import { ShipEngineAPIConfig } from "@shipengine/react-api";
4
+ import { ElementsContextProviderProps } from "./elements-context-provider";
5
+ export type ElementsProviderProps = Omit<ElementsContextProviderProps, "theme"> & ShipEngineAPIConfig & {
27
6
  defaultQueryClientOptions?: DefaultOptions;
28
- features?: ElementsFeatureFlags;
29
- locale?: string;
30
- onError?: ElementsErrorHandler;
31
- /** Scope of the Elements Provider. Can be null to not specify a specific element */
32
- scope?: string | null;
33
7
  themeConfig?: CustomThemeData;
34
- } & ShipEngineAPIConfig;
8
+ };
35
9
  /**
36
10
  * @category Providers
37
11
  */
38
- export declare const ElementsProvider: ({ baseURL, cdnURL, children, container, features, getToken, headers, locale: localeProp, onApiError, onError, scope, themeConfig, defaultQueryClientOptions, }: ElementsProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
39
- /**
40
- * Must be used within {@link ElementsProvider}
41
- *
42
- * @category Elements Hooks
43
- *
44
- * @see {@link registerElement}
45
- */
46
- export declare const useElements: () => ElementsContextValue;
12
+ export declare const ElementsProvider: ({ baseURL, cdnURL, children, container, features, getToken, headers, locale, onApiError, onError, scope, themeConfig, defaultQueryClientOptions, }: ElementsProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +1,3 @@
1
+ export * from "./elements-context-provider";
1
2
  export * from "./elements-provider";
3
+ export * from "./elements-test-provider";
@@ -4,7 +4,7 @@ export type ConnectedCarrierMetadata = {
4
4
  isConnected: boolean;
5
5
  };
6
6
  export declare const useListFundingSourceCarriers: () => {
7
- data: ConnectedCarrierMetadata[];
7
+ data: ConnectedCarrierMetadata[] | undefined;
8
8
  error: import("@shipengine/react-api").CodedError[] | null;
9
9
  isLoading: boolean;
10
10
  refetch: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@shipengine/react-api").Carrier[], import("@shipengine/react-api").CodedError[]>>;
@@ -1,4 +1,5 @@
1
1
  export type ShipEngineCarriersProps = {
2
+ onRedirectToOnboarding?: () => void;
2
3
  showFunds?: boolean;
3
4
  };
4
- export declare const ShipEngineCarriers: ({ showFunds }: ShipEngineCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
5
+ export declare const ShipEngineCarriers: ({ showFunds, onRedirectToOnboarding, }: ShipEngineCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +1,2 @@
1
1
  export * from "./manage-external-carriers";
2
+ export * from "./use-manage-external-carriers";
@@ -1,4 +1,14 @@
1
+ import { Carrier, CodedError, ListCarrierConnectionsResponse } from "@shipengine/js-api";
1
2
  export type ExternalCarriersProps = {
3
+ carrierMetadata?: ListCarrierConnectionsResponse;
4
+ carrierMetadataLoading: boolean;
5
+ connectedExternalCarriers?: Carrier[];
6
+ deleteCarrier: (carrierId: string) => Promise<void>;
7
+ deleteCarrierErrors: CodedError[] | null;
8
+ isDeletingCarrier: boolean;
9
+ isListCarriersFetching: boolean;
10
+ isListCarriersLoading: boolean;
2
11
  isModalFullScreen?: boolean;
12
+ refetchConnectedCarriers: () => void;
3
13
  };
4
- export declare const ExternalCarriers: ({ isModalFullScreen }: ExternalCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
14
+ export declare const ExternalCarriers: ({ isModalFullScreen, carrierMetadata, carrierMetadataLoading, connectedExternalCarriers, deleteCarrier, isDeletingCarrier, isListCarriersFetching, isListCarriersLoading, deleteCarrierErrors, refetchConnectedCarriers, }: ExternalCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export declare const useManageExternalCarriers: () => {
2
+ carrierMetadata: import("@shipengine/react-api").ListCarrierConnectionsResponse | undefined;
3
+ carrierMetadataLoading: boolean;
4
+ connectedExternalCarriers: import("@shipengine/react-api").Carrier[] | undefined;
5
+ deleteCarrier: import("@tanstack/react-query").UseMutateAsyncFunction<void, import("@shipengine/react-api").CodedError[], string, unknown>;
6
+ deleteCarrierErrors: import("@shipengine/react-api").CodedError[] | null;
7
+ deleteCarrierSuccess: boolean;
8
+ isDeletingCarrier: boolean;
9
+ isListCarriersFetching: boolean;
10
+ isListCarriersLoading: boolean;
11
+ refetchConnectedCarriers: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@shipengine/react-api").Carrier[], import("@shipengine/react-api").CodedError[]>>;
12
+ };
@@ -13,4 +13,7 @@
13
13
  *
14
14
  * @see {@link ManageFundingProps | The props that are passed into the `<ManageFunding />` component}
15
15
  */
16
- export declare const ManageFunding: () => import("@emotion/react/jsx-runtime").JSX.Element;
16
+ export type ManageFundingProps = {
17
+ onRedirectToOnboarding?: () => void;
18
+ };
19
+ export declare const ManageFunding: ({ onRedirectToOnboarding }: ManageFundingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -17,4 +17,7 @@
17
17
  *
18
18
  * @see {@link AccountSettings.Element | The `<AccountSettings />` component renders the `<PaymentMethodSettings />` component}
19
19
  */
20
- export declare const PaymentMethodSettings: () => import("@emotion/react/jsx-runtime").JSX.Element;
20
+ export type PaymentMethodSettingsProps = {
21
+ onRedirectToOnboarding: () => void;
22
+ };
23
+ export declare const PaymentMethodSettings: ({ onRedirectToOnboarding }: PaymentMethodSettingsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { SE } from "@shipengine/react-api";
2
- import { SelectCategory } from "../../components/field/select";
2
+ import { SelectCategory } from "../../components/field/select/select-with-categories";
3
3
  /**
4
4
  * @internal
5
5
  *
@@ -6,7 +6,9 @@ import { SE } from "@shipengine/react-api";
6
6
  *
7
7
  * @category Hooks
8
8
  */
9
- export declare const useWarehouseOptions: (warehouses?: SE.Warehouse[]) => {
9
+ export declare const useWarehouseOptions: (warehouses?: SE.Warehouse[], rightContentAction?: ((warehouseId: string) => void) | undefined) => {
10
10
  label: string;
11
+ rightContent: import("@emotion/react/jsx-runtime").JSX.Element;
12
+ subLabel: string;
11
13
  value: string;
12
14
  }[] | undefined;
package/src/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./components";
2
2
  export * from "./constants";
3
+ export * from "./create-element";
3
4
  export * from "./elements";
4
5
  export * from "./extensions";
5
6
  export * from "./hooks";