@shipengine/elements 2.12.0 → 2.13.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 (58) hide show
  1. package/actions-menu.js +5 -5
  2. package/index.js +1 -1
  3. package/package.json +2 -2
  4. package/src/components/add-funds-form/add-funds-form.d.ts +9 -1
  5. package/src/components/carrier-connection-card/carrier-connection-card.styles.d.ts +1 -1
  6. package/src/components/collapsible-panel/collapsible-panel.d.ts +15 -1
  7. package/src/components/field/date-picker/date-picker.d.ts +3 -1
  8. package/src/components/field/rate-select/rate-card/cost-breakdown/cost-breakdown.styles.d.ts +2 -1
  9. package/src/components/field/rate-select/rate-card/rate-card.styles.d.ts +1 -1
  10. package/src/components/grid-controller/grid-controller.styles.d.ts +8 -3
  11. package/src/components/grid-filters/components/label-id-filter/label-id-filter.styles.d.ts +1 -1
  12. package/src/components/history/history-card/history-card.styles.d.ts +1 -1
  13. package/src/components/save-status/save-status.d.ts +15 -1
  14. package/src/components/templates/label-display/label-card.styles.d.ts +1 -1
  15. package/src/components/templates/shipment-form/shipment-schema.d.ts +15 -109
  16. package/src/components/templates/theme-creator/theme-creator.styles.d.ts +1 -1
  17. package/src/elements/labels-grid/labels-grid.d.ts +15 -6
  18. package/src/elements/manage-carriers/manage-carriers.d.ts +10 -1
  19. package/src/elements/manage-external-carriers/manage-external-carriers.d.ts +10 -1
  20. package/src/elements/manage-funding/manage-funding-element.d.ts +10 -1
  21. package/src/elements/manage-warehouses/manage-warehouses.d.ts +10 -1
  22. package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +10 -1
  23. package/src/elements/purchase-label/purchase-label.d.ts +14 -2
  24. package/src/elements/select-label-layout/select-label-layout-element.d.ts +10 -1
  25. package/src/elements/shipment-summary/shipment-summary.d.ts +13 -2
  26. package/src/elements/shipments-grid/shipments-grid.d.ts +10 -1
  27. package/src/elements/theme-creator/theme-creator.d.ts +10 -1
  28. package/src/elements/transaction-history/transaction-history-element.d.ts +10 -1
  29. package/src/elements/unit-settings/unit-settings-element.d.ts +10 -1
  30. package/src/elements/vat-settings/vat-settings-element.d.ts +10 -1
  31. package/src/elements/void-label/components/actions/actions.d.ts +2 -1
  32. package/src/elements/void-label/void-label.d.ts +65 -25
  33. package/src/elements-provider/elements-context-provider.d.ts +10 -3
  34. package/src/elements-provider/elements-provider.d.ts +7 -2
  35. package/src/features/manage-carriers/index.d.ts +1 -0
  36. package/src/features/manage-carriers/manage-carriers.d.ts +12 -1
  37. package/src/features/manage-carriers/use-manage-carriers.d.ts +15 -0
  38. package/src/features/manage-funding/manage-funding.d.ts +10 -1
  39. package/src/features/vat-settings/use-vat-settings.d.ts +1 -1
  40. package/src/hooks/options/use-insurance-provider-options.d.ts +1 -1
  41. package/src/hooks/use-root-portal.d.ts +3 -2
  42. package/src/locales/en/index.d.ts +10 -1
  43. package/src/utilities/styles.d.ts +6 -2
  44. package/src/workflows/account-settings/account-settings.d.ts +10 -1
  45. package/src/workflows/account-settings/use-get-panel-props.d.ts +2 -2
  46. package/src/workflows/carrier-services/carrier-services.d.ts +60 -2
  47. package/src/workflows/connect-external-carrier/connect-external-carrier.d.ts +33 -1
  48. package/src/workflows/label-workflow/label-workflow.d.ts +10 -0
  49. package/src/workflows/onboarding/onboarding.d.ts +17 -1
  50. package/suspend-text.js +1 -1
  51. package/transaction-history-element.js +1 -1
  52. package/use-scrub-errors.js +1 -1
  53. package/use-toggle.js +1 -1
  54. package/use-unit-settings.js +1 -1
  55. package/usePager.js +1 -1
  56. package/utilities.js +1 -1
  57. package/validation.js +1 -1
  58. package/wallet-form.js +1 -1
