@astral/ui 4.115.0 → 4.116.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.
@@ -1,4 +1,4 @@
1
- import { HOVER_MEDIA, selfContainedClassname } from '../constants';
1
+ import { HOVER_MEDIA, SCROLLBAR_SIZE, selfContainedClassname, } from '../constants';
2
2
  import { pdfViewerClassnames } from '../PdfViewer/constants';
3
3
  import { styled } from '../styled';
4
4
  import { PAGE_CONTENT_ANIMATION, pageContentClassnames } from './constants';
@@ -60,10 +60,16 @@ export const Content = styled.div `
60
60
 
61
61
  ${HOVER_MEDIA} {
62
62
  scrollbar-gutter: stable;
63
+
64
+ padding-right: ${({ theme }) => `calc(${theme.spacing(6)} - ${SCROLLBAR_SIZE})`};
63
65
  }
64
66
 
65
67
  &.${pageContentClassnames.contentHasHeader}, &.${pageContentClassnames.hasAside} {
66
68
  padding: ${({ theme }) => theme.spacing(4, 6, 4)};
69
+
70
+ ${HOVER_MEDIA} {
71
+ padding-right: ${({ theme }) => `calc(${theme.spacing(6)} - ${SCROLLBAR_SIZE})`};
72
+ }
67
73
  }
68
74
 
69
75
  ${({ theme }) => theme.breakpoints.down('laptop')} {
@@ -71,8 +77,16 @@ export const Content = styled.div `
71
77
  padding-bottom: ${({ theme }) => theme.spacing(3)};
72
78
  padding-left: ${({ theme }) => theme.spacing(4)};
73
79
 
80
+ ${HOVER_MEDIA} {
81
+ padding-right: ${({ theme }) => `calc(${theme.spacing(4)} - ${SCROLLBAR_SIZE})`};
82
+ }
83
+
74
84
  &.${pageContentClassnames.contentHasHeader}, &.${pageContentClassnames.hasAside} {
75
85
  padding: ${({ theme }) => theme.spacing(4, 4, 3)};
86
+
87
+ ${HOVER_MEDIA} {
88
+ padding-right: ${({ theme }) => `calc(${theme.spacing(4)} - ${SCROLLBAR_SIZE})`};
89
+ }
76
90
  }
77
91
  }
78
92
 
@@ -88,6 +102,16 @@ export const Content = styled.div `
88
102
  border: 1px solid ${({ theme }) => theme.palette.components.border.default};
89
103
  border-radius: ${({ theme }) => theme.shape.medium};
90
104
 
105
+ ${HOVER_MEDIA} {
106
+ padding-right: ${({ theme }) => theme.spacing(4)};
107
+ }
108
+
109
+ &.${pageContentClassnames.contentHasHeader}, &.${pageContentClassnames.hasAside} {
110
+ ${HOVER_MEDIA} {
111
+ padding-right: ${({ theme }) => theme.spacing(4)};
112
+ }
113
+ }
114
+
91
115
  &.${pageContentClassnames.contentHasHeader} {
92
116
  border-top-left-radius: 0;
93
117
  border-top-right-radius: 0;
@@ -1,18 +1,23 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { IconButton } from '../../../components/IconButton';
3
+ import { CheckOutlineMd } from '../../../icons/CheckOutlineMd';
4
+ import { CrossOutlineMd } from '../../../icons/CrossOutlineMd';
2
5
  import { Form } from '../../Form';
3
6
  import { FormSubmitButton } from '../../FormSubmitButton';
4
7
  import { FormTextField } from '../../FormTextField';
5
8
  import { FIELD_NAME } from '../constants';
6
- import { CancelButton, Description, FormFooter, Wrapper } from './styles';
9
+ import { FormIconSubmitButton } from '../FormIconSubmitButton';
10
+ import { Actions, Description, FieldContainer, FieldRow, FormFooter, Wrapper, } from './styles';
7
11
  import { useLogic } from './useLogic';
8
12
  // biome-ignore lint/complexity/noUselessTypeConstraint: Фикс типизация в тестах
9
13
  export const EditingForm = (props) => {
10
- const { formProps } = useLogic(props);
14
+ const { formProps, isMobile } = useLogic(props);
11
15
  const { componentField = (fieldProps) => _jsx(FormTextField, { ...fieldProps }), onClose, } = props;
12
- return (_jsx(Wrapper, { children: _jsxs(Form, { ...formProps, children: [_jsx(Description, { children: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u043E\u0432\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u00AB\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\u00BB" }), componentField?.({
13
- name: FIELD_NAME,
14
- control: formProps.form.control,
15
- fullWidth: true,
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" })] })] }) }));
16
+ const formFieldProps = {
17
+ name: FIELD_NAME,
18
+ control: formProps.form.control,
19
+ fullWidth: true,
20
+ autoFocus: true,
21
+ };
22
+ return (_jsx(Wrapper, { children: _jsxs(Form, { ...formProps, children: [_jsx(Description, { children: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u043E\u0432\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u00AB\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\u00BB" }), _jsxs(FieldRow, { children: [_jsx(FieldContainer, { children: componentField(formFieldProps) }), !isMobile && (_jsxs(Actions, { children: [_jsx(FormIconSubmitButton, { variant: "outlined", size: "large", color: "success", "aria-label": "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C", children: _jsx(CheckOutlineMd, {}) }), _jsx(IconButton, { variant: "outlined", size: "large", color: "grey", "aria-label": "\u041E\u0442\u043C\u0435\u043D\u0430", onClick: onClose, children: _jsx(CrossOutlineMd, {}) })] }))] }), isMobile && (_jsx(FormFooter, { children: _jsx(FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" }) }))] }) }));
18
23
  };
@@ -14,17 +14,19 @@ export declare const Description: import("../../../components/styled").StyledCom
14
14
  } & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
15
15
  theme?: import("@emotion/react").Theme | undefined;
16
16
  }, {}, {}>;
17
+ export declare const FieldRow: import("../../../components/styled").StyledComponent<{
18
+ theme?: import("@emotion/react").Theme | undefined;
19
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
20
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
21
+ export declare const FieldContainer: import("../../../components/styled").StyledComponent<{
22
+ theme?: import("@emotion/react").Theme | undefined;
23
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
24
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
25
+ export declare const Actions: import("../../../components/styled").StyledComponent<{
26
+ theme?: import("@emotion/react").Theme | undefined;
27
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
28
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
29
  export declare const FormFooter: import("../../../components/styled").StyledComponent<{
18
30
  theme?: import("@emotion/react").Theme | undefined;
19
31
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
20
32
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
21
- export declare const CancelButton: import("../../../components/styled").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
22
- variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
23
- loading?: boolean | undefined;
24
- color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
25
- component?: import("react").ElementType | undefined;
26
- selected?: boolean | undefined;
27
- size?: "large" | "medium" | undefined;
28
- } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
29
- theme?: import("@emotion/react").Theme | undefined;
30
- }, {}, {}>;
@@ -1,4 +1,4 @@
1
- import { Button, buttonClasses } from '../../../components/Button';
1
+ import { buttonClasses } from '../../../components/Button';
2
2
  import { styled } from '../../../components/styled';
3
3
  import { Typography } from '../../../components/Typography';
4
4
  export const Wrapper = styled.div `
@@ -16,22 +16,30 @@ export const Description = styled(Typography) `
16
16
  display: none;
17
17
  }
18
18
  `;
19
+ export const FieldRow = styled.div `
20
+ display: flex;
21
+ gap: ${({ theme }) => theme.spacing(5)};
22
+ align-items: flex-start;
23
+ `;
24
+ export const FieldContainer = styled.div `
25
+ flex: 1;
26
+
27
+ min-width: 0;
28
+ `;
29
+ export const Actions = styled.div `
30
+ display: flex;
31
+ flex-shrink: 0;
32
+ gap: ${({ theme }) => theme.spacing(2)};
33
+ `;
19
34
  export const FormFooter = styled.footer `
20
35
  display: flex;
21
36
  gap: ${({ theme }) => theme.spacing(3)};
22
37
  justify-content: end;
23
38
 
24
- ${({ theme }) => theme.breakpoints.down('mobile')} {
25
- padding-top: ${({ theme }) => theme.spacing(4)};
39
+ padding-top: ${({ theme }) => theme.spacing(4)};
26
40
 
27
- & .${buttonClasses.root} {
28
- width: 100%;
29
- height: 48px;
30
- }
31
- }
32
- `;
33
- export const CancelButton = styled(Button) `
34
- ${({ theme }) => theme.breakpoints.down('mobile')} {
35
- display: none;
41
+ & .${buttonClasses.root} {
42
+ width: 100%;
43
+ height: 48px;
36
44
  }
37
45
  `;
