@alfalab/core-components-chart 4.1.0 → 5.0.0-8406faee42e08c133fbcbb0de3e6eb2df6766dd2
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/components/Dot/index.css +7 -7
- package/components/Dot/index.module.css.js +1 -1
- package/components/Legends/index.css +14 -7
- package/components/Legends/index.js +1 -1
- package/components/Legends/index.js.map +1 -1
- package/components/Legends/index.module.css.js +1 -1
- package/components/Tick/index.css +9 -2
- package/components/Tick/index.module.css.js +1 -1
- package/components/TooltipContent/index.css +18 -9
- package/components/TooltipContent/index.js +3 -3
- package/components/TooltipContent/index.js.map +1 -1
- package/components/TooltipContent/index.module.css.js +1 -1
- package/cssm/components/Legends/index.js +1 -1
- package/cssm/components/Legends/index.js.map +1 -1
- package/cssm/components/Legends/index.module.css +14 -7
- package/cssm/components/Tick/index.module.css +9 -2
- package/cssm/components/TooltipContent/index.js +3 -3
- package/cssm/components/TooltipContent/index.js.map +1 -1
- package/cssm/components/TooltipContent/index.module.css +18 -9
- package/cssm/hoc/Customized.js +4 -4
- package/cssm/hoc/Customized.js.map +1 -1
- package/cssm/index.module.css +19 -5
- package/esm/components/Dot/index.css +7 -7
- package/esm/components/Dot/index.module.css.js +1 -1
- package/esm/components/Legends/index.css +14 -7
- package/esm/components/Legends/index.js +2 -2
- package/esm/components/Legends/index.js.map +1 -1
- package/esm/components/Legends/index.module.css.js +1 -1
- package/esm/components/Tick/index.css +9 -2
- package/esm/components/Tick/index.module.css.js +1 -1
- package/esm/components/TooltipContent/index.css +18 -9
- package/esm/components/TooltipContent/index.js +4 -4
- package/esm/components/TooltipContent/index.js.map +1 -1
- package/esm/components/TooltipContent/index.module.css.js +1 -1
- package/esm/hoc/Customized.js +5 -5
- package/esm/hoc/Customized.js.map +1 -1
- package/esm/index.css +19 -5
- package/esm/index.module.css.js +1 -1
- package/esm/index.module.css.js.map +1 -1
- package/hoc/Customized.js +4 -4
- package/hoc/Customized.js.map +1 -1
- package/index.css +19 -5
- package/index.module.css.js +1 -1
- package/index.module.css.js.map +1 -1
- package/modern/components/Dot/index.css +7 -7
- package/modern/components/Dot/index.module.css.js +1 -1
- package/modern/components/Legends/index.css +14 -7
- package/modern/components/Legends/index.js +2 -2
- package/modern/components/Legends/index.js.map +1 -1
- package/modern/components/Legends/index.module.css.js +1 -1
- package/modern/components/Tick/index.css +9 -2
- package/modern/components/Tick/index.module.css.js +1 -1
- package/modern/components/TooltipContent/index.css +18 -9
- package/modern/components/TooltipContent/index.js +4 -4
- package/modern/components/TooltipContent/index.js.map +1 -1
- package/modern/components/TooltipContent/index.module.css.js +1 -1
- package/modern/hoc/Customized.js +3 -3
- package/modern/hoc/Customized.js.map +1 -1
- package/modern/index.css +19 -5
- package/modern/index.module.css.js +1 -1
- package/modern/index.module.css.js.map +1 -1
- package/moderncssm/components/Legends/index.js +2 -2
- package/moderncssm/components/Legends/index.js.map +1 -1
- package/moderncssm/components/Tick/index.module.css +1 -0
- package/moderncssm/components/TooltipContent/index.js +4 -4
- package/moderncssm/components/TooltipContent/index.js.map +1 -1
- package/moderncssm/hoc/Customized.js +3 -3
- package/moderncssm/hoc/Customized.js.map +1 -1
- package/moderncssm/index.module.css +7 -1
- package/package.json +7 -7
- package/src/components/Legends/index.tsx +3 -3
- package/src/components/TooltipContent/index.tsx +7 -7
- package/src/hoc/Customized.tsx +3 -3
- package/src/index.module.css +2 -2
package/components/Dot/index.css
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
.
|
|
1
|
+
.chart__dotUnfocused_y0dx1 {
|
|
2
2
|
opacity: 0.3;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.
|
|
6
|
-
.
|
|
7
|
-
.
|
|
5
|
+
.chart__dot_y0dx1,
|
|
6
|
+
.chart__dotItem_y0dx1,
|
|
7
|
+
.chart__dotWrap_y0dx1 {
|
|
8
8
|
transition: all 0.2s ease;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.
|
|
12
|
-
animation:
|
|
11
|
+
.chart__dot_y0dx1 {
|
|
12
|
+
animation: chart__showDot_y0dx1 0.5s ease;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
@keyframes
|
|
15
|
+
@keyframes chart__showDot_y0dx1 {
|
|
16
16
|
from {
|
|
17
17
|
opacity: 0;
|
|
18
18
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"dotUnfocused":"
|
|
5
|
+
var styles = {"dotUnfocused":"chart__dotUnfocused_y0dx1","dot":"chart__dot_y0dx1","dotItem":"chart__dotItem_y0dx1","dotWrap":"chart__dotWrap_y0dx1"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -2,25 +2,32 @@
|
|
|
2
2
|
--gap-2xl: 32px;
|
|
3
3
|
--gap-0: 0px;
|
|
4
4
|
--gap-32: var(--gap-2xl);
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
|
+
.chart__legendContent_ienf1 {
|
|
6
7
|
display: flex;
|
|
7
8
|
align-items: center;
|
|
8
9
|
flex-wrap: wrap;
|
|
9
|
-
}
|
|
10
|
+
}
|
|
11
|
+
.chart__legendWrap_ienf1 {
|
|
10
12
|
width: 100%;
|
|
11
13
|
margin: var(--gap-0);
|
|
12
14
|
padding: var(--gap-0);
|
|
13
|
-
}
|
|
15
|
+
}
|
|
16
|
+
.chart__legendItem_ienf1 {
|
|
14
17
|
margin-right: var(--gap-32);
|
|
15
18
|
cursor: pointer;
|
|
16
19
|
display: inline-block;
|
|
17
|
-
}
|
|
20
|
+
}
|
|
21
|
+
.chart__legendItem_ienf1:last-child {
|
|
18
22
|
margin-right: var(--gap-0);
|
|
19
|
-
}
|
|
23
|
+
}
|
|
24
|
+
.chart__legendUnactive_ienf1 {
|
|
20
25
|
opacity: 0.3;
|
|
21
|
-
}
|
|
26
|
+
}
|
|
27
|
+
.chart__legendIcon_ienf1 {
|
|
22
28
|
margin-right: 13px;
|
|
23
29
|
display: flex;
|
|
24
|
-
}
|
|
30
|
+
}
|
|
31
|
+
.chart__legendValue_ienf1 {
|
|
25
32
|
text-transform: capitalize;
|
|
26
33
|
}
|
|
@@ -40,7 +40,7 @@ var Legends = React__default.default.forwardRef(function (_a, ref) {
|
|
|
40
40
|
React__default.default.createElement(Icon, { fill: ((_a = item.properties) === null || _a === void 0 ? void 0 : _a.fill) ||
|
|
41
41
|
((_b = item.properties) === null || _b === void 0 ? void 0 : _b.stroke) ||
|
|
42
42
|
'', height: legend.iconHeight || 16 }))) : null,
|
|
43
|
-
React__default.default.createElement(coreComponentsTypography.
|
|
43
|
+
React__default.default.createElement(coreComponentsTypography.TypographyText, { view: 'primary-medium', tag: 'span', className: cn__default.default(index_module.legendValue) }, item.properties.name))));
|
|
44
44
|
})));
|
|
45
45
|
});
|
|
46
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/components/Legends/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/Legends/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { CircleIcon } from '../../icons/Circle';\nimport { CircleLineIcon } from '../../icons/CircleLine';\nimport { FilledCircleIcon } from '../../icons/FilledCircle';\nimport { StrokeCircleIcon } from '../../icons/StrokeCircle';\nimport { type LegendProps } from '../../types/legend.types';\nimport { type SeriaProps } from '../../types/seria.types';\nimport { type DataDynamicBooleanProps } from '../../types/utils/data.types';\n\nimport styles from './index.module.css';\n\ninterface Props {\n legend: LegendProps;\n series: SeriaProps[];\n id: string;\n charts: DataDynamicBooleanProps;\n toggleChart(item: SeriaProps): void;\n}\n\nconst icons = {\n circleLine: CircleLineIcon,\n filledCircle: FilledCircleIcon,\n strokeCircle: StrokeCircleIcon,\n circle: CircleIcon,\n};\n\nexport const Legends = React.forwardRef<HTMLUListElement, Props>(\n ({ legend, series, id, charts, toggleChart }, ref): React.ReactElement => {\n const style: React.CSSProperties = {\n textAlign: legend.align || 'center',\n transform: `translateY(${\n (legend?.marginTop ? legend.marginTop : 0) *\n (legend.verticalAlign === 'top' ? -1 : 1)\n }px)`,\n };\n\n return (\n <ul ref={ref} className={cn(styles.legendWrap)} style={style}>\n {series.map((item: SeriaProps) => {\n if (item.hideLegend || item.hide) return null;\n\n const Icon = icons[item.icon] || CircleIcon;\n\n return (\n <li\n role='presentation'\n key={`${id}-${item.properties.dataKey}`}\n className={cn(\n styles.legendItem,\n charts[`${item.properties.dataKey}`] ? '' : styles.legendUnactive,\n )}\n onClick={() => toggleChart(item)}\n >\n <div className={cn(styles.legendContent)}>\n {Icon ? (\n <i className={cn(styles.legendIcon)}>\n <Icon\n fill={\n item.properties?.fill ||\n item.properties?.stroke ||\n ''\n }\n height={legend.iconHeight || 16}\n />\n </i>\n ) : null}\n <TypographyText\n view='primary-medium'\n tag='span'\n className={cn(styles.legendValue)}\n >\n {item.properties.name}\n </TypographyText>\n </div>\n </li>\n );\n })}\n </ul>\n );\n },\n);\n"],"names":["CircleLineIcon","FilledCircleIcon","StrokeCircleIcon","CircleIcon","React","cn","styles","TypographyText"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,IAAM,KAAK,GAAG;AACV,IAAA,UAAU,EAAEA,yBAAc;AAC1B,IAAA,YAAY,EAAEC,6BAAgB;AAC9B,IAAA,YAAY,EAAEC,6BAAgB;AAC9B,IAAA,MAAM,EAAEC,iBAAU;CACrB;AAEY,IAAA,OAAO,GAAGC,sBAAK,CAAC,UAAU,CACnC,UAAC,EAA2C,EAAE,GAAG,EAAA;AAA9C,IAAA,IAAA,MAAM,GAAA,EAAA,CAAA,MAAA,EAAE,MAAM,GAAA,EAAA,CAAA,MAAA,EAAE,EAAE,GAAA,EAAA,CAAA,EA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EAAA,EAAK,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,aAAa,CAAC,EAAA;AACnC,gBAAA,IAAI,IACDF,sBAAG,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,UAAU,CAAC,EAAA;oBAC/BF,sBAAC,CAAA,aAAA,CAAA,IAAI,EACD,EAAA,IAAI,EACA,CAAA,MAAA,IAAI,CAAC,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI;AACrB,6BAAA,CAAA,EAAA,GAAA,IAAI,CAAC,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,CAAA;AACvB,4BAAA,EAAE,EAEN,MAAM,EAAE,MAAM,CAAC,UAAU,IAAI,EAAE,EAAA,CACjC,CACF,IACJ,IAAI;AACR,gBAAAA,sBAAA,CAAA,aAAA,CAACG,uCAAc,EAAA,EACX,IAAI,EAAC,gBAAgB,EACrB,GAAG,EAAC,MAAM,EACV,SAAS,EAAEF,mBAAE,CAACC,YAAM,CAAC,WAAW,CAAC,EAEhC,EAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CACR,CACf,CACL;KAEZ,CAAC,CACD;AAEb,CAAC;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"legendContent":"
|
|
5
|
+
var styles = {"legendContent":"chart__legendContent_ienf1","legendWrap":"chart__legendWrap_ienf1","legendItem":"chart__legendItem_ienf1","legendUnactive":"chart__legendUnactive_ienf1","legendIcon":"chart__legendIcon_ienf1","legendValue":"chart__legendValue_ienf1"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--color-dark-base-bg-primary: #121213;
|
|
3
3
|
--color-light-text-primary: rgba(3, 3, 6, 0.88);
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
6
|
+
--font-family-system:
|
|
7
|
+
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
|
|
8
|
+
}
|
|
9
|
+
.chart__tickText_1cyix {
|
|
5
10
|
fill: var(--color-light-text-primary);
|
|
6
11
|
font-size: 16px;
|
|
7
12
|
line-height: 24px;
|
|
8
13
|
font-weight: 400;
|
|
9
|
-
|
|
14
|
+
font-family: var(--font-family-system);
|
|
15
|
+
}
|
|
16
|
+
.chart__circle_1cyix {
|
|
10
17
|
opacity: 0.3;
|
|
11
18
|
fill: var(--color-dark-base-bg-primary);
|
|
12
19
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"tickText":"
|
|
5
|
+
var styles = {"tickText":"chart__tickText_1cyix","circle":"chart__circle_1cyix"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--color-light-base-bg-primary: #fff;
|
|
3
3
|
--color-light-neutral-400: #d2d3d9;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
5
6
|
--shadow-l:
|
|
6
7
|
0 24px 32px rgba(0, 0, 0, 0.08), 0 20px 24px rgba(0, 0, 0, 0.08),
|
|
7
8
|
0 12px 16px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.04);
|
|
8
|
-
}
|
|
9
|
+
}
|
|
10
|
+
:root {
|
|
9
11
|
--border-radius-m: 8px;
|
|
10
12
|
--border-radius-8: var(--border-radius-m);
|
|
11
|
-
}
|
|
13
|
+
}
|
|
14
|
+
:root {
|
|
12
15
|
--gap-s: 12px;
|
|
13
16
|
--gap-m: 16px;
|
|
14
17
|
--gap-3xs-neg: -2px;
|
|
@@ -17,7 +20,8 @@
|
|
|
17
20
|
--gap-12: var(--gap-s);
|
|
18
21
|
--gap-16: var(--gap-m);
|
|
19
22
|
--gap-2-neg: var(--gap-3xs-neg);
|
|
20
|
-
}
|
|
23
|
+
}
|
|
24
|
+
.chart__tooltip_5sqmg {
|
|
21
25
|
background-color: var(--color-light-base-bg-primary);
|
|
22
26
|
border: 1px solid var(--color-light-neutral-400);
|
|
23
27
|
box-shadow: var(--shadow-l);
|
|
@@ -25,15 +29,18 @@
|
|
|
25
29
|
padding: var(--gap-12) var(--gap-16);
|
|
26
30
|
pointer-events: none;
|
|
27
31
|
position: relative;
|
|
28
|
-
}
|
|
32
|
+
}
|
|
33
|
+
.chart__tooltipList_5sqmg {
|
|
29
34
|
position: relative;
|
|
30
35
|
z-index: 5;
|
|
31
36
|
list-style-type: none;
|
|
32
37
|
padding: var(--gap-0);
|
|
33
38
|
margin: var(--gap-0);
|
|
34
|
-
}
|
|
39
|
+
}
|
|
40
|
+
.chart__tooltipItem_5sqmg {
|
|
35
41
|
margin-bottom: var(--gap-10);
|
|
36
|
-
}
|
|
42
|
+
}
|
|
43
|
+
.chart__tooltipArrow_5sqmg {
|
|
37
44
|
position: absolute;
|
|
38
45
|
left: var(--gap-0);
|
|
39
46
|
top: 50%;
|
|
@@ -42,7 +49,8 @@
|
|
|
42
49
|
height: 10px;
|
|
43
50
|
border: 1px solid var(--color-light-neutral-400);
|
|
44
51
|
background-color: var(--color-light-base-bg-primary);
|
|
45
|
-
}
|
|
52
|
+
}
|
|
53
|
+
.chart__tooltipArrow_5sqmg:before {
|
|
46
54
|
content: '';
|
|
47
55
|
position: absolute;
|
|
48
56
|
left: var(--gap-2-neg);
|
|
@@ -52,7 +60,8 @@
|
|
|
52
60
|
border-style: solid;
|
|
53
61
|
border-width: 0 14px 14px 0;
|
|
54
62
|
border-color: transparent var(--color-light-base-bg-primary) transparent transparent;
|
|
55
|
-
}
|
|
63
|
+
}
|
|
64
|
+
.chart__tooltipArrowRight_5sqmg {
|
|
56
65
|
left: 100%;
|
|
57
66
|
transform: translate(-50%, -50%) scale(-1, 1) rotate(45deg);
|
|
58
67
|
}
|
|
@@ -30,16 +30,16 @@ var TooltipContent = React.forwardRef(function (_a, ref) {
|
|
|
30
30
|
_c)) })),
|
|
31
31
|
React__default.default.createElement("ul", { className: cn__default.default(index_module.tooltipList) },
|
|
32
32
|
React__default.default.createElement("li", { className: cn__default.default(index_module.tooltipItem), style: labelStyle },
|
|
33
|
-
React__default.default.createElement(coreComponentsTypography.
|
|
33
|
+
React__default.default.createElement(coreComponentsTypography.TypographyText, { view: 'primary-medium', tag: 'span', weight: 'medium', className: cn__default.default(index_module.tooltipLabel) }, labelFormatter ? labelFormatter(label) : label)),
|
|
34
34
|
payload.map(function (entry) {
|
|
35
35
|
var data = series.find(function (d) { return d.properties.dataKey === entry.dataKey; });
|
|
36
36
|
if ((data === null || data === void 0 ? void 0 : data.hideTooltip) || (data === null || data === void 0 ? void 0 : data.hide))
|
|
37
37
|
return null;
|
|
38
38
|
return (React__default.default.createElement("li", { className: cn__default.default(index_module.tooltipItem), key: entry.dataKey, style: { color: entry.color } },
|
|
39
|
-
React__default.default.createElement(coreComponentsTypography.
|
|
39
|
+
React__default.default.createElement(coreComponentsTypography.TypographyText, { view: 'primary-medium', tag: 'span', weight: 'medium', className: cn__default.default(index_module.tooltipValue) },
|
|
40
40
|
(entry === null || entry === void 0 ? void 0 : entry.formatter) ? entry.formatter(entry.value) : entry.value,
|
|
41
41
|
separator || ' '),
|
|
42
|
-
React__default.default.createElement(coreComponentsTypography.
|
|
42
|
+
React__default.default.createElement(coreComponentsTypography.TypographyText, { view: 'secondary-large', tag: 'span', className: cn__default.default(index_module.tooltipName) }, "".concat(entry.name))));
|
|
43
43
|
}))));
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/components/TooltipContent/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport cn from 'classnames';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/TooltipContent/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { type PayloadProps } from '../../types/payload.types';\nimport { type SeriaProps } from '../../types/seria.types';\nimport { type TooltipProps } from '../../types/tooltip.types';\n\nimport styles from './index.module.css';\n\nexport interface TooltipContentProps extends TooltipProps {\n payload: PayloadProps[];\n series: SeriaProps[];\n}\n\nexport const TooltipContent = forwardRef<HTMLDivElement, TooltipContentProps>(\n (\n {\n payload,\n separator,\n label,\n tooltipArrowSide,\n arrow,\n series,\n labelFormatter,\n labelStyle,\n contentFormatter,\n },\n ref,\n ) => {\n if (!label || payload.length === 0) return null;\n\n if (typeof contentFormatter === 'function') {\n return (\n <div className={cn(styles.tooltip)} ref={ref}>\n {arrow && (\n <span\n className={cn(styles.tooltipArrow, {\n [styles.tooltipArrowRight]: !tooltipArrowSide,\n })}\n />\n )}\n {contentFormatter?.({ label, payload })}\n </div>\n );\n }\n\n return (\n <div className={cn(styles.tooltip)} ref={ref}>\n {arrow && (\n <span\n className={cn(styles.tooltipArrow, {\n [styles.tooltipArrowRight]: !tooltipArrowSide,\n })}\n />\n )}\n <ul className={cn(styles.tooltipList)}>\n <li className={cn(styles.tooltipItem)} style={labelStyle}>\n <TypographyText\n view='primary-medium'\n tag='span'\n weight='medium'\n className={cn(styles.tooltipLabel)}\n >\n {labelFormatter ? labelFormatter(label) : label}\n </TypographyText>\n </li>\n {payload.map((entry: PayloadProps) => {\n const data: SeriaProps | undefined = series.find(\n (d: SeriaProps) => d.properties.dataKey === entry.dataKey,\n );\n\n if (data?.hideTooltip || data?.hide) return null;\n\n return (\n <li\n className={cn(styles.tooltipItem)}\n key={entry.dataKey}\n style={{ color: entry.color }}\n >\n <TypographyText\n view='primary-medium'\n tag='span'\n weight='medium'\n className={cn(styles.tooltipValue)}\n >\n {entry?.formatter ? entry.formatter(entry.value) : entry.value}\n {separator || ' '}\n </TypographyText>\n <TypographyText\n view='secondary-large'\n tag='span'\n className={cn(styles.tooltipName)}\n >{`${entry.name}`}</TypographyText>\n </li>\n );\n })}\n </ul>\n </div>\n );\n },\n);\n"],"names":["forwardRef","React","cn","styles","TypographyText"],"mappings":";;;;;;;;;;;;;;IAgBa,cAAc,GAAGA,gBAAU,CACpC,UACI,EAUC,EACD,GAAG,EAAA;;QAVC,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,gBAAgB,GAAA,EAAA,CAAA,gBAAA,EAChB,KAAK,WAAA,EACL,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,gBAAgB,GAAA,EAAA,CAAA,gBAAA;AAIpB,IAAA,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;AAE/C,IAAA,IAAI,OAAO,gBAAgB,KAAK,UAAU,EAAE;AACxC,QAAA,QACIC,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,EAAA;YACvC,KAAK,KACFF,sBACI,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,YAAY,GAAA,EAAA,GAAA,EAAA;AAC7B,oBAAA,EAAA,CAACA,YAAM,CAAC,iBAAiB,CAAA,GAAG,CAAC,gBAAgB;AAC/C,oBAAA,EAAA,EAAA,EAAA,CACJ,CACL,EACA,gBAA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ooltipList_5sqmg","tooltipItem":"chart__tooltipItem_5sqmg","tooltipArrow":"chart__tooltipArrow_5sqmg","tooltipArrowRight":"chart__tooltipArrowRight_5sqmg"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -41,7 +41,7 @@ var Legends = React__default.default.forwardRef(function (_a, ref) {
|
|
|
41
41
|
React__default.default.createElement(Icon, { fill: ((_a = item.properties) === null || _a === void 0 ? void 0 : _a.fill) ||
|
|
42
42
|
((_b = item.properties) === null || _b === void 0 ? void 0 : _b.stroke) ||
|
|
43
43
|
'', height: legend.iconHeight || 16 }))) : null,
|
|
44
|
-
React__default.default.createElement(cssm.
|
|
44
|
+
React__default.default.createElement(cssm.TypographyText, { view: 'primary-medium', tag: 'span', className: cn__default.default(styles__default.default.legendValue) }, item.properties.name))));
|
|
45
45
|
})));
|
|
46
46
|
});
|
|
47
47
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Legends/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Legends/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { CircleIcon } from '../../icons/Circle';\nimport { CircleLineIcon } from '../../icons/CircleLine';\nimport { FilledCircleIcon } from '../../icons/FilledCircle';\nimport { StrokeCircleIcon } from '../../icons/StrokeCircle';\nimport { type LegendProps } from '../../types/legend.types';\nimport { type SeriaProps } from '../../types/seria.types';\nimport { type DataDynamicBooleanProps } from '../../types/utils/data.types';\n\nimport styles from './index.module.css';\n\ninterface Props {\n legend: LegendProps;\n series: SeriaProps[];\n id: string;\n charts: DataDynamicBooleanProps;\n toggleChart(item: SeriaProps): void;\n}\n\nconst icons = {\n circleLine: CircleLineIcon,\n filledCircle: FilledCircleIcon,\n strokeCircle: StrokeCircleIcon,\n circle: CircleIcon,\n};\n\nexport const Legends = React.forwardRef<HTMLUListElement, Props>(\n ({ legend, series, id, charts, toggleChart }, ref): React.ReactElement => {\n const style: React.CSSProperties = {\n textAlign: legend.align || 'center',\n transform: `translateY(${\n (legend?.marginTop ? legend.marginTop : 0) *\n (legend.verticalAlign === 'top' ? -1 : 1)\n }px)`,\n };\n\n return (\n <ul ref={ref} className={cn(styles.legendWrap)} style={style}>\n {series.map((item: SeriaProps) => {\n if (item.hideLegend || item.hide) return null;\n\n const Icon = icons[item.icon] || CircleIcon;\n\n return (\n <li\n role='presentation'\n key={`${id}-${item.properties.dataKey}`}\n className={cn(\n styles.legendItem,\n charts[`${item.properties.dataKey}`] ? '' : styles.legendUnactive,\n )}\n onClick={() => toggleChart(item)}\n >\n <div className={cn(styles.legendContent)}>\n {Icon ? (\n <i className={cn(styles.legendIcon)}>\n <Icon\n fill={\n item.properties?.fill ||\n item.properties?.stroke ||\n ''\n }\n height={legend.iconHeight || 16}\n />\n </i>\n ) : null}\n <TypographyText\n view='primary-medium'\n tag='span'\n className={cn(styles.legendValue)}\n >\n {item.properties.name}\n </TypographyText>\n </div>\n </li>\n );\n })}\n </ul>\n );\n },\n);\n"],"names":["CircleLineIcon","FilledCircleIcon","StrokeCircleIcon","CircleIcon","React","cn","styles","TypographyText"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,IAAM,KAAK,GAAG;AACV,IAAA,UAAU,EAAEA,yBAAc;AAC1B,IAAA,YAAY,EAAEC,6BAAgB;AAC9B,IAAA,YAAY,EAAEC,6BAAgB;AAC9B,IAAA,MAAM,EAAEC,iBAAU;CACrB;AAEY,IAAA,OAAO,GAAGC,sBAAK,CAAC,UAAU,CACnC,UAAC,EAA2C,EAAE,GAAG,EAAA;AAA9C,IAAA,IAAA,MAAM,GAAA,EAAA,CAAA,MAAA,EAAE,MAAM,GAAA,EAAA,CAAA,MAAA,EAAE,EAAE,GAAA,EAAA,CAAA,EAAA,EA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AA,EAAK,SAAS,EAAEC,mBAAE,CAACC,uBAAM,CAAC,aAAa,CAAC,EAAA;AACnC,gBAAA,IAAI,IACDF,sBAAG,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,SAAS,EAAEC,mBAAE,CAACC,uBAAM,CAAC,UAAU,CAAC,EAAA;oBAC/BF,sBAAC,CAAA,aAAA,CAAA,IAAI,EACD,EAAA,IAAI,EACA,CAAA,MAAA,IAAI,CAAC,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI;AACrB,6BAAA,CAAA,EAAA,GAAA,IAAI,CAAC,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,CAAA;AACvB,4BAAA,EAAE,EAEN,MAAM,EAAE,MAAM,CAAC,UAAU,IAAI,EAAE,EAAA,CACjC,CACF,IACJ,IAAI;AACR,gBAAAA,sBAAA,CAAA,aAAA,CAACG,mBAAc,EAAA,EACX,IAAI,EAAC,gBAAgB,EACrB,GAAG,EAAC,MAAM,EACV,SAAS,EAAEF,mBAAE,CAACC,uBAAM,CAAC,WAAW,CAAC,EAEhC,EAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CACR,CACf,CACL;KAEZ,CAAC,CACD;AAEb,CAAC;;;;"}
|
|
@@ -2,25 +2,32 @@
|
|
|
2
2
|
--gap-2xl: 32px;
|
|
3
3
|
--gap-0: 0px;
|
|
4
4
|
--gap-32: var(--gap-2xl);
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
|
+
.legendContent {
|
|
6
7
|
display: flex;
|
|
7
8
|
align-items: center;
|
|
8
9
|
flex-wrap: wrap;
|
|
9
|
-
}
|
|
10
|
+
}
|
|
11
|
+
.legendWrap {
|
|
10
12
|
width: 100%;
|
|
11
13
|
margin: var(--gap-0);
|
|
12
14
|
padding: var(--gap-0);
|
|
13
|
-
}
|
|
15
|
+
}
|
|
16
|
+
.legendItem {
|
|
14
17
|
margin-right: var(--gap-32);
|
|
15
18
|
cursor: pointer;
|
|
16
19
|
display: inline-block;
|
|
17
|
-
}
|
|
20
|
+
}
|
|
21
|
+
.legendItem:last-child {
|
|
18
22
|
margin-right: var(--gap-0);
|
|
19
|
-
}
|
|
23
|
+
}
|
|
24
|
+
.legendUnactive {
|
|
20
25
|
opacity: 0.3;
|
|
21
|
-
}
|
|
26
|
+
}
|
|
27
|
+
.legendIcon {
|
|
22
28
|
margin-right: 13px;
|
|
23
29
|
display: flex;
|
|
24
|
-
}
|
|
30
|
+
}
|
|
31
|
+
.legendValue {
|
|
25
32
|
text-transform: capitalize;
|
|
26
33
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--color-dark-base-bg-primary: #121213;
|
|
3
3
|
--color-light-text-primary: rgba(3, 3, 6, 0.88);
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
6
|
+
--font-family-system:
|
|
7
|
+
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
|
|
8
|
+
}
|
|
9
|
+
.tickText {
|
|
5
10
|
fill: var(--color-light-text-primary);
|
|
6
11
|
font-size: 16px;
|
|
7
12
|
line-height: 24px;
|
|
8
13
|
font-weight: 400;
|
|
9
|
-
|
|
14
|
+
font-family: var(--font-family-system);
|
|
15
|
+
}
|
|
16
|
+
.circle {
|
|
10
17
|
opacity: 0.3;
|
|
11
18
|
fill: var(--color-dark-base-bg-primary);
|
|
12
19
|
}
|
|
@@ -31,16 +31,16 @@ var TooltipContent = React.forwardRef(function (_a, ref) {
|
|
|
31
31
|
_c)) })),
|
|
32
32
|
React__default.default.createElement("ul", { className: cn__default.default(styles__default.default.tooltipList) },
|
|
33
33
|
React__default.default.createElement("li", { className: cn__default.default(styles__default.default.tooltipItem), style: labelStyle },
|
|
34
|
-
React__default.default.createElement(cssm.
|
|
34
|
+
React__default.default.createElement(cssm.TypographyText, { view: 'primary-medium', tag: 'span', weight: 'medium', className: cn__default.default(styles__default.default.tooltipLabel) }, labelFormatter ? labelFormatter(label) : label)),
|
|
35
35
|
payload.map(function (entry) {
|
|
36
36
|
var data = series.find(function (d) { return d.properties.dataKey === entry.dataKey; });
|
|
37
37
|
if ((data === null || data === void 0 ? void 0 : data.hideTooltip) || (data === null || data === void 0 ? void 0 : data.hide))
|
|
38
38
|
return null;
|
|
39
39
|
return (React__default.default.createElement("li", { className: cn__default.default(styles__default.default.tooltipItem), key: entry.dataKey, style: { color: entry.color } },
|
|
40
|
-
React__default.default.createElement(cssm.
|
|
40
|
+
React__default.default.createElement(cssm.TypographyText, { view: 'primary-medium', tag: 'span', weight: 'medium', className: cn__default.default(styles__default.default.tooltipValue) },
|
|
41
41
|
(entry === null || entry === void 0 ? void 0 : entry.formatter) ? entry.formatter(entry.value) : entry.value,
|
|
42
42
|
separator || ' '),
|
|
43
|
-
React__default.default.createElement(cssm.
|
|
43
|
+
React__default.default.createElement(cssm.TypographyText, { view: 'secondary-large', tag: 'span', className: cn__default.default(styles__default.default.tooltipName) }, "".concat(entry.name))));
|
|
44
44
|
}))));
|
|
45
45
|
});
|
|
46
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/TooltipContent/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport cn from 'classnames';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/TooltipContent/index.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport cn from 'classnames';\n\nimport { TypographyText } from '@alfalab/core-components-typography';\n\nimport { type PayloadProps } from '../../types/payload.types';\nimport { type SeriaProps } from '../../types/seria.types';\nimport { type TooltipProps } from '../../types/tooltip.types';\n\nimport styles from './index.module.css';\n\nexport interface TooltipContentProps extends TooltipProps {\n payload: PayloadProps[];\n series: SeriaProps[];\n}\n\nexport const TooltipContent = forwardRef<HTMLDivElement, TooltipContentProps>(\n (\n {\n payload,\n separator,\n label,\n tooltipArrowSide,\n arrow,\n series,\n labelFormatter,\n labelStyle,\n contentFormatter,\n },\n ref,\n ) => {\n if (!label || payload.length === 0) return null;\n\n if (typeof contentFormatter === 'function') {\n return (\n <div className={cn(styles.tooltip)} ref={ref}>\n {arrow && (\n <span\n className={cn(styles.tooltipArrow, {\n [styles.tooltipArrowRight]: !tooltipArrowSide,\n })}\n />\n )}\n {contentFormatter?.({ label, payload })}\n </div>\n );\n }\n\n return (\n <div className={cn(styles.tooltip)} ref={ref}>\n {arrow && (\n <span\n className={cn(styles.tooltipArrow, {\n [styles.tooltipArrowRight]: !tooltipArrowSide,\n })}\n />\n )}\n <ul className={cn(styles.tooltipList)}>\n <li className={cn(styles.tooltipItem)} style={labelStyle}>\n <TypographyText\n view='primary-medium'\n tag='span'\n weight='medium'\n className={cn(styles.tooltipLabel)}\n >\n {labelFormatter ? labelFormatter(label) : label}\n </TypographyText>\n </li>\n {payload.map((entry: PayloadProps) => {\n const data: SeriaProps | undefined = series.find(\n (d: SeriaProps) => d.properties.dataKey === entry.dataKey,\n );\n\n if (data?.hideTooltip || data?.hide) return null;\n\n return (\n <li\n className={cn(styles.tooltipItem)}\n key={entry.dataKey}\n style={{ color: entry.color }}\n >\n <TypographyText\n view='primary-medium'\n tag='span'\n weight='medium'\n className={cn(styles.tooltipValue)}\n >\n {entry?.formatter ? entry.formatter(entry.value) : entry.value}\n {separator || ' '}\n </TypographyText>\n <TypographyText\n view='secondary-large'\n tag='span'\n className={cn(styles.tooltipName)}\n >{`${entry.name}`}</TypographyText>\n </li>\n );\n })}\n </ul>\n </div>\n );\n },\n);\n"],"names":["forwardRef","React","cn","styles","TypographyText"],"mappings":";;;;;;;;;;;;;;;IAgBa,cAAc,GAAGA,gBAAU,CACpC,UACI,EAUC,EACD,GAAG,EAAA;;QAVC,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,KAAK,GAAA,EAAA,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,mBAAc,IACX,IAAI,EAAC,gBAAgB,EACrB,GAAG,EAAC,MAAM,EACV,MAAM,EAAC,QAAQ,EACf,SAAS,EAAEF,mBAAE,CAACC,uBAAM,CAAC,YAAY,CAAC,EAAA;wBAEjC,CAAA,KAAK,aAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,SAAS,IAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK;wBAC7D,SAAS,IAAI,GAAG,CACJ;oBACjBF,sBAAC,CAAA,aAAA,CAAAG,mBAAc,EACX,EAAA,IAAI,EAAC,iBAAiB,EACtB,GAAG,EAAC,MAAM,EACV,SAAS,EAAEF,mBAAE,CAACC,uBAAM,CAAC,WAAW,CAAC,EAAA,EACnC,EAAG,CAAA,MAAA,CAAA,KAAK,CAAC,IAAI,CAAE,CAAkB,CAClC;AAEb,aAAC,CAAC,CACD,CACH;AAEd,CAAC;;;;"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--color-light-base-bg-primary: #fff;
|
|
3
3
|
--color-light-neutral-400: #d2d3d9;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
5
6
|
--shadow-l:
|
|
6
7
|
0 24px 32px rgba(0, 0, 0, 0.08), 0 20px 24px rgba(0, 0, 0, 0.08),
|
|
7
8
|
0 12px 16px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.04);
|
|
8
|
-
}
|
|
9
|
+
}
|
|
10
|
+
:root {
|
|
9
11
|
--border-radius-m: 8px;
|
|
10
12
|
--border-radius-8: var(--border-radius-m);
|
|
11
|
-
}
|
|
13
|
+
}
|
|
14
|
+
:root {
|
|
12
15
|
--gap-s: 12px;
|
|
13
16
|
--gap-m: 16px;
|
|
14
17
|
--gap-3xs-neg: -2px;
|
|
@@ -17,7 +20,8 @@
|
|
|
17
20
|
--gap-12: var(--gap-s);
|
|
18
21
|
--gap-16: var(--gap-m);
|
|
19
22
|
--gap-2-neg: var(--gap-3xs-neg);
|
|
20
|
-
}
|
|
23
|
+
}
|
|
24
|
+
.tooltip {
|
|
21
25
|
background-color: var(--color-light-base-bg-primary);
|
|
22
26
|
border: 1px solid var(--color-light-neutral-400);
|
|
23
27
|
box-shadow: var(--shadow-l);
|
|
@@ -25,15 +29,18 @@
|
|
|
25
29
|
padding: var(--gap-12) var(--gap-16);
|
|
26
30
|
pointer-events: none;
|
|
27
31
|
position: relative;
|
|
28
|
-
}
|
|
32
|
+
}
|
|
33
|
+
.tooltipList {
|
|
29
34
|
position: relative;
|
|
30
35
|
z-index: 5;
|
|
31
36
|
list-style-type: none;
|
|
32
37
|
padding: var(--gap-0);
|
|
33
38
|
margin: var(--gap-0);
|
|
34
|
-
}
|
|
39
|
+
}
|
|
40
|
+
.tooltipItem {
|
|
35
41
|
margin-bottom: var(--gap-10);
|
|
36
|
-
}
|
|
42
|
+
}
|
|
43
|
+
.tooltipArrow {
|
|
37
44
|
position: absolute;
|
|
38
45
|
left: var(--gap-0);
|
|
39
46
|
top: 50%;
|
|
@@ -42,7 +49,8 @@
|
|
|
42
49
|
height: 10px;
|
|
43
50
|
border: 1px solid var(--color-light-neutral-400);
|
|
44
51
|
background-color: var(--color-light-base-bg-primary);
|
|
45
|
-
}
|
|
52
|
+
}
|
|
53
|
+
.tooltipArrow:before {
|
|
46
54
|
content: '';
|
|
47
55
|
position: absolute;
|
|
48
56
|
left: var(--gap-2-neg);
|
|
@@ -52,7 +60,8 @@
|
|
|
52
60
|
border-style: solid;
|
|
53
61
|
border-width: 0 14px 14px 0;
|
|
54
62
|
border-color: transparent var(--color-light-base-bg-primary) transparent transparent;
|
|
55
|
-
}
|
|
63
|
+
}
|
|
64
|
+
.tooltipArrowRight {
|
|
56
65
|
left: 100%;
|
|
57
66
|
transform: translate(-50%, -50%) scale(-1, 1) rotate(45deg);
|
|
58
67
|
}
|
package/cssm/hoc/Customized.js
CHANGED
|
@@ -9,10 +9,10 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
|
|
10
10
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
11
11
|
|
|
12
|
-
var CustomizedHOC = function (Component, options) {
|
|
13
|
-
var
|
|
14
|
-
return
|
|
15
|
-
};
|
|
12
|
+
var CustomizedHOC = function (Component, options) { return function (props) {
|
|
13
|
+
var key = props.key, ref = props.ref, rest = tslib.__rest(props, ["key", "ref"]);
|
|
14
|
+
return React__default.default.createElement(Component, tslib.__assign({ key: key, ref: ref }, rest, options));
|
|
15
|
+
}; };
|
|
16
16
|
|
|
17
17
|
exports.CustomizedHOC = CustomizedHOC;
|
|
18
18
|
//# sourceMappingURL=Customized.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Customized.js","sources":["../../src/hoc/Customized.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\n\nexport const CustomizedHOC = (Component: any, options: any) => {\n const
|
|
1
|
+
{"version":3,"file":"Customized.js","sources":["../../src/hoc/Customized.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\n\nexport const CustomizedHOC = (Component: any, options: any) => (props: any) => {\n const { key, ref, ...rest } = props;\n\n return <Component key={key} ref={ref} {...rest} {...options} />;\n};\n"],"names":["__rest","React","__assign"],"mappings":";;;;;;;;;;;AAGa,IAAA,aAAa,GAAG,UAAC,SAAc,EAAE,OAAY,EAAA,EAAK,OAAA,UAAC,KAAU,EAAA;AAC9D,IAAA,IAAA,GAAG,GAAmB,KAAK,CAAxB,GAAA,EAAE,GAAG,GAAc,KAAK,CAAnB,GAAA,EAAK,IAAI,GAAKA,YAAA,CAAA,KAAK,EAA7B,CAAA,KAAA,EAAA,KAAA,CAAqB,CAAF;AAEzB,IAAA,OAAOC,sBAAC,CAAA,aAAA,CAAA,SAAS,EAACC,cAAA,CAAA,EAAA,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAM,EAAA,IAAI,EAAM,OAAO,EAAI;AACnE,CAAC,CAAA;;;;"}
|
package/cssm/index.module.css
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--color-light-text-primary: rgba(3, 3, 6, 0.88);
|
|
3
|
-
}
|
|
3
|
+
}
|
|
4
|
+
:root {
|
|
5
|
+
--font-family-system:
|
|
6
|
+
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
|
|
7
|
+
}
|
|
8
|
+
.coreChart :global(.recharts-line path) {
|
|
4
9
|
transition: d 0.2s ease-out;
|
|
5
|
-
}
|
|
10
|
+
}
|
|
11
|
+
.coreChart :global(.recharts-text tspan) {
|
|
6
12
|
fill: var(--color-light-text-primary);
|
|
13
|
+
|
|
7
14
|
font-size: 16px;
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
|
|
16
|
+
line-height: 20px;
|
|
17
|
+
|
|
18
|
+
font-weight: 400;
|
|
19
|
+
|
|
20
|
+
font-family: var(--font-family-system);
|
|
21
|
+
}
|
|
22
|
+
.bar {
|
|
10
23
|
transition:
|
|
11
24
|
opacity 0.2s ease-out,
|
|
12
25
|
d 0.2s ease-out;
|
|
13
|
-
}
|
|
26
|
+
}
|
|
27
|
+
.unfocused {
|
|
14
28
|
opacity: 0.3;
|
|
15
29
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
.
|
|
1
|
+
.chart__dotUnfocused_y0dx1 {
|
|
2
2
|
opacity: 0.3;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.
|
|
6
|
-
.
|
|
7
|
-
.
|
|
5
|
+
.chart__dot_y0dx1,
|
|
6
|
+
.chart__dotItem_y0dx1,
|
|
7
|
+
.chart__dotWrap_y0dx1 {
|
|
8
8
|
transition: all 0.2s ease;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.
|
|
12
|
-
animation:
|
|
11
|
+
.chart__dot_y0dx1 {
|
|
12
|
+
animation: chart__showDot_y0dx1 0.5s ease;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
@keyframes
|
|
15
|
+
@keyframes chart__showDot_y0dx1 {
|
|
16
16
|
from {
|
|
17
17
|
opacity: 0;
|
|
18
18
|
}
|