@max-ts/components 1.0.0 → 1.1.0

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.
@@ -19,5 +19,6 @@ export type ActionGroupProps<TMainActionComponent extends ElementType = ElementT
19
19
  * Название класса, применяется к корневому компоненту
20
20
  */
21
21
  className?: string;
22
+ size?: 'small' | 'medium' | 'large';
22
23
  };
23
24
  export declare const ActionGroup: <TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType>(props: ActionGroupProps<TMainActionComponent, TSecondaryActionComponent>) => import("react/jsx-runtime").JSX.Element;
@@ -60,6 +60,7 @@ export type MainActionsProps<TMainActionComponent extends ElementType> = {
60
60
  * Если true, основные действия будут заблокированы
61
61
  */
62
62
  isDisabled?: boolean;
63
+ size?: 'small' | 'medium' | 'large';
63
64
  };
64
- export declare const MainActions: <TMainActionComponent extends ElementType = ElementType>({ actions, isDisabled, }: MainActionsProps<TMainActionComponent>) => import("react/jsx-runtime").JSX.Element;
65
+ export declare const MainActions: <TMainActionComponent extends ElementType = ElementType>({ actions, isDisabled, size, }: MainActionsProps<TMainActionComponent>) => import("react/jsx-runtime").JSX.Element;
65
66
  export {};
@@ -4,7 +4,6 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
4
4
  loadingIndicator?: import('react').ReactNode;
5
5
  loadingPosition?: "start" | "end" | "center";
6
6
  color?: `${import('../../Button').ButtonColors}`;
7
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
7
  selected?: boolean;
9
8
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
10
9
  export declare const StyledDropdownButton: import('@emotion/styled').StyledComponent<Omit<import('../../Button').ButtonProps<import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>>, "onClick" | "endIcon" | "selected"> & {
@@ -17,5 +17,6 @@ export type SecondaryActionProps<TSecondaryActionComponent extends ElementType>
17
17
  * Если true, вторичные действия будут заблокированы
18
18
  */
19
19
  isDisabled?: boolean;
20
+ size?: 'small' | 'medium' | 'large';
20
21
  };
21
- export declare const SecondaryActions: <TSecondaryActionComponent extends ElementType = ElementType>({ actions, isDisabled, }: SecondaryActionProps<TSecondaryActionComponent>) => import("react/jsx-runtime").JSX.Element | null;
22
+ export declare const SecondaryActions: <TSecondaryActionComponent extends ElementType = ElementType>({ actions, isDisabled, size, }: SecondaryActionProps<TSecondaryActionComponent>) => import("react/jsx-runtime").JSX.Element | null;
@@ -15,5 +15,6 @@ export type SecondaryVisibleAction = Omit<ButtonProps<'button'>, 'children'> & {
15
15
  };
16
16
  export type MainActionProps = {
17
17
  actions: SecondaryVisibleAction[];
18
+ size?: 'small' | 'medium' | 'large';
18
19
  };
