@astral/ui 4.15.1 → 4.16.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/DataGrid/Head/styles.js +1 -1
  2. package/components/PageLayout/PageContent/PageContent.d.ts +2 -33
  3. package/components/PageLayout/PageContent/PageContent.js +4 -4
  4. package/components/PageLayout/PageContent/PageContentHeader/PageContentHeaderActions/PageContentHeaderActions.js +1 -1
  5. package/components/PageLayout/PageContent/PageContentHeader/styles.js +8 -0
  6. package/components/PageLayout/PageContent/constants.d.ts +1 -0
  7. package/components/PageLayout/PageContent/constants.js +1 -0
  8. package/components/PageLayout/PageContent/index.d.ts +1 -0
  9. package/components/PageLayout/PageContent/styles.js +6 -1
  10. package/components/PageLayout/PageContent/types.d.ts +33 -0
  11. package/components/PageLayout/PageContent/types.js +1 -0
  12. package/components/PageLayout/PageContent/useLogic/index.d.ts +1 -0
  13. package/components/PageLayout/PageContent/useLogic/index.js +1 -0
  14. package/components/PageLayout/PageContent/useLogic/useLogic.d.ts +7 -0
  15. package/components/PageLayout/PageContent/useLogic/useLogic.js +11 -0
  16. package/components/PageLayout/PageHeader/MobilePageActions/styles.d.ts +1 -0
  17. package/components/PageLayout/PageHeader/PageActions/MainActions/MainActions.d.ts +5 -1
  18. package/components/PageLayout/PageHeader/PageActions/MainActions/MainActions.js +2 -2
  19. package/components/PageLayout/PageHeader/PageActions/MainActions/styles.d.ts +1 -2
  20. package/components/PageLayout/PageHeader/PageActions/MainActions/styles.js +1 -1
  21. package/components/PageLayout/PageHeader/PageActions/PageActions.d.ts +8 -0
  22. package/components/PageLayout/PageHeader/PageActions/PageActions.js +3 -3
  23. package/components/PageLayout/PageHeader/PageActions/styles.d.ts +2 -3
  24. package/components/PageLayout/PageHeader/PageActions/styles.js +2 -2
  25. package/components/fileUploading/FileUploaderDropzone/PlaceholderContainer/styles.js +1 -0
  26. package/components/theme/components/MuiListItemButton.js +3 -0
  27. package/components/theme/palette/palette.js +1 -1
  28. package/hook-form/FormTreeLikeAsyncAutocomplete/index.d.ts +1 -0
  29. package/hook-form/FormTreeLikeAsyncAutocomplete/index.js +1 -1
  30. package/node/components/DataGrid/Head/styles.js +1 -1
  31. package/node/components/PageLayout/PageContent/PageContent.d.ts +2 -33
  32. package/node/components/PageLayout/PageContent/PageContent.js +3 -3
  33. package/node/components/PageLayout/PageContent/PageContentHeader/PageContentHeaderActions/PageContentHeaderActions.js +1 -1
  34. package/node/components/PageLayout/PageContent/PageContentHeader/styles.js +8 -0
  35. package/node/components/PageLayout/PageContent/constants.d.ts +1 -0
  36. package/node/components/PageLayout/PageContent/constants.js +1 -0
  37. package/node/components/PageLayout/PageContent/index.d.ts +1 -0
  38. package/node/components/PageLayout/PageContent/styles.js +6 -1
  39. package/node/components/PageLayout/PageContent/types.d.ts +33 -0
  40. package/node/components/PageLayout/PageContent/types.js +2 -0
  41. package/node/components/PageLayout/PageContent/useLogic/index.d.ts +1 -0
  42. package/node/components/PageLayout/PageContent/useLogic/index.js +17 -0
  43. package/node/components/PageLayout/PageContent/useLogic/useLogic.d.ts +7 -0
  44. package/node/components/PageLayout/PageContent/useLogic/useLogic.js +15 -0
  45. package/node/components/PageLayout/PageHeader/MobilePageActions/styles.d.ts +1 -0
  46. package/node/components/PageLayout/PageHeader/PageActions/MainActions/MainActions.d.ts +5 -1
  47. package/node/components/PageLayout/PageHeader/PageActions/MainActions/MainActions.js +2 -2
  48. package/node/components/PageLayout/PageHeader/PageActions/MainActions/styles.d.ts +1 -2
  49. package/node/components/PageLayout/PageHeader/PageActions/MainActions/styles.js +1 -1
  50. package/node/components/PageLayout/PageHeader/PageActions/PageActions.d.ts +8 -0
  51. package/node/components/PageLayout/PageHeader/PageActions/PageActions.js +3 -3
  52. package/node/components/PageLayout/PageHeader/PageActions/styles.d.ts +2 -3
  53. package/node/components/PageLayout/PageHeader/PageActions/styles.js +2 -2
  54. package/node/components/fileUploading/FileUploaderDropzone/PlaceholderContainer/styles.js +1 -0
  55. package/node/components/theme/components/MuiListItemButton.js +3 -0
  56. package/node/components/theme/palette/palette.js +1 -1
  57. package/node/hook-form/FormTreeLikeAsyncAutocomplete/index.d.ts +1 -0
  58. package/node/hook-form/FormTreeLikeAsyncAutocomplete/index.js +16 -0
  59. package/package.json +15 -1
