@astral/ui 0.43.1 → 0.44.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.
- package/DialogTitle/DialogTitle.d.ts +4 -1
- package/DialogTitle/DialogTitle.js +2 -2
- package/DialogTitle/index.d.ts +0 -1
- package/DialogTitle/index.js +0 -1
- package/esm/DialogTitle/DialogTitle.d.ts +4 -1
- package/esm/DialogTitle/DialogTitle.js +3 -3
- package/esm/DialogTitle/index.d.ts +0 -1
- package/esm/DialogTitle/index.js +0 -1
- package/package.json +2 -2
- package/DialogTitle/types.d.ts +0 -4
- package/DialogTitle/types.js +0 -2
- package/esm/DialogTitle/types.d.ts +0 -4
- package/esm/DialogTitle/types.js +0 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DialogTitleProps } from '
|
|
2
|
+
import { ModalProps, DialogTitleProps as MuiDialogTitleProps } from '@mui/material';
|
|
3
|
+
export declare type DialogTitleProps = MuiDialogTitleProps & {
|
|
4
|
+
onClose?: ModalProps['onClose'];
|
|
5
|
+
};
|
|
3
6
|
export declare const DialogTitle: ({ children, onClose, ...props }: DialogTitleProps) => JSX.Element;
|
|
@@ -30,11 +30,11 @@ var IconButton_1 = require("../IconButton");
|
|
|
30
30
|
var DialogTitle = function (_a) {
|
|
31
31
|
// 'escapeKeyDown' в документашке написано что это опциональный тип, и можно стрингу любую туда закидывать, а по факту либо escapeKeyDown либо backdropClick
|
|
32
32
|
var children = _a.children, onClose = _a.onClose, props = __rest(_a, ["children", "onClose"]);
|
|
33
|
-
var
|
|
33
|
+
var handleTitleClick = function (e) {
|
|
34
34
|
if (onClose) {
|
|
35
35
|
onClose(e, 'escapeKeyDown');
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.DialogTitle, __assign({}, props, { children: [children, onClose && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, __assign({ variant: "text", onClick:
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.DialogTitle, __assign({}, props, { children: [children, onClose && ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, __assign({ 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)(icons_1.CrossOutlineMd, {}) })))] })));
|
|
39
39
|
};
|
|
40
40
|
exports.DialogTitle = DialogTitle;
|
package/DialogTitle/index.d.ts
CHANGED
package/DialogTitle/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DialogTitleProps } from '
|
|
2
|
+
import { ModalProps, DialogTitleProps as MuiDialogTitleProps } from '@mui/material';
|
|
3
|
+
export declare type DialogTitleProps = MuiDialogTitleProps & {
|
|
4
|
+
onClose?: ModalProps['onClose'];
|
|
5
|
+
};
|
|
3
6
|
export declare const DialogTitle: ({ children, onClose, ...props }: DialogTitleProps) => JSX.Element;
|
|
@@ -21,16 +21,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { DialogTitle as MuiDialogTitle } from '@mui/material';
|
|
24
|
+
import { DialogTitle as MuiDialogTitle, } from '@mui/material';
|
|
25
25
|
import { CrossOutlineMd } from '@astral/icons';
|
|
26
26
|
import { IconButton } from '../IconButton';
|
|
27
27
|
export var DialogTitle = function (_a) {
|
|
28
28
|
// 'escapeKeyDown' в документашке написано что это опциональный тип, и можно стрингу любую туда закидывать, а по факту либо escapeKeyDown либо backdropClick
|
|
29
29
|
var children = _a.children, onClose = _a.onClose, props = __rest(_a, ["children", "onClose"]);
|
|
30
|
-
var
|
|
30
|
+
var handleTitleClick = function (e) {
|
|
31
31
|
if (onClose) {
|
|
32
32
|
onClose(e, 'escapeKeyDown');
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
return (_jsxs(MuiDialogTitle, __assign({}, props, { children: [children, onClose && (_jsx(IconButton, __assign({ variant: "text", onClick:
|
|
35
|
+
return (_jsxs(MuiDialogTitle, __assign({}, props, { children: [children, onClose && (_jsx(IconButton, __assign({ 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, {}) })))] })));
|
|
36
36
|
};
|
package/esm/DialogTitle/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astral/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.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": "^0.
|
|
11
|
+
"@astral/icons": "^0.44.0",
|
|
12
12
|
"@emotion/cache": "11.7.1",
|
|
13
13
|
"@emotion/react": "11.9.0",
|
|
14
14
|
"@emotion/server": "11.4.0",
|
package/DialogTitle/types.d.ts
DELETED
package/DialogTitle/types.js
DELETED
package/esm/DialogTitle/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|