@adoptaunabuelo/react-components 0.1.15 → 0.1.16

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.
@@ -9,8 +9,8 @@ export interface MenuProps {
9
9
  icon?: JSX.Element;
10
10
  Icon?: JSX.Element;
11
11
  position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
12
- children: React.ReactNode;
13
- options: Array<OptionsProps>;
12
+ children?: React.ReactNode;
13
+ options?: Array<OptionsProps>;
14
14
  onChange?: (visible: boolean) => void;
15
15
  onClick?: (option: OptionsProps) => void;
16
16
  }
package/dist/esm/index.js CHANGED
@@ -683,7 +683,7 @@ var n="none",r="contents",a=/input|select|textarea|button|object|iframe/;functio
683
683
  :hover{
684
684
  background-color: ${Color.status.neutral.hover};
685
685
  }
686
- `,MenuList=forwardRef(((e,t)=>{const[n,r]=useState(!1);useImperativeHandle(t,(()=>({close(){r(!1)}}))),useEffect((()=>(document.addEventListener("mousedown",(t=>{const r=document.getElementById(e.id);null!==r&&(r.contains(t.target)||n&&a(t))})),document.removeEventListener("mousedown",a))));const a=t=>{t.stopPropagation(),n?(r(!1),e.onChange&&e.onChange(!1)):(r(!0),e.onChange&&e.onChange(!0))};return jsxs(Container,Object.assign({id:e.id,role:"menu",style:e.style},{children:[e.Icon?jsx(IconView,Object.assign({onClick:a},{children:e.Icon})):jsx(Button,{style:{backgroundColor:n?Color.status.neutral.active:void 0},design:"image",icon:e.icon?e.icon:jsx(MoreVertical,{}),onClick:a}),jsxs(FilterView,Object.assign({padding:!e.options,position:e.position,style:e.menuStyle,show:n},{children:[e.children,e.options&&e.options.map(((t,n)=>jsxs(MenuCell,Object.assign({style:{borderBottom:n+1===e.options.length?"none":"1px solid "+Color.line.soft},onClick:n=>((t,n)=>{t.stopPropagation(),r(!1),e.onClick&&e.onClick(n)})(n,t)},{children:[t.icon,jsx(Text,Object.assign({type:"p"},{children:t.label}))]}),"action"+n)))]}))]}))})),LabelStyled=qe.div`
686
+ `,MenuList=forwardRef(((e,t)=>{const[n,r]=useState(!1);useImperativeHandle(t,(()=>({close(){r(!1)}}))),useEffect((()=>(document.addEventListener("mousedown",(t=>{const r=document.getElementById(e.id);null!==r&&(r.contains(t.target)||n&&a(t))})),document.removeEventListener("mousedown",a))));const a=t=>{t.stopPropagation(),n?(r(!1),e.onChange&&e.onChange(!1)):(r(!0),e.onChange&&e.onChange(!0))};return jsxs(Container,Object.assign({id:e.id,role:"menu",style:e.style},{children:[e.Icon?jsx(IconView,Object.assign({onClick:a},{children:e.Icon})):jsx(Button,{style:{backgroundColor:n?Color.status.neutral.active:void 0},design:"image",icon:e.icon?e.icon:jsx(MoreVertical,{}),onClick:a}),jsxs(FilterView,Object.assign({padding:!e.options,position:e.position,style:e.menuStyle,show:n},{children:[e.children,e.options&&e.options.map(((t,n)=>{var a;return jsxs(MenuCell,Object.assign({style:{borderBottom:n+1===(null===(a=e.options)||void 0===a?void 0:a.length)?"none":"1px solid "+Color.line.soft},onClick:n=>((t,n)=>{t.stopPropagation(),r(!1),e.onClick&&e.onClick(n)})(n,t)},{children:[t.icon,jsx(Text,Object.assign({type:"p"},{children:t.label}))]}),"action"+n)}))]}))]}))})),LabelStyled=qe.div`
687
687
  display: flex;
688
688
  flex-direction: row;
689
689
  justify-content: center;