@@ -9,7 +9,7 @@ export const Wrapper = styled('header', {
9
9
  width: fit-content;
10
10
  min-width: 100%;
11
11
 
12
- border-bottom: 2px solid ${({ theme }) => theme.palette.grey[300]};
12
+ border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
13
13
  `;
14
14
  export const CheckboxCell = styled.div `
15
15
  display: flex;
@@ -1,34 +1,3 @@
1
- import { type ReactNode, type RefObject } from 'react';
2
- import { type PageLayoutFooterProps } from '../PageLayoutFooter';
3
- export type PageContentProps = {
4
- children: ReactNode;
5
- /**
6
- * Флаг, растягивающий контейнер на 100% высоты
7
- * @deprecated Не поддерживается, контейнер всегда растянут на 100% независимо от флага
8
- */
9
- isFullHeight?: boolean;
10
- /**
11
- * Название класса, применяется к корневому компоненту
12
- */
13
- className?: string;
14
- /**
15
- * Конфигурация PageLayoutFooter
16
- * @example <PageLayout footer={{
17
- * children: 'Нижняя панель страницы',
18
- * }} />
19
- */
20
- footer?: PageLayoutFooterProps | ReactNode;
21
- /**
22
- * Если true, убирает отступы для Content
23
- */
24
- isFormPaddingDisable?: boolean;
25
- /**
26
- * Ref на скролл контейнер
27
- */
28
- scrollRef?: RefObject<HTMLDivElement>;
29
- /**
30
- * Header контентной части
31
- */
32
- header?: ReactNode;
33
- };
1
+ /// <reference types="react" />
2
+ import type { PageContentProps } from './types';
34
3
  export declare const PageContent: import("react").ForwardRefExoticComponent<PageContentProps & import("react").RefAttributes<HTMLElement>>;
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, isValidElement, useContext, } from 'react';
2
+ import { forwardRef, isValidElement } from 'react';
3
3
  import { classNames } from '../../utils';
4
- import { PageContext } from '../PageContext';
5
4
  import { PageLayoutFooter, } from '../PageLayoutFooter';
6
5
  import { pageContentClassnames } from './constants';
7
6
  import { Content, Wrapper } from './styles';
7
+ import { useLogic } from './useLogic';
8
8
  export const PageContent = forwardRef((props, forwardedRef) => {
9
- const { hasAside } = useContext(PageContext);
9
+ const { hasAside, contentClassnames } = useLogic(props);
10
10
  const { className, children, isFullHeight = true, footer, scrollRef, header, } = props;
11
- return (_jsxs(Wrapper, { className: classNames(className, pageContentClassnames.pageContent), ref: forwardedRef, "$isFullHeight": isFullHeight, "$isSeparatorShown": hasAside || Boolean(header), children: [header && header, _jsx(Content, { ref: scrollRef, className: pageContentClassnames.content, "$hasAside": hasAside || Boolean(header), children: children }), footer && !isValidElement(footer) && (_jsx(PageLayoutFooter, { ...footer })), isValidElement(footer) && footer] }));
11
+ return (_jsxs(Wrapper, { className: classNames(className, pageContentClassnames.pageContent), ref: forwardedRef, "$isFullHeight": isFullHeight, "$isSeparatorShown": hasAside || Boolean(header), children: [header && header, _jsx(Content, { ref: scrollRef, className: contentClassnames, "$hasAside": hasAside || Boolean(header), children: children }), footer && !isValidElement(footer) && (_jsx(PageLayoutFooter, { ...footer })), isValidElement(footer) && footer] }));
12
12
  });
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { PageActions } from '../../../PageHeader';
3
3
  export const PageContentHeaderActions = (props) => {
4
- return _jsx(PageActions, { size: "medium", ...props });
4
+ return _jsx(PageActions, { size: "medium", spacing: 1, ...props });
5
5
  };
@@ -8,6 +8,14 @@ export const Wrapper = styled.header `
8
8
  padding: ${({ theme }) => theme.spacing(4, 6)};
9
9
 
10
10
  border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
11
+
12
+ ${({ theme }) => theme.breakpoints.down('sm')} {
13
+ margin: ${({ theme }) => theme.spacing(0, 4)};
14
+
15
+ background-color: ${({ theme }) => theme.palette.background.default};
16
+ border-top-left-radius: ${({ theme }) => theme.shape.medium};
17
+ border-top-right-radius: ${({ theme }) => theme.shape.medium};
18
+ }
11
19
  `;
12
20
  export const TitleBlock = styled.div `
13
21
  overflow: hidden;
@@ -1,6 +1,7 @@
1
1
  export declare const pageContentClassnames: {
2
2
  pageContent: string;
3
3
  content: string;
4
+ contentHasHeader: string;
4
5
  animation: string;
5
6
  };
6
7
  export declare const PAGE_CONTENT_ANIMATION = "white-flash";
@@ -2,6 +2,7 @@ import { createUIKitClassname } from '../../utils';
2
2
  export const pageContentClassnames = {
3
3
  pageContent: createUIKitClassname('page-content'),
4
4
  content: createUIKitClassname('page-content__content'),
5
+ contentHasHeader: createUIKitClassname('page-content__content_has-header'),
5
6
  animation: createUIKitClassname('page-content_animation'),
6
7
  };
7
8
  export const PAGE_CONTENT_ANIMATION = 'white-flash';
@@ -1,3 +1,4 @@
1
1
  export * from './constants';
2
2
  export * from './PageContent';
3
3
  export * from './PageContentHeader';
4
+ export type { PageContentProps } from './types';
@@ -26,7 +26,6 @@ export const Wrapper = styled('article', {
26
26
  height: ${({ $isFullHeight }) => ($isFullHeight ? 'auto' : '100%')};
27
27
 
28
28
  border-top: none;
29
- border-radius: ${({ theme }) => theme.shape.medium};
30
29
  }
31
30
 
32
31
  @keyframes ${PAGE_CONTENT_ANIMATION} {
@@ -69,6 +68,12 @@ export const Content = styled.div `
69
68
  padding: ${({ theme }) => theme.spacing(4, 4, 3)};
70
69
 
71
70
  background-color: ${({ theme }) => theme.palette.background.default};
71
+ border-radius: ${({ theme }) => theme.shape.medium};
72
+
73
+ &.${pageContentClassnames.contentHasHeader} {
74
+ border-top-left-radius: 0;
75
+ border-top-right-radius: 0;
76
+ }
72
77
  }