@@ -7,5 +7,6 @@ export declare const useLogic: <TValue>({ initialValue, children, validate, onCl
7
7
  form: import("react-hook-form").UseFormReturn<FormValues, any>;
8
8
  onSubmit: (e?: import("react").BaseSyntheticEvent<object, any, any> | undefined) => Promise<void | undefined>;
9
9
  };
10
+ isMobile: boolean;
10
11
  };
11
12
  export {};
@@ -1,4 +1,5 @@
1
1
  import { useMemo } from 'react';
2
+ import { useViewportType } from '../../../../components/useViewportType';
2
3
  import { useForm } from '../../../useForm';
3
4
  import { FIELD_NAME } from '../../constants';
4
5
  export const useLogic = ({ initialValue, children, validate, onClose, onSubmit, }) => {
@@ -45,10 +46,12 @@ export const useLogic = ({ initialValue, children, validate, onClose, onSubmit,
45
46
  return onSubmit(fieldValue);
46
47
  }
47
48
  };
49
+ const { isMobile } = useViewportType();
48
50
  return {
49
51
  formProps: {
50
52
  form,
51
53
  onSubmit: form.handleSubmit(handleSubmit),
52
54
  },
55
+ isMobile,
53
56
  };
54
57
  };
@@ -0,0 +1,3 @@
1
+ import { type IconButtonProps } from '../../../components/IconButton';
2
+ export type FormIconSubmitButtonProps = Omit<IconButtonProps, 'type'>;
3
+ export declare const FormIconSubmitButton: ({ children, loading, ...props }: FormIconSubmitButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { IconButton, } from '../../../components/IconButton';
3
+ import { useFormContext } from '../../useFormContext';
4
+ export const FormIconSubmitButton = ({ children, loading, ...props }) => {
5
+ const { formState } = useFormContext();
6
+ return (_jsx(IconButton, { type: "submit", loading: loading || formState?.isSubmitting, ...props, children: children }));
7
+ };
@@ -0,0 +1 @@
1
+ export * from './FormIconSubmitButton';
@@ -0,0 +1 @@
1
+ export * from './FormIconSubmitButton';
@@ -63,10 +63,16 @@ exports.Content = styled_1.styled.div `
63
63
 
64
64
  ${constants_1.HOVER_MEDIA} {
65
65
  scrollbar-gutter: stable;
66
+
67
+ padding-right: ${({ theme }) => `calc(${theme.spacing(6)} - ${constants_1.SCROLLBAR_SIZE})`};
66
68
  }
67
69
 
68
70
  &.${constants_3.pageContentClassnames.contentHasHeader}, &.${constants_3.pageContentClassnames.hasAside} {
69
71
  padding: ${({ theme }) => theme.spacing(4, 6, 4)};
72
+
73
+ ${constants_1.HOVER_MEDIA} {
74
+ padding-right: ${({ theme }) => `calc(${theme.spacing(6)} - ${constants_1.SCROLLBAR_SIZE})`};
75
+ }
70
76
  }
71
77
 
72
78
  ${({ theme }) => theme.breakpoints.down('laptop')} {
@@ -74,8 +80,16 @@ exports.Content = styled_1.styled.div `
74
80
  padding-bottom: ${({ theme }) => theme.spacing(3)};
75
81
  padding-left: ${({ theme }) => theme.spacing(4)};
76
82
 
83
+ ${constants_1.HOVER_MEDIA} {
84
+ padding-right: ${({ theme }) => `calc(${theme.spacing(4)} - ${constants_1.SCROLLBAR_SIZE})`};
85
+ }
86
+
77
87
  &.${constants_3.pageContentClassnames.contentHasHeader}, &.${constants_3.pageContentClassnames.hasAside} {
78
88
  padding: ${({ theme }) => theme.spacing(4, 4, 3)};
89
+
90
+ ${constants_1.HOVER_MEDIA} {
91
+ padding-right: ${({ theme }) => `calc(${theme.spacing(4)} - ${constants_1.SCROLLBAR_SIZE})`};
92
+ }
79
93
  }
80
94
  }
81
95
 
