@shipengine/elements 2.7.0 → 2.8.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 (47) hide show
  1. package/carrier.js +1 -1
  2. package/components.js +1 -1
  3. package/elements.js +1 -1
  4. package/index.js +1 -1
  5. package/package.json +2 -2
  6. package/src/components/grid-filters/components/created-date-filter/created-date-filter.d.ts +23 -0
  7. package/src/components/grid-filters/components/created-date-filter/created-date-filter.styles.d.ts +41 -0
  8. package/src/components/grid-filters/components/created-date-filter/index.d.ts +1 -0
  9. package/src/components/grid-filters/components/created-date-filter/types/form.d.ts +7 -0
  10. package/src/components/grid-filters/components/created-date-filter/types/index.d.ts +1 -0
  11. package/src/components/grid-filters/components/created-date-filter/utils/dates.d.ts +12 -0
  12. package/src/components/grid-filters/components/created-date-filter/utils/index.d.ts +1 -0
  13. package/src/components/grid-filters/components/index.d.ts +2 -0
  14. package/src/components/grid-filters/components/shipment-id-filter/index.d.ts +1 -0
  15. package/src/components/grid-filters/{shipment-id-filter.d.ts → components/shipment-id-filter/shipment-id-filter.d.ts} +1 -1
  16. package/src/components/grid-filters/components/shipment-id-filter/shipment-id-filter.styles.d.ts +10 -0
  17. package/src/components/grid-filters/grid-filters.d.ts +4 -0
  18. package/src/elements/label-layout/label-layout-element.d.ts +7 -0
  19. package/src/elements/labels-grid/labels-grid.d.ts +7 -0
  20. package/src/elements/manage-carriers/manage-carriers.d.ts +7 -0
  21. package/src/elements/manage-external-carriers/manage-external-carriers.d.ts +7 -0
  22. package/src/elements/manage-funding/manage-funding-element.d.ts +7 -0
  23. package/src/elements/manage-warehouses/manage-warehouses.d.ts +7 -0
  24. package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +7 -0
  25. package/src/elements/purchase-label/purchase-label.d.ts +7 -5
  26. package/src/elements/shipment-summary/shipment-summary.d.ts +7 -0
  27. package/src/elements/shipments-grid/hooks/use-shipments-grid.d.ts +2 -3
  28. package/src/elements/shipments-grid/shipments-grid.d.ts +17 -4
  29. package/src/elements/shipments-grid/utils/created-date-value.d.ts +15 -0
  30. package/src/elements/shipments-grid/utils/index.d.ts +1 -0
  31. package/src/elements/theme-creator/theme-creator.d.ts +7 -0
  32. package/src/elements/transaction-history/transaction-history-element.d.ts +7 -0
  33. package/src/elements/unit-settings/unit-settings-element.d.ts +7 -0
  34. package/src/elements/vat-settings/vat-settings-element.d.ts +7 -0
  35. package/src/elements/void-label/void-label.d.ts +7 -0
  36. package/src/locales/en/index.d.ts +7 -0
  37. package/src/utilities/date.d.ts +1 -1
  38. package/src/workflows/account-settings/account-settings.d.ts +7 -0
  39. package/src/workflows/carrier-services/carrier-services.d.ts +7 -0
  40. package/src/workflows/connect-external-carrier/connect-external-carrier.d.ts +7 -0
  41. package/src/workflows/onboarding/onboarding.d.ts +7 -0
  42. package/transaction-history-element.js +1 -1
  43. package/use-unit-settings.js +1 -1
  44. package/usePager.js +1 -1
  45. package/wallet-form.js +1 -1
  46. package/src/components/grid-filters/grid-filters.styles.d.ts +0 -11
  47. /package/src/components/grid-filters/{shipment-id-filter-shema.d.ts → components/shipment-id-filter/shipment-id-filter-shema.d.ts} +0 -0