73
78
 
74
79
  &:has(.${pdfViewerClassnames.document}.${pdfViewerClassnames.zoom}) {
@@ -0,0 +1,33 @@
1
+ import type { ReactNode, RefObject } from 'react';
2
+ import type { PageLayoutFooterProps } from '../PageLayoutFooter';
3
+ export type PageContentProps = {
4
+ children: ReactNode;
5
+ /**
6
+ * Флаг, растягивающий контейнер на 100% высоты
7
+ * @deprecated Не поддерживается, контейнер всегда растянут на 100% независимо от флага
8
+ */
9
+ isFullHeight?: boolean;
10
+ /**
11
+ * Название класса, применяется к корневому компоненту
12
+ */
13
+ className?: string;
14
+ /**
15
+ * Конфигурация PageLayoutFooter
16
+ * @example <PageLayout footer={{
17
+ * children: 'Нижняя панель страницы',
18
+ * }} />
19
+ */
20
+ footer?: PageLayoutFooterProps | ReactNode;
21
+ /**
22
+ * Если true, убирает отступы для Content
23
+ */
24
+ isFormPaddingDisable?: boolean;
25
+ /**
26
+ * Ref на скролл контейнер
27
+ */
28
+ scrollRef?: RefObject<HTMLDivElement>;
29
+ /**
30
+ * Header контентной части
31
+ */
32
+ header?: ReactNode;
33
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,7 @@
1
+ import type { PageContentProps } from '../types';
2
+ type UseLogicParams = PageContentProps;
3
+ export declare const useLogic: ({ header }: UseLogicParams) => {
4
+ contentClassnames: string;
5
+ hasAside: boolean;
6
+ };
7
+ export {};
@@ -0,0 +1,11 @@
1
+ import { useContext, useMemo } from 'react';
2
+ import { classNames } from '../../../utils';
3
+ import { PageContext } from '../../PageContext';
4
+ import { pageContentClassnames } from '../constants';
5
+ export const useLogic = ({ header }) => {
6
+ const { hasAside } = useContext(PageContext);
7
+ const contentClassnames = useMemo(() => classNames(pageContentClassnames.content, {
8
+ [pageContentClassnames.contentHasHeader]: Boolean(header),
9
+ }), [header]);
10
+ return { contentClassnames, hasAside };
11
+ };
@@ -53,6 +53,7 @@ export declare const StyledMainActions: import("@emotion/styled").StyledComponen
53
53
  actions?: import("../../..").MainAction<import("react").ElementType>[] | undefined;
54
54
  className?: string | undefined;
55
55
  size: "medium" | "large";
56
+ spacing?: number | undefined;
56
57
  } & {
57
58
  theme?: import("@emotion/react").Theme | undefined;
58
59
  } & {
@@ -8,6 +8,10 @@ type PageMainActionsProps<TMainActionComponent extends ElementType> = Omit<MainA
8
8
  */
9
9
  className?: string;
10
10
  size: ButtonSize;
11
+ /**
12
+ * Отступ между действиями
13
+ */
14
+ spacing?: number;
11
15
  };
12
- export declare const MainActions: <TMainActionComponent extends ElementType = ElementType>({ actions, isDisabled, className, size, }: PageMainActionsProps<TMainActionComponent>) => JSX.Element | null;
16
+ export declare const MainActions: <TMainActionComponent extends ElementType = ElementType>({ actions, isDisabled, className, size, spacing, }: PageMainActionsProps<TMainActionComponent>) => JSX.Element | null;
13
17
  export {};
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { MainActions as ActionGroupMainActions, } from '../../../../ActionGroup';
3
3
  import { Wrapper } from './styles';
4
- export const MainActions = ({ actions, isDisabled, className, size, }) => {
4
+ export const MainActions = ({ actions, isDisabled, className, size, spacing = 2, }) => {
5
5
  if (!actions || (actions && actions.length === 0)) {
6
6
  return null;
7
7
  }
8
- return (_jsx(Wrapper, { className: className, "$size": size, children: _jsx(ActionGroupMainActions, { actions: actions ?? [], isDisabled: isDisabled, size: size }) }));
8
+ return (_jsx(Wrapper, { className: className, "$spacing": spacing, children: _jsx(ActionGroupMainActions, { actions: actions ?? [], isDisabled: isDisabled, size: size }) }));
9
9
  };
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- import type { ButtonSize } from '../../../../Button';
3
2
  export declare const Wrapper: import("@emotion/styled").StyledComponent<{
4
3
  theme?: import("@emotion/react").Theme | undefined;
5
4
  as?: import("react").ElementType<any> | undefined;
6
5
  } & {
7
- $size: ButtonSize;
6
+ $spacing: number;
8
7
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -3,7 +3,7 @@ import { styled } from '../../../../styles';
3
3
  import { tooltipClassnames } from '../../../../Tooltip';
4
4
  export const Wrapper = styled.div `
5
5
  display: flex;
6
- gap: ${({ theme, $size }) => theme.spacing($size === 'large' ? 2 : 1)};
6
+ gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
7
7
 
8
8
  ${({ theme }) => theme.breakpoints.down('sm')} {
9
9
  flex-wrap: wrap;
@@ -7,6 +7,10 @@ export type PageActionsProps<TMainActionComponent extends ElementType = ElementT
7
7
  */
8
8
  isLoading?: boolean;
9
9
  size?: ButtonSize;
10
+ /**
11
+ * Отступ между действиями
12
+ */
13
+ spacing?: number;
10
14
  };
11
15
  export declare const PageActions: <TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType>(props: ActionGroupProps<TMainActionComponent, TSecondaryActionComponent> & {
12
16
  /**
@@ -14,4 +18,8 @@ export declare const PageActions: <TMainActionComponent extends ElementType = El
14
18
  */
15
19
  isLoading?: boolean | undefined;
16
20
  size?: "medium" | "large" | undefined;
21
+ /**
22
+ * Отступ между действиями
23
+ */
24
+ spacing?: number | undefined;
17
25
  } & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
@@ -7,12 +7,12 @@ import { SecondaryActions } from './SecondaryActions';
7
7
  import { SecondaryVisibleActions } from './SecondaryVisibleActions';
8
8
  import { ActionWrapper, SecondaryWrapper, Wrapper } from './styles';
9
9
  const PageActionsInner = (props, ref) => {
10
- const { secondary, secondaryVisible, main, className, isLoading, size = 'medium', } = props;
10
+ const { secondary, secondaryVisible, main, className, isLoading, size = 'medium', spacing = 2, } = props;
11
11
  const { disabledAction } = useActionsState({ main, secondary });
12
- const renderSecondaryActions = () => (_jsxs(SecondaryWrapper, { "$size": size, children: [secondaryVisible && (_jsx(SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && (_jsx(SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] }));
12
+ const renderSecondaryActions = () => (_jsxs(SecondaryWrapper, { "$spacing": spacing, children: [secondaryVisible && (_jsx(SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && (_jsx(SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] }));
13
13
  if (isLoading) {
14
14
  return (_jsx(Wrapper, { children: _jsx(PageActionSkeleton, { size: size }) }));
15
15
  }
16
- return (_jsx(Wrapper, { className: className, ref: ref, children: _jsxs(ActionWrapper, { "$size": size, children: [_jsx(MainActions, { isDisabled: disabledAction, actions: main, size: size }), renderSecondaryActions()] }) }));
16
+ return (_jsx(Wrapper, { className: className, ref: ref, children: _jsxs(ActionWrapper, { "$spacing": spacing, children: [_jsx(MainActions, { isDisabled: disabledAction, actions: main, size: size, spacing: spacing }), renderSecondaryActions()] }) }));
17
17
  };
18
18
  export const PageActions = forwardRefWithGeneric(PageActionsInner);
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { ButtonSize } from '../../../Button';
3
2
  export declare const Wrapper: import("@emotion/styled").StyledComponent<{
4
3
  theme?: import("@emotion/react").Theme | undefined;
5
4
  as?: import("react").ElementType<any> | undefined;
@@ -8,11 +7,11 @@ export declare const SecondaryWrapper: import("@emotion/styled").StyledComponent
8
7
  theme?: import("@emotion/react").Theme | undefined;
9
8
  as?: import("react").ElementType<any> | undefined;
10
9
  } & {
11
- $size: ButtonSize;
10
+ $spacing: number;
12
11
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
13
12
  export declare const ActionWrapper: import("@emotion/styled").StyledComponent<{
14
13
  theme?: import("@emotion/react").Theme | undefined;
15
14
  as?: import("react").ElementType<any> | undefined;
16
15
  } & {
17
- $size: ButtonSize;
16
+ $spacing: number;
18
17
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -12,7 +12,7 @@ export const Wrapper = styled.div `
12
12
  export const SecondaryWrapper = styled('div') `
13
13
  display: flex;
14
14
  flex-wrap: nowrap;
15
- gap: ${({ theme, $size }) => theme.spacing($size === 'large' ? 2 : 1)};
15
+ gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
16
16
 
17
17
  ${({ theme }) => theme.breakpoints.down('sm')} {
18
18
  gap: ${({ theme }) => theme.spacing(2)};
@@ -21,7 +21,7 @@ export const SecondaryWrapper = styled('div') `
21
21
  export const ActionWrapper = styled.div `
22
22
  display: flex;
23
23
  flex-direction: row-reverse;
24
- gap: ${({ theme, $size }) => theme.spacing($size === 'large' ? 2 : 1)};
24
+ gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
25
25
 
26
26
  ${({ theme }) => theme.breakpoints.down('sm')} {
27
27
  gap: ${({ theme }) => theme.spacing(2)};
@@ -3,6 +3,7 @@ export const Wrapper = styled.div `
3
3
  display: flex;
4
4
  gap: ${({ theme }) => theme.spacing(4)};
5
5
  align-items: center;
6
+ justify-content: center;
6
7
 
7
8
  ${({ theme }) => theme.breakpoints.down('sm')} {
8
9
  flex-direction: column;
@@ -7,6 +7,9 @@ export const MuiListItemButton = {
7
7
  color: theme.palette.primary[800],
8
8
  backgroundColor: theme.palette.grey[100],
9
9
  },
10
+ '&:hover': {
11
+ backgroundColor: theme.palette.background.elementHover,
12
+ },
10
13
  };
11
14
  },
12
15
  },
@@ -71,7 +71,7 @@ export const getPalette = (palette) => {
71
71
  default: '#FFFFFF',
72
72
  paper: '#FFFFFF',
73
73
  element: '#FFFFFF',
74
- elementHover: '#F9F9F9',
74
+ elementHover: '#F0F0F0',
75
75
  modalShadow: '#24242473',
76
76
  body: '#F9F9F9',
77
77
  },
@@ -0,0 +1 @@
1
+ export * from './FormTreeLikeAsyncAutocomplete';
@@ -1 +1 @@
1
- "use strict";
1
+ export * from './FormTreeLikeAsyncAutocomplete';
@@ -12,7 +12,7 @@ exports.Wrapper = (0, styles_1.styled)('header', {
12
12
  width: fit-content;
13
13
  min-width: 100%;
14
14
 
15
- border-bottom: 2px solid ${({ theme }) => theme.palette.grey[300]};
15
+ border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
16
16
  `;
17
17
  exports.CheckboxCell = styles_1.styled.div `
18
18
  display: flex;
@@ -1,34 +1,3 @@
1
- import { type ReactNode, type RefObject } from 'react';
2
- import { type PageLayoutFooterProps } from '../PageLayoutFooter';
3
- export type PageContentProps = {
4
- children: ReactNode;
5
- /**
6
- * Флаг, растягивающий контейнер на 100% высоты
7
- * @deprecated Не поддерживается, контейнер всегда растянут на 100% независимо от флага
8
- */
9
- isFullHeight?: boolean;
10
- /**
11
- * Название класса, применяется к корневому компоненту
12
- */
13
- className?: string;
14
- /**
15
- * Конфигурация PageLayoutFooter
16
- * @example <PageLayout footer={{
17
- * children: 'Нижняя панель страницы',
18
- * }} />
19
- */
20
- footer?: PageLayoutFooterProps | ReactNode;
21
- /**
22
- * Если true, убирает отступы для Content
23
- */
24
- isFormPaddingDisable?: boolean;
25
- /**
26
- * Ref на скролл контейнер
27
- */
28
- scrollRef?: RefObject<HTMLDivElement>;
29
- /**
30
- * Header контентной части
31
- */
32
- header?: ReactNode;
33
- };
1
+ /// <reference types="react" />
2
+ import type { PageContentProps } from './types';
34
3
  export declare const PageContent: import("react").ForwardRefExoticComponent<PageContentProps & import("react").RefAttributes<HTMLElement>>;
@@ -4,12 +4,12 @@ exports.PageContent = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const utils_1 = require("../../utils");
7
- const PageContext_1 = require("../PageContext");
8
7
  const PageLayoutFooter_1 = require("../PageLayoutFooter");
9
8
  const constants_1 = require("./constants");
10
9
  const styles_1 = require("./styles");
10
+ const useLogic_1 = require("./useLogic");
11
11
  exports.PageContent = (0, react_1.forwardRef)((props, forwardedRef) => {
12
- const { hasAside } = (0, react_1.useContext)(PageContext_1.PageContext);
12
+ const { hasAside, contentClassnames } = (0, useLogic_1.useLogic)(props);
13
13
  const { className, children, isFullHeight = true, footer, scrollRef, header, } = props;
14
- return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: (0, utils_1.classNames)(className, constants_1.pageContentClassnames.pageContent), ref: forwardedRef, "$isFullHeight": isFullHeight, "$isSeparatorShown": hasAside || Boolean(header), children: [header && header, (0, jsx_runtime_1.jsx)(styles_1.Content, { ref: scrollRef, className: constants_1.pageContentClassnames.content, "$hasAside": hasAside || Boolean(header), children: children }), footer && !(0, react_1.isValidElement)(footer) && ((0, jsx_runtime_1.jsx)(PageLayoutFooter_1.PageLayoutFooter, { ...footer })), (0, react_1.isValidElement)(footer) && footer] }));
14
+ return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: (0, utils_1.classNames)(className, constants_1.pageContentClassnames.pageContent), ref: forwardedRef, "$isFullHeight": isFullHeight, "$isSeparatorShown": hasAside || Boolean(header), children: [header && header, (0, jsx_runtime_1.jsx)(styles_1.Content, { ref: scrollRef, className: contentClassnames, "$hasAside": hasAside || Boolean(header), children: children }), footer && !(0, react_1.isValidElement)(footer) && ((0, jsx_runtime_1.jsx)(PageLayoutFooter_1.PageLayoutFooter, { ...footer })), (0, react_1.isValidElement)(footer) && footer] }));
15
15
  });
