@astral/ui 4.113.1 → 4.113.2

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,9 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Tab } from '../../Tabs';
3
- import { StyledTabs } from './styles';
2
+ import { Tabs as AstralUITabs, Tab } from '../../Tabs';
4
3
  export const Tabs = ({ listType, notificationsCount, unreadNotificationsCount, onChange, }) => {
5
4
  const handleChange = (_, value) => {
6
5
  onChange(value);
7
6
  };
8
- return (_jsxs(StyledTabs, { value: listType, onChange: handleChange, children: [_jsx(Tab, { value: "unread", label: "\u041D\u0435\u043F\u0440\u043E\u0447\u0438\u0442\u0430\u043D\u043D\u044B\u0435", count: unreadNotificationsCount }), _jsx(Tab, { value: "all", label: "\u0412\u0441\u0435", count: notificationsCount })] }));
7
+ return (_jsxs(AstralUITabs, { value: listType, onChange: handleChange, children: [_jsx(Tab, { value: "unread", label: "\u041D\u0435\u043F\u0440\u043E\u0447\u0438\u0442\u0430\u043D\u043D\u044B\u0435", count: unreadNotificationsCount }), _jsx(Tab, { value: "all", label: "\u0412\u0441\u0435", count: notificationsCount })] }));
9
8
  };
@@ -1,8 +1,8 @@
1
1
  import Tab from '@mui/material/Tab';
2
- import { HOVER_MEDIA } from '../../constants';
2
+ import { HOVER_MEDIA, TABS_HEIGHT, TABS_HEIGHT_MOBILE } from '../../constants';
3
3
  import { styled } from '../../styled';
4
4
  export const StyledTab = styled(Tab) `
5
- min-height: 36px;
5
+ min-height: ${TABS_HEIGHT};
6
6
  padding: 0;
7
7
 
8
8
  line-height: 20px;
@@ -10,6 +10,10 @@ export const StyledTab = styled(Tab) `
10
10
 
11
11
  border: 2px solid transparent;
12
12
 
13
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
14
+ min-height: ${TABS_HEIGHT_MOBILE};
15
+ }
16
+
13
17
  &:last-child {
14
18
  margin-right: 0;
15
19
  }
@@ -1,4 +1,5 @@
1
1
  import MuiTabs, { tabsClasses } from '@mui/material/Tabs';
2
+ import { TABS_HEIGHT, TABS_HEIGHT_MOBILE } from '../constants';
2
3
  import { styled } from '../styled';
3
4
  export const Container = styled.div `
4
5
  overflow-x: auto;
@@ -20,8 +21,9 @@ export const Container = styled.div `
20
21
  }
21
22
  `;
22
23
  export const Divider = styled.div `
23
- position: relative;
24
- bottom: 2px;
24
+ position: absolute;
25
+ bottom: 0;
26
+ left: 0;
25
27
 
26
28
  width: 100%;
27
29
  height: 1px;
@@ -40,7 +42,14 @@ export const StyledTabs = styled(MuiTabs) `
40
42
  }
41
43
  `;
42
44
  export const Wrapper = styled.div `
45
+ position: relative;
46
+
43
47
  display: inline-block;
44
48
 
45
49
  min-width: 100%;
50
+ height: ${TABS_HEIGHT};
51
+
52
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
53
+ height: ${TABS_HEIGHT_MOBILE};
54
+ }
46
55
  `;
@@ -3,3 +3,4 @@ export * from './scrollbar';
3
3
  export * from './footer';
4
4
  export * from './classnames';
5
5
  export * from './media';
6
+ export * from './tabs';
@@ -3,3 +3,4 @@ export * from './scrollbar';
3
3
  export * from './footer';
4
4
  export * from './classnames';
5
5
  export * from './media';
6
+ export * from './tabs';
@@ -0,0 +1,2 @@
1
+ export declare const TABS_HEIGHT = "34px";
2
+ export declare const TABS_HEIGHT_MOBILE = "40px";
@@ -0,0 +1,2 @@
1
+ export const TABS_HEIGHT = '34px';
2
+ export const TABS_HEIGHT_MOBILE = '40px';
@@ -1,9 +1,13 @@
1
1
  export const MuiTabs = {
2
2
  styleOverrides: {
3
- root() {
3
+ root({ theme }) {
4
4
  return {
5
- minHeight: 38,
6
- height: 38,
5
+ minHeight: 34,
6
+ height: 34,
7
+ [theme.breakpoints.down('mobile')]: {
8
+ minHeight: 40,
9
+ height: 40,
10
+ },
7
11
  };
8
12
  },
9
13
  indicator({ theme }) {
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Tabs = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const Tabs_1 = require("../../Tabs");
6
- const styles_1 = require("./styles");
7
6
  const Tabs = ({ listType, notificationsCount, unreadNotificationsCount, onChange, }) => {
8
7
  const handleChange = (_, value) => {
9
8
  onChange(value);
10
9
  };
11
- return ((0, jsx_runtime_1.jsxs)(styles_1.StyledTabs, { value: listType, onChange: handleChange, children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { value: "unread", label: "\u041D\u0435\u043F\u0440\u043E\u0447\u0438\u0442\u0430\u043D\u043D\u044B\u0435", count: unreadNotificationsCount }), (0, jsx_runtime_1.jsx)(Tabs_1.Tab, { value: "all", label: "\u0412\u0441\u0435", count: notificationsCount })] }));
10
+ return ((0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { value: listType, onChange: handleChange, children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { value: "unread", label: "\u041D\u0435\u043F\u0440\u043E\u0447\u0438\u0442\u0430\u043D\u043D\u044B\u0435", count: unreadNotificationsCount }), (0, jsx_runtime_1.jsx)(Tabs_1.Tab, { value: "all", label: "\u0412\u0441\u0435", count: notificationsCount })] }));
12
11
  };
