@cloud-ru/ds-uikit-product-modal-predefined 1.0.8-preview-04507fc5.0 → 1.0.8
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.
- package/CHANGELOG.md +6 -0
- package/README.md +8 -12
- package/dist/cjs/components/DeleteModal/DeleteModal.d.ts +1 -1
- package/dist/cjs/components/DeleteModal/DeleteModal.js +4 -4
- package/dist/cjs/components/DeleteModal/styles.module.css +16 -0
- package/dist/cjs/components/RecallModal/RecallModal.d.ts +1 -1
- package/dist/cjs/components/RecallModal/RecallModal.js +4 -4
- package/dist/cjs/components/RecallModal/styles.module.css +16 -0
- package/dist/cjs/helperComponents/DesktopReleaseNotes/DesktopReleaseNotes.js +1 -1
- package/dist/cjs/helperComponents/DesktopReleaseNotes/styles.module.css +16 -0
- package/dist/cjs/helperComponents/InputConfirm/InputConfirm.js +2 -1
- package/dist/cjs/helperComponents/InputConfirm/styles.module.css +1 -0
- package/dist/cjs/style.css +49 -0
- package/dist/cjs/types.d.ts +1 -3
- package/dist/esm/components/DeleteModal/DeleteModal.d.ts +1 -1
- package/dist/esm/components/DeleteModal/DeleteModal.js +4 -4
- package/dist/esm/components/DeleteModal/styles.module.css +16 -0
- package/dist/esm/components/RecallModal/RecallModal.d.ts +1 -1
- package/dist/esm/components/RecallModal/RecallModal.js +4 -4
- package/dist/esm/components/RecallModal/styles.module.css +16 -0
- package/dist/esm/helperComponents/DesktopReleaseNotes/DesktopReleaseNotes.js +1 -1
- package/dist/esm/helperComponents/DesktopReleaseNotes/styles.module.css +16 -0
- package/dist/esm/helperComponents/InputConfirm/InputConfirm.js +2 -1
- package/dist/esm/helperComponents/InputConfirm/styles.module.css +1 -0
- package/dist/esm/style.css +49 -0
- package/dist/esm/types.d.ts +1 -3
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +18 -17
- package/src/components/DeleteModal/DeleteModal.tsx +4 -4
- package/src/components/DeleteModal/styles.module.scss +19 -0
- package/src/components/RecallModal/RecallModal.tsx +4 -4
- package/src/components/RecallModal/styles.module.scss +19 -0
- package/src/helperComponents/DesktopReleaseNotes/DesktopReleaseNotes.tsx +2 -0
- package/src/helperComponents/DesktopReleaseNotes/styles.module.scss +19 -0
- package/src/helperComponents/InputConfirm/InputConfirm.tsx +2 -1
- package/src/helperComponents/InputConfirm/styles.module.scss +2 -0
- package/src/types.ts +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.0.8 (2026-08-27)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **FF-8948:** truncate long confirm text in InputConfirm ([4ef9666](https://github.com/cloud-ru-tech/snack-v2/commit/4ef966639386a66c91deb6fdafe95a6cc33a012a))
|
|
11
|
+
|
|
6
12
|
## 1.0.7 (2026-08-25)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @ds/uikit-product-modal-predefined
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Пакет `@cloud-ru/ds-uikit-product-modal-predefined` предоставляет готовые product-сценарии поверх `@cloud-ru/ds-modal` и `@cloud-ru/ds-bottom-sheet`.
|
|
6
6
|
|
|
7
7
|
- **DeleteModal** — удаление объекта с опциональным подтверждением через ввод текста.
|
|
8
|
-
- **RecallModal** — отзыв действия с тем же
|
|
8
|
+
- **RecallModal** — отзыв действия с тем же подтверждением через ввод текста.
|
|
9
9
|
- **ReleaseNotes** — адаптивный release notes: модальное окно на desktop, bottom sheet на mobile; состояния `data`, `noData`, `error`.
|
|
10
10
|
|
|
11
11
|
## Установка
|
|
@@ -22,13 +22,13 @@ import { DeleteModal, RecallModal, ReleaseNotes } from '@cloud-ru/ds-uikit-produ
|
|
|
22
22
|
|
|
23
23
|
Источник: `Product UI Kit (variables)`, root node `3179:1987`.
|
|
24
24
|
|
|
25
|
-
Пакет следует Figma-first API: `
|
|
25
|
+
Пакет следует Figma-first API: `contentState` — публичная визуальная ось, поле подтверждения включается пропом `confirmText`. Legacy `@cloud-ru/uikit-product-modal-predefined` используется как источник поведения, но новый пакет не является drop-in заменой legacy API.
|
|
26
26
|
|
|
27
27
|
## DeleteModal
|
|
28
28
|
|
|
29
|
-
Готовое модальное окно удаления с
|
|
29
|
+
Готовое модальное окно удаления с опциональным подтверждением через ввод текста.
|
|
30
30
|
|
|
31
|
-
`DeleteModal` — готовый сценарий удаления объекта.
|
|
31
|
+
`DeleteModal` — готовый сценарий удаления объекта. Вариант из макета `deleteModalConfirmable` включается пропом `confirmText`: если он передан, модалка показывает поле подтверждения.
|
|
32
32
|
|
|
33
33
|
### Примеры использования
|
|
34
34
|
|
|
@@ -73,7 +73,6 @@ export function DeleteConfirmable() {
|
|
|
73
73
|
open={open}
|
|
74
74
|
onClose={() => setOpen(false)}
|
|
75
75
|
objectType='виртуальную машину'
|
|
76
|
-
confirmable
|
|
77
76
|
confirmText='vm-production-01'
|
|
78
77
|
onDelete={close => close()}
|
|
79
78
|
/>
|
|
@@ -89,9 +88,8 @@ export function DeleteConfirmable() {
|
|
|
89
88
|
| Prop | Type | Default | Description |
|
|
90
89
|
|------|------|---------|-------------|
|
|
91
90
|
| `closeOnPopstate` | `boolean` | — | Закрытие при навигации по истории |
|
|
92
|
-
| `confirmText` | `string` | — | Текст, который нужно ввести для подтверждения |
|
|
91
|
+
| `confirmText` | `string` | — | Текст, который нужно ввести для подтверждения. Если передан — модалка показывает поле подтверждения |
|
|
93
92
|
| `confirmTextVariant` | `"name"` \| `"text"` | `name` | Тип текста подтверждения |
|
|
94
|
-
| `confirmable` | `boolean` | `false` | Состояние с подтверждением через ввод текста |
|
|
95
93
|
| `content` | `ReactNode` | — | Основной текст модалки |
|
|
96
94
|
| `data-test-id` | `string` | — | |
|
|
97
95
|
| `deleting` | `boolean` | — | Состояние загрузки кнопки удаления |
|
|
@@ -110,9 +108,9 @@ export function DeleteConfirmable() {
|
|
|
110
108
|
|
|
111
109
|
## RecallModal
|
|
112
110
|
|
|
113
|
-
Готовое модальное окно отзыва действия с опциональным
|
|
111
|
+
Готовое модальное окно отзыва действия с опциональным подтверждением через ввод текста.
|
|
114
112
|
|
|
115
|
-
`RecallModal` — готовый сценарий отзыва действия.
|
|
113
|
+
`RecallModal` — готовый сценарий отзыва действия. Вариант из макета `recallModalConfirmable` включается пропом `confirmText`: если он передан, модалка показывает поле подтверждения.
|
|
116
114
|
|
|
117
115
|
### Примеры использования
|
|
118
116
|
|
|
@@ -151,7 +149,6 @@ export function RecallConfirmable() {
|
|
|
151
149
|
<RecallModal
|
|
152
150
|
open={open}
|
|
153
151
|
onClose={() => setOpen(false)}
|
|
154
|
-
confirmable
|
|
155
152
|
confirmText='recall-operation-01'
|
|
156
153
|
onRecall={close => close()}
|
|
157
154
|
/>
|
|
@@ -167,8 +164,7 @@ export function RecallConfirmable() {
|
|
|
167
164
|
| Prop | Type | Default | Description |
|
|
168
165
|
|------|------|---------|-------------|
|
|
169
166
|
| `closeOnPopstate` | `boolean` | — | Закрытие при навигации по истории |
|
|
170
|
-
| `confirmText` | `string` | — | Текст, который нужно ввести для подтверждения |
|
|
171
|
-
| `confirmable` | `boolean` | `false` | Состояние с подтверждением через ввод текста |
|
|
167
|
+
| `confirmText` | `string` | — | Текст, который нужно ввести для подтверждения. Если передан — модалка показывает поле подтверждения |
|
|
172
168
|
| `content` | `ReactNode` | — | Основной текст модалки |
|
|
173
169
|
| `data-test-id` | `string` | — | |
|
|
174
170
|
| `hideConfirmCopyButton` | `boolean` | — | Скрыть кнопку копирования текста подтверждения |
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DeleteModalProps } from '../../types';
|
|
2
|
-
export declare function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTooltip, onDelete, deleting, content,
|
|
2
|
+
export declare function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTooltip, onDelete, deleting, content, confirmText, hideConfirmCopyButton, subtitle, confirmTextVariant, ...rest }: DeleteModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,14 +14,14 @@ const helperComponents_1 = require("../../helperComponents");
|
|
|
14
14
|
const hooks_1 = require("../../hooks");
|
|
15
15
|
const locale_1 = require("../../locale");
|
|
16
16
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
17
|
-
function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTooltip, onDelete, deleting, content,
|
|
17
|
+
function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTooltip, onDelete, deleting, content, confirmText, hideConfirmCopyButton, subtitle, confirmTextVariant = constants_1.CONFIRM_TEXT_VARIANT.Name, ...rest }) {
|
|
18
18
|
const { t } = locale_1.modalPredefinedLocale.useTranslations();
|
|
19
19
|
const inputRef = (0, react_1.useRef)(null);
|
|
20
20
|
const { value, error, handleChange, reset, validate } = (0, hooks_1.useTextFieldValidation)({
|
|
21
|
-
target:
|
|
21
|
+
target: confirmText,
|
|
22
22
|
errorText: t('confirm.error'),
|
|
23
23
|
});
|
|
24
|
-
const shouldShowConfirm = Boolean(
|
|
24
|
+
const shouldShowConfirm = Boolean(confirmText);
|
|
25
25
|
const title = objectType ? t('deleteModal.title', { objectType }) : t('deleteModal.fallbackTitle');
|
|
26
26
|
const confirmPlaceholder = confirmTextVariant === constants_1.CONFIRM_TEXT_VARIANT.Text ? t('confirm.textPlaceholder') : t('confirm.namePlaceholder');
|
|
27
27
|
const handleClose = () => {
|
|
@@ -35,5 +35,5 @@ function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTo
|
|
|
35
35
|
}
|
|
36
36
|
onDelete(handleClose);
|
|
37
37
|
};
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)(modal_1.ModalCustom, { open: open, onClose: handleClose, mode: mode, closeOnPopstate: closeOnPopstate, width: modal_1.WIDTH.S, "data-test-id": constants_1.TEST_IDS.deleteModal,
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(modal_1.ModalCustom, { open: open, onClose: handleClose, mode: mode, closeOnPopstate: closeOnPopstate, width: modal_1.WIDTH.S, "data-test-id": constants_1.TEST_IDS.deleteModal, ...rest, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.safeAreaTop }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Header, { title: title, subtitle: subtitle, slotAfterTitle: titleTooltip ? (0, jsx_runtime_1.jsx)(tooltip_1.QuestionTooltip, { size: 's', tip: titleTooltip }) : undefined }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Body, { className: styles_module_scss_1.default.body, content: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, children: [content ?? t('deleteModal.content'), shouldShowConfirm && ((0, jsx_runtime_1.jsx)(helperComponents_1.InputConfirm, { ref: inputRef, confirmText: confirmText ?? '', hideConfirmCopyButton: hideConfirmCopyButton, value: value, error: error, size: 'l', copyLineAlign: 'start', confirmLabel: t('deleteModal.confirmLabel'), placeholder: confirmPlaceholder, onChange: handleChange }))] }) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.safeAreaBottom }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Footer, { children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footer, children: [(0, jsx_runtime_1.jsx)(button_1.Button, { view: button_1.VIEW.Outline, appearance: button_1.APPEARANCE.Neutral, label: t('deleteModal.cancel'), onClick: handleClose, "data-test-id": constants_1.TEST_IDS.cancelButton }), (0, jsx_runtime_1.jsx)(button_1.Button, { view: button_1.VIEW.Filled, appearance: button_1.APPEARANCE.Critical, label: t('deleteModal.approve'), loading: deleting, onClick: handleApproveClick, "data-test-id": constants_1.TEST_IDS.approveButton })] }) })] }));
|
|
39
39
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
.safeAreaTop{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
align-items:flex-start;
|
|
5
|
+
align-self:stretch;
|
|
6
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.safeAreaBottom{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
align-items:flex-start;
|
|
13
|
+
align-self:stretch;
|
|
14
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
.body{
|
|
2
18
|
min-height:auto;
|
|
3
19
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RecallModalProps } from '../../types';
|
|
2
|
-
export declare function RecallModal({ open, onClose, mode, closeOnPopstate, titleTooltip, onRecall, loading, content,
|
|
2
|
+
export declare function RecallModal({ open, onClose, mode, closeOnPopstate, titleTooltip, onRecall, loading, content, confirmText, hideConfirmCopyButton, subtitle, ...rest }: RecallModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,14 +14,14 @@ const helperComponents_1 = require("../../helperComponents");
|
|
|
14
14
|
const hooks_1 = require("../../hooks");
|
|
15
15
|
const locale_1 = require("../../locale");
|
|
16
16
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
17
|
-
function RecallModal({ open, onClose, mode, closeOnPopstate, titleTooltip, onRecall, loading, content,
|
|
17
|
+
function RecallModal({ open, onClose, mode, closeOnPopstate, titleTooltip, onRecall, loading, content, confirmText, hideConfirmCopyButton, subtitle, ...rest }) {
|
|
18
18
|
const { t } = locale_1.modalPredefinedLocale.useTranslations();
|
|
19
19
|
const inputRef = (0, react_1.useRef)(null);
|
|
20
20
|
const { value, error, handleChange, reset, validate } = (0, hooks_1.useTextFieldValidation)({
|
|
21
|
-
target:
|
|
21
|
+
target: confirmText,
|
|
22
22
|
errorText: t('confirm.error'),
|
|
23
23
|
});
|
|
24
|
-
const shouldShowConfirm = Boolean(
|
|
24
|
+
const shouldShowConfirm = Boolean(confirmText);
|
|
25
25
|
const handleClose = () => {
|
|
26
26
|
reset();
|
|
27
27
|
onClose();
|
|
@@ -33,5 +33,5 @@ function RecallModal({ open, onClose, mode, closeOnPopstate, titleTooltip, onRec
|
|
|
33
33
|
}
|
|
34
34
|
onRecall(handleClose);
|
|
35
35
|
};
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(modal_1.ModalCustom, { open: open, onClose: handleClose, mode: mode, closeOnPopstate: closeOnPopstate, width: modal_1.WIDTH.S, "data-test-id": constants_1.TEST_IDS.recallModal,
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(modal_1.ModalCustom, { open: open, onClose: handleClose, mode: mode, closeOnPopstate: closeOnPopstate, width: modal_1.WIDTH.S, "data-test-id": constants_1.TEST_IDS.recallModal, ...rest, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.safeAreaTop }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Header, { title: t('recallModal.title'), subtitle: subtitle, slotAfterTitle: titleTooltip ? (0, jsx_runtime_1.jsx)(tooltip_1.QuestionTooltip, { size: 's', tip: titleTooltip }) : undefined }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Body, { className: styles_module_scss_1.default.body, content: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, children: [content ?? t('recallModal.content'), shouldShowConfirm && ((0, jsx_runtime_1.jsx)(helperComponents_1.InputConfirm, { ref: inputRef, confirmText: confirmText ?? '', confirmLabel: t('recallModal.confirmLabel'), hideConfirmCopyButton: hideConfirmCopyButton, value: value, error: error, size: 'l', copyLineAlign: 'start', placeholder: t('confirm.namePlaceholder'), onChange: handleChange }))] }) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.safeAreaBottom }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Footer, { children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footer, children: [(0, jsx_runtime_1.jsx)(button_1.Button, { view: button_1.VIEW.Outline, appearance: button_1.APPEARANCE.Neutral, label: t('recallModal.cancel'), onClick: handleClose, "data-test-id": constants_1.TEST_IDS.cancelButton }), (0, jsx_runtime_1.jsx)(button_1.Button, { view: button_1.VIEW.Filled, appearance: button_1.APPEARANCE.Critical, label: t('recallModal.approve'), loading: loading, onClick: handleApproveClick, "data-test-id": constants_1.TEST_IDS.approveButton })] }) })] }));
|
|
37
37
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
.safeAreaTop{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
align-items:flex-start;
|
|
5
|
+
align-self:stretch;
|
|
6
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.safeAreaBottom{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
align-items:flex-start;
|
|
13
|
+
align-self:stretch;
|
|
14
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
.body{
|
|
2
18
|
min-height:auto;
|
|
3
19
|
}
|
|
@@ -17,5 +17,5 @@ function DesktopReleaseNotes({ open, onClose, closeOnPopstate, contentState = co
|
|
|
17
17
|
const { t } = locale_1.modalPredefinedLocale.useTranslations();
|
|
18
18
|
const { pageIndex, readablePageNumber, setPage, handleClose, handleReadLaterClick, handleNextPageClick, handlePrevPageClick, } = (0, hooks_1.useReleaseNotesNavigation)({ onClose, onReadLaterClick, onSlideChange });
|
|
19
19
|
const shouldShowFooter = contentState === constants_1.CONTENT_STATE.Data && (loading || items.length > 0);
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)(modal_1.ModalCustom, { open: open, onClose: handleClose, closeOnPopstate: closeOnPopstate, width: modal_1.WIDTH.M, "data-content-state": contentState, "data-surface": 'modal', ...(0, utils_1.extractSupportProps)(rest), children: [(0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Header, { title: t('releaseNotes.title') }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Body, { className: styles_module_scss_1.default.body, content: (0, jsx_runtime_1.jsx)(ReleaseNotesContent_1.ReleaseNotesContent, { contentState: contentState, items: items, loading: loading, pageIndex: pageIndex, surface: 'modal', noDataTitle: t('releaseNotes.noDataTitle'), noDataDescription: t('releaseNotes.noDataDescription'), errorTitle: t('releaseNotes.errorTitle'), errorDescription: t('releaseNotes.errorDescription'), retryLabel: t('releaseNotes.retry'), onPageChange: setPage, onDataErrorRetryClick: onDataErrorRetryClick }) }), shouldShowFooter && ((0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Footer, { children: (0, jsx_runtime_1.jsx)(ReleaseNotesFooter_1.ReleaseNotesFooter, { surface: 'modal', total: items.length, pageIndex: pageIndex, readablePageNumber: readablePageNumber, counterLabel: t('releaseNotes.counter', { page: readablePageNumber, total: items.length }), readLaterLabel: t('releaseNotes.readLater'), onReadLaterClick: handleReadLaterClick, onPrevPageClick: handlePrevPageClick, onNextPageClick: () => handleNextPageClick(items.length) }) }))] }));
|
|
20
|
+
return ((0, jsx_runtime_1.jsxs)(modal_1.ModalCustom, { open: open, onClose: handleClose, closeOnPopstate: closeOnPopstate, width: modal_1.WIDTH.M, "data-content-state": contentState, "data-surface": 'modal', ...(0, utils_1.extractSupportProps)(rest), children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.safeAreaTop }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Header, { title: t('releaseNotes.title') }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Body, { className: styles_module_scss_1.default.body, content: (0, jsx_runtime_1.jsx)(ReleaseNotesContent_1.ReleaseNotesContent, { contentState: contentState, items: items, loading: loading, pageIndex: pageIndex, surface: 'modal', noDataTitle: t('releaseNotes.noDataTitle'), noDataDescription: t('releaseNotes.noDataDescription'), errorTitle: t('releaseNotes.errorTitle'), errorDescription: t('releaseNotes.errorDescription'), retryLabel: t('releaseNotes.retry'), onPageChange: setPage, onDataErrorRetryClick: onDataErrorRetryClick }) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.safeAreaBottom }), shouldShowFooter && ((0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Footer, { children: (0, jsx_runtime_1.jsx)(ReleaseNotesFooter_1.ReleaseNotesFooter, { surface: 'modal', total: items.length, pageIndex: pageIndex, readablePageNumber: readablePageNumber, counterLabel: t('releaseNotes.counter', { page: readablePageNumber, total: items.length }), readLaterLabel: t('releaseNotes.readLater'), onReadLaterClick: handleReadLaterClick, onPrevPageClick: handlePrevPageClick, onNextPageClick: () => handleNextPageClick(items.length) }) }))] }));
|
|
21
21
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
.safeAreaTop{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
align-items:flex-start;
|
|
5
|
+
align-self:stretch;
|
|
6
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.safeAreaBottom{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
align-items:flex-start;
|
|
13
|
+
align-self:stretch;
|
|
14
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
.body{
|
|
2
18
|
min-height:calc(6 * var(--sn-primitive-dimension-64, 64px));
|
|
3
19
|
}
|
|
@@ -6,10 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.InputConfirm = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const fields_1 = require("@cloud-ru/ds-fields");
|
|
9
|
+
const truncate_string_1 = require("@cloud-ru/ds-truncate-string");
|
|
9
10
|
const uikit_product_copy_1 = require("@cloud-ru/ds-uikit-product-copy");
|
|
10
11
|
const react_1 = require("react");
|
|
11
12
|
const constants_1 = require("../../constants");
|
|
12
13
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
13
14
|
exports.InputConfirm = (0, react_1.forwardRef)(function InputConfirm({ confirmText, confirmLabel, hideConfirmCopyButton, value, error, label, size = 'm', copyLineAlign = 'space-between', placeholder, onChange, ...rest }, ref) {
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.root, children: [confirmLabel && (0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.confirmLabel, children: confirmLabel }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.confirmText, "data-align": copyLineAlign, children: [(0, jsx_runtime_1.jsx)(
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.root, children: [confirmLabel && (0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.confirmLabel, children: confirmLabel }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.confirmText, "data-align": copyLineAlign, children: [(0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { className: styles_module_scss_1.default.confirmValue, variant: 'middle', text: confirmText }), !hideConfirmCopyButton && (0, jsx_runtime_1.jsx)(uikit_product_copy_1.CopyButton, { valueToCopy: confirmText, "data-test-id": constants_1.TEST_IDS.confirmCopyButton })] }), (0, jsx_runtime_1.jsx)(fields_1.FieldCombo, { ...rest, ref: ref, inputMode: 'text', label: label, required: Boolean(label), size: size, placeholder: placeholder, value: value, onChange: onChange, hint: error, validationState: error ? fields_1.VALIDATION_STATE.Error : fields_1.VALIDATION_STATE.Default, "data-test-id": constants_1.TEST_IDS.confirmInput })] }));
|
|
15
16
|
});
|
|
@@ -35,4 +35,5 @@
|
|
|
35
35
|
font-size:var(--sn-regular-body-m-fontSize, var(--sn-density-typography-roleBody-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px)));
|
|
36
36
|
letter-spacing:var(--sn-regular-body-m-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
|
|
37
37
|
paragraph-spacing:var(--sn-regular-body-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
|
|
38
|
+
min-width:0;
|
|
38
39
|
}
|
package/dist/cjs/style.css
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
.safeAreaTop{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
align-items:flex-start;
|
|
5
|
+
align-self:stretch;
|
|
6
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.safeAreaBottom{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
align-items:flex-start;
|
|
13
|
+
align-self:stretch;
|
|
14
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
.body{
|
|
2
18
|
min-height:auto;
|
|
3
19
|
}
|
|
@@ -15,6 +31,22 @@
|
|
|
15
31
|
justify-content:flex-end;
|
|
16
32
|
width:100%;
|
|
17
33
|
}
|
|
34
|
+
.safeAreaTop{
|
|
35
|
+
display:flex;
|
|
36
|
+
flex-direction:column;
|
|
37
|
+
align-items:flex-start;
|
|
38
|
+
align-self:stretch;
|
|
39
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.safeAreaBottom{
|
|
43
|
+
display:flex;
|
|
44
|
+
flex-direction:column;
|
|
45
|
+
align-items:flex-start;
|
|
46
|
+
align-self:stretch;
|
|
47
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
48
|
+
}
|
|
49
|
+
|
|
18
50
|
.body{
|
|
19
51
|
min-height:auto;
|
|
20
52
|
}
|
|
@@ -32,6 +64,22 @@
|
|
|
32
64
|
justify-content:flex-end;
|
|
33
65
|
width:100%;
|
|
34
66
|
}
|
|
67
|
+
.safeAreaTop{
|
|
68
|
+
display:flex;
|
|
69
|
+
flex-direction:column;
|
|
70
|
+
align-items:flex-start;
|
|
71
|
+
align-self:stretch;
|
|
72
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.safeAreaBottom{
|
|
76
|
+
display:flex;
|
|
77
|
+
flex-direction:column;
|
|
78
|
+
align-items:flex-start;
|
|
79
|
+
align-self:stretch;
|
|
80
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
81
|
+
}
|
|
82
|
+
|
|
35
83
|
.body{
|
|
36
84
|
min-height:calc(6 * var(--sn-primitive-dimension-64, 64px));
|
|
37
85
|
}
|
|
@@ -72,6 +120,7 @@
|
|
|
72
120
|
font-size:var(--sn-regular-body-m-fontSize, var(--sn-density-typography-roleBody-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px)));
|
|
73
121
|
letter-spacing:var(--sn-regular-body-m-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
|
|
74
122
|
paragraph-spacing:var(--sn-regular-body-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
|
|
123
|
+
min-width:0;
|
|
75
124
|
}
|
|
76
125
|
.root{
|
|
77
126
|
display:grid;
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -21,9 +21,7 @@ export type NoteItemProps = {
|
|
|
21
21
|
type BaseActionModalProps = Pick<ModalCustomProps, 'open' | 'onClose' | 'mode' | 'closeOnPopstate'> & {
|
|
22
22
|
/** Подсказка рядом с заголовком */
|
|
23
23
|
titleTooltip?: ReactNode;
|
|
24
|
-
/**
|
|
25
|
-
confirmable?: boolean;
|
|
26
|
-
/** Текст, который нужно ввести для подтверждения */
|
|
24
|
+
/** Текст, который нужно ввести для подтверждения. Если передан — модалка показывает поле подтверждения */
|
|
27
25
|
confirmText?: string;
|
|
28
26
|
/** Скрыть кнопку копирования текста подтверждения */
|
|
29
27
|
hideConfirmCopyButton?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DeleteModalProps } from '../../types.js';
|
|
2
|
-
export declare function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTooltip, onDelete, deleting, content,
|
|
2
|
+
export declare function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTooltip, onDelete, deleting, content, confirmText, hideConfirmCopyButton, subtitle, confirmTextVariant, ...rest }: DeleteModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,14 +8,14 @@ import { InputConfirm } from '../../helperComponents/index.js';
|
|
|
8
8
|
import { useTextFieldValidation } from '../../hooks.js';
|
|
9
9
|
import { modalPredefinedLocale } from '../../locale/index.js';
|
|
10
10
|
import styles from './styles.module.css';
|
|
11
|
-
export function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTooltip, onDelete, deleting, content,
|
|
11
|
+
export function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType, titleTooltip, onDelete, deleting, content, confirmText, hideConfirmCopyButton, subtitle, confirmTextVariant = CONFIRM_TEXT_VARIANT.Name, ...rest }) {
|
|
12
12
|
const { t } = modalPredefinedLocale.useTranslations();
|
|
13
13
|
const inputRef = useRef(null);
|
|
14
14
|
const { value, error, handleChange, reset, validate } = useTextFieldValidation({
|
|
15
|
-
target:
|
|
15
|
+
target: confirmText,
|
|
16
16
|
errorText: t('confirm.error'),
|
|
17
17
|
});
|
|
18
|
-
const shouldShowConfirm = Boolean(
|
|
18
|
+
const shouldShowConfirm = Boolean(confirmText);
|
|
19
19
|
const title = objectType ? t('deleteModal.title', { objectType }) : t('deleteModal.fallbackTitle');
|
|
20
20
|
const confirmPlaceholder = confirmTextVariant === CONFIRM_TEXT_VARIANT.Text ? t('confirm.textPlaceholder') : t('confirm.namePlaceholder');
|
|
21
21
|
const handleClose = () => {
|
|
@@ -29,5 +29,5 @@ export function DeleteModal({ open, onClose, mode, closeOnPopstate, objectType,
|
|
|
29
29
|
}
|
|
30
30
|
onDelete(handleClose);
|
|
31
31
|
};
|
|
32
|
-
return (_jsxs(ModalCustom, { open: open, onClose: handleClose, mode: mode, closeOnPopstate: closeOnPopstate, width: WIDTH.S, "data-test-id": TEST_IDS.deleteModal,
|
|
32
|
+
return (_jsxs(ModalCustom, { open: open, onClose: handleClose, mode: mode, closeOnPopstate: closeOnPopstate, width: WIDTH.S, "data-test-id": TEST_IDS.deleteModal, ...rest, children: [_jsx("div", { className: styles.safeAreaTop }), _jsx(ModalCustom.Header, { title: title, subtitle: subtitle, slotAfterTitle: titleTooltip ? _jsx(QuestionTooltip, { size: 's', tip: titleTooltip }) : undefined }), _jsx(ModalCustom.Body, { className: styles.body, content: _jsxs("div", { className: styles.content, children: [content ?? t('deleteModal.content'), shouldShowConfirm && (_jsx(InputConfirm, { ref: inputRef, confirmText: confirmText ?? '', hideConfirmCopyButton: hideConfirmCopyButton, value: value, error: error, size: 'l', copyLineAlign: 'start', confirmLabel: t('deleteModal.confirmLabel'), placeholder: confirmPlaceholder, onChange: handleChange }))] }) }), _jsx("div", { className: styles.safeAreaBottom }), _jsx(ModalCustom.Footer, { children: _jsxs("div", { className: styles.footer, children: [_jsx(Button, { view: VIEW.Outline, appearance: APPEARANCE.Neutral, label: t('deleteModal.cancel'), onClick: handleClose, "data-test-id": TEST_IDS.cancelButton }), _jsx(Button, { view: VIEW.Filled, appearance: APPEARANCE.Critical, label: t('deleteModal.approve'), loading: deleting, onClick: handleApproveClick, "data-test-id": TEST_IDS.approveButton })] }) })] }));
|
|
33
33
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
.safeAreaTop{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
align-items:flex-start;
|
|
5
|
+
align-self:stretch;
|
|
6
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.safeAreaBottom{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
align-items:flex-start;
|
|
13
|
+
align-self:stretch;
|
|
14
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
.body{
|
|
2
18
|
min-height:auto;
|
|
3
19
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RecallModalProps } from '../../types.js';
|
|
2
|
-
export declare function RecallModal({ open, onClose, mode, closeOnPopstate, titleTooltip, onRecall, loading, content,
|
|
2
|
+
export declare function RecallModal({ open, onClose, mode, closeOnPopstate, titleTooltip, onRecall, loading, content, confirmText, hideConfirmCopyButton, subtitle, ...rest }: RecallModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,14 +8,14 @@ import { InputConfirm } from '../../helperComponents/index.js';
|
|
|
8
8
|
import { useTextFieldValidation } from '../../hooks.js';
|
|
9
9
|
import { modalPredefinedLocale } from '../../locale/index.js';
|
|
10
10
|
import styles from './styles.module.css';
|
|
11
|
-
export function RecallModal({ open, onClose, mode, closeOnPopstate, titleTooltip, onRecall, loading, content,
|
|
11
|
+
export function RecallModal({ open, onClose, mode, closeOnPopstate, titleTooltip, onRecall, loading, content, confirmText, hideConfirmCopyButton, subtitle, ...rest }) {
|
|
12
12
|
const { t } = modalPredefinedLocale.useTranslations();
|
|
13
13
|
const inputRef = useRef(null);
|
|
14
14
|
const { value, error, handleChange, reset, validate } = useTextFieldValidation({
|
|
15
|
-
target:
|
|
15
|
+
target: confirmText,
|
|
16
16
|
errorText: t('confirm.error'),
|
|
17
17
|
});
|
|
18
|
-
const shouldShowConfirm = Boolean(
|
|
18
|
+
const shouldShowConfirm = Boolean(confirmText);
|
|
19
19
|
const handleClose = () => {
|
|
20
20
|
reset();
|
|
21
21
|
onClose();
|
|
@@ -27,5 +27,5 @@ export function RecallModal({ open, onClose, mode, closeOnPopstate, titleTooltip
|
|
|
27
27
|
}
|
|
28
28
|
onRecall(handleClose);
|
|
29
29
|
};
|
|
30
|
-
return (_jsxs(ModalCustom, { open: open, onClose: handleClose, mode: mode, closeOnPopstate: closeOnPopstate, width: WIDTH.S, "data-test-id": TEST_IDS.recallModal,
|
|
30
|
+
return (_jsxs(ModalCustom, { open: open, onClose: handleClose, mode: mode, closeOnPopstate: closeOnPopstate, width: WIDTH.S, "data-test-id": TEST_IDS.recallModal, ...rest, children: [_jsx("div", { className: styles.safeAreaTop }), _jsx(ModalCustom.Header, { title: t('recallModal.title'), subtitle: subtitle, slotAfterTitle: titleTooltip ? _jsx(QuestionTooltip, { size: 's', tip: titleTooltip }) : undefined }), _jsx(ModalCustom.Body, { className: styles.body, content: _jsxs("div", { className: styles.content, children: [content ?? t('recallModal.content'), shouldShowConfirm && (_jsx(InputConfirm, { ref: inputRef, confirmText: confirmText ?? '', confirmLabel: t('recallModal.confirmLabel'), hideConfirmCopyButton: hideConfirmCopyButton, value: value, error: error, size: 'l', copyLineAlign: 'start', placeholder: t('confirm.namePlaceholder'), onChange: handleChange }))] }) }), _jsx("div", { className: styles.safeAreaBottom }), _jsx(ModalCustom.Footer, { children: _jsxs("div", { className: styles.footer, children: [_jsx(Button, { view: VIEW.Outline, appearance: APPEARANCE.Neutral, label: t('recallModal.cancel'), onClick: handleClose, "data-test-id": TEST_IDS.cancelButton }), _jsx(Button, { view: VIEW.Filled, appearance: APPEARANCE.Critical, label: t('recallModal.approve'), loading: loading, onClick: handleApproveClick, "data-test-id": TEST_IDS.approveButton })] }) })] }));
|
|
31
31
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
.safeAreaTop{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
align-items:flex-start;
|
|
5
|
+
align-self:stretch;
|
|
6
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.safeAreaBottom{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
align-items:flex-start;
|
|
13
|
+
align-self:stretch;
|
|
14
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
.body{
|
|
2
18
|
min-height:auto;
|
|
3
19
|
}
|
|
@@ -11,5 +11,5 @@ export function DesktopReleaseNotes({ open, onClose, closeOnPopstate, contentSta
|
|
|
11
11
|
const { t } = modalPredefinedLocale.useTranslations();
|
|
12
12
|
const { pageIndex, readablePageNumber, setPage, handleClose, handleReadLaterClick, handleNextPageClick, handlePrevPageClick, } = useReleaseNotesNavigation({ onClose, onReadLaterClick, onSlideChange });
|
|
13
13
|
const shouldShowFooter = contentState === CONTENT_STATE.Data && (loading || items.length > 0);
|
|
14
|
-
return (_jsxs(ModalCustom, { open: open, onClose: handleClose, closeOnPopstate: closeOnPopstate, width: WIDTH.M, "data-content-state": contentState, "data-surface": 'modal', ...extractSupportProps(rest), children: [_jsx(ModalCustom.Header, { title: t('releaseNotes.title') }), _jsx(ModalCustom.Body, { className: styles.body, content: _jsx(ReleaseNotesContent, { contentState: contentState, items: items, loading: loading, pageIndex: pageIndex, surface: 'modal', noDataTitle: t('releaseNotes.noDataTitle'), noDataDescription: t('releaseNotes.noDataDescription'), errorTitle: t('releaseNotes.errorTitle'), errorDescription: t('releaseNotes.errorDescription'), retryLabel: t('releaseNotes.retry'), onPageChange: setPage, onDataErrorRetryClick: onDataErrorRetryClick }) }), shouldShowFooter && (_jsx(ModalCustom.Footer, { children: _jsx(ReleaseNotesFooter, { surface: 'modal', total: items.length, pageIndex: pageIndex, readablePageNumber: readablePageNumber, counterLabel: t('releaseNotes.counter', { page: readablePageNumber, total: items.length }), readLaterLabel: t('releaseNotes.readLater'), onReadLaterClick: handleReadLaterClick, onPrevPageClick: handlePrevPageClick, onNextPageClick: () => handleNextPageClick(items.length) }) }))] }));
|
|
14
|
+
return (_jsxs(ModalCustom, { open: open, onClose: handleClose, closeOnPopstate: closeOnPopstate, width: WIDTH.M, "data-content-state": contentState, "data-surface": 'modal', ...extractSupportProps(rest), children: [_jsx("div", { className: styles.safeAreaTop }), _jsx(ModalCustom.Header, { title: t('releaseNotes.title') }), _jsx(ModalCustom.Body, { className: styles.body, content: _jsx(ReleaseNotesContent, { contentState: contentState, items: items, loading: loading, pageIndex: pageIndex, surface: 'modal', noDataTitle: t('releaseNotes.noDataTitle'), noDataDescription: t('releaseNotes.noDataDescription'), errorTitle: t('releaseNotes.errorTitle'), errorDescription: t('releaseNotes.errorDescription'), retryLabel: t('releaseNotes.retry'), onPageChange: setPage, onDataErrorRetryClick: onDataErrorRetryClick }) }), _jsx("div", { className: styles.safeAreaBottom }), shouldShowFooter && (_jsx(ModalCustom.Footer, { children: _jsx(ReleaseNotesFooter, { surface: 'modal', total: items.length, pageIndex: pageIndex, readablePageNumber: readablePageNumber, counterLabel: t('releaseNotes.counter', { page: readablePageNumber, total: items.length }), readLaterLabel: t('releaseNotes.readLater'), onReadLaterClick: handleReadLaterClick, onPrevPageClick: handlePrevPageClick, onNextPageClick: () => handleNextPageClick(items.length) }) }))] }));
|
|
15
15
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
.safeAreaTop{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
align-items:flex-start;
|
|
5
|
+
align-self:stretch;
|
|
6
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.safeAreaBottom{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
align-items:flex-start;
|
|
13
|
+
align-self:stretch;
|
|
14
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
.body{
|
|
2
18
|
min-height:calc(6 * var(--sn-primitive-dimension-64, 64px));
|
|
3
19
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { FieldCombo, VALIDATION_STATE } from '@cloud-ru/ds-fields';
|
|
3
|
+
import { TruncateString } from '@cloud-ru/ds-truncate-string';
|
|
3
4
|
import { CopyButton } from '@cloud-ru/ds-uikit-product-copy';
|
|
4
5
|
import { forwardRef } from 'react';
|
|
5
6
|
import { TEST_IDS } from '../../constants.js';
|
|
6
7
|
import styles from './styles.module.css';
|
|
7
8
|
export const InputConfirm = forwardRef(function InputConfirm({ confirmText, confirmLabel, hideConfirmCopyButton, value, error, label, size = 'm', copyLineAlign = 'space-between', placeholder, onChange, ...rest }, ref) {
|
|
8
|
-
return (_jsxs("div", { className: styles.root, children: [confirmLabel && _jsx("span", { className: styles.confirmLabel, children: confirmLabel }), _jsxs("div", { className: styles.confirmText, "data-align": copyLineAlign, children: [_jsx(
|
|
9
|
+
return (_jsxs("div", { className: styles.root, children: [confirmLabel && _jsx("span", { className: styles.confirmLabel, children: confirmLabel }), _jsxs("div", { className: styles.confirmText, "data-align": copyLineAlign, children: [_jsx(TruncateString, { className: styles.confirmValue, variant: 'middle', text: confirmText }), !hideConfirmCopyButton && _jsx(CopyButton, { valueToCopy: confirmText, "data-test-id": TEST_IDS.confirmCopyButton })] }), _jsx(FieldCombo, { ...rest, ref: ref, inputMode: 'text', label: label, required: Boolean(label), size: size, placeholder: placeholder, value: value, onChange: onChange, hint: error, validationState: error ? VALIDATION_STATE.Error : VALIDATION_STATE.Default, "data-test-id": TEST_IDS.confirmInput })] }));
|
|
9
10
|
});
|
|
@@ -35,4 +35,5 @@
|
|
|
35
35
|
font-size:var(--sn-regular-body-m-fontSize, var(--sn-density-typography-roleBody-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px)));
|
|
36
36
|
letter-spacing:var(--sn-regular-body-m-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
|
|
37
37
|
paragraph-spacing:var(--sn-regular-body-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
|
|
38
|
+
min-width:0;
|
|
38
39
|
}
|
package/dist/esm/style.css
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
.safeAreaTop{
|
|
2
|
+
display:flex;
|
|
3
|
+
flex-direction:column;
|
|
4
|
+
align-items:flex-start;
|
|
5
|
+
align-self:stretch;
|
|
6
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.safeAreaBottom{
|
|
10
|
+
display:flex;
|
|
11
|
+
flex-direction:column;
|
|
12
|
+
align-items:flex-start;
|
|
13
|
+
align-self:stretch;
|
|
14
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
.body{
|
|
2
18
|
min-height:auto;
|
|
3
19
|
}
|
|
@@ -15,6 +31,22 @@
|
|
|
15
31
|
justify-content:flex-end;
|
|
16
32
|
width:100%;
|
|
17
33
|
}
|
|
34
|
+
.safeAreaTop{
|
|
35
|
+
display:flex;
|
|
36
|
+
flex-direction:column;
|
|
37
|
+
align-items:flex-start;
|
|
38
|
+
align-self:stretch;
|
|
39
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.safeAreaBottom{
|
|
43
|
+
display:flex;
|
|
44
|
+
flex-direction:column;
|
|
45
|
+
align-items:flex-start;
|
|
46
|
+
align-self:stretch;
|
|
47
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
48
|
+
}
|
|
49
|
+
|
|
18
50
|
.body{
|
|
19
51
|
min-height:auto;
|
|
20
52
|
}
|
|
@@ -32,6 +64,22 @@
|
|
|
32
64
|
justify-content:flex-end;
|
|
33
65
|
width:100%;
|
|
34
66
|
}
|
|
67
|
+
.safeAreaTop{
|
|
68
|
+
display:flex;
|
|
69
|
+
flex-direction:column;
|
|
70
|
+
align-items:flex-start;
|
|
71
|
+
align-self:stretch;
|
|
72
|
+
padding-top:var(--sn-modal-anatomy-container-safeArea-paddingTop, var(--sn-density-spacing-interval-l, var(--sn-primitive-dimension-24, 24px)));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.safeAreaBottom{
|
|
76
|
+
display:flex;
|
|
77
|
+
flex-direction:column;
|
|
78
|
+
align-items:flex-start;
|
|
79
|
+
align-self:stretch;
|
|
80
|
+
padding-bottom:var(--sn-modal-anatomy-container-safeArea-paddingBottom, var(--sn-density-spacing-interval-s, var(--sn-primitive-dimension-8, 8px)));
|
|
81
|
+
}
|
|
82
|
+
|
|
35
83
|
.body{
|
|
36
84
|
min-height:calc(6 * var(--sn-primitive-dimension-64, 64px));
|
|
37
85
|
}
|
|
@@ -72,6 +120,7 @@
|
|
|
72
120
|
font-size:var(--sn-regular-body-m-fontSize, var(--sn-density-typography-roleBody-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px)));
|
|
73
121
|
letter-spacing:var(--sn-regular-body-m-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
|
|
74
122
|
paragraph-spacing:var(--sn-regular-body-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
|
|
123
|
+
min-width:0;
|
|
75
124
|
}
|
|
76
125
|
.root{
|
|
77
126
|
display:grid;
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -21,9 +21,7 @@ export type NoteItemProps = {
|
|
|
21
21
|
type BaseActionModalProps = Pick<ModalCustomProps, 'open' | 'onClose' | 'mode' | 'closeOnPopstate'> & {
|
|
22
22
|
/** Подсказка рядом с заголовком */
|
|
23
23
|
titleTooltip?: ReactNode;
|
|
24
|
-
/**
|
|
25
|
-
confirmable?: boolean;
|
|
26
|
-
/** Текст, который нужно ввести для подтверждения */
|
|
24
|
+
/** Текст, который нужно ввести для подтверждения. Если передан — модалка показывает поле подтверждения */
|
|
27
25
|
confirmText?: string;
|
|
28
26
|
/** Скрыть кнопку копирования текста подтверждения */
|
|
29
27
|
hideConfirmCopyButton?: boolean;
|