@hh.ru/magritte-ui-placeholder 10.0.29 → 11.0.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/Placeholder.d.ts +3 -2
- package/Placeholder.js +25 -21
- package/Placeholder.js.map +1 -1
- package/index.css +14 -29
- package/index.d.ts +1 -1
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/package.json +5 -2
- package/types.d.ts +17 -45
package/Placeholder.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
1
|
import { PlaceholderProps } from '@hh.ru/magritte-ui-placeholder/types';
|
|
3
|
-
export declare const Placeholder: FC<PlaceholderProps
|
|
2
|
+
export declare const Placeholder: React.FC<PlaceholderProps> & {
|
|
3
|
+
Image: React.FC<React.ImgHTMLAttributes<HTMLImageElement>>;
|
|
4
|
+
};
|
package/Placeholder.js
CHANGED
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useState } from 'react';
|
|
3
|
+
import { isValidElement, useState } from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
+
import { CENTERED_WRAPPER_CLASS } from '@hh.ru/magritte-ui-button-stack';
|
|
5
6
|
import { getContainerStyles } from './utils.js';
|
|
7
|
+
import { ScrollbarContainer } from '@hh.ru/magritte-ui-scrollbar';
|
|
8
|
+
import { VSpacing } from '@hh.ru/magritte-ui-spacing';
|
|
6
9
|
import { Title } from '@hh.ru/magritte-ui-title';
|
|
7
10
|
|
|
8
|
-
var styles = {"placeholder
|
|
11
|
+
var styles = {"placeholder":"magritte-placeholder___8EHpb_11-0-0","vertical-align-top":"magritte-vertical-align-top___nmf-X_11-0-0","verticalAlignTop":"magritte-vertical-align-top___nmf-X_11-0-0","vertical-align-center":"magritte-vertical-align-center___-QB1n_11-0-0","verticalAlignCenter":"magritte-vertical-align-center___-QB1n_11-0-0","vertical-align-bottom":"magritte-vertical-align-bottom___l9O6B_11-0-0","verticalAlignBottom":"magritte-vertical-align-bottom___l9O6B_11-0-0","title-container":"magritte-title-container___dki9b_11-0-0","titleContainer":"magritte-title-container___dki9b_11-0-0","image-container":"magritte-image-container___n7AQh_11-0-0","imageContainer":"magritte-image-container___n7AQh_11-0-0","content":"magritte-content___J6qIa_11-0-0","placeholder-image":"magritte-placeholder-image___bMcah_11-0-0","placeholderImage":"magritte-placeholder-image___bMcah_11-0-0","placeholder-image_hidden":"magritte-placeholder-image_hidden___5fOaL_11-0-0","placeholderImageHidden":"magritte-placeholder-image_hidden___5fOaL_11-0-0"};
|
|
9
12
|
|
|
10
13
|
const PLACEHOLDER_IMAGE_HEIGHT = 200;
|
|
11
|
-
const Placeholder = ({ title, titleProps, description,
|
|
14
|
+
const Placeholder = ({ title, titleProps, description, children, buttons, maxWidth, minHeight, gapTop = 24, gapBottom = 24, paddingTop, paddingBottom, 'data-qa': dataQa, verticalAlign = 'center', }) => {
|
|
15
|
+
return (jsxs("div", { className: classnames(styles.placeholder, {
|
|
16
|
+
[styles.verticalAlignTop]: verticalAlign === 'top',
|
|
17
|
+
[styles.verticalAlignCenter]: verticalAlign === 'center',
|
|
18
|
+
[styles.verticalAlignBottom]: verticalAlign === 'bottom',
|
|
19
|
+
}), style: getContainerStyles({ paddingTop, paddingBottom, maxWidth, minHeight }), "data-qa": dataQa, children: [isValidElement(children) && children.type === Placeholder.Image ? (children) : (jsx("div", { className: styles.content, children: jsx(ScrollbarContainer, { children: children }) })), Boolean(children) && jsx(VSpacing, { default: gapTop }), jsx("div", { className: styles.titleContainer, children: jsx(Title, { size: "medium", alignment: "center", Element: "h2", description: description, ...titleProps, children: title }) }), Boolean(buttons) && jsx(VSpacing, { default: gapBottom }), jsx("div", { className: CENTERED_WRAPPER_CLASS, children: buttons })] }));
|
|
20
|
+
};
|
|
21
|
+
const PlaceholderImage = (props) => {
|
|
12
22
|
const [isLoaded, setIsLoaded] = useState(false);
|
|
13
23
|
const [isLoadingError, setIsLoadingError] = useState(false);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
setIsLoadingError(true);
|
|
25
|
-
}, src: image, alt: ariaLabel, className: classnames(styles.placeholderImage, {
|
|
26
|
-
[styles.placeholderImageHidden]: isLoadingError,
|
|
27
|
-
}), width: imageWidth, height: !isLoaded && !imageHeight ? PLACEHOLDER_IMAGE_HEIGHT : imageHeight }) })), jsx(Title, { size: "medium", alignment: "center", Element: "h2", description: description, ...titleProps, children: title }), showButtons && hasAnyButton && (jsxs("div", { className: classnames(styles.placeholderButtons, {
|
|
28
|
-
[styles.placeholderButtonsNoStretch]: !buttonsStretched,
|
|
29
|
-
[styles.placeholderButtonsAlignLeft]: buttonsAlign === 'left',
|
|
30
|
-
[styles.placeholderButtonsAlignCenter]: buttonsAlign === 'center',
|
|
31
|
-
}), children: [buttonPrimary, buttonSecondary, buttonTertiary] }))] }));
|
|
24
|
+
return (jsx("div", { className: styles.imageContainer, children: jsx("img", { ...props, onLoad: (event) => {
|
|
25
|
+
props.onLoad?.(event);
|
|
26
|
+
setIsLoaded(true);
|
|
27
|
+
}, onError: (event) => {
|
|
28
|
+
props.onError?.(event);
|
|
29
|
+
setIsLoaded(false);
|
|
30
|
+
setIsLoadingError(true);
|
|
31
|
+
}, className: classnames(props.className, styles.placeholderImage, {
|
|
32
|
+
[styles.placeholderImageHidden]: isLoadingError,
|
|
33
|
+
}), width: props.width, height: !isLoaded && !props.height ? PLACEHOLDER_IMAGE_HEIGHT : props.height }) }));
|
|
32
34
|
};
|
|
35
|
+
PlaceholderImage.displayName = 'Placeholder.Image';
|
|
36
|
+
Placeholder.Image = PlaceholderImage;
|
|
33
37
|
|
|
34
38
|
export { Placeholder };
|
|
35
39
|
//# sourceMappingURL=Placeholder.js.map
|
package/Placeholder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Placeholder.js","sources":["../src/Placeholder.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Placeholder.js","sources":["../src/Placeholder.tsx"],"sourcesContent":["import { isValidElement, useState } from 'react';\nimport classnames from 'classnames';\n\nimport { CENTERED_WRAPPER_CLASS } from '@hh.ru/magritte-ui-button-stack';\nimport { PlaceholderProps } from '@hh.ru/magritte-ui-placeholder/types';\nimport { getContainerStyles } from '@hh.ru/magritte-ui-placeholder/utils';\nimport { ScrollbarContainer } from '@hh.ru/magritte-ui-scrollbar';\nimport { VSpacing } from '@hh.ru/magritte-ui-spacing';\nimport { Title } from '@hh.ru/magritte-ui-title';\n\nimport styles from './placeholder.less';\n\nconst PLACEHOLDER_IMAGE_HEIGHT = 200;\n\nexport const Placeholder: React.FC<PlaceholderProps> & {\n Image: React.FC<React.ImgHTMLAttributes<HTMLImageElement>>;\n} = ({\n title,\n titleProps,\n description,\n children,\n buttons,\n\n maxWidth,\n minHeight,\n gapTop = 24,\n gapBottom = 24,\n paddingTop,\n paddingBottom,\n\n 'data-qa': dataQa,\n verticalAlign = 'center',\n}) => {\n return (\n <div\n className={classnames(styles.placeholder, {\n [styles.verticalAlignTop]: verticalAlign === 'top',\n [styles.verticalAlignCenter]: verticalAlign === 'center',\n [styles.verticalAlignBottom]: verticalAlign === 'bottom',\n })}\n style={getContainerStyles({ paddingTop, paddingBottom, maxWidth, minHeight })}\n data-qa={dataQa}\n >\n {isValidElement(children) && children.type === Placeholder.Image ? (\n children\n ) : (\n <div className={styles.content}>\n <ScrollbarContainer>{children}</ScrollbarContainer>\n </div>\n )}\n {Boolean(children) && <VSpacing default={gapTop} />}\n <div className={styles.titleContainer}>\n <Title size=\"medium\" alignment=\"center\" Element=\"h2\" description={description} {...titleProps}>\n {title}\n </Title>\n </div>\n {Boolean(buttons) && <VSpacing default={gapBottom} />}\n <div className={CENTERED_WRAPPER_CLASS}>{buttons}</div>\n </div>\n );\n};\n\nconst PlaceholderImage: React.FC<React.ImgHTMLAttributes<HTMLImageElement>> = (props) => {\n const [isLoaded, setIsLoaded] = useState(false);\n const [isLoadingError, setIsLoadingError] = useState(false);\n return (\n <div className={styles.imageContainer}>\n <img\n {...props}\n onLoad={(event) => {\n props.onLoad?.(event);\n setIsLoaded(true);\n }}\n onError={(event) => {\n props.onError?.(event);\n setIsLoaded(false);\n setIsLoadingError(true);\n }}\n className={classnames(props.className, styles.placeholderImage, {\n [styles.placeholderImageHidden]: isLoadingError,\n })}\n width={props.width}\n height={!isLoaded && !props.height ? PLACEHOLDER_IMAGE_HEIGHT : props.height}\n />\n </div>\n );\n};\n\nPlaceholderImage.displayName = 'Placeholder.Image';\nPlaceholder.Image = PlaceholderImage;\n"],"names":["_jsxs","_jsx"],"mappings":"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"}
|
package/index.css
CHANGED
|
@@ -1,52 +1,37 @@
|
|
|
1
|
-
.magritte-
|
|
1
|
+
.magritte-placeholder___8EHpb_11-0-0{
|
|
2
2
|
display:flex;
|
|
3
3
|
flex-direction:column;
|
|
4
4
|
flex:1;
|
|
5
5
|
margin:auto;
|
|
6
6
|
height:inherit;
|
|
7
|
+
box-sizing:border-box;
|
|
7
8
|
}
|
|
8
|
-
.magritte-
|
|
9
|
+
.magritte-vertical-align-top___nmf-X_11-0-0{
|
|
9
10
|
justify-content:flex-start;
|
|
10
11
|
}
|
|
11
|
-
.magritte-
|
|
12
|
+
.magritte-vertical-align-center___-QB1n_11-0-0{
|
|
12
13
|
justify-content:center;
|
|
13
14
|
}
|
|
14
|
-
.magritte-
|
|
15
|
+
.magritte-vertical-align-bottom___l9O6B_11-0-0{
|
|
15
16
|
justify-content:flex-end;
|
|
16
17
|
}
|
|
17
|
-
.magritte-
|
|
18
|
-
|
|
19
|
-
flex-direction:column;
|
|
20
|
-
gap:12px;
|
|
21
|
-
margin-top:32px;
|
|
22
|
-
}
|
|
23
|
-
@media (min-width: 1020px){
|
|
24
|
-
body.magritte-old-layout .magritte-placeholder-buttons_no-stretch___04p3Z_10-0-29{
|
|
25
|
-
flex-direction:row;
|
|
26
|
-
}
|
|
18
|
+
.magritte-title-container___dki9b_11-0-0{
|
|
19
|
+
padding:0 12px;
|
|
27
20
|
}
|
|
28
|
-
|
|
29
|
-
body:not(.magritte-old-layout) .magritte-placeholder-buttons_no-stretch___04p3Z_10-0-29{
|
|
30
|
-
flex-direction:row;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
.magritte-placeholder-buttons_no-stretch___04p3Z_10-0-29.magritte-placeholder-buttons_align-left___mzBmy_10-0-29{
|
|
34
|
-
justify-content:flex-start;
|
|
35
|
-
}
|
|
36
|
-
.magritte-placeholder-buttons_no-stretch___04p3Z_10-0-29.magritte-placeholder-buttons_align-center___7QhoH_10-0-29{
|
|
37
|
-
justify-content:center;
|
|
38
|
-
}
|
|
39
|
-
.magritte-placeholder-image-container___3eIPQ_10-0-29{
|
|
40
|
-
margin-bottom:32px;
|
|
21
|
+
.magritte-image-container___n7AQh_11-0-0{
|
|
41
22
|
display:flex;
|
|
42
23
|
align-content:center;
|
|
43
24
|
justify-content:center;
|
|
25
|
+
min-height:0;
|
|
26
|
+
}
|
|
27
|
+
.magritte-content___J6qIa_11-0-0{
|
|
28
|
+
overflow:hidden;
|
|
44
29
|
}
|
|
45
|
-
.magritte-placeholder-
|
|
30
|
+
.magritte-placeholder-image___bMcah_11-0-0{
|
|
46
31
|
max-width:100%;
|
|
47
32
|
max-height:100%;
|
|
48
33
|
object-fit:contain;
|
|
49
34
|
}
|
|
50
|
-
.magritte-placeholder-
|
|
35
|
+
.magritte-placeholder-image_hidden___5fOaL_11-0-0{
|
|
51
36
|
visibility:hidden;
|
|
52
37
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from '@hh.ru/magritte-ui-placeholder/Placeholder';
|
|
2
|
-
export { type PlaceholderProps, type PlaceholderVerticalAlign
|
|
2
|
+
export { type PlaceholderProps, type PlaceholderVerticalAlign } from '@hh.ru/magritte-ui-placeholder/types';
|
package/index.js
CHANGED
|
@@ -3,6 +3,9 @@ export { Placeholder } from './Placeholder.js';
|
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'classnames';
|
|
6
|
+
import '@hh.ru/magritte-ui-button-stack';
|
|
6
7
|
import './utils.js';
|
|
8
|
+
import '@hh.ru/magritte-ui-scrollbar';
|
|
9
|
+
import '@hh.ru/magritte-ui-spacing';
|
|
7
10
|
import '@hh.ru/magritte-ui-title';
|
|
8
11
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-placeholder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@hh.ru/magritte-design-tokens": "24.4.0",
|
|
23
23
|
"@hh.ru/magritte-ui-breakpoint": "6.0.6",
|
|
24
|
+
"@hh.ru/magritte-ui-button-stack": "3.0.0",
|
|
25
|
+
"@hh.ru/magritte-ui-scrollbar": "1.0.17",
|
|
26
|
+
"@hh.ru/magritte-ui-spacing": "2.1.10",
|
|
24
27
|
"@hh.ru/magritte-ui-title": "7.0.29"
|
|
25
28
|
},
|
|
26
29
|
"peerDependencies": {
|
|
@@ -30,5 +33,5 @@
|
|
|
30
33
|
"publishConfig": {
|
|
31
34
|
"access": "public"
|
|
32
35
|
},
|
|
33
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "494e7d82d7d01dfd9a60460b9b94f08a7ef609d5"
|
|
34
37
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,59 +1,31 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
1
|
import { TokenBaseStaticSpace } from '@hh.ru/magritte-design-tokens/types';
|
|
3
2
|
import { TitleProps } from '@hh.ru/magritte-ui-title/types';
|
|
4
|
-
type Explode<T> = keyof T extends infer K ? K extends unknown ? {
|
|
5
|
-
[I in keyof T]: I extends K ? T[I] : never;
|
|
6
|
-
} : never : never;
|
|
7
|
-
type AtMostOne<T> = Explode<Partial<T>>;
|
|
8
3
|
export type PlaceholderVerticalAlign = 'top' | 'center' | 'bottom';
|
|
9
|
-
export
|
|
10
|
-
|
|
4
|
+
export interface PlaceholderProps {
|
|
5
|
+
/** Заголовок */
|
|
6
|
+
title: TitleProps['children'];
|
|
7
|
+
/** Пропсы заголовка */
|
|
8
|
+
titleProps?: Omit<TitleProps, 'children'>;
|
|
9
|
+
/** Подзаголовок */
|
|
10
|
+
description?: TitleProps['description'];
|
|
11
|
+
/** Слот для <Placeholder.Image /> или произвольного контента */
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/** Button Stack с кнопками */
|
|
14
|
+
buttons?: React.ReactNode;
|
|
11
15
|
/** Максимальная ширина контейнера */
|
|
12
16
|
maxWidth?: number | 'fit-content';
|
|
13
17
|
/** Минимальная высота контейнера */
|
|
14
18
|
minHeight?: number;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/** Пропы заголовка */
|
|
20
|
-
titleProps?: Omit<TitleProps, 'children'>;
|
|
21
|
-
/** Показывать ли кнопки */
|
|
22
|
-
showButtons?: boolean;
|
|
19
|
+
/** Отступ между слотом и тайтлом */
|
|
20
|
+
gapTop?: TokenBaseStaticSpace;
|
|
21
|
+
/** Отступ между тайтлом и кнопками */
|
|
22
|
+
gapBottom?: TokenBaseStaticSpace;
|
|
23
23
|
/** Верхний отступ */
|
|
24
24
|
paddingTop?: TokenBaseStaticSpace;
|
|
25
25
|
/** Нижний отступ */
|
|
26
26
|
paddingBottom?: TokenBaseStaticSpace;
|
|
27
|
-
/** Src картинки результата */
|
|
28
|
-
image?: string;
|
|
29
|
-
/** Ширина картинки результата */
|
|
30
|
-
imageWidth?: number | string;
|
|
31
|
-
/** Высота картинки результата */
|
|
32
|
-
imageHeight?: number | string;
|
|
33
|
-
/** Выравнивание контента по вертикали */
|
|
34
|
-
verticalAlign?: PlaceholderVerticalAlign;
|
|
35
|
-
/** Растяжение кнопок по ширине (false только при одной кнопке) */
|
|
36
|
-
buttonsStretched?: boolean;
|
|
37
|
-
/** Выравнивание кнопок по горизонтали */
|
|
38
|
-
buttonsAlign?: PlaceholderButtonsAlign;
|
|
39
|
-
/** Лейбл картинки для скринридеров (подставляется в alt картинки) */
|
|
40
|
-
'aria-label'?: string;
|
|
41
27
|
/** data-qa атрибут для контейнера */
|
|
42
28
|
'data-qa'?: string;
|
|
29
|
+
/** Выравнивание контента по вертикали */
|
|
30
|
+
verticalAlign?: PlaceholderVerticalAlign;
|
|
43
31
|
}
|
|
44
|
-
interface PlaceholderButtonsProps {
|
|
45
|
-
/** Primary кнопка (компонент Button) */
|
|
46
|
-
buttonPrimary?: ReactElement;
|
|
47
|
-
/** Secondary кнопка (компонент Button) */
|
|
48
|
-
buttonSecondary?: ReactElement;
|
|
49
|
-
/** Tertiary кнопка (компонент Button) */
|
|
50
|
-
buttonTertiary?: ReactElement;
|
|
51
|
-
}
|
|
52
|
-
type PlaceholderButtonsStretchedProps = {
|
|
53
|
-
buttonsStretched?: true;
|
|
54
|
-
} & PlaceholderButtonsProps;
|
|
55
|
-
type PlaceholderButtonsNotStretchedProps = {
|
|
56
|
-
buttonsStretched: false;
|
|
57
|
-
} & AtMostOne<PlaceholderButtonsProps>;
|
|
58
|
-
export type PlaceholderProps = PlaceholderBaseProps & (PlaceholderButtonsStretchedProps | PlaceholderButtonsNotStretchedProps);
|
|
59
|
-
export {};
|