@alfalab/core-components-list 3.1.1 → 3.2.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 (61) hide show
  1. package/Component-0887e7cb.d.ts +72 -0
  2. package/Component-71bc37e9.d.ts +15 -0
  3. package/Component-71bc37e9.js +66 -0
  4. package/Component.d.ts +0 -29
  5. package/Component.js +8 -70
  6. package/components/item/Component.d.ts +0 -0
  7. package/components/item/Component.js +12 -0
  8. package/components/item/index.css +49 -0
  9. package/components/item/index.d.ts +1 -0
  10. package/components/item/index.js +12 -0
  11. package/cssm/Component-0887e7cb.d.ts +72 -0
  12. package/cssm/Component-7cc47e0b.d.ts +15 -0
  13. package/cssm/Component-7cc47e0b.js +64 -0
  14. package/cssm/Component.d.ts +0 -29
  15. package/cssm/Component.js +10 -69
  16. package/cssm/components/item/Component.d.ts +0 -0
  17. package/cssm/components/item/Component.js +14 -0
  18. package/cssm/components/item/index.d.ts +1 -0
  19. package/cssm/components/item/index.js +14 -0
  20. package/cssm/components/item/index.module.css +48 -0
  21. package/cssm/index.d.ts +1 -1
  22. package/cssm/index.js +7 -2
  23. package/cssm/index.module.css +18 -37
  24. package/cssm/utils.d.ts +5 -0
  25. package/cssm/utils.js +13 -0
  26. package/esm/Component-0887e7cb.d.ts +72 -0
  27. package/esm/Component-5084b3b8.d.ts +15 -0
  28. package/esm/Component-5084b3b8.js +57 -0
  29. package/esm/Component.d.ts +0 -29
  30. package/esm/Component.js +6 -68
  31. package/esm/components/item/Component.d.ts +0 -0
  32. package/esm/components/item/Component.js +6 -0
  33. package/esm/components/item/index.css +49 -0
  34. package/esm/components/item/index.d.ts +1 -0
  35. package/esm/components/item/index.js +6 -0
  36. package/esm/index.css +19 -38
  37. package/esm/index.d.ts +1 -1
  38. package/esm/index.js +4 -1
  39. package/esm/utils.d.ts +5 -0
  40. package/esm/utils.js +10 -0
  41. package/index.css +19 -38
  42. package/index.d.ts +1 -1
  43. package/index.js +6 -2
  44. package/modern/Component-0887e7cb.d.ts +72 -0
  45. package/modern/Component-368bf140.d.ts +15 -0
  46. package/modern/Component-368bf140.js +52 -0
  47. package/modern/Component.d.ts +0 -29
  48. package/modern/Component.js +5 -27
  49. package/modern/components/item/Component.d.ts +0 -0
  50. package/modern/components/item/Component.js +5 -0
  51. package/modern/components/item/index.css +49 -0
  52. package/modern/components/item/index.d.ts +1 -0
  53. package/modern/components/item/index.js +5 -0
  54. package/modern/index.css +19 -38
  55. package/modern/index.d.ts +1 -1
  56. package/modern/index.js +3 -1
  57. package/modern/utils.d.ts +5 -0
  58. package/modern/utils.js +6 -0
  59. package/package.json +4 -2
  60. package/utils.d.ts +5 -0
  61. package/utils.js +13 -0
@@ -0,0 +1,48 @@
1
+ :root {
2
+ } /* deprecated */ :root {
3
+ --color-light-text-primary: #0b1f35; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
5
+ } :root {
6
+ } :root {
7
+
8
+ /* Hard */
9
+
10
+ /* Up */
11
+
12
+ /* Hard up */
13
+ } :root {
14
+ } :root {
15
+ --gap-3xs: 2px;
16
+ --gap-2xs: 4px;
17
+ --gap-s: 12px;
18
+ } :root {
19
+ } :root {
20
+ } :root {
21
+ --list-marker-color: var(--color-light-text-primary);
22
+ --list-item-margin: var(--gap-s);
23
+ } .item {
24
+ margin-top: var(--list-item-margin);
25
+ display: flex
26
+ } .item:first-child {
27
+ margin-top: 0;
28
+ } .item.reversed:first-child {
29
+ margin-top: var(--list-item-margin);
30
+ } .item.reversed:last-child {
31
+ margin-top: 0;
32
+ } .item.unorderedItem {
33
+ display: list-item;
34
+ } .slot {
35
+ min-width: 20px;
36
+ display: flex;
37
+ box-sizing: border-box;
38
+ justify-content: start;
39
+ padding-right: var(--gap-2xs);
40
+ flex-shrink: 0
41
+ } .slot.defaultColor {
42
+ color: var(--list-marker-color);
43
+ } .slot.disc {
44
+ justify-content: center;
45
+ padding: 0 var(--gap-2xs);
46
+ } .caption {
47
+ margin-top: var(--gap-3xs);
48
+ }
package/cssm/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./Component";
1
+ export * from "./Component-0887e7cb";
2
2
  export * from "./presets";
