@solace-health/ui 0.3.16 → 0.3.19

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
@@ -323,7 +323,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
323
323
  font-weight: 500;
324
324
  line-height: 30px;
325
325
  }
326
- `,M5=({defaultState:e=!1,name:t,label:r={active:"YES",inactive:"NO"},handleEvent:n=null,value:i})=>{let s=useFormContext(),[l,a]=useState(e);return useEffect(()=>{s&&s.setValue(t,i);},[]),useEffect(()=>{a(e);},[e]),jsxs(w5,{htmlFor:t,children:[jsx(v5,{type:"checkbox",checked:l,onClick:p=>{a(!l),s&&s.setValue(t,p.target.value),n&&n(p.target.value);},id:t,name:t,value:i}),jsx(k5,{children:jsx(c.Body,{color:"#fff",children:l?r.active:r.inactive})})]})},p2=M5;var B5=o(c.Body)`
326
+ `,M5=({defaultState:e=!1,name:t,label:r={active:"YES",inactive:"NO"},handleEvent:n=null,value:i})=>{let s=useFormContext(),[l,a]=useState(e);return useEffect(()=>{s&&e&&s.setValue(t,i);},[]),useEffect(()=>{a(e);},[e]),jsxs(w5,{htmlFor:t,children:[jsx(v5,{type:"checkbox",checked:l,onClick:p=>{a(!l),s&&s.setValue(t,p.target.value),n&&n(p.target.value);},id:t,name:t,value:i}),jsx(k5,{children:jsx(c.Body,{color:"#fff",children:l?r.active:r.inactive})})]})},p2=M5;var B5=o(c.Body)`
327
327
  margin-bottom: 5px;
328
328
  font-weight: ${({isLabelBold:e})=>e?"bold":"regular"};
329
329
  text-align: start;
@@ -418,6 +418,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
418
418
  position: absolute;
419
419
  left: 0px;
420
420
  top: 0px;
421
+ background: white;
421
422
  width: 20px;
422
423
  height: 20px;
423
424
  border-radius: 4px;
@@ -481,7 +482,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
481
482
  background: none;
482
483
  position: absolute;
483
484
  top: -3px;
484
- padding-left: 30px;
485
+ padding: 0 0 0 30px;
485
486
  font-family: ${({theme:C})=>C.typography.family.script};
486
487
  font-weight: ${({theme:C})=>C.typography.weight.normal};
487
488
  font-size: 24px;