@@ -91,6 +105,16 @@ exports.Content = styled_1.styled.div `
91
105
  border: 1px solid ${({ theme }) => theme.palette.components.border.default};
92
106
  border-radius: ${({ theme }) => theme.shape.medium};
93
107
 
108
+ ${constants_1.HOVER_MEDIA} {
109
+ padding-right: ${({ theme }) => theme.spacing(4)};
110
+ }
111
+
112
+ &.${constants_3.pageContentClassnames.contentHasHeader}, &.${constants_3.pageContentClassnames.hasAside} {
113
+ ${constants_1.HOVER_MEDIA} {
114
+ padding-right: ${({ theme }) => theme.spacing(4)};
115
+ }
116
+ }
117
+
94
118
  &.${constants_3.pageContentClassnames.contentHasHeader} {
95
119
  border-top-left-radius: 0;
96
120
  border-top-right-radius: 0;
@@ -2,21 +2,26 @@
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 IconButton_1 = require("../../../components/IconButton");
6
+ const CheckOutlineMd_1 = require("../../../icons/CheckOutlineMd");
7
+ const CrossOutlineMd_1 = require("../../../icons/CrossOutlineMd");
5
8
  const Form_1 = require("../../Form");
6
9
  const FormSubmitButton_1 = require("../../FormSubmitButton");
7
10
  const FormTextField_1 = require("../../FormTextField");
8
11
  const constants_1 = require("../constants");
12
+ const FormIconSubmitButton_1 = require("../FormIconSubmitButton");
9
13
  const styles_1 = require("./styles");
10
14
  const useLogic_1 = require("./useLogic");
11
15
  // biome-ignore lint/complexity/noUselessTypeConstraint: Фикс типизация в тестах
12
16
  const EditingForm = (props) => {
13
- const { formProps } = (0, useLogic_1.useLogic)(props);
17
+ const { formProps, isMobile } = (0, useLogic_1.useLogic)(props);
14
18
  const { componentField = (fieldProps) => (0, jsx_runtime_1.jsx)(FormTextField_1.FormTextField, { ...fieldProps }), onClose, } = props;
15
- return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsxs)(Form_1.Form, { ...formProps, children: [(0, jsx_runtime_1.jsx)(styles_1.Description, { children: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u043E\u0432\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u00AB\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\u00BB" }), componentField?.({
16
- name: constants_1.FIELD_NAME,
17
- control: formProps.form.control,
18
- fullWidth: true,
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" })] })] }) }));
19
+ const formFieldProps = {
20
+ name: constants_1.FIELD_NAME,
21
+ control: formProps.form.control,
22
+ fullWidth: true,
23
+ autoFocus: true,
24
+ };
25
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsxs)(Form_1.Form, { ...formProps, children: [(0, jsx_runtime_1.jsx)(styles_1.Description, { children: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u043E\u0432\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u00AB\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C\u00BB" }), (0, jsx_runtime_1.jsxs)(styles_1.FieldRow, { children: [(0, jsx_runtime_1.jsx)(styles_1.FieldContainer, { children: componentField(formFieldProps) }), !isMobile && ((0, jsx_runtime_1.jsxs)(styles_1.Actions, { children: [(0, jsx_runtime_1.jsx)(FormIconSubmitButton_1.FormIconSubmitButton, { variant: "outlined", size: "large", color: "success", "aria-label": "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C", children: (0, jsx_runtime_1.jsx)(CheckOutlineMd_1.CheckOutlineMd, {}) }), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "outlined", size: "large", color: "grey", "aria-label": "\u041E\u0442\u043C\u0435\u043D\u0430", onClick: onClose, children: (0, jsx_runtime_1.jsx)(CrossOutlineMd_1.CrossOutlineMd, {}) })] }))] }), isMobile && ((0, jsx_runtime_1.jsx)(styles_1.FormFooter, { children: (0, jsx_runtime_1.jsx)(FormSubmitButton_1.FormSubmitButton, { children: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C" }) }))] }) }));
21
26
  };
22
27
  exports.EditingForm = EditingForm;
@@ -14,17 +14,19 @@ export declare const Description: import("@emotion/styled/dist/declarations/src/
14
14
  } & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
15
15
  theme?: import("@emotion/react").Theme | undefined;
16
16
  }, {}, {}>;
17
+ export declare const FieldRow: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
18
+ theme?: import("@emotion/react").Theme | undefined;
19
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
20
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
21
+ export declare const FieldContainer: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
22
+ theme?: import("@emotion/react").Theme | undefined;
23
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
24
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
25
+ export declare const Actions: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
26
+ theme?: import("@emotion/react").Theme | undefined;
27
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
28
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
29
  export declare const FormFooter: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
18
30
  theme?: import("@emotion/react").Theme | undefined;
19
31
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
20
32
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
21
- export declare const CancelButton: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
22
- variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
23
- loading?: boolean | undefined;
24
- color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
25
- component?: import("react").ElementType | undefined;
26
- selected?: boolean | undefined;
27
- size?: "large" | "medium" | undefined;
28
- } & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
29
- theme?: import("@emotion/react").Theme | undefined;
30
- }, {}, {}>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CancelButton = exports.FormFooter = exports.Description = exports.Wrapper = void 0;
3
+ exports.FormFooter = exports.Actions = exports.FieldContainer = exports.FieldRow = exports.Description = exports.Wrapper = void 0;
4
4
  const Button_1 = require("../../../components/Button");
5
5
  const styled_1 = require("../../../components/styled");
6
6
  const Typography_1 = require("../../../components/Typography");
@@ -19,22 +19,30 @@ exports.Description = (0, styled_1.styled)(Typography_1.Typography) `
19
19
  display: none;
