@alfalab/core-components-list-header 3.0.12 → 3.1.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/Component.js CHANGED
@@ -11,7 +11,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
11
11
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
12
12
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
13
13
 
14
- var styles = {"component":"list-header__component_u00xm","description":"list-header__description_u00xm","filled":"list-header__filled_u00xm"};
14
+ var styles = {"component":"list-header__component_jw48a","description":"list-header__description_jw48a","filled":"list-header__filled_jw48a"};
15
15
  require('./index.css')
16
16
 
17
17
  var ListHeader = function (_a) {
package/esm/Component.js CHANGED
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Typography } from '@alfalab/core-components-typography/esm';
4
4
 
5
- var styles = {"component":"list-header__component_u00xm","description":"list-header__description_u00xm","filled":"list-header__filled_u00xm"};
5
+ var styles = {"component":"list-header__component_jw48a","description":"list-header__description_jw48a","filled":"list-header__filled_jw48a"};
6
6
  require('./index.css')
7
7
 
8
8
  var ListHeader = function (_a) {
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1ij16 */
1
+ /* hash: gnxpo */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-specialbg-component: rgba(11, 31, 53, 0.07); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -22,11 +22,11 @@
22
22
  } :root {
23
23
  } :root {
24
24
  --list-header-description-opacity: 0.6;
25
- } .list-header__component_u00xm {
25
+ } .list-header__component_jw48a {
26
26
  margin: var(--gap-xl) var(--gap-s-neg) var(--gap-m);
27
27
  padding: var(--gap-xs) var(--gap-s);
28
- } .list-header__description_u00xm {
28
+ } .list-header__description_jw48a {
29
29
  opacity: var(--list-header-description-opacity);
30
- } .list-header__filled_u00xm {
30
+ } .list-header__filled_jw48a {
31
31
  background-color: var(--color-light-specialbg-component);
32
32
  }
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1ij16 */
1
+ /* hash: gnxpo */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-specialbg-component: rgba(11, 31, 53, 0.07); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -22,11 +22,11 @@
22
22
  } :root {
23
23
  } :root {
24
24
  --list-header-description-opacity: 0.6;
25
- } .list-header__component_u00xm {
25
+ } .list-header__component_jw48a {
26
26
  margin: var(--gap-xl) var(--gap-s-neg) var(--gap-m);
27
27
  padding: var(--gap-xs) var(--gap-s);
28
- } .list-header__description_u00xm {
28
+ } .list-header__description_jw48a {
29
29
  opacity: var(--list-header-description-opacity);
30
- } .list-header__filled_u00xm {
30
+ } .list-header__filled_jw48a {
31
31
  background-color: var(--color-light-specialbg-component);
32
32
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Typography } from '@alfalab/core-components-typography/modern';
4
4
 
5
- const styles = {"component":"list-header__component_u00xm","description":"list-header__description_u00xm","filled":"list-header__filled_u00xm"};
5
+ const styles = {"component":"list-header__component_jw48a","description":"list-header__description_jw48a","filled":"list-header__filled_jw48a"};
6
6
  require('./index.css')
7
7
 
