@astral/ui 4.47.0 → 4.47.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/ComplianceStatus/ComplianceStatus.js +1 -1
- package/components/DashboardSidebar/constants.d.ts +6 -0
- package/components/DashboardSidebar/constants.js +6 -0
- package/components/DashboardSidebar/styles.js +22 -3
- package/components/NavMenu/Item/ItemButton/ItemButton.js +17 -1
- package/components/NavMenu/Item/ItemButton/constants.d.ts +6 -0
- package/components/NavMenu/Item/ItemButton/constants.js +7 -0
- package/components/NavMenu/Item/ItemButton/index.d.ts +1 -0
- package/components/NavMenu/Item/ItemButton/index.js +1 -0
- package/components/NavMenu/Item/ItemButton/styles.d.ts +0 -5
- package/components/NavMenu/Item/ItemButton/styles.js +15 -16
- package/components/NavMenu/Item/index.d.ts +1 -0
- package/components/NavMenu/Item/index.js +1 -0
- package/components/utils/cva/cva.d.ts +1 -0
- package/components/utils/cva/cva.js +1 -0
- package/components/utils/cva/index.d.ts +1 -0
- package/components/utils/cva/index.js +1 -0
- package/components/utils/cva/public.d.ts +1 -0
- package/components/utils/cva/public.js +1 -0
- package/node/components/ComplianceStatus/ComplianceStatus.js +2 -2
- package/node/components/DashboardSidebar/constants.d.ts +6 -0
- package/node/components/DashboardSidebar/constants.js +7 -1
- package/node/components/DashboardSidebar/styles.js +21 -2
- package/node/components/NavMenu/Item/ItemButton/ItemButton.js +17 -1
- package/node/components/NavMenu/Item/ItemButton/constants.d.ts +6 -0
- package/node/components/NavMenu/Item/ItemButton/constants.js +10 -0
- package/node/components/NavMenu/Item/ItemButton/index.d.ts +1 -0
- package/node/components/NavMenu/Item/ItemButton/index.js +1 -0
- package/node/components/NavMenu/Item/ItemButton/styles.d.ts +0 -5
- package/node/components/NavMenu/Item/ItemButton/styles.js +16 -17
- package/node/components/NavMenu/Item/index.d.ts +1 -0
- package/node/components/NavMenu/Item/index.js +3 -0
- package/node/components/utils/cva/cva.d.ts +1 -0
- package/node/components/utils/cva/cva.js +5 -0
- package/node/components/utils/cva/index.d.ts +1 -0
- package/node/components/utils/cva/index.js +17 -0
- package/node/components/utils/cva/public.d.ts +1 -0
- package/node/components/utils/cva/public.js +17 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
2
|
import { OverflowTypography } from '../OverflowTypography';
|
|
4
3
|
import { Typography } from '../Typography';
|
|
4
|
+
import { cva } from '../utils/cva';
|
|
5
5
|
import { complianceStatusClassnames, complianceStatusColorClassnames, complianceStatusVariantClassnames, } from './constants';
|
|
6
6
|
import { EmptyIcon, Inner, Item, RejectIcon, StyledLoader, SuccessIcon, Wrapper, } from './styles';
|
|
7
7
|
const ICON_BY_STATUS = {
|
|
@@ -3,3 +3,9 @@ export const dashboardSidebarClassnames = {
|
|
|
3
3
|
root: createUIKitClassname('dashboard-layout-sidebar'),
|
|
4
4
|
hasMenuOrganization: createUIKitClassname('dashboard-layout-sidebar_has-menu-organization'),
|
|
5
5
|
};
|
|
6
|
+
export const LABEL_WIDTH = {
|
|
7
|
+
default: '170px',
|
|
8
|
+
counter: '130px',
|
|
9
|
+
group: '140px',
|
|
10
|
+
groupCounter: '100px',
|
|
11
|
+
};
|
|
@@ -2,10 +2,11 @@ import { FOOTER_DESKTOP_HEIGHT, FOOTER_LAPTOP_HEIGHT } from '../constants';
|
|
|
2
2
|
import { HEADER_HEIGHT_MOBILE } from '../DashboardLayout/constants';
|
|
3
3
|
import { menuOrganizationClassnames } from '../MenuOrganization/constants';
|
|
4
4
|
import { MOBILE_BUTTON_HEIGHT } from '../MenuOrganization/OrganizationButton';
|
|
5
|
+
import { navMenuItemButtonClassnames } from '../NavMenu/Item';
|
|
5
6
|
import { Paper } from '../Paper';
|
|
6
7
|
import { pinButtonClassnames } from '../PinButton';
|
|
7
8
|
import { styled } from '../styled';
|
|
8
|
-
import { dashboardSidebarClassnames } from './constants';
|
|
9
|
+
import { dashboardSidebarClassnames, LABEL_WIDTH } from './constants';
|
|
9
10
|
export const Wrapper = styled('div', {
|
|
10
11
|
shouldForwardProp: (prop) => !['$isPinned', '$alertHeight'].includes(prop),
|
|
11
12
|
}) `
|
|
@@ -59,7 +60,7 @@ export const SidebarRoot = styled('aside', {
|
|
|
59
60
|
width: ${({ $collapsedIn, $isPinned }) => $isPinned || (!$isPinned && $collapsedIn) ? '242px' : '58px'};
|
|
60
61
|
height: 100%;
|
|
61
62
|
|
|
62
|
-
background-color: ${({ theme }) => theme.palette.background.default}
|
|
63
|
+
background-color: ${({ theme }) => theme.palette.background.default};
|
|
63
64
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
64
65
|
box-shadow: ${({ theme, $isPinned, $collapsedIn }) => ($isPinned || !$collapsedIn ? 'unset' : theme.elevation[300])};
|
|
65
66
|
|
|
@@ -115,6 +116,24 @@ export const SidebarContent = styled.div `
|
|
|
115
116
|
});
|
|
116
117
|
}};
|
|
117
118
|
|
|
119
|
+
& .${navMenuItemButtonClassnames.label} {
|
|
120
|
+
width: ${LABEL_WIDTH.default};
|
|
121
|
+
|
|
122
|
+
&.${navMenuItemButtonClassnames.labelHasCounter} {
|
|
123
|
+
width: ${LABEL_WIDTH.counter};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
& .${navMenuItemButtonClassnames.hasGroup} {
|
|
128
|
+
& .${navMenuItemButtonClassnames.label} {
|
|
129
|
+
width: ${LABEL_WIDTH.group};
|
|
130
|
+
|
|
131
|
+
&.${navMenuItemButtonClassnames.labelHasCounter} {
|
|
132
|
+
width: ${LABEL_WIDTH.groupCounter};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
118
137
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
119
138
|
width: inherit;
|
|
120
139
|
padding: ${({ theme, $hasHeader }) => theme.spacing($hasHeader ? 0 : 2, 0, 0, 0)};
|
|
@@ -134,7 +153,7 @@ export const Footer = styled.footer `
|
|
|
134
153
|
border-bottom-left-radius: ${({ theme }) => theme.shape.medium};
|
|
135
154
|
|
|
136
155
|
.${pinButtonClassnames.root} {
|
|
137
|
-
padding-left: ${({ theme }) => theme.microSpacing(9)}
|
|
156
|
+
padding-left: ${({ theme }) => theme.microSpacing(9)};
|
|
138
157
|
}
|
|
139
158
|
|
|
140
159
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
@@ -2,11 +2,27 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { forwardRef, } from 'react';
|
|
3
3
|
import { Collapse } from '../../../Collapse';
|
|
4
4
|
import { useViewportType } from '../../../useViewportType';
|
|
5
|
+
import { cva } from '../../../utils/cva';
|
|
6
|
+
import { navMenuItemButtonClassnames } from './constants';
|
|
5
7
|
import { EndAdornmentWrapper, NavMenuItemButtonChevron, NavMenuItemButtonIcon, NavMenuItemButtonText, StyledListItemButton, StyledPageDotOutlineMd, } from './styles';
|
|
8
|
+
const itemButton = cva(navMenuItemButtonClassnames.root, {
|
|
9
|
+
variants: {
|
|
10
|
+
hasGroup: {
|
|
11
|
+
true: navMenuItemButtonClassnames.hasGroup,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
const itemButtonLabel = cva(navMenuItemButtonClassnames.label, {
|
|
16
|
+
variants: {
|
|
17
|
+
hasCounter: {
|
|
18
|
+
true: navMenuItemButtonClassnames.labelHasCounter,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
6
22
|
export const ItemButton = forwardRef((props, ref) => {
|
|
7
23
|
const { collapsedIn, opened, text, icon, component = 'a', counter, isNested = false, isGroupTitleItem = false, selected, ...restProps } = props;
|
|
8
24
|
const { isMobile } = useViewportType();
|
|
9
25
|
const Counter = counter?.component;
|
|
10
26
|
const { max, count } = counter || {};
|
|
11
|
-
return (_jsxs(StyledListItemButton, {
|
|
27
|
+
return (_jsxs(StyledListItemButton, { className: itemButton({ hasGroup: isGroupTitleItem }), ref: ref, component: component, withoutContainer: true, selected: selected, "aria-selected": selected, ...restProps, children: [isMobile ? (_jsxs(_Fragment, { children: [isNested && _jsx(StyledPageDotOutlineMd, {}), _jsx(NavMenuItemButtonText, { children: text, rowsCount: 2 })] })) : (_jsxs(_Fragment, { children: [_jsx(NavMenuItemButtonIcon, { children: Counter && Number(count) ? (_jsx(Counter.Badge, { invisible: collapsedIn, children: icon })) : (icon) }), _jsx(Collapse, { orientation: "horizontal", in: collapsedIn, children: _jsx(NavMenuItemButtonText, { tooltipProps: { placement: 'right' }, className: itemButtonLabel({ hasCounter: Boolean(counter) }), children: text, rowsCount: 2 }) })] })), _jsxs(EndAdornmentWrapper, { "$collapsedIn": collapsedIn, children: [Counter && _jsx(Counter, { max: max, count: count }), isGroupTitleItem && (_jsx(NavMenuItemButtonChevron, { "$collapsedIn": collapsedIn, "$opened": opened }))] })] }));
|
|
12
28
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createUIKitClassname } from '../../../utils/createUIKitClassname';
|
|
2
|
+
export const navMenuItemButtonClassnames = {
|
|
3
|
+
root: createUIKitClassname('nav-menu-item-button'),
|
|
4
|
+
hasGroup: createUIKitClassname('nav-menu-item-button_has-group'),
|
|
5
|
+
label: createUIKitClassname('nav-menu-item-button__label'),
|
|
6
|
+
labelHasCounter: createUIKitClassname('nav-menu-item-button__label_has-counter'),
|
|
7
|
+
};
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
export declare const StyledListItemButton: import("../../../styled").StyledComponent<Omit<import("../../../ListItemButton").ListItemButtonProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
-
} & {
|
|
6
|
-
$isGroupTitleItem: boolean;
|
|
7
5
|
}, {}, {}>;
|
|
8
6
|
export declare const NavMenuItemButtonIcon: import("../../../styled").StyledComponent<Omit<{
|
|
9
7
|
classes?: Partial<import("@mui/material").ListItemIconClasses> | undefined;
|
|
@@ -637,9 +635,6 @@ export declare const NavMenuItemButtonText: import("../../../styled").StyledComp
|
|
|
637
635
|
children?: import("react").ReactNode;
|
|
638
636
|
} & import("react").RefAttributes<HTMLElement> & {
|
|
639
637
|
theme?: import("@emotion/react").Theme | undefined;
|
|
640
|
-
} & {
|
|
641
|
-
$isGroupTitleItem: boolean;
|
|
642
|
-
$isCounter?: boolean | undefined;
|
|
643
638
|
}, {}, {}>;
|
|
644
639
|
export declare const NavMenuItemButtonChevron: import("../../../styled").StyledComponent<{
|
|
645
640
|
children?: import("react").ReactNode;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { listItemButtonClasses } from '@mui/material/ListItemButton';
|
|
1
2
|
import { ChevronDOutlineMd } from '../../../../icons/ChevronDOutlineMd';
|
|
2
3
|
import { PageDotOutlineMd } from '../../../../icons/PageDotOutlineMd';
|
|
3
4
|
import { ListItemButton } from '../../../ListItemButton';
|
|
@@ -6,15 +7,8 @@ import { OverflowTypography } from '../../../OverflowTypography';
|
|
|
6
7
|
import { svgIconClassnames } from '../../../SvgIcon';
|
|
7
8
|
import { styled } from '../../../styled';
|
|
8
9
|
import { UpDownTransition } from '../../../styled/mixins';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return isGroupTitleItem ? '140px' : '170px';
|
|
12
|
-
}
|
|
13
|
-
return isGroupTitleItem ? '100px' : '130px';
|
|
14
|
-
};
|
|
15
|
-
export const StyledListItemButton = styled(ListItemButton, {
|
|
16
|
-
shouldForwardProp: (prop) => !['$isGroupTitleItem'].includes(prop),
|
|
17
|
-
}) `
|
|
10
|
+
import { navMenuItemButtonClassnames } from './constants';
|
|
11
|
+
export const StyledListItemButton = styled(ListItemButton) `
|
|
18
12
|
overflow: hidden;
|
|
19
13
|
|
|
20
14
|
box-sizing: border-box;
|
|
@@ -23,10 +17,10 @@ export const StyledListItemButton = styled(ListItemButton, {
|
|
|
23
17
|
|
|
24
18
|
border-radius: ${({ theme }) => theme.shape.small};
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
&.${listItemButtonClasses.selected} {
|
|
27
21
|
color: ${({ theme }) => theme.palette.grey[900]};
|
|
28
22
|
|
|
29
|
-
background-color: ${({ theme
|
|
23
|
+
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
30
24
|
|
|
31
25
|
&::before {
|
|
32
26
|
content: '';
|
|
@@ -40,7 +34,15 @@ export const StyledListItemButton = styled(ListItemButton, {
|
|
|
40
34
|
}
|
|
41
35
|
|
|
42
36
|
&:hover {
|
|
43
|
-
background-color: ${({ theme
|
|
37
|
+
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.${navMenuItemButtonClassnames.hasGroup} {
|
|
41
|
+
background-color: inherit;
|
|
42
|
+
|
|
43
|
+
&:hover {
|
|
44
|
+
background-color: inherit;
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
|
|
@@ -86,10 +88,7 @@ export const NavMenuItemButtonIcon = styled(ListItemIcon) `
|
|
|
86
88
|
height: 20px;
|
|
87
89
|
}
|
|
88
90
|
`;
|
|
89
|
-
export const NavMenuItemButtonText = styled(OverflowTypography
|
|
90
|
-
shouldForwardProp: (prop) => !['$isGroupTitleItem', '$isCounter'].includes(prop),
|
|
91
|
-
}) `
|
|
92
|
-
width: ${({ $isGroupTitleItem, $isCounter }) => getItemWidth($isGroupTitleItem, $isCounter)};
|
|
91
|
+
export const NavMenuItemButtonText = styled(OverflowTypography) `
|
|
93
92
|
margin-left: ${({ theme }) => theme.spacing(3)};
|
|
94
93
|
|
|
95
94
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cva } from 'class-variance-authority';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cva } from 'class-variance-authority';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cva';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cva';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cva';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cva';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ComplianceStatus = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const class_variance_authority_1 = require("class-variance-authority");
|
|
6
5
|
const OverflowTypography_1 = require("../OverflowTypography");
|
|
7
6
|
const Typography_1 = require("../Typography");
|
|
7
|
+
const cva_1 = require("../utils/cva");
|
|
8
8
|
const constants_1 = require("./constants");
|
|
9
9
|
const styles_1 = require("./styles");
|
|
10
10
|
const ICON_BY_STATUS = {
|
|
@@ -13,7 +13,7 @@ const ICON_BY_STATUS = {
|
|
|
13
13
|
reject: (0, jsx_runtime_1.jsx)(styles_1.RejectIcon, {}),
|
|
14
14
|
loading: (0, jsx_runtime_1.jsx)(styles_1.StyledLoader, {}),
|
|
15
15
|
};
|
|
16
|
-
const complianceStatus = (0,
|
|
16
|
+
const complianceStatus = (0, cva_1.cva)(constants_1.complianceStatusClassnames.root, {
|
|
17
17
|
variants: {
|
|
18
18
|
backgroundColor: {
|
|
19
19
|
grey: constants_1.complianceStatusColorClassnames.grey,
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dashboardSidebarClassnames = void 0;
|
|
3
|
+
exports.LABEL_WIDTH = exports.dashboardSidebarClassnames = void 0;
|
|
4
4
|
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
5
5
|
exports.dashboardSidebarClassnames = {
|
|
6
6
|
root: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout-sidebar'),
|
|
7
7
|
hasMenuOrganization: (0, createUIKitClassname_1.createUIKitClassname)('dashboard-layout-sidebar_has-menu-organization'),
|
|
8
8
|
};
|
|
9
|
+
exports.LABEL_WIDTH = {
|
|
10
|
+
default: '170px',
|
|
11
|
+
counter: '130px',
|
|
12
|
+
group: '140px',
|
|
13
|
+
groupCounter: '100px',
|
|
14
|
+
};
|
|
@@ -5,6 +5,7 @@ const constants_1 = require("../constants");
|
|
|
5
5
|
const constants_2 = require("../DashboardLayout/constants");
|
|
6
6
|
const constants_3 = require("../MenuOrganization/constants");
|
|
7
7
|
const OrganizationButton_1 = require("../MenuOrganization/OrganizationButton");
|
|
8
|
+
const Item_1 = require("../NavMenu/Item");
|
|
8
9
|
const Paper_1 = require("../Paper");
|
|
9
10
|
const PinButton_1 = require("../PinButton");
|
|
10
11
|
const styled_1 = require("../styled");
|
|
@@ -62,7 +63,7 @@ exports.SidebarRoot = (0, styled_1.styled)('aside', {
|
|
|
62
63
|
width: ${({ $collapsedIn, $isPinned }) => $isPinned || (!$isPinned && $collapsedIn) ? '242px' : '58px'};
|
|
63
64
|
height: 100%;
|
|
64
65
|
|
|
65
|
-
background-color: ${({ theme }) => theme.palette.background.default}
|
|
66
|
+
background-color: ${({ theme }) => theme.palette.background.default};
|
|
66
67
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
67
68
|
box-shadow: ${({ theme, $isPinned, $collapsedIn }) => ($isPinned || !$collapsedIn ? 'unset' : theme.elevation[300])};
|
|
68
69
|
|
|
@@ -118,6 +119,24 @@ exports.SidebarContent = styled_1.styled.div `
|
|
|
118
119
|
});
|
|
119
120
|
}};
|
|
120
121
|
|
|
122
|
+
& .${Item_1.navMenuItemButtonClassnames.label} {
|
|
123
|
+
width: ${constants_4.LABEL_WIDTH.default};
|
|
124
|
+
|
|
125
|
+
&.${Item_1.navMenuItemButtonClassnames.labelHasCounter} {
|
|
126
|
+
width: ${constants_4.LABEL_WIDTH.counter};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
& .${Item_1.navMenuItemButtonClassnames.hasGroup} {
|
|
131
|
+
& .${Item_1.navMenuItemButtonClassnames.label} {
|
|
132
|
+
width: ${constants_4.LABEL_WIDTH.group};
|
|
133
|
+
|
|
134
|
+
&.${Item_1.navMenuItemButtonClassnames.labelHasCounter} {
|
|
135
|
+
width: ${constants_4.LABEL_WIDTH.groupCounter};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
121
140
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
122
141
|
width: inherit;
|
|
123
142
|
padding: ${({ theme, $hasHeader }) => theme.spacing($hasHeader ? 0 : 2, 0, 0, 0)};
|
|
@@ -137,7 +156,7 @@ exports.Footer = styled_1.styled.footer `
|
|
|
137
156
|
border-bottom-left-radius: ${({ theme }) => theme.shape.medium};
|
|
138
157
|
|
|
139
158
|
.${PinButton_1.pinButtonClassnames.root} {
|
|
140
|
-
padding-left: ${({ theme }) => theme.microSpacing(9)}
|
|
159
|
+
padding-left: ${({ theme }) => theme.microSpacing(9)};
|
|
141
160
|
}
|
|
142
161
|
|
|
143
162
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
@@ -5,11 +5,27 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const Collapse_1 = require("../../../Collapse");
|
|
7
7
|
const useViewportType_1 = require("../../../useViewportType");
|
|
8
|
+
const cva_1 = require("../../../utils/cva");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
8
10
|
const styles_1 = require("./styles");
|
|
11
|
+
const itemButton = (0, cva_1.cva)(constants_1.navMenuItemButtonClassnames.root, {
|
|
12
|
+
variants: {
|
|
13
|
+
hasGroup: {
|
|
14
|
+
true: constants_1.navMenuItemButtonClassnames.hasGroup,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
const itemButtonLabel = (0, cva_1.cva)(constants_1.navMenuItemButtonClassnames.label, {
|
|
19
|
+
variants: {
|
|
20
|
+
hasCounter: {
|
|
21
|
+
true: constants_1.navMenuItemButtonClassnames.labelHasCounter,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
9
25
|
exports.ItemButton = (0, react_1.forwardRef)((props, ref) => {
|
|
10
26
|
const { collapsedIn, opened, text, icon, component = 'a', counter, isNested = false, isGroupTitleItem = false, selected, ...restProps } = props;
|
|
11
27
|
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
12
28
|
const Counter = counter?.component;
|
|
13
29
|
const { max, count } = counter || {};
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledListItemButton, {
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.StyledListItemButton, { className: itemButton({ hasGroup: isGroupTitleItem }), ref: ref, component: component, withoutContainer: true, selected: selected, "aria-selected": selected, ...restProps, children: [isMobile ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isNested && (0, jsx_runtime_1.jsx)(styles_1.StyledPageDotOutlineMd, {}), (0, jsx_runtime_1.jsx)(styles_1.NavMenuItemButtonText, { children: text, rowsCount: 2 })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.NavMenuItemButtonIcon, { children: Counter && Number(count) ? ((0, jsx_runtime_1.jsx)(Counter.Badge, { invisible: collapsedIn, children: icon })) : (icon) }), (0, jsx_runtime_1.jsx)(Collapse_1.Collapse, { orientation: "horizontal", in: collapsedIn, children: (0, jsx_runtime_1.jsx)(styles_1.NavMenuItemButtonText, { tooltipProps: { placement: 'right' }, className: itemButtonLabel({ hasCounter: Boolean(counter) }), children: text, rowsCount: 2 }) })] })), (0, jsx_runtime_1.jsxs)(styles_1.EndAdornmentWrapper, { "$collapsedIn": collapsedIn, children: [Counter && (0, jsx_runtime_1.jsx)(Counter, { max: max, count: count }), isGroupTitleItem && ((0, jsx_runtime_1.jsx)(styles_1.NavMenuItemButtonChevron, { "$collapsedIn": collapsedIn, "$opened": opened }))] })] }));
|
|
15
31
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.navMenuItemButtonClassnames = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../../../utils/createUIKitClassname");
|
|
5
|
+
exports.navMenuItemButtonClassnames = {
|
|
6
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('nav-menu-item-button'),
|
|
7
|
+
hasGroup: (0, createUIKitClassname_1.createUIKitClassname)('nav-menu-item-button_has-group'),
|
|
8
|
+
label: (0, createUIKitClassname_1.createUIKitClassname)('nav-menu-item-button__label'),
|
|
9
|
+
labelHasCounter: (0, createUIKitClassname_1.createUIKitClassname)('nav-menu-item-button__label_has-counter'),
|
|
10
|
+
};
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
export declare const StyledListItemButton: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../../ListItemButton").ListItemButtonProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
-
} & {
|
|
6
|
-
$isGroupTitleItem: boolean;
|
|
7
5
|
}, {}, {}>;
|
|
8
6
|
export declare const NavMenuItemButtonIcon: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<{
|
|
9
7
|
classes?: Partial<import("@mui/material").ListItemIconClasses> | undefined;
|
|
@@ -637,9 +635,6 @@ export declare const NavMenuItemButtonText: import("@emotion/styled/dist/declara
|
|
|
637
635
|
children?: import("react").ReactNode;
|
|
638
636
|
} & import("react").RefAttributes<HTMLElement> & {
|
|
639
637
|
theme?: import("@emotion/react").Theme | undefined;
|
|
640
|
-
} & {
|
|
641
|
-
$isGroupTitleItem: boolean;
|
|
642
|
-
$isCounter?: boolean | undefined;
|
|
643
638
|
}, {}, {}>;
|
|
644
639
|
export declare const NavMenuItemButtonChevron: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
645
640
|
children?: import("react").ReactNode;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StyledPageDotOutlineMd = exports.EndAdornmentWrapper = exports.NavMenuItemButtonChevron = exports.NavMenuItemButtonText = exports.NavMenuItemButtonIcon = exports.StyledListItemButton = void 0;
|
|
4
|
+
const ListItemButton_1 = require("@mui/material/ListItemButton");
|
|
4
5
|
const ChevronDOutlineMd_1 = require("../../../../icons/ChevronDOutlineMd");
|
|
5
6
|
const PageDotOutlineMd_1 = require("../../../../icons/PageDotOutlineMd");
|
|
6
|
-
const
|
|
7
|
+
const ListItemButton_2 = require("../../../ListItemButton");
|
|
7
8
|
const ListItemIcon_1 = require("../../../ListItemIcon");
|
|
8
9
|
const OverflowTypography_1 = require("../../../OverflowTypography");
|
|
9
10
|
const SvgIcon_1 = require("../../../SvgIcon");
|
|
10
11
|
const styled_1 = require("../../../styled");
|
|
11
12
|
const mixins_1 = require("../../../styled/mixins");
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
return isGroupTitleItem ? '140px' : '170px';
|
|
15
|
-
}
|
|
16
|
-
return isGroupTitleItem ? '100px' : '130px';
|
|
17
|
-
};
|
|
18
|
-
exports.StyledListItemButton = (0, styled_1.styled)(ListItemButton_1.ListItemButton, {
|
|
19
|
-
shouldForwardProp: (prop) => !['$isGroupTitleItem'].includes(prop),
|
|
20
|
-
}) `
|
|
13
|
+
const constants_1 = require("./constants");
|
|
14
|
+
exports.StyledListItemButton = (0, styled_1.styled)(ListItemButton_2.ListItemButton) `
|
|
21
15
|
overflow: hidden;
|
|
22
16
|
|
|
23
17
|
box-sizing: border-box;
|
|
@@ -26,10 +20,10 @@ exports.StyledListItemButton = (0, styled_1.styled)(ListItemButton_1.ListItemBut
|
|
|
26
20
|
|
|
27
21
|
border-radius: ${({ theme }) => theme.shape.small};
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
&.${ListItemButton_1.listItemButtonClasses.selected} {
|
|
30
24
|
color: ${({ theme }) => theme.palette.grey[900]};
|
|
31
25
|
|
|
32
|
-
background-color: ${({ theme
|
|
26
|
+
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
33
27
|
|
|
34
28
|
&::before {
|
|
35
29
|
content: '';
|
|
@@ -43,7 +37,15 @@ exports.StyledListItemButton = (0, styled_1.styled)(ListItemButton_1.ListItemBut
|
|
|
43
37
|
}
|
|
44
38
|
|
|
45
39
|
&:hover {
|
|
46
|
-
background-color: ${({ theme
|
|
40
|
+
background-color: ${({ theme }) => theme.palette.primary[100]};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.${constants_1.navMenuItemButtonClassnames.hasGroup} {
|
|
44
|
+
background-color: inherit;
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
background-color: inherit;
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -89,10 +91,7 @@ exports.NavMenuItemButtonIcon = (0, styled_1.styled)(ListItemIcon_1.ListItemIcon
|
|
|
89
91
|
height: 20px;
|
|
90
92
|
}
|
|
91
93
|
`;
|
|
92
|
-
exports.NavMenuItemButtonText = (0, styled_1.styled)(OverflowTypography_1.OverflowTypography
|
|
93
|
-
shouldForwardProp: (prop) => !['$isGroupTitleItem', '$isCounter'].includes(prop),
|
|
94
|
-
}) `
|
|
95
|
-
width: ${({ $isGroupTitleItem, $isCounter }) => getItemWidth($isGroupTitleItem, $isCounter)};
|
|
94
|
+
exports.NavMenuItemButtonText = (0, styled_1.styled)(OverflowTypography_1.OverflowTypography) `
|
|
96
95
|
margin-left: ${({ theme }) => theme.spacing(3)};
|
|
97
96
|
|
|
98
97
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
@@ -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.navMenuItemButtonClassnames = void 0;
|
|
17
18
|
__exportStar(require("./Item"), exports);
|
|
18
19
|
__exportStar(require("./types"), exports);
|
|
20
|
+
var ItemButton_1 = require("./ItemButton");
|
|
21
|
+
Object.defineProperty(exports, "navMenuItemButtonClassnames", { enumerable: true, get: function () { return ItemButton_1.navMenuItemButtonClassnames; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cva } from 'class-variance-authority';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cva = void 0;
|
|
4
|
+
var class_variance_authority_1 = require("class-variance-authority");
|
|
5
|
+
Object.defineProperty(exports, "cva", { enumerable: true, get: function () { return class_variance_authority_1.cva; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cva';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cva"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cva';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cva"), exports);
|