@solace-health/ui 0.4.5 → 0.4.6

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.mjs CHANGED
@@ -287,7 +287,7 @@ var w2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(w2||{});var X1
287
287
  `}
288
288
  `,K3=({className:e="",children:t="",size:o="md",allCaps:r=!1,color:i=""})=>jsx(X3,{allCaps:r,className:e,size:o,style:{color:i},children:t}),a1=K3;var U3=n.span`
289
289
  margin: 0;
290
- `,Y3=({children:e,as:t,length:o=120})=>{let i=((s,p,a="...")=>{let c=s.length>p?a:"";return s.substring(0,p)+c})(e,o);return jsx(U3,{as:t,children:i})},l1=Y3;var d={Body:i1,Display:s1,Error:e2,Header:a1,Truncated:l1};var t5=({startTime:e="00:00",endTime:t="24:00",interval:o=30,defaultValue:r="",onChange:i=()=>null})=>{let[s,p]=useState("closed"),[a,c]=useState(),h=useCallback(()=>{let C=DateTime.fromFormat(t,"HH:mm"),u=Duration.fromObject({minutes:o}),v=[],w=DateTime.fromFormat(e,"hh:mm");for(;w<C;)v.push({label:w.toFormat("h:mm a"),value:{hour:w.toFormat("HH"),min:w.toFormat("mm"),raw:w.toFormat("HH:mm"),formatted:w.toFormat("h:mm a")}}),w=w.plus(u);return v},[e,t,o,r])();return useEffect(()=>{let C=h.find(u=>u.value.raw===(r||e));c(C);},[]),jsx(o1,{onItemClick:C=>{let u=h.find(v=>v.value.raw===C.value.raw);c(u),i(C);},onMenuChange:C=>p(C),cta:jsxs(t1,{children:[jsx(d.Body,{size:"lg",children:a?.value.formatted||"-"}),jsx(z.Caret,{direction:["open","opening"].includes(s)?"up":"down"})]}),children:h.map((C,u,v)=>jsxs(Fragment,{children:[jsx(n1,{label:C.label,value:C.value},C.label),v.length-1!==u&&jsx(r1,{})]}))})},g2=t5;var n5=(t=>(t.LOADING_LISTINGS="loadingListings",t))(n5||{}),I=class{client;constructor(t){this.client=g1.createClient(t);}async getLottieFile({slug:t}){let r=(await this.client.getEntries({content_type:"lottie"})).items.find(i=>i.fields.slug===t);return r?r.fields.lottieFile:(console.warn(`Lottie file not found for slug ${t}`),null)}async getImage(t){let r=(await this.client.getEntries({content_type:"image"})).items.find(i=>i.fields.slug===t);return r?r.fields.image.fields.file.url:null}};var p5=({animationData:e,height:t,width:o,loop:r})=>{let i=useSpring({from:{opacity:0},to:{opacity:1}});return jsx(animated.div,{style:i,children:jsx(s5,{loop:r,animationData:e,play:!0,style:{width:o,height:t},rendererSettings:{preserveAspectRatio:"xMidYMid slice"}})})},d5=({height:e,width:t,loop:o,slug:r,contentfulConfig:i})=>{let[s,p]=useState();return useEffect(()=>{new I(i).getLottieFile({slug:r}).then(a=>{p(a);});},[]),s?jsx(p5,{animationData:s,height:e,width:t,loop:o}):null};var f5=n.div`
290
+ `,Y3=({children:e,as:t,length:o=120})=>{let i=((s,p,a="...")=>{let c=s.length>p?a:"";return s.substring(0,p)+c})(e,o);return jsx(U3,{as:t,children:i})},l1=Y3;var d={Body:i1,Display:s1,Error:e2,Header:a1,Truncated:l1};var t5=({startTime:e="00:00",endTime:t="24:00",interval:o=30,defaultValue:r="",onChange:i=()=>null})=>{let[s,p]=useState("closed"),[a,c]=useState(),h=useCallback(()=>{let C=DateTime.fromFormat(t,"HH:mm"),u=Duration.fromObject({minutes:o}),v=[],w=DateTime.fromFormat(e,"hh:mm");for(;w<C;)v.push({label:w.toFormat("h:mm a"),value:{hour:w.toFormat("HH"),min:w.toFormat("mm"),raw:w.toFormat("HH:mm"),formatted:w.toFormat("h:mm a")}}),w=w.plus(u);return v},[e,t,o,r])();return useEffect(()=>{let C=h.find(u=>u.value.raw===(r||e));c(C);},[r]),jsx(o1,{onItemClick:C=>{let u=h.find(v=>v.value.raw===C.value.raw);c(u),i(C);},onMenuChange:C=>p(C),cta:jsxs(t1,{children:[jsx(d.Body,{size:"lg",children:a?.value.formatted||"-"}),jsx(z.Caret,{direction:["open","opening"].includes(s)?"up":"down"})]}),children:h.map((C,u,v)=>jsxs(Fragment,{children:[jsx(n1,{label:C.label,value:C.value},C.label),v.length-1!==u&&jsx(r1,{})]}))})},g2=t5;var n5=(t=>(t.LOADING_LISTINGS="loadingListings",t))(n5||{}),I=class{client;constructor(t){this.client=g1.createClient(t);}async getLottieFile({slug:t}){let r=(await this.client.getEntries({content_type:"lottie"})).items.find(i=>i.fields.slug===t);return r?r.fields.lottieFile:(console.warn(`Lottie file not found for slug ${t}`),null)}async getImage(t){let r=(await this.client.getEntries({content_type:"image"})).items.find(i=>i.fields.slug===t);return r?r.fields.image.fields.file.url:null}};var p5=({animationData:e,height:t,width:o,loop:r})=>{let i=useSpring({from:{opacity:0},to:{opacity:1}});return jsx(animated.div,{style:i,children:jsx(s5,{loop:r,animationData:e,play:!0,style:{width:o,height:t},rendererSettings:{preserveAspectRatio:"xMidYMid slice"}})})},d5=({height:e,width:t,loop:o,slug:r,contentfulConfig:i})=>{let[s,p]=useState();return useEffect(()=>{new I(i).getLottieFile({slug:r}).then(a=>{p(a);});},[]),s?jsx(p5,{animationData:s,height:e,width:t,loop:o}):null};var f5=n.div`
291
291
  align-items: center;
292
292
  background-color: rgba(0, 0, 0, 0.2);
293
293
  bottom: 0;