13
12
  exports.Tabs = Tabs;
@@ -8,7 +8,7 @@ const Tab_1 = __importDefault(require("@mui/material/Tab"));
8
8
  const constants_1 = require("../../constants");
9
9
  const styled_1 = require("../../styled");
10
10
  exports.StyledTab = (0, styled_1.styled)(Tab_1.default) `
11
- min-height: 36px;
11
+ min-height: ${constants_1.TABS_HEIGHT};
12
12
  padding: 0;
13
13
 
14
14
  line-height: 20px;
@@ -16,6 +16,10 @@ exports.StyledTab = (0, styled_1.styled)(Tab_1.default) `
16
16
 
17
17
  border: 2px solid transparent;
18
18
 
19
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
20
+ min-height: ${constants_1.TABS_HEIGHT_MOBILE};
21
+ }
22
+
19
23
  &:last-child {
20
24
  margin-right: 0;
21
25
  }
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.Wrapper = exports.StyledTabs = exports.Divider = exports.Container = void 0;
27
27
  const Tabs_1 = __importStar(require("@mui/material/Tabs"));
28
+ const constants_1 = require("../constants");
28
29
  const styled_1 = require("../styled");
29
30
  exports.Container = styled_1.styled.div `
30
31
  overflow-x: auto;
@@ -46,8 +47,9 @@ exports.Container = styled_1.styled.div `
46
47
  }
47
48
  `;
48
49
  exports.Divider = styled_1.styled.div `
49
- position: relative;
50
- bottom: 2px;
50
+ position: absolute;
51
+ bottom: 0;
52
+ left: 0;
51
53
 
52
54
  width: 100%;
53
55
  height: 1px;
@@ -66,7 +68,14 @@ exports.StyledTabs = (0, styled_1.styled)(Tabs_1.default) `
66
68
  }
67
69
  `;
68
70
  exports.Wrapper = styled_1.styled.div `
71
+ position: relative;
72
+
69
73
  display: inline-block;
70
74
 
71
75
  min-width: 100%;
76
+ height: ${constants_1.TABS_HEIGHT};
77
+
78
+ ${({ theme }) => theme.breakpoints.down('mobile')} {
79
+ height: ${constants_1.TABS_HEIGHT_MOBILE};
80
+ }
72
81
  `;
@@ -3,3 +3,4 @@ export * from './scrollbar';
3
3
  export * from './footer';
4
4
  export * from './classnames';
5
5
  export * from './media';
6
+ export * from './tabs';
@@ -19,3 +19,4 @@ __exportStar(require("./scrollbar"), exports);
19
19
  __exportStar(require("./footer"), exports);
20
20
  __exportStar(require("./classnames"), exports);
21
21
  __exportStar(require("./media"), exports);
22
+ __exportStar(require("./tabs"), exports);
@@ -0,0 +1,2 @@
1
+ export declare const TABS_HEIGHT = "34px";
2
+ export declare const TABS_HEIGHT_MOBILE = "40px";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TABS_HEIGHT_MOBILE = exports.TABS_HEIGHT = void 0;
4
+ exports.TABS_HEIGHT = '34px';
5
+ exports.TABS_HEIGHT_MOBILE = '40px';
@@ -3,10 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MuiTabs = void 0;
4
4
  exports.MuiTabs = {
5
5
  styleOverrides: {
6
- root() {
6
+ root({ theme }) {
7
7
  return {
8
- minHeight: 38,
9
- height: 38,
8
+ minHeight: 34,
9
+ height: 34,
10
+ [theme.breakpoints.down('mobile')]: {
11
+ minHeight: 40,
12
+ height: 40,
13
+ },
10
14
  };
11
15
  },
12
16
  indicator({ theme }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.113.1",
3
+ "version": "4.113.2",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {
@@ -1,3 +0,0 @@
1
- export declare const StyledTabs: import("../../styled").StyledComponent<import("../../Tabs").TabsProps & {
2
- theme?: import("@emotion/react").Theme | undefined;
3
- }, {}, {}>;
@@ -1,5 +0,0 @@
1
- import { styled } from '../../styled';
2
- import { Tabs } from '../../Tabs';
3
- export const StyledTabs = styled(Tabs) `
4
- min-height: 36px;
5
- `;
@@ -1,3 +0,0 @@
1
- export declare const StyledTabs: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../../Tabs").TabsProps & {
2
- theme?: import("@emotion/react").Theme | undefined;
3
- }, {}, {}>;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StyledTabs = void 0;
4
- const styled_1 = require("../../styled");
5
- const Tabs_1 = require("../../Tabs");
6
- exports.StyledTabs = (0, styled_1.styled)(Tabs_1.Tabs) `
7
- min-height: 36px;
8
- `;