@alfalab/core-components-list 3.2.2 → 3.3.1

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 (36) hide show
  1. package/{Component-ff50db60.js → Component-97e48f23.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-9d7b71bc.js → Component-f0de0306.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-9fb6bcfc.js → Component-6249e117.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 -2
  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/{Component-ff50db60.d.ts → Component-97e48f23.d.ts} +0 -0
  35. /package/esm/{Component-9d7b71bc.d.ts → Component-f0de0306.d.ts} +0 -0
  36. /package/modern/{Component-9fb6bcfc.d.ts → Component-6249e117.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_aqlzc","reversed":"list__reversed_aqlzc","unorderedItem":"list__unorderedItem_aqlzc","slot":"list__slot_aqlzc","defaultColor":"list__defaultColor_aqlzc","disc":"list__disc_aqlzc","caption":"list__caption_aqlzc"};
14
+ var styles$1 = {"item":"list__item_1ak97","reversed":"list__reversed_1ak97","unorderedItem":"list__unorderedItem_1ak97","slot":"list__slot_1ak97","defaultColor":"list__defaultColor_1ak97","disc":"list__disc_1ak97","caption":"list__caption_1ak97"};
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_kdv9p","lowerAlpha":"list__lowerAlpha_kdv9p","decimal":"list__decimal_kdv9p","reversed":"list__reversed_kdv9p"};
40
+ var styles = {"list":"list__list_i0dt7","lowerAlpha":"list__lowerAlpha_i0dt7","decimal":"list__decimal_i0dt7","reversed":"list__reversed_i0dt7"};
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-ff50db60.js');
8
+ var components_item_Component = require('./Component-97e48f23.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-ff50db60.js');
8
+ var components_item_Component = require('../../Component-97e48f23.js');
9
9
  require('tslib');
10
10
  require('../../utils.js');
11
11
 
@@ -1,4 +1,4 @@
1
- /* hash: szmy2 */
1
+ /* hash: d5kqk */
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_aqlzc {
24
+ } .list__item_1ak97 {
25
25
  margin-top: var(--list-item-margin);
26
26
  display: flex
27
- } .list__item_aqlzc:first-child {
27
+ } .list__item_1ak97:first-child {
28
28
  margin-top: 0;
29
- } .list__item_aqlzc.list__reversed_aqlzc:first-child {
29
+ } .list__item_1ak97.list__reversed_1ak97:first-child {
30
30
  margin-top: var(--list-item-margin);
31
- } .list__item_aqlzc.list__reversed_aqlzc:last-child {
31
+ } .list__item_1ak97.list__reversed_1ak97:last-child {
32
32
  margin-top: 0;
33
- } .list__item_aqlzc.list__unorderedItem_aqlzc {
33
+ } .list__item_1ak97.list__unorderedItem_1ak97 {
34
34
  display: list-item;
35
- } .list__slot_aqlzc {
35
+ } .list__slot_1ak97 {
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_aqlzc.list__defaultColor_aqlzc {
42
+ } .list__slot_1ak97.list__defaultColor_1ak97 {
43
43
  color: var(--list-marker-color);
44
- } .list__slot_aqlzc.list__disc_aqlzc {
44
+ } .list__slot_1ak97.list__disc_1ak97 {
45
45
  justify-content: center;
46
46
  padding: 0 var(--gap-2xs);
47
- } .list__caption_aqlzc {
47
+ } .list__caption_1ak97 {
48
48
  margin-top: var(--gap-3xs);
49
49
  }
@@ -1 +1 @@
1
- export * from "../../Component-ff50db60";
1
+ export * from "../../Component-97e48f23";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var components_item_Component = require('../../Component-ff50db60.js');
5
+ var components_item_Component = require('../../Component-97e48f23.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_aqlzc","reversed":"list__reversed_aqlzc","unorderedItem":"list__unorderedItem_aqlzc","slot":"list__slot_aqlzc","defaultColor":"list__defaultColor_aqlzc","disc":"list__disc_aqlzc","caption":"list__caption_aqlzc"};
7
+ var styles$1 = {"item":"list__item_1ak97","reversed":"list__reversed_1ak97","unorderedItem":"list__unorderedItem_1ak97","slot":"list__slot_1ak97","defaultColor":"list__defaultColor_1ak97","disc":"list__disc_1ak97","caption":"list__caption_1ak97"};
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_kdv9p","lowerAlpha":"list__lowerAlpha_kdv9p","decimal":"list__decimal_kdv9p","reversed":"list__reversed_kdv9p"};
33
+ var styles = {"list":"list__list_i0dt7","lowerAlpha":"list__lowerAlpha_i0dt7","decimal":"list__decimal_i0dt7","reversed":"list__reversed_i0dt7"};
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-9d7b71bc.js';
4
+ export { a as List, L as ListContext } from './Component-f0de0306.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-9d7b71bc.js';
4
+ export { I as Item } from '../../Component-f0de0306.js';
5
5
  import 'tslib';
6
6
  import '../../utils.js';
@@ -1,4 +1,4 @@
1
- /* hash: szmy2 */
1
+ /* hash: d5kqk */
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_aqlzc {
24
+ } .list__item_1ak97 {
25
25
  margin-top: var(--list-item-margin);
26
26
  display: flex
27
- } .list__item_aqlzc:first-child {
27
+ } .list__item_1ak97:first-child {
28
28
  margin-top: 0;
29
- } .list__item_aqlzc.list__reversed_aqlzc:first-child {
29
+ } .list__item_1ak97.list__reversed_1ak97:first-child {
30
30
  margin-top: var(--list-item-margin);
31
- } .list__item_aqlzc.list__reversed_aqlzc:last-child {
31
+ } .list__item_1ak97.list__reversed_1ak97:last-child {
32
32
  margin-top: 0;
33
- } .list__item_aqlzc.list__unorderedItem_aqlzc {
33
+ } .list__item_1ak97.list__unorderedItem_1ak97 {
34
34
  display: list-item;
35
- } .list__slot_aqlzc {
35
+ } .list__slot_1ak97 {
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_aqlzc.list__defaultColor_aqlzc {
42
+ } .list__slot_1ak97.list__defaultColor_1ak97 {
43
43
  color: var(--list-marker-color);
44
- } .list__slot_aqlzc.list__disc_aqlzc {
44
+ } .list__slot_1ak97.list__disc_1ak97 {
45
45
  justify-content: center;
46
46
  padding: 0 var(--gap-2xs);
47
- } .list__caption_aqlzc {
47
+ } .list__caption_1ak97 {
48
48
  margin-top: var(--gap-3xs);
49
49
  }
@@ -1 +1 @@
1
- export * from "../../Component-9d7b71bc";
1
+ export * from "../../Component-f0de0306";
@@ -1,4 +1,4 @@
1
- export { I as Item } from '../../Component-9d7b71bc.js';
1
+ export { I as Item } from '../../Component-f0de0306.js';
2
2
  import 'tslib';
3
3
  import 'react';
4
4
  import 'classnames';
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 18vre */
1
+ /* hash: 1i0ri */
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_kdv9p {
19
+ } .list__list_i0dt7 {
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_kdv9p {
29
+ } .list__lowerAlpha_i0dt7 {
30
30
  list-style-type: lower-alpha;
31
31
  padding-left: var(--gap-l);
32
- } .list__decimal_kdv9p {
32
+ } .list__decimal_i0dt7 {
33
33
  list-style-type: decimal;
34
- } ol.list__list_kdv9p {
34
+ } ol.list__list_i0dt7 {
35
35
  display: flex;
36
36
  flex-direction: column
37
- } ol.list__list_kdv9p.list__reversed_kdv9p {
37
+ } ol.list__list_i0dt7.list__reversed_i0dt7 {
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-9d7b71bc.js';
1
+ export { a as List, L as ListContext } from './Component-f0de0306.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: 18vre */
1
+ /* hash: 1i0ri */
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_kdv9p {
19
+ } .list__list_i0dt7 {
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_kdv9p {
29
+ } .list__lowerAlpha_i0dt7 {
30
30
  list-style-type: lower-alpha;
31
31
  padding-left: var(--gap-l);
32
- } .list__decimal_kdv9p {
32
+ } .list__decimal_i0dt7 {
33
33
  list-style-type: decimal;
34
- } ol.list__list_kdv9p {
34
+ } ol.list__list_i0dt7 {
35
35
  display: flex;
36
36
  flex-direction: column
37
- } ol.list__list_kdv9p.list__reversed_kdv9p {
37
+ } ol.list__list_i0dt7.list__reversed_i0dt7 {
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-ff50db60.js');
5
+ var components_item_Component = require('./Component-97e48f23.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_aqlzc","reversed":"list__reversed_aqlzc","unorderedItem":"list__unorderedItem_aqlzc","slot":"list__slot_aqlzc","defaultColor":"list__defaultColor_aqlzc","disc":"list__disc_aqlzc","caption":"list__caption_aqlzc"};
6
+ const styles$1 = {"item":"list__item_1ak97","reversed":"list__reversed_1ak97","unorderedItem":"list__unorderedItem_1ak97","slot":"list__slot_1ak97","defaultColor":"list__defaultColor_1ak97","disc":"list__disc_1ak97","caption":"list__caption_1ak97"};
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_kdv9p","lowerAlpha":"list__lowerAlpha_kdv9p","decimal":"list__decimal_kdv9p","reversed":"list__reversed_kdv9p"};
30
+ const styles = {"list":"list__list_i0dt7","lowerAlpha":"list__lowerAlpha_i0dt7","decimal":"list__decimal_i0dt7","reversed":"list__reversed_i0dt7"};
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-9fb6bcfc.js';
3
+ export { a as List, L as ListContext } from './Component-6249e117.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-9fb6bcfc.js';
4
+ export { I as Item } from '../../Component-6249e117.js';
5
5
  import '../../utils.js';
@@ -1,4 +1,4 @@
1
- /* hash: szmy2 */
1
+ /* hash: d5kqk */
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_aqlzc {
24
+ } .list__item_1ak97 {
25
25
  margin-top: var(--list-item-margin);
26
26
  display: flex
27
- } .list__item_aqlzc:first-child {
27
+ } .list__item_1ak97:first-child {
28
28
  margin-top: 0;
29
- } .list__item_aqlzc.list__reversed_aqlzc:first-child {
29
+ } .list__item_1ak97.list__reversed_1ak97:first-child {
30
30
  margin-top: var(--list-item-margin);
31
- } .list__item_aqlzc.list__reversed_aqlzc:last-child {
31
+ } .list__item_1ak97.list__reversed_1ak97:last-child {
32
32
  margin-top: 0;
33
- } .list__item_aqlzc.list__unorderedItem_aqlzc {
33
+ } .list__item_1ak97.list__unorderedItem_1ak97 {
34
34
  display: list-item;
35
- } .list__slot_aqlzc {
35
+ } .list__slot_1ak97 {
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_aqlzc.list__defaultColor_aqlzc {
42
+ } .list__slot_1ak97.list__defaultColor_1ak97 {
43
43
  color: var(--list-marker-color);
44
- } .list__slot_aqlzc.list__disc_aqlzc {
44
+ } .list__slot_1ak97.list__disc_1ak97 {
45
45
  justify-content: center;
46
46
  padding: 0 var(--gap-2xs);
47
- } .list__caption_aqlzc {
47
+ } .list__caption_1ak97 {
48
48
  margin-top: var(--gap-3xs);
49
49
  }
@@ -1 +1 @@
1
- export * from "../../Component-9fb6bcfc";
1
+ export * from "../../Component-6249e117";
@@ -1,4 +1,4 @@
1
- export { I as Item } from '../../Component-9fb6bcfc.js';
1
+ export { I as Item } from '../../Component-6249e117.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: 18vre */
1
+ /* hash: 1i0ri */
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_kdv9p {
19
+ } .list__list_i0dt7 {
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_kdv9p {
29
+ } .list__lowerAlpha_i0dt7 {
30
30
  list-style-type: lower-alpha;
31
31
  padding-left: var(--gap-l);
32
- } .list__decimal_kdv9p {
32
+ } .list__decimal_i0dt7 {
33
33
  list-style-type: decimal;
34
- } ol.list__list_kdv9p {
34
+ } ol.list__list_i0dt7 {
35
35
  display: flex;
36
36
  flex-direction: column
37
- } ol.list__list_kdv9p.list__reversed_kdv9p {
37
+ } ol.list__list_i0dt7.list__reversed_i0dt7 {
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-9fb6bcfc.js';
1
+ export { a as List, L as ListContext } from './Component-6249e117.js';
2
2
  export { listPresets } from './presets.js';
3
3
  import 'react';
4
4
  import 'classnames';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-list",
3
- "version": "3.2.2",
3
+ "version": "3.3.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@alfalab/core-components-typography": "^3.2.2",
17
+ "@alfalab/core-components-typography": "^4.1.0",
18
18
  "classnames": "^2.3.1",
19
19
  "tslib": "^2.4.0"
20
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');