@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.
@@ -1,3 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { DialogTitleProps } from './types';
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 onClickTitle = function (e) {
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: onClickTitle }, { children: (0, jsx_runtime_1.jsx)(icons_1.CrossOutlineMd, {}) })))] })));
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;
@@ -1,2 +1 @@
1
1
  export * from './DialogTitle';
2
- export * from './types';
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./DialogTitle"), exports);
18
- __exportStar(require("./types"), exports);
@@ -1,3 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { DialogTitleProps } from './types';
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 onClickTitle = function (e) {
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: onClickTitle }, { children: _jsx(CrossOutlineMd, {}) })))] })));
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
  };
@@ -1,2 +1 @@
1
1
  export * from './DialogTitle';
2
- export * from './types';
@@ -1,2 +1 @@
1
1
  export * from './DialogTitle';
2
- export * from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "0.43.1",
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.43.1",
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",
@@ -1,4 +0,0 @@
1
- import { ModalProps, DialogTitleProps as MuiDialogTitleProps } from '@mui/material';
2
- export declare type DialogTitleProps = MuiDialogTitleProps & {
3
- onClose?: ModalProps['onClose'];
4
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- import { ModalProps, DialogTitleProps as MuiDialogTitleProps } from '@mui/material';
2
- export declare type DialogTitleProps = MuiDialogTitleProps & {
3
- onClose?: ModalProps['onClose'];
4
- };
@@ -1 +0,0 @@
1
- export {};