@@ -33,6 +33,7 @@ export declare const Element: ({ resources, ...props }: PaymentMethodSettingsPro
33
33
  };
34
34
  errorMessages: {
35
35
  labelIdRequired: string;
36
+ request_failed_to_complete: string;
36
37
  };
37
38
  resultMessages: {
38
39
  approved: string;
@@ -962,6 +963,9 @@ export declare const Element: ({ resources, ...props }: PaymentMethodSettingsPro
962
963
  tooManyCharacters: string;
963
964
  requiredShipmentId: string;
964
965
  requiredLabelId: string;
966
+ heightExceeded: string;
967
+ widthExceeded: string;
968
+ lengthExceeded: string;
965
969
  };
966
970
  shippingPresets: {
967
971
  apply: string;
@@ -1036,7 +1040,12 @@ export declare const Element: ({ resources, ...props }: PaymentMethodSettingsPro
1036
1040
  transactionHistory: string;
1037
1041
  adjustmentHistory: string;
1038
1042
  warehouses: string;
1039
- carriers: string;
1043
+ carriers: {
1044
+ title: string;
1045
+ customStatusMessages: {
1046
+ success: string;
1047
+ };
1048
+ };
1040
1049
  externalCarriers: string;
1041
1050
  labelLayout: string;
1042
1051
  unitSettings: string;
@@ -252,6 +252,7 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
252
252
  };
253
253
  errorMessages: {
254
254
  labelIdRequired: string;
255
+ request_failed_to_complete: string;
255
256
  };
256
257
  resultMessages: {
257
258
  approved: string;
@@ -261,7 +262,10 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
261
262
  refund_process: string;
262
263
  refund_rules: string;
263
264
  resultTitles: {
264
- approved: string;
265
+ approved: string; /**
266
+ * A unique ID assigned during the creation of a sales order. It can be used to locate the
267
+ * sales order and any subsequent shipments related to that order.
268
+ */
265
269
  rejected: string;
266
270
  };
267
271
  voidedOn: string;
@@ -1206,6 +1210,9 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
1206
1210
  tooManyCharacters: string;
1207
1211
  requiredShipmentId: string;
1208
1212
  requiredLabelId: string;
1213
+ heightExceeded: string;
1214
+ widthExceeded: string;
1215
+ lengthExceeded: string;
1209
1216
  };
1210
1217
  shippingPresets: {
1211
1218
  apply: string;
@@ -1280,7 +1287,12 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
1280
1287
  transactionHistory: string;
1281
1288
  adjustmentHistory: string;
1282
1289
  warehouses: string;
1283
- carriers: string;
1290
+ carriers: {
1291
+ title: string;
1292
+ customStatusMessages: {
1293
+ success: string;
1294
+ };
1295
+ };
1284
1296
  externalCarriers: string;
1285
1297
  labelLayout: string;
1286
1298
  unitSettings: string;
@@ -32,6 +32,7 @@ export declare const Element: ({ resources, ...props }: object & {
32
32
  };
33
33
  errorMessages: {
34
34
  labelIdRequired: string;
35
+ request_failed_to_complete: string;
35
36
  };
36
37
  resultMessages: {
37
38
  approved: string;
@@ -961,6 +962,9 @@ export declare const Element: ({ resources, ...props }: object & {
961
962
  tooManyCharacters: string;
962
963
  requiredShipmentId: string;
963
964
  requiredLabelId: string;
965
+ heightExceeded: string;
966
+ widthExceeded: string;
967
+ lengthExceeded: string;
964
968
  };
965
969
  shippingPresets: {
966
970
  apply: string;
@@ -1035,7 +1039,12 @@ export declare const Element: ({ resources, ...props }: object & {
1035
1039
  transactionHistory: string;
1036
1040
  adjustmentHistory: string;
1037
1041
  warehouses: string;
1038
- carriers: string;
1042
+ carriers: {
1043
+ title: string;
1044
+ customStatusMessages: {
1045
+ success: string;
1046
+ };
1047
+ };
1039
1048
  externalCarriers: string;
1040
1049
  labelLayout: string;
1041
1050
  unitSettings: string;
@@ -121,11 +121,14 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
121
121
  };
122
122
  errorMessages: {
123
123
  labelIdRequired: string;
124
+ request_failed_to_complete: string;
124
125
  };
125
126
  resultMessages: {
126
127
  approved: string;
127
128
  rejected: string;
128
- dpdwallet: string;
129
+ dpdwallet: string; /**
130
+ * `features` is a set of feature flags you would like to enable or disable in this component.
131
+ */
129
132
  };
130
133
  refund_process: string;
131
134
  refund_rules: string;
@@ -1093,6 +1096,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
1093
1096
  tooManyCharacters: string;
1094
1097
  requiredShipmentId: string;
1095
1098
  requiredLabelId: string;
1099
+ heightExceeded: string;
1100
+ widthExceeded: string;
1101
+ lengthExceeded: string;
1096
1102
  };
1097
1103
  shippingPresets: {
1098
1104
  apply: string;
@@ -1167,7 +1173,12 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
1167
1173
  transactionHistory: string;
1168
1174
  adjustmentHistory: string;
1169
1175
  warehouses: string;
1170
- carriers: string;
1176
+ carriers: {
1177
+ title: string;
1178
+ customStatusMessages: {
1179
+ success: string;
1180
+ };
1181
+ };
1171
1182
  externalCarriers: string;
1172
1183
  labelLayout: string;
1173
1184
  unitSettings: string;
@@ -104,6 +104,7 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & {
104
104
  };
105
105
  errorMessages: {
106
106
  labelIdRequired: string;
107
+ request_failed_to_complete: string;
107
108
  };
108
109
  resultMessages: {
109
110
  approved: string;
@@ -1096,6 +1097,9 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & {
1096
1097
  tooManyCharacters: string;
1097
1098
  requiredShipmentId: string;
1098
1099
  requiredLabelId: string;
1100
+ heightExceeded: string;
1101
+ widthExceeded: string;
1102
+ lengthExceeded: string;
1099
1103
  };
1100
1104
  shippingPresets: {
1101
1105
  apply: string;
@@ -1170,7 +1174,12 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & {
1170
1174
  transactionHistory: string;
1171
1175
  adjustmentHistory: string;
1172
1176
  warehouses: string;
1173
- carriers: string;
1177
+ carriers: {
1178
+ title: string;
1179
+ customStatusMessages: {
1180
+ success: string;
1181
+ };
1182
+ };
1174
1183
  externalCarriers: string;
1175
1184
  labelLayout: string;
1176
1185
  unitSettings: string;
@@ -45,6 +45,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
45
45
  };
46
46
  errorMessages: {
47
47
  labelIdRequired: string;
48
+ request_failed_to_complete: string;
48
49
  };
49
50
  resultMessages: {
50
51
  approved: string;
@@ -974,6 +975,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
974
975
  tooManyCharacters: string;
975
976
  requiredShipmentId: string;
976
977
  requiredLabelId: string;
978
+ heightExceeded: string;
979
+ widthExceeded: string;
980
+ lengthExceeded: string;
977
981
  };
978
982
  shippingPresets: {
979
983
  apply: string;
@@ -1048,7 +1052,12 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
1048
1052
  transactionHistory: string;
1049
1053
  adjustmentHistory: string;
1050
1054
  warehouses: string;
1051
- carriers: string;
1055
+ carriers: {
1056
+ title: string;
1057
+ customStatusMessages: {
1058
+ success: string;
1059
+ };
1060
+ };
1052
1061
  externalCarriers: string;
1053
1062
  labelLayout: string;
1054
1063
  unitSettings: string;
@@ -32,6 +32,7 @@ export declare const Element: ({ resources, ...props }: object & {
32
32
  };
33
33
  errorMessages: {
34
34
  labelIdRequired: string;
35
+ request_failed_to_complete: string;
35
36
  };
36
37
  resultMessages: {
37
38
  approved: string;
@@ -961,6 +962,9 @@ export declare const Element: ({ resources, ...props }: object & {
961
962
  tooManyCharacters: string;
962
963
  requiredShipmentId: string;
963
964
  requiredLabelId: string;
965
+ heightExceeded: string;
966
+ widthExceeded: string;
967
+ lengthExceeded: string;
964
968
  };
965
969
  shippingPresets: {
966
970
  apply: string;
@@ -1035,7 +1039,12 @@ export declare const Element: ({ resources, ...props }: object & {
1035
1039
  transactionHistory: string;
1036
1040
  adjustmentHistory: string;
1037
1041
  warehouses: string;
1038
- carriers: string;
1042
+ carriers: {
1043
+ title: string;
1044
+ customStatusMessages: {
1045
+ success: string;
1046
+ };
1047
+ };
1039
1048
  externalCarriers: string;
1040
1049
  labelLayout: string;
1041
1050
  unitSettings: string;
@@ -32,6 +32,7 @@ export declare const Element: ({ resources, ...props }: object & {
32
32
  };
33
33
  errorMessages: {
34
34
  labelIdRequired: string;
35
+ request_failed_to_complete: string;
35
36
  };
36
37
  resultMessages: {
37
38
  approved: string;
@@ -961,6 +962,9 @@ export declare const Element: ({ resources, ...props }: object & {
961
962
  tooManyCharacters: string;
962
963
  requiredShipmentId: string;
963
964
  requiredLabelId: string;
965
+ heightExceeded: string;
966
+ widthExceeded: string;
967
+ lengthExceeded: string;
964
968
  };
965
969
  shippingPresets: {
966
970
  apply: string;
@@ -1035,7 +1039,12 @@ export declare const Element: ({ resources, ...props }: object & {
1035
1039
  transactionHistory: string;
1036
1040
  adjustmentHistory: string;
1037
1041
  warehouses: string;
1038
- carriers: string;
1042
+ carriers: {
1043
+ title: string;
1044
+ customStatusMessages: {
1045
+ success: string;
1046
+ };
1047
+ };
1039
1048
  externalCarriers: string;
1040
1049
  labelLayout: string;
1041
1050
  unitSettings: string;
@@ -32,6 +32,7 @@ export declare const Element: ({ resources, ...props }: object & {
32
32
  };
33
33
  errorMessages: {
34
34
  labelIdRequired: string;
35
+ request_failed_to_complete: string;
35
36
  };
36
37
  resultMessages: {
37
38
  approved: string;
@@ -961,6 +962,9 @@ export declare const Element: ({ resources, ...props }: object & {
961
962
  tooManyCharacters: string;
962
963
  requiredShipmentId: string;
963
964
  requiredLabelId: string;
965
+ heightExceeded: string;
966
+ widthExceeded: string;
967
+ lengthExceeded: string;
964
968
  };
965
969
  shippingPresets: {
966
970
  apply: string;
@@ -1035,7 +1039,12 @@ export declare const Element: ({ resources, ...props }: object & {
1035
1039
  transactionHistory: string;
1036
1040
  adjustmentHistory: string;
1037
1041
  warehouses: string;
1038
- carriers: string;
1042
+ carriers: {
1043
+ title: string;
1044
+ customStatusMessages: {
1045
+ success: string;
1046
+ };
1047
+ };
1039
1048
  externalCarriers: string;
1040
1049
  labelLayout: string;
1041
1050
  unitSettings: string;
@@ -1,9 +1,10 @@
1
1
  import { SE } from "@shipengine/react-api";
2
2
  export type ActionsProps = {
3
3
  onComplete?: (request: SE.VoidRequest, shipment: SE.SalesOrderShipment) => void;
4
+ onFail?: () => Promise<void> | void;
4
5
  onSubmit?: () => Promise<void>;
5
6
  onViewShipment?: (shipment: SE.SalesOrderShipment) => void;
6
7
  shipment: SE.SalesOrderShipment;
7
8
  voidRequest?: SE.VoidRequest;
8
9
  };
9
- export declare const Actions: ({ onComplete, onSubmit, onViewShipment, shipment, voidRequest, }: ActionsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
10
+ export declare const Actions: ({ onComplete, onSubmit, onViewShipment, shipment, voidRequest, onFail, }: ActionsProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -119,6 +119,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
119
119
  };
120
120
  errorMessages: {
121
121
  labelIdRequired: string;
122
+ request_failed_to_complete: string;
122
123
  };
123
124
  resultMessages: {
124
125
  approved: string;
@@ -351,6 +352,31 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
351
352
  "requires-additional-handling": string;
352
353
  addOns: string;
353
354
  contentDescription: string;
355
+ /**
356
+ * # Void Label Component
357
+ *
358
+ * - The `<VoidLabel />` component is used to void a given shipping label. When a label is voided,
359
+ * you then get the option to view the associated shipment via the `Shipment Summary` Element, or
360
+ * you can purchase another label for the shipment via the `Purchase Label` Element.
361
+ *
362
+ * @param ComponentProps The base props that will be passed into the `<VoidLabel />` component.
363
+ *
364
+ * @returns Element An EmotionJSX.Element that will render the `<VoidLabel />` component
365
+ * with all the appropriate wrappers.
366
+ *
367
+ * @example
368
+ * You can see how the `<Component />` is used in the `createElement` function call below.
369
+ * ```tsx
370
+ * export const Element = createElement(Component, ErrorFallback, {
371
+ *
372
+ * resources: { en },
373
+ * });
374
+ * ```
375
+ *
376
+ * <br />
377
+ *
378
+ * @see {@link VoidLabel.Element | The **Element** created to render `<VoidLabel />`}
379
+ */
354
380
  confirmation: string;
355
381
  dimensions: {
356
382
  length: string;
@@ -445,7 +471,11 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
445
471
  shipToAddressFormFields: string;
446
472
  sections: {
447
473
  customsForm: string;
448
- windsorFramework: string;
474
+ windsorFramework: string; /**
475
+ * # Void Label Element Props
476
+ *
477
+ * @see {@link VoidLabel.Element | See the full type that `typeof Element` will return}
478
+ */
449
479
  shipment: string;
450
480
  rate_one: string;
451
481
  rate_other: string;
@@ -486,10 +516,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
486
516
  };
487
517
  };
488
518
  success: {
489
- title: string; /**
490
- * `onSuccess` is a callback function that will be invoked when the request to void a given
491
- * shipping label is successful.
492
- */
519
+ title: string;
493
520
  subtitle: string;
494
521
  action: string;
495
522
  };
@@ -561,10 +588,15 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
561
588
  isEnabled: string;
562
589
  isLoading: string;
563
590
  lowBalancePurchaseThreshold: string;
564
- maximumPurchasesPerDay: string;
565
- purchaseAmount: string; /**
566
- * `labelId` is the unique identifier for the label you wish to void.
591
+ /**
592
+ * # Void Label Component Props
593
+ *
594
+ * - These are the base props that will be passed into the `<VoidLabel />` component.
595
+ *
596
+ * @see {@link VoidLabel.Component | This prop types usage in the `<VoidLabel />` component}
567
597
  */
598
+ maximumPurchasesPerDay: string;
599
+ purchaseAmount: string;
568
600
  readSettings: string;
569
601
  };
570
602
  addFunds: {
@@ -622,6 +654,13 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
622
654
  };
623
655
  units: {
624
656
  title: string;
657
+ /**
658
+ * # Void Label Component Props
659
+ *
660
+ * - These are the base props that will be passed into the `<VoidLabel />` component.
661
+ *
662
+ * @see {@link VoidLabel.Component | This prop types usage in the `<VoidLabel />` component}
663
+ */
625
664
  dimensions: {
626
665
  title: string;
627
666
  standard: string;
@@ -698,7 +737,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
698
737
  voided: string;
699
738
  error: string;
700
739
  completed: string;
701
- processing: string;
740
+ processing: string; /**
741
+ * `labelId` is the unique identifier for the label you wish to void.
742
+ */
702
743
  };
703
744
  trackingStatus: {
704
745
  unknown: string;
@@ -733,9 +774,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
733
774
  };
734
775
  search: string;
735
776
  settingsModal: {
736
- closeDialog: string; /**
737
- * `labelId` is the unique identifier for the label you wish to void.
738
- */
777
+ closeDialog: string;
739
778
  header: string;
740
779
  };
741
780
  status: {
@@ -746,7 +785,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
746
785
  toastBody: string;
747
786
  };
748
787
  deleteCarrierErrorTitle: string;
749
- deleteCarrierErrorMessage: string;
788
+ deleteCarrierErrorMessage: string; /**
789
+ * `onSuccess` is a callback function that will be invoked when the request to void a given
790
+ * shipping label is successful.
791
+ */
750
792
  loadingDeletingCarrier: string;
751
793
  };
752
794
  common: {
@@ -770,13 +812,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
770
812
  tryAgain: string;
771
813
  };
772
814
  address: {
773
- /**
774
- * # Void Label Component Props
775
- *
776
- * - These are the base props that will be passed into the `<VoidLabel />` component.
777
- *
778
- * @see {@link VoidLabel.Component | This prop types usage in the `<VoidLabel />` component}
779
- */
780
815
  fields: {
781
816
  name: string;
782
817
  company: string;
@@ -1062,6 +1097,9 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
1062
1097
  tooManyCharacters: string;
1063
1098
  requiredShipmentId: string;
1064
1099
  requiredLabelId: string;
1100
+ heightExceeded: string;
1101
+ widthExceeded: string;
1102
+ lengthExceeded: string;
1065
1103
  };
1066
1104
  shippingPresets: {
1067
1105
  apply: string;
@@ -1136,15 +1174,17 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
1136
1174
  transactionHistory: string;
1137
1175
  adjustmentHistory: string;
1138
1176
  warehouses: string;
1139
- carriers: string;
1177
+ carriers: {
1178
+ title: string;
1179
+ customStatusMessages: {
1180
+ success: string;
1181
+ };
1182
+ };
1140
1183
  externalCarriers: string;
1141
1184
  labelLayout: string;
1142
1185
  unitSettings: string;
1143
1186
  vatSettings: string;
1144
- }; /**
1145
- * `onComplete` is a callback function that will be invoked when the request to void a given
1146
- * shipping label is completed.
1147
- */
1187
+ };
1148
1188
  };
1149
1189
  };
1150
1190
  } | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { THEME_ID } from "@shipengine/giger";
2
3
  import { Theme } from "@shipengine/giger-theme";
3
4
  import { ShipEngineAPIConfig, ShipEngineProps } from "@shipengine/react-api";
4
5
  import { ElementsFeatureFlags, GlobalFeatures } from "../utilities";
@@ -7,13 +8,16 @@ export interface ElementsContextValue {
7
8
  baseURL: string;
8
9
  cdnURL: string;
9
10
  container?: HTMLElement;
11
+ emotionCacheShadowRootContainer?: ShadowRoot & HTMLElement;
10
12
  getFeatures: (key: keyof ElementsFeatureFlags) => ElementsFeatureFlags[keyof ElementsFeatureFlags];
11
13
  getToken: ShipEngineProps["getToken"];
12
14
  globalFeatures: GlobalFeatures;
13
15
  locale?: string;
14
16
  onError: ElementsErrorHandler;
15
17
  scope: string | null;
16
- theme: Theme;
18
+ theme: Theme | {
19
+ [THEME_ID]: Theme;
20
+ };
17
21
  }
18
22
  /**
19
23
  * @category Contexts
@@ -23,17 +27,20 @@ export type ElementsContextProviderProps = {
23
27
  cdnURL?: string;
24
28
  children: React.ReactNode;
25
29
  container?: HTMLElement;
30
+ emotionCacheShadowRootContainer?: ShadowRoot & HTMLElement;
26
31
  features?: ElementsFeatureFlags;
27
32
  locale?: string;
28
33
  onError?: ElementsErrorHandler;
29
34
  /** Scope of the Elements Provider. Can be null to not specify a specific element */
30
35
  scope?: string | null;
31
- theme: Theme;
36
+ theme: Theme | {
37
+ [THEME_ID]: Theme;
38
+ };
32
39
  } & Pick<ShipEngineAPIConfig, "getToken" | "baseURL">;
33
40
  /**
34
41
  * @category Providers
35
42
  */
36
- export declare const ElementsContextProvider: ({ baseURL, cdnURL, children, container, features, getToken, locale: localeProp, onError, scope, theme, }: ElementsContextProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
43
+ export declare const ElementsContextProvider: ({ baseURL, cdnURL, children, container, features, getToken, locale: localeProp, onError, scope, theme, emotionCacheShadowRootContainer, }: ElementsContextProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
37
44
  /**
38
45
  * Must be used within {@link ElementsProvider}
39
46
  *
@@ -1,12 +1,17 @@
1
1
  import { DefaultOptions } from "@tanstack/react-query";
2
+ import { THEME_ID } from "@shipengine/giger";
2
3
  import { CustomThemeData } from "@shipengine/giger-theme";
3
4
  import { ShipEngineAPIConfig } from "@shipengine/react-api";
4
5
  import { ElementsContextProviderProps } from "./elements-context-provider";
5
6
  export type ElementsProviderProps = Omit<ElementsContextProviderProps, "theme"> & ShipEngineAPIConfig & {
6
7
  defaultQueryClientOptions?: DefaultOptions;
7
- themeConfig?: CustomThemeData;
8
+ emotionCacheShadowRootContainer?: ShadowRoot & HTMLElement;
9
+ emotionCacheShadowRootContainerWrapper?: HTMLDivElement;
10
+ themeConfig?: CustomThemeData | {
11
+ [THEME_ID]: CustomThemeData;
12
+ };
8
13
  };
9
14
  /**
10
15
  * @category Providers
11
16
  */
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;
17
+ export declare const ElementsProvider: ({ baseURL, cdnURL, children, container, features, getToken, headers, locale, onApiError, onError, scope, themeConfig, defaultQueryClientOptions, emotionCacheShadowRootContainer, emotionCacheShadowRootContainerWrapper, }: ElementsProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1 +1,2 @@
1
1
  export * from "./manage-carriers";
2
+ export * from "./use-manage-carriers";
@@ -1,5 +1,16 @@
1
+ import { CodedError, Currency } from "@shipengine/react-api";
1
2
  export type ShipEngineCarriersProps = {
3
+ addedFundsError?: CodedError[] | null;
4
+ addFunds?: (payload: {
5
+ carrierId: string;
6
+ funds: {
7
+ amount: number;
8
+ currency: Currency;
9
+ };
10
+ }) => Promise<void>;
11
+ isUpdateFundsError?: boolean;
12
+ isUpdatingFunds?: boolean;
2
13
  onRedirectToOnboarding?: () => void;
3
14
  showFunds?: boolean;
4
15
  };
5
- export declare const ShipEngineCarriers: ({ showFunds, onRedirectToOnboarding, }: ShipEngineCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
16
+ export declare const ShipEngineCarriers: ({ showFunds, onRedirectToOnboarding, addFunds, addedFundsError, }: ShipEngineCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { Currency } from "@shipengine/react-api";
2
+ export declare const useManageCarriers: () => {
3
+ addFunds: (payload: {
4
+ carrierId: string;
5
+ funds: {
6
+ amount: number;
7
+ currency: Currency;
8
+ };
9
+ }) => Promise<void>;
10
+ addFundsError: import("@shipengine/react-api").CodedError[] | null;
11
+ isAddFundsSuccess: boolean;
12
+ isAddingFunds: boolean;
13
+ isAddingFundsError: boolean;
14
+ isAddingFundsIdle: boolean;
15
+ };
@@ -1,3 +1,4 @@
1
+ import { CodedError, Currency } from "@shipengine/react-api";
1
2
  /**
2
3
  * @namespace ManageFunding
3
4
  *
@@ -14,6 +15,14 @@
14
15
  * @see {@link ManageFundingProps | The props that are passed into the `<ManageFunding />` component}
15
16
  */
16
17
  export type ManageFundingProps = {
18
+ addedFundsError?: CodedError[] | null;
19
+ addFunds?: (payload: {
20
+ carrierId: string;
21
+ funds: {
22
+ amount: number;
23
+ currency: Currency;
24
+ };
25
+ }) => Promise<void>;
17
26
  onRedirectToOnboarding?: () => void;
18
27
  };
19
- export declare const ManageFunding: ({ onRedirectToOnboarding }: ManageFundingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
28
+ export declare const ManageFunding: ({ onRedirectToOnboarding, addFunds, addedFundsError }: ManageFundingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ export declare const useVatSettings: () => {
2
2
  getVatSettingsErrors: import("@shipengine/react-api").CodedError[] | null;
3
3
  isLoading: boolean;
4
4
  refreshVatSettings: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@shipengine/react-api").ShipEngineAccountSettings, import("@shipengine/react-api").CodedError[]>>;
5
- updateVatSettings: import("@tanstack/react-query").UseMutateAsyncFunction<import("@shipengine/react-api").ShipEngineAccountSettings, import("@shipengine/react-api").CodedError[], SE.AccountSettings, unknown>;
5
+ updateVatSettings: import("@tanstack/react-query").UseMutateAsyncFunction<import("@shipengine/react-api").ShipEngineAccountSettings, import("@shipengine/react-api").CodedError[], Partial<import("@shipengine/react-api").ShipEngineAccountSettings>, unknown>;
6
6
  updateVatSettingsErrors: import("@shipengine/react-api").CodedError[] | null;
7
7
  vatSettings: import("@shipengine/react-api").ShipEngineAccountSettings | undefined;
8
8
  };
@@ -15,7 +15,7 @@ export declare const useInsuranceProviderOptions: (insuranceAccount?: SE.Insuran
15
15
  fundingSourceInsuranceProvider: SE.FundingSourceInsuranceProvider | undefined;
16
16
  insuranceProviderOptions: {
17
17
  label: string;
18
- value: SE.InsuranceProviderType;
18
+ value: string;
19
19
  }[];
20
20
  refetchInsuranceAcceptedTerms: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<SE.InsuranceFundingSourceAcceptedTermsResponse, SE.CodedError[]>>;
21
21
  };