@astral/ui 4.46.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.
Files changed (59) hide show
  1. package/components/ComplianceStatus/ComplianceStatus.d.ts +1 -43
  2. package/components/ComplianceStatus/ComplianceStatus.js +17 -2
  3. package/components/ComplianceStatus/constants.d.ts +14 -0
  4. package/components/ComplianceStatus/constants.js +18 -0
  5. package/components/ComplianceStatus/index.d.ts +2 -1
  6. package/components/ComplianceStatus/index.js +1 -1
  7. package/components/ComplianceStatus/public.d.ts +2 -1
  8. package/components/ComplianceStatus/public.js +1 -1
  9. package/components/ComplianceStatus/styles.d.ts +0 -5
  10. package/components/ComplianceStatus/styles.js +21 -3
  11. package/components/ComplianceStatus/types.d.ts +42 -0
  12. package/components/ComplianceStatus/types.js +1 -0
  13. package/components/DashboardSidebar/constants.d.ts +6 -0
  14. package/components/DashboardSidebar/constants.js +6 -0
  15. package/components/DashboardSidebar/styles.js +22 -3
  16. package/components/NavMenu/Item/ItemButton/ItemButton.js +17 -1
  17. package/components/NavMenu/Item/ItemButton/constants.d.ts +6 -0
  18. package/components/NavMenu/Item/ItemButton/constants.js +7 -0
  19. package/components/NavMenu/Item/ItemButton/index.d.ts +1 -0
  20. package/components/NavMenu/Item/ItemButton/index.js +1 -0
  21. package/components/NavMenu/Item/ItemButton/styles.d.ts +0 -5
  22. package/components/NavMenu/Item/ItemButton/styles.js +15 -16
  23. package/components/NavMenu/Item/index.d.ts +1 -0
  24. package/components/NavMenu/Item/index.js +1 -0
  25. package/components/utils/cva/cva.d.ts +1 -0
  26. package/components/utils/cva/cva.js +1 -0
  27. package/components/utils/cva/index.d.ts +1 -0
  28. package/components/utils/cva/index.js +1 -0
  29. package/components/utils/cva/public.d.ts +1 -0
  30. package/components/utils/cva/public.js +1 -0
  31. package/node/components/ComplianceStatus/ComplianceStatus.d.ts +1 -43
  32. package/node/components/ComplianceStatus/ComplianceStatus.js +17 -2
  33. package/node/components/ComplianceStatus/constants.d.ts +14 -0
  34. package/node/components/ComplianceStatus/constants.js +21 -0
  35. package/node/components/ComplianceStatus/index.d.ts +2 -1
  36. package/node/components/ComplianceStatus/public.d.ts +2 -1
  37. package/node/components/ComplianceStatus/styles.d.ts +0 -5
  38. package/node/components/ComplianceStatus/styles.js +21 -3
  39. package/node/components/ComplianceStatus/types.d.ts +42 -0
  40. package/node/components/ComplianceStatus/types.js +2 -0
  41. package/node/components/DashboardSidebar/constants.d.ts +6 -0
  42. package/node/components/DashboardSidebar/constants.js +7 -1
  43. package/node/components/DashboardSidebar/styles.js +21 -2
  44. package/node/components/NavMenu/Item/ItemButton/ItemButton.js +17 -1
  45. package/node/components/NavMenu/Item/ItemButton/constants.d.ts +6 -0
  46. package/node/components/NavMenu/Item/ItemButton/constants.js +10 -0
  47. package/node/components/NavMenu/Item/ItemButton/index.d.ts +1 -0
  48. package/node/components/NavMenu/Item/ItemButton/index.js +1 -0
  49. package/node/components/NavMenu/Item/ItemButton/styles.d.ts +0 -5
  50. package/node/components/NavMenu/Item/ItemButton/styles.js +16 -17
  51. package/node/components/NavMenu/Item/index.d.ts +1 -0
  52. package/node/components/NavMenu/Item/index.js +3 -0
  53. package/node/components/utils/cva/cva.d.ts +1 -0
  54. package/node/components/utils/cva/cva.js +5 -0
  55. package/node/components/utils/cva/index.d.ts +1 -0
  56. package/node/components/utils/cva/index.js +17 -0
  57. package/node/components/utils/cva/public.d.ts +1 -0
  58. package/node/components/utils/cva/public.js +17 -0
  59. package/package.json +2 -1
