@shipengine/elements 1.9.0 → 2.0.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/README.md +0 -4
- package/assertions-dfa95b4d.js +1 -0
- package/carrier-c2a5ed53.js +1 -0
- package/{carrier-logo-1b6c767e.js → carrier-logo-330e926f.js} +1 -1
- package/components.js +1 -1
- package/elements.js +1 -1
- package/hooks.js +1 -1
- package/index.js +1 -1
- package/money-d4f3d7c3.js +1 -0
- package/package.json +7 -3
- package/schemas.js +1 -1
- package/{shipment-90d35708.js → shipment-150160e0.js} +1 -1
- package/src/components/add-funds-form/add-funds-form.d.ts +1 -1
- package/src/components/auto-funding-form/auto-funding-form.d.ts +1 -1
- package/src/components/carrier-balance/carrier-balance.d.ts +1 -1
- package/src/components/collapsible-panel/collapsible-panel.d.ts +1 -1
- package/src/components/display-term/display-term.d.ts +1 -1
- package/src/components/edit-billing-form/edit-billing-form.d.ts +1 -1
- package/src/components/field/money-input/money-input.d.ts +1 -1
- package/src/components/field/rate-card/cost-breakdown/cost-breakdown.d.ts +1 -1
- package/src/components/field/rate-card/rate-card.d.ts +1 -1
- package/src/components/field/rate-select/rate-select.d.ts +1 -1
- package/src/components/fund-and-purchase/fund-and-purchase.d.ts +1 -1
- package/src/components/history/history-card/history-card.d.ts +1 -1
- package/src/components/items-breakdown/items-breakdown.d.ts +1 -1
- package/src/components/pager/pager.d.ts +1 -1
- package/src/components/rate-details/rate-details.d.ts +1 -1
- package/src/components/save-status/save-status.d.ts +1 -1
- package/src/components/service-points/service-points.d.ts +1 -1
- package/src/components/templates/address-display/address-display.d.ts +1 -1
- package/src/components/templates/address-preference-display/address-preference-display.d.ts +1 -1
- package/src/components/templates/address-preference-select/address-preference-select.d.ts +1 -1
- package/src/components/templates/connect-external-carrier-form/connect-external-carrier-form.d.ts +12 -0
- package/src/components/templates/connect-external-carrier-form/index.d.ts +1 -0
- package/src/components/templates/index.d.ts +1 -1
- package/src/components/templates/label/label.d.ts +1 -1
- package/src/components/templates/product-form/product-form.d.ts +1 -1
- package/src/components/templates/products-display/products-display.d.ts +1 -1
- package/src/components/templates/rate-form/rate-form.d.ts +3 -4
- package/src/components/templates/shipment/shipment.d.ts +3 -11
- package/src/components/templates/shipment-form/shipment-form.d.ts +2 -9
- package/src/components/templates/shipment-form/shipment-schema.d.ts +1 -1
- package/src/components/templates/suspend-sales-order/suspend-sales-order.d.ts +1 -1
- package/src/components/templates/suspend-shipment/suspend-shipment.d.ts +1 -1
- package/src/components/templates/wallet-form/edit-wallet-address-form.d.ts +1 -1
- package/src/components/templates/wallet-form/wallet-form.d.ts +2 -4
- package/src/components/templates/wallet-form/wallet-schema.d.ts +1 -1
- package/src/components/wallet-card/wallet-card.d.ts +1 -1
- package/src/components/warehouse-form/warehouse-form.d.ts +1 -1
- package/src/create-element/create-element.d.ts +10 -0
- package/src/create-element/element/element.d.ts +16 -0
- package/src/create-element/element/hooks/index.d.ts +1 -0
- package/src/create-element/element/hooks/use-i18n.d.ts +12 -0
- package/src/create-element/element/index.d.ts +3 -0
- package/src/create-element/element/utils/get-emotion-cache.d.ts +2 -0
- package/src/create-element/element/utils/index.d.ts +1 -0
- package/src/create-element/error-boundary/error-boundary.d.ts +21 -0
- package/src/create-element/error-boundary/index.d.ts +1 -0
- package/src/create-element/index.d.ts +1 -0
- package/src/elements/index.d.ts +5 -4
- package/src/elements/label-layout/label-layout-element.d.ts +1 -1
- package/src/elements/labels-grid/labels-grid.d.ts +2 -2
- package/src/elements/manage-carriers/index.d.ts +1 -0
- package/src/elements/{shipengine-carriers/shipengine-carriers.d.ts → manage-carriers/manage-carriers.d.ts} +52 -46
- package/src/elements/manage-external-carriers/index.d.ts +1 -0
- package/src/elements/manage-external-carriers/manage-external-carriers.d.ts +888 -0
- package/src/elements/manage-funding/manage-funding-element.d.ts +1 -1
- package/src/elements/manage-warehouses/manage-warehouses.d.ts +19 -2
- package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +1 -1
- package/src/elements/purchase-label/configure-shipment.d.ts +4 -27
- package/src/elements/purchase-label/hooks/use-address.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-configure-shipment.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-customs.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-import-sales-order.d.ts +2 -2
- package/src/elements/purchase-label/hooks/use-load-shipment.d.ts +3 -3
- package/src/elements/purchase-label/hooks/use-pending-shipment.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-presets.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-rates-form.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-rates-with-cache.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-request-preferred-rates.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-request-rates.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-shipment-form.d.ts +1 -1
- package/src/elements/purchase-label/purchase-label-by-sales-order.d.ts +1 -1
- package/src/elements/purchase-label/purchase-label-by-shipment.d.ts +1 -1
- package/src/elements/purchase-label/purchase-label.d.ts +18 -41
- package/src/elements/shipment-summary/index.d.ts +1 -0
- package/src/elements/{view-shipment/view-shipment.d.ts → shipment-summary/shipment-summary.d.ts} +42 -59
- package/src/elements/shipments-grid/shipments-grid.d.ts +2 -2
- package/src/elements/theme-creator/theme-creator.d.ts +1 -1
- package/src/elements/transaction-history/index.d.ts +1 -0
- package/src/elements/{wallet-history/wallet-history-element.d.ts → transaction-history/transaction-history-element.d.ts} +1 -1
- package/src/elements/unit-settings/unit-settings-element.d.ts +1 -1
- package/src/elements/vat-settings/vat-settings-element.d.ts +1 -1
- package/src/elements/void-label/components/actions/actions.d.ts +1 -1
- package/src/elements/void-label/components/message/message.d.ts +1 -1
- package/src/elements/void-label/void-label.d.ts +33 -49
- package/src/elements-provider/elements-provider.d.ts +46 -0
- package/src/elements-provider/elements-test-provider.d.ts +3 -0
- package/src/elements-provider/hooks/index.d.ts +1 -0
- package/src/elements-provider/hooks/use-load-icons.d.ts +7 -0
- package/src/elements-provider/index.d.ts +1 -0
- package/src/factories/shipengine/address.d.ts +1 -1
- package/src/factories/shipengine/carrier.d.ts +1 -1
- package/src/factories/shipengine/index.d.ts +1 -1
- package/src/factories/shipengine/label.d.ts +1 -1
- package/src/factories/shipengine/money.d.ts +1 -1
- package/src/factories/shipengine/order-source.d.ts +1 -1
- package/src/factories/shipengine/package.d.ts +1 -1
- package/src/factories/shipengine/resource.d.ts +1 -1
- package/src/factories/shipengine/sales-order.d.ts +1 -1
- package/src/factories/shipengine/service-point.d.ts +1 -1
- package/src/factories/shipengine/service.d.ts +1 -1
- package/src/factories/shipengine/shipment.d.ts +1 -1
- package/src/factories/shipengine/{wallet-history.d.ts → transaction-history.d.ts} +1 -1
- package/src/factories/shipengine/warehouse.d.ts +1 -1
- package/src/factories/shipengine/weight.d.ts +1 -1
- package/src/features/index.d.ts +3 -3
- package/src/features/label-layout/label-layout.d.ts +1 -1
- package/src/features/label-layout/use-label-layout.d.ts +1 -1
- package/src/features/{shipengine-carriers → manage-carriers}/hooks/use-list-funding-source-carriers.d.ts +2 -2
- package/src/features/manage-carriers/index.d.ts +1 -0
- package/src/features/manage-carriers/manage-carriers-row/index.d.ts +1 -0
- package/src/features/{shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.d.ts → manage-carriers/manage-carriers-row/manage-carriers-row.d.ts} +3 -3
- package/src/features/manage-carriers/manage-carriers.d.ts +4 -0
- package/src/features/manage-external-carriers/index.d.ts +1 -0
- package/src/features/manage-external-carriers/manage-external-carriers.d.ts +4 -0
- package/src/features/manage-warehouses/manage-warehouses.d.ts +1 -1
- package/src/features/manage-warehouses/use-manage-warehouses.d.ts +9 -9
- package/src/features/manage-warehouses/warehouse-display/warehouse-display.d.ts +1 -1
- package/src/features/transaction-history/index.d.ts +1 -0
- package/src/features/transaction-history/transaction-history.d.ts +6 -0
- package/src/features/unit-settings/unit-settings.d.ts +1 -1
- package/src/features/unit-settings/use-unit-settings.d.ts +1 -1
- package/src/features/vat-settings/use-vat-settings.d.ts +5 -5
- package/src/hooks/here-map/init.d.ts +1 -1
- package/src/hooks/options/use-confirmation-options.d.ts +1 -1
- package/src/hooks/options/use-customs-contents-options.d.ts +1 -1
- package/src/hooks/options/use-customs-non-delivery-options.d.ts +1 -1
- package/src/hooks/options/use-insurance-provider-options.d.ts +1 -1
- package/src/hooks/options/use-package-options.d.ts +1 -1
- package/src/hooks/options/use-rate-options.d.ts +1 -1
- package/src/hooks/options/use-service-code-options.d.ts +1 -1
- package/src/hooks/options/use-service-points.d.ts +1 -1
- package/src/hooks/options/use-shipment-metadata.d.ts +1 -1
- package/src/hooks/options/use-shipping-presets-options.d.ts +1 -1
- package/src/hooks/options/use-warehouse-options.d.ts +1 -1
- package/src/hooks/use-address-validation.d.ts +1 -1
- package/src/hooks/use-get-or-create-shipment.d.ts +3 -3
- package/src/hooks/use-scrub-errors.d.ts +1 -1
- package/src/index.d.ts +1 -0
- package/src/locales/en/index.d.ts +1 -1
- package/src/mocks/carriers/handlers.d.ts +1 -1
- package/src/mocks/warehouses/handlers.d.ts +1 -1
- package/src/schemas/shipengine/money.d.ts +1 -1
- package/src/testing/test-utils.d.ts +7 -1
- package/src/themes/fallback.d.ts +3 -0
- package/src/themes/index.d.ts +4 -0
- package/src/types/carrier-metadata.d.ts +1 -1
- package/src/types/preferred-rates.d.ts +1 -1
- package/src/types/shipping-preset/shipping-preset.d.ts +1 -1
- package/src/utilities/error.d.ts +1 -1
- package/src/utilities/feature-flags/feature-flags.d.ts +18 -0
- package/src/utilities/feature-flags/index.d.ts +2 -0
- package/src/utilities/feature-flags/types.d.ts +141 -0
- package/src/utilities/money.d.ts +1 -1
- package/src/utilities/rates.d.ts +1 -1
- package/src/utilities/shipengine/address.d.ts +1 -1
- package/src/utilities/shipengine/carrier.d.ts +1 -1
- package/src/utilities/shipengine/dimensions.d.ts +1 -1
- package/src/utilities/shipengine/sales-order.d.ts +1 -1
- package/src/utilities/shipengine/shipment.d.ts +1 -1
- package/src/utilities/shipengine/warehouses.d.ts +1 -1
- package/src/utilities/shipengine/weight.d.ts +1 -1
- package/src/workflows/account-settings/account-settings.d.ts +7 -14
- package/src/workflows/{connect-carrier/connect-carrier.d.ts → carrier-services/carrier-services.d.ts} +35 -49
- package/src/workflows/carrier-services/index.d.ts +1 -0
- package/src/workflows/{manage-wallet-workflow/manage-wallet-workflow.d.ts → connect-external-carrier/connect-external-carrier.d.ts} +16 -21
- package/src/workflows/connect-external-carrier/index.d.ts +1 -0
- package/src/workflows/index.d.ts +3 -2
- package/src/workflows/label-workflow/index.d.ts +1 -0
- package/src/workflows/{purchase-label-workflow/purchase-label-workflow.d.ts → label-workflow/label-workflow.d.ts} +16 -34
- package/src/workflows/onboarding/components/carrier-recovery-form/carrier-recovery-form.d.ts +1 -1
- package/src/workflows/onboarding/components/funding-and-carrier-connection-step/funding-and-carrier-connection-step.d.ts +2 -4
- package/src/workflows/onboarding/components/funding-and-carrier-connection-step/use-funding-and-carrier-connection-step.d.ts +1 -1
- package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.d.ts +2 -9
- package/src/workflows/onboarding/components/ship-from-address-step/ship-from-address-step.d.ts +1 -1
- package/src/workflows/onboarding/components/ship-from-address-step/use-ship-from-address-step.d.ts +1 -1
- package/src/workflows/onboarding/components/terms-agreement-form/terms-agreement-form.d.ts +1 -1
- package/src/workflows/onboarding/components/terms-agreement-step/terms-agreement-step.d.ts +1 -1
- package/src/workflows/onboarding/components/terms-agreement-step/use-terms-agreement-step.d.ts +1 -1
- package/src/workflows/onboarding/onboarding.d.ts +22 -70
- package/story-notes-c714d2ed.js +1 -0
- package/{suspend-text-c8c7b6b6.js → suspend-text-cad3a977.js} +1 -1
- package/transaction-history-element-cbfe487c.js +1 -0
- package/{use-page-layout-93ffae78.js → use-page-layout-8cb5075f.js} +1 -1
- package/use-scrub-errors-9870a6f3.js +1 -0
- package/use-toggle-866d7938.js +1 -0
- package/use-unit-settings-a5bae16e.js +1 -0
- package/utilities.js +1 -1
- package/validation-528e7834.js +1 -0
- package/wallet-form-9e4bfaea.js +1 -0
- package/warehouse-form-da6a7ac5.js +34 -0
- package/{warehouses-dfcdce23.js → warehouses-a83188ab.js} +1 -1
- package/workflows.js +1 -1
- package/carrier-2abb4760.js +0 -1
- package/feature-flags-3e03717c.js +0 -1
- package/money-fbc4d0b3.js +0 -1
- package/payment-method-settings-element-595cc38d.js +0 -1
- package/src/components/templates/connect-carrier-form/connect-carrier-form.d.ts +0 -12
- package/src/components/templates/connect-carrier-form/index.d.ts +0 -1
- package/src/elements/external-carriers/external-carriers.d.ts +0 -941
- package/src/elements/external-carriers/index.d.ts +0 -1
- package/src/elements/shipengine-carriers/index.d.ts +0 -1
- package/src/elements/view-shipment/index.d.ts +0 -1
- package/src/elements/wallet-history/index.d.ts +0 -1
- package/src/features/external-carriers/external-carriers.d.ts +0 -11
- package/src/features/external-carriers/index.d.ts +0 -1
- package/src/features/shipengine-carriers/index.d.ts +0 -1
- package/src/features/shipengine-carriers/shipengine-carriers-row/index.d.ts +0 -1
- package/src/features/shipengine-carriers/shipengine-carriers.d.ts +0 -10
- package/src/features/wallet-history/index.d.ts +0 -1
- package/src/features/wallet-history/wallet-history.d.ts +0 -6
- package/src/hooks/use-elements.d.ts +0 -35
- package/src/utilities/feature-flags.d.ts +0 -232
- package/src/workflows/connect-carrier/index.d.ts +0 -1
- package/src/workflows/manage-wallet-workflow/index.d.ts +0 -1
- package/src/workflows/purchase-label-workflow/index.d.ts +0 -1
- package/story-notes-ce2d8cca.js +0 -1
- package/use-scrub-errors-2c4db406.js +0 -1
- package/use-toggle-838d2ebd.js +0 -1
- package/validation-b941a548.js +0 -1
- package/wallet-form-3981400b.js +0 -1
- package/wallet-history-5b34c856.js +0 -1
- package/warehouse-form-c0b3ea78.js +0 -34
- /package/src/components/templates/{connect-carrier-form/connect-carrier-form.styles.d.ts → connect-external-carrier-form/connect-external-carrier-form.styles.d.ts} +0 -0
- /package/src/features/{shipengine-carriers → manage-carriers}/hooks/index.d.ts +0 -0
- /package/src/features/{shipengine-carriers → manage-carriers}/hooks/use-carrier-metadata.d.ts +0 -0
- /package/src/features/{shipengine-carriers/shipengine-carriers-row/shipengine-carriers-row.styles.d.ts → manage-carriers/manage-carriers-row/manage-carriers-row.styles.d.ts} +0 -0
- /package/src/features/{shipengine-carriers/shipengine-carriers.styles.d.ts → manage-carriers/manage-carriers.styles.d.ts} +0 -0
- /package/src/features/{wallet-history/wallet-history.styles.d.ts → transaction-history/transaction-history.styles.d.ts} +0 -0
- /package/src/workflows/{manage-wallet-workflow → carrier-services}/use-get-wallet-panel-props.d.ts +0 -0
package/README.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(r,o){if(!r)throw new Error(o)}function o(r){throw new Error(r)}export{r as a,o as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{format as e}from"date-fns/format";import{enGB as t,enUS as r}from"date-fns/locale";import{parse as n}from"date-fns/parse";import{SE as a}from"@shipengine/react-api";import{c as s,u as o,f as i}from"./address-8f8119f4.js";function c(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function u(e,t,r,n){return new(r||(r=Promise))((function(a,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function i(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,i)}c((n=n.apply(e,t||[])).next())}))}const d=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"numeric",month:"long",year:"numeric"}),l=(e="en-US")=>{const n=e.replaceAll("-",""),a=e.split("-")[0],s={enGB:t,enUS:r};return s[n in s?n:a]},p=(t,r="en-US",n)=>{const a=l(r),s=v(r);return e(t,null!=n?n:s,{locale:a})},y=(e,t="en-US",r="P")=>{const a=l(t);return n(e,r,new Date,{locale:a})},m=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"2-digit",month:"2-digit",year:"2-digit"}),g=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"2-digit",month:"2-digit",year:"numeric"}),v=(e="en-US")=>{var t;return null===(t=l(e).formatLong)||void 0===t?void 0:t.date({width:"short"})},f=(e,t=new Date)=>((t=new Date(t)).setDate(t.getDate()+e),t),D=(e,t=new Date)=>t.getHours()>=e?f(1,new Date(t)):new Date(t),w=(...e)=>new Date(Math.max(...e.map(Number))),h=e=>{const t=e?new Date(e):new Date;return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())},b=e=>{const t=(new Date).getFullYear(),r=[];for(let n=0;n<e;n++)r.push(`${t+n}`);return r},C=(e,t,r="desc")=>{const[n,a]="asc"===r?[e,t]:[t,e];return new Date(n.createdAt).getTime()-new Date(a.createdAt).getTime()},U=e=>!!e&&new Date(e)>=new Date,_=e=>{const t=null!=e?e:new Date;return{firstDayOfMonth:new Date(t.getFullYear(),t.getMonth(),1),lastDayOfTheMonth:new Date(t.getFullYear(),t.getMonth()+1,0),origin:t,previousMonthFirstDay:new Date(t.getFullYear(),t.getMonth()-1,1),previousMonthLastDay:new Date(t.getFullYear(),t.getMonth()-1+1,0),thirtyDaysAgo:new Date((new Date).setDate(t.getDate()-30))}},O={aud:"$",cad:"$",eur:"€",gbp:"£",nzd:"$",usd:"$"},S=(e,t="en-US")=>Intl.NumberFormat(t,{currency:e.currency,style:"currency"}).format(e.amount),j=(...e)=>e.reduce(((e,t)=>{var r;return t?e+(null!==(r=t.amount)&&void 0!==r?r:0):e}),0),A=e=>[e.substring(0,4),e.substring(4,8),e.substring(8,12),e.substring(12)].join(" ").trim(),M=e=>{const t=e.replace(/\//g,"");return t.length>2?[t.substring(0,2),t.substring(2,6)].join("/").trim():t},L=e=>{switch(null==e?void 0:e.toLowerCase()){case"usd":default:return a.Currency.USD;case"cad":return a.Currency.CAD;case"aud":return a.Currency.AUD;case"gbp":return a.Currency.GBP;case"eur":return a.Currency.EUR;case"nzd":return a.Currency.NZD}},x=e=>{let t;switch(e){case a.Currency.USD:case a.Currency.CAD:case a.Currency.AUD:case a.Currency.NZD:t="$";break;case a.Currency.GBP:t="£";break;case a.Currency.EUR:t="€"}return t},F=(e,t,r)=>{switch(e){case"usps_media_mail":return!0;case"usps_first_class_mail":return"large_envelope_or_flat"===t;case"dhl_express_worldwide":return r;default:return!1}},P=(e={})=>j(...Object.values(e)),T=(e,t)=>t[e]||e,$=[{carrier:"yodel_walleted"},{carrier:"hermes",serviceCodes:[{serviceCode:"domestic_courier_collections",type:"pick_up"},{serviceCode:"postable_courier_collections",type:"pick_up"}]},{carrier:"dpdwallet"}],k=e=>$.some((t=>e.carrierCode===t.carrier)),Y=(e,t)=>$.some((r=>{var n;return r.carrier===e&&(null===(n=r.serviceCodes)||void 0===n?void 0:n.some((e=>e.serviceCode===t&&"pick_up"===e.type)))})),B=e=>{var t;return"US"===e.countryCode||(null===(t=s.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnitedStatesTerritory)},N=e=>{var t,r;return!(!(null===(t=o.find((t=>t.code===e.stateProvince)))||void 0===t?void 0:t.isMilitary)&&!(null===(r=i.find((t=>t.code===e.cityLocality)))||void 0===r?void 0:r.isMilitary))},E=e=>{var t,r;return!(!(null===(t=s.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnitedStatesTerritory)&&!(null===(r=o.find((t=>t.code===e.stateProvince)))||void 0===r?void 0:r.isUnitedStatesTerritory))},G=e=>{var t;return!!(null===(t=s.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnsupportedByUps)},I=/^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i,z=e=>I.test(e),H=e=>!!(z(e.addressLine1)||e.addressLine2&&z(e.addressLine2)),R=e=>!e||Object.entries(e).every((([e,t])=>"countryCode"===e||[null,"","unknown"].includes(t))),Z=(e,t)=>Object.assign(Object.assign(Object.assign({},e),e.matchedAddress&&{matchedAddress:Object.assign(Object.assign({},e.matchedAddress),{email:t})}),{originalAddress:Object.assign(Object.assign({},e.originalAddress),{email:t})}),q=["usps","stamps_com"],J=e=>q.includes(e),K=e=>"ups"===e,Q=(e=[],t)=>{const r=e.find((e=>e.carrierCode===t));return null==r?void 0:r.carrierId},V=(e,t)=>{var r;return`https://logos.shipstation.com/ipaas/carriers/${null!==(r={stamps_com:"stamps_com_wl"}[e])&&void 0!==r?r:e}/${t}.svg`};export{Y as A,B,N as C,E as D,G as E,z as F,H as G,R as H,Z as I,J,K,Q as L,V as M,u as N,c as _,l as a,p as b,m as c,g as d,f as e,d as f,v as g,b as h,U as i,_ as j,O as k,S as l,w as m,D as n,h as o,y as p,j as q,A as r,C as s,M as t,L as u,x as v,F as w,P as x,T as y,k as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"@emotion/react/jsx-runtime";import{M as o}from"./carrier-
|
|
1
|
+
import{jsx as r}from"@emotion/react/jsx-runtime";import{M as o}from"./carrier-c2a5ed53.js";const e={md:40,lg:68,xl:105},t=({carrierCode:t,carrierName:i,size:m="md"})=>{const a=o(t,"logo");return a?r("img",{alt:`${i}-logo`,height:e[m],src:a,width:e[m]},i):null};export{t as C};
|
package/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CollapsiblePanel,f as CopyButton,h as Cube,D as DateRangeCombo,i as DateRangeSelect,j as DisplayTerm,E as EditBillingForm,k as ErrorFallback,F as FieldLabel,l as FormPortal,m as FundAndPurchase,H as HistoryCard,n as HistoryCardExtension,I as InlineLabel,o as ItemsBreakdown,L as LinkAction,p as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,q as SettingsCard,r as SkeletonCarrierRow,t as Spacer,u as Spread,T as Tabs,V as VatForm,W as WalletCard,v as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./warehouse-form-
|
|
1
|
+
export{A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CollapsiblePanel,f as CopyButton,h as Cube,D as DateRangeCombo,i as DateRangeSelect,j as DisplayTerm,E as EditBillingForm,k as ErrorFallback,F as FieldLabel,l as FormPortal,m as FundAndPurchase,H as HistoryCard,n as HistoryCardExtension,I as InlineLabel,o as ItemsBreakdown,L as LinkAction,p as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,q as SettingsCard,r as SkeletonCarrierRow,t as Spacer,u as Spread,T as Tabs,V as VatForm,W as WalletCard,v as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./warehouse-form-da6a7ac5.js";export{C as CarrierLogo}from"./carrier-logo-330e926f.js";export{C as CellFormattedDate,D as Drawer,G as GridController,P as Pager,S as SuspendText,u as usePager}from"./suspend-text-cad3a977.js";export{f as Field,S as StoryNotes}from"./story-notes-c714d2ed.js";export{P as Portal}from"./use-toggle-866d7938.js";import"./carrier-c2a5ed53.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"@shipengine/react-api";import"./address-8f8119f4.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./validation-528e7834.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"lodash/isEqual";import"./money-d4f3d7c3.js";import"copy-to-clipboard";import"js-base64";import"card-validator";import"libphonenumber-js/min";import"axios";import"./zod-60def96c.js";import"lodash/omit";import"react-dom";
|
package/elements.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{e as
|
|
1
|
+
export{e as LabelLayout,l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,d as ManageFunding,a as ManageWarehouses,p as PaymentMethodSettings,s as ShipmentsGrid,t as ThemeCreator,T as ThemeCreatorProvider,f as TransactionHistory,c as UnitSettings,u as useThemeCreator}from"./transaction-history-element-cbfe487c.js";export{c as CarrierServices,p as PurchaseLabel,s as ShipmentSummary,v as VoidLabel}from"./use-unit-settings-a5bae16e.js";import"@emotion/react/jsx-runtime";import"./warehouse-form-da6a7ac5.js";import"./carrier-c2a5ed53.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"@shipengine/react-api";import"./address-8f8119f4.js";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./validation-528e7834.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"./use-toggle-866d7938.js";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"./money-d4f3d7c3.js";import"copy-to-clipboard";import"js-base64";import"card-validator";import"libphonenumber-js/min";import"axios";import"./zod-60def96c.js";import"./suspend-text-cad3a977.js";import"./formatString-413ec7c7.js";import"humps";import"@tanstack/react-query";import"./use-scrub-errors-9870a6f3.js";import"./shipment-150160e0.js";import"lodash/orderBy";import"lodash/merge";import"lodash/mergeWith";import"./warehouses-a83188ab.js";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";
|
package/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle-
|
|
1
|
+
export{R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle-866d7938.js";export{P as PudoType,l as useBlackboxDetection,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,d as useInsuranceProviderOptions,m as useNestedForm,e as usePackageOptions,f as useRateOptions,n as useRunOnceOnTrue,o as useScrubErrors,g as useServiceCodeOptions,k as useServicePoints,h as useShipmentMetadata,i as useShippingPresetsOptions,j as useWarehouseOptions}from"./use-scrub-errors-9870a6f3.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as usePageLayout}from"./use-page-layout-8cb5075f.js";import"react";import"./address-8f8119f4.js";import"./carrier-c2a5ed53.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"@shipengine/react-api";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"@emotion/react/jsx-runtime";import"humps";import"react-i18next";import"./shipment-150160e0.js";import"lodash/orderBy";import"@shipengine/giger";import"@emotion/react";import"js-base64";
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CollapsiblePanel,f as CopyButton,h as Cube,D as DateRangeCombo,i as DateRangeSelect,j as DisplayTerm,E as EditBillingForm,k as ErrorFallback,F as FieldLabel,l as FormPortal,m as FundAndPurchase,H as HistoryCard,n as HistoryCardExtension,I as InlineLabel,o as ItemsBreakdown,L as LinkAction,p as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,q as SettingsCard,r as SkeletonCarrierRow,t as Spacer,u as Spread,T as Tabs,V as VatForm,W as WalletCard,v as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./warehouse-form-
|
|
1
|
+
export{A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CollapsiblePanel,f as CopyButton,h as Cube,D as DateRangeCombo,i as DateRangeSelect,j as DisplayTerm,E as EditBillingForm,w as ElementsContext,x as ElementsProvider,k as ErrorFallback,F as FieldLabel,l as FormPortal,m as FundAndPurchase,H as HistoryCard,n as HistoryCardExtension,I as InlineLabel,o as ItemsBreakdown,L as LinkAction,p as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,q as SettingsCard,r as SkeletonCarrierRow,t as Spacer,u as Spread,T as Tabs,V as VatForm,W as WalletCard,v as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles,y as useElements}from"./warehouse-form-da6a7ac5.js";export{C as CarrierLogo}from"./carrier-logo-330e926f.js";export{C as CellFormattedDate,D as Drawer,G as GridController,P as Pager,S as SuspendText,u as usePager}from"./suspend-text-cad3a977.js";export{f as Field,S as StoryNotes}from"./story-notes-c714d2ed.js";export{P as Portal,R as RootPortalProvider,b as useAddressValidation,u as useCountryCodeOptions,c as useRootPortal,a as useStateCodeOptions,d as useToggle}from"./use-toggle-866d7938.js";export{C as Country,U as UsState,d as UsaCity,c as countries,a as countryCodes,e as euCountryCodes,p as postalCodeRegex,f as usCities,b as usStateCodes,u as usStates}from"./address-8f8119f4.js";export{e as LabelLayout,l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,d as ManageFunding,a as ManageWarehouses,p as PaymentMethodSettings,s as ShipmentsGrid,t as ThemeCreator,T as ThemeCreatorProvider,f as TransactionHistory,c as UnitSettings,u as useThemeCreator}from"./transaction-history-element-cbfe487c.js";export{c as CarrierServices,a as ConnectExternalCarrier,p as PurchaseLabel,s as ShipmentSummary,v as VoidLabel}from"./use-unit-settings-a5bae16e.js";export{e as extendZod}from"./zod-60def96c.js";export{P as PudoType,l as useBlackboxDetection,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,d as useInsuranceProviderOptions,m as useNestedForm,e as usePackageOptions,f as useRateOptions,n as useRunOnceOnTrue,o as useScrubErrors,g as useServiceCodeOptions,k as useServicePoints,h as useShipmentMetadata,i as useShippingPresetsOptions,j as useWarehouseOptions}from"./use-scrub-errors-9870a6f3.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as usePageLayout}from"./use-page-layout-8cb5075f.js";export{m as moneySchema}from"./money-d4f3d7c3.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone-87dd7bd8.js";export{a as assert,r as raise}from"./assertions-dfa95b4d.js";export{a as convertDimensions,c as createDictionary,f as formatDimensions,e as getCancelledShipment,b as getIsCustomsRequiredForShipment,g as getIsInternationalShipment,d as getPendingShipment,h as getShipmentByStatus,m as moveCustomsItemsToProducts}from"./shipment-150160e0.js";export{I as addEmailToValidation,q as calculateTotal,k as currencySymbol,e as daysAfter,a as findDateLocale,b as formatByDateAndLocale,r as formatCreditCardNumber,f as formatDate,c as formatDateDDMMYY,d as formatDateDDMMYYYY,t as formatExpiration,l as formatMoney,L as getCarrierIdByCarrierCode,u as getCurrencyFromString,v as getCurrencySymbolFromString,h as getExpirationYears,M as getLogoOrIconByCarrierCode,w as getRateRequiresAcknowledgement,j as getRelativeDates,x as getTotalRateAmount,g as getlocaleDateStringFormat,A as isCollectionService,B as isDomesticAddress,H as isEmptyAddress,C as isMilitaryAddress,i as isNowOrInTheFuture,F as isPoBox,G as isPoBoxAddress,z as isPudoEligibleRate,D as isUnitedStatesTerritory,E as isUnsupportedByUps,K as isUpsCarrier,J as isUspsCarrier,m as mostRecent,n as nextDayCutoff,o as omitTime,y as overrideCarrierCodes,p as parseLocaleDate,s as sortByCreationDate}from"./carrier-c2a5ed53.js";export{k as convertDecimalWeightToFractionalWeight,j as convertFractionalWeightToDecimalWeight,h as convertPoundsAndOuncesToOunces,l as convertWeight,c as createCodedErrors,m as formatFractionalWeight,g as getCustomsFromSalesOrder,o as getDefaultWarehouse,b as getIsCustomsRequiredForSalesOrder,d as getRequestedServices,e as getSalesOrderItemsFromSalesOrderOrShipment,f as isDecimalWeight,n as isFlatRatePackageCode,i as isMetricWeightUnit,a as throwAny,t as throwJoinedMessages}from"./warehouses-a83188ab.js";export{c as createStyles,d as deepMergeFeatures,e as errorMap,f as featureFlagComponentNameLookup,a as formLogger,g as getDefaultFeatures,i as isObject,b as isString,t as trackingStatusFormatter,v as validationResolver}from"./validation-528e7834.js";export{a as addSpaceBetweenWords,c as capitalizeFirstLetter,p as pascalize}from"./formatString-413ec7c7.js";export{a as AccountSettings,l as LabelWorkflow,o as Onboarding}from"./wallet-form-9e4bfaea.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"@emotion/react";import"@shipengine/giger-theme";import"@shipengine/react-api";import"lodash/isEqual";import"zod";import"copy-to-clipboard";import"js-base64";import"card-validator";import"libphonenumber-js/min";import"axios";import"lodash/omit";import"react-dom";import"@tanstack/react-query";import"lodash/merge";import"lodash/mergeWith";import"humps";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";import"lodash/orderBy";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get";import"@hookform/resolvers/zod";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as n}from"zod";import{SE as e}from"@shipengine/react-api";const r=n.object({amount:n.number().nonnegative(),currency:n.nativeEnum(e.Currency)});export{r as m};
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipengine/elements",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@shipengine/alchemy": "5.x.x",
|
|
6
5
|
"@emotion/react": "11.x",
|
|
7
6
|
"react-i18next": "11.x",
|
|
8
7
|
"i18next": "22.x",
|
|
@@ -59,6 +58,7 @@
|
|
|
59
58
|
"type": "module",
|
|
60
59
|
"types": "./src/index.d.ts",
|
|
61
60
|
"dependencies": {
|
|
61
|
+
"@emotion/cache": "11.10.5",
|
|
62
62
|
"@emotion/serialize": "1.1.1",
|
|
63
63
|
"@faker-js/faker": "7.6.0",
|
|
64
64
|
"@hookform/resolvers": "2.9.1",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"@shipengine/giger": "1.11.2",
|
|
70
70
|
"@shipengine/giger-theme": "1.5.1",
|
|
71
71
|
"@shipengine/js-api": "1.21.0",
|
|
72
|
+
"@shipengine/react-api": "2.11.8",
|
|
72
73
|
"@storybook/addons": "6.5.16",
|
|
73
74
|
"@storybook/components": "7.0.0-rc.1",
|
|
74
75
|
"@storybook/core-events": "7.0.0-rc.1",
|
|
@@ -77,17 +78,20 @@
|
|
|
77
78
|
"@tanstack/react-query": "4.36.1",
|
|
78
79
|
"@testing-library/dom": "8.19.0",
|
|
79
80
|
"@vitejs/plugin-react": "1.3.2",
|
|
80
|
-
"axios": "
|
|
81
|
+
"axios": "1.7.2",
|
|
81
82
|
"card-validator": "8.1.1",
|
|
83
|
+
"classnames": "2.5.1",
|
|
82
84
|
"copy-to-clipboard": "3.3.3",
|
|
83
85
|
"date-fns": "3.6.0",
|
|
84
86
|
"expect": "28.1.3",
|
|
85
87
|
"humps": "2.0.1",
|
|
88
|
+
"i18next-browser-languagedetector": "6.1.8",
|
|
86
89
|
"js-base64": "3.7.3",
|
|
87
90
|
"libphonenumber-js": "1.10.14",
|
|
88
91
|
"lodash": "4.17.21",
|
|
89
92
|
"react-hook-form": "7.40.0",
|
|
90
93
|
"rollup-plugin-copy": "3.4.0",
|
|
94
|
+
"stylis": "4.1.3",
|
|
91
95
|
"use-debounce": "10.0.0",
|
|
92
96
|
"zod": "3.19.1"
|
|
93
97
|
}
|
package/schemas.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{m as moneySchema}from"./money-
|
|
1
|
+
export{m as moneySchema}from"./money-d4f3d7c3.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone-87dd7bd8.js";import"zod";import"@shipengine/react-api";import"libphonenumber-js/min";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as s,D as t,s as e,_ as n}from"./carrier-
|
|
1
|
+
import{C as s,D as t,s as e,_ as n}from"./carrier-c2a5ed53.js";const o=(s,t)=>{var e;return null!==(e=null==s?void 0:s.reduce(((s,e)=>Object.assign(Object.assign({},s),t(e,s))),{}))&&void 0!==e?e:{}},i=s=>`${s.length} x ${s.width} x ${s.height} `;function a(s,{allowAllZeroes:t}={}){const{length:e,width:n,height:o,unit:i}=s;if(![e,n,o].every((s=>0===s))||t)return Object.assign(Object.assign({},s),{unit:null!=i?i:"inch"})}const u=({shipFrom:s,shipTo:t})=>(null==s?void 0:s.countryCode)!==(null==t?void 0:t.countryCode),c=({shipFrom:e,shipTo:n})=>e&&s(e)||n&&(s(n)||t(n))||(null==e?void 0:e.countryCode)!==(null==n?void 0:n.countryCode),l=s=>null==s?void 0:s.filter((s=>"pending"===s.shipmentStatus)).sort(e)[0],r=s=>null==s?void 0:s.filter((s=>"cancelled"===s.shipmentStatus)).sort(e)[0],d=(s,t)=>null==t?void 0:t.filter((({shipmentStatus:t})=>t===s)).sort(e)[0],m=s=>{var t,e;if(!(null===(e=null===(t=s.customs)||void 0===t?void 0:t.customsItems)||void 0===e?void 0:e.length))return s;const o=s.customs.customsItems.map((s=>Object.assign(Object.assign({},s),{value:s.value instanceof Object?s.value:{amount:s.value,currency:s.valueCurrency||"USD"}}))),i=s.customs,a=n(i,["customsItems"]);return Object.assign(Object.assign({},s),{customs:a,packages:s.packages.map(((s,t)=>0===t?Object.assign(Object.assign({},s),{products:o}):s))})};export{a,c as b,o as c,l as d,r as e,i as f,u as g,d as h,m};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SE } from "@shipengine/alchemy";
|
|
2
1
|
import { InputProps } from "@shipengine/giger";
|
|
2
|
+
import { SE } from "@shipengine/react-api";
|
|
3
3
|
import { ControlledField } from "../create-field-controller";
|
|
4
4
|
export declare const transform: {
|
|
5
5
|
in: ({ amount, currency }?: Partial<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SE } from "@shipengine/alchemy";
|
|
2
1
|
import { WithCommonProps } from "@shipengine/giger";
|
|
2
|
+
import type { SE } from "@shipengine/react-api";
|
|
3
3
|
import { RateOption } from "../../../hooks";
|
|
4
4
|
export type RateCardProps = Partial<RateOption> & WithCommonProps<{
|
|
5
5
|
isAcknowledged?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { SE } from "@shipengine/
|
|
2
|
+
import type { SE } from "@shipengine/react-api";
|
|
3
3
|
import { RateOption } from "../../../hooks";
|
|
4
4
|
import { RateFormProps } from "../../templates";
|
|
5
5
|
import { ControlledField } from "../create-field-controller";
|
package/src/components/templates/connect-external-carrier-form/connect-external-carrier-form.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RJSFSchema, UiSchema } from "@rjsf/utils";
|
|
2
|
+
export type ConnectExternalCarrierFormProps = {
|
|
3
|
+
carrierName: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
iconUrl: string;
|
|
6
|
+
isBeta?: boolean;
|
|
7
|
+
jsonSchema: RJSFSchema;
|
|
8
|
+
onCancel?: () => void;
|
|
9
|
+
onCarrierConnected?: (carrierId: string) => void;
|
|
10
|
+
uiSchema: UiSchema;
|
|
11
|
+
};
|
|
12
|
+
export declare const ConnectExternalCarrierForm: ({ carrierName, displayName, iconUrl, isBeta, jsonSchema, uiSchema, onCancel, onCarrierConnected, }: ConnectExternalCarrierFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./connect-external-carrier-form";
|
|
@@ -5,7 +5,7 @@ export * from "./address-parser";
|
|
|
5
5
|
export * from "./address-preference-display";
|
|
6
6
|
export * from "./address-preference-select";
|
|
7
7
|
export * from "./label";
|
|
8
|
-
export * from "../../features/
|
|
8
|
+
export * from "../../features/manage-carriers";
|
|
9
9
|
export * from "./product-form";
|
|
10
10
|
export * from "./rate-form";
|
|
11
11
|
export * from "./shipment-form";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { SE } from "@shipengine/
|
|
2
|
-
import { ConfigureShipmentFeatures } from "../../../elements/purchase-label/configure-shipment";
|
|
3
|
-
import { VatSettingsFeatures } from "../../../features";
|
|
1
|
+
import { SE } from "@shipengine/react-api";
|
|
4
2
|
import { ServicePointSearchQuery } from "../../../hooks";
|
|
5
3
|
import { PreferredRatesResponse } from "../../../types";
|
|
4
|
+
import { RateFormFeatures } from "../../../utilities";
|
|
6
5
|
export type RateFormProps = {
|
|
7
6
|
carriers?: SE.Carrier[];
|
|
8
7
|
currency: SE.Currency;
|
|
@@ -11,7 +10,7 @@ export type RateFormProps = {
|
|
|
11
10
|
displayableSaveRateErrors?: string[];
|
|
12
11
|
displayableShipmentErrors?: string[];
|
|
13
12
|
errors?: SE.CodedError[];
|
|
14
|
-
features?:
|
|
13
|
+
features?: RateFormFeatures;
|
|
15
14
|
fetchServicePoints: (searchQuery: string) => void;
|
|
16
15
|
isLoading?: boolean;
|
|
17
16
|
labelErrors?: string[];
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import { SE } from "@shipengine/
|
|
2
|
-
import {
|
|
1
|
+
import { SE } from "@shipengine/react-api";
|
|
2
|
+
import { ShipmentSummaryFeatures } from "../../../utilities";
|
|
3
3
|
export declare const schedulePickupForCarrier: (carrierCode?: string, plaftformSchedulePickupUrl?: string) => string | undefined;
|
|
4
|
-
export type ShipmentFeatures = {
|
|
5
|
-
presentation?: {
|
|
6
|
-
poweredByShipEngine?: boolean;
|
|
7
|
-
};
|
|
8
|
-
shipment?: {
|
|
9
|
-
schedulePickup?: boolean;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
4
|
export type ShipmentProps = {
|
|
13
5
|
carriers?: SE.Carrier[];
|
|
14
|
-
features?:
|
|
6
|
+
features?: ShipmentSummaryFeatures;
|
|
15
7
|
labels?: SE.Label[];
|
|
16
8
|
onClickPrintLabel?: () => void;
|
|
17
9
|
onClickPurchaseLabel?: (order: SE.SalesOrder) => void;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { SE } from "@shipengine/
|
|
2
|
+
import { SE } from "@shipengine/react-api";
|
|
3
3
|
import { UseShippingPresetsOptionsProps } from "../../../hooks";
|
|
4
4
|
import { ShippingPreset } from "../../../types";
|
|
5
|
+
import { ShipmentFormFeatures } from "../../../utilities";
|
|
5
6
|
import { AddressParserPayload } from "../address-parser";
|
|
6
7
|
import { AddressPreference, AddressPreferenceDisplayProps } from "../address-preference-display";
|
|
7
8
|
export type OnChangeAddressOptions = {
|
|
8
9
|
shouldValidate?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export type ShipmentFormMode = "browse_rates" | "select_service";
|
|
11
|
-
export type ShipmentFormFeatures = {
|
|
12
|
-
addOns?: boolean;
|
|
13
|
-
browseRates?: boolean;
|
|
14
|
-
includeShipsuranceInsurance?: boolean;
|
|
15
|
-
includeThirdPartyInsurance?: boolean;
|
|
16
|
-
selectService?: boolean;
|
|
17
|
-
shippingPresets?: boolean;
|
|
18
|
-
};
|
|
19
12
|
export type ShipmentFormProps = {
|
|
20
13
|
accountSettings?: SE.AccountSettings;
|
|
21
14
|
addressLoading: boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { SE } from "@shipengine/
|
|
2
|
-
import { VatSettingsFeatures } from "../../../features";
|
|
1
|
+
import { SE } from "@shipengine/react-api";
|
|
3
2
|
export type WalletFormFeatures = {};
|
|
4
3
|
export type WalletPayload = {
|
|
5
4
|
address: SE.Address;
|
|
@@ -9,7 +8,6 @@ export type WalletPayload = {
|
|
|
9
8
|
export type WalletFormProps = {
|
|
10
9
|
address: SE.Address;
|
|
11
10
|
errors?: SE.CodedError[] | null;
|
|
12
|
-
features?: VatSettingsFeatures;
|
|
13
11
|
onSubmit: (payload: WalletPayload) => Promise<void>;
|
|
14
12
|
};
|
|
15
|
-
export declare const WalletForm: ({ address, errors, onSubmit
|
|
13
|
+
export declare const WalletForm: ({ address, errors, onSubmit }: WalletFormProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { Provider } from "@shipengine/
|
|
2
|
+
import { Provider } from "@shipengine/react-api";
|
|
3
3
|
export declare const walletEmailSchemas: {
|
|
4
4
|
emailOptional: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
5
5
|
emailRequired: z.ZodString;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Theme } from "@emotion/react";
|
|
2
|
+
import { Interpolation } from "@emotion/serialize";
|
|
3
|
+
import { ElementComponent, ElementFallbackComponent, TranslationResources } from "./element";
|
|
4
|
+
export interface CreateElementOptions<T extends TranslationResources> {
|
|
5
|
+
css?: Interpolation<Theme>;
|
|
6
|
+
resources?: T;
|
|
7
|
+
}
|
|
8
|
+
export declare const createElement: <P extends object, T extends TranslationResources<import("./element").TranslationNamespaces>>(Component: ElementComponent<P>, fallback: ElementFallbackComponent, options?: CreateElementOptions<T> | undefined) => ({ resources, ...props }: P & {
|
|
9
|
+
resources?: T | undefined;
|
|
10
|
+
}) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WithConditionalCSSProp } from "@emotion/react/types/jsx-namespace";
|
|
3
|
+
import { TranslationResources } from "./hooks";
|
|
4
|
+
export type ElementComponentProps = object & WithConditionalCSSProp<object>;
|
|
5
|
+
export type ElementComponent<P extends ElementComponentProps> = React.ComponentType<P>;
|
|
6
|
+
export type ElementFallbackComponentProps = {
|
|
7
|
+
error: Error;
|
|
8
|
+
};
|
|
9
|
+
export type ElementFallbackComponent = React.ComponentType<ElementFallbackComponentProps>;
|
|
10
|
+
export interface ElementProps {
|
|
11
|
+
children: React.ReactElement<ElementComponentProps>;
|
|
12
|
+
className?: string;
|
|
13
|
+
fallback: ElementFallbackComponent;
|
|
14
|
+
resources?: TranslationResources;
|
|
15
|
+
}
|
|
16
|
+
export declare const Element: ({ children, className, fallback: FallbackComponent, resources, }: ElementProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./use-i18n";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type TranslationNamespaces = {
|
|
2
|
+
[key: string]: Record<string, any>;
|
|
3
|
+
common: Record<string, any>;
|
|
4
|
+
};
|
|
5
|
+
export type TranslationResources<Namespaces = TranslationNamespaces> = {
|
|
6
|
+
[key: string]: Namespaces;
|
|
7
|
+
en: Namespaces;
|
|
8
|
+
};
|
|
9
|
+
export interface UseI18nProps {
|
|
10
|
+
resources?: TranslationResources;
|
|
11
|
+
}
|
|
12
|
+
export declare const useI18n: ({ resources }: UseI18nProps) => import("i18next").i18n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./get-emotion-cache";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ElementsErrorHandler } from "../../elements-provider";
|
|
3
|
+
export interface ErrorProps {
|
|
4
|
+
error: Error;
|
|
5
|
+
}
|
|
6
|
+
export type ErrorBoundaryProps = {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
fallback: React.ComponentType<{
|
|
9
|
+
error: Error;
|
|
10
|
+
}>;
|
|
11
|
+
onError: ElementsErrorHandler;
|
|
12
|
+
};
|
|
13
|
+
type ErrorBoundaryState = {
|
|
14
|
+
error?: Error;
|
|
15
|
+
};
|
|
16
|
+
declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
17
|
+
constructor(props: ErrorBoundaryProps);
|
|
18
|
+
componentDidCatch(error: Error, context: React.ErrorInfo): void;
|
|
19
|
+
render(): string | number | boolean | React.ReactFragment | import("@emotion/react/jsx-runtime").JSX.Element | null | undefined;
|
|
20
|
+
}
|
|
21
|
+
export { ErrorBoundary };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./error-boundary";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./create-element";
|