package/carrier.js CHANGED
@@ -1 +1 @@
1
- import{format as e}from"date-fns/format";import{enGB as t,enUS as r}from"date-fns/locale";import{parse as a}from"date-fns/parse";import n from"humps";import{SE as s}from"@shipengine/react-api";import{c as o,u as i,f as c}from"./address.js";function u(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}function l(e,t,r,a){return new(r||(r=Promise))((function(n,s){function o(e){try{c(a.next(e))}catch(e){s(e)}}function i(e){try{c(a.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,i)}c((a=a.apply(e,t||[])).next())}))}const d=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"numeric",month:"long",year:"numeric"}),g=(e="en-US")=>{const a=e.replaceAll("-",""),n=e.split("-")[0],s={enGB:t,enUS:r};return s[a in s?a:n]},p=(t,r="en-US",a)=>{const n=g(r),s=D(r);return e(t,null!=a?a:s,{locale:n})},m=(e,t="en-US",r="P")=>{const n=g(t);return a(e,r,new Date,{locale:n})},y=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"2-digit",month:"2-digit",year:"2-digit"}),f=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"2-digit",month:"2-digit",year:"numeric"}),D=(e="en-US")=>{var t;return null===(t=(g(e)||g("en-US")).formatLong)||void 0===t?void 0:t.date({width:"short"})},w=(e,t=new Date)=>((t=new Date(t)).setDate(t.getDate()+e),t),v=(e,t=new Date)=>t.getHours()>=e?w(1,new Date(t)):new Date(t),h=(...e)=>new Date(Math.max(...e.map(Number))),b=e=>{const t=e?new Date(e):new Date;return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())},C=e=>{const t=(new Date).getFullYear(),r=[];for(let a=0;a<e;a++)r.push(`${t+a}`);return r},U=(e,t,r="desc")=>{const[a,n]="asc"===r?[e,t]:[t,e];return new Date(a.createdAt).getTime()-new Date(n.createdAt).getTime()},S=e=>!!e&&new Date(e)>=new Date,O=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))}},j=e=>e.slice(0,1).toUpperCase()+e.slice(1),A=e=>e.split(" ").map((e=>j(e.toLowerCase()))).join(" "),_=e=>n.pascalize(e),L=e=>null==e?void 0:e.replace(/\s+/g,"-").toLowerCase(),M=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/(?<=[a-zA-Z])(\d)/g," $1").trim(),$={aud:"$",cad:"$",eur:"€",gbp:"£",nzd:"$",usd:"$"},P=(e,t="en-US")=>Intl.NumberFormat(t,{currency:e.currency,style:"currency"}).format(e.amount),T=(...e)=>e.reduce(((e,t)=>{var r;return t?e+(null!==(r=t.amount)&&void 0!==r?r:0):e}),0),x=e=>[e.substring(0,4),e.substring(4,8),e.substring(8,12),e.substring(12)].join(" ").trim(),F=e=>{const t=e.replace(/\//g,"");return t.length>2?[t.substring(0,2),t.substring(2,6)].join("/").trim():t},z=e=>{switch(null==e?void 0:e.toLowerCase()){case"usd":default:return s.Currency.USD;case"cad":return s.Currency.CAD;case"aud":return s.Currency.AUD;case"gbp":return s.Currency.GBP;case"eur":return s.Currency.EUR;case"nzd":return s.Currency.NZD}},B=e=>{let t;switch(e){case s.Currency.USD:case s.Currency.CAD:case s.Currency.AUD:case s.Currency.NZD:t="$";break;case s.Currency.GBP:t="£‎";break;case s.Currency.EUR:t="€"}return t},Y=(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}},G=(e={})=>T(...Object.values(e)),N=(e,t)=>t[e]||e,k=e=>{var t;return"US"===e.countryCode||(null===(t=o.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnitedStatesTerritory)},E=e=>{var t,r;return!(!(null===(t=i.find((t=>t.code===e.stateProvince)))||void 0===t?void 0:t.isMilitary)&&!(null===(r=c.find((t=>t.code===e.cityLocality)))||void 0===r?void 0:r.isMilitary))},I=e=>{var t,r;return!(!(null===(t=o.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnitedStatesTerritory)&&!(null===(r=i.find((t=>t.code===e.stateProvince)))||void 0===r?void 0:r.isUnitedStatesTerritory))},Z=e=>{var t;return!!(null===(t=o.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnsupportedByUps)},R=/^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i,H=e=>R.test(e),q=e=>!!(H(e.addressLine1)||e.addressLine2&&H(e.addressLine2)),J=e=>!e||Object.entries(e).every((([e,t])=>"countryCode"===e||[null,"","unknown"].includes(t))),K=(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"],V=e=>Q.includes(e),W=e=>"ups"===e,X=(e=[],t)=>{const r=e.find((e=>e.carrierCode===t));return null==r?void 0:r.carrierId},ee=(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`},te=e=>!!e&&["GB","CA"].includes(e),re=e=>"AU"===e,ae=(e,t)=>null==e?void 0:e.filter((e=>"globalpost"===e.carrierCode?te(t):"sendle_walleted"!==e.carrierCode||re(t)));export{B as A,Y as B,G as C,N as D,k as E,E as F,I as G,Z as H,H as I,q as J,J as K,K as L,V as M,W as N,X as O,ee as P,te as Q,re as R,ae as S,u as T,l as _,g as a,p as b,y as c,f as d,w as e,d as f,D as g,C as h,S as i,O as j,j as k,A as l,h as m,v as n,b as o,m as p,_ as q,L as r,U as s,M as t,$ as u,P as v,T as w,x,F as y,z};
1
+ import{format as e}from"date-fns/format";import{ca as t,de as r,enAU as a,enGB as n,enUS as s,es as o,fr as i,it as c,pt as u}from"date-fns/locale";import{parse as l}from"date-fns/parse";import d from"humps";import{SE as g}from"@shipengine/react-api";import{c as p,u as m,f as y}from"./address.js";function f(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}function D(e,t,r,a){return new(r||(r=Promise))((function(n,s){function o(e){try{c(a.next(e))}catch(e){s(e)}}function i(e){try{c(a.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,i)}c((a=a.apply(e,t||[])).next())}))}const w=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"numeric",month:"long",year:"numeric"}),v=(e="en-US")=>{const l=e.replaceAll("-",""),d=e.split("-")[0],g={ca:t,de:r,enAU:a,enGB:n,enUS:s,es:o,fr:i,it:c,pt:u};return g[l in g?l:d]},h=(t,r="en-US",a)=>{const n=v(r),s=S(r);return e(t,null!=a?a:s,{locale:n})},b=(e,t="en-US",r="P")=>{const a=v(t);return l(e,r,new Date,{locale:a})},C=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"2-digit",month:"2-digit",year:"2-digit"}),U=(e,t="en-US")=>new Date(e).toLocaleDateString(t,{day:"2-digit",month:"2-digit",year:"numeric"}),S=(e="en-US")=>{var t;return null===(t=(v(e)||v("en-US")).formatLong)||void 0===t?void 0:t.date({width:"short"})},O=(e,t=new Date)=>((t=new Date(t)).setDate(t.getDate()+e),t),A=(e,t=new Date)=>t.getHours()>=e?O(1,new Date(t)):new Date(t),j=(...e)=>new Date(Math.max(...e.map(Number))),_=e=>{const t=e?new Date(e):new Date;return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())},L=e=>{const t=(new Date).getFullYear(),r=[];for(let a=0;a<e;a++)r.push(`${t+a}`);return r},M=(e,t,r="desc")=>{const[a,n]="asc"===r?[e,t]:[t,e];return new Date(a.createdAt).getTime()-new Date(n.createdAt).getTime()},$=e=>!!e&&("string"==typeof e?new Date(e):e)>=new Date,P=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))}},T=e=>e.slice(0,1).toUpperCase()+e.slice(1),x=e=>e.split(" ").map((e=>T(e.toLowerCase()))).join(" "),F=e=>d.pascalize(e),z=e=>null==e?void 0:e.replace(/\s+/g,"-").toLowerCase(),B=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/(?<=[a-zA-Z])(\d)/g," $1").trim(),Y={aud:"$",cad:"$",eur:"€",gbp:"£",nzd:"$",usd:"$"},G=(e,t="en-US")=>Intl.NumberFormat(t,{currency:e.currency,style:"currency"}).format(e.amount),N=(...e)=>e.reduce(((e,t)=>{var r;return t?e+(null!==(r=t.amount)&&void 0!==r?r:0):e}),0),k=e=>[e.substring(0,4),e.substring(4,8),e.substring(8,12),e.substring(12)].join(" ").trim(),E=e=>{const t=e.replace(/\//g,"");return t.length>2?[t.substring(0,2),t.substring(2,6)].join("/").trim():t},I=e=>{switch(null==e?void 0:e.toLowerCase()){case"usd":default:return g.Currency.USD;case"cad":return g.Currency.CAD;case"aud":return g.Currency.AUD;case"gbp":return g.Currency.GBP;case"eur":return g.Currency.EUR;case"nzd":return g.Currency.NZD}},Z=e=>{let t;switch(e){case g.Currency.USD:case g.Currency.CAD:case g.Currency.AUD:case g.Currency.NZD:t="$";break;case g.Currency.GBP:t="£‎";break;case g.Currency.EUR:t="€"}return t},R=(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}},H=(e={})=>N(...Object.values(e)),q=(e,t)=>t[e]||e,J=e=>{var t;return"US"===e.countryCode||(null===(t=p.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnitedStatesTerritory)},K=e=>{var t,r;return!(!(null===(t=m.find((t=>t.code===e.stateProvince)))||void 0===t?void 0:t.isMilitary)&&!(null===(r=y.find((t=>t.code===e.cityLocality)))||void 0===r?void 0:r.isMilitary))},Q=e=>{var t,r;return!(!(null===(t=p.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnitedStatesTerritory)&&!(null===(r=m.find((t=>t.code===e.stateProvince)))||void 0===r?void 0:r.isUnitedStatesTerritory))},V=e=>{var t;return!!(null===(t=p.find((t=>t.code===e.countryCode)))||void 0===t?void 0:t.isUnsupportedByUps)},W=/^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i,X=e=>W.test(e),ee=e=>!!(X(e.addressLine1)||e.addressLine2&&X(e.addressLine2)),te=e=>!e||Object.entries(e).every((([e,t])=>"countryCode"===e||[null,"","unknown"].includes(t))),re=(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})}),ae=["usps","stamps_com"],ne=e=>ae.includes(e),se=e=>"ups"===e,oe=(e=[],t)=>{const r=e.find((e=>e.carrierCode===t));return null==r?void 0:r.carrierId},ie=(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`},ce=e=>!!e&&["GB","CA"].includes(e),ue=e=>"AU"===e,le=(e,t)=>null==e?void 0:e.filter((e=>"globalpost"===e.carrierCode?ce(t):"sendle_walleted"!==e.carrierCode||ue(t)));export{Z as A,R as B,H as C,q as D,J as E,K as F,Q as G,V as H,X as I,ee as J,te as K,re as L,ne as M,se as N,oe as O,ie as P,ce as Q,ue as R,le as S,f as T,D as _,v as a,h as b,C as c,U as d,O as e,w as f,S as g,L as h,$ as i,P as j,T as k,x as l,j as m,A as n,_ as o,b as p,F as q,z as r,M as s,B as t,Y as u,G as v,N as w,k as x,E as y,I as z};
package/components.js CHANGED
@@ -1 +1 @@
1
- export{z as Actions,y as ActionsMenu,A as AddFundsForm,b as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,d as CarrierConnectionCard,e as CarrierIcon,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,l as EditBillingForm,m as ErrorFallback,F as FieldLabel,n as FormPortal,o as FundAndPurchase,H as HistoryCard,p as HistoryCardExtension,I as InlineLabel,q as ItemsBreakdown,L as LinkAction,r as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,t as SettingsCard,u as SkeletonCarrierRow,v as Spacer,w as Spread,T as Tabs,V as VatForm,W as WalletCard,x as WarehouseForm,c as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./actions-menu.js";export{C as CarrierLogo}from"./carrier-logo.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";export{P as Portal}from"./use-toggle.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"humps";import"@shipengine/react-api";import"./address.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./vat.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"lodash/isEqual";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit";import"card-validator";import"./zod.js";import"react-use";import"react-dom";
1
+ export{z as Actions,y as ActionsMenu,A as AddFundsForm,b as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,d as CarrierConnectionCard,e as CarrierIcon,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,l as EditBillingForm,m as ErrorFallback,F as FieldLabel,n as FormPortal,o as FundAndPurchase,H as HistoryCard,p as HistoryCardExtension,I as InlineLabel,q as ItemsBreakdown,L as LinkAction,r as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,t as SettingsCard,u as SkeletonCarrierRow,v as Spacer,w as Spread,T as Tabs,V as VatForm,W as WalletCard,x as WarehouseForm,c as autoFundingSchema,g as getAddFundsSchema,s as styles}from"./actions-menu.js";export{C as CarrierLogo}from"./carrier-logo.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";export{P as Portal}from"./use-toggle.js";import"./carrier.js";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"humps";import"@shipengine/react-api";import"./address.js";import"@emotion/react/jsx-runtime";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./vat.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"lodash/isEqual";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit";import"card-validator";import"./zod.js";import"react-use";import"date-fns/subDays";import"react-dom";
package/elements.js CHANGED
@@ -1 +1 @@
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.js";export{a as CarrierServices,p as PurchaseLabel,s as ShipmentSummary,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"humps";import"@shipengine/react-api";import"./address.js";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./vat.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"./use-toggle.js";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"card-validator";import"./zod.js";import"./use-get-service-name.js";import"./usePager.js";import"react-use";import"@tanstack/react-query";import"./use-scrub-errors.js";import"./shipment.js";import"lodash/orderBy";import"lodash/merge";import"lodash/mergeWith";import"./warehouses.js";import"axios";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";
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.js";export{a as CarrierServices,p as PurchaseLabel,s as ShipmentSummary,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"humps";import"@shipengine/react-api";import"./address.js";import"date-fns/isToday";import"@shipengine/giger";import"react";import"react-hook-form";import"react-i18next";import"./vat.js";import"lodash/get";import"@hookform/resolvers/zod";import"zod";import"@emotion/react";import"@shipengine/giger-theme";import"./use-toggle.js";import"lodash/isEqual";import"lodash/omit";import"react-dom";import"./money.js";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"card-validator";import"./zod.js";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"@tanstack/react-query";import"./use-scrub-errors.js";import"./shipment.js";import"lodash/orderBy";import"lodash/merge";import"lodash/mergeWith";import"./warehouses.js";import"axios";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/index.js CHANGED
@@ -1 +1 @@
1
- import{E as X,a as _}from"./actions-menu.js";export{z as Actions,y as ActionsMenu,A as AddFundsForm,b as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,d as CarrierConnectionCard,e as CarrierIcon,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,l as EditBillingForm,a as ElementsContext,E as ElementsContextProvider,m as ErrorFallback,F as FieldLabel,n as FormPortal,o as FundAndPurchase,H as HistoryCard,p as HistoryCardExtension,I as InlineLabel,q as ItemsBreakdown,L as LinkAction,r as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,t as SettingsCard,u as SkeletonCarrierRow,v as Spacer,w as Spread,T as Tabs,V as VatForm,W as WalletCard,x as WarehouseForm,c as autoFundingSchema,g as getAddFundsSchema,s as styles,G as useElements}from"./actions-menu.js";export{C as CarrierLogo}from"./carrier-logo.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{R as Y}from"./use-toggle.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.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,p as PurchaseLabel,s as ShipmentSummary,v as VoidLabel,c as createElement}from"./use-unit-settings.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.js";export{e as extendZod}from"./zod.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.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{m as moneySchema}from"./money.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone.js";export{a as assert,r as raise}from"./assertions.js";export{i as isOnboarded}from"./checks.js";export{b as convertDimensions,c as createDictionary,f as formatDimensions,h as getCancelledShipment,d as getIsCustomsRequiredForShipment,g as getIsInternationalShipment,e as getPendingShipment,j as getShipmentByStatus,a as isCollectionService,i as isPudoEligibleRate,m as moveCustomsItemsToProducts}from"./shipment.js";import{_ as Z}from"./carrier.js";export{L as addEmailToValidation,t as addSpaceBetweenWords,w as calculateTotal,k as capitalizeFirstLetter,l as capitalizeFirstLetterOfEachWord,u as currencySymbol,e as daysAfter,S as filterFundingSourceCarriers,a as findDateLocale,b as formatByDateAndLocale,x as formatCreditCardNumber,f as formatDate,c as formatDateDDMMYY,d as formatDateDDMMYYYY,y as formatExpiration,v as formatMoney,O as getCarrierIdByCarrierCode,z as getCurrencyFromString,A as getCurrencySymbolFromString,h as getExpirationYears,P as getLogoOrIconByCarrierCode,B as getRateRequiresAcknowledgement,j as getRelativeDates,C as getTotalRateAmount,g as getlocaleDateStringFormat,E as isDomesticAddress,K as isEmptyAddress,Q as isGlobalPostEligible,F as isMilitaryAddress,i as isNowOrInTheFuture,I as isPoBox,J as isPoBoxAddress,R as isSendleEligible,G as isUnitedStatesTerritory,H as isUnsupportedByUps,N as isUpsCarrier,M as isUspsCarrier,m as mostRecent,n as nextDayCutoff,o as omitTime,D as overrideCarrierCodes,p as parseLocaleDate,q as pascalize,r as replaceSpacesWithDashes,s as sortByCreationDate}from"./carrier.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.js";import{g as $,d as ee}from"./vat.js";export{N as NO_VAT_COUNTRIES,c as aggregateRateDetailItems,e as calculateRateDetailBreakdown,h as createStyles,d as deepMergeFeatures,j as errorMap,f as featureFlagComponentNameLookup,a as formLogger,g as getDefaultFeatures,k as getIsVatRequired,i as isObject,b as isString,t as trackingStatusFormatter,v as validationResolver}from"./vat.js";export{a as AccountSettings,l as LabelWorkflow,o as Onboarding}from"./wallet-form.js";import{jsx as ae}from"@emotion/react/jsx-runtime";import{GigerProvider as te,GigerTestProvider as re}from"@shipengine/giger";import{Theme as se}from"@shipengine/giger-theme";import{ShipEngine as oe}from"@shipengine/react-api";import ie from"axios";import{useCallback as ne,useMemo as le}from"react";import"date-fns/isToday";import"react-hook-form";import"react-i18next";import"@emotion/react";import"lodash/isEqual";import"zod";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit";import"card-validator";import"react-use";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";var pe={fallback:{borderRadius:{L:"16px",M:"8px",S:"4px",XL:"32px",XS:"2px"},breakPoints:{desktop:1280,mobileLarge:480,tablet:768,tabletLarge:960},card:{borderRadius:{desktop:"8px",mobile:"4px",tablet:"8px"}},components:{Button:{borderRadius:"4px"},Checkbox:{borderRadius:"2px",square:!1},Chip:{backgroundColor:"#f4f4f4",border:"none",borderRadius:"16px",color:"#706f6f",fontWeight:600,isSelected:{backgroundColor:"#EDEDED",border:"none",color:"#7A7A7A"},padding:"4px 16px"},Dialog:{action:{justifyContent:"center"},content:{padding:24,textAlign:"center"},dialog:{backgroundColor:"rgba(0, 0, 0, 0.26)",borderRadius:"4px"},header:{borderBottom:"2px solid #d3d3d3",padding:24,titleColor:"#616161"}},Field:{color:"#373737",fontWeight:700,placeholder:{fontWeight:700}},FieldContainer:{borderRadius:"4px"},Link:{activeColor:"#787878",defaultColor:"#616161",hoverColor:"#303030",isDark:{activeColor:"#787878",defaultColor:"#fff",hoverColor:"#fff",visitedColor:"#fff"},visitedColor:"#303030"},Table:{border:"none",borderRadius:"4px",boxShadow:"0 0 12px rgba(0, 0, 0, 0.1)"},Typography:{body1:{fontSize:"16px",fontWeight:400,letterSpacing:0,lineHeight:"24px"},body2:{fontSize:"14px",fontWeight:400,letterSpacing:3,lineHeight:"20px"},heading1:{fontSize:"48px",fontWeight:700,letterSpacing:0,lineHeight:"72px"},heading2:{fontSize:"32px",fontWeight:700,letterSpacing:1,lineHeight:"48px"},heading3:{fontSize:"24px",fontWeight:700,letterSpacing:3,lineHeight:"48px"},heading4:{fontSize:"20px",fontWeight:700,letterSpacing:3,lineHeight:"32px"},heading5:{fontSize:"18px",fontWeight:700,letterSpacing:3,lineHeight:"28px"},heading6:{fontSize:"16px",fontWeight:700,letterSpacing:3,lineHeight:"24px"},small:{fontSize:"12px",fontWeight:400,letterSpacing:5,lineHeight:"20px"},subtitle1:{fontSize:"16px",fontWeight:600,letterSpacing:3,lineHeight:"24px"},subtitle2:{fontSize:"14px",fontWeight:600,letterSpacing:5,lineHeight:"20px"}}},defaultFontFamily:"Arial",elevations:{above:{boxShadow:"0 0 12px rgba(0, 0, 0, 0.1)",zIndex:1e3},backdrop:{boxShadow:"none",zIndex:1007},flat1:{boxShadow:"0 2px 2px rgba(0, 0, 0, 0.1)",zIndex:1},flat2:{boxShadow:"0 2px 2px rgba(0, 0, 0, 0.1)",zIndex:1e3},overlay1:{boxShadow:"0 0 24px rgba(0, 0, 0, 0.1)",zIndex:1006},overlay2:{boxShadow:"0 0 24px rgba(0, 0, 0, 0.1)",zIndex:1008},popout1:{boxShadow:"0 4px 16px rgba(0, 0, 0, 0.1)",zIndex:1004},popout2:{boxShadow:"0 4px 16px rgba(0, 0, 0, 0.1)",zIndex:1005},raised:{boxShadow:"0 8px 8px rgba(0, 0, 0, 0.1)",zIndex:1002},raisedInverted1:{boxShadow:"0 -8px 8px rgba(0, 0, 0, 0.1)",zIndex:1002},raisedInverted2:{boxShadow:"0 -8px 8px rgba(0, 0, 0, 0.1)",zIndex:1003},sticky:{boxShadow:"none",zIndex:1001}},fontFaces:[],grid:{desktop:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},desktopLarge:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},mobile:{columns:4,gutter:16,horizontalSpace:16,verticalSpace:16},mobileLarge:{columns:4,gutter:16,horizontalSpace:16,verticalSpace:16},tablet:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},tabletLarge:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24}},iconSize:{extra_large:"48px",large:"32px",medium:"20px",regular:"24px",small:"16px"},palette:{alert:{light:"#ffe7ca",main:"#725200"},black:"#000",dataVisualization:{highContrast:{blue:"#3970C1",blueDark:"#002039",coral:"#F95D6A",cyan:"#45CEE0",green:"#B3D849",orange:"#FFA600",orangeDark:"#FF7C43",pink:"#D12771",purple:"#A05195",purpleDark:"#665191"},lowContrast:{blue:"#96B3DE",blueDark:"#5283AB",coral:"#FCA6AD",cyan:"#BAE6FF",green:"#DEF895",orange:"#FDDFA5",orangeDark:"#FCC2A9",pink:"#E995BA",purple:"#D4BBFF",purpleDark:"#B1A2D0"}},error:{light:"#fee5e4",main:"#a72514"},gray:{dark:"#373737",light:"#d3d3d3",main:"#706f6f",megaLight:"#f4f4f4",ultraLight:"#f4f4f4"},info:{light:"#dbedfd",main:"#195f7f"},primary:{dark:"#626262",light:"#D6D6D6",main:"#7A7A7A",ultraLight:"#EDEDED"},secondary:{dark:"#303030",light:"#787878",main:"#616161",ultraLight:"#F4F4F4"},success:{light:"#dcfddb",main:"#286327"},white:"#fff"},spacingBase:8,typography:{fontSize:{L:"18px",M:"16px",S:"14px",XL:"20px",XS:"12px",XXL:"24px",XXS:"10px",XXXL:"32px",XXXXL:"48px"},fontWeight:{bold:700,light:200,normal:400,semibold:600},letterSpacing:{L:3,M:1,S:0,XL:5,XXL:8,XXXL:12},lineHeight:{L:"28px",M:"24px",S:"20px",XL:"32px",XXL:"48px",XXXL:"72px"}}}};const de=({baseURL:e="https://elements.shipengine.com",cdnURL:a="https://cdn.packlink.com",children:t,container:r,features:s,getToken:o,headers:i,locale:n,onApiError:l,onError:p=(()=>{}),scope:d="lmnt",themeConfig:c,defaultQueryClientOptions:g})=>{const m=(({cdnURL:e})=>ne((a=>Z(void 0,void 0,void 0,(function*(){return(yield ie.get(`/brand/fallback/icons/${a.toLowerCase()}.svg`,{baseURL:e,responseType:"json"})).data}))),[e]))({cdnURL:a}),u=new se(null!=c?c:pe.fallback),h={baseURL:e,cdnURL:a,container:r,features:s,getToken:o,locale:n,onError:p,scope:d,theme:u};return ae(X,Object.assign({},h,{children:ae(te,Object.assign({cdnUrl:a,reference:d||void 0,resolveIcon:m,theme:u},{children:ae(oe,Object.assign({baseURL:e,defaultQueryClientOptions:g,getToken:o,headers:i,onApiError:l},{children:ae(Y,{children:t})}))}))}))},ce=({baseURL:e,children:a,features:t})=>{const r=le((()=>new se),[]),s=$(["globalFeatures"]),o=ne((()=>"none"),[]),i={baseURL:e,cdnURL:"mockCdnUrl",getFeatures:e=>{var a;return ee(null!==(a=$([e]))&&void 0!==a?a:{},null==t?void 0:t[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"]},s),t.globalFeatures),onError:()=>{},scope:"lmnt",theme:r};return ae(_.Provider,Object.assign({value:i},{children:ae(re,Object.assign({theme:r},{children:ae(oe,Object.assign({baseURL:e,getToken:o},{children:a}))}))}))};export{de as ElementsProvider,ce as ElementsTestProvider};
1
+ import{E as X,a as _}from"./actions-menu.js";export{z as Actions,y as ActionsMenu,A as AddFundsForm,b as AutoFundingForm,B as ButtonGroup,C as CarrierBalance,d as CarrierConnectionCard,e as CarrierIcon,f as CollapsiblePanel,h as CopyButton,i as Cube,D as DateRangeCombo,j as DateRangeSelect,k as DisplayTerm,l as EditBillingForm,a as ElementsContext,E as ElementsContextProvider,m as ErrorFallback,F as FieldLabel,n as FormPortal,o as FundAndPurchase,H as HistoryCard,p as HistoryCardExtension,I as InlineLabel,q as ItemsBreakdown,L as LinkAction,r as Loader,P as PoweredByShipEngine,R as RateDetails,S as Section,t as SettingsCard,u as SkeletonCarrierRow,v as Spacer,w as Spread,T as Tabs,V as VatForm,W as WalletCard,x as WarehouseForm,c as autoFundingSchema,g as getAddFundsSchema,s as styles,G as useElements}from"./actions-menu.js";export{C as CarrierLogo}from"./carrier-logo.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{R as Y}from"./use-toggle.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.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,p as PurchaseLabel,s as ShipmentSummary,v as VoidLabel,c as createElement}from"./use-unit-settings.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.js";export{e as extendZod}from"./zod.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.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{m as moneySchema}from"./money.js";export{p as phoneSchema,a as phoneSchemaUnvalidated}from"./phone.js";export{a as assert,r as raise}from"./assertions.js";export{i as isOnboarded}from"./checks.js";export{b as convertDimensions,c as createDictionary,f as formatDimensions,h as getCancelledShipment,d as getIsCustomsRequiredForShipment,g as getIsInternationalShipment,e as getPendingShipment,j as getShipmentByStatus,a as isCollectionService,i as isPudoEligibleRate,m as moveCustomsItemsToProducts}from"./shipment.js";import{_ as Z}from"./carrier.js";export{L as addEmailToValidation,t as addSpaceBetweenWords,w as calculateTotal,k as capitalizeFirstLetter,l as capitalizeFirstLetterOfEachWord,u as currencySymbol,e as daysAfter,S as filterFundingSourceCarriers,a as findDateLocale,b as formatByDateAndLocale,x as formatCreditCardNumber,f as formatDate,c as formatDateDDMMYY,d as formatDateDDMMYYYY,y as formatExpiration,v as formatMoney,O as getCarrierIdByCarrierCode,z as getCurrencyFromString,A as getCurrencySymbolFromString,h as getExpirationYears,P as getLogoOrIconByCarrierCode,B as getRateRequiresAcknowledgement,j as getRelativeDates,C as getTotalRateAmount,g as getlocaleDateStringFormat,E as isDomesticAddress,K as isEmptyAddress,Q as isGlobalPostEligible,F as isMilitaryAddress,i as isNowOrInTheFuture,I as isPoBox,J as isPoBoxAddress,R as isSendleEligible,G as isUnitedStatesTerritory,H as isUnsupportedByUps,N as isUpsCarrier,M as isUspsCarrier,m as mostRecent,n as nextDayCutoff,o as omitTime,D as overrideCarrierCodes,p as parseLocaleDate,q as pascalize,r as replaceSpacesWithDashes,s as sortByCreationDate}from"./carrier.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.js";import{g as $,d as ee}from"./vat.js";export{N as NO_VAT_COUNTRIES,c as aggregateRateDetailItems,e as calculateRateDetailBreakdown,h as createStyles,d as deepMergeFeatures,j as errorMap,f as featureFlagComponentNameLookup,a as formLogger,g as getDefaultFeatures,k as getIsVatRequired,i as isObject,b as isString,t as trackingStatusFormatter,v as validationResolver}from"./vat.js";export{a as AccountSettings,l as LabelWorkflow,o as Onboarding}from"./wallet-form.js";import{jsx as ae}from"@emotion/react/jsx-runtime";import{GigerProvider as te,GigerTestProvider as re}from"@shipengine/giger";import{Theme as se}from"@shipengine/giger-theme";import{ShipEngine as oe}from"@shipengine/react-api";import ie from"axios";import{useCallback as ne,useMemo as le}from"react";import"date-fns/isToday";import"react-hook-form";import"react-i18next";import"@emotion/react";import"lodash/isEqual";import"zod";import"copy-to-clipboard";import"js-base64";import"libphonenumber-js/min";import"lodash/omit";import"card-validator";import"react-use";import"date-fns/subDays";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"date-fns/formatISO";import"date-fns/isSameDay";import"date-fns/isWithinInterval";import"date-fns/setHours";import"date-fns/setMinutes";import"lodash/orderBy";import"date-fns/format";import"date-fns/locale";import"date-fns/parse";import"lodash/get";import"@hookform/resolvers/zod";var pe={fallback:{borderRadius:{L:"16px",M:"8px",S:"4px",XL:"32px",XS:"2px"},breakPoints:{desktop:1280,mobileLarge:480,tablet:768,tabletLarge:960},card:{borderRadius:{desktop:"8px",mobile:"4px",tablet:"8px"}},components:{Button:{borderRadius:"4px"},Checkbox:{borderRadius:"2px",square:!1},Chip:{backgroundColor:"#f4f4f4",border:"none",borderRadius:"16px",color:"#706f6f",fontWeight:600,isSelected:{backgroundColor:"#EDEDED",border:"none",color:"#7A7A7A"},padding:"4px 16px"},Dialog:{action:{justifyContent:"center"},content:{padding:24,textAlign:"center"},dialog:{backgroundColor:"rgba(0, 0, 0, 0.26)",borderRadius:"4px"},header:{borderBottom:"2px solid #d3d3d3",padding:24,titleColor:"#616161"}},Field:{color:"#373737",fontWeight:700,placeholder:{fontWeight:700}},FieldContainer:{borderRadius:"4px"},Link:{activeColor:"#787878",defaultColor:"#616161",hoverColor:"#303030",isDark:{activeColor:"#787878",defaultColor:"#fff",hoverColor:"#fff",visitedColor:"#fff"},visitedColor:"#303030"},Table:{border:"none",borderRadius:"4px",boxShadow:"0 0 12px rgba(0, 0, 0, 0.1)"},Typography:{body1:{fontSize:"16px",fontWeight:400,letterSpacing:0,lineHeight:"24px"},body2:{fontSize:"14px",fontWeight:400,letterSpacing:3,lineHeight:"20px"},heading1:{fontSize:"48px",fontWeight:700,letterSpacing:0,lineHeight:"72px"},heading2:{fontSize:"32px",fontWeight:700,letterSpacing:1,lineHeight:"48px"},heading3:{fontSize:"24px",fontWeight:700,letterSpacing:3,lineHeight:"48px"},heading4:{fontSize:"20px",fontWeight:700,letterSpacing:3,lineHeight:"32px"},heading5:{fontSize:"18px",fontWeight:700,letterSpacing:3,lineHeight:"28px"},heading6:{fontSize:"16px",fontWeight:700,letterSpacing:3,lineHeight:"24px"},small:{fontSize:"12px",fontWeight:400,letterSpacing:5,lineHeight:"20px"},subtitle1:{fontSize:"16px",fontWeight:600,letterSpacing:3,lineHeight:"24px"},subtitle2:{fontSize:"14px",fontWeight:600,letterSpacing:5,lineHeight:"20px"}}},defaultFontFamily:"Arial",elevations:{above:{boxShadow:"0 0 12px rgba(0, 0, 0, 0.1)",zIndex:1e3},backdrop:{boxShadow:"none",zIndex:1007},flat1:{boxShadow:"0 2px 2px rgba(0, 0, 0, 0.1)",zIndex:1},flat2:{boxShadow:"0 2px 2px rgba(0, 0, 0, 0.1)",zIndex:1e3},overlay1:{boxShadow:"0 0 24px rgba(0, 0, 0, 0.1)",zIndex:1006},overlay2:{boxShadow:"0 0 24px rgba(0, 0, 0, 0.1)",zIndex:1008},popout1:{boxShadow:"0 4px 16px rgba(0, 0, 0, 0.1)",zIndex:1004},popout2:{boxShadow:"0 4px 16px rgba(0, 0, 0, 0.1)",zIndex:1005},raised:{boxShadow:"0 8px 8px rgba(0, 0, 0, 0.1)",zIndex:1002},raisedInverted1:{boxShadow:"0 -8px 8px rgba(0, 0, 0, 0.1)",zIndex:1002},raisedInverted2:{boxShadow:"0 -8px 8px rgba(0, 0, 0, 0.1)",zIndex:1003},sticky:{boxShadow:"none",zIndex:1001}},fontFaces:[],grid:{desktop:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},desktopLarge:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},mobile:{columns:4,gutter:16,horizontalSpace:16,verticalSpace:16},mobileLarge:{columns:4,gutter:16,horizontalSpace:16,verticalSpace:16},tablet:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24},tabletLarge:{columns:12,gutter:24,horizontalSpace:16,verticalSpace:24}},iconSize:{extra_large:"48px",large:"32px",medium:"20px",regular:"24px",small:"16px"},palette:{alert:{light:"#ffe7ca",main:"#725200"},black:"#000",dataVisualization:{highContrast:{blue:"#3970C1",blueDark:"#002039",coral:"#F95D6A",cyan:"#45CEE0",green:"#B3D849",orange:"#FFA600",orangeDark:"#FF7C43",pink:"#D12771",purple:"#A05195",purpleDark:"#665191"},lowContrast:{blue:"#96B3DE",blueDark:"#5283AB",coral:"#FCA6AD",cyan:"#BAE6FF",green:"#DEF895",orange:"#FDDFA5",orangeDark:"#FCC2A9",pink:"#E995BA",purple:"#D4BBFF",purpleDark:"#B1A2D0"}},error:{light:"#fee5e4",main:"#a72514"},gray:{dark:"#373737",light:"#d3d3d3",main:"#706f6f",megaLight:"#f4f4f4",ultraLight:"#f4f4f4"},info:{light:"#dbedfd",main:"#195f7f"},primary:{dark:"#626262",light:"#D6D6D6",main:"#7A7A7A",ultraLight:"#EDEDED"},secondary:{dark:"#303030",light:"#787878",main:"#616161",ultraLight:"#F4F4F4"},success:{light:"#dcfddb",main:"#286327"},white:"#fff"},spacingBase:8,typography:{fontSize:{L:"18px",M:"16px",S:"14px",XL:"20px",XS:"12px",XXL:"24px",XXS:"10px",XXXL:"32px",XXXXL:"48px"},fontWeight:{bold:700,light:200,normal:400,semibold:600},letterSpacing:{L:3,M:1,S:0,XL:5,XXL:8,XXXL:12},lineHeight:{L:"28px",M:"24px",S:"20px",XL:"32px",XXL:"48px",XXXL:"72px"}}}};const de=({baseURL:e="https://elements.shipengine.com",cdnURL:a="https://cdn.packlink.com",children:t,container:r,features:s,getToken:o,headers:i,locale:n,onApiError:l,onError:p=(()=>{}),scope:d="lmnt",themeConfig:c,defaultQueryClientOptions:m})=>{const g=(({cdnURL:e})=>ne((a=>Z(void 0,void 0,void 0,(function*(){return(yield ie.get(`/brand/fallback/icons/${a.toLowerCase()}.svg`,{baseURL:e,responseType:"json"})).data}))),[e]))({cdnURL:a}),u=new se(null!=c?c:pe.fallback),h={baseURL:e,cdnURL:a,container:r,features:s,getToken:o,locale:n,onError:p,scope:d,theme:u};return ae(X,Object.assign({},h,{children:ae(te,Object.assign({cdnUrl:a,reference:d||void 0,resolveIcon:g,theme:u},{children:ae(oe,Object.assign({baseURL:e,defaultQueryClientOptions:m,getToken:o,headers:i,onApiError:l},{children:ae(Y,{children:t})}))}))}))},ce=({baseURL:e,children:a,features:t})=>{const r=le((()=>new se),[]),s=$(["globalFeatures"]),o=ne((()=>"none"),[]),i={baseURL:e,cdnURL:"mockCdnUrl",getFeatures:e=>{var a;return ee(null!==(a=$([e]))&&void 0!==a?a:{},null==t?void 0:t[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"]},s),t.globalFeatures),onError:()=>{},scope:"lmnt",theme:r};return ae(_.Provider,Object.assign({value:i},{children:ae(re,Object.assign({theme:r},{children:ae(oe,Object.assign({baseURL:e,getToken:o},{children:a}))}))}))};export{de as ElementsProvider,ce as ElementsTestProvider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "peerDependencies": {
5
5
  "@emotion/react": "11.x",
6
6
  "react-i18next": "11.x",
@@ -35,7 +35,7 @@
35
35
  "@rjsf/core": "5.16.1",
36
36
  "@rjsf/utils": "5.16.1",
37
37
  "@rjsf/validator-ajv8": "5.16.1",
38
- "@shipengine/giger": "1.17.0",
38
+ "@shipengine/giger": "1.18.0",
39
39
  "@shipengine/giger-theme": "1.7.0",
40
40
  "@shipengine/js-api": "2.1.1",
41
41
  "@shipengine/react-api": "3.2.1",
@@ -0,0 +1,23 @@
1
+ import { IGridFilters } from "../../grid-filters";
2
+ /**
3
+ * @internal
4
+ *
5
+ * # Created Date Filter Props
6
+ *
7
+ * @see {@link CreatedDateFilter | The `<CreatedDateFilter />` component}
8
+ */
9
+ type CreatedDateFilterProps = {
10
+ filters: IGridFilters;
11
+ onFiltersUpdated: (params: IGridFilters) => void;
12
+ };
13
+ /**
14
+ * @internal
15
+ *
16
+ * # CreatedDateFilter
17
+ *
18
+ * - The `<CreatedDateFilter />` component handle created date filter used in Shipments Grid.
19
+ *
20
+ * @see {@link CreatedDateFilterProps | The props for the `<CreatedDateFilter />` component}
21
+ */
22
+ export declare const CreatedDateFilter: ({ filters, onFiltersUpdated }: CreatedDateFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1,41 @@
1
+ export declare const styles: {
2
+ calendarContainer: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
3
+ border: string;
4
+ borderRadius: string;
5
+ };
6
+ calendarFooterButtons: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
7
+ alignSelf: "flex-end";
8
+ marginTop: number;
9
+ };
10
+ clearButton: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
11
+ marginRight: number;
12
+ };
13
+ input: () => {
14
+ width: string;
15
+ };
16
+ inputsArrow: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
17
+ marginLeft: number;
18
+ marginRight: number;
19
+ };
20
+ inputsWrapper: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
21
+ alignItems: "center";
22
+ display: "flex";
23
+ marginBottom: number;
24
+ };
25
+ mainButton: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
26
+ marginRight: number;
27
+ };
28
+ popover: () => {
29
+ maxWidth: string;
30
+ };
31
+ popoverCalendarWrapper: () => {
32
+ display: "flex";
33
+ flexDirection: "column";
34
+ };
35
+ popoverWrapper: () => {
36
+ display: "flex";
37
+ };
38
+ radioGroup: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
39
+ marginRight: number;
40
+ };
41
+ };
@@ -0,0 +1 @@
1
+ export { CreatedDateFilter } from "./created-date-filter";
@@ -0,0 +1,7 @@
1
+ export declare enum DateFilter {
2
+ TODAY = "today",
3
+ LAST7DAYS = "last_7",
4
+ LAST30DAYS = "last_30",
5
+ LAST365DAYS = "last_365",
6
+ CUSTOM = "custom"
7
+ }
@@ -0,0 +1 @@
1
+ export { DateFilter } from "./form";
@@ -0,0 +1,12 @@
1
+ import { DateFilter } from "../types";
2
+ type DateRange = {
3
+ end: Date;
4
+ start: Date;
5
+ };
6
+ /**
7
+ * Given a value from `enumValue` we will return an object with the end and start Date
8
+ * By default will return `DateFilter.TODAY`, the `DateFilter.CUSTOM` its being handled at the
9
+ * component.
10
+ */
11
+ export declare const getDateRangeFromEnum: (enumValue: DateFilter) => DateRange;
12
+ export {};
@@ -0,0 +1 @@
1
+ export { getDateRangeFromEnum } from "./dates";
@@ -0,0 +1,2 @@
1
+ export { ShipmentIdFilter } from "./shipment-id-filter";
2
+ export { CreatedDateFilter } from "./created-date-filter";
@@ -0,0 +1 @@
1
+ export { ShipmentIdFilter } from "./shipment-id-filter";
@@ -1,4 +1,4 @@
1
- import { IGridFilters } from "./grid-filters";
1
+ import { IGridFilters } from "../../grid-filters";
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -0,0 +1,10 @@
1
+ export declare const styles: {
2
+ mainButton: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
3
+ marginRight: number;
4
+ };
5
+ popoverButtons: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
6
+ display: "flex";
7
+ gap: number;
8
+ justifyContent: "flex-end";
9
+ };
10
+ };
@@ -15,6 +15,10 @@ export type IGridFilter<T> = {
15
15
  value: T | null;
16
16
  };