@@ -1,44 +1,2 @@
1
- import { type ReactNode } from 'react';
2
- type ItemStatus = 'success' | 'reject' | 'default' | 'loading';
3
- type BackgroundColor = 'grey' | 'primary';
4
- type Variant = 'plain' | 'contained';
5
- export type ComplianceStatusItem = {
6
- /**
7
- * Текст для отображения в элементе списка
8
- */
9
- text: ReactNode;
10
- /**
11
- * Статус элемента
12
- */
13
- status: ItemStatus;
14
- };
15
- export type ComplianceStatusProps = {
16
- /**
17
- * Основной заголовок элемента
18
- */
19
- title?: string | null;
20
- /**
21
- * Пропс для добавления контента между заголовком и списком
22
- */
23
- subtitle?: ReactNode;
24
- /**
25
- * Пропс для добавления контента после списка
26
- */
27
- children?: ReactNode;
28
- /**
29
- * Элементы списка
30
- */
31
- itemsList: ComplianceStatusItem[];
32
- /**
33
- * Фоновый цвет
34
- * @default grey
35
- */
36
- backgroundColor?: BackgroundColor;
37
- /**
38
- * Вариант отображения блока статусов
39
- * @default contained
40
- */
41
- variant?: Variant;
42
- };
1
+ import type { ComplianceStatusProps } from './types';
43
2
  export declare const ComplianceStatus: ({ title, itemsList, children, subtitle, backgroundColor, variant, }: ComplianceStatusProps) => import("react/jsx-runtime").JSX.Element;
44
- export {};
@@ -1,6 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { OverflowTypography } from '../OverflowTypography';
3
3
  import { Typography } from '../Typography';
4
+ import { cva } from '../utils/cva';
5
+ import { complianceStatusClassnames, complianceStatusColorClassnames, complianceStatusVariantClassnames, } from './constants';
4
6
  import { EmptyIcon, Inner, Item, RejectIcon, StyledLoader, SuccessIcon, Wrapper, } from './styles';
5
7
  const ICON_BY_STATUS = {
6
8
  default: _jsx(EmptyIcon, {}),
@@ -8,8 +10,21 @@ const ICON_BY_STATUS = {
8
10
  reject: _jsx(RejectIcon, {}),
9
11
  loading: _jsx(StyledLoader, {}),
10
12
  };
13
+ const complianceStatus = cva(complianceStatusClassnames.root, {
14
+ variants: {
15
+ backgroundColor: {
16
+ grey: complianceStatusColorClassnames.grey,
17
+ primary: complianceStatusColorClassnames.primary,
18
+ },
19
+ variant: {
20
+ contained: complianceStatusVariantClassnames.contained,
21
+ outlined: complianceStatusVariantClassnames.outlined,
22
+ plain: complianceStatusVariantClassnames.plain,
23
+ },
24
+ },
25
+ });
11
26
  export const ComplianceStatus = ({ title, itemsList, children, subtitle, backgroundColor = 'grey', variant = 'contained', }) => {
12
- return (_jsxs(Wrapper, { "$background": backgroundColor, "$variant": variant, children: [title && (_jsx(OverflowTypography, { variant: "h6", component: "h4", children: title })), subtitle, _jsx(Inner, { children: itemsList.map(({ text, status }, index) => (
27
+ return (_jsxs(Wrapper, { className: complianceStatus({ backgroundColor, variant }), children: [title && (_jsx(OverflowTypography, { className: complianceStatusClassnames.title, variant: "h6", component: "h4", children: title })), subtitle, _jsx(Inner, { className: complianceStatusClassnames.list, children: itemsList.map(({ text, status }, index) => (
13
28
  // biome-ignore lint/suspicious/noArrayIndexKey: Элементы статичны
14
- _jsxs(Item, { children: [ICON_BY_STATUS[status], _jsx(Typography, { children: text })] }, index))) }), children] }));
29
+ _jsxs(Item, { className: complianceStatusClassnames.item, children: [ICON_BY_STATUS[status], _jsx(Typography, { children: text })] }, index))) }), children] }));
15
30
  };
@@ -0,0 +1,14 @@
1
+ import type { BackgroundColor, Variant } from './types';
2
+ export declare const complianceStatusColorClassnames: Record<BackgroundColor, string>;
3
+ export declare const complianceStatusVariantClassnames: Record<Variant, string>;
4
+ export declare const complianceStatusClassnames: {
5
+ contained: string;
6
+ outlined: string;
7
+ plain: string;
8
+ primary: string;
9
+ grey: string;
10
+ root: string;
11
+ title: string;
12
+ list: string;
13
+ item: string;
14
+ };
@@ -0,0 +1,18 @@
1
+ import { createUIKitClassname } from '../utils/createUIKitClassname';
2
+ export const complianceStatusColorClassnames = {
3
+ grey: createUIKitClassname('compliance-status_color-grey'),
4
+ primary: createUIKitClassname('compliance-status_color-primary'),
5
+ };
6
+ export const complianceStatusVariantClassnames = {
7
+ plain: createUIKitClassname('compliance-status_variant-plain'),
8
+ contained: createUIKitClassname('compliance-status_variant-contained'),
9
+ outlined: createUIKitClassname('compliance-status_variant-outlined'),
10
+ };
11
+ export const complianceStatusClassnames = {
12
+ root: createUIKitClassname('compliance-status'),
13
+ title: createUIKitClassname('compliance-status__title'),
14
+ list: createUIKitClassname('compliance-status__list'),
15
+ item: createUIKitClassname('compliance-status__item'),
16
+ ...complianceStatusColorClassnames,
17
+ ...complianceStatusVariantClassnames,
18
+ };
@@ -1 +1,2 @@
1
- export { ComplianceStatus, type ComplianceStatusItem, type ComplianceStatusProps, } from './ComplianceStatus';
1
+ export { ComplianceStatus } from './ComplianceStatus';
2
+ export type { ComplianceStatusItem, ComplianceStatusProps } from './types';
@@ -1 +1 @@
1
- export { ComplianceStatus, } from './ComplianceStatus';
1
+ export { ComplianceStatus } from './ComplianceStatus';
@@ -1 +1,2 @@
1
- export { ComplianceStatus, type ComplianceStatusItem, type ComplianceStatusProps, } from './ComplianceStatus';
1
+ export { ComplianceStatus } from './ComplianceStatus';
2
+ export type { ComplianceStatusItem, ComplianceStatusProps } from './types';
@@ -1 +1 @@
1
- export { ComplianceStatus, } from './ComplianceStatus';
1
+ export { ComplianceStatus } from './ComplianceStatus';
@@ -1,11 +1,7 @@
1
1
  /// <reference types="react" />
2
- type Variant = 'plain' | 'contained';
3
2
  export declare const Wrapper: import("../styled").StyledComponent<{
4
3
  theme?: import("@emotion/react").Theme | undefined;
5
4
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
6
- } & {
7
- $background: 'grey' | 'primary';
8
- $variant: Variant;
9
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
10
6
  export declare const Inner: import("../styled").StyledComponent<{
11
7
  theme?: import("@emotion/react").Theme | undefined;
@@ -51,4 +47,3 @@ export declare const SuccessIcon: import("../styled").StyledComponent<{
51
47
  export declare const StyledLoader: import("../styled").StyledComponent<import("../Loader").LoaderProps & {
52
48
  theme?: import("@emotion/react").Theme | undefined;
53
49
  }, {}, {}>;
54
- export {};
@@ -4,6 +4,7 @@ import { SuccessFillSm } from '../../icons/SuccessFillSm';
4
4
  import { Loader } from '../Loader';
5
5
  import { keyframes, styled } from '../styled';
6
6
  import { listContainer } from '../styled/mixins';
7
+ import { complianceStatusClassnames } from './constants';
7
8
  const iconAppearAnimation = keyframes `
8
9
  from {
9
10
  transform: scale(0);
@@ -14,14 +15,31 @@ const iconAppearAnimation = keyframes `
14
15
  opacity: 1;
15
16
  }
16
17
  `;
17
- export const Wrapper = styled('article') `
18
+ export const Wrapper = styled.article `
18
19
  display: grid;
19
20
  grid-gap: ${({ theme }) => theme.spacing(2)};
20
21
 
21
- padding: ${({ theme, $variant }) => $variant === 'contained' ? theme.spacing(3) : 0};
22
+ background-color: inherit;
22
23
 
23
- background-color: ${({ theme, $background, $variant }) => $variant === 'contained' ? theme.palette[$background][100] : 'inherit'};
24
24
  border-radius: ${({ theme }) => theme.shape.medium};
25
+
26
+ &.${complianceStatusClassnames.contained} {
27
+ padding: ${({ theme }) => theme.spacing(3)};
28
+
29
+ &.${complianceStatusClassnames.primary} {
30
+ background-color: ${({ theme }) => theme.palette.primary[100]};
31
+ }
32
+
33
+ &.${complianceStatusClassnames.grey} {
34
+ background-color: ${({ theme }) => theme.palette.grey[100]};
35
+ }
36
+ }
37
+
38
+ &.${complianceStatusClassnames.outlined} {
39
+ padding: ${({ theme }) => theme.spacing(3)};
40
+
41
+ border: 1px solid ${({ theme }) => theme.palette.grey[300]};
42
+ }
25
43
  `;
26
44
  export const Inner = styled('ul') `
27
45
  display: grid;
@@ -0,0 +1,42 @@
1
+ import type { ReactNode } from 'react';
2
+ export type ItemStatus = 'success' | 'reject' | 'default' | 'loading';
3
+ export type BackgroundColor = 'grey' | 'primary';
4
+ export type Variant = 'plain' | 'contained' | 'outlined';
5
+ export type ComplianceStatusItem = {
6
+ /**
7
+ * Текст для отображения в элементе списка
8
+ */
9
+ text: ReactNode;
10
+ /**
11
+ * Статус элемента
12
+ */
13
+ status: ItemStatus;
14
+ };
15
+ export type ComplianceStatusProps = {
16
+ /**
17
+ * Основной заголовок элемента
18
+ */
19
+ title?: string | null;
20
+ /**
21
+ * Пропс для добавления контента между заголовком и списком
22
+ */
23
+ subtitle?: ReactNode;
24
+ /**
25
+ * Пропс для добавления контента после списка
26
+ */
27
+ children?: ReactNode;
28
+ /**
29
+ * Элементы списка
30
+ */
31
+ itemsList: ComplianceStatusItem[];
32
+ /**
33
+ * Фоновый цвет
34
+ * @default grey
35
+ */
36
+ backgroundColor?: BackgroundColor;
37
+ /**
38
+ * Вариант отображения блока статусов
39
+ * @default contained
40
+ */
41
+ variant?: Variant;
42
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -2,3 +2,9 @@ export declare const dashboardSidebarClassnames: {
2
2
  root: string;
3
3
  hasMenuOrganization: string;
4
4
  };
5
+ export declare const LABEL_WIDTH: {
6
+ default: string;
7
+ counter: string;
8
+ group: string;
9
+ groupCounter: string;
10
+ };
@@ -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, { "$isGroupTitleItem": isGroupTitleItem, ref: ref, component: component, withoutContainer: true, selected: selected, "aria-selected": selected, ...restProps, children: [isMobile ? (_jsxs(_Fragment, { children: [isNested && _jsx(StyledPageDotOutlineMd, {}), _jsx(NavMenuItemButtonText, { "$isGroupTitleItem": isGroupTitleItem, 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, { "$isGroupTitleItem": isGroupTitleItem, "$isCounter": Boolean(counter), tooltipProps: { placement: 'right' }, children: text, rowsCount: 2 }) })] })), _jsxs(EndAdornmentWrapper, { "$collapsedIn": collapsedIn, children: [Counter && _jsx(Counter, { max: max, count: count }), isGroupTitleItem && (_jsx(NavMenuItemButtonChevron, { "$collapsedIn": collapsedIn, "$opened": opened }))] })] }));
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,6 @@
1
+ export declare const navMenuItemButtonClassnames: {
2
+ root: string;
3
+ hasGroup: string;
4
+ label: string;
5
+ labelHasCounter: string;
6
+ };
@@ -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
+ };
@@ -1 +1,2 @@
1
1
  export * from './ItemButton';
2
+ export * from './constants';
@@ -1 +1,2 @@
1
1
  export * from './ItemButton';
2
+ export * from './constants';
@@ -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
- const getItemWidth = (isGroupTitleItem, isCounter) => {
10
- if (!isCounter) {
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
- &.Mui-selected {
20
+ &.${listItemButtonClasses.selected} {
27
21
  color: ${({ theme }) => theme.palette.grey[900]};
28
22
 
29
- background-color: ${({ theme, $isGroupTitleItem }) => $isGroupTitleItem ? 'inherit' : theme.palette.primary[100]};
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, $isGroupTitleItem }) => $isGroupTitleItem ? 'inherit' : theme.palette.primary[100]};
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')} {
@@ -1,2 +1,3 @@
1
1
  export * from './Item';
2
2
  export * from './types';
3
+ export { navMenuItemButtonClassnames } from './ItemButton';
@@ -1,2 +1,3 @@
1
1
  export * from './Item';
2
2
  export * from './types';
3
+ export { navMenuItemButtonClassnames } from './ItemButton';
@@ -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';
@@ -1,44 +1,2 @@
1
- import { type ReactNode } from 'react';
2
- type ItemStatus = 'success' | 'reject' | 'default' | 'loading';
3
- type BackgroundColor = 'grey' | 'primary';
4
- type Variant = 'plain' | 'contained';
5
- export type ComplianceStatusItem = {
6
- /**
7
- * Текст для отображения в элементе списка
8
- */
9
- text: ReactNode;
10
- /**
11
- * Статус элемента
12
- */
13
- status: ItemStatus;
14
- };
15
- export type ComplianceStatusProps = {
16
- /**
17
- * Основной заголовок элемента
18
- */
19
- title?: string | null;
20
- /**
21
- * Пропс для добавления контента между заголовком и списком
22
- */
23
- subtitle?: ReactNode;
24
- /**
25
- * Пропс для добавления контента после списка
26
- */
27
- children?: ReactNode;
28
- /**
29
- * Элементы списка
30
- */
31
- itemsList: ComplianceStatusItem[];
32
- /**
33
- * Фоновый цвет
34
- * @default grey
35
- */
36
- backgroundColor?: BackgroundColor;
37
- /**
38
- * Вариант отображения блока статусов
39
- * @default contained
40
- */
41
- variant?: Variant;
42
- };
1
+ import type { ComplianceStatusProps } from './types';
43
2
  export declare const ComplianceStatus: ({ title, itemsList, children, subtitle, backgroundColor, variant, }: ComplianceStatusProps) => import("react/jsx-runtime").JSX.Element;
44
- export {};
@@ -4,6 +4,8 @@ exports.ComplianceStatus = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const OverflowTypography_1 = require("../OverflowTypography");
6
6
  const Typography_1 = require("../Typography");
7
+ const cva_1 = require("../utils/cva");
8
+ const constants_1 = require("./constants");
7
9
  const styles_1 = require("./styles");
8
10
  const ICON_BY_STATUS = {
9
11
  default: (0, jsx_runtime_1.jsx)(styles_1.EmptyIcon, {}),
@@ -11,9 +13,22 @@ const ICON_BY_STATUS = {
11
13
  reject: (0, jsx_runtime_1.jsx)(styles_1.RejectIcon, {}),
12
14
  loading: (0, jsx_runtime_1.jsx)(styles_1.StyledLoader, {}),
13
15
  };
16
+ const complianceStatus = (0, cva_1.cva)(constants_1.complianceStatusClassnames.root, {
17
+ variants: {
18
+ backgroundColor: {
19
+ grey: constants_1.complianceStatusColorClassnames.grey,
20
+ primary: constants_1.complianceStatusColorClassnames.primary,
21
+ },
22
+ variant: {
23
+ contained: constants_1.complianceStatusVariantClassnames.contained,
24
+ outlined: constants_1.complianceStatusVariantClassnames.outlined,
25
+ plain: constants_1.complianceStatusVariantClassnames.plain,
26
+ },
27
+ },
28
+ });
14
29
  const ComplianceStatus = ({ title, itemsList, children, subtitle, backgroundColor = 'grey', variant = 'contained', }) => {
15
- return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$background": backgroundColor, "$variant": variant, children: [title && ((0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { variant: "h6", component: "h4", children: title })), subtitle, (0, jsx_runtime_1.jsx)(styles_1.Inner, { children: itemsList.map(({ text, status }, index) => (
30
+ return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: complianceStatus({ backgroundColor, variant }), children: [title && ((0, jsx_runtime_1.jsx)(OverflowTypography_1.OverflowTypography, { className: constants_1.complianceStatusClassnames.title, variant: "h6", component: "h4", children: title })), subtitle, (0, jsx_runtime_1.jsx)(styles_1.Inner, { className: constants_1.complianceStatusClassnames.list, children: itemsList.map(({ text, status }, index) => (
16
31
  // biome-ignore lint/suspicious/noArrayIndexKey: Элементы статичны
17
- (0, jsx_runtime_1.jsxs)(styles_1.Item, { children: [ICON_BY_STATUS[status], (0, jsx_runtime_1.jsx)(Typography_1.Typography, { children: text })] }, index))) }), children] }));
32
+ (0, jsx_runtime_1.jsxs)(styles_1.Item, { className: constants_1.complianceStatusClassnames.item, children: [ICON_BY_STATUS[status], (0, jsx_runtime_1.jsx)(Typography_1.Typography, { children: text })] }, index))) }), children] }));
18
33
  };
19
34
  exports.ComplianceStatus = ComplianceStatus;
@@ -0,0 +1,14 @@
1
+ import type { BackgroundColor, Variant } from './types';
2
+ export declare const complianceStatusColorClassnames: Record<BackgroundColor, string>;
3
+ export declare const complianceStatusVariantClassnames: Record<Variant, string>;
4
+ export declare const complianceStatusClassnames: {
5
+ contained: string;
6
+ outlined: string;
7
+ plain: string;
8
+ primary: string;
9
+ grey: string;
10
+ root: string;
11
+ title: string;
12
+ list: string;
13
+ item: string;
14
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.complianceStatusClassnames = exports.complianceStatusVariantClassnames = exports.complianceStatusColorClassnames = void 0;
4
+ const createUIKitClassname_1 = require("../utils/createUIKitClassname");
5
+ exports.complianceStatusColorClassnames = {
6
+ grey: (0, createUIKitClassname_1.createUIKitClassname)('compliance-status_color-grey'),
7
+ primary: (0, createUIKitClassname_1.createUIKitClassname)('compliance-status_color-primary'),
8
+ };
9
+ exports.complianceStatusVariantClassnames = {
10
+ plain: (0, createUIKitClassname_1.createUIKitClassname)('compliance-status_variant-plain'),
11
+ contained: (0, createUIKitClassname_1.createUIKitClassname)('compliance-status_variant-contained'),
12
+ outlined: (0, createUIKitClassname_1.createUIKitClassname)('compliance-status_variant-outlined'),
13
+ };
14
+ exports.complianceStatusClassnames = {
15
+ root: (0, createUIKitClassname_1.createUIKitClassname)('compliance-status'),
16
+ title: (0, createUIKitClassname_1.createUIKitClassname)('compliance-status__title'),
17
+ list: (0, createUIKitClassname_1.createUIKitClassname)('compliance-status__list'),
18
+ item: (0, createUIKitClassname_1.createUIKitClassname)('compliance-status__item'),
19
+ ...exports.complianceStatusColorClassnames,
20
+ ...exports.complianceStatusVariantClassnames,
21
+ };
@@ -1 +1,2 @@
1
- export { ComplianceStatus, type ComplianceStatusItem, type ComplianceStatusProps, } from './ComplianceStatus';
1
+ export { ComplianceStatus } from './ComplianceStatus';
2
+ export type { ComplianceStatusItem, ComplianceStatusProps } from './types';
@@ -1 +1,2 @@
1
- export { ComplianceStatus, type ComplianceStatusItem, type ComplianceStatusProps, } from './ComplianceStatus';
1
+ export { ComplianceStatus } from './ComplianceStatus';
2
+ export type { ComplianceStatusItem, ComplianceStatusProps } from './types';
@@ -1,11 +1,7 @@
1
1
  /// <reference types="react" />
2
- type Variant = 'plain' | 'contained';
3
2
  export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
4
3
  theme?: import("@emotion/react").Theme | undefined;
5
4
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
6
- } & {
7
- $background: 'grey' | 'primary';
8
- $variant: Variant;
9
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
10
6
  export declare const Inner: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
11
7
  theme?: import("@emotion/react").Theme | undefined;
@@ -51,4 +47,3 @@ export declare const SuccessIcon: import("@emotion/styled/dist/declarations/src/
51
47
  export declare const StyledLoader: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../Loader").LoaderProps & {
52
48
  theme?: import("@emotion/react").Theme | undefined;
53
49
  }, {}, {}>;
54
- export {};
@@ -7,6 +7,7 @@ const SuccessFillSm_1 = require("../../icons/SuccessFillSm");
7
7
  const Loader_1 = require("../Loader");
8
8
  const styled_1 = require("../styled");
9
9
  const mixins_1 = require("../styled/mixins");
10
+ const constants_1 = require("./constants");
10
11
  const iconAppearAnimation = (0, styled_1.keyframes) `
11
12
  from {
12
13
  transform: scale(0);
@@ -17,14 +18,31 @@ const iconAppearAnimation = (0, styled_1.keyframes) `
17
18
  opacity: 1;
18
19
  }
19
20
  `;
20
- exports.Wrapper = (0, styled_1.styled)('article') `
21
+ exports.Wrapper = styled_1.styled.article `
21
22
  display: grid;
22
23
  grid-gap: ${({ theme }) => theme.spacing(2)};
23
24
 
24
- padding: ${({ theme, $variant }) => $variant === 'contained' ? theme.spacing(3) : 0};
25
+ background-color: inherit;
25
26
 
26
- background-color: ${({ theme, $background, $variant }) => $variant === 'contained' ? theme.palette[$background][100] : 'inherit'};
27
27
  border-radius: ${({ theme }) => theme.shape.medium};
28
+
29
+ &.${constants_1.complianceStatusClassnames.contained} {
30
+ padding: ${({ theme }) => theme.spacing(3)};
31
+
32
+ &.${constants_1.complianceStatusClassnames.primary} {
33
+ background-color: ${({ theme }) => theme.palette.primary[100]};
34
+ }
35
+
36
+ &.${constants_1.complianceStatusClassnames.grey} {
37
+ background-color: ${({ theme }) => theme.palette.grey[100]};
38
+ }
39
+ }
40
+
41
+ &.${constants_1.complianceStatusClassnames.outlined} {
42
+ padding: ${({ theme }) => theme.spacing(3)};
43
+
44
+ border: 1px solid ${({ theme }) => theme.palette.grey[300]};
45
+ }
28
46
  `;
29
47
  exports.Inner = (0, styled_1.styled)('ul') `
30
48
  display: grid;
@@ -0,0 +1,42 @@
1
+ import type { ReactNode } from 'react';
2
+ export type ItemStatus = 'success' | 'reject' | 'default' | 'loading';
3
+ export type BackgroundColor = 'grey' | 'primary';
4
+ export type Variant = 'plain' | 'contained' | 'outlined';
5
+ export type ComplianceStatusItem = {
6
+ /**
7
+ * Текст для отображения в элементе списка
8
+ */
9
+ text: ReactNode;
10
+ /**
11
+ * Статус элемента
12
+ */
13
+ status: ItemStatus;
14
+ };
15
+ export type ComplianceStatusProps = {
16
+ /**
17
+ * Основной заголовок элемента
18
+ */
19
+ title?: string | null;
20
+ /**
21
+ * Пропс для добавления контента между заголовком и списком
22
+ */
23
+ subtitle?: ReactNode;
24
+ /**
25
+ * Пропс для добавления контента после списка
26
+ */
27
+ children?: ReactNode;
28
+ /**
29
+ * Элементы списка
30
+ */
31
+ itemsList: ComplianceStatusItem[];
32
+ /**
33
+ * Фоновый цвет
34
+ * @default grey
35
+ */
36
+ backgroundColor?: BackgroundColor;
37
+ /**
38
+ * Вариант отображения блока статусов
39
+ * @default contained
40
+ */
41
+ variant?: Variant;
42
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,3 +2,9 @@ export declare const dashboardSidebarClassnames: {
2
2
  root: string;
3
3
  hasMenuOrganization: string;
4
4
  };
5
+ export declare const LABEL_WIDTH: {
6
+ default: string;
7
+ counter: string;
8
+ group: string;
9
+ groupCounter: string;
10
+ };
@@ -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, { "$isGroupTitleItem": 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, { "$isGroupTitleItem": isGroupTitleItem, 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, { "$isGroupTitleItem": isGroupTitleItem, "$isCounter": Boolean(counter), tooltipProps: { placement: 'right' }, 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 }))] })] }));
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,6 @@
1
+ export declare const navMenuItemButtonClassnames: {
2
+ root: string;
3
+ hasGroup: string;
4
+ label: string;
5
+ labelHasCounter: string;
6
+ };
@@ -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
+ };
@@ -1 +1,2 @@
1
1
  export * from './ItemButton';
2
+ export * from './constants';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ItemButton"), exports);
18
+ __exportStar(require("./constants"), exports);
@@ -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 ListItemButton_1 = require("../../../ListItemButton");
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 getItemWidth = (isGroupTitleItem, isCounter) => {
13
- if (!isCounter) {
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
- &.Mui-selected {
23
+ &.${ListItemButton_1.listItemButtonClasses.selected} {
30
24
  color: ${({ theme }) => theme.palette.grey[900]};
31
25
 
32
- background-color: ${({ theme, $isGroupTitleItem }) => $isGroupTitleItem ? 'inherit' : theme.palette.primary[100]};
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, $isGroupTitleItem }) => $isGroupTitleItem ? 'inherit' : theme.palette.primary[100]};
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')} {
@@ -1,2 +1,3 @@
1
1
  export * from './Item';
2
2
  export * from './types';
3
+ export { navMenuItemButtonClassnames } from './ItemButton';
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.46.0",
3
+ "version": "4.47.1",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {
@@ -12,6 +12,7 @@
12
12
  "@emotion/styled": "^11.13.5",
13
13
  "@mui/material": "5.13.0",
14
14
  "classnames": "^2.5.1",
15
+ "class-variance-authority": "^0.7.1",
15
16
  "colord": "^2.9.3",
16
17
  "dayjs": "^1.11.5",
17
18
  "react-imask": "6.4.2",