@cloud-ru/ds-uikit-product-modal-predefined 1.1.4-preview-c0e895ed.0 → 1.1.4-preview-e8fe6b56.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.
package/README.md CHANGED
@@ -94,7 +94,7 @@ export function DeleteConfirmable() {
94
94
  | `data-test-id` | `string` | — | |
95
95
  | `deleting` | `boolean` | — | Состояние загрузки кнопки удаления |
96
96
  | `hideConfirmCopyButton` | `boolean` | — | Скрыть кнопку копирования текста подтверждения |
97
- | `mode` | `"aggressive"` \| `"forced"` \| `"regular"` | `MODE.Regular` | Режим закрытия: Regular — overlay/Esc/кнопка; Aggressive — только кнопка; Forced — без кнопки и overlay/Esc. <br/> Aggressive и Forced размывают фон под подложкой. <br/> На mobile Aggressive запрещает закрытие кликом по подложке, Forced также отключает свайп. |
97
+ | `mode` | `"aggressive"` \| `"forced"` \| `"regular"` | `MODE.Regular` | Режим закрытия: Regular — overlay/Esc/кнопка; Aggressive — только кнопка; Forced — без кнопки и overlay/Esc. |
98
98
  | `objectType` | `string` | — | Тип удаляемого объекта, отображается в заголовке |
99
99
  | `onClose` | `() => void` | — | Колбэк закрытия |
100
100
  | `onDelete` | `(onClose: () => void) => void` | — | Колбэк подтверждения удаления |
@@ -169,7 +169,7 @@ export function RecallConfirmable() {
169
169
  | `data-test-id` | `string` | — | |
170
170
  | `hideConfirmCopyButton` | `boolean` | — | Скрыть кнопку копирования текста подтверждения |
171
171
  | `loading` | `boolean` | — | Состояние загрузки кнопки отзыва |
172
- | `mode` | `"aggressive"` \| `"forced"` \| `"regular"` | `MODE.Regular` | Режим закрытия: Regular — overlay/Esc/кнопка; Aggressive — только кнопка; Forced — без кнопки и overlay/Esc. <br/> Aggressive и Forced размывают фон под подложкой. <br/> На mobile Aggressive запрещает закрытие кликом по подложке, Forced также отключает свайп. |
172
+ | `mode` | `"aggressive"` \| `"forced"` \| `"regular"` | `MODE.Regular` | Режим закрытия: Regular — overlay/Esc/кнопка; Aggressive — только кнопка; Forced — без кнопки и overlay/Esc. |
173
173
  | `onClose` | `() => void` | — | Колбэк закрытия |
174
174
  | `onRecall` | `(onClose: () => void) => void` | — | Колбэк подтверждения отзыва |
175
175
  | `open` | `boolean` | — | Управление состоянием показан/не показан |
@@ -1,7 +1,6 @@
1
1
  import { NoteItemProps, Surface } from '../../types';
2
2
  type NoteItemComponentProps = NoteItemProps & {
3
3
  surface?: Surface;
4
- active?: boolean;
5
4
  };
6
- export declare function NoteItem({ title, description, image, video, surface, active }: NoteItemComponentProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function NoteItem({ title, description, image, video, surface }: NoteItemComponentProps): import("react/jsx-runtime").JSX.Element;
7
6
  export {};
@@ -41,6 +41,6 @@ function NoteItemMedia({ image, video }) {
41
41
  // При ошибке `<img>` не рендерится: иначе поверх заглушки остаётся превью браузера с alt-текстом.
42
42
  status !== constants_1.MEDIA_STATUS.Error && ((0, jsx_runtime_1.jsx)("img", { ref: handleImageRef, className: styles_module_scss_1.default.file, src: image.src, alt: image.alt, onLoad: handleImageLoad, onError: handleImageError, "data-test-id": constants_1.TEST_IDS.releaseNotesImage }))), status === constants_1.MEDIA_STATUS.Pending && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.mediaOverlay, "aria-hidden": true, children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { loading: true, width: '100%', height: '100%' }) })), status === constants_1.MEDIA_STATUS.Error && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.mediaOverlay, role: 'img', "aria-label": image.alt, "data-test-id": constants_1.TEST_IDS.releaseNotesMediaFallback, children: (0, jsx_runtime_1.jsx)(system_1.ImageSVG, { className: styles_module_scss_1.default.mediaFallbackIcon, size: FALLBACK_ICON_SIZE }) }))] }));
43
43
  }
