@itcase/ui-web 1.10.12 → 1.10.13
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 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("clsx"),s=require("react-modern-drawer"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("clsx"),s=require("react-modern-drawer"),a=require("@itcase/ui-core/hooks"),c=require("../../primitives_cjs_ocTnUpml.js"),t=require("../../Group_cjs_CiLUYKP7.js"),o=require("../../default_cjs_BMdcKzhJ.js");require("@rc-component/tooltip"),require("react-inlinesvg"),require("@itcase/ui-core/hoc"),require("@itcase/ui-core/utils");const l={sizeH3:{titleTextSize:"h3",descTextSize:"s",dividerSize:"s"},...{surfacePrimary:{titleTextColor:"surfaceTextPrimary",descTextColor:"surfaceTextPrimary",closeIcon:o.icons24.Action.Close,closeIconFillIcon:"surfaceItemPrimary"}}},n={DEFAULT:{isInDOM:!0,isOpen:!1},ENTER_FINISH:{isInDOM:!0,isOpen:!0},EXIT_FINISH:{isInDOM:!1,isOpen:!1}},d={appearance:l,setAppearance:e=>{d.appearance=e}};exports.Drawer=function(o){const{appearance:l,className:u,dataTestId:I,dataTour:p,type:_,title:x,desc:T,enableOverlay:m,lockBackgroundScroll:f=!0,stickyButton:S,before:h,after:N,close:v,isKeepMounted:w=!1,isOpen:j=!1,onClickClose:z,onClose:C,children:y}=o,g=r.useRef(j),F=r.useRef(!0),q=a.useAppearanceConfig(l,d),E=a.useDevicePropsGenerator(o,q),{direction:O,size:D,titleTextColor:k,titleTextSize:H,titleTextWeight:A,descTextColor:P,descTextSize:b,divider:B,dividerSize:M,zeroPadding:R,closeIcon:$,closeIconFill:G,closeIconFillIcon:X,closeIconFillSize:L,closeIconShape:U,closeIconSize:W,closeIconSrc:K}=E,[J,Q]=r.useState(j?n.ENTER_FINISH:n.EXIT_FINISH);return r.useEffect(()=>{if(F.current)return void(F.current=!1);const e=!0===Boolean(g.current),r=!1===Boolean(j);g.current=j,Q(n.DEFAULT);const i=setTimeout(()=>{Q(j?n.ENTER_FINISH:n.EXIT_FINISH),e&&r&&C&&C()},j?16:300);return()=>{clearTimeout(i)}},[j]),w||J.isInDOM?e.jsx(s,{className:i("drawer",_&&`drawer_type_${_}`,u,S&&"drawer_sticky-button",R&&"drawer_reset-padding"),direction:O||"right",size:D||600,customIdSuffix:I?`_${I}`:void 0,duration:300,enableOverlay:m,lockBackgroundScroll:f,overlayClassName:"drawer__overlay",open:J.isOpen,onClose:z,children:e.jsxs(t.Group,{className:"drawer__content",dataTestId:I,dataTour:p,width:"fill",children:[h&&e.jsx("div",{className:"drawer__before",children:h}),!v&&($||K)&&e.jsx("div",{className:"drawer__close",children:e.jsx(c.Icon,{className:"cursor_type_pointer",dataTestId:I&&`${I}CloseIcon`,fill:G,fillSize:L,iconFill:X,iconSize:W,imageSrc:K,shape:U,SvgImage:$,onClick:z})}),(x||T)&&e.jsxs("div",{className:"drawer__header",children:[e.jsx(c.Title,{className:"drawer__header-title",dataTestId:I&&`${I}Title`,size:H,textColor:k,textWeight:A,children:x}),e.jsx(c.Text,{className:"drawer__header-desc",dataTestId:I&&`${I}Desc`,size:b,textColor:P,children:T})]}),B&&e.jsx(c.Divider,{width:"fill",size:M,fill:"surfaceTertiary"}),y&&e.jsx("div",{className:"drawer__wrapper",children:y}),N&&e.jsx("div",{className:"drawer__after",children:N})]})}):null},exports.drawerAppearance=l,exports.drawerConfig=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useRef as i,useState as o,useEffect as t}from"react";import a from"clsx";import s from"react-modern-drawer";import{useAppearanceConfig as c,useDevicePropsGenerator as l}from"@itcase/ui-core/hooks";import{I as n,d,T as m,D as p}from"../primitives_es_BQqNcRQk.js";import{G as I}from"../Group_es_DIuSNHx3.js";import{d as _}from"../default_es_OK2akzEP.js";import"@rc-component/tooltip";import"react-inlinesvg";import"@itcase/ui-core/hoc";import"@itcase/ui-core/utils";const u={sizeH3:{titleTextSize:"h3",descTextSize:"s",dividerSize:"s"},...{surfacePrimary:{titleTextColor:"surfaceTextPrimary",descTextColor:"surfaceTextPrimary",closeIcon:_.Action.Close,closeIconFillIcon:"surfaceItemPrimary"}}},T={DEFAULT:{isInDOM:!0,isOpen:!1},ENTER_FINISH:{isInDOM:!0,isOpen:!0},EXIT_FINISH:{isInDOM:!1,isOpen:!1}},f={appearance:u,setAppearance:e=>{f.appearance=e}};function h(_){const{appearance:u,className:h,dataTestId:S,dataTour:N,type:x,title:v,desc:w,enableOverlay:z,lockBackgroundScroll:y=!0,stickyButton:C,before:F,after:g,close:E,isKeepMounted:O=!1,isOpen:k=!1,onClickClose:D,onClose:H,children:b}=_,B=i(k),M=i(!0),P=c(u,f),$=l(_,P),{direction:j,size:A,titleTextColor:R,titleTextSize:X,titleTextWeight:G,descTextColor:L,descTextSize:U,divider:W,dividerSize:K,zeroPadding:q,closeIcon:J,closeIconFill:Q,closeIconFillIcon:V,closeIconFillSize:Y,closeIconShape:Z,closeIconSize:ee,closeIconSrc:re}=$,[ie,oe]=o(k?T.ENTER_FINISH:T.EXIT_FINISH);return t(()=>{if(M.current)return void(M.current=!1);const e=!0===Boolean(B.current),r=!1===Boolean(k);B.current=k,oe(T.DEFAULT);const i=setTimeout(()=>{oe(k?T.ENTER_FINISH:T.EXIT_FINISH),e&&r&&H&&H()},k?16:300);return()=>{clearTimeout(i)}},[k]),O||ie.isInDOM?e(s,{className:a("drawer",x&&`drawer_type_${x}`,h,C&&"drawer_sticky-button",q&&"drawer_reset-padding"),direction:j||"right",size:A||600,customIdSuffix:S?`_${S}`:void 0,duration:300,enableOverlay:z,lockBackgroundScroll:y,overlayClassName:"drawer__overlay",open:ie.isOpen,onClose:D,children:r(I,{className:"drawer__content",dataTestId:S,dataTour:N,width:"fill",children:[F&&e("div",{className:"drawer__before",children:F}),!E&&(J||re)&&e("div",{className:"drawer__close",children:e(n,{className:"cursor_type_pointer",dataTestId:S&&`${S}CloseIcon`,fill:Q,fillSize:Y,iconFill:V,iconSize:ee,imageSrc:re,shape:Z,SvgImage:J,onClick:D})}),(v||w)&&r("div",{className:"drawer__header",children:[e(d,{className:"drawer__header-title",dataTestId:S&&`${S}Title`,size:X,textColor:R,textWeight:G,children:v}),e(m,{className:"drawer__header-desc",dataTestId:S&&`${S}Desc`,size:U,textColor:L,children:w})]}),W&&e(p,{width:"fill",size:K,fill:"surfaceTertiary"}),b&&e("div",{className:"drawer__wrapper",children:b}),g&&e("div",{className:"drawer__after",children:g})]})}):null}export{h as Drawer,u as drawerAppearance,f as drawerConfig};
|
|
@@ -61611,6 +61611,8 @@ h2.react-datepicker__current-month {
|
|
|
61611
61611
|
opacity: 100% !important;
|
|
61612
61612
|
backdrop-filter: var(--drawer-overlay-filter) !important;
|
|
61613
61613
|
}
|
|
61614
|
+
&__content {
|
|
61615
|
+
}
|
|
61614
61616
|
&__close {
|
|
61615
61617
|
padding: 3m 3m 0 3m;
|
|
61616
61618
|
position: relative;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import ReactDrawer from 'react-modern-drawer';
|
|
5
5
|
import { useAppearanceConfig, useDevicePropsGenerator, } from '@itcase/ui-core/hooks';
|
|
6
6
|
import { Divider } from 'src/components/Divider';
|
|
7
|
+
import { Group } from 'src/components/Group';
|
|
7
8
|
import { Icon } from 'src/components/Icon';
|
|
8
9
|
import { Text } from 'src/components/Text';
|
|
9
10
|
import { Title } from 'src/components/Title';
|
|
@@ -53,7 +54,6 @@ function Drawer(props) {
|
|
|
53
54
|
if (!isKeepMounted && !animationState.isInDOM) {
|
|
54
55
|
return null;
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
-
return (_jsx(ReactDrawer, { className: clsx('drawer', type && `drawer_type_${type}`, className, dataTour && `dataTour-${dataTour}`, stickyButton && 'drawer_sticky-button', zeroPadding && 'drawer_reset-padding'), direction: direction || 'right', size: size || 600, customIdSuffix: dataTestId ? `_${dataTestId}` : undefined, duration: ANIMATION_DURATION, enableOverlay: enableOverlay, lockBackgroundScroll: lockBackgroundScroll, overlayClassName: "drawer__overlay", open: animationState.isOpen, onClose: onClickClose, children: dataTestId || dataTour ? (_jsx("div", { "data-testid": dataTestId, "data-tour": dataTour, style: { display: 'contents' }, children: drawerContent })) : (drawerContent) }));
|
|
57
|
+
return (_jsx(ReactDrawer, { className: clsx('drawer', type && `drawer_type_${type}`, className, stickyButton && 'drawer_sticky-button', zeroPadding && 'drawer_reset-padding'), direction: direction || 'right', size: size || 600, customIdSuffix: dataTestId ? `_${dataTestId}` : undefined, duration: ANIMATION_DURATION, enableOverlay: enableOverlay, lockBackgroundScroll: lockBackgroundScroll, overlayClassName: "drawer__overlay", open: animationState.isOpen, onClose: onClickClose, children: _jsxs(Group, { className: "drawer__content", dataTestId: dataTestId, dataTour: dataTour, width: "fill", children: [before && _jsx("div", { className: "drawer__before", children: before }), !close && (closeIcon || closeIconSrc) && (_jsx("div", { className: "drawer__close", children: _jsx(Icon, { className: "cursor_type_pointer", dataTestId: dataTestId && `${dataTestId}CloseIcon`, fill: closeIconFill, fillSize: closeIconFillSize, iconFill: closeIconFillIcon, iconSize: closeIconSize, imageSrc: closeIconSrc, shape: closeIconShape, SvgImage: closeIcon, onClick: onClickClose }) })), (title || desc) && (_jsxs("div", { className: "drawer__header", children: [_jsx(Title, { className: "drawer__header-title", dataTestId: dataTestId && `${dataTestId}Title`, size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title }), _jsx(Text, { className: "drawer__header-desc", dataTestId: dataTestId && `${dataTestId}Desc`, size: descTextSize, textColor: descTextColor, children: desc })] })), divider && (_jsx(Divider, { width: "fill", size: dividerSize, fill: "surfaceTertiary" })), children && _jsx("div", { className: "drawer__wrapper", children: children }), after && _jsx("div", { className: "drawer__after", children: after })] }) }));
|
|
58
58
|
}
|
|
59
59
|
export { Drawer, drawerConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/ui-web",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.13",
|
|
4
4
|
"description": "UI components",
|
|
5
5
|
"keywords": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@itcase/tokens-am": "^1.1.57",
|
|
54
54
|
"@itcase/tokens-baikal": "^1.1.54",
|
|
55
55
|
"@itcase/tokens-palette": "^1.1.50",
|
|
56
|
-
"@itcase/ui-core": "^1.10.
|
|
56
|
+
"@itcase/ui-core": "^1.10.13",
|
|
57
57
|
"@rc-component/tooltip": "^1.4.0",
|
|
58
58
|
"axios": "^1.16.1",
|
|
59
59
|
"clsx": "^2.1.1",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"storybook": "^10.4.1",
|
|
117
117
|
"typescript": "^6.0.3"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "ffdd3c3b3cf6fcc6d40520e607fd593417da356b"
|
|
120
120
|
}
|