19
- export declare const SecondaryVisibleActions: ({ actions }: MainActionProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const SecondaryVisibleActions: ({ actions, size }: MainActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,6 +4,5 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
4
4
  loadingIndicator?: import('react').ReactNode;
5
5
  loadingPosition?: "start" | "end" | "center";
6
6
  color?: `${import('../../Button').ButtonColors}`;
7
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
7
  selected?: boolean;
9
8
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
@@ -6,7 +6,6 @@ export declare const StyledIconButton: import('@emotion/styled').StyledComponent
6
6
  loadingIndicator?: import('react').ReactNode;
7
7
  loadingPosition?: "start" | "end" | "center";
8
8
  color?: `${import('..').ButtonColors}`;
9
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
10
9
  selected?: boolean;
11
10
  } & {
12
11
  loading?: boolean;
@@ -23,10 +23,6 @@ export type ButtonProps<RootComponent extends ElementType> = Omit<WithoutEmotion
23
23
  * Цвет текста кнопки
24
24
  */
25
25
  color?: `${ButtonColors}`;
26
- /**
27
- * Тип html-элемента
28
- */
29
- component?: RootComponent;
30
26
  /**
31
27
  * Состояние кнопки - selected
32
28
  */
@@ -4,6 +4,5 @@ export declare const CancelButton: import('@emotion/styled').StyledComponent<Omi
4
4
  loadingIndicator?: import('react').ReactNode;
5
5
  loadingPosition?: "start" | "end" | "center";
6
6
  color?: `${import('../Button').ButtonColors}`;
7
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
7
  selected?: boolean;
9
8
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
@@ -4,7 +4,7 @@ export type DashboardLayoutProps = {
4
4
  };
5
5
  export declare const DashboardLayout: {
6
6
  ({ children, className, }: DashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
7
- Sidebar: ({ width, collapsedWidth, header, footer, content, groups, className, }: import('./Sidebar').SidebarProps) => import("react/jsx-runtime").JSX.Element;
7
+ Sidebar: ({ width, collapsedWidth, header, footer, content, className, }: import('./Sidebar').SidebarProps) => import("react/jsx-runtime").JSX.Element;
8
8
  Main: ({ children, className }: import('./Main').MainProps) => import("react/jsx-runtime").JSX.Element;
9
9
  };
10
10
  export declare const useDashboard: () => {
@@ -4,8 +4,7 @@ export type SidebarProps = {
4
4
  collapsedWidth?: CSSProperties['width'];
5
5
  header?: React.ReactNode;
6
6
  footer?: React.ReactNode;
7
- content?: React.ReactNode;
8
- groups?: React.ReactNode[];
7
+ content: React.ReactNode;
9
8
  className?: string;
10
9
  };
11
- export declare const Sidebar: ({ width, collapsedWidth, header, footer, content, groups, className, }: SidebarProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const Sidebar: ({ width, collapsedWidth, header, footer, content, className, }: SidebarProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,4 +5,3 @@ export declare const SidebarContainer: import('@emotion/styled').StyledComponent
5
5
  export declare const SidebarHeader: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, keyof import('react').HTMLAttributes<HTMLElement> | keyof import('react').ClassAttributes<HTMLElement>>, {}>;
6
6
  export declare const SidebarFooter: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, keyof import('react').HTMLAttributes<HTMLElement> | keyof import('react').ClassAttributes<HTMLElement>>, {}>;
7
7
  export declare const SidebarContent: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
8
- export declare const SidebarGroup: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
@@ -24,7 +24,6 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
24
24
  loadingIndicator?: import('react').ReactNode;
25
25
  loadingPosition?: "start" | "end" | "center";
26
26
  color?: `${import('../..').ButtonColors}`;
27
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
28
27
  selected?: boolean;
29
28
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
30
29
  $isActive: boolean;
@@ -4,7 +4,6 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
4
4
  loadingIndicator?: import('react').ReactNode;
5
5
  loadingPosition?: "start" | "end" | "center";
6
6
  color?: `${import('../..').ButtonColors}`;
7
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
7
  selected?: boolean;
9
8
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
10
9
  $isOutside?: boolean;
@@ -10,7 +10,6 @@ export declare const MonthButton: import('@emotion/styled').StyledComponent<Omit
10
10
  loadingIndicator?: import('react').ReactNode;
11
11
  loadingPosition?: "start" | "end" | "center";
12
12
  color?: `${import('../Button').ButtonColors}`;
13
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
14
13
  selected?: boolean;
15
14
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
16
15
  export declare const StyledMonths: import('@emotion/styled').StyledComponent<import('react').HTMLAttributes<HTMLDivElement> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
@@ -10,14 +10,5 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
10
10
  loadingIndicator?: import('react').ReactNode;
11
11
  loadingPosition?: "start" | "end" | "center";
12
12
  color?: `${import('../Button').ButtonColors}`;
13
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
14
13
  selected?: boolean;
15
- } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Omit<import('../types').WithoutEmotionSpecific<import('@mui/material').ButtonProps<"button">>, "color" | "variant"> & {
16
- variant?: `${import('../Button').ButtonVariants}`;
17
- loading?: boolean;
18
- loadingIndicator?: import('react').ReactNode;
19
- loadingPosition?: "start" | "end" | "center";
20
- color?: `${import('../Button').ButtonColors}`;
21
- component?: "button" | undefined;
22
- selected?: boolean;
23
- }, {}, {}>;
14
+ } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Omit<import('../types').WithoutEmotionSpecific<import('@mui/material').ButtonProps<"button">>, "color" | "variant">, {}, {}>;
@@ -1,50 +1,32 @@
1
1
  import { ElementType, ReactNode } from 'react';
2
- import { ActionGroupProps } from '../../ActionGroup';
3
- import { ButtonProps } from '../../Button';
4
- import { Theme } from '../../../theme';
5
- export type PageHeaderProps<TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType, TBackButtonComponent extends ElementType = ElementType> = {
2
+ import { ButtonProps } from '../..';
3
+ export type PageHeaderProps<TBackButtonComponent extends ElementType = 'button'> = {
6
4
  /**
7
5
  * Заголовок страницы
8
6
  * @example <PageHeader title="Заголовок страницы" />
9
7
  */
10
- title: ReactNode;
8
+ title: ReactNode | string;
11
9
  /**
12
10
  * Описание страницы
13
11
  * @example <PageHeader description="Описание страницы" />
14
12
  */
15
- description?: ReactNode;
16
- /**
17
- * Набор компонент, отображаемый в нижней части блока
18
- * @example <PageHeader subheader={<TextField placeholder="Поиск на странице..." size="small" />} />
19
- */
20
- subheader?: ReactNode;
13
+ subtitle?: ReactNode | string;
21
14
  /**
22
15
  * Хлебные крошки
23
16
  * @example <PageHeader breadcrumbs={
24
- * [
25
- * <Link>Первая ссылка</Link>,
26
- * <Link>Вторая ссылка</Link>,
27
- * <>Текст</>,
28
- * ]
17
+ * <Breadcrumbs>
18
+ * <Link>Первая ссылка</Link>,
19
+ * <Link>Вторая ссылка</Link>,
20
+ * <>Текст</>
21
+ * </Breadcrumbs>
29
22
  * } />
30
23
  */
31
- breadcrumbs?: ReactNode[];
24
+ breadcrumbs?: ReactNode;
32
25
  /**
33
- * Набор кнопок, видимые конфигурируются через объект main, скрытые в меню - через secondary
34
- * @example <PageHeader actions={{
35
- * main: [
36
- * {
37
- * text: 'Основное действие',
38
- * },
39
- * ],
40
- * secondary: [
41
- * {
42
- * text: 'Вспомогательное действие',
43
- * },
44
- * ]
45
- * }} />
26
+ * Набор дополнительных действий
27
+ * @example <PageHeader actions={<Button variant='link'>Перейти к счету</Button>} />
46
28
  */
47
- actions?: ActionGroupProps<TMainActionComponent, TSecondaryActionComponent>;
29
+ actions?: ReactNode;
48
30
  /**
49
31
  * Название класса, применяется к корневому компоненту
50
32
  */
@@ -58,9 +40,6 @@ export type PageHeaderProps<TMainActionComponent extends ElementType = ElementTy
58
40
  * }}
59
41
  * />
60
42
  */
61
- backButton?: Omit<ButtonProps<TBackButtonComponent>, 'children' | 'variant'> & {
62
- component?: TBackButtonComponent;
63
- theme?: Theme | undefined;
64
- };
43
+ backButton?: Omit<ButtonProps<TBackButtonComponent>, 'children' | 'variant'>;
65
44
  };
66
- export declare const Header: <TMainActionComponent extends ElementType, TSecondaryActionComponent extends ElementType, TBackButtonComponent extends ElementType>(props: PageHeaderProps<TMainActionComponent, TSecondaryActionComponent, TBackButtonComponent>) => import("react/jsx-runtime").JSX.Element;
45
+ export declare const Header: <TBackButtonComponent extends ElementType>(props: PageHeaderProps<TBackButtonComponent>) => import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ export type PageLayoutProps = {
5
5
  };
6
6
  export declare const PageLayout: {
7
7
  ({ children, className }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
8
- Header: <TMainActionComponent extends import('react').ElementType, TSecondaryActionComponent extends import('react').ElementType, TBackButtonComponent extends import('react').ElementType>(props: import('./Header').PageHeaderProps<TMainActionComponent, TSecondaryActionComponent, TBackButtonComponent>) => import("react/jsx-runtime").JSX.Element;
8
+ Header: <TBackButtonComponent extends import('react').ElementType>(props: import('./Header').PageHeaderProps<TBackButtonComponent>) => import("react/jsx-runtime").JSX.Element;
9
9
  Content: (props: import('./Content').PageContentProps) => import("react/jsx-runtime").JSX.Element;
10
10
  Footer: (props: import('./Footer').PageLayoutFooterProps) => import("react/jsx-runtime").JSX.Element;
11
11
  Aside: ({ children, className }: import('./Aside').PageAsideProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,6 @@ export declare const StyledIconButton: import('@emotion/styled').StyledComponent
5
5
  loadingIndicator?: import('react').ReactNode;
6
6
  loadingPosition?: "start" | "end" | "center";
7
7
  color?: `${import('..').ButtonColors}`;
8
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
8
  selected?: boolean;
10
9
  } & {
11
10
  loading?: boolean;
@@ -13,7 +13,6 @@ export declare const StyledIconButton: import('@emotion/styled').StyledComponent
13
13
  loadingIndicator?: import('react').ReactNode;
14
14
  loadingPosition?: "start" | "end" | "center";
15
15
  color?: `${import('..').ButtonColors}`;
16
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
17
16
  selected?: boolean;
18
17
  } & {
19
18
  loading?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { SidebarNavItem } from './types';
2
2
  export type SidebarNavProps = {
3
3
  items: SidebarNavItem[];
4
- collapsed?: boolean;
5
4
  };
6
- export declare const SidebarNav: ({ items, collapsed }: SidebarNavProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const SidebarNav: ({ items }: SidebarNavProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,6 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
4
4
  loadingIndicator?: import('react').ReactNode;
5
5
  loadingPosition?: "start" | "end" | "center";
6
6
  color?: `${import('../Button').ButtonColors}`;
7
- component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
7
  selected?: boolean;
9
8
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
10
9
  collapsed?: boolean;