@alfalab/core-components-pure-cell 5.0.1 → 5.0.2
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.d.ts +10 -16
- package/component.js +6 -6
- package/component.js.map +1 -1
- package/components/addon/component.d.ts +1 -1
- package/components/addon/component.js +2 -2
- package/components/addon/component.js.map +1 -1
- package/components/addon/index.css +17 -15
- package/components/addon/index.module.css.js +1 -1
- package/components/amount/component.d.ts +1 -1
- package/components/amount/component.js +2 -2
- package/components/amount/component.js.map +1 -1
- package/components/amount/index.css +3 -3
- package/components/amount/index.module.css.js +1 -1
- package/components/amount/index.module.css.js.map +1 -1
- package/components/amount-title/component.d.ts +1 -1
- package/components/amount-title/component.js +2 -2
- package/components/amount-title/component.js.map +1 -1
- package/components/amount-title/index.css +14 -14
- package/components/amount-title/index.module.css.js +1 -1
- package/components/amount-title/index.module.css.js.map +1 -1
- package/components/category/component.d.ts +1 -1
- package/components/category/component.js +2 -2
- package/components/category/component.js.map +1 -1
- package/components/category/index.css +4 -4
- package/components/category/index.module.css.js +1 -1
- package/components/category/index.module.css.js.map +1 -1
- package/components/content/component.d.ts +1 -1
- package/components/content/component.js +2 -2
- package/components/content/component.js.map +1 -1
- package/components/content/index.css +3 -3
- package/components/content/index.module.css.js +1 -1
- package/components/content/index.module.css.js.map +1 -1
- package/components/footer/component.d.ts +1 -1
- package/components/footer/component.js +2 -2
- package/components/footer/component.js.map +1 -1
- package/components/footer/index.css +4 -4
- package/components/footer/index.module.css.js +1 -1
- package/components/footer/index.module.css.js.map +1 -1
- package/components/footer-button/component.d.ts +2 -2
- package/components/footer-button/component.js +2 -2
- package/components/footer-button/component.js.map +1 -1
- package/components/footer-button/index.css +1 -1
- package/components/footer-button/index.module.css.js +1 -1
- package/components/footer-button/index.module.css.js.map +1 -1
- package/components/footer-text/component.d.ts +1 -1
- package/components/footer-text/component.js +2 -2
- package/components/footer-text/component.js.map +1 -1
- package/components/graphics/component.d.ts +1 -1
- package/components/graphics/component.js +2 -2
- package/components/graphics/component.js.map +1 -1
- package/components/graphics/index.css +23 -21
- package/components/graphics/index.module.css.js +1 -1
- package/components/main/component.d.ts +1 -1
- package/components/main/component.js +2 -2
- package/components/main/component.js.map +1 -1
- package/components/main/index.css +11 -9
- package/components/main/index.module.css.js +1 -1
- package/components/text/component.d.ts +1 -1
- package/components/text/component.js +2 -2
- package/components/text/component.js.map +1 -1
- package/components/text/index.css +6 -6
- package/components/text/index.module.css.js +1 -1
- package/components/text/index.module.css.js.map +1 -1
- package/components/types.d.ts +8 -8
- package/components/typesProps.d.ts +2 -2
- package/context.d.ts +9 -0
- package/context.js +11 -0
- package/context.js.map +1 -0
- package/cssm/component.d.ts +10 -16
- package/cssm/component.js +6 -6
- package/cssm/component.js.map +1 -1
- package/cssm/components/addon/component.d.ts +1 -1
- package/cssm/components/addon/component.js +2 -2
- package/cssm/components/addon/component.js.map +1 -1
- package/cssm/components/addon/index.module.css +5 -3
- package/cssm/components/amount/component.d.ts +1 -1
- package/cssm/components/amount/component.js +2 -2
- package/cssm/components/amount/component.js.map +1 -1
- package/cssm/components/amount-title/component.d.ts +1 -1
- package/cssm/components/amount-title/component.js +2 -2
- package/cssm/components/amount-title/component.js.map +1 -1
- package/cssm/components/category/component.d.ts +1 -1
- package/cssm/components/category/component.js +2 -2
- package/cssm/components/category/component.js.map +1 -1
- package/cssm/components/content/component.d.ts +1 -1
- package/cssm/components/content/component.js +2 -2
- package/cssm/components/content/component.js.map +1 -1
- package/cssm/components/content/index.module.css +1 -1
- package/cssm/components/footer/component.d.ts +1 -1
- package/cssm/components/footer/component.js +2 -2
- package/cssm/components/footer/component.js.map +1 -1
- package/cssm/components/footer/index.module.css +1 -1
- package/cssm/components/footer-button/component.d.ts +2 -2
- package/cssm/components/footer-button/component.js +2 -2
- package/cssm/components/footer-button/component.js.map +1 -1
- package/cssm/components/footer-text/component.d.ts +1 -1
- package/cssm/components/footer-text/component.js +2 -2
- package/cssm/components/footer-text/component.js.map +1 -1
- package/cssm/components/graphics/component.d.ts +1 -1
- package/cssm/components/graphics/component.js +2 -2
- package/cssm/components/graphics/component.js.map +1 -1
- package/cssm/components/graphics/index.module.css +16 -14
- package/cssm/components/main/component.d.ts +1 -1
- package/cssm/components/main/component.js +2 -2
- package/cssm/components/main/component.js.map +1 -1
- package/cssm/components/main/index.module.css +5 -3
- package/cssm/components/text/component.d.ts +1 -1
- package/cssm/components/text/component.js +2 -2
- package/cssm/components/text/component.js.map +1 -1
- package/cssm/components/types.d.ts +8 -8
- package/cssm/components/typesProps.d.ts +2 -2
- package/cssm/context.d.ts +9 -0
- package/cssm/context.js +11 -0
- package/cssm/context.js.map +1 -0
- package/cssm/index.module.css +6 -4
- package/esm/component.d.ts +10 -16
- package/esm/component.js +2 -2
- package/esm/component.js.map +1 -1
- package/esm/components/addon/component.d.ts +1 -1
- package/esm/components/addon/component.js +1 -1
- package/esm/components/addon/component.js.map +1 -1
- package/esm/components/addon/index.css +17 -15
- package/esm/components/addon/index.module.css.js +1 -1
- package/esm/components/amount/component.d.ts +1 -1
- package/esm/components/amount/component.js +1 -1
- package/esm/components/amount/component.js.map +1 -1
- package/esm/components/amount/index.css +3 -3
- package/esm/components/amount/index.module.css.js +1 -1
- package/esm/components/amount/index.module.css.js.map +1 -1
- package/esm/components/amount-title/component.d.ts +1 -1
- package/esm/components/amount-title/component.js +1 -1
- package/esm/components/amount-title/component.js.map +1 -1
- package/esm/components/amount-title/index.css +14 -14
- package/esm/components/amount-title/index.module.css.js +1 -1
- package/esm/components/amount-title/index.module.css.js.map +1 -1
- package/esm/components/category/component.d.ts +1 -1
- package/esm/components/category/component.js +1 -1
- package/esm/components/category/component.js.map +1 -1
- package/esm/components/category/index.css +4 -4
- package/esm/components/category/index.module.css.js +1 -1
- package/esm/components/category/index.module.css.js.map +1 -1
- package/esm/components/content/component.d.ts +1 -1
- package/esm/components/content/component.js +1 -1
- package/esm/components/content/component.js.map +1 -1
- package/esm/components/content/index.css +3 -3
- package/esm/components/content/index.module.css.js +1 -1
- package/esm/components/content/index.module.css.js.map +1 -1
- package/esm/components/footer/component.d.ts +1 -1
- package/esm/components/footer/component.js +1 -1
- package/esm/components/footer/component.js.map +1 -1
- package/esm/components/footer/index.css +4 -4
- package/esm/components/footer/index.module.css.js +1 -1
- package/esm/components/footer/index.module.css.js.map +1 -1
- package/esm/components/footer-button/component.d.ts +2 -2
- package/esm/components/footer-button/component.js +1 -1
- package/esm/components/footer-button/component.js.map +1 -1
- package/esm/components/footer-button/index.css +1 -1
- package/esm/components/footer-button/index.module.css.js +1 -1
- package/esm/components/footer-button/index.module.css.js.map +1 -1
- package/esm/components/footer-text/component.d.ts +1 -1
- package/esm/components/footer-text/component.js +1 -1
- package/esm/components/footer-text/component.js.map +1 -1
- package/esm/components/graphics/component.d.ts +1 -1
- package/esm/components/graphics/component.js +1 -1
- package/esm/components/graphics/component.js.map +1 -1
- package/esm/components/graphics/index.css +23 -21
- package/esm/components/graphics/index.module.css.js +1 -1
- package/esm/components/main/component.d.ts +1 -1
- package/esm/components/main/component.js +1 -1
- package/esm/components/main/component.js.map +1 -1
- package/esm/components/main/index.css +11 -9
- package/esm/components/main/index.module.css.js +1 -1
- package/esm/components/text/component.d.ts +1 -1
- package/esm/components/text/component.js +1 -1
- package/esm/components/text/component.js.map +1 -1
- package/esm/components/text/index.css +6 -6
- package/esm/components/text/index.module.css.js +1 -1
- package/esm/components/text/index.module.css.js.map +1 -1
- package/esm/components/types.d.ts +8 -8
- package/esm/components/typesProps.d.ts +2 -2
- package/esm/context.d.ts +9 -0
- package/esm/context.js +7 -0
- package/esm/context.js.map +1 -0
- package/esm/index.css +34 -32
- package/esm/index.module.css.js +1 -1
- package/esm/index.module.css.js.map +1 -1
- package/index.css +34 -32
- package/index.module.css.js +1 -1
- package/index.module.css.js.map +1 -1
- package/modern/component.d.ts +10 -16
- package/modern/component.js +2 -3
- package/modern/component.js.map +1 -1
- package/modern/components/addon/component.d.ts +1 -1
- package/modern/components/addon/component.js +1 -1
- package/modern/components/addon/component.js.map +1 -1
- package/modern/components/addon/index.css +17 -15
- package/modern/components/addon/index.module.css.js +1 -1
- package/modern/components/amount/component.d.ts +1 -1
- package/modern/components/amount/component.js +1 -1
- package/modern/components/amount/component.js.map +1 -1
- package/modern/components/amount/index.css +3 -3
- package/modern/components/amount/index.module.css.js +1 -1
- package/modern/components/amount/index.module.css.js.map +1 -1
- package/modern/components/amount-title/component.d.ts +1 -1
- package/modern/components/amount-title/component.js +1 -1
- package/modern/components/amount-title/component.js.map +1 -1
- package/modern/components/amount-title/index.css +14 -14
- package/modern/components/amount-title/index.module.css.js +1 -1
- package/modern/components/amount-title/index.module.css.js.map +1 -1
- package/modern/components/category/component.d.ts +1 -1
- package/modern/components/category/component.js +1 -1
- package/modern/components/category/component.js.map +1 -1
- package/modern/components/category/index.css +4 -4
- package/modern/components/category/index.module.css.js +1 -1
- package/modern/components/category/index.module.css.js.map +1 -1
- package/modern/components/content/component.d.ts +1 -1
- package/modern/components/content/component.js +1 -1
- package/modern/components/content/component.js.map +1 -1
- package/modern/components/content/index.css +3 -3
- package/modern/components/content/index.module.css.js +1 -1
- package/modern/components/content/index.module.css.js.map +1 -1
- package/modern/components/footer/component.d.ts +1 -1
- package/modern/components/footer/component.js +1 -1
- package/modern/components/footer/component.js.map +1 -1
- package/modern/components/footer/index.css +4 -4
- package/modern/components/footer/index.module.css.js +1 -1
- package/modern/components/footer/index.module.css.js.map +1 -1
- package/modern/components/footer-button/component.d.ts +2 -2
- package/modern/components/footer-button/component.js +1 -1
- package/modern/components/footer-button/component.js.map +1 -1
- package/modern/components/footer-button/index.css +1 -1
- package/modern/components/footer-button/index.module.css.js +1 -1
- package/modern/components/footer-button/index.module.css.js.map +1 -1
- package/modern/components/footer-text/component.d.ts +1 -1
- package/modern/components/footer-text/component.js +1 -1
- package/modern/components/footer-text/component.js.map +1 -1
- package/modern/components/graphics/component.d.ts +1 -1
- package/modern/components/graphics/component.js +1 -1
- package/modern/components/graphics/component.js.map +1 -1
- package/modern/components/graphics/index.css +23 -21
- package/modern/components/graphics/index.module.css.js +1 -1
- package/modern/components/main/component.d.ts +1 -1
- package/modern/components/main/component.js +1 -1
- package/modern/components/main/component.js.map +1 -1
- package/modern/components/main/index.css +11 -9
- package/modern/components/main/index.module.css.js +1 -1
- package/modern/components/text/component.d.ts +1 -1
- package/modern/components/text/component.js +1 -1
- package/modern/components/text/component.js.map +1 -1
- package/modern/components/text/index.css +6 -6
- package/modern/components/text/index.module.css.js +1 -1
- package/modern/components/text/index.module.css.js.map +1 -1
- package/modern/components/types.d.ts +8 -8
- package/modern/components/typesProps.d.ts +2 -2
- package/modern/context.d.ts +9 -0
- package/modern/context.js +7 -0
- package/modern/context.js.map +1 -0
- package/modern/index.css +34 -32
- package/modern/index.module.css.js +1 -1
- package/modern/index.module.css.js.map +1 -1
- package/moderncssm/component.d.ts +10 -16
- package/moderncssm/component.js +2 -3
- package/moderncssm/component.js.map +1 -1
- package/moderncssm/components/addon/component.d.ts +1 -1
- package/moderncssm/components/addon/component.js +1 -1
- package/moderncssm/components/addon/component.js.map +1 -1
- package/moderncssm/components/addon/index.module.css +5 -3
- package/moderncssm/components/amount/component.d.ts +1 -1
- package/moderncssm/components/amount/component.js +1 -1
- package/moderncssm/components/amount/component.js.map +1 -1
- package/moderncssm/components/amount/index.module.css +2 -0
- package/moderncssm/components/amount-title/component.d.ts +1 -1
- package/moderncssm/components/amount-title/component.js +1 -1
- package/moderncssm/components/amount-title/component.js.map +1 -1
- package/moderncssm/components/amount-title/index.module.css +2 -0
- package/moderncssm/components/category/component.d.ts +1 -1
- package/moderncssm/components/category/component.js +1 -1
- package/moderncssm/components/category/component.js.map +1 -1
- package/moderncssm/components/category/index.module.css +2 -0
- package/moderncssm/components/content/component.d.ts +1 -1
- package/moderncssm/components/content/component.js +1 -1
- package/moderncssm/components/content/component.js.map +1 -1
- package/moderncssm/components/content/index.module.css +3 -2
- package/moderncssm/components/footer/component.d.ts +1 -1
- package/moderncssm/components/footer/component.js +1 -1
- package/moderncssm/components/footer/component.js.map +1 -1
- package/moderncssm/components/footer/index.module.css +3 -3
- package/moderncssm/components/footer-button/component.d.ts +2 -2
- package/moderncssm/components/footer-button/component.js +1 -1
- package/moderncssm/components/footer-button/component.js.map +1 -1
- package/moderncssm/components/footer-button/index.module.css +2 -0
- package/moderncssm/components/footer-text/component.d.ts +1 -1
- package/moderncssm/components/footer-text/component.js +1 -1
- package/moderncssm/components/footer-text/component.js.map +1 -1
- package/moderncssm/components/graphics/component.d.ts +1 -1
- package/moderncssm/components/graphics/component.js +1 -1
- package/moderncssm/components/graphics/component.js.map +1 -1
- package/moderncssm/components/graphics/index.module.css +16 -14
- package/moderncssm/components/main/component.d.ts +1 -1
- package/moderncssm/components/main/component.js +1 -1
- package/moderncssm/components/main/component.js.map +1 -1
- package/moderncssm/components/main/index.module.css +5 -3
- package/moderncssm/components/text/component.d.ts +1 -1
- package/moderncssm/components/text/component.js +1 -1
- package/moderncssm/components/text/component.js.map +1 -1
- package/moderncssm/components/text/index.module.css +2 -0
- package/moderncssm/components/types.d.ts +8 -8
- package/moderncssm/components/typesProps.d.ts +2 -2
- package/moderncssm/context.d.ts +9 -0
- package/moderncssm/context.js +7 -0
- package/moderncssm/context.js.map +1 -0
- package/moderncssm/index.module.css +6 -4
- package/package.json +4 -4
- package/src/component.tsx +11 -21
- package/src/components/addon/component.tsx +2 -2
- package/src/components/amount/component.tsx +2 -2
- package/src/components/amount/index.module.css +1 -1
- package/src/components/amount-title/component.tsx +2 -2
- package/src/components/amount-title/index.module.css +1 -1
- package/src/components/category/component.tsx +2 -2
- package/src/components/category/index.module.css +1 -1
- package/src/components/content/component.tsx +2 -2
- package/src/components/content/index.module.css +1 -1
- package/src/components/footer/component.tsx +2 -2
- package/src/components/footer/index.module.css +1 -1
- package/src/components/footer-button/component.tsx +8 -3
- package/src/components/footer-button/index.module.css +1 -1
- package/src/components/footer-text/component.tsx +2 -2
- package/src/components/graphics/component.tsx +2 -2
- package/src/components/main/component.tsx +2 -2
- package/src/components/text/component.tsx +2 -2
- package/src/components/text/index.module.css +1 -3
- package/src/components/types.ts +8 -8
- package/src/components/typesProps.ts +2 -2
- package/src/context.ts +12 -0
- package/src/index.module.css +2 -2
- package/src/vars.css +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
4
|
-
import { PureCellContext } from '../../
|
|
4
|
+
import { PureCellContext } from '../../context.js';
|
|
5
5
|
import styles from './index.module.css';
|
|
6
6
|
|
|
7
7
|
const Content = ({ children, dataTestId }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/content/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { PureCellContext } from '../../
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/content/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { PureCellContext } from '../../context';\nimport { type ContentElement } from '../types';\n\nimport styles from './index.module.css';\n\ntype Props = {\n /**\n * Компоненты\n */\n children: ContentElement;\n\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Используется модификатор -content\n */\n dataTestId?: string;\n};\n\nexport const Content: React.FC<Props> = ({ children, dataTestId }) => {\n const { direction, dataTestId: contextDataTestId } = useContext(PureCellContext);\n\n return (\n <section\n className={cn(styles.component, { [styles.horizontal]: direction === 'horizontal' })}\n data-test-id={getDataTestId(dataTestId || contextDataTestId, 'content')}\n >\n {children}\n </section>\n );\n};\n"],"names":[],"mappings":";;;;;;AAuBa,MAAA,OAAO,GAAoB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAI;AACjE,IAAA,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC;AAEhF,IAAA,QACI,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,GAAG,SAAS,KAAK,YAAY,EAAE,CAAC,EACtE,cAAA,EAAA,aAAa,CAAC,UAAU,IAAI,iBAAiB,EAAE,SAAS,CAAC,EAAA,EAEtE,QAAQ,CACH;AAElB;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
4
|
-
import { PureCellContext } from '../../
|
|
4
|
+
import { PureCellContext } from '../../context.js';
|
|
5
5
|
import styles from './index.module.css';
|
|
6
6
|
|
|
7
7
|
const Footer = ({ children, footerPadding = 'default', dataTestId }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/footer/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { PureCellContext } from '../../
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/footer/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { PureCellContext } from '../../context';\nimport { type FooterElement } from '../types';\n\nimport styles from './index.module.css';\n\ntype Props = {\n /**\n * Компоненты\n */\n children: FooterElement;\n\n /**\n * Вертикальные отступы\n */\n footerPadding?: 'default' | 'none';\n\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Используется модификатор -footer\n */\n dataTestId?: string;\n};\n\nexport const Footer: React.FC<Props> = ({ children, footerPadding = 'default', dataTestId }) => {\n const pureCellContext = useContext(PureCellContext);\n\n return (\n <footer\n className={cn(styles.component, styles[footerPadding])}\n data-test-id={getDataTestId(dataTestId || pureCellContext.dataTestId, 'footer')}\n >\n {children}\n </footer>\n );\n};\n"],"names":[],"mappings":";;;;;;AA4BO,MAAM,MAAM,GAAoB,CAAC,EAAE,QAAQ,EAAE,aAAa,GAAG,SAAS,EAAE,UAAU,EAAE,KAAI;AAC3F,IAAA,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;AAEnD,IAAA,QACI,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,EACxC,cAAA,EAAA,aAAa,CAAC,UAAU,IAAI,eAAe,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAA,EAE9E,QAAQ,CACJ;AAEjB;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
2
|
-
import { ButtonProps } from '@alfalab/core-components-button/moderncssm';
|
|
1
|
+
import React, { type AnchorHTMLAttributes, type ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { type ButtonProps } from '@alfalab/core-components-button/moderncssm';
|
|
3
3
|
declare type ComponentProps = Omit<ButtonProps, 'dataTestId'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Идентификатор для систем автоматизированного тестирования.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef, useContext } from 'react';
|
|
2
2
|
import { Button } from '@alfalab/core-components-button/moderncssm';
|
|
3
3
|
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
4
|
-
import { PureCellContext } from '../../
|
|
4
|
+
import { PureCellContext } from '../../context.js';
|
|
5
5
|
import styles from './index.module.css';
|
|
6
6
|
|
|
7
7
|
const FooterButton = forwardRef(({ children, dataTestId, onClick, onMouseDown, onMouseEnter, onMouseLeave, ...props }, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/footer-button/component.tsx"],"sourcesContent":["import React, { AnchorHTMLAttributes
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/footer-button/component.tsx"],"sourcesContent":["import React, {\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n forwardRef,\n useContext,\n} from 'react';\n\nimport { Button, type ButtonProps } from '@alfalab/core-components-button';\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { PureCellContext } from '../../context';\n\nimport styles from './index.module.css';\n\ntype ComponentProps = Omit<ButtonProps, 'dataTestId'> & {\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Используется модификатор -button\n */\n dataTestId?: string;\n};\n\ntype FooterButtonProps = ComponentProps &\n Partial<AnchorHTMLAttributes<HTMLAnchorElement> | ButtonHTMLAttributes<HTMLButtonElement>>;\n\ntype FooterButtonMouseEvent = React.MouseEvent<HTMLAnchorElement, MouseEvent> &\n React.MouseEvent<HTMLButtonElement, MouseEvent>;\n\ntype FooterButtonMouseEventHandler =\n | React.MouseEventHandler<HTMLAnchorElement>\n | React.MouseEventHandler<HTMLButtonElement>;\n\nexport const FooterButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, FooterButtonProps>(\n ({ children, dataTestId, onClick, onMouseDown, onMouseEnter, onMouseLeave, ...props }, ref) => {\n const pureCellContext = useContext(PureCellContext);\n\n const handleClick = (e: FooterButtonMouseEvent) => {\n e.stopPropagation();\n (onClick as FooterButtonMouseEventHandler)?.(e);\n };\n\n const handleMouseEnter = (e: FooterButtonMouseEvent) => {\n (onMouseEnter as FooterButtonMouseEventHandler)?.(e);\n pureCellContext.unsetMainHover?.();\n };\n\n const handleMouseLeave = (e: FooterButtonMouseEvent) => {\n (onMouseLeave as FooterButtonMouseEventHandler)?.(e);\n pureCellContext.setMainHover?.();\n };\n\n const handleMouseDown = (e: FooterButtonMouseEvent) => {\n (onMouseDown as FooterButtonMouseEventHandler)?.(e);\n e.stopPropagation();\n };\n\n return (\n <Button\n {...props}\n size='xxs'\n dataTestId={getDataTestId(dataTestId || pureCellContext.dataTestId, 'button')}\n className={styles.component}\n ref={ref}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onMouseDown={handleMouseDown}\n >\n {children}\n </Button>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;AAgCa,MAAA,YAAY,GAAG,UAAU,CAClC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AAC1F,IAAA,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;AAEnD,IAAA,MAAM,WAAW,GAAG,CAAC,CAAyB,KAAI;QAC9C,CAAC,CAAC,eAAe,EAAE;AAClB,QAAA,OAAyC,GAAG,CAAC,CAAC;AACnD,KAAC;AAED,IAAA,MAAM,gBAAgB,GAAG,CAAC,CAAyB,KAAI;AAClD,QAAA,YAA8C,GAAG,CAAC,CAAC;AACpD,QAAA,eAAe,CAAC,cAAc,IAAI;AACtC,KAAC;AAED,IAAA,MAAM,gBAAgB,GAAG,CAAC,CAAyB,KAAI;AAClD,QAAA,YAA8C,GAAG,CAAC,CAAC;AACpD,QAAA,eAAe,CAAC,YAAY,IAAI;AACpC,KAAC;AAED,IAAA,MAAM,eAAe,GAAG,CAAC,CAAyB,KAAI;AACjD,QAAA,WAA6C,GAAG,CAAC,CAAC;QACnD,CAAC,CAAC,eAAe,EAAE;AACvB,KAAC;IAED,QACI,KAAC,CAAA,aAAA,CAAA,MAAM,EACC,EAAA,GAAA,KAAK,EACT,IAAI,EAAC,KAAK,EACV,UAAU,EAAE,aAAa,CAAC,UAAU,IAAI,eAAe,CAAC,UAAU,EAAE,QAAQ,CAAC,EAC7E,SAAS,EAAE,MAAM,CAAC,SAAS,EAC3B,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,WAAW,EAAE,eAAe,EAE3B,EAAA,QAAQ,CACJ;AAEjB,CAAC;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
3
3
|
import { Text } from '@alfalab/core-components-typography/moderncssm';
|
|
4
|
-
import { PureCellContext } from '../../
|
|
4
|
+
import { PureCellContext } from '../../context.js';
|
|
5
5
|
|
|
6
6
|
const FooterText = ({ children, color = 'secondary', dataTestId, }) => {
|
|
7
7
|
const pureCellContext = useContext(PureCellContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/footer-text/component.tsx"],"sourcesContent":["import React, { ReactNode, useContext } from 'react';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { type Color, Text } from '@alfalab/core-components-typography';\n\nimport { PureCellContext } from '../../
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/footer-text/component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { type Color, Text } from '@alfalab/core-components-typography';\n\nimport { PureCellContext } from '../../context';\n\nexport type FooterTextProps = {\n /**\n * Цвет текста\n */\n color?: Color;\n\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Используется модификатор -footer-title\n */\n dataTestId?: string;\n\n /**\n * Дочерние элементы.\n */\n children?: ReactNode;\n};\n\nexport const FooterText: React.FC<FooterTextProps> = ({\n children,\n color = 'secondary',\n dataTestId,\n}) => {\n const pureCellContext = useContext(PureCellContext);\n\n return (\n <Text\n view='primary-small'\n color={color}\n data-test-id={getDataTestId(dataTestId || pureCellContext.dataTestId, 'footer-title')}\n >\n {children}\n </Text>\n );\n};\n"],"names":[],"mappings":";;;;;AAyBO,MAAM,UAAU,GAA8B,CAAC,EAClD,QAAQ,EACR,KAAK,GAAG,WAAW,EACnB,UAAU,GACb,KAAI;AACD,IAAA,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;IAEnD,QACI,KAAC,CAAA,aAAA,CAAA,IAAI,EACD,EAAA,IAAI,EAAC,eAAe,EACpB,KAAK,EAAE,KAAK,EACE,cAAA,EAAA,aAAa,CAAC,UAAU,IAAI,eAAe,CAAC,UAAU,EAAE,cAAc,CAAC,EAEpF,EAAA,QAAQ,CACN;AAEf;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
4
|
-
import { PureCellContext } from '../../
|
|
4
|
+
import { PureCellContext } from '../../context.js';
|
|
5
5
|
import styles from './index.module.css';
|
|
6
6
|
|
|
7
7
|
const GRAPHICS_COMPONENT = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/graphics/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { PureCellContext } from '../../
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/graphics/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { PureCellContext } from '../../context';\nimport { type GraphicsElement } from '../types';\n\nimport styles from './index.module.css';\n\nexport type Props = {\n /**\n * Компоненты\n */\n children: GraphicsElement;\n\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Используется модификатор -graphics\n */\n dataTestId?: string;\n\n /**\n * Вертикальное выравнивание\n */\n verticalAlign?: 'top' | 'center' | 'bottom';\n\n /**\n * Отступ от графики\n */\n graphicPadding?: 'max' | 'airy' | 'default' | 'compact' | 'tiny' | 'none';\n\n /**\n * Клик по контенту графики.\n */\n onClick?: () => void;\n};\n\nconst GRAPHICS_COMPONENT: Record<string, keyof Pick<React.ReactHTML, 'button' | 'section'>> = {\n button: 'button',\n section: 'section',\n};\n\nexport const Graphics: React.FC<Props> = ({\n children,\n dataTestId,\n verticalAlign = 'top',\n graphicPadding,\n onClick,\n}) => {\n const pureCellContext = useContext(PureCellContext);\n\n const Component = onClick ? GRAPHICS_COMPONENT.button : GRAPHICS_COMPONENT.section;\n\n const defaultGraphicPadding = pureCellContext.direction === 'horizontal' ? 'airy' : 'default';\n\n const onMouseEvents = {\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n onClick?.();\n },\n onMouseEnter: () => {\n pureCellContext.unsetMainHover?.();\n },\n onMouseLeave: () => {\n pureCellContext.setMainHover?.();\n },\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n },\n };\n\n return (\n <Component\n className={cn(\n styles.component,\n styles[verticalAlign],\n styles[pureCellContext.direction || 'horizontal'],\n styles[graphicPadding || defaultGraphicPadding],\n { [styles.button]: onClick },\n )}\n data-test-id={getDataTestId(dataTestId || pureCellContext.dataTestId, 'graphics')}\n {...(onClick && onMouseEvents)}\n >\n {children}\n </Component>\n );\n};\n"],"names":[],"mappings":";;;;;;AAsCA,MAAM,kBAAkB,GAAsE;AAC1F,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,OAAO,EAAE,SAAS;CACrB;AAEY,MAAA,QAAQ,GAAoB,CAAC,EACtC,QAAQ,EACR,UAAU,EACV,aAAa,GAAG,KAAK,EACrB,cAAc,EACd,OAAO,GACV,KAAI;AACD,IAAA,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;AAEnD,IAAA,MAAM,SAAS,GAAG,OAAO,GAAG,kBAAkB,CAAC,MAAM,GAAG,kBAAkB,CAAC,OAAO;AAElF,IAAA,MAAM,qBAAqB,GAAG,eAAe,CAAC,SAAS,KAAK,YAAY,GAAG,MAAM,GAAG,SAAS;AAE7F,IAAA,MAAM,aAAa,GAAG;AAClB,QAAA,OAAO,EAAE,CAAC,CAAsC,KAAI;YAChD,CAAC,CAAC,eAAe,EAAE;YACnB,OAAO,IAAI;SACd;QACD,YAAY,EAAE,MAAK;AACf,YAAA,eAAe,CAAC,cAAc,IAAI;SACrC;QACD,YAAY,EAAE,MAAK;AACf,YAAA,eAAe,CAAC,YAAY,IAAI;SACnC;AACD,QAAA,WAAW,EAAE,CAAC,CAAsC,KAAI;YACpD,CAAC,CAAC,eAAe,EAAE;SACtB;KACJ;AAED,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACN,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,aAAa,CAAC,EACrB,MAAM,CAAC,eAAe,CAAC,SAAS,IAAI,YAAY,CAAC,EACjD,MAAM,CAAC,cAAc,IAAI,qBAAqB,CAAC,EAC/C,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,EAAE,CAC/B,EAAA,cAAA,EACa,aAAa,CAAC,UAAU,IAAI,eAAe,CAAC,UAAU,EAAE,UAAU,CAAC,EAAA,IAC5E,OAAO,IAAI,aAAa,CAAC,EAAA,EAE7B,QAAQ,CACD;AAEpB;;;;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
:root {
|
|
2
4
|
--pure-cell-clickable-area-hover-opacity: 1;
|
|
3
5
|
--pure-cell-clickable-area-active-opacity: 1;
|
|
@@ -20,51 +22,51 @@
|
|
|
20
22
|
align-self: flex-end;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
.horizontal:not(:last-child)
|
|
25
|
+
.horizontal.none:not(:last-child) {
|
|
24
26
|
margin-right: var(--gap-0);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
.horizontal:not(:last-child)
|
|
29
|
+
.horizontal.max:not(:last-child) {
|
|
28
30
|
margin-right: var(--gap-24);
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
.horizontal:not(:last-child)
|
|
33
|
+
.horizontal.airy:not(:last-child) {
|
|
32
34
|
margin-right: var(--gap-16);
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
.horizontal:not(:last-child)
|
|
37
|
+
.horizontal.default:not(:last-child) {
|
|
36
38
|
margin-right: var(--gap-12);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
.horizontal:not(:last-child)
|
|
41
|
+
.horizontal.compact:not(:last-child) {
|
|
40
42
|
margin-right: var(--gap-8);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
.horizontal:not(:last-child)
|
|
45
|
+
.horizontal.tiny:not(:last-child) {
|
|
44
46
|
margin-right: var(--gap-4);
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
.vertical:not(:last-child)
|
|
49
|
+
.vertical.none:not(:last-child) {
|
|
48
50
|
margin-bottom: var(--gap-0);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
.vertical:not(:last-child)
|
|
53
|
+
.vertical.max:not(:last-child) {
|
|
52
54
|
margin-bottom: var(--gap-24);
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
.vertical:not(:last-child)
|
|
57
|
+
.vertical.airy:not(:last-child) {
|
|
56
58
|
margin-bottom: var(--gap-16);
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
.vertical:not(:last-child)
|
|
61
|
+
.vertical.default:not(:last-child) {
|
|
60
62
|
margin-bottom: var(--gap-12);
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
.vertical:not(:last-child)
|
|
65
|
+
.vertical.compact:not(:last-child) {
|
|
64
66
|
margin-bottom: var(--gap-8);
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
.vertical:not(:last-child)
|
|
69
|
+
.vertical.tiny:not(:last-child) {
|
|
68
70
|
margin-bottom: var(--gap-4);
|
|
69
71
|
}
|
|
70
72
|
|
|
@@ -76,7 +78,7 @@
|
|
|
76
78
|
border: 0;
|
|
77
79
|
margin: var(--gap-0);
|
|
78
80
|
box-shadow: none;
|
|
79
|
-
border-radius: 0;
|
|
81
|
+
border-radius: var(--border-radius-0);
|
|
80
82
|
-webkit-user-select: none;
|
|
81
83
|
-moz-user-select: none;
|
|
82
84
|
user-select: none;
|
|
@@ -89,7 +91,7 @@
|
|
|
89
91
|
cursor: pointer;
|
|
90
92
|
padding: var(--gap-0);
|
|
91
93
|
transition: opacity 0.15s ease-in-out;
|
|
92
|
-
min-width: auto
|
|
94
|
+
min-width: auto;
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
.button:hover {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
4
|
-
import { PureCellContext } from '../../
|
|
4
|
+
import { PureCellContext } from '../../context.js';
|
|
5
5
|
import styles from './index.module.css';
|
|
6
6
|
|
|
7
7
|
const MAIN_COMPONENT = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/main/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { PureCellContext } from '../../
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/main/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { PureCellContext } from '../../context';\nimport { type MainElement } from '../types';\n\nimport styles from './index.module.css';\n\ntype Props = {\n /**\n * Компоненты\n */\n children: MainElement;\n\n /**\n * Позволяет изменить расположение блоков внутри main\n */\n isReverse?: boolean;\n\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Используется модификатор -main\n */\n dataTestId?: string;\n\n /**\n * Клик по контенту.\n */\n onClick?: () => void;\n};\n\nconst MAIN_COMPONENT: Record<string, keyof Pick<React.ReactHTML, 'button' | 'section'>> = {\n button: 'button',\n section: 'section',\n};\n\nexport const Main: React.FC<Props> = ({ children, isReverse, className, dataTestId, onClick }) => {\n const {\n direction = 'horizontal',\n dataTestId: contextDataTestId,\n setMainHover,\n unsetMainHover,\n } = useContext(PureCellContext);\n\n const Component = onClick ? MAIN_COMPONENT.button : MAIN_COMPONENT.section;\n\n const onMouseEvents = {\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n onClick?.();\n },\n onMouseEnter: () => {\n unsetMainHover?.();\n },\n onMouseLeave: () => {\n setMainHover?.();\n },\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n },\n };\n\n return (\n <Component\n className={cn(\n styles.component,\n styles[direction],\n {\n [styles.reverse]: isReverse,\n },\n { [styles.button]: onClick },\n className,\n )}\n data-test-id={getDataTestId(dataTestId || contextDataTestId, 'main')}\n {...(onClick && onMouseEvents)}\n >\n {children}\n </Component>\n );\n};\n"],"names":[],"mappings":";;;;;;AAsCA,MAAM,cAAc,GAAsE;AACtF,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,OAAO,EAAE,SAAS;CACrB;AAEY,MAAA,IAAI,GAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,KAAI;AAC7F,IAAA,MAAM,EACF,SAAS,GAAG,YAAY,EACxB,UAAU,EAAE,iBAAiB,EAC7B,YAAY,EACZ,cAAc,GACjB,GAAG,UAAU,CAAC,eAAe,CAAC;AAE/B,IAAA,MAAM,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,OAAO;AAE1E,IAAA,MAAM,aAAa,GAAG;AAClB,QAAA,OAAO,EAAE,CAAC,CAAsC,KAAI;YAChD,CAAC,CAAC,eAAe,EAAE;YACnB,OAAO,IAAI;SACd;QACD,YAAY,EAAE,MAAK;YACf,cAAc,IAAI;SACrB;QACD,YAAY,EAAE,MAAK;YACf,YAAY,IAAI;SACnB;AACD,QAAA,WAAW,EAAE,CAAC,CAAsC,KAAI;YACpD,CAAC,CAAC,eAAe,EAAE;SACtB;KACJ;AAED,IAAA,QACI,KAAC,CAAA,aAAA,CAAA,SAAS,EACN,EAAA,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,SAAS,CAAC,EACjB;AACI,YAAA,CAAC,MAAM,CAAC,OAAO,GAAG,SAAS;AAC9B,SAAA,EACD,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,EAAE,EAC5B,SAAS,CACZ,kBACa,aAAa,CAAC,UAAU,IAAI,iBAAiB,EAAE,MAAM,CAAC,MAC/D,OAAO,IAAI,aAAa,CAAC,EAAA,EAE7B,QAAQ,CACD;AAEpB;;;;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
:root {
|
|
2
4
|
--pure-cell-clickable-area-hover-opacity: 1;
|
|
3
5
|
--pure-cell-clickable-area-active-opacity: 1;
|
|
@@ -7,7 +9,7 @@
|
|
|
7
9
|
display: flex;
|
|
8
10
|
flex-direction: column;
|
|
9
11
|
align-self: center;
|
|
10
|
-
white-space: pre-line
|
|
12
|
+
white-space: pre-line;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
.component.vertical {
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
border: 0;
|
|
30
32
|
margin: var(--gap-0);
|
|
31
33
|
box-shadow: none;
|
|
32
|
-
border-radius: 0;
|
|
34
|
+
border-radius: var(--border-radius-0);
|
|
33
35
|
-webkit-user-select: none;
|
|
34
36
|
-moz-user-select: none;
|
|
35
37
|
user-select: none;
|
|
@@ -42,7 +44,7 @@
|
|
|
42
44
|
cursor: pointer;
|
|
43
45
|
padding: var(--gap-0);
|
|
44
46
|
transition: opacity 0.15s ease-in-out;
|
|
45
|
-
min-width: auto
|
|
47
|
+
min-width: auto;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
.component.button:hover {
|
|
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
|
|
4
4
|
import { Text as Text$1 } from '@alfalab/core-components-typography/moderncssm';
|
|
5
|
-
import { PureCellContext } from '../../
|
|
5
|
+
import { PureCellContext } from '../../context.js';
|
|
6
6
|
import styles from './index.module.css';
|
|
7
7
|
|
|
8
8
|
const Text = ({ children, value, rowLimit, view = 'component-primary', titleWeight, titleColor, valueColor, dataTestId, }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/text/component.tsx"],"sourcesContent":["import React, { ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { type Color, Text as TypographyText } from '@alfalab/core-components-typography';\n\nimport { PureCellContext } from '../../
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/text/component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { type Color, Text as TypographyText } from '@alfalab/core-components-typography';\n\nimport { PureCellContext } from '../../context';\n\nimport styles from './index.module.css';\n\ntype Props = {\n /**\n * Контент\n */\n children?: ReactNode;\n\n /**\n * Количество строк\n */\n rowLimit?: 1 | 2;\n\n /**\n * Размер текста\n */\n view?:\n | 'primary-large'\n | 'primary-medium'\n | 'primary-small'\n | 'component'\n | 'component-primary'\n | 'secondary-large';\n\n /**\n * Толщина title\n */\n titleWeight?: 'regular' | 'bold';\n\n /**\n * Цвет title\n */\n titleColor: Color;\n\n /**\n * Value ячейки\n */\n value?: ReactNode;\n\n /**\n * Цвет value\n */\n valueColor?: Color;\n\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Для контента используется модификатор -text_content, для value ячейки -text_value\n */\n dataTestId?: string;\n};\n\nexport const Text: React.FC<Props> = ({\n children,\n value,\n rowLimit,\n view = 'component-primary',\n titleWeight,\n titleColor,\n valueColor,\n dataTestId,\n}) => {\n const { direction = 'horizontal', dataTestId: contextDataTestId } = useContext(PureCellContext);\n const className = rowLimit && styles[`rowLimit${rowLimit}`];\n\n return (\n <div\n className={cn(styles.component, {\n [styles.vertical]: direction !== 'horizontal',\n })}\n >\n <div className={styles.title}>\n <TypographyText\n view={view}\n weight={titleWeight}\n tag='div'\n color={titleColor}\n className={className}\n data-test-id={getDataTestId(dataTestId || contextDataTestId, 'text_content')}\n >\n {children}\n </TypographyText>\n </div>\n\n {value && (\n <div className={styles.value}>\n <TypographyText\n view={view}\n tag='div'\n color={valueColor}\n className={className}\n data-test-id={getDataTestId(dataTestId || contextDataTestId, 'text_value')}\n >\n {value}\n </TypographyText>\n </div>\n )}\n </div>\n );\n};\n"],"names":["TypographyText"],"mappings":";;;;;;;AA2Da,MAAA,IAAI,GAAoB,CAAC,EAClC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,IAAI,GAAG,mBAAmB,EAC1B,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,GACb,KAAI;AACD,IAAA,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC;IAC/F,MAAM,SAAS,GAAG,QAAQ,IAAI,MAAM,CAAC,CAAW,QAAA,EAAA,QAAQ,CAAE,CAAA,CAAC;IAE3D,QACI,6BACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE;AAC5B,YAAA,CAAC,MAAM,CAAC,QAAQ,GAAG,SAAS,KAAK,YAAY;SAChD,CAAC,EAAA;AAEF,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,KAAK,EAAA;AACxB,YAAA,KAAA,CAAA,aAAA,CAACA,MAAc,EAAA,EACX,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,WAAW,EACnB,GAAG,EAAC,KAAK,EACT,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EAAA,cAAA,EACN,aAAa,CAAC,UAAU,IAAI,iBAAiB,EAAE,cAAc,CAAC,EAE3E,EAAA,QAAQ,CACI,CACf;AAEL,QAAA,KAAK,KACF,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,KAAK,EAAA;AACxB,YAAA,KAAA,CAAA,aAAA,CAACA,MAAc,EAAA,EACX,IAAI,EAAE,IAAI,EACV,GAAG,EAAC,KAAK,EACT,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EAAA,cAAA,EACN,aAAa,CAAC,UAAU,IAAI,iBAAiB,EAAE,YAAY,CAAC,EAAA,EAEzE,KAAK,CACO,CACf,CACT,CACC;AAEd;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { Comment } from '@alfalab/core-components-comment/moderncssm';
|
|
3
|
-
import { Amount } from './amount';
|
|
4
|
-
import { AmountTitle } from './amount-title';
|
|
5
|
-
import { FooterButton } from './footer-button';
|
|
6
|
-
import { FooterText } from './footer-text';
|
|
7
|
-
import { Graphics } from './graphics';
|
|
8
|
-
import { Text } from './text';
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type Comment } from '@alfalab/core-components-comment/moderncssm';
|
|
3
|
+
import { type Amount } from './amount';
|
|
4
|
+
import { type AmountTitle } from './amount-title';
|
|
5
|
+
import { type FooterButton } from './footer-button';
|
|
6
|
+
import { type FooterText } from './footer-text';
|
|
7
|
+
import { type Graphics } from './graphics';
|
|
8
|
+
import { type Text } from './text';
|
|
9
9
|
declare type TextElement = ReactElement<typeof Text>;
|
|
10
10
|
export declare type GraphicsElement = ReactElement<typeof Graphics> | boolean | null;
|
|
11
11
|
declare type AmountElement = ReactElement<typeof Amount>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type PureCellContextValue = {
|
|
3
|
+
/** Направление */
|
|
4
|
+
direction?: 'horizontal' | 'vertical';
|
|
5
|
+
dataTestId?: string;
|
|
6
|
+
setMainHover?: () => void;
|
|
7
|
+
unsetMainHover?: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const PureCellContext: import("react").Context<PureCellContextValue>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import { createContext } from 'react';\n\nexport type PureCellContextValue = {\n /** Направление */\n direction?: 'horizontal' | 'vertical';\n dataTestId?: string;\n setMainHover?: () => void;\n unsetMainHover?: () => void;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport const PureCellContext = createContext<PureCellContextValue>({});\n"],"names":[],"mappings":";;AAUA;MACa,eAAe,GAAG,aAAa,CAAuB,EAAE;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
.component {
|
|
2
|
-
text-align:
|
|
4
|
+
text-align: inherit;
|
|
3
5
|
box-sizing: border-box;
|
|
4
6
|
}
|
|
5
7
|
|
|
@@ -18,10 +20,10 @@
|
|
|
18
20
|
font-family: inherit;
|
|
19
21
|
background: none;
|
|
20
22
|
border: 0;
|
|
21
|
-
border-radius: 0;
|
|
23
|
+
border-radius: var(--border-radius-0);
|
|
22
24
|
cursor: pointer;
|
|
23
25
|
transition: opacity 0.15s ease-in-out;
|
|
24
|
-
padding: var(--gap-0)
|
|
26
|
+
padding: var(--gap-0);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
.button.hover {
|
|
@@ -36,7 +38,7 @@
|
|
|
36
38
|
text-decoration: none;
|
|
37
39
|
color: inherit;
|
|
38
40
|
cursor: pointer;
|
|
39
|
-
transition: opacity 0.15s ease-in-out
|
|
41
|
+
transition: opacity 0.15s ease-in-out;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
.link.hover {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-pure-cell",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@alfalab/core-components-amount": "^4.0.0",
|
|
14
14
|
"@alfalab/core-components-button": "^12.0.1",
|
|
15
|
-
"@alfalab/core-components-comment": "^3.0.
|
|
15
|
+
"@alfalab/core-components-comment": "^3.0.2",
|
|
16
16
|
"@alfalab/core-components-shared": "^1.1.0",
|
|
17
|
-
"@alfalab/core-components-typography": "^5.0.
|
|
17
|
+
"@alfalab/core-components-typography": "^5.0.2",
|
|
18
18
|
"@alfalab/data": "^1.9.2",
|
|
19
19
|
"@alfalab/hooks": "^1.13.1",
|
|
20
20
|
"classnames": "^2.5.1",
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"access": "public",
|
|
30
30
|
"directory": "dist"
|
|
31
31
|
},
|
|
32
|
-
"themesVersion": "14.1.
|
|
32
|
+
"themesVersion": "14.1.2",
|
|
33
33
|
"varsVersion": "10.1.0"
|
|
34
34
|
}
|
package/src/component.tsx
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
/* eslint-disable react/jsx-no-constructed-context-values */
|
|
2
1
|
import React, {
|
|
3
|
-
AnchorHTMLAttributes,
|
|
4
|
-
ButtonHTMLAttributes,
|
|
5
|
-
ElementType,
|
|
2
|
+
type AnchorHTMLAttributes,
|
|
3
|
+
type ButtonHTMLAttributes,
|
|
4
|
+
type ElementType,
|
|
6
5
|
forwardRef,
|
|
7
|
-
HTMLAttributes,
|
|
6
|
+
type HTMLAttributes,
|
|
8
7
|
useRef,
|
|
9
8
|
useState,
|
|
10
9
|
} from 'react';
|
|
11
10
|
import mergeRefs from 'react-merge-refs';
|
|
12
11
|
import cn from 'classnames';
|
|
13
12
|
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
-
import { ButtonProps } from '@alfalab/core-components-button';
|
|
16
13
|
import { Comment } from '@alfalab/core-components-comment';
|
|
17
14
|
import { useFocus } from '@alfalab/hooks';
|
|
18
15
|
|
|
@@ -23,24 +20,16 @@ import { Category } from './components/category';
|
|
|
23
20
|
import { Content } from './components/content';
|
|
24
21
|
import { Footer } from './components/footer';
|
|
25
22
|
import { FooterButton } from './components/footer-button';
|
|
26
|
-
import { FooterText
|
|
23
|
+
import { FooterText } from './components/footer-text';
|
|
27
24
|
import { Graphics } from './components/graphics';
|
|
28
25
|
import { Main } from './components/main';
|
|
29
26
|
import { Text } from './components/text';
|
|
30
|
-
import { PureCellElement } from './components/types';
|
|
27
|
+
import { type PureCellElement } from './components/types';
|
|
28
|
+
import { PureCellContext, type PureCellContextValue } from './context';
|
|
31
29
|
|
|
32
30
|
import styles from './index.module.css';
|
|
33
31
|
|
|
34
|
-
export
|
|
35
|
-
/** Направление */
|
|
36
|
-
direction?: 'horizontal' | 'vertical';
|
|
37
|
-
dataTestId?: string;
|
|
38
|
-
setMainHover?: () => void;
|
|
39
|
-
unsetMainHover?: () => void;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
43
|
-
export const PureCellContext = React.createContext<PureCellContext>({});
|
|
32
|
+
export { PureCellContext };
|
|
44
33
|
|
|
45
34
|
type BasePureCellProps = {
|
|
46
35
|
/**
|
|
@@ -152,7 +141,8 @@ const PureCellComponent = forwardRef<HTMLElement, PureCellProps>(
|
|
|
152
141
|
[styles.active]: activeState,
|
|
153
142
|
};
|
|
154
143
|
|
|
155
|
-
|
|
144
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
145
|
+
const contextState: PureCellContextValue = {
|
|
156
146
|
direction,
|
|
157
147
|
dataTestId,
|
|
158
148
|
setMainHover: setHover,
|
|
@@ -223,7 +213,7 @@ const PureCellComponent = forwardRef<HTMLElement, PureCellProps>(
|
|
|
223
213
|
},
|
|
224
214
|
);
|
|
225
215
|
|
|
226
|
-
const ExtraSubtitle = FooterText
|
|
216
|
+
const ExtraSubtitle = FooterText;
|
|
227
217
|
|
|
228
218
|
/**
|
|
229
219
|
* Универсальный конструктор для сборки любой ячейки.
|
|
@@ -3,8 +3,8 @@ import cn from 'classnames';
|
|
|
3
3
|
|
|
4
4
|
import { getDataTestId } from '@alfalab/core-components-shared';
|
|
5
5
|
|
|
6
|
-
import { PureCellContext } from '../../
|
|
7
|
-
import { AddonElement } from '../types';
|
|
6
|
+
import { PureCellContext } from '../../context';
|
|
7
|
+
import { type AddonElement } from '../types';
|
|
8
8
|
|
|
9
9
|
import styles from './index.module.css';
|
|
10
10
|
|
|
@@ -5,8 +5,8 @@ import { Amount as CoreAmount } from '@alfalab/core-components-amount';
|
|
|
5
5
|
import { getDataTestId } from '@alfalab/core-components-shared';
|
|
6
6
|
import { type Color, Text } from '@alfalab/core-components-typography';
|
|
7
7
|
|
|
8
|
-
import { PureCellContext } from '../../
|
|
9
|
-
import { AmountProps as AmountType } from '../typesProps';
|
|
8
|
+
import { PureCellContext } from '../../context';
|
|
9
|
+
import { type AmountProps as AmountType } from '../typesProps';
|
|
10
10
|
|
|
11
11
|
import styles from './index.module.css';
|
|
12
12
|
|