@astral/ui 4.102.0 → 4.103.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 (89) hide show
  1. package/components/Dialog/Dialog.d.ts +1 -1
  2. package/components/Dialog/Dialog.js +5 -4
  3. package/components/Dialog/styles.js +8 -0
  4. package/components/Dialog/types.d.ts +5 -0
  5. package/components/Dialog/useLogic/useLogic.d.ts +3 -3
  6. package/components/Dialog/useLogic/useLogic.js +6 -2
  7. package/components/HintPopover/styles.js +2 -1
  8. package/components/NewPopover/NewPopover.js +1 -0
  9. package/components/NewPopover/constants.d.ts +5 -0
  10. package/components/NewPopover/constants.js +6 -1
  11. package/components/NewPopover/styles.js +2 -1
  12. package/components/NewPopover/types.d.ts +1 -1
  13. package/components/NewPopover/useLogic/useLogic.d.ts +2 -2
  14. package/components/NewPopover/useLogic/useLogic.js +12 -12
  15. package/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.d.ts +7 -0
  16. package/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.js +19 -0
  17. package/components/NewPopover/useLogic/utils/getFallbackPlacements/index.d.ts +1 -0
  18. package/components/NewPopover/useLogic/utils/getFallbackPlacements/index.js +1 -0
  19. package/components/NewPopover/useLogic/utils/index.d.ts +4 -0
  20. package/components/NewPopover/useLogic/utils/index.js +4 -0
  21. package/components/Onboarding/types/step.d.ts +1 -1
  22. package/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
  23. package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.js +1 -1
  24. package/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.d.ts +1 -0
  25. package/components/Onboarding/ui/hooks/useTrackedRect/constants.d.ts +6 -0
  26. package/components/Onboarding/ui/hooks/useTrackedRect/constants.js +6 -0
  27. package/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.js +34 -12
  28. package/components/fileUploading/FileUploader/FIleList/FileList.d.ts +1 -1
  29. package/components/fileUploading/FileUploaderFile/Actions/Actions.js +2 -2
  30. package/components/fileUploading/FileUploaderFile/Actions/styles.js +7 -0
  31. package/components/fileUploading/FileUploaderFile/Actions/useLogic/useLogic.d.ts +6 -1
  32. package/components/fileUploading/FileUploaderFile/Actions/useLogic/useLogic.js +2 -1
  33. package/components/fileUploading/FileUploaderFile/FileUploaderFile.d.ts +1 -1
  34. package/components/fileUploading/PreviewFileUploader/FileList/FileList.d.ts +1 -1
  35. package/components/fileUploading/PreviewFileUploaderFile/FilePreview/FilePreview.d.ts +4 -0
  36. package/components/fileUploading/PreviewFileUploaderFile/FilePreview/FilePreview.js +1 -1
  37. package/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.d.ts +13 -51
  38. package/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.js +5 -1
  39. package/components/fileUploading/PreviewFileUploaderFile/PreviewFileUploaderFile.d.ts +4 -0
  40. package/components/fileUploading/PreviewFileUploaderFile/PreviewFileUploaderFile.js +2 -2
  41. package/components/fileUploading/hooks/useFileUploader/useFileUploader.d.ts +1 -0
  42. package/components/fileUploading/hooks/useFileUploader/useFileUploader.js +1 -0
  43. package/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts +1 -0
  44. package/hook-form/FormFilters/FormFiltersDialog/styles.d.ts +1 -0
  45. package/node/components/Dialog/Dialog.d.ts +1 -1
  46. package/node/components/Dialog/Dialog.js +5 -4
  47. package/node/components/Dialog/styles.js +8 -0
  48. package/node/components/Dialog/types.d.ts +5 -0
  49. package/node/components/Dialog/useLogic/useLogic.d.ts +3 -3
  50. package/node/components/Dialog/useLogic/useLogic.js +6 -2
  51. package/node/components/HintPopover/styles.js +2 -1
  52. package/node/components/NewPopover/NewPopover.js +1 -0
  53. package/node/components/NewPopover/constants.d.ts +5 -0
  54. package/node/components/NewPopover/constants.js +7 -2
  55. package/node/components/NewPopover/styles.js +1 -0
  56. package/node/components/NewPopover/types.d.ts +1 -1
  57. package/node/components/NewPopover/useLogic/useLogic.d.ts +2 -2
  58. package/node/components/NewPopover/useLogic/useLogic.js +15 -15
  59. package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.d.ts +7 -0
  60. package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/getFallbackPlacements.js +23 -0
  61. package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/index.d.ts +1 -0
  62. package/node/components/NewPopover/useLogic/utils/getFallbackPlacements/index.js +17 -0
  63. package/node/components/NewPopover/useLogic/utils/index.d.ts +4 -0
  64. package/node/components/NewPopover/useLogic/utils/index.js +20 -0
  65. package/node/components/Onboarding/types/step.d.ts +1 -1
  66. package/node/components/Onboarding/ui/StepStrategy/steps/HighlightStep/styles.d.ts +1 -1
  67. package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/StandaloneStep.js +1 -1
  68. package/node/components/Onboarding/ui/StepStrategy/steps/StandaloneStep/styles.d.ts +1 -0
  69. package/node/components/Onboarding/ui/hooks/useTrackedRect/constants.d.ts +6 -0
  70. package/node/components/Onboarding/ui/hooks/useTrackedRect/constants.js +9 -0
  71. package/node/components/Onboarding/ui/hooks/useTrackedRect/useTrackedRect.js +34 -12
  72. package/node/components/fileUploading/FileUploader/FIleList/FileList.d.ts +1 -1
  73. package/node/components/fileUploading/FileUploaderFile/Actions/Actions.js +2 -2
  74. package/node/components/fileUploading/FileUploaderFile/Actions/styles.js +7 -0
  75. package/node/components/fileUploading/FileUploaderFile/Actions/useLogic/useLogic.d.ts +6 -1
  76. package/node/components/fileUploading/FileUploaderFile/Actions/useLogic/useLogic.js +2 -1
  77. package/node/components/fileUploading/FileUploaderFile/FileUploaderFile.d.ts +1 -1
  78. package/node/components/fileUploading/PreviewFileUploader/FileList/FileList.d.ts +1 -1
  79. package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/FilePreview.d.ts +4 -0
  80. package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/FilePreview.js +1 -1
  81. package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.d.ts +13 -51
  82. package/node/components/fileUploading/PreviewFileUploaderFile/FilePreview/useLogic/useLogic.js +5 -1
  83. package/node/components/fileUploading/PreviewFileUploaderFile/PreviewFileUploaderFile.d.ts +4 -0
  84. package/node/components/fileUploading/PreviewFileUploaderFile/PreviewFileUploaderFile.js +2 -2
  85. package/node/components/fileUploading/hooks/useFileUploader/useFileUploader.d.ts +1 -0
  86. package/node/components/fileUploading/hooks/useFileUploader/useFileUploader.js +1 -0
  87. package/node/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts +1 -0
  88. package/node/hook-form/FormFilters/FormFiltersDialog/styles.d.ts +1 -0
  89. package/package.json +1 -1
@@ -6,5 +6,5 @@ export type FileListProps = {
6
6
  * Идентификатор файла, для которого выполняется удаление
7
7
  */
8
8
  deletingFileId?: FileId | null;
9
- } & Pick<PreviewFileUploaderFileProps, 'onDelete' | 'onRetry' | 'onView' | 'generateDownloadLink' | 'selfFiles' | 'setErrorStatusFile'>;
9
+ } & Pick<PreviewFileUploaderFileProps, 'onDelete' | 'onRetry' | 'onView' | 'generateDownloadLink' | 'selfFiles' | 'setErrorStatusFile' | 'isDisabled'>;
10
10
  export declare const FileList: ({ files, deletingFileId, ...restProps }: FileListProps) => import("react/jsx-runtime").JSX.Element;
@@ -46,6 +46,10 @@ export type FilePreviewProps = {
46
46
  * Флаг загрузки при удалении файла
47
47
  */
48
48
  isDeletingFile?: boolean;
49
+ /**
50
+ * Флаг блокировки действий
51
+ */
52
+ isDisabled?: boolean;
49
53
  /**
50
54
  * Компонент для отображения превью pdf-файлов
51
55
  */
@@ -13,6 +13,6 @@ const useLogic_1 = require("./useLogic");
13
13
  const FilePreview = (props) => {
14
14
  const { getActionsList, isImageFile, isPdfFile, isOtherFile } = (0, useLogic_1.useLogic)(props);
15
15
  const { file, fileName, fileSize, fileUrl, generateDownloadLink, isHidePersonalData, PdfViewer, } = props;
16
- return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [!isOtherFile && ((0, jsx_runtime_1.jsx)(Preview_1.Preview, { isImageFile: isImageFile, isPdfFile: isPdfFile, file: file, fileUrl: fileUrl, generateDownloadLink: generateDownloadLink, isHidePersonalData: isHidePersonalData, PdfViewer: PdfViewer })), (0, jsx_runtime_1.jsxs)(styles_1.Details, { className: constants_1.previewFileUploaderClassnames.details, "$isOtherFile": isOtherFile, children: [isOtherFile && (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h6", children: "\u0424\u0430\u0439\u043B \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D" }), (0, jsx_runtime_1.jsx)(styles_1.StyledFileInfo, { "$isOtherFile": isOtherFile, fileName: fileName, fileSize: fileSize }), (0, jsx_runtime_1.jsx)(styles_1.Actions, { children: getActionsList().map(({ type, ...action }) => ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: action.tooltip, disableInteractive: true, children: type === 'iconButton' ? ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { ...action, children: action.icon })) : ((0, jsx_runtime_1.jsx)(Button_1.Button, { ...action, children: 'title' in action ? action.title : '' })) }, action.tooltip))) })] })] }));
16
+ return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [!isOtherFile && ((0, jsx_runtime_1.jsx)(Preview_1.Preview, { isImageFile: isImageFile, isPdfFile: isPdfFile, file: file, fileUrl: fileUrl, generateDownloadLink: generateDownloadLink, isHidePersonalData: isHidePersonalData, PdfViewer: PdfViewer })), (0, jsx_runtime_1.jsxs)(styles_1.Details, { className: constants_1.previewFileUploaderClassnames.details, "$isOtherFile": isOtherFile, children: [isOtherFile && (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "h6", children: "\u0424\u0430\u0439\u043B \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D" }), (0, jsx_runtime_1.jsx)(styles_1.StyledFileInfo, { "$isOtherFile": isOtherFile, fileName: fileName, fileSize: fileSize }), (0, jsx_runtime_1.jsx)(styles_1.Actions, { children: getActionsList().map(({ type, ...action }) => ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: action.tooltip, disableInteractive: true, withoutContainer: !action.disabled, children: type === 'iconButton' ? ((0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { ...action, children: action.icon })) : ((0, jsx_runtime_1.jsx)(Button_1.Button, { ...action, children: action.title ?? '' })) }, action.tooltip))) })] })] }));
17
17
  };
