@astral/ui 4.24.2 → 4.25.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.
@@ -3,4 +3,8 @@ export const Input = styled.input `
3
3
  width: 0;
4
4
  height: 0;
5
5
  padding: 0;
6
+
7
+ &::file-selector-button {
8
+ display: none;
9
+ }
6
10
  `;
@@ -19,6 +19,7 @@ export type EditingFormProps<TValue = string> = {
19
19
  name: typeof FIELD_NAME;
20
20
  control: UseFormReturn<FormValues>['control'];
21
21
  fullWidth: boolean;
22
+ autoFocus: boolean;
22
23
  }) => ReactElement;
23
24
  /**
24
25
  * Функция валидации для редактируемого поля.
@@ -1,10 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button } from '../../../components/Button';
3
2
  import { Form } from '../../Form';
4
3
  import { FormSubmitButton } from '../../FormSubmitButton';
5
4
  import { FormTextField } from '../../FormTextField';
6
5
  import { FIELD_NAME } from '../constants';
7
- import { Description, FormFooter, Wrapper } from './styles';
6
+ import { CancelButton, Description, FormFooter, Wrapper } from './styles';
8
7
  import { useLogic } from './useLogic';
9
8
  // biome-ignore lint/complexity/noUselessTypeConstraint: Фикс типизация в тестах
10
9
  export const EditingForm = (props) => {
@@ -14,5 +13,6 @@ export const EditingForm = (props) => {
14
13
  name: FIELD_NAME,
15
14
  control: formProps.form.control,
16
15
  fullWidth: true,
17
- }), _jsxs(FormFooter, { children: [_jsx(Button, { variant: "text", onClick: onClose, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" })] })] }) }));
16
+ autoFocus: true,
17
+ }), _jsxs(FormFooter, { children: [_jsx(CancelButton, { variant: "text", onClick: onClose, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" })] })] }) }));
18
18
  };
@@ -16,3 +16,12 @@ export declare const FormFooter: import("../../../components/styled").StyledComp
16
16
  theme?: import("@emotion/react").Theme | undefined;
17
17
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
18
18
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
19
+ export declare const CancelButton: import("../../../components/styled").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
20
+ variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
21
+ loading?: boolean | undefined;
22
+ color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
23
+ component?: import("react").ElementType | undefined;
24
+ selected?: boolean | undefined;
25
+ } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
26
+ theme?: import("@emotion/react").Theme | undefined;
27
+ }, {}, {}>;
@@ -1,14 +1,37 @@
1
+ import { Button, buttonClasses } from '../../../components/Button';
1
2
  import { styled } from '../../../components/styled';
2
3
  import { Typography } from '../../../components/Typography';
3
4
  export const Wrapper = styled.div `
4
5
  width: 400px;
5
6
  padding: ${({ theme }) => theme.spacing(4)};
7
+
8
+ ${({ theme }) => theme.breakpoints.down('sm')} {
9
+ width: auto;
10
+ }
6
11
  `;
7
12
  export const Description = styled(Typography) `
8
13
  margin-bottom: ${({ theme }) => theme.spacing(3)};
14
+
15
+ ${({ theme }) => theme.breakpoints.down('sm')} {
16
+ display: none;
17
+ }
9
18
  `;
10
19
  export const FormFooter = styled.footer `
11
20
  display: flex;
12
21
  gap: ${({ theme }) => theme.spacing(3)};
13
22
  justify-content: end;
23
+
24
+ ${({ theme }) => theme.breakpoints.down('sm')} {
25
+ padding-top: ${({ theme }) => theme.spacing(4)};
26
+
27
+ & .${buttonClasses.root} {
28
+ width: 100%;
29
+ height: 48px;
30
+ }
31
+ }
32
+ `;
33
+ export const CancelButton = styled(Button) `
34
+ ${({ theme }) => theme.breakpoints.down('sm')} {
35
+ display: none;
36
+ }
14
37
  `;
@@ -14,5 +14,6 @@ export declare const useLogic: <TValue>({ isLoading, iconPosition, }: EditableTe
14
14
  open: boolean;
15
15
  onClose: () => void;
16
16
  anchorEl: import("../../../components/usePopover").AnchorType;
17
+ title: string;
17
18
  };
18
19
  };
@@ -24,6 +24,7 @@ export const useLogic = ({ isLoading, iconPosition, }) => {
24
24
  open: isOpen,
25
25
  onClose: actions.close,
26
26
  anchorEl: anchor,
27
+ title: 'Изменение данных',
27
28
  },
28
29
  };
29
30
  };
@@ -6,4 +6,8 @@ exports.Input = styled_1.styled.input `
6
6
  width: 0;
7
7
  height: 0;
8
8
  padding: 0;
9
+
10
+ &::file-selector-button {
11
+ display: none;
12
+ }
9
13
  `;
@@ -19,6 +19,7 @@ export type EditingFormProps<TValue = string> = {
19
19
  name: typeof FIELD_NAME;
20
20
  control: UseFormReturn<FormValues>['control'];
21
21
  fullWidth: boolean;
22
+ autoFocus: boolean;
22
23
  }) => ReactElement;
23
24
  /**
24
25
  * Функция валидации для редактируемого поля.
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EditingForm = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const Button_1 = require("../../../components/Button");
6
5
  const Form_1 = require("../../Form");
7
6
  const FormSubmitButton_1 = require("../../FormSubmitButton");
8
7
  const FormTextField_1 = require("../../FormTextField");
@@ -17,6 +16,7 @@ const EditingForm = (props) => {
17
16
  name: constants_1.FIELD_NAME,
18
17
  control: formProps.form.control,
19
18
  fullWidth: true,
20
- }), (0, jsx_runtime_1.jsxs)(styles_1.FormFooter, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { variant: "text", onClick: onClose, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), (0, jsx_runtime_1.jsx)(FormSubmitButton_1.FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" })] })] }) }));
19
+ autoFocus: true,
20
+ }), (0, jsx_runtime_1.jsxs)(styles_1.FormFooter, { children: [(0, jsx_runtime_1.jsx)(styles_1.CancelButton, { variant: "text", onClick: onClose, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), (0, jsx_runtime_1.jsx)(FormSubmitButton_1.FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" })] })] }) }));
21
21
  };
22
22
  exports.EditingForm = EditingForm;
@@ -16,3 +16,12 @@ export declare const FormFooter: import("@emotion/styled/dist/declarations/src/t
16
16
  theme?: import("@emotion/react").Theme | undefined;
17
17
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
18
18
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
19
+ export declare const CancelButton: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
20
+ variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
21
+ loading?: boolean | undefined;
22
+ color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
23
+ component?: import("react").ElementType | undefined;
24
+ selected?: boolean | undefined;
25
+ } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
26
+ theme?: import("@emotion/react").Theme | undefined;
27
+ }, {}, {}>;
@@ -1,17 +1,40 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FormFooter = exports.Description = exports.Wrapper = void 0;
3
+ exports.CancelButton = exports.FormFooter = exports.Description = exports.Wrapper = void 0;
4
+ const Button_1 = require("../../../components/Button");
4
5
  const styled_1 = require("../../../components/styled");
5
6
  const Typography_1 = require("../../../components/Typography");
6
7
  exports.Wrapper = styled_1.styled.div `
7
8
  width: 400px;
8
9
  padding: ${({ theme }) => theme.spacing(4)};
10
+
11
+ ${({ theme }) => theme.breakpoints.down('sm')} {
12
+ width: auto;
13
+ }
9
14
  `;
10
15
  exports.Description = (0, styled_1.styled)(Typography_1.Typography) `
11
16
  margin-bottom: ${({ theme }) => theme.spacing(3)};
17
+
18
+ ${({ theme }) => theme.breakpoints.down('sm')} {
19
+ display: none;
20
+ }
12
21
  `;
13
22
  exports.FormFooter = styled_1.styled.footer `
14
23
  display: flex;
15
24
  gap: ${({ theme }) => theme.spacing(3)};
16
25
  justify-content: end;
26
+
27
+ ${({ theme }) => theme.breakpoints.down('sm')} {
28
+ padding-top: ${({ theme }) => theme.spacing(4)};
29
+
30
+ & .${Button_1.buttonClasses.root} {
31
+ width: 100%;
32
+ height: 48px;
33
+ }
34
+ }
35
+ `;
36
+ exports.CancelButton = (0, styled_1.styled)(Button_1.Button) `
37
+ ${({ theme }) => theme.breakpoints.down('sm')} {
38
+ display: none;
39
+ }
17
40
  `;
@@ -14,5 +14,6 @@ export declare const useLogic: <TValue>({ isLoading, iconPosition, }: EditableTe
14
14
  open: boolean;
15
15
  onClose: () => void;
16
16
  anchorEl: import("../../../components/usePopover").AnchorType;
17
+ title: string;
17
18
  };
18
19
  };
@@ -27,6 +27,7 @@ const useLogic = ({ isLoading, iconPosition, }) => {
27
27
  open: isOpen,
28
28
  onClose: actions.close,
29
29
  anchorEl: anchor,
30
+ title: 'Изменение данных',
30
31
  },
31
32
  };
32
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.24.2",
3
+ "version": "4.25.1",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {