@max-ts/components 1.1.0 → 1.1.2

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.
@@ -2,7 +2,7 @@ import { ElementType } from 'react';
2
2
  import { MainAction } from './MainActions';
3
3
  import { SecondaryAction } from './SecondaryActions';
4
4
  import { SecondaryVisibleAction } from './SecondaryVisibleActions';
5
- export type ActionGroupProps<TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType> = {
5
+ export type ActionGroupProps<TMainActionComponent extends ElementType = ElementType, TSecondaryActionComponent extends ElementType = ElementType, TSecondaryVisibleActionComponent extends ElementType = ElementType> = {
6
6
  /**
7
7
  * Основные действия
8
8
  */
@@ -14,7 +14,7 @@ export type ActionGroupProps<TMainActionComponent extends ElementType = ElementT
14
14
  /**
15
15
  * Видимые второстепенные действия
16
16
  */
17
- secondaryVisible?: SecondaryVisibleAction[];
17
+ secondaryVisible?: SecondaryVisibleAction<TSecondaryVisibleActionComponent>[];
18
18
  /**
19
19
  * Название класса, применяется к корневому компоненту
20
20
  */
@@ -25,6 +25,7 @@ type SingleAction<TMainActionComponent extends ElementType> = Omit<ButtonProps<T
25
25
  * Если true, блокирует взаимодействие с actions
26
26
  */
27
27
  isBlockingOperation?: boolean;
28
+ component?: TMainActionComponent;
28
29
  };
29
30
  type MultipleAction<TMainActionComponent extends ElementType> = Omit<DropdownButtonProps<TMainActionComponent>, 'children' | 'name' | 'component'> & {
30
31
  /**
@@ -51,6 +52,7 @@ type MultipleAction<TMainActionComponent extends ElementType> = Omit<DropdownBut
51
52
  * Текст тултипа при наведении на кнопку
52
53
  */
53
54
  note?: string;
55
+ component?: TMainActionComponent;
54
56
  };
55
57
  /** Модель основного экшена */
56
58
  export type MainAction<TMainActionComponent extends ElementType> = SingleAction<TMainActionComponent> | MultipleAction<TMainActionComponent>;
@@ -5,6 +5,7 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
5
5
  loadingPosition?: "start" | "end" | "center";
6
6
  color?: `${import('../../Button').ButtonColors}`;
7
7
  selected?: boolean;
8
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
9
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
9
10
  export declare const StyledDropdownButton: import('@emotion/styled').StyledComponent<Omit<import('../../Button').ButtonProps<import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements>>, "onClick" | "endIcon" | "selected"> & {
10
11
  name: string;
@@ -10,6 +10,7 @@ export type SecondaryAction<TSecondaryActionComponent extends ElementType> = Lis
10
10
  * Текст тултипа при наведении на элемент меню
11
11
  */
12
12
  note?: string;
13
+ component?: TSecondaryActionComponent;
13
14
  };
14
15
  export type SecondaryActionProps<TSecondaryActionComponent extends ElementType> = {
15
16
  actions: SecondaryAction<TSecondaryActionComponent>[];
@@ -1,7 +1,7 @@
1
- import { ReactNode } from 'react';
1
+ import { ElementType, ReactNode } from 'react';
2
2
  import { ButtonProps } from '../..';
3
3
  /** Модель второстепенного видимого экшена */
4
- export type SecondaryVisibleAction = Omit<ButtonProps<'button'>, 'children'> & {
4
+ export type SecondaryVisibleAction<TComponent extends ElementType> = Omit<ButtonProps<'button'>, 'children'> & {
5
5
  /** Название действия */
6
6
  name: string;
7
7
  /** Иконка */
@@ -12,9 +12,10 @@ export type SecondaryVisibleAction = Omit<ButtonProps<'button'>, 'children'> & {
12
12
  * Если true, блокирует взаимодействие с actions
13
13
  */
14
14
  isBlockingOperation?: boolean;
15
+ component?: TComponent;
15
16
  };
16
- export type MainActionProps = {
17
- actions: SecondaryVisibleAction[];
17
+ export type MainActionProps<TComponent extends ElementType> = {
18
+ actions: SecondaryVisibleAction<TComponent>[];
18
19
  size?: 'small' | 'medium' | 'large';
19
20
  };
20
- export declare const SecondaryVisibleActions: ({ actions, size }: MainActionProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const SecondaryVisibleActions: <TComponent extends ElementType = ElementType>({ actions, size, }: MainActionProps<TComponent>) => import("react/jsx-runtime").JSX.Element;
@@ -5,4 +5,5 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
5
5
  loadingPosition?: "start" | "end" | "center";
6
6
  color?: `${import('../../Button').ButtonColors}`;
7
7
  selected?: boolean;
8
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
9
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
@@ -7,6 +7,7 @@ export declare const StyledIconButton: import('@emotion/styled').StyledComponent
7
7
  loadingPosition?: "start" | "end" | "center";
8
8
  color?: `${import('..').ButtonColors}`;
9
9
  selected?: boolean;
10
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
10
11
  } & {
11
12
  loading?: boolean;
12
13
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
@@ -27,5 +27,6 @@ export type ButtonProps<RootComponent extends ElementType> = Omit<WithoutEmotion
27
27
  * Состояние кнопки - selected
28
28
  */
29
29
  selected?: boolean;
30
+ component?: RootComponent;
30
31
  };
31
32
  export declare const Button: <RootComponent extends React.ElementType = ButtonTypeMap["defaultComponent"]>(props: ButtonProps<RootComponent>) => import("react/jsx-runtime").JSX.Element;
@@ -5,4 +5,5 @@ export declare const CancelButton: import('@emotion/styled').StyledComponent<Omi
5
5
  loadingPosition?: "start" | "end" | "center";
6
6
  color?: `${import('../Button').ButtonColors}`;
7
7
  selected?: boolean;
8
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
9
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
@@ -25,6 +25,7 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
25
25
  loadingPosition?: "start" | "end" | "center";
26
26
  color?: `${import('../..').ButtonColors}`;
27
27
  selected?: boolean;
28
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
28
29
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
29
30
  $isActive: boolean;
30
31
  }, {}, {}>;
@@ -5,6 +5,7 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
5
5
  loadingPosition?: "start" | "end" | "center";
6
6
  color?: `${import('../..').ButtonColors}`;
7
7
  selected?: boolean;
8
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
9
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
9
10
  $isOutside?: boolean;
10
11
  $isToday?: boolean;
@@ -11,6 +11,7 @@ export declare const MonthButton: import('@emotion/styled').StyledComponent<Omit
11
11
  loadingPosition?: "start" | "end" | "center";
12
12
  color?: `${import('../Button').ButtonColors}`;
13
13
  selected?: boolean;
14
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
14
15
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
15
16
  export declare const StyledMonths: import('@emotion/styled').StyledComponent<import('react').HTMLAttributes<HTMLDivElement> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
16
17
  export declare const StyledMonthCaption: import('@emotion/styled').StyledComponent<{
@@ -11,4 +11,13 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
11
11
  loadingPosition?: "start" | "end" | "center";
12
12
  color?: `${import('../Button').ButtonColors}`;
13
13
  selected?: boolean;
14
- } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Omit<import('../types').WithoutEmotionSpecific<import('@mui/material').ButtonProps<"button">>, "color" | "variant">, {}, {}>;
14
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
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
+ selected?: boolean;
22
+ component?: "button" | undefined;
23
+ }, {}, {}>;
@@ -6,6 +6,7 @@ export declare const StyledIconButton: import('@emotion/styled').StyledComponent
6
6
  loadingPosition?: "start" | "end" | "center";
7
7
  color?: `${import('..').ButtonColors}`;
8
8
  selected?: boolean;
9
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
10
  } & {
10
11
  loading?: boolean;
11
12
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
@@ -14,6 +14,7 @@ export declare const StyledIconButton: import('@emotion/styled').StyledComponent
14
14
  loadingPosition?: "start" | "end" | "center";
15
15
  color?: `${import('..').ButtonColors}`;
16
16
  selected?: boolean;
17
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
17
18
  } & {
18
19
  loading?: boolean;
19
20
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
@@ -5,6 +5,7 @@ export declare const StyledButton: import('@emotion/styled').StyledComponent<Omi
5
5
  loadingPosition?: "start" | "end" | "center";
6
6
  color?: `${import('../Button').ButtonColors}`;
7
7
  selected?: boolean;
8
+ component?: import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
8
9
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & {
9
10
  collapsed?: boolean;
10
11
  }, {}, {}>;
package/lib/index.mjs CHANGED
@@ -2185,7 +2185,10 @@ const Jc = m(
2185
2185
  )
2186
2186
  ))
2187
2187
  }
2188
- ) : null, lu = ({ actions: e, size: t }) => /* @__PURE__ */ l.jsx(l.Fragment, { children: e.map((n) => {
2188
+ ) : null, lu = ({
2189
+ actions: e,
2190
+ size: t
2191
+ }) => /* @__PURE__ */ l.jsx(l.Fragment, { children: e.map((n) => {
2189
2192
  const {
2190
2193
  name: r,
2191
2194
  icon: o,
@@ -9559,7 +9562,14 @@ const Uo = ({
9559
9562
  }, [t]), /* @__PURE__ */ l.jsxs(dv, { className: Rn(a, La), children: [
9560
9563
  /* @__PURE__ */ l.jsxs(fv, { children: [
9561
9564
  /* @__PURE__ */ l.jsx(we, { title: s ? "Развернуть" : "Свернуть", children: /* @__PURE__ */ l.jsx(Ue, { variant: "text", onClick: c, children: s ? /* @__PURE__ */ l.jsx(xs, { size: 20 }) : /* @__PURE__ */ l.jsx(ws, { size: 20 }) }) }),
9562
- i && /* @__PURE__ */ l.jsx(we, { title: "Назад", children: /* @__PURE__ */ l.jsx(Ue, { ...i, variant: "text", children: /* @__PURE__ */ l.jsx(ks, { size: 20 }) }) })
9565
+ i && /* @__PURE__ */ l.jsx(we, { title: "Назад", children: /* @__PURE__ */ l.jsx(
9566
+ Ue,
9567
+ {
9568
+ ...i,
9569
+ variant: "text",
9570
+ children: /* @__PURE__ */ l.jsx(ks, { size: 20 })
9571
+ }
9572
+ ) })
9563
9573
  ] }),
9564
9574
  r && /* @__PURE__ */ l.jsx(uv, { className: "breadcrumbs", children: r }),
9565
9575
  /* @__PURE__ */ l.jsx(pv, { children: o }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@max-ts/components",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "browser": "./src/index.ts",
5
5
  "main": "./lib/index.mjs",
6
6
  "module": "./lib/index.mjs",