18
18
  exports.FilePreview = FilePreview;
@@ -1,61 +1,23 @@
1
- /// <reference types="react" />
1
+ import { type ReactElement } from 'react';
2
+ import { type ButtonProps } from '../../../../Button';
2
3
  import { type FilePreviewProps } from '../FilePreview';
3
4
  type UseLogicParams = FilePreviewProps;
4
- export declare const useLogic: ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDelete, onView, fileType, isDeletingFile, }: UseLogicParams) => {
5
+ /**
6
+ * Действие в списке actions превью файла.
7
+ */
8
+ type FileAction = Omit<ButtonProps, 'type'> & {
9
+ type: 'button' | 'iconButton';
10
+ tooltip: string;
11
+ icon?: ReactElement;
12
+ title?: string;
13
+ };
14
+ export declare const useLogic: ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDelete, onView, fileType, isDeletingFile, isDisabled, }: UseLogicParams) => {
5
15
  isImageFile: boolean;
6
16
  isPdfFile: boolean;
7
17
  /**
8
18
  * Формат файла отличающийся от pdf и изображения
9
19
  */
10
20
  isOtherFile: boolean;
11
- getActionsList: () => {
12
- type: string;
13
- tooltip: string;
14
- title: string;
15
- variant: "light";
16
- color: "grey";
17
- icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
18
- loading: boolean | undefined;
19
- onClick: () => void;
20
- }[] | ({
21
- component: import("react").ElementType;
22
- href: string;
23
- target: string;
24
- rel: string;
25
- type: string;
26
- tooltip: string;
27
- variant: "light";
28
- color: "grey";
29
- icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
30
- } | {
31
- onClick: () => void | undefined;
32
- type: string;
33
- tooltip: string;
34
- variant: "light";
35
- color: "grey";
36
- icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
37
- } | {
38
- type: string;
39
- tooltip: string;
40
- component: "a";
41
- variant: "light";
42
- color: "grey";
43
- icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
44
- download: string;
45
- href: string;
46
- loading?: undefined;
47
- onClick?: undefined;
48
- } | {
49
- type: string;
50
- tooltip: string;
51
- variant: "light";
52
- color: "grey";
53
- icon: import("react").FunctionComponentElement<import("../../../..").SvgIconProps>;
54
- loading: boolean | undefined;
55
- onClick: () => void;
56
- component?: undefined;
57
- download?: undefined;
58
- href?: undefined;
59
- })[];
21
+ getActionsList: () => FileAction[];
60
22
  };