20
20
  }
21
21
  `;
22
+ exports.FieldRow = styled_1.styled.div `
23
+ display: flex;
24
+ gap: ${({ theme }) => theme.spacing(5)};
25
+ align-items: flex-start;
26
+ `;
27
+ exports.FieldContainer = styled_1.styled.div `
28
+ flex: 1;
29
+
30
+ min-width: 0;
31
+ `;
32
+ exports.Actions = styled_1.styled.div `
33
+ display: flex;
34
+ flex-shrink: 0;
35
+ gap: ${({ theme }) => theme.spacing(2)};
36
+ `;
22
37
  exports.FormFooter = styled_1.styled.footer `
23
38
  display: flex;
24
39
  gap: ${({ theme }) => theme.spacing(3)};
25
40
  justify-content: end;
26
41
 
27
- ${({ theme }) => theme.breakpoints.down('mobile')} {
28
- padding-top: ${({ theme }) => theme.spacing(4)};
42
+ padding-top: ${({ theme }) => theme.spacing(4)};
29
43
 
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('mobile')} {
38
- display: none;
44
+ & .${Button_1.buttonClasses.root} {
45
+ width: 100%;
46
+ height: 48px;
39
47
  }
40
48
  `;
@@ -7,5 +7,6 @@ export declare const useLogic: <TValue>({ initialValue, children, validate, onCl
7
7
  form: import("react-hook-form").UseFormReturn<FormValues, any>;
8
8
  onSubmit: (e?: import("react").BaseSyntheticEvent<object, any, any> | undefined) => Promise<void | undefined>;
9
9
  };
10
+ isMobile: boolean;
10
11
  };
11
12
  export {};
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLogic = void 0;
4
4
  const react_1 = require("react");
5
+ const useViewportType_1 = require("../../../../components/useViewportType");
5
6
  const useForm_1 = require("../../../useForm");
6
7
  const constants_1 = require("../../constants");
7
8
  const useLogic = ({ initialValue, children, validate, onClose, onSubmit, }) => {
@@ -48,11 +49,13 @@ const useLogic = ({ initialValue, children, validate, onClose, onSubmit, }) => {
48
49
  return onSubmit(fieldValue);
49
50
  }
50
51
  };
52
+ const { isMobile } = (0, useViewportType_1.useViewportType)();
51
53
  return {
52
54
  formProps: {
53
55
  form,
54
56
  onSubmit: form.handleSubmit(handleSubmit),
55
57
  },
58
+ isMobile,
56
59
  };
57
60
  };
58
61
  exports.useLogic = useLogic;
@@ -0,0 +1,3 @@
1
+ import { type IconButtonProps } from '../../../components/IconButton';
2
+ export type FormIconSubmitButtonProps = Omit<IconButtonProps, 'type'>;
3
+ export declare const FormIconSubmitButton: ({ children, loading, ...props }: FormIconSubmitButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormIconSubmitButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const IconButton_1 = require("../../../components/IconButton");
6
+ const useFormContext_1 = require("../../useFormContext");
7
+ const FormIconSubmitButton = ({ children, loading, ...props }) => {
8
+ const { formState } = (0, useFormContext_1.useFormContext)();
9
+ return ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { type: "submit", loading: loading || formState?.isSubmitting, ...props, children: children }));
10
+ };
11
+ exports.FormIconSubmitButton = FormIconSubmitButton;
@@ -0,0 +1 @@
1
+ export * from './FormIconSubmitButton';
@@ -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("./FormIconSubmitButton"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.115.0",
3
+ "version": "4.116.0",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {