@astral/ui 4.113.1 → 4.113.3
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/NotificationList/Tabs/Tabs.js +2 -3
- package/components/Tabs/Tab/styles.js +6 -2
- package/components/Tabs/styles.js +11 -2
- package/components/constants/index.d.ts +1 -0
- package/components/constants/index.js +1 -0
- package/components/constants/tabs.d.ts +2 -0
- package/components/constants/tabs.js +2 -0
- package/components/theme/components/MuiTabs.js +7 -3
- package/hook-form/FormToggleButtonGroup/FormToggleButtonGroup.d.ts +1 -1
- package/hook-form/FormToggleButtonGroup/FormToggleButtonGroup.js +2 -2
- package/node/components/NotificationList/Tabs/Tabs.js +1 -2
- package/node/components/Tabs/Tab/styles.js +5 -1
- package/node/components/Tabs/styles.js +11 -2
- package/node/components/constants/index.d.ts +1 -0
- package/node/components/constants/index.js +1 -0
- package/node/components/constants/tabs.d.ts +2 -0
- package/node/components/constants/tabs.js +5 -0
- package/node/components/theme/components/MuiTabs.js +7 -3
- package/node/hook-form/FormToggleButtonGroup/FormToggleButtonGroup.d.ts +1 -1
- package/node/hook-form/FormToggleButtonGroup/FormToggleButtonGroup.js +2 -2
- package/package.json +1 -1
- package/components/NotificationList/Tabs/styles.d.ts +0 -3
- package/components/NotificationList/Tabs/styles.js +0 -5
- package/node/components/NotificationList/Tabs/styles.d.ts +0 -3
- package/node/components/NotificationList/Tabs/styles.js +0 -8
|
@@ -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(
|
|
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:
|
|
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:
|
|
24
|
-
bottom:
|
|
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
|
`;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export const MuiTabs = {
|
|
2
2
|
styleOverrides: {
|
|
3
|
-
root() {
|
|
3
|
+
root({ theme }) {
|
|
4
4
|
return {
|
|
5
|
-
minHeight:
|
|
6
|
-
height:
|
|
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 }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ToggleButtonGroupProps } from '../../components/ToggleButtonGroup';
|
|
2
2
|
import { type WithFormFieldProps } from '../types';
|
|
3
|
-
export type FormToggleButtonGroupProps<TFieldValues extends object, TDisableHelperText extends boolean = false> = WithFormFieldProps<Omit<ToggleButtonGroupProps, 'exclusive'>, TFieldValues> & {
|
|
3
|
+
export type FormToggleButtonGroupProps<TFieldValues extends object, TDisableHelperText extends boolean = false> = WithFormFieldProps<Omit<ToggleButtonGroupProps, 'exclusive' | 'defaultValue'>, TFieldValues> & {
|
|
4
4
|
/**
|
|
5
5
|
* Если true, сообщение об ошибке не будет показано
|
|
6
6
|
*/
|
|
@@ -5,11 +5,11 @@ export const FormToggleButtonGroup = (props) => {
|
|
|
5
5
|
const { isError, onChange, errorText, color: colorToggleButton, isDisabledErrorText, ...restProps } = props;
|
|
6
6
|
const { error, children, helperText, onChange: fieldPropsOnChange, ...fieldProps } = useFormFieldProps({
|
|
7
7
|
...restProps,
|
|
8
|
-
defaultValue: restProps.defaultValue
|
|
8
|
+
defaultValue: restProps.defaultValue ??
|
|
9
9
|
null,
|
|
10
10
|
});
|
|
11
11
|
const handleChange = (_, value) => {
|
|
12
|
-
if (value) {
|
|
12
|
+
if (value != null) {
|
|
13
13
|
fieldPropsOnChange(value);
|
|
14
14
|
}
|
|
15
15
|
};
|
|
@@ -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)(
|
|
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:
|
|
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:
|
|
50
|
-
bottom:
|
|
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,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:
|
|
9
|
-
height:
|
|
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 }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ToggleButtonGroupProps } from '../../components/ToggleButtonGroup';
|
|
2
2
|
import { type WithFormFieldProps } from '../types';
|
|
3
|
-
export type FormToggleButtonGroupProps<TFieldValues extends object, TDisableHelperText extends boolean = false> = WithFormFieldProps<Omit<ToggleButtonGroupProps, 'exclusive'>, TFieldValues> & {
|
|
3
|
+
export type FormToggleButtonGroupProps<TFieldValues extends object, TDisableHelperText extends boolean = false> = WithFormFieldProps<Omit<ToggleButtonGroupProps, 'exclusive' | 'defaultValue'>, TFieldValues> & {
|
|
4
4
|
/**
|
|
5
5
|
* Если true, сообщение об ошибке не будет показано
|
|
6
6
|
*/
|
|
@@ -8,11 +8,11 @@ const FormToggleButtonGroup = (props) => {
|
|
|
8
8
|
const { isError, onChange, errorText, color: colorToggleButton, isDisabledErrorText, ...restProps } = props;
|
|
9
9
|
const { error, children, helperText, onChange: fieldPropsOnChange, ...fieldProps } = (0, useFormFieldProps_1.useFormFieldProps)({
|
|
10
10
|
...restProps,
|
|
11
|
-
defaultValue: restProps.defaultValue
|
|
11
|
+
defaultValue: restProps.defaultValue ??
|
|
12
12
|
null,
|
|
13
13
|
});
|
|
14
14
|
const handleChange = (_, value) => {
|
|
15
|
-
if (value) {
|
|
15
|
+
if (value != null) {
|
|
16
16
|
fieldPropsOnChange(value);
|
|
17
17
|
}
|
|
18
18
|
};
|
package/package.json
CHANGED
|
@@ -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
|
-
`;
|