@@ -4,6 +4,6 @@ exports.PageContentHeaderActions = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const PageHeader_1 = require("../../../PageHeader");
6
6
  const PageContentHeaderActions = (props) => {
7
- return (0, jsx_runtime_1.jsx)(PageHeader_1.PageActions, { size: "medium", ...props });
7
+ return (0, jsx_runtime_1.jsx)(PageHeader_1.PageActions, { size: "medium", spacing: 1, ...props });
8
8
  };
9
9
  exports.PageContentHeaderActions = PageContentHeaderActions;
@@ -11,6 +11,14 @@ exports.Wrapper = styles_1.styled.header `
11
11
  padding: ${({ theme }) => theme.spacing(4, 6)};
12
12
 
13
13
  border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
14
+
15
+ ${({ theme }) => theme.breakpoints.down('sm')} {
16
+ margin: ${({ theme }) => theme.spacing(0, 4)};
17
+
18
+ background-color: ${({ theme }) => theme.palette.background.default};
19
+ border-top-left-radius: ${({ theme }) => theme.shape.medium};
20
+ border-top-right-radius: ${({ theme }) => theme.shape.medium};
21
+ }
14
22
  `;
15
23
  exports.TitleBlock = styles_1.styled.div `
16
24
  overflow: hidden;
@@ -1,6 +1,7 @@
1
1
  export declare const pageContentClassnames: {
2
2
  pageContent: string;
3
3
  content: string;
4
+ contentHasHeader: string;
4
5
  animation: string;
5
6
  };
6
7
  export declare const PAGE_CONTENT_ANIMATION = "white-flash";
@@ -5,6 +5,7 @@ const utils_1 = require("../../utils");
5
5
  exports.pageContentClassnames = {
6
6
  pageContent: (0, utils_1.createUIKitClassname)('page-content'),
7
7
  content: (0, utils_1.createUIKitClassname)('page-content__content'),
8
+ contentHasHeader: (0, utils_1.createUIKitClassname)('page-content__content_has-header'),
8
9
  animation: (0, utils_1.createUIKitClassname)('page-content_animation'),
9
10
  };
10
11
  exports.PAGE_CONTENT_ANIMATION = 'white-flash';
@@ -1,3 +1,4 @@
1
1
  export * from './constants';
2
2
  export * from './PageContent';
3
3
  export * from './PageContentHeader';
4
+ export type { PageContentProps } from './types';
@@ -29,7 +29,6 @@ exports.Wrapper = (0, styles_1.styled)('article', {
29
29
  height: ${({ $isFullHeight }) => ($isFullHeight ? 'auto' : '100%')};
30
30
 
31
31
  border-top: none;
32
- border-radius: ${({ theme }) => theme.shape.medium};
33
32
  }
34
33
 
35
34
  @keyframes ${constants_1.PAGE_CONTENT_ANIMATION} {
@@ -72,6 +71,12 @@ exports.Content = styles_1.styled.div `
72
71
  padding: ${({ theme }) => theme.spacing(4, 4, 3)};
