@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
|
@@ -4,29 +4,29 @@
|
|
|
4
4
|
--gap-0: 0px;
|
|
5
5
|
--gap-2: var(--gap-3xs);
|
|
6
6
|
--gap-16: var(--gap-m);
|
|
7
|
-
} .pure-
|
|
7
|
+
} .pure-cell__horizontal_1do7h {
|
|
8
8
|
padding: var(--gap-2) var(--gap-0);
|
|
9
|
-
} .pure-
|
|
9
|
+
} .pure-cell__rowLimit1_1do7h {
|
|
10
10
|
-webkit-line-clamp: 1;
|
|
11
11
|
display: -webkit-box;
|
|
12
12
|
-webkit-box-orient: vertical;
|
|
13
13
|
overflow: hidden;
|
|
14
14
|
word-break: break-all;
|
|
15
|
-
} .pure-
|
|
15
|
+
} .pure-cell__rowLimit2_1do7h {
|
|
16
16
|
-webkit-line-clamp: 2;
|
|
17
17
|
display: -webkit-box;
|
|
18
18
|
-webkit-box-orient: vertical;
|
|
19
19
|
overflow: hidden;
|
|
20
|
-
} .pure-
|
|
20
|
+
} .pure-cell__component_1do7h {
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: row;
|
|
23
23
|
flex-wrap: nowrap;
|
|
24
24
|
justify-content: space-between;
|
|
25
25
|
margin: var(--gap-2) var(--gap-0);
|
|
26
26
|
word-break: break-word;
|
|
27
|
-
} .pure-
|
|
27
|
+
} .pure-cell__component_1do7h .pure-cell__vertical_1do7h {
|
|
28
28
|
justify-content: center;
|
|
29
|
-
} .pure-
|
|
29
|
+
} .pure-cell__title_1do7h + .pure-cell__value_1do7h {
|
|
30
30
|
margin-left: var(--gap-16);
|
|
31
31
|
flex-shrink: 0;
|
|
32
32
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"horizontal":"pure-
|
|
5
|
+
var styles = {"horizontal":"pure-cell__horizontal_1do7h","rowLimit1":"pure-cell__rowLimit1_1do7h","rowLimit2":"pure-cell__rowLimit2_1do7h","component":"pure-cell__component_1do7h","vertical":"pure-cell__vertical_1do7h","title":"pure-cell__title_1do7h","value":"pure-cell__value_1do7h"};
|
|
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/text/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.horizontal {\n padding: var(--gap-2) var(--gap-0);\n}\n\n.rowLimit1 {\n @mixin row_limit 1;\n word-break: break-all;\n}\n\n.rowLimit2 {\n @mixin row_limit 2;\n}\n\n.component {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n margin: var(--gap-2) var(--gap-0);\n word-break: break-word;\n
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/text/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-typography-index.css';\n\n.horizontal {\n padding: var(--gap-2) var(--gap-0);\n}\n\n.rowLimit1 {\n @mixin row_limit 1;\n word-break: break-all;\n}\n\n.rowLimit2 {\n @mixin row_limit 2;\n}\n\n.component {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n margin: var(--gap-2) var(--gap-0);\n word-break: break-word;\n\n & .vertical {\n justify-content: center;\n }\n}\n\n.title + .value {\n margin-left: var(--gap-16);\n flex-shrink: 0;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,YAAY,CAAC,6BAA6B,CAAC,WAAW,CAAC,4BAA4B,CAAC,WAAW,CAAC,4BAA4B,CAAC,WAAW,CAAC,4BAA4B,CAAC,UAAU,CAAC,2BAA2B,CAAC,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,wBAAwB,CAAC;;;;"}
|
package/components/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { Comment } from '@alfalab/core-components-comment';
|
|
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';
|
|
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>;
|
package/context.d.ts
ADDED
|
@@ -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>;
|
package/context.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
8
|
+
var PureCellContext = React.createContext({});
|
|
9
|
+
|
|
10
|
+
exports.PureCellContext = PureCellContext;
|
|
11
|
+
//# sourceMappingURL=context.js.map
|
package/context.js.map
ADDED
|
@@ -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":["createContext"],"mappings":";;;;;;AAUA;IACa,eAAe,GAAGA,mBAAa,CAAuB,EAAE;;;;"}
|
package/cssm/component.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React, { AnchorHTMLAttributes, ButtonHTMLAttributes, ElementType, HTMLAttributes } from 'react';
|
|
2
|
-
import { ButtonProps } from '@alfalab/core-components-button/cssm';
|
|
1
|
+
import React, { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type ElementType, type HTMLAttributes } from 'react';
|
|
3
2
|
import { Comment } from '@alfalab/core-components-comment/cssm';
|
|
4
3
|
import { Addon } from './components/addon';
|
|
5
4
|
import { Amount } from './components/amount';
|
|
@@ -8,19 +7,12 @@ import { Category } from './components/category';
|
|
|
8
7
|
import { Content } from './components/content';
|
|
9
8
|
import { Footer } from './components/footer';
|
|
10
9
|
import { FooterButton } from './components/footer-button';
|
|
11
|
-
import { FooterTextProps } from './components/footer-text';
|
|
12
10
|
import { Graphics } from './components/graphics';
|
|
13
11
|
import { Main } from './components/main';
|
|
14
12
|
import { Text } from './components/text';
|
|
15
|
-
import { PureCellElement } from './components/types';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
direction?: 'horizontal' | 'vertical';
|
|
19
|
-
dataTestId?: string;
|
|
20
|
-
setMainHover?: () => void;
|
|
21
|
-
unsetMainHover?: () => void;
|
|
22
|
-
};
|
|
23
|
-
export declare const PureCellContext: React.Context<PureCellContext>;
|
|
13
|
+
import { type PureCellElement } from './components/types';
|
|
14
|
+
import { PureCellContext } from './context';
|
|
15
|
+
export { PureCellContext };
|
|
24
16
|
declare type BasePureCellProps = {
|
|
25
17
|
/**
|
|
26
18
|
* Направление
|
|
@@ -69,7 +61,7 @@ declare type ButtonPureCellProps = BasePureCellProps & ButtonHTMLAttributes<HTML
|
|
|
69
61
|
declare type ElementPureCellProps = BasePureCellProps & HTMLAttributes<HTMLElement>;
|
|
70
62
|
export declare type PureCellProps = Partial<AnchorPureCellProps | ButtonPureCellProps | ElementPureCellProps>;
|
|
71
63
|
declare const PureCellComponent: React.ForwardRefExoticComponent<PureCellProps & React.RefAttributes<HTMLElement>>;
|
|
72
|
-
declare const ExtraSubtitle: React.FC<FooterTextProps>;
|
|
64
|
+
declare const ExtraSubtitle: React.FC<import("./components/footer-text").FooterTextProps>;
|
|
73
65
|
/**
|
|
74
66
|
* Универсальный конструктор для сборки любой ячейки.
|
|
75
67
|
*
|
|
@@ -96,7 +88,9 @@ declare const PureCell: React.ForwardRefExoticComponent<PureCellProps & React.Re
|
|
|
96
88
|
titleColor: "tertiary" | "disabled" | "accent" | "primary" | "attention" | "positive" | "secondary" | "tertiary-inverted" | "primary-inverted" | "secondary-inverted" | "link" | "negative" | "static-primary-light" | "static-secondary-light" | "static-tertiary-light" | "static-primary-dark" | "static-secondary-dark" | "static-tertiary-dark" | "static-accent" | "static-positive";
|
|
97
89
|
value?: React.ReactNode;
|
|
98
90
|
valueColor?: "tertiary" | "disabled" | "accent" | "primary" | "attention" | "positive" | "secondary" | "tertiary-inverted" | "primary-inverted" | "secondary-inverted" | "link" | "negative" | "static-primary-light" | "static-secondary-light" | "static-tertiary-light" | "static-primary-dark" | "static-secondary-dark" | "static-tertiary-dark" | "static-accent" | "static-positive" | undefined;
|
|
99
|
-
dataTestId?: string | undefined;
|
|
91
|
+
dataTestId?: string | undefined; /**
|
|
92
|
+
* Направление
|
|
93
|
+
*/
|
|
100
94
|
}>;
|
|
101
95
|
Amount: React.FC<{
|
|
102
96
|
weight?: "bold" | "normal" | undefined;
|
|
@@ -123,8 +117,8 @@ declare const PureCell: React.ForwardRefExoticComponent<PureCellProps & React.Re
|
|
|
123
117
|
footerPadding?: "default" | "none" | undefined;
|
|
124
118
|
dataTestId?: string | undefined;
|
|
125
119
|
}>;
|
|
126
|
-
ExtraSubtitle: React.FC<FooterTextProps>;
|
|
127
|
-
FooterButton: React.ForwardRefExoticComponent<(Omit<ButtonProps, "dataTestId"> & {
|
|
120
|
+
ExtraSubtitle: React.FC<import("./components/footer-text").FooterTextProps>;
|
|
121
|
+
FooterButton: React.ForwardRefExoticComponent<(Omit<import("@alfalab/core-components-button").ButtonProps, "dataTestId"> & {
|
|
128
122
|
dataTestId?: string | undefined;
|
|
129
123
|
} & Partial<React.AnchorHTMLAttributes<HTMLAnchorElement> | React.ButtonHTMLAttributes<HTMLButtonElement>>) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
130
124
|
Comment: React.FC<import("@alfalab/core-components-comment").CommentProps>;
|
package/cssm/component.js
CHANGED
|
@@ -19,6 +19,7 @@ var component$a = require('./components/footer-text/component.js');
|
|
|
19
19
|
var component$1 = require('./components/graphics/component.js');
|
|
20
20
|
var component = require('./components/main/component.js');
|
|
21
21
|
var component$3 = require('./components/text/component.js');
|
|
22
|
+
var context = require('./context.js');
|
|
22
23
|
var styles = require('./index.module.css');
|
|
23
24
|
|
|
24
25
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -28,8 +29,6 @@ var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
|
28
29
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
29
30
|
var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
30
31
|
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
32
|
-
var PureCellContext = React__default.default.createContext({});
|
|
33
32
|
var PureCellComponent = React.forwardRef(function (_a, ref) {
|
|
34
33
|
var _b, _c;
|
|
35
34
|
var className = _a.className, dataTestId = _a.dataTestId, onClick = _a.onClick, href = _a.href, _d = _a.tag, Component = _d === void 0 ? (href && 'a') || (onClick && 'button') || 'section' : _d, children = _a.children, _e = _a.horizontalPadding, horizontalPadding = _e === void 0 ? 'none' : _e, _f = _a.verticalPadding, verticalPadding = _f === void 0 ? 'none' : _f, _g = _a.direction, direction = _g === void 0 ? 'horizontal' : _g, restProps = tslib.__rest(_a, ["className", "dataTestId", "onClick", "href", "tag", "children", "horizontalPadding", "verticalPadding", "direction"]);
|
|
@@ -59,6 +58,7 @@ var PureCellComponent = React.forwardRef(function (_a, ref) {
|
|
|
59
58
|
_b[styles__default.default.hover] = hoverState,
|
|
60
59
|
_b[styles__default.default.active] = activeState,
|
|
61
60
|
_b);
|
|
61
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
62
62
|
var contextState = {
|
|
63
63
|
direction: direction,
|
|
64
64
|
dataTestId: dataTestId,
|
|
@@ -77,14 +77,14 @@ var PureCellComponent = React.forwardRef(function (_a, ref) {
|
|
|
77
77
|
// Для совместимости с react-router-dom, меняем href на to
|
|
78
78
|
var hrefProps = (_c = {}, _c[typeof Component === 'string' ? 'href' : 'to'] = href, _c);
|
|
79
79
|
return (React__default.default.createElement(Component, tslib.__assign({ rel: target === '_blank' ? 'noreferrer noopener' : undefined }, restProps, hrefProps, { ref: mergeRefs__default.default([cellRef, ref]), className: cn__default.default(styles__default.default.link, addClasses, className), "data-test-id": dataTestId, onClick: onClick }, mouseEvents),
|
|
80
|
-
React__default.default.createElement(PureCellContext.Provider, { value: contextState }, children)));
|
|
80
|
+
React__default.default.createElement(context.PureCellContext.Provider, { value: contextState }, children)));
|
|
81
81
|
}
|
|
82
82
|
if (onClick) {
|
|
83
83
|
return (React__default.default.createElement(Component, tslib.__assign({}, restProps, { ref: mergeRefs__default.default([cellRef, ref]), className: cn__default.default(styles__default.default.button, addClasses, className), "data-test-id": dataTestId, onClick: onClick }, mouseEvents),
|
|
84
|
-
React__default.default.createElement(PureCellContext.Provider, { value: contextState }, children)));
|
|
84
|
+
React__default.default.createElement(context.PureCellContext.Provider, { value: contextState }, children)));
|
|
85
85
|
}
|
|
86
86
|
return (React__default.default.createElement(Component, tslib.__assign({}, restProps, { ref: ref, tabIndex: 0, className: cn__default.default(addClasses, className), "data-test-id": dataTestId }),
|
|
87
|
-
React__default.default.createElement(PureCellContext.Provider, { value: contextState }, children)));
|
|
87
|
+
React__default.default.createElement(context.PureCellContext.Provider, { value: contextState }, children)));
|
|
88
88
|
});
|
|
89
89
|
var ExtraSubtitle = component$a.FooterText;
|
|
90
90
|
/**
|
|
@@ -122,8 +122,8 @@ exports.FooterButton = component$8.FooterButton;
|
|
|
122
122
|
exports.Graphics = component$1.Graphics;
|
|
123
123
|
exports.Main = component.Main;
|
|
124
124
|
exports.Text = component$3.Text;
|
|
125
|
+
exports.PureCellContext = context.PureCellContext;
|
|
125
126
|
exports.ExtraSubtitle = ExtraSubtitle;
|
|
126
127
|
exports.PureCell = PureCell;
|
|
127
128
|
exports.PureCellComponent = PureCellComponent;
|
|
128
|
-
exports.PureCellContext = PureCellContext;
|
|
129
129
|
//# sourceMappingURL=component.js.map
|
package/cssm/component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../src/component.tsx"],"sourcesContent":["/* eslint-disable react/jsx-no-constructed-context-values */\nimport React, {\n AnchorHTMLAttributes,\n ButtonHTMLAttributes,\n ElementType,\n forwardRef,\n HTMLAttributes,\n useRef,\n useState,\n} from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { ButtonProps } from '@alfalab/core-components-button';\nimport { Comment } from '@alfalab/core-components-comment';\nimport { useFocus } from '@alfalab/hooks';\n\nimport { Addon } from './components/addon';\nimport { Amount } from './components/amount';\nimport { AmountTitle } from './components/amount-title';\nimport { Category } from './components/category';\nimport { Content } from './components/content';\nimport { Footer } from './components/footer';\nimport { FooterButton } from './components/footer-button';\nimport { FooterText, FooterTextProps } from './components/footer-text';\nimport { Graphics } from './components/graphics';\nimport { Main } from './components/main';\nimport { Text } from './components/text';\nimport { PureCellElement } from './components/types';\n\nimport styles from './index.module.css';\n\nexport type PureCellContext = {\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 = React.createContext<PureCellContext>({});\n\ntype BasePureCellProps = {\n /**\n * Направление\n */\n direction?: 'horizontal' | 'vertical';\n\n /**\n * Сss класс для стилизации общей обёртки\n */\n className?: string;\n\n /**\n * Выводит ссылку в виде ячейки\n */\n href?: string;\n\n /**\n * Вертикальные отступы\n */\n verticalPadding?:\n | 'airy'\n | 'default'\n | 'compact'\n | 'tiny'\n | 'none'\n | {\n /**\n * Вертикальный отступ сверху\n */\n top?: 'airy' | 'default' | 'compact' | 'tiny' | 'none';\n /**\n * Вертикальный отступ снизу\n */\n bottom?: 'airy' | 'default' | 'compact' | 'tiny' | 'none';\n };\n\n /**\n * Горизонтальные отступы\n */\n horizontalPadding?: 'left' | 'right' | 'both' | 'none';\n\n /**\n * Позволяет использовать кастомный компонент для кнопки (например Link из роутера)\n */\n tag?: ElementType;\n\n /**\n * Компоненты\n */\n children: PureCellElement;\n\n /**\n * Идентификатор для систем автоматизированного тестирования\n */\n dataTestId?: string;\n};\ntype AnchorPureCellProps = BasePureCellProps & AnchorHTMLAttributes<HTMLAnchorElement>;\ntype ButtonPureCellProps = BasePureCellProps & ButtonHTMLAttributes<HTMLButtonElement>;\ntype ElementPureCellProps = BasePureCellProps & HTMLAttributes<HTMLElement>;\nexport type PureCellProps = Partial<\n AnchorPureCellProps | ButtonPureCellProps | ElementPureCellProps\n>;\n\nconst PureCellComponent = forwardRef<HTMLElement, PureCellProps>(\n (\n {\n className,\n dataTestId,\n onClick,\n href,\n tag: Component = (href && 'a') || (onClick && 'button') || 'section',\n children,\n horizontalPadding = 'none',\n verticalPadding = 'none',\n direction = 'horizontal',\n ...restProps\n },\n ref,\n ) => {\n const cellRef = useRef<HTMLDivElement>(null);\n const [focused] = useFocus(cellRef, 'keyboard');\n const [hoverState, setHoverState] = useState<boolean>(false);\n const [activeState, setActiveState] = useState<boolean>(false);\n\n const setHover = () => setHoverState(true);\n const unsetHover = () => setHoverState(false);\n const setActive = () => setActiveState(true);\n\n const unsetActive = () => setActiveState(false);\n\n const mouseEvents = {\n onMouseEnter: setHover,\n onMouseLeave: () => {\n unsetHover();\n // Убираем на случай, если уводим курсор за пределы компонента при сработавшем onMouseDown\n unsetActive();\n },\n onMouseDown: setActive,\n onMouseUp: unsetActive,\n };\n\n const addClasses = {\n [styles.component]: true,\n [styles.focused]: focused,\n [styles[direction]]: true,\n [styles[horizontalPadding]]: true,\n [styles.hover]: hoverState,\n [styles.active]: activeState,\n };\n\n const contextState: PureCellContext = {\n direction,\n dataTestId,\n setMainHover: setHover,\n unsetMainHover: unsetHover,\n };\n\n if (typeof verticalPadding === 'string') {\n addClasses[styles[verticalPadding as string]] = typeof verticalPadding === 'string';\n }\n\n if (typeof verticalPadding === 'object') {\n addClasses[styles[`${verticalPadding.top}Top`]] = !!verticalPadding.top;\n addClasses[styles[`${verticalPadding.bottom}Bottom`]] = !!verticalPadding.bottom;\n }\n\n if (href) {\n const { target } = restProps as AnchorHTMLAttributes<HTMLAnchorElement>;\n\n // Для совместимости с react-router-dom, меняем href на to\n const hrefProps = { [typeof Component === 'string' ? 'href' : 'to']: href };\n\n return (\n <Component\n rel={target === '_blank' ? 'noreferrer noopener' : undefined}\n {...(restProps as AnchorHTMLAttributes<HTMLAnchorElement>)}\n {...hrefProps}\n ref={mergeRefs([cellRef, ref])}\n className={cn(styles.link, addClasses, className)}\n data-test-id={dataTestId}\n onClick={onClick}\n {...mouseEvents}\n >\n <PureCellContext.Provider value={contextState}>\n {children}\n </PureCellContext.Provider>\n </Component>\n );\n }\n\n if (onClick) {\n return (\n <Component\n {...(restProps as AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={mergeRefs([cellRef, ref])}\n className={cn(styles.button, addClasses, className)}\n data-test-id={dataTestId}\n onClick={onClick}\n {...mouseEvents}\n >\n <PureCellContext.Provider value={contextState}>\n {children}\n </PureCellContext.Provider>\n </Component>\n );\n }\n\n return (\n <Component\n {...(restProps as AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={ref}\n tabIndex={0}\n className={cn(addClasses, className)}\n data-test-id={dataTestId}\n >\n <PureCellContext.Provider value={contextState}>{children}</PureCellContext.Provider>\n </Component>\n );\n },\n);\n\nconst ExtraSubtitle = FooterText as React.FC<FooterTextProps>;\n\n/**\n * Универсальный конструктор для сборки любой ячейки.\n *\n * [Макет](https://www.figma.com/file/KlFOLLkKO8rtvvQE3RXuhq/Click-Library?node-id=43525%3A240018)\n */\nconst PureCell = Object.assign(PureCellComponent, {\n Main,\n Graphics,\n Content,\n Text,\n Amount,\n AmountTitle,\n Addon,\n Footer,\n ExtraSubtitle,\n FooterButton,\n Comment,\n Category,\n});\n\nPureCellComponent.displayName = 'PureCellComponent';\n\nexport {\n PureCell,\n PureCellComponent,\n Main,\n Graphics,\n Content,\n Text,\n Amount,\n AmountTitle,\n Addon,\n Footer,\n ExtraSubtitle,\n FooterButton,\n Comment,\n Category,\n};\n"],"names":["React","forwardRef","__rest","useRef","useFocus","useState","styles","__assign","mergeRefs","cn","FooterText","Main","Graphics","Content","Text","Amount","AmountTitle","Addon","Footer","FooterButton","Comment","Category"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA;AACa,IAAA,eAAe,GAAGA,sBAAK,CAAC,aAAa,CAAkB,EAAE;AAiEtE,IAAM,iBAAiB,GAAGC,gBAAU,CAChC,UAC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;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../src/component.tsx"],"sourcesContent":["import React, {\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type ElementType,\n forwardRef,\n type HTMLAttributes,\n useRef,\n useState,\n} from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport cn from 'classnames';\n\nimport { Comment } from '@alfalab/core-components-comment';\nimport { useFocus } from '@alfalab/hooks';\n\nimport { Addon } from './components/addon';\nimport { Amount } from './components/amount';\nimport { AmountTitle } from './components/amount-title';\nimport { Category } from './components/category';\nimport { Content } from './components/content';\nimport { Footer } from './components/footer';\nimport { FooterButton } from './components/footer-button';\nimport { FooterText } from './components/footer-text';\nimport { Graphics } from './components/graphics';\nimport { Main } from './components/main';\nimport { Text } from './components/text';\nimport { type PureCellElement } from './components/types';\nimport { PureCellContext, type PureCellContextValue } from './context';\n\nimport styles from './index.module.css';\n\nexport { PureCellContext };\n\ntype BasePureCellProps = {\n /**\n * Направление\n */\n direction?: 'horizontal' | 'vertical';\n\n /**\n * Сss класс для стилизации общей обёртки\n */\n className?: string;\n\n /**\n * Выводит ссылку в виде ячейки\n */\n href?: string;\n\n /**\n * Вертикальные отступы\n */\n verticalPadding?:\n | 'airy'\n | 'default'\n | 'compact'\n | 'tiny'\n | 'none'\n | {\n /**\n * Вертикальный отступ сверху\n */\n top?: 'airy' | 'default' | 'compact' | 'tiny' | 'none';\n /**\n * Вертикальный отступ снизу\n */\n bottom?: 'airy' | 'default' | 'compact' | 'tiny' | 'none';\n };\n\n /**\n * Горизонтальные отступы\n */\n horizontalPadding?: 'left' | 'right' | 'both' | 'none';\n\n /**\n * Позволяет использовать кастомный компонент для кнопки (например Link из роутера)\n */\n tag?: ElementType;\n\n /**\n * Компоненты\n */\n children: PureCellElement;\n\n /**\n * Идентификатор для систем автоматизированного тестирования\n */\n dataTestId?: string;\n};\ntype AnchorPureCellProps = BasePureCellProps & AnchorHTMLAttributes<HTMLAnchorElement>;\ntype ButtonPureCellProps = BasePureCellProps & ButtonHTMLAttributes<HTMLButtonElement>;\ntype ElementPureCellProps = BasePureCellProps & HTMLAttributes<HTMLElement>;\nexport type PureCellProps = Partial<\n AnchorPureCellProps | ButtonPureCellProps | ElementPureCellProps\n>;\n\nconst PureCellComponent = forwardRef<HTMLElement, PureCellProps>(\n (\n {\n className,\n dataTestId,\n onClick,\n href,\n tag: Component = (href && 'a') || (onClick && 'button') || 'section',\n children,\n horizontalPadding = 'none',\n verticalPadding = 'none',\n direction = 'horizontal',\n ...restProps\n },\n ref,\n ) => {\n const cellRef = useRef<HTMLDivElement>(null);\n const [focused] = useFocus(cellRef, 'keyboard');\n const [hoverState, setHoverState] = useState<boolean>(false);\n const [activeState, setActiveState] = useState<boolean>(false);\n\n const setHover = () => setHoverState(true);\n const unsetHover = () => setHoverState(false);\n const setActive = () => setActiveState(true);\n\n const unsetActive = () => setActiveState(false);\n\n const mouseEvents = {\n onMouseEnter: setHover,\n onMouseLeave: () => {\n unsetHover();\n // Убираем на случай, если уводим курсор за пределы компонента при сработавшем onMouseDown\n unsetActive();\n },\n onMouseDown: setActive,\n onMouseUp: unsetActive,\n };\n\n const addClasses = {\n [styles.component]: true,\n [styles.focused]: focused,\n [styles[direction]]: true,\n [styles[horizontalPadding]]: true,\n [styles.hover]: hoverState,\n [styles.active]: activeState,\n };\n\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n const contextState: PureCellContextValue = {\n direction,\n dataTestId,\n setMainHover: setHover,\n unsetMainHover: unsetHover,\n };\n\n if (typeof verticalPadding === 'string') {\n addClasses[styles[verticalPadding as string]] = typeof verticalPadding === 'string';\n }\n\n if (typeof verticalPadding === 'object') {\n addClasses[styles[`${verticalPadding.top}Top`]] = !!verticalPadding.top;\n addClasses[styles[`${verticalPadding.bottom}Bottom`]] = !!verticalPadding.bottom;\n }\n\n if (href) {\n const { target } = restProps as AnchorHTMLAttributes<HTMLAnchorElement>;\n\n // Для совместимости с react-router-dom, меняем href на to\n const hrefProps = { [typeof Component === 'string' ? 'href' : 'to']: href };\n\n return (\n <Component\n rel={target === '_blank' ? 'noreferrer noopener' : undefined}\n {...(restProps as AnchorHTMLAttributes<HTMLAnchorElement>)}\n {...hrefProps}\n ref={mergeRefs([cellRef, ref])}\n className={cn(styles.link, addClasses, className)}\n data-test-id={dataTestId}\n onClick={onClick}\n {...mouseEvents}\n >\n <PureCellContext.Provider value={contextState}>\n {children}\n </PureCellContext.Provider>\n </Component>\n );\n }\n\n if (onClick) {\n return (\n <Component\n {...(restProps as AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={mergeRefs([cellRef, ref])}\n className={cn(styles.button, addClasses, className)}\n data-test-id={dataTestId}\n onClick={onClick}\n {...mouseEvents}\n >\n <PureCellContext.Provider value={contextState}>\n {children}\n </PureCellContext.Provider>\n </Component>\n );\n }\n\n return (\n <Component\n {...(restProps as AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={ref}\n tabIndex={0}\n className={cn(addClasses, className)}\n data-test-id={dataTestId}\n >\n <PureCellContext.Provider value={contextState}>{children}</PureCellContext.Provider>\n </Component>\n );\n },\n);\n\nconst ExtraSubtitle = FooterText;\n\n/**\n * Универсальный конструктор для сборки любой ячейки.\n *\n * [Макет](https://www.figma.com/file/KlFOLLkKO8rtvvQE3RXuhq/Click-Library?node-id=43525%3A240018)\n */\nconst PureCell = Object.assign(PureCellComponent, {\n Main,\n Graphics,\n Content,\n Text,\n Amount,\n AmountTitle,\n Addon,\n Footer,\n ExtraSubtitle,\n FooterButton,\n Comment,\n Category,\n});\n\nPureCellComponent.displayName = 'PureCellComponent';\n\nexport {\n PureCell,\n PureCellComponent,\n Main,\n Graphics,\n Content,\n Text,\n Amount,\n AmountTitle,\n Addon,\n Footer,\n ExtraSubtitle,\n FooterButton,\n Comment,\n Category,\n};\n"],"names":["forwardRef","__rest","useRef","useFocus","useState","styles","React","__assign","mergeRefs","cn","PureCellContext","FooterText","Main","Graphics","Content","Text","Amount","AmountTitle","Addon","Footer","Foo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,EAAAC,YAAA;AACP,IAAA,QAAQ,EAAAC,oBAAA;AACX,CAAA;AAED,iBAAiB,CAAC,WAAW,GAAG,mBAAmB;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -6,7 +6,7 @@ var tslib = require('tslib');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var cssm = require('@alfalab/core-components-shared/cssm');
|
|
9
|
-
var
|
|
9
|
+
var context = require('../../context.js');
|
|
10
10
|
var styles = require('./index.module.css');
|
|
11
11
|
|
|
12
12
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -22,7 +22,7 @@ var ADDON_COMPONENT = {
|
|
|
22
22
|
var Addon = function (_a) {
|
|
23
23
|
var _b;
|
|
24
24
|
var children = _a.children, _c = _a.verticalAlign, verticalAlign = _c === void 0 ? 'top' : _c, _d = _a.addonPadding, addonPadding = _d === void 0 ? 'default' : _d, dataTestId = _a.dataTestId, onClick = _a.onClick;
|
|
25
|
-
var pureCellContext = React.useContext(
|
|
25
|
+
var pureCellContext = React.useContext(context.PureCellContext);
|
|
26
26
|
var Component = onClick ? ADDON_COMPONENT.button : ADDON_COMPONENT.section;
|
|
27
27
|
var onMouseEvents = {
|
|
28
28
|
onClick: function (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/addon/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/addon/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 AddonElement } from '../types';\n\nimport styles from './index.module.css';\n\ntype Props = {\n /**\n * Вертикальное выравнивание\n */\n verticalAlign?: 'auto' | 'top' | 'center' | 'bottom';\n\n /**\n * Горизонтальные отступы\n */\n addonPadding?: 'default' | 'none';\n\n /**\n * Компоненты\n */\n children: AddonElement;\n\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Используется модификатор -addon\n */\n dataTestId?: string;\n\n /**\n * Клик по контенту аддона.\n */\n onClick?: () => void;\n};\n\nconst ADDON_COMPONENT: Record<string, keyof Pick<React.ReactHTML, 'button' | 'section'>> = {\n button: 'button',\n section: 'section',\n};\n\nexport const Addon: React.FC<Props> = ({\n children,\n verticalAlign = 'top',\n addonPadding = 'default',\n dataTestId,\n onClick,\n}) => {\n const pureCellContext = useContext(PureCellContext);\n\n const Component = onClick ? ADDON_COMPONENT.button : ADDON_COMPONENT.section;\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(styles.component, styles[addonPadding], styles[verticalAlign], {\n [styles.button]: onClick,\n })}\n data-test-id={getDataTestId(dataTestId || pureCellContext.dataTestId, 'addon')}\n {...(onClick && onMouseEvents)}\n >\n {children}\n </Component>\n );\n};\n"],"names":["useContext","PureCellContext","React","__assign","cn","styles","getDataTestId"],"mappings":";;;;;;;;;;;;;;;;;AAsCA,IAAM,eAAe,GAAsE;AACvF,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,OAAO,EAAE,SAAS;CACrB;AAEM,IAAM,KAAK,GAAoB,UAAC,EAMtC,EAAA;;QALG,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,EAAqB,GAAA,EAAA,CAAA,aAAA,EAArB,aAAa,GAAG,EAAA,KAAA,MAAA,GAAA,KAAK,KAAA,EACrB,EAAA,GAAA,EAAA,CAAA,YAAwB,E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IAAI,aAAa,IAE5B,QAAQ,CACD;AAEpB;;;;"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
:root {
|
|
2
|
+
--border-radius-0: 0;
|
|
3
|
+
} :root {
|
|
2
4
|
--gap-m: 16px;
|
|
3
5
|
--gap-0: 0px;
|
|
4
6
|
--gap-16: var(--gap-m);
|
|
@@ -8,7 +10,7 @@
|
|
|
8
10
|
} .component {
|
|
9
11
|
display: flex;
|
|
10
12
|
flex-direction: column;
|
|
11
|
-
align-items: flex-end
|
|
13
|
+
align-items: flex-end;
|
|
12
14
|
} .component > * {
|
|
13
15
|
justify-content: flex-end;
|
|
14
16
|
} .component.none {
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
border: 0;
|
|
34
36
|
margin: var(--gap-0);
|
|
35
37
|
box-shadow: none;
|
|
36
|
-
border-radius: 0;
|
|
38
|
+
border-radius: var(--border-radius-0);
|
|
37
39
|
-webkit-user-select: none;
|
|
38
40
|
-moz-user-select: none;
|
|
39
41
|
user-select: none;
|
|
@@ -45,7 +47,7 @@
|
|
|
45
47
|
min-width: 0;
|
|
46
48
|
cursor: pointer;
|
|
47
49
|
padding: var(--gap-0);
|
|
48
|
-
transition: opacity 0.15s ease-in-out
|
|
50
|
+
transition: opacity 0.15s ease-in-out;
|
|
49
51
|
} .button:hover {
|
|
50
52
|
opacity: var(--pure-cell-clickable-area-hover-opacity);
|
|
51
53
|
} .button:active {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type Color } from '@alfalab/core-components-typography/cssm';
|
|
3
|
-
import { AmountProps as AmountType } from '../typesProps';
|
|
3
|
+
import { type AmountProps as AmountType } from '../typesProps';
|
|
4
4
|
declare type Props = {
|
|
5
5
|
/**
|
|
6
6
|
* Начертание шрифта денежного значения
|
|
@@ -8,7 +8,7 @@ var cn = require('classnames');
|
|
|
8
8
|
var cssm$2 = require('@alfalab/core-components-amount/cssm');
|
|
9
9
|
var cssm$1 = require('@alfalab/core-components-shared/cssm');
|
|
10
10
|
var cssm = require('@alfalab/core-components-typography/cssm');
|
|
11
|
-
var
|
|
11
|
+
var context = require('../../context.js');
|
|
12
12
|
var styles = require('./index.module.css');
|
|
13
13
|
|
|
14
14
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -19,7 +19,7 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
|
19
19
|
|
|
20
20
|
var Amount = function (_a) {
|
|
21
21
|
var _b = _a.weight, weight = _b === void 0 ? 'normal' : _b, _c = _a.textView, textView = _c === void 0 ? 'component' : _c, _d = _a.color, color = _d === void 0 ? 'primary' : _d, minority = _a.minority, _e = _a.minorUnits, minorUnits = _e === void 0 ? 100 : _e, hidden = _a.hidden, dataTestId = _a.dataTestId, restProps = tslib.__rest(_a, ["weight", "textView", "color", "minority", "minorUnits", "hidden", "dataTestId"]);
|
|
22
|
-
var pureCellContext = React.useContext(
|
|
22
|
+
var pureCellContext = React.useContext(context.PureCellContext);
|
|
23
23
|
if (hidden) {
|
|
24
24
|
return (React__default.default.createElement("div", { className: styles__default.default.hiddenWrapper },
|
|
25
25
|
React__default.default.createElement("div", { className: styles__default.default.hidden })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/amount/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Amount as CoreAmount } from '@alfalab/core-components-amount';\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/amount/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Amount as CoreAmount } from '@alfalab/core-components-amount';\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { type Color, Text } from '@alfalab/core-components-typography';\n\nimport { PureCellContext } from '../../context';\nimport { type AmountProps as AmountType } from '../typesProps';\n\nimport styles from './index.module.css';\n\ntype Props = {\n /**\n * Начертание шрифта денежного значения\n */\n weight?: 'bold' | 'normal';\n\n /**\n * Размер денежного значения\n */\n textView?: 'component' | 'primary-small';\n\n /**\n * Цвет денежного значения\n */\n color?: Color;\n\n /**\n * Скрыть денежное значение\n */\n hidden?: boolean;\n\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Для typography используется модификатор -amount-text, для компонента Amount -amount\n */\n dataTestId?: string;\n} & Omit<AmountType, 'dataTestId'>;\n\nexport const Amount: React.FC<Props> = ({\n weight = 'normal',\n textView = 'component',\n color = 'primary',\n minority,\n minorUnits = 100,\n hidden,\n dataTestId,\n ...restProps\n}) => {\n const pureCellContext = useContext(PureCellContext);\n\n if (hidden) {\n return (\n <div className={styles.hiddenWrapper}>\n <div className={styles.hidden} />\n </div>\n );\n }\n\n return (\n <Text\n view={textView}\n dataTestId={getDataTestId(dataTestId || pureCellContext.dataTestId, 'amount-text')}\n className={cn(styles.component)}\n color={color}\n >\n <CoreAmount\n minority={minority || minorUnits}\n bold={weight === 'bold' ? 'full' : 'none'}\n dataTestId={getDataTestId(dataTestId || pureCellContext.dataTestId, 'amount')}\n {...restProps}\n />\n </Text>\n );\n};\n"],"names":["__rest","useContext","PureCellContext","React","styles","Text","getDataTestId","cn","CoreAmount","__assign"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCO,IAAM,MAAM,GAAoB,UAAC,EASvC,EAAA;AARG,IAAA,IAAA,cAAiB,EAAjB,MAAM,mBAAG,QAAQ,GAAA,EAAA,EACjB,EAAsB,GAAA,EAAA,CAAA,QAAA,EAAtB,QAAQ,GAAA,EAAA,KAAA,MAAA,GAAG,WAAW,GAAA,EAAA,EACtB,aAAiB,EAAjB,KAAK,mBAAG,SAAS,GAAA,EAAA,EACjB,QAAQ,cAAA,EACR,EAAA,GAAA,EAAA,CAAA,UAAgB,EAAhB,UAAU,GAAA,EAAA,KAAA,MAAA,GAAG,GAAG,GAAA,EAAA,EAChB,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,UAAU,GAAA,EAAA,CAAA,UAAA,EACP,SAAS,GAAAA,YAAA,CAAA,EAAA,EARwB,iFASvC,CADe;AAEZ,IAAA,IAAM,eAAe,GAAGC,gBAAU,CAACC,uBAAe,CAAC;AAEnD,IAAA,IAAI,MAAM,EAAE;AACR,QAAA,QACIC,sBAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEC,uBAAM,CAAC,aAAa,EAAA;YAChCD,sBAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEC,uBAAM,CAAC,MAAM,EAAI,CAAA,CAC/B;AAEb;AAED,IAAA,QACID,sBAAA,CAAA,aAAA,CAACE,SAAI,EAAA,EACD,IAAI,EAAE,QAAQ,EACd,UAAU,EAAEC,oBAAa,CAAC,UAAU,IAAI,eAAe,CAAC,UAAU,EAAE,aAAa,CAAC,EAClF,SAAS,EAAEC,mBAAE,CAACH,uBAAM,CAAC,SAAS,CAAC,EAC/B,KAAK,EAAE,KAAK,EAAA;AAEZ,QAAAD,sBAAA,CAAA,aAAA,CAACK,aAAU,EACPC,cAAA,CAAA,EAAA,QAAQ,EAAE,QAAQ,IAAI,UAAU,EAChC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,EACzC,UAAU,EAAEH,oBAAa,CAAC,UAAU,IAAI,eAAe,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAA,EACzE,SAAS,CACf,CAAA,CACC;AAEf;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type Color, type TitleProps } from '@alfalab/core-components-typography/cssm';
|
|
3
|
-
import { AmountProps as AmountType } from '../typesProps';
|
|
3
|
+
import { type AmountProps as AmountType } from '../typesProps';
|
|
4
4
|
declare type Props = {
|
|
5
5
|
/**
|
|
6
6
|
* Цвет денежного значения
|
|
@@ -8,7 +8,7 @@ var cn = require('classnames');
|
|
|
8
8
|
var cssm$2 = require('@alfalab/core-components-amount/cssm');
|
|
9
9
|
var cssm$1 = require('@alfalab/core-components-shared/cssm');
|
|
10
10
|
var cssm = require('@alfalab/core-components-typography/cssm');
|
|
11
|
-
var
|
|
11
|
+
var context = require('../../context.js');
|
|
12
12
|
var styles = require('./index.module.css');
|
|
13
13
|
|
|
14
14
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -19,7 +19,7 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
|
19
19
|
|
|
20
20
|
var AmountTitle = function (_a) {
|
|
21
21
|
var minority = _a.minority, _b = _a.minorUnits, minorUnits = _b === void 0 ? 100 : _b, hidden = _a.hidden, className = _a.className, _c = _a.color, color = _c === void 0 ? 'primary' : _c, dataTestId = _a.dataTestId, _d = _a.titleProps, titlePropsFromProps = _d === void 0 ? {} : _d, restProps = tslib.__rest(_a, ["minority", "minorUnits", "hidden", "className", "color", "dataTestId", "titleProps"]);
|
|
22
|
-
var pureCellContext = React.useContext(
|
|
22
|
+
var pureCellContext = React.useContext(context.PureCellContext);
|
|
23
23
|
var titleProps = tslib.__assign({ tag: 'h4', view: 'small', color: color }, titlePropsFromProps);
|
|
24
24
|
if (hidden) {
|
|
25
25
|
return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.hiddenWrapper, styles__default.default["hiddenWrapper-".concat(titleProps.view)]) },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/amount-title/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Amount as CoreAmount } from '@alfalab/core-components-amount';\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { type Color, type TitleProps, TitleResponsive } from '@alfalab/core-components-typography';\n\nimport { PureCellContext } from '../../
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/amount-title/component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Amount as CoreAmount } from '@alfalab/core-components-amount';\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { type Color, type TitleProps, TitleResponsive } from '@alfalab/core-components-typography';\n\nimport { PureCellContext } from '../../context';\nimport { type AmountProps as AmountType } from '../typesProps';\n\nimport styles from './index.module.css';\n\ntype Props = {\n /**\n * Цвет денежного значения\n * @deprecated Используйте titleProps.color\n */\n color?: Color;\n\n /**\n * Пропсы, которые будут прокинуты в компонент типографики\n */\n titleProps?: TitleProps;\n\n /**\n * Скрыть денежное значение\n */\n hidden?: boolean;\n\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Для typography используется модификатор -amount-title, для компонента Amount -core-amount-title\n */\n dataTestId?: string;\n} & Omit<AmountType, 'dataTestId'>;\n\nexport const AmountTitle: React.FC<Props> = ({\n minority,\n minorUnits = 100,\n hidden,\n className,\n color = 'primary',\n dataTestId,\n titleProps: titlePropsFromProps = {},\n ...restProps\n}) => {\n const pureCellContext = useContext(PureCellContext);\n\n const titleProps = {\n tag: 'h4',\n view: 'small',\n color,\n ...titlePropsFromProps,\n } as Omit<TitleProps, 'className' | 'dataTestId'>;\n\n if (hidden) {\n return (\n <div className={cn(styles.hiddenWrapper, styles[`hiddenWrapper-${titleProps.view}`])}>\n <div className={cn(styles.hidden, styles[`hidden-${titleProps.view}`])} />\n </div>\n );\n }\n\n return (\n <TitleResponsive\n {...titleProps}\n dataTestId={getDataTestId(dataTestId || pureCellContext.dataTestId, 'amount-title')}\n className={cn(styles.component, titlePropsFromProps?.className)}\n >\n <CoreAmount\n minority={minority || minorUnits}\n className={cn(styles.weight, className)}\n dataTestId={getDataTestId(\n dataTestId || pureCellContext.dataTestId,\n 'core-amount-title',\n )}\n {...restProps}\n bold='none'\n />\n </TitleResponsive>\n );\n};\n"],"names":["__rest","useContext","PureCellContext","__assign","React","cn","styles","TitleResponsive","getDataTestId","Co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,CAACG,oBAAe,EAAAJ,cAAA,CAAA,EAAA,EACR,UAAU,EACd,EAAA,UAAU,EAAEK,oBAAa,CAAC,UAAU,IAAI,eAAe,CAAC,UAAU,EAAE,cAAc,CAAC,EACnF,SAAS,EAAEH,mBAAE,CAACC,uBAAM,CAAC,SAAS,EAAE,mBAAmB,aAAnB,mBAAmB,KAAA,MAAA,GAAA,MAAA,GAAnB,mBAAmB,CAAE,SAAS,CAAC,EAAA,CAAA;AAE/D,QAAAF,sBAAA,CAAA,aAAA,CAACK,aAAU,EACPN,cAAA,CAAA,EAAA,QAAQ,EAAE,QAAQ,IAAI,UAAU,EAChC,SAAS,EAAEE,mBAAE,CAACC,uBAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACvC,UAAU,EAAEE,oBAAa,CACrB,UAAU,IAAI,eAAe,CAAC,UAAU,EACxC,mBAAmB,CACtB,EACG,EAAA,SAAS,IACb,IAAI,EAAC,MAAM,EACb,CAAA,CAAA,CACY;AAE1B;;;;"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var cssm$1 = require('@alfalab/core-components-shared/cssm');
|
|
7
7
|
var cssm = require('@alfalab/core-components-typography/cssm');
|
|
8
|
-
var
|
|
8
|
+
var context = require('../../context.js');
|
|
9
9
|
var styles = require('./index.module.css');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -15,7 +15,7 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
|
15
15
|
|
|
16
16
|
var Category = function (_a) {
|
|
17
17
|
var categoryName = _a.categoryName, categoryPercent = _a.categoryPercent, rightAddons = _a.rightAddons, dataTestId = _a.dataTestId;
|
|
18
|
-
var pureCellContext = React.useContext(
|
|
18
|
+
var pureCellContext = React.useContext(context.PureCellContext);
|
|
19
19
|
return (React__default.default.createElement("div", { className: styles__default.default.component, "data-test-id": 'cell-pure-category' },
|
|
20
20
|
React__default.default.createElement(cssm.Text, { view: 'primary-small', color: 'secondary', dataTestId: cssm$1.getDataTestId(dataTestId || pureCellContext.dataTestId, 'category-name'), className: styles__default.default.categoryName }, categoryName),
|
|
21
21
|
categoryPercent !== undefined && (React__default.default.createElement(cssm.Text, { tag: 'div', view: 'primary-small', color: 'secondary', className: styles__default.default.categoryPercent, dataTestId: cssm$1.getDataTestId(dataTestId || pureCellContext.dataTestId, 'category-percent') },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/category/component.tsx"],"sourcesContent":["import React, { ReactNode, useContext } from 'react';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { PureCellContext } from '../../
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/category/component.tsx"],"sourcesContent":["import React, { type ReactNode, useContext } from 'react';\n\nimport { getDataTestId } from '@alfalab/core-components-shared';\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { PureCellContext } from '../../context';\n\nimport styles from './index.module.css';\n\ntype Props = {\n /**\n * Наименование категории\n */\n categoryName: string;\n\n /**\n * Процент категории\n */\n categoryPercent?: number;\n\n /**\n * Слот справа\n */\n rightAddons?: ReactNode;\n\n /**\n * Идентификатор для систем автоматизированного тестирования.\n * Для наименования категории используется модификатор -category-name,\n * процент категории -category-percent, слота справа -category-right-addon\n */\n dataTestId?: string;\n};\n\nexport const Category: React.FC<Props> = ({\n categoryName,\n categoryPercent,\n rightAddons,\n dataTestId,\n}) => {\n const pureCellContext = useContext(PureCellContext);\n\n return (\n <div className={styles.component} data-test-id='cell-pure-category'>\n <Text\n view='primary-small'\n color='secondary'\n dataTestId={getDataTestId(\n dataTestId || pureCellContext.dataTestId,\n 'category-name',\n )}\n className={styles.categoryName}\n >\n {categoryName}\n </Text>\n {categoryPercent !== undefined && (\n <Text\n tag='div'\n view='primary-small'\n color='secondary'\n className={styles.categoryPercent}\n dataTestId={getDataTestId(\n dataTestId || pureCellContext.dataTestId,\n 'category-percent',\n )}\n >\n {categoryPercent}%\n </Text>\n )}\n {rightAddons !== undefined && (\n <div\n className={styles.rightAddon}\n data-test-id={getDataTestId(\n dataTestId || pureCellContext.dataTestId,\n 'category-right-addon',\n )}\n >\n {rightAddons}\n </div>\n )}\n </div>\n );\n};\n"],"names":["useContext","PureCellContext","React","styles","Text","getDataTestId"],"mappings":";;;;;;;;;;;;;;;AAiCO,IAAM,QAAQ,GAAoB,UAAC,EAKzC,EAAA;QAJG,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,UAAU,GAAA,EAAA,CAAA,UAAA;AAEV,IAAA,IAAM,eAAe,GAAGA,gBAAU,CAACC,uBAAe,CAAC;IAEnD,QACIC,8CAAK,SAAS,EAAEC,uBAAM,CAAC,SAAS,kBAAe,oBAAoB,EAAA;AAC/D,QAAAD,sBAAA,CAAA,aAAA,CAACE,SAAI,EAAA,EACD,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,WAAW,EACjB,UAAU,EAAEC,oBAAa,CACrB,UAAU,IAAI,eAAe,CAAC,UAAU,EACxC,eAAe,CAClB,EACD,SAAS,EAAEF,uBAAM,CAAC,YAAY,EAAA,EAE7B,YAAY,CACV;AACN,QAAA,eAAe,KAAK,SAAS,KAC1BD,sBAAA,CAAA,aAAA,CAACE,SAAI,EACD,EAAA,GAAG,EAAC,KAAK,EACT,IAAI,EAAC,eAAe,EACpB,KAAK,EAAC,WAAW,EACjB,SAAS,EAAED,uBAAM,CAAC,eAAe,EACjC,UAAU,EAAEE,oBAAa,CACrB,UAAU,IAAI,eAAe,CAAC,UAAU,EACxC,kBAAkB,CACrB,EAAA;YAEA,eAAe;gBACb,CACV;QACA,WAAW,KAAK,SAAS,KACtBH,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAEC,uBAAM,CAAC,UAAU,EAAA,cAAA,EACdE,oBAAa,CACvB,UAAU,IAAI,eAAe,CAAC,UAAU,EACxC,sBAAsB,CACzB,EAEA,EAAA,WAAW,CACV,CACT,CACC;AAEd;;;;"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var cn = require('classnames');
|
|
7
7
|
var cssm = require('@alfalab/core-components-shared/cssm');
|
|
8
|
-
var
|
|
8
|
+
var context = require('../../context.js');
|
|
9
9
|
var styles = require('./index.module.css');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -17,7 +17,7 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
|
17
17
|
var Content = function (_a) {
|
|
18
18
|
var _b;
|
|
19
19
|
var children = _a.children, dataTestId = _a.dataTestId;
|
|
20
|
-
var _c = React.useContext(
|
|
20
|
+
var _c = React.useContext(context.PureCellContext), direction = _c.direction, contextDataTestId = _c.dataTestId;
|
|
21
21
|
return (React__default.default.createElement("section", { className: cn__default.default(styles__default.default.component, (_b = {}, _b[styles__default.default.horizontal] = direction === 'horizontal', _b)), "data-test-id": cssm.getDataTestId(dataTestId || contextDataTestId, 'content') }, children));
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -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":["useContext","PureCellContext","React","cn","styles","getDataTestId"],"mappings":";;;;;;;;;;;;;;;;AAuBO,IAAM,OAAO,GAAoB,UAAC,EAAwB,EAAA;;QAAtB,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,UAAU,GAAA,EAAA,CAAA,UAAA;IACrD,IAAA,EAAA,GAA+CA,gBAAU,CAACC,uBAAe,CAAC,EAAxE,SAAS,GAAA,EAAA,CAAA,SAAA,EAAc,iBAAiB,GAAA,EAAA,CAAA,UAAgC;AAEhF,IAAA,QACIC,sBAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EACI,SAAS,EAAEC,mBAAE,CAACC,uBAAM,CAAC,SAAS,GAAI,EAAA,GAAA,EAAA,EAAA,EAAA,CAACA,uBAAM,CAAC,UAAU,CAAG,GAAA,SAAS,KAAK,YAAY,EAAG,EAAA,EAAA,EAAA,cAAA,EACtEC,kBAAa,CAAC,UAAU,IAAI,iBAAiB,EAAE,SAAS,CAAC,EAAA,EAEtE,QAAQ,CACH;AAElB;;;;"}
|