44
- function NoteItem({ title, description, image, video, surface = constants_1.SURFACE.Modal, active = true }) {
45
- return ((0, jsx_runtime_1.jsxs)("article", { className: styles_module_scss_1.default.root, "data-surface": surface, "data-active": active, "data-test-id": constants_1.TEST_IDS.releaseNotesItem, children: [(0, jsx_runtime_1.jsx)(NoteItemMedia, { image: image, video: video }, `${video ?? ''}|${image.src}`), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.titleWrapper, children: (0, jsx_runtime_1.jsx)(typography_1.Typography, { className: styles_module_scss_1.default.title, variant: 'title', size: 'l', children: title }) }), (0, jsx_runtime_1.jsx)(scroll_1.Scroll, { className: styles_module_scss_1.default.description, size: scroll_1.SIZE.S, barHideStrategy: scroll_1.BAR_HIDE_STRATEGY.Leave, children: (0, jsx_runtime_1.jsx)(markdown_1.Markdown, { value: description, className: styles_module_scss_1.default.markdown }) })] })] }));
44
+ function NoteItem({ title, description, image, video, surface = constants_1.SURFACE.Modal }) {
45
+ return ((0, jsx_runtime_1.jsxs)("article", { className: styles_module_scss_1.default.root, "data-surface": surface, "data-test-id": constants_1.TEST_IDS.releaseNotesItem, children: [(0, jsx_runtime_1.jsx)(NoteItemMedia, { image: image, video: video }, `${video ?? ''}|${image.src}`), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.content, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.titleWrapper, children: (0, jsx_runtime_1.jsx)(typography_1.Typography, { className: styles_module_scss_1.default.title, variant: 'title', size: 'l', children: title }) }), (0, jsx_runtime_1.jsx)(scroll_1.Scroll, { className: styles_module_scss_1.default.description, size: scroll_1.SIZE.S, barHideStrategy: scroll_1.BAR_HIDE_STRATEGY.Leave, children: (0, jsx_runtime_1.jsx)(markdown_1.Markdown, { value: description, className: styles_module_scss_1.default.markdown }) })] })] }));
46
46
  }
@@ -11,10 +11,6 @@
11
11
  row-gap:var(--sn-primitive-dimension-16, 16px);
12
12
  height:auto;
13
13
  }
14
- .root[data-surface=bottomSheet][data-active=false]{
15
- overflow:hidden;
16
- height:0;
17
- }
18
14
 
19
15
  .media{
20
16
  position:relative;
@@ -29,5 +29,5 @@ function ReleaseNotesContent({ contentState, items, loading, pageIndex, surface,
29
29
  if (contentState === constants_1.CONTENT_STATE.NoData || !hasItems) {
30
30
  return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.stateWrapper, "data-surface": surface, children: (0, jsx_runtime_1.jsx)(info_block_1.InfoBlock, { className: styles_module_scss_1.default.state, size: 'l', title: noDataTitle, content: (0, jsx_runtime_1.jsx)(InfoBlockDescription, { children: noDataDescription }), "data-test-id": constants_1.TEST_IDS.releaseNotesNoData }) }));
31
31
  }
32
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.root, styles_module_scss_1.default[surface]), children: (0, jsx_runtime_1.jsx)(carousel_1.Carousel, { arrows: false, pagination: false, swipe: true, state: { page: pageIndex, onChange: onPageChange }, className: styles_module_scss_1.default.carousel, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)(NoteItem_1.NoteItem, { ...item, surface: surface, active: index === pageIndex }, `${item.title}-${item.image.src}`))) }) }));
32
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.root, styles_module_scss_1.default[surface]), children: (0, jsx_runtime_1.jsx)(carousel_1.Carousel, { arrows: false, pagination: false, swipe: true, state: { page: pageIndex, onChange: onPageChange }, className: styles_module_scss_1.default.carousel, children: items.map(item => ((0, jsx_runtime_1.jsx)(NoteItem_1.NoteItem, { ...item, surface: surface }, `${item.title}-${item.image.src}`))) }) }));
33
33
  }
@@ -58,10 +58,6 @@
58
58
  row-gap:var(--sn-primitive-dimension-16, 16px);
59
59
  height:auto;
60
60
  }
61
- .root[data-surface=bottomSheet][data-active=false]{
62
- overflow:hidden;
63
- height:0;
64
- }
65
61
 
