@astral/ui 4.9.0 → 4.11.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/components/CheckboxField/CheckboxField.d.ts +1 -3
- package/components/CheckboxField/CheckboxField.js +2 -1
- package/components/CheckboxField/constants.d.ts +3 -0
- package/components/CheckboxField/constants.js +4 -0
- package/components/CheckboxField/index.d.ts +1 -0
- package/components/CheckboxField/index.js +1 -0
- package/components/CheckboxField/styles.js +2 -2
- package/components/PageLayout/PageHeader/HeaderContent/HeaderContent.js +1 -1
- package/components/PageLayout/PageHeader/Title/Title.js +1 -1
- package/components/PageLayout/PageHeader/Title/styles.js +2 -0
- package/components/TextField/styles.js +1 -1
- package/components/theme/components/MuiOutlinedInput.js +3 -0
- package/node/components/CheckboxField/CheckboxField.d.ts +1 -3
- package/node/components/CheckboxField/CheckboxField.js +2 -1
- package/node/components/CheckboxField/constants.d.ts +3 -0
- package/node/components/CheckboxField/constants.js +7 -0
- package/node/components/CheckboxField/index.d.ts +1 -0
- package/node/components/CheckboxField/index.js +3 -0
- package/node/components/CheckboxField/styles.js +2 -2
- package/node/components/PageLayout/PageHeader/HeaderContent/HeaderContent.js +1 -1
- package/node/components/PageLayout/PageHeader/Title/Title.js +1 -1
- package/node/components/PageLayout/PageHeader/Title/styles.js +2 -0
- package/node/components/TextField/styles.js +1 -1
- package/node/components/theme/components/MuiOutlinedInput.js +3 -0
- package/package.json +1 -1
|
@@ -29,9 +29,7 @@ export declare const CheckboxField: import("react").ForwardRefExoticComponent<im
|
|
|
29
29
|
checked?: boolean | undefined;
|
|
30
30
|
indeterminate?: boolean | undefined;
|
|
31
31
|
isError?: boolean | undefined;
|
|
32
|
-
onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>, checked: boolean) => void) | undefined;
|
|
33
|
-
* Флаг принудительного скрытия блока helperText
|
|
34
|
-
*/
|
|
32
|
+
onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>, checked: boolean) => void) | undefined;
|
|
35
33
|
name?: string | undefined;
|
|
36
34
|
value?: string | undefined;
|
|
37
35
|
defaultChecked?: boolean | undefined;
|
|
@@ -3,11 +3,12 @@ import { forwardRef, useMemo } from 'react';
|
|
|
3
3
|
import { Checkbox } from '../Checkbox';
|
|
4
4
|
import { FormControl } from '../FormControl';
|
|
5
5
|
import { Tooltip } from '../Tooltip';
|
|
6
|
+
import { checkboxFieldClassnames } from './constants';
|
|
6
7
|
import { StyledFormControlledLabel, StyledFormHelperText } from './styles';
|
|
7
8
|
/**
|
|
8
9
|
* Составной компонент чекбокса. Содержит label, tooltip, helperText и т.д.
|
|
9
10
|
*/
|
|
10
11
|
export const CheckboxField = forwardRef(({ isSuccess, helperText, hideHelperText = false, label, isError, ...restProps }, ref) => {
|
|
11
12
|
const showTooltip = useMemo(() => Boolean(isError && hideHelperText), [isError, hideHelperText]);
|
|
12
|
-
return (_jsxs(FormControl, { ref: ref, children: [_jsx(Tooltip, { title: showTooltip && helperText, placement: "bottom-start", withoutContainer: false, children: _jsx(StyledFormControlledLabel, { control: _jsx(Checkbox, { isError: isError, ...restProps }), label: label }) }), !hideHelperText && (_jsx(StyledFormHelperText, { error: isError, success: isSuccess, children: helperText }))] }));
|
|
13
|
+
return (_jsxs(FormControl, { ref: ref, children: [_jsx(Tooltip, { title: showTooltip && helperText, placement: "bottom-start", withoutContainer: false, children: _jsx(StyledFormControlledLabel, { classes: { label: checkboxFieldClassnames.label }, control: _jsx(Checkbox, { isError: isError, ...restProps }), label: label }) }), !hideHelperText && (_jsx(StyledFormHelperText, { error: isError, success: isSuccess, children: helperText }))] }));
|
|
13
14
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { typographyClasses } from '@mui/material';
|
|
2
1
|
import { FormControlLabel } from '../FormControlLabel';
|
|
3
2
|
import { FormHelperText } from '../FormHelperText';
|
|
4
3
|
import { styled } from '../styles';
|
|
4
|
+
import { checkboxFieldClassnames } from './constants';
|
|
5
5
|
export const StyledFormControlledLabel = styled(FormControlLabel) `
|
|
6
6
|
align-items: flex-start;
|
|
7
7
|
|
|
8
|
-
.${
|
|
8
|
+
.${checkboxFieldClassnames.label} {
|
|
9
9
|
margin-left: 0;
|
|
10
10
|
padding-top: calc(${({ theme }) => theme.spacing(1)} + 2px);
|
|
11
11
|
|
|
@@ -13,5 +13,5 @@ export const HeaderContent = ({ backButton, description, subheader, breadcrumbs,
|
|
|
13
13
|
}
|
|
14
14
|
return (_jsx(BreadcrumbsWrapper, { children: Array.isArray(breadcrumbs) ? (_jsx(Breadcrumbs, { children: breadcrumbs })) : (breadcrumbs) }));
|
|
15
15
|
};
|
|
16
|
-
return (_jsxs(_Fragment, { children: [renderBreadcrumbs(), _jsx(DesktopTitleWrapper, { children: _jsx(Title, { backButton: backButton, title: title, isLoading: isLoading, hasDescription: Boolean(description), hasBreadcrumbs: Boolean(breadcrumbs) }) }), _jsx(Description, { description: description, isLoading: isLoading }), actions && (_jsx(PageActions, { className: classNames(pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "
|
|
16
|
+
return (_jsxs(_Fragment, { children: [renderBreadcrumbs(), _jsx(DesktopTitleWrapper, { children: _jsx(Title, { backButton: backButton, title: title, isLoading: isLoading, hasDescription: Boolean(description), hasBreadcrumbs: Boolean(breadcrumbs) }) }), _jsx(Description, { description: description, isLoading: isLoading }), actions && (_jsx(PageActions, { className: classNames(pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "medium", ...actions })), subheader && _jsx(PageSubheader, { children: subheader })] }));
|
|
17
17
|
};
|
|
@@ -6,5 +6,5 @@ export const Title = ({ backButton, title, isLoading, hasDescription, hasBreadcr
|
|
|
6
6
|
if (!title && isLoading) {
|
|
7
7
|
return _jsx(StyledSkeleton, { height: 20, width: 280, variant: "rounded" });
|
|
8
8
|
}
|
|
9
|
-
return (_jsxs(_Fragment, { children: [backButton && (_jsx(BackButton, { ...backButton, variant: "outlined", color: "grey", size: "
|
|
9
|
+
return (_jsxs(_Fragment, { children: [backButton && (_jsx(BackButton, { ...backButton, variant: "outlined", color: "grey", size: "medium", children: _jsx(ArrowLOutlineMd, {}) })), typeof title === 'string' ? (_jsx(TitleWrapper, { component: "h1", variant: "h3", "$hasDescription": hasDescription, "$hasBreadcrumbs": hasBreadcrumbs, children: _jsx(OverflowTypography, { component: "div", variant: "inherit", children: title }) })) : (_jsx(TitleWrapper, { component: "div", role: "heading", variant: "h3", "aria-level": 1, "$hasDescription": hasDescription, "$hasBreadcrumbs": hasBreadcrumbs, children: title }))] }));
|
|
10
10
|
};
|
|
@@ -23,6 +23,8 @@ export const TitleWrapper = styled(Typography, {
|
|
|
23
23
|
align-self: center;
|
|
24
24
|
|
|
25
25
|
margin-right: ${({ theme }) => theme.spacing(3)};
|
|
26
|
+
|
|
27
|
+
line-height: ${({ theme }) => theme.typography.h2.lineHeight};
|
|
26
28
|
|
|
27
29
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
28
30
|
font-size: ${({ theme }) => theme.typography.h5.fontSize};
|
|
@@ -29,9 +29,7 @@ export declare const CheckboxField: import("react").ForwardRefExoticComponent<im
|
|
|
29
29
|
checked?: boolean | undefined;
|
|
30
30
|
indeterminate?: boolean | undefined;
|
|
31
31
|
isError?: boolean | undefined;
|
|
32
|
-
onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>, checked: boolean) => void) | undefined;
|
|
33
|
-
* Флаг принудительного скрытия блока helperText
|
|
34
|
-
*/
|
|
32
|
+
onChange?: ((event: import("react").ChangeEvent<HTMLInputElement>, checked: boolean) => void) | undefined;
|
|
35
33
|
name?: string | undefined;
|
|
36
34
|
value?: string | undefined;
|
|
37
35
|
defaultChecked?: boolean | undefined;
|
|
@@ -6,11 +6,12 @@ const react_1 = require("react");
|
|
|
6
6
|
const Checkbox_1 = require("../Checkbox");
|
|
7
7
|
const FormControl_1 = require("../FormControl");
|
|
8
8
|
const Tooltip_1 = require("../Tooltip");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
9
10
|
const styles_1 = require("./styles");
|
|
10
11
|
/**
|
|
11
12
|
* Составной компонент чекбокса. Содержит label, tooltip, helperText и т.д.
|
|
12
13
|
*/
|
|
13
14
|
exports.CheckboxField = (0, react_1.forwardRef)(({ isSuccess, helperText, hideHelperText = false, label, isError, ...restProps }, ref) => {
|
|
14
15
|
const showTooltip = (0, react_1.useMemo)(() => Boolean(isError && hideHelperText), [isError, hideHelperText]);
|
|
15
|
-
return ((0, jsx_runtime_1.jsxs)(FormControl_1.FormControl, { ref: ref, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: showTooltip && helperText, placement: "bottom-start", withoutContainer: false, children: (0, jsx_runtime_1.jsx)(styles_1.StyledFormControlledLabel, { control: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { isError: isError, ...restProps }), label: label }) }), !hideHelperText && ((0, jsx_runtime_1.jsx)(styles_1.StyledFormHelperText, { error: isError, success: isSuccess, children: helperText }))] }));
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(FormControl_1.FormControl, { ref: ref, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: showTooltip && helperText, placement: "bottom-start", withoutContainer: false, children: (0, jsx_runtime_1.jsx)(styles_1.StyledFormControlledLabel, { classes: { label: constants_1.checkboxFieldClassnames.label }, control: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { isError: isError, ...restProps }), label: label }) }), !hideHelperText && ((0, jsx_runtime_1.jsx)(styles_1.StyledFormHelperText, { error: isError, success: isSuccess, children: helperText }))] }));
|
|
16
17
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkboxFieldClassnames = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
exports.checkboxFieldClassnames = {
|
|
6
|
+
label: (0, utils_1.createUIKitClassname)('checkbox-field__label'),
|
|
7
|
+
};
|
|
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.checkboxFieldClassnames = void 0;
|
|
17
18
|
__exportStar(require("./CheckboxField"), exports);
|
|
19
|
+
var constants_1 = require("./constants");
|
|
20
|
+
Object.defineProperty(exports, "checkboxFieldClassnames", { enumerable: true, get: function () { return constants_1.checkboxFieldClassnames; } });
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StyledFormHelperText = exports.StyledFormControlledLabel = void 0;
|
|
4
|
-
const material_1 = require("@mui/material");
|
|
5
4
|
const FormControlLabel_1 = require("../FormControlLabel");
|
|
6
5
|
const FormHelperText_1 = require("../FormHelperText");
|
|
7
6
|
const styles_1 = require("../styles");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
8
|
exports.StyledFormControlledLabel = (0, styles_1.styled)(FormControlLabel_1.FormControlLabel) `
|
|
9
9
|
align-items: flex-start;
|
|
10
10
|
|
|
11
|
-
.${
|
|
11
|
+
.${constants_1.checkboxFieldClassnames.label} {
|
|
12
12
|
margin-left: 0;
|
|
13
13
|
padding-top: calc(${({ theme }) => theme.spacing(1)} + 2px);
|
|
14
14
|
|
|
@@ -16,6 +16,6 @@ const HeaderContent = ({ backButton, description, subheader, breadcrumbs, action
|
|
|
16
16
|
}
|
|
17
17
|
return ((0, jsx_runtime_1.jsx)(styles_1.BreadcrumbsWrapper, { children: Array.isArray(breadcrumbs) ? ((0, jsx_runtime_1.jsx)(Breadcrumbs_1.Breadcrumbs, { children: breadcrumbs })) : (breadcrumbs) }));
|
|
18
18
|
};
|
|
19
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderBreadcrumbs(), (0, jsx_runtime_1.jsx)(styles_1.DesktopTitleWrapper, { children: (0, jsx_runtime_1.jsx)(Title_1.Title, { backButton: backButton, title: title, isLoading: isLoading, hasDescription: Boolean(description), hasBreadcrumbs: Boolean(breadcrumbs) }) }), (0, jsx_runtime_1.jsx)(Description_1.Description, { description: description, isLoading: isLoading }), actions && ((0, jsx_runtime_1.jsx)(PageActions_1.PageActions, { className: (0, utils_1.classNames)(constants_1.pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderBreadcrumbs(), (0, jsx_runtime_1.jsx)(styles_1.DesktopTitleWrapper, { children: (0, jsx_runtime_1.jsx)(Title_1.Title, { backButton: backButton, title: title, isLoading: isLoading, hasDescription: Boolean(description), hasBreadcrumbs: Boolean(breadcrumbs) }) }), (0, jsx_runtime_1.jsx)(Description_1.Description, { description: description, isLoading: isLoading }), actions && ((0, jsx_runtime_1.jsx)(PageActions_1.PageActions, { className: (0, utils_1.classNames)(constants_1.pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "medium", ...actions })), subheader && (0, jsx_runtime_1.jsx)(styles_1.PageSubheader, { children: subheader })] }));
|
|
20
20
|
};
|
|
21
21
|
exports.HeaderContent = HeaderContent;
|
|
@@ -9,6 +9,6 @@ const Title = ({ backButton, title, isLoading, hasDescription, hasBreadcrumbs, }
|
|
|
9
9
|
if (!title && isLoading) {
|
|
10
10
|
return (0, jsx_runtime_1.jsx)(styles_1.StyledSkeleton, { height: 20, width: 280, variant: "rounded" });
|
|
11
11
|
}
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [backButton && ((0, jsx_runtime_1.jsx)(styles_1.BackButton, { ...backButton, variant: "outlined", color: "grey", size: "
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [backButton && ((0, jsx_runtime_1.jsx)(styles_1.BackButton, { ...backButton, variant: "outlined", color: "grey", size: "medium", children: (0, jsx_runtime_1.jsx)(icons_1.ArrowLOutlineMd, {}) })), typeof title === 'string' ? ((0, jsx_runtime_1.jsx)(styles_1.TitleWrapper, { component: "h1", variant: "h3", "$hasDescription": hasDescription, "$hasBreadcrumbs": hasBreadcrumbs, children: (0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { component: "div", variant: "inherit", children: title }) })) : ((0, jsx_runtime_1.jsx)(styles_1.TitleWrapper, { component: "div", role: "heading", variant: "h3", "aria-level": 1, "$hasDescription": hasDescription, "$hasBreadcrumbs": hasBreadcrumbs, children: title }))] }));
|
|
13
13
|
};
|
|
14
14
|
exports.Title = Title;
|
|
@@ -26,6 +26,8 @@ exports.TitleWrapper = (0, styles_1.styled)(Typography_1.Typography, {
|
|
|
26
26
|
align-self: center;
|
|
27
27
|
|
|
28
28
|
margin-right: ${({ theme }) => theme.spacing(3)};
|
|
29
|
+
|
|
30
|
+
line-height: ${({ theme }) => theme.typography.h2.lineHeight};
|
|
29
31
|
|
|
30
32
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
31
33
|
font-size: ${({ theme }) => theme.typography.h5.fontSize};
|