73
72
 
74
73
  background-color: ${({ theme }) => theme.palette.background.default};
74
+ border-radius: ${({ theme }) => theme.shape.medium};
75
+
76
+ &.${constants_1.pageContentClassnames.contentHasHeader} {
77
+ border-top-left-radius: 0;
78
+ border-top-right-radius: 0;
79
+ }
75
80
  }
76
81
 
77
82
  &:has(.${PdfViewer_1.pdfViewerClassnames.document}.${PdfViewer_1.pdfViewerClassnames.zoom}) {
@@ -0,0 +1,33 @@
1
+ import type { ReactNode, RefObject } from 'react';
2
+ import type { PageLayoutFooterProps } from '../PageLayoutFooter';
3
+ export type PageContentProps = {
4
+ children: ReactNode;
5
+ /**
6
+ * Флаг, растягивающий контейнер на 100% высоты
7
+ * @deprecated Не поддерживается, контейнер всегда растянут на 100% независимо от флага
8
+ */
9
+ isFullHeight?: boolean;
10
+ /**
11
+ * Название класса, применяется к корневому компоненту
12
+ */
13
+ className?: string;
14
+ /**
15
+ * Конфигурация PageLayoutFooter
16
+ * @example <PageLayout footer={{
17
+ * children: 'Нижняя панель страницы',
18
+ * }} />
19
+ */
20
+ footer?: PageLayoutFooterProps | ReactNode;
21
+ /**
22
+ * Если true, убирает отступы для Content
23
+ */
24
+ isFormPaddingDisable?: boolean;
25
+ /**
26
+ * Ref на скролл контейнер
27
+ */
28
+ scrollRef?: RefObject<HTMLDivElement>;
29
+ /**
30
+ * Header контентной части
31
+ */
32
+ header?: ReactNode;
33
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -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("./useLogic"), exports);
@@ -0,0 +1,7 @@
1
+ import type { PageContentProps } from '../types';
2
+ type UseLogicParams = PageContentProps;
3
+ export declare const useLogic: ({ header }: UseLogicParams) => {
4
+ contentClassnames: string;
5
+ hasAside: boolean;
6
+ };
7
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLogic = void 0;
4
+ const react_1 = require("react");
5
+ const utils_1 = require("../../../utils");
6
+ const PageContext_1 = require("../../PageContext");
7
+ const constants_1 = require("../constants");
8
+ const useLogic = ({ header }) => {
9
+ const { hasAside } = (0, react_1.useContext)(PageContext_1.PageContext);
10
+ const contentClassnames = (0, react_1.useMemo)(() => (0, utils_1.classNames)(constants_1.pageContentClassnames.content, {
11
+ [constants_1.pageContentClassnames.contentHasHeader]: Boolean(header),
12
+ }), [header]);
13
+ return { contentClassnames, hasAside };
14
+ };
15
+ exports.useLogic = useLogic;
@@ -53,6 +53,7 @@ export declare const StyledMainActions: import("@emotion/styled").StyledComponen
53
53
  actions?: import("../../..").MainAction<import("react").ElementType>[] | undefined;
54
54
  className?: string | undefined;
55
55
  size: "medium" | "large";
56
+ spacing?: number | undefined;
56
57
  } & {
57
58
  theme?: import("@emotion/react").Theme | undefined;
58
59
  } & {
@@ -8,6 +8,10 @@ type PageMainActionsProps<TMainActionComponent extends ElementType> = Omit<MainA
8
8
  */
9
9
  className?: string;
10
10
  size: ButtonSize;
11
+ /**
12
+ * Отступ между действиями
13
+ */
14
+ spacing?: number;
11
15
  };
