@shipengine/elements 2.17.0 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/carrier.js +1 -1
  2. package/elements.js +1 -1
  3. package/index.js +1 -1
  4. package/package.json +4 -12
  5. package/src/components/grid-controller/grid-controller.d.ts +6 -2
  6. package/src/components/templates/theme-creator/theme-creator.d.ts +3 -2
  7. package/src/create-element/element/index.d.ts +0 -1
  8. package/src/elements/labels-grid/hooks/use-labels-grid.d.ts +6 -0
  9. package/src/elements/shipment-summary/shipment-summary.d.ts +1 -4
  10. package/src/elements/shipments-grid/shipments-grid.d.ts +1 -4
  11. package/src/elements/theme-creator/theme-creator.d.ts +4 -15
  12. package/src/elements/void-label/void-label.d.ts +18 -8
  13. package/src/elements-provider/elements-context-provider.d.ts +2 -2
  14. package/src/elements-provider/elements-provider.d.ts +1 -2
  15. package/src/hooks/insurance/use-manage-funding-source-insurance.d.ts +1 -0
  16. package/src/utilities/feature-flags/types.d.ts +4 -0
  17. package/src/utilities/storybook-local-storage-config.d.ts +12 -0
  18. package/src/workflows/connect-external-carrier/connect-external-carrier.d.ts +23 -24
  19. package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.d.ts +2 -1
  20. package/src/workflows/onboarding/onboarding.d.ts +38 -73
  21. package/transaction-history-element.js +1 -1
  22. package/use-configure-shipment.js +1 -1
  23. package/use-toggle.js +1 -1
  24. package/use-unit-settings.js +1 -1
  25. package/usePager.js +1 -1
  26. package/wallet-form.js +1 -1
  27. package/workflows.js +1 -1
  28. package/src/create-element/element/utils/get-emotion-cache.d.ts +0 -2
  29. package/src/create-element/element/utils/index.d.ts +0 -1
