@astral/ui 1.5.0 → 1.6.0

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.
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ import { SwipeableDrawerProps as MuiSwipeableDrawerProps } from '@mui/material';
3
+ export declare type SwipeableDrawerProps = {
4
+ /**
5
+ * @example <StyledSwipeableDrawer drawerBleedingTitle="Заголовок">
6
+ * @description Текстовый заголовок в шапке компонента.
7
+ */
8
+ drawerBleedingTitle: string;
9
+ /**
10
+ * @example <StyledSwipeableDrawer>
11
+ * @default false
12
+ * @description Остаётся ли компонент смонтированным после его скрытия.
13
+ */
14
+ isMountedOnHide?: boolean;
15
+ /**
16
+ * @example <StyledSwipeableDrawer>
17
+ * @default undefined
18
+ * @description Иконка в шапке компонента (над заголовком).
19
+ */
20
+ drawerBleedingIcon?: ReactNode;
21
+ /**
22
+ * @example <StyledSwipeableDrawer drawerBleedingIcon={56}>
23
+ * @default 56
24
+ * @description Высота шапки компонента и невидимого перетаскиваемого элемента.
25
+ */
26
+ drawerBleedingHeight?: number;
27
+ } & MuiSwipeableDrawerProps;
28
+ export declare const SwipeableDrawer: ({ drawerBleedingTitle, isMountedOnHide, drawerBleedingIcon, drawerBleedingHeight, children, ...props }: SwipeableDrawerProps) => JSX.Element;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.SwipeableDrawer = void 0;
26
+ var jsx_runtime_1 = require("react/jsx-runtime");
27
+ var styles_1 = require("./styles");
28
+ var SwipeableDrawer = function (_a) {
29
+ var drawerBleedingTitle = _a.drawerBleedingTitle, _b = _a.isMountedOnHide, isMountedOnHide = _b === void 0 ? false : _b, drawerBleedingIcon = _a.drawerBleedingIcon, _c = _a.drawerBleedingHeight, drawerBleedingHeight = _c === void 0 ? 56 : _c, children = _a.children, props = __rest(_a, ["drawerBleedingTitle", "isMountedOnHide", "drawerBleedingIcon", "drawerBleedingHeight", "children"]);
30
+ return ((0, jsx_runtime_1.jsxs)(styles_1.StyledSwipeableDrawer, __assign({}, props, { swipeAreaWidth: drawerBleedingHeight, ModalProps: { keepMounted: isMountedOnHide } }, { children: [(0, jsx_runtime_1.jsxs)(styles_1.SwipeableDrawerHeader, __assign({ drawerBleedingHeight: drawerBleedingHeight }, { children: [(0, jsx_runtime_1.jsx)(styles_1.SwipeableDrawerPuller, { children: drawerBleedingIcon || (0, jsx_runtime_1.jsx)(styles_1.SwipeableDrawerPullerIcon, {}) }), (0, jsx_runtime_1.jsx)(styles_1.SwipeableDrawerTitle, __assign({ noWrap: true }, { children: drawerBleedingTitle }))] })), (0, jsx_runtime_1.jsx)(styles_1.SwipeableDrawerBody, __assign({ drawerBleedingHeight: drawerBleedingHeight }, { children: children }))] })));
31
+ };
32
+ exports.SwipeableDrawer = SwipeableDrawer;
@@ -0,0 +1 @@
1
+ export * from './SwipeableDrawer';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./SwipeableDrawer"), exports);
@@ -0,0 +1,43 @@
1
+ /// <reference types="react" />
2
+ import { SwipeableDrawerProps } from '@mui/material';
3
+ declare type SwipeableDrawerHeaderProps = {
4
+ drawerBleedingHeight: number;
5
+ };
6
+ declare type SwipeableDrawerBodyProps = {
7
+ drawerBleedingHeight: number;
8
+ };
9
+ export declare const StyledSwipeableDrawer: import("@emotion/styled").StyledComponent<SwipeableDrawerProps & {
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ }, {}, {}>;
12
+ export declare const SwipeableDrawerHeader: import("@emotion/styled").StyledComponent<{
13
+ theme?: import("@emotion/react").Theme | undefined;
14
+ as?: import("react").ElementType<any> | undefined;
15
+ } & SwipeableDrawerHeaderProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
16
+ export declare const SwipeableDrawerPuller: import("@emotion/styled").StyledComponent<{
17
+ theme?: import("@emotion/react").Theme | undefined;
18
+ as?: import("react").ElementType<any> | undefined;
19
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
+ export declare const SwipeableDrawerPullerIcon: import("@emotion/styled").StyledComponent<{
21
+ theme?: import("@emotion/react").Theme | undefined;
22
+ as?: import("react").ElementType<any> | undefined;
23
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
24
+ export declare const SwipeableDrawerTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
25
+ align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
26
+ children?: import("react").ReactNode;
27
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
28
+ gutterBottom?: boolean | undefined;
29
+ noWrap?: boolean | undefined;
30
+ paragraph?: boolean | undefined;
31
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
32
+ variant?: "inherit" | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "h7" | "h8" | "h9" | "ui" | "link" | "pointer" | "code" | "div" | undefined;
33
+ variantMapping?: Partial<Record<"inherit" | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "h7" | "h8" | "h9" | "ui" | "link" | "pointer" | "code" | "div", string>> | undefined;
34
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | "css" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
35
+ ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
36
+ }, "children" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | ("fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "typography" | "p" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & {
37
+ theme?: import("@emotion/react").Theme | undefined;
38
+ }, {}, {}>;
39
+ export declare const SwipeableDrawerBody: import("@emotion/styled").StyledComponent<{
40
+ theme?: import("@emotion/react").Theme | undefined;
41
+ as?: import("react").ElementType<any> | undefined;
42
+ } & SwipeableDrawerBodyProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
43
+ export {};
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.SwipeableDrawerBody = exports.SwipeableDrawerTitle = exports.SwipeableDrawerPullerIcon = exports.SwipeableDrawerPuller = exports.SwipeableDrawerHeader = exports.StyledSwipeableDrawer = void 0;
19
+ var material_1 = require("@mui/material");
20
+ var styles_1 = require("../styles");
21
+ /**
22
+ * @description Вывод высоты шапки компонента.
23
+ */
24
+ var getHeight = function (_a) {
25
+ var drawerBleedingHeight = _a.drawerBleedingHeight;
26
+ return "".concat(drawerBleedingHeight, "px");
27
+ };
28
+ /**
29
+ * @description Расчет максимальной высоты тела компонента с учетом абсолютно
30
+ * позиционированной шапки, плюс отступ от верха экрана в размер шапки.
31
+ */
32
+ var calcMaxBodyHeight = function (_a) {
33
+ var drawerBleedingHeight = _a.drawerBleedingHeight;
34
+ return "calc(100vh - ".concat(drawerBleedingHeight, "px * 2)");
35
+ };
36
+ /**
37
+ * @description Определение плавной анимации полного скрытия компонента.
38
+ * Предусматривает для <SwipeableDrawer keepMounted={false} /> переопределение
39
+ * базового "transition" плавно выводя компонент за рамки видимой области экрана.
40
+ */
41
+ var getUnmountTransform = function (_a) {
42
+ var open = _a.open, ModalProps = _a.ModalProps;
43
+ return !(ModalProps === null || ModalProps === void 0 ? void 0 : ModalProps.keepMounted) && !open
44
+ ? 'translateY(100vh) !important'
45
+ : 'none';
46
+ };
47
+ exports.StyledSwipeableDrawer = (0, styles_1.styled)(material_1.SwipeableDrawer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .MuiPaper-root {\n overflow: visible;\n\n transform: ", ";\n }\n\n .MuiBackdrop-root {\n background-color: ", ";\n }\n"], ["\n .MuiPaper-root {\n overflow: visible;\n\n transform: ", ";\n }\n\n .MuiBackdrop-root {\n background-color: ", ";\n }\n"])), function (props) { return getUnmountTransform(__assign({}, props)); }, function (_a) {
48
+ var theme = _a.theme;
49
+ return theme.palette.background.modalShadow;
50
+ });
51
+ exports.SwipeableDrawerHeader = styles_1.styled.header(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n top: -", ";\n\n display: flex;\n justify-content: center;\n width: 100%;\n height: ", ";\n padding: ", ";\n\n background-color: ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n box-shadow: ", ";\n visibility: visible;\n"], ["\n position: absolute;\n top: -", ";\n\n display: flex;\n justify-content: center;\n width: 100%;\n height: ", ";\n padding: ", ";\n\n background-color: ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n box-shadow: ", ";\n visibility: visible;\n"])), function (props) { return getHeight(__assign({}, props)); }, function (props) { return getHeight(__assign({}, props)); }, function (_a) {
52
+ var theme = _a.theme;
53
+ return theme.spacing(6, 6, 3, 6);
54
+ }, function (_a) {
55
+ var theme = _a.theme;
56
+ return theme.palette.mode === 'light'
57
+ ? theme.palette.background.default
58
+ : theme.palette.grey[800];
59
+ }, function (_a) {
60
+ var theme = _a.theme;
61
+ return theme.shape.medium;
62
+ }, function (_a) {
63
+ var theme = _a.theme;
64
+ return theme.shape.medium;
65
+ }, function (_a) {
66
+ var theme = _a.theme;
67
+ return theme.shadows[8];
68
+ });
69
+ exports.SwipeableDrawerPuller = styles_1.styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n\n svg {\n fill: ", ";\n }\n"], ["\n position: absolute;\n top: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n\n svg {\n fill: ", ";\n }\n"])), function (_a) {
70
+ var theme = _a.theme;
71
+ return theme.palette.mode === 'light'
72
+ ? theme.palette.grey[900]
73
+ : theme.palette.grey[300];
74
+ });
75
+ exports.SwipeableDrawerPullerIcon = styles_1.styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 14px;\n height: 2px;\n\n background-color: ", ";\n border-radius: ", ";\n"], ["\n width: 14px;\n height: 2px;\n\n background-color: ", ";\n border-radius: ", ";\n"])), function (_a) {
76
+ var theme = _a.theme;
77
+ return theme.palette.mode === 'light'
78
+ ? theme.palette.grey[900]
79
+ : theme.palette.grey[300];
80
+ }, function (_a) {
81
+ var theme = _a.theme;
82
+ return theme.shape.small;
83
+ });
84
+ exports.SwipeableDrawerTitle = (0, styles_1.styled)(material_1.Typography)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
85
+ var theme = _a.theme;
86
+ return theme.palette.grey[700];
87
+ });
88
+ exports.SwipeableDrawerBody = styles_1.styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n z-index: ", ";\n\n height: 100%;\n max-height: ", ";\n overflow: auto;\n\n background-color: ", ";\n"], ["\n z-index: ", ";\n\n height: 100%;\n max-height: ", ";\n overflow: auto;\n\n background-color: ", ";\n"])), function (_a) {
89
+ var theme = _a.theme;
90
+ return theme.zIndex.mobileStepper;
91
+ }, function (props) { return calcMaxBodyHeight(__assign({}, props)); }, function (_a) {
92
+ var theme = _a.theme;
93
+ return theme.palette.mode === 'light'
94
+ ? theme.palette.background.default
95
+ : theme.palette.grey[800];
96
+ });
97
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ import { SwipeableDrawerProps as MuiSwipeableDrawerProps } from '@mui/material';
3
+ export declare type SwipeableDrawerProps = {
4
+ /**
5
+ * @example <StyledSwipeableDrawer drawerBleedingTitle="Заголовок">
6
+ * @description Текстовый заголовок в шапке компонента.
7
+ */
8
+ drawerBleedingTitle: string;
9
+ /**
10
+ * @example <StyledSwipeableDrawer>
11
+ * @default false
12
+ * @description Остаётся ли компонент смонтированным после его скрытия.
13
+ */
14
+ isMountedOnHide?: boolean;
15
+ /**
16
+ * @example <StyledSwipeableDrawer>
17
+ * @default undefined
18
+ * @description Иконка в шапке компонента (над заголовком).
19
+ */
20
+ drawerBleedingIcon?: ReactNode;
21
+ /**
22
+ * @example <StyledSwipeableDrawer drawerBleedingIcon={56}>
23
+ * @default 56
24
+ * @description Высота шапки компонента и невидимого перетаскиваемого элемента.
25
+ */
26
+ drawerBleedingHeight?: number;
27
+ } & MuiSwipeableDrawerProps;
28
+ export declare const SwipeableDrawer: ({ drawerBleedingTitle, isMountedOnHide, drawerBleedingIcon, drawerBleedingHeight, children, ...props }: SwipeableDrawerProps) => JSX.Element;
@@ -0,0 +1,28 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { StyledSwipeableDrawer, SwipeableDrawerBody, SwipeableDrawerHeader, SwipeableDrawerPuller, SwipeableDrawerPullerIcon, SwipeableDrawerTitle, } from './styles';
25
+ export var SwipeableDrawer = function (_a) {
26
+ var drawerBleedingTitle = _a.drawerBleedingTitle, _b = _a.isMountedOnHide, isMountedOnHide = _b === void 0 ? false : _b, drawerBleedingIcon = _a.drawerBleedingIcon, _c = _a.drawerBleedingHeight, drawerBleedingHeight = _c === void 0 ? 56 : _c, children = _a.children, props = __rest(_a, ["drawerBleedingTitle", "isMountedOnHide", "drawerBleedingIcon", "drawerBleedingHeight", "children"]);
27
+ return (_jsxs(StyledSwipeableDrawer, __assign({}, props, { swipeAreaWidth: drawerBleedingHeight, ModalProps: { keepMounted: isMountedOnHide } }, { children: [_jsxs(SwipeableDrawerHeader, __assign({ drawerBleedingHeight: drawerBleedingHeight }, { children: [_jsx(SwipeableDrawerPuller, { children: drawerBleedingIcon || _jsx(SwipeableDrawerPullerIcon, {}) }), _jsx(SwipeableDrawerTitle, __assign({ noWrap: true }, { children: drawerBleedingTitle }))] })), _jsx(SwipeableDrawerBody, __assign({ drawerBleedingHeight: drawerBleedingHeight }, { children: children }))] })));
28
+ };
@@ -0,0 +1 @@
1
+ export * from './SwipeableDrawer';
@@ -0,0 +1 @@
1
+ export * from './SwipeableDrawer';
@@ -0,0 +1,43 @@
1
+ /// <reference types="react" />
2
+ import { SwipeableDrawerProps } from '@mui/material';
3
+ declare type SwipeableDrawerHeaderProps = {
4
+ drawerBleedingHeight: number;
5
+ };
6
+ declare type SwipeableDrawerBodyProps = {
7
+ drawerBleedingHeight: number;
8
+ };
9
+ export declare const StyledSwipeableDrawer: import("@emotion/styled").StyledComponent<SwipeableDrawerProps & {
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ }, {}, {}>;
12
+ export declare const SwipeableDrawerHeader: import("@emotion/styled").StyledComponent<{
13
+ theme?: import("@emotion/react").Theme | undefined;
14
+ as?: import("react").ElementType<any> | undefined;
15
+ } & SwipeableDrawerHeaderProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
16
+ export declare const SwipeableDrawerPuller: import("@emotion/styled").StyledComponent<{
17
+ theme?: import("@emotion/react").Theme | undefined;
18
+ as?: import("react").ElementType<any> | undefined;
19
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
+ export declare const SwipeableDrawerPullerIcon: import("@emotion/styled").StyledComponent<{
21
+ theme?: import("@emotion/react").Theme | undefined;
22
+ as?: import("react").ElementType<any> | undefined;
23
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
24
+ export declare const SwipeableDrawerTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
25
+ align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
26
+ children?: import("react").ReactNode;
27
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
28
+ gutterBottom?: boolean | undefined;
29
+ noWrap?: boolean | undefined;
30
+ paragraph?: boolean | undefined;
31
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
32
+ variant?: "inherit" | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "h7" | "h8" | "h9" | "ui" | "link" | "pointer" | "code" | "div" | undefined;
33
+ variantMapping?: Partial<Record<"inherit" | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "h7" | "h8" | "h9" | "ui" | "link" | "pointer" | "code" | "div", string>> | undefined;
34
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | "css" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
35
+ ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
36
+ }, "children" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | ("fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "typography" | "p" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & {
37
+ theme?: import("@emotion/react").Theme | undefined;
38
+ }, {}, {}>;
39
+ export declare const SwipeableDrawerBody: import("@emotion/styled").StyledComponent<{
40
+ theme?: import("@emotion/react").Theme | undefined;
41
+ as?: import("react").ElementType<any> | undefined;
42
+ } & SwipeableDrawerBodyProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
43
+ export {};
@@ -0,0 +1,94 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ import { SwipeableDrawer, Typography, } from '@mui/material';
17
+ import { styled } from '../styles';
18
+ /**
19
+ * @description Вывод высоты шапки компонента.
20
+ */
21
+ var getHeight = function (_a) {
22
+ var drawerBleedingHeight = _a.drawerBleedingHeight;
23
+ return "".concat(drawerBleedingHeight, "px");
24
+ };
25
+ /**
26
+ * @description Расчет максимальной высоты тела компонента с учетом абсолютно
27
+ * позиционированной шапки, плюс отступ от верха экрана в размер шапки.
28
+ */
29
+ var calcMaxBodyHeight = function (_a) {
30
+ var drawerBleedingHeight = _a.drawerBleedingHeight;
31
+ return "calc(100vh - ".concat(drawerBleedingHeight, "px * 2)");
32
+ };
33
+ /**
34
+ * @description Определение плавной анимации полного скрытия компонента.
35
+ * Предусматривает для <SwipeableDrawer keepMounted={false} /> переопределение
36
+ * базового "transition" плавно выводя компонент за рамки видимой области экрана.
37
+ */
38
+ var getUnmountTransform = function (_a) {
39
+ var open = _a.open, ModalProps = _a.ModalProps;
40
+ return !(ModalProps === null || ModalProps === void 0 ? void 0 : ModalProps.keepMounted) && !open
41
+ ? 'translateY(100vh) !important'
42
+ : 'none';
43
+ };
44
+ export var StyledSwipeableDrawer = styled(SwipeableDrawer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .MuiPaper-root {\n overflow: visible;\n\n transform: ", ";\n }\n\n .MuiBackdrop-root {\n background-color: ", ";\n }\n"], ["\n .MuiPaper-root {\n overflow: visible;\n\n transform: ", ";\n }\n\n .MuiBackdrop-root {\n background-color: ", ";\n }\n"])), function (props) { return getUnmountTransform(__assign({}, props)); }, function (_a) {
45
+ var theme = _a.theme;
46
+ return theme.palette.background.modalShadow;
47
+ });
48
+ export var SwipeableDrawerHeader = styled.header(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n top: -", ";\n\n display: flex;\n justify-content: center;\n width: 100%;\n height: ", ";\n padding: ", ";\n\n background-color: ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n box-shadow: ", ";\n visibility: visible;\n"], ["\n position: absolute;\n top: -", ";\n\n display: flex;\n justify-content: center;\n width: 100%;\n height: ", ";\n padding: ", ";\n\n background-color: ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n box-shadow: ", ";\n visibility: visible;\n"])), function (props) { return getHeight(__assign({}, props)); }, function (props) { return getHeight(__assign({}, props)); }, function (_a) {
49
+ var theme = _a.theme;
50
+ return theme.spacing(6, 6, 3, 6);
51
+ }, function (_a) {
52
+ var theme = _a.theme;
53
+ return theme.palette.mode === 'light'
54
+ ? theme.palette.background.default
55
+ : theme.palette.grey[800];
56
+ }, function (_a) {
57
+ var theme = _a.theme;
58
+ return theme.shape.medium;
59
+ }, function (_a) {
60
+ var theme = _a.theme;
61
+ return theme.shape.medium;
62
+ }, function (_a) {
63
+ var theme = _a.theme;
64
+ return theme.shadows[8];
65
+ });
66
+ export var SwipeableDrawerPuller = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n\n svg {\n fill: ", ";\n }\n"], ["\n position: absolute;\n top: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n\n svg {\n fill: ", ";\n }\n"])), function (_a) {
67
+ var theme = _a.theme;
68
+ return theme.palette.mode === 'light'
69
+ ? theme.palette.grey[900]
70
+ : theme.palette.grey[300];
71
+ });
72
+ export var SwipeableDrawerPullerIcon = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 14px;\n height: 2px;\n\n background-color: ", ";\n border-radius: ", ";\n"], ["\n width: 14px;\n height: 2px;\n\n background-color: ", ";\n border-radius: ", ";\n"])), function (_a) {
73
+ var theme = _a.theme;
74
+ return theme.palette.mode === 'light'
75
+ ? theme.palette.grey[900]
76
+ : theme.palette.grey[300];
77
+ }, function (_a) {
78
+ var theme = _a.theme;
79
+ return theme.shape.small;
80
+ });
81
+ export var SwipeableDrawerTitle = styled(Typography)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
82
+ var theme = _a.theme;
83
+ return theme.palette.grey[700];
84
+ });
85
+ export var SwipeableDrawerBody = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n z-index: ", ";\n\n height: 100%;\n max-height: ", ";\n overflow: auto;\n\n background-color: ", ";\n"], ["\n z-index: ", ";\n\n height: 100%;\n max-height: ", ";\n overflow: auto;\n\n background-color: ", ";\n"])), function (_a) {
86
+ var theme = _a.theme;
87
+ return theme.zIndex.mobileStepper;
88
+ }, function (props) { return calcMaxBodyHeight(__assign({}, props)); }, function (_a) {
89
+ var theme = _a.theme;
90
+ return theme.palette.mode === 'light'
91
+ ? theme.palette.background.default
92
+ : theme.palette.grey[800];
93
+ });
94
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
package/esm/index.d.ts CHANGED
@@ -64,6 +64,7 @@ export * from './SideDialogActions';
64
64
  export * from './SideDialogContent';
