@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
|
|
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,
|
|
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