17
17
  export interface IGridFilters {
18
+ createdDate?: IGridFilter<{
19
+ end: Date;
20
+ start: Date;
21
+ }>;
18
22
  shipmentId: IGridFilter<string>;
19
23
  }
20
24
  /**
@@ -805,11 +805,18 @@ export declare const Element: ({ resources, ...props }: object & {
805
805
  rows: string;
806
806
  clearAll: string;
807
807
  shipmentId: string;
808
+ createdDate: string;
808
809
  shipmentIdFilter: string;
810
+ createdDateFilter: string;
809
811
  apply: string;
810
812
  clear: string;
811
813
  search: string;
812
814
  shipmentIdHint: string;
815
+ dateFilterToday: string;
816
+ dateFilterLast7Days: string;
817
+ dateFilterLast30Days: string;
818
+ dateFilterLast12Months: string;
819
+ dateFilterCustom: string;
813
820
  };
814
821
  insuranceProviders: {
815
822
  carrier: string;
@@ -856,11 +856,18 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
856
856
  rows: string;
857
857
  clearAll: string;
858
858
  shipmentId: string;
859
+ createdDate: string;
859
860
  shipmentIdFilter: string;
861
+ createdDateFilter: string;
860
862
  apply: string;
861
863
  clear: string;
862
864
  search: string;
863
865
  shipmentIdHint: string;
866
+ dateFilterToday: string;
867
+ dateFilterLast7Days: string;
868
+ dateFilterLast30Days: string;
869
+ dateFilterLast12Months: string;
870
+ dateFilterCustom: string;
864
871
  };
865
872
  insuranceProviders: {
866
873
  carrier: string;
@@ -873,11 +873,18 @@ export declare const Element: ({ resources, ...props }: ShipEngineCarriersProps
873
873
  rows: string;
874
874
  clearAll: string;
875
875
  shipmentId: string;
876
+ createdDate: string;
876
877
  shipmentIdFilter: string;
878
+ createdDateFilter: string;
877
879
  apply: string;
878
880
  clear: string;
879
881
  search: string;
880
882
  shipmentIdHint: string;
883
+ dateFilterToday: string;
884
+ dateFilterLast7Days: string;
885
+ dateFilterLast30Days: string;
886
+ dateFilterLast12Months: string;
887
+ dateFilterCustom: string;
881
888
  };
882
889
  insuranceProviders: {
883
890
  carrier: string;
@@ -872,11 +872,18 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
872
872
  rows: string;
873
873
  clearAll: string;
874
874
  shipmentId: string;
875
+ createdDate: string;
875
876
  shipmentIdFilter: string;
877
+ createdDateFilter: string;
876
878
  apply: string;
877
879
  clear: string;
878
880
  search: string;
879
881
  shipmentIdHint: string;
882
+ dateFilterToday: string;
883
+ dateFilterLast7Days: string;
884
+ dateFilterLast30Days: string;
885
+ dateFilterLast12Months: string;
886
+ dateFilterCustom: string;
880
887
  };
881
888
  insuranceProviders: {
882
889
  carrier: string;
@@ -806,11 +806,18 @@ export declare const Element: ({ resources, ...props }: ManageFundingProps & {
806
806
  rows: string;
807
807
  clearAll: string;
808
808
  shipmentId: string;
809
+ createdDate: string;
809
810
  shipmentIdFilter: string;
811
+ createdDateFilter: string;
810
812
  apply: string;
811
813
  clear: string;
812
814
  search: string;
813
815
  shipmentIdHint: string;
816
+ dateFilterToday: string;
817
+ dateFilterLast7Days: string;
818
+ dateFilterLast30Days: string;
819
+ dateFilterLast12Months: string;
820
+ dateFilterCustom: string;
814
821
  };
815
822
  insuranceProviders: {
816
823
  carrier: string;
@@ -840,11 +840,18 @@ export declare const Element: ({ resources, ...props }: object & {
840
840
  rows: string;
841
841
  clearAll: string;
842
842
  shipmentId: string;
843
+ createdDate: string;
843
844
  shipmentIdFilter: string;
845
+ createdDateFilter: string;
844
846
  apply: string;
845
847
  clear: string;
846
848
  search: string;
847
849
  shipmentIdHint: string;
850
+ dateFilterToday: string;
851
+ dateFilterLast7Days: string;
852
+ dateFilterLast30Days: string;
853
+ dateFilterLast12Months: string;
854
+ dateFilterCustom: string;
848
855
  };
849
856
  insuranceProviders: {
850
857
  carrier: string;
@@ -806,11 +806,18 @@ export declare const Element: ({ resources, ...props }: PaymentMethodSettingsPro
806
806
  rows: string;
807
807
  clearAll: string;
808
808
  shipmentId: string;
809
+ createdDate: string;
809
810
  shipmentIdFilter: string;
811
+ createdDateFilter: string;
810
812
  apply: string;
811
813
  clear: string;
812
814
  search: string;
813
815
  shipmentIdHint: string;
816
+ dateFilterToday: string;
817
+ dateFilterLast7Days: string;
818
+ dateFilterLast30Days: string;
819
+ dateFilterLast12Months: string;
820
+ dateFilterCustom: string;
814
821
  };
815
822
  insuranceProviders: {
816
823
  carrier: string;
@@ -1016,11 +1016,18 @@ export declare const Element: ({ resources, ...props }: ElementProps & {
1016
1016
  rows: string;
1017
1017
  clearAll: string;
1018
1018
  shipmentId: string;
1019
+ createdDate: string;
1019
1020
  shipmentIdFilter: string;
1021
+ createdDateFilter: string;
1020
1022
  apply: string;
1021
1023
  clear: string;
1022
1024
  search: string;
1023
1025
  shipmentIdHint: string;
1026
+ dateFilterToday: string;
1027
+ dateFilterLast7Days: string;
1028
+ dateFilterLast30Days: string;
1029
+ dateFilterLast12Months: string;
1030
+ dateFilterCustom: string;
1024
1031
  };
1025
1032
  insuranceProviders: {
1026
1033
  carrier: string;
@@ -1089,11 +1096,6 @@ export declare const Element: ({ resources, ...props }: ElementProps & {
1089
1096
  invalidStateProvince: string;
1090
1097
  invalidString: string;
1091
1098
  nonnegative: string;
1092
- /**
1093
- * # Purchase Label Component Props
1094
- *
1095
- * @see {@link PurchaseLabel.Component | The **Common Props** used in the `<PurchaseLabel /> component`}
1096
- */
1097
1099
  nonnegativeList: string;
