@alfalab/core-components-list 3.2.1 → 3.3.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.
Files changed (37) hide show
  1. package/{Component-6858e395.js → Component-3157d73d.js} +2 -2
  2. package/Component.js +1 -1
  3. package/components/item/Component.js +1 -1
  4. package/components/item/index.css +10 -10
  5. package/components/item/index.d.ts +1 -1
  6. package/components/item/index.js +1 -1
  7. package/esm/{Component-bb93aa74.js → Component-3900b562.js} +2 -2
  8. package/esm/Component.js +1 -1
  9. package/esm/components/item/Component.js +1 -1
  10. package/esm/components/item/index.css +10 -10
  11. package/esm/components/item/index.d.ts +1 -1
  12. package/esm/components/item/index.js +1 -1
  13. package/esm/index.css +6 -6
  14. package/esm/index.js +1 -1
  15. package/index.css +6 -6
  16. package/index.js +1 -1
  17. package/modern/{Component-cfeaa92e.js → Component-de49b78c.js} +2 -2
  18. package/modern/Component.js +1 -1
  19. package/modern/components/item/Component.js +1 -1
  20. package/modern/components/item/index.css +10 -10
  21. package/modern/components/item/index.d.ts +1 -1
  22. package/modern/components/item/index.js +1 -1
  23. package/modern/index.css +6 -6
  24. package/modern/index.js +1 -1
  25. package/package.json +2 -5
  26. package/src/Component.tsx +145 -0
  27. package/src/components/item/Component.tsx +79 -0
  28. package/src/components/item/index.module.css +49 -0
  29. package/src/components/item/index.ts +1 -0
  30. package/src/index.module.css +27 -0
  31. package/src/index.ts +2 -0
  32. package/src/presets.ts +6 -0
  33. package/src/utils.ts +7 -0
  34. package/send-stats.js +0 -82
  35. /package/{Component-6858e395.d.ts → Component-3157d73d.d.ts} +0 -0
  36. /package/esm/{Component-bb93aa74.d.ts → Component-3900b562.d.ts} +0 -0
  37. /package/modern/{Component-cfeaa92e.d.ts → Component-de49b78c.d.ts} +0 -0
@@ -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$1 = {"item":"list__item_1hiip","reversed":"list__reversed_1hiip","unorderedItem":"list__unorderedItem_1hiip","slot":"list__slot_1hiip","defaultColor":"list__defaultColor_1hiip","disc":"list__disc_1hiip","caption":"list__caption_1hiip"};
14
+ var styles$1 = {"item":"list__item_1x6qc","reversed":"list__reversed_1x6qc","unorderedItem":"list__unorderedItem_1x6qc","slot":"list__slot_1x6qc","defaultColor":"list__defaultColor_1x6qc","disc":"list__disc_1x6qc","caption":"list__caption_1x6qc"};
15
15
  require('./components/item/index.css')
16
16
 
17
17
  var Item = function (_a) {
@@ -37,7 +37,7 @@ var Item = function (_a) {
37
37
  };
38
38
  Item.displayName = 'ListItem';
39
39
 
40
- var styles = {"list":"list__list_1o0md","lowerAlpha":"list__lowerAlpha_1o0md","decimal":"list__decimal_1o0md","reversed":"list__reversed_1o0md"};
40
+ var styles = {"list":"list__list_19fx8","lowerAlpha":"list__lowerAlpha_19fx8","decimal":"list__decimal_19fx8","reversed":"list__reversed_19fx8"};
41
41
  require('./index.css')
42
42
 
43
43
  var ListContext = React__default.default.createContext({});
package/Component.js CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  require('tslib');
6
6
  require('react');
7
7
  require('classnames');
8
- var components_item_Component = require('./Component-6858e395.js');
8
+ var components_item_Component = require('./Component-3157d73d.js');
9
9
  require('./utils.js');
10
10
  require('@alfalab/core-components-typography');
11
11
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  require('react');
6
6
  require('classnames');
7
7
  require('@alfalab/core-components-typography');
8
- var components_item_Component = require('../../Component-6858e395.js');
8
+ var components_item_Component = require('../../Component-3157d73d.js');
9
9
  require('tslib');
10
10
  require('../../utils.js');
11
11
 
@@ -1,4 +1,4 @@
1
- /* hash: 128f6 */
1
+ /* hash: pk0lo */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e; /* 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 */
@@ -21,29 +21,29 @@
21
21
  } :root {
22
22
  --list-marker-color: var(--color-light-text-primary);
23
23
  --list-item-margin: var(--gap-s);
24
- } .list__item_1hiip {
24
+ } .list__item_1x6qc {
25
25
  margin-top: var(--list-item-margin);
26
26
  display: flex
27
- } .list__item_1hiip:first-child {
27
+ } .list__item_1x6qc:first-child {
28
28
  margin-top: 0;
29
- } .list__item_1hiip.list__reversed_1hiip:first-child {
29
+ } .list__item_1x6qc.list__reversed_1x6qc:first-child {
30
30
  margin-top: var(--list-item-margin);
31
- } .list__item_1hiip.list__reversed_1hiip:last-child {
31
+ } .list__item_1x6qc.list__reversed_1x6qc:last-child {
32
32
  margin-top: 0;
33
- } .list__item_1hiip.list__unorderedItem_1hiip {
33
+ } .list__item_1x6qc.list__unorderedItem_1x6qc {
34
34
  display: list-item;
35
- } .list__slot_1hiip {
35
+ } .list__slot_1x6qc {
36
36
  min-width: 20px;
37
37
  display: flex;
38
38
  box-sizing: border-box;
39
39
  justify-content: start;
40
40
  padding-right: var(--gap-2xs);
41
41
  flex-shrink: 0
42
- } .list__slot_1hiip.list__defaultColor_1hiip {
42
+ } .list__slot_1x6qc.list__defaultColor_1x6qc {
43
43
  color: var(--list-marker-color);
44
- } .list__slot_1hiip.list__disc_1hiip {
44
+ } .list__slot_1x6qc.list__disc_1x6qc {
45
45
  justify-content: center;
46
46
  padding: 0 var(--gap-2xs);
47
- } .list__caption_1hiip {
47
+ } .list__caption_1x6qc {
48
48
  margin-top: var(--gap-3xs);
49
49
  }
@@ -1 +1 @@
1
- export * from "../../Component-6858e395";
1
+ export * from "../../Component-3157d73d";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var components_item_Component = require('../../Component-6858e395.js');
5
+ var components_item_Component = require('../../Component-3157d73d.js');
6
6
  require('tslib');
7
7
  require('react');
8
8
  require('classnames');
@@ -4,7 +4,7 @@ import cn from 'classnames';
4
4
  import { Typography } from '@alfalab/core-components-typography/esm';
5
5
  import { isItem } from './utils.js';
6
6
 
7
- var styles$1 = {"item":"list__item_1hiip","reversed":"list__reversed_1hiip","unorderedItem":"list__unorderedItem_1hiip","slot":"list__slot_1hiip","defaultColor":"list__defaultColor_1hiip","disc":"list__disc_1hiip","caption":"list__caption_1hiip"};
7
+ var styles$1 = {"item":"list__item_1x6qc","reversed":"list__reversed_1x6qc","unorderedItem":"list__unorderedItem_1x6qc","slot":"list__slot_1x6qc","defaultColor":"list__defaultColor_1x6qc","disc":"list__disc_1x6qc","caption":"list__caption_1x6qc"};
8
8
  require('./components/item/index.css')
9
9
 