package/carrier.js CHANGED
@@ -1 +1 @@
1
- import{format as e}from"date-fns/format";import{ca as r,de as a,enAU as s,enGB as t,enUS as n,es as i,fr as l,it as o,pt as c}from"date-fns/locale";import{parse as d}from"date-fns/parse";import u from"lodash/get.js";import m from"humps";import{SE as p}from"@shipengine/react-api";import g from"lodash/isEqual.js";import h from"lodash/isNil.js";import v from"lodash/omit.js";import f from"lodash/omitBy.js";import{c as y,u as w,f as b}from"./address.js";function D(e,r){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(a[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(s=Object.getOwnPropertySymbols(e);t<s.length;t++)r.indexOf(s[t])<0&&Object.prototype.propertyIsEnumerable.call(e,s[t])&&(a[s[t]]=e[s[t]])}return a}function C(e,r,a,s){return new(a||(a=Promise))((function(t,n){function i(e){try{o(s.next(e))}catch(e){n(e)}}function l(e){try{o(s.throw(e))}catch(e){n(e)}}function o(e){var r;e.done?t(e.value):(r=e.value,r instanceof a?r:new a((function(e){e(r)}))).then(i,l)}o((s=s.apply(e,r||[])).next())}))}const L=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"numeric",month:"long",year:"numeric"}),S=(e="en-US")=>{const d=e.replaceAll("-",""),u=e.split("-")[0],m={ca:r,de:a,enAU:s,enGB:t,enUS:n,es:i,fr:l,it:o,pt:c};return m[d in m?d:u]},A=(r,a="en-US",s)=>{const t=S(a),n=j(a);return e(r,null!=s?s:n,{locale:t})},M=(e,r="en-US",a="P")=>{const s=S(r);return d(e,a,new Date,{locale:s})},U=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"2-digit",month:"2-digit",year:"2-digit"}),O=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"2-digit",month:"2-digit",year:"numeric"}),j=(e="en-US")=>{var r;return null===(r=(S(e)||S("en-US")).formatLong)||void 0===r?void 0:r.date({width:"short"})},F=(e,r=new Date)=>((r=new Date(r)).setDate(r.getDate()+e),r),z=(e,r=new Date)=>r.getHours()>=e?F(1,new Date(r)):new Date(r),I=(...e)=>new Date(Math.max(...e.map(Number))),_=e=>{const r=e?new Date(e):new Date;return new Date(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate())},x=e=>{const r=(new Date).getFullYear(),a=[];for(let s=0;s<e;s++)a.push(`${r+s}`);return a},P=(e,r,a="desc")=>{const[s,t]="asc"===a?[e,r]:[r,e];return new Date(s.createdAt).getTime()-new Date(t.createdAt).getTime()},E=e=>!!e&&("string"==typeof e?new Date(e):e)>=new Date,k=e=>{const r=null!=e?e:new Date;return{firstDayOfMonth:new Date(r.getFullYear(),r.getMonth(),1),lastDayOfTheMonth:new Date(r.getFullYear(),r.getMonth()+1,0),origin:r,previousMonthFirstDay:new Date(r.getFullYear(),r.getMonth()-1,1),previousMonthLastDay:new Date(r.getFullYear(),r.getMonth()-1+1,0),thirtyDaysAgo:new Date((new Date).setDate(r.getDate()-30))}},B={accountSettingsFeatures:{showCarrierServices:!0,showExternalCarriers:!1,showLabelLayout:!0,showManageWarehouses:!0,showUnitSettings:!0,showVatSettings:!0},globalFeatures:{enableParcelGuard:!0,isSandbox:!1,poweredByShipEngine:!0,showVatSettings:!1},labelsGridFeatures:{columns:[{allowFilter:!0,name:"labelId"},{name:"recipient"},{name:"shippingService"},{name:"createdDate"},{name:"trackingStatus"}],showActions:!0},purchaseLabelFeatures:{betaEnableWindsorFramework:!1,compatibleCountryCodes:["AU","CA","FR","DE","GB","IL","IT","NO","ES","SE","US"],enableErrorWhenShipmentCancelled:!1,partnerMessages:{incompleteLabelPurchaseRequirements:void 0},rateForm:{enableFunding:!0,enablePudoUI:!1,labelLayout:!1,nicknameRate:!0,requireDhlTermsAcknowledgement:!1,saveRate:!0},shipmentForm:{addOns:!0,browseRates:!0,includeCarrierInsurance:!1,includeShipsuranceInsurance:!0,includeThirdPartyInsurance:!1,selectService:!0,shippingPresets:!1,useWarehouses:!0}},shipmentSummaryFeatures:{schedulePickup:!0}},T=e=>{var r;return null!==(r={PurchaseLabel:"ConfigureSalesOrderShipment"}[e])&&void 0!==r?r:""},V=e=>e.map((e=>u(B,e))).reduce(((e,r)=>Object.assign(e,r))),R=e=>null!==e&&"object"==typeof e&&!Array.isArray(e);function $(e,r){const a=Object.assign({},e);return R(e)&&R(r)&&Object.keys(r).forEach((e=>{R(r[e])?(a[e]||Object.assign(a,{[e]:{}}),a[e]=$(a[e],r[e])):Object.assign(a,{[e]:r[e]})})),a}const Z=e=>e.slice(0,1).toUpperCase()+e.slice(1),G=e=>e.split(" ").map((e=>Z(e.toLowerCase()))).join(" "),q=e=>m.pascalize(e),N=e=>null==e?void 0:e.replace(/\s+/g,"-").toLowerCase(),Y=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/(?<=[a-zA-Z])(\d)/g," $1").trim(),H={aud:"$",cad:"$",eur:"€",gbp:"£",nzd:"$",usd:"$"},W=(e,r="en-US")=>Intl.NumberFormat(r,{currency:e.currency,style:"currency"}).format(e.amount),J=(...e)=>e.reduce(((e,r)=>{var a;return r?e+(null!==(a=r.amount)&&void 0!==a?a:0):e}),0),K=e=>[e.substring(0,4),e.substring(4,8),e.substring(8,12),e.substring(12)].join(" ").trim(),Q=e=>{const r=e.replace(/\//g,"");return r.length>2?[r.substring(0,2),r.substring(2,6)].join("/").trim():r},X=e=>{switch(null==e?void 0:e.toLowerCase()){case"usd":default:return p.Currency.USD;case"cad":return p.Currency.CAD;case"aud":return p.Currency.AUD;case"gbp":return p.Currency.GBP;case"eur":return p.Currency.EUR;case"nzd":return p.Currency.NZD}},ee=e=>{let r;switch(e){case p.Currency.USD:case p.Currency.CAD:case p.Currency.AUD:case p.Currency.NZD:r="$";break;case p.Currency.GBP:r="£‎";break;case p.Currency.EUR:r="€"}return r},re=(e,r,a)=>{switch(e){case"usps_media_mail":return!0;case"usps_first_class_mail":return"large_envelope_or_flat"===r;case"dhl_express_worldwide":return a;default:return!1}},ae=(e={})=>J(...Object.values(e)),se=(e,r)=>r[e]||e,te=e=>{var r;return"US"===e.countryCode||(null===(r=y.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnitedStatesTerritory)},ne=e=>{var r,a;return!(!(null===(r=w.find((r=>r.code===e.stateProvince)))||void 0===r?void 0:r.isMilitary)&&!(null===(a=b.find((r=>r.code===e.cityLocality)))||void 0===a?void 0:a.isMilitary))},ie=e=>{var r,a;return!(!(null===(r=y.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnitedStatesTerritory)&&!(null===(a=w.find((r=>r.code===e.stateProvince)))||void 0===a?void 0:a.isUnitedStatesTerritory))},le=e=>{var r;return!!(null===(r=y.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnsupportedByUps)},oe=/^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i,ce=e=>oe.test(e),de=e=>!!(ce(e.addressLine1)||e.addressLine2&&ce(e.addressLine2)),ue=e=>!e||Object.entries(e).every((([e,r])=>"countryCode"===e||[null,"","unknown"].includes(r))),me=(e,r)=>Object.assign(Object.assign(Object.assign({},e),e.matchedAddress&&{matchedAddress:Object.assign(Object.assign({},e.matchedAddress),{email:r})}),{originalAddress:Object.assign(Object.assign({},e.originalAddress),{email:r})}),pe=e=>{var r;if(e)return null!==(r=e.find((e=>e.isDefault)))&&void 0!==r?r:e[0]},ge=(e,r)=>{if(!e&&!r)return;const a={originAddress:f(v(null==e?void 0:e.shipFrom,["addressResidentialIndicator"]),h),returnAddress:f(v(null==e?void 0:e.returnTo,["addressResidentialIndicator"]),h)},s=null==r?void 0:r.find((e=>g(a,v(Object.assign(Object.assign({},e),void 0===e.returnAddress&&{returnAddress:e.originAddress}),["addressId","name","isDefault"]))));return(null==s?void 0:s.addressId)||"custom-shipment-address"},he=(e,r)=>{if(!e||!r)return;const a={originAddress:f(v(null==e?void 0:e.shipFrom,["addressResidentialIndicator"]),h),returnAddress:f(v(null==e?void 0:e.returnTo,["addressResidentialIndicator"]),h)};return null==r?void 0:r.some((e=>g(a,v(Object.assign(Object.assign({},e),void 0===e.returnAddress&&{returnAddress:e.originAddress}),["addressId","name","isDefault"]))))};const ve=["usps","stamps_com"],fe=e=>ve.includes(e),ye=e=>"ups"===e,we=e=>e.includes("yodel"),be=e=>"hermes"===e,De=(e=[],r)=>{const a=e.find((e=>e.carrierCode===r));return null==a?void 0:a.carrierId},Ce=(e,r)=>{var a;if("parcelguard"===e)return"logo"===r?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='55' height='55' fill='none'%3e%3cmask id='a' width='55' height='55' x='0' y='0' maskUnits='userSpaceOnUse' style='mask-type:alpha'%3e%3cpath fill='%23FFFFFE' fill-rule='evenodd' d='M55 0H0v55h55zM32.238 10.76H24.39V7.997h7.847zM2.39 40.477l48.324-6.693V12.967L2.39 19.618z' clip-rule='evenodd'/%3e%3c/mask%3e%3cg fill-rule='evenodd' clip-rule='evenodd' mask='url(%23a)'%3e%3cpath fill='%23BBAE92' d='M10.136 9.38v31.096l17.726 10.908 18.03-10.908V9.456z'/%3e%3cpath fill='%23343534' d='M8.087 6.742c.49-.271 1.111-.413 1.751-.413H46.19c.64 0 1.26.142 1.75.413.462.255.99.742.99 1.477v32.75c0 .602-.342 1.13-.691 1.496-.354.37-.823.693-1.342.902L30.024 53.77a1 1 0 0 1-.144.07c-.556.21-1.232.3-1.867.3-.634 0-1.31-.09-1.867-.3a1 1 0 0 1-.143-.07L9.13 43.367a3.9 3.9 0 0 1-1.34-.902c-.35-.366-.692-.894-.692-1.496V8.219c0-.735.528-1.222.99-1.477m.663 1.577.006-.009zm.023-.026a.7.7 0 0 1 .125-.085c.198-.11.529-.204.94-.204H46.19c.41 0 .742.094.94.204a.7.7 0 0 1 .125.085v32.676q0-.006-.002.002c-.008.025-.046.148-.227.338a2.2 2.2 0 0 1-.8.522 1 1 0 0 0-.144.07L29.22 52.298c-.308.103-.74.167-1.206.167s-.897-.064-1.205-.167L9.945 41.902a1 1 0 0 0-.143-.07 2.2 2.2 0 0 1-.8-.523c-.182-.19-.22-.313-.227-.337q-.003-.009-.002-.003zm38.505.026-.006-.009q.007.01.006.01'/%3e%3cpath fill='%23343534' d='M32.81 1.106a.84.84 0 0 1 1.1-.44l13.887 5.946a.838.838 0 1 1-.66 1.54L33.252 2.206a.84.84 0 0 1-.44-1.1M26.343 3.567a.84.84 0 0 1-.643.994L9.327 8.075a.838.838 0 0 1-.351-1.638l16.373-3.514a.84.84 0 0 1 .994.644M22.73 7.25c0-.463.375-.838.838-.838h9.51c.462 0 .837.375.837.838v4.26a.84.84 0 0 1-.837.838h-9.51a.84.84 0 0 1-.838-.838zm1.675.838v2.584h7.835V8.088z'/%3e%3c/g%3e%3cpath fill='%23343534' fill-rule='evenodd' d='M9.36 22.741c-.144-.233-.375-.323-.777-.268l-1.944.267.02 1.841 1.915-.263c.461-.064.69-.247.808-.486.068-.15.087-.306.084-.538-.003-.253-.035-.451-.107-.553m2.001 2.187c-.455.6-1.214.957-2.196 1.113-.3.05-2.455.326-2.455.326l.028 2.5-2.456.337-.089-7.992 4.901-.673c.962-.133 1.646-.014 2.092.38.466.342.724.996.735 1.987.01.89-.174 1.543-.56 2.022M15.859 22.324l-.168-.645-.153.71-.68 1.977 1.673-.23zm-2.186 5.59-2.526.346 3.018-8.418 3.117-.428 2.995 7.592-2.566.352-.6-1.62-2.836.39zM25.765 20.467c-.123-.237-.364-.284-.715-.236l-2.055.282.018 1.629 2.105-.29c.3-.041.56-.147.648-.352.059-.15.087-.367.085-.528-.002-.182-.024-.392-.086-.506m2.135 1.53c-.246.46-.604.761-.974.893l1.9 2.941-2.736.376-1.433-2.508-1.644.226.03 2.7-2.405.331-.09-7.991 5.042-.693c1.062-.146 1.757.062 2.164.543.315.362.471.878.48 1.627.007.647-.128 1.171-.334 1.555M36.824 23.03c-.538 1.26-1.643 2.04-3.778 2.333-1.473.202-2.55.026-3.248-.567-.67-.577-1.001-1.554-1.017-2.971-.014-1.274.275-2.297.87-3.057.692-.866 1.78-1.41 3.354-1.627 2.425-.333 3.497.432 3.86 1.506.156.445.213.995.216 1.308l-2.475.34a1.6 1.6 0 0 0-.22-.8c-.235-.373-.608-.525-1.39-.417-.662.09-1.08.33-1.346.752-.247.379-.331.948-.323 1.676.01.84.135 1.339.4 1.637.305.353.787.418 1.339.342.72-.098 1.11-.375 1.317-.697.187-.28.244-.56.26-.897l2.476-.34c-.016.326-.05.959-.295 1.479M37.965 24.575l-.089-7.991 6.765-.93.021 1.882-4.37.6.014 1.163 4.209-.578.02 1.901-4.208.579.013 1.183 4.42-.607.02 1.862zM45.913 23.483l-.09-7.991 2.476-.34.067 6.018 3.818-.525.023 1.973zM12.535 37.45l-.108-.654c-.505.597-1.264.964-2.356 1.114-1.443.199-2.542-.167-3.154-1.025-.377-.506-.628-1.444-.64-2.557-.012-1.001.149-1.935.612-2.708.561-.948 1.636-1.765 3.5-2.02 2.055-.283 3.175.272 3.648 1.261.164.332.26.846.264 1.19l-2.365.325c-.002-.203-.116-.45-.288-.62-.233-.23-.636-.338-1.147-.267-.621.085-1.051.276-1.328.668-.267.361-.4.937-.39 1.888.01.88.166 1.365.36 1.652.244.311.688.524 1.5.412.822-.113 1.438-.613 1.512-1.2l-.005-.426-1.984.273-.019-1.719 4.22-.58s.022 2.094.028 2.54c.01.98.033 2.142.034 2.193zM19.07 36.664c-2.185.3-3.858-.301-3.881-2.385l-.058-5.19 2.456-.337.057 5.088c.007.698.543 1.04 1.455.915.862-.119 1.418-.64 1.41-1.299 0-.151-.056-5.098-.056-5.098l2.445-.336.06 5.351c.02 1.862-1.613 2.978-3.888 3.29M27.9 30.05l-.169-.645-.152.71-.681 1.978 1.674-.23zm-2.187 5.59-2.526.346 3.018-8.418 3.117-.428 2.996 7.592-2.566.352-.6-1.62-2.836.39zM38.006 28.165c-.123-.236-.365-.284-.716-.236l-2.054.282.018 1.63 2.105-.29c.3-.041.56-.148.648-.353.059-.15.087-.366.085-.528-.002-.182-.025-.392-.086-.505m2.135 1.53c-.246.46-.604.762-.974.894l1.9 2.94-2.736.377-1.433-2.509-1.644.226.03 2.701-2.405.33-.09-7.99 5.042-.694c1.062-.145 1.757.063 2.164.544.315.362.471.877.48 1.626.007.648-.128 1.172-.334 1.555M47.074 28.55c-.007-.576-.075-1.306-.279-1.501-.314-.302-.605-.353-1.207-.27l-1.533.21.047 4.239 1.534-.21c.621-.086.95-.263 1.217-.624.208-.282.228-1.196.22-1.844m-.886 4.276-4.49.617-.09-7.992 4.37-.6c1.444-.198 2.34.033 2.838.653.499.61.596 1.266.613 2.722.018 1.7-.084 2.342-.518 3.07-.473.805-1.29 1.333-2.723 1.53' clip-rule='evenodd'/%3e%3cpath fill='%231A1919' fill-rule='evenodd' d='m50.974 40.244.198.625.195-.625h.45v1.086h-.288v-.786l-.236.786h-.245l-.236-.784v.784h-.288v-1.086zm-1.506.261v-.26h.959v.26h-.323v.825h-.317v-.825z' clip-rule='evenodd'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg width='21' height='20' viewBox='0 0 21 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M2.16675 3.33342V15.6721L9.969 19.7591C10.2574 19.9102 10.6014 19.9114 10.8909 19.7623L18.8334 15.6721V3.33343L2.16675 3.33342Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.58857 0.731017C8.7832 1.14808 8.60288 1.64395 8.18582 1.83857L2.93582 4.92191L2.16675 3.33342L7.48101 0.328269C7.89807 0.133641 8.39394 0.313958 8.58857 0.731017Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.4734 0.371172C11.7287 -0.0117689 12.2461 -0.115247 12.629 0.140047L18.8334 3.33343L17.9545 4.86013L11.7045 1.5268C11.3216 1.2715 11.2181 0.754112 11.4734 0.371172Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.83325 5V14.8709L10.4431 18.3333L17.1666 14.8709V5.02448L3.83325 5Z' fill='%23F9FAFB'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.8335 4.8335V14.8277L10.4432 18.3334L17.1665 14.8277V4.85828L3.8335 4.8335Z' fill='%23BBAE92'/%3e%3c/svg%3e";return`https://logos.shipstation.com/ipaas/carriers/${null!==(a={stamps_com:"stamps_com_wl",usps:"stamps_com_wl"}[e])&&void 0!==a?a:e}/${r}.svg`},Le=e=>!!e&&["GB","CA","US"].includes(e),Se=e=>"AU"===e,Ae=(e,r)=>null==e?void 0:e.filter((e=>"globalpost"===e.carrierCode?Le(r):"sendle_walleted"!==e.carrierCode||Se(r)));export{Se as $,J as A,K as B,Q as C,X as D,ee as E,re as F,ae as G,se as H,te as I,ne as J,ie as K,le as L,ce as M,de as N,ue as O,me as P,pe as Q,ge as R,he as S,fe as T,ye as U,we as V,be as W,De as X,Ce as Y,Le as Z,C as _,S as a,Ae as a0,D as a1,A as b,U as c,$ as d,O as e,L as f,V as g,j as h,F as i,x as j,E as k,k as l,I as m,z as n,_ as o,M as p,T as q,R as r,P as s,Z as t,G as u,q as v,N as w,Y as x,H as y,W as z};
1
+ import{format as e}from"date-fns/format";import{ca as r,de as a,enAU as s,enGB as t,enUS as n,es as i,fr as l,it as o,pt as c}from"date-fns/locale";import{parse as d}from"date-fns/parse";import u from"lodash/get.js";import m from"humps";import{SE as p}from"@shipengine/react-api";import h from"lodash/isEqual.js";import g from"lodash/isNil.js";import v from"lodash/omit.js";import f from"lodash/omitBy.js";import{c as w,u as y,f as b}from"./address.js";function D(e,r){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(a[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(s=Object.getOwnPropertySymbols(e);t<s.length;t++)r.indexOf(s[t])<0&&Object.prototype.propertyIsEnumerable.call(e,s[t])&&(a[s[t]]=e[s[t]])}return a}function C(e,r,a,s){return new(a||(a=Promise))((function(t,n){function i(e){try{o(s.next(e))}catch(e){n(e)}}function l(e){try{o(s.throw(e))}catch(e){n(e)}}function o(e){var r;e.done?t(e.value):(r=e.value,r instanceof a?r:new a((function(e){e(r)}))).then(i,l)}o((s=s.apply(e,r||[])).next())}))}const S=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"numeric",month:"long",year:"numeric"}),L=(e="en-US")=>{const d=e.replaceAll("-",""),u=e.split("-")[0],m={ca:r,de:a,enAU:s,enGB:t,enUS:n,es:i,fr:l,it:o,pt:c};return m[d in m?d:u]},M=(r,a="en-US",s)=>{const t=L(a),n=j(a);return e(r,null!=s?s:n,{locale:t})},A=(e,r="en-US",a="P")=>{const s=L(r);return d(e,a,new Date,{locale:s})},U=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"2-digit",month:"2-digit",year:"2-digit"}),O=(e,r="en-US")=>new Date(e).toLocaleDateString(r,{day:"2-digit",month:"2-digit",year:"numeric"}),j=(e="en-US")=>{var r;return null===(r=(L(e)||L("en-US")).formatLong)||void 0===r?void 0:r.date({width:"short"})},F=(e,r=new Date)=>((r=new Date(r)).setDate(r.getDate()+e),r),z=(e,r=new Date)=>r.getHours()>=e?F(1,new Date(r)):new Date(r),I=(...e)=>new Date(Math.max(...e.map(Number))),_=e=>{const r=e?new Date(e):new Date;return new Date(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate())},x=e=>{const r=(new Date).getFullYear(),a=[];for(let s=0;s<e;s++)a.push(`${r+s}`);return a},P=(e,r,a="desc")=>{const[s,t]="asc"===a?[e,r]:[r,e];return new Date(s.createdAt).getTime()-new Date(t.createdAt).getTime()},E=e=>!!e&&("string"==typeof e?new Date(e):e)>=new Date,k=e=>{const r=null!=e?e:new Date;return{firstDayOfMonth:new Date(r.getFullYear(),r.getMonth(),1),lastDayOfTheMonth:new Date(r.getFullYear(),r.getMonth()+1,0),origin:r,previousMonthFirstDay:new Date(r.getFullYear(),r.getMonth()-1,1),previousMonthLastDay:new Date(r.getFullYear(),r.getMonth()-1+1,0),thirtyDaysAgo:new Date((new Date).setDate(r.getDate()-30))}},B={accountSettingsFeatures:{showCarrierServices:!0,showExternalCarriers:!1,showLabelLayout:!0,showManageWarehouses:!0,showUnitSettings:!0,showVatSettings:!0},globalFeatures:{disableShadowDOM:!1,enableParcelGuard:!0,isSandbox:!1,poweredByShipEngine:!0,showVatSettings:!1},labelsGridFeatures:{columns:[{allowFilter:!0,name:"labelId"},{name:"recipient"},{name:"shippingService"},{name:"createdDate"},{name:"trackingStatus"}],showActions:!0},purchaseLabelFeatures:{betaEnableWindsorFramework:!1,compatibleCountryCodes:["AU","CA","FR","DE","GB","IL","IT","NO","ES","SE","US"],enableErrorWhenShipmentCancelled:!1,partnerMessages:{incompleteLabelPurchaseRequirements:void 0},rateForm:{enableFunding:!0,enablePudoUI:!1,labelLayout:!1,nicknameRate:!0,requireDhlTermsAcknowledgement:!1,saveRate:!0},shipmentForm:{addOns:!0,browseRates:!0,includeCarrierInsurance:!1,includeShipsuranceInsurance:!0,includeThirdPartyInsurance:!1,selectService:!0,shippingPresets:!1,useWarehouses:!0}},shipmentSummaryFeatures:{schedulePickup:!0}},T=e=>{var r;return null!==(r={PurchaseLabel:"ConfigureSalesOrderShipment"}[e])&&void 0!==r?r:""},V=e=>e.map((e=>u(B,e))).reduce(((e,r)=>Object.assign(e,r))),R=e=>null!==e&&"object"==typeof e&&!Array.isArray(e);function $(e,r){const a=Object.assign({},e);return R(e)&&R(r)&&Object.keys(r).forEach((e=>{R(r[e])?(a[e]||Object.assign(a,{[e]:{}}),a[e]=$(a[e],r[e])):Object.assign(a,{[e]:r[e]})})),a}const Z=e=>e.slice(0,1).toUpperCase()+e.slice(1),G=e=>e.split(" ").map((e=>Z(e.toLowerCase()))).join(" "),q=e=>m.pascalize(e),N=e=>null==e?void 0:e.replace(/\s+/g,"-").toLowerCase(),Y=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/(?<=[a-zA-Z])(\d)/g," $1").trim(),H={aud:"$",cad:"$",eur:"€",gbp:"£",nzd:"$",usd:"$"},W=(e,r="en-US")=>Intl.NumberFormat(r,{currency:e.currency,style:"currency"}).format(e.amount),J=(...e)=>e.reduce(((e,r)=>{var a;return r?e+(null!==(a=r.amount)&&void 0!==a?a:0):e}),0),K=e=>[e.substring(0,4),e.substring(4,8),e.substring(8,12),e.substring(12)].join(" ").trim(),Q=e=>{const r=e.replace(/\//g,"");return r.length>2?[r.substring(0,2),r.substring(2,6)].join("/").trim():r},X=e=>{switch(null==e?void 0:e.toLowerCase()){case"usd":default:return p.Currency.USD;case"cad":return p.Currency.CAD;case"aud":return p.Currency.AUD;case"gbp":return p.Currency.GBP;case"eur":return p.Currency.EUR;case"nzd":return p.Currency.NZD}},ee=e=>{let r;switch(e){case p.Currency.USD:case p.Currency.CAD:case p.Currency.AUD:case p.Currency.NZD:r="$";break;case p.Currency.GBP:r="£‎";break;case p.Currency.EUR:r="€"}return r},re=(e,r,a)=>{switch(e){case"usps_media_mail":return!0;case"usps_first_class_mail":return"large_envelope_or_flat"===r;case"dhl_express_worldwide":return a;default:return!1}},ae=(e={})=>J(...Object.values(e)),se=(e,r)=>r[e]||e,te=e=>{var r;return"US"===e.countryCode||(null===(r=w.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnitedStatesTerritory)},ne=e=>{var r,a;return!(!(null===(r=y.find((r=>r.code===e.stateProvince)))||void 0===r?void 0:r.isMilitary)&&!(null===(a=b.find((r=>r.code===e.cityLocality)))||void 0===a?void 0:a.isMilitary))},ie=e=>{var r,a;return!(!(null===(r=w.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnitedStatesTerritory)&&!(null===(a=y.find((r=>r.code===e.stateProvince)))||void 0===a?void 0:a.isUnitedStatesTerritory))},le=e=>{var r;return!!(null===(r=w.find((r=>r.code===e.countryCode)))||void 0===r?void 0:r.isUnsupportedByUps)},oe=/^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i,ce=e=>oe.test(e),de=e=>!!(ce(e.addressLine1)||e.addressLine2&&ce(e.addressLine2)),ue=e=>!e||Object.entries(e).every((([e,r])=>"countryCode"===e||[null,"","unknown"].includes(r))),me=(e,r)=>Object.assign(Object.assign(Object.assign({},e),e.matchedAddress&&{matchedAddress:Object.assign(Object.assign({},e.matchedAddress),{email:r})}),{originalAddress:Object.assign(Object.assign({},e.originalAddress),{email:r})}),pe=e=>{var r;if(e)return null!==(r=e.find((e=>e.isDefault)))&&void 0!==r?r:e[0]},he=(e,r)=>{if(!e&&!r)return;const a={originAddress:f(v(null==e?void 0:e.shipFrom,["addressResidentialIndicator"]),g),returnAddress:f(v(null==e?void 0:e.returnTo,["addressResidentialIndicator"]),g)},s=null==r?void 0:r.find((e=>h(a,v(Object.assign(Object.assign({},e),void 0===e.returnAddress&&{returnAddress:e.originAddress}),["addressId","name","isDefault"]))));return(null==s?void 0:s.addressId)||"custom-shipment-address"},ge=(e,r)=>{if(!e||!r)return;const a={originAddress:f(v(null==e?void 0:e.shipFrom,["addressResidentialIndicator"]),g),returnAddress:f(v(null==e?void 0:e.returnTo,["addressResidentialIndicator"]),g)};return null==r?void 0:r.some((e=>h(a,v(Object.assign(Object.assign({},e),void 0===e.returnAddress&&{returnAddress:e.originAddress}),["addressId","name","isDefault"]))))};const ve=["usps","stamps_com"],fe=e=>ve.includes(e),we=e=>"ups"===e,ye=e=>e.includes("yodel"),be=e=>"hermes"===e,De=(e=[],r)=>{const a=e.find((e=>e.carrierCode===r));return null==a?void 0:a.carrierId},Ce=(e,r)=>{var a;if("parcelguard"===e)return"logo"===r?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='55' height='55' fill='none'%3e%3cmask id='a' width='55' height='55' x='0' y='0' maskUnits='userSpaceOnUse' style='mask-type:alpha'%3e%3cpath fill='%23FFFFFE' fill-rule='evenodd' d='M55 0H0v55h55zM32.238 10.76H24.39V7.997h7.847zM2.39 40.477l48.324-6.693V12.967L2.39 19.618z' clip-rule='evenodd'/%3e%3c/mask%3e%3cg fill-rule='evenodd' clip-rule='evenodd' mask='url(%23a)'%3e%3cpath fill='%23BBAE92' d='M10.136 9.38v31.096l17.726 10.908 18.03-10.908V9.456z'/%3e%3cpath fill='%23343534' d='M8.087 6.742c.49-.271 1.111-.413 1.751-.413H46.19c.64 0 1.26.142 1.75.413.462.255.99.742.99 1.477v32.75c0 .602-.342 1.13-.691 1.496-.354.37-.823.693-1.342.902L30.024 53.77a1 1 0 0 1-.144.07c-.556.21-1.232.3-1.867.3-.634 0-1.31-.09-1.867-.3a1 1 0 0 1-.143-.07L9.13 43.367a3.9 3.9 0 0 1-1.34-.902c-.35-.366-.692-.894-.692-1.496V8.219c0-.735.528-1.222.99-1.477m.663 1.577.006-.009zm.023-.026a.7.7 0 0 1 .125-.085c.198-.11.529-.204.94-.204H46.19c.41 0 .742.094.94.204a.7.7 0 0 1 .125.085v32.676q0-.006-.002.002c-.008.025-.046.148-.227.338a2.2 2.2 0 0 1-.8.522 1 1 0 0 0-.144.07L29.22 52.298c-.308.103-.74.167-1.206.167s-.897-.064-1.205-.167L9.945 41.902a1 1 0 0 0-.143-.07 2.2 2.2 0 0 1-.8-.523c-.182-.19-.22-.313-.227-.337q-.003-.009-.002-.003zm38.505.026-.006-.009q.007.01.006.01'/%3e%3cpath fill='%23343534' d='M32.81 1.106a.84.84 0 0 1 1.1-.44l13.887 5.946a.838.838 0 1 1-.66 1.54L33.252 2.206a.84.84 0 0 1-.44-1.1M26.343 3.567a.84.84 0 0 1-.643.994L9.327 8.075a.838.838 0 0 1-.351-1.638l16.373-3.514a.84.84 0 0 1 .994.644M22.73 7.25c0-.463.375-.838.838-.838h9.51c.462 0 .837.375.837.838v4.26a.84.84 0 0 1-.837.838h-9.51a.84.84 0 0 1-.838-.838zm1.675.838v2.584h7.835V8.088z'/%3e%3c/g%3e%3cpath fill='%23343534' fill-rule='evenodd' d='M9.36 22.741c-.144-.233-.375-.323-.777-.268l-1.944.267.02 1.841 1.915-.263c.461-.064.69-.247.808-.486.068-.15.087-.306.084-.538-.003-.253-.035-.451-.107-.553m2.001 2.187c-.455.6-1.214.957-2.196 1.113-.3.05-2.455.326-2.455.326l.028 2.5-2.456.337-.089-7.992 4.901-.673c.962-.133 1.646-.014 2.092.38.466.342.724.996.735 1.987.01.89-.174 1.543-.56 2.022M15.859 22.324l-.168-.645-.153.71-.68 1.977 1.673-.23zm-2.186 5.59-2.526.346 3.018-8.418 3.117-.428 2.995 7.592-2.566.352-.6-1.62-2.836.39zM25.765 20.467c-.123-.237-.364-.284-.715-.236l-2.055.282.018 1.629 2.105-.29c.3-.041.56-.147.648-.352.059-.15.087-.367.085-.528-.002-.182-.024-.392-.086-.506m2.135 1.53c-.246.46-.604.761-.974.893l1.9 2.941-2.736.376-1.433-2.508-1.644.226.03 2.7-2.405.331-.09-7.991 5.042-.693c1.062-.146 1.757.062 2.164.543.315.362.471.878.48 1.627.007.647-.128 1.171-.334 1.555M36.824 23.03c-.538 1.26-1.643 2.04-3.778 2.333-1.473.202-2.55.026-3.248-.567-.67-.577-1.001-1.554-1.017-2.971-.014-1.274.275-2.297.87-3.057.692-.866 1.78-1.41 3.354-1.627 2.425-.333 3.497.432 3.86 1.506.156.445.213.995.216 1.308l-2.475.34a1.6 1.6 0 0 0-.22-.8c-.235-.373-.608-.525-1.39-.417-.662.09-1.08.33-1.346.752-.247.379-.331.948-.323 1.676.01.84.135 1.339.4 1.637.305.353.787.418 1.339.342.72-.098 1.11-.375 1.317-.697.187-.28.244-.56.26-.897l2.476-.34c-.016.326-.05.959-.295 1.479M37.965 24.575l-.089-7.991 6.765-.93.021 1.882-4.37.6.014 1.163 4.209-.578.02 1.901-4.208.579.013 1.183 4.42-.607.02 1.862zM45.913 23.483l-.09-7.991 2.476-.34.067 6.018 3.818-.525.023 1.973zM12.535 37.45l-.108-.654c-.505.597-1.264.964-2.356 1.114-1.443.199-2.542-.167-3.154-1.025-.377-.506-.628-1.444-.64-2.557-.012-1.001.149-1.935.612-2.708.561-.948 1.636-1.765 3.5-2.02 2.055-.283 3.175.272 3.648 1.261.164.332.26.846.264 1.19l-2.365.325c-.002-.203-.116-.45-.288-.62-.233-.23-.636-.338-1.147-.267-.621.085-1.051.276-1.328.668-.267.361-.4.937-.39 1.888.01.88.166 1.365.36 1.652.244.311.688.524 1.5.412.822-.113 1.438-.613 1.512-1.2l-.005-.426-1.984.273-.019-1.719 4.22-.58s.022 2.094.028 2.54c.01.98.033 2.142.034 2.193zM19.07 36.664c-2.185.3-3.858-.301-3.881-2.385l-.058-5.19 2.456-.337.057 5.088c.007.698.543 1.04 1.455.915.862-.119 1.418-.64 1.41-1.299 0-.151-.056-5.098-.056-5.098l2.445-.336.06 5.351c.02 1.862-1.613 2.978-3.888 3.29M27.9 30.05l-.169-.645-.152.71-.681 1.978 1.674-.23zm-2.187 5.59-2.526.346 3.018-8.418 3.117-.428 2.996 7.592-2.566.352-.6-1.62-2.836.39zM38.006 28.165c-.123-.236-.365-.284-.716-.236l-2.054.282.018 1.63 2.105-.29c.3-.041.56-.148.648-.353.059-.15.087-.366.085-.528-.002-.182-.025-.392-.086-.505m2.135 1.53c-.246.46-.604.762-.974.894l1.9 2.94-2.736.377-1.433-2.509-1.644.226.03 2.701-2.405.33-.09-7.99 5.042-.694c1.062-.145 1.757.063 2.164.544.315.362.471.877.48 1.626.007.648-.128 1.172-.334 1.555M47.074 28.55c-.007-.576-.075-1.306-.279-1.501-.314-.302-.605-.353-1.207-.27l-1.533.21.047 4.239 1.534-.21c.621-.086.95-.263 1.217-.624.208-.282.228-1.196.22-1.844m-.886 4.276-4.49.617-.09-7.992 4.37-.6c1.444-.198 2.34.033 2.838.653.499.61.596 1.266.613 2.722.018 1.7-.084 2.342-.518 3.07-.473.805-1.29 1.333-2.723 1.53' clip-rule='evenodd'/%3e%3cpath fill='%231A1919' fill-rule='evenodd' d='m50.974 40.244.198.625.195-.625h.45v1.086h-.288v-.786l-.236.786h-.245l-.236-.784v.784h-.288v-1.086zm-1.506.261v-.26h.959v.26h-.323v.825h-.317v-.825z' clip-rule='evenodd'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg width='21' height='20' viewBox='0 0 21 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M2.16675 3.33342V15.6721L9.969 19.7591C10.2574 19.9102 10.6014 19.9114 10.8909 19.7623L18.8334 15.6721V3.33343L2.16675 3.33342Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.58857 0.731017C8.7832 1.14808 8.60288 1.64395 8.18582 1.83857L2.93582 4.92191L2.16675 3.33342L7.48101 0.328269C7.89807 0.133641 8.39394 0.313958 8.58857 0.731017Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.4734 0.371172C11.7287 -0.0117689 12.2461 -0.115247 12.629 0.140047L18.8334 3.33343L17.9545 4.86013L11.7045 1.5268C11.3216 1.2715 11.2181 0.754112 11.4734 0.371172Z' fill='%23343534'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.83325 5V14.8709L10.4431 18.3333L17.1666 14.8709V5.02448L3.83325 5Z' fill='%23F9FAFB'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.8335 4.8335V14.8277L10.4432 18.3334L17.1665 14.8277V4.85828L3.8335 4.8335Z' fill='%23BBAE92'/%3e%3c/svg%3e";return`https://logos.shipstation.com/ipaas/carriers/${null!==(a={stamps_com:"stamps_com_wl",usps:"stamps_com_wl"}[e])&&void 0!==a?a:e}/${r}.svg`},Se=e=>!!e&&["GB","CA","US"].includes(e),Le=e=>"AU"===e,Me=(e,r)=>null==e?void 0:e.filter((e=>"globalpost"===e.carrierCode?Se(r):"sendle_walleted"!==e.carrierCode||Le(r)));export{Le as $,J as A,K as B,Q as C,X as D,ee as E,re as F,ae as G,se as H,te as I,ne as J,ie as K,le as L,ce as M,de as N,ue as O,me as P,pe as Q,he as R,ge as S,fe as T,we as U,ye as V,be as W,De as X,Ce as Y,Se as Z,C as _,L as a,Me as a0,D as a1,M as b,U as c,$ as d,O as e,S as f,V as g,j as h,F as i,x as j,E as k,k as l,I as m,z as n,_ as o,A as p,T as q,R as r,P as s,Z as t,G as u,q as v,N as w,Y as x,H as y,W as z};
package/elements.js CHANGED
@@ -1 +1 @@
1
- export{l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,f as ManageFunding,a as ManageWarehouses,h as PaymentMethodSettings,p as PurchaseLabel,g as SelectLabelLayout,d as ShipmentSummary,s as ShipmentsGrid,c as ThemeCreator,T as ThemeCreatorProvider,i as TransactionHistory,e as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{a as CarrierServices,v as VoidLabel}from"./use-unit-settings.js";import"@emotion/react/jsx-runtime";import"./actions-menu.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get.js";import"humps";import"@shipengine/react-api";import"lodash/isEqual.js";import"lodash/isNil.js";import"lodash/omit.js";import"lodash/omitBy.js";import"./address.js";import"date-fns/isToday";import"@shipengine/giger";import"./use-toggle.js";import"react";import"react-dom";import"@emotion/react";import"./validation.js";import"@hookform/resolvers/zod";import"zod";import"react-i18next";import"@shipengine/giger-theme";import"react-hook-form";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"card-validator";import"./zod.js";import"./use-configure-shipment.js";import"./warehouses.js";import"./canada-ddp.js";import"lodash/orderBy.js";import"@tanstack/react-query";import"./use-get-service-name.js";import"./usePager.js";import"react-use";import"date-fns/subDays";import"date-fns/formatISO";import"date-fns/isSameDay";import"date-fns/isWithinInterval";import"date-fns/setHours";import"date-fns/setMinutes";import"./vat.js";import"axios";import"lodash/merge.js";import"lodash/mergeWith.js";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase.js";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";
1
+ export{l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,f as ManageFunding,a as ManageWarehouses,h as PaymentMethodSettings,p as PurchaseLabel,g as SelectLabelLayout,d as ShipmentSummary,s as ShipmentsGrid,c as ThemeCreator,T as ThemeCreatorProvider,i as TransactionHistory,e as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{a as CarrierServices,v as VoidLabel}from"./use-unit-settings.js";import"@emotion/react/jsx-runtime";import"./actions-menu.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get.js";import"humps";import"@shipengine/react-api";import"lodash/isEqual.js";import"lodash/isNil.js";import"lodash/omit.js";import"lodash/omitBy.js";import"./address.js";import"date-fns/isToday";import"@shipengine/giger";import"./use-toggle.js";import"react";import"react-dom";import"@emotion/react";import"./validation.js";import"@hookform/resolvers/zod";import"zod";import"react-i18next";import"@shipengine/giger-theme";import"react-hook-form";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"card-validator";import"./zod.js";import"./use-configure-shipment.js";import"./warehouses.js";import"./canada-ddp.js";import"lodash/orderBy.js";import"@tanstack/react-query";import"./use-get-service-name.js";import"./usePager.js";import"react-use";import"date-fns/subDays";import"date-fns/formatISO";import"date-fns/isSameDay";import"date-fns/isWithinInterval";import"date-fns/setHours";import"date-fns/setMinutes";import"./vat.js";import"axios";import"lodash/merge.js";import"lodash/mergeWith.js";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase.js";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";
package/index.js CHANGED
@@ -1 +1 @@
1
- import{ShipEngine as _}from"@shipengine/react-api";export*from"@shipengine/react-api";export{y as Actions,x as ActionsMenu,A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CarrierLogo,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,E as EditBillingForm,l as ErrorFallback,F as FieldLabel,m as FormPortal,n as FundAndPurchase,H as HistoryCard,o as HistoryCardExtension,I as InlineLabel,p as ItemsBreakdown,L as LinkAction,q as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,r as SettingsCard,z as ShipFromAddressForm,t as SkeletonCarrierRow,u as Spacer,v as Spread,T as Tabs,V as VatForm,W as WalletCard,w as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./actions-menu.js";export{C as CellFormattedDate,D as Drawer,E as ErrorState,G as GridController,b as GridFilters,a as GridFooter,u as usePager}from"./usePager.js";export{f as Field,P as Pager,S as StoryNotes,a as SuspendText}from"./suspend-text.js";import{E as ee,R as se,a as ae}from"./use-toggle.js";export{a as ElementsContext,E as ElementsContextProvider,P as Portal,R as RootPortalProvider,c as useAddressValidation,u as useCountryCodeOptions,g as useElements,d as useNestedForm,e as useRootPortal,b as useStateCodeOptions,f as useToggle}from"./use-toggle.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.js";export{a as CarrierServices,b as ConnectExternalCarrier,v as VoidLabel,c as createElement}from"./use-unit-settings.js";import{t as re}from"./transaction-history-element.js";export{l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,f as ManageFunding,a as ManageWarehouses,h as PaymentMethodSettings,p as PurchaseLabel,g as SelectLabelLayout,d as ShipmentSummary,s as ShipmentsGrid,c as ThemeCreator,T as ThemeCreatorProvider,i as TransactionHistory,e as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{e as extendZod}from"./zod.js";export{P as PudoType,p as useBlackboxDetection,r as useConfigureShipment,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,n as useGetFundingSourceInsuranceProvider,s as useImportSalesOrder,d as useInsuranceProviderOptions,o as useManageFundingSourceInsurance,e as useMovementIndicatorOptions,f as usePackageOptions,g as useRateOptions,q as useScrubErrors,h as useServiceCodeOptions,l as useServicePoints,k as useShipFromAddressOptions,i as useShipmentMetadata,j as useShippingPresetsOptions,m as useWindsorFramework}from"./use-configure-shipment.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as useHelpers,b as usePageLayout}from"./use-page-layout.js";export{u as useGetServiceName}from"./use-get-service-name.js";export{u as useRunOnceOnTrue}from"./use-run-once-on-true.js";export{m as moneySchema}from"./money.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone.js";export{C as CanadaDeliveredDutyOptions}from"./canada-ddp.js";export{a as assert,r as raise}from"./assertions.js";export{g as getSellerIdFromToken,i as isOnboarded}from"./checks.js";export{d as convertDimensions,c as createDictionary,f as formatDimensions,n as getCancelledShipment,g as getCustomsFromSalesOrder,q as getDefaultWarehouse,e as getIsCustomsRequiredForSalesOrder,l as getIsCustomsRequiredForShipment,k as getIsInternationalShipment,m as getPendingShipment,h as getRequestedServices,j as getSalesOrderItemsFromSalesOrderOrShipment,o as getShipmentByStatus,r as getWarehouseById,b as isCollectionService,a as isPudoEligibleRate,i as isShippingServiceServiceDisabled,p as moveCustomsItemsToProducts}from"./warehouses.js";import{_ as te,g as oe,d as ie}from"./carrier.js";export{P as addEmailToValidation,x as addSpaceBetweenWords,A as calculateTotal,t as capitalizeFirstLetter,u as capitalizeFirstLetterOfEachWord,y as currencySymbol,i as daysAfter,d as deepMergeFeatures,q as featureFlagComponentNameLookup,a0 as filterFundingSourceCarriers,a as findDateLocale,b as formatByDateAndLocale,B as formatCreditCardNumber,f as formatDate,c as formatDateDDMMYY,e as formatDateDDMMYYYY,C as formatExpiration,z as formatMoney,X as getCarrierIdByCarrierCode,D as getCurrencyFromString,E as getCurrencySymbolFromString,g as getDefaultFeatures,Q as getDefaultShipFromAddress,j as getExpirationYears,S as getIsShipmentUsingSavedShipFromAddress,Y as getLogoOrIconByCarrierCode,F as getRateRequiresAcknowledgement,l as getRelativeDates,R as getSavedShipFromAddressId,G as getTotalRateAmount,h as getlocaleDateStringFormat,I as isDomesticAddress,O as isEmptyAddress,W as isEvriCarrier,Z as isGlobalPostEligible,J as isMilitaryAddress,k as isNowOrInTheFuture,r as isObject,M as isPoBox,N as isPoBoxAddress,$ as isSendleEligible,K as isUnitedStatesTerritory,L as isUnsupportedByUps,U as isUpsCarrier,T as isUspsCarrier,V as isYodelCarrier,m as mostRecent,n as nextDayCutoff,o as omitTime,H as overrideCarrierCodes,p as parseLocaleDate,v as pascalize,w as replaceSpacesWithDashes,s as sortByCreationDate}from"./carrier.js";export{N as NO_VAT_COUNTRIES,f as convertDecimalWeightToFractionalWeight,e as convertFractionalWeightToDecimalWeight,d as convertPoundsAndOuncesToOunces,g as convertWeight,c as createCodedErrors,h as formatFractionalWeight,n as formatTrackingNumber,k as getInsuranceProviderWithFriendlyName,l as getIsInsuraceProviderAccepted,o as getIsVatRequired,b as isDecimalWeight,j as isFlatRatePackageCode,i as isMetricWeightUnit,a as throwAny,t as throwJoinedMessages,m as trackingStatusFormatter}from"./vat.js";export{a as aggregateRateDetailItems,c as calculateRateDetailBreakdown,b as createStyles,e as errorMap,f as formLogger,i as isString,s as scopeTheme,v as validationResolver}from"./validation.js";export{a as AccountSettings,l as LabelWorkflow,o as Onboarding}from"./wallet-form.js";import{jsx as ne}from"@emotion/react/jsx-runtime";import{useCallback as me,useMemo as de}from"react";import{THEME_ID as le,GigerProvider as ce,GigerTestProvider as pe}from"@shipengine/giger";import{Theme as ue}from"@shipengine/giger-theme";import ge from"axios";import"date-fns/isToday";import"@emotion/react";import"react-i18next";import"lodash/isEqual.js";import"react-hook-form";import"zod";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit.js";import"card-validator";import"react-use";import"date-fns/subDays";import"react-dom";import"humps";import"lodash/merge.js";import"@tanstack/react-query";import"lodash/mergeWith.js";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase.js";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"@emotion/cache";import"stylis";import"date-fns/formatISO";import"date-fns/isSameDay";import"date-fns/isWithinInterval";import"date-fns/setHours";import"date-fns/setMinutes";import"lodash/orderBy.js";import"jwt-decode";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get.js";import"lodash/isNil.js";import"lodash/omitBy.js";import"@hookform/resolvers/zod";const he=({baseURL:e="https://elements.shipengine.com",cdnURL:s="https://cdn.packlink.com",children:a,container:r,features:t,getToken:o,headers:i,locale:n,onApiError:m,onError:d=(()=>{}),scope:l="lmnt",themeConfig:c,defaultQueryClientOptions:p,emotionCacheShadowRootContainer:u})=>{const g=(({cdnURL:e})=>me((s=>te(void 0,void 0,void 0,(function*(){return(yield ge.get(`/brand/fallback/icons/${s.toLowerCase()}.svg`,{baseURL:e,responseType:"text"})).data}))),[e]))({cdnURL:s}),h=de((()=>{var e;const s=new ue(null!==(e=c&&le in c?c[le]:c)&&void 0!==e?e:re.fallback);return c&&le in c?{[le]:s}:s}),[c]),f={baseURL:e,cdnURL:s,container:r,emotionCacheShadowRootContainer:u,features:t,getToken:o,locale:n,onError:d,scope:l,theme:h};return ne(ee,Object.assign({},f,{children:ne(ce,Object.assign({cdnUrl:s,emotionCacheShadowRootContainer:u,reference:u||l||void 0,resolveIcon:g,theme:h},{children:ne(_,Object.assign({baseURL:e,defaultQueryClientOptions:p,getToken:o,headers:i,onApiError:m},{children:ne(se,Object.assign({emotionCacheShadowRootContainer:u},{children:a}))}))}))}))},fe=({baseURL:e,children:s,features:a})=>{const r=de((()=>new ue),[]),t=oe(["globalFeatures"]),o=me((()=>"none"),[]),i={baseURL:e,cdnURL:"mockCdnUrl",getFeatures:e=>{var s;return ie(null!==(s=oe([e]))&&void 0!==s?s:{},null==a?void 0:a[e])},getToken:o,globalFeatures:Object.assign(Object.assign({enabledExternalCarriers:["apc","asendia","better_trucks","canpar","chronopost","couriers_please","courierpost","dpd","hermes_germany","intelliquick_delivery","lso","ontrac","seko","ups","yodel"]},t),a.globalFeatures),onError:()=>{},scope:"lmnt",theme:r};return ne(ae.Provider,Object.assign({value:i},{children:ne(pe,Object.assign({theme:r},{children:ne(_,Object.assign({baseURL:e,getToken:o},{children:s}))}))}))};export{he as ElementsProvider,fe as ElementsTestProvider};
1
+ import{ShipEngine as _}from"@shipengine/react-api";export*from"@shipengine/react-api";export{y as Actions,x as ActionsMenu,A as AddFundsForm,a as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,c as CarrierConnectionCard,d as CarrierIcon,e as CarrierLogo,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,E as EditBillingForm,l as ErrorFallback,F as FieldLabel,m as FormPortal,n as FundAndPurchase,H as HistoryCard,o as HistoryCardExtension,I as InlineLabel,p as ItemsBreakdown,L as LinkAction,q as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,r as SettingsCard,z as ShipFromAddressForm,t as SkeletonCarrierRow,u as Spacer,v as Spread,T as Tabs,V as VatForm,W as WalletCard,w as WarehouseForm,b as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./actions-menu.js";export{C as CellFormattedDate,D as Drawer,E as ErrorState,G as GridController,b as GridFilters,a as GridFooter,u as usePager}from"./usePager.js";export{f as Field,P as Pager,S as StoryNotes,a as SuspendText}from"./suspend-text.js";import{E as ee,R as ae,a as se}from"./use-toggle.js";export{a as ElementsContext,E as ElementsContextProvider,P as Portal,R as RootPortalProvider,c as useAddressValidation,u as useCountryCodeOptions,g as useElements,d as useNestedForm,e as useRootPortal,b as useStateCodeOptions,f as useToggle}from"./use-toggle.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.js";export{a as CarrierServices,b as ConnectExternalCarrier,v as VoidLabel,c as createElement}from"./use-unit-settings.js";import{t as re}from"./transaction-history-element.js";export{l as LabelsGrid,m as ManageCarriers,b as ManageExternalCarriers,f as ManageFunding,a as ManageWarehouses,h as PaymentMethodSettings,p as PurchaseLabel,g as SelectLabelLayout,d as ShipmentSummary,s as ShipmentsGrid,c as ThemeCreator,T as ThemeCreatorProvider,i as TransactionHistory,e as UnitSettings,u as useThemeCreator}from"./transaction-history-element.js";export{e as extendZod}from"./zod.js";export{P as PudoType,p as useBlackboxDetection,r as useConfigureShipment,u as useConfirmationOptions,a as useCustomsContentsOptions,b as useCustomsNonDeliveryOptions,c as useDateRangeOptions,n as useGetFundingSourceInsuranceProvider,s as useImportSalesOrder,d as useInsuranceProviderOptions,o as useManageFundingSourceInsurance,e as useMovementIndicatorOptions,f as usePackageOptions,g as useRateOptions,q as useScrubErrors,h as useServiceCodeOptions,l as useServicePoints,k as useShipFromAddressOptions,i as useShipmentMetadata,j as useShippingPresetsOptions,m as useWindsorFramework}from"./use-configure-shipment.js";export{P as PageLayoutProvider,u as useExpirationMonthOptions,a as useHelpers,b as usePageLayout}from"./use-page-layout.js";export{u as useGetServiceName}from"./use-get-service-name.js";export{u as useRunOnceOnTrue}from"./use-run-once-on-true.js";export{m as moneySchema}from"./money.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone.js";export{C as CanadaDeliveredDutyOptions}from"./canada-ddp.js";export{a as assert,r as raise}from"./assertions.js";export{g as getSellerIdFromToken,i as isOnboarded}from"./checks.js";export{d as convertDimensions,c as createDictionary,f as formatDimensions,n as getCancelledShipment,g as getCustomsFromSalesOrder,q as getDefaultWarehouse,e as getIsCustomsRequiredForSalesOrder,l as getIsCustomsRequiredForShipment,k as getIsInternationalShipment,m as getPendingShipment,h as getRequestedServices,j as getSalesOrderItemsFromSalesOrderOrShipment,o as getShipmentByStatus,r as getWarehouseById,b as isCollectionService,a as isPudoEligibleRate,i as isShippingServiceServiceDisabled,p as moveCustomsItemsToProducts}from"./warehouses.js";import{_ as te,g as oe,d as ie}from"./carrier.js";export{P as addEmailToValidation,x as addSpaceBetweenWords,A as calculateTotal,t as capitalizeFirstLetter,u as capitalizeFirstLetterOfEachWord,y as currencySymbol,i as daysAfter,d as deepMergeFeatures,q as featureFlagComponentNameLookup,a0 as filterFundingSourceCarriers,a as findDateLocale,b as formatByDateAndLocale,B as formatCreditCardNumber,f as formatDate,c as formatDateDDMMYY,e as formatDateDDMMYYYY,C as formatExpiration,z as formatMoney,X as getCarrierIdByCarrierCode,D as getCurrencyFromString,E as getCurrencySymbolFromString,g as getDefaultFeatures,Q as getDefaultShipFromAddress,j as getExpirationYears,S as getIsShipmentUsingSavedShipFromAddress,Y as getLogoOrIconByCarrierCode,F as getRateRequiresAcknowledgement,l as getRelativeDates,R as getSavedShipFromAddressId,G as getTotalRateAmount,h as getlocaleDateStringFormat,I as isDomesticAddress,O as isEmptyAddress,W as isEvriCarrier,Z as isGlobalPostEligible,J as isMilitaryAddress,k as isNowOrInTheFuture,r as isObject,M as isPoBox,N as isPoBoxAddress,$ as isSendleEligible,K as isUnitedStatesTerritory,L as isUnsupportedByUps,U as isUpsCarrier,T as isUspsCarrier,V as isYodelCarrier,m as mostRecent,n as nextDayCutoff,o as omitTime,H as overrideCarrierCodes,p as parseLocaleDate,v as pascalize,w as replaceSpacesWithDashes,s as sortByCreationDate}from"./carrier.js";export{N as NO_VAT_COUNTRIES,f as convertDecimalWeightToFractionalWeight,e as convertFractionalWeightToDecimalWeight,d as convertPoundsAndOuncesToOunces,g as convertWeight,c as createCodedErrors,h as formatFractionalWeight,n as formatTrackingNumber,k as getInsuranceProviderWithFriendlyName,l as getIsInsuraceProviderAccepted,o as getIsVatRequired,b as isDecimalWeight,j as isFlatRatePackageCode,i as isMetricWeightUnit,a as throwAny,t as throwJoinedMessages,m as trackingStatusFormatter}from"./vat.js";export{a as aggregateRateDetailItems,c as calculateRateDetailBreakdown,b as createStyles,e as errorMap,f as formLogger,i as isString,s as scopeTheme,v as validationResolver}from"./validation.js";export{a as AccountSettings,l as LabelWorkflow,o as Onboarding}from"./wallet-form.js";import{jsx as ne}from"@emotion/react/jsx-runtime";import{useCallback as de,useMemo as me,useRef as le,useState as ce,useEffect as ue}from"react";import{createPortal as pe}from"react-dom";import{THEME_ID as ge,GigerProvider as he,GigerTestProvider as fe}from"@shipengine/giger";import{Theme as Ce}from"@shipengine/giger-theme";import Se from"axios";import"date-fns/isToday";import"@emotion/react";import"react-i18next";import"lodash/isEqual.js";import"react-hook-form";import"zod";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit.js";import"card-validator";import"react-use";import"date-fns/subDays";import"humps";import"lodash/merge.js";import"@tanstack/react-query";import"lodash/mergeWith.js";import"@shipengine/js-api";import"@rjsf/core";import"@rjsf/validator-ajv8";import"lodash/camelCase.js";import"use-debounce";import"classnames";import"i18next";import"i18next-browser-languagedetector";import"date-fns/formatISO";import"date-fns/isSameDay";import"date-fns/isWithinInterval";import"date-fns/setHours";import"date-fns/setMinutes";import"lodash/orderBy.js";import"jwt-decode";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get.js";import"lodash/isNil.js";import"lodash/omitBy.js";import"@hookform/resolvers/zod";const be=({baseURL:e="https://elements.shipengine.com",cdnURL:a="https://cdn.packlink.com",children:s,container:r,features:t,getToken:o,headers:i,locale:n,onApiError:d,onError:m=(()=>{}),scope:l="lmnt",themeConfig:c,defaultQueryClientOptions:u,emotionCacheShadowRootContainer:p})=>{var g;const h=(({cdnURL:e})=>de((a=>te(void 0,void 0,void 0,(function*(){return(yield Se.get(`/brand/fallback/icons/${a.toLowerCase()}.svg`,{baseURL:e,responseType:"text"})).data}))),[e]))({cdnURL:a}),f=me((()=>{var e;const a=new Ce(null!==(e=c&&ge in c?c[ge]:c)&&void 0!==e?e:re.fallback);return c&&ge in c?{[ge]:a}:a}),[c]),C=le(null),[S,b]=ce(),v="attachShadow"in HTMLElement.prototype&&!(null===(g=null==t?void 0:t.globalFeatures)||void 0===g?void 0:g.disableShadowDOM);ue((()=>{var e;v&&(!r||r instanceof ShadowRoot||r.shadowRoot?p?b(p):C.current&&!(null===(e=C.current)||void 0===e?void 0:e.shadowRoot)&&b(C.current.attachShadow({mode:"open"})):b(r.attachShadow({mode:"open"})))}),[p,C,r,v]);const y={baseURL:e,cdnURL:a,container:r,emotionCacheShadowRootContainer:S,features:t,getToken:o,locale:n,onError:m,scope:l,theme:f},j=ne(ee,Object.assign({},y,{children:ne(he,Object.assign({cdnUrl:a,emotionCacheShadowRootContainer:S,reference:l||void 0,resolveIcon:h,theme:f},{children:ne(_,Object.assign({baseURL:e,defaultQueryClientOptions:u,getToken:o,headers:i,onApiError:d},{children:ne(ae,Object.assign({emotionCacheShadowRootContainer:S},{children:s}))}))}))}));return v?r?S?pe(j,S):null:ne("div",Object.assign({id:"elements-container",ref:C},{children:S&&pe(j,S)})):j},ve=({baseURL:e,children:a,features:s})=>{const r=me((()=>new Ce),[]),t=oe(["globalFeatures"]),o=de((()=>"none"),[]),i={baseURL:e,cdnURL:"mockCdnUrl",getFeatures:e=>{var a;return ie(null!==(a=oe([e]))&&void 0!==a?a:{},null==s?void 0:s[e])},getToken:o,globalFeatures:Object.assign(Object.assign({enabledExternalCarriers:["apc","asendia","better_trucks","canpar","chronopost","couriers_please","courierpost","dpd","hermes_germany","intelliquick_delivery","lso","ontrac","seko","ups","yodel"]},t),s.globalFeatures),onError:()=>{},scope:"lmnt",theme:r};return ne(se.Provider,Object.assign({value:i},{children:ne(fe,Object.assign({theme:r},{children:ne(_,Object.assign({baseURL:e,getToken:o},{children:a}))}))}))};export{be as ElementsProvider,ve as ElementsTestProvider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "peerDependencies": {
5
5
  "@emotion/react": "11.x",
6
6
  "react-i18next": "11.x",
@@ -31,26 +31,19 @@
31
31
  "type": "module",
32
32
  "types": "./src/index.d.ts",
33
33
  "dependencies": {
34
- "@emotion/cache": "11.10.5",
35
34
  "@emotion/serialize": "1.1.1",
36
35
  "@hookform/resolvers": "2.9.11",
37
36
  "@jest/globals": "28.1.3",
38
37
  "@rjsf/core": "5.16.1",
39
38
  "@rjsf/utils": "5.16.1",
40
39
  "@rjsf/validator-ajv8": "5.16.1",
41
- "@shipengine/giger": "1.20.8",
42
- "@shipengine/giger-theme": "1.7.1",
40
+ "@shipengine/giger": "1.20.11",
41
+ "@shipengine/giger-theme": "1.8.0",
43
42
  "@shipengine/js-api": "3.2.0",
44
43
  "@shipengine/react-api": "3.8.3",
45
- "@storybook/addons": "6.5.16",
46
- "@storybook/api": "6.5.16",
47
- "@storybook/components": "7.0.0-rc.1",
48
- "@storybook/core-events": "7.0.0-rc.1",
49
- "@storybook/manager-api": "7.0.0-rc.1",
50
- "@storybook/theming": "7.0.0-rc.1",
51
44
  "@tanstack/react-query": "4.36.1",
52
45
  "@testing-library/dom": "8.19.0",
53
- "axios": "1.7.2",
46
+ "axios": "1.7.4",
54
47
  "card-validator": "8.1.1",
55
48
  "classnames": "2.5.1",
56
49
  "copy-to-clipboard": "3.3.3",
@@ -65,7 +58,6 @@
65
58
  "react-hook-form": "7.40.0",
66
59
  "react-use": "17.4.2",
67
60
  "rollup-plugin-copy": "3.4.0",
68
- "stylis": "4.1.3",
69
61
  "use-debounce": "10.0.0",
70
62
  "zod": "3.19.1"
71
63
  }
@@ -1,8 +1,12 @@
1
+ import { Interpolation, Theme } from "@emotion/react";
1
2
  import { ReactNode } from "react";
2
3
  export type ColumnProps<T> = {
3
4
  headerContent: ReactNode;
4
5
  renderCellContent: (data: T) => ReactNode;
5
6
  };
7
+ type GridDataType = object & {
8
+ bodyCellStyles?: Interpolation<Theme>;
9
+ };
6
10
  /**
7
11
  * @internal
8
12
  *
@@ -10,7 +14,7 @@ export type ColumnProps<T> = {
10
14
  *
11
15
  * @see {@link GridController | The `<GridController />` component}
12
16
  */
13
- type GridProps<T extends object> = {
17
+ type GridProps<T extends GridDataType> = {
14
18
  columns: ColumnProps<T>[];
15
19
  data: T[];
16
20
  emptyContent?: ReactNode;
@@ -28,5 +32,5 @@ type GridProps<T extends object> = {
28
32
  *
29
33
  * @see {@link GridProps | The props for the `<GridController />` component}
30
34
  */
31
- export declare const GridController: <T extends object>({ columns, data, footerContent, onRowClick, useCheckboxes, filters, emptyContent, }: GridProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
35
+ export declare const GridController: <T extends GridDataType>({ columns, data, footerContent, onRowClick, useCheckboxes, filters, emptyContent, }: GridProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
32
36
  export {};
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { EmotionJSX } from "@emotion/react/types/jsx-namespace";
2
3
  import { CustomThemeData } from "@shipengine/giger-theme";
3
4
  export type ThemeCreatorProps = {
4
5
  allowPaste?: boolean;
@@ -8,9 +9,9 @@ export type ThemeCreatorProps = {
8
9
  themeConfig: CustomThemeData;
9
10
  }[];
10
11
  showDrawer?: {
11
- content?: React.ReactNode;
12
+ content: () => EmotionJSX.Element | React.ReactNode;
12
13
  copyToClipboardText?: string;
13
14
  };
14
15
  themeConfig: CustomThemeData;
15
16
  };
16
- export declare const ThemeCreator: ({ themeConfig, onUpdateThemeConfig, presets, showDrawer, }: ThemeCreatorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
17
+ export declare const ThemeCreator: ({ themeConfig, onUpdateThemeConfig, presets, showDrawer, }: ThemeCreatorProps) => EmotionJSX.Element;
@@ -1,3 +1,2 @@
1
1
  export * from "./element";
2
2
  export * from "./hooks";
3
- export * from "./utils";
@@ -9,6 +9,9 @@ export declare const useLabelsGrid: ({ labelStatus, showShipmentIdFilter, showLa
9
9
  clearAllFilters: () => void;
10
10
  filters: IGridFilters;
11
11
  getGridData: () => {
12
+ bodyCellStyles: {
13
+ color: string | undefined;
14
+ };
12
15
  serviceName: string | null | undefined;
13
16
  alternativeIdentifiers?: string[] | undefined;
14
17
  batchId: string;
@@ -58,6 +61,9 @@ export declare const useLabelsGrid: ({ labelStatus, showShipmentIdFilter, showLa
58
61
  isError: boolean;
59
62
  isLoading: boolean;
60
63
  labels: {
64
+ bodyCellStyles: {
65
+ color: string | undefined;
66
+ };
61
67
  serviceName: string | null | undefined;
62
68
  alternativeIdentifiers?: string[] | undefined;
63
69
  batchId: string;
@@ -712,10 +712,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
712
712
  voided: string;
713
713
  error: string;
714
714
  completed: string;
715
- processing: string; /**
716
- * `onClickPrintLabel` is a callback function that will be invoked when the user clicks the
717
- * `Print Label` button.
718
- */
715
+ processing: string;
719
716
  };
720
717
  trackingStatus: {
721
718
  unknown: string;
@@ -710,10 +710,7 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & {
710
710
  button: string;
711
711
  };
712
712
  status: {
713
- voided: string; /**
714
- * `onClickCancelShipment` is a callback function that controls the display of `Cancel shipment` option and
715
- * will be invoked when the user clicks on it.
716
- */
713
+ voided: string;
717
714
  error: string;
718
715
  completed: string;
719
716
  processing: string;
@@ -1,19 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { CustomThemeData } from "@shipengine/giger-theme";
3
- export type ComponentProps = {
4
- onUpdateThemeConfig: (themeConfig: CustomThemeData) => void;
5
- presets?: {
6
- presetName: string;
7
- themeConfig: CustomThemeData;
8
- }[];
9
- showDrawer?: {
10
- content?: React.ReactNode;
11
- copyToClipboardText?: string;
12
- };
13
- themeConfig: CustomThemeData;
14
- };
15
- export declare const Component: ({ ...props }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
16
- export declare const Element: ({ resources, ...props }: ComponentProps & {
2
+ import { ThemeCreatorProps } from "../../components/templates/theme-creator";
3
+ export type ComponentProps = ThemeCreatorProps;
4
+ export declare const Component: ({ ...props }: ThemeCreatorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
5
+ export declare const Element: ({ resources, ...props }: ThemeCreatorProps & {
17
6
  resources?: {
18
7
  en: {
19
8
  "wallet-history": {
@@ -718,7 +718,13 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
718
718
  };
719
719
  empty: {
720
720
  title: string;
721
- subtitle: string;
721
+ subtitle: string; /**
722
+ * # Void Label Component Props
723
+ *
724
+ * - These are the base props that will be passed into the `<VoidLabel />` component.
725
+ *
726
+ * @see {@link VoidLabel.Component | This prop types usage in the `<VoidLabel />` component}
727
+ */
722
728
  };
723
729
  emptyWithFilters: {
724
730
  title: string;
@@ -733,6 +739,10 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
733
739
  };
734
740
  trackingStatus: {
735
741
  unknown: string;
742
+ /**
743
+ * `onComplete` is a callback function that will be invoked when the request to void a given
744
+ * shipping label is completed.
745
+ */
736
746
  inTransit: string;
737
747
  delivered: string;
738
748
  error: string;
@@ -745,13 +755,13 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
745
755
  };
746
756
  errorMessages: {
747
757
  title: string;
748
- subtitle: string;
749
- }; /**
750
- * `onViewShipment` is a callback function that will be invoked when the user clicks the
751
- * `View Shipment` button. This will take you back to the
752
- * {@link ShipmentSummary.Element | `Shipment Summary Element`} for the given shipment, where you
753
- * will be able to see the voided label listed.
754
- */
758
+ subtitle: string; /**
759
+ * `onViewShipment` is a callback function that will be invoked when the user clicks the
760
+ * `View Shipment` button. This will take you back to the
761
+ * {@link ShipmentSummary.Element | `Shipment Summary Element`} for the given shipment, where you
762
+ * will be able to see the voided label listed.
763
+ */
764
+ };
755
765
  };
756
766
  "connect-carrier": {
757
767
  actions: {
@@ -8,7 +8,7 @@ export interface ElementsContextValue {
8
8
  baseURL: string;
9
9
  cdnURL: string;
10
10
  container?: HTMLElement;
11
- emotionCacheShadowRootContainer?: ShadowRoot & HTMLElement;
11
+ emotionCacheShadowRootContainer?: ShadowRoot | null;
12
12
  getFeatures: (key: keyof ElementsFeatureFlags) => ElementsFeatureFlags[keyof ElementsFeatureFlags];
13
13
  getToken: ShipEngineProps["getToken"];
14
14
  globalFeatures: GlobalFeatures;
@@ -27,7 +27,7 @@ export type ElementsContextProviderProps = {
27
27
  cdnURL?: string;
28
28
  children: React.ReactNode;
29
29
  container?: HTMLElement;
30
- emotionCacheShadowRootContainer?: ShadowRoot & HTMLElement;
30
+ emotionCacheShadowRootContainer?: ShadowRoot | null;
31
31
  features?: ElementsFeatureFlags;
32
32
  locale?: string;
33
33
  onError?: ElementsErrorHandler;
@@ -5,7 +5,6 @@ import { ShipEngineAPIConfig } from "@shipengine/react-api";
5
5
  import { ElementsContextProviderProps } from "./elements-context-provider";
6
6
  export type ElementsProviderProps = Omit<ElementsContextProviderProps, "theme"> & ShipEngineAPIConfig & {
7
7
  defaultQueryClientOptions?: DefaultOptions;
8
- emotionCacheShadowRootContainer?: ShadowRoot & HTMLElement;
9
8
  themeConfig?: CustomThemeData | {
10
9
  [THEME_ID]: CustomThemeData;
11
10
  };
@@ -13,4 +12,4 @@ export type ElementsProviderProps = Omit<ElementsContextProviderProps, "theme">
13
12
  /**
14
13
  * @category Providers
15
14
  */
16
- export declare const ElementsProvider: ({ baseURL, cdnURL, children, container, features, getToken, headers, locale, onApiError, onError, scope, themeConfig, defaultQueryClientOptions, emotionCacheShadowRootContainer, }: ElementsProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
15
+ export declare const ElementsProvider: ({ baseURL, cdnURL, children, container, features, getToken, headers, locale, onApiError, onError, scope, themeConfig, defaultQueryClientOptions, emotionCacheShadowRootContainer, }: ElementsProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
@@ -1,6 +1,7 @@
1
1
  import { SE } from "@shipengine/react-api";
2
2
  import { InsuranceProviderProfile } from "../../types";
3
3
  export declare const useManageFundingSourceInsurance: () => {
4
+ fundingSourceCountryCode: string | undefined;
4
5
  hasInsuranceToRegister: boolean | undefined;
5
6
  insuranceAcceptedTerms: SE.Term[] | undefined;
6
7
  insuranceProviderProfiles: InsuranceProviderProfile[] | undefined;
@@ -159,6 +159,10 @@ export type LabelsGridFeatures = {
159
159
  showActions?: boolean;
160
160
  };
161
161
  export type GlobalFeatures = {
162
+ /**
163
+ * Disable default usage of Shadow DOM for all elements
164
+ */
165
+ disableShadowDOM?: boolean;
162
166
  /**
163
167
  * Availible "Bring your own carrier" carrier codes for carriers that may be added. If this is omitted, new carriers may not be added by this element.
164
168
  */
@@ -0,0 +1,12 @@
1
+ interface ShipEngineLocalStorageConfig {
2
+ carrierId?: string;
3
+ labelId?: string;
4
+ salesOrderId?: string;
5
+ sellerId?: number;
6
+ shipmentId?: string;
7
+ token?: string;
8
+ warehouseId?: string;
9
+ }
10
+ export declare const getLocalStorageConfig: () => ShipEngineLocalStorageConfig | undefined;
11
+ export declare const setLocalStorageConfig: (config: ShipEngineLocalStorageConfig) => void;
12
+ export {};
@@ -73,29 +73,6 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
73
73
  dpdwallet: string;
74
74
  };
75
75
  refund_process: string;
76
- /**
77
- * # ConnectExternalCarrier Component
78
- *
79
- * @param ComponentProps The base props that will be passed into the `<ConnectExternalCarrier />` component.
80
- *
81
- * @returns Element A React element that renders the `<ConnectExternalCarrier />` component allowing users
82
- * to connect their own existing carrier account. If no carrier is provided, the user may
83
- * select from a list of carriers specified by `features.availableCarrierConnections`.
84
- * This component is composed in the `<AccountSettings />` Element.
85
- *
86
- * @example
87
- * ```tsx
88
- * (() => {
89
- * const features = useFeatures("CarrierConnections");
90
- *
91
- * return <ConnectExternalCarrier.Component features={features} />;
92
- * })();
93
- * ```
94
- *
95
- * <br />
96
- *
97
- * @see {@link ConnectExternalCarrier.ComponentProps | The props that are passed into the `<ConnectExternalCarrier />` component}
98
- */
99
76
  refund_rules: string;
100
77
  resultTitles: {
101
78
  approved: string;
@@ -289,7 +266,29 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
289
266
  auctane_service_fee: string;
290
267
  product_price: string;
291
268
  };
292
- };
269
+ }; /**
270
+ * # ConnectExternalCarrier Component
271
+ *
272
+ * @param ComponentProps The base props that will be passed into the `<ConnectExternalCarrier />` component.
273
+ *
274
+ * @returns Element A React element that renders the `<ConnectExternalCarrier />` component allowing users
275
+ * to connect their own existing carrier account. If no carrier is provided, the user may
276
+ * select from a list of carriers specified by `features.availableCarrierConnections`.
277
+ * This component is composed in the `<AccountSettings />` Element.
278
+ *
279
+ * @example
280
+ * ```tsx
281
+ * (() => {
282
+ * const features = useFeatures("CarrierConnections");
283
+ *
284
+ * return <ConnectExternalCarrier.Component features={features} />;
285
+ * })();
286
+ * ```
287
+ *
288
+ * <br />
289
+ *
290
+ * @see {@link ConnectExternalCarrier.ComponentProps | The props that are passed into the `<ConnectExternalCarrier />` component}
291
+ */
293
292
  "purchase-label": {
294
293
  title: string;
295
294
  actions: {
@@ -16,5 +16,6 @@ export type OnboardingWizardProps = {
16
16
  defaultShipFromAddress?: ShipFromAddressStepProps["defaultShipFromAddress"];
17
17
  onComplete: () => void;
18
18
  onSellerOnboarded?: () => void;
19
+ skipWelcomePage?: boolean;
19
20
  };
20
- export declare const OnboardingWizard: ({ defaultShipFromAddress, onComplete: onWizardComplete, onSellerOnboarded, }: OnboardingWizardProps) => import("@emotion/react/jsx-runtime").JSX.Element;
21
+ export declare const OnboardingWizard: ({ defaultShipFromAddress, onComplete: onWizardComplete, onSellerOnboarded, skipWelcomePage, }: OnboardingWizardProps) => import("@emotion/react/jsx-runtime").JSX.Element;