@trafilea/afrodita-components 7.10.1 → 7.10.2

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.
@@ -1,2 +1,2 @@
1
- import{__assign as o}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import{useState as t,useEffect as n}from"react";import{Container as e,Backdrop as d,Sidebar as l}from"./style.js";var a=function(a){var u=a.children,c=a.isOpen,s=a.onClose,p=a.onOpen,f=a.backgroundColor,v=void 0===f?"#fff":f,m=a.backdropColor,h=void 0===m?"rgba(0, 0, 0, 0.5)":m,b=a.position,k=void 0===b?"left":b,C=a.width,g=void 0===C?"33%":C,O=a.height,w=void 0===O?"100%":O,T=a.top,j=void 0===T?"0":T,x=a.onClickOutside,D=a.ssr,y=void 0!==D&&D,B=t(c),S=B[0],q=B[1],z=t(c),A=z[0],E=z[1];return n((function(){if(!1===c){q(c);var o=setTimeout((function(){E(c),null==s||s()}),300);return function(){clearTimeout(o)}}E(c);var i=setTimeout((function(){q(c),null==p||p()}),100);return function(){clearTimeout(i)}}),[c,s,p]),A||y?i(e,o({visible:!y||A},{children:[r(d,{backgroundColor:h,isOpen:S,top:j,"data-testid":"Drawer-Backdrop",onClick:x&&x},void 0),r(l,o({position:k,width:g,height:w,top:j,backgroundColor:v,isOpen:S,"data-testid":"Drawer-Sidebar"},{children:u}),void 0)]}),void 0):null};export{a as Drawer};
1
+ import{__assign as o}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useState as r,useEffect as e}from"react";import{Container as n,Backdrop as d,Sidebar as a}from"./style.js";var l=function(l){var c=l.children,u=l.isOpen,s=l.onClose,p=l.onOpen,v=l.backgroundColor,f=void 0===v?"#fff":v,m=l.backdropColor,b=void 0===m?"rgba(0, 0, 0, 0.5)":m,h=l.position,k=void 0===h?"left":h,C=l.width,g=void 0===C?"33%":C,T=l.height,O=void 0===T?"100%":T,w=l.top,j=void 0===w?"0":w,x=l.onClickOutside,B=l.ssr,D=void 0!==B&&B,I=l.dataTestIdSidebar,S=void 0===I?"Drawer-Sidebar":I,y=l.dataTestIdBackdrop,q=void 0===y?"Drawer-Backdrop":y,z=r(u),A=z[0],E=z[1],F=r(u),G=F[0],H=F[1];return e((function(){if(!1===u){E(u);var o=setTimeout((function(){H(u),null==s||s()}),300);return function(){clearTimeout(o)}}H(u);var i=setTimeout((function(){E(u),null==p||p()}),100);return function(){clearTimeout(i)}}),[u,s,p]),G||D?i(n,o({visible:!D||G},{children:[t(d,{backgroundColor:b,isOpen:A,top:j,"data-testid":q,onClick:x&&x},void 0),t(a,o({position:k,width:g,height:O,top:j,backgroundColor:f,isOpen:A,"data-testid":S},{children:c}),void 0)]}),void 0):null};export{l as Drawer};
2
2
  //# sourceMappingURL=Drawer.js.map
package/build/index.d.ts CHANGED
@@ -3237,8 +3237,10 @@ interface DrawerProps {
3237
3237
  height?: string;
3238
3238
  top?: string;
3239
3239
  ssr?: boolean;
3240
+ dataTestIdSidebar?: string;
3241
+ dataTestIdBackdrop?: string;
3240
3242
  }
3241
- declare const Drawer: ({ children, isOpen, onClose, onOpen, backgroundColor, backdropColor, position, width, height, top, onClickOutside, ssr, }: DrawerProps) => JSX.Element | null;
3243
+ declare const Drawer: ({ children, isOpen, onClose, onOpen, backgroundColor, backdropColor, position, width, height, top, onClickOutside, ssr, dataTestIdSidebar, dataTestIdBackdrop, }: DrawerProps) => JSX.Element | null;
3242
3244
 