12
- export declare const MainActions: <TMainActionComponent extends ElementType = ElementType>({ actions, isDisabled, className, size, }: PageMainActionsProps<TMainActionComponent>) => JSX.Element | null;
16
+ export declare const MainActions: <TMainActionComponent extends ElementType = ElementType>({ actions, isDisabled, className, size, spacing, }: PageMainActionsProps<TMainActionComponent>) => JSX.Element | null;
13
17
  export {};
@@ -4,10 +4,10 @@ exports.MainActions = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const ActionGroup_1 = require("../../../../ActionGroup");
6
6
  const styles_1 = require("./styles");
7
- const MainActions = ({ actions, isDisabled, className, size, }) => {
7
+ const MainActions = ({ actions, isDisabled, className, size, spacing = 2, }) => {
8
8
  if (!actions || (actions && actions.length === 0)) {
9
9
  return null;
10
10
  }
11
- return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, "$size": size, children: (0, jsx_runtime_1.jsx)(ActionGroup_1.MainActions, { actions: actions ?? [], isDisabled: isDisabled, size: size }) }));
11
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, "$spacing": spacing, children: (0, jsx_runtime_1.jsx)(ActionGroup_1.MainActions, { actions: actions ?? [], isDisabled: isDisabled, size: size }) }));
12
12
  };
