@astral/ui 4.91.0 → 4.91.1
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.
- package/components/DialogHeader/DialogHeader.js +2 -3
- package/components/DialogHeader/styles.d.ts +10 -0
- package/components/DialogHeader/styles.js +4 -0
- package/components/DialogTitle/DialogTitle.js +2 -2
- package/components/DialogTitle/styles.d.ts +11 -0
- package/components/DialogTitle/styles.js +6 -0
- package/node/components/DialogHeader/DialogHeader.js +1 -2
- package/node/components/DialogHeader/styles.d.ts +10 -0
- package/node/components/DialogHeader/styles.js +5 -1
- package/node/components/DialogTitle/DialogTitle.js +2 -2
- package/node/components/DialogTitle/styles.d.ts +11 -0
- package/node/components/DialogTitle/styles.js +9 -0
- package/package.json +1 -1
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CrossOutlineMd } from '../../icons/CrossOutlineMd';
|
|
3
|
-
import { IconButton } from '../IconButton';
|
|
4
3
|
import { Typography } from '../Typography';
|
|
5
|
-
import { HeaderContent, Wrapper } from './styles';
|
|
4
|
+
import { HeaderContent, StyledIconButton, Wrapper } from './styles';
|
|
6
5
|
export const DialogHeader = ({ children, title, justifyContent = 'flex-start', disableSpacing, onClose, className, }) => {
|
|
7
6
|
const handleTitleClick = (e) => {
|
|
8
7
|
if (onClose) {
|
|
9
8
|
onClose(e, 'escapeKeyDown');
|
|
10
9
|
}
|
|
11
10
|
};
|
|
12
|
-
return (_jsxs(Wrapper, { className: className, hasTitle: Boolean(title), hasOnClose: Boolean(onClose), children: [title && _jsx(Typography, { variant: "h4", children: title }), _jsx(HeaderContent, { justifyContent: justifyContent, columnSpacing: disableSpacing ? 0 : 2, children: children }), onClose && (_jsx(
|
|
11
|
+
return (_jsxs(Wrapper, { className: className, hasTitle: Boolean(title), hasOnClose: Boolean(onClose), children: [title && _jsx(Typography, { variant: "h4", children: title }), _jsx(HeaderContent, { justifyContent: justifyContent, columnSpacing: disableSpacing ? 0 : 2, children: children }), onClose && (_jsx(StyledIconButton, { variant: "text", onClick: handleTitleClick, "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E\u0435 \u043E\u043A\u043D\u043E", children: _jsx(CrossOutlineMd, {}) }))] }));
|
|
13
12
|
};
|
|
@@ -13,6 +13,16 @@ export declare const Wrapper: import("../styled").StyledComponent<{
|
|
|
13
13
|
theme?: import("@emotion/react").Theme | undefined;
|
|
14
14
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
15
15
|
} & DialogHeaderRootProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
16
|
+
export declare const StyledIconButton: import("../styled").StyledComponent<Omit<import("..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
17
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
18
|
+
loading?: boolean | undefined;
|
|
19
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
20
|
+
component?: import("react").ElementType | undefined;
|
|
21
|
+
selected?: boolean | undefined;
|
|
22
|
+
size?: "large" | "medium" | undefined;
|
|
23
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
24
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
25
|
+
}, {}, {}>;
|
|
16
26
|
export type DialogHeaderContentProps = {
|
|
17
27
|
justifyContent: CSSProperties['justifyContent'];
|
|
18
28
|
columnSpacing: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IconButton } from '../IconButton';
|
|
1
2
|
import { styled } from '../styled';
|
|
2
3
|
export const Wrapper = styled('div', {
|
|
3
4
|
label: 'DialogHeader-root',
|
|
@@ -23,6 +24,9 @@ export const Wrapper = styled('div', {
|
|
|
23
24
|
height: auto;
|
|
24
25
|
padding: ${({ theme }) => theme.spacing(4, 6)};
|
|
25
26
|
`;
|
|
27
|
+
export const StyledIconButton = styled(IconButton) `
|
|
28
|
+
align-self: start;
|
|
29
|
+
`;
|
|
26
30
|
export const HeaderContent = styled('div', {
|
|
27
31
|
shouldForwardProp: (prop) => !['justifyContent', 'columnSpacing'].includes(prop),
|
|
28
32
|
label: 'DialogHeader-content',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import MuiDialogTitle from '@mui/material/DialogTitle';
|
|
3
3
|
import { CrossOutlineMd } from '../../icons/CrossOutlineMd';
|
|
4
|
-
import {
|
|
4
|
+
import { StyledIconButton } from './styles';
|
|
5
5
|
export const DialogTitle = ({ children, onClose, headerContent, ...props }) => {
|
|
6
6
|
// 'escapeKeyDown' в документашке написано что это опциональный тип, и можно стрингу любую туда закидывать, а по факту либо escapeKeyDown либо backdropClick
|
|
7
7
|
const handleTitleClick = (e) => {
|
|
@@ -9,5 +9,5 @@ export const DialogTitle = ({ children, onClose, headerContent, ...props }) => {
|
|
|
9
9
|
onClose(e, 'escapeKeyDown');
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
return (_jsxs(MuiDialogTitle, { ...props, children: [children, headerContent, onClose && (_jsx(
|
|
12
|
+
return (_jsxs(MuiDialogTitle, { ...props, children: [children, headerContent, onClose && (_jsx(StyledIconButton, { variant: "text", onClick: handleTitleClick, "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E\u0435 \u043E\u043A\u043D\u043E", children: _jsx(CrossOutlineMd, {}) }))] }));
|
|
13
13
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledIconButton: import("../styled").StyledComponent<Omit<import("..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
3
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
4
|
+
loading?: boolean | undefined;
|
|
5
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
6
|
+
component?: import("react").ElementType | undefined;
|
|
7
|
+
selected?: boolean | undefined;
|
|
8
|
+
size?: "large" | "medium" | undefined;
|
|
9
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
10
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DialogHeader = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const CrossOutlineMd_1 = require("../../icons/CrossOutlineMd");
|
|
6
|
-
const IconButton_1 = require("../IconButton");
|
|
7
6
|
const Typography_1 = require("../Typography");
|
|
8
7
|
const styles_1 = require("./styles");
|
|
9
8
|
const DialogHeader = ({ children, title, justifyContent = 'flex-start', disableSpacing, onClose, className, }) => {
|
|
@@ -12,6 +11,6 @@ const DialogHeader = ({ children, title, justifyContent = 'flex-start', disableS
|
|
|
12
11
|
onClose(e, 'escapeKeyDown');
|
|
13
12
|
}
|
|
14
13
|
};
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: className, hasTitle: Boolean(title), hasOnClose: Boolean(onClose), children: [title && (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h4", children: title }), (0, jsx_runtime_1.jsx)(styles_1.HeaderContent, { justifyContent: justifyContent, columnSpacing: disableSpacing ? 0 : 2, children: children }), onClose && ((0, jsx_runtime_1.jsx)(
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: className, hasTitle: Boolean(title), hasOnClose: Boolean(onClose), children: [title && (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h4", children: title }), (0, jsx_runtime_1.jsx)(styles_1.HeaderContent, { justifyContent: justifyContent, columnSpacing: disableSpacing ? 0 : 2, children: children }), onClose && ((0, jsx_runtime_1.jsx)(styles_1.StyledIconButton, { variant: "text", onClick: handleTitleClick, "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E\u0435 \u043E\u043A\u043D\u043E", children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) }))] }));
|
|
16
15
|
};
|
|
17
16
|
exports.DialogHeader = DialogHeader;
|
|
@@ -13,6 +13,16 @@ export declare const Wrapper: import("@emotion/styled/dist/declarations/src/type
|
|
|
13
13
|
theme?: import("@emotion/react").Theme | undefined;
|
|
14
14
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
15
15
|
} & DialogHeaderRootProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
16
|
+
export declare const StyledIconButton: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
17
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
18
|
+
loading?: boolean | undefined;
|
|
19
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
20
|
+
component?: import("react").ElementType | undefined;
|
|
21
|
+
selected?: boolean | undefined;
|
|
22
|
+
size?: "large" | "medium" | undefined;
|
|
23
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
24
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
25
|
+
}, {}, {}>;
|
|
16
26
|
export type DialogHeaderContentProps = {
|
|
17
27
|
justifyContent: CSSProperties['justifyContent'];
|
|
18
28
|
columnSpacing: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HeaderContent = exports.Wrapper = void 0;
|
|
3
|
+
exports.HeaderContent = exports.StyledIconButton = exports.Wrapper = void 0;
|
|
4
|
+
const IconButton_1 = require("../IconButton");
|
|
4
5
|
const styled_1 = require("../styled");
|
|
5
6
|
exports.Wrapper = (0, styled_1.styled)('div', {
|
|
6
7
|
label: 'DialogHeader-root',
|
|
@@ -26,6 +27,9 @@ exports.Wrapper = (0, styled_1.styled)('div', {
|
|
|
26
27
|
height: auto;
|
|
27
28
|
padding: ${({ theme }) => theme.spacing(4, 6)};
|
|
28
29
|
`;
|
|
30
|
+
exports.StyledIconButton = (0, styled_1.styled)(IconButton_1.IconButton) `
|
|
31
|
+
align-self: start;
|
|
32
|
+
`;
|
|
29
33
|
exports.HeaderContent = (0, styled_1.styled)('div', {
|
|
30
34
|
shouldForwardProp: (prop) => !['justifyContent', 'columnSpacing'].includes(prop),
|
|
31
35
|
label: 'DialogHeader-content',
|
|
@@ -7,7 +7,7 @@ exports.DialogTitle = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const DialogTitle_1 = __importDefault(require("@mui/material/DialogTitle"));
|
|
9
9
|
const CrossOutlineMd_1 = require("../../icons/CrossOutlineMd");
|
|
10
|
-
const
|
|
10
|
+
const styles_1 = require("./styles");
|
|
11
11
|
const DialogTitle = ({ children, onClose, headerContent, ...props }) => {
|
|
12
12
|
// 'escapeKeyDown' в документашке написано что это опциональный тип, и можно стрингу любую туда закидывать, а по факту либо escapeKeyDown либо backdropClick
|
|
13
13
|
const handleTitleClick = (e) => {
|
|
@@ -15,6 +15,6 @@ const DialogTitle = ({ children, onClose, headerContent, ...props }) => {
|
|
|
15
15
|
onClose(e, 'escapeKeyDown');
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)(DialogTitle_1.default, { ...props, children: [children, headerContent, onClose && ((0, jsx_runtime_1.jsx)(
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(DialogTitle_1.default, { ...props, children: [children, headerContent, onClose && ((0, jsx_runtime_1.jsx)(styles_1.StyledIconButton, { variant: "text", onClick: handleTitleClick, "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u043C\u043E\u0434\u0430\u043B\u044C\u043D\u043E\u0435 \u043E\u043A\u043D\u043E", children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) }))] }));
|
|
19
19
|
};
|
|
20
20
|
exports.DialogTitle = DialogTitle;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledIconButton: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
3
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
4
|
+
loading?: boolean | undefined;
|
|
5
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
6
|
+
component?: import("react").ElementType | undefined;
|
|
7
|
+
selected?: boolean | undefined;
|
|
8
|
+
size?: "large" | "medium" | undefined;
|
|
9
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
10
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledIconButton = void 0;
|
|
4
|
+
const IconButton_1 = require("../IconButton");
|
|
5
|
+
const styled_1 = require("../styled");
|
|
6
|
+
exports.StyledIconButton = (0, styled_1.styled)(IconButton_1.IconButton) `
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
align-self: start;
|
|
9
|
+
`;
|