@shipengine/elements 0.37.21 → 0.38.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.
package/index.cjs
CHANGED
|
@@ -2118,13 +2118,19 @@ const usStates = [new UsState("Alabama", "AL"), new UsState("Alaska", "AK"), new
|
|
|
2118
2118
|
isMilitary
|
|
2119
2119
|
}), new UsState("California", "CA"), new UsState("Colorado", "CO"), new UsState("Connecticut", "CT"), new UsState("Delaware", "DE"), new UsState("District of Columbia", "DC"), new UsState("Florida", "FL"), new UsState("Georgia", "GA"), new UsState("Guam", "GU", {
|
|
2120
2120
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2121
|
-
}), new UsState("Hawaii", "HI"), new UsState("Idaho", "ID"), new UsState("Illinois", "IL"), new UsState("Indiana", "IN"), new UsState("Iowa", "IA"), new UsState("Kansas", "KS"), new UsState("Kentucky", "KY"), new UsState("Louisiana", "LA"), new UsState("Maine", "ME"), new UsState("
|
|
2121
|
+
}), new UsState("Hawaii", "HI"), new UsState("Idaho", "ID"), new UsState("Illinois", "IL"), new UsState("Indiana", "IN"), new UsState("Iowa", "IA"), new UsState("Kansas", "KS"), new UsState("Kentucky", "KY"), new UsState("Louisiana", "LA"), new UsState("Maine", "ME"), new UsState("Marshall Islands", "MH", {
|
|
2122
2122
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2123
|
-
}), new UsState("
|
|
2123
|
+
}), new UsState("Maryland", "MD"), new UsState("Massachusetts", "MA"), new UsState("Michigan", "MI"), new UsState("Micronesia", "FM", {
|
|
2124
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2125
|
+
}), new UsState("Minnesota", "MN"), new UsState("Mississippi", "MS"), new UsState("Missouri", "MO"), new UsState("Montana", "MT"), new UsState("Nebraska", "NE"), new UsState("Nevada", "NV"), new UsState("New Hampshire", "NH"), new UsState("New Jersey", "NJ"), new UsState("New Mexico", "NM"), new UsState("New York", "NY"), new UsState("North Carolina", "NC"), new UsState("North Dakota", "ND"), new UsState("Northern Mariana Islands", "MP", {
|
|
2126
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2127
|
+
}), new UsState("Ohio", "OH"), new UsState("Oklahoma", "OK"), new UsState("Oregon", "OR"), new UsState("Palau", "PW", {
|
|
2124
2128
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2125
|
-
}), new UsState("
|
|
2129
|
+
}), new UsState("Pennsylvania", "PA"), new UsState("Puerto Rico", "PR", {
|
|
2126
2130
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2127
|
-
}), new UsState("
|
|
2131
|
+
}), new UsState("Rhode Island", "RI"), new UsState("South Carolina", "SC"), new UsState("South Dakota", "SD"), new UsState("Tennessee", "TN"), new UsState("Texas", "TX"), new UsState("Utah", "UT"), new UsState("Vermont", "VT"), new UsState("Virgin Islands", "VI", {
|
|
2132
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2133
|
+
}), new UsState("Virginia", "VA"), new UsState("Washington", "WA"), new UsState("West Virginia", "WV"), new UsState("Wisconsin", "WI"), new UsState("Wyoming", "WY"), new UsState("U.S. Minor Outlying Islands", "UM", {
|
|
2128
2134
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2129
2135
|
})];
|
|
2130
2136
|
/**
|
|
@@ -2744,7 +2750,7 @@ const formLogger = {
|
|
|
2744
2750
|
// event bubbling doesn't handle the formId target properly when passed through a portal.
|
|
2745
2751
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
2746
2752
|
this.isSubmitting = true;
|
|
2747
|
-
handleSubmit(e);
|
|
2753
|
+
void handleSubmit(e);
|
|
2748
2754
|
this.isSubmitting = false;
|
|
2749
2755
|
};
|
|
2750
2756
|
},
|
|
@@ -4994,6 +5000,7 @@ RootPortalContext.displayName = "RootPortalContext";
|
|
|
4994
5000
|
const RootPortalProvider = ({
|
|
4995
5001
|
children
|
|
4996
5002
|
}) => {
|
|
5003
|
+
// eslint-disable-next-line react/hook-use-state -- We don't need the setter
|
|
4997
5004
|
const [rootPortal] = React.useState(() => {
|
|
4998
5005
|
let rootPortal = document.getElementById("root-portal");
|
|
4999
5006
|
if (!rootPortal) {
|
|
@@ -9952,6 +9959,7 @@ const WalletForm = ({
|
|
|
9952
9959
|
},
|
|
9953
9960
|
resolver: validationResolver(walletSchema)
|
|
9954
9961
|
});
|
|
9962
|
+
const formSetValue = form.setValue;
|
|
9955
9963
|
useBlackboxDetection({
|
|
9956
9964
|
onError: React.useCallback(() => {
|
|
9957
9965
|
setCodedErrors(errors => {
|
|
@@ -9963,8 +9971,8 @@ const WalletForm = ({
|
|
|
9963
9971
|
};
|
|
9964
9972
|
return [...(errors !== null && errors !== void 0 ? errors : []), blackBoxError];
|
|
9965
9973
|
});
|
|
9966
|
-
}, [
|
|
9967
|
-
onSuccess: React.useCallback(bb =>
|
|
9974
|
+
}, [t]),
|
|
9975
|
+
onSuccess: React.useCallback(bb => formSetValue("iovationBlackbox", bb), [formSetValue])
|
|
9968
9976
|
});
|
|
9969
9977
|
const watchAddress = form.watch("address");
|
|
9970
9978
|
const handleSubmit = form.handleSubmit(values => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -15522,10 +15530,10 @@ const RateForm = ({
|
|
|
15522
15530
|
} finally {
|
|
15523
15531
|
// Invalidate carrier queries after the rate form is submitted, regardless of success.
|
|
15524
15532
|
// This allows the carrier balance to refresh if the purchase failed but funding succeeded.
|
|
15525
|
-
queryClient.invalidateQueries(["useGetCarrierById", selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId], {
|
|
15533
|
+
void queryClient.invalidateQueries(["useGetCarrierById", selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId], {
|
|
15526
15534
|
exact: true
|
|
15527
15535
|
});
|
|
15528
|
-
queryClient.invalidateQueries(["useListCarriers"], {
|
|
15536
|
+
void queryClient.invalidateQueries(["useListCarriers"], {
|
|
15529
15537
|
exact: true
|
|
15530
15538
|
});
|
|
15531
15539
|
}
|
|
@@ -16729,7 +16737,7 @@ const ShipmentForm = ({
|
|
|
16729
16737
|
React.useEffect(() => {
|
|
16730
16738
|
if (!requireMeasurements) {
|
|
16731
16739
|
form.resetField("packages.0.dimensions");
|
|
16732
|
-
form.trigger("packages.0.dimensions");
|
|
16740
|
+
void form.trigger("packages.0.dimensions");
|
|
16733
16741
|
}
|
|
16734
16742
|
}, [requireMeasurements, form]);
|
|
16735
16743
|
React.useEffect(() => {
|
|
@@ -17020,7 +17028,7 @@ const ShipmentForm = ({
|
|
|
17020
17028
|
children: presetCategory.options.map(preset => jsxRuntime.jsx(giger.Option, Object.assign({
|
|
17021
17029
|
onClick: () => {
|
|
17022
17030
|
onDirty(); // bypass rate cache
|
|
17023
|
-
handleApplyPreset(preset.value);
|
|
17031
|
+
void handleApplyPreset(preset.value);
|
|
17024
17032
|
},
|
|
17025
17033
|
selected: ___default["default"].isEqual(selectedPreset, preset.value),
|
|
17026
17034
|
value: JSON.stringify(preset.value)
|
|
@@ -18160,13 +18168,14 @@ const ConfigureShipment = _a => {
|
|
|
18160
18168
|
const _d = useShipmentForm({
|
|
18161
18169
|
compatibleCountryCodes: features === null || features === void 0 ? void 0 : features.compatibleCountryCodes,
|
|
18162
18170
|
onAddressValidation,
|
|
18163
|
-
onApplyPreset: React.useCallback((
|
|
18171
|
+
onApplyPreset: React.useCallback((preset, shipment) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18164
18172
|
var _e;
|
|
18165
18173
|
if (shipment.packages[0].weight.value) {
|
|
18166
18174
|
yield requestRates(shipment, isInternational);
|
|
18167
18175
|
}
|
|
18168
18176
|
(_e = hydrateRef.current) === null || _e === void 0 ? void 0 : _e.call(hydrateRef, shipment);
|
|
18169
|
-
|
|
18177
|
+
void (onApplyPreset === null || onApplyPreset === void 0 ? void 0 : onApplyPreset(preset, shipment));
|
|
18178
|
+
}), [onApplyPreset, requestRates, isInternational]),
|
|
18170
18179
|
onChangeAddress,
|
|
18171
18180
|
onShipmentUpdated,
|
|
18172
18181
|
onSubmit: React.useCallback(shipment => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -18365,7 +18374,7 @@ const useImportSalesOrder = ({
|
|
|
18365
18374
|
// to handle scenarios where the sales order has not yet been imported. If the
|
|
18366
18375
|
// order source has already refreshed and there is still no matching order, bubble it up
|
|
18367
18376
|
// to the error boundary.
|
|
18368
|
-
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18377
|
+
void (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18369
18378
|
const selectedOrderSources = orderSourceCode ? orderSources === null || orderSources === void 0 ? void 0 : orderSources.filter(o => o.orderSourceCode.includes(orderSourceCode) && o.active) : orderSources;
|
|
18370
18379
|
if (selectedOrderSources && !salesOrder && !isFetchingSalesOrder && !isFetchingSalesOrders && !hasRefreshedOrderSource) {
|
|
18371
18380
|
yield Promise.all(selectedOrderSources.map(o => refreshOrderSource(o.orderSourceId)));
|
|
@@ -18488,7 +18497,7 @@ const useGetOrCreateShipment = (onShipmentUpdated, shipmentId) => {
|
|
|
18488
18497
|
const getShipment = alchemy.useGetShipment(shipmentId !== null && shipmentId !== void 0 ? shipmentId : createdShipment === null || createdShipment === void 0 ? void 0 : createdShipment.shipmentId);
|
|
18489
18498
|
React.useEffect(() => {
|
|
18490
18499
|
if (shouldTriggerUpdate && getShipment.data) {
|
|
18491
|
-
onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(getShipment.data);
|
|
18500
|
+
void (onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(getShipment.data));
|
|
18492
18501
|
setShouldTriggerUpdate(false);
|
|
18493
18502
|
}
|
|
18494
18503
|
}, [shouldTriggerUpdate, getShipment]);
|
package/index.js
CHANGED
|
@@ -2086,13 +2086,19 @@ const usStates = [new UsState("Alabama", "AL"), new UsState("Alaska", "AK"), new
|
|
|
2086
2086
|
isMilitary
|
|
2087
2087
|
}), new UsState("California", "CA"), new UsState("Colorado", "CO"), new UsState("Connecticut", "CT"), new UsState("Delaware", "DE"), new UsState("District of Columbia", "DC"), new UsState("Florida", "FL"), new UsState("Georgia", "GA"), new UsState("Guam", "GU", {
|
|
2088
2088
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2089
|
-
}), new UsState("Hawaii", "HI"), new UsState("Idaho", "ID"), new UsState("Illinois", "IL"), new UsState("Indiana", "IN"), new UsState("Iowa", "IA"), new UsState("Kansas", "KS"), new UsState("Kentucky", "KY"), new UsState("Louisiana", "LA"), new UsState("Maine", "ME"), new UsState("
|
|
2089
|
+
}), new UsState("Hawaii", "HI"), new UsState("Idaho", "ID"), new UsState("Illinois", "IL"), new UsState("Indiana", "IN"), new UsState("Iowa", "IA"), new UsState("Kansas", "KS"), new UsState("Kentucky", "KY"), new UsState("Louisiana", "LA"), new UsState("Maine", "ME"), new UsState("Marshall Islands", "MH", {
|
|
2090
2090
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2091
|
-
}), new UsState("
|
|
2091
|
+
}), new UsState("Maryland", "MD"), new UsState("Massachusetts", "MA"), new UsState("Michigan", "MI"), new UsState("Micronesia", "FM", {
|
|
2092
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2093
|
+
}), new UsState("Minnesota", "MN"), new UsState("Mississippi", "MS"), new UsState("Missouri", "MO"), new UsState("Montana", "MT"), new UsState("Nebraska", "NE"), new UsState("Nevada", "NV"), new UsState("New Hampshire", "NH"), new UsState("New Jersey", "NJ"), new UsState("New Mexico", "NM"), new UsState("New York", "NY"), new UsState("North Carolina", "NC"), new UsState("North Dakota", "ND"), new UsState("Northern Mariana Islands", "MP", {
|
|
2094
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2095
|
+
}), new UsState("Ohio", "OH"), new UsState("Oklahoma", "OK"), new UsState("Oregon", "OR"), new UsState("Palau", "PW", {
|
|
2092
2096
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2093
|
-
}), new UsState("
|
|
2097
|
+
}), new UsState("Pennsylvania", "PA"), new UsState("Puerto Rico", "PR", {
|
|
2094
2098
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2095
|
-
}), new UsState("
|
|
2099
|
+
}), new UsState("Rhode Island", "RI"), new UsState("South Carolina", "SC"), new UsState("South Dakota", "SD"), new UsState("Tennessee", "TN"), new UsState("Texas", "TX"), new UsState("Utah", "UT"), new UsState("Vermont", "VT"), new UsState("Virgin Islands", "VI", {
|
|
2100
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2101
|
+
}), new UsState("Virginia", "VA"), new UsState("Washington", "WA"), new UsState("West Virginia", "WV"), new UsState("Wisconsin", "WI"), new UsState("Wyoming", "WY"), new UsState("U.S. Minor Outlying Islands", "UM", {
|
|
2096
2102
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2097
2103
|
})];
|
|
2098
2104
|
/**
|
|
@@ -2712,7 +2718,7 @@ const formLogger = {
|
|
|
2712
2718
|
// event bubbling doesn't handle the formId target properly when passed through a portal.
|
|
2713
2719
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
2714
2720
|
this.isSubmitting = true;
|
|
2715
|
-
handleSubmit(e);
|
|
2721
|
+
void handleSubmit(e);
|
|
2716
2722
|
this.isSubmitting = false;
|
|
2717
2723
|
};
|
|
2718
2724
|
},
|
|
@@ -4962,6 +4968,7 @@ RootPortalContext.displayName = "RootPortalContext";
|
|
|
4962
4968
|
const RootPortalProvider = ({
|
|
4963
4969
|
children
|
|
4964
4970
|
}) => {
|
|
4971
|
+
// eslint-disable-next-line react/hook-use-state -- We don't need the setter
|
|
4965
4972
|
const [rootPortal] = useState(() => {
|
|
4966
4973
|
let rootPortal = document.getElementById("root-portal");
|
|
4967
4974
|
if (!rootPortal) {
|
|
@@ -9920,6 +9927,7 @@ const WalletForm = ({
|
|
|
9920
9927
|
},
|
|
9921
9928
|
resolver: validationResolver(walletSchema)
|
|
9922
9929
|
});
|
|
9930
|
+
const formSetValue = form.setValue;
|
|
9923
9931
|
useBlackboxDetection({
|
|
9924
9932
|
onError: useCallback(() => {
|
|
9925
9933
|
setCodedErrors(errors => {
|
|
@@ -9931,8 +9939,8 @@ const WalletForm = ({
|
|
|
9931
9939
|
};
|
|
9932
9940
|
return [...(errors !== null && errors !== void 0 ? errors : []), blackBoxError];
|
|
9933
9941
|
});
|
|
9934
|
-
}, [
|
|
9935
|
-
onSuccess: useCallback(bb =>
|
|
9942
|
+
}, [t]),
|
|
9943
|
+
onSuccess: useCallback(bb => formSetValue("iovationBlackbox", bb), [formSetValue])
|
|
9936
9944
|
});
|
|
9937
9945
|
const watchAddress = form.watch("address");
|
|
9938
9946
|
const handleSubmit = form.handleSubmit(values => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -15490,10 +15498,10 @@ const RateForm = ({
|
|
|
15490
15498
|
} finally {
|
|
15491
15499
|
// Invalidate carrier queries after the rate form is submitted, regardless of success.
|
|
15492
15500
|
// This allows the carrier balance to refresh if the purchase failed but funding succeeded.
|
|
15493
|
-
queryClient.invalidateQueries(["useGetCarrierById", selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId], {
|
|
15501
|
+
void queryClient.invalidateQueries(["useGetCarrierById", selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId], {
|
|
15494
15502
|
exact: true
|
|
15495
15503
|
});
|
|
15496
|
-
queryClient.invalidateQueries(["useListCarriers"], {
|
|
15504
|
+
void queryClient.invalidateQueries(["useListCarriers"], {
|
|
15497
15505
|
exact: true
|
|
15498
15506
|
});
|
|
15499
15507
|
}
|
|
@@ -16697,7 +16705,7 @@ const ShipmentForm = ({
|
|
|
16697
16705
|
useEffect(() => {
|
|
16698
16706
|
if (!requireMeasurements) {
|
|
16699
16707
|
form.resetField("packages.0.dimensions");
|
|
16700
|
-
form.trigger("packages.0.dimensions");
|
|
16708
|
+
void form.trigger("packages.0.dimensions");
|
|
16701
16709
|
}
|
|
16702
16710
|
}, [requireMeasurements, form]);
|
|
16703
16711
|
useEffect(() => {
|
|
@@ -16988,7 +16996,7 @@ const ShipmentForm = ({
|
|
|
16988
16996
|
children: presetCategory.options.map(preset => jsx(Option, Object.assign({
|
|
16989
16997
|
onClick: () => {
|
|
16990
16998
|
onDirty(); // bypass rate cache
|
|
16991
|
-
handleApplyPreset(preset.value);
|
|
16999
|
+
void handleApplyPreset(preset.value);
|
|
16992
17000
|
},
|
|
16993
17001
|
selected: _$3.isEqual(selectedPreset, preset.value),
|
|
16994
17002
|
value: JSON.stringify(preset.value)
|
|
@@ -18128,13 +18136,14 @@ const ConfigureShipment = _a => {
|
|
|
18128
18136
|
const _d = useShipmentForm({
|
|
18129
18137
|
compatibleCountryCodes: features === null || features === void 0 ? void 0 : features.compatibleCountryCodes,
|
|
18130
18138
|
onAddressValidation,
|
|
18131
|
-
onApplyPreset: useCallback((
|
|
18139
|
+
onApplyPreset: useCallback((preset, shipment) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18132
18140
|
var _e;
|
|
18133
18141
|
if (shipment.packages[0].weight.value) {
|
|
18134
18142
|
yield requestRates(shipment, isInternational);
|
|
18135
18143
|
}
|
|
18136
18144
|
(_e = hydrateRef.current) === null || _e === void 0 ? void 0 : _e.call(hydrateRef, shipment);
|
|
18137
|
-
|
|
18145
|
+
void (onApplyPreset === null || onApplyPreset === void 0 ? void 0 : onApplyPreset(preset, shipment));
|
|
18146
|
+
}), [onApplyPreset, requestRates, isInternational]),
|
|
18138
18147
|
onChangeAddress,
|
|
18139
18148
|
onShipmentUpdated,
|
|
18140
18149
|
onSubmit: useCallback(shipment => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -18333,7 +18342,7 @@ const useImportSalesOrder = ({
|
|
|
18333
18342
|
// to handle scenarios where the sales order has not yet been imported. If the
|
|
18334
18343
|
// order source has already refreshed and there is still no matching order, bubble it up
|
|
18335
18344
|
// to the error boundary.
|
|
18336
|
-
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18345
|
+
void (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18337
18346
|
const selectedOrderSources = orderSourceCode ? orderSources === null || orderSources === void 0 ? void 0 : orderSources.filter(o => o.orderSourceCode.includes(orderSourceCode) && o.active) : orderSources;
|
|
18338
18347
|
if (selectedOrderSources && !salesOrder && !isFetchingSalesOrder && !isFetchingSalesOrders && !hasRefreshedOrderSource) {
|
|
18339
18348
|
yield Promise.all(selectedOrderSources.map(o => refreshOrderSource(o.orderSourceId)));
|
|
@@ -18456,7 +18465,7 @@ const useGetOrCreateShipment = (onShipmentUpdated, shipmentId) => {
|
|
|
18456
18465
|
const getShipment = useGetShipment(shipmentId !== null && shipmentId !== void 0 ? shipmentId : createdShipment === null || createdShipment === void 0 ? void 0 : createdShipment.shipmentId);
|
|
18457
18466
|
useEffect(() => {
|
|
18458
18467
|
if (shouldTriggerUpdate && getShipment.data) {
|
|
18459
|
-
onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(getShipment.data);
|
|
18468
|
+
void (onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(getShipment.data));
|
|
18460
18469
|
setShouldTriggerUpdate(false);
|
|
18461
18470
|
}
|
|
18462
18471
|
}, [shouldTriggerUpdate, getShipment]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipengine/elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@packlink/giger": "*",
|
|
6
6
|
"react-i18next": "*",
|
|
@@ -23,9 +23,8 @@
|
|
|
23
23
|
"@faker-js/faker": "7.6.0",
|
|
24
24
|
"@hookform/resolvers": "2.9.1",
|
|
25
25
|
"@jest/globals": "28.1.3",
|
|
26
|
-
"@packlink/
|
|
27
|
-
"@
|
|
28
|
-
"@shipengine/alchemy": "2.1.0",
|
|
26
|
+
"@packlink/giger-theme": "2.0.1",
|
|
27
|
+
"@shipengine/alchemy": "3.0.0",
|
|
29
28
|
"@shipengine/js-api": "0.23.0",
|
|
30
29
|
"@storybook/addons": "6.5.16",
|
|
31
30
|
"@storybook/components": "7.0.0-rc.1",
|
|
@@ -81,13 +81,13 @@ export declare class UsState<T extends string, U extends string> {
|
|
|
81
81
|
*
|
|
82
82
|
* # Address Utils - Array US States and their codes
|
|
83
83
|
*/
|
|
84
|
-
export declare const usStates: readonly [UsState<"Alabama", "AL">, UsState<"Alaska", "AK">, UsState<"American Samoa", "AS">, UsState<"Arizona", "AZ">, UsState<"Arkansas", "AR">, UsState<"Armed Forces Americas", "AA">, UsState<"Armed Forces Europe", "AE">, UsState<"Armed Forces Pacific", "AP">, UsState<"California", "CA">, UsState<"Colorado", "CO">, UsState<"Connecticut", "CT">, UsState<"Delaware", "DE">, UsState<"District of Columbia", "DC">, UsState<"Florida", "FL">, UsState<"Georgia", "GA">, UsState<"Guam", "GU">, UsState<"Hawaii", "HI">, UsState<"Idaho", "ID">, UsState<"Illinois", "IL">, UsState<"Indiana", "IN">, UsState<"Iowa", "IA">, UsState<"Kansas", "KS">, UsState<"Kentucky", "KY">, UsState<"Louisiana", "LA">, UsState<"Maine", "ME">, UsState<"Maryland", "MD">, UsState<"Massachusetts", "MA">, UsState<"Michigan", "MI">, UsState<"Minnesota", "MN">, UsState<"Mississippi", "MS">, UsState<"Missouri", "MO">, UsState<"Montana", "MT">, UsState<"Nebraska", "NE">, UsState<"Nevada", "NV">, UsState<"New Hampshire", "NH">, UsState<"New Jersey", "NJ">, UsState<"New Mexico", "NM">, UsState<"New York", "NY">, UsState<"North Carolina", "NC">, UsState<"North Dakota", "ND">, UsState<"Ohio", "OH">, UsState<"Oklahoma", "OK">, UsState<"Oregon", "OR">, UsState<"Pennsylvania", "PA">, UsState<"Puerto Rico", "PR">, UsState<"Rhode Island", "RI">, UsState<"South Carolina", "SC">, UsState<"South Dakota", "SD">, UsState<"Tennessee", "TN">, UsState<"Texas", "TX">, UsState<"Utah", "UT">, UsState<"Vermont", "VT">, UsState<"Virgin Islands", "VI">, UsState<"Virginia", "VA">, UsState<"Washington", "WA">, UsState<"West Virginia", "WV">, UsState<"Wisconsin", "WI">, UsState<"Wyoming", "WY">, UsState<"
|
|
84
|
+
export declare const usStates: readonly [UsState<"Alabama", "AL">, UsState<"Alaska", "AK">, UsState<"American Samoa", "AS">, UsState<"Arizona", "AZ">, UsState<"Arkansas", "AR">, UsState<"Armed Forces Americas", "AA">, UsState<"Armed Forces Europe", "AE">, UsState<"Armed Forces Pacific", "AP">, UsState<"California", "CA">, UsState<"Colorado", "CO">, UsState<"Connecticut", "CT">, UsState<"Delaware", "DE">, UsState<"District of Columbia", "DC">, UsState<"Florida", "FL">, UsState<"Georgia", "GA">, UsState<"Guam", "GU">, UsState<"Hawaii", "HI">, UsState<"Idaho", "ID">, UsState<"Illinois", "IL">, UsState<"Indiana", "IN">, UsState<"Iowa", "IA">, UsState<"Kansas", "KS">, UsState<"Kentucky", "KY">, UsState<"Louisiana", "LA">, UsState<"Maine", "ME">, UsState<"Marshall Islands", "MH">, UsState<"Maryland", "MD">, UsState<"Massachusetts", "MA">, UsState<"Michigan", "MI">, UsState<"Micronesia", "FM">, UsState<"Minnesota", "MN">, UsState<"Mississippi", "MS">, UsState<"Missouri", "MO">, UsState<"Montana", "MT">, UsState<"Nebraska", "NE">, UsState<"Nevada", "NV">, UsState<"New Hampshire", "NH">, UsState<"New Jersey", "NJ">, UsState<"New Mexico", "NM">, UsState<"New York", "NY">, UsState<"North Carolina", "NC">, UsState<"North Dakota", "ND">, UsState<"Northern Mariana Islands", "MP">, UsState<"Ohio", "OH">, UsState<"Oklahoma", "OK">, UsState<"Oregon", "OR">, UsState<"Palau", "PW">, UsState<"Pennsylvania", "PA">, UsState<"Puerto Rico", "PR">, UsState<"Rhode Island", "RI">, UsState<"South Carolina", "SC">, UsState<"South Dakota", "SD">, UsState<"Tennessee", "TN">, UsState<"Texas", "TX">, UsState<"Utah", "UT">, UsState<"Vermont", "VT">, UsState<"Virgin Islands", "VI">, UsState<"Virginia", "VA">, UsState<"Washington", "WA">, UsState<"West Virginia", "WV">, UsState<"Wisconsin", "WI">, UsState<"Wyoming", "WY">, UsState<"U.S. Minor Outlying Islands", "UM">];
|
|
85
85
|
/**
|
|
86
86
|
* @internal
|
|
87
87
|
*
|
|
88
88
|
* # Address Utils - Map of US State Codes
|
|
89
89
|
*/
|
|
90
|
-
export declare const usStateCodes: ["AL", "AK", "AS", "AZ", "AR", "AA", "AE", "AP", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY", "
|
|
90
|
+
export declare const usStateCodes: ["AL", "AK", "AS", "AZ", "AR", "AA", "AE", "AP", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "FM", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY", "UM"];
|
|
91
91
|
/**
|
|
92
92
|
* @internal
|
|
93
93
|
*
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* @category Hooks
|
|
7
7
|
*/
|
|
8
8
|
export declare const useStateCodeOptions: (domestic?: boolean) => {
|
|
9
|
-
label: "Alabama" | "Alaska" | "American Samoa" | "Arizona" | "Arkansas" | "Armed Forces Americas" | "Armed Forces Europe" | "Armed Forces Pacific" | "California" | "Colorado" | "Connecticut" | "Delaware" | "District of Columbia" | "Florida" | "Georgia" | "Guam" | "Hawaii" | "Idaho" | "Illinois" | "Indiana" | "Iowa" | "Kansas" | "Kentucky" | "Louisiana" | "Maine" | "Maryland" | "Massachusetts" | "Michigan" | "Minnesota" | "Mississippi" | "Missouri" | "Montana" | "Nebraska" | "Nevada" | "New Hampshire" | "New Jersey" | "New Mexico" | "New York" | "North Carolina" | "North Dakota" | "Ohio" | "Oklahoma" | "Oregon" | "Pennsylvania" | "Puerto Rico" | "Rhode Island" | "South Carolina" | "South Dakota" | "Tennessee" | "Texas" | "Utah" | "Vermont" | "Virgin Islands" | "Virginia" | "Washington" | "West Virginia" | "Wisconsin" | "Wyoming" | "
|
|
10
|
-
value: "AL" | "AK" | "AS" | "AZ" | "AR" | "AA" | "AE" | "AP" | "CA" | "CO" | "CT" | "DE" | "DC" | "FL" | "GA" | "GU" | "HI" | "ID" | "IL" | "IN" | "IA" | "KS" | "KY" | "LA" | "ME" | "MD" | "MA" | "MI" | "MN" | "MS" | "MO" | "MT" | "NE" | "NV" | "NH" | "NJ" | "NM" | "NY" | "NC" | "ND" | "OH" | "OK" | "OR" | "PA" | "PR" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VT" | "VI" | "VA" | "WA" | "WV" | "WI" | "WY" | "
|
|
9
|
+
label: "Alabama" | "Alaska" | "American Samoa" | "Arizona" | "Arkansas" | "Armed Forces Americas" | "Armed Forces Europe" | "Armed Forces Pacific" | "California" | "Colorado" | "Connecticut" | "Delaware" | "District of Columbia" | "Florida" | "Georgia" | "Guam" | "Hawaii" | "Idaho" | "Illinois" | "Indiana" | "Iowa" | "Kansas" | "Kentucky" | "Louisiana" | "Maine" | "Marshall Islands" | "Maryland" | "Massachusetts" | "Michigan" | "Micronesia" | "Minnesota" | "Mississippi" | "Missouri" | "Montana" | "Nebraska" | "Nevada" | "New Hampshire" | "New Jersey" | "New Mexico" | "New York" | "North Carolina" | "North Dakota" | "Northern Mariana Islands" | "Ohio" | "Oklahoma" | "Oregon" | "Palau" | "Pennsylvania" | "Puerto Rico" | "Rhode Island" | "South Carolina" | "South Dakota" | "Tennessee" | "Texas" | "Utah" | "Vermont" | "Virgin Islands" | "Virginia" | "Washington" | "West Virginia" | "Wisconsin" | "Wyoming" | "U.S. Minor Outlying Islands";
|
|
10
|
+
value: "AL" | "AK" | "AS" | "AZ" | "AR" | "AA" | "AE" | "AP" | "CA" | "CO" | "CT" | "DE" | "DC" | "FL" | "GA" | "GU" | "HI" | "ID" | "IL" | "IN" | "IA" | "KS" | "KY" | "LA" | "ME" | "MH" | "MD" | "MA" | "MI" | "FM" | "MN" | "MS" | "MO" | "MT" | "NE" | "NV" | "NH" | "NJ" | "NM" | "NY" | "NC" | "ND" | "MP" | "OH" | "OK" | "OR" | "PW" | "PA" | "PR" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VT" | "VI" | "VA" | "WA" | "WV" | "WI" | "WY" | "UM";
|
|
11
11
|
}[];
|
|
@@ -6,7 +6,6 @@ export type ElementsErrorHandler = (err: Error, context: {
|
|
|
6
6
|
element?: string;
|
|
7
7
|
}) => void;
|
|
8
8
|
export interface ElementsContextValue {
|
|
9
|
-
brandName?: string;
|
|
10
9
|
environment: ElementsEnvironment;
|
|
11
10
|
onError?: ElementsErrorHandler;
|
|
12
11
|
}
|
|
@@ -16,7 +15,6 @@ export interface ElementsContextValue {
|
|
|
16
15
|
export declare const ElementsContext: import("react").Context<ElementsContextValue | undefined>;
|
|
17
16
|
export interface ElementsProviderProps {
|
|
18
17
|
baseURL?: string;
|
|
19
|
-
brandName?: string;
|
|
20
18
|
children: JSX.Element;
|
|
21
19
|
environment?: ElementsEnvironment;
|
|
22
20
|
getToken: ShipEngineProps["getToken"];
|
|
@@ -26,7 +24,7 @@ export interface ElementsProviderProps {
|
|
|
26
24
|
/**
|
|
27
25
|
* @category Providers
|
|
28
26
|
*/
|
|
29
|
-
export declare const ElementsProvider: ({ baseURL,
|
|
27
|
+
export declare const ElementsProvider: ({ baseURL, children, environment, getToken, onError, }: ElementsProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
30
28
|
/**
|
|
31
29
|
* Must be used within {@link ElementsProvider}
|
|
32
30
|
*
|