@hh.ru/magritte-ui-placeholder 11.1.48 → 11.1.50

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { PlaceholderProps } from '@hh.ru/magritte-ui-placeholder/types';
1
+ import { PlaceholderProps } from './types';
2
2
  export declare const Placeholder: React.FC<PlaceholderProps> & {
3
3
  Image: React.FC<React.ImgHTMLAttributes<HTMLImageElement>>;
4
4
  };
package/Placeholder.js CHANGED
@@ -7,31 +7,69 @@ import { getContainerStyles } from './utils.js';
7
7
  import { VSpacing } from '@hh.ru/magritte-ui-spacing';
8
8
  import { Title } from '@hh.ru/magritte-ui-title';
9
9
 
10
- var styles = {"placeholder":"magritte-placeholder___8EHpb_11-1-48","vertical-align-top":"magritte-vertical-align-top___nmf-X_11-1-48","verticalAlignTop":"magritte-vertical-align-top___nmf-X_11-1-48","vertical-align-center":"magritte-vertical-align-center___-QB1n_11-1-48","verticalAlignCenter":"magritte-vertical-align-center___-QB1n_11-1-48","vertical-align-bottom":"magritte-vertical-align-bottom___l9O6B_11-1-48","verticalAlignBottom":"magritte-vertical-align-bottom___l9O6B_11-1-48","title-container":"magritte-title-container___dki9b_11-1-48","titleContainer":"magritte-title-container___dki9b_11-1-48","image-container":"magritte-image-container___n7AQh_11-1-48","imageContainer":"magritte-image-container___n7AQh_11-1-48","content":"magritte-content___J6qIa_11-1-48","placeholder-image":"magritte-placeholder-image___bMcah_11-1-48","placeholderImage":"magritte-placeholder-image___bMcah_11-1-48","placeholder-image_hidden":"magritte-placeholder-image_hidden___5fOaL_11-1-48","placeholderImageHidden":"magritte-placeholder-image_hidden___5fOaL_11-1-48"};
10
+ var styles = {"placeholder":"magritte-placeholder___8EHpb_11-1-50","vertical-align-top":"magritte-vertical-align-top___nmf-X_11-1-50","verticalAlignTop":"magritte-vertical-align-top___nmf-X_11-1-50","vertical-align-center":"magritte-vertical-align-center___-QB1n_11-1-50","verticalAlignCenter":"magritte-vertical-align-center___-QB1n_11-1-50","vertical-align-bottom":"magritte-vertical-align-bottom___l9O6B_11-1-50","verticalAlignBottom":"magritte-vertical-align-bottom___l9O6B_11-1-50","title-container":"magritte-title-container___dki9b_11-1-50","titleContainer":"magritte-title-container___dki9b_11-1-50","image-container":"magritte-image-container___n7AQh_11-1-50","imageContainer":"magritte-image-container___n7AQh_11-1-50","content":"magritte-content___J6qIa_11-1-50","placeholder-image":"magritte-placeholder-image___bMcah_11-1-50","placeholderImage":"magritte-placeholder-image___bMcah_11-1-50","placeholder-image_hidden":"magritte-placeholder-image_hidden___5fOaL_11-1-50","placeholderImageHidden":"magritte-placeholder-image_hidden___5fOaL_11-1-50"};
11
11
 
12
12
  const PLACEHOLDER_IMAGE_HEIGHT = 200;