61
23
  export {};
@@ -11,7 +11,7 @@ const constants_1 = require("../../../constants");
11
11
  const useGenerateLocalFileURL_1 = require("../../../hooks/useGenerateLocalFileURL");
12
12
  const MimeTypeRegistry_1 = require("../../../services/MimeTypeRegistry");
13
13
  const generateAttrLinkNewTab_1 = require("../../../utils/generateAttrLinkNewTab");
14
- const useLogic = ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDelete, onView, fileType, isDeletingFile, }) => {
14
+ const useLogic = ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDelete, onView, fileType, isDeletingFile, isDisabled, }) => {
15
15
  const { generateUrl } = (0, useGenerateLocalFileURL_1.useGenerateLocalFileURL)();
16
16
  const { isMobile } = (0, useViewportType_1.useViewportType)();
17
17
  const isPdfFile = MimeTypeRegistry_1.MimeTypeRegistry.getInstance()
@@ -84,6 +84,8 @@ const useLogic = ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDel
84
84
  color: 'grey',
85
85
  icon: (0, react_1.createElement)(BinOutlineMd_1.BinOutlineMd),
86
86
  loading: isDeletingFile,
87
+ disabled: isDisabled,
88
+ 'aria-label': 'Удалить',
87
89
  onClick: handleDelete,
88
90
  },
89
91
  ];
@@ -107,6 +109,8 @@ const useLogic = ({ fileId, file, fileUrl, fileName, generateDownloadLink, onDel
107
109
  color: 'grey',
108
110
  icon: (0, react_1.createElement)(BinOutlineMd_1.BinOutlineMd),
109
111
  loading: isDeletingFile,
112
+ disabled: isDisabled,
113
+ 'aria-label': 'Удалить',
110
114
  onClick: handleDelete,
111
115
  },
112
116
  ];
@@ -27,6 +27,10 @@ export type PreviewFileUploaderFileProps = UploadFile & {
27
27
  * Флаг загрузки при удалении файла
28
28
  */
29
29
  isDeletingFile?: boolean;
30
+ /**
31
+ * Флаг блокировки действий
32
+ */
33
+ isDisabled?: boolean;
30
34
  /**
31
35
  * Компонент для отображения превью pdf-файлов
32
36
  */
@@ -8,9 +8,9 @@ const FileLoading_1 = require("./FileLoading");
8
8
  const FilePreview_1 = require("./FilePreview");
9
9
  const styles_1 = require("./styles");
10
10
  const PreviewFileUploaderFile = (props) => {
11
- const { id, name, type, file, url, size, status, generateDownloadLink, onRetry, onDelete, onView, selfFiles, setErrorStatusFile, isHidePersonalData, PdfViewer, isDeletingFile, } = props;
11
+ const { id, name, type, file, url, size, status, generateDownloadLink, onRetry, onDelete, onView, selfFiles, setErrorStatusFile, isHidePersonalData, PdfViewer, isDeletingFile, isDisabled, } = props;
12
12
  const { isLoading, isUploadError, isRestrictionError, errorMsg, progress } = status || {};
13
13
  const isError = isUploadError || isRestrictionError;
14
- return ((0, jsx_runtime_1.jsx)(Fade_1.Fade, { in: true, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$isLoading": isLoading, "$isError": isError, children: [!isLoading && !isError && ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { fileId: id, fileName: name, fileType: type, file: file, fileUrl: url, fileSize: size, generateDownloadLink: generateDownloadLink, onView: onView, onDelete: onDelete, isHidePersonalData: isHidePersonalData, PdfViewer: PdfViewer, isDeletingFile: isDeletingFile })), isLoading && ((0, jsx_runtime_1.jsx)(FileLoading_1.FileLoading, { selfFiles: selfFiles, setErrorStatusFile: setErrorStatusFile, fileId: id, fileName: name, fileSize: size, progress: progress })), isError && ((0, jsx_runtime_1.jsx)(FileError_1.FileError, { fileId: id, fileName: name, file: file, fileSize: size, errorMsg: errorMsg, isUploadError: isUploadError, onRetry: onRetry, onDelete: onDelete }))] }) }));
14
+ return ((0, jsx_runtime_1.jsx)(Fade_1.Fade, { in: true, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "$isLoading": isLoading, "$isError": isError, children: [!isLoading && !isError && ((0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { fileId: id, fileName: name, fileType: type, file: file, fileUrl: url, fileSize: size, generateDownloadLink: generateDownloadLink, onView: onView, onDelete: onDelete, isHidePersonalData: isHidePersonalData, PdfViewer: PdfViewer, isDeletingFile: isDeletingFile, isDisabled: isDisabled })), isLoading && ((0, jsx_runtime_1.jsx)(FileLoading_1.FileLoading, { selfFiles: selfFiles, setErrorStatusFile: setErrorStatusFile, fileId: id, fileName: name, fileSize: size, progress: progress })), isError && ((0, jsx_runtime_1.jsx)(FileError_1.FileError, { fileId: id, fileName: name, file: file, fileSize: size, errorMsg: errorMsg, isUploadError: isUploadError, onRetry: onRetry, onDelete: onDelete }))] }) }));
15
15
  };
16
16
  exports.PreviewFileUploaderFile = PreviewFileUploaderFile;
@@ -44,6 +44,7 @@ export declare const useFileUploader: ({ value, isDisabled, isMultiple, accept,
44
44
  className: string;
45
45
  };
46
46
  fileListProps: {
47
+ isDisabled: boolean | undefined;
47
48
  onDelete: (fileId: FileId) => void;
48
49
  onRetry: ((fileId: FileId, file: File) => void) | undefined;
49
50
  onView: ((fileId: string, file?: File | undefined, fileUrl?: string | undefined) => void) | undefined;
@@ -165,6 +165,7 @@ inputRef, notify, onChange, onUploadFile, onDeleteFile, name, isError, onView, g
165
165
  },
166
166
  },
167
167
  fileListProps: {
168
+ isDisabled,
168
169
  onDelete: handleDelete,
169
170
  onRetry: getHandlerOnRetry(),
170
171
  onView,
@@ -90,6 +90,7 @@ export declare const usePreviewFileUploader: ({ placeholderImgSrc, isHidePersona
90
90
  fileListProps: {
91
91
  isHidePersonalData: boolean | undefined;
92
92
  PdfViewer: LazyExoticComponent<(props: PdfViewerProps) => ReactElement> | ((props: PdfViewerProps) => ReactElement) | undefined;
93
+ isDisabled: boolean | undefined;
93
94
  onDelete: (fileId: string) => void;
94
95
  onRetry: ((fileId: string, file: File) => void) | undefined;
95
96
  onView: ((fileId: string, file?: File | undefined, fileUrl?: string | undefined) => void) | undefined;
@@ -12,6 +12,7 @@ export declare const StyledDialog: import("@emotion/styled/dist/declarations/src
12
12
  disableBackdropClick?: boolean | undefined;
13
13
  size?: import("../../../components/Dialog").DialogSize | undefined;
14
14
  headerContent?: import("react").ReactNode;
15
+ disableMobileDrawer?: boolean | undefined;
15
16
  } & {
16
17
  theme?: import("@emotion/react").Theme | undefined;
17
18
  }, {}, {}>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.102.0",
3
+ "version": "4.103.1",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {