@solace-health/ui 0.3.16 → 0.3.18

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.cjs CHANGED
@@ -443,6 +443,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
443
443
  position: absolute;
444
444
  left: 0px;
445
445
  top: 0px;
446
+ background: white;
446
447
  width: 20px;
447
448
  height: 20px;
448
449
  border-radius: 4px;
@@ -506,7 +507,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
506
507
  background: none;
507
508
  position: absolute;
508
509
  top: -3px;
509
- padding-left: 30px;
510
+ padding: 0 0 0 30px;
510
511
  font-family: ${({theme:C})=>C.typography.family.script};
511
512
  font-weight: ${({theme:C})=>C.typography.weight.normal};
512
513
  font-size: 24px;
@@ -552,6 +553,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
552
553
  + label::after {
553
554
  content: "";
554
555
  position: absolute;
556
+ background: white;
555
557
  left: 0px;
556
558
  top: 0px;
557
559
  width: 20px;
@@ -667,7 +669,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
667
669
  `,h3=({label:e="",name:t,details:r="",options:n=[],allowInput:i=!1,previewOnly:s=!1,formOptions:l={}})=>{let a=react.useRef(),C=reactHookForm.useFormContext();C.register(t,l);let[p,x]=react.useState(!1),[f,S]=react.useState(""),[L,y]=react.useState(n),w=web.useSpring(p?{opacity:1,transform:"translate(0px, 0px)",display:"block",config:{duration:150}}:{opacity:0,transform:"translate(0px, -2px)",display:"none",config:{duration:150}});react.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);};react.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 jsxRuntime.jsxs(l3,{children:[jsxRuntime.jsx(p3,{size:"lg",children:e}),r&&jsxRuntime.jsx(d3,{children:r}),s?jsxRuntime.jsx(u3,{size:"md",children:b||"N/A"}):jsxRuntime.jsxs(c3,{onClick:()=>x(!p),children:[b,i&&jsxRuntime.jsx(m3,{onKeyDown:$,value:f,onChange:g=>S(g.target.value),type:"text"}),jsxRuntime.jsx(E.Caret,{direction:p?"up":"down"}),jsxRuntime.jsx(C3,{style:w,ref:a,children:L.map(g=>{let{label:h}=g,m=g.label===b;return jsxRuntime.jsxs(g3,{onClick:()=>B(g),children:[jsxRuntime.jsx(c.Body,{size:"lg",children:h}),jsxRuntime.jsx(f3,{isCurrent:m,children:jsxRuntime.jsx(E.Check,{color:"#fff"})})]},g.value)})})]})]})},n1=h3;var L3=({label:e="Submit",isSubmitting:t=!1,hideWhenInvalid:r=!1,...n})=>{let i=reactHookForm.useFormContext(),{isValid:s}=i.formState,a=web.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 jsxRuntime.jsx(web.animated.div,{style:a,...n,children:jsxRuntime.jsx(o2.Primary,{type:"submit",isSubmitting:t,...n,children:e})})},s1=L3;var z3=o__default.default.div`
668
670
  position: relative;
669
671
  margin-bottom: 24px;
670
- z-index: 100;
672
+ z-index: 20;
671
673
  `,H3=o__default.default(c.Body)`
672
674
  margin-bottom: 5px;
673
675
  font-weight: bold;
@@ -737,7 +739,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
737
739
  `,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 jsxRuntime.jsx(D3,{isCurrent:i,onClick:()=>e(s),children:jsxRuntime.jsx(c.Body,{size:"lg",children:s})})},T3=({label:e="",details:t="",required:r=!0,previewOnly:n=!1})=>{let i=react.useRef(),[s,l]=react.useState(!1),[a,C]=react.useState(!1),p=reactHookForm.useFormContext();p.register("city",{required:r});let x=web.useSpring(s?{opacity:1,transform:"translate(0px, 0px)",display:"block",config:{duration:150}}:{opacity:0,transform:"translate(0px, -2px)",display:"none",config:{duration:150}});react.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__default.default({requestOptions:{types:["locality","postal_code"],componentRestrictions:{country:"us"}}});react.useEffect(()=>{if(y){C(y);return}setTimeout(()=>{C(y);},2e3);},[y]);let B=web.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)&&k3.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 jsxRuntime.jsxs(z3,{children:[jsxRuntime.jsx(H3,{size:"lg",children:e}),t&&jsxRuntime.jsx(P3,{children:t}),n?jsxRuntime.jsx($3,{size:"md",children:f||"N/A"}):jsxRuntime.jsxs(B3,{children:[jsxRuntime.jsx(O3,{onKeyDown:h,value:S||f,onChange:m=>$(m),type:"text"}),L.length>0&&jsxRuntime.jsx(V3,{style:x,ref:i,children:L.map(m=>jsxRuntime.jsx(R3,{handleSelect:g,option:m,value:S},m.description))}),jsxRuntime.jsx(Z3,{style:B,children:jsxRuntime.jsx(V,{size:"sm"})})]})]})},C1=e=>{let{isLoaded:t}=api.useLoadScript({googleMapsApiKey:e.api_key||process.env.GOOGLE_MAPS_API_KEY||"",libraries:["places"]});return t?jsxRuntime.jsx(T3,{...e}):null};var f1=({color:e="#5A5A5A"})=>jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.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__default.default.div`
738
740
  position: relative;
739
741
  margin-bottom: 24px;
740
- z-index: 200;
742
+ z-index: 20;
741
743
  `,N3=o__default.default(c.Body)`
742
744
  margin-bottom: 5px;
743
745
  font-weight: bold;