66
62
  .media{
67
63
  position:relative;
@@ -1,7 +1,6 @@
1
1
  import { NoteItemProps, Surface } from '../../types.js';
2
2
  type NoteItemComponentProps = NoteItemProps & {
3
3
  surface?: Surface;
4
- active?: boolean;
5
4
  };
6
- export declare function NoteItem({ title, description, image, video, surface, active }: NoteItemComponentProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function NoteItem({ title, description, image, video, surface }: NoteItemComponentProps): import("react/jsx-runtime").JSX.Element;
7
6
  export {};
@@ -35,6 +35,6 @@ function NoteItemMedia({ image, video }) {
35
35
  // При ошибке `<img>` не рендерится: иначе поверх заглушки остаётся превью браузера с alt-текстом.
36
36
  status !== MEDIA_STATUS.Error && (_jsx("img", { ref: handleImageRef, className: styles.file, src: image.src, alt: image.alt, onLoad: handleImageLoad, onError: handleImageError, "data-test-id": TEST_IDS.releaseNotesImage }))), status === MEDIA_STATUS.Pending && (_jsx("div", { className: styles.mediaOverlay, "aria-hidden": true, children: _jsx(Skeleton, { loading: true, width: '100%', height: '100%' }) })), status === MEDIA_STATUS.Error && (_jsx("div", { className: styles.mediaOverlay, role: 'img', "aria-label": image.alt, "data-test-id": TEST_IDS.releaseNotesMediaFallback, children: _jsx(ImageSVG, { className: styles.mediaFallbackIcon, size: FALLBACK_ICON_SIZE }) }))] }));
37
37
  }
38
- export function NoteItem({ title, description, image, video, surface = SURFACE.Modal, active = true }) {
39
- return (_jsxs("article", { className: styles.root, "data-surface": surface, "data-active": active, "data-test-id": TEST_IDS.releaseNotesItem, children: [_jsx(NoteItemMedia, { image: image, video: video }, `${video ?? ''}|${image.src}`), _jsxs("div", { className: styles.content, children: [_jsx("div", { className: styles.titleWrapper, children: _jsx(Typography, { className: styles.title, variant: 'title', size: 'l', children: title }) }), _jsx(Scroll, { className: styles.description, size: SCROLL_SIZE.S, barHideStrategy: BAR_HIDE_STRATEGY.Leave, children: _jsx(Markdown, { value: description, className: styles.markdown }) })] })] }));
38
+ export function NoteItem({ title, description, image, video, surface = SURFACE.Modal }) {
39
+ return (_jsxs("article", { className: styles.root, "data-surface": surface, "data-test-id": TEST_IDS.releaseNotesItem, children: [_jsx(NoteItemMedia, { image: image, video: video }, `${video ?? ''}|${image.src}`), _jsxs("div", { className: styles.content, children: [_jsx("div", { className: styles.titleWrapper, children: _jsx(Typography, { className: styles.title, variant: 'title', size: 'l', children: title }) }), _jsx(Scroll, { className: styles.description, size: SCROLL_SIZE.S, barHideStrategy: BAR_HIDE_STRATEGY.Leave, children: _jsx(Markdown, { value: description, className: styles.markdown }) })] })] }));
40
40
  }
@@ -11,10 +11,6 @@
11
11
  row-gap:var(--sn-primitive-dimension-16, 16px);
12
12
  height:auto;
13
13
  }
14
- .root[data-surface=bottomSheet][data-active=false]{
15
- overflow:hidden;
16
- height:0;
17
- }
18
14
 
19
15
  .media{
20
16
  position:relative;
@@ -23,5 +23,5 @@ export function ReleaseNotesContent({ contentState, items, loading, pageIndex, s
23
23
  if (contentState === CONTENT_STATE.NoData || !hasItems) {
24
24
  return (_jsx("div", { className: styles.stateWrapper, "data-surface": surface, children: _jsx(InfoBlock, { className: styles.state, size: 'l', title: noDataTitle, content: _jsx(InfoBlockDescription, { children: noDataDescription }), "data-test-id": TEST_IDS.releaseNotesNoData }) }));
25
25
  }
26
- return (_jsx("div", { className: cn(styles.root, styles[surface]), children: _jsx(Carousel, { arrows: false, pagination: false, swipe: true, state: { page: pageIndex, onChange: onPageChange }, className: styles.carousel, children: items.map((item, index) => (_jsx(NoteItem, { ...item, surface: surface, active: index === pageIndex }, `${item.title}-${item.image.src}`))) }) }));
26
+ return (_jsx("div", { className: cn(styles.root, styles[surface]), children: _jsx(Carousel, { arrows: false, pagination: false, swipe: true, state: { page: pageIndex, onChange: onPageChange }, className: styles.carousel, children: items.map(item => (_jsx(NoteItem, { ...item, surface: surface }, `${item.title}-${item.image.src}`))) }) }));
27
27
  }
@@ -58,10 +58,6 @@
58
58
  row-gap:var(--sn-primitive-dimension-16, 16px);
59
59
  height:auto;
60
60
  }
61
- .root[data-surface=bottomSheet][data-active=false]{
62
- overflow:hidden;
63
- height:0;
64
- }
65
61
 
66
62
  .media{
67
63
  position:relative;