65
65
  export * from './SideDialogContentText';
66
66
  export * from './Slide';
67
+ export * from './SwipeableDrawer';
67
68
  export * from './Zoom';
68
69
  export * from './Notification';
69
70
  export * from './LocalizationProvider';
package/esm/index.js CHANGED
@@ -64,6 +64,7 @@ export * from './SideDialogActions';
64
64
  export * from './SideDialogContent';
65
65
  export * from './SideDialogContentText';
66
66
  export * from './Slide';
67
+ export * from './SwipeableDrawer';
67
68
  export * from './Zoom';
68
69
  export * from './Notification';
69
70
  export * from './LocalizationProvider';
package/index.d.ts CHANGED
@@ -64,6 +64,7 @@ export * from './SideDialogActions';
64
64
  export * from './SideDialogContent';
65
65
  export * from './SideDialogContentText';
66
66
  export * from './Slide';
67
+ export * from './SwipeableDrawer';
67
68
  export * from './Zoom';
68
69
  export * from './Notification';
69
70
  export * from './LocalizationProvider';
package/index.js CHANGED
@@ -80,6 +80,7 @@ __exportStar(require("./SideDialogActions"), exports);
80
80
  __exportStar(require("./SideDialogContent"), exports);
81
81
  __exportStar(require("./SideDialogContentText"), exports);
82
82
  __exportStar(require("./Slide"), exports);
83
+ __exportStar(require("./SwipeableDrawer"), exports);
83
84
  __exportStar(require("./Zoom"), exports);
84
85
  __exportStar(require("./Notification"), exports);
85
86
  __exportStar(require("./LocalizationProvider"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "browser": "./src/index.ts",
5
5
  "jest": {
6
6
  "moduleNameMapper": {
@@ -8,7 +8,7 @@
8
8
  }
9
9
  },
10
10
  "dependencies": {
11
- "@astral/icons": "^1.5.0",
11
+ "@astral/icons": "^1.6.0",
12
12
  "@emotion/cache": "11.7.1",
13
13
  "@emotion/react": "11.9.0",
14
14
  "@emotion/server": "11.4.0",