@loadsmart/loadsmart-ui 7.2.0 → 7.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2539,7 +2539,7 @@
2539
2539
  `}
2540
2540
  `,Id=g.default(fe)`
2541
2541
  ${l.conditional({"transform: rotate(180deg);":l.whenProps({$rotate:!0})})}
2542
- `;function Hd(t){const{expanded:n,disabled:r}=t,o=e.__rest(t,["expanded","disabled"]);return d.default.createElement(Bd,Object.assign({type:"button"},o,{"aria-haspopup":"true","aria-expanded":n,disabled:r,trailing:!r&&d.default.createElement(Id,{name:"chevron-down",size:16,$rotate:n})}))}const Wd={normalize:!0};function Ud(e,t=Wd){const n=Object.assign(Object.assign({},Wd),t),r=function(){let t=new Date;null!=e&&(t=new Date(e));return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),n.normalize?12:t.getUTCHours(),n.normalize?0:t.getUTCMinutes(),n.normalize?0:t.getUTCSeconds(),n.normalize?0:t.getUTCMilliseconds()))}();return{get:()=>r,getYear:()=>r.getUTCFullYear(),getMonth:()=>r.getUTCMonth(),getDate:()=>r.getUTCDate(),getTime:()=>r.getTime(),getWeekday:()=>r.getUTCDay(),getHours:()=>r.getUTCHours(),getMinutes:()=>r.getUTCMinutes(),getSeconds:()=>r.getUTCSeconds(),getMilliseconds:()=>r.getUTCMilliseconds(),matches(...e){if(Re(e))return!1;const t=e.map(qd),n=Ud(r);return t.some((e=>e(n)))},add:(e,t)=>Yd(r,e,t),subtract:(e,t)=>Yd(r,e,-1*t),set(e,t){const n={year:r.getUTCFullYear(),month:r.getUTCMonth(),day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds(),[e]:t};return r.setUTCFullYear(n.year),r.setUTCMonth(n.month),r.setUTCDate(n.day),r.setUTCHours(n.hour),r.setUTCMinutes(n.minute),r.setUTCSeconds(n.second),r.setUTCMilliseconds(n.millisecond),this},is:(e,t,n)=>function(t,n){let r;switch(e){case">=":r=t>=n;break;case">":r=t>n;break;case"<":r=t<n;break;case"<=":r=t<=n;break;default:r=t===n}return r}(Vd(r,n),Vd(t.get(),n)),toString:()=>r.toISOString()}}function Vd(e,t="day"){const n=Qd.toString(),r={year:4,month:7,day:10,hour:13,minute:16,second:19,millisecond:24}[t];if(null==r)throw new Error(`precision ${t} is not supported`);const o=n.slice(r),a=e.toISOString().slice(0,r);return new Date(`${a}${o}`).getTime()}function Yd(e,t,n){const r={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0,[t]:n};return Ud(new Date(Date.UTC(e.getUTCFullYear()+r.year,e.getUTCMonth()+r.month,e.getUTCDate()+r.day,e.getUTCHours()+r.hour,e.getUTCMinutes()+r.minute,e.getUTCSeconds()+r.second,e.getUTCMilliseconds()+r.millisecond)),{normalize:!1})}function qd(e){if(o.isFunction(e))return e;const[t,n]=function(e){let t;if(Array.isArray(e)){const n=null!=e[0]?Ud(e[0]):Qd,r=null!=e[1]?Ud(e[1]):Jd;t=[n.getTime(),r.getTime()]}else{const n=Ud(e).getTime();t=[n,n]}return t}(e);return function(e){if(t>n)throw new Zd([t,n]);return t<=e.getTime()&&e.getTime()<=n}}function Gd(e,t=2){return String(e).padStart(t,"0")}class Zd extends Error{constructor([e,t]){super(`Invalid constraint: [${e}, ${t}]`)}}const Kd=Ud(),Qd=Ud(0,{normalize:!1}),Jd=Ud(8639999999999999);function Xd(e){const{constraints:n,onSelect:r,mode:o="single"}=e,l="single"==o?1:2,i=Dr(),[s,c]=t.useState((()=>ru(e.selected))),[d,u]=t.useState((()=>{const t=null!=e.month?e.month:Kd.getMonth();return nu(null!=e.year?e.year:Kd.getYear(),t,l)}));function g(e){var t,n;const[r]=d,o=new Date(null!==(t=e.year)&&void 0!==t?t:r.year,null!==(n=e.month)&&void 0!==n?n:r.month);u(nu(o.getFullYear(),o.getMonth(),l))}function f(e){const[t,n]=ru(e);function o(e){return null!=e?Ud(e).toString():null}c([t,n]),i&&(null==r||r([o(t),o(n)]))}return t.useEffect((function(){g({month:e.month,year:e.year})}),[e.month,e.year]),t.useEffect((function(){const t=ru(e.selected);t[0]==s[0]&&t[1]==s[1]||c(t)}),[e.selected]),{mode:o,months:d,selected:s,constraints:a.toArray(n||[]),clear:function(){f([null,null])},set:g,select:f}}const eu=864e5;function tu(e,t){const n=Ud(Date.UTC(e,t)),r=n.getWeekday(),o=32-new Date(Date.UTC(e,t,32)).getUTCDate(),a=[];for(let e=r;e>0;e--)a.push(Ud(n.getTime()-e*eu));for(let e=0;e<o;e++)a.push(Ud(n.getTime()+e*eu));for(let e=0;(r+o+e)%7!=0;e++)a.push(Ud(n.getTime()+(o+e)*eu));return{month:n.getMonth(),year:n.getYear(),days:a}}function nu(e,t,n=1){if(t<0||t>11)throw new Error("Invalid month! Please, provide a number between 0 (January) and 11 (December).");const r=new Array;for(let o=0;o<n;o++)r.push(tu(e,t+o));return r}function ru(e){const[t,n]=a.toArray(e);return[null!=t?Ud(t).getTime():null,null!=n?Ud(null!=n?n:t).getTime():null]}const ou=(e,t)=>{const n=lu[t].format(e.get());return(iu[t]||o.identity)(n)};function au(e){const t=function(e){function t(e){return null!=e&&["M","d","D","Y","H","h","m","s","A","a","o"].includes(e)?"token":"string"}const n=[];let r,o=0,a=!1;for(;o<e.length;){const l=Math.max(0,n.length-1),i=e.charAt(o);o++,["[","]"].includes(i)?a="["===i:a?n[l]=`${n[l]||""}${i}`:r!==i&&[t(r),t(i)].includes("token")?n.push(i):n[l]=`${n[l]||""}${i}`,r=i}return n}(e);return{format:e=>t.map(((n,r)=>{const o=t[r-1];return n in lu?ou(e,n):n in su&&su[n].valid(o)?su[n].format(ou(e,o)):n})).join("")}}const lu={MM:new Intl.DateTimeFormat("en-US",{month:"2-digit"}),MMM:new Intl.DateTimeFormat("en-US",{month:"short"}),MMMM:new Intl.DateTimeFormat("en-US",{month:"long"}),D:new Intl.DateTimeFormat("en-US",{day:"numeric"}),DD:new Intl.DateTimeFormat("en-US",{day:"2-digit"}),ddd:new Intl.DateTimeFormat("en-US",{weekday:"short"}),dddd:new Intl.DateTimeFormat("en-US",{weekday:"long"}),YYYY:new Intl.DateTimeFormat("en-US",{year:"numeric"}),HH:new Intl.DateTimeFormat("en-US",{hour:"2-digit",hour12:!1}),hh:new Intl.DateTimeFormat("en-US",{hour:"2-digit",hour12:!0}),mm:new Intl.DateTimeFormat("en-US",{minute:"2-digit",hour12:!1}),ss:new Intl.DateTimeFormat("en-US",{second:"2-digit",hour12:!1}),a:new Intl.DateTimeFormat("en-US",{hour:"2-digit",hour12:!0}),A:new Intl.DateTimeFormat("en-US",{hour:"2-digit",hour12:!0})},iu={hh:e=>e?Gd(e.split(/\s/)[0],2):e,HH:e=>e?Gd(e,2):e,mm:e=>e?Gd(e,2):e,ss:e=>e?Gd(e,2):e,a:e=>e?(e.split(/\s/)[1]||"").toLowerCase():e,A:e=>e?(e.split(/\s/)[1]||"").toUpperCase():e},su={o:{valid:e=>new Set(["D","DD"]).has(e),format:e=>{return(t=parseInt(e,10))%10==1&&11!==t?"st":t%10==2&&12!==t?"nd":t%10==3&&13!==t?"rd":"th";var t}}},cu=g.default(Sn)`
2542
+ `;function Hd(t){const{expanded:n,disabled:r}=t,o=e.__rest(t,["expanded","disabled"]);return d.default.createElement(Bd,Object.assign({type:"button"},o,{"aria-haspopup":"true","aria-expanded":n,disabled:r,trailing:!r&&d.default.createElement(Id,{name:"chevron-down",size:16,$rotate:n})}))}const Wd={normalize:!0};function Ud(e,t=Wd){const n=Object.assign(Object.assign({},Wd),t),r=function(){let t=new Date;null!=e&&(t=new Date(e));return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),n.normalize?12:t.getUTCHours(),n.normalize?0:t.getUTCMinutes(),n.normalize?0:t.getUTCSeconds(),n.normalize?0:t.getUTCMilliseconds()))}();return{get:()=>r,getYear:()=>r.getUTCFullYear(),getMonth:()=>r.getUTCMonth(),getDate:()=>r.getUTCDate(),getTime:()=>r.getTime(),getWeekday:()=>r.getUTCDay(),getHours:()=>r.getUTCHours(),getMinutes:()=>r.getUTCMinutes(),getSeconds:()=>r.getUTCSeconds(),getMilliseconds:()=>r.getUTCMilliseconds(),matches(...e){if(Re(e))return!1;const t=e.map(qd),n=Ud(r);return t.some((e=>e(n)))},add:(e,t)=>Yd(r,e,t),subtract:(e,t)=>Yd(r,e,-1*t),set(e,t){const n={year:r.getUTCFullYear(),month:r.getUTCMonth(),day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds(),[e]:t};return r.setUTCFullYear(n.year),r.setUTCMonth(n.month),r.setUTCDate(n.day),r.setUTCHours(n.hour),r.setUTCMinutes(n.minute),r.setUTCSeconds(n.second),r.setUTCMilliseconds(n.millisecond),this},is:(e,t,n)=>function(t,n){let r;switch(e){case">=":r=t>=n;break;case">":r=t>n;break;case"<":r=t<n;break;case"<=":r=t<=n;break;default:r=t===n}return r}(Vd(r,n),Vd(t.get(),n)),toString:()=>r.toISOString()}}function Vd(e,t="day"){const n=Qd.toString(),r={year:4,month:7,day:10,hour:13,minute:16,second:19,millisecond:24}[t];if(null==r)throw new Error(`precision ${t} is not supported`);const o=n.slice(r),a=e.toISOString().slice(0,r);return new Date(`${a}${o}`).getTime()}function Yd(e,t,n){const r={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0,[t]:n};return Ud(new Date(Date.UTC(e.getUTCFullYear()+r.year,e.getUTCMonth()+r.month,e.getUTCDate()+r.day,e.getUTCHours()+r.hour,e.getUTCMinutes()+r.minute,e.getUTCSeconds()+r.second,e.getUTCMilliseconds()+r.millisecond)),{normalize:!1})}function qd(e){if(o.isFunction(e))return e;const[t,n]=function(e){let t;if(Array.isArray(e)){const n=null!=e[0]?Ud(e[0]):Qd,r=null!=e[1]?Ud(e[1]):Jd;t=[n.getTime(),r.getTime()]}else{const n=Ud(e).getTime();t=[n,n]}return t}(e);return function(e){if(t>n)throw new Zd([t,n]);return t<=e.getTime()&&e.getTime()<=n}}function Gd(e,t=2){return String(e).padStart(t,"0")}class Zd extends Error{constructor([e,t]){super(`Invalid constraint: [${e}, ${t}]`)}}const Kd=Ud(),Qd=Ud(0,{normalize:!1}),Jd=Ud(8639999999999999);function Xd(e){const{constraints:n,onSelect:r,mode:o="single"}=e,l="single"==o?1:2,i=Dr(),[s,c]=t.useState((()=>ru(e.selected))),[d,u]=t.useState((()=>{const t=null!=e.month?e.month:Kd.getMonth();return nu(null!=e.year?e.year:Kd.getYear(),t,l)}));function g(e){var t,n;const[r]=d,o=new Date(null!==(t=e.year)&&void 0!==t?t:r.year,null!==(n=e.month)&&void 0!==n?n:r.month);u(nu(o.getFullYear(),o.getMonth(),l))}function f(e){const[t,n]=ru(e);function o(e){return null!=e?Ud(e).toString():null}c([t,n]),i&&(null==r||r([o(t),o(n)]))}return t.useEffect((function(){g({month:e.month,year:e.year})}),[e.month,e.year]),t.useEffect((function(){const t=ru(e.selected);t[0]==s[0]&&t[1]==s[1]||c(t)}),[e.selected]),{mode:o,months:d,selected:s,constraints:a.toArray(n||[]),clear:function(){f([null,null])},set:g,select:f}}const eu=864e5;function tu(e,t){const n=Ud(Date.UTC(e,t)),r=n.getWeekday(),o=32-new Date(Date.UTC(e,t,32)).getUTCDate(),a=[];for(let e=r;e>0;e--)a.push(Ud(n.getTime()-e*eu));for(let e=0;e<o;e++)a.push(Ud(n.getTime()+e*eu));for(let e=0;(r+o+e)%7!=0;e++)a.push(Ud(n.getTime()+(o+e)*eu));return{month:n.getMonth(),year:n.getYear(),days:a}}function nu(e,t,n=1){if(t<0||t>11)throw new Error("Invalid month! Please, provide a number between 0 (January) and 11 (December).");const r=new Array;for(let o=0;o<n;o++)r.push(tu(e,t+o));return r}function ru(e){const[t,n]=a.toArray(e);return[null!=t?Ud(t).getTime():null,null!=n?Ud(null!=n?n:t).getTime():null]}const ou=(e,t)=>{const n=lu[t].format(e.get());return(iu[t]||o.identity)(n)};function au(e){const t=function(e){function t(e){return null!=e&&["M","d","D","Y","H","h","m","s","A","a","o"].includes(e)?"token":"string"}const n=[];let r,o=0,a=!1;for(;o<e.length;){const l=Math.max(0,n.length-1),i=e.charAt(o);o++,["[","]"].includes(i)?a="["===i:a?n[l]=`${n[l]||""}${i}`:r!==i&&[t(r),t(i)].includes("token")?n.push(i):n[l]=`${n[l]||""}${i}`,r=i}return n}(e);return{format:e=>t.map(((n,r)=>{const o=t[r-1];return n in lu?ou(e,n):n in su&&su[n].valid(o)?su[n].format(ou(e,o)):n})).join("")}}const lu={MM:new Intl.DateTimeFormat("en-US",{month:"2-digit"}),MMM:new Intl.DateTimeFormat("en-US",{month:"short"}),MMMM:new Intl.DateTimeFormat("en-US",{month:"long"}),D:new Intl.DateTimeFormat("en-US",{day:"numeric"}),DD:new Intl.DateTimeFormat("en-US",{day:"2-digit"}),ddd:new Intl.DateTimeFormat("en-US",{weekday:"short"}),dddd:new Intl.DateTimeFormat("en-US",{weekday:"long"}),YYYY:new Intl.DateTimeFormat("en-US",{year:"numeric"}),HH:new Intl.DateTimeFormat("en-US",{hour:"2-digit",hourCycle:"h23"}),hh:new Intl.DateTimeFormat("en-US",{hour:"2-digit",hour12:!0}),mm:new Intl.DateTimeFormat("en-US",{minute:"2-digit",hour12:!1}),ss:new Intl.DateTimeFormat("en-US",{second:"2-digit",hour12:!1}),a:new Intl.DateTimeFormat("en-US",{hour:"2-digit",hour12:!0}),A:new Intl.DateTimeFormat("en-US",{hour:"2-digit",hour12:!0})},iu={hh:e=>e?Gd(e.split(/\s/)[0],2):e,HH:e=>e?Gd(e,2):e,mm:e=>e?Gd(e,2):e,ss:e=>e?Gd(e,2):e,a:e=>e?(e.split(/\s/)[1]||"").toLowerCase():e,A:e=>e?(e.split(/\s/)[1]||"").toUpperCase():e},su={o:{valid:e=>new Set(["D","DD"]).has(e),format:e=>{return(t=parseInt(e,10))%10==1&&11!==t?"st":t%10==2&&12!==t?"nd":t%10==3&&13!==t?"rd":"th";var t}}},cu=g.default(Sn)`
2543
2543
  ${en(l.conditional({body:l.whenProps({$status:["default","faded"]}),"body-bold":l.whenProps({$status:["current-day","selection-start","selection","selection-end"]})}))}
2544
2544
 
2545
2545
  user-select: none;