@alfalab/core-components-list 3.2.2 → 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.
- package/{Component-ff50db60.js → Component-3157d73d.js} +2 -2
- package/Component.js +1 -1
- package/components/item/Component.js +1 -1
- package/components/item/index.css +10 -10
- package/components/item/index.d.ts +1 -1
- package/components/item/index.js +1 -1
- package/esm/{Component-9d7b71bc.js → Component-3900b562.js} +2 -2
- package/esm/Component.js +1 -1
- package/esm/components/item/Component.js +1 -1
- package/esm/components/item/index.css +10 -10
- package/esm/components/item/index.d.ts +1 -1
- package/esm/components/item/index.js +1 -1
- package/esm/index.css +6 -6
- package/esm/index.js +1 -1
- package/index.css +6 -6
- package/index.js +1 -1
- package/modern/{Component-9fb6bcfc.js → Component-de49b78c.js} +2 -2
- package/modern/Component.js +1 -1
- package/modern/components/item/Component.js +1 -1
- package/modern/components/item/index.css +10 -10
- package/modern/components/item/index.d.ts +1 -1
- package/modern/components/item/index.js +1 -1
- package/modern/index.css +6 -6
- package/modern/index.js +1 -1
- package/package.json +2 -2
- package/src/Component.tsx +145 -0
- package/src/components/item/Component.tsx +79 -0
- package/src/components/item/index.module.css +49 -0
- package/src/components/item/index.ts +1 -0
- package/src/index.module.css +27 -0
- package/src/index.ts +2 -0
- package/src/presets.ts +6 -0
- package/src/utils.ts +7 -0
- /package/{Component-ff50db60.d.ts → Component-3157d73d.d.ts} +0 -0
- /package/esm/{Component-9d7b71bc.d.ts → Component-3900b562.d.ts} +0 -0
- /package/modern/{Component-9fb6bcfc.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":"
|
|
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":"
|
|
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-
|
|
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-
|
|
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:
|
|
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
|
-
} .
|
|
24
|
+
} .list__item_1x6qc {
|
|
25
25
|
margin-top: var(--list-item-margin);
|
|
26
26
|
display: flex
|
|
27
|
-
} .
|
|
27
|
+
} .list__item_1x6qc:first-child {
|
|
28
28
|
margin-top: 0;
|
|
29
|
-
} .
|
|
29
|
+
} .list__item_1x6qc.list__reversed_1x6qc:first-child {
|
|
30
30
|
margin-top: var(--list-item-margin);
|
|
31
|
-
} .
|
|
31
|
+
} .list__item_1x6qc.list__reversed_1x6qc:last-child {
|
|
32
32
|
margin-top: 0;
|
|
33
|
-
} .
|
|
33
|
+
} .list__item_1x6qc.list__unorderedItem_1x6qc {
|
|
34
34
|
display: list-item;
|
|
35
|
-
} .
|
|
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
|
-
} .
|
|
42
|
+
} .list__slot_1x6qc.list__defaultColor_1x6qc {
|
|
43
43
|
color: var(--list-marker-color);
|
|
44
|
-
} .
|
|
44
|
+
} .list__slot_1x6qc.list__disc_1x6qc {
|
|
45
45
|
justify-content: center;
|
|
46
46
|
padding: 0 var(--gap-2xs);
|
|
47
|
-
} .
|
|
47
|
+
} .list__caption_1x6qc {
|
|
48
48
|
margin-top: var(--gap-3xs);
|
|
49
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-3157d73d";
|
package/components/item/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-
|
|
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":"
|
|
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":"
|
|
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-
|
|
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,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
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
|
-
} .
|
|
24
|
+
} .list__item_1x6qc {
|
|
25
25
|
margin-top: var(--list-item-margin);
|
|
26
26
|
display: flex
|
|
27
|
-
} .
|
|
27
|
+
} .list__item_1x6qc:first-child {
|
|
28
28
|
margin-top: 0;
|
|
29
|
-
} .
|
|
29
|
+
} .list__item_1x6qc.list__reversed_1x6qc:first-child {
|
|
30
30
|
margin-top: var(--list-item-margin);
|
|
31
|
-
} .
|
|
31
|
+
} .list__item_1x6qc.list__reversed_1x6qc:last-child {
|
|
32
32
|
margin-top: 0;
|
|
33
|
-
} .
|
|
33
|
+
} .list__item_1x6qc.list__unorderedItem_1x6qc {
|
|
34
34
|
display: list-item;
|
|
35
|
-
} .
|
|
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
|
-
} .
|
|
42
|
+
} .list__slot_1x6qc.list__defaultColor_1x6qc {
|
|
43
43
|
color: var(--list-marker-color);
|
|
44
|
-
} .
|
|
44
|
+
} .list__slot_1x6qc.list__disc_1x6qc {
|
|
45
45
|
justify-content: center;
|
|
46
46
|
padding: 0 var(--gap-2xs);
|
|
47
|
-
} .
|
|
47
|
+
} .list__caption_1x6qc {
|
|
48
48
|
margin-top: var(--gap-3xs);
|
|
49
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-3900b562";
|
package/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
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
|
-
} .
|
|
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
|
-
} .
|
|
29
|
+
} .list__lowerAlpha_19fx8 {
|
|
30
30
|
list-style-type: lower-alpha;
|
|
31
31
|
padding-left: var(--gap-l);
|
|
32
|
-
} .
|
|
32
|
+
} .list__decimal_19fx8 {
|
|
33
33
|
list-style-type: decimal;
|
|
34
|
-
} ol.
|
|
34
|
+
} ol.list__list_19fx8 {
|
|
35
35
|
display: flex;
|
|
36
36
|
flex-direction: column
|
|
37
|
-
} ol.
|
|
37
|
+
} ol.list__list_19fx8.list__reversed_19fx8 {
|
|
38
38
|
flex-direction: column-reverse;
|
|
39
39
|
}
|
package/esm/index.js
CHANGED
package/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
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
|
-
} .
|
|
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
|
-
} .
|
|
29
|
+
} .list__lowerAlpha_19fx8 {
|
|
30
30
|
list-style-type: lower-alpha;
|
|
31
31
|
padding-left: var(--gap-l);
|
|
32
|
-
} .
|
|
32
|
+
} .list__decimal_19fx8 {
|
|
33
33
|
list-style-type: decimal;
|
|
34
|
-
} ol.
|
|
34
|
+
} ol.list__list_19fx8 {
|
|
35
35
|
display: flex;
|
|
36
36
|
flex-direction: column
|
|
37
|
-
} ol.
|
|
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-
|
|
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":"
|
|
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":"
|
|
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({});
|
package/modern/Component.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
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
|
-
} .
|
|
24
|
+
} .list__item_1x6qc {
|
|
25
25
|
margin-top: var(--list-item-margin);
|
|
26
26
|
display: flex
|
|
27
|
-
} .
|
|
27
|
+
} .list__item_1x6qc:first-child {
|
|
28
28
|
margin-top: 0;
|
|
29
|
-
} .
|
|
29
|
+
} .list__item_1x6qc.list__reversed_1x6qc:first-child {
|
|
30
30
|
margin-top: var(--list-item-margin);
|
|
31
|
-
} .
|
|
31
|
+
} .list__item_1x6qc.list__reversed_1x6qc:last-child {
|
|
32
32
|
margin-top: 0;
|
|
33
|
-
} .
|
|
33
|
+
} .list__item_1x6qc.list__unorderedItem_1x6qc {
|
|
34
34
|
display: list-item;
|
|
35
|
-
} .
|
|
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
|
-
} .
|
|
42
|
+
} .list__slot_1x6qc.list__defaultColor_1x6qc {
|
|
43
43
|
color: var(--list-marker-color);
|
|
44
|
-
} .
|
|
44
|
+
} .list__slot_1x6qc.list__disc_1x6qc {
|
|
45
45
|
justify-content: center;
|
|
46
46
|
padding: 0 var(--gap-2xs);
|
|
47
|
-
} .
|
|
47
|
+
} .list__caption_1x6qc {
|
|
48
48
|
margin-top: var(--gap-3xs);
|
|
49
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "../../Component-
|
|
1
|
+
export * from "../../Component-de49b78c";
|
package/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
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
|
-
} .
|
|
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
|
-
} .
|
|
29
|
+
} .list__lowerAlpha_19fx8 {
|
|
30
30
|
list-style-type: lower-alpha;
|
|
31
31
|
padding-left: var(--gap-l);
|
|
32
|
-
} .
|
|
32
|
+
} .list__decimal_19fx8 {
|
|
33
33
|
list-style-type: decimal;
|
|
34
|
-
} ol.
|
|
34
|
+
} ol.list__list_19fx8 {
|
|
35
35
|
display: flex;
|
|
36
36
|
flex-direction: column
|
|
37
|
-
} ol.
|
|
37
|
+
} ol.list__list_19fx8.list__reversed_19fx8 {
|
|
38
38
|
flex-direction: column-reverse;
|
|
39
39
|
}
|
package/modern/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-list",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
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": "^
|
|
17
|
+
"@alfalab/core-components-typography": "^4.0.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
package/src/presets.ts
ADDED
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');
|
|
File without changes
|
|
File without changes
|
|
File without changes
|