@@ -527,6 +528,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
527
528
  + label::after {
528
529
  content: "";
529
530
  position: absolute;
531
+ background: white;
530
532
  left: 0px;
531
533
  top: 0px;
532
534
  width: 20px;
@@ -642,7 +644,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
642
644
  `,h3=({label:e="",name:t,details:r="",options:n=[],allowInput:i=!1,previewOnly:s=!1,formOptions:l={}})=>{let a=useRef(),C=useFormContext();C.register(t,l);let[p,x]=useState(!1),[f,S]=useState(""),[L,y]=useState(n),w=useSpring(p?{opacity:1,transform:"translate(0px, 0px)",display:"block",config:{duration:150}}:{opacity:0,transform:"translate(0px, -2px)",display:"none",config:{duration:150}});useEffect(()=>{let g=h=>{p&&a.current&&!a.current.contains(h.target)&&x(!1);};return document.addEventListener("mousedown",h=>g(h)),()=>{document.removeEventListener("mousedown",h=>g(h));}},[p]);let b=n.find(g=>g.value===C.getValues(t))?.label,B=g=>{S(""),C.setValue(t,g.value),C.trigger(t),x(!1);};useEffect(()=>{if(x(!!f),f){let g=n.filter(h=>h.value.match(f.toLowerCase()));y(g),C.setValue(t,f);}else y(n);},[f]);let $=g=>{g.code==="Enter"&&g.preventDefault();};return jsxs(l3,{children:[jsx(p3,{size:"lg",children:e}),r&&jsx(d3,{children:r}),s?jsx(u3,{size:"md",children:b||"N/A"}):jsxs(c3,{onClick:()=>x(!p),children:[b,i&&jsx(m3,{onKeyDown:$,value:f,onChange:g=>S(g.target.value),type:"text"}),jsx(E.Caret,{direction:p?"up":"down"}),jsx(C3,{style:w,ref:a,children:L.map(g=>{let{label:h}=g,m=g.label===b;return jsxs(g3,{onClick:()=>B(g),children:[jsx(c.Body,{size:"lg",children:h}),jsx(f3,{isCurrent:m,children:jsx(E.Check,{color:"#fff"})})]},g.value)})})]})]})},n1=h3;var L3=({label:e="Submit",isSubmitting:t=!1,hideWhenInvalid:r=!1,...n})=>{let i=useFormContext(),{isValid:s}=i.formState,a=useSpring((r?s:!0)?{position:"relative",zIndex:0,opacity:1,transform:"translate(0px, 0px)",display:"block",config:{duration:250}}:{opacity:0,transform:"translate(0px, -3px)",display:"none",config:{duration:250}});return jsx(animated.div,{style:a,...n,children:jsx(o2.Primary,{type:"submit",isSubmitting:t,...n,children:e})})},s1=L3;var z3=o.div`
643
645
  position: relative;
644
646
  margin-bottom: 24px;
645
- z-index: 100;
647
+ z-index: 20;
646
648
  `,H3=o(c.Body)`
647
649
  margin-bottom: 5px;
648
650
  font-weight: bold;
@@ -712,7 +714,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
712
714
  `,E3=e=>{let t="",r="";e.address_components.forEach(s=>{let l=s.types.some(C=>C==="locality"),a=s.types.some(C=>C==="administrative_area_level_1");l?t=s.short_name:a&&(r=s.short_name);});let n=e.geometry.location.lat(),i=e.geometry.location.lng();return {city:t,state:r,lat:n,long:i}},R3=({handleSelect:e,option:t,value:r})=>{let{description:n}=t,i=n===r,s=n.replace(", USA","");return jsx(D3,{isCurrent:i,onClick:()=>e(s),children:jsx(c.Body,{size:"lg",children:s})})},T3=({label:e="",details:t="",required:r=!0,previewOnly:n=!1})=>{let i=useRef(),[s,l]=useState(!1),[a,C]=useState(!1),p=useFormContext();p.register("city",{required:r});let x=useSpring(s?{opacity:1,transform:"translate(0px, 0px)",display:"block",config:{duration:150}}:{opacity:0,transform:"translate(0px, -2px)",display:"none",config:{duration:150}});useEffect(()=>{let m=v=>{s&&i.current&&!i.current.contains(v.target)&&l(!1);};return document.addEventListener("mousedown",v=>m(v)),()=>{document.removeEventListener("mousedown",v=>m(v));}},[s]);let f=p.getValues("city")?`${p.getValues("city")}, ${p.getValues("state")}`:"",{value:S,suggestions:{data:L,loading:y},setValue:w,clearSuggestions:b}=k3({requestOptions:{types:["locality","postal_code"],componentRestrictions:{country:"us"}}});useEffect(()=>{if(y){C(y);return}setTimeout(()=>{C(y);},2e3);},[y]);let B=useSpring(a?{opacity:1,transform:"translate(0px, 0px)",config:{duration:400}}:{opacity:0,transform:"translate(5px, 0px)",config:{duration:200}}),$=m=>{w(m.target.value),p.setValue("city",null),p.setValue("state",null),p.trigger("city"),m.target.value.length>=3&&l(!0);},g=m=>{w(m,!1),b(),!(m.length<=2)&&getGeocode({address:m}).then(v=>{let{city:d,state:u,lat:t2,long:y1}=E3(v[0]);p.setValue("city",d),p.setValue("state",u),p.setValue("lat",t2),p.setValue("long",y1),p.trigger("city");}).catch(v=>console.error(`Google Maps API error: ${v}`));},h=m=>{m.code==="Enter"&&m.preventDefault();};return jsxs(z3,{children:[jsx(H3,{size:"lg",children:e}),t&&jsx(P3,{children:t}),n?jsx($3,{size:"md",children:f||"N/A"}):jsxs(B3,{children:[jsx(O3,{onKeyDown:h,value:S||f,onChange:m=>$(m),type:"text"}),L.length>0&&jsx(V3,{style:x,ref:i,children:L.map(m=>jsx(R3,{handleSelect:g,option:m,value:S},m.description))}),jsx(Z3,{style:B,children:jsx(V,{size:"sm"})})]})]})},C1=e=>{let{isLoaded:t}=useLoadScript({googleMapsApiKey:e.api_key||process.env.GOOGLE_MAPS_API_KEY||"",libraries:["places"]});return t?jsx(T3,{...e}):null};var f1=({color:e="#5A5A5A"})=>jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9999 10.9999H12.2099L11.9299 10.7299C13.1299 9.32989 13.7499 7.41989 13.4099 5.38989C12.9399 2.60989 10.6199 0.389893 7.81989 0.0498932C3.58989 -0.470107 0.0298932 3.08989 0.549893 7.31989C0.889893 10.1199 3.10989 12.4399 5.88989 12.9099C7.91989 13.2499 9.82989 12.6299 11.2299 11.4299L11.4999 11.7099V12.4999L15.7499 16.7499C16.1599 17.1599 16.8299 17.1599 17.2399 16.7499C17.6499 16.3399 17.6499 15.6699 17.2399 15.2599L12.9999 10.9999ZM6.99989 10.9999C4.50989 10.9999 2.49989 8.98989 2.49989 6.49989C2.49989 4.00989 4.50989 1.99989 6.99989 1.99989C9.48989 1.99989 11.4999 4.00989 11.4999 6.49989C11.4999 8.98989 9.48989 10.9999 6.99989 10.9999Z",fill:"#5A5A5A",color:e})});var G3=o.div`
713
715
  position: relative;
714
716
  margin-bottom: 24px;
715
- z-index: 200;
717
+ z-index: 20;
716
718
  `,N3=o(c.Body)`
717
719
  margin-bottom: 5px;
718
720
  font-weight: bold;