package/cssm/index.js CHANGED
@@ -1,12 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var Component = require('./Component.js');
3
+ var components_item_Component = require('./Component-7cc47e0b.js');
4
4
  var presets = require('./presets.js');
5
+ require('tslib');
5
6
  require('react');
6
7
  require('classnames');
8
+ require('@alfalab/core-components-typography/cssm');
9
+ require('./utils.js');
7
10
  require('./index.module.css');
11
+ require('./components/item/index.module.css');
8
12
 
9
13
 
10
14
 
11
- exports.List = Component.List;
15
+ exports.List = components_item_Component.List;
16
+ exports.ListContext = components_item_Component.ListContext;
12
17
  exports.listPresets = presets.listPresets;
@@ -1,25 +1,21 @@
1
1
  :root {
2
- --color-light-text-primary: #0b1f35;
3
- }
4
- :root {
2
+ } /* deprecated */ :root {
3
+ --color-light-text-primary: #0b1f35; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
5
+ } :root {
6
+ } :root {
5
7
 
6
8
  /* Hard */
7
9
 
8
10
  /* Up */
9
11
 
10
12
  /* Hard up */
11
- }
12
- :root {
13
- --gap-2xs: 4px;
14
- --gap-xs: 8px;
15
- --gap-s: 12px;
13
+ } :root {
14
+ } :root {
16
15
  --gap-l: 20px;
17
- }
18
- :root {
19
- --list-marker-color: var(--color-light-text-primary);
20
- --list-item-margin: var(--gap-s);
21
- }
22
- .list {
16
+ } :root {
17
+ } :root {
18
+ } .list {
23
19
  margin: 0;
24
20
  padding: 0;
25
21
  color: var(--color-light-text-primary);
@@ -29,29 +25,14 @@
29
25
  line-height: 24px;
30
26
 
31
27
  font-weight: 400;
32
- }
33
- .orderedList {
34
- padding-left: var(--gap-l);
35
- }
36
- .lowerAlpha {
28
+ } .lowerAlpha {
37
29
  list-style-type: lower-alpha;
38
- }
39
- .decimal {
30
+ padding-left: var(--gap-l);
31
+ } .decimal {
40
32
  list-style-type: decimal;
41
- }
42
- .item {
43
- margin-top: var(--list-item-margin)
44
- }
45
- .item:first-child {
46
- margin-top: 0;
47
- }
48
- .unorderedItem {
33
+ } ol.list {
49
34
  display: flex;
50
- }
51
- .orderedItem {
52
- padding-left: var(--gap-2xs);
53
- }
54
- .slot {
55
- margin-right: var(--gap-xs);
56
- color: var(--list-marker-color);
57
- }
35
+ flex-direction: column
36
+ } ol.list.reversed {
37
+ flex-direction: column-reverse;
38
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { ReactNode } from 'react';
3
+ declare const isItemElement: (obj: JSX.Element, name?: string) => boolean;
4
+ declare const isItem: (child: ReactNode) => boolean;
5
+ export { isItemElement, isItem };
package/cssm/utils.js ADDED
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ var isItemElement = function (obj, name) {
6
+ return typeof obj === 'object' && obj.type.displayName === name;
7
+ };
8
+ var isItem = function (child) {
9
+ return React.isValidElement(child) && isItemElement(child, 'ListItem');
10
+ };
11
+
12
+ exports.isItem = isItem;
13
+ exports.isItemElement = isItemElement;
@@ -0,0 +1,72 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { ReactNode } from "react";
4
+ type TListContext = {
5
+ /**
6
+ * Упорядоченный список
7
+ */
8
+ orderedList?: boolean;
9
+ /**
10
+ * Маркер
11
+ * @default '—' for ul and 'decimal' for ol
12
+ */
13
+ markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;
14
+ /**
15
+ * Цвет маркера
16
+ */
17
+ colorMarker?: ColorMarkerType;
18
+ /**
19
+ * Список обратного счета
20
+ */
21
+ reversed?: boolean;
22
+ /**
23
+ * Номер пункта
24
+ */
25
+ index?: number;
26
+ /**
27
+ * Начало отсчета элементов списка
28
+ */
29
+ start?: number;
30
+ };
31
+ declare const ListContext: React.Context<TListContext>;
32
+ type ColorMarkerType = 'tertiary' | 'accent' | 'primary' | 'attention' | 'positive' | 'secondary' | 'tertiary-inverted' | 'primary-inverted' | 'secondary-inverted' | 'link' | 'negative';
33
+ type ListProps = {
34
+ /**
35
+ * HTML тег
36
+ * @default 'ul'
37
+ */
38
+ tag?: 'ul' | 'ol';
39
+ /**
40
+ * Маркер
41
+ * @default '—' for ul and 'decimal' for ol
42
+ */
43
+ marker?: 'lower-alpha' | 'decimal' | string | ReactNode;
44
+ /**
45
+ * Css-класс для стилизации
46
+ */
47
+ className?: string;
48
+ /**
49
+ * Цвет маркера
50
+ */
51
+ colorMarker?: ColorMarkerType;
52
+ /**
53
+ * Список обратного счета
54
+ */
55
+ reversed?: boolean;
56
+ /**
57
+ * Начало отсчета элементов списка
58
+ */
59
+ start?: number;
60
+ /**
61
+ * Id компонента для тестов
62
+ */
63
+ dataTestId?: string;
64
+ /**
65
+ * Дочерние элементы
66
+ */
67
+ children?: ReactNode;
68
+ } & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;
69
+ declare const List: React.FC<ListProps> & {
70
+ Item: React.FC<import("./components/item/index").ItemProps>;
71
+ };
72
+ export { TListContext, ListContext, ListProps, List };
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { ReactNode } from "react";
4
+ type ItemProps = {
5
+ /**
6
+ * Дополнительный текст
7
+ */
8
+ caption?: string;
9
+ /**
10
+ * Дочерние элементы.
11
+ */
12
+ children?: ReactNode;
13
+ };
14
+ declare const Item: React.FC<ItemProps>;
15
+ export { ItemProps, Item };
@@ -0,0 +1,57 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React, { useContext, Children } from 'react';
3
+ import cn from 'classnames';
4
+ import { Typography } from '@alfalab/core-components-typography/esm';
5
+ import { isItem } from './utils.js';
6
+
7
+ var styles$1 = {"item":"list__item_opye0","reversed":"list__reversed_opye0","unorderedItem":"list__unorderedItem_opye0","slot":"list__slot_opye0","defaultColor":"list__defaultColor_opye0","disc":"list__disc_opye0","caption":"list__caption_opye0"};
8
+ require('./components/item/index.css')
9
+
10
+ var Item = function (_a) {
11
+ var _b, _c;
12
+ var caption = _a.caption, children = _a.children;
13
+ var _d = useContext(ListContext), orderedList = _d.orderedList, markerType = _d.markerType, colorMarker = _d.colorMarker, reversed = _d.reversed, _e = _d.index, index = _e === void 0 ? 0 : _e, _f = _d.start, start = _f === void 0 ? 0 : _f;
14
+ var markerLowerAlpha = markerType === 'lower-alpha';
15
+ var itemClassNames = cn(styles$1.item, (_b = {},
16
+ _b[styles$1.unorderedItem] = markerLowerAlpha,
17
+ _b[styles$1.reversed] = reversed,
18
+ _b));
19
+ var isDisc = markerType === '•';
20
+ var count = start === 0 ? index + 1 : start + index;
21
+ var marker = orderedList || markerType === 'decimal' ? "".concat(count, ".") : markerType;
22
+ return (React.createElement("li", { className: cn(itemClassNames) },
23
+ !markerLowerAlpha && (React.createElement(Typography.Text, { tag: 'div', color: colorMarker, monospaceNumbers: true, view: 'primary-medium', className: cn(styles$1.slot, (_c = {},
24
+ _c[styles$1.disc] = isDisc && !orderedList,
25
+ _c[styles$1.defaultColor] = !colorMarker,
26
+ _c)) }, marker)),
27
+ React.createElement("div", null,
28
+ React.createElement(Typography.Text, { tag: 'div', view: 'primary-medium' }, children),
29
+ caption && (React.createElement(Typography.Text, { tag: 'div', view: 'primary-small', color: 'secondary', className: styles$1.caption }, caption)))));
30
+ };
31
+ Item.displayName = 'ListItem';
32
+
33
+ var styles = {"list":"list__list_1ngae","lowerAlpha":"list__lowerAlpha_1ngae","decimal":"list__decimal_1ngae","reversed":"list__reversed_1ngae"};
34
+ require('./index.css')
35
+
36
+ var ListContext = React.createContext({});
37
+ var ListComponent = function (_a) {
38
+ var _b;
39
+ var _c = _a.tag, tag = _c === void 0 ? 'ul' : _c, marker = _a.marker, className = _a.className, dataTestId = _a.dataTestId, colorMarker = _a.colorMarker, children = _a.children, reversed = _a.reversed, start = _a.start, restProps = __rest(_a, ["tag", "marker", "className", "dataTestId", "colorMarker", "children", "reversed", "start"]);
40
+ var markerType = marker || (tag === 'ul' ? '—' : 'decimal');
41
+ var alphaMarker = markerType === 'lower-alpha';
42
+ var decimalMarker = markerType === 'decimal';
43
+ var Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';
44
+ var orderedList = Component === 'ol';
45
+ var listClassNames = cn(styles.list, (_b = {},
46
+ _b[styles.lowerAlpha] = alphaMarker,
47
+ _b[styles.decimal] = decimalMarker,
48
+ _b[styles.reversed] = reversed,
49
+ _b), className);
50
+ /* eslint-disable react/jsx-no-constructed-context-values */
51
+ return (React.createElement(Component, __assign({ className: listClassNames, "data-test-id": dataTestId }, restProps), Children.map(children, function (child, index) { return (React.createElement(ListContext.Provider, { value: { orderedList: orderedList, markerType: markerType, colorMarker: colorMarker, reversed: reversed, index: index, start: start } }, isItem(child) ? child : React.createElement(Item, null, child))); })));
52
+ };
53
+ var List = Object.assign(ListComponent, {
54
+ Item: Item,
55
+ });
56
+
57
+ export { Item as I, ListContext as L, List as a };
@@ -1,29 +0,0 @@
1
- /// <reference types="react" />
2
- import React from 'react';
3
- import { ReactNode } from "react";
4
- type ListProps = {
5
- /**
6
- * HTML тег
7
- * @default 'ul'
8
- */
9
- tag?: 'ul' | 'ol';
10
- /**
11
- * Маркер
12
- * @default '—' for ul and 'decimal' for ol
13
- */
14
- marker?: 'lower-alpha' | 'decimal' | string | ReactNode;
15
- /**
16
- * Css-класс для стилизации
17
- */
18
- className?: string;
19
- /**
20
- * Id компонента для тестов
21
- */
22
- dataTestId?: string;
23
- /**
24
- * Дочерние элементы.
25
- */
26
- children?: ReactNode;
27
- } & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;
28
- declare const List: React.FC<ListProps>;
29
- export { ListProps, List };
package/esm/Component.js CHANGED
@@ -1,68 +1,6 @@
1
- import React, { Children } from 'react';
2
- import cn from 'classnames';
3
-
4
- /******************************************************************************
5
- Copyright (c) Microsoft Corporation.
6
-
7
- Permission to use, copy, modify, and/or distribute this software for any
8
- purpose with or without fee is hereby granted.
9
-
10
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
- PERFORMANCE OF THIS SOFTWARE.
17
- ***************************************************************************** */
18
- var __assign = function () {
19
- __assign = Object.assign || function __assign(t) {
20
- for (var s, i = 1, n = arguments.length; i < n; i++) {
21
- s = arguments[i];
22
- for (var p in s)
23
- if (Object.prototype.hasOwnProperty.call(s, p))
24
- t[p] = s[p];
25
- }
26
- return t;
27
- };
28
- return __assign.apply(this, arguments);
29
- };
30
- function __rest(s, e) {
31
- var t = {};
32
- for (var p in s)
33
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
34
- t[p] = s[p];
35
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
36
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
37
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
38
- t[p[i]] = s[p[i]];
39
- }
40
- return t;
41
- }
42
-
43
- var styles = {"list":"list__list_dvhxd","orderedList":"list__orderedList_dvhxd","lowerAlpha":"list__lowerAlpha_dvhxd","decimal":"list__decimal_dvhxd","item":"list__item_dvhxd","unorderedItem":"list__unorderedItem_dvhxd","orderedItem":"list__orderedItem_dvhxd","slot":"list__slot_dvhxd"};
44
- require('./index.css')
45
-
46
- var List = function (_a) {
47
- var _b, _c;
48
- var _d = _a.tag, tag = _d === void 0 ? 'ul' : _d, marker = _a.marker, className = _a.className, dataTestId = _a.dataTestId, children = _a.children, restProps = __rest(_a, ["tag", "marker", "className", "dataTestId", "children"]);
49
- var markerType = marker || (tag === 'ul' ? '—' : 'decimal');
50
- var orderedMarker = markerType === 'decimal' || markerType === 'lower-alpha';
51
- var Component = tag === 'ol' || orderedMarker ? 'ol' : 'ul';
52
- var unorderedList = Component === 'ul';
53
- var orderedList = Component === 'ol';
54
- var listClassNames = cn(styles.list, (_b = {},
55
- _b[styles.lowerAlpha] = markerType === 'lower-alpha',
56
- _b[styles.decimal] = markerType === 'decimal',
57
- _b[styles.orderedList] = orderedList,
58
- _b), className);
59
- var itemClassNames = cn(styles.item, (_c = {},
60
- _c[styles.unorderedItem] = unorderedList,
61
- _c[styles.orderedItem] = orderedList,
62
- _c));
63
- return (React.createElement(Component, __assign({ className: listClassNames, "data-test-id": dataTestId }, restProps), Children.map(children, function (child) { return (React.createElement("li", { className: itemClassNames },
64
- unorderedList && React.createElement("div", { className: styles.slot }, markerType),
65
- child)); })));
66
- };
67
-
68
- export { List };
1
+ import 'tslib';
2
+ import 'react';
3
+ import 'classnames';
4
+ export { a as List, L as ListContext } from './Component-5084b3b8.js';
5
+ import './utils.js';
6
+ import '@alfalab/core-components-typography/esm';
File without changes
@@ -0,0 +1,6 @@
1
+ import 'react';
2
+ import 'classnames';
3
+ import '@alfalab/core-components-typography/esm';
4
+ export { I as Item } from '../../Component-5084b3b8.js';
5
+ import 'tslib';
6
+ import '../../utils.js';
@@ -0,0 +1,49 @@
1
+ /* hash: vfky2 */
2
+ :root {
3
+ } /* deprecated */ :root {
4
+ --color-light-text-primary: #0b1f35; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
5
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
6
+ } :root {
7
+ } :root {
8
+
9
+ /* Hard */
10
+
11
+ /* Up */
12
+
13
+ /* Hard up */
14
+ } :root {
15
+ } :root {
16
+ --gap-3xs: 2px;
17
+ --gap-2xs: 4px;
18
+ --gap-s: 12px;
19
+ } :root {
20
+ } :root {
21
+ } :root {
22
+ --list-marker-color: var(--color-light-text-primary);
23
+ --list-item-margin: var(--gap-s);
24
+ } .list__item_opye0 {
25
+ margin-top: var(--list-item-margin);
26
+ display: flex
27
+ } .list__item_opye0:first-child {
28
+ margin-top: 0;
29
+ } .list__item_opye0.list__reversed_opye0:first-child {
30
+ margin-top: var(--list-item-margin);
31
+ } .list__item_opye0.list__reversed_opye0:last-child {
32
+ margin-top: 0;
33
+ } .list__item_opye0.list__unorderedItem_opye0 {
34
+ display: list-item;
35
+ } .list__slot_opye0 {
36
+ min-width: 20px;
37
+ display: flex;
38
+ box-sizing: border-box;
39
+ justify-content: start;
40
+ padding-right: var(--gap-2xs);
41
+ flex-shrink: 0
42
+ } .list__slot_opye0.list__defaultColor_opye0 {
43
+ color: var(--list-marker-color);
44
+ } .list__slot_opye0.list__disc_opye0 {
45
+ justify-content: center;
46
+ padding: 0 var(--gap-2xs);
47
+ } .list__caption_opye0 {
48
+ margin-top: var(--gap-3xs);
49
+ }
@@ -0,0 +1 @@
1
+ export * from "../../Component-5084b3b8";
@@ -0,0 +1,6 @@
1
+ export { I as Item } from '../../Component-5084b3b8.js';
2
+ import 'tslib';
3
+ import 'react';
4
+ import 'classnames';
5
+ import '@alfalab/core-components-typography/esm';
6
+ import '../../utils.js';
package/esm/index.css CHANGED
@@ -1,26 +1,22 @@
1
- /* hash: h40dj */
2
- :root {
3
- --color-light-text-primary: #0b1f35;
4
- }
1
+ /* hash: 19no9 */
5
2
  :root {
3
+ } /* deprecated */ :root {
4
+ --color-light-text-primary: #0b1f35; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
5
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
6
+ } :root {
7
+ } :root {
6
8
 
7
9
  /* Hard */
8
10
 
9
11
  /* Up */
10
12
 
11
13
  /* Hard up */
12
- }
13
- :root {
14
- --gap-2xs: 4px;
15
- --gap-xs: 8px;
16
- --gap-s: 12px;
14
+ } :root {
15
+ } :root {
17
16
  --gap-l: 20px;
18
- }
19
- :root {
20
- --list-marker-color: var(--color-light-text-primary);
21
- --list-item-margin: var(--gap-s);
22
- }
23
- .list__list_dvhxd {
17
+ } :root {
18
+ } :root {
19
+ } .list__list_1ngae {
24
20
  margin: 0;
25
21
  padding: 0;
26
22
  color: var(--color-light-text-primary);
@@ -30,29 +26,14 @@
30
26
  line-height: 24px;
31
27
 
32
28
  font-weight: 400;
33
- }
34
- .list__orderedList_dvhxd {
35
- padding-left: var(--gap-l);
36
- }
37
- .list__lowerAlpha_dvhxd {
29
+ } .list__lowerAlpha_1ngae {
38
30
  list-style-type: lower-alpha;
39
- }
40
- .list__decimal_dvhxd {
31
+ padding-left: var(--gap-l);
32
+ } .list__decimal_1ngae {
41
33
  list-style-type: decimal;
42
- }
43
- .list__item_dvhxd {
44
- margin-top: var(--list-item-margin)
45
- }
46
- .list__item_dvhxd:first-child {
47
- margin-top: 0;
48
- }
49
- .list__unorderedItem_dvhxd {
34
+ } ol.list__list_1ngae {
50
35
  display: flex;
51
- }
52
- .list__orderedItem_dvhxd {
53
- padding-left: var(--gap-2xs);
54
- }
55
- .list__slot_dvhxd {
56
- margin-right: var(--gap-xs);
57
- color: var(--list-marker-color);
58
- }
36
+ flex-direction: column
37
+ } ol.list__list_1ngae.list__reversed_1ngae {
38
+ flex-direction: column-reverse;
39
+ }
package/esm/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./Component";
1
+ export * from "./Component-0887e7cb";
2
2
  export * from "./presets";
package/esm/index.js CHANGED
@@ -1,4 +1,7 @@
1
- export { List } from './Component.js';
1
+ export { a as List, L as ListContext } from './Component-5084b3b8.js';
2
2
  export { listPresets } from './presets.js';
3
+ import 'tslib';
3
4
  import 'react';
4
5
  import 'classnames';
6
+ import '@alfalab/core-components-typography/esm';
7
+ import './utils.js';
package/esm/utils.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { ReactNode } from 'react';
3
+ declare const isItemElement: (obj: JSX.Element, name?: string) => boolean;
4
+ declare const isItem: (child: ReactNode) => boolean;
5
+ export { isItemElement, isItem };
package/esm/utils.js ADDED
@@ -0,0 +1,10 @@
1
+ import { isValidElement } from 'react';
2
+
3
+ var isItemElement = function (obj, name) {
4
+ return typeof obj === 'object' && obj.type.displayName === name;
5
+ };
6
+ var isItem = function (child) {
7
+ return isValidElement(child) && isItemElement(child, 'ListItem');
8
+ };
9
+
10
+ export { isItem, isItemElement };