@shipengine/elements 0.26.12 → 0.26.16

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.
package/index.cjs CHANGED
@@ -8052,13 +8052,23 @@ const styles$g = createStyles({
8052
8052
  const ListCarriers = ({
8053
8053
  carriers: _carriers = [],
8054
8054
  errors,
8055
+ features,
8055
8056
  isLoading,
8056
8057
  onRegisterCarrier,
8057
8058
  registerCarrierErrors
8058
8059
  }) => {
8060
+ features = Object.assign({
8061
+ carriers: {
8062
+ enabledCarriers: ["dhl_express_walleted", "ups"]
8063
+ }
8064
+ }, features !== null && features !== void 0 ? features : {});
8059
8065
  const {
8060
8066
  t
8061
8067
  } = reactI18next.useTranslation();
8068
+ const enabledCarriers = _carriers.filter(carrier => {
8069
+ var _a;
8070
+ return carrier.carrier.carrierCode === "stamps_com" || ((_a = features === null || features === void 0 ? void 0 : features.carriers) === null || _a === void 0 ? void 0 : _a.enabledCarriers.includes(carrier.carrier.carrierCode));
8071
+ });
8062
8072
  return jsxRuntime.jsxs(Section, Object.assign({
8063
8073
  title: t("list-carriers:headers.carriers")
8064
8074
  }, {
@@ -8081,7 +8091,7 @@ const ListCarriers = ({
8081
8091
  }, {
8082
8092
  children: isLoading ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
8083
8093
  children: [jsxRuntime.jsx(LoadingSkeletonRow, {}), jsxRuntime.jsx(LoadingSkeletonRow, {}), jsxRuntime.jsx(LoadingSkeletonRow, {})]
8084
- }) : _carriers.map(carrier => jsxRuntime.jsx("li", {
8094
+ }) : enabledCarriers.map(carrier => jsxRuntime.jsx("li", {
8085
8095
  children: jsxRuntime.jsx(ListCarriersRow, {
8086
8096
  connectedCarrier: carrier,
8087
8097
  registerCarrier: values => __awaiter(void 0, void 0, void 0, function* () {
@@ -10201,12 +10211,13 @@ const Onboarding = ({
10201
10211
  registerUpsCarrierErrors,
10202
10212
  warehouses
10203
10213
  }) => {
10204
- var _a, _b;
10214
+ var _a, _b, _c;
10205
10215
  features = Object.assign({
10206
- global: {
10207
- presentation: {
10208
- poweredByShipEngine: false
10209
- }
10216
+ carriers: {
10217
+ enabledCarriers: ["ups", "dhl_express_walleted"]
10218
+ },
10219
+ presentation: {
10220
+ poweredByShipEngine: false
10210
10221
  }
10211
10222
  }, features !== null && features !== void 0 ? features : {});
10212
10223
  const {
@@ -10222,9 +10233,10 @@ const Onboarding = ({
10222
10233
  // Make sure their Stamps carrier is not the Free one
10223
10234
  // Once an account adds a UPS carrier to their Stamps wallet, the carrierCode changes from "stamps_com" => "usps"
10224
10235
  const hasStampsWallet = carriers === null || carriers === void 0 ? void 0 : carriers.some(carrier => carrier.carrierCode === "stamps_com" && carrier.nickname !== "Free" || carrier.carrierCode === "usps");
10236
+ const upsEnabled = (_b = (_a = features === null || features === void 0 ? void 0 : features.carriers) === null || _a === void 0 ? void 0 : _a.enabledCarriers) === null || _b === void 0 ? void 0 : _b.includes("ups");
10225
10237
  const hasUps = carriers === null || carriers === void 0 ? void 0 : carriers.some(c => c.carrierCode === "ups");
10226
10238
  const hasDhl = carriers === null || carriers === void 0 ? void 0 : carriers.some(c => c.carrierCode === "dhl_express_worldwide");
10227
- const hasCompletedOnboarding = onboardingComplete || warehouses.length && hasStampsWallet && hasUps && hasDhl;
10239
+ const hasCompletedOnboarding = onboardingComplete || warehouses.length && hasStampsWallet && (hasUps || !upsEnabled) && hasDhl;
10228
10240
  const currentStep = React.useMemo(() => {
10229
10241
  if (hasCompletedOnboarding) {
10230
10242
  return 5;
@@ -10243,7 +10255,7 @@ const Onboarding = ({
10243
10255
  }) => __awaiter(void 0, void 0, void 0, function* () {
10244
10256
  setAddress(address);
10245
10257
  try {
10246
- yield Promise.all([!hasUps && address && registerUpsCarrier({
10258
+ yield Promise.all([upsEnabled && !hasUps && address && registerUpsCarrier({
10247
10259
  address,
10248
10260
  agreeToCarrierTerms: agreedToTerms,
10249
10261
  carrierCode: "ups",
@@ -10253,7 +10265,7 @@ const Onboarding = ({
10253
10265
  carrierCode: "dhl_express_walleted",
10254
10266
  nickname: "dhl_express_walleted"
10255
10267
  })]);
10256
- } catch (_c) {
10268
+ } catch (_d) {
10257
10269
  // Errors shown inline for recovery
10258
10270
  }
10259
10271
  yield onCarrierCreated();
@@ -10282,7 +10294,7 @@ const Onboarding = ({
10282
10294
  });
10283
10295
  });
10284
10296
  const renderStep = () => {
10285
- var _a;
10297
+ var _a, _b, _c;
10286
10298
  // Step 5: Onboarding Complete
10287
10299
  if (hasCompletedOnboarding) {
10288
10300
  return jsxRuntime.jsx(CompletionPage, {
@@ -10296,7 +10308,7 @@ const Onboarding = ({
10296
10308
  // Step 2: Agree to Terms and Conditions
10297
10309
  if (!agreedToTerms) {
10298
10310
  return jsxRuntime.jsx(CarrierTermsForm, {
10299
- carrierCodes: ["stamps_com", "ups", "dhl_express_walleted"],
10311
+ carrierCodes: ["stamps_com"].concat((_b = (_a = features === null || features === void 0 ? void 0 : features.carriers) === null || _a === void 0 ? void 0 : _a.enabledCarriers) !== null && _b !== void 0 ? _b : []),
10300
10312
  onSubmit: () => {
10301
10313
  setAgreedToTerms(true);
10302
10314
  if (!warehouses.length) {
@@ -10346,7 +10358,7 @@ const Onboarding = ({
10346
10358
  }
10347
10359
  // Step 4: Register Stamps Wallet, UPS, DHL
10348
10360
  if (agreedToTerms && warehouses.length && hasValidAddress && !hasStampsWallet && !hasCompletedBilling) {
10349
- const defaultWarehouse = (_a = warehouses.find(w => w.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
10361
+ const defaultWarehouse = (_c = warehouses.find(w => w.isDefault)) !== null && _c !== void 0 ? _c : warehouses[0];
10350
10362
  return jsxRuntime.jsx(AddressPreferenceProvider, Object.assign({
10351
10363
  formHeader: jsxRuntime.jsxs("div", Object.assign({
10352
10364
  css: styles$c.walletFormHeader
@@ -10401,7 +10413,7 @@ const Onboarding = ({
10401
10413
  }
10402
10414
  if (hasStampsWallet) {
10403
10415
  // Step 4.1: Handle UPS Registration Errors
10404
- if (!hasUps && registerUpsCarrierErrors) {
10416
+ if (upsEnabled && !hasUps && registerUpsCarrierErrors) {
10405
10417
  return jsxRuntime.jsx(CarrierRecoveryForm, {
10406
10418
  address: address,
10407
10419
  carrierCode: "ups",
@@ -10447,7 +10459,7 @@ const Onboarding = ({
10447
10459
  css: styles$c.step,
10448
10460
  label: t("onboarding:steps.payment")
10449
10461
  })]
10450
- })), renderStep(), ((_b = (_a = features === null || features === void 0 ? void 0 : features.global) === null || _a === void 0 ? void 0 : _a.presentation) === null || _b === void 0 ? void 0 : _b.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
10462
+ })), renderStep(), ((_c = features === null || features === void 0 ? void 0 : features.presentation) === null || _c === void 0 ? void 0 : _c.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
10451
10463
  children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
10452
10464
  })]
10453
10465
  }));
@@ -11563,12 +11575,10 @@ const RateForm = ({
11563
11575
  shipment,
11564
11576
  outOfBandDisplayableErrors
11565
11577
  }) => {
11566
- var _a, _b, _c, _d, _e, _f;
11578
+ var _a, _b, _c, _d, _e;
11567
11579
  features = Object.assign({
11568
- global: {
11569
- presentation: {
11570
- poweredByShipEngine: false
11571
- }
11580
+ presentation: {
11581
+ poweredByShipEngine: false
11572
11582
  },
11573
11583
  rateForm: {
11574
11584
  enableGlobalPostFiltering: false,
@@ -11744,7 +11754,7 @@ const RateForm = ({
11744
11754
  onPurchase: handleSubmit,
11745
11755
  onSave: handleSaveRate,
11746
11756
  purchaseAmount: getTotalRateAmount(selectedRate)
11747
- }), ((_f = (_e = features === null || features === void 0 ? void 0 : features.global) === null || _e === void 0 ? void 0 : _e.presentation) === null || _f === void 0 ? void 0 : _f.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
11757
+ }), ((_e = features === null || features === void 0 ? void 0 : features.presentation) === null || _e === void 0 ? void 0 : _e.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
11748
11758
  children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
11749
11759
  })]
11750
11760
  }));
@@ -13072,12 +13082,10 @@ const Shipment = ({
13072
13082
  shipment,
13073
13083
  warehouse
13074
13084
  }) => {
13075
- var _a, _b, _c, _d;
13085
+ var _a, _b, _c;
13076
13086
  features = Object.assign({
13077
- global: {
13078
- presentation: {
13079
- poweredByShipEngine: false
13080
- }
13087
+ presentation: {
13088
+ poweredByShipEngine: false
13081
13089
  }
13082
13090
  }, features !== null && features !== void 0 ? features : {});
13083
13091
  const {
@@ -13260,7 +13268,7 @@ const Shipment = ({
13260
13268
  })), "representative."]
13261
13269
  }))
13262
13270
  }))
13263
- })), ((_d = (_c = features === null || features === void 0 ? void 0 : features.global) === null || _c === void 0 ? void 0 : _c.presentation) === null || _d === void 0 ? void 0 : _d.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
13271
+ })), ((_c = features === null || features === void 0 ? void 0 : features.presentation) === null || _c === void 0 ? void 0 : _c.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
13264
13272
  children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
13265
13273
  })]
13266
13274
  });
@@ -14390,7 +14398,9 @@ const useListConnectedCarriers = () => {
14390
14398
  };
14391
14399
  };
14392
14400
 
14393
- const Component$5 = () => {
14401
+ const Component$5 = ({
14402
+ features
14403
+ }) => {
14394
14404
  const {
14395
14405
  data: carriersConnectedStatus,
14396
14406
  error,
@@ -14413,6 +14423,7 @@ const Component$5 = () => {
14413
14423
  return jsxRuntime.jsx(ListCarriers, {
14414
14424
  carriers: carriersConnectedStatus,
14415
14425
  errors: error,
14426
+ features: features,
14416
14427
  isLoading: isLoading,
14417
14428
  onRegisterCarrier: handleRegistration,
14418
14429
  registerCarrierErrors: registerCarrierErrors
@@ -15766,12 +15777,10 @@ const Component = ({
15766
15777
  onSuccess,
15767
15778
  onViewShipment
15768
15779
  }) => {
15769
- var _a, _b, _c;
15780
+ var _a, _b;
15770
15781
  features = Object.assign({
15771
- global: {
15772
- presentation: {
15773
- poweredByShipEngine: false
15774
- }
15782
+ presentation: {
15783
+ poweredByShipEngine: false
15775
15784
  }
15776
15785
  }, features !== null && features !== void 0 ? features : {});
15777
15786
  // TODO [LMNT-910] - labelId should be a required prop
@@ -15807,7 +15816,7 @@ const Component = ({
15807
15816
  onViewShipment: onViewShipment,
15808
15817
  shipment: shipment.data,
15809
15818
  voidRequest: voidLabel.data
15810
- }), ((_c = (_b = features === null || features === void 0 ? void 0 : features.global) === null || _b === void 0 ? void 0 : _b.presentation) === null || _c === void 0 ? void 0 : _c.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
15819
+ }), ((_b = features === null || features === void 0 ? void 0 : features.presentation) === null || _b === void 0 ? void 0 : _b.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
15811
15820
  children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
15812
15821
  })]
15813
15822
  });
package/index.js CHANGED
@@ -8020,13 +8020,23 @@ const styles$g = createStyles({
8020
8020
  const ListCarriers = ({
8021
8021
  carriers: _carriers = [],
8022
8022
  errors,
8023
+ features,
8023
8024
  isLoading,
8024
8025
  onRegisterCarrier,
8025
8026
  registerCarrierErrors
8026
8027
  }) => {
8028
+ features = Object.assign({
8029
+ carriers: {
8030
+ enabledCarriers: ["dhl_express_walleted", "ups"]
8031
+ }
8032
+ }, features !== null && features !== void 0 ? features : {});
8027
8033
  const {
8028
8034
  t
8029
8035
  } = useTranslation();
8036
+ const enabledCarriers = _carriers.filter(carrier => {
8037
+ var _a;
8038
+ return carrier.carrier.carrierCode === "stamps_com" || ((_a = features === null || features === void 0 ? void 0 : features.carriers) === null || _a === void 0 ? void 0 : _a.enabledCarriers.includes(carrier.carrier.carrierCode));
8039
+ });
8030
8040
  return jsxs(Section, Object.assign({
8031
8041
  title: t("list-carriers:headers.carriers")
8032
8042
  }, {
@@ -8049,7 +8059,7 @@ const ListCarriers = ({
8049
8059
  }, {
8050
8060
  children: isLoading ? jsxs(Fragment, {
8051
8061
  children: [jsx(LoadingSkeletonRow, {}), jsx(LoadingSkeletonRow, {}), jsx(LoadingSkeletonRow, {})]
8052
- }) : _carriers.map(carrier => jsx("li", {
8062
+ }) : enabledCarriers.map(carrier => jsx("li", {
8053
8063
  children: jsx(ListCarriersRow, {
8054
8064
  connectedCarrier: carrier,
8055
8065
  registerCarrier: values => __awaiter(void 0, void 0, void 0, function* () {
@@ -10169,12 +10179,13 @@ const Onboarding = ({
10169
10179
  registerUpsCarrierErrors,
10170
10180
  warehouses
10171
10181
  }) => {
10172
- var _a, _b;
10182
+ var _a, _b, _c;
10173
10183
  features = Object.assign({
10174
- global: {
10175
- presentation: {
10176
- poweredByShipEngine: false
10177
- }
10184
+ carriers: {
10185
+ enabledCarriers: ["ups", "dhl_express_walleted"]
10186
+ },
10187
+ presentation: {
10188
+ poweredByShipEngine: false
10178
10189
  }
10179
10190
  }, features !== null && features !== void 0 ? features : {});
10180
10191
  const {
@@ -10190,9 +10201,10 @@ const Onboarding = ({
10190
10201
  // Make sure their Stamps carrier is not the Free one
10191
10202
  // Once an account adds a UPS carrier to their Stamps wallet, the carrierCode changes from "stamps_com" => "usps"
10192
10203
  const hasStampsWallet = carriers === null || carriers === void 0 ? void 0 : carriers.some(carrier => carrier.carrierCode === "stamps_com" && carrier.nickname !== "Free" || carrier.carrierCode === "usps");
10204
+ const upsEnabled = (_b = (_a = features === null || features === void 0 ? void 0 : features.carriers) === null || _a === void 0 ? void 0 : _a.enabledCarriers) === null || _b === void 0 ? void 0 : _b.includes("ups");
10193
10205
  const hasUps = carriers === null || carriers === void 0 ? void 0 : carriers.some(c => c.carrierCode === "ups");
10194
10206
  const hasDhl = carriers === null || carriers === void 0 ? void 0 : carriers.some(c => c.carrierCode === "dhl_express_worldwide");
10195
- const hasCompletedOnboarding = onboardingComplete || warehouses.length && hasStampsWallet && hasUps && hasDhl;
10207
+ const hasCompletedOnboarding = onboardingComplete || warehouses.length && hasStampsWallet && (hasUps || !upsEnabled) && hasDhl;
10196
10208
  const currentStep = useMemo(() => {
10197
10209
  if (hasCompletedOnboarding) {
10198
10210
  return 5;
@@ -10211,7 +10223,7 @@ const Onboarding = ({
10211
10223
  }) => __awaiter(void 0, void 0, void 0, function* () {
10212
10224
  setAddress(address);
10213
10225
  try {
10214
- yield Promise.all([!hasUps && address && registerUpsCarrier({
10226
+ yield Promise.all([upsEnabled && !hasUps && address && registerUpsCarrier({
10215
10227
  address,
10216
10228
  agreeToCarrierTerms: agreedToTerms,
10217
10229
  carrierCode: "ups",
@@ -10221,7 +10233,7 @@ const Onboarding = ({
10221
10233
  carrierCode: "dhl_express_walleted",
10222
10234
  nickname: "dhl_express_walleted"
10223
10235
  })]);
10224
- } catch (_c) {
10236
+ } catch (_d) {
10225
10237
  // Errors shown inline for recovery
10226
10238
  }
10227
10239
  yield onCarrierCreated();
@@ -10250,7 +10262,7 @@ const Onboarding = ({
10250
10262
  });
10251
10263
  });
10252
10264
  const renderStep = () => {
10253
- var _a;
10265
+ var _a, _b, _c;
10254
10266
  // Step 5: Onboarding Complete
10255
10267
  if (hasCompletedOnboarding) {
10256
10268
  return jsx(CompletionPage, {
@@ -10264,7 +10276,7 @@ const Onboarding = ({
10264
10276
  // Step 2: Agree to Terms and Conditions
10265
10277
  if (!agreedToTerms) {
10266
10278
  return jsx(CarrierTermsForm, {
10267
- carrierCodes: ["stamps_com", "ups", "dhl_express_walleted"],
10279
+ carrierCodes: ["stamps_com"].concat((_b = (_a = features === null || features === void 0 ? void 0 : features.carriers) === null || _a === void 0 ? void 0 : _a.enabledCarriers) !== null && _b !== void 0 ? _b : []),
10268
10280
  onSubmit: () => {
10269
10281
  setAgreedToTerms(true);
10270
10282
  if (!warehouses.length) {
@@ -10314,7 +10326,7 @@ const Onboarding = ({
10314
10326
  }
10315
10327
  // Step 4: Register Stamps Wallet, UPS, DHL
10316
10328
  if (agreedToTerms && warehouses.length && hasValidAddress && !hasStampsWallet && !hasCompletedBilling) {
10317
- const defaultWarehouse = (_a = warehouses.find(w => w.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
10329
+ const defaultWarehouse = (_c = warehouses.find(w => w.isDefault)) !== null && _c !== void 0 ? _c : warehouses[0];
10318
10330
  return jsx(AddressPreferenceProvider, Object.assign({
10319
10331
  formHeader: jsxs("div", Object.assign({
10320
10332
  css: styles$c.walletFormHeader
@@ -10369,7 +10381,7 @@ const Onboarding = ({
10369
10381
  }
10370
10382
  if (hasStampsWallet) {
10371
10383
  // Step 4.1: Handle UPS Registration Errors
10372
- if (!hasUps && registerUpsCarrierErrors) {
10384
+ if (upsEnabled && !hasUps && registerUpsCarrierErrors) {
10373
10385
  return jsx(CarrierRecoveryForm, {
10374
10386
  address: address,
10375
10387
  carrierCode: "ups",
@@ -10415,7 +10427,7 @@ const Onboarding = ({
10415
10427
  css: styles$c.step,
10416
10428
  label: t("onboarding:steps.payment")
10417
10429
  })]
10418
- })), renderStep(), ((_b = (_a = features === null || features === void 0 ? void 0 : features.global) === null || _a === void 0 ? void 0 : _a.presentation) === null || _b === void 0 ? void 0 : _b.poweredByShipEngine) && jsxs(Fragment, {
10430
+ })), renderStep(), ((_c = features === null || features === void 0 ? void 0 : features.presentation) === null || _c === void 0 ? void 0 : _c.poweredByShipEngine) && jsxs(Fragment, {
10419
10431
  children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
10420
10432
  })]
10421
10433
  }));
@@ -11531,12 +11543,10 @@ const RateForm = ({
11531
11543
  shipment,
11532
11544
  outOfBandDisplayableErrors
11533
11545
  }) => {
11534
- var _a, _b, _c, _d, _e, _f;
11546
+ var _a, _b, _c, _d, _e;
11535
11547
  features = Object.assign({
11536
- global: {
11537
- presentation: {
11538
- poweredByShipEngine: false
11539
- }
11548
+ presentation: {
11549
+ poweredByShipEngine: false
11540
11550
  },
11541
11551
  rateForm: {
11542
11552
  enableGlobalPostFiltering: false,
@@ -11712,7 +11722,7 @@ const RateForm = ({
11712
11722
  onPurchase: handleSubmit,
11713
11723
  onSave: handleSaveRate,
11714
11724
  purchaseAmount: getTotalRateAmount(selectedRate)
11715
- }), ((_f = (_e = features === null || features === void 0 ? void 0 : features.global) === null || _e === void 0 ? void 0 : _e.presentation) === null || _f === void 0 ? void 0 : _f.poweredByShipEngine) && jsxs(Fragment, {
11725
+ }), ((_e = features === null || features === void 0 ? void 0 : features.presentation) === null || _e === void 0 ? void 0 : _e.poweredByShipEngine) && jsxs(Fragment, {
11716
11726
  children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
11717
11727
  })]
11718
11728
  }));
@@ -13040,12 +13050,10 @@ const Shipment = ({
13040
13050
  shipment,
13041
13051
  warehouse
13042
13052
  }) => {
13043
- var _a, _b, _c, _d;
13053
+ var _a, _b, _c;
13044
13054
  features = Object.assign({
13045
- global: {
13046
- presentation: {
13047
- poweredByShipEngine: false
13048
- }
13055
+ presentation: {
13056
+ poweredByShipEngine: false
13049
13057
  }
13050
13058
  }, features !== null && features !== void 0 ? features : {});
13051
13059
  const {
@@ -13228,7 +13236,7 @@ const Shipment = ({
13228
13236
  })), "representative."]
13229
13237
  }))
13230
13238
  }))
13231
- })), ((_d = (_c = features === null || features === void 0 ? void 0 : features.global) === null || _c === void 0 ? void 0 : _c.presentation) === null || _d === void 0 ? void 0 : _d.poweredByShipEngine) && jsxs(Fragment, {
13239
+ })), ((_c = features === null || features === void 0 ? void 0 : features.presentation) === null || _c === void 0 ? void 0 : _c.poweredByShipEngine) && jsxs(Fragment, {
13232
13240
  children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
13233
13241
  })]
13234
13242
  });
@@ -14358,7 +14366,9 @@ const useListConnectedCarriers = () => {
14358
14366
  };
14359
14367
  };
14360
14368
 
14361
- const Component$5 = () => {
14369
+ const Component$5 = ({
14370
+ features
14371
+ }) => {
14362
14372
  const {
14363
14373
  data: carriersConnectedStatus,
14364
14374
  error,
@@ -14381,6 +14391,7 @@ const Component$5 = () => {
14381
14391
  return jsx(ListCarriers, {
14382
14392
  carriers: carriersConnectedStatus,
14383
14393
  errors: error,
14394
+ features: features,
14384
14395
  isLoading: isLoading,
14385
14396
  onRegisterCarrier: handleRegistration,
14386
14397
  registerCarrierErrors: registerCarrierErrors
@@ -15734,12 +15745,10 @@ const Component = ({
15734
15745
  onSuccess,
15735
15746
  onViewShipment
15736
15747
  }) => {
15737
- var _a, _b, _c;
15748
+ var _a, _b;
15738
15749
  features = Object.assign({
15739
- global: {
15740
- presentation: {
15741
- poweredByShipEngine: false
15742
- }
15750
+ presentation: {
15751
+ poweredByShipEngine: false
15743
15752
  }
15744
15753
  }, features !== null && features !== void 0 ? features : {});
15745
15754
  // TODO [LMNT-910] - labelId should be a required prop
@@ -15775,7 +15784,7 @@ const Component = ({
15775
15784
  onViewShipment: onViewShipment,
15776
15785
  shipment: shipment.data,
15777
15786
  voidRequest: voidLabel.data
15778
- }), ((_c = (_b = features === null || features === void 0 ? void 0 : features.global) === null || _b === void 0 ? void 0 : _b.presentation) === null || _c === void 0 ? void 0 : _c.poweredByShipEngine) && jsxs(Fragment, {
15787
+ }), ((_b = features === null || features === void 0 ? void 0 : features.presentation) === null || _b === void 0 ? void 0 : _b.poweredByShipEngine) && jsxs(Fragment, {
15779
15788
  children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
15780
15789
  })]
15781
15790
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "0.26.12",
3
+ "version": "0.26.16",
4
4
  "typedoc": {
5
5
  "entryPoint": "./src/index.ts",
6
6
  "readmeFile": "../../README.md",
@@ -1,10 +1,16 @@
1
1
  import { CarrierConnection, CodedError } from "@shipengine/alchemy";
2
2
  import { ConnectedCarrierMetadata } from "../../../elements/list-carriers/hooks/use-list-connected-carriers";
3
+ export type ListCarriersFeatures = {
4
+ carriers?: {
5
+ enabledCarriers: string[];
6
+ };
7
+ };
3
8
  export type ListCarriersProps = {
4
9
  carriers?: ConnectedCarrierMetadata[];
5
10
  errors?: CodedError[] | null;
11
+ features?: ListCarriersFeatures;
6
12
  isLoading?: boolean;
7
13
  onRegisterCarrier: (payload: CarrierConnection) => Promise<void>;
8
14
  registerCarrierErrors?: CodedError[] | null;
9
15
  };
10
- export declare const ListCarriers: ({ carriers, errors, isLoading, onRegisterCarrier, registerCarrierErrors, }: ListCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
16
+ export declare const ListCarriers: ({ carriers, errors, features, isLoading, onRegisterCarrier, registerCarrierErrors, }: ListCarriersProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -13,10 +13,11 @@ export type ValidateBilling = {
13
13
  };
14
14
  export type ValidateAddress = ValidateWarehouse | ValidateBilling;
15
15
  export type OnboardingFeatures = {
16
- global?: {
17
- presentation?: {
18
- poweredByShipEngine?: boolean;
19
- };
16
+ carriers?: {
17
+ enabledCarriers: string[];
18
+ };
19
+ presentation?: {
20
+ poweredByShipEngine?: boolean;
20
21
  };
21
22
  };
22
23
  export type OnboardingProps = {
@@ -6,7 +6,7 @@ export type RateFormProps = {
6
6
  displayableErrors?: string[];
7
7
  displayableLabelErrors?: string[];
8
8
  errors?: SE.CodedError[];
9
- features?: Pick<ConfigureShipmentFeatures, "global" | "rateForm">;
9
+ features?: ConfigureShipmentFeatures;
10
10
  isLoading?: boolean;
11
11
  labelErrors?: SE.CodedError[];
12
12
  labels?: SE.Label[];
@@ -1,10 +1,8 @@
1
1
  import { SE } from "@shipengine/alchemy";
2
2
  export declare const schedulePickupForCarrier: (carrierCode?: string, plaftformSchedulePickupUrl?: string) => string | undefined;
3
3
  export type ShipmentFeatures = {
4
- global?: {
5
- presentation?: {
6
- poweredByShipEngine?: boolean;
7
- };
4
+ presentation?: {
5
+ poweredByShipEngine?: boolean;
8
6
  };
9
7
  shipment?: {
10
8
  schedulePickup?: boolean;
@@ -12,10 +12,8 @@ export type RateFormFeatures = {
12
12
  };
13
13
  export type ConfigureShipmentFeatures = {
14
14
  compatibleCountryCodes?: UseShipmentFormProps["compatibleCountryCodes"];
15
- global?: {
16
- presentation?: {
17
- poweredByShipEngine?: boolean;
18
- };
15
+ presentation?: {
16
+ poweredByShipEngine?: boolean;
19
17
  };
20
18
  rateForm?: RateFormFeatures;
21
19
  shipmentForm?: Templates.ShipmentFormFeatures;
@@ -1,6 +1,10 @@
1
1
  /// <reference types="react" />
2
- export declare const Component: () => import("@emotion/react/jsx-runtime").JSX.Element;
3
- export declare const Element: ({ resources, ...props }: object & {
2
+ import { OnboardingProps } from "../../components/templates";
3
+ export type ComponentProps = {
4
+ features?: OnboardingProps["features"];
5
+ };
6
+ export declare const Component: ({ features }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export declare const Element: ({ resources, ...props }: ComponentProps & {
4
8
  resources?: {
5
9
  en: {
6
10
  "wallet-history": {
@@ -2,10 +2,8 @@
2
2
  import { SE } from "@shipengine/alchemy";
3
3
  export type ComponentProps = {
4
4
  features?: {
5
- global?: {
6
- presentation?: {
7
- poweredByShipEngine?: boolean;
8
- };
5
+ presentation?: {
6
+ poweredByShipEngine?: boolean;
9
7
  };
10
8
  };
11
9
  labelId?: string;