@astral/ui 1.8.0 → 1.9.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/Alert/Alert.js CHANGED
@@ -29,9 +29,10 @@ var icons_1 = require("@astral/icons");
29
29
  var Typography_1 = require("../Typography");
30
30
  var Grid_1 = require("../Grid");
31
31
  var Collapse_1 = require("../Collapse");
32
+ var styles_1 = require("./styles");
32
33
  var Alert = function (_a) {
33
34
  var children = _a.children, title = _a.title, _b = _a.closeText, closeText = _b === void 0 ? 'Скрыть' : _b, _c = _a.display, display = _c === void 0 ? true : _c, actions = _a.actions, onClose = _a.onClose, props = __rest(_a, ["children", "title", "closeText", "display", "actions", "onClose"]);
34
- return ((0, jsx_runtime_1.jsx)(Collapse_1.Collapse, __assign({ in: display }, { children: (0, jsx_runtime_1.jsxs)(material_1.Alert, __assign({}, props, { closeText: closeText, variant: "filled", onClose: onClose, iconMapping: {
35
+ return ((0, jsx_runtime_1.jsx)(Collapse_1.Collapse, __assign({ in: display }, { children: (0, jsx_runtime_1.jsxs)(styles_1.StyledAlert, __assign({}, props, { closeText: closeText, variant: "filled", onClose: onClose, iconMapping: {
35
36
  info: (0, jsx_runtime_1.jsx)(icons_1.InfoFillMd, {}),
36
37
  error: (0, jsx_runtime_1.jsx)(icons_1.ErrorFillMd, {}),
37
38
  success: (0, jsx_runtime_1.jsx)(icons_1.SuccessFillMd, {}),
@@ -0,0 +1,4 @@
1
+ import { AlertProps } from '@mui/material';
2
+ export declare const StyledAlert: import("@emotion/styled").StyledComponent<AlertProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ }, {}, {}>;
@@ -0,0 +1,23 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.StyledAlert = void 0;
8
+ var material_1 = require("@mui/material");
9
+ var styles_1 = require("../styles");
10
+ exports.StyledAlert = (0, styles_1.styled)(material_1.Alert)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: ", ";\n }\n\n ", " {\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: 0;\n }\n }\n"], ["\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: ", ";\n }\n\n ", " {\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: 0;\n }\n }\n"])), function (_a) {
11
+ var theme = _a.theme;
12
+ return theme.spacing(3);
13
+ }, function (_a) {
14
+ var theme = _a.theme;
15
+ return theme.spacing(3, 0);
16
+ }, function (_a) {
17
+ var theme = _a.theme;
18
+ return theme.breakpoints.up('sm');
19
+ }, function (_a) {
20
+ var theme = _a.theme;
21
+ return theme.spacing(2, 4);
22
+ });
23
+ var templateObject_1;
@@ -4,7 +4,7 @@ import { ProfileProps } from '../../Profile/types';
4
4
  export declare type HeaderProps = {
5
5
  product: ProductProps;
6
6
  productSwitcher?: React.FC;
7
- profile: ProfileProps;
7
+ profile?: ProfileProps;
8
8
  };
9
9
  export declare const Header: import("react").ForwardRefExoticComponent<HeaderProps & import("react").RefAttributes<HTMLDivElement>>;
10
10
  export default Header;
@@ -22,6 +22,6 @@ exports.Header = (0, react_1.forwardRef)(function (props, ref) {
22
22
  var ProductSwitcher = props.productSwitcher, product = props.product,
23
23
  // menu: Menu,
24
24
  profile = props.profile;
25
- return ((0, jsx_runtime_1.jsxs)(styles_1.HeaderRoot, __assign({ ref: ref }, { children: [(0, jsx_runtime_1.jsxs)(styles_1.HeaderNav, { children: [ProductSwitcher && (0, jsx_runtime_1.jsx)(ProductSwitcher, {}), (0, jsx_runtime_1.jsx)(Product_1.Product, __assign({}, product))] }), (0, jsx_runtime_1.jsx)(Profile_1.Profile, __assign({}, profile))] })));
25
+ return ((0, jsx_runtime_1.jsxs)(styles_1.HeaderRoot, __assign({ ref: ref }, { children: [(0, jsx_runtime_1.jsxs)(styles_1.HeaderNav, { children: [ProductSwitcher && (0, jsx_runtime_1.jsx)(ProductSwitcher, {}), (0, jsx_runtime_1.jsx)(Product_1.Product, __assign({}, product))] }), profile && (0, jsx_runtime_1.jsx)(Profile_1.Profile, __assign({}, profile))] })));
26
26
  });
27
27
  exports.default = exports.Header;
@@ -21,14 +21,15 @@ 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 { AlertTitle, Alert as MuiAlert, } from '@mui/material';
24
+ import { AlertTitle } from '@mui/material';
25
25
  import { ErrorFillMd, InfoFillMd, SuccessFillMd, WarningFillMd, } from '@astral/icons';
26
26
  import { Typography } from '../Typography';
27
27
  import { Grid } from '../Grid';
28
28
  import { Collapse } from '../Collapse';
29
+ import { StyledAlert } from './styles';
29
30
  export var Alert = function (_a) {
30
31
  var children = _a.children, title = _a.title, _b = _a.closeText, closeText = _b === void 0 ? 'Скрыть' : _b, _c = _a.display, display = _c === void 0 ? true : _c, actions = _a.actions, onClose = _a.onClose, props = __rest(_a, ["children", "title", "closeText", "display", "actions", "onClose"]);
31
- return (_jsx(Collapse, __assign({ in: display }, { children: _jsxs(MuiAlert, __assign({}, props, { closeText: closeText, variant: "filled", onClose: onClose, iconMapping: {
32
+ return (_jsx(Collapse, __assign({ in: display }, { children: _jsxs(StyledAlert, __assign({}, props, { closeText: closeText, variant: "filled", onClose: onClose, iconMapping: {
32
33
  info: _jsx(InfoFillMd, {}),
33
34
  error: _jsx(ErrorFillMd, {}),
34
35
  success: _jsx(SuccessFillMd, {}),
@@ -0,0 +1,4 @@
1
+ import { AlertProps } from '@mui/material';
2
+ export declare const StyledAlert: import("@emotion/styled").StyledComponent<AlertProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ }, {}, {}>;
@@ -0,0 +1,20 @@
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
+ import { Alert } from '@mui/material';
6
+ import { styled } from '../styles';
7
+ export var StyledAlert = styled(Alert)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: ", ";\n }\n\n ", " {\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: 0;\n }\n }\n"], ["\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: ", ";\n }\n\n ", " {\n padding: ", ";\n\n .MuiAlert-message > *:last-child:not(:empty):not(.MuiTypography-root) {\n padding: 0;\n }\n }\n"])), function (_a) {
8
+ var theme = _a.theme;
9
+ return theme.spacing(3);
10
+ }, function (_a) {
11
+ var theme = _a.theme;
12
+ return theme.spacing(3, 0);
13
+ }, function (_a) {
14
+ var theme = _a.theme;
15
+ return theme.breakpoints.up('sm');
16
+ }, function (_a) {
17
+ var theme = _a.theme;
18
+ return theme.spacing(2, 4);
19
+ });
20
+ var templateObject_1;
@@ -4,7 +4,7 @@ import { ProfileProps } from '../../Profile/types';
4
4
  export declare type HeaderProps = {
5
5
  product: ProductProps;
6
6
  productSwitcher?: React.FC;
7
- profile: ProfileProps;
7
+ profile?: ProfileProps;
8
8
  };
9
9
  export declare const Header: import("react").ForwardRefExoticComponent<HeaderProps & import("react").RefAttributes<HTMLDivElement>>;
10
10
  export default Header;
@@ -19,6 +19,6 @@ export var Header = forwardRef(function (props, ref) {
19
19
  var ProductSwitcher = props.productSwitcher, product = props.product,
20
20
  // menu: Menu,
21
21
  profile = props.profile;
22
- return (_jsxs(HeaderRoot, __assign({ ref: ref }, { children: [_jsxs(HeaderNav, { children: [ProductSwitcher && _jsx(ProductSwitcher, {}), _jsx(Product, __assign({}, product))] }), _jsx(Profile, __assign({}, profile))] })));
22
+ return (_jsxs(HeaderRoot, __assign({ ref: ref }, { children: [_jsxs(HeaderNav, { children: [ProductSwitcher && _jsx(ProductSwitcher, {}), _jsx(Product, __assign({}, product))] }), profile && _jsx(Profile, __assign({}, profile))] })));
23
23
  });
24
24
  export default Header;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "1.8.0",
3
+ "version": "1.9.1",
4
4
  "browser": "./src/index.ts",
5
5
  "jest": {
6
6
  "moduleNameMapper": {
@@ -8,16 +8,16 @@
8
8
  }
9
9
  },
10
10
  "dependencies": {
11
- "@astral/icons": "^1.8.0",
11
+ "@astral/icons": "^1.9.1",
12
12
  "@emotion/cache": "11.7.1",
13
13
  "@emotion/react": "11.9.0",
14
14
  "@emotion/server": "11.4.0",
15
15
  "@emotion/styled": "11.8.1",
16
- "@mui/base": "5.0.0-alpha.85",
17
- "@mui/lab": "5.0.0-alpha.86",
18
- "@mui/material": "5.8.4",
16
+ "@mui/base": "^5.0.0-alpha.85",
17
+ "@mui/lab": "^5.0.0-alpha.86",
18
+ "@mui/material": "^5.8.4",
19
19
  "date-fns": "^2.28.0",
20
- "lodash-es": "4.17.21",
20
+ "lodash-es": "^4.17.21",
21
21
  "react-datepicker": "4.7.0",
22
22
  "react-imask": "^6.4.2",
23
23
  "react-toastify": "9.0.3",