@astral/ui 4.23.0 → 4.24.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/BottomDrawer/BottomDrawer.js +2 -2
- package/components/BottomDrawer/constants.d.ts +3 -0
- package/components/BottomDrawer/constants.js +4 -0
- package/components/BottomDrawer/index.d.ts +1 -0
- package/components/BottomDrawer/index.js +1 -0
- package/components/BottomDrawer/public.d.ts +1 -0
- package/components/BottomDrawer/public.js +1 -0
- package/components/DashboardContext/DashboardContext.d.ts +2 -1
- package/components/DashboardContext/DashboardContext.js +2 -1
- package/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.js +9 -2
- package/components/DashboardLayout/Header/Header.js +3 -9
- package/components/DashboardLayout/Header/useLogic/useLogic.d.ts +6 -1
- package/components/DashboardLayout/Header/useLogic/useLogic.js +18 -2
- package/components/DashboardSidebar/DashboardSidebar.js +2 -4
- package/components/DashboardSidebar/constants.d.ts +1 -0
- package/components/DashboardSidebar/constants.js +1 -0
- package/components/DashboardSidebar/styles.js +6 -0
- package/components/DashboardSidebar/useLogic/useLogic.d.ts +2 -1
- package/components/DashboardSidebar/useLogic/useLogic.js +10 -3
- package/components/MenuOrganization/MenuOrganization.js +5 -6
- package/components/MenuOrganization/NoData/styles.js +4 -0
- package/components/MenuOrganization/OrganizationButton/constants.d.ts +1 -0
- package/components/MenuOrganization/OrganizationButton/constants.js +1 -0
- package/components/MenuOrganization/OrganizationButton/index.d.ts +1 -0
- package/components/MenuOrganization/OrganizationButton/index.js +1 -0
- package/components/MenuOrganization/OrganizationButton/styles.js +22 -0
- package/components/MenuOrganization/OrganizationItem/styles.d.ts +1 -1
- package/components/MenuOrganization/OrganizationItem/styles.js +9 -0
- package/components/MenuOrganization/OrganizationListSkeleton/styles.js +12 -0
- package/components/MenuOrganization/constants.d.ts +2 -0
- package/components/MenuOrganization/constants.js +2 -0
- package/components/MenuOrganization/styles.d.ts +11 -0
- package/components/MenuOrganization/styles.js +82 -0
- package/components/MenuOrganization/useLogic/useLogic.d.ts +14 -4
- package/components/MenuOrganization/useLogic/useLogic.js +21 -2
- package/components/PageHeader/Title/Title.js +1 -1
- package/components/Popover/Popover.d.ts +1 -1
- package/components/Popover/Popover.js +3 -3
- package/components/placeholders/Placeholder/Placeholder.js +2 -2
- package/components/placeholders/Placeholder/constants.d.ts +4 -0
- package/components/placeholders/Placeholder/constants.js +5 -0
- package/components/placeholders/Placeholder/index.d.ts +1 -0
- package/components/placeholders/Placeholder/index.js +1 -0
- package/components/placeholders/Placeholder/public.d.ts +1 -0
- package/components/placeholders/Placeholder/public.js +1 -0
- package/node/components/BottomDrawer/BottomDrawer.js +1 -1
- package/node/components/BottomDrawer/constants.d.ts +3 -0
- package/node/components/BottomDrawer/constants.js +5 -1
- package/node/components/BottomDrawer/index.d.ts +1 -0
- package/node/components/BottomDrawer/index.js +3 -0
- package/node/components/BottomDrawer/public.d.ts +1 -0
- package/node/components/BottomDrawer/public.js +3 -0
- package/node/components/DashboardContext/DashboardContext.d.ts +2 -1
- package/node/components/DashboardContext/DashboardContext.js +1 -0
- package/node/components/DashboardContext/DashboardContextProvider/DashboardContextProvider.js +8 -1
- package/node/components/DashboardLayout/Header/Header.js +2 -8
- package/node/components/DashboardLayout/Header/useLogic/useLogic.d.ts +6 -1
- package/node/components/DashboardLayout/Header/useLogic/useLogic.js +18 -2
- package/node/components/DashboardSidebar/DashboardSidebar.js +2 -4
- package/node/components/DashboardSidebar/constants.d.ts +1 -0
- package/node/components/DashboardSidebar/constants.js +1 -0
- package/node/components/DashboardSidebar/styles.js +6 -0
- package/node/components/DashboardSidebar/useLogic/useLogic.d.ts +2 -1
- package/node/components/DashboardSidebar/useLogic/useLogic.js +9 -2
- package/node/components/MenuOrganization/MenuOrganization.js +3 -4
- package/node/components/MenuOrganization/NoData/styles.js +4 -0
- package/node/components/MenuOrganization/OrganizationButton/constants.d.ts +1 -0
- package/node/components/MenuOrganization/OrganizationButton/constants.js +4 -0
- package/node/components/MenuOrganization/OrganizationButton/index.d.ts +1 -0
- package/node/components/MenuOrganization/OrganizationButton/index.js +3 -0
- package/node/components/MenuOrganization/OrganizationButton/styles.js +22 -0
- package/node/components/MenuOrganization/OrganizationItem/styles.d.ts +1 -1
- package/node/components/MenuOrganization/OrganizationItem/styles.js +11 -2
- package/node/components/MenuOrganization/OrganizationListSkeleton/styles.js +12 -0
- package/node/components/MenuOrganization/constants.d.ts +2 -0
- package/node/components/MenuOrganization/constants.js +3 -1
- package/node/components/MenuOrganization/styles.d.ts +11 -0
- package/node/components/MenuOrganization/styles.js +87 -5
- package/node/components/MenuOrganization/useLogic/useLogic.d.ts +14 -4
- package/node/components/MenuOrganization/useLogic/useLogic.js +21 -2
- package/node/components/PageHeader/Title/Title.js +1 -1
- package/node/components/Popover/Popover.d.ts +1 -1
- package/node/components/Popover/Popover.js +3 -3
- package/node/components/placeholders/Placeholder/Placeholder.js +1 -1
- package/node/components/placeholders/Placeholder/constants.d.ts +4 -0
- package/node/components/placeholders/Placeholder/constants.js +6 -1
- package/node/components/placeholders/Placeholder/index.d.ts +1 -0
- package/node/components/placeholders/Placeholder/index.js +3 -0
- package/node/components/placeholders/Placeholder/public.d.ts +1 -0
- package/node/components/placeholders/Placeholder/public.js +3 -0
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.menuOrganizationClassnames = exports.PLACEHOLDER_HEIGHT = exports.DEFAULT_LINK_BUTTON_NAME = void 0;
|
|
3
|
+
exports.menuOrganizationClassnames = exports.PLACEHOLDER_HEIGHT = exports.POPOVER_TITLE = exports.DEFAULT_LINK_BUTTON_NAME = void 0;
|
|
4
4
|
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
5
5
|
exports.DEFAULT_LINK_BUTTON_NAME = 'Перейти к данным организации';
|
|
6
|
+
exports.POPOVER_TITLE = 'Выбор организации';
|
|
6
7
|
exports.PLACEHOLDER_HEIGHT = '108px';
|
|
7
8
|
exports.menuOrganizationClassnames = {
|
|
8
9
|
root: (0, createUIKitClassname_1.createUIKitClassname)('menu-organization'),
|
|
9
10
|
errorPlaceholder: (0, createUIKitClassname_1.createUIKitClassname)('menu-organization__error-placeholder'),
|
|
11
|
+
mobileVisible: (0, createUIKitClassname_1.createUIKitClassname)('menu-organization_visible'),
|
|
10
12
|
};
|
|
@@ -25,3 +25,14 @@ export declare const StyledTypography: import("@emotion/styled/dist/declarations
|
|
|
25
25
|
} & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
|
|
26
26
|
theme?: import("@emotion/react").Theme | undefined;
|
|
27
27
|
}, {}, {}>;
|
|
28
|
+
export declare const ButtonWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
29
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
30
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
31
|
+
} & {
|
|
32
|
+
$alertHeight?: number | undefined;
|
|
33
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
34
|
+
export declare const StyledPopover: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("..").WithoutEmotionSpecific<import("@mui/material").PopoverProps> & {
|
|
35
|
+
title?: string | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
38
|
+
}, {}, {}>;
|
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StyledTypography = exports.OrganizationData = exports.OrganizationsWrapper = exports.SearchWrapper = exports.ActionWrapper = void 0;
|
|
3
|
+
exports.StyledPopover = exports.ButtonWrapper = exports.StyledTypography = exports.OrganizationData = exports.OrganizationsWrapper = exports.SearchWrapper = exports.ActionWrapper = void 0;
|
|
4
|
+
const BottomDrawer_1 = require("../BottomDrawer");
|
|
5
|
+
const constants_1 = require("../BottomDrawer/constants");
|
|
6
|
+
const constants_2 = require("../DashboardLayout/constants");
|
|
4
7
|
const Grid_1 = require("../Grid");
|
|
8
|
+
const Popover_1 = require("../Popover");
|
|
9
|
+
const LoadingPlaceholder_1 = require("../placeholders/LoadingPlaceholder");
|
|
10
|
+
const Placeholder_1 = require("../placeholders/Placeholder");
|
|
5
11
|
const styled_1 = require("../styled");
|
|
6
12
|
const Typography_1 = require("../Typography");
|
|
7
|
-
const
|
|
13
|
+
const constants_3 = require("./constants");
|
|
8
14
|
exports.ActionWrapper = styled_1.styled.div `
|
|
9
15
|
padding: ${({ theme }) => theme.spacing(2)};
|
|
10
16
|
|
|
11
17
|
border-top: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
18
|
+
|
|
19
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
20
|
+
padding: ${({ theme }) => theme.spacing(4)};
|
|
21
|
+
}
|
|
12
22
|
`;
|
|
13
23
|
exports.SearchWrapper = styled_1.styled.div `
|
|
14
24
|
max-width: 300px;
|
|
15
25
|
padding: ${({ theme }) => theme.spacing(2, 3)};
|
|
16
26
|
|
|
17
27
|
border-bottom: ${({ theme }) => `1px solid ${theme.palette.grey['300']}`};
|
|
28
|
+
|
|
29
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
30
|
+
max-width: unset;
|
|
31
|
+
padding: ${({ theme }) => theme.spacing(3, 4)};
|
|
32
|
+
}
|
|
18
33
|
`;
|
|
19
34
|
exports.OrganizationsWrapper = styled_1.styled.div `
|
|
20
35
|
overflow-y: auto;
|
|
@@ -24,17 +39,39 @@ exports.OrganizationsWrapper = styled_1.styled.div `
|
|
|
24
39
|
|
|
25
40
|
box-sizing: ${({ $isLoading }) => ($isLoading ? 'content-box' : 'inherit')};
|
|
26
41
|
width: 300px;
|
|
27
|
-
min-height: ${({ $isLoading }) => ($isLoading ?
|
|
42
|
+
min-height: ${({ $isLoading }) => ($isLoading ? constants_3.PLACEHOLDER_HEIGHT : '64px')};
|
|
28
43
|
max-height: 328px;
|
|
29
44
|
|
|
30
|
-
& .${
|
|
45
|
+
& .${constants_3.menuOrganizationClassnames.errorPlaceholder} {
|
|
46
|
+
display: flex;
|
|
31
47
|
gap: ${({ theme }) => theme.spacing(1)};
|
|
32
48
|
|
|
33
|
-
height: ${
|
|
49
|
+
height: ${constants_3.PLACEHOLDER_HEIGHT};
|
|
34
50
|
}
|
|
35
51
|
|
|
36
52
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
37
53
|
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
max-height: unset;
|
|
56
|
+
|
|
57
|
+
& .${LoadingPlaceholder_1.loadingPlaceholderClassnames.root} {
|
|
58
|
+
justify-content: unset;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
& .${constants_3.menuOrganizationClassnames.errorPlaceholder} {
|
|
62
|
+
gap: ${({ theme }) => theme.spacing(6)};
|
|
63
|
+
justify-content: center;
|
|
64
|
+
|
|
65
|
+
height: 100%;
|
|
66
|
+
|
|
67
|
+
& .${Placeholder_1.placeholderClassnames.title} {
|
|
68
|
+
margin-bottom: unset;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
& .${Placeholder_1.placeholderClassnames.footer} {
|
|
72
|
+
margin-top: unset;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
38
75
|
}
|
|
39
76
|
`;
|
|
40
77
|
exports.OrganizationData = (0, styled_1.styled)(Grid_1.Grid) `
|
|
@@ -46,3 +83,48 @@ exports.OrganizationData = (0, styled_1.styled)(Grid_1.Grid) `
|
|
|
46
83
|
exports.StyledTypography = (0, styled_1.styled)(Typography_1.Typography) `
|
|
47
84
|
color: ${({ theme }) => theme.palette.grey[600]};
|
|
48
85
|
`;
|
|
86
|
+
exports.ButtonWrapper = styled_1.styled.div `
|
|
87
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
88
|
+
position: absolute;
|
|
89
|
+
z-index: ${({ theme }) => theme.zIndex.appBar - 1};
|
|
90
|
+
top: ${({ $alertHeight }) => `calc(${$alertHeight}px + ${constants_2.HEADER_HEIGHT_MOBILE}) `};
|
|
91
|
+
left: 0;
|
|
92
|
+
|
|
93
|
+
/* Необходимо для анимации компонента вместе с sidebar */
|
|
94
|
+
transform: translateX(-100vw);
|
|
95
|
+
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
|
|
99
|
+
width: 100vw;
|
|
100
|
+
|
|
101
|
+
background-color: ${({ theme }) => theme.palette.background.default};
|
|
102
|
+
|
|
103
|
+
transition: ${({ theme }) => {
|
|
104
|
+
return theme.transitions.create(['transform'], {
|
|
105
|
+
duration: theme.transitions.duration.standard,
|
|
106
|
+
});
|
|
107
|
+
}};
|
|
108
|
+
|
|
109
|
+
&.${constants_3.menuOrganizationClassnames.mobileVisible} {
|
|
110
|
+
transform: translateX(0);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
exports.StyledPopover = (0, styled_1.styled)(Popover_1.Popover) `
|
|
115
|
+
|
|
116
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
117
|
+
& .${BottomDrawer_1.bottomDrawerClassnames.content} {
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
|
|
121
|
+
height: calc(100vh - ${constants_1.OFFSET_TOP_SCREEN});
|
|
122
|
+
|
|
123
|
+
@supports (height: 100dvh) {
|
|
124
|
+
height: calc(100dvh - ${constants_1.OFFSET_TOP_SCREEN});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
`;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { type ChangeEvent, type SyntheticEvent } from 'react';
|
|
1
|
+
import { type ChangeEvent, type MouseEvent, type SyntheticEvent } from 'react';
|
|
2
2
|
import { type MenuOrganizationProps, type Organization } from '../types';
|
|
3
3
|
type UseLogicParams<TData extends Organization & Record<string, unknown>> = MenuOrganizationProps<TData>;
|
|
4
4
|
export declare const useLogic: <TData extends Organization & Record<string, unknown>>({ organizations, onChangeSearch, onChange, currentOrganizationGroupLabel, currentOrganization, groupBy, onClose, onOpen, isOpen: isOpenPopover, isDisabled, disabledReason, isHidePersonalData, action, isLoading, isError, onRetry, renderItem, renderPreview, }: UseLogicParams<TData>) => {
|
|
5
|
-
|
|
6
|
-
text
|
|
7
|
-
|
|
5
|
+
actionButtonProps: {
|
|
6
|
+
text?: string | undefined;
|
|
7
|
+
component?: import("react").ElementType | undefined;
|
|
8
|
+
href?: string | undefined;
|
|
9
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
10
|
+
endIcon?: import("react").ReactNode;
|
|
11
|
+
startIcon?: import("react").ReactNode;
|
|
12
|
+
onClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
};
|
|
14
|
+
hasAction: boolean;
|
|
8
15
|
isLoading: boolean | undefined;
|
|
9
16
|
isError: boolean | undefined;
|
|
10
17
|
onRetry: () => void;
|
|
@@ -53,5 +60,8 @@ export declare const useLogic: <TData extends Organization & Record<string, unkn
|
|
|
53
60
|
hasSearch: boolean;
|
|
54
61
|
};
|
|
55
62
|
isShowSearchField: boolean;
|
|
63
|
+
isMobile: boolean;
|
|
64
|
+
classnames: string;
|
|
65
|
+
alertHeight: number;
|
|
56
66
|
};
|
|
57
67
|
export {};
|
|
@@ -3,12 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const DashboardContext_1 = require("../../DashboardContext");
|
|
6
|
+
const DashboardSidebarProvider_1 = require("../../DashboardSidebarProvider");
|
|
6
7
|
const personalDataSecurity_1 = require("../../personalDataSecurity");
|
|
7
8
|
const usePopover_1 = require("../../usePopover");
|
|
9
|
+
const useViewportType_1 = require("../../useViewportType");
|
|
10
|
+
const classNames_1 = require("../../utils/classNames");
|
|
11
|
+
const constants_1 = require("../constants");
|
|
8
12
|
const useLogic = ({ organizations = [], onChangeSearch, onChange, currentOrganizationGroupLabel, currentOrganization, groupBy, onClose, onOpen, isOpen: isOpenPopover, isDisabled, disabledReason, isHidePersonalData, action, isLoading, isError, onRetry, renderItem, renderPreview, }) => {
|
|
9
|
-
const { isLoading: isDashboardLoading } = (0, react_1.useContext)(DashboardContext_1.DashboardContext);
|
|
13
|
+
const { isLoading: isDashboardLoading, alertHeight } = (0, react_1.useContext)(DashboardContext_1.DashboardContext);
|
|
10
14
|
const [searchValue, setSearchValue] = (0, react_1.useState)('');
|
|
11
15
|
const [anchorButtonEl, setAnchorButtonEl] = (0, react_1.useState)(null);
|
|
16
|
+
const { isPinned } = (0, react_1.useContext)(DashboardSidebarProvider_1.DashboardSidebarContext);
|
|
17
|
+
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
18
|
+
const { onClick, ...restActionProps } = action || {};
|
|
12
19
|
const buttonRef = (0, react_1.useCallback)((node) => {
|
|
13
20
|
if (node) {
|
|
14
21
|
setAnchorButtonEl(node);
|
|
@@ -40,6 +47,10 @@ const useLogic = ({ organizations = [], onChangeSearch, onChange, currentOrganiz
|
|
|
40
47
|
onChange(organization);
|
|
41
48
|
handleClosePopover();
|
|
42
49
|
};
|
|
50
|
+
const handleActionClick = (event) => {
|
|
51
|
+
onClick?.(event);
|
|
52
|
+
handleClosePopover();
|
|
53
|
+
};
|
|
43
54
|
const isShowCurrentOrganization = (0, react_1.useMemo)(() => {
|
|
44
55
|
return (!searchValue.length || filteredOrganization.includes(currentOrganization));
|
|
45
56
|
}, [currentOrganization, filteredOrganization, searchValue.length]);
|
|
@@ -56,8 +67,13 @@ const useLogic = ({ organizations = [], onChangeSearch, onChange, currentOrganiz
|
|
|
56
67
|
const renderPreviewWrapper = (0, react_1.useMemo)(() => renderPreview
|
|
57
68
|
? (organization, params) => renderPreview(organization, params)
|
|
58
69
|
: undefined, [renderPreview]);
|
|
70
|
+
const classnames = (0, react_1.useMemo)(() => (0, classNames_1.classNames)({ [constants_1.menuOrganizationClassnames.mobileVisible]: isPinned }), [isPinned]);
|
|
59
71
|
return {
|
|
60
|
-
|
|
72
|
+
actionButtonProps: {
|
|
73
|
+
onClick: handleActionClick,
|
|
74
|
+
...restActionProps,
|
|
75
|
+
},
|
|
76
|
+
hasAction: Boolean(action),
|
|
61
77
|
isLoading,
|
|
62
78
|
isError,
|
|
63
79
|
onRetry,
|
|
@@ -95,6 +111,9 @@ const useLogic = ({ organizations = [], onChangeSearch, onChange, currentOrganiz
|
|
|
95
111
|
hasSearch: isShowSearchField,
|
|
96
112
|
},
|
|
97
113
|
isShowSearchField,
|
|
114
|
+
isMobile,
|
|
115
|
+
classnames,
|
|
116
|
+
alertHeight,
|
|
98
117
|
};
|
|
99
118
|
};
|
|
100
119
|
exports.useLogic = useLogic;
|
|
@@ -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: "medium", children: (0, jsx_runtime_1.jsx)(ArrowLOutlineMd_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 }))] }));
|
|
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)(ArrowLOutlineMd_1.ArrowLOutlineMd, {}) })), typeof title === 'string' ? ((0, jsx_runtime_1.jsx)(styles_1.TitleWrapper, { component: "h1", variant: "h3", "$hasDescription": hasDescription || isLoading, "$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;
|
|
@@ -6,4 +6,4 @@ export type PopoverProps = WithoutEmotionSpecific<MuiPopoverProps> & {
|
|
|
6
6
|
*/
|
|
7
7
|
title?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const Popover: ({ children, onClose, open, title, ...restProps }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const Popover: ({ children, onClose, open, title, className, ...restProps }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,11 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const BottomDrawer_1 = require("../BottomDrawer");
|
|
6
6
|
const useViewportType_1 = require("../useViewportType");
|
|
7
7
|
const styles_1 = require("./styles");
|
|
8
|
-
const Popover = ({ children, onClose, open, title, ...restProps }) => {
|
|
8
|
+
const Popover = ({ children, onClose, open, title, className, ...restProps }) => {
|
|
9
9
|
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
10
10
|
if (isMobile) {
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(BottomDrawer_1.BottomDrawer, { title: title, onClose: onClose, open: open, children: children }));
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(BottomDrawer_1.BottomDrawer, { title: title, onClose: onClose, open: open, className: className, children: children }));
|
|
12
12
|
}
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.StyledMuiPopover, { open: open, onClose: onClose, ...restProps, children: children }));
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledMuiPopover, { open: open, onClose: onClose, className: className, ...restProps, children: children }));
|
|
14
14
|
};
|
|
15
15
|
exports.Popover = Popover;
|
|
@@ -13,6 +13,6 @@ const Placeholder = ({ className, title, imgSrc, imgAlt, description, Actions, s
|
|
|
13
13
|
const RenderImage = (0, react_1.useMemo)(() => (renderImage && (0, Image_1.setDefaultImageStyles)(renderImage)) ||
|
|
14
14
|
(configRenderImage && (0, Image_1.setDefaultImageStyles)(configRenderImage)) ||
|
|
15
15
|
Image_1.Image, [renderImage, configRenderImage]);
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$size": size, className: className, children: [(0, jsx_runtime_1.jsxs)(styles_1.InnerContainer, { "$size": size, children: [imgSrc && ((0, jsx_runtime_1.jsx)(RenderImage, { src: imgSrc, alt: imgAlt, width: constants_1.IMAGE_WIDTH[size], height: constants_1.IMAGE_HEIGHT[size], size: size })), (0, jsx_runtime_1.jsx)(styles_1.Title, { "$size": size, variant: constants_1.TITLE_HEADER_LEVEL[size], children: title }), description && ((0, jsx_runtime_1.jsx)(styles_1.Description, { "$size": size, component: "div", variant: constants_1.DESCRIPTION_LEVEL[size], children: description }))] }), Actions && (0, jsx_runtime_1.jsx)(styles_1.Footer, { children: Actions })] }));
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$size": size, className: className, children: [(0, jsx_runtime_1.jsxs)(styles_1.InnerContainer, { "$size": size, children: [imgSrc && ((0, jsx_runtime_1.jsx)(RenderImage, { src: imgSrc, alt: imgAlt, width: constants_1.IMAGE_WIDTH[size], height: constants_1.IMAGE_HEIGHT[size], size: size })), (0, jsx_runtime_1.jsx)(styles_1.Title, { className: constants_1.placeholderClassnames.title, "$size": size, variant: constants_1.TITLE_HEADER_LEVEL[size], children: title }), description && ((0, jsx_runtime_1.jsx)(styles_1.Description, { "$size": size, component: "div", variant: constants_1.DESCRIPTION_LEVEL[size], children: description }))] }), Actions && ((0, jsx_runtime_1.jsx)(styles_1.Footer, { className: constants_1.placeholderClassnames.footer, children: Actions }))] }));
|
|
17
17
|
};
|
|
18
18
|
exports.Placeholder = Placeholder;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DESCRIPTION_LEVEL = exports.TITLE_HEADER_LEVEL = exports.MAX_INNER_WIDTH = exports.IMAGE_HEIGHT = exports.IMAGE_WIDTH = exports.SIZE = void 0;
|
|
3
|
+
exports.placeholderClassnames = exports.DESCRIPTION_LEVEL = exports.TITLE_HEADER_LEVEL = exports.MAX_INNER_WIDTH = exports.IMAGE_HEIGHT = exports.IMAGE_WIDTH = exports.SIZE = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
|
|
4
5
|
exports.SIZE = {
|
|
5
6
|
Small: 'small',
|
|
6
7
|
Medium: 'medium',
|
|
@@ -31,3 +32,7 @@ exports.DESCRIPTION_LEVEL = {
|
|
|
31
32
|
[exports.SIZE.Medium]: 'body1',
|
|
32
33
|
[exports.SIZE.Large]: 'subtitle1',
|
|
33
34
|
};
|
|
35
|
+
exports.placeholderClassnames = {
|
|
36
|
+
footer: (0, createUIKitClassname_1.createUIKitClassname)('placeholder__footer'),
|
|
37
|
+
title: (0, createUIKitClassname_1.createUIKitClassname)('placeholder__title'),
|
|
38
|
+
};
|
|
@@ -14,6 +14,9 @@ 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.placeholderClassnames = void 0;
|
|
17
18
|
__exportStar(require("./Image"), exports);
|
|
18
19
|
__exportStar(require("./Placeholder"), exports);
|
|
19
20
|
__exportStar(require("./types"), exports);
|
|
21
|
+
var constants_1 = require("./constants");
|
|
22
|
+
Object.defineProperty(exports, "placeholderClassnames", { enumerable: true, get: function () { return constants_1.placeholderClassnames; } });
|
|
@@ -14,5 +14,8 @@ 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.placeholderClassnames = void 0;
|
|
18
|
+
var constants_1 = require("./constants");
|
|
19
|
+
Object.defineProperty(exports, "placeholderClassnames", { enumerable: true, get: function () { return constants_1.placeholderClassnames; } });
|
|
17
20
|
__exportStar(require("./Placeholder"), exports);
|
|
18
21
|
__exportStar(require("./types"), exports);
|