1098
1100
  positive: string;
1099
1101
  positiveList: string;
@@ -905,11 +905,18 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
905
905
  rows: string;
906
906
  clearAll: string;
907
907
  shipmentId: string;
908
+ createdDate: string;
908
909
  shipmentIdFilter: string;
910
+ createdDateFilter: string;
909
911
  apply: string;
910
912
  clear: string;
911
913
  search: string;
912
914
  shipmentIdHint: string;
915
+ dateFilterToday: string;
916
+ dateFilterLast7Days: string;
917
+ dateFilterLast30Days: string;
918
+ dateFilterLast12Months: string;
919
+ dateFilterCustom: string;
913
920
  };
914
921
  insuranceProviders: {
915
922
  carrier: string;
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { SE } from "@shipengine/js-api";
3
2
  import { IGridFilters } from "../../../components";
4
3
  import { ShipmentsGridProps } from "../shipments-grid";
5
- export declare const useShipmentsGrid: ({ shipmentStatus, showShipmentIdFilter, }: ShipmentsGridProps) => {
4
+ export declare const useShipmentsGrid: ({ shipmentStatus, showShipmentIdFilter, showCreatedDateFilter, }: ShipmentsGridProps) => {
6
5
  clearAllFilters: () => void;
7
6
  filters: IGridFilters;
8
7
  getGridData: () => {
@@ -89,7 +88,7 @@ export declare const useShipmentsGrid: ({ shipmentStatus, showShipmentIdFilter,
89
88
  showPagination: boolean;
90
89
  totalElements: number;
91
90
  };
92
- setFilters: import("react").Dispatch<import("react").SetStateAction<IGridFilters>>;
91
+ setFilters: (newFilters: IGridFilters) => void;
93
92
  shipments: {
94
93
  serviceName: string | null | undefined;
95
94
  addressValidation?: SE.AddressValidation | undefined;
@@ -15,6 +15,10 @@ export type ShipmentsGridProps = {
15
15
  * If no value is defined, all shipments will be rendered.
16
16
  */
17
17
  shipmentStatus?: SE.ShipmentStatus;
18
+ /**
19
+ * `showCreatedDateFilter` controls the display of the Created Date filter
20
+ */
21
+ showCreatedDateFilter?: boolean;
18
22
  /**
19
23
  * `showShipmentIdFilter` controls the display of the shipmentId search filter
20
24
  */
@@ -41,7 +45,7 @@ export type ShipmentsGridProps = {
41
45
  *
42
46
  * @see {@link ShipmentsGrid.Element | The **Element** created to render `<ShipmentsGrid />`}
43
47
  */
44
- export declare const Component: ({ onRowClick, shipmentStatus, showShipmentIdFilter, }: ShipmentsGridProps) => import("@emotion/react/jsx-runtime").JSX.Element;
48
+ export declare const Component: ({ onRowClick, shipmentStatus, showShipmentIdFilter, showCreatedDateFilter, }: ShipmentsGridProps) => import("@emotion/react/jsx-runtime").JSX.Element;
45
49
  /**
46
50
  * # Registered Shipments Grid Element
47
51
  *
@@ -106,7 +110,7 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & {
106
110
  resultTitles: {
107
111
  approved: string;
108
112
  rejected: string; /**
109
- * `showShipmentIdFilter` controls the display of the shipmentId search filter
113
+ * `showCreatedDateFilter` controls the display of the Created Date filter
110
114
  */
111
115
  };
112
116
  voidedOn: string;
@@ -210,7 +214,7 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & {
210
214
  poBox: {
211
215
  title: string;
212
216
  description: string; /**
213
- * `showShipmentIdFilter` controls the display of the shipmentId search filter
217
+ * `showCreatedDateFilter` controls the display of the Created Date filter
214
218
  */
215
219
  };
216
220
  carrier: {
@@ -514,7 +518,9 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & {
514
518
  title: string;
515
519
  message: string;
516
520
  };
517
- isLoading: string;
521
+ isLoading: string; /**
522
+ * `showShipmentIdFilter` controls the display of the shipmentId search filter
523
+ */
518
524
  labels: {
519
525
  amount: string;
520
526
  };
@@ -875,11 +881,18 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & {
875
881
  rows: string;
876
882
  clearAll: string;
877
883
  shipmentId: string;
884
+ createdDate: string;
878
885
  shipmentIdFilter: string;
886
+ createdDateFilter: string;
879
887
  apply: string;
880
888
  clear: string;
881
889
  search: string;
882
890
  shipmentIdHint: string;
891
+ dateFilterToday: string;
892
+ dateFilterLast7Days: string;
893
+ dateFilterLast30Days: string;
894
+ dateFilterLast12Months: string;
895
+ dateFilterCustom: string;
883
896
  };
884
897
  insuranceProviders: {
885
898
  carrier: string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This functions receive an start and end Dates and prepare an object that can be passed to the API.
3
+ */
4
+ export declare const getCreatedDateFilterValue: (start: Date | undefined, end: Date | undefined) => {
5
+ createdAtEnd?: undefined;
6
+ createdAtStart?: undefined;
7
+ } | {
8
+ createdAtEnd: string;
9
+ createdAtStart: string;
10
+ };
11
+ /**
12
+ * Given an start/end Dates and the Shipment Creation date we check if the Shipment creation date
13
+ * its the same as the one selected by the user or within an interval
14
+ */
15
+ export declare const filterDateAndShipmentDateIsSameOrWithinInterval: (start: Date, end: Date, shipmentCreationDate: string) => boolean;
@@ -0,0 +1 @@
1
+ export { getCreatedDateFilterValue, filterDateAndShipmentDateIsSameOrWithinInterval, } from "./created-date-value";
@@ -818,11 +818,18 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
818
818
  rows: string;
819
819
  clearAll: string;
820
820
  shipmentId: string;
821
+ createdDate: string;
821
822
  shipmentIdFilter: string;
823
+ createdDateFilter: string;
822
824
  apply: string;
823
825
  clear: string;
824
826
  search: string;
825
827
  shipmentIdHint: string;
828
+ dateFilterToday: string;
829
+ dateFilterLast7Days: string;
830
+ dateFilterLast30Days: string;
831
+ dateFilterLast12Months: string;
832
+ dateFilterCustom: string;
826
833
  };
827
834
  insuranceProviders: {
828
835
  carrier: string;
@@ -805,11 +805,18 @@ export declare const Element: ({ resources, ...props }: object & {
805
805
  rows: string;
806
806
  clearAll: string;
807
807
  shipmentId: string;
808
+ createdDate: string;
808
809
  shipmentIdFilter: string;
810
+ createdDateFilter: string;
809
811
  apply: string;
810
812
  clear: string;
811
813
  search: string;
812
814
  shipmentIdHint: string;
815
+ dateFilterToday: string;
816
+ dateFilterLast7Days: string;
817
+ dateFilterLast30Days: string;
818
+ dateFilterLast12Months: string;
819
+ dateFilterCustom: string;
813
820
  };
814
821
  insuranceProviders: {
815
822
  carrier: string;