3243
3245
  interface DropdownListIconsProps {
3244
3246
  items: DropdownListIconsItem[];
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),r=require("react"),o=require("./style.js");exports.Drawer=function(t){var n=t.children,s=t.isOpen,u=t.onClose,a=t.onOpen,d=t.backgroundColor,c=void 0===d?"#fff":d,l=t.backdropColor,v=void 0===l?"rgba(0, 0, 0, 0.5)":l,f=t.position,p=void 0===f?"left":f,b=t.width,h=void 0===b?"33%":b,g=t.height,k=void 0===g?"100%":g,C=t.top,j=void 0===C?"0":C,x=t.onClickOutside,O=t.ssr,_=void 0!==O&&O,m=r.useState(s),w=m[0],q=m[1],S=r.useState(s),T=S[0],D=S[1];if(r.useEffect((function(){if(!1===s){q(s);var e=setTimeout((function(){D(s),null==u||u()}),300);return function(){clearTimeout(e)}}D(s);var i=setTimeout((function(){q(s),null==a||a()}),100);return function(){clearTimeout(i)}}),[s,u,a]),!T&&!_)return null;var y=!_||T;return i.jsxs(o.Container,e.__assign({visible:y},{children:[i.jsx(o.Backdrop,{backgroundColor:v,isOpen:w,top:j,"data-testid":"Drawer-Backdrop",onClick:x&&x},void 0),i.jsx(o.Sidebar,e.__assign({position:p,width:h,height:k,top:j,backgroundColor:c,isOpen:w,"data-testid":"Drawer-Sidebar"},{children:n}),void 0)]}),void 0)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),r=require("react"),o=require("./style.js");exports.Drawer=function(t){var n=t.children,d=t.isOpen,a=t.onClose,s=t.onOpen,u=t.backgroundColor,c=void 0===u?"#fff":u,l=t.backdropColor,v=void 0===l?"rgba(0, 0, 0, 0.5)":l,p=t.position,f=void 0===p?"left":p,b=t.width,h=void 0===b?"33%":b,k=t.height,g=void 0===k?"100%":k,C=t.top,j=void 0===C?"0":C,x=t.onClickOutside,O=t.ssr,T=void 0!==O&&O,_=t.dataTestIdSidebar,m=void 0===_?"Drawer-Sidebar":_,w=t.dataTestIdBackdrop,S=void 0===w?"Drawer-Backdrop":w,q=r.useState(d),B=q[0],D=q[1],y=r.useState(d),I=y[0],E=y[1];if(r.useEffect((function(){if(!1===d){D(d);var e=setTimeout((function(){E(d),null==a||a()}),300);return function(){clearTimeout(e)}}E(d);var i=setTimeout((function(){D(d),null==s||s()}),100);return function(){clearTimeout(i)}}),[d,a,s]),!I&&!T)return null;var M=!T||I;return i.jsxs(o.Container,e.__assign({visible:M},{children:[i.jsx(o.Backdrop,{backgroundColor:v,isOpen:B,top:j,"data-testid":S,onClick:x&&x},void 0),i.jsx(o.Sidebar,e.__assign({position:f,width:h,height:g,top:j,backgroundColor:c,isOpen:B,"data-testid":m},{children:n}),void 0)]}),void 0)};
2
2
  //# sourceMappingURL=Drawer.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Trafilea's Design System",
4
4
  "author": "Trafilea",
5
5
  "repository": "https://github.com/trafilea/afrodita-components",
6
- "version": "7.10.1",
6
+ "version": "7.10.2",
7
7
  "private": false,
8
8
  "main": "build/lib/index.js",
9
9
  "style": "build/es/index.css",