13
13
  exports.MainActions = MainActions;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- import type { ButtonSize } from '../../../../Button';
3
2
  export declare const Wrapper: import("@emotion/styled").StyledComponent<{
4
3
  theme?: import("@emotion/react").Theme | undefined;
5
4
  as?: import("react").ElementType<any> | undefined;
6
5
  } & {
7
- $size: ButtonSize;
6
+ $spacing: number;
8
7
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -6,7 +6,7 @@ const styles_1 = require("../../../../styles");
6
6
  const Tooltip_1 = require("../../../../Tooltip");
7
7
  exports.Wrapper = styles_1.styled.div `
8
8
  display: flex;
9
- gap: ${({ theme, $size }) => theme.spacing($size === 'large' ? 2 : 1)};
9
+ gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
10
10
 
11
11
  ${({ theme }) => theme.breakpoints.down('sm')} {
12
12
  flex-wrap: wrap;
@@ -7,6 +7,10 @@ export type PageActionsProps<TMainActionComponent extends ElementType = ElementT
7
7
  */
8
8
  isLoading?: boolean;
9
9
  size?: ButtonSize;
10
+ /**
11
+ * Отступ между действиями
12
+ */
13
+ spacing?: number;
10
14
  };
11
15
  export declare const PageActions: <TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType>(props: ActionGroupProps<TMainActionComponent, TSecondaryActionComponent> & {
12
16
  /**
@@ -14,4 +18,8 @@ export declare const PageActions: <TMainActionComponent extends ElementType = El
14
18
  */
15
19
  isLoading?: boolean | undefined;
16
20
  size?: "medium" | "large" | undefined;
21
+ /**
22
+ * Отступ между действиями
23
+ */
24
+ spacing?: number | undefined;
17
25
  } & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
@@ -10,12 +10,12 @@ const SecondaryActions_1 = require("./SecondaryActions");
10
10
  const SecondaryVisibleActions_1 = require("./SecondaryVisibleActions");
11
11
  const styles_1 = require("./styles");
12
12
  const PageActionsInner = (props, ref) => {
13
- const { secondary, secondaryVisible, main, className, isLoading, size = 'medium', } = props;
13
+ const { secondary, secondaryVisible, main, className, isLoading, size = 'medium', spacing = 2, } = props;
14
14
  const { disabledAction } = (0, ActionGroup_1.useActionsState)({ main, secondary });
15
- const renderSecondaryActions = () => ((0, jsx_runtime_1.jsxs)(styles_1.SecondaryWrapper, { "$size": size, children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(SecondaryVisibleActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && ((0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] }));
15
+ const renderSecondaryActions = () => ((0, jsx_runtime_1.jsxs)(styles_1.SecondaryWrapper, { "$spacing": spacing, children: [secondaryVisible && ((0, jsx_runtime_1.jsx)(SecondaryVisibleActions_1.SecondaryVisibleActions, { actions: secondaryVisible, size: size })), secondary && ((0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: disabledAction, actions: secondary, size: size }))] }));
16
16
  if (isLoading) {
17
17
  return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsx)(PageActionSkeleton_1.PageActionSkeleton, { size: size }) }));
18
18
  }
19
- return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, ref: ref, children: (0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { "$size": size, children: [(0, jsx_runtime_1.jsx)(MainActions_1.MainActions, { isDisabled: disabledAction, actions: main, size: size }), renderSecondaryActions()] }) }));
19
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: className, ref: ref, children: (0, jsx_runtime_1.jsxs)(styles_1.ActionWrapper, { "$spacing": spacing, children: [(0, jsx_runtime_1.jsx)(MainActions_1.MainActions, { isDisabled: disabledAction, actions: main, size: size, spacing: spacing }), renderSecondaryActions()] }) }));
20
20
  };
21
21
  exports.PageActions = (0, forwardRefWithGeneric_1.forwardRefWithGeneric)(PageActionsInner);
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { ButtonSize } from '../../../Button';
3
2
  export declare const Wrapper: import("@emotion/styled").StyledComponent<{
4
3
  theme?: import("@emotion/react").Theme | undefined;
5
4
  as?: import("react").ElementType<any> | undefined;
@@ -8,11 +7,11 @@ export declare const SecondaryWrapper: import("@emotion/styled").StyledComponent
8
7
  theme?: import("@emotion/react").Theme | undefined;
9
8
  as?: import("react").ElementType<any> | undefined;
10
9
  } & {
11
- $size: ButtonSize;
10
+ $spacing: number;
12
11
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
13
12
  export declare const ActionWrapper: import("@emotion/styled").StyledComponent<{
14
13
  theme?: import("@emotion/react").Theme | undefined;
15
14
  as?: import("react").ElementType<any> | undefined;
16
15
  } & {
17
- $size: ButtonSize;
16
+ $spacing: number;
18
17
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -15,7 +15,7 @@ exports.Wrapper = styles_1.styled.div `
15
15
  exports.SecondaryWrapper = (0, styles_1.styled)('div') `
16
16
  display: flex;
17
17
  flex-wrap: nowrap;
18
- gap: ${({ theme, $size }) => theme.spacing($size === 'large' ? 2 : 1)};
18
+ gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
19
19
 
20
20
  ${({ theme }) => theme.breakpoints.down('sm')} {
21
21
  gap: ${({ theme }) => theme.spacing(2)};
@@ -24,7 +24,7 @@ exports.SecondaryWrapper = (0, styles_1.styled)('div') `
24
24
  exports.ActionWrapper = styles_1.styled.div `
25
25
  display: flex;
26
26
  flex-direction: row-reverse;
27
- gap: ${({ theme, $size }) => theme.spacing($size === 'large' ? 2 : 1)};
27
+ gap: ${({ theme, $spacing }) => theme.spacing($spacing)};
28
28
 
29
29
  ${({ theme }) => theme.breakpoints.down('sm')} {
30
30
  gap: ${({ theme }) => theme.spacing(2)};
@@ -6,6 +6,7 @@ exports.Wrapper = styles_1.styled.div `
6
6
  display: flex;
7
7
  gap: ${({ theme }) => theme.spacing(4)};
8
8
  align-items: center;
9
+ justify-content: center;
9
10
 
10
11
  ${({ theme }) => theme.breakpoints.down('sm')} {
11
12
  flex-direction: column;
@@ -10,6 +10,9 @@ exports.MuiListItemButton = {
10
10
  color: theme.palette.primary[800],
11
11
  backgroundColor: theme.palette.grey[100],
12
12
  },
13
+ '&:hover': {
14
+ backgroundColor: theme.palette.background.elementHover,
15
+ },
13
16
  };
14
17
  },