10
10
  var Item = function (_a) {
@@ -30,7 +30,7 @@ var Item = function (_a) {
30
30
  };
31
31
  Item.displayName = 'ListItem';
32
32
 
33
- var styles = {"list":"list__list_1o0md","lowerAlpha":"list__lowerAlpha_1o0md","decimal":"list__decimal_1o0md","reversed":"list__reversed_1o0md"};
33
+ var styles = {"list":"list__list_19fx8","lowerAlpha":"list__lowerAlpha_19fx8","decimal":"list__decimal_19fx8","reversed":"list__reversed_19fx8"};
34
34
  require('./index.css')
35
35
 
36
36
  var ListContext = React.createContext({});
package/esm/Component.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'tslib';
2
2
  import 'react';
3
3
  import 'classnames';
4
- export { a as List, L as ListContext } from './Component-bb93aa74.js';
4
+ export { a as List, L as ListContext } from './Component-3900b562.js';
5
5
  import './utils.js';
6
6
  import '@alfalab/core-components-typography/esm';
@@ -1,6 +1,6 @@
1
1
  import 'react';
2
2
  import 'classnames';
3
3
  import '@alfalab/core-components-typography/esm';
4
- export { I as Item } from '../../Component-bb93aa74.js';
4
+ export { I as Item } from '../../Component-3900b562.js';
5
5
  import 'tslib';
6
6
  import '../../utils.js';
@@ -1,4 +1,4 @@
1
- /* hash: 128f6 */
1
+ /* hash: pk0lo */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e; /* 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 */
@@ -21,29 +21,29 @@
21
21
  } :root {
22
22
  --list-marker-color: var(--color-light-text-primary);
23
23
  --list-item-margin: var(--gap-s);
24
- } .list__item_1hiip {
24
+ } .list__item_1x6qc {
25
25
  margin-top: var(--list-item-margin);
26
26
  display: flex
27
- } .list__item_1hiip:first-child {
27
+ } .list__item_1x6qc:first-child {
28
28
  margin-top: 0;
29
- } .list__item_1hiip.list__reversed_1hiip:first-child {
29
+ } .list__item_1x6qc.list__reversed_1x6qc:first-child {
30
30
  margin-top: var(--list-item-margin);
31
- } .list__item_1hiip.list__reversed_1hiip:last-child {
31
+ } .list__item_1x6qc.list__reversed_1x6qc:last-child {
32
32
  margin-top: 0;
33
- } .list__item_1hiip.list__unorderedItem_1hiip {
33
+ } .list__item_1x6qc.list__unorderedItem_1x6qc {
34
34
  display: list-item;
35
- } .list__slot_1hiip {
35
+ } .list__slot_1x6qc {
36
36
  min-width: 20px;
37
37
  display: flex;
38
38
  box-sizing: border-box;
39
39
  justify-content: start;
40
40
  padding-right: var(--gap-2xs);
41
41
  flex-shrink: 0
42
- } .list__slot_1hiip.list__defaultColor_1hiip {
42
+ } .list__slot_1x6qc.list__defaultColor_1x6qc {
43
43
  color: var(--list-marker-color);
44
- } .list__slot_1hiip.list__disc_1hiip {
44
+ } .list__slot_1x6qc.list__disc_1x6qc {
45
45
  justify-content: center;
46
46
  padding: 0 var(--gap-2xs);
47
- } .list__caption_1hiip {
47
+ } .list__caption_1x6qc {
48
48
  margin-top: var(--gap-3xs);
49
49
  }
@@ -1 +1 @@
1
- export * from "../../Component-bb93aa74";
1
+ export * from "../../Component-3900b562";
@@ -1,4 +1,4 @@
1
- export { I as Item } from '../../Component-bb93aa74.js';
1
+ export { I as Item } from '../../Component-3900b562.js';
2
2
  import 'tslib';
3
3
  import 'react';
4
4
  import 'classnames';
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1fkvi */
1
+ /* hash: wy4kp */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e; /* 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 */
@@ -16,7 +16,7 @@
16
16
  --gap-l: 20px;
17
17
  } :root {
18
18
  } :root {
19
- } .list__list_1o0md {
19
+ } .list__list_19fx8 {
20
20
  margin: 0;
21
21
  padding: 0;
22
22
  color: var(--color-light-text-primary);
@@ -26,14 +26,14 @@
26
26
  line-height: 24px;
27
27
 
28
28
  font-weight: 400;
29
- } .list__lowerAlpha_1o0md {
29
+ } .list__lowerAlpha_19fx8 {
30
30
  list-style-type: lower-alpha;
31
31
  padding-left: var(--gap-l);
32
- } .list__decimal_1o0md {
32
+ } .list__decimal_19fx8 {
33
33
  list-style-type: decimal;
34
- } ol.list__list_1o0md {
34
+ } ol.list__list_19fx8 {
35
35
  display: flex;
36
36
  flex-direction: column
37
- } ol.list__list_1o0md.list__reversed_1o0md {
37
+ } ol.list__list_19fx8.list__reversed_19fx8 {
38
38
  flex-direction: column-reverse;
39
39
  }
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { a as List, L as ListContext } from './Component-bb93aa74.js';
1
+ export { a as List, L as ListContext } from './Component-3900b562.js';
2
2
  export { listPresets } from './presets.js';
3
3
  import 'tslib';
4
4
  import 'react';
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1fkvi */
1
+ /* hash: wy4kp */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e; /* 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 */
@@ -16,7 +16,7 @@
16
16
  --gap-l: 20px;
17
17
  } :root {
18
18
  } :root {
19
- } .list__list_1o0md {
19
+ } .list__list_19fx8 {
20
20
  margin: 0;
21
21
  padding: 0;
22
22
  color: var(--color-light-text-primary);
@@ -26,14 +26,14 @@
26
26
  line-height: 24px;
27
27
 
28
28
  font-weight: 400;
29
- } .list__lowerAlpha_1o0md {
29
+ } .list__lowerAlpha_19fx8 {
30
30
  list-style-type: lower-alpha;
31
31
  padding-left: var(--gap-l);
32
- } .list__decimal_1o0md {
32
+ } .list__decimal_19fx8 {
33
33
  list-style-type: decimal;
34
- } ol.list__list_1o0md {
34
+ } ol.list__list_19fx8 {
35
35
  display: flex;
36
36
  flex-direction: column
37
- } ol.list__list_1o0md.list__reversed_1o0md {
37
+ } ol.list__list_19fx8.list__reversed_19fx8 {
38
38
  flex-direction: column-reverse;
39
39
  }
package/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var components_item_Component = require('./Component-6858e395.js');
5
+ var components_item_Component = require('./Component-3157d73d.js');
6
6
  var presets = require('./presets.js');
7
7
  require('tslib');
8
8
  require('react');
@@ -3,7 +3,7 @@ import cn from 'classnames';
3
3
  import { Typography } from '@alfalab/core-components-typography/modern';
4
4
  import { isItem } from './utils.js';
5
5
 
6
- const styles$1 = {"item":"list__item_1hiip","reversed":"list__reversed_1hiip","unorderedItem":"list__unorderedItem_1hiip","slot":"list__slot_1hiip","defaultColor":"list__defaultColor_1hiip","disc":"list__disc_1hiip","caption":"list__caption_1hiip"};
6
+ const styles$1 = {"item":"list__item_1x6qc","reversed":"list__reversed_1x6qc","unorderedItem":"list__unorderedItem_1x6qc","slot":"list__slot_1x6qc","defaultColor":"list__defaultColor_1x6qc","disc":"list__disc_1x6qc","caption":"list__caption_1x6qc"};
7
7
  require('./components/item/index.css')
8
8
 
9
9
  const Item = ({ caption, children }) => {
@@ -27,7 +27,7 @@ const Item = ({ caption, children }) => {
27
27
  };
28
28
  Item.displayName = 'ListItem';
29
29
 
30
- const styles = {"list":"list__list_1o0md","lowerAlpha":"list__lowerAlpha_1o0md","decimal":"list__decimal_1o0md","reversed":"list__reversed_1o0md"};
30
+ const styles = {"list":"list__list_19fx8","lowerAlpha":"list__lowerAlpha_19fx8","decimal":"list__decimal_19fx8","reversed":"list__reversed_19fx8"};
31
31
  require('./index.css')
32
32
 
33
33
  const ListContext = React.createContext({});
@@ -1,5 +1,5 @@
1
1
  import 'react';
2
2
  import 'classnames';
3
- export { a as List, L as ListContext } from './Component-cfeaa92e.js';
3
+ export { a as List, L as ListContext } from './Component-de49b78c.js';
4
4
  import './utils.js';
5
5
  import '@alfalab/core-components-typography/modern';
@@ -1,5 +1,5 @@
1
1
  import 'react';
2
2
  import 'classnames';
3
3
  import '@alfalab/core-components-typography/modern';
4
- export { I as Item } from '../../Component-cfeaa92e.js';
4
+ export { I as Item } from '../../Component-de49b78c.js';
5
5
  import '../../utils.js';
@@ -1,4 +1,4 @@
1
- /* hash: 128f6 */
1
+ /* hash: pk0lo */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e; /* 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 */
@@ -21,29 +21,29 @@
21
21
  } :root {
22
22
  --list-marker-color: var(--color-light-text-primary);
23
23
  --list-item-margin: var(--gap-s);
24
- } .list__item_1hiip {
24
+ } .list__item_1x6qc {
25
25
  margin-top: var(--list-item-margin);
26
26
  display: flex
27
- } .list__item_1hiip:first-child {
27
+ } .list__item_1x6qc:first-child {
28
28
  margin-top: 0;
29
- } .list__item_1hiip.list__reversed_1hiip:first-child {
29
+ } .list__item_1x6qc.list__reversed_1x6qc:first-child {
30
30
  margin-top: var(--list-item-margin);
31
- } .list__item_1hiip.list__reversed_1hiip:last-child {
31
+ } .list__item_1x6qc.list__reversed_1x6qc:last-child {
32
32
  margin-top: 0;
33
- } .list__item_1hiip.list__unorderedItem_1hiip {
33
+ } .list__item_1x6qc.list__unorderedItem_1x6qc {
34
34
  display: list-item;
35
- } .list__slot_1hiip {
35
+ } .list__slot_1x6qc {
36
36
  min-width: 20px;
37
37
  display: flex;
38
38
  box-sizing: border-box;
39
39
  justify-content: start;
40
40
  padding-right: var(--gap-2xs);
41
41
  flex-shrink: 0
42
- } .list__slot_1hiip.list__defaultColor_1hiip {
42
+ } .list__slot_1x6qc.list__defaultColor_1x6qc {
43
43
  color: var(--list-marker-color);
44
- } .list__slot_1hiip.list__disc_1hiip {
44
+ } .list__slot_1x6qc.list__disc_1x6qc {
45
45
  justify-content: center;
46
46
  padding: 0 var(--gap-2xs);
47
- } .list__caption_1hiip {
47
+ } .list__caption_1x6qc {
48
48
  margin-top: var(--gap-3xs);
49
49
  }
@@ -1 +1 @@
1
- export * from "../../Component-cfeaa92e";
1
+ export * from "../../Component-de49b78c";
@@ -1,4 +1,4 @@
1
- export { I as Item } from '../../Component-cfeaa92e.js';
1
+ export { I as Item } from '../../Component-de49b78c.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import '@alfalab/core-components-typography/modern';
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1fkvi */
1
+ /* hash: wy4kp */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e; /* 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 */
@@ -16,7 +16,7 @@
16
16
  --gap-l: 20px;
17
17
  } :root {
18
18
  } :root {
19
- } .list__list_1o0md {
19
+ } .list__list_19fx8 {
20
20
  margin: 0;
21
21
  padding: 0;
22
22
  color: var(--color-light-text-primary);
@@ -26,14 +26,14 @@
26
26
  line-height: 24px;
27
27
 
28
28
  font-weight: 400;
29
- } .list__lowerAlpha_1o0md {
29
+ } .list__lowerAlpha_19fx8 {
30
30
  list-style-type: lower-alpha;
31
31
  padding-left: var(--gap-l);
32
- } .list__decimal_1o0md {
32
+ } .list__decimal_19fx8 {
33
33
  list-style-type: decimal;
34
- } ol.list__list_1o0md {
34
+ } ol.list__list_19fx8 {
35
35
  display: flex;
36
36
  flex-direction: column
37
- } ol.list__list_1o0md.list__reversed_1o0md {
37
+ } ol.list__list_19fx8.list__reversed_19fx8 {
38
38
  flex-direction: column-reverse;
39
39
  }
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { a as List, L as ListContext } from './Component-cfeaa92e.js';
1
+ export { a as List, L as ListContext } from './Component-de49b78c.js';
2
2
  export { listPresets } from './presets.js';
3
3
  import 'react';
4
4
  import 'classnames';
package/package.json CHANGED
@@ -1,14 +1,11 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-list",
3
- "version": "3.2.1",
3
+ "version": "3.3.0",
4
4
  "description": "",
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"
@@ -17,7 +14,7 @@
17
14
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
18
15
  },
19
16
  "dependencies": {
20
- "@alfalab/core-components-typography": "^3.2.1",
17
+ "@alfalab/core-components-typography": "^4.0.0",
21
18
  "classnames": "^2.3.1",
22
19
  "tslib": "^2.4.0"
23
20
  }
@@ -0,0 +1,145 @@
1
+ import React, { Children, ReactNode } from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { Item } from './components/item';
5
+ import { isItem } from './utils';
6
+
7
+ import styles from './index.module.css';
8
+
9
+ export type TListContext = {
10
+ /**
11
+ * Упорядоченный список
12
+ */
13
+ orderedList?: boolean;
14
+
15
+ /**
16
+ * Маркер
17
+ * @default '—' for ul and 'decimal' for ol
18
+ */
19
+ markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;
20
+
21
+ /**
22
+ * Цвет маркера
23
+ */
24
+ colorMarker?: ColorMarkerType;
25
+
26
+ /**
27
+ * Список обратного счета
28
+ */
29
+ reversed?: boolean;
30
+
31
+ /**
32
+ * Номер пункта
33
+ */
34
+ index?: number;
35
+
36
+ /**
37
+ * Начало отсчета элементов списка
38
+ */
39
+ start?: number;
40
+ };
41
+
42
+ export const ListContext = React.createContext<TListContext>({});
43
+
44
+ type ColorMarkerType =
45
+ | 'tertiary'
46
+ | 'accent'
47
+ | 'primary'
48
+ | 'attention'
49
+ | 'positive'
50
+ | 'secondary'
51
+ | 'tertiary-inverted'
52
+ | 'primary-inverted'
53
+ | 'secondary-inverted'
54
+ | 'link'
55
+ | 'negative';
56
+
57
+ export type ListProps = {
58
+ /**
59
+ * HTML тег
60
+ * @default 'ul'
61
+ */
62
+ tag?: 'ul' | 'ol';
63
+
64
+ /**
65
+ * Маркер
66
+ * @default '—' for ul and 'decimal' for ol
67
+ */
68
+ marker?: 'lower-alpha' | 'decimal' | string | ReactNode;
69
+
70
+ /**
71
+ * Css-класс для стилизации
72
+ */
73
+ className?: string;
74
+
75
+ /**
76
+ * Цвет маркера
77
+ */
78
+ colorMarker?: ColorMarkerType;
79
+
80
+ /**
81
+ * Список обратного счета
82
+ */
83
+ reversed?: boolean;
84
+
85
+ /**
86
+ * Начало отсчета элементов списка
87
+ */
88
+ start?: number;
89
+
90
+ /**
91
+ * Id компонента для тестов
92
+ */
93
+ dataTestId?: string;
94
+
95
+ /**
96
+ * Дочерние элементы
97
+ */
98
+ children?: ReactNode;
99
+ } & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;
100
+
101
+ const ListComponent: React.FC<ListProps> = ({
102
+ tag = 'ul',
103
+ marker,
104
+ className,
105
+ dataTestId,
106
+ colorMarker,
107
+ children,
108
+ reversed,
109
+ start,
110
+ ...restProps
111
+ }) => {
112
+ const markerType = marker || (tag === 'ul' ? '—' : 'decimal');
113
+ const alphaMarker = markerType === 'lower-alpha';
114
+ const decimalMarker = markerType === 'decimal';
115
+ const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';
116
+
117
+ const orderedList = Component === 'ol';
118
+
119
+ const listClassNames = cn(
120
+ styles.list,
121
+ {
122
+ [styles.lowerAlpha]: alphaMarker,
123
+ [styles.decimal]: decimalMarker,
124
+ [styles.reversed]: reversed,
125
+ },
126
+ className,
127
+ );
128
+
129
+ /* eslint-disable react/jsx-no-constructed-context-values */
130
+ return (
131
+ <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>
132
+ {Children.map(children, (child, index) => (
133
+ <ListContext.Provider
134
+ value={{ orderedList, markerType, colorMarker, reversed, index, start }}
135
+ >
136
+ {isItem(child) ? child : <Item>{child}</Item>}
137
+ </ListContext.Provider>
138
+ ))}
139
+ </Component>
140
+ );
141
+ };
142
+
143
+ export const List = Object.assign(ListComponent, {
144
+ Item,
145
+ });
@@ -0,0 +1,79 @@
1
+ import React, { ReactNode, useContext } from 'react';
2
+ import cn from 'classnames';
3
+
4
+ import { Typography } from '@alfalab/core-components-typography';
5
+
6
+ import { ListContext } from '../../Component';
7
+
8
+ import styles from './index.module.css';
9
+
10
+ export type ItemProps = {
11
+ /**
12
+ * Дополнительный текст
13
+ */
14
+ caption?: string;
15
+
16
+ /**
17
+ * Дочерние элементы.
18
+ */
19
+ children?: ReactNode;
20
+ };
21
+
22
+ export const Item: React.FC<ItemProps> = ({ caption, children }) => {
23
+ const {
24
+ orderedList,
25
+ markerType,
26
+ colorMarker,
27
+ reversed,
28
+ index = 0,
29
+ start = 0,
30
+ } = useContext(ListContext);
31
+
32
+ const markerLowerAlpha = markerType === 'lower-alpha';
33
+
34
+ const itemClassNames = cn(styles.item, {
35
+ [styles.unorderedItem]: markerLowerAlpha,
36
+ [styles.reversed]: reversed,
37
+ });
38
+
39
+ const isDisc = markerType === '•';
40
+
41
+ const count = start === 0 ? index + 1 : start + index;
42
+ const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;
43
+
44
+ return (
45
+ <li className={cn(itemClassNames)}>
46
+ {!markerLowerAlpha && (
47
+ <Typography.Text
48
+ tag='div'
49
+ color={colorMarker}
50
+ monospaceNumbers={true}
51
+ view='primary-medium'
52
+ className={cn(styles.slot, {
53
+ [styles.disc]: isDisc && !orderedList,
54
+ [styles.defaultColor]: !colorMarker,
55
+ })}
56
+ >
57
+ {marker}
58
+ </Typography.Text>
59
+ )}
60
+ <div>
61
+ <Typography.Text tag='div' view='primary-medium'>
62
+ {children}
63
+ </Typography.Text>
64
+ {caption && (
65
+ <Typography.Text
66
+ tag='div'
67
+ view='primary-small'
68
+ color='secondary'
69
+ className={styles.caption}
70
+ >
71
+ {caption}
72
+ </Typography.Text>
73
+ )}
74
+ </div>
75
+ </li>
76
+ );
77
+ };
78
+
79
+ Item.displayName = 'ListItem';
@@ -0,0 +1,49 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ :root {
4
+ --list-marker-color: var(--color-light-text-primary);
5
+ --list-item-margin: var(--gap-s);
6
+ }
7
+
8
+ .item {
9
+ margin-top: var(--list-item-margin);
10
+ display: flex;
11
+
12
+ &:first-child {
13
+ margin-top: 0;
14
+ }
15
+
16
+ &.reversed:first-child {
17
+ margin-top: var(--list-item-margin);
18
+ }
19
+
20
+ &.reversed:last-child {
21
+ margin-top: 0;
22
+ }
23
+
24
+ &.unorderedItem {
25
+ display: list-item;
26
+ }
27
+ }
28
+
29
+ .slot {
30
+ min-width: 20px;
31
+ display: flex;
32
+ box-sizing: border-box;
33
+ justify-content: start;
34
+ padding-right: var(--gap-2xs);
35
+ flex-shrink: 0;
36
+
37
+ &.defaultColor {
38
+ color: var(--list-marker-color);
39
+ }
40
+
41
+ &.disc {
42
+ justify-content: center;
43
+ padding: 0 var(--gap-2xs);
44
+ }
45
+ }
46
+
47
+ .caption {
48
+ margin-top: var(--gap-3xs);
49
+ }
@@ -0,0 +1 @@
1
+ export * from './Component';
@@ -0,0 +1,27 @@
1
+ @import '@alfalab/core-components-themes/src/default.css';
2
+
3
+ .list {
4
+ margin: 0;
5
+ padding: 0;
6
+ color: var(--color-light-text-primary);
7
+
8
+ @mixin paragraph_primary_medium;
9
+ }
10
+
11
+ .lowerAlpha {
12
+ list-style-type: lower-alpha;
13
+ padding-left: var(--gap-l);
14
+ }
15
+
16
+ .decimal {
17
+ list-style-type: decimal;
18
+ }
19
+
20
+ ol.list {
21
+ display: flex;
22
+ flex-direction: column;
23
+
24
+ &.reversed {
25
+ flex-direction: column-reverse;
26
+ }
27
+ }
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './Component';
2
+ export * from './presets';
package/src/presets.ts ADDED
@@ -0,0 +1,6 @@
1
+ export const listPresets = {
2
+ mobile: {
3
+ tag: 'ul',
4
+ marker: '–',
5
+ },
6
+ };
package/src/utils.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { isValidElement, ReactNode } from 'react';
2
+
3
+ export const isItemElement = (obj: JSX.Element, name?: string): boolean =>
4
+ typeof obj === 'object' && obj.type.displayName === name;
5
+
6
+ export const isItem = (child: ReactNode) =>
7
+ isValidElement(child) && isItemElement(child, 'ListItem');
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
- });