@astral/ui 4.91.2 → 4.92.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/components/Alert/Alert.js +2 -2
- package/components/Autocomplete/Autocomplete.js +2 -2
- package/components/Autocomplete/useLogic/useLogic.js +2 -2
- package/components/Badge/Badge.js +2 -2
- package/components/BulletList/BulletList.js +2 -2
- package/components/BulletListItem/BulletListItem.js +2 -2
- package/components/Button/useLogic/useLogic.js +2 -2
- package/components/Checkbox/Icon/Icon.js +2 -2
- package/components/Checkbox/useLogic/useLogic.js +2 -2
- package/components/Chip/ChipStatusIcon/ChipStatusIcon.js +2 -2
- package/components/Chip/useLogic/useLogic.js +2 -2
- package/components/ConfirmDialog/ConfirmDialog.js +2 -2
- package/components/CopyTypography/CopyTypography.js +3 -3
- package/components/DashboardAlert/DashboardAlert.js +2 -2
- package/components/DashboardLayout/DashboardSidebar/useLogic/useLogic.js +2 -2
- package/components/DashboardLayout/Header/styles.js +8 -0
- package/components/DashboardLayout/Main/styles.js +8 -0
- package/components/DashboardSidebarSkeleton/DashboardSidebarSkeleton.js +2 -2
- package/components/DataGrid/Body/Body.js +2 -2
- package/components/DataGrid/Cell/Cell.js +2 -2
- package/components/DataGrid/DataGrid.js +2 -2
- package/components/DataGrid/HeadCell/HeadCell.js +2 -2
- package/components/DataGrid/PinnedSections/Section/useLogic/useLogic.js +2 -2
- package/components/DataGrid/Row/Row.js +3 -3
- package/components/DataGrid/RowBase/RowBase.js +2 -2
- package/components/DataGridInfinite/DataGridInfinite.js +2 -2
- package/components/DataGridPaginationContainer/DataGridPaginationContainer.js +2 -2
- package/components/DescriptionCell/useLogic/useLogic.js +2 -2
- package/components/Dialog/Dialog.js +2 -2
- package/components/Dialog/useLogic/useLogic.js +2 -2
- package/components/DialogActions/DialogActions.js +2 -2
- package/components/DialogContent/DialogContent.js +2 -2
- package/components/DonutChart/DonutChart.js +2 -2
- package/components/EmailField/EmailField.js +2 -2
- package/components/EmailOrPhoneField/EmailOrPhoneField.js +2 -2
- package/components/Filename/Filename.js +2 -2
- package/components/GuidTypography/GuidTypography.js +5 -5
- package/components/HintPopover/HintPopover.js +2 -2
- package/components/IconButton/IconButton.js +2 -2
- package/components/Loader/Loader.js +2 -2
- package/components/MenuItem/MenuItem.js +2 -2
- package/components/MinimalisticPagination/MinimalisticPagination.js +2 -2
- package/components/NewPopover/NewPopover.js +2 -2
- package/components/NewStepper/NewStepper.js +2 -2
- package/components/NewStepper/Step/Step.js +3 -3
- package/components/Notification/NotificationStackContainer/NotificationStackContainer.js +3 -3
- package/components/PageAside/PageAside.js +2 -2
- package/components/PageAsideNavigation/PageAsideNavigation.js +2 -2
- package/components/PageContent/PageContent.js +2 -2
- package/components/PageContent/styles.js +1 -1
- package/components/PageHeader/HeaderContent/HeaderContent.js +2 -2
- package/components/PageHeader/HeaderContent/styles.js +12 -0
- package/components/PageHeader/PageActions/useLogic/useLogic.js +3 -3
- package/components/PageHeader/PageHeader.js +3 -3
- package/components/PageHeader/styles.js +16 -4
- package/components/PageLayout/PageLayout.js +2 -2
- package/components/PageLayout/styles.js +14 -2
- package/components/PageLayoutContainer/PageLayoutContainer.js +2 -2
- package/components/PageLayoutSection/PageLayoutSection.js +2 -2
- package/components/PageLayoutSection/PageLayoutSectionContainer/PageLayoutSectionContainer.js +2 -2
- package/components/PagePinnableAside/PagePinnableAside.js +2 -2
- package/components/PasswordField/PasswordField.js +2 -2
- package/components/PdfViewer/PdfDocument/PdfDocument.js +2 -2
- package/components/PinButton/PinButton.js +2 -2
- package/components/Radio/useLogic/useLogic.js +2 -2
- package/components/RadioCard/RadioCard.js +2 -2
- package/components/SearchField/SearchField.js +2 -2
- package/components/StaticCalendar/StaticDaysCalendar/StaticDaysCalendar.js +2 -2
- package/components/SvgIcon/SvgIcon.js +2 -2
- package/components/Tabs/Tabs.js +2 -2
- package/components/Tag/useLogic/useLogic.js +2 -2
- package/components/TagBadge/TagBadge.js +2 -2
- package/components/TextField/TextField.js +2 -2
- package/components/Tooltip/Tooltip.js +2 -2
- package/components/Tooltip/useLogic/useLogic.js +2 -2
- package/components/Tree/TreeList/TreeList.js +2 -2
- package/components/TreeLikeList/TreeLikeList.js +2 -2
- package/components/Typography/Typography.js +2 -2
- package/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +4 -4
- package/components/utils/classNames/classNames.d.ts +1 -1
- package/components/utils/classNames/classNames.js +1 -1
- package/components/utils/cn/cn.d.ts +1 -0
- package/components/utils/cn/cn.js +1 -0
- package/components/utils/cn/index.d.ts +1 -0
- package/components/utils/cn/index.js +1 -0
- package/components/utils/cn/public.d.ts +1 -0
- package/components/utils/cn/public.js +1 -0
- package/hook-form/EditableText/EditableText.js +2 -2
- package/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +2 -2
- package/hook-form/FormMobilePhoneField/FormMobilePhoneField.js +2 -2
- package/hook-form/FormPageLayout/FormPageLayout.js +2 -2
- package/hook-form/FormPageLayoutBase/FormPageLayoutBase.js +2 -2
- package/hook-form/FormWizardPageLayout/FormWizardPageLayout.js +2 -2
- package/node/components/Alert/Alert.js +2 -2
- package/node/components/Autocomplete/Autocomplete.js +2 -2
- package/node/components/Autocomplete/useLogic/useLogic.js +2 -2
- package/node/components/Badge/Badge.js +2 -2
- package/node/components/BulletList/BulletList.js +2 -2
- package/node/components/BulletListItem/BulletListItem.js +2 -2
- package/node/components/Button/useLogic/useLogic.js +2 -2
- package/node/components/Checkbox/Icon/Icon.js +2 -2
- package/node/components/Checkbox/useLogic/useLogic.js +2 -2
- package/node/components/Chip/ChipStatusIcon/ChipStatusIcon.js +2 -2
- package/node/components/Chip/useLogic/useLogic.js +2 -2
- package/node/components/ConfirmDialog/ConfirmDialog.js +2 -2
- package/node/components/CopyTypography/CopyTypography.js +3 -3
- package/node/components/DashboardAlert/DashboardAlert.js +2 -2
- package/node/components/DashboardLayout/DashboardSidebar/useLogic/useLogic.js +2 -2
- package/node/components/DashboardLayout/Header/styles.js +8 -0
- package/node/components/DashboardLayout/Main/styles.js +8 -0
- package/node/components/DashboardSidebarSkeleton/DashboardSidebarSkeleton.js +2 -2
- package/node/components/DataGrid/Body/Body.js +2 -2
- package/node/components/DataGrid/Cell/Cell.js +2 -2
- package/node/components/DataGrid/DataGrid.js +2 -2
- package/node/components/DataGrid/HeadCell/HeadCell.js +2 -2
- package/node/components/DataGrid/PinnedSections/Section/useLogic/useLogic.js +2 -2
- package/node/components/DataGrid/Row/Row.js +3 -3
- package/node/components/DataGrid/RowBase/RowBase.js +2 -2
- package/node/components/DataGridInfinite/DataGridInfinite.js +2 -2
- package/node/components/DataGridPaginationContainer/DataGridPaginationContainer.js +2 -2
- package/node/components/DescriptionCell/useLogic/useLogic.js +2 -2
- package/node/components/Dialog/Dialog.js +2 -2
- package/node/components/Dialog/useLogic/useLogic.js +2 -2
- package/node/components/DialogActions/DialogActions.js +2 -2
- package/node/components/DialogContent/DialogContent.js +2 -2
- package/node/components/DonutChart/DonutChart.js +2 -2
- package/node/components/EmailField/EmailField.js +2 -2
- package/node/components/EmailOrPhoneField/EmailOrPhoneField.js +2 -2
- package/node/components/Filename/Filename.js +2 -2
- package/node/components/GuidTypography/GuidTypography.js +5 -5
- package/node/components/HintPopover/HintPopover.js +2 -2
- package/node/components/IconButton/IconButton.js +2 -2
- package/node/components/Loader/Loader.js +2 -2
- package/node/components/MenuItem/MenuItem.js +2 -2
- package/node/components/MinimalisticPagination/MinimalisticPagination.js +2 -2
- package/node/components/NewPopover/NewPopover.js +2 -2
- package/node/components/NewStepper/NewStepper.js +2 -2
- package/node/components/NewStepper/Step/Step.js +3 -3
- package/node/components/Notification/NotificationStackContainer/NotificationStackContainer.js +3 -3
- package/node/components/PageAside/PageAside.js +2 -2
- package/node/components/PageAsideNavigation/PageAsideNavigation.js +2 -2
- package/node/components/PageContent/PageContent.js +2 -2
- package/node/components/PageContent/styles.js +11 -11
- package/node/components/PageHeader/HeaderContent/HeaderContent.js +2 -2
- package/node/components/PageHeader/HeaderContent/styles.js +12 -0
- package/node/components/PageHeader/PageActions/useLogic/useLogic.js +3 -3
- package/node/components/PageHeader/PageHeader.js +3 -3
- package/node/components/PageHeader/styles.js +16 -4
- package/node/components/PageLayout/PageLayout.js +2 -2
- package/node/components/PageLayout/styles.js +14 -2
- package/node/components/PageLayoutContainer/PageLayoutContainer.js +2 -2
- package/node/components/PageLayoutSection/PageLayoutSection.js +2 -2
- package/node/components/PageLayoutSection/PageLayoutSectionContainer/PageLayoutSectionContainer.js +2 -2
- package/node/components/PagePinnableAside/PagePinnableAside.js +2 -2
- package/node/components/PasswordField/PasswordField.js +2 -2
- package/node/components/PdfViewer/PdfDocument/PdfDocument.js +2 -2
- package/node/components/PinButton/PinButton.js +2 -2
- package/node/components/Radio/useLogic/useLogic.js +2 -2
- package/node/components/RadioCard/RadioCard.js +2 -2
- package/node/components/SearchField/SearchField.js +2 -2
- package/node/components/StaticCalendar/StaticDaysCalendar/StaticDaysCalendar.js +2 -2
- package/node/components/SvgIcon/SvgIcon.js +2 -2
- package/node/components/Tabs/Tabs.js +2 -2
- package/node/components/Tag/useLogic/useLogic.js +2 -2
- package/node/components/TagBadge/TagBadge.js +2 -2
- package/node/components/TextField/TextField.js +2 -2
- package/node/components/Tooltip/Tooltip.js +2 -2
- package/node/components/Tooltip/useLogic/useLogic.js +2 -2
- package/node/components/Tree/TreeList/TreeList.js +2 -2
- package/node/components/TreeLikeList/TreeLikeList.js +2 -2
- package/node/components/Typography/Typography.js +2 -2
- package/node/components/placeholders/LoadingPlaceholder/LoadingPlaceholder.js +4 -4
- package/node/components/utils/classNames/classNames.d.ts +1 -1
- package/node/components/utils/classNames/classNames.js +2 -2
- package/node/components/utils/cn/cn.d.ts +1 -0
- package/node/components/utils/cn/cn.js +8 -0
- package/node/components/utils/cn/index.d.ts +1 -0
- package/node/components/utils/cn/index.js +17 -0
- package/node/components/utils/cn/public.d.ts +1 -0
- package/node/components/utils/cn/public.js +17 -0
- package/node/hook-form/EditableText/EditableText.js +2 -2
- package/node/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +2 -2
- package/node/hook-form/FormMobilePhoneField/FormMobilePhoneField.js +2 -2
- package/node/hook-form/FormPageLayout/FormPageLayout.js +2 -2
- package/node/hook-form/FormPageLayoutBase/FormPageLayoutBase.js +2 -2
- package/node/hook-form/FormWizardPageLayout/FormWizardPageLayout.js +2 -2
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { useHidePersonalData } from '../personalDataSecurity';
|
|
4
4
|
import { Tooltip } from '../Tooltip';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
6
|
import { FileBaseName, FileSuffix, StyledTypography } from './styles';
|
|
7
7
|
import { useLogic } from './useLogic';
|
|
8
8
|
export const Filename = forwardRef((props, forwardedRef) => {
|
|
@@ -14,5 +14,5 @@ export const Filename = forwardRef((props, forwardedRef) => {
|
|
|
14
14
|
const hidePersonalDataClassname = useHidePersonalData({
|
|
15
15
|
isEnabled: isHidePersonalData,
|
|
16
16
|
});
|
|
17
|
-
return (_jsx(Tooltip, { title: isOverflowed && children, disableInteractive: true, ...tooltipProps, className:
|
|
17
|
+
return (_jsx(Tooltip, { title: isOverflowed && children, disableInteractive: true, ...tooltipProps, className: cn(tooltipProps?.className, hidePersonalDataClassname), children: _jsxs(StyledTypography, { "$align": align, variant: variant, className: cn(className, hidePersonalDataClassname), ...restProps, children: [_jsx(FileBaseName, { ...baseNameProps }), _jsx(FileSuffix, { children: suffixWithExtension })] }) }));
|
|
18
18
|
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { CopyTypography } from '../CopyTypography';
|
|
3
3
|
import { OverflowTypography } from '../OverflowTypography';
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from '../utils/cn';
|
|
5
5
|
import { useLogic } from './useLogic';
|
|
6
6
|
export const GuidTypography = (props) => {
|
|
7
7
|
const { className, tooltipProps, canCopy, copyParams, restProps, resolvedCopyText, hidePersonalDataClassname, } = useLogic(props);
|
|
8
8
|
if (canCopy) {
|
|
9
9
|
return (_jsx(CopyTypography, { isShowCopyText: true, copyText: resolvedCopyText, tooltipProps: {
|
|
10
10
|
...tooltipProps,
|
|
11
|
-
className:
|
|
12
|
-
}, ...copyParams, children: _jsx(OverflowTypography, { visibleLastSymbolsCount: 4, className:
|
|
11
|
+
className: cn(tooltipProps?.className, hidePersonalDataClassname),
|
|
12
|
+
}, ...copyParams, children: _jsx(OverflowTypography, { visibleLastSymbolsCount: 4, className: cn(className, hidePersonalDataClassname), tooltipProps: { title: undefined }, ...restProps }) }));
|
|
13
13
|
}
|
|
14
|
-
return (_jsx(OverflowTypography, { visibleLastSymbolsCount: 4, className:
|
|
14
|
+
return (_jsx(OverflowTypography, { visibleLastSymbolsCount: 4, className: cn(className, hidePersonalDataClassname), tooltipProps: {
|
|
15
15
|
...tooltipProps,
|
|
16
|
-
className:
|
|
16
|
+
className: cn(tooltipProps?.className, hidePersonalDataClassname),
|
|
17
17
|
}, ...restProps }));
|
|
18
18
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CrossOutlineMd } from '../../icons/CrossOutlineMd';
|
|
3
3
|
import { useViewportType } from '../useViewportType';
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from '../utils/cn';
|
|
5
5
|
import { cva } from '../utils/cva';
|
|
6
6
|
import { hintPopoverClassnames } from './constants';
|
|
7
7
|
import { ActionRow, Body, CloseButton, StyledHintPopover, Title, } from './styles';
|
|
@@ -19,5 +19,5 @@ const hintPopoverCva = cva(hintPopoverClassnames.root, {
|
|
|
19
19
|
*/
|
|
20
20
|
export const HintPopover = ({ variant = 'dark', title, action, onClose, contentRef, children, className, ...restProps }) => {
|
|
21
21
|
const { isMobile } = useViewportType();
|
|
22
|
-
return (_jsx(StyledHintPopover, { ...restProps, className:
|
|
22
|
+
return (_jsx(StyledHintPopover, { ...restProps, className: cn(className, hintPopoverCva({ variant })), hasArrow: true, disableMobileDrawer: true, onClose: onClose, children: _jsxs(Body, { ref: contentRef, tabIndex: -1, children: [_jsx(CloseButton, { variant: "text", onClick: onClose, "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", children: _jsx(CrossOutlineMd, {}) }), title && (_jsx(Title, { component: "div", variant: isMobile ? 'h5' : 'h4', children: title })), children, action && _jsx(ActionRow, { children: action })] }) }));
|
|
23
23
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ButtonVariants } from '../Button';
|
|
3
3
|
import { forwardRefWithGeneric } from '../forwardRefWithGeneric';
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from '../utils/cn';
|
|
5
5
|
import { iconButtonClassnames } from './constants';
|
|
6
6
|
import { StyledButton } from './styles';
|
|
7
7
|
const UnwrappedIconButton = (props, ref) => {
|
|
8
8
|
const { variant = ButtonVariants.Contained, children, className, ...restProps } = props;
|
|
9
|
-
return (_jsx(StyledButton, { variant: variant, className:
|
|
9
|
+
return (_jsx(StyledButton, { variant: variant, className: cn(iconButtonClassnames.root, className), ...restProps, ref: ref, children: children }));
|
|
10
10
|
};
|
|
11
11
|
export const IconButton = forwardRefWithGeneric(UnwrappedIconButton);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
3
|
import { loaderClassnames } from './constants';
|
|
4
4
|
import { StyledSvgIcon, Wrapper } from './styles';
|
|
5
5
|
export const Loader = ({ size = 'medium', color = 'primary', className, style, }) => {
|
|
6
|
-
return (_jsx(Wrapper, { className:
|
|
6
|
+
return (_jsx(Wrapper, { className: cn(className, loaderClassnames.root), "$size": size, "$color": color, "data-color": color, role: "progressbar", style: style, children: _jsx(StyledSvgIcon, { viewBox: "22 22 44 44", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", children: _jsx("circle", { cx: "44", cy: "44", r: "20.2", fill: "none", stroke: "currentColor", strokeWidth: "3.6", strokeDasharray: "80, 200", strokeDashoffset: "0" }) }) }));
|
|
7
7
|
};
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import MuiMenuItem from '@mui/material/MenuItem';
|
|
3
3
|
import { forwardRefWithGeneric } from '../forwardRefWithGeneric';
|
|
4
4
|
import { Tooltip } from '../Tooltip';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
6
|
import { menuItemClassnames } from './constants';
|
|
7
7
|
const InnerMenuItem = (props, ref) => {
|
|
8
8
|
const { disabledReason, disabled, component = 'div', title, tooltipPlacement = 'left', note, className, ...rest } = props;
|
|
9
|
-
return (_jsx("li", { children: _jsx(Tooltip, { title: disabled ? disabledReason : note, placement: tooltipPlacement, withoutContainer: !disabled, children: _jsx(MuiMenuItem, { className:
|
|
9
|
+
return (_jsx("li", { children: _jsx(Tooltip, { title: disabled ? disabledReason : note, placement: tooltipPlacement, withoutContainer: !disabled, children: _jsx(MuiMenuItem, { className: cn(menuItemClassnames.root, className), ...rest, disabled: disabled, title: title, ref: ref, component: component }) }, title) }));
|
|
10
10
|
};
|
|
11
11
|
export const MenuItem = forwardRefWithGeneric(InnerMenuItem);
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { NextOutlineMd } from '../../icons/NextOutlineMd';
|
|
3
3
|
import { PreviousOutlineMd } from '../../icons/PreviousOutlineMd';
|
|
4
4
|
import { IconButton } from '../IconButton';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
6
|
import { cva } from '../utils/cva';
|
|
7
7
|
import { minimalisticPaginationClassnames } from './constants';
|
|
8
8
|
import { PageItem, PaginationWrapper } from './styles';
|
|
@@ -17,5 +17,5 @@ const rootCva = cva(minimalisticPaginationClassnames.root, {
|
|
|
17
17
|
export const MinimalisticPagination = (props) => {
|
|
18
18
|
const { previousButtonProps, nextButtonProps } = useLogic(props);
|
|
19
19
|
const { page, className, isDisabled } = props;
|
|
20
|
-
return (_jsxs(PaginationWrapper, { className:
|
|
20
|
+
return (_jsxs(PaginationWrapper, { className: cn(className, rootCva({ isDisabled })), "aria-label": "\u041F\u0430\u0433\u0438\u043D\u0430\u0446\u0438\u044F", children: [_jsx(IconButton, { "aria-label": "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443", variant: "text", ...previousButtonProps, children: _jsx(PreviousOutlineMd, {}) }), _jsx(PageItem, { component: "span", children: page }), _jsx(IconButton, { "aria-label": "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443", variant: "text", ...nextButtonProps, children: _jsx(NextOutlineMd, {}) })] }));
|
|
21
21
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { BottomDrawer } from '../BottomDrawer';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
4
|
import { cva } from '../utils/cva';
|
|
5
5
|
import { popoverClassnames } from './constants';
|
|
6
6
|
import { AnimatedWrapper, InnerContainer, PopoverArrow, StyledMuiPopper, } from './styles';
|
|
@@ -29,5 +29,5 @@ export const NewPopover = ({ children, onClose, isOpen, title, className, style,
|
|
|
29
29
|
disableAutoFocus,
|
|
30
30
|
}, children: children }));
|
|
31
31
|
}
|
|
32
|
-
return (_jsx(StyledMuiPopper, { className:
|
|
32
|
+
return (_jsx(StyledMuiPopper, { className: cn(popoverClassnames.root, className), style: style, open: shouldRender, placement: placement, anchorEl: anchorEl, disablePortal: disablePortal, modifiers: mergedModifiers, children: _jsxs(AnimatedWrapper, { className: animatedWrapperCva({ isOpen: isOpened, hasArrow }), style: animatedWrapperStyle, onAnimationEnd: handleAnimationEnd, children: [hasArrow && (_jsx(PopoverArrow, { ref: setArrowElement, className: popoverClassnames.arrow })), _jsx(InnerContainer, { ref: setContainerRef, tabIndex: -1, className: popoverClassnames.innerContainer, children: children })] }) }));
|
|
33
33
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
3
|
import { cva } from '../utils/cva';
|
|
4
4
|
import { stepperClassnames } from './constants';
|
|
5
5
|
import { StepperContextProvider } from './StepperContext';
|
|
@@ -22,7 +22,7 @@ const stepper = cva(stepperClassnames.root, {
|
|
|
22
22
|
});
|
|
23
23
|
export const NewStepper = (props) => {
|
|
24
24
|
const { containerRef, stepperConnector, stepperAlternativeLabel, activeStep, onClickPrevStep, onClickStep, orientation, className, children, } = useLogic(props);
|
|
25
|
-
return (_jsx(StepperContextProvider, { orientation: orientation, activeStep: activeStep, connector: stepperConnector, alternativeLabel: stepperAlternativeLabel, onClickPrevStep: onClickPrevStep, onClickStep: onClickStep, children: _jsx(Wrapper, { ref: containerRef, role: "group", className:
|
|
25
|
+
return (_jsx(StepperContextProvider, { orientation: orientation, activeStep: activeStep, connector: stepperConnector, alternativeLabel: stepperAlternativeLabel, onClickPrevStep: onClickPrevStep, onClickStep: onClickStep, children: _jsx(Wrapper, { ref: containerRef, role: "group", className: cn(stepper({
|
|
26
26
|
alternativeLabel: stepperAlternativeLabel,
|
|
27
27
|
connector: stepperConnector,
|
|
28
28
|
orientation,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
3
|
import { cva } from '../../utils/cva';
|
|
4
4
|
import { StepIcon } from '../StepIcon';
|
|
5
5
|
import { stepClassnames } from './constants';
|
|
@@ -55,7 +55,7 @@ const connector = cva(stepClassnames.connector, {
|
|
|
55
55
|
export const Step = (props) => {
|
|
56
56
|
const { isCompletedStep, isRenderButton, handleClick, connectorVariant, alternativeLabel, orientation, children, isError, isWarning, icon, className, label, isRenderVerticalLineConnector, isRenderHorizontalLineConnector, isDisabled, isActiveStep, } = useLogic(props);
|
|
57
57
|
const StepContent = isRenderButton ? StyledButton : StepContentWrapper;
|
|
58
|
-
return (_jsxs(Wrapper, { "data-active-step": isActiveStep, className:
|
|
58
|
+
return (_jsxs(Wrapper, { "data-active-step": isActiveStep, className: cn(step({
|
|
59
59
|
isError,
|
|
60
60
|
isCompleted: isCompletedStep,
|
|
61
61
|
connector: connectorVariant,
|
|
@@ -63,7 +63,7 @@ export const Step = (props) => {
|
|
|
63
63
|
alternativeLabel,
|
|
64
64
|
orientation,
|
|
65
65
|
isDisabled,
|
|
66
|
-
}), className), children: [_jsxs(StepContent, { variant: "text", onClick: handleClick, disabled: isDisabled, className:
|
|
66
|
+
}), className), children: [_jsxs(StepContent, { variant: "text", onClick: handleClick, disabled: isDisabled, className: cn(stepClassnames.content, {
|
|
67
67
|
[stepClassnames.active]: isActiveStep,
|
|
68
68
|
}), children: [_jsxs(LabelWrapper, { className: stepClassnames.labelContainer, children: [_jsx(IconWrapper, { className: stepClassnames.iconContainer, children: _jsx(StepIcon, { icon: icon, isActive: isActiveStep, isCompleted: isCompletedStep, isError: isError, isWarning: isWarning }) }), _jsx(Label, { label: label, isActiveStep: isActiveStep }), connectorVariant === 'arrow' && (_jsx(ArrowConnector, { className: connector({
|
|
69
69
|
connector: connectorVariant,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { injectStyle } from 'react-toastify-next/dist/inject-style';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../../utils/cn';
|
|
4
4
|
import { NOTIFY_CONTAINER_ID, NOTIFY_POSITIONS, NOTIFY_STATIC_CONTAINER_ID, notifyClassnames, } from '../constants';
|
|
5
5
|
import { CloseButton, Inner, StaticInner, Wrapper } from './styles';
|
|
6
6
|
import { useLogic } from './useLogic';
|
|
@@ -11,9 +11,9 @@ export const NotificationStackContainer = ({ containerId = NOTIFY_CONTAINER_ID,
|
|
|
11
11
|
const { isVisibleCloseButton, isStackExpanded, isStartedClosingNotify, closeAll, } = useLogic({
|
|
12
12
|
containerId,
|
|
13
13
|
});
|
|
14
|
-
return (_jsxs(Wrapper, { className:
|
|
14
|
+
return (_jsxs(Wrapper, { className: cn({
|
|
15
15
|
[notifyClassnames.container]: isStackExpanded,
|
|
16
|
-
}), children: [_jsx("div", { className: notifyClassnames.stackHost, children: _jsx(Inner, { ...props, className:
|
|
16
|
+
}), children: [_jsx("div", { className: notifyClassnames.stackHost, children: _jsx(Inner, { ...props, className: cn(notifyClassnames.stack, props.className), ...{ stacked: true }, containerId: containerId, pauseOnFocusLoss: true, position: NOTIFY_POSITIONS.BOTTOM_RIGHT, newestOnTop: false, closeOnClick: false, draggable: false, rtl: false, closeButton: false, bodyClassName: `${notifyClassnames.body}`, toastClassName: notifyClassnames.root, progressClassName: `${notifyClassnames.progress}` }) }), isVisibleCloseButton && (_jsx(CloseButton, { variant: "light", color: "grey", className: cn({
|
|
17
17
|
[notifyClassnames.closeButtonAnimationOut]: isStartedClosingNotify,
|
|
18
18
|
}), onClick: closeAll, children: "\u0421\u043A\u0440\u044B\u0442\u044C \u0432\u0441\u0435" })), _jsx(StaticInner, { containerId: staticContainerId, position: NOTIFY_POSITIONS.BOTTOM_RIGHT, newestOnTop: false, closeOnClick: false, draggable: false, rtl: false, closeButton: false, bodyClassName: `${notifyClassnames.body}`, toastClassName: notifyClassnames.root, progressClassName: `${notifyClassnames.progress}` }), bannerContainer] }));
|
|
19
19
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
4
|
import { cva } from '../utils/cva';
|
|
5
5
|
import { pageAsideClassnames } from './constants';
|
|
6
6
|
import { usePageAside } from './hooks';
|
|
@@ -18,5 +18,5 @@ export const PageAside = ({ children, className, header, navigation, }) => {
|
|
|
18
18
|
navigation,
|
|
19
19
|
});
|
|
20
20
|
return (_jsxs(_Fragment, { children: [isMobileNavigationVisible &&
|
|
21
|
-
createPortal(_jsx(MobileAsideNavigation, { className: pageAsideClassnames.mobileNavigation, children: navigation }), pageHeaderContainer), header && _jsx(MobileAsideHeader, { children: header }), _jsx(MobileAsideButton, { content: children }), _jsxs(Wrapper, { className:
|
|
21
|
+
createPortal(_jsx(MobileAsideNavigation, { className: pageAsideClassnames.mobileNavigation, children: navigation }), pageHeaderContainer), header && _jsx(MobileAsideHeader, { children: header }), _jsx(MobileAsideButton, { content: children }), _jsxs(Wrapper, { className: cn(className, asideCva({ withHeader: Boolean(header) })), children: [header && (_jsxs(AsideHeader, { children: [header, _jsx(StyledDivider, {})] })), navigation, children] })] }));
|
|
22
22
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useScrollToActiveElement } from '../useScrollToActiveElement';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
4
|
import { pageAsideNavigationClassnames } from './constants';
|
|
5
5
|
import { AddonNavigationWrapper, NavigationList, Wrapper } from './styles';
|
|
6
6
|
export const PageAsideNavigation = ({ addonNavigation, children, className, addonNavigationPosition = 'start', }) => {
|
|
7
7
|
const { containerRef } = useScrollToActiveElement();
|
|
8
|
-
return (_jsxs(Wrapper, { className:
|
|
8
|
+
return (_jsxs(Wrapper, { className: cn(pageAsideNavigationClassnames.root, className), children: [addonNavigationPosition === 'start' && addonNavigation && (_jsx(AddonNavigationWrapper, { children: addonNavigation })), _jsx(NavigationList, { ref: containerRef, children: children }), addonNavigationPosition === 'end' && addonNavigation && (_jsx(AddonNavigationWrapper, { children: addonNavigation }))] }));
|
|
9
9
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, isValidElement, useContext } from 'react';
|
|
3
3
|
import { PageContext } from '../PageContext';
|
|
4
4
|
import { PageLayoutFooter, } from '../PageLayoutFooter';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
6
|
import { cva } from '../utils/cva';
|
|
7
7
|
import { pageContentClassnames } from './constants';
|
|
8
8
|
import { Content, Wrapper } from './styles';
|
|
@@ -22,7 +22,7 @@ const contentCva = cva(pageContentClassnames.content, {
|
|
|
22
22
|
export const PageContent = forwardRef((props, forwardedRef) => {
|
|
23
23
|
const { hasAside } = useContext(PageContext);
|
|
24
24
|
const { className, children, isFullHeight = true, footer, scrollRef, header, isUnconstrained = false, } = props;
|
|
25
|
-
return (_jsxs(Wrapper, { className:
|
|
25
|
+
return (_jsxs(Wrapper, { className: cn(className, pageContentClassnames.pageContent), ref: forwardedRef, "$isFullHeight": isFullHeight, "$isSeparatorShown": hasAside || Boolean(header), children: [header && header, _jsx(Content, { ref: scrollRef, className: contentCva({
|
|
26
26
|
isUnconstrained,
|
|
27
27
|
hasHeader: Boolean(header),
|
|
28
28
|
hasAside,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { selfContainedClassname } from '../constants';
|
|
2
|
-
import { pdfViewerClassnames } from '../PdfViewer';
|
|
2
|
+
import { pdfViewerClassnames } from '../PdfViewer/constants';
|
|
3
3
|
import { styled } from '../styled';
|
|
4
4
|
import { PAGE_CONTENT_ANIMATION, pageContentClassnames } from './constants';
|
|
5
5
|
export const Wrapper = styled('article', {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Breadcrumbs } from '../../Breadcrumbs';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../../utils/cn';
|
|
4
4
|
import { pageHeaderClassnames } from '../constants';
|
|
5
5
|
import { PageActions } from '../PageActions';
|
|
6
6
|
import { Title } from '../Title';
|
|
@@ -14,5 +14,5 @@ export const HeaderContent = ({ backButton, description, subheader, breadcrumbs,
|
|
|
14
14
|
}
|
|
15
15
|
return (_jsx(BreadcrumbsWrapper, { children: Array.isArray(breadcrumbs) ? (_jsx(Breadcrumbs, { children: breadcrumbs })) : (breadcrumbs) }));
|
|
16
16
|
};
|
|
17
|
-
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:
|
|
17
|
+
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: cn(pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, size: "medium", withCollapseOnLaptop: Boolean(filters), ...actions })), filters && (_jsx(FormFiltersProvider, { filtersClassName: pageHeaderClassnames.filters, quickFiltersClassName: pageHeaderClassnames.quickFilters, children: filters })), tabs && _jsx(TabsWrapper, { children: tabs }), subheader && (_jsx(PageSubheader, { className: pageHeaderClassnames.subheader, children: subheader }))] }));
|
|
18
18
|
};
|
|
@@ -6,6 +6,10 @@ export const BreadcrumbsWrapper = styled.div `
|
|
|
6
6
|
|
|
7
7
|
margin-bottom: ${({ theme }) => theme.spacing(1)};
|
|
8
8
|
|
|
9
|
+
&:empty {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
10
14
|
display: none;
|
|
11
15
|
}
|
|
@@ -16,6 +20,10 @@ export const TabsWrapper = styled.div `
|
|
|
16
20
|
|
|
17
21
|
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
18
22
|
|
|
23
|
+
&:empty {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
20
28
|
padding: ${({ theme }) => theme.spacing(0, 0, 4, 0)};
|
|
21
29
|
|
|
@@ -30,6 +38,10 @@ export const PageSubheader = styled.div `
|
|
|
30
38
|
|
|
31
39
|
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
32
40
|
|
|
41
|
+
&:empty {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
33
45
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
34
46
|
padding: ${({ theme }) => theme.spacing(0, 4, 4, 4)};
|
|
35
47
|
}
|
|
@@ -2,13 +2,13 @@ import { useContext, useMemo } from 'react';
|
|
|
2
2
|
import { useActionsState } from '../../../ActionGroup';
|
|
3
3
|
import { NextFeatureFlagsContext } from '../../../ConfigProvider/NextFeatureFlagsContext';
|
|
4
4
|
import { DashboardContext } from '../../../DashboardContext';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../../../utils/cn';
|
|
6
6
|
import { actionsClassnames, focusModeButtonClassnames } from '../constants';
|
|
7
7
|
export const useLogic = ({ main, secondary, secondaryVisible, withCollapseOnLaptop = false, }) => {
|
|
8
8
|
const { showFocusModeButtonOnDesktop, showFocusModeButtonOnLaptop } = useContext(NextFeatureFlagsContext);
|
|
9
9
|
const { setFocusedMode, isFocusedMode } = useContext(DashboardContext);
|
|
10
10
|
const { disabledAction } = useActionsState({ main, secondary });
|
|
11
|
-
const buttonClassnames = useMemo(() =>
|
|
11
|
+
const buttonClassnames = useMemo(() => cn({
|
|
12
12
|
[focusModeButtonClassnames.isShowOnDesktop]: showFocusModeButtonOnDesktop,
|
|
13
13
|
[focusModeButtonClassnames.isShowOnLaptop]: showFocusModeButtonOnLaptop,
|
|
14
14
|
}), [showFocusModeButtonOnDesktop, showFocusModeButtonOnLaptop]);
|
|
@@ -52,7 +52,7 @@ export const useLogic = ({ main, secondary, secondaryVisible, withCollapseOnLapt
|
|
|
52
52
|
return allActions;
|
|
53
53
|
}, [main, secondary, secondaryVisible, disabledAction]);
|
|
54
54
|
const classnames = useMemo(() => {
|
|
55
|
-
return
|
|
55
|
+
return cn({
|
|
56
56
|
[actionsClassnames.withCollapseOnLaptop]: withCollapseOnLaptop && collapsedActions.length > 0,
|
|
57
57
|
});
|
|
58
58
|
}, [withCollapseOnLaptop]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../utils/cn';
|
|
3
3
|
import { cva } from '../utils/cva';
|
|
4
4
|
import { pageHeaderClassnames } from './constants';
|
|
5
5
|
import { HeaderContent } from './HeaderContent';
|
|
@@ -36,9 +36,9 @@ export const PageHeader = (props) => {
|
|
|
36
36
|
return (_jsxs(_Fragment, { children: [_jsxs(MobileTitleWrapper, { className: mobilePageHeaderCva({
|
|
37
37
|
hasTitle: Boolean(title) || isLoading,
|
|
38
38
|
hasBackButton: Boolean(backButton),
|
|
39
|
-
}), children: [_jsx(Title, { backButton: backButton, title: title, isLoading: isLoading }), mobileTitleActions && mobileTitleActions] }), _jsx(Wrapper, { className:
|
|
39
|
+
}), children: [_jsx(Title, { backButton: backButton, title: title, isLoading: isLoading }), mobileTitleActions && mobileTitleActions] }), _jsx(Wrapper, { className: cn(rootCva({
|
|
40
40
|
hasActions: Boolean(actions),
|
|
41
41
|
hasSubheader: Boolean(subheader),
|
|
42
42
|
hasFilters: Boolean(filters),
|
|
43
|
-
}), className), children: _jsx(HeaderContent, { breadcrumbs: breadcrumbs, backButton: backButton, title: title, description: description, actions: actions, subheader: subheader, tabs: tabs, filters: filters, isLoading: isLoading }) }), isShowMobileActions && (_jsx(MobilePageActions, { className:
|
|
43
|
+
}), className), children: _jsx(HeaderContent, { breadcrumbs: breadcrumbs, backButton: backButton, title: title, description: description, actions: actions, subheader: subheader, tabs: tabs, filters: filters, isLoading: isLoading }) }), isShowMobileActions && (_jsx(MobilePageActions, { className: cn(pageHeaderClassnames.pageHeaderActions), isLoading: isLoading, ...actions }))] }));
|
|
44
44
|
};
|
|
@@ -31,8 +31,20 @@ export const Wrapper = styled.header `
|
|
|
31
31
|
|
|
32
32
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
/*
|
|
35
|
+
* Два правила, а не список через запятую: невалидный :has()
|
|
36
|
+
* отбросил бы и границу под фильтрами.
|
|
37
|
+
*/
|
|
38
|
+
&.${pageHeaderClassnames.hasFilters} {
|
|
39
|
+
border-bottom: 1px solid
|
|
40
|
+
${({ theme }) => theme.palette.components.border.default};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Причина игнора: прогрессивное улучшение */
|
|
44
|
+
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
45
|
+
&:has(.${pageHeaderClassnames.subheader}:not(:empty)) {
|
|
46
|
+
border-bottom: 1px solid
|
|
47
|
+
${({ theme }) => theme.palette.components.border.default};
|
|
36
48
|
}
|
|
37
49
|
}
|
|
38
50
|
|
|
@@ -78,8 +90,8 @@ export const MobileTitleWrapper = styled.div `
|
|
|
78
90
|
/* stylelint-disable plugin/no-unsupported-browser-features */
|
|
79
91
|
&:not(:has(+ .${pageHeaderClassnames.root} :is(
|
|
80
92
|
.${pageHeaderClassnames.filters},
|
|
81
|
-
.${pageHeaderClassnames.subheader},
|
|
82
|
-
.${pageAsideClassnames.mobileNavigation}
|
|
93
|
+
.${pageHeaderClassnames.subheader}:not(:empty),
|
|
94
|
+
.${pageAsideClassnames.mobileNavigation}:not(:empty)
|
|
83
95
|
))) {
|
|
84
96
|
border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
|
|
85
97
|
}
|
|
@@ -6,13 +6,13 @@ import { PageContextProvider } from '../PageContext';
|
|
|
6
6
|
import { PageHeader } from '../PageHeader';
|
|
7
7
|
import { PageLayoutContainer, pageLayoutClassnames, } from '../PageLayoutContainer';
|
|
8
8
|
import { LoadingPlaceholder } from '../placeholders/LoadingPlaceholder';
|
|
9
|
-
import {
|
|
9
|
+
import { cn } from '../utils/cn';
|
|
10
10
|
import { DesktopAlertWrapper, LoaderWrapper, MobileAlertWrapper, } from './styles';
|
|
11
11
|
import { useLogic } from './useLogic';
|
|
12
12
|
export const PageLayout = (props) => {
|
|
13
13
|
const { header, content, aside, footer, className, alert, isLoading } = props;
|
|
14
14
|
const { hasAside, ref } = useLogic(props);
|
|
15
|
-
return (_jsxs(PageContextProvider, { hasAside: hasAside, isLoading: isLoading, children: [alert && _jsx(DesktopAlertWrapper, { children: alert }), _jsxs(PageLayoutContainer, { className:
|
|
15
|
+
return (_jsxs(PageContextProvider, { hasAside: hasAside, isLoading: isLoading, children: [alert && _jsx(DesktopAlertWrapper, { children: alert }), _jsxs(PageLayoutContainer, { className: cn(className, {
|
|
16
16
|
[pageLayoutClassnames.withoutHeader]: !header,
|
|
17
17
|
}), ref: ref, children: [alert && _jsx(MobileAlertWrapper, { children: alert }), isValidElement(header)
|
|
18
18
|
? header
|
|
@@ -2,18 +2,30 @@ import { styled } from '../styled';
|
|
|
2
2
|
export const MobileAlertWrapper = styled.div `
|
|
3
3
|
display: none;
|
|
4
4
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
5
|
-
display:
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: ${({ theme }) => theme.spacing(2)};
|
|
6
8
|
|
|
7
9
|
margin: ${({ theme }) => theme.spacing(3, 4, 0, 4)};
|
|
8
10
|
|
|
9
11
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
12
|
+
|
|
13
|
+
&:empty {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
10
16
|
}
|
|
11
17
|
`;
|
|
12
18
|
export const DesktopAlertWrapper = styled.div `
|
|
13
|
-
display:
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: ${({ theme }) => theme.spacing(2)};
|
|
14
22
|
|
|
15
23
|
margin-bottom: ${({ theme }) => theme.spacing(4)};
|
|
16
24
|
|
|
25
|
+
&:empty {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
18
30
|
display: none;
|
|
19
31
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
4
|
import { pageLayoutClassnames } from './constants';
|
|
5
5
|
import { StyledPaper, Wrapper } from './styles';
|
|
6
6
|
export const PageLayoutContainer = forwardRef(({ children, className }, forwardedRef) => {
|
|
7
|
-
return (_jsx(StyledPaper, { variant: "outlined", children: _jsx(Wrapper, { className:
|
|
7
|
+
return (_jsx(StyledPaper, { variant: "outlined", children: _jsx(Wrapper, { className: cn(className, pageLayoutClassnames.root), ref: forwardedRef, children: children }) }));
|
|
8
8
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
4
|
import { cva } from '../utils/cva';
|
|
5
5
|
import { pageLayoutSectionClassnames } from './constants';
|
|
6
6
|
import { Section, SectionWrapper } from './styles';
|
|
@@ -24,5 +24,5 @@ const sectionWrapperCva = cva(pageLayoutSectionClassnames.wrapper, {
|
|
|
24
24
|
* } />
|
|
25
25
|
*/
|
|
26
26
|
export const PageLayoutSection = forwardRef(({ children, className, isNoMobileSidePadding = false }, ref) => {
|
|
27
|
-
return (_jsx(Section, { className:
|
|
27
|
+
return (_jsx(Section, { className: cn(className, pageLayoutSectionClassnames.root), ref: ref, children: _jsx(SectionWrapper, { className: sectionWrapperCva({ isNoMobileSidePadding }), children: children }) }));
|
|
28
28
|
});
|
package/components/PageLayoutSection/PageLayoutSectionContainer/PageLayoutSectionContainer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useMemo } from 'react';
|
|
3
3
|
import { PageContext } from '../../PageContext';
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
5
|
import { pageLayoutSectionContainerClassnames } from './constants';
|
|
6
6
|
import { SectionContainer } from './styles';
|
|
7
7
|
/**
|
|
@@ -19,7 +19,7 @@ import { SectionContainer } from './styles';
|
|
|
19
19
|
export const PageLayoutSectionContainer = ({ children, className, isShowDivider = false, }) => {
|
|
20
20
|
const { hasAside } = useContext(PageContext);
|
|
21
21
|
const classes = useMemo(() => {
|
|
22
|
-
return
|
|
22
|
+
return cn(className, {
|
|
23
23
|
[pageLayoutSectionContainerClassnames.withAside]: hasAside,
|
|
24
24
|
[pageLayoutSectionContainerClassnames.withDivider]: isShowDivider,
|
|
25
25
|
});
|
|
@@ -4,7 +4,7 @@ import { MenuOnOutlineMd } from '../../icons/MenuOnOutlineMd';
|
|
|
4
4
|
import { MobileAsideButton, pageAsideClassnames } from '../PageAside';
|
|
5
5
|
import { AsideHeader, MobileAsideHeader, MobileAsideNavigation, StyledDivider, } from '../PageAside/styles';
|
|
6
6
|
import { PinButton } from '../PinButton';
|
|
7
|
-
import {
|
|
7
|
+
import { cn } from '../utils/cn';
|
|
8
8
|
import { cva } from '../utils/cva';
|
|
9
9
|
import { pinnableAsideClassnames } from './constants';
|
|
10
10
|
import { Aside, ChildrenWrapper, Content, Dummy, Footer } from './styles';
|
|
@@ -22,5 +22,5 @@ const asideCva = cva(pinnableAsideClassnames.root, {
|
|
|
22
22
|
export const PagePinnableAside = ({ header, children, className, navigation, ...restProps }) => {
|
|
23
23
|
const { isPinned, togglePin, pageHeaderContainer, isMobileNavigationVisible, } = useLogic({ navigation, ...restProps });
|
|
24
24
|
return (_jsxs(_Fragment, { children: [isMobileNavigationVisible &&
|
|
25
|
-
createPortal(_jsx(MobileAsideNavigation, { className: pageAsideClassnames.mobileNavigation, children: navigation }), pageHeaderContainer), header && _jsx(MobileAsideHeader, { children: header }), _jsx(MobileAsideButton, { content: children }), _jsxs(Aside, { "$isPinned": isPinned, className: asideCva({ withHeader: Boolean(header) }), children: [_jsx(Dummy, { "$isPinned": isPinned, children: _jsx(MenuOnOutlineMd, {}) }), _jsxs(Content, { "$isPinned": isPinned, className:
|
|
25
|
+
createPortal(_jsx(MobileAsideNavigation, { className: pageAsideClassnames.mobileNavigation, children: navigation }), pageHeaderContainer), header && _jsx(MobileAsideHeader, { children: header }), _jsx(MobileAsideButton, { content: children }), _jsxs(Aside, { "$isPinned": isPinned, className: asideCva({ withHeader: Boolean(header) }), children: [_jsx(Dummy, { "$isPinned": isPinned, children: _jsx(MenuOnOutlineMd, {}) }), _jsxs(Content, { "$isPinned": isPinned, className: cn(className, pinnableAsideClassnames.content), children: [_jsxs(ChildrenWrapper, { children: [header && (_jsxs(AsideHeader, { children: [header, _jsx(StyledDivider, {})] })), navigation, children] }), _jsx(Footer, { children: _jsx(PinButton, { isPinned: isPinned, isUseCollapse: false, onClick: togglePin }) })] })] })] }));
|
|
26
26
|
};
|
|
@@ -5,7 +5,7 @@ import { EyeOutlineMd } from '../../icons/EyeOutlineMd';
|
|
|
5
5
|
import { IconButton } from '../IconButton';
|
|
6
6
|
import { useHidePersonalData } from '../personalDataSecurity';
|
|
7
7
|
import { TextField } from '../TextField';
|
|
8
|
-
import {
|
|
8
|
+
import { cn } from '../utils/cn';
|
|
9
9
|
export const PasswordField = forwardRef(({ label, disabled = false, showSymbols = false, isHidePersonalData, inputProps, ...props }, ref) => {
|
|
10
10
|
const [showPassword, setShowPassword] = useState(showSymbols);
|
|
11
11
|
const handleClickShowPassword = () => setShowPassword((show) => !show);
|
|
@@ -18,7 +18,7 @@ export const PasswordField = forwardRef(({ label, disabled = false, showSymbols
|
|
|
18
18
|
});
|
|
19
19
|
return (_jsx(TextField, { inputProps: {
|
|
20
20
|
...inputProps,
|
|
21
|
-
className:
|
|
21
|
+
className: cn(inputProps?.className, hidePersonalDataClassname),
|
|
22
22
|
}, ref: ref, label: label, type: showPassword ? 'text' : 'password', disabled: disabled, InputProps: {
|
|
23
23
|
endAdornment: (_jsx(IconButton, { variant: "text", color: "grey", disabled: disabled, "aria-label": "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0432\u0438\u0434\u0438\u043C\u043E\u0441\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044F", onClick: handleClickShowPassword, onMouseDown: handleMouseDownPassword, children: showPassword ? (_jsx(EyeCrossedOutlineMd, { id: "visibility-off" })) : (_jsx(EyeOutlineMd, { id: "visibility-on" })) })),
|
|
24
24
|
}, ...props }));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from '../../utils/cn';
|
|
3
3
|
import { pdfViewerClassnames } from '../constants';
|
|
4
4
|
import { StyledDocument } from './styles';
|
|
5
5
|
import { useLogic } from './useLogic';
|
|
6
6
|
export const PDFDocument = (props) => {
|
|
7
7
|
const { documentRef, onAnimationEnd, isLoading } = useLogic(props);
|
|
8
8
|
const { enabledZoom, isCentered, ...restProps } = props;
|
|
9
|
-
return (_jsx(StyledDocument, { ...restProps, "$isLoading": isLoading, className:
|
|
9
|
+
return (_jsx(StyledDocument, { ...restProps, "$isLoading": isLoading, className: cn(pdfViewerClassnames.document, {
|
|
10
10
|
[pdfViewerClassnames.zoom]: enabledZoom,
|
|
11
11
|
[pdfViewerClassnames.centered]: isCentered,
|
|
12
12
|
}), inputRef: documentRef, onAnimationEnd: onAnimationEnd }));
|
|
@@ -2,11 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { PinOutlineMd } from '../../icons/PinOutlineMd';
|
|
3
3
|
import { UnpinOutlineMd } from '../../icons/UnpinOutlineMd';
|
|
4
4
|
import { Collapse } from '../Collapse';
|
|
5
|
-
import {
|
|
5
|
+
import { cn } from '../utils/cn';
|
|
6
6
|
import { pinButtonClassnames } from './constants';
|
|
7
7
|
import { Content, TogglerButton } from './styles';
|
|
8
8
|
export const PinButton = (props) => {
|
|
9
9
|
const { isPinned, collapsedIn, isUseCollapse = true, className, ...restProps } = props;
|
|
10
10
|
const PinIcon = isPinned ? UnpinOutlineMd : PinOutlineMd;
|
|
11
|
-
return (_jsx(TogglerButton, { startIcon: _jsx(PinIcon, {}), variant: "text", className:
|
|
11
|
+
return (_jsx(TogglerButton, { startIcon: _jsx(PinIcon, {}), variant: "text", className: cn(className, pinButtonClassnames.root), ...restProps, children: isUseCollapse ? (_jsx(Collapse, { in: collapsedIn, orientation: "horizontal", children: _jsx(Content, { children: isPinned ? 'Открепить меню' : 'Закрепить меню' }) })) : (_jsx(Content, { children: isPinned ? 'Открепить меню' : 'Закрепить меню' })) }));
|
|
12
12
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react';
|
|
2
2
|
import { useUpdateEffect } from '../../useUpdateEffect';
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from '../../utils/cn';
|
|
4
4
|
import { radioClassnames } from '../constants';
|
|
5
5
|
export const useLogic = ({ checked = false, disabled = false, isError = false, onChange: propsOnChange, className: propClassNames, name, style, inputRef, value, id, ...restProps }) => {
|
|
6
6
|
const [isChecked, setIsChecked] = useState(checked);
|
|
@@ -11,7 +11,7 @@ export const useLogic = ({ checked = false, disabled = false, isError = false, o
|
|
|
11
11
|
propsOnChange?.(event, event.target.checked);
|
|
12
12
|
setIsChecked(event.target.checked);
|
|
13
13
|
};
|
|
14
|
-
const className = useMemo(() =>
|
|
14
|
+
const className = useMemo(() => cn(radioClassnames.root, isChecked ? radioClassnames.checked : '', disabled ? radioClassnames.disabled : '', propClassNames), [isChecked, disabled, propClassNames]);
|
|
15
15
|
return {
|
|
16
16
|
onChange,
|
|
17
17
|
isChecked,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { RadioGroupContext } from '../RadioGroup';
|
|
4
|
-
import {
|
|
4
|
+
import { cn } from '../utils/cn';
|
|
5
5
|
import { radioCardClassnames } from './constants';
|
|
6
6
|
import { Content, StyledRadio, Wrapper } from './styles';
|
|
7
7
|
export const RadioCard = ({ id, disabled: propsIsDisabled, className, header, children, value, ...props }) => {
|
|
8
8
|
const { isError, value: groupValue, name, onChange, disabled, } = useContext(RadioGroupContext);
|
|
9
|
-
return (_jsxs(Wrapper, { className:
|
|
9
|
+
return (_jsxs(Wrapper, { className: cn(className, radioCardClassnames.root), "$isError": isError, "$isChecked": groupValue === value, "$isDisabled": disabled || propsIsDisabled, children: [_jsx(StyledRadio, { disabled: disabled || propsIsDisabled, checked: groupValue === value, name: name, onChange: (event) => onChange?.(event, event.target.value), value: value, ...props }), _jsxs(Content, { className: radioCardClassnames.content, children: [_jsx("div", { children: header }), _jsx("div", { children: children })] })] }));
|
|
10
10
|
};
|