15
18
  },
@@ -74,7 +74,7 @@ const getPalette = (palette) => {
74
74
  default: '#FFFFFF',
75
75
  paper: '#FFFFFF',
76
76
  element: '#FFFFFF',
77
- elementHover: '#F9F9F9',
77
+ elementHover: '#F0F0F0',
78
78
  modalShadow: '#24242473',
79
79
  body: '#F9F9F9',
80
80
  },
@@ -0,0 +1 @@
1
+ export * from './FormTreeLikeAsyncAutocomplete';
@@ -1 +1,17 @@
1
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("./FormTreeLikeAsyncAutocomplete"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.15.1",
3
+ "version": "4.16.1",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {
@@ -134,6 +134,20 @@
134
134
  "types": "./components/CardGridInfinite/index.d.ts",
135
135
  "default": "./components/CardGridInfinite/index.js",
136
136
  "import": "./components/CardGridInfinite/index.js"
137
+ },
138
+ "./hook-form/FormTreeLikeAsyncAutocomplete": {
139
+ "module": "./hook-form/FormTreeLikeAsyncAutocomplete/index.js",
140
+ "require": "./node/hook-form/FormTreeLikeAsyncAutocomplete/index.js",
141
+ "types": "./hook-form/FormTreeLikeAsyncAutocomplete/index.d.ts",
142
+ "default": "./hook-form/FormTreeLikeAsyncAutocomplete/index.js",
143
+ "import": "./hook-form/FormTreeLikeAsyncAutocomplete/index.js"
144
+ },
145
+ "./hook-form/FormTreeAsyncAutocomplete": {
146
+ "module": "./hook-form/FormTreeAsyncAutocomplete/index.js",
147
+ "require": "./node/hook-form/FormTreeAsyncAutocomplete/index.js",
148
+ "types": "./hook-form/FormTreeAsyncAutocomplete/index.d.ts",
149
+ "default": "./hook-form/FormTreeAsyncAutocomplete/index.js",
150
+ "import": "./hook-form/FormTreeAsyncAutocomplete/index.js"
137
151
  }
138
152
  },
139
153
  "author": "Astral.Soft",