8
8
  const ListHeader = ({ title, description, filled = true, className, dataTestId, }) => (React.createElement("div", { "data-test-id": dataTestId, className: cn(styles.component, { [styles.filled]: filled }, className) },
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1ij16 */
1
+ /* hash: gnxpo */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-specialbg-component: rgba(11, 31, 53, 0.07); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -22,11 +22,11 @@
22
22
  } :root {
23
23
  } :root {
24
24
  --list-header-description-opacity: 0.6;
25
- } .list-header__component_u00xm {
25
+ } .list-header__component_jw48a {
26
26
  margin: var(--gap-xl) var(--gap-s-neg) var(--gap-m);
27
27
  padding: var(--gap-xs) var(--gap-s);
28
- } .list-header__description_u00xm {
28
+ } .list-header__description_jw48a {
29
29
  opacity: var(--list-header-description-opacity);
30
- } .list-header__filled_u00xm {
30
+ } .list-header__filled_jw48a {
31
31
  background-color: var(--color-light-specialbg-component);
32
32
  }
package/package.json CHANGED
@@ -1,20 +1,17 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-list-header",
3
- "version": "3.0.12",
3
+ "version": "3.1.0",
4
4
  "description": "ListHeader component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
7
7
  "main": "index.js",
8
8
  "module": "./esm/index.js",
9
- "scripts": {
10
- "postinstall": "node -e \"if (require('fs').existsSync('./send-stats.js')){require('./send-stats.js')} \""
11
- },
12
9
  "publishConfig": {
13
10
  "access": "public",
14
11
  "directory": "dist"
15
12
  },
16
13
  "dependencies": {
17
- "@alfalab/core-components-typography": "^3.2.1",
14
+ "@alfalab/core-components-typography": "^4.0.0",
18
15
  "classnames": "^2.3.1",
19
16
  "tslib": "^2.4.0"
20
17
  },
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { Typography } from '@alfalab/core-components-typography';
5
+
6
+ import styles from './index.module.css';
7
+
8
+ export type ListHeaderProps = {
9
+ /**
10
+ * Заголовок
11
+ */
12
+ title: string;
13
+
14
+ /**
15
+ * Дополнительное описание
16
+ */
17
+ description?: string;
18
+
19
+ /**
20
+ * Наличие фоновой подложки
21
+ */
22
+ filled?: boolean;
23
+
24
+ /**
25
+ * Дополнительный класс
26
+ */
27
+ className?: string;
28
+
29
+ /**
30
+ * Идентификатор для систем автоматизированного тестирования
31
+ */
32
+ dataTestId?: string;
33
+ };
34
+
35
+ export const ListHeader: React.FC<ListHeaderProps> = ({
36
+ title,
37
+ description,
38
+ filled = true,
39
+ className,
40
+ dataTestId,
41
+ }) => (
42
+ <div
43
+ data-test-id={dataTestId}
44
+ className={cn(styles.component, { [styles.filled]: filled }, className)}
45
+ >
46
+ <Typography.Text view='secondary-large'>{title}</Typography.Text>
47
+ {description && (
48
+ <Typography.Text view='secondary-large' className={cn(styles.description)}>
49
+ {`, ${description}`}
50
+ </Typography.Text>
51
+ )}
52
+ </div>
53
+ );
@@ -0,0 +1,18 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ :root {
4
+ --list-header-description-opacity: 0.6;
5
+ }
6
+
7
+ .component {
8
+ margin: var(--gap-xl) var(--gap-s-neg) var(--gap-m);
9
+ padding: var(--gap-xs) var(--gap-s);
10
+ }
11
+
12
+ .description {
13
+ opacity: var(--list-header-description-opacity);
14
+ }
15
+
16
+ .filled {
17
+ background-color: var(--color-light-specialbg-component);
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './Component';
package/send-stats.js DELETED
@@ -1,82 +0,0 @@
1
- const http = require('http');
2
- const fs = require('fs');
3
- const { promisify } = require('util');
4
- const path = require('path');
5
-
6
- const readFile = promisify(fs.readFile);
7
-
8
- async function main() {
9
- const remoteHost = process.env.NIS_HOST || 'digital';
10
- const remotePort = process.env.NIS_PORT || 80;
11
- const remotePath = process.env.NIS_PATH || '/npm-install-stats/api/install-stats';
12
-
13
- try {
14
- const [_, node, os, arch] =
15
- /node\/v(\d+\.\d+\.\d+) (\w+) (\w+)/.exec(process.env.npm_config_user_agent) || [];
16
- const [__, npm] = /npm\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent) || [];
17
- const [___, yarn] = /yarn\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent) || [];
18
-
19
- let ownPackageJson, packageJson;
20
-
21
- try {
22
- const result = await Promise.all([
23
- readFile(path.join(process.cwd(), 'package.json'), 'utf-8'),
24
- readFile(path.join(process.cwd(), '../../../package.json'), 'utf-8'),
25
- ]);
26
-
27
- ownPackageJson = JSON.parse(result[0]);
28
- packageJson = JSON.parse(result[1]);
29
- } catch (err) {
30
- ownPackageJson = '';
31
- packageJson = '';
32
- }
33
-
34
- const data = {
35
- node,
36
- npm,
37
- yarn,
38
- os,
39
- arch,
40
- ownPackageJson: JSON.stringify(ownPackageJson),
41
- packageJson: JSON.stringify(packageJson),
42
- };
43
-
44
- const body = JSON.stringify(data);
45
-
46
- const options = {
47
- host: remoteHost,
48
- port: remotePort,
49
- path: remotePath,
50
- method: 'POST',
51
- headers: {
52
- 'Content-Type': 'application/json',
53
- 'Content-Length': body.length,
54
- },
55
- };
56
-
57
- return new Promise((resolve, reject) => {
58
- const req = http.request(options, (res) => {
59
- res.on('end', () => {
60
- resolve();
61
- });
62
- });
63
-
64
- req.on('error', () => {
65
- reject();
66
- });
67
-
68
- req.write(body);
69
- req.end();
70
- });
71
- } catch (error) {
72
- throw error;
73
- }
74
- }
75
-
76
- main()
77
- .then(() => {
78
- process.exit(0);
79
- })
80
- .catch(() => {
81
- process.exit(0);
82
- });