@happeouikit/form-elements 2.3.48 → 2.3.49

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.js CHANGED
@@ -243,7 +243,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
243
243
  color: ${({hoverColor:e})=>e||W.active};
244
244
  text-decoration: underline;
245
245
  }
246
- `;Oa.propTypes={color:G.string,hoverColor:G.string,underline:G.bool,children:G.node};Oa.defaultProps={color:W.active,hoverColor:W.active,underline:!1};const Yf=({label:e,subtitle:t,description:r,tabIndex:n,id:a,disabled:i,checked:o,defaultChecked:s,required:u,onChange:l,background:c,"data-tip":d,"data-tooltip-content":f,"data-tooltip-id":p,"data-testid":h,...v})=>{const g=m.useRef(null),b=m.useCallback(y=>{if(!i&&(y.preventDefault(),g.current)){const D=!g.current.checked;y.currentTarget.setAttribute("aria-checked",D.toString()),g.current.checked=D;const M={...y,target:{...g.current,checked:D,id:w}};typeof l=="function"&&l(M,D)}},[l]),I=m.useCallback(y=>{y.key.match(/enter|spacebar|\W{1}/i)&&b(y)},[b]),x=m.useCallback(y=>{i||typeof l=="function"&&l(y,y.target.checked)},[l,i]),w=m.useMemo(()=>a||Ot(),[a]);return A.jsxs(zf,{background:c,children:[A.jsx(Vf,{"aria-hidden":"true",onChange:x,onKeyDown:I,ref:g,type:"checkbox",tabIndex:-1,disabled:i,checked:o,required:u,id:w,"data-testid":h,"aria-describedby":r?`${w}_description`:void 0}),A.jsx(Ln,{type:"button",role:"switch","aria-checked":o||s||!1,onKeyDown:I,onClick:b,disabled:i,background:c,...v}),e&&A.jsxs(Lf,{children:[A.jsxs(Hf,{children:[e&&A.jsx(jf,{bold:!0,htmlFor:w,"data-tooltip-content":f||d,"data-tooltip-id":p,onClick:b,children:e}),t&&A.jsx(Zf,{children:t})]}),r&&A.jsx(Xf,{id:`${w}_description`,children:r})]})]})},Vf=S.input`
246
+ `;Oa.propTypes={color:G.string,hoverColor:G.string,underline:G.bool,children:G.node};Oa.defaultProps={color:W.active,hoverColor:W.active,underline:!1};const Yf=({label:e,subtitle:t,description:r,tabIndex:n,id:a,disabled:i,checked:o,defaultChecked:s,required:u,onChange:l,background:c,"data-tip":d,"data-tooltip-content":f,"data-tooltip-id":p,"data-testid":h,...v})=>{const g=m.useRef(null),b=m.useCallback(y=>{if(!i&&(y.preventDefault(),g.current)){const D=!g.current.checked;y.currentTarget.setAttribute("aria-checked",D.toString()),g.current.checked=D;const M={...y,target:{...g.current,checked:D,id:w}};typeof l=="function"&&l(M,D)}},[l]),I=m.useCallback(y=>{y.key.match(/enter|spacebar|\W{1}/i)&&b(y)},[b]),x=m.useCallback(y=>{i||typeof l=="function"&&l(y,y.target.checked)},[l,i]),w=m.useMemo(()=>a||Ot(),[a]);return A.jsxs(zf,{background:c,children:[A.jsx(Vf,{"aria-hidden":"true",onChange:x,onKeyDown:I,ref:g,type:"checkbox",tabIndex:-1,disabled:i,checked:o,defaultChecked:s,required:u,id:w,"data-testid":h,"aria-describedby":r?`${w}_description`:void 0}),A.jsx(Ln,{type:"button",role:"switch","aria-checked":o||s||!1,onKeyDown:I,onClick:b,disabled:i,background:c,...v}),e&&A.jsxs(Lf,{children:[A.jsxs(Hf,{children:[e&&A.jsx(jf,{bold:!0,htmlFor:w,"data-tooltip-content":f||d,"data-tooltip-id":p,onClick:b,children:e}),t&&A.jsx(Zf,{children:t})]}),r&&A.jsx(Xf,{id:`${w}_description`,children:r})]})]})},Vf=S.input`
247
247
  position: absolute;
248
248
  opacity: 0;
249
249
  height: 0;