@solace-health/ui 0.3.24 → 0.3.26

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
@@ -641,6 +641,7 @@ var C2=(s=>(s.XL="xl",s.LG="lg",s.MD="md",s.SM="sm",s.XS="xs",s))(C2||{});var b1
641
641
  background: none;
642
642
  position: absolute;
643
643
  top: 0;
644
+ left: 0;
644
645
  `,h3=o(c.Body)`
645
646
  margin-bottom: 24px;
646
647
  `,y3=({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,h]=useState(!1),[f,S]=useState(""),[w,x]=useState(n),L=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=y=>{p&&a.current&&!a.current.contains(y.target)&&h(!1);};return document.addEventListener("mousedown",y=>g(y)),()=>{document.removeEventListener("mousedown",y=>g(y));}},[p]);let b=n.find(g=>g.value===C.getValues(t))?.label,B=g=>{S(""),C.setValue(t,g.value),C.trigger(t),h(!1);};useEffect(()=>{if(h(!!f),f){let g=n.filter(y=>y.value.match(f.toLowerCase()));x(g),C.setValue(t,f);}else x(n);},[f,n.length]);let O=g=>{g.code==="Enter"&&g.preventDefault();};return jsxs(p3,{children:[jsx(d3,{size:"lg",children:e}),r&&jsx(c3,{children:r}),s?jsx(h3,{size:"md",children:b||"N/A"}):jsxs(C3,{onClick:()=>h(!p),children:[b,i&&jsx(u3,{onKeyDown:O,value:f,onChange:g=>S(g.target.value),type:"text"}),jsx(E.Caret,{direction:p?"up":"down"}),jsx(g3,{style:L,ref:a,children:w.map(g=>{let{label:y}=g,m=g.label===b;return jsxs(f3,{onClick:()=>B(g),children:[jsx(c.Body,{size:"lg",children:y}),jsx(m3,{isCurrent:m,children:jsx(E.Check,{color:"#fff"})})]},g.value)})})]})]})},n1=y3;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 H3=o.div`