13
- const Placeholder = ({ title, titleProps, description, children, buttons, maxWidth, minHeight, gapTop = 24, gapBottom = 24, paddingTop, paddingBottom, 'data-qa': dataQa, verticalAlign = 'center', }) => {
14
- return (jsxs("div", { className: classnames(styles.placeholder, {
15
- [styles.verticalAlignTop]: verticalAlign === 'top',
16
- [styles.verticalAlignCenter]: verticalAlign === 'center',
17
- [styles.verticalAlignBottom]: verticalAlign === 'bottom',
18
- }), style: getContainerStyles({ paddingTop, paddingBottom, maxWidth, minHeight }), "data-qa": dataQa, children: [isValidElement(children) && children.type === Placeholder.Image ? (children) : (jsx("div", { className: styles.content, 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 })] }));
13
+ const Placeholder = ({
14
+ title,
15
+ titleProps,
16
+ description,
17
+ children,
18
+ buttons,
19
+ maxWidth,
20
+ minHeight,
21
+ gapTop = 24,
22
+ gapBottom = 24,
23
+ paddingTop,
24
+ paddingBottom,
25
+ "data-qa": dataQa,
26
+ verticalAlign = "center"
27
+ }) => {
28
+ return /* @__PURE__ */ jsxs(
29
+ "div",
30
+ {
31
+ className: classnames(styles.placeholder, {
32
+ [styles.verticalAlignTop]: verticalAlign === "top",
33
+ [styles.verticalAlignCenter]: verticalAlign === "center",
34
+ [styles.verticalAlignBottom]: verticalAlign === "bottom"
35
+ }),
36
+ style: getContainerStyles({ paddingTop, paddingBottom, maxWidth, minHeight }),
37
+ "data-qa": dataQa,
38
+ children: [
39
+ isValidElement(children) && children.type === Placeholder.Image ? children : /* @__PURE__ */ jsx("div", { className: styles.content, children }),
40
+ Boolean(children) && /* @__PURE__ */ jsx(VSpacing, { default: gapTop }),
41
+ /* @__PURE__ */ jsx("div", { className: styles.titleContainer, children: /* @__PURE__ */ jsx(Title, { size: "medium", alignment: "center", Element: "h2", description, ...titleProps, children: title }) }),
42
+ Boolean(buttons) && /* @__PURE__ */ jsx(VSpacing, { default: gapBottom }),
43
+ /* @__PURE__ */ jsx("div", { className: CENTERED_WRAPPER_CLASS, children: buttons })
44
+ ]
45
+ }
46
+ );
19
47
  };
20
48
  const PlaceholderImage = (props) => {
21
- const [isLoaded, setIsLoaded] = useState(false);
22
- const [isLoadingError, setIsLoadingError] = useState(false);
23
- return (jsx("div", { className: styles.imageContainer, children: jsx("img", { ...props, onLoad: (event) => {
24
- props.onLoad?.(event);
25
- setIsLoaded(true);
26
- }, onError: (event) => {
27
- props.onError?.(event);
28
- setIsLoaded(false);
29
- setIsLoadingError(true);
30
- }, className: classnames(props.className, styles.placeholderImage, {
31
- [styles.placeholderImageHidden]: isLoadingError,
32
- }), width: props.width, height: !isLoaded && !props.height ? PLACEHOLDER_IMAGE_HEIGHT : props.height }) }));
49
+ const [isLoaded, setIsLoaded] = useState(false);
50
+ const [isLoadingError, setIsLoadingError] = useState(false);
51
+ return /* @__PURE__ */ jsx("div", { className: styles.imageContainer, children: /* @__PURE__ */ jsx(
52
+ "img",
53
+ {
54
+ ...props,
55
+ onLoad: (event) => {
56
+ props.onLoad?.(event);
57
+ setIsLoaded(true);
58
+ },
59
+ onError: (event) => {
60
+ props.onError?.(event);
61
+ setIsLoaded(false);
62
+ setIsLoadingError(true);
63
+ },
64
+ className: classnames(props.className, styles.placeholderImage, {
65
+ [styles.placeholderImageHidden]: isLoadingError
66
+ }),
67
+ width: props.width,
68
+ height: !isLoaded && !props.height ? PLACEHOLDER_IMAGE_HEIGHT : props.height
69
+ }
70
+ ) });
33
71
  };
34
- PlaceholderImage.displayName = 'Placeholder.Image';
72
+ PlaceholderImage.displayName = "Placeholder.Image";
35
73
  Placeholder.Image = PlaceholderImage;
36
74
 
37
75
  export { Placeholder };
@@ -1 +1 @@
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 { 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}>{children}</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":";;;;;;;;;;AAWA,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAExB,MAAA,WAAW,GAEpB,CAAC,EACD,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,OAAO,EAEP,QAAQ,EACR,SAAS,EACT,MAAM,GAAG,EAAE,EACX,SAAS,GAAG,EAAE,EACd,UAAU,EACV,aAAa,EAEb,SAAS,EAAE,MAAM,EACjB,aAAa,GAAG,QAAQ,GAC3B,KAAI;IACD,QACIA,cACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE;AACtC,YAAA,CAAC,MAAM,CAAC,gBAAgB,GAAG,aAAa,KAAK,KAAK;AAClD,YAAA,CAAC,MAAM,CAAC,mBAAmB,GAAG,aAAa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C5D,IAAA,QACIA,GAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,cAAc,EAAA,QAAA,EACjCA,GACQ,CAAA,KAAA,EAAA,EAAA,GAAA,KAAK,EACT,MAAM,EAAE,CAAC,KAAK,KAAI;AACd,gBAAA,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;gBACtB,WAAW,CAAC,IAAI,CAAC,CAAC;AACtB,aAAC,EACD,OAAO,EAAE,CAAC,KAAK,KAAI;AACf,gBAAA,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;gBACvB,WAAW,CAAC,KAAK,CAAC,CAAC;gBACnB,iBAAiB,CAAC,IAAI,CAAC,CAAC;AAC5B,aAAC,EACD,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAE;AAC5D,gBAAA,CAAC,MAAM,CAAC,sBAAsB,GAAG,cAAc;AAClD,aAAA,CAAC,EACF,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,MAAM,EAAE,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,wBAAwB,GAAG,KAAK,CAAC,MAAM,EAC9E,CAAA,EAAA,CACA,EACR;AACN,CAAC,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AACnD,WAAW,CAAC,KAAK,GAAG,gBAAgB;;;;"}
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 { 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}>{children}</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":[],"mappings":";;;;;;;;;;AAWA,MAAM,wBAA2B,G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AAA,GAAS,2BAA2B,KAAM,CAAA,MAAA;AAAA,KAAA;AAAA,GAE9E,EAAA,CAAA,CAAA;AAER,CAAA,CAAA;AAEA,gBAAA,CAAiB,WAAc,GAAA,mBAAA,CAAA;AAC/B,WAAA,CAAY,KAAQ,GAAA,gBAAA;;;;"}
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- .magritte-placeholder___8EHpb_11-1-48{
1
+ .magritte-placeholder___8EHpb_11-1-50{
2
2
  display:flex;
3
3
  flex-direction:column;
4
4
  flex:1;
@@ -6,33 +6,33 @@
6
6
  height:inherit;
7
7
  box-sizing:border-box;
8
8
  }
9
- .magritte-vertical-align-top___nmf-X_11-1-48{
9
+ .magritte-vertical-align-top___nmf-X_11-1-50{
10
10
  justify-content:flex-start;
11
11
  }
12
- .magritte-vertical-align-center___-QB1n_11-1-48{
12
+ .magritte-vertical-align-center___-QB1n_11-1-50{
13
13
  justify-content:center;
14
14
  }
15
- .magritte-vertical-align-bottom___l9O6B_11-1-48{
15
+ .magritte-vertical-align-bottom___l9O6B_11-1-50{
16
16
  justify-content:flex-end;
17
17
  }
18
- .magritte-title-container___dki9b_11-1-48{
18
+ .magritte-title-container___dki9b_11-1-50{
19
19
  padding:0 12px;
20
20
  }
21
- .magritte-image-container___n7AQh_11-1-48{
21
+ .magritte-image-container___n7AQh_11-1-50{
22
22
  display:flex;
23
23
  align-content:center;
24
24
  justify-content:center;
25
25
  min-height:0;
26
26
  }
27
- .magritte-content___J6qIa_11-1-48{
27
+ .magritte-content___J6qIa_11-1-50{
28
28
  display:flex;
29
29
  justify-content:center;
30
30
  }
31
- .magritte-placeholder-image___bMcah_11-1-48{
31
+ .magritte-placeholder-image___bMcah_11-1-50{
32
32
  max-width:100%;
33
33
  max-height:100%;
34
34
  object-fit:contain;
35
35
  }
36
- .magritte-placeholder-image_hidden___5fOaL_11-1-48{
36
+ .magritte-placeholder-image_hidden___5fOaL_11-1-50{
37
37
  visibility:hidden;
38
38
  }
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from '@hh.ru/magritte-ui-placeholder/Placeholder';
2
- export { type PlaceholderProps, type PlaceholderVerticalAlign } from '@hh.ru/magritte-ui-placeholder/types';
1
+ export * from './Placeholder';
2
+ export { type PlaceholderProps, type PlaceholderVerticalAlign } from './types';
package/index.mock.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { FC } from 'react';
2
- export { type PlaceholderProps, type PlaceholderVerticalAlign } from '@hh.ru/magritte-ui-placeholder/types';
2
+ export { type PlaceholderProps, type PlaceholderVerticalAlign } from './types';
3
3
  export declare const Placeholder: FC<Record<string, unknown>>;
package/index.mock.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import './index.css';
2
2
  import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
3
3
 
4
- const Placeholder = mockComponent('Placeholder', undefined, {
5
- withChildren: true,
4
+ const Placeholder = mockComponent("Placeholder", void 0, {
5
+ withChildren: true
6
6
  });
7
7
 
8
8
  export { Placeholder };
package/index.mock.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { FC } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport { type PlaceholderProps, type PlaceholderVerticalAlign } from '@hh.ru/magritte-ui-placeholder/types';\n\nexport const Placeholder: FC<Record<string, unknown>> = mockComponent('Placeholder', undefined, {\n withChildren: true,\n});\n"],"names":[],"mappings":";;MAMa,WAAW,GAAgC,aAAa,CAAC,aAAa,EAAE,SAAS,EAAE;AAC5F,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
1
+ {"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { FC } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport { type PlaceholderProps, type PlaceholderVerticalAlign } from '@hh.ru/magritte-ui-placeholder/types';\n\nexport const Placeholder: FC<Record<string, unknown>> = mockComponent('Placeholder', undefined, {\n withChildren: true,\n});\n"],"names":[],"mappings":";;AAMa,MAAA,WAAA,GAA2C,aAAc,CAAA,aAAA,EAAe,KAAW,CAAA,EAAA;AAAA,EAC5F,YAAc,EAAA,IAAA;AAClB,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-placeholder",
3
- "version": "11.1.48",
3
+ "version": "11.1.50",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -16,15 +16,16 @@
16
16
  "ts-config": "yarn root:ts-config $(pwd)",
17
17
  "ts-check": "yarn root:ts-check $(pwd)",
18
18
  "test": "jest $(pwd)",
19
+ "test:types": "yarn root:test:types $(pwd)",
19
20
  "watch": "yarn root:watch $(pwd)"
20
21
  },
21
22
  "dependencies": {
22
- "@hh.ru/magritte-design-tokens": "26.0.0",
23
- "@hh.ru/magritte-ui-breakpoint": "6.1.2",
24
- "@hh.ru/magritte-ui-button-stack": "4.0.35",
25
- "@hh.ru/magritte-ui-mock-component": "1.1.8",
26
- "@hh.ru/magritte-ui-spacing": "2.1.30",
27
- "@hh.ru/magritte-ui-title": "8.3.13"
23
+ "@hh.ru/magritte-design-tokens": "26.0.2",
24
+ "@hh.ru/magritte-ui-breakpoint": "6.1.3",
25
+ "@hh.ru/magritte-ui-button-stack": "4.0.37",
26
+ "@hh.ru/magritte-ui-mock-component": "1.1.9",
27
+ "@hh.ru/magritte-ui-spacing": "2.1.32",
28
+ "@hh.ru/magritte-ui-title": "8.3.15"
28
29
  },
29
30
  "peerDependencies": {
30
31
  "classnames": ">=2.3.2",
@@ -33,5 +34,5 @@
33
34
  "publishConfig": {
34
35
  "access": "public"
35
36
  },
36
- "gitHead": "b0ff5da48fb29d516c8289082560ee1882d16986"
37
+ "gitHead": "33dbaa1dc9b9705e925ffc9f6fcc7a0dc153bd36"
37
38
  }
package/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { PlaceholderProps } from '@hh.ru/magritte-ui-placeholder/types';
1
+ import { PlaceholderProps } from './types';
2
2
  export declare const getContainerStyles: ({ paddingTop, paddingBottom, maxWidth, minHeight, }: {
3
- paddingTop: PlaceholderProps["paddingTop"];
4
- paddingBottom: PlaceholderProps["paddingBottom"];
5
- maxWidth: PlaceholderProps["maxWidth"];
6
- minHeight: PlaceholderProps["minHeight"];
3
+ paddingTop: PlaceholderProps['paddingTop'];
4
+ paddingBottom: PlaceholderProps['paddingBottom'];
5
+ maxWidth: PlaceholderProps['maxWidth'];
6
+ minHeight: PlaceholderProps['minHeight'];
7
7
  }) => Record<string, string>;
package/utils.js CHANGED
@@ -1,19 +1,24 @@
1
1
  import './index.css';
2
- const getContainerStyles = ({ paddingTop, paddingBottom, maxWidth, minHeight, }) => {
3
- const containerStyles = {};
4
- if (paddingTop !== undefined) {
5
- containerStyles.paddingTop = `${paddingTop}px`;
6
- }
7
- if (paddingBottom !== undefined) {
8
- containerStyles.paddingBottom = `${paddingBottom}px`;
9
- }
10
- if (maxWidth !== undefined) {
11
- containerStyles.maxWidth = `${maxWidth}${isNaN(+maxWidth) ? '' : 'px'}`;
12
- }
13
- if (minHeight !== undefined) {
14
- containerStyles.minHeight = `${minHeight}px`;
15
- }
16
- return containerStyles;
2
+ const getContainerStyles = ({
3
+ paddingTop,
4
+ paddingBottom,
5
+ maxWidth,
6
+ minHeight
7
+ }) => {
8
+ const containerStyles = {};
9
+ if (paddingTop !== void 0) {
10
+ containerStyles.paddingTop = `${paddingTop}px`;
11
+ }
12
+ if (paddingBottom !== void 0) {
13
+ containerStyles.paddingBottom = `${paddingBottom}px`;
14
+ }
15
+ if (maxWidth !== void 0) {
16
+ containerStyles.maxWidth = `${maxWidth}${isNaN(+maxWidth) ? "" : "px"}`;
17
+ }
18
+ if (minHeight !== void 0) {
19
+ containerStyles.minHeight = `${minHeight}px`;
20
+ }
21
+ return containerStyles;
17
22
  };
18
23
 
19
24
  export { getContainerStyles };
package/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["src/utils.ts"],"sourcesContent":["import { PlaceholderProps } from '@hh.ru/magritte-ui-placeholder/types';\n\nexport const getContainerStyles = ({\n paddingTop,\n paddingBottom,\n maxWidth,\n minHeight,\n}: {\n paddingTop: PlaceholderProps['paddingTop'];\n paddingBottom: PlaceholderProps['paddingBottom'];\n maxWidth: PlaceholderProps['maxWidth'];\n minHeight: PlaceholderProps['minHeight'];\n}): Record<string, string> => {\n const containerStyles: Record<string, string> = {};\n if (paddingTop !== undefined) {\n containerStyles.paddingTop = `${paddingTop}px`;\n }\n if (paddingBottom !== undefined) {\n containerStyles.paddingBottom = `${paddingBottom}px`;\n }\n if (maxWidth !== undefined) {\n containerStyles.maxWidth = `${maxWidth}${isNaN(+maxWidth) ? '' : 'px'}`;\n }\n if (minHeight !== undefined) {\n containerStyles.minHeight = `${minHeight}px`;\n }\n return containerStyles;\n};\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAG,CAAC,EAC/B,UAAU,EACV,aAAa,EACb,QAAQ,EACR,SAAS,GAMZ,KAA4B;IACzB,MAAM,eAAe,GAA2B,EAAE,CAAC;AACnD,IAAA,IAAI,UAAU,KAAK,SAAS,EAAE;AAC1B,QAAA,eAAe,CAAC,UAAU,GAAG,CAAG,EAAA,UAAU,IAAI,CAAC;KAClD;AACD,IAAA,IAAI,aAAa,KAAK,SAAS,EAAE;AAC7B,QAAA,eAAe,CAAC,aAAa,GAAG,CAAG,EAAA,aAAa,IAAI,CAAC;KACxD;AACD,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;QACxB,eAAe,CAAC,QAAQ,GAAG,CAAA,EAAG,QAAQ,CAAG,EAAA,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;KAC3E;AACD,IAAA,IAAI,SAAS,KAAK,SAAS,EAAE;AACzB,QAAA,eAAe,CAAC,SAAS,GAAG,CAAG,EAAA,SAAS,IAAI,CAAC;KAChD;AACD,IAAA,OAAO,eAAe,CAAC;AAC3B;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["src/utils.ts"],"sourcesContent":["import { PlaceholderProps } from '@hh.ru/magritte-ui-placeholder/types';\n\nexport const getContainerStyles = ({\n paddingTop,\n paddingBottom,\n maxWidth,\n minHeight,\n}: {\n paddingTop: PlaceholderProps['paddingTop'];\n paddingBottom: PlaceholderProps['paddingBottom'];\n maxWidth: PlaceholderProps['maxWidth'];\n minHeight: PlaceholderProps['minHeight'];\n}): Record<string, string> => {\n const containerStyles: Record<string, string> = {};\n if (paddingTop !== undefined) {\n containerStyles.paddingTop = `${paddingTop}px`;\n }\n if (paddingBottom !== undefined) {\n containerStyles.paddingBottom = `${paddingBottom}px`;\n }\n if (maxWidth !== undefined) {\n containerStyles.maxWidth = `${maxWidth}${isNaN(+maxWidth) ? '' : 'px'}`;\n }\n if (minHeight !== undefined) {\n containerStyles.minHeight = `${minHeight}px`;\n }\n return containerStyles;\n};\n"],"names":[],"mappings":"AAEO,MAAM,qBAAqB,CAAC;AAAA,EAC/B,UAAA;AAAA,EACA,aAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AACJ,CAK8B,KAAA;AAC1B,EAAA,MAAM,kBAA0C,EAAC,CAAA;AACjD,EAAA,IAAI,eAAe,KAAW,CAAA,EAAA;AAC1B,IAAgB,eAAA,CAAA,UAAA,GAAa,GAAG,UAAU,CAAA,EAAA,CAAA,CAAA;AAAA,GAC9C;AACA,EAAA,IAAI,kBAAkB,KAAW,CAAA,EAAA;AAC7B,IAAgB,eAAA,CAAA,aAAA,GAAgB,GAAG,aAAa,CAAA,EAAA,CAAA,CAAA;AAAA,GACpD;AACA,EAAA,IAAI,aAAa,KAAW,CAAA,EAAA;AACxB,IAAgB,eAAA,CAAA,QAAA,GAAW,GAAG,QAAQ,CAAA,EAAG,MAAM,CAAC,QAAQ,CAAI,GAAA,EAAA,GAAK,IAAI,CAAA,CAAA,CAAA;AAAA,GACzE;AACA,EAAA,IAAI,cAAc,KAAW,CAAA,EAAA;AACzB,IAAgB,eAAA,CAAA,SAAA,GAAY,GAAG,SAAS,CAAA,EAAA,CAAA,CAAA;AAAA,GAC5C;AACA,EAAO,OAAA,eAAA,CAAA;AACX;;;;"}