@alfalab/core-components-list 5.0.15 → 5.0.16-alfasans
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Component.js.map +1 -1
- package/components/item/Component.js.map +1 -1
- package/components/item/index.css +9 -9
- package/components/item/index.module.css.js +1 -1
- package/components/item/index.module.css.js.map +1 -1
- package/context.js.map +1 -1
- package/cssm/Component.js.map +1 -1
- package/cssm/components/item/Component.js.map +1 -1
- package/cssm/context.js.map +1 -1
- package/cssm/index.module.css +6 -3
- package/cssm/presets.js.map +1 -1
- package/cssm/utils.js.map +1 -1
- package/esm/Component.js.map +1 -1
- package/esm/components/item/Component.js.map +1 -1
- package/esm/components/item/index.css +9 -9
- package/esm/components/item/index.module.css.js +1 -1
- package/esm/components/item/index.module.css.js.map +1 -1
- package/esm/context.js.map +1 -1
- package/esm/index.css +11 -8
- package/esm/index.module.css.js +1 -1
- package/esm/index.module.css.js.map +1 -1
- package/esm/presets.js.map +1 -1
- package/esm/utils.js.map +1 -1
- package/index.css +11 -8
- package/index.module.css.js +1 -1
- package/index.module.css.js.map +1 -1
- package/modern/Component.js.map +1 -1
- package/modern/components/item/Component.js.map +1 -1
- package/modern/components/item/index.css +9 -9
- package/modern/components/item/index.module.css.js +1 -1
- package/modern/components/item/index.module.css.js.map +1 -1
- package/modern/context.js.map +1 -1
- package/modern/index.css +11 -8
- package/modern/index.module.css.js +1 -1
- package/modern/index.module.css.js.map +1 -1
- package/modern/presets.js.map +1 -1
- package/modern/utils.js.map +1 -1
- package/moderncssm/Component.js.map +1 -1
- package/moderncssm/components/item/Component.js.map +1 -1
- package/moderncssm/context.js.map +1 -1
- package/moderncssm/index.module.css +3 -1
- package/moderncssm/presets.js.map +1 -1
- package/moderncssm/utils.js.map +1 -1
- package/package.json +4 -4
- package/presets.js.map +1 -1
- package/utils.js.map +1 -1
package/Component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["src/Component.tsx"],"sourcesContent":["import React, { Children, type ReactNode } from 'react';\nimport cn from 'classnames';\n\nimport { Item } from './components/item';\nimport { ListContext, type TListContext } from './context';\nimport { type ColorMarkerType } from './types';\nimport { isItem } from './utils';\n\nimport styles from './index.module.css';\n\nexport { ListContext, type TListContext };\n\nexport type ListProps = {\n /**\n * HTML тег\n * @default 'ul'\n */\n tag?: 'ul' | 'ol';\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n marker?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Css-класс для стилизации\n */\n className?: string;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы\n */\n children?: ReactNode;\n} & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;\n\nconst ListComponent: React.FC<ListProps> = ({\n tag = 'ul',\n marker,\n className,\n dataTestId,\n colorMarker,\n children,\n reversed,\n start,\n ...restProps\n}) => {\n const markerType = marker || (tag === 'ul' ? '–' : 'decimal');\n const alphaMarker = markerType === 'lower-alpha';\n const decimalMarker = markerType === 'decimal';\n const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';\n\n const orderedList = Component === 'ol';\n\n const listClassNames = cn(\n styles.list,\n {\n [styles.lowerAlpha]: alphaMarker,\n [styles.decimal]: decimalMarker,\n [styles.reversed]: reversed,\n },\n className,\n );\n\n /* eslint-disable react/jsx-no-constructed-context-values */\n return (\n <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>\n {Children.map(children, (child, index) => (\n <ListContext.Provider\n value={{ orderedList, markerType, colorMarker, reversed, index, start }}\n >\n {isItem(child) ? child : <Item>{child}</Item>}\n </ListContext.Provider>\n ))}\n </Component>\n );\n};\n\nexport const List = Object.assign(ListComponent, {\n Item,\n});\n"],"names":["__rest","Component","cn","styles","React","__assign","Children","ListContext","isItem","Item"],"mappings":";;;;;;;;;;;;;;;;;AAwDA,IAAM,aAAa,GAAwB,UAAC,EAU3C,EAAA;;AATG,IAAA,IAAA,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["src/Component.tsx"],"sourcesContent":["import React, { Children, type ReactNode } from 'react';\nimport cn from 'classnames';\n\nimport { Item } from './components/item';\nimport { ListContext, type TListContext } from './context';\nimport { type ColorMarkerType } from './types';\nimport { isItem } from './utils';\n\nimport styles from './index.module.css';\n\nexport { ListContext, type TListContext };\n\nexport type ListProps = {\n /**\n * HTML тег\n * @default 'ul'\n */\n tag?: 'ul' | 'ol';\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n marker?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Css-класс для стилизации\n */\n className?: string;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы\n */\n children?: ReactNode;\n} & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;\n\nconst ListComponent: React.FC<ListProps> = ({\n tag = 'ul',\n marker,\n className,\n dataTestId,\n colorMarker,\n children,\n reversed,\n start,\n ...restProps\n}) => {\n const markerType = marker || (tag === 'ul' ? '–' : 'decimal');\n const alphaMarker = markerType === 'lower-alpha';\n const decimalMarker = markerType === 'decimal';\n const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';\n\n const orderedList = Component === 'ol';\n\n const listClassNames = cn(\n styles.list,\n {\n [styles.lowerAlpha]: alphaMarker,\n [styles.decimal]: decimalMarker,\n [styles.reversed]: reversed,\n },\n className,\n );\n\n /* eslint-disable react/jsx-no-constructed-context-values */\n return (\n <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>\n {Children.map(children, (child, index) => (\n <ListContext.Provider\n value={{ orderedList, markerType, colorMarker, reversed, index, start }}\n >\n {isItem(child) ? child : <Item>{child}</Item>}\n </ListContext.Provider>\n ))}\n </Component>\n );\n};\n\nexport const List = Object.assign(ListComponent, {\n Item,\n});\n"],"names":["__rest","Component","cn","styles","React","__assign","Children","ListContext","isItem","Item"],"mappings":";;;;;;;;;;;;;;;;;AAwDA,IAAM,aAAa,GAAwB,UAAC,EAU3C,EAAA;;AATG,IAAA,IAAA,EAAA,GAAA,EAAA,CAAA,GAAU,EAAV,GAAG,GAAA,EAAA,KAAA,MAAA,GAAG,IAAI,GAAA,EAAA,EACV,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,KAAK,GAAA,EAAA,CAAA,KAAA,EACF,SAAS,GAAAA,YAAA,CAAA,EAAA,EAT4B,4FAU3C,CADe;AAEZ,IAAA,IAAM,UAAU,GAAG,MAAM,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG,GAAG,SAAS,CAAC;AAC7D,IAAA,IAAM,WAAW,GAAG,UAAU,KAAK,aAAa;AAChD,IAAA,IAAM,aAAa,GAAG,UAAU,KAAK,SAAS;AAC9C,IAAA,IAAMC,WAAS,GAAG,GAAG,KAAK,IAAI,IAAI,WAAW,GAAG,IAAI,GAAG,IAAI;AAE3D,IAAA,IAAM,WAAW,GAAGA,WAAS,KAAK,IAAI;AAEtC,IAAA,IAAM,cAAc,GAAGC,mBAAE,CACrBC,YAAM,CAAC,IAAI,GAAA,EAAA,GAAA,EAAA;AAEP,QAAA,EAAA,CAACA,YAAM,CAAC,UAAU,CAAA,GAAG,WAAW;AAChC,QAAA,EAAA,CAACA,YAAM,CAAC,OAAO,CAAA,GAAG,aAAa;AAC/B,QAAA,EAAA,CAACA,YAAM,CAAC,QAAQ,CAAA,GAAG,QAAQ;AAE/B,QAAA,EAAA,GAAA,SAAS,CACZ;;AAGD,IAAA,QACIC,sBAAA,CAAA,aAAA,CAACH,WAAS,EAAAI,cAAA,CAAA,EAAC,SAAS,EAAE,cAAc,EAAA,cAAA,EAAgB,UAAU,IAAM,SAAS,CAAA,EACxEC,cAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAC,KAAK,EAAE,KAAK,EAAA,EAAK,QACtCF,sBAAA,CAAA,aAAA,CAACG,mBAAW,CAAC,QAAQ,IACjB,KAAK,EAAE,EAAE,WAAW,aAAA,EAAE,UAAU,EAAA,UAAA,EAAE,WAAW,EAAA,WAAA,EAAE,QAAQ,EAAA,QAAA,EAAE,KAAK,EAAA,KAAA,EAAE,KAAK,OAAA,EAAE,EAAA,EAEtEC,YAAM,CAAC,KAAK,CAAC,GAAG,KAAK,GAAGJ,sBAAA,CAAA,aAAA,CAACK,cAAI,EAAA,IAAA,EAAE,KAAK,CAAQ,CAC1B,EAC1B,CANyC,CAMzC,CAAC,CACM;AAEpB,CAAC;IAEY,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE;AAC7C,IAAA,IAAI,EAAAA,cAAA;AACP,CAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../src/components/item/Component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { ListContext } from '../../context';\n\nimport styles from './index.module.css';\n\nexport type ItemProps = {\n /**\n * Дополнительный текст\n */\n caption?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n markerClassName?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n dataTestId?: string;\n};\n\nexport const Item: React.FC<ItemProps> = ({\n caption,\n children,\n className,\n markerClassName,\n dataTestId,\n}) => {\n const {\n orderedList,\n markerType,\n colorMarker,\n reversed,\n index = 0,\n start = 0,\n } = useContext(ListContext);\n\n const markerLowerAlpha = markerType === 'lower-alpha';\n\n const itemClassNames = cn(styles.item, className, {\n [styles.unorderedItem]: markerLowerAlpha,\n [styles.reversed]: reversed,\n });\n\n const isDisc = markerType === '•';\n\n const count = start === 0 ? index + 1 : start + index;\n const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;\n\n return (\n <li className={cn(itemClassNames)} data-test-id={dataTestId}>\n {!markerLowerAlpha && (\n <TypographyText\n tag='div'\n color={colorMarker}\n monospaceNumbers={true}\n view='primary-medium'\n className={cn(styles.slot, markerClassName, {\n [styles.disc]: isDisc && !orderedList,\n [styles.defaultColor]: !colorMarker,\n })}\n >\n {marker}\n </TypographyText>\n )}\n <div>\n <TypographyText tag='div' view='primary-medium'>\n {children}\n </TypographyText>\n {caption && (\n <TypographyText\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.caption}\n >\n {caption}\n </TypographyText>\n )}\n </div>\n </li>\n );\n};\n\nItem.displayName = 'Item';\n"],"names":["useContext","ListContext","cn","styles","React","TypographyText"],"mappings":";;;;;;;;;;;;;;;AAoCO,IAAM,IAAI,GAAwB,UAAC,EAMzC,EAAA;;AALG,IAAA,IAAA,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,UAAU,GAAA,EAAA,CAAA,UAAA;AAEJ,IAAA,IAAA,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../src/components/item/Component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { ListContext } from '../../context';\n\nimport styles from './index.module.css';\n\nexport type ItemProps = {\n /**\n * Дополнительный текст\n */\n caption?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n markerClassName?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n dataTestId?: string;\n};\n\nexport const Item: React.FC<ItemProps> = ({\n caption,\n children,\n className,\n markerClassName,\n dataTestId,\n}) => {\n const {\n orderedList,\n markerType,\n colorMarker,\n reversed,\n index = 0,\n start = 0,\n } = useContext(ListContext);\n\n const markerLowerAlpha = markerType === 'lower-alpha';\n\n const itemClassNames = cn(styles.item, className, {\n [styles.unorderedItem]: markerLowerAlpha,\n [styles.reversed]: reversed,\n });\n\n const isDisc = markerType === '•';\n\n const count = start === 0 ? index + 1 : start + index;\n const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;\n\n return (\n <li className={cn(itemClassNames)} data-test-id={dataTestId}>\n {!markerLowerAlpha && (\n <TypographyText\n tag='div'\n color={colorMarker}\n monospaceNumbers={true}\n view='primary-medium'\n className={cn(styles.slot, markerClassName, {\n [styles.disc]: isDisc && !orderedList,\n [styles.defaultColor]: !colorMarker,\n })}\n >\n {marker}\n </TypographyText>\n )}\n <div>\n <TypographyText tag='div' view='primary-medium'>\n {children}\n </TypographyText>\n {caption && (\n <TypographyText\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.caption}\n >\n {caption}\n </TypographyText>\n )}\n </div>\n </li>\n );\n};\n\nItem.displayName = 'Item';\n"],"names":["useContext","ListContext","cn","styles","React","TypographyText"],"mappings":";;;;;;;;;;;;;;;AAoCO,IAAM,IAAI,GAAwB,UAAC,EAMzC,EAAA;;AALG,IAAA,IAAA,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,UAAU,GAAA,EAAA,CAAA,UAAA;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,EAAA;AACtC,gBAAA,EAAA,CAACA,YAAM,CAAC,IAAI,IAAG,MAAM,IAAI,CAAC,WAAW;AACrC,gBAAA,EAAA,CAACA,YAAM,CAAC,YAAY,CAAA,GAAG,CAAC,WAAW;oBACrC,EAAA,EAED,MAAM,CACM,CACpB;AACD,QAAAC,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;YACIA,sBAAA,CAAA,aAAA,CAACC,uCAAc,EAAA,EAAC,GAAG,EAAC,KAAK,EAAC,IAAI,EAAC,gBAAgB,EAAA,EAC1C,QAAQ,CACI;AAChB,YAAA,OAAO,KACJD,sBAAA,CAAA,aAAA,CAACC,uCAAc,EAAA,EACX,GAAG,EAAC,KAAK,EACT,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,WAAW,EACjB,SAAS,EAAEF,YAAM,CAAC,OAAO,EAAA,EAExB,OAAO,CACK,CACpB,CACC,CACL;AAEb;AAEA,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
|
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
--list-marker-color: var(--color-light-text-primary);
|
|
12
12
|
--list-item-margin: var(--gap-12);
|
|
13
13
|
}
|
|
14
|
-
.
|
|
14
|
+
.list__item_6os8m {
|
|
15
15
|
margin-top: var(--list-item-margin);
|
|
16
16
|
display: flex;
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.list__item_6os8m:first-child {
|
|
19
19
|
margin-top: var(--gap-0);
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.list__item_6os8m.list__reversed_6os8m:first-child {
|
|
22
22
|
margin-top: var(--list-item-margin);
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.list__item_6os8m.list__reversed_6os8m:last-child {
|
|
25
25
|
margin-top: var(--gap-0);
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.list__item_6os8m.list__unorderedItem_6os8m {
|
|
28
28
|
display: list-item;
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
.list__slot_6os8m {
|
|
31
31
|
min-width: 20px;
|
|
32
32
|
display: flex;
|
|
33
33
|
box-sizing: border-box;
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
padding-right: var(--gap-4);
|
|
36
36
|
flex-shrink: 0;
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.list__slot_6os8m.list__defaultColor_6os8m {
|
|
39
39
|
color: var(--list-marker-color);
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.list__slot_6os8m.list__disc_6os8m {
|
|
42
42
|
justify-content: center;
|
|
43
43
|
padding: var(--gap-0) var(--gap-4);
|
|
44
44
|
}
|
|
45
|
-
.
|
|
45
|
+
.list__caption_6os8m {
|
|
46
46
|
margin-top: var(--gap-2);
|
|
47
47
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"item":"
|
|
5
|
+
var styles = {"item":"list__item_6os8m","reversed":"list__reversed_6os8m","unorderedItem":"list__unorderedItem_6os8m","slot":"list__slot_6os8m","defaultColor":"list__defaultColor_6os8m","disc":"list__disc_6os8m","caption":"list__caption_6os8m"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/item/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --list-marker-color: var(--color-light-text-primary);\n --list-item-margin: var(--gap-12);\n}\n\n.item {\n margin-top: var(--list-item-margin);\n display: flex;\n\n &:first-child {\n margin-top: var(--gap-0);\n }\n\n &.reversed:first-child {\n margin-top: var(--list-item-margin);\n }\n\n &.reversed:last-child {\n margin-top: var(--gap-0);\n }\n\n &.unorderedItem {\n display: list-item;\n }\n}\n\n.slot {\n min-width: 20px;\n display: flex;\n box-sizing: border-box;\n justify-content: flex-start;\n padding-right: var(--gap-4);\n flex-shrink: 0;\n\n &.defaultColor {\n color: var(--list-marker-color);\n }\n\n &.disc {\n justify-content: center;\n padding: var(--gap-0) var(--gap-4);\n }\n}\n\n.caption {\n margin-top: var(--gap-2);\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,sBAAsB,CAAC,eAAe,CAAC,2BAA2B,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,0BAA0B,CAAC,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/item/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --list-marker-color: var(--color-light-text-primary);\n --list-item-margin: var(--gap-12);\n}\n\n.item {\n margin-top: var(--list-item-margin);\n display: flex;\n\n &:first-child {\n margin-top: var(--gap-0);\n }\n\n &.reversed:first-child {\n margin-top: var(--list-item-margin);\n }\n\n &.reversed:last-child {\n margin-top: var(--gap-0);\n }\n\n &.unorderedItem {\n display: list-item;\n }\n}\n\n.slot {\n min-width: 20px;\n display: flex;\n box-sizing: border-box;\n justify-content: flex-start;\n padding-right: var(--gap-4);\n flex-shrink: 0;\n\n &.defaultColor {\n color: var(--list-marker-color);\n }\n\n &.disc {\n justify-content: center;\n padding: var(--gap-0) var(--gap-4);\n }\n}\n\n.caption {\n margin-top: var(--gap-2);\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,sBAAsB,CAAC,eAAe,CAAC,2BAA2B,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,0BAA0B,CAAC,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,qBAAqB,CAAC;;"}
|
package/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["src/context.ts"],"sourcesContent":["import { createContext, type ReactNode } from 'react';\n\nimport { type ColorMarkerType } from './types';\n\nexport type TListContext = {\n /**\n * Упорядоченный список\n */\n orderedList?: boolean;\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Номер пункта\n */\n index?: number;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n};\n\nexport const ListContext = createContext<TListContext>({});\n"],"names":["createContext"],"mappings":";;;;;;IAqCa,WAAW,GAAGA,mBAAa,CAAe,EAAE
|
|
1
|
+
{"version":3,"file":"context.js","sources":["src/context.ts"],"sourcesContent":["import { createContext, type ReactNode } from 'react';\n\nimport { type ColorMarkerType } from './types';\n\nexport type TListContext = {\n /**\n * Упорядоченный список\n */\n orderedList?: boolean;\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Номер пункта\n */\n index?: number;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n};\n\nexport const ListContext = createContext<TListContext>({});\n"],"names":["createContext"],"mappings":";;;;;;IAqCa,WAAW,GAAGA,mBAAa,CAAe,EAAE;;"}
|
package/cssm/Component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { Children, type ReactNode } from 'react';\nimport cn from 'classnames';\n\nimport { Item } from './components/item';\nimport { ListContext, type TListContext } from './context';\nimport { type ColorMarkerType } from './types';\nimport { isItem } from './utils';\n\nimport styles from './index.module.css';\n\nexport { ListContext, type TListContext };\n\nexport type ListProps = {\n /**\n * HTML тег\n * @default 'ul'\n */\n tag?: 'ul' | 'ol';\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n marker?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Css-класс для стилизации\n */\n className?: string;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы\n */\n children?: ReactNode;\n} & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;\n\nconst ListComponent: React.FC<ListProps> = ({\n tag = 'ul',\n marker,\n className,\n dataTestId,\n colorMarker,\n children,\n reversed,\n start,\n ...restProps\n}) => {\n const markerType = marker || (tag === 'ul' ? '–' : 'decimal');\n const alphaMarker = markerType === 'lower-alpha';\n const decimalMarker = markerType === 'decimal';\n const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';\n\n const orderedList = Component === 'ol';\n\n const listClassNames = cn(\n styles.list,\n {\n [styles.lowerAlpha]: alphaMarker,\n [styles.decimal]: decimalMarker,\n [styles.reversed]: reversed,\n },\n className,\n );\n\n /* eslint-disable react/jsx-no-constructed-context-values */\n return (\n <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>\n {Children.map(children, (child, index) => (\n <ListContext.Provider\n value={{ orderedList, markerType, colorMarker, reversed, index, start }}\n >\n {isItem(child) ? child : <Item>{child}</Item>}\n </ListContext.Provider>\n ))}\n </Component>\n );\n};\n\nexport const List = Object.assign(ListComponent, {\n Item,\n});\n"],"names":["__rest","Component","cn","styles","React","__assign","Children","ListContext","isItem","Item"],"mappings":";;;;;;;;;;;;;;;;;;AAwDA,IAAM,aAAa,GAAwB,UAAC,EAU3C,EAAA;;AATG,IAAA,IAAA,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { Children, type ReactNode } from 'react';\nimport cn from 'classnames';\n\nimport { Item } from './components/item';\nimport { ListContext, type TListContext } from './context';\nimport { type ColorMarkerType } from './types';\nimport { isItem } from './utils';\n\nimport styles from './index.module.css';\n\nexport { ListContext, type TListContext };\n\nexport type ListProps = {\n /**\n * HTML тег\n * @default 'ul'\n */\n tag?: 'ul' | 'ol';\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n marker?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Css-класс для стилизации\n */\n className?: string;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы\n */\n children?: ReactNode;\n} & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;\n\nconst ListComponent: React.FC<ListProps> = ({\n tag = 'ul',\n marker,\n className,\n dataTestId,\n colorMarker,\n children,\n reversed,\n start,\n ...restProps\n}) => {\n const markerType = marker || (tag === 'ul' ? '–' : 'decimal');\n const alphaMarker = markerType === 'lower-alpha';\n const decimalMarker = markerType === 'decimal';\n const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';\n\n const orderedList = Component === 'ol';\n\n const listClassNames = cn(\n styles.list,\n {\n [styles.lowerAlpha]: alphaMarker,\n [styles.decimal]: decimalMarker,\n [styles.reversed]: reversed,\n },\n className,\n );\n\n /* eslint-disable react/jsx-no-constructed-context-values */\n return (\n <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>\n {Children.map(children, (child, index) => (\n <ListContext.Provider\n value={{ orderedList, markerType, colorMarker, reversed, index, start }}\n >\n {isItem(child) ? child : <Item>{child}</Item>}\n </ListContext.Provider>\n ))}\n </Component>\n );\n};\n\nexport const List = Object.assign(ListComponent, {\n Item,\n});\n"],"names":["__rest","Component","cn","styles","React","__assign","Children","ListContext","isItem","Item"],"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AAgB,UAAU,IAAM,SAAS,CAAA,EACxEC,cAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAC,KAAK,EAAE,KAAK,EAAA,EAAK,QACtCF,sBAAA,CAAA,aAAA,CAACG,mBAAW,CAAC,QAAQ,IACjB,KAAK,EAAE,EAAE,WAAW,aAAA,EAAE,UAAU,EAAA,UAAA,EAAE,WAAW,EAAA,WAAA,EAAE,QAAQ,EAAA,QAAA,EAAE,KAAK,EAAA,KAAA,EAAE,KAAK,OAAA,EAAE,EAAA,EAEtEC,YAAM,CAAC,KAAK,CAAC,GAAG,KAAK,GAAGJ,sBAAA,CAAA,aAAA,CAACK,cAAI,EAAA,IAAA,EAAE,KAAK,CAAQ,CAC1B,EAC1B,CANyC,CAMzC,CAAC,CACM;AAEpB,CAAC;IAEY,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE;AAC7C,IAAA,IAAI,EAAAA,cAAA;AACP,CAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/item/Component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { ListContext } from '../../context';\n\nimport styles from './index.module.css';\n\nexport type ItemProps = {\n /**\n * Дополнительный текст\n */\n caption?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n markerClassName?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n dataTestId?: string;\n};\n\nexport const Item: React.FC<ItemProps> = ({\n caption,\n children,\n className,\n markerClassName,\n dataTestId,\n}) => {\n const {\n orderedList,\n markerType,\n colorMarker,\n reversed,\n index = 0,\n start = 0,\n } = useContext(ListContext);\n\n const markerLowerAlpha = markerType === 'lower-alpha';\n\n const itemClassNames = cn(styles.item, className, {\n [styles.unorderedItem]: markerLowerAlpha,\n [styles.reversed]: reversed,\n });\n\n const isDisc = markerType === '•';\n\n const count = start === 0 ? index + 1 : start + index;\n const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;\n\n return (\n <li className={cn(itemClassNames)} data-test-id={dataTestId}>\n {!markerLowerAlpha && (\n <TypographyText\n tag='div'\n color={colorMarker}\n monospaceNumbers={true}\n view='primary-medium'\n className={cn(styles.slot, markerClassName, {\n [styles.disc]: isDisc && !orderedList,\n [styles.defaultColor]: !colorMarker,\n })}\n >\n {marker}\n </TypographyText>\n )}\n <div>\n <TypographyText tag='div' view='primary-medium'>\n {children}\n </TypographyText>\n {caption && (\n <TypographyText\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.caption}\n >\n {caption}\n </TypographyText>\n )}\n </div>\n </li>\n );\n};\n\nItem.displayName = 'Item';\n"],"names":["useContext","ListContext","cn","styles","React","TypographyText"],"mappings":";;;;;;;;;;;;;;;;AAoCO,IAAM,IAAI,GAAwB,UAAC,EAMzC,EAAA;;AALG,IAAA,IAAA,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,UAAU,GAAA,EAAA,CAAA,UAAA;AAEJ,IAAA,IAAA,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/item/Component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { ListContext } from '../../context';\n\nimport styles from './index.module.css';\n\nexport type ItemProps = {\n /**\n * Дополнительный текст\n */\n caption?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n markerClassName?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n dataTestId?: string;\n};\n\nexport const Item: React.FC<ItemProps> = ({\n caption,\n children,\n className,\n markerClassName,\n dataTestId,\n}) => {\n const {\n orderedList,\n markerType,\n colorMarker,\n reversed,\n index = 0,\n start = 0,\n } = useContext(ListContext);\n\n const markerLowerAlpha = markerType === 'lower-alpha';\n\n const itemClassNames = cn(styles.item, className, {\n [styles.unorderedItem]: markerLowerAlpha,\n [styles.reversed]: reversed,\n });\n\n const isDisc = markerType === '•';\n\n const count = start === 0 ? index + 1 : start + index;\n const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;\n\n return (\n <li className={cn(itemClassNames)} data-test-id={dataTestId}>\n {!markerLowerAlpha && (\n <TypographyText\n tag='div'\n color={colorMarker}\n monospaceNumbers={true}\n view='primary-medium'\n className={cn(styles.slot, markerClassName, {\n [styles.disc]: isDisc && !orderedList,\n [styles.defaultColor]: !colorMarker,\n })}\n >\n {marker}\n </TypographyText>\n )}\n <div>\n <TypographyText tag='div' view='primary-medium'>\n {children}\n </TypographyText>\n {caption && (\n <TypographyText\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.caption}\n >\n {caption}\n </TypographyText>\n )}\n </div>\n </li>\n );\n};\n\nItem.displayName = 'Item';\n"],"names":["useContext","ListContext","cn","styles","React","TypographyText"],"mappings":";;;;;;;;;;;;;;;;AAoCO,IAAM,IAAI,GAAwB,UAAC,EAMzC,EAAA;;AALG,IAAA,IAAA,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,UAAU,GAAA,EAAA,CAAA,UAAA;AAEJ,IAAA,IAAA,EAAA,GAOFA,gBAAU,CAACC,mBAAW,CAAC,EANvB,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,QAAQ,GAAA,EAAA,CAAA,QAAA,EAC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BAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA;YACIA,sBAAA,CAAA,aAAA,CAACC,mBAAc,EAAA,EAAC,GAAG,EAAC,KAAK,EAAC,IAAI,EAAC,gBAAgB,EAAA,EAC1C,QAAQ,CACI;AAChB,YAAA,OAAO,KACJD,sBAAA,CAAA,aAAA,CAACC,mBAAc,EAAA,EACX,GAAG,EAAC,KAAK,EACT,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,WAAW,EACjB,SAAS,EAAEF,uBAAM,CAAC,OAAO,EAAA,EAExB,OAAO,CACK,CACpB,CACC,CACL;AAEb;AAEA,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
|
package/cssm/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import { createContext, type ReactNode } from 'react';\n\nimport { type ColorMarkerType } from './types';\n\nexport type TListContext = {\n /**\n * Упорядоченный список\n */\n orderedList?: boolean;\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Номер пункта\n */\n index?: number;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n};\n\nexport const ListContext = createContext<TListContext>({});\n"],"names":["createContext"],"mappings":";;;;;;IAqCa,WAAW,GAAGA,mBAAa,CAAe,EAAE
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import { createContext, type ReactNode } from 'react';\n\nimport { type ColorMarkerType } from './types';\n\nexport type TListContext = {\n /**\n * Упорядоченный список\n */\n orderedList?: boolean;\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Номер пункта\n */\n index?: number;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n};\n\nexport const ListContext = createContext<TListContext>({});\n"],"names":["createContext"],"mappings":";;;;;;IAqCa,WAAW,GAAGA,mBAAa,CAAe,EAAE;;"}
|
package/cssm/index.module.css
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
--gap-20: 20px;
|
|
7
7
|
}
|
|
8
8
|
:root {
|
|
9
|
-
--font-family-
|
|
10
|
-
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
9
|
+
--font-family-alfasans:
|
|
10
|
+
'Alfa Interface Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
11
|
+
Helvetica, sans-serif;
|
|
11
12
|
}
|
|
12
13
|
.list {
|
|
13
14
|
margin: var(--gap-0);
|
|
@@ -20,7 +21,9 @@
|
|
|
20
21
|
|
|
21
22
|
font-weight: 400;
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
letter-spacing: -0.24px;
|
|
25
|
+
|
|
26
|
+
font-family: var(--font-family-alfasans);
|
|
24
27
|
}
|
|
25
28
|
.lowerAlpha {
|
|
26
29
|
list-style-type: lower-alpha;
|
package/cssm/presets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sources":["../src/presets.ts"],"sourcesContent":["export const listPresets = {\n mobile: {\n tag: 'ul',\n marker: '–',\n },\n};\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"presets.js","sources":["../src/presets.ts"],"sourcesContent":["export const listPresets = {\n mobile: {\n tag: 'ul',\n marker: '–',\n },\n};\n"],"names":[],"mappings":";;;;AAAO,IAAM,WAAW,GAAG;AACvB,IAAA,MAAM,EAAE;AACJ,QAAA,GAAG,EAAE,IAAI;AACT,QAAA,MAAM,EAAE,GAAG;AACd,KAAA;;;"}
|
package/cssm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\nexport const isItemElement = (obj: JSX.Element, name?: string): boolean =>\n typeof obj === 'object' && obj.type.displayName === name;\n\nexport const isItem = (child: ReactNode) => isValidElement(child) && isItemElement(child, 'Item');\n"],"names":["isValidElement"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\nexport const isItemElement = (obj: JSX.Element, name?: string): boolean =>\n typeof obj === 'object' && obj.type.displayName === name;\n\nexport const isItem = (child: ReactNode) => isValidElement(child) && isItemElement(child, 'Item');\n"],"names":["isValidElement"],"mappings":";;;;;;AAEO,IAAM,aAAa,GAAG,UAAC,GAAgB,EAAE,IAAa,EAAA;IACzD,OAAA,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI;AAAxD;IAES,MAAM,GAAG,UAAC,KAAgB,EAAA,EAAK,OAAAA,oBAAc,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA,CAArD;;;"}
|
package/esm/Component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { Children, type ReactNode } from 'react';\nimport cn from 'classnames';\n\nimport { Item } from './components/item';\nimport { ListContext, type TListContext } from './context';\nimport { type ColorMarkerType } from './types';\nimport { isItem } from './utils';\n\nimport styles from './index.module.css';\n\nexport { ListContext, type TListContext };\n\nexport type ListProps = {\n /**\n * HTML тег\n * @default 'ul'\n */\n tag?: 'ul' | 'ol';\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n marker?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Css-класс для стилизации\n */\n className?: string;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы\n */\n children?: ReactNode;\n} & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;\n\nconst ListComponent: React.FC<ListProps> = ({\n tag = 'ul',\n marker,\n className,\n dataTestId,\n colorMarker,\n children,\n reversed,\n start,\n ...restProps\n}) => {\n const markerType = marker || (tag === 'ul' ? '–' : 'decimal');\n const alphaMarker = markerType === 'lower-alpha';\n const decimalMarker = markerType === 'decimal';\n const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';\n\n const orderedList = Component === 'ol';\n\n const listClassNames = cn(\n styles.list,\n {\n [styles.lowerAlpha]: alphaMarker,\n [styles.decimal]: decimalMarker,\n [styles.reversed]: reversed,\n },\n className,\n );\n\n /* eslint-disable react/jsx-no-constructed-context-values */\n return (\n <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>\n {Children.map(children, (child, index) => (\n <ListContext.Provider\n value={{ orderedList, markerType, colorMarker, reversed, index, start }}\n >\n {isItem(child) ? child : <Item>{child}</Item>}\n </ListContext.Provider>\n ))}\n </Component>\n );\n};\n\nexport const List = Object.assign(ListComponent, {\n Item,\n});\n"],"names":[],"mappings":";;;;;;;;AAwDA,IAAM,aAAa,GAAwB,UAAC,EAU3C,EAAA;;AATG,IAAA,IAAA,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { Children, type ReactNode } from 'react';\nimport cn from 'classnames';\n\nimport { Item } from './components/item';\nimport { ListContext, type TListContext } from './context';\nimport { type ColorMarkerType } from './types';\nimport { isItem } from './utils';\n\nimport styles from './index.module.css';\n\nexport { ListContext, type TListContext };\n\nexport type ListProps = {\n /**\n * HTML тег\n * @default 'ul'\n */\n tag?: 'ul' | 'ol';\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n marker?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Css-класс для стилизации\n */\n className?: string;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы\n */\n children?: ReactNode;\n} & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;\n\nconst ListComponent: React.FC<ListProps> = ({\n tag = 'ul',\n marker,\n className,\n dataTestId,\n colorMarker,\n children,\n reversed,\n start,\n ...restProps\n}) => {\n const markerType = marker || (tag === 'ul' ? '–' : 'decimal');\n const alphaMarker = markerType === 'lower-alpha';\n const decimalMarker = markerType === 'decimal';\n const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';\n\n const orderedList = Component === 'ol';\n\n const listClassNames = cn(\n styles.list,\n {\n [styles.lowerAlpha]: alphaMarker,\n [styles.decimal]: decimalMarker,\n [styles.reversed]: reversed,\n },\n className,\n );\n\n /* eslint-disable react/jsx-no-constructed-context-values */\n return (\n <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>\n {Children.map(children, (child, index) => (\n <ListContext.Provider\n value={{ orderedList, markerType, colorMarker, reversed, index, start }}\n >\n {isItem(child) ? child : <Item>{child}</Item>}\n </ListContext.Provider>\n ))}\n </Component>\n );\n};\n\nexport const List = Object.assign(ListComponent, {\n Item,\n});\n"],"names":[],"mappings":";;;;;;;;AAwDA,IAAM,aAAa,GAAwB,UAAC,EAU3C,EAAA;;AATG,IAAA,IAAA,EAAA,GAAA,EAAA,CAAA,GAAU,EAAV,GAAG,GAAA,EAAA,KAAA,MAAA,GAAG,IAAI,GAAA,EAAA,EACV,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,UAAU,GAAA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EAAA,KAAA,EAAE,KAAK,OAAA,EAAE,EAAA,EAEtE,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,IAAA,EAAE,KAAK,CAAQ,CAC1B,EAC1B,CANyC,CAMzC,CAAC,CACM;AAEpB,CAAC;IAEY,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE;AAC7C,IAAA,IAAI,EAAA,IAAA;AACP,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/item/Component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { ListContext } from '../../context';\n\nimport styles from './index.module.css';\n\nexport type ItemProps = {\n /**\n * Дополнительный текст\n */\n caption?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n markerClassName?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n dataTestId?: string;\n};\n\nexport const Item: React.FC<ItemProps> = ({\n caption,\n children,\n className,\n markerClassName,\n dataTestId,\n}) => {\n const {\n orderedList,\n markerType,\n colorMarker,\n reversed,\n index = 0,\n start = 0,\n } = useContext(ListContext);\n\n const markerLowerAlpha = markerType === 'lower-alpha';\n\n const itemClassNames = cn(styles.item, className, {\n [styles.unorderedItem]: markerLowerAlpha,\n [styles.reversed]: reversed,\n });\n\n const isDisc = markerType === '•';\n\n const count = start === 0 ? index + 1 : start + index;\n const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;\n\n return (\n <li className={cn(itemClassNames)} data-test-id={dataTestId}>\n {!markerLowerAlpha && (\n <TypographyText\n tag='div'\n color={colorMarker}\n monospaceNumbers={true}\n view='primary-medium'\n className={cn(styles.slot, markerClassName, {\n [styles.disc]: isDisc && !orderedList,\n [styles.defaultColor]: !colorMarker,\n })}\n >\n {marker}\n </TypographyText>\n )}\n <div>\n <TypographyText tag='div' view='primary-medium'>\n {children}\n </TypographyText>\n {caption && (\n <TypographyText\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.caption}\n >\n {caption}\n </TypographyText>\n )}\n </div>\n </li>\n );\n};\n\nItem.displayName = 'Item';\n"],"names":[],"mappings":";;;;;;AAoCO,IAAM,IAAI,GAAwB,UAAC,EAMzC,EAAA;;AALG,IAAA,IAAA,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,UAAU,GAAA,EAAA,CAAA,UAAA;AAEJ,IAAA,IAAA,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/item/Component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { ListContext } from '../../context';\n\nimport styles from './index.module.css';\n\nexport type ItemProps = {\n /**\n * Дополнительный текст\n */\n caption?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n markerClassName?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n dataTestId?: string;\n};\n\nexport const Item: React.FC<ItemProps> = ({\n caption,\n children,\n className,\n markerClassName,\n dataTestId,\n}) => {\n const {\n orderedList,\n markerType,\n colorMarker,\n reversed,\n index = 0,\n start = 0,\n } = useContext(ListContext);\n\n const markerLowerAlpha = markerType === 'lower-alpha';\n\n const itemClassNames = cn(styles.item, className, {\n [styles.unorderedItem]: markerLowerAlpha,\n [styles.reversed]: reversed,\n });\n\n const isDisc = markerType === '•';\n\n const count = start === 0 ? index + 1 : start + index;\n const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;\n\n return (\n <li className={cn(itemClassNames)} data-test-id={dataTestId}>\n {!markerLowerAlpha && (\n <TypographyText\n tag='div'\n color={colorMarker}\n monospaceNumbers={true}\n view='primary-medium'\n className={cn(styles.slot, markerClassName, {\n [styles.disc]: isDisc && !orderedList,\n [styles.defaultColor]: !colorMarker,\n })}\n >\n {marker}\n </TypographyText>\n )}\n <div>\n <TypographyText tag='div' view='primary-medium'>\n {children}\n </TypographyText>\n {caption && (\n <TypographyText\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.caption}\n >\n {caption}\n </TypographyText>\n )}\n </div>\n </li>\n );\n};\n\nItem.displayName = 'Item';\n"],"names":[],"mappings":";;;;;;AAoCO,IAAM,IAAI,GAAwB,UAAC,EAMzC,EAAA;;AALG,IAAA,IAAA,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,UAAU,GAAA,EAAA,CAAA,UAAA;AAEJ,IAAA,IAAA,EAAA,GAOF,UAAU,CAAC,WAAW,CAAC,EANvB,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,EAAA,GAAA,EAAA,CAAA,KAAS,EAAT,KAAK,mBAAG,CAAC,GAAA,EAAA,EACT,EAAA,GAAA,EAAA,CAAA,KAAS,EAAT,KAAK,GAAA,EAAA,KAAA,MAAA,GAAG,CAAC,KACc;AAE3B,IAAA,IAAM,gBAAgB,GAAG,UAAU,KAAK,aAAa;IAErD,IAAM,cAAc,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,GAAA,EAAA,GAAA,EAAA;AAC5C,QAAA,EAAA,CAAC,MAAM,CAAC,aAAa,CAAA,GAAG,gBAAgB;AACxC,QAAA,E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,MAAM;;"}
|
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
--list-marker-color: var(--color-light-text-primary);
|
|
12
12
|
--list-item-margin: var(--gap-12);
|
|
13
13
|
}
|
|
14
|
-
.
|
|
14
|
+
.list__item_6os8m {
|
|
15
15
|
margin-top: var(--list-item-margin);
|
|
16
16
|
display: flex;
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.list__item_6os8m:first-child {
|
|
19
19
|
margin-top: var(--gap-0);
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.list__item_6os8m.list__reversed_6os8m:first-child {
|
|
22
22
|
margin-top: var(--list-item-margin);
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.list__item_6os8m.list__reversed_6os8m:last-child {
|
|
25
25
|
margin-top: var(--gap-0);
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.list__item_6os8m.list__unorderedItem_6os8m {
|
|
28
28
|
display: list-item;
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
.list__slot_6os8m {
|
|
31
31
|
min-width: 20px;
|
|
32
32
|
display: flex;
|
|
33
33
|
box-sizing: border-box;
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
padding-right: var(--gap-4);
|
|
36
36
|
flex-shrink: 0;
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.list__slot_6os8m.list__defaultColor_6os8m {
|
|
39
39
|
color: var(--list-marker-color);
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.list__slot_6os8m.list__disc_6os8m {
|
|
42
42
|
justify-content: center;
|
|
43
43
|
padding: var(--gap-0) var(--gap-4);
|
|
44
44
|
}
|
|
45
|
-
.
|
|
45
|
+
.list__caption_6os8m {
|
|
46
46
|
margin-top: var(--gap-2);
|
|
47
47
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"item":"
|
|
3
|
+
var styles = {"item":"list__item_6os8m","reversed":"list__reversed_6os8m","unorderedItem":"list__unorderedItem_6os8m","slot":"list__slot_6os8m","defaultColor":"list__defaultColor_6os8m","disc":"list__disc_6os8m","caption":"list__caption_6os8m"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/item/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --list-marker-color: var(--color-light-text-primary);\n --list-item-margin: var(--gap-12);\n}\n\n.item {\n margin-top: var(--list-item-margin);\n display: flex;\n\n &:first-child {\n margin-top: var(--gap-0);\n }\n\n &.reversed:first-child {\n margin-top: var(--list-item-margin);\n }\n\n &.reversed:last-child {\n margin-top: var(--gap-0);\n }\n\n &.unorderedItem {\n display: list-item;\n }\n}\n\n.slot {\n min-width: 20px;\n display: flex;\n box-sizing: border-box;\n justify-content: flex-start;\n padding-right: var(--gap-4);\n flex-shrink: 0;\n\n &.defaultColor {\n color: var(--list-marker-color);\n }\n\n &.disc {\n justify-content: center;\n padding: var(--gap-0) var(--gap-4);\n }\n}\n\n.caption {\n margin-top: var(--gap-2);\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,sBAAsB,CAAC,eAAe,CAAC,2BAA2B,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,0BAA0B,CAAC,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/item/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --list-marker-color: var(--color-light-text-primary);\n --list-item-margin: var(--gap-12);\n}\n\n.item {\n margin-top: var(--list-item-margin);\n display: flex;\n\n &:first-child {\n margin-top: var(--gap-0);\n }\n\n &.reversed:first-child {\n margin-top: var(--list-item-margin);\n }\n\n &.reversed:last-child {\n margin-top: var(--gap-0);\n }\n\n &.unorderedItem {\n display: list-item;\n }\n}\n\n.slot {\n min-width: 20px;\n display: flex;\n box-sizing: border-box;\n justify-content: flex-start;\n padding-right: var(--gap-4);\n flex-shrink: 0;\n\n &.defaultColor {\n color: var(--list-marker-color);\n }\n\n &.disc {\n justify-content: center;\n padding: var(--gap-0) var(--gap-4);\n }\n}\n\n.caption {\n margin-top: var(--gap-2);\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,sBAAsB,CAAC,eAAe,CAAC,2BAA2B,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,0BAA0B,CAAC,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,qBAAqB,CAAC;;"}
|
package/esm/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import { createContext, type ReactNode } from 'react';\n\nimport { type ColorMarkerType } from './types';\n\nexport type TListContext = {\n /**\n * Упорядоченный список\n */\n orderedList?: boolean;\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Номер пункта\n */\n index?: number;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n};\n\nexport const ListContext = createContext<TListContext>({});\n"],"names":[],"mappings":";;IAqCa,WAAW,GAAG,aAAa,CAAe,EAAE
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import { createContext, type ReactNode } from 'react';\n\nimport { type ColorMarkerType } from './types';\n\nexport type TListContext = {\n /**\n * Упорядоченный список\n */\n orderedList?: boolean;\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Номер пункта\n */\n index?: number;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n};\n\nexport const ListContext = createContext<TListContext>({});\n"],"names":[],"mappings":";;IAqCa,WAAW,GAAG,aAAa,CAAe,EAAE;;"}
|
package/esm/index.css
CHANGED
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
--gap-20: 20px;
|
|
7
7
|
}
|
|
8
8
|
:root {
|
|
9
|
-
--font-family-
|
|
10
|
-
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
9
|
+
--font-family-alfasans:
|
|
10
|
+
'Alfa Interface Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
11
|
+
Helvetica, sans-serif;
|
|
11
12
|
}
|
|
12
|
-
.
|
|
13
|
+
.list__list_cjc3w {
|
|
13
14
|
margin: var(--gap-0);
|
|
14
15
|
padding: var(--gap-0);
|
|
15
16
|
color: var(--color-light-text-primary);
|
|
@@ -20,19 +21,21 @@
|
|
|
20
21
|
|
|
21
22
|
font-weight: 400;
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
letter-spacing: -0.24px;
|
|
25
|
+
|
|
26
|
+
font-family: var(--font-family-alfasans);
|
|
24
27
|
}
|
|
25
|
-
.
|
|
28
|
+
.list__lowerAlpha_cjc3w {
|
|
26
29
|
list-style-type: lower-alpha;
|
|
27
30
|
padding-left: var(--gap-20);
|
|
28
31
|
}
|
|
29
|
-
.
|
|
32
|
+
.list__decimal_cjc3w {
|
|
30
33
|
list-style-type: decimal;
|
|
31
34
|
}
|
|
32
|
-
ol.
|
|
35
|
+
ol.list__list_cjc3w {
|
|
33
36
|
display: flex;
|
|
34
37
|
flex-direction: column;
|
|
35
38
|
}
|
|
36
|
-
ol.
|
|
39
|
+
ol.list__list_cjc3w.list__reversed_cjc3w {
|
|
37
40
|
flex-direction: column-reverse;
|
|
38
41
|
}
|
package/esm/index.module.css.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"list":"
|
|
3
|
+
var styles = {"list":"list__list_cjc3w","lowerAlpha":"list__lowerAlpha_cjc3w","decimal":"list__decimal_cjc3w","reversed":"list__reversed_cjc3w"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.list {\n margin: var(--gap-0);\n padding: var(--gap-0);\n color: var(--color-light-text-primary);\n\n @mixin paragraph_primary_medium;\n}\n\n.lowerAlpha {\n list-style-type: lower-alpha;\n padding-left: var(--gap-20);\n}\n\n.decimal {\n list-style-type: decimal;\n}\n\nol.list {\n display: flex;\n flex-direction: column;\n\n &.reversed {\n flex-direction: column-reverse;\n }\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,wBAAwB,CAAC,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.list {\n margin: var(--gap-0);\n padding: var(--gap-0);\n color: var(--color-light-text-primary);\n\n @mixin paragraph_primary_medium;\n}\n\n.lowerAlpha {\n list-style-type: lower-alpha;\n padding-left: var(--gap-20);\n}\n\n.decimal {\n list-style-type: decimal;\n}\n\nol.list {\n display: flex;\n flex-direction: column;\n\n &.reversed {\n flex-direction: column-reverse;\n }\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,wBAAwB,CAAC,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,sBAAsB,CAAC;;"}
|
package/esm/presets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sources":["../src/presets.ts"],"sourcesContent":["export const listPresets = {\n mobile: {\n tag: 'ul',\n marker: '–',\n },\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"presets.js","sources":["../src/presets.ts"],"sourcesContent":["export const listPresets = {\n mobile: {\n tag: 'ul',\n marker: '–',\n },\n};\n"],"names":[],"mappings":"AAAO,IAAM,WAAW,GAAG;AACvB,IAAA,MAAM,EAAE;AACJ,QAAA,GAAG,EAAE,IAAI;AACT,QAAA,MAAM,EAAE,GAAG;AACd,KAAA;;;"}
|
package/esm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\nexport const isItemElement = (obj: JSX.Element, name?: string): boolean =>\n typeof obj === 'object' && obj.type.displayName === name;\n\nexport const isItem = (child: ReactNode) => isValidElement(child) && isItemElement(child, 'Item');\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\nexport const isItemElement = (obj: JSX.Element, name?: string): boolean =>\n typeof obj === 'object' && obj.type.displayName === name;\n\nexport const isItem = (child: ReactNode) => isValidElement(child) && isItemElement(child, 'Item');\n"],"names":[],"mappings":";;AAEO,IAAM,aAAa,GAAG,UAAC,GAAgB,EAAE,IAAa,EAAA;IACzD,OAAA,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI;AAAxD;IAES,MAAM,GAAG,UAAC,KAAgB,EAAA,EAAK,OAAA,cAAc,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA,CAArD;;"}
|
package/index.css
CHANGED
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
--gap-20: 20px;
|
|
7
7
|
}
|
|
8
8
|
:root {
|
|
9
|
-
--font-family-
|
|
10
|
-
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
9
|
+
--font-family-alfasans:
|
|
10
|
+
'Alfa Interface Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
11
|
+
Helvetica, sans-serif;
|
|
11
12
|
}
|
|
12
|
-
.
|
|
13
|
+
.list__list_cjc3w {
|
|
13
14
|
margin: var(--gap-0);
|
|
14
15
|
padding: var(--gap-0);
|
|
15
16
|
color: var(--color-light-text-primary);
|
|
@@ -20,19 +21,21 @@
|
|
|
20
21
|
|
|
21
22
|
font-weight: 400;
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
letter-spacing: -0.24px;
|
|
25
|
+
|
|
26
|
+
font-family: var(--font-family-alfasans);
|
|
24
27
|
}
|
|
25
|
-
.
|
|
28
|
+
.list__lowerAlpha_cjc3w {
|
|
26
29
|
list-style-type: lower-alpha;
|
|
27
30
|
padding-left: var(--gap-20);
|
|
28
31
|
}
|
|
29
|
-
.
|
|
32
|
+
.list__decimal_cjc3w {
|
|
30
33
|
list-style-type: decimal;
|
|
31
34
|
}
|
|
32
|
-
ol.
|
|
35
|
+
ol.list__list_cjc3w {
|
|
33
36
|
display: flex;
|
|
34
37
|
flex-direction: column;
|
|
35
38
|
}
|
|
36
|
-
ol.
|
|
39
|
+
ol.list__list_cjc3w.list__reversed_cjc3w {
|
|
37
40
|
flex-direction: column-reverse;
|
|
38
41
|
}
|
package/index.module.css.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"list":"
|
|
5
|
+
var styles = {"list":"list__list_cjc3w","lowerAlpha":"list__lowerAlpha_cjc3w","decimal":"list__decimal_cjc3w","reversed":"list__reversed_cjc3w"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
package/index.module.css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.list {\n margin: var(--gap-0);\n padding: var(--gap-0);\n color: var(--color-light-text-primary);\n\n @mixin paragraph_primary_medium;\n}\n\n.lowerAlpha {\n list-style-type: lower-alpha;\n padding-left: var(--gap-20);\n}\n\n.decimal {\n list-style-type: decimal;\n}\n\nol.list {\n display: flex;\n flex-direction: column;\n\n &.reversed {\n flex-direction: column-reverse;\n }\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,wBAAwB,CAAC,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.list {\n margin: var(--gap-0);\n padding: var(--gap-0);\n color: var(--color-light-text-primary);\n\n @mixin paragraph_primary_medium;\n}\n\n.lowerAlpha {\n list-style-type: lower-alpha;\n padding-left: var(--gap-20);\n}\n\n.decimal {\n list-style-type: decimal;\n}\n\nol.list {\n display: flex;\n flex-direction: column;\n\n &.reversed {\n flex-direction: column-reverse;\n }\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,wBAAwB,CAAC,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,sBAAsB,CAAC;;"}
|
package/modern/Component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { Children, type ReactNode } from 'react';\nimport cn from 'classnames';\n\nimport { Item } from './components/item';\nimport { ListContext, type TListContext } from './context';\nimport { type ColorMarkerType } from './types';\nimport { isItem } from './utils';\n\nimport styles from './index.module.css';\n\nexport { ListContext, type TListContext };\n\nexport type ListProps = {\n /**\n * HTML тег\n * @default 'ul'\n */\n tag?: 'ul' | 'ol';\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n marker?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Css-класс для стилизации\n */\n className?: string;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы\n */\n children?: ReactNode;\n} & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;\n\nconst ListComponent: React.FC<ListProps> = ({\n tag = 'ul',\n marker,\n className,\n dataTestId,\n colorMarker,\n children,\n reversed,\n start,\n ...restProps\n}) => {\n const markerType = marker || (tag === 'ul' ? '–' : 'decimal');\n const alphaMarker = markerType === 'lower-alpha';\n const decimalMarker = markerType === 'decimal';\n const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';\n\n const orderedList = Component === 'ol';\n\n const listClassNames = cn(\n styles.list,\n {\n [styles.lowerAlpha]: alphaMarker,\n [styles.decimal]: decimalMarker,\n [styles.reversed]: reversed,\n },\n className,\n );\n\n /* eslint-disable react/jsx-no-constructed-context-values */\n return (\n <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>\n {Children.map(children, (child, index) => (\n <ListContext.Provider\n value={{ orderedList, markerType, colorMarker, reversed, index, start }}\n >\n {isItem(child) ? child : <Item>{child}</Item>}\n </ListContext.Provider>\n ))}\n </Component>\n );\n};\n\nexport const List = Object.assign(ListComponent, {\n Item,\n});\n"],"names":[],"mappings":";;;;;;;AAwDA,MAAM,aAAa,GAAwB,CAAC,EACxC,GAAG,GAAG,IAAI,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,GAAG,SAAS,EACf,KAAI;AACD,IAAA,MAAM,UAAU,GAAG,MAAM,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG,GAAG,SAAS,CAAC;AAC7D,IAAA,MAAM,WAAW,GAAG,UAAU,KAAK,aAAa;AAChD,IAAA,MAAM,aAAa,GAAG,UAAU,KAAK,SAAS;AAC9C,IAAA,MAAM,SAAS,GAAG,GAAG,KAAK,IAAI,IAAI,WAAW,GAAG,IAAI,GAAG,IAAI;AAE3D,IAAA,MAAM,WAAW,GAAG,SAAS,KAAK,IAAI;AAEtC,IAAA,MAAM,cAAc,GAAG,EAAE,CACrB,MAAM,CAAC,IAAI,EACX;AACI,QAAA,CAAC,MAAM,CAAC,UAAU,GAAG,WAAW;AAChC,QAAA,CAAC,MAAM,CAAC,OAAO,GAAG,aAAa;AAC/B,QAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;KAC9B,EACD,SAAS,CACZ;;AAGD,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { Children, type ReactNode } from 'react';\nimport cn from 'classnames';\n\nimport { Item } from './components/item';\nimport { ListContext, type TListContext } from './context';\nimport { type ColorMarkerType } from './types';\nimport { isItem } from './utils';\n\nimport styles from './index.module.css';\n\nexport { ListContext, type TListContext };\n\nexport type ListProps = {\n /**\n * HTML тег\n * @default 'ul'\n */\n tag?: 'ul' | 'ol';\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n marker?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Css-класс для стилизации\n */\n className?: string;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы\n */\n children?: ReactNode;\n} & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;\n\nconst ListComponent: React.FC<ListProps> = ({\n tag = 'ul',\n marker,\n className,\n dataTestId,\n colorMarker,\n children,\n reversed,\n start,\n ...restProps\n}) => {\n const markerType = marker || (tag === 'ul' ? '–' : 'decimal');\n const alphaMarker = markerType === 'lower-alpha';\n const decimalMarker = markerType === 'decimal';\n const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';\n\n const orderedList = Component === 'ol';\n\n const listClassNames = cn(\n styles.list,\n {\n [styles.lowerAlpha]: alphaMarker,\n [styles.decimal]: decimalMarker,\n [styles.reversed]: reversed,\n },\n className,\n );\n\n /* eslint-disable react/jsx-no-constructed-context-values */\n return (\n <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>\n {Children.map(children, (child, index) => (\n <ListContext.Provider\n value={{ orderedList, markerType, colorMarker, reversed, index, start }}\n >\n {isItem(child) ? child : <Item>{child}</Item>}\n </ListContext.Provider>\n ))}\n </Component>\n );\n};\n\nexport const List = Object.assign(ListComponent, {\n Item,\n});\n"],"names":[],"mappings":";;;;;;;AAwDA,MAAM,aAAa,GAAwB,CAAC,EACxC,GAAG,GAAG,IAAI,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,GAAG,SAAS,EACf,KAAI;AACD,IAAA,MAAM,UAAU,GAAG,MAAM,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG,GAAG,SAAS,CAAC;AAC7D,IAAA,MAAM,WAAW,GAAG,UAAU,KAAK,aAAa;AAChD,IAAA,MAAM,aAAa,GAAG,UAAU,KAAK,SAAS;AAC9C,IAAA,MAAM,SAAS,GAAG,GAAG,KAAK,IAAI,IAAI,WAAW,GAAG,IAAI,GAAG,IAAI;AAE3D,IAAA,MAAM,WAAW,GAAG,SAAS,KAAK,IAAI;AAEtC,IAAA,MAAM,cAAc,GAAG,EAAE,CACrB,MAAM,CAAC,IAAI,EACX;AACI,QAAA,CAAC,MAAM,CAAC,UAAU,GAAG,WAAW;AAChC,QAAA,CAAC,MAAM,CAAC,OAAO,GAAG,aAAa;AAC/B,QAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;KAC9B,EACD,SAAS,CACZ;;AAGD,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAE,cAAc,EAAA,cAAA,EAAgB,UAAU,EAAA,GAAM,SAAS,EAAA,EACxE,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,MACjC,KAAA,CAAA,aAAA,CAAC,WAAW,CAAC,QAAQ,EAAA,EACjB,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAA,EAEtE,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,oBAAC,IAAI,EAAA,IAAA,EAAE,KAAK,CAAQ,CAC1B,CAC1B,CAAC,CACM;AAEpB,CAAC;MAEY,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE;IAC7C,IAAI;AACP,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/item/Component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { ListContext } from '../../context';\n\nimport styles from './index.module.css';\n\nexport type ItemProps = {\n /**\n * Дополнительный текст\n */\n caption?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n markerClassName?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n dataTestId?: string;\n};\n\nexport const Item: React.FC<ItemProps> = ({\n caption,\n children,\n className,\n markerClassName,\n dataTestId,\n}) => {\n const {\n orderedList,\n markerType,\n colorMarker,\n reversed,\n index = 0,\n start = 0,\n } = useContext(ListContext);\n\n const markerLowerAlpha = markerType === 'lower-alpha';\n\n const itemClassNames = cn(styles.item, className, {\n [styles.unorderedItem]: markerLowerAlpha,\n [styles.reversed]: reversed,\n });\n\n const isDisc = markerType === '•';\n\n const count = start === 0 ? index + 1 : start + index;\n const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;\n\n return (\n <li className={cn(itemClassNames)} data-test-id={dataTestId}>\n {!markerLowerAlpha && (\n <TypographyText\n tag='div'\n color={colorMarker}\n monospaceNumbers={true}\n view='primary-medium'\n className={cn(styles.slot, markerClassName, {\n [styles.disc]: isDisc && !orderedList,\n [styles.defaultColor]: !colorMarker,\n })}\n >\n {marker}\n </TypographyText>\n )}\n <div>\n <TypographyText tag='div' view='primary-medium'>\n {children}\n </TypographyText>\n {caption && (\n <TypographyText\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.caption}\n >\n {caption}\n </TypographyText>\n )}\n </div>\n </li>\n );\n};\n\nItem.displayName = 'Item';\n"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/item/Component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { ListContext } from '../../context';\n\nimport styles from './index.module.css';\n\nexport type ItemProps = {\n /**\n * Дополнительный текст\n */\n caption?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n markerClassName?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n dataTestId?: string;\n};\n\nexport const Item: React.FC<ItemProps> = ({\n caption,\n children,\n className,\n markerClassName,\n dataTestId,\n}) => {\n const {\n orderedList,\n markerType,\n colorMarker,\n reversed,\n index = 0,\n start = 0,\n } = useContext(ListContext);\n\n const markerLowerAlpha = markerType === 'lower-alpha';\n\n const itemClassNames = cn(styles.item, className, {\n [styles.unorderedItem]: markerLowerAlpha,\n [styles.reversed]: reversed,\n });\n\n const isDisc = markerType === '•';\n\n const count = start === 0 ? index + 1 : start + index;\n const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;\n\n return (\n <li className={cn(itemClassNames)} data-test-id={dataTestId}>\n {!markerLowerAlpha && (\n <TypographyText\n tag='div'\n color={colorMarker}\n monospaceNumbers={true}\n view='primary-medium'\n className={cn(styles.slot, markerClassName, {\n [styles.disc]: isDisc && !orderedList,\n [styles.defaultColor]: !colorMarker,\n })}\n >\n {marker}\n </TypographyText>\n )}\n <div>\n <TypographyText tag='div' view='primary-medium'>\n {children}\n </TypographyText>\n {caption && (\n <TypographyText\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.caption}\n >\n {caption}\n </TypographyText>\n )}\n </div>\n </li>\n );\n};\n\nItem.displayName = 'Item';\n"],"names":[],"mappings":";;;;;;AAoCO,MAAM,IAAI,GAAwB,CAAC,EACtC,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAe,EACf,UAAU,GACb,KAAI;IACD,MAAM,EACF,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,KAAK,GAAG,CAAC,EACT,KAAK,GAAG,CAAC,GACZ,GAAG,UAAU,CAAC,WAAW,CAAC;AAE3B,IAAA,MAAM,gBAAgB,GAAG,UAAU,KAAK,aAAa;IAErD,MAAM,cAAc,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE;AAC9C,QAAA,CAAC,MAAM,CAAC,aAAa,GAAG,gBAAgB;AACxC,QAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;AAC9B,KAAA,CA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-item-margin: var(--gap-12);
|
|
13
13
|
}
|
|
14
|
-
.
|
|
14
|
+
.list__item_6os8m {
|
|
15
15
|
margin-top: var(--list-item-margin);
|
|
16
16
|
display: flex;
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.list__item_6os8m:first-child {
|
|
19
19
|
margin-top: var(--gap-0);
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.list__item_6os8m.list__reversed_6os8m:first-child {
|
|
22
22
|
margin-top: var(--list-item-margin);
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.list__item_6os8m.list__reversed_6os8m:last-child {
|
|
25
25
|
margin-top: var(--gap-0);
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.list__item_6os8m.list__unorderedItem_6os8m {
|
|
28
28
|
display: list-item;
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
.list__slot_6os8m {
|
|
31
31
|
min-width: 20px;
|
|
32
32
|
display: flex;
|
|
33
33
|
box-sizing: border-box;
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
padding-right: var(--gap-4);
|
|
36
36
|
flex-shrink: 0;
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.list__slot_6os8m.list__defaultColor_6os8m {
|
|
39
39
|
color: var(--list-marker-color);
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.list__slot_6os8m.list__disc_6os8m {
|
|
42
42
|
justify-content: center;
|
|
43
43
|
padding: var(--gap-0) var(--gap-4);
|
|
44
44
|
}
|
|
45
|
-
.
|
|
45
|
+
.list__caption_6os8m {
|
|
46
46
|
margin-top: var(--gap-2);
|
|
47
47
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"item":"
|
|
3
|
+
const styles = {"item":"list__item_6os8m","reversed":"list__reversed_6os8m","unorderedItem":"list__unorderedItem_6os8m","slot":"list__slot_6os8m","defaultColor":"list__defaultColor_6os8m","disc":"list__disc_6os8m","caption":"list__caption_6os8m"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/item/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --list-marker-color: var(--color-light-text-primary);\n --list-item-margin: var(--gap-12);\n}\n\n.item {\n margin-top: var(--list-item-margin);\n display: flex;\n\n &:first-child {\n margin-top: var(--gap-0);\n }\n\n &.reversed:first-child {\n margin-top: var(--list-item-margin);\n }\n\n &.reversed:last-child {\n margin-top: var(--gap-0);\n }\n\n &.unorderedItem {\n display: list-item;\n }\n}\n\n.slot {\n min-width: 20px;\n display: flex;\n box-sizing: border-box;\n justify-content: flex-start;\n padding-right: var(--gap-4);\n flex-shrink: 0;\n\n &.defaultColor {\n color: var(--list-marker-color);\n }\n\n &.disc {\n justify-content: center;\n padding: var(--gap-0) var(--gap-4);\n }\n}\n\n.caption {\n margin-top: var(--gap-2);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,sBAAsB,CAAC,eAAe,CAAC,2BAA2B,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,0BAA0B,CAAC,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/item/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --list-marker-color: var(--color-light-text-primary);\n --list-item-margin: var(--gap-12);\n}\n\n.item {\n margin-top: var(--list-item-margin);\n display: flex;\n\n &:first-child {\n margin-top: var(--gap-0);\n }\n\n &.reversed:first-child {\n margin-top: var(--list-item-margin);\n }\n\n &.reversed:last-child {\n margin-top: var(--gap-0);\n }\n\n &.unorderedItem {\n display: list-item;\n }\n}\n\n.slot {\n min-width: 20px;\n display: flex;\n box-sizing: border-box;\n justify-content: flex-start;\n padding-right: var(--gap-4);\n flex-shrink: 0;\n\n &.defaultColor {\n color: var(--list-marker-color);\n }\n\n &.disc {\n justify-content: center;\n padding: var(--gap-0) var(--gap-4);\n }\n}\n\n.caption {\n margin-top: var(--gap-2);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,sBAAsB,CAAC,eAAe,CAAC,2BAA2B,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,CAAC,0BAA0B,CAAC,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,qBAAqB,CAAC;;"}
|
package/modern/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import { createContext, type ReactNode } from 'react';\n\nimport { type ColorMarkerType } from './types';\n\nexport type TListContext = {\n /**\n * Упорядоченный список\n */\n orderedList?: boolean;\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Номер пункта\n */\n index?: number;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n};\n\nexport const ListContext = createContext<TListContext>({});\n"],"names":[],"mappings":";;MAqCa,WAAW,GAAG,aAAa,CAAe,EAAE
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import { createContext, type ReactNode } from 'react';\n\nimport { type ColorMarkerType } from './types';\n\nexport type TListContext = {\n /**\n * Упорядоченный список\n */\n orderedList?: boolean;\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Номер пункта\n */\n index?: number;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n};\n\nexport const ListContext = createContext<TListContext>({});\n"],"names":[],"mappings":";;MAqCa,WAAW,GAAG,aAAa,CAAe,EAAE;;"}
|
package/modern/index.css
CHANGED
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
--gap-20: 20px;
|
|
7
7
|
}
|
|
8
8
|
:root {
|
|
9
|
-
--font-family-
|
|
10
|
-
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
9
|
+
--font-family-alfasans:
|
|
10
|
+
'Alfa Interface Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
11
|
+
Helvetica, sans-serif;
|
|
11
12
|
}
|
|
12
|
-
.
|
|
13
|
+
.list__list_cjc3w {
|
|
13
14
|
margin: var(--gap-0);
|
|
14
15
|
padding: var(--gap-0);
|
|
15
16
|
color: var(--color-light-text-primary);
|
|
@@ -20,19 +21,21 @@
|
|
|
20
21
|
|
|
21
22
|
font-weight: 400;
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
letter-spacing: -0.24px;
|
|
25
|
+
|
|
26
|
+
font-family: var(--font-family-alfasans);
|
|
24
27
|
}
|
|
25
|
-
.
|
|
28
|
+
.list__lowerAlpha_cjc3w {
|
|
26
29
|
list-style-type: lower-alpha;
|
|
27
30
|
padding-left: var(--gap-20);
|
|
28
31
|
}
|
|
29
|
-
.
|
|
32
|
+
.list__decimal_cjc3w {
|
|
30
33
|
list-style-type: decimal;
|
|
31
34
|
}
|
|
32
|
-
ol.
|
|
35
|
+
ol.list__list_cjc3w {
|
|
33
36
|
display: flex;
|
|
34
37
|
flex-direction: column;
|
|
35
38
|
}
|
|
36
|
-
ol.
|
|
39
|
+
ol.list__list_cjc3w.list__reversed_cjc3w {
|
|
37
40
|
flex-direction: column-reverse;
|
|
38
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"list":"
|
|
3
|
+
const styles = {"list":"list__list_cjc3w","lowerAlpha":"list__lowerAlpha_cjc3w","decimal":"list__decimal_cjc3w","reversed":"list__reversed_cjc3w"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.list {\n margin: var(--gap-0);\n padding: var(--gap-0);\n color: var(--color-light-text-primary);\n\n @mixin paragraph_primary_medium;\n}\n\n.lowerAlpha {\n list-style-type: lower-alpha;\n padding-left: var(--gap-20);\n}\n\n.decimal {\n list-style-type: decimal;\n}\n\nol.list {\n display: flex;\n flex-direction: column;\n\n &.reversed {\n flex-direction: column-reverse;\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,wBAAwB,CAAC,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.list {\n margin: var(--gap-0);\n padding: var(--gap-0);\n color: var(--color-light-text-primary);\n\n @mixin paragraph_primary_medium;\n}\n\n.lowerAlpha {\n list-style-type: lower-alpha;\n padding-left: var(--gap-20);\n}\n\n.decimal {\n list-style-type: decimal;\n}\n\nol.list {\n display: flex;\n flex-direction: column;\n\n &.reversed {\n flex-direction: column-reverse;\n }\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,wBAAwB,CAAC,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,sBAAsB,CAAC;;"}
|
package/modern/presets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sources":["../src/presets.ts"],"sourcesContent":["export const listPresets = {\n mobile: {\n tag: 'ul',\n marker: '–',\n },\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"presets.js","sources":["../src/presets.ts"],"sourcesContent":["export const listPresets = {\n mobile: {\n tag: 'ul',\n marker: '–',\n },\n};\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;AACvB,IAAA,MAAM,EAAE;AACJ,QAAA,GAAG,EAAE,IAAI;AACT,QAAA,MAAM,EAAE,GAAG;AACd,KAAA;;;"}
|
package/modern/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\nexport const isItemElement = (obj: JSX.Element, name?: string): boolean =>\n typeof obj === 'object' && obj.type.displayName === name;\n\nexport const isItem = (child: ReactNode) => isValidElement(child) && isItemElement(child, 'Item');\n"],"names":[],"mappings":";;MAEa,aAAa,GAAG,CAAC,GAAgB,EAAE,IAAa,KACzD,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK;MAE3C,MAAM,GAAG,CAAC,KAAgB,KAAK,cAAc,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\nexport const isItemElement = (obj: JSX.Element, name?: string): boolean =>\n typeof obj === 'object' && obj.type.displayName === name;\n\nexport const isItem = (child: ReactNode) => isValidElement(child) && isItemElement(child, 'Item');\n"],"names":[],"mappings":";;MAEa,aAAa,GAAG,CAAC,GAAgB,EAAE,IAAa,KACzD,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK;MAE3C,MAAM,GAAG,CAAC,KAAgB,KAAK,cAAc,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { Children, type ReactNode } from 'react';\nimport cn from 'classnames';\n\nimport { Item } from './components/item';\nimport { ListContext, type TListContext } from './context';\nimport { type ColorMarkerType } from './types';\nimport { isItem } from './utils';\n\nimport styles from './index.module.css';\n\nexport { ListContext, type TListContext };\n\nexport type ListProps = {\n /**\n * HTML тег\n * @default 'ul'\n */\n tag?: 'ul' | 'ol';\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n marker?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Css-класс для стилизации\n */\n className?: string;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы\n */\n children?: ReactNode;\n} & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;\n\nconst ListComponent: React.FC<ListProps> = ({\n tag = 'ul',\n marker,\n className,\n dataTestId,\n colorMarker,\n children,\n reversed,\n start,\n ...restProps\n}) => {\n const markerType = marker || (tag === 'ul' ? '–' : 'decimal');\n const alphaMarker = markerType === 'lower-alpha';\n const decimalMarker = markerType === 'decimal';\n const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';\n\n const orderedList = Component === 'ol';\n\n const listClassNames = cn(\n styles.list,\n {\n [styles.lowerAlpha]: alphaMarker,\n [styles.decimal]: decimalMarker,\n [styles.reversed]: reversed,\n },\n className,\n );\n\n /* eslint-disable react/jsx-no-constructed-context-values */\n return (\n <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>\n {Children.map(children, (child, index) => (\n <ListContext.Provider\n value={{ orderedList, markerType, colorMarker, reversed, index, start }}\n >\n {isItem(child) ? child : <Item>{child}</Item>}\n </ListContext.Provider>\n ))}\n </Component>\n );\n};\n\nexport const List = Object.assign(ListComponent, {\n Item,\n});\n"],"names":[],"mappings":";;;;;;;AAwDA,MAAM,aAAa,GAAwB,CAAC,EACxC,GAAG,GAAG,IAAI,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,GAAG,SAAS,EACf,KAAI;AACD,IAAA,MAAM,UAAU,GAAG,MAAM,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG,GAAG,SAAS,CAAC;AAC7D,IAAA,MAAM,WAAW,GAAG,UAAU,KAAK,aAAa;AAChD,IAAA,MAAM,aAAa,GAAG,UAAU,KAAK,SAAS;AAC9C,IAAA,MAAM,SAAS,GAAG,GAAG,KAAK,IAAI,IAAI,WAAW,GAAG,IAAI,GAAG,IAAI;AAE3D,IAAA,MAAM,WAAW,GAAG,SAAS,KAAK,IAAI;AAEtC,IAAA,MAAM,cAAc,GAAG,EAAE,CACrB,MAAM,CAAC,IAAI,EACX;AACI,QAAA,CAAC,MAAM,CAAC,UAAU,GAAG,WAAW;AAChC,QAAA,CAAC,MAAM,CAAC,OAAO,GAAG,aAAa;AAC/B,QAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;KAC9B,EACD,SAAS,CACZ;;AAGD,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { Children, type ReactNode } from 'react';\nimport cn from 'classnames';\n\nimport { Item } from './components/item';\nimport { ListContext, type TListContext } from './context';\nimport { type ColorMarkerType } from './types';\nimport { isItem } from './utils';\n\nimport styles from './index.module.css';\n\nexport { ListContext, type TListContext };\n\nexport type ListProps = {\n /**\n * HTML тег\n * @default 'ul'\n */\n tag?: 'ul' | 'ol';\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n marker?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Css-класс для стилизации\n */\n className?: string;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n\n /**\n * Id компонента для тестов\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы\n */\n children?: ReactNode;\n} & Omit<React.OlHTMLAttributes<HTMLOListElement>, 'type'>;\n\nconst ListComponent: React.FC<ListProps> = ({\n tag = 'ul',\n marker,\n className,\n dataTestId,\n colorMarker,\n children,\n reversed,\n start,\n ...restProps\n}) => {\n const markerType = marker || (tag === 'ul' ? '–' : 'decimal');\n const alphaMarker = markerType === 'lower-alpha';\n const decimalMarker = markerType === 'decimal';\n const Component = tag === 'ul' || alphaMarker ? 'ul' : 'ol';\n\n const orderedList = Component === 'ol';\n\n const listClassNames = cn(\n styles.list,\n {\n [styles.lowerAlpha]: alphaMarker,\n [styles.decimal]: decimalMarker,\n [styles.reversed]: reversed,\n },\n className,\n );\n\n /* eslint-disable react/jsx-no-constructed-context-values */\n return (\n <Component className={listClassNames} data-test-id={dataTestId} {...restProps}>\n {Children.map(children, (child, index) => (\n <ListContext.Provider\n value={{ orderedList, markerType, colorMarker, reversed, index, start }}\n >\n {isItem(child) ? child : <Item>{child}</Item>}\n </ListContext.Provider>\n ))}\n </Component>\n );\n};\n\nexport const List = Object.assign(ListComponent, {\n Item,\n});\n"],"names":[],"mappings":";;;;;;;AAwDA,MAAM,aAAa,GAAwB,CAAC,EACxC,GAAG,GAAG,IAAI,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,GAAG,SAAS,EACf,KAAI;AACD,IAAA,MAAM,UAAU,GAAG,MAAM,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG,GAAG,SAAS,CAAC;AAC7D,IAAA,MAAM,WAAW,GAAG,UAAU,KAAK,aAAa;AAChD,IAAA,MAAM,aAAa,GAAG,UAAU,KAAK,SAAS;AAC9C,IAAA,MAAM,SAAS,GAAG,GAAG,KAAK,IAAI,IAAI,WAAW,GAAG,IAAI,GAAG,IAAI;AAE3D,IAAA,MAAM,WAAW,GAAG,SAAS,KAAK,IAAI;AAEtC,IAAA,MAAM,cAAc,GAAG,EAAE,CACrB,MAAM,CAAC,IAAI,EACX;AACI,QAAA,CAAC,MAAM,CAAC,UAAU,GAAG,WAAW;AAChC,QAAA,CAAC,MAAM,CAAC,OAAO,GAAG,aAAa;AAC/B,QAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ;KAC9B,EACD,SAAS,CACZ;;AAGD,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAE,cAAc,EAAA,cAAA,EAAgB,UAAU,EAAA,GAAM,SAAS,EAAA,EACxE,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,MACjC,KAAA,CAAA,aAAA,CAAC,WAAW,CAAC,QAAQ,EAAA,EACjB,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAA,EAEtE,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,oBAAC,IAAI,EAAA,IAAA,EAAE,KAAK,CAAQ,CAC1B,CAC1B,CAAC,CACM;AAEpB,CAAC;MAEY,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE;IAC7C,IAAI;AACP,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../../src/components/item/Component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { ListContext } from '../../context';\n\nimport styles from './index.module.css';\n\nexport type ItemProps = {\n /**\n * Дополнительный текст\n */\n caption?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n markerClassName?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n dataTestId?: string;\n};\n\nexport const Item: React.FC<ItemProps> = ({\n caption,\n children,\n className,\n markerClassName,\n dataTestId,\n}) => {\n const {\n orderedList,\n markerType,\n colorMarker,\n reversed,\n index = 0,\n start = 0,\n } = useContext(ListContext);\n\n const markerLowerAlpha = markerType === 'lower-alpha';\n\n const itemClassNames = cn(styles.item, className, {\n [styles.unorderedItem]: markerLowerAlpha,\n [styles.reversed]: reversed,\n });\n\n const isDisc = markerType === '•';\n\n const count = start === 0 ? index + 1 : start + index;\n const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;\n\n return (\n <li className={cn(itemClassNames)} data-test-id={dataTestId}>\n {!markerLowerAlpha && (\n <TypographyText\n tag='div'\n color={colorMarker}\n monospaceNumbers={true}\n view='primary-medium'\n className={cn(styles.slot, markerClassName, {\n [styles.disc]: isDisc && !orderedList,\n [styles.defaultColor]: !colorMarker,\n })}\n >\n {marker}\n </TypographyText>\n )}\n <div>\n <TypographyText tag='div' view='primary-medium'>\n {children}\n </TypographyText>\n {caption && (\n <TypographyText\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.caption}\n >\n {caption}\n </TypographyText>\n )}\n </div>\n </li>\n );\n};\n\nItem.displayName = 'Item';\n"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/item/Component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { ListContext } from '../../context';\n\nimport styles from './index.module.css';\n\nexport type ItemProps = {\n /**\n * Дополнительный текст\n */\n caption?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n markerClassName?: string;\n\n /**\n * Дополнительный класс для маркера\n */\n dataTestId?: string;\n};\n\nexport const Item: React.FC<ItemProps> = ({\n caption,\n children,\n className,\n markerClassName,\n dataTestId,\n}) => {\n const {\n orderedList,\n markerType,\n colorMarker,\n reversed,\n index = 0,\n start = 0,\n } = useContext(ListContext);\n\n const markerLowerAlpha = markerType === 'lower-alpha';\n\n const itemClassNames = cn(styles.item, className, {\n [styles.unorderedItem]: markerLowerAlpha,\n [styles.reversed]: reversed,\n });\n\n const isDisc = markerType === '•';\n\n const count = start === 0 ? index + 1 : start + index;\n const marker = orderedList || markerType === 'decimal' ? `${count}.` : markerType;\n\n return (\n <li className={cn(itemClassNames)} data-test-id={dataTestId}>\n {!markerLowerAlpha && (\n <TypographyText\n tag='div'\n color={colorMarker}\n monospaceNumbers={true}\n view='primary-medium'\n className={cn(styles.slot, markerClassName, {\n [styles.disc]: isDisc && !orderedList,\n [styles.defaultColor]: !colorMarker,\n })}\n >\n {marker}\n </TypographyText>\n )}\n <div>\n <TypographyText tag='div' view='primary-medium'>\n {children}\n </TypographyText>\n {caption && (\n <TypographyText\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.caption}\n >\n {caption}\n </TypographyText>\n )}\n </div>\n </li>\n );\n};\n\nItem.displayName = 'Item';\n"],"names":[],"mappings":";;;;;;AAoCO,MAAM,IAAI,GAAwB,CAAC,EACtC,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAe,EACf,UAAU,GACb,KAAI;IACD,MAAM,EACF,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,KAAK,GAAG,CAAC,EACT,KAAK,GAAG,CAAC,GACZ,GAAG,UAAU,CAAC,WAAW,CAAC;AAE3B,IAAA,MAAM,gBAAgB,GAAG,UAAU,KAAK,aAAa;IAErD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AE,MAAM,CAAC,OAAO,EAAA,EAExB,OAAO,CACK,CACpB,CACC,CACL;AAEb;AAEA,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import { createContext, type ReactNode } from 'react';\n\nimport { type ColorMarkerType } from './types';\n\nexport type TListContext = {\n /**\n * Упорядоченный список\n */\n orderedList?: boolean;\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Номер пункта\n */\n index?: number;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n};\n\nexport const ListContext = createContext<TListContext>({});\n"],"names":[],"mappings":";;MAqCa,WAAW,GAAG,aAAa,CAAe,EAAE
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import { createContext, type ReactNode } from 'react';\n\nimport { type ColorMarkerType } from './types';\n\nexport type TListContext = {\n /**\n * Упорядоченный список\n */\n orderedList?: boolean;\n\n /**\n * Маркер\n * @default '–' for ul and 'decimal' for ol\n */\n markerType?: 'lower-alpha' | 'decimal' | string | ReactNode;\n\n /**\n * Цвет маркера\n */\n colorMarker?: ColorMarkerType;\n\n /**\n * Список обратного счета\n */\n reversed?: boolean;\n\n /**\n * Номер пункта\n */\n index?: number;\n\n /**\n * Начало отсчета элементов списка\n */\n start?: number;\n};\n\nexport const ListContext = createContext<TListContext>({});\n"],"names":[],"mappings":";;MAqCa,WAAW,GAAG,aAAa,CAAe,EAAE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sources":["../src/presets.ts"],"sourcesContent":["export const listPresets = {\n mobile: {\n tag: 'ul',\n marker: '–',\n },\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"presets.js","sources":["../src/presets.ts"],"sourcesContent":["export const listPresets = {\n mobile: {\n tag: 'ul',\n marker: '–',\n },\n};\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;AACvB,IAAA,MAAM,EAAE;AACJ,QAAA,GAAG,EAAE,IAAI;AACT,QAAA,MAAM,EAAE,GAAG;AACd,KAAA;;;"}
|
package/moderncssm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\nexport const isItemElement = (obj: JSX.Element, name?: string): boolean =>\n typeof obj === 'object' && obj.type.displayName === name;\n\nexport const isItem = (child: ReactNode) => isValidElement(child) && isItemElement(child, 'Item');\n"],"names":[],"mappings":";;MAEa,aAAa,GAAG,CAAC,GAAgB,EAAE,IAAa,KACzD,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK;MAE3C,MAAM,GAAG,CAAC,KAAgB,KAAK,cAAc,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\nexport const isItemElement = (obj: JSX.Element, name?: string): boolean =>\n typeof obj === 'object' && obj.type.displayName === name;\n\nexport const isItem = (child: ReactNode) => isValidElement(child) && isItemElement(child, 'Item');\n"],"names":[],"mappings":";;MAEa,aAAa,GAAG,CAAC,GAAgB,EAAE,IAAa,KACzD,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK;MAE3C,MAAM,GAAG,CAAC,KAAgB,KAAK,cAAc,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-list",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.16-alfasans",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"build": "rollup -c ../../tools/rollup/rollup.config.mjs --silent"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@alfalab/core-components-typography": "
|
|
16
|
+
"@alfalab/core-components-typography": "6.0.15-alfasans",
|
|
17
17
|
"classnames": "^2.5.1",
|
|
18
18
|
"tslib": "^2.4.0"
|
|
19
19
|
},
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"access": "public",
|
|
26
26
|
"directory": "dist"
|
|
27
27
|
},
|
|
28
|
-
"themesVersion": "15.2.
|
|
29
|
-
"varsVersion": "11.
|
|
28
|
+
"themesVersion": "15.2.2-alfasans",
|
|
29
|
+
"varsVersion": "11.6.1-alfasans"
|
|
30
30
|
}
|
package/presets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sources":["src/presets.ts"],"sourcesContent":["export const listPresets = {\n mobile: {\n tag: 'ul',\n marker: '–',\n },\n};\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"presets.js","sources":["src/presets.ts"],"sourcesContent":["export const listPresets = {\n mobile: {\n tag: 'ul',\n marker: '–',\n },\n};\n"],"names":[],"mappings":";;;;AAAO,IAAM,WAAW,GAAG;AACvB,IAAA,MAAM,EAAE;AACJ,QAAA,GAAG,EAAE,IAAI;AACT,QAAA,MAAM,EAAE,GAAG;AACd,KAAA;;;"}
|
package/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["src/utils.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\nexport const isItemElement = (obj: JSX.Element, name?: string): boolean =>\n typeof obj === 'object' && obj.type.displayName === name;\n\nexport const isItem = (child: ReactNode) => isValidElement(child) && isItemElement(child, 'Item');\n"],"names":["isValidElement"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["src/utils.ts"],"sourcesContent":["import { isValidElement, type ReactNode } from 'react';\n\nexport const isItemElement = (obj: JSX.Element, name?: string): boolean =>\n typeof obj === 'object' && obj.type.displayName === name;\n\nexport const isItem = (child: ReactNode) => isValidElement(child) && isItemElement(child, 'Item');\n"],"names":["isValidElement"],"mappings":";;;;;;AAEO,IAAM,aAAa,GAAG,UAAC,GAAgB,EAAE,IAAa,EAAA;IACzD,OAAA,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI;AAAxD;IAES,MAAM,GAAG,UAAC,KAAgB,EAAA,EAAK,OAAAA,